@nice2dev/erp-adapter 1.4.13 → 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/CHANGELOG.md +36 -0
- package/dist/omniverk/index.d.ts +1 -1
- package/dist/omniverk/preset.d.ts +25 -1
- package/dist/omniverk.cjs +2 -2
- package/dist/omniverk.mjs +969 -891
- package/package.json +3 -3
package/dist/omniverk.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { objectFileKind as
|
|
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)),
|
|
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
|
|
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(([,
|
|
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
|
|
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(([
|
|
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
|
|
39
|
-
const e =
|
|
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) =>
|
|
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) =>
|
|
53
|
+
i.map((n) => Oe(n, ot)),
|
|
54
54
|
t,
|
|
55
55
|
o
|
|
56
56
|
)
|
|
57
57
|
};
|
|
58
|
-
})(),
|
|
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
|
|
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
|
|
101
|
-
const t = (e.rows ?? []).flatMap((
|
|
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((
|
|
107
|
-
const N = n.find((
|
|
106
|
+
columns: o.map((m) => {
|
|
107
|
+
const N = n.find((O) => O.field === m.field);
|
|
108
108
|
if (!N)
|
|
109
|
-
return { field:
|
|
110
|
-
const L =
|
|
111
|
-
return N[L] === void 0 && 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
|
|
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,
|
|
128
|
+
}), (o.sections ?? []).forEach((s, r) => {
|
|
129
129
|
i.push({
|
|
130
|
-
id: `tab-${n}-section-${
|
|
130
|
+
id: `tab-${n}-section-${r}`,
|
|
131
131
|
cells: [
|
|
132
132
|
{
|
|
133
|
-
id: `tab-${n}-section-${
|
|
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
|
|
144
|
+
let a = [], u = 0;
|
|
145
145
|
const p = () => {
|
|
146
|
-
|
|
146
|
+
a.length && (i.push({ id: `tab-${n}-section-${r}-row-${i.length}`, cells: a }), a = [], u = 0);
|
|
147
147
|
};
|
|
148
|
-
(s.controls ?? []).forEach((
|
|
149
|
-
const L = typeof
|
|
150
|
-
|
|
151
|
-
id: `c-${n}-${
|
|
152
|
-
controlType:
|
|
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(
|
|
156
|
-
required:
|
|
157
|
-
field:
|
|
158
|
-
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(
|
|
161
|
-
}),
|
|
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,
|
|
175
|
+
var p, m, N, L, I;
|
|
176
176
|
const t = i.tabs ?? [], o = t.flatMap(
|
|
177
|
-
(
|
|
177
|
+
(O) => (O.sections ?? []).flatMap((x) => x.controls ?? [])
|
|
178
178
|
), n = [];
|
|
179
|
-
let s = null,
|
|
180
|
-
const
|
|
181
|
-
for (const
|
|
182
|
-
for (const
|
|
183
|
-
const w =
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
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 ===
|
|
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((
|
|
191
|
-
|
|
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
|
|
196
|
-
if (!
|
|
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
|
|
199
|
-
...
|
|
200
|
-
field:
|
|
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) :
|
|
203
|
-
colSpan: (
|
|
204
|
-
required: w.required === !0 ? !0 : (
|
|
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
|
-
|
|
206
|
+
a().controls.push(g);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
return
|
|
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((
|
|
216
|
-
tabs:
|
|
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
|
|
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
|
|
224
|
-
const t = U(e) ? e : {}, o = J(t.name) ?? J(t.id) ?? `#${i}`, n = J(t.displayName) ?? o, s =
|
|
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
|
|
233
|
-
return Ve(
|
|
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
|
|
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
|
|
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:
|
|
259
|
-
fromItem:
|
|
258
|
+
toItem: pt,
|
|
259
|
+
fromItem: ut
|
|
260
260
|
});
|
|
261
|
-
function
|
|
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((
|
|
290
|
+
const s = t.find((a) => a.state === n.id), r = s ?? { state: n.id };
|
|
291
291
|
return W({
|
|
292
|
-
...
|
|
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),
|
|
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
|
-
...
|
|
301
|
+
...r ?? {},
|
|
302
302
|
fromState: n.fromStateId,
|
|
303
303
|
toState: n.toStateId,
|
|
304
|
-
actionName: n.name || (
|
|
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
|
|
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((
|
|
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
|
|
315
|
-
return Ve(Je(
|
|
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
|
|
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
|
|
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:
|
|
336
|
-
fromItem:
|
|
335
|
+
toItem: yt,
|
|
336
|
+
fromItem: gt
|
|
337
337
|
});
|
|
338
|
-
function
|
|
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
|
|
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
|
|
364
|
-
return W({ ...
|
|
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
|
|
367
|
+
const r = n.find((a) => a.name === s.id);
|
|
368
368
|
return W({
|
|
369
|
-
...
|
|
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
|
|
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:
|
|
385
|
-
assign:
|
|
384
|
+
select: wt,
|
|
385
|
+
assign: vt,
|
|
386
386
|
arrayKey: (e) => e === "/permissions" ? "code" : e === "/permissionGroups" ? "name" : void 0
|
|
387
|
-
}),
|
|
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
|
-
}),
|
|
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:
|
|
411
|
+
files: [{ path: i[0].path, text: tt(e, i[0].text) }]
|
|
412
412
|
})
|
|
413
|
-
},
|
|
413
|
+
}, St = et({
|
|
414
414
|
match: _(".scripts.json"),
|
|
415
415
|
property: "scripts",
|
|
416
416
|
phasesProperty: "scripts"
|
|
417
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
|
|
453
|
-
|
|
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
|
-
},
|
|
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
|
-
],
|
|
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
|
|
507
|
-
return [...e.normalize("NFD")].map((i) =>
|
|
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
|
|
510
|
-
const i =
|
|
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
|
|
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
|
|
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" :
|
|
549
|
+
return e.isForeignKey ? "Guid" : It[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
|
|
550
550
|
}
|
|
551
|
-
function
|
|
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
|
|
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
|
|
583
|
+
function Dt(e) {
|
|
584
584
|
var o;
|
|
585
585
|
const i = [];
|
|
586
|
-
(!((o = e.name) != null && o.trim()) ||
|
|
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 =
|
|
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
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
for (const
|
|
599
|
-
const p =
|
|
600
|
-
p.length === 0 ? i.push(`${s}: field "${
|
|
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
|
|
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
|
|
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
|
|
632
|
-
var b, g,
|
|
633
|
-
const t =
|
|
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 =
|
|
636
|
+
const o = e.name.toLowerCase().startsWith(G.toLowerCase()), n = F(
|
|
637
637
|
o ? e.name.slice(G.length) : e.name
|
|
638
|
-
), s =
|
|
638
|
+
), s = Lt(
|
|
639
639
|
G + n,
|
|
640
640
|
i.existingPackageNames ?? /* @__PURE__ */ new Set()
|
|
641
|
-
),
|
|
642
|
-
`${
|
|
643
|
-
...L ? [`${
|
|
644
|
-
...I ? [`${
|
|
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: `${
|
|
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:
|
|
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:
|
|
657
|
-
exportedAt:
|
|
656
|
+
icon: x,
|
|
657
|
+
exportedAt: Kt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
|
|
658
658
|
modules: [
|
|
659
659
|
{
|
|
660
|
-
name:
|
|
660
|
+
name: xe,
|
|
661
661
|
displayName: p,
|
|
662
662
|
description: e.description ?? p,
|
|
663
|
-
icon:
|
|
664
|
-
parts:
|
|
663
|
+
icon: x,
|
|
664
|
+
parts: E
|
|
665
665
|
}
|
|
666
666
|
],
|
|
667
667
|
dependencies: ["Core.Users"],
|
|
668
|
-
i18n:
|
|
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
|
|
673
|
+
const f = [];
|
|
674
674
|
for (const h of N) {
|
|
675
|
-
const
|
|
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),
|
|
678
|
-
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" && (
|
|
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
|
-
|
|
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(
|
|
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:
|
|
693
|
+
fields: k
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
if (w.push({
|
|
697
|
-
path: `${
|
|
698
|
-
text: ee({ moduleName:
|
|
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 ===
|
|
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
|
|
705
|
-
},
|
|
704
|
+
return l ? F(l.name) : "Name";
|
|
705
|
+
}, k = [];
|
|
706
706
|
for (const d of N) {
|
|
707
|
-
const j = d.fields.filter((
|
|
708
|
-
field:
|
|
709
|
-
displayName: q(
|
|
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:
|
|
712
|
-
...
|
|
713
|
-
})), v = j.filter((
|
|
714
|
-
field:
|
|
715
|
-
type:
|
|
716
|
-
label: q(
|
|
717
|
-
...
|
|
718
|
-
...
|
|
719
|
-
entity:
|
|
720
|
-
displayField: h(
|
|
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
|
-
|
|
724
|
-
id: `vw-${
|
|
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((
|
|
738
|
-
const
|
|
737
|
+
const A = j.map((y) => {
|
|
738
|
+
const S = ge(y)[1];
|
|
739
739
|
return {
|
|
740
|
-
field:
|
|
741
|
-
type:
|
|
742
|
-
label: q(
|
|
743
|
-
colSpan:
|
|
744
|
-
...
|
|
745
|
-
...
|
|
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
|
-
|
|
749
|
-
id: `vw-${
|
|
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: `${
|
|
766
|
-
text: ee({ moduleName:
|
|
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) => `${
|
|
770
|
+
const h = (j) => `${r}.${j}`, k = (j, l) => ({
|
|
771
771
|
code: h(j),
|
|
772
|
-
name: `${p} — ${
|
|
773
|
-
description: `${
|
|
774
|
-
}), d = (j,
|
|
775
|
-
name: `${G}${
|
|
776
|
-
description: `${p} — ${
|
|
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: `${
|
|
780
|
+
path: `${a}.permissions.json`,
|
|
781
781
|
text: ee({
|
|
782
|
-
moduleName:
|
|
782
|
+
moduleName: u,
|
|
783
783
|
version: "1.0.0",
|
|
784
784
|
permissions: [
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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
|
|
800
|
-
const
|
|
799
|
+
for (const h of O) {
|
|
800
|
+
const k = {
|
|
801
801
|
"module.displayName": p,
|
|
802
|
-
"module.description":
|
|
802
|
+
"module.description": m ?? p
|
|
803
803
|
};
|
|
804
804
|
for (const d of N) {
|
|
805
|
-
|
|
806
|
-
for (const j of d.fields.filter((
|
|
807
|
-
|
|
808
|
-
L && (
|
|
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: `${
|
|
812
|
-
text: ee({ moduleName: s, locale: h, version: "1.0.0", translations:
|
|
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: `${
|
|
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
|
|
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
|
|
850
|
-
return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) =>
|
|
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
|
|
853
|
-
async function
|
|
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),
|
|
860
|
-
for (const w of e.filter((
|
|
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
|
|
863
|
-
for (const
|
|
864
|
-
const b = typeof
|
|
865
|
-
b.startsWith(`${p}.`) && I.set(b, `${
|
|
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
|
|
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
|
|
873
|
+
const E = N(w.path);
|
|
874
874
|
if (!w.path.toLowerCase().endsWith(".json")) {
|
|
875
|
-
|
|
875
|
+
x.push({ path: E, text: w.text });
|
|
876
876
|
continue;
|
|
877
877
|
}
|
|
878
|
-
let
|
|
878
|
+
let f;
|
|
879
879
|
try {
|
|
880
|
-
|
|
880
|
+
f = z(w.text).value;
|
|
881
881
|
} catch {
|
|
882
|
-
|
|
882
|
+
x.push({ path: E, text: w.text });
|
|
883
883
|
continue;
|
|
884
884
|
}
|
|
885
|
-
let b =
|
|
885
|
+
let b = Ne(f, O);
|
|
886
886
|
if (w === t && Y(b)) {
|
|
887
|
-
const { sourceDefinitionId: g, ...
|
|
887
|
+
const { sourceDefinitionId: g, ...T } = b;
|
|
888
888
|
b = {
|
|
889
|
-
...
|
|
890
|
-
packageName:
|
|
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
|
|
898
|
-
if (!Y(
|
|
899
|
-
g.push(
|
|
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
|
-
...
|
|
904
|
-
...typeof
|
|
905
|
-
...typeof
|
|
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
|
-
}),
|
|
913
|
+
}), x.push({ path: E, text: qe(w.text, b) });
|
|
914
914
|
}
|
|
915
915
|
return {
|
|
916
|
-
id:
|
|
916
|
+
id: r,
|
|
917
917
|
packageId: i.packageId ?? o.category,
|
|
918
|
-
files:
|
|
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
|
|
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
|
|
928
|
-
!
|
|
929
|
-
key:
|
|
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
|
|
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
|
|
946
|
-
return s.defaultValue !== void 0 ?
|
|
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
|
|
950
|
+
const Wt = {
|
|
951
951
|
Anonymous: "none",
|
|
952
952
|
User: "session",
|
|
953
953
|
Admin: "session"
|
|
954
954
|
};
|
|
955
|
-
function
|
|
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
|
|
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
|
|
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: `${
|
|
967
|
-
method:
|
|
968
|
-
path:
|
|
966
|
+
key: `${r} ${a}`,
|
|
967
|
+
method: r,
|
|
968
|
+
path: a,
|
|
969
969
|
handler: V(s.handler),
|
|
970
|
-
auth:
|
|
970
|
+
auth: u ? Wt[u] ?? "session" : void 0
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
return t;
|
|
975
975
|
}
|
|
976
|
-
function
|
|
977
|
-
const t =
|
|
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((
|
|
980
|
-
notExposed: t.filter((
|
|
979
|
+
missingInControllers: o.filter((a) => !s.has(n(a))),
|
|
980
|
+
notExposed: t.filter((a) => !r.has(n(a)))
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
|
-
function
|
|
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 } =
|
|
987
|
+
})), { missingInControllers: n } = _t(e, i);
|
|
988
988
|
for (const s of n) {
|
|
989
|
-
const
|
|
990
|
-
let
|
|
991
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
1036
|
-
var t, o, n, s,
|
|
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
|
|
1047
|
-
var
|
|
1048
|
-
return (
|
|
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 (
|
|
1050
|
+
if (E.protocol === "soap") {
|
|
1051
1051
|
i.SOAPConnection.push({
|
|
1052
|
-
Id:
|
|
1052
|
+
Id: f,
|
|
1053
1053
|
Name: w.name,
|
|
1054
|
-
WsdlUrl:
|
|
1055
|
-
EndpointUrl:
|
|
1054
|
+
WsdlUrl: E.baseUrl,
|
|
1055
|
+
EndpointUrl: E.baseUrl,
|
|
1056
1056
|
SoapVersion: ((o = (t = g.find((h) => {
|
|
1057
|
-
var
|
|
1058
|
-
return (
|
|
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:
|
|
1061
|
-
AuthConfigJson:
|
|
1062
|
-
TimeoutSeconds:
|
|
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,
|
|
1066
|
-
const d =
|
|
1065
|
+
for (const [h, k] of g.entries()) {
|
|
1066
|
+
const d = T(k.id);
|
|
1067
1067
|
i.SOAPSavedCall.push({
|
|
1068
|
-
Id: await b(
|
|
1069
|
-
ConnectionId:
|
|
1070
|
-
Name:
|
|
1071
|
-
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:
|
|
1074
|
-
SoapAction: (n =
|
|
1075
|
-
InputTemplateXml: (s =
|
|
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 (
|
|
1086
|
+
if (E.protocol === "graphql") {
|
|
1087
1087
|
i.GraphQLEndpoint.push({
|
|
1088
|
-
Id:
|
|
1088
|
+
Id: f,
|
|
1089
1089
|
Name: w.name,
|
|
1090
|
-
EndpointUrl:
|
|
1091
|
-
AuthType:
|
|
1092
|
-
CustomHeaders: (
|
|
1093
|
-
TimeoutSeconds:
|
|
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,
|
|
1097
|
-
const d =
|
|
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(
|
|
1100
|
-
GraphQLEndpointId:
|
|
1101
|
-
Name:
|
|
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: (
|
|
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 (!(
|
|
1113
|
+
if (!(E.protocol !== "rest" && E.protocol !== "odata" && E.protocol !== "webhook")) {
|
|
1114
1114
|
i.RESTConnection.push({
|
|
1115
|
-
Id:
|
|
1115
|
+
Id: f,
|
|
1116
1116
|
Name: w.name,
|
|
1117
|
-
BaseUrl:
|
|
1118
|
-
AuthType:
|
|
1119
|
-
AuthConfigJson:
|
|
1120
|
-
DefaultHeadersJson: (p =
|
|
1121
|
-
PaginationType: ((
|
|
1122
|
-
PaginationConfigJson:
|
|
1123
|
-
RateLimitMaxRequests:
|
|
1124
|
-
RateLimitWindowSeconds:
|
|
1125
|
-
TimeoutSeconds:
|
|
1126
|
-
RetryCount: (N =
|
|
1127
|
-
RetryBackoffMs: (L =
|
|
1128
|
-
WebhookPath: (
|
|
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,
|
|
1132
|
-
const d =
|
|
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(
|
|
1135
|
-
ConnectionId:
|
|
1136
|
-
Name:
|
|
1137
|
-
Description:
|
|
1138
|
-
HttpMethod: (
|
|
1139
|
-
PathTemplate:
|
|
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:
|
|
1142
|
-
BodyTemplate: (
|
|
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((
|
|
1157
|
-
w[
|
|
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
|
|
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
|
|
1167
|
-
const t = (s,
|
|
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),
|
|
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) =>
|
|
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
|
-
]),
|
|
1563
|
-
function
|
|
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,
|
|
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
|
|
1587
|
-
var
|
|
1586
|
+
function ii(e, i = {}) {
|
|
1587
|
+
var E;
|
|
1588
1588
|
const t = new Set(
|
|
1589
|
-
[...i.legacyListViewFiles ??
|
|
1590
|
-
(
|
|
1589
|
+
[...i.legacyListViewFiles ?? ti].map(
|
|
1590
|
+
(f) => f.toLowerCase()
|
|
1591
1591
|
)
|
|
1592
|
-
), o = [], n = (
|
|
1593
|
-
o.push({ severity: "error", ...
|
|
1592
|
+
), o = [], n = (f) => {
|
|
1593
|
+
o.push({ severity: "error", ...f });
|
|
1594
1594
|
}, s = [];
|
|
1595
|
-
for (const
|
|
1596
|
-
if (!(!re(
|
|
1595
|
+
for (const f of e.files)
|
|
1596
|
+
if (!(!re(f.path, ".json") || f.path.startsWith(".revisions/")))
|
|
1597
1597
|
try {
|
|
1598
|
-
s.push({ file:
|
|
1598
|
+
s.push({ file: f, value: z(f.text).value });
|
|
1599
1599
|
} catch (b) {
|
|
1600
1600
|
n({
|
|
1601
1601
|
code: "json.invalid",
|
|
1602
|
-
message: `${
|
|
1602
|
+
message: `${f.path} is not valid JSON: ${b instanceof Error ? b.message : String(b)}`,
|
|
1603
1603
|
messageKey: "devStudio.issue.jsonInvalid",
|
|
1604
|
-
params: { path:
|
|
1605
|
-
path:
|
|
1604
|
+
params: { path: f.path, error: b instanceof Error ? b.message : String(b) },
|
|
1605
|
+
path: f.path
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
|
-
const
|
|
1609
|
-
|
|
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:
|
|
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:
|
|
1621
|
+
path: f.path,
|
|
1622
1622
|
pointer: `/${g}`
|
|
1623
1623
|
});
|
|
1624
|
-
const
|
|
1625
|
-
|
|
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:
|
|
1632
|
-
const g = K(b) ? b.module : void 0,
|
|
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(
|
|
1635
|
-
...K(
|
|
1636
|
-
...K(
|
|
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:
|
|
1647
|
+
path: f.path,
|
|
1648
1648
|
pointer: `/${h.split(".").join("/")}`
|
|
1649
1649
|
});
|
|
1650
1650
|
}
|
|
1651
|
-
const p = [],
|
|
1652
|
-
for (const { file:
|
|
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 = [],
|
|
1656
|
-
if (!Array.isArray(
|
|
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:
|
|
1661
|
+
path: f.path,
|
|
1662
1662
|
pointer: "/entities"
|
|
1663
1663
|
});
|
|
1664
1664
|
continue;
|
|
1665
1665
|
}
|
|
1666
|
-
|
|
1667
|
-
const
|
|
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:
|
|
1674
|
-
pointer:
|
|
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:
|
|
1682
|
-
pointer:
|
|
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:
|
|
1692
|
-
pointer: `${
|
|
1693
|
-
}), C.fields.forEach((j,
|
|
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 = `${
|
|
1697
|
-
d && c && j.isPrimaryKey !== !0 &&
|
|
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` }), $ &&
|
|
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:
|
|
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:
|
|
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:
|
|
1724
|
+
path: f.path,
|
|
1725
1725
|
pointer: g[0].pointer
|
|
1726
1726
|
});
|
|
1727
1727
|
}
|
|
1728
|
-
for (const { file:
|
|
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:
|
|
1733
|
+
path: f.path,
|
|
1734
1734
|
pointer: "/permissions"
|
|
1735
1735
|
});
|
|
1736
1736
|
const N = [];
|
|
1737
|
-
for (const { file:
|
|
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:
|
|
1743
|
+
path: f.path
|
|
1744
1744
|
});
|
|
1745
1745
|
continue;
|
|
1746
1746
|
}
|
|
1747
|
-
ie(b, "views").forEach((g,
|
|
1747
|
+
ie(b, "views").forEach((g, T) => {
|
|
1748
1748
|
if (!K(g))
|
|
1749
1749
|
return;
|
|
1750
|
-
const C = `/views/${
|
|
1751
|
-
typeof g.name == "string" && N.push(g.name), typeof g.type == "string" && g.type.toLowerCase() === "list" && !t.has(
|
|
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:
|
|
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:
|
|
1763
|
+
path: f.path,
|
|
1764
1764
|
pointer: C
|
|
1765
1765
|
}));
|
|
1766
|
-
const
|
|
1766
|
+
const k = [[g, "displayName", C]];
|
|
1767
1767
|
ie(g, "columns").forEach((d, j) => {
|
|
1768
|
-
for (const
|
|
1769
|
-
|
|
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
|
-
|
|
1772
|
-
|
|
1773
|
-
(v, $) =>
|
|
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,
|
|
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:
|
|
1785
|
-
pointer: `${
|
|
1784
|
+
path: f.path,
|
|
1785
|
+
pointer: `${l}/${j}`
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
1788
|
});
|
|
1789
1789
|
}
|
|
1790
|
-
const L = s.filter((
|
|
1791
|
-
for (const
|
|
1792
|
-
const [, b, g] = Le.exec(
|
|
1793
|
-
|
|
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
|
|
1796
|
-
[...I.keys()].map((
|
|
1797
|
-
),
|
|
1798
|
-
for (const [
|
|
1799
|
-
const g = b.get("en"),
|
|
1800
|
-
if (g && !
|
|
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: `${
|
|
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:
|
|
1804
|
+
params: { group: f },
|
|
1805
1805
|
path: g.file.path
|
|
1806
|
-
}),
|
|
1806
|
+
}), T && !g && n({
|
|
1807
1807
|
code: "i18n.englishMissing",
|
|
1808
|
-
message: `${
|
|
1808
|
+
message: `${f}.pl.i18n.json needs an .en.i18n.json baseline.`,
|
|
1809
1809
|
messageKey: "devStudio.issue.englishBundleMissing",
|
|
1810
|
-
params: { group:
|
|
1811
|
-
path:
|
|
1812
|
-
}), g &&
|
|
1813
|
-
const h = C(g),
|
|
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: `${
|
|
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:
|
|
1819
|
+
path: T.file.path,
|
|
1820
1820
|
count: d.length,
|
|
1821
1821
|
keys: d.slice(0, 10).join(", ")
|
|
1822
1822
|
},
|
|
1823
|
-
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,
|
|
1837
|
-
const d = Ae(
|
|
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: `${
|
|
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:
|
|
1844
|
-
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 [
|
|
1847
|
-
|
|
1848
|
-
const v =
|
|
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: `${
|
|
1851
|
+
message: `${k.file.path}: ${l} = "${c}" — the English bundle is the English UI.`,
|
|
1852
1852
|
messageKey: "devStudio.issue.polishInEnglish",
|
|
1853
|
-
params: { path:
|
|
1854
|
-
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 (
|
|
1859
|
+
if (a.length && L.length) {
|
|
1860
1860
|
const b = [
|
|
1861
1861
|
"module.displayName",
|
|
1862
1862
|
...p.map((g) => `entity.${g}.displayName`),
|
|
1863
|
-
...
|
|
1863
|
+
...m.map((g) => `${g}.displayName`),
|
|
1864
1864
|
...N.map((g) => `view.${g}.displayName`)
|
|
1865
1865
|
].filter(
|
|
1866
|
-
(g) => !
|
|
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:
|
|
1875
|
+
for (const { file: f, value: b } of s)
|
|
1876
1876
|
me(
|
|
1877
1877
|
b,
|
|
1878
1878
|
void 0,
|
|
1879
1879
|
"",
|
|
1880
|
-
(g,
|
|
1880
|
+
(g, T, C) => n({
|
|
1881
1881
|
code: "icons.emoji",
|
|
1882
|
-
message: `${
|
|
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:
|
|
1885
|
-
path:
|
|
1884
|
+
params: { key: T, text: C },
|
|
1885
|
+
path: f.path,
|
|
1886
1886
|
pointer: g
|
|
1887
1887
|
})
|
|
1888
1888
|
);
|
|
1889
|
-
const w =
|
|
1890
|
-
if (w.length &&
|
|
1891
|
-
const
|
|
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
|
|
1894
|
-
for (const C of Array.isArray(
|
|
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" &&
|
|
1896
|
+
typeof h == "string" && f.add(h);
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
|
-
const b = (
|
|
1900
|
-
(Array.isArray(b) ? b : []).forEach((g,
|
|
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" && !
|
|
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:
|
|
1909
|
-
pointer: `/dataSources/${
|
|
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
|
|
1923
|
-
if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && 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",
|
|
1925
|
+
me(JSON.parse(s), "optionsJson", r, o);
|
|
1926
1926
|
} catch {
|
|
1927
1927
|
}
|
|
1928
|
-
me(s, n,
|
|
1928
|
+
me(s, n, r, o);
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1931
|
+
function ni(e, i = {}) {
|
|
1932
1932
|
const t = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1933
|
-
for (const
|
|
1934
|
-
for (const
|
|
1935
|
-
if (!
|
|
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
|
|
1937
|
+
let u;
|
|
1938
1938
|
try {
|
|
1939
|
-
|
|
1939
|
+
u = z(a.text).value;
|
|
1940
1940
|
} catch {
|
|
1941
1941
|
continue;
|
|
1942
1942
|
}
|
|
1943
|
-
if (re(
|
|
1944
|
-
const p =
|
|
1945
|
-
o.set(p, [...o.get(p) ?? [],
|
|
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(
|
|
1948
|
-
for (const p of ie(
|
|
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
|
|
1951
|
-
N.includes(
|
|
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 [
|
|
1956
|
-
|
|
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 ${
|
|
1959
|
+
message: `Package name ${r} is declared by ${a.length} modules: ${a.join(", ")}`,
|
|
1960
1960
|
messageKey: "devStudio.issue.duplicatePackage",
|
|
1961
|
-
params: { name:
|
|
1961
|
+
params: { name: r, count: a.length, modules: a.join(", ") }
|
|
1962
1962
|
});
|
|
1963
|
-
const s = new Set([...i.knownDuplicates ?? []].map((
|
|
1964
|
-
for (const [
|
|
1965
|
-
|
|
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 ${
|
|
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:
|
|
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,
|
|
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
|
|
1998
|
-
const t = ne(e) ? e : {}, o = Object.fromEntries(Object.entries(t).filter(([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
|
|
2018
|
+
const Ee = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
|
|
2019
2019
|
function Me(e, i) {
|
|
2020
|
-
var
|
|
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 : (
|
|
2022
|
-
const p = o.find((
|
|
2023
|
-
return
|
|
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:
|
|
2025
|
+
packageName: u.moduleId,
|
|
2026
2026
|
// seed entries spell `required` out, also when it is false
|
|
2027
|
-
required:
|
|
2028
|
-
condition:
|
|
2029
|
-
description:
|
|
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
|
|
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(
|
|
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 =
|
|
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
|
|
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
|
|
2098
|
-
function
|
|
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
|
|
2103
|
-
const i =
|
|
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
|
|
2107
|
-
function
|
|
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
|
|
2110
|
-
const
|
|
2111
|
-
const c = i.find((v) => v.id ===
|
|
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 "${
|
|
2113
|
+
throw new Error(`Unknown workspace "${l}"`);
|
|
2114
2114
|
return c;
|
|
2115
|
-
},
|
|
2116
|
-
const c = l
|
|
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(
|
|
2122
|
-
const v = await
|
|
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
|
|
2125
|
+
return we($) ? $ : {};
|
|
2126
2126
|
} catch {
|
|
2127
2127
|
return {};
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const
|
|
2130
|
+
function m(l, c, v, $, A) {
|
|
2131
|
+
const y = se($.packageName) ?? (c || l.id);
|
|
2132
2132
|
return {
|
|
2133
|
-
workspaceId:
|
|
2134
|
-
id:
|
|
2133
|
+
workspaceId: l.id,
|
|
2134
|
+
id: y,
|
|
2135
2135
|
packageId: se($.category),
|
|
2136
|
-
label: se($.displayName) ??
|
|
2136
|
+
label: se($.displayName) ?? y,
|
|
2137
2137
|
description: se($.description),
|
|
2138
2138
|
version: se($.version),
|
|
2139
2139
|
location: c,
|
|
2140
|
-
readOnly:
|
|
2140
|
+
readOnly: l.readOnly,
|
|
2141
2141
|
files: A,
|
|
2142
2142
|
search: `${c} ${v}`
|
|
2143
2143
|
};
|
|
2144
2144
|
}
|
|
2145
|
-
async function N(
|
|
2145
|
+
async function N(l) {
|
|
2146
2146
|
const c = /* @__PURE__ */ new Map(), v = async ($) => {
|
|
2147
|
-
const A = await
|
|
2148
|
-
if (
|
|
2149
|
-
const
|
|
2150
|
-
|
|
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
|
-
|
|
2153
|
-
await p(
|
|
2154
|
-
|
|
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(`${
|
|
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
|
|
2159
|
-
|
|
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 = (
|
|
2164
|
-
n.delete(
|
|
2165
|
-
},
|
|
2166
|
-
let c = n.get(
|
|
2167
|
-
return c || (c = N(
|
|
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
|
|
2170
|
-
const c = l
|
|
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 "${
|
|
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(
|
|
2176
|
-
const v = [], $ = async (A,
|
|
2177
|
-
const
|
|
2178
|
-
if (!(
|
|
2179
|
-
for (const M of
|
|
2180
|
-
M.kind === "file" ? v.push(
|
|
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
|
|
2185
|
-
t && await
|
|
2184
|
+
async function E(l, c, v, $) {
|
|
2185
|
+
t && await l.write(mi(c, $), v);
|
|
2186
2186
|
}
|
|
2187
|
-
async function
|
|
2187
|
+
async function f(l, c) {
|
|
2188
2188
|
const v = [], $ = async (A) => {
|
|
2189
|
-
const
|
|
2190
|
-
for (const
|
|
2191
|
-
if (
|
|
2192
|
-
for (const M of await
|
|
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:
|
|
2195
|
+
path: P(A, D[1]),
|
|
2196
2196
|
stamp: D[2],
|
|
2197
|
-
at:
|
|
2197
|
+
at: P(A, ".revisions", M.name)
|
|
2198
2198
|
});
|
|
2199
2199
|
}
|
|
2200
|
-
else
|
|
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(
|
|
2205
|
-
const c = L(
|
|
2206
|
-
return c ? (await
|
|
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(
|
|
2209
|
-
const v = await
|
|
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
|
|
2216
|
-
arrayKey: (
|
|
2215
|
+
const T = {
|
|
2216
|
+
arrayKey: (l) => l === "" ? "slug" : l.endsWith("/modules") ? "packageName" : void 0
|
|
2217
2217
|
};
|
|
2218
|
-
async function C(
|
|
2219
|
-
if (v && await
|
|
2220
|
-
await
|
|
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
|
|
2223
|
+
await l.fs.write(
|
|
2224
2224
|
c,
|
|
2225
|
-
v ? qe(v, $,
|
|
2225
|
+
v ? qe(v, $, T) : le($)
|
|
2226
2226
|
);
|
|
2227
2227
|
}
|
|
2228
2228
|
const h = /* @__PURE__ */ new Map();
|
|
2229
|
-
function
|
|
2230
|
-
const v = `${
|
|
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((
|
|
2233
|
+
const A = (c.ref.files ?? []).filter((y) => /\.(manifest|entities)\.json$/i.test(y));
|
|
2234
2234
|
$ = Promise.all(
|
|
2235
|
-
A.map(async (
|
|
2236
|
-
var
|
|
2235
|
+
A.map(async (y) => {
|
|
2236
|
+
var S;
|
|
2237
2237
|
return {
|
|
2238
|
-
path:
|
|
2239
|
-
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((
|
|
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(
|
|
2246
|
+
async function d(l) {
|
|
2247
2247
|
var c;
|
|
2248
|
-
return
|
|
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(),
|
|
2252
|
+
n.clear(), h.clear(), r = null;
|
|
2253
2253
|
},
|
|
2254
2254
|
async listWorkspaces() {
|
|
2255
|
-
return i.map((
|
|
2256
|
-
id:
|
|
2257
|
-
label:
|
|
2258
|
-
...
|
|
2259
|
-
...
|
|
2260
|
-
...
|
|
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(
|
|
2264
|
-
const c = i.findIndex((
|
|
2263
|
+
async listModules(l) {
|
|
2264
|
+
const c = i.findIndex((y) => y.id === l), v = a(l);
|
|
2265
2265
|
I(v);
|
|
2266
|
-
const $ = await
|
|
2267
|
-
i.slice(0, c).map(async (
|
|
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:
|
|
2270
|
-
const
|
|
2271
|
-
return
|
|
2272
|
-
}).sort((
|
|
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(
|
|
2275
|
-
const { root: c, module: v } = await
|
|
2276
|
-
for (const
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2279
|
-
path:
|
|
2280
|
-
text:
|
|
2281
|
-
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(
|
|
2288
|
-
const { module: v } = await
|
|
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(
|
|
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) &&
|
|
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 (
|
|
2298
|
-
return { ok: !1, conflicts:
|
|
2299
|
-
const
|
|
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 =
|
|
2302
|
-
H && await
|
|
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:
|
|
2304
|
+
return I($), { ok: !0, versions: M, revision: S };
|
|
2305
2305
|
},
|
|
2306
|
-
async createModule(
|
|
2307
|
-
var
|
|
2308
|
-
const c =
|
|
2309
|
-
|
|
2310
|
-
|
|
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
|
|
2315
|
-
throw new Error(`"${
|
|
2316
|
-
for (const
|
|
2317
|
-
await c.fs.write(
|
|
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
|
|
2319
|
+
const A = (await O(c)).get(l.id.toLowerCase());
|
|
2320
2320
|
if (!A)
|
|
2321
|
-
throw new Error(`The new module ${
|
|
2321
|
+
throw new Error(`The new module ${l.id} has no manifest naming it`);
|
|
2322
2322
|
return A.ref;
|
|
2323
2323
|
},
|
|
2324
|
-
async deleteModule(
|
|
2325
|
-
const { module: c } = await
|
|
2326
|
-
await v.fs.removeDir(c.dir), s.delete(`${v.id}:${
|
|
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
|
|
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
|
|
2339
|
-
const
|
|
2340
|
-
|
|
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
|
|
2343
|
+
return r = l, c;
|
|
2344
2344
|
},
|
|
2345
|
-
async saveTemplate(
|
|
2346
|
-
const v = (c == null ? void 0 : c.previousId) ??
|
|
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 =
|
|
2349
|
-
(R) =>
|
|
2350
|
-
), D = [...
|
|
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
|
-
|
|
2353
|
-
M < 0 ? void 0 :
|
|
2354
|
-
), await C(A, $.path,
|
|
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
|
|
2359
|
+
const y = P(
|
|
2360
2360
|
L(A),
|
|
2361
|
-
`wizard-templates-${
|
|
2362
|
-
), { text:
|
|
2363
|
-
await C(A,
|
|
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
|
|
2365
|
+
return r = null, { ...l, extra: l.extra };
|
|
2366
2366
|
},
|
|
2367
|
-
async deleteTemplate(
|
|
2368
|
-
const c = await d(
|
|
2367
|
+
async deleteTemplate(l) {
|
|
2368
|
+
const c = await d(l);
|
|
2369
2369
|
if (!c)
|
|
2370
2370
|
return;
|
|
2371
|
-
const v =
|
|
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
|
-
(
|
|
2377
|
+
(y) => !(we(y) && String(y.slug ?? "").toLowerCase() === l.toLowerCase())
|
|
2378
2378
|
)
|
|
2379
|
-
),
|
|
2379
|
+
), r = null;
|
|
2380
2380
|
},
|
|
2381
|
-
async validate(
|
|
2382
|
-
const v = l
|
|
2383
|
-
$.filter((M) => M.ref.id.toLowerCase() !==
|
|
2384
|
-
),
|
|
2385
|
-
return
|
|
2386
|
-
[...A, { location:
|
|
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(
|
|
2390
|
+
).filter((M) => M.message.split(/[ ,]+/).includes(S));
|
|
2391
2391
|
},
|
|
2392
|
-
async listRevisions(
|
|
2393
|
-
const { root: v, module: $ } = await
|
|
2394
|
-
(
|
|
2395
|
-
),
|
|
2396
|
-
for (const
|
|
2397
|
-
|
|
2398
|
-
return [...
|
|
2399
|
-
id:
|
|
2400
|
-
timestamp:
|
|
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((
|
|
2403
|
+
})).sort((S, M) => M.timestamp - S.timestamp);
|
|
2404
2404
|
},
|
|
2405
|
-
async readRevision(
|
|
2405
|
+
async readRevision(l, c, v) {
|
|
2406
2406
|
var M;
|
|
2407
|
-
const { root: $, module: A } = await
|
|
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 (
|
|
2410
|
+
if (y.length === 0)
|
|
2411
2411
|
throw new Error(`Unknown revision "${c}"`);
|
|
2412
|
-
const
|
|
2413
|
-
for (const D of
|
|
2414
|
-
|
|
2415
|
-
return v ?
|
|
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(
|
|
2417
|
+
async rollback(l, c, v) {
|
|
2418
2418
|
var M;
|
|
2419
|
-
const { module: $ } = await
|
|
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 (
|
|
2422
|
+
if (y.length === 0)
|
|
2423
2423
|
throw new Error(`Unknown revision "${c}"`);
|
|
2424
|
-
const
|
|
2425
|
-
for (const D of
|
|
2426
|
-
const R =
|
|
2427
|
-
X && await
|
|
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
|
|
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
|
|
2440
|
-
function
|
|
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
|
|
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
|
|
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
|
|
2460
|
-
const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((p,
|
|
2461
|
-
async function s(p,
|
|
2462
|
-
const I = typeof e.headers == "function" ? await e.headers() : e.headers ?? {},
|
|
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
|
-
}),
|
|
2472
|
-
let w =
|
|
2473
|
-
if (L === "json" || !
|
|
2471
|
+
}), x = await O.text();
|
|
2472
|
+
let w = x;
|
|
2473
|
+
if (L === "json" || !O.ok)
|
|
2474
2474
|
try {
|
|
2475
|
-
w =
|
|
2475
|
+
w = x ? JSON.parse(x) : void 0;
|
|
2476
2476
|
} catch {
|
|
2477
|
-
w =
|
|
2477
|
+
w = x;
|
|
2478
2478
|
}
|
|
2479
|
-
if (!
|
|
2480
|
-
throw new
|
|
2481
|
-
`${p} ${
|
|
2482
|
-
|
|
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
|
|
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,
|
|
2503
|
-
const N = (
|
|
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 ((
|
|
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
|
-
(
|
|
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",
|
|
2536
|
-
var
|
|
2537
|
-
return ((
|
|
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
|
|
2540
|
-
return { path: N(I), text:
|
|
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
|
|
2548
|
+
return m.clear(), (I ?? []).map((O) => (m.set(O.packageName, O), {
|
|
2549
2549
|
workspaceId: p,
|
|
2550
|
-
id:
|
|
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:
|
|
2554
|
-
label:
|
|
2555
|
-
location:
|
|
2556
|
-
files: [
|
|
2557
|
-
search:
|
|
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,
|
|
2566
|
-
const
|
|
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
|
|
2572
|
-
if (!
|
|
2571
|
+
const E = O[0];
|
|
2572
|
+
if (!E || E.type !== "write")
|
|
2573
2573
|
return { ok: !0, versions: {} };
|
|
2574
|
-
const
|
|
2575
|
-
if (
|
|
2576
|
-
return { ok: !1, conflicts: [{ path:
|
|
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(
|
|
2581
|
+
manifest: z(E.text).value
|
|
2582
2582
|
}
|
|
2583
2583
|
), g = await L(I.id);
|
|
2584
2584
|
return {
|
|
2585
2585
|
ok: !0,
|
|
2586
|
-
versions: { [
|
|
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((
|
|
2595
|
-
id:
|
|
2596
|
-
timestamp: Date.parse(
|
|
2594
|
+
) ?? []).map((x) => ({
|
|
2595
|
+
id: x.id,
|
|
2596
|
+
timestamp: Date.parse(x.at) || 0,
|
|
2597
2597
|
path: N(I.id),
|
|
2598
|
-
...
|
|
2598
|
+
...x.sizeBytes !== void 0 ? { summary: `${x.sizeBytes} B` } : {}
|
|
2599
2599
|
}));
|
|
2600
2600
|
},
|
|
2601
|
-
async readRevision(I,
|
|
2601
|
+
async readRevision(I, O) {
|
|
2602
2602
|
return s(
|
|
2603
2603
|
"GET",
|
|
2604
|
-
`/module-manifests/${n(I.id)}/revisions/${n(
|
|
2604
|
+
`/module-manifests/${n(I.id)}/revisions/${n(O)}`,
|
|
2605
2605
|
void 0,
|
|
2606
2606
|
"text"
|
|
2607
2607
|
);
|
|
2608
2608
|
},
|
|
2609
|
-
async rollback(I,
|
|
2609
|
+
async rollback(I, O) {
|
|
2610
2610
|
await s(
|
|
2611
2611
|
"POST",
|
|
2612
|
-
`/module-manifests/${n(I.id)}/revisions/${n(
|
|
2612
|
+
`/module-manifests/${n(I.id)}/revisions/${n(O)}/rollback`
|
|
2613
2613
|
);
|
|
2614
2614
|
},
|
|
2615
|
-
...
|
|
2615
|
+
...r
|
|
2616
2616
|
};
|
|
2617
2617
|
}
|
|
2618
|
-
const
|
|
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
|
|
2631
|
-
return ((
|
|
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:
|
|
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,
|
|
2638
|
+
async writeModule(p, m) {
|
|
2639
2639
|
var N;
|
|
2640
2640
|
try {
|
|
2641
2641
|
const L = await s(
|
|
2642
2642
|
"PUT",
|
|
2643
|
-
|
|
2643
|
+
a(p),
|
|
2644
2644
|
{
|
|
2645
|
-
changes:
|
|
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
|
|
2662
|
-
return { ok: !1, conflicts: ((N = L.body) == null ? void 0 : N.conflicts) ??
|
|
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:
|
|
2673
|
+
files: u(p.files)
|
|
2674
2674
|
}
|
|
2675
2675
|
), workspaceId: p.workspaceId };
|
|
2676
2676
|
},
|
|
2677
2677
|
async deleteModule(p) {
|
|
2678
|
-
await s("DELETE",
|
|
2678
|
+
await s("DELETE", a(p));
|
|
2679
2679
|
},
|
|
2680
|
-
async listRevisions(p,
|
|
2680
|
+
async listRevisions(p, m) {
|
|
2681
2681
|
return s(
|
|
2682
2682
|
"GET",
|
|
2683
|
-
`${
|
|
2683
|
+
`${a(p)}/revisions${m ? `?path=${n(m)}` : ""}`
|
|
2684
2684
|
);
|
|
2685
2685
|
},
|
|
2686
|
-
async readRevision(p,
|
|
2686
|
+
async readRevision(p, m, N) {
|
|
2687
2687
|
return s(
|
|
2688
2688
|
"GET",
|
|
2689
|
-
`${
|
|
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,
|
|
2694
|
+
async rollback(p, m, N) {
|
|
2695
2695
|
await s(
|
|
2696
2696
|
"POST",
|
|
2697
|
-
`${
|
|
2697
|
+
`${a(p)}/revisions/${n(m)}/rollback${N ? `?path=${n(N)}` : ""}`
|
|
2698
2698
|
);
|
|
2699
2699
|
},
|
|
2700
2700
|
...e.serverValidation ? {
|
|
2701
|
-
async validate(p,
|
|
2702
|
-
return s("POST", `${
|
|
2703
|
-
files:
|
|
2701
|
+
async validate(p, m) {
|
|
2702
|
+
return s("POST", `${a(p)}/validate`, {
|
|
2703
|
+
files: u(m)
|
|
2704
2704
|
});
|
|
2705
2705
|
}
|
|
2706
2706
|
} : {},
|
|
2707
|
-
...
|
|
2707
|
+
...r
|
|
2708
2708
|
};
|
|
2709
2709
|
}
|
|
2710
|
-
const
|
|
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
|
-
],
|
|
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
|
-
},
|
|
2739
|
+
}, vi = (e) => {
|
|
2740
2740
|
var i;
|
|
2741
|
-
return ((i =
|
|
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
|
|
2744
|
-
|
|
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: [...
|
|
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:
|
|
2784
|
-
|
|
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 ??
|
|
2862
|
+
locales: e.locales ?? wi,
|
|
2787
2863
|
requiredLocales: ["en", "pl"],
|
|
2788
2864
|
moduleId: (s) => {
|
|
2789
|
-
var
|
|
2790
|
-
const
|
|
2791
|
-
return typeof
|
|
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) =>
|
|
2794
|
-
generateModule: async (s, { existingIds:
|
|
2795
|
-
const
|
|
2869
|
+
validateModule: (s) => ii(s),
|
|
2870
|
+
generateModule: async (s, { existingIds: r }) => {
|
|
2871
|
+
const a = await Ft(
|
|
2796
2872
|
{
|
|
2797
|
-
...
|
|
2873
|
+
...Rt(s),
|
|
2798
2874
|
iconConfig: e.iconConfig,
|
|
2799
2875
|
ownerTenantId: e.ownerTenantId
|
|
2800
2876
|
},
|
|
2801
|
-
{ existingPackageNames:
|
|
2877
|
+
{ existingPackageNames: r }
|
|
2802
2878
|
);
|
|
2803
|
-
if (!
|
|
2804
|
-
throw new Error(
|
|
2879
|
+
if (!a.package)
|
|
2880
|
+
throw new Error(a.problems.join(`
|
|
2805
2881
|
`));
|
|
2806
2882
|
return {
|
|
2807
|
-
id:
|
|
2883
|
+
id: a.package.packageName,
|
|
2808
2884
|
packageId: s.packageId,
|
|
2809
|
-
files:
|
|
2885
|
+
files: a.package.files
|
|
2810
2886
|
};
|
|
2811
2887
|
},
|
|
2812
|
-
duplicateModule: (s,
|
|
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:
|
|
2901
|
+
newFile: (s, { files: r }) => {
|
|
2826
2902
|
var L;
|
|
2827
|
-
const
|
|
2903
|
+
const a = vi(r), u = ((L = ye(r)) == null ? void 0 : L.value) ?? {};
|
|
2828
2904
|
if (s === "scripts") {
|
|
2829
|
-
let I = `${
|
|
2830
|
-
for (let
|
|
2831
|
-
I = `${
|
|
2832
|
-
const
|
|
2833
|
-
moduleName: String(
|
|
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(
|
|
2913
|
+
return { path: I, text: le(O) };
|
|
2838
2914
|
}
|
|
2839
|
-
const p = `${String(
|
|
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(
|
|
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(
|
|
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(
|
|
2940
|
+
moduleName: String(u.packageName ?? a),
|
|
2865
2941
|
version: "1.0.0",
|
|
2866
|
-
variables:
|
|
2942
|
+
variables: Ut(u),
|
|
2867
2943
|
sets: [{ id: "default", name: "Default", values: {} }]
|
|
2868
2944
|
}
|
|
2869
2945
|
]
|
|
2870
2946
|
}[s];
|
|
2871
|
-
return N ? { path: `${
|
|
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
|
|
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),
|
|
2904
|
-
for (const
|
|
2905
|
-
if (!
|
|
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
|
|
2908
|
-
|
|
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 [...
|
|
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
|
|
2918
|
-
return t.set(n, { text: s, version:
|
|
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
|
|
2926
|
-
|
|
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
|
|
2934
|
-
function
|
|
2935
|
-
return typeof
|
|
3009
|
+
const Ye = () => typeof window > "u" ? void 0 : window.showDirectoryPicker;
|
|
3010
|
+
function Oi() {
|
|
3011
|
+
return typeof Ye() == "function";
|
|
2936
3012
|
}
|
|
2937
|
-
async function
|
|
2938
|
-
const i =
|
|
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
|
|
3023
|
+
function Ci(e) {
|
|
2948
3024
|
const i = new TextDecoder("utf-8", { ignoreBOM: !0 });
|
|
2949
|
-
async function t(
|
|
2950
|
-
let
|
|
2951
|
-
for (const p of
|
|
3025
|
+
async function t(r, a = !1) {
|
|
3026
|
+
let u = e;
|
|
3027
|
+
for (const p of r.split("/").filter(Boolean))
|
|
2952
3028
|
try {
|
|
2953
|
-
|
|
2954
|
-
} catch (
|
|
2955
|
-
if (pe(
|
|
3029
|
+
u = await u.getDirectoryHandle(p, { create: a });
|
|
3030
|
+
} catch (m) {
|
|
3031
|
+
if (pe(m))
|
|
2956
3032
|
return null;
|
|
2957
|
-
throw
|
|
3033
|
+
throw m;
|
|
2958
3034
|
}
|
|
2959
|
-
return
|
|
3035
|
+
return u;
|
|
2960
3036
|
}
|
|
2961
|
-
const o = (
|
|
2962
|
-
const
|
|
2963
|
-
return
|
|
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(
|
|
2966
|
-
const [
|
|
2967
|
-
if (!
|
|
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
|
|
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 = (
|
|
3053
|
+
const s = (r) => `${r.lastModified}:${r.size}`;
|
|
2978
3054
|
return {
|
|
2979
|
-
async list(
|
|
2980
|
-
const
|
|
2981
|
-
if (
|
|
2982
|
-
for await (const p of
|
|
2983
|
-
|
|
2984
|
-
return
|
|
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(
|
|
2987
|
-
const
|
|
2988
|
-
if (!
|
|
3062
|
+
async read(r) {
|
|
3063
|
+
const a = await n(r);
|
|
3064
|
+
if (!a)
|
|
2989
3065
|
return null;
|
|
2990
|
-
const
|
|
2991
|
-
return { text: i.decode(await
|
|
3066
|
+
const u = await a.getFile();
|
|
3067
|
+
return { text: i.decode(await u.arrayBuffer()), version: s(u) };
|
|
2992
3068
|
},
|
|
2993
|
-
async write(
|
|
2994
|
-
const
|
|
2995
|
-
if (!
|
|
2996
|
-
throw new Error(`Cannot write ${
|
|
2997
|
-
const p = await
|
|
2998
|
-
return await p.write(
|
|
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(
|
|
3001
|
-
const [
|
|
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(
|
|
3004
|
-
} catch (
|
|
3005
|
-
if (!pe(
|
|
3006
|
-
throw
|
|
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(
|
|
3010
|
-
const [
|
|
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(
|
|
3013
|
-
} catch (
|
|
3014
|
-
if (!pe(
|
|
3015
|
-
throw
|
|
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
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
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
|
-
|
|
3133
|
+
oi as omniverkTemplateFromEntry,
|
|
3056
3134
|
Me as omniverkTemplateToEntry,
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
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
|
};
|