@nice2dev/erp-adapter 1.4.6 → 1.4.7
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 +41 -0
- package/dist/omniverk/index.d.ts +1 -1
- package/dist/omniverk/kinds.d.ts +6 -0
- package/dist/omniverk.cjs +2 -2
- package/dist/omniverk.mjs +1019 -979
- package/package.json +3 -3
package/dist/omniverk.mjs
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { objectFileKind as
|
|
2
|
-
const V = (e) => typeof e == "object" && e !== null && !Array.isArray(e), G = (e) => typeof e == "string" && e ? e : void 0, U = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), Ze =
|
|
1
|
+
import { objectFileKind as Be, endsWithAny as B, arrayFileKind as Oe, i18nFileKind as ze, itemsFileKind as Ae, jsonFileKind as Le, scriptsFileKind as Je, jsonValuesEqual as Ke, keepTextFormat as He, parseJsonText as _, patchJsonText as De, stringifyJsonText as ae } from "@nice2dev/ui-forms/studio";
|
|
2
|
+
const V = (e) => typeof e == "object" && e !== null && !Array.isArray(e), G = (e) => typeof e == "string" && e ? e : void 0, U = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), Ze = Be({
|
|
3
3
|
id: "manifest",
|
|
4
4
|
label: "Manifest",
|
|
5
5
|
labelKey: "devStudio.kind.manifest",
|
|
6
6
|
icon: "file",
|
|
7
7
|
editor: "manifest",
|
|
8
|
-
match:
|
|
9
|
-
}),
|
|
8
|
+
match: B(".manifest.json")
|
|
9
|
+
}), Me = [
|
|
10
10
|
["dataType", "type"],
|
|
11
11
|
["isRequired", "required"]
|
|
12
12
|
], ce = "$aliases";
|
|
13
13
|
function Ye(e) {
|
|
14
14
|
if (!V(e))
|
|
15
15
|
return e;
|
|
16
|
-
const i =
|
|
16
|
+
const i = Me.filter(([a, n]) => !(a in e) && n in e);
|
|
17
17
|
if (i.length === 0)
|
|
18
18
|
return e;
|
|
19
19
|
const t = {};
|
|
20
|
-
for (const [
|
|
21
|
-
const s = i.find(([, r]) => r ===
|
|
22
|
-
t[s ? s[0] :
|
|
20
|
+
for (const [a, n] of Object.entries(e)) {
|
|
21
|
+
const s = i.find(([, r]) => r === a);
|
|
22
|
+
t[s ? s[0] : a] = n;
|
|
23
23
|
}
|
|
24
|
-
return t[ce] = i.map(([,
|
|
24
|
+
return t[ce] = i.map(([, a]) => a), t;
|
|
25
25
|
}
|
|
26
26
|
function Xe(e) {
|
|
27
27
|
if (!V(e) || !Array.isArray(e[ce]))
|
|
28
28
|
return e;
|
|
29
29
|
const i = e[ce], t = {};
|
|
30
|
-
for (const [
|
|
31
|
-
if (
|
|
30
|
+
for (const [a, n] of Object.entries(e)) {
|
|
31
|
+
if (a === ce)
|
|
32
32
|
continue;
|
|
33
|
-
const s =
|
|
34
|
-
t[s ? s[1] :
|
|
33
|
+
const s = Me.find(([r, l]) => r === a && i.includes(l));
|
|
34
|
+
t[s ? s[1] : a] = n;
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
}
|
|
38
38
|
const Se = (e, i) => V(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.map(i) } : e, Qe = (() => {
|
|
39
|
-
const e =
|
|
39
|
+
const e = Oe({
|
|
40
40
|
id: "entities",
|
|
41
41
|
label: "Entities",
|
|
42
42
|
labelKey: "devStudio.kind.entities",
|
|
43
43
|
icon: "database",
|
|
44
44
|
editor: "entities",
|
|
45
|
-
match:
|
|
45
|
+
match: B(".entities.json"),
|
|
46
46
|
property: "entities",
|
|
47
47
|
itemKey: "name"
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
50
|
...e,
|
|
51
|
-
decode: (i, t) => e.decode(i, t).map((
|
|
52
|
-
encode: (i, t,
|
|
51
|
+
decode: (i, t) => e.decode(i, t).map((a) => Se(a, Ye)),
|
|
52
|
+
encode: (i, t, a) => e.encode(
|
|
53
53
|
i.map((n) => Se(n, Xe)),
|
|
54
54
|
t,
|
|
55
|
-
|
|
55
|
+
a
|
|
56
56
|
)
|
|
57
57
|
};
|
|
58
58
|
})(), et = ze(), ge = {
|
|
@@ -96,25 +96,25 @@ function tt(e) {
|
|
|
96
96
|
]
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
var l,
|
|
101
|
-
const t = (e.rows ?? []).flatMap((
|
|
99
|
+
function Fe(e, i) {
|
|
100
|
+
var l, h, d;
|
|
101
|
+
const t = (e.rows ?? []).flatMap((p) => p.cells).find((p) => p.controlType === "dataGrid"), a = ((l = t == null ? void 0 : t.props) == null ? void 0 : l.columns) ?? [], n = i.columns ?? [], s = (d = (h = e.dataSources) == null ? void 0 : h.find((p) => p.type === "entity")) == null ? void 0 : d.entity, r = (p) => "displayName" in p ? "displayName" : "header" in p ? "header" : "label" in p ? "label" : "displayName";
|
|
102
102
|
return U({
|
|
103
103
|
...i,
|
|
104
104
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
105
105
|
entityName: s ?? i.entityName,
|
|
106
|
-
columns:
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
return { field:
|
|
110
|
-
const
|
|
111
|
-
return
|
|
106
|
+
columns: a.map((p) => {
|
|
107
|
+
const k = n.find((T) => T.field === p.field);
|
|
108
|
+
if (!k)
|
|
109
|
+
return { field: p.field, displayName: p.header ?? p.field };
|
|
110
|
+
const A = r(k), S = p.header ?? p.field;
|
|
111
|
+
return k[A] === void 0 && S === p.field ? k : { ...k, [A]: S };
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
function it(e) {
|
|
116
116
|
const i = [];
|
|
117
|
-
return e.tabs.forEach((
|
|
117
|
+
return e.tabs.forEach((a, n) => {
|
|
118
118
|
i.push({
|
|
119
119
|
id: `tab-${n}`,
|
|
120
120
|
cells: [
|
|
@@ -122,10 +122,10 @@ function it(e) {
|
|
|
122
122
|
id: `tab-${n}`,
|
|
123
123
|
controlType: "heading",
|
|
124
124
|
colSpan: 12,
|
|
125
|
-
props: { text: String(
|
|
125
|
+
props: { text: String(a.displayName ?? a.name ?? ""), level: 2, name: a.name }
|
|
126
126
|
}
|
|
127
127
|
]
|
|
128
|
-
}), (
|
|
128
|
+
}), (a.sections ?? []).forEach((s, r) => {
|
|
129
129
|
i.push({
|
|
130
130
|
id: `tab-${n}-section-${r}`,
|
|
131
131
|
cells: [
|
|
@@ -141,24 +141,24 @@ function it(e) {
|
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
143
|
});
|
|
144
|
-
let l = [],
|
|
144
|
+
let l = [], h = 0;
|
|
145
145
|
const d = () => {
|
|
146
|
-
l.length && (i.push({ id: `tab-${n}-section-${r}-row-${i.length}`, cells: l }), l = [],
|
|
146
|
+
l.length && (i.push({ id: `tab-${n}-section-${r}-row-${i.length}`, cells: l }), l = [], h = 0);
|
|
147
147
|
};
|
|
148
|
-
(s.controls ?? []).forEach((
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
id: `c-${n}-${r}-${
|
|
152
|
-
controlType: ge[String(
|
|
153
|
-
colSpan:
|
|
148
|
+
(s.controls ?? []).forEach((p, k) => {
|
|
149
|
+
const A = typeof p.colSpan == "number" ? p.colSpan : 6;
|
|
150
|
+
h + A > 12 && d(), l.push({
|
|
151
|
+
id: `c-${n}-${r}-${k}`,
|
|
152
|
+
controlType: ge[String(p.type)] ?? "textInput",
|
|
153
|
+
colSpan: A,
|
|
154
154
|
props: {
|
|
155
|
-
label: String(
|
|
156
|
-
required:
|
|
157
|
-
field:
|
|
158
|
-
type:
|
|
155
|
+
label: String(p.label ?? p.field ?? ""),
|
|
156
|
+
required: p.required === !0,
|
|
157
|
+
field: p.field,
|
|
158
|
+
type: p.type
|
|
159
159
|
},
|
|
160
|
-
bindings: { value: { source: "record", field: String(
|
|
161
|
-
}),
|
|
160
|
+
bindings: { value: { source: "record", field: String(p.field ?? "") } }
|
|
161
|
+
}), h += A;
|
|
162
162
|
}), d();
|
|
163
163
|
});
|
|
164
164
|
}), {
|
|
@@ -171,49 +171,49 @@ function it(e) {
|
|
|
171
171
|
rows: i
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var d,
|
|
176
|
-
const t = i.tabs ?? [],
|
|
177
|
-
(
|
|
174
|
+
function Pe(e, i) {
|
|
175
|
+
var d, p, k, A, S;
|
|
176
|
+
const t = i.tabs ?? [], a = t.flatMap(
|
|
177
|
+
(T) => (T.sections ?? []).flatMap((I) => I.controls ?? [])
|
|
178
178
|
), n = [];
|
|
179
179
|
let s = null, r = null;
|
|
180
180
|
const l = () => (s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s)), r || (r = { name: "Details", displayName: "Details", controls: [] }, s.sections.push(r)), r);
|
|
181
|
-
for (const
|
|
182
|
-
for (const
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
s = { ...t.find((
|
|
181
|
+
for (const T of e.rows ?? [])
|
|
182
|
+
for (const I of T.cells) {
|
|
183
|
+
const b = I.props ?? {};
|
|
184
|
+
if (I.controlType === "heading" && (b.level === 2 || b.level === 3)) {
|
|
185
|
+
const N = G(b.name) ?? String(b.text ?? "").replace(/\s+/g, "");
|
|
186
|
+
if (b.level === 2)
|
|
187
|
+
s = { ...t.find((j) => j.name === N) ?? {}, name: N, displayName: String(b.text ?? N), sections: [] }, n.push(s), r = null;
|
|
188
188
|
else {
|
|
189
189
|
s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s));
|
|
190
|
-
const
|
|
191
|
-
r = { ...
|
|
190
|
+
const C = t.flatMap((O) => O.sections ?? []).find((O) => O.name === N);
|
|
191
|
+
r = { ...C ? Object.fromEntries(Object.entries(C).filter(([O]) => O !== "controls")) : {}, name: N, displayName: String(b.text ?? N), controls: [] }, s.sections.push(r);
|
|
192
192
|
}
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
195
|
+
const D = ((p = (d = I.bindings) == null ? void 0 : d.value) == null ? void 0 : p.field) ?? G(b.field);
|
|
196
|
+
if (!D)
|
|
197
197
|
continue;
|
|
198
|
-
const
|
|
199
|
-
...
|
|
200
|
-
field:
|
|
201
|
-
type:
|
|
202
|
-
label:
|
|
203
|
-
colSpan: (
|
|
204
|
-
required:
|
|
198
|
+
const u = a.find((N) => N.field === D), v = u && ge[String(u.type)] === I.controlType ? u.type : ((k = Object.entries(ge).find(([, N]) => N === I.controlType)) == null ? void 0 : k[0]) ?? "input", f = U({
|
|
199
|
+
...u ?? {},
|
|
200
|
+
field: D,
|
|
201
|
+
type: v,
|
|
202
|
+
label: b.label !== void 0 ? String(b.label) : u == null ? void 0 : u.label,
|
|
203
|
+
colSpan: (u == null ? void 0 : u.colSpan) !== void 0 || I.colSpan !== 6 ? I.colSpan : void 0,
|
|
204
|
+
required: b.required === !0 ? !0 : (u == null ? void 0 : u.required) === !0 ? !1 : u == null ? void 0 : u.required
|
|
205
205
|
});
|
|
206
|
-
l().controls.push(
|
|
206
|
+
l().controls.push(f);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
return
|
|
208
|
+
const h = n.map((T) => {
|
|
209
|
+
const I = t.find((b) => b.name === T.name);
|
|
210
|
+
return I ? { ...I, ...T } : T;
|
|
211
211
|
});
|
|
212
212
|
return U({
|
|
213
213
|
...i,
|
|
214
214
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
215
|
-
entityName: ((
|
|
216
|
-
tabs:
|
|
215
|
+
entityName: ((S = (A = e.dataSources) == null ? void 0 : A.find((T) => T.type === "entity")) == null ? void 0 : S.entity) ?? i.entityName,
|
|
216
|
+
tabs: h
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
const nt = (e) => {
|
|
@@ -221,38 +221,38 @@ const nt = (e) => {
|
|
|
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
223
|
function st(e, i) {
|
|
224
|
-
const t = V(e) ? e : {},
|
|
224
|
+
const t = V(e) ? e : {}, a = G(t.name) ?? G(t.id) ?? `#${i}`, n = G(t.displayName) ?? a, s = nt(t);
|
|
225
225
|
if (!s)
|
|
226
226
|
return {
|
|
227
|
-
key:
|
|
227
|
+
key: a,
|
|
228
228
|
label: n,
|
|
229
229
|
source: e,
|
|
230
230
|
rawReason: String(t.type ?? (t.viewJson ? "viewJson" : "unknown"))
|
|
231
231
|
};
|
|
232
|
-
const r = s === "List" ? tt(t) : it(t), l = s === "List" ?
|
|
233
|
-
return
|
|
232
|
+
const r = s === "List" ? tt(t) : it(t), l = s === "List" ? Fe(r, t) : Pe(r, t);
|
|
233
|
+
return Ke(l, e) ? { key: a, label: n, definition: r, source: e } : { key: a, label: n, source: e, rawReason: `${s} (round-trip)` };
|
|
234
234
|
}
|
|
235
235
|
function ot(e) {
|
|
236
236
|
if (!e.definition)
|
|
237
237
|
return e.source;
|
|
238
238
|
const i = V(e.source) ? e.source : { name: e.definition.id };
|
|
239
|
-
return e.definition.kind === "form" ?
|
|
239
|
+
return e.definition.kind === "form" ? Pe(e.definition, {
|
|
240
240
|
type: "Form",
|
|
241
241
|
...i,
|
|
242
242
|
name: i.name ?? e.definition.id
|
|
243
|
-
}) :
|
|
243
|
+
}) : Fe(e.definition, {
|
|
244
244
|
type: "List",
|
|
245
245
|
...i,
|
|
246
246
|
name: i.name ?? e.definition.id
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
const at =
|
|
249
|
+
const at = Ae({
|
|
250
250
|
id: "views",
|
|
251
251
|
label: "Views",
|
|
252
252
|
labelKey: "devStudio.kind.views",
|
|
253
253
|
icon: "grid",
|
|
254
254
|
editor: "views",
|
|
255
|
-
match:
|
|
255
|
+
match: B(".views.json"),
|
|
256
256
|
property: "views",
|
|
257
257
|
itemKey: "name",
|
|
258
258
|
toItem: st,
|
|
@@ -265,23 +265,23 @@ function rt(e) {
|
|
|
265
265
|
name: String(e.displayName ?? e.name),
|
|
266
266
|
entityType: String(e.entityName ?? ""),
|
|
267
267
|
version: 1,
|
|
268
|
-
states: i.map((
|
|
269
|
-
id: String(
|
|
270
|
-
name: String(
|
|
271
|
-
type:
|
|
268
|
+
states: i.map((a, n) => ({
|
|
269
|
+
id: String(a.state),
|
|
270
|
+
name: String(a.displayName ?? a.state),
|
|
271
|
+
type: a.isInitial === !0 ? "initial" : a.isFinal === !0 ? "final" : "intermediate",
|
|
272
272
|
position: { x: 60 + n % 4 * 230, y: 80 + Math.floor(n / 4) * 140 }
|
|
273
273
|
})),
|
|
274
|
-
transitions: t.map((
|
|
274
|
+
transitions: t.map((a, n) => ({
|
|
275
275
|
id: `t${n}`,
|
|
276
|
-
fromStateId: String(
|
|
277
|
-
toStateId: String(
|
|
278
|
-
name: String(
|
|
279
|
-
...typeof
|
|
276
|
+
fromStateId: String(a.fromState),
|
|
277
|
+
toStateId: String(a.toState),
|
|
278
|
+
name: String(a.actionName ?? ""),
|
|
279
|
+
...typeof a.requiredPermission == "string" ? { requiredPermission: a.requiredPermission } : {}
|
|
280
280
|
}))
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
const t = i.steps ?? [],
|
|
283
|
+
function Re(e, i) {
|
|
284
|
+
const t = i.steps ?? [], a = i.connections ?? [];
|
|
285
285
|
return U({
|
|
286
286
|
...i,
|
|
287
287
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
@@ -296,7 +296,7 @@ function Pe(e, i) {
|
|
|
296
296
|
});
|
|
297
297
|
}),
|
|
298
298
|
connections: e.transitions.map((n) => {
|
|
299
|
-
const s = /^t(\d+)$/.exec(n.id), r = s ?
|
|
299
|
+
const s = /^t(\d+)$/.exec(n.id), r = s ? a[Number(s[1])] : a.find((l) => l.fromState === n.fromStateId && l.toState === n.toStateId);
|
|
300
300
|
return U({
|
|
301
301
|
...r ?? {},
|
|
302
302
|
fromState: n.fromStateId,
|
|
@@ -308,28 +308,28 @@ function Pe(e, i) {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
function lt(e, i) {
|
|
311
|
-
const t = V(e) ? e : {},
|
|
312
|
-
if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((
|
|
313
|
-
return { key:
|
|
311
|
+
const t = V(e) ? e : {}, a = G(t.name) ?? `#${i}`, n = G(t.displayName) ?? a, s = t.steps;
|
|
312
|
+
if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((h) => V(h) && typeof h.state == "string")))
|
|
313
|
+
return { key: a, label: n, source: e, rawReason: G(t.triggerType) ?? "automation" };
|
|
314
314
|
const l = rt(t);
|
|
315
|
-
return
|
|
315
|
+
return Ke(Re(l, t), e) ? { key: a, label: n, definition: l, source: e } : { key: a, label: n, source: e, rawReason: "state machine (round-trip)" };
|
|
316
316
|
}
|
|
317
317
|
function ct(e) {
|
|
318
318
|
if (!e.definition)
|
|
319
319
|
return e.source;
|
|
320
320
|
const i = V(e.source) ? e.source : { name: e.definition.id };
|
|
321
|
-
return
|
|
321
|
+
return Re(e.definition, {
|
|
322
322
|
...i,
|
|
323
323
|
name: i.name ?? e.definition.id
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
const dt =
|
|
326
|
+
const dt = Ae({
|
|
327
327
|
id: "workflows",
|
|
328
328
|
label: "Workflows",
|
|
329
329
|
labelKey: "devStudio.kind.workflows",
|
|
330
330
|
icon: "git-branch",
|
|
331
331
|
editor: "workflows",
|
|
332
|
-
match:
|
|
332
|
+
match: B(".workflows.json"),
|
|
333
333
|
property: "workflows",
|
|
334
334
|
itemKey: "name",
|
|
335
335
|
toItem: lt,
|
|
@@ -356,11 +356,11 @@ function pt(e) {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
function mt(e, i) {
|
|
359
|
-
const t = V(e) ? e : {},
|
|
359
|
+
const t = V(e) ? e : {}, a = t.permissions ?? [], n = t.permissionGroups ?? [];
|
|
360
360
|
return {
|
|
361
361
|
...t,
|
|
362
362
|
permissions: i.permissions.map((s) => {
|
|
363
|
-
const r =
|
|
363
|
+
const r = a.find((l) => l.code === s.code);
|
|
364
364
|
return U({ ...r ?? {}, code: s.code, name: s.name, description: s.description });
|
|
365
365
|
}),
|
|
366
366
|
permissionGroups: i.groups.map((s) => {
|
|
@@ -374,23 +374,23 @@ function mt(e, i) {
|
|
|
374
374
|
})
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
const ut =
|
|
377
|
+
const ut = Le({
|
|
378
378
|
id: "permissions",
|
|
379
379
|
label: "Permissions",
|
|
380
380
|
labelKey: "devStudio.kind.permissions",
|
|
381
381
|
icon: "shield",
|
|
382
382
|
editor: "permissions",
|
|
383
|
-
match:
|
|
383
|
+
match: B(".permissions.json"),
|
|
384
384
|
select: pt,
|
|
385
385
|
assign: mt,
|
|
386
386
|
arrayKey: (e) => e === "/permissions" ? "code" : e === "/permissionGroups" ? "name" : void 0
|
|
387
|
-
}), ft =
|
|
387
|
+
}), ft = Le({
|
|
388
388
|
id: "seeds",
|
|
389
389
|
label: "Seed data",
|
|
390
390
|
labelKey: "devStudio.kind.seeds",
|
|
391
391
|
icon: "database",
|
|
392
392
|
editor: "seeds",
|
|
393
|
-
match:
|
|
393
|
+
match: B(".seeds.json"),
|
|
394
394
|
select: (e) => {
|
|
395
395
|
const i = V(e) ? e : {};
|
|
396
396
|
if (!V(i.seeds) || i.demoSeeds !== void 0 && !V(i.demoSeeds))
|
|
@@ -411,10 +411,19 @@ const ut = Ae({
|
|
|
411
411
|
files: [{ path: i[0].path, text: He(e, i[0].text) }]
|
|
412
412
|
})
|
|
413
413
|
}, gt = Je({
|
|
414
|
-
match:
|
|
414
|
+
match: B(".scripts.json"),
|
|
415
415
|
property: "scripts",
|
|
416
416
|
phasesProperty: "scripts"
|
|
417
|
-
}), ht =
|
|
417
|
+
}), ht = Oe({
|
|
418
|
+
id: "dataSources",
|
|
419
|
+
label: "Data sources",
|
|
420
|
+
labelKey: "devStudio.kind.dataSources",
|
|
421
|
+
icon: "database",
|
|
422
|
+
editor: "dataSources",
|
|
423
|
+
match: B(".datasources.json"),
|
|
424
|
+
property: "dataSources",
|
|
425
|
+
itemKey: "key"
|
|
426
|
+
}), wt = [
|
|
418
427
|
Ze,
|
|
419
428
|
Qe,
|
|
420
429
|
et,
|
|
@@ -422,15 +431,16 @@ const ut = Ae({
|
|
|
422
431
|
dt,
|
|
423
432
|
ut,
|
|
424
433
|
ft,
|
|
434
|
+
ht,
|
|
425
435
|
gt,
|
|
426
436
|
yt
|
|
427
|
-
],
|
|
437
|
+
], vt = (e, i) => i, J = (e) => ({
|
|
428
438
|
type: "array",
|
|
429
439
|
title: e,
|
|
430
440
|
items: { type: "string" }
|
|
431
441
|
});
|
|
432
|
-
function
|
|
433
|
-
const t = (s, r) => e(`devStudio.omniverk.${s}`, r),
|
|
442
|
+
function $t(e = vt, i = {}) {
|
|
443
|
+
const t = (s, r) => e(`devStudio.omniverk.${s}`, r), a = {
|
|
434
444
|
type: "object",
|
|
435
445
|
properties: {
|
|
436
446
|
key: { type: "string", title: t("field.key", "Key") },
|
|
@@ -500,11 +510,11 @@ function vt(e = wt, i = {}) {
|
|
|
500
510
|
description: { type: "string", title: t("field.description", "Description") },
|
|
501
511
|
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
502
512
|
color: { type: "string", title: t("field.color", "Colour") },
|
|
503
|
-
parts:
|
|
513
|
+
parts: J(t("field.parts", "Files"))
|
|
504
514
|
}
|
|
505
515
|
}
|
|
506
516
|
},
|
|
507
|
-
i18n:
|
|
517
|
+
i18n: J(t("field.i18n", "Translation files"))
|
|
508
518
|
}
|
|
509
519
|
}
|
|
510
520
|
},
|
|
@@ -514,7 +524,7 @@ function vt(e = wt, i = {}) {
|
|
|
514
524
|
schema: {
|
|
515
525
|
type: "object",
|
|
516
526
|
properties: {
|
|
517
|
-
dependencies:
|
|
527
|
+
dependencies: J(t("field.dependencies", "Required packages")),
|
|
518
528
|
dependencyRefs: {
|
|
519
529
|
type: "array",
|
|
520
530
|
title: t("field.dependencyRefs", "Dependency details"),
|
|
@@ -541,8 +551,8 @@ function vt(e = wt, i = {}) {
|
|
|
541
551
|
}
|
|
542
552
|
}
|
|
543
553
|
},
|
|
544
|
-
provides:
|
|
545
|
-
requiredControls:
|
|
554
|
+
provides: J(t("field.provides", "Provides")),
|
|
555
|
+
requiredControls: J(t("field.requiredControls", "Required controls"))
|
|
546
556
|
}
|
|
547
557
|
}
|
|
548
558
|
},
|
|
@@ -564,7 +574,7 @@ function vt(e = wt, i = {}) {
|
|
|
564
574
|
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
565
575
|
isOptional: { type: "boolean", title: t("field.isOptional", "Optional") },
|
|
566
576
|
order: { type: "integer", title: t("field.order", "Order") },
|
|
567
|
-
fields: { type: "array", title: t("field.fields", "Fields"), items:
|
|
577
|
+
fields: { type: "array", title: t("field.fields", "Fields"), items: a }
|
|
568
578
|
}
|
|
569
579
|
}
|
|
570
580
|
},
|
|
@@ -628,7 +638,7 @@ function vt(e = wt, i = {}) {
|
|
|
628
638
|
fields: {
|
|
629
639
|
type: "array",
|
|
630
640
|
title: t("field.fields", "Fields"),
|
|
631
|
-
items:
|
|
641
|
+
items: a
|
|
632
642
|
}
|
|
633
643
|
}
|
|
634
644
|
}
|
|
@@ -718,8 +728,8 @@ function vt(e = wt, i = {}) {
|
|
|
718
728
|
image: { type: "string", title: t("field.image", "Image") },
|
|
719
729
|
tag: { type: "string", title: t("field.tag", "Tag") },
|
|
720
730
|
description: { type: "string", title: t("field.description", "Description") },
|
|
721
|
-
ports:
|
|
722
|
-
volumes:
|
|
731
|
+
ports: J(t("field.ports", "Ports")),
|
|
732
|
+
volumes: J(t("field.volumes", "Volumes")),
|
|
723
733
|
command: { type: "string", title: t("field.command", "Command") },
|
|
724
734
|
healthCheckCmd: {
|
|
725
735
|
type: "string",
|
|
@@ -809,7 +819,7 @@ function vt(e = wt, i = {}) {
|
|
|
809
819
|
}
|
|
810
820
|
return n;
|
|
811
821
|
}
|
|
812
|
-
const W = "Custom.", Ne = "Core",
|
|
822
|
+
const W = "Custom.", Ne = "Core", bt = {
|
|
813
823
|
string: "string",
|
|
814
824
|
varchar: "string",
|
|
815
825
|
nvarchar: "string",
|
|
@@ -839,7 +849,7 @@ const W = "Custom.", Ne = "Core", $t = {
|
|
|
839
849
|
enum: "enum",
|
|
840
850
|
guid: "Guid",
|
|
841
851
|
uuid: "Guid"
|
|
842
|
-
},
|
|
852
|
+
}, kt = [
|
|
843
853
|
"string",
|
|
844
854
|
"text",
|
|
845
855
|
"int",
|
|
@@ -853,7 +863,7 @@ const W = "Custom.", Ne = "Core", $t = {
|
|
|
853
863
|
"json",
|
|
854
864
|
"enum",
|
|
855
865
|
"Guid"
|
|
856
|
-
],
|
|
866
|
+
], St = {
|
|
857
867
|
ł: "l",
|
|
858
868
|
Ł: "L",
|
|
859
869
|
ß: "ss",
|
|
@@ -862,11 +872,11 @@ const W = "Custom.", Ne = "Core", $t = {
|
|
|
862
872
|
ø: "o",
|
|
863
873
|
Ø: "O"
|
|
864
874
|
};
|
|
865
|
-
function
|
|
866
|
-
return [...e.normalize("NFD")].map((i) =>
|
|
875
|
+
function Nt(e) {
|
|
876
|
+
return [...e.normalize("NFD")].map((i) => St[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
|
|
867
877
|
}
|
|
868
878
|
function P(e) {
|
|
869
|
-
const i =
|
|
879
|
+
const i = Nt(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
|
|
870
880
|
return /^[0-9]/.test(i) ? `M${i}` : i;
|
|
871
881
|
}
|
|
872
882
|
const je = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
|
|
@@ -875,26 +885,26 @@ function he(e) {
|
|
|
875
885
|
(i, t) => t > 0 && je(i) && !je(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
|
|
876
886
|
).join("");
|
|
877
887
|
}
|
|
878
|
-
function
|
|
888
|
+
function jt(e) {
|
|
879
889
|
return (e.startsWith(W) ? e.slice(W.length) : e.split(".").pop() ?? e).toLowerCase().replace(/[^a-z0-9_-]+/g, "") || "module";
|
|
880
890
|
}
|
|
881
|
-
async function
|
|
891
|
+
async function qe(e) {
|
|
882
892
|
const i = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
883
893
|
return new Uint8Array(i);
|
|
884
894
|
}
|
|
885
895
|
const ke = (e) => Array.from(e, (i) => i.toString(16).padStart(2, "0")).join("");
|
|
886
|
-
async function qe(e, i) {
|
|
887
|
-
const t = (await Re(`${e}/${i}`.toLowerCase())).slice(0, 16), o = ke([3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15].map((n) => t[n]));
|
|
888
|
-
return `${o.slice(0, 8)}-${o.slice(8, 12)}-${o.slice(12, 16)}-${o.slice(16, 20)}-${o.slice(20)}`;
|
|
889
|
-
}
|
|
890
896
|
async function Ve(e, i) {
|
|
897
|
+
const t = (await qe(`${e}/${i}`.toLowerCase())).slice(0, 16), a = ke([3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15].map((n) => t[n]));
|
|
898
|
+
return `${a.slice(0, 8)}-${a.slice(8, 12)}-${a.slice(12, 16)}-${a.slice(16, 20)}-${a.slice(20)}`;
|
|
899
|
+
}
|
|
900
|
+
async function Ue(e, i) {
|
|
891
901
|
const t = `custom_${e}_${he(i)}`;
|
|
892
|
-
return t.length <= 63 ? t : `${t.slice(0, 54)}_${ke(await
|
|
902
|
+
return t.length <= 63 ? t : `${t.slice(0, 54)}_${ke(await qe(t)).slice(0, 8)}`;
|
|
893
903
|
}
|
|
894
|
-
function
|
|
895
|
-
const t = new Set([...i].map((
|
|
896
|
-
for (let
|
|
897
|
-
const n =
|
|
904
|
+
function Tt(e, i) {
|
|
905
|
+
const t = new Set([...i].map((a) => a.toLowerCase()));
|
|
906
|
+
for (let a = 1; a < 100; a++) {
|
|
907
|
+
const n = a === 1 ? e : `${e}${a}`;
|
|
898
908
|
if (!t.has(n.toLowerCase()))
|
|
899
909
|
return n;
|
|
900
910
|
}
|
|
@@ -905,7 +915,7 @@ const ne = (e) => e.name.toLowerCase() === "id", q = (e) => {
|
|
|
905
915
|
return (((i = e.displayName) == null ? void 0 : i.trim()) || e.name).trim();
|
|
906
916
|
};
|
|
907
917
|
function se(e) {
|
|
908
|
-
return e.isForeignKey ? "Guid" :
|
|
918
|
+
return e.isForeignKey ? "Guid" : bt[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
|
|
909
919
|
}
|
|
910
920
|
function pe(e) {
|
|
911
921
|
if (e.isForeignKey)
|
|
@@ -930,7 +940,7 @@ function pe(e) {
|
|
|
930
940
|
return ["Text", "input"];
|
|
931
941
|
}
|
|
932
942
|
}
|
|
933
|
-
const
|
|
943
|
+
const Et = {
|
|
934
944
|
lookup: "EntitySelect",
|
|
935
945
|
textarea: "Textarea",
|
|
936
946
|
number: "number",
|
|
@@ -939,10 +949,10 @@ const Tt = {
|
|
|
939
949
|
date: "date",
|
|
940
950
|
datetime: "datetime"
|
|
941
951
|
};
|
|
942
|
-
function
|
|
943
|
-
var
|
|
952
|
+
function xt(e) {
|
|
953
|
+
var a;
|
|
944
954
|
const i = [];
|
|
945
|
-
(!((
|
|
955
|
+
(!((a = e.name) != null && a.trim()) || P(e.name).length === 0) && i.push("The module needs a name with letters or digits."), e.entities.length === 0 && i.push("The module has no entities — add at least one.");
|
|
946
956
|
const t = /* @__PURE__ */ new Set();
|
|
947
957
|
for (const n of e.entities) {
|
|
948
958
|
const s = P(n.name);
|
|
@@ -951,20 +961,20 @@ function Et(e) {
|
|
|
951
961
|
continue;
|
|
952
962
|
}
|
|
953
963
|
t.has(s.toLowerCase()) && i.push(`Entity ${s} appears twice.`), t.add(s.toLowerCase());
|
|
954
|
-
const r = n.fields.filter((
|
|
964
|
+
const r = n.fields.filter((h) => !ne(h));
|
|
955
965
|
r.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
|
|
956
966
|
const l = /* @__PURE__ */ new Set();
|
|
957
|
-
for (const
|
|
958
|
-
const d = P(
|
|
959
|
-
d.length === 0 ? i.push(`${s}: field "${
|
|
967
|
+
for (const h of r) {
|
|
968
|
+
const d = P(h.name);
|
|
969
|
+
d.length === 0 ? i.push(`${s}: field "${h.name}" needs a name with letters or digits.`) : l.has(d.toLowerCase()) ? i.push(`${s}: field ${d} appears twice.`) : l.add(d.toLowerCase());
|
|
960
970
|
}
|
|
961
971
|
}
|
|
962
972
|
return i;
|
|
963
973
|
}
|
|
964
|
-
const
|
|
974
|
+
const It = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), X = (e) => ae(e, { finalNewline: !1 }), H = (e, i) => ({
|
|
965
975
|
icon: { name: e, package: "@nice2dev/icons", style: i }
|
|
966
976
|
});
|
|
967
|
-
function
|
|
977
|
+
function Ct(e) {
|
|
968
978
|
const i = e && /^Ntd[A-Z]/.test(e), t = e && /^[A-Z]\w*Icon$/.test(e);
|
|
969
979
|
return {
|
|
970
980
|
module: {
|
|
@@ -976,204 +986,204 @@ function It(e) {
|
|
|
976
986
|
animation: { type: "none" }
|
|
977
987
|
},
|
|
978
988
|
entities: {},
|
|
979
|
-
views: { list:
|
|
989
|
+
views: { list: H("NtdList", "outline"), form: H("NtdEdit", "outline") },
|
|
980
990
|
permissions: {
|
|
981
|
-
read:
|
|
982
|
-
create:
|
|
983
|
-
update:
|
|
984
|
-
delete:
|
|
985
|
-
admin:
|
|
991
|
+
read: H("NtdEye", "outline"),
|
|
992
|
+
create: H("NtdPlus", "outline"),
|
|
993
|
+
update: H("NtdEdit", "outline"),
|
|
994
|
+
delete: H("NtdTrash", "outline"),
|
|
995
|
+
admin: H("NtdShield", "solid")
|
|
986
996
|
},
|
|
987
997
|
workflowStates: {}
|
|
988
998
|
};
|
|
989
999
|
}
|
|
990
|
-
async function
|
|
991
|
-
var
|
|
992
|
-
const t =
|
|
1000
|
+
async function Ot(e, i = {}) {
|
|
1001
|
+
var v, f, N, C;
|
|
1002
|
+
const t = xt(e);
|
|
993
1003
|
if (t.length > 0)
|
|
994
1004
|
return { problems: t };
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
), s =
|
|
1005
|
+
const a = e.name.toLowerCase().startsWith(W.toLowerCase()), n = P(
|
|
1006
|
+
a ? e.name.slice(W.length) : e.name
|
|
1007
|
+
), s = Tt(
|
|
998
1008
|
W + n,
|
|
999
1009
|
i.existingPackageNames ?? /* @__PURE__ */ new Set()
|
|
1000
|
-
), r = s.slice(W.length), l = r.toLowerCase(),
|
|
1010
|
+
), r = s.slice(W.length), l = r.toLowerCase(), h = `${s}.${Ne}`, d = a ? r : e.name.trim(), p = ((v = e.description) == null ? void 0 : v.trim()) || void 0, k = e.entities.map((j) => ({ ...j, name: P(j.name) })), A = e.views !== !1, S = e.permissions !== !1, T = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], I = e.icon ?? "widgets", b = [], D = [
|
|
1001
1011
|
`${l}.entities.json`,
|
|
1002
|
-
...
|
|
1003
|
-
...
|
|
1012
|
+
...A ? [`${l}.views.json`] : [],
|
|
1013
|
+
...S ? [`${l}.permissions.json`] : []
|
|
1004
1014
|
];
|
|
1005
|
-
|
|
1015
|
+
b.push({
|
|
1006
1016
|
path: `${l}.manifest.json`,
|
|
1007
1017
|
text: X({
|
|
1008
1018
|
packageName: s,
|
|
1009
1019
|
version: "1.0.0",
|
|
1010
1020
|
displayName: d,
|
|
1011
|
-
description:
|
|
1021
|
+
description: p ?? d,
|
|
1012
1022
|
author: "OmniVerk Module Builder",
|
|
1013
1023
|
license: "Proprietary",
|
|
1014
|
-
category: ((
|
|
1015
|
-
icon:
|
|
1016
|
-
exportedAt:
|
|
1024
|
+
category: ((f = e.category) == null ? void 0 : f.trim()) || "Custom",
|
|
1025
|
+
icon: I,
|
|
1026
|
+
exportedAt: It((i.now ?? (() => /* @__PURE__ */ new Date()))()),
|
|
1017
1027
|
modules: [
|
|
1018
1028
|
{
|
|
1019
1029
|
name: Ne,
|
|
1020
1030
|
displayName: d,
|
|
1021
1031
|
description: e.description ?? d,
|
|
1022
|
-
icon:
|
|
1023
|
-
parts:
|
|
1032
|
+
icon: I,
|
|
1033
|
+
parts: D
|
|
1024
1034
|
}
|
|
1025
1035
|
],
|
|
1026
1036
|
dependencies: ["Core.Users"],
|
|
1027
|
-
i18n:
|
|
1037
|
+
i18n: T.map((j) => `${l}.${j}.i18n.json`),
|
|
1028
1038
|
...e.ownerTenantId ? { ownerTenantId: e.ownerTenantId } : {},
|
|
1029
1039
|
...e.sourceDefinitionId ? { sourceDefinitionId: e.sourceDefinitionId } : {}
|
|
1030
1040
|
})
|
|
1031
1041
|
});
|
|
1032
|
-
const
|
|
1033
|
-
for (const
|
|
1034
|
-
const
|
|
1035
|
-
for (const
|
|
1036
|
-
const
|
|
1037
|
-
name: P(
|
|
1038
|
-
displayName: q(
|
|
1039
|
-
dataType:
|
|
1042
|
+
const u = [];
|
|
1043
|
+
for (const j of k) {
|
|
1044
|
+
const O = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
|
|
1045
|
+
for (const w of j.fields.filter((E) => !ne(E))) {
|
|
1046
|
+
const E = se(w), o = {
|
|
1047
|
+
name: P(w.name),
|
|
1048
|
+
displayName: q(w),
|
|
1049
|
+
dataType: E
|
|
1040
1050
|
};
|
|
1041
|
-
|
|
1051
|
+
E === "string" && (o.maxLength = w.maxLength && w.maxLength > 0 ? w.maxLength : 200), w.isRequired && (o.isRequired = !0), w.isUnique && (o.isUnique = !0), (w.isIndexed || w.isForeignKey) && (o.isIndexed = !0), w.isForeignKey && (o.isForeignKey = !0, w.referencedEntity && (o.referencedEntity = P(w.referencedEntity))), (N = w.defaultValue) != null && N.trim() && (o.defaultValue = w.defaultValue), (C = w.description) != null && C.trim() && (o.description = w.description), O.push(o);
|
|
1042
1052
|
}
|
|
1043
|
-
|
|
1044
|
-
id: await
|
|
1045
|
-
name:
|
|
1046
|
-
displayName: q(
|
|
1047
|
-
tableName: await
|
|
1048
|
-
description:
|
|
1049
|
-
entityIcon:
|
|
1053
|
+
u.push({
|
|
1054
|
+
id: await Ve(s, j.name),
|
|
1055
|
+
name: j.name,
|
|
1056
|
+
displayName: q(j),
|
|
1057
|
+
tableName: await Ue(l, j.name),
|
|
1058
|
+
description: j.description ?? q(j),
|
|
1059
|
+
entityIcon: j.icon ?? "table_rows",
|
|
1050
1060
|
isAudited: !0,
|
|
1051
1061
|
isSoftDeleteEnabled: !1,
|
|
1052
|
-
fields:
|
|
1062
|
+
fields: O
|
|
1053
1063
|
});
|
|
1054
1064
|
}
|
|
1055
|
-
if (
|
|
1065
|
+
if (b.push({
|
|
1056
1066
|
path: `${l}.entities.json`,
|
|
1057
|
-
text: X({ moduleName:
|
|
1058
|
-
}),
|
|
1059
|
-
const
|
|
1060
|
-
const
|
|
1061
|
-
(
|
|
1067
|
+
text: X({ moduleName: h, version: "1.0.0", entities: u })
|
|
1068
|
+
}), A) {
|
|
1069
|
+
const j = (w) => {
|
|
1070
|
+
const E = k.find((c) => c.name === P(w)), o = E == null ? void 0 : E.fields.find(
|
|
1071
|
+
(c) => !ne(c) && !c.isForeignKey && se(c) === "string"
|
|
1062
1072
|
);
|
|
1063
|
-
return
|
|
1064
|
-
},
|
|
1065
|
-
for (const
|
|
1066
|
-
const
|
|
1067
|
-
field: P(
|
|
1068
|
-
displayName: q(
|
|
1073
|
+
return o ? P(o.name) : "Name";
|
|
1074
|
+
}, O = [];
|
|
1075
|
+
for (const w of k) {
|
|
1076
|
+
const E = w.fields.filter((m) => !ne(m)), o = E.filter((m) => !["text", "json"].includes(se(m))).slice(0, 6), c = (o.length ? o : [E[0]]).map((m) => ({
|
|
1077
|
+
field: P(m.name),
|
|
1078
|
+
displayName: q(m),
|
|
1069
1079
|
sortable: !0,
|
|
1070
|
-
type: pe(
|
|
1071
|
-
...
|
|
1072
|
-
})),
|
|
1073
|
-
field: P(
|
|
1074
|
-
type:
|
|
1075
|
-
label: q(
|
|
1076
|
-
...
|
|
1077
|
-
...
|
|
1078
|
-
entity: P(
|
|
1079
|
-
displayField:
|
|
1080
|
+
type: pe(m)[0],
|
|
1081
|
+
...m.isForeignKey && m.referencedEntity ? { referencedEntity: P(m.referencedEntity) } : {}
|
|
1082
|
+
})), y = E.filter((m) => ["string", "text"].includes(se(m))).map((m) => P(m.name)), g = E.map((m) => ({
|
|
1083
|
+
field: P(m.name),
|
|
1084
|
+
type: Et[pe(m)[1]] ?? "TextInput",
|
|
1085
|
+
label: q(m),
|
|
1086
|
+
...m.isRequired ? { required: !0 } : {},
|
|
1087
|
+
...m.isForeignKey && m.referencedEntity ? {
|
|
1088
|
+
entity: P(m.referencedEntity),
|
|
1089
|
+
displayField: j(m.referencedEntity)
|
|
1080
1090
|
} : {}
|
|
1081
1091
|
}));
|
|
1082
|
-
|
|
1083
|
-
id: `vw-${l}-${he(
|
|
1084
|
-
name: `${
|
|
1085
|
-
displayName: q(
|
|
1092
|
+
O.push({
|
|
1093
|
+
id: `vw-${l}-${he(w.name)}-list`,
|
|
1094
|
+
name: `${w.name}List`,
|
|
1095
|
+
displayName: q(w),
|
|
1086
1096
|
type: "List",
|
|
1087
1097
|
icon: "list",
|
|
1088
|
-
entityName:
|
|
1089
|
-
columns:
|
|
1090
|
-
searchFields:
|
|
1098
|
+
entityName: w.name,
|
|
1099
|
+
columns: c,
|
|
1100
|
+
searchFields: y,
|
|
1091
1101
|
pageSize: 25,
|
|
1092
|
-
createControls:
|
|
1102
|
+
createControls: g,
|
|
1093
1103
|
allowEdit: !0,
|
|
1094
1104
|
allowDelete: !0
|
|
1095
1105
|
});
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1106
|
+
const x = E.map((m) => {
|
|
1107
|
+
const $ = pe(m)[1];
|
|
1098
1108
|
return {
|
|
1099
|
-
field: P(
|
|
1100
|
-
type:
|
|
1101
|
-
label: q(
|
|
1102
|
-
colSpan:
|
|
1103
|
-
...
|
|
1104
|
-
...
|
|
1109
|
+
field: P(m.name),
|
|
1110
|
+
type: $,
|
|
1111
|
+
label: q(m),
|
|
1112
|
+
colSpan: $ === "textarea" ? 12 : 6,
|
|
1113
|
+
...m.isRequired ? { required: !0 } : {},
|
|
1114
|
+
...m.isForeignKey && m.referencedEntity ? { entity: P(m.referencedEntity) } : {}
|
|
1105
1115
|
};
|
|
1106
1116
|
});
|
|
1107
|
-
|
|
1108
|
-
id: `vw-${l}-${he(
|
|
1109
|
-
name: `${
|
|
1110
|
-
displayName: q(
|
|
1117
|
+
O.push({
|
|
1118
|
+
id: `vw-${l}-${he(w.name)}-form`,
|
|
1119
|
+
name: `${w.name}Form`,
|
|
1120
|
+
displayName: q(w),
|
|
1111
1121
|
type: "Form",
|
|
1112
1122
|
icon: "edit",
|
|
1113
|
-
entityName:
|
|
1123
|
+
entityName: w.name,
|
|
1114
1124
|
tabs: [
|
|
1115
1125
|
{
|
|
1116
1126
|
name: "Main",
|
|
1117
|
-
displayName: q(
|
|
1118
|
-
sections: [{ name: "Details", displayName: "Details", controls:
|
|
1127
|
+
displayName: q(w),
|
|
1128
|
+
sections: [{ name: "Details", displayName: "Details", controls: x }]
|
|
1119
1129
|
}
|
|
1120
1130
|
]
|
|
1121
1131
|
});
|
|
1122
1132
|
}
|
|
1123
|
-
|
|
1133
|
+
b.push({
|
|
1124
1134
|
path: `${l}.views.json`,
|
|
1125
|
-
text: X({ moduleName:
|
|
1135
|
+
text: X({ moduleName: h, version: "1.0.0", views: O })
|
|
1126
1136
|
});
|
|
1127
1137
|
}
|
|
1128
|
-
if (
|
|
1129
|
-
const
|
|
1130
|
-
code:
|
|
1131
|
-
name: `${d} — ${
|
|
1132
|
-
description: `${
|
|
1133
|
-
}),
|
|
1134
|
-
name: `${W}${r} ${
|
|
1135
|
-
description: `${d} — ${
|
|
1136
|
-
permissions:
|
|
1138
|
+
if (S) {
|
|
1139
|
+
const j = (E) => `${r}.${E}`, O = (E, o) => ({
|
|
1140
|
+
code: j(E),
|
|
1141
|
+
name: `${d} — ${o}`,
|
|
1142
|
+
description: `${o}: ${d}`
|
|
1143
|
+
}), w = (E, o, ...c) => ({
|
|
1144
|
+
name: `${W}${r} ${E}`,
|
|
1145
|
+
description: `${d} — ${o}`,
|
|
1146
|
+
permissions: c.map(j)
|
|
1137
1147
|
});
|
|
1138
|
-
|
|
1148
|
+
b.push({
|
|
1139
1149
|
path: `${l}.permissions.json`,
|
|
1140
1150
|
text: X({
|
|
1141
|
-
moduleName:
|
|
1151
|
+
moduleName: h,
|
|
1142
1152
|
version: "1.0.0",
|
|
1143
1153
|
permissions: [
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1154
|
+
O("Read", "view records"),
|
|
1155
|
+
O("Create", "add records"),
|
|
1156
|
+
O("Edit", "edit records"),
|
|
1157
|
+
O("Delete", "delete records"),
|
|
1158
|
+
O("Admin", "administer the module")
|
|
1149
1159
|
],
|
|
1150
1160
|
permissionGroups: [
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1161
|
+
w("Viewer", "read only", "Read"),
|
|
1162
|
+
w("Editor", "read and edit", "Read", "Create", "Edit"),
|
|
1163
|
+
w("Admin", "full access", "Read", "Create", "Edit", "Delete", "Admin")
|
|
1154
1164
|
]
|
|
1155
1165
|
})
|
|
1156
1166
|
});
|
|
1157
1167
|
}
|
|
1158
|
-
for (const
|
|
1159
|
-
const
|
|
1168
|
+
for (const j of T) {
|
|
1169
|
+
const O = {
|
|
1160
1170
|
"module.displayName": d,
|
|
1161
|
-
"module.description":
|
|
1171
|
+
"module.description": p ?? d
|
|
1162
1172
|
};
|
|
1163
|
-
for (const
|
|
1164
|
-
|
|
1165
|
-
for (const
|
|
1166
|
-
|
|
1167
|
-
|
|
1173
|
+
for (const w of k) {
|
|
1174
|
+
O[`entity.${w.name}.displayName`] = q(w);
|
|
1175
|
+
for (const E of w.fields.filter((o) => !ne(o)))
|
|
1176
|
+
O[`field.${w.name}.${P(E.name)}.displayName`] = q(E);
|
|
1177
|
+
A && (O[`view.${w.name}List.displayName`] = q(w), O[`view.${w.name}Form.displayName`] = q(w), O[`view.${w.name}Form.tab.Main`] = q(w), O[`view.${w.name}Form.section.Details`] = j === "pl" ? "Szczegóły" : "Details");
|
|
1168
1178
|
}
|
|
1169
|
-
|
|
1170
|
-
path: `${l}.${
|
|
1171
|
-
text: X({ moduleName: s, locale:
|
|
1179
|
+
b.push({
|
|
1180
|
+
path: `${l}.${j}.i18n.json`,
|
|
1181
|
+
text: X({ moduleName: s, locale: j, version: "1.0.0", translations: O })
|
|
1172
1182
|
});
|
|
1173
1183
|
}
|
|
1174
|
-
return e.iconConfig !== !1 &&
|
|
1184
|
+
return e.iconConfig !== !1 && b.push({ path: `${l}.iconconfig.json`, text: X(Ct(e.icon)) }), { package: { packageName: s, folder: `Custom/${r}`, files: b }, problems: [] };
|
|
1175
1185
|
}
|
|
1176
|
-
function
|
|
1186
|
+
function At(e) {
|
|
1177
1187
|
const i = (t) => typeof t == "string" && t ? t : void 0;
|
|
1178
1188
|
return {
|
|
1179
1189
|
name: e.name,
|
|
@@ -1188,103 +1198,103 @@ function Ot(e) {
|
|
|
1188
1198
|
displayName: i(t.displayName),
|
|
1189
1199
|
description: i(t.description),
|
|
1190
1200
|
icon: i(t.entityIcon) ?? i(t.icon),
|
|
1191
|
-
fields: (Array.isArray(t.fields) ? t.fields : []).map((
|
|
1192
|
-
name: String(
|
|
1193
|
-
displayName: i(
|
|
1194
|
-
dataType: i(
|
|
1195
|
-
isRequired:
|
|
1196
|
-
maxLength: typeof
|
|
1197
|
-
isUnique:
|
|
1198
|
-
isIndexed:
|
|
1199
|
-
isForeignKey:
|
|
1200
|
-
referencedEntity: i(
|
|
1201
|
-
defaultValue:
|
|
1202
|
-
description: i(
|
|
1201
|
+
fields: (Array.isArray(t.fields) ? t.fields : []).map((a) => ({
|
|
1202
|
+
name: String(a.name ?? ""),
|
|
1203
|
+
displayName: i(a.displayName),
|
|
1204
|
+
dataType: i(a.dataType) ?? i(a.type),
|
|
1205
|
+
isRequired: a.isRequired === !0 || a.required === !0,
|
|
1206
|
+
maxLength: typeof a.maxLength == "number" ? a.maxLength : void 0,
|
|
1207
|
+
isUnique: a.isUnique === !0,
|
|
1208
|
+
isIndexed: a.isIndexed === !0,
|
|
1209
|
+
isForeignKey: a.isForeignKey === !0,
|
|
1210
|
+
referencedEntity: i(a.referencedEntity),
|
|
1211
|
+
defaultValue: a.defaultValue === void 0 || a.defaultValue === null ? void 0 : String(a.defaultValue),
|
|
1212
|
+
description: i(a.description)
|
|
1203
1213
|
}))
|
|
1204
1214
|
}))
|
|
1205
1215
|
};
|
|
1206
1216
|
}
|
|
1207
|
-
const
|
|
1217
|
+
const Z = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1208
1218
|
function we(e, i) {
|
|
1209
|
-
return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) => we(t, i)) :
|
|
1219
|
+
return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) => we(t, i)) : Z(e) ? Object.fromEntries(Object.entries(e).map(([t, a]) => [t, we(a, i)])) : e;
|
|
1210
1220
|
}
|
|
1211
|
-
const
|
|
1212
|
-
async function
|
|
1221
|
+
const Lt = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1222
|
+
async function Kt(e, i) {
|
|
1213
1223
|
const t = e.find(
|
|
1214
|
-
(
|
|
1224
|
+
(b) => !b.path.includes("/") && b.path.toLowerCase().endsWith(".manifest.json")
|
|
1215
1225
|
);
|
|
1216
1226
|
if (!t)
|
|
1217
1227
|
throw new Error("The module has no manifest.");
|
|
1218
|
-
const
|
|
1219
|
-
for (const
|
|
1228
|
+
const a = _(t.text).value, n = String(a.packageName ?? ""), s = t.path.slice(0, -14), r = i.id, l = jt(r), h = (b) => b.startsWith(W) ? b.slice(W.length) : b.split(".").pop() ?? b, d = h(n), p = h(r), k = (b) => b.startsWith(`${s}.`) ? `${l}${b.slice(s.length)}` : b, A = new Map(e.map((b) => [b.path, k(b.path)])), S = /* @__PURE__ */ new Map();
|
|
1229
|
+
for (const b of e.filter((D) => D.path.toLowerCase().endsWith(".permissions.json")))
|
|
1220
1230
|
try {
|
|
1221
|
-
const
|
|
1222
|
-
for (const
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1231
|
+
const D = _(b.text).value;
|
|
1232
|
+
for (const u of Z(D) && Array.isArray(D.permissions) ? D.permissions : []) {
|
|
1233
|
+
const v = typeof u.code == "string" ? u.code : "";
|
|
1234
|
+
v.startsWith(`${d}.`) && S.set(v, `${p}${v.slice(d.length)}`);
|
|
1225
1235
|
}
|
|
1226
1236
|
} catch {
|
|
1227
1237
|
}
|
|
1228
|
-
const
|
|
1229
|
-
for (const
|
|
1230
|
-
if (
|
|
1238
|
+
const T = (b) => n && (b === n || b.startsWith(`${n}.`) || b.startsWith(`${n} `)) ? r + b.slice(n.length) : S.get(b) ?? A.get(b) ?? b, I = [];
|
|
1239
|
+
for (const b of e) {
|
|
1240
|
+
if (b.path.startsWith(".revisions/"))
|
|
1231
1241
|
continue;
|
|
1232
|
-
const
|
|
1233
|
-
if (!
|
|
1234
|
-
|
|
1242
|
+
const D = k(b.path);
|
|
1243
|
+
if (!b.path.toLowerCase().endsWith(".json")) {
|
|
1244
|
+
I.push({ path: D, text: b.text });
|
|
1235
1245
|
continue;
|
|
1236
1246
|
}
|
|
1237
|
-
let
|
|
1247
|
+
let u;
|
|
1238
1248
|
try {
|
|
1239
|
-
|
|
1249
|
+
u = _(b.text).value;
|
|
1240
1250
|
} catch {
|
|
1241
|
-
|
|
1251
|
+
I.push({ path: D, text: b.text });
|
|
1242
1252
|
continue;
|
|
1243
1253
|
}
|
|
1244
|
-
let
|
|
1245
|
-
if (
|
|
1246
|
-
const { sourceDefinitionId:
|
|
1247
|
-
|
|
1248
|
-
...
|
|
1254
|
+
let v = we(u, T);
|
|
1255
|
+
if (b === t && Z(v)) {
|
|
1256
|
+
const { sourceDefinitionId: f, ...N } = v;
|
|
1257
|
+
v = {
|
|
1258
|
+
...N,
|
|
1249
1259
|
packageName: r,
|
|
1250
1260
|
...i.name ? { displayName: i.name } : {},
|
|
1251
1261
|
...i.packageId ? { category: i.packageId } : {}
|
|
1252
1262
|
};
|
|
1253
1263
|
}
|
|
1254
|
-
if (
|
|
1255
|
-
const
|
|
1256
|
-
for (const
|
|
1257
|
-
if (!
|
|
1258
|
-
|
|
1264
|
+
if (b.path.toLowerCase().endsWith(".entities.json") && Z(v) && Array.isArray(v.entities)) {
|
|
1265
|
+
const f = [];
|
|
1266
|
+
for (const N of v.entities) {
|
|
1267
|
+
if (!Z(N) || typeof N.name != "string") {
|
|
1268
|
+
f.push(N);
|
|
1259
1269
|
continue;
|
|
1260
1270
|
}
|
|
1261
|
-
|
|
1262
|
-
...
|
|
1263
|
-
...typeof
|
|
1264
|
-
...typeof
|
|
1271
|
+
f.push({
|
|
1272
|
+
...N,
|
|
1273
|
+
...typeof N.id == "string" && Lt.test(N.id) ? { id: await Ve(r, N.name) } : {},
|
|
1274
|
+
...typeof N.tableName == "string" ? { tableName: await Ue(l, N.name) } : {}
|
|
1265
1275
|
});
|
|
1266
1276
|
}
|
|
1267
|
-
|
|
1277
|
+
v = { ...v, entities: f };
|
|
1268
1278
|
}
|
|
1269
|
-
i.name && /\.en\.i18n\.json$/i.test(
|
|
1270
|
-
...
|
|
1271
|
-
translations: { ...
|
|
1272
|
-
}),
|
|
1279
|
+
i.name && /\.en\.i18n\.json$/i.test(b.path) && Z(v) && Z(v.translations) && typeof v.translations["module.displayName"] == "string" && (v = {
|
|
1280
|
+
...v,
|
|
1281
|
+
translations: { ...v.translations, "module.displayName": i.name }
|
|
1282
|
+
}), I.push({ path: D, text: De(b.text, v) });
|
|
1273
1283
|
}
|
|
1274
1284
|
return {
|
|
1275
1285
|
id: r,
|
|
1276
|
-
packageId: i.packageId ??
|
|
1277
|
-
files:
|
|
1286
|
+
packageId: i.packageId ?? a.category,
|
|
1287
|
+
files: I
|
|
1278
1288
|
};
|
|
1279
1289
|
}
|
|
1280
|
-
const
|
|
1290
|
+
const M = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ee = (e, i) => M(e) && Array.isArray(e[i]) ? e[i] : [], oe = (e, i) => e.toLowerCase().endsWith(i), ve = (e) => !e.includes("/"), Dt = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Mt = [
|
|
1281
1291
|
"ING Bank Śląski",
|
|
1282
1292
|
"Bank Śląski",
|
|
1283
1293
|
"BOŚ",
|
|
1284
1294
|
"e-Zamówienia",
|
|
1285
1295
|
"eZamówienia",
|
|
1286
1296
|
"Plataforma de Contratación del Sector Público"
|
|
1287
|
-
], re = (e) =>
|
|
1297
|
+
], re = (e) => Dt.test(Mt.reduce((i, t) => i.split(t).join(""), e)), Ft = /* @__PURE__ */ new Set([
|
|
1288
1298
|
"module",
|
|
1289
1299
|
"entity",
|
|
1290
1300
|
"field",
|
|
@@ -1293,8 +1303,8 @@ const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ee = (
|
|
|
1293
1303
|
"nav",
|
|
1294
1304
|
"action",
|
|
1295
1305
|
"tutorial"
|
|
1296
|
-
]),
|
|
1297
|
-
function
|
|
1306
|
+
]), Pt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
|
|
1307
|
+
function Rt(e) {
|
|
1298
1308
|
for (let i = 0; i < e.length; i++) {
|
|
1299
1309
|
const t = e.charCodeAt(i);
|
|
1300
1310
|
if (t >= 55296 && t <= 56319 || t >= 9728 && t <= 10175)
|
|
@@ -1303,12 +1313,12 @@ function Pt(e) {
|
|
|
1303
1313
|
return !1;
|
|
1304
1314
|
}
|
|
1305
1315
|
function Te(e) {
|
|
1306
|
-
if (!
|
|
1316
|
+
if (!M(e))
|
|
1307
1317
|
return [];
|
|
1308
|
-
const i =
|
|
1318
|
+
const i = M(e.translations) ? e.translations : M(e.keys) ? e.keys : void 0;
|
|
1309
1319
|
return i ? Object.entries(i) : [];
|
|
1310
1320
|
}
|
|
1311
|
-
const Ee = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i,
|
|
1321
|
+
const Ee = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, qt = /* @__PURE__ */ new Set([
|
|
1312
1322
|
"hotel.views.json",
|
|
1313
1323
|
"restaurant.views.json",
|
|
1314
1324
|
"backup-dr.views.json",
|
|
@@ -1317,286 +1327,287 @@ const Ee = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Rt = /* @__PU
|
|
|
1317
1327
|
"shelf_management.views.json",
|
|
1318
1328
|
"psa.views.json"
|
|
1319
1329
|
]);
|
|
1320
|
-
function
|
|
1330
|
+
function Vt(e, i = {}) {
|
|
1331
|
+
var D;
|
|
1321
1332
|
const t = new Set(
|
|
1322
|
-
[...i.legacyListViewFiles ??
|
|
1323
|
-
(
|
|
1333
|
+
[...i.legacyListViewFiles ?? qt].map(
|
|
1334
|
+
(u) => u.toLowerCase()
|
|
1324
1335
|
)
|
|
1325
|
-
),
|
|
1326
|
-
|
|
1336
|
+
), a = [], n = (u) => {
|
|
1337
|
+
a.push({ severity: "error", ...u });
|
|
1327
1338
|
}, s = [];
|
|
1328
|
-
for (const
|
|
1329
|
-
if (!(!oe(
|
|
1339
|
+
for (const u of e.files)
|
|
1340
|
+
if (!(!oe(u.path, ".json") || u.path.startsWith(".revisions/")))
|
|
1330
1341
|
try {
|
|
1331
|
-
s.push({ file:
|
|
1342
|
+
s.push({ file: u, value: _(u.text).value });
|
|
1332
1343
|
} catch (v) {
|
|
1333
1344
|
n({
|
|
1334
1345
|
code: "json.invalid",
|
|
1335
|
-
message: `${
|
|
1346
|
+
message: `${u.path} is not valid JSON: ${v instanceof Error ? v.message : String(v)}`,
|
|
1336
1347
|
messageKey: "devStudio.issue.jsonInvalid",
|
|
1337
|
-
params: { path:
|
|
1338
|
-
path:
|
|
1348
|
+
params: { path: u.path, error: v instanceof Error ? v.message : String(v) },
|
|
1349
|
+
path: u.path
|
|
1339
1350
|
});
|
|
1340
1351
|
}
|
|
1341
|
-
const r = (
|
|
1352
|
+
const r = (u) => s.filter((v) => ve(v.file.path) && oe(v.file.path, u)), l = r(".manifest.json");
|
|
1342
1353
|
l.length === 0 && n({
|
|
1343
1354
|
code: "manifest.missing",
|
|
1344
1355
|
message: "The module has no *.manifest.json.",
|
|
1345
1356
|
messageKey: "devStudio.issue.manifestMissing"
|
|
1346
1357
|
});
|
|
1347
|
-
for (const { file:
|
|
1358
|
+
for (const { file: u, value: v } of l)
|
|
1348
1359
|
for (const f of ["packageName", "version", "category"])
|
|
1349
|
-
(!
|
|
1360
|
+
(!M(v) || !(f in v)) && n({
|
|
1350
1361
|
code: "manifest.required",
|
|
1351
1362
|
message: `The manifest needs "${f}".`,
|
|
1352
1363
|
messageKey: "devStudio.issue.manifestRequired",
|
|
1353
1364
|
params: { field: f },
|
|
1354
|
-
path:
|
|
1365
|
+
path: u.path,
|
|
1355
1366
|
pointer: `/${f}`
|
|
1356
1367
|
});
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1368
|
+
const h = r(".iconconfig.json");
|
|
1369
|
+
h.length === 0 && e.contents !== "manifest" && n({
|
|
1359
1370
|
severity: "info",
|
|
1360
1371
|
code: "iconconfig.missing",
|
|
1361
1372
|
message: "The module has no *.iconconfig.json: its menu shows a default icon (the CI wants one in every Category/Module folder).",
|
|
1362
1373
|
messageKey: "devStudio.issue.iconconfigMissing"
|
|
1363
1374
|
});
|
|
1364
|
-
for (const { file:
|
|
1365
|
-
const f =
|
|
1366
|
-
...
|
|
1367
|
-
...
|
|
1368
|
-
...
|
|
1369
|
-
...
|
|
1375
|
+
for (const { file: u, value: v } of h) {
|
|
1376
|
+
const f = M(v) ? v.module : void 0, N = M(f) ? f.icon : void 0, C = [
|
|
1377
|
+
...M(f) ? [] : ["module"],
|
|
1378
|
+
...M(f) && !M(N) ? ["module.icon"] : [],
|
|
1379
|
+
...M(N) && !("name" in N) ? ["module.icon.name"] : [],
|
|
1380
|
+
...M(N) && !("package" in N) ? ["module.icon.package"] : [],
|
|
1370
1381
|
...["views", "permissions", "workflowStates"].filter(
|
|
1371
|
-
(
|
|
1382
|
+
(j) => !M(v) || !(j in v)
|
|
1372
1383
|
)
|
|
1373
1384
|
];
|
|
1374
|
-
for (const
|
|
1385
|
+
for (const j of C)
|
|
1375
1386
|
n({
|
|
1376
1387
|
code: "iconconfig.structure",
|
|
1377
|
-
message: `The icon config needs "${
|
|
1388
|
+
message: `The icon config needs "${j}".`,
|
|
1378
1389
|
messageKey: "devStudio.issue.iconconfigStructure",
|
|
1379
|
-
params: { field:
|
|
1380
|
-
path:
|
|
1381
|
-
pointer: `/${
|
|
1390
|
+
params: { field: j },
|
|
1391
|
+
path: u.path,
|
|
1392
|
+
pointer: `/${j.split(".").join("/")}`
|
|
1382
1393
|
});
|
|
1383
1394
|
}
|
|
1384
|
-
const d = [],
|
|
1385
|
-
for (const { file:
|
|
1386
|
-
if (!
|
|
1395
|
+
const d = [], p = [];
|
|
1396
|
+
for (const { file: u, value: v } of r(".entities.json")) {
|
|
1397
|
+
if (!M(v) || !("entities" in v))
|
|
1387
1398
|
continue;
|
|
1388
|
-
const f = [],
|
|
1389
|
-
if (!Array.isArray(
|
|
1399
|
+
const f = [], N = v.entities;
|
|
1400
|
+
if (!Array.isArray(N) || N.length === 0) {
|
|
1390
1401
|
n({
|
|
1391
1402
|
code: "entities.empty",
|
|
1392
1403
|
message: "The file has no entities.",
|
|
1393
1404
|
messageKey: "devStudio.issue.entitiesEmpty",
|
|
1394
|
-
path:
|
|
1405
|
+
path: u.path,
|
|
1395
1406
|
pointer: "/entities"
|
|
1396
1407
|
});
|
|
1397
1408
|
continue;
|
|
1398
1409
|
}
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
if (
|
|
1410
|
+
N.forEach((C, j) => {
|
|
1411
|
+
const O = `/entities/${j}`, w = M(C) && typeof C.name == "string" ? C.name : void 0;
|
|
1412
|
+
if (w ? d.push(w) : n({
|
|
1402
1413
|
code: "entities.name",
|
|
1403
|
-
message: `Entity #${
|
|
1414
|
+
message: `Entity #${j + 1} has no name.`,
|
|
1404
1415
|
messageKey: "devStudio.issue.entitiesName",
|
|
1405
|
-
params: { n:
|
|
1406
|
-
path:
|
|
1407
|
-
pointer:
|
|
1408
|
-
}), !
|
|
1416
|
+
params: { n: j + 1 },
|
|
1417
|
+
path: u.path,
|
|
1418
|
+
pointer: O
|
|
1419
|
+
}), !M(C) || !Array.isArray(C.fields)) {
|
|
1409
1420
|
n({
|
|
1410
1421
|
code: "entities.fields",
|
|
1411
|
-
message: `Entity ${
|
|
1422
|
+
message: `Entity ${w ?? `#${j + 1}`} has no fields array.`,
|
|
1412
1423
|
messageKey: "devStudio.issue.entitiesFields",
|
|
1413
|
-
params: { name:
|
|
1414
|
-
path:
|
|
1415
|
-
pointer:
|
|
1424
|
+
params: { name: w ?? `#${j + 1}` },
|
|
1425
|
+
path: u.path,
|
|
1426
|
+
pointer: O
|
|
1416
1427
|
});
|
|
1417
1428
|
return;
|
|
1418
1429
|
}
|
|
1419
|
-
|
|
1430
|
+
M(C) && typeof C.displayName == "string" && re(C.displayName) && n({
|
|
1420
1431
|
code: "labels.polish",
|
|
1421
|
-
message: `Entity ${
|
|
1432
|
+
message: `Entity ${w}: the display name "${C.displayName}" is Polish — seed labels are English, Polish goes to the .pl bundle.`,
|
|
1422
1433
|
messageKey: "devStudio.issue.polishEntity",
|
|
1423
|
-
params: { name:
|
|
1424
|
-
path:
|
|
1425
|
-
pointer: `${
|
|
1426
|
-
}),
|
|
1427
|
-
if (!
|
|
1434
|
+
params: { name: w ?? "", text: C.displayName },
|
|
1435
|
+
path: u.path,
|
|
1436
|
+
pointer: `${O}/displayName`
|
|
1437
|
+
}), C.fields.forEach((E, o) => {
|
|
1438
|
+
if (!M(E))
|
|
1428
1439
|
return;
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1440
|
+
const c = typeof E.name == "string" ? E.name : void 0, y = `${O}/fields/${o}`;
|
|
1441
|
+
w && c && E.isPrimaryKey !== !0 && p.push(`field.${w}.${c}`);
|
|
1442
|
+
const g = typeof E.dataType == "string" ? E.dataType.replace(/\?+$/, "") : void 0;
|
|
1443
|
+
g === void 0 && typeof E.type == "string" && f.push({ name: `${w}.${c}`, pointer: `${y}/type` }), g && Pt.has(g.toLowerCase()) && (c === "Id" || E.isForeignKey === !0) && n({
|
|
1433
1444
|
code: "entities.keyNotGuid",
|
|
1434
|
-
message: `${
|
|
1445
|
+
message: `${w}.${c} is ${g}: keys must be Guid (every row's Id is a uuid).`,
|
|
1435
1446
|
messageKey: "devStudio.issue.keyNotGuid",
|
|
1436
|
-
params: { name: `${
|
|
1437
|
-
path:
|
|
1438
|
-
pointer: `${
|
|
1439
|
-
}), typeof
|
|
1447
|
+
params: { name: `${w}.${c}`, type: g },
|
|
1448
|
+
path: u.path,
|
|
1449
|
+
pointer: `${y}/dataType`
|
|
1450
|
+
}), typeof E.displayName == "string" && re(E.displayName) && n({
|
|
1440
1451
|
code: "labels.polish",
|
|
1441
|
-
message: `${
|
|
1452
|
+
message: `${w}.${c}: the display name "${E.displayName}" is Polish — seed labels are English.`,
|
|
1442
1453
|
messageKey: "devStudio.issue.polishField",
|
|
1443
|
-
params: { name: `${
|
|
1444
|
-
path:
|
|
1445
|
-
pointer: `${
|
|
1454
|
+
params: { name: `${w}.${c}`, text: E.displayName },
|
|
1455
|
+
path: u.path,
|
|
1456
|
+
pointer: `${y}/displayName`
|
|
1446
1457
|
});
|
|
1447
1458
|
});
|
|
1448
1459
|
}), f.length && n({
|
|
1449
1460
|
severity: "warning",
|
|
1450
1461
|
code: "entities.typeIgnored",
|
|
1451
|
-
message: `${f.length} field(s) give their type as "type", which installing ignores — it reads "dataType": ${f.slice(0, 5).map((
|
|
1462
|
+
message: `${f.length} field(s) give their type as "type", which installing ignores — it reads "dataType": ${f.slice(0, 5).map((C) => C.name).join(", ")}${f.length > 5 ? ", …" : ""}`,
|
|
1452
1463
|
messageKey: "devStudio.issue.typeIgnored",
|
|
1453
1464
|
params: {
|
|
1454
1465
|
count: f.length,
|
|
1455
|
-
names: `${f.slice(0, 5).map((
|
|
1466
|
+
names: `${f.slice(0, 5).map((C) => C.name).join(", ")}${f.length > 5 ? ", …" : ""}`
|
|
1456
1467
|
},
|
|
1457
|
-
path:
|
|
1468
|
+
path: u.path,
|
|
1458
1469
|
pointer: f[0].pointer
|
|
1459
1470
|
});
|
|
1460
1471
|
}
|
|
1461
|
-
for (const { file:
|
|
1462
|
-
(!
|
|
1472
|
+
for (const { file: u, value: v } of r(".permissions.json"))
|
|
1473
|
+
(!M(v) || !Array.isArray(v.permissions) || v.permissions.length === 0) && n({
|
|
1463
1474
|
code: "permissions.empty",
|
|
1464
1475
|
message: 'The file needs a non-empty "permissions" array.',
|
|
1465
1476
|
messageKey: "devStudio.issue.permissionsEmpty",
|
|
1466
|
-
path:
|
|
1477
|
+
path: u.path,
|
|
1467
1478
|
pointer: "/permissions"
|
|
1468
1479
|
});
|
|
1469
|
-
const
|
|
1470
|
-
for (const { file:
|
|
1471
|
-
if (!
|
|
1480
|
+
const k = [];
|
|
1481
|
+
for (const { file: u, value: v } of r(".views.json")) {
|
|
1482
|
+
if (!M(v) || Object.keys(v).length === 0) {
|
|
1472
1483
|
n({
|
|
1473
1484
|
code: "views.empty",
|
|
1474
1485
|
message: "A views file is a JSON object with at least one property.",
|
|
1475
1486
|
messageKey: "devStudio.issue.viewsEmpty",
|
|
1476
|
-
path:
|
|
1487
|
+
path: u.path
|
|
1477
1488
|
});
|
|
1478
1489
|
continue;
|
|
1479
1490
|
}
|
|
1480
|
-
ee(v, "views").forEach((f,
|
|
1481
|
-
if (!
|
|
1491
|
+
ee(v, "views").forEach((f, N) => {
|
|
1492
|
+
if (!M(f))
|
|
1482
1493
|
return;
|
|
1483
|
-
const
|
|
1484
|
-
typeof f.name == "string" &&
|
|
1494
|
+
const C = `/views/${N}`, j = typeof f.name == "string" ? f.name : "(unnamed)";
|
|
1495
|
+
typeof f.name == "string" && k.push(f.name), typeof f.type == "string" && f.type.toLowerCase() === "list" && !t.has(u.path.toLowerCase()) && (typeof f.entityName != "string" || !f.entityName.trim() ? n({
|
|
1485
1496
|
code: "views.listEntity",
|
|
1486
|
-
message: `List view ${
|
|
1497
|
+
message: `List view ${j} needs a top-level "entityName".`,
|
|
1487
1498
|
messageKey: "devStudio.issue.listEntity",
|
|
1488
|
-
params: { name:
|
|
1489
|
-
path:
|
|
1490
|
-
pointer:
|
|
1499
|
+
params: { name: j },
|
|
1500
|
+
path: u.path,
|
|
1501
|
+
pointer: C
|
|
1491
1502
|
}) : (!Array.isArray(f.columns) || f.columns.length === 0) && n({
|
|
1492
1503
|
code: "views.listColumns",
|
|
1493
|
-
message: `List view ${
|
|
1504
|
+
message: `List view ${j} needs non-empty top-level "columns".`,
|
|
1494
1505
|
messageKey: "devStudio.issue.listColumns",
|
|
1495
|
-
params: { name:
|
|
1496
|
-
path:
|
|
1497
|
-
pointer:
|
|
1506
|
+
params: { name: j },
|
|
1507
|
+
path: u.path,
|
|
1508
|
+
pointer: C
|
|
1498
1509
|
}));
|
|
1499
|
-
const
|
|
1500
|
-
ee(f, "columns").forEach((
|
|
1501
|
-
for (const
|
|
1502
|
-
|
|
1503
|
-
}), ee(f, "tabs").forEach((
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
(
|
|
1510
|
+
const O = [[f, "displayName", C]];
|
|
1511
|
+
ee(f, "columns").forEach((w, E) => {
|
|
1512
|
+
for (const o of ["header", "displayName", "label"])
|
|
1513
|
+
O.push([w, o, `${C}/columns/${E}`]);
|
|
1514
|
+
}), ee(f, "tabs").forEach((w, E) => {
|
|
1515
|
+
O.push([w, "displayName", `${C}/tabs/${E}`]), ee(w, "sections").forEach((o, c) => {
|
|
1516
|
+
O.push([o, "displayName", `${C}/tabs/${E}/sections/${c}`]), ee(o, "controls").forEach(
|
|
1517
|
+
(y, g) => O.push([y, "label", `${C}/tabs/${E}/sections/${c}/controls/${g}`])
|
|
1507
1518
|
);
|
|
1508
1519
|
});
|
|
1509
1520
|
});
|
|
1510
|
-
for (const [
|
|
1511
|
-
const
|
|
1512
|
-
typeof
|
|
1521
|
+
for (const [w, E, o] of O) {
|
|
1522
|
+
const c = M(w) ? w[E] : void 0;
|
|
1523
|
+
typeof c == "string" && re(c) && n({
|
|
1513
1524
|
code: "labels.polish",
|
|
1514
|
-
message: `View ${
|
|
1525
|
+
message: `View ${j}: "${c}" is Polish — seed labels are English.`,
|
|
1515
1526
|
messageKey: "devStudio.issue.polishView",
|
|
1516
|
-
params: { name:
|
|
1517
|
-
path:
|
|
1518
|
-
pointer: `${
|
|
1527
|
+
params: { name: j, text: c },
|
|
1528
|
+
path: u.path,
|
|
1529
|
+
pointer: `${o}/${E}`
|
|
1519
1530
|
});
|
|
1520
1531
|
}
|
|
1521
1532
|
});
|
|
1522
1533
|
}
|
|
1523
|
-
const
|
|
1524
|
-
for (const
|
|
1525
|
-
const [, v, f] = Ee.exec(
|
|
1526
|
-
|
|
1534
|
+
const A = s.filter((u) => ve(u.file.path) && Ee.test(u.file.path)), S = /* @__PURE__ */ new Map();
|
|
1535
|
+
for (const u of A) {
|
|
1536
|
+
const [, v, f] = Ee.exec(u.file.path), N = S.get(v) ?? /* @__PURE__ */ new Map();
|
|
1537
|
+
N.set(f.toLowerCase(), u), S.set(v, N);
|
|
1527
1538
|
}
|
|
1528
|
-
const
|
|
1529
|
-
[...
|
|
1530
|
-
),
|
|
1531
|
-
for (const [
|
|
1532
|
-
const f = v.get("en"),
|
|
1533
|
-
if (f && !
|
|
1539
|
+
const T = new Set(
|
|
1540
|
+
[...S.keys()].map((u) => u.split(".")[0]).filter((u) => !Ft.has(u))
|
|
1541
|
+
), I = /* @__PURE__ */ new Set();
|
|
1542
|
+
for (const [u, v] of S) {
|
|
1543
|
+
const f = v.get("en"), N = v.get("pl"), C = (j) => new Set(Te(j == null ? void 0 : j.value).map(([O]) => O));
|
|
1544
|
+
if (f && !N && n({
|
|
1534
1545
|
code: "i18n.polishMissing",
|
|
1535
|
-
message: `${
|
|
1546
|
+
message: `${u}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
|
|
1536
1547
|
messageKey: "devStudio.issue.polishBundleMissing",
|
|
1537
|
-
params: { group:
|
|
1548
|
+
params: { group: u },
|
|
1538
1549
|
path: f.file.path
|
|
1539
|
-
}),
|
|
1550
|
+
}), N && !f && n({
|
|
1540
1551
|
code: "i18n.englishMissing",
|
|
1541
|
-
message: `${
|
|
1552
|
+
message: `${u}.pl.i18n.json needs an .en.i18n.json baseline.`,
|
|
1542
1553
|
messageKey: "devStudio.issue.englishBundleMissing",
|
|
1543
|
-
params: { group:
|
|
1544
|
-
path:
|
|
1545
|
-
}), f &&
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1554
|
+
params: { group: u },
|
|
1555
|
+
path: N.file.path
|
|
1556
|
+
}), f && N) {
|
|
1557
|
+
const j = C(f), O = C(N), w = [...j].filter((o) => !O.has(o)), E = [...O].filter((o) => !j.has(o));
|
|
1558
|
+
w.length && n({
|
|
1548
1559
|
code: "i18n.keyMissing",
|
|
1549
|
-
message: `${
|
|
1560
|
+
message: `${N.file.path} is missing ${w.length} key(s) of English: ${w.slice(0, 10).join(", ")}`,
|
|
1550
1561
|
messageKey: "devStudio.issue.keysMissingPl",
|
|
1551
1562
|
params: {
|
|
1552
|
-
path:
|
|
1553
|
-
count:
|
|
1554
|
-
keys:
|
|
1563
|
+
path: N.file.path,
|
|
1564
|
+
count: w.length,
|
|
1565
|
+
keys: w.slice(0, 10).join(", ")
|
|
1555
1566
|
},
|
|
1556
|
-
path:
|
|
1557
|
-
}),
|
|
1567
|
+
path: N.file.path
|
|
1568
|
+
}), E.length && n({
|
|
1558
1569
|
code: "i18n.keyMissing",
|
|
1559
|
-
message: `${f.file.path} is missing ${
|
|
1570
|
+
message: `${f.file.path} is missing ${E.length} key(s) of Polish: ${E.slice(0, 10).join(", ")}`,
|
|
1560
1571
|
messageKey: "devStudio.issue.keysMissingEn",
|
|
1561
1572
|
params: {
|
|
1562
1573
|
path: f.file.path,
|
|
1563
|
-
count:
|
|
1564
|
-
keys:
|
|
1574
|
+
count: E.length,
|
|
1575
|
+
keys: E.slice(0, 10).join(", ")
|
|
1565
1576
|
},
|
|
1566
1577
|
path: f.file.path
|
|
1567
1578
|
});
|
|
1568
1579
|
}
|
|
1569
|
-
for (const [
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1580
|
+
for (const [j, O] of v) {
|
|
1581
|
+
const w = Te(O.value), E = w.filter(([o]) => T.has(o.split(".")[0])).map(([o]) => o);
|
|
1582
|
+
if (E.length && n({
|
|
1572
1583
|
severity: "warning",
|
|
1573
1584
|
code: "i18n.fileKey",
|
|
1574
|
-
message: `${
|
|
1585
|
+
message: `${O.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${E.slice(0, 5).join(", ")}).`,
|
|
1575
1586
|
messageKey: "devStudio.issue.fileKey",
|
|
1576
|
-
params: { path:
|
|
1577
|
-
path:
|
|
1578
|
-
}),
|
|
1579
|
-
for (const [
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
["module", "entity", "field", "view"].includes(
|
|
1587
|
+
params: { path: O.file.path, keys: E.slice(0, 5).join(", ") },
|
|
1588
|
+
path: O.file.path
|
|
1589
|
+
}), j === "en")
|
|
1590
|
+
for (const [o, c] of w) {
|
|
1591
|
+
I.add(o);
|
|
1592
|
+
const y = o.split(".")[0];
|
|
1593
|
+
["module", "entity", "field", "view"].includes(y) && typeof c == "string" && re(c) && n({
|
|
1583
1594
|
code: "i18n.polishInEnglish",
|
|
1584
|
-
message: `${
|
|
1595
|
+
message: `${O.file.path}: ${o} = "${c}" — the English bundle is the English UI.`,
|
|
1585
1596
|
messageKey: "devStudio.issue.polishInEnglish",
|
|
1586
|
-
params: { path:
|
|
1587
|
-
path:
|
|
1597
|
+
params: { path: O.file.path, key: o, text: c },
|
|
1598
|
+
path: O.file.path
|
|
1588
1599
|
});
|
|
1589
1600
|
}
|
|
1590
1601
|
}
|
|
1591
1602
|
}
|
|
1592
|
-
if (l.length &&
|
|
1603
|
+
if (l.length && A.length) {
|
|
1593
1604
|
const v = [
|
|
1594
1605
|
"module.displayName",
|
|
1595
1606
|
...d.map((f) => `entity.${f}.displayName`),
|
|
1596
|
-
...
|
|
1597
|
-
...
|
|
1607
|
+
...p.map((f) => `${f}.displayName`),
|
|
1608
|
+
...k.map((f) => `view.${f}.displayName`)
|
|
1598
1609
|
].filter(
|
|
1599
|
-
(f) => !
|
|
1610
|
+
(f) => !I.has(f) && !(f.startsWith("field.") && I.has(`${f.slice(0, -12)}.label`))
|
|
1600
1611
|
);
|
|
1601
1612
|
v.length && n({
|
|
1602
1613
|
code: "i18n.labelMissing",
|
|
@@ -1605,63 +1616,87 @@ function qt(e, i = {}) {
|
|
|
1605
1616
|
params: { count: v.length, keys: v.slice(0, 10).join(", ") }
|
|
1606
1617
|
});
|
|
1607
1618
|
}
|
|
1608
|
-
for (const { file:
|
|
1619
|
+
for (const { file: u, value: v } of s)
|
|
1609
1620
|
de(
|
|
1610
1621
|
v,
|
|
1611
1622
|
void 0,
|
|
1612
1623
|
"",
|
|
1613
|
-
(f,
|
|
1624
|
+
(f, N, C) => n({
|
|
1614
1625
|
code: "icons.emoji",
|
|
1615
|
-
message: `${
|
|
1626
|
+
message: `${N} = "${C}": icon fields take an Ntd* name and column headers are words, never emoji.`,
|
|
1616
1627
|
messageKey: "devStudio.issue.iconsEmoji",
|
|
1617
|
-
params: { key:
|
|
1618
|
-
path:
|
|
1628
|
+
params: { key: N, text: C },
|
|
1629
|
+
path: u.path,
|
|
1619
1630
|
pointer: f
|
|
1620
1631
|
})
|
|
1621
1632
|
);
|
|
1622
|
-
|
|
1633
|
+
const b = r(".datasources.json");
|
|
1634
|
+
if (b.length && l.length) {
|
|
1635
|
+
const u = /* @__PURE__ */ new Set();
|
|
1636
|
+
for (const { value: f } of b) {
|
|
1637
|
+
const N = Array.isArray(f) ? f : f == null ? void 0 : f.dataSources;
|
|
1638
|
+
for (const C of Array.isArray(N) ? N : []) {
|
|
1639
|
+
const j = (C == null ? void 0 : C.key) ?? (C == null ? void 0 : C.name);
|
|
1640
|
+
typeof j == "string" && u.add(j);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
const v = (D = l[0].value) == null ? void 0 : D.dataSources;
|
|
1644
|
+
(Array.isArray(v) ? v : []).forEach((f, N) => {
|
|
1645
|
+
const C = (f == null ? void 0 : f.key) ?? (f == null ? void 0 : f.name);
|
|
1646
|
+
typeof C == "string" && !u.has(C) && n({
|
|
1647
|
+
severity: "warning",
|
|
1648
|
+
code: "dataSources.undefined",
|
|
1649
|
+
message: `The manifest lists the data source "${C}", which no *.datasources.json defines.`,
|
|
1650
|
+
messageKey: "devStudio.issue.dataSourceUndefined",
|
|
1651
|
+
params: { key: C },
|
|
1652
|
+
path: l[0].file.path,
|
|
1653
|
+
pointer: `/dataSources/${N}`
|
|
1654
|
+
});
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
return a;
|
|
1623
1658
|
}
|
|
1624
|
-
function de(e, i, t,
|
|
1659
|
+
function de(e, i, t, a) {
|
|
1625
1660
|
if (Array.isArray(e)) {
|
|
1626
|
-
e.forEach((n, s) => de(n, i, `${t}/${s}`,
|
|
1661
|
+
e.forEach((n, s) => de(n, i, `${t}/${s}`, a));
|
|
1627
1662
|
return;
|
|
1628
1663
|
}
|
|
1629
|
-
if (
|
|
1664
|
+
if (M(e))
|
|
1630
1665
|
for (const [n, s] of Object.entries(e)) {
|
|
1631
1666
|
const r = `${t}/${n}`;
|
|
1632
|
-
if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" &&
|
|
1667
|
+
if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && Rt(s) && a(r, n, s), n === "optionsJson" && typeof s == "string")
|
|
1633
1668
|
try {
|
|
1634
|
-
de(JSON.parse(s), "optionsJson", r,
|
|
1669
|
+
de(JSON.parse(s), "optionsJson", r, a);
|
|
1635
1670
|
} catch {
|
|
1636
1671
|
}
|
|
1637
|
-
de(s, n, r,
|
|
1672
|
+
de(s, n, r, a);
|
|
1638
1673
|
}
|
|
1639
1674
|
}
|
|
1640
|
-
function
|
|
1641
|
-
const t = [],
|
|
1675
|
+
function Ut(e, i = {}) {
|
|
1676
|
+
const t = [], a = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1642
1677
|
for (const r of e)
|
|
1643
1678
|
for (const l of r.files) {
|
|
1644
1679
|
if (!ve(l.path) || !oe(l.path, ".json"))
|
|
1645
1680
|
continue;
|
|
1646
|
-
let
|
|
1681
|
+
let h;
|
|
1647
1682
|
try {
|
|
1648
|
-
|
|
1683
|
+
h = _(l.text).value;
|
|
1649
1684
|
} catch {
|
|
1650
1685
|
continue;
|
|
1651
1686
|
}
|
|
1652
|
-
if (oe(l.path, ".manifest.json") &&
|
|
1653
|
-
const d =
|
|
1654
|
-
|
|
1687
|
+
if (oe(l.path, ".manifest.json") && M(h) && typeof h.packageName == "string" && h.packageName) {
|
|
1688
|
+
const d = h.packageName.toLowerCase();
|
|
1689
|
+
a.set(d, [...a.get(d) ?? [], r.location]);
|
|
1655
1690
|
}
|
|
1656
1691
|
if (oe(l.path, ".entities.json") && r.group) {
|
|
1657
|
-
for (const d of ee(
|
|
1658
|
-
if (
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1692
|
+
for (const d of ee(h, "entities"))
|
|
1693
|
+
if (M(d) && typeof d.name == "string" && d.name) {
|
|
1694
|
+
const p = `${r.group}/${d.name}`.toLowerCase(), k = n.get(p) ?? [];
|
|
1695
|
+
k.includes(r.location) || n.set(p, [...k, r.location]);
|
|
1661
1696
|
}
|
|
1662
1697
|
}
|
|
1663
1698
|
}
|
|
1664
|
-
for (const [r, l] of
|
|
1699
|
+
for (const [r, l] of a)
|
|
1665
1700
|
l.length > 1 && t.push({
|
|
1666
1701
|
severity: "error",
|
|
1667
1702
|
code: "workspace.packageName",
|
|
@@ -1680,7 +1715,7 @@ function Vt(e, i = {}) {
|
|
|
1680
1715
|
});
|
|
1681
1716
|
return t;
|
|
1682
1717
|
}
|
|
1683
|
-
const te = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (e) => typeof e == "string" && e ? e : void 0,
|
|
1718
|
+
const te = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (e) => typeof e == "string" && e ? e : void 0, Wt = /* @__PURE__ */ new Set([
|
|
1684
1719
|
"slug",
|
|
1685
1720
|
"category",
|
|
1686
1721
|
"subCategory",
|
|
@@ -1691,20 +1726,20 @@ const te = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (
|
|
|
1691
1726
|
"translations",
|
|
1692
1727
|
"modules"
|
|
1693
1728
|
]);
|
|
1694
|
-
function
|
|
1729
|
+
function We(e) {
|
|
1695
1730
|
if (Array.isArray(e))
|
|
1696
1731
|
return e.filter((i) => typeof i == "string");
|
|
1697
1732
|
if (typeof e == "string")
|
|
1698
1733
|
return e.split(",").map((i) => i.trim()).filter(Boolean);
|
|
1699
1734
|
}
|
|
1700
|
-
function
|
|
1735
|
+
function Ge(e) {
|
|
1701
1736
|
const i = {};
|
|
1702
|
-
for (const [t,
|
|
1703
|
-
te(
|
|
1737
|
+
for (const [t, a] of Object.entries(te(e) ? e : {}))
|
|
1738
|
+
te(a) && (i[t] = { ...a, name: String(a.name ?? "") });
|
|
1704
1739
|
return i;
|
|
1705
1740
|
}
|
|
1706
|
-
function
|
|
1707
|
-
const t = te(e) ? e : {},
|
|
1741
|
+
function Gt(e, i) {
|
|
1742
|
+
const t = te(e) ? e : {}, a = Object.fromEntries(Object.entries(t).filter(([n]) => !Wt.has(n)));
|
|
1708
1743
|
return {
|
|
1709
1744
|
id: String(t.slug ?? ""),
|
|
1710
1745
|
category: Q(t.category),
|
|
@@ -1712,30 +1747,30 @@ function Wt(e, i) {
|
|
|
1712
1747
|
parentId: Q(t.parentSlug),
|
|
1713
1748
|
icon: Q(t.icon),
|
|
1714
1749
|
sortOrder: typeof t.sortOrder == "number" ? t.sortOrder : void 0,
|
|
1715
|
-
tags:
|
|
1716
|
-
translations:
|
|
1750
|
+
tags: We(t.tags),
|
|
1751
|
+
translations: Ge(t.translations),
|
|
1717
1752
|
modules: (Array.isArray(t.modules) ? t.modules : []).filter(te).map((n) => ({
|
|
1718
1753
|
moduleId: String(n.packageName ?? ""),
|
|
1719
1754
|
required: n.required === !0,
|
|
1720
1755
|
condition: Q(n.condition),
|
|
1721
1756
|
description: Q(n.description)
|
|
1722
1757
|
})),
|
|
1723
|
-
...Object.keys(
|
|
1758
|
+
...Object.keys(a).length ? { extra: a } : {},
|
|
1724
1759
|
...i ? { readOnly: i } : {}
|
|
1725
1760
|
};
|
|
1726
1761
|
}
|
|
1727
1762
|
const $e = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
|
|
1728
1763
|
function xe(e, i) {
|
|
1729
1764
|
var l;
|
|
1730
|
-
const t = te(i) ? i : {},
|
|
1731
|
-
const d =
|
|
1765
|
+
const t = te(i) ? i : {}, a = (Array.isArray(t.modules) ? t.modules : []).filter(te), s = JSON.stringify(We(t.tags) ?? []) === JSON.stringify(e.tags ?? []) ? t.tags : (l = e.tags) != null && l.length ? typeof t.tags == "string" ? e.tags.join(",") : e.tags : void 0, r = (h) => {
|
|
1766
|
+
const d = a.find((p) => p.packageName === h.moduleId);
|
|
1732
1767
|
return $e({
|
|
1733
1768
|
...d,
|
|
1734
|
-
packageName:
|
|
1769
|
+
packageName: h.moduleId,
|
|
1735
1770
|
// seed entries spell `required` out, also when it is false
|
|
1736
|
-
required:
|
|
1737
|
-
condition:
|
|
1738
|
-
description:
|
|
1771
|
+
required: h.required === !0 ? !0 : !d || "required" in d ? !1 : void 0,
|
|
1772
|
+
condition: h.condition || void 0,
|
|
1773
|
+
description: h.description || void 0
|
|
1739
1774
|
});
|
|
1740
1775
|
};
|
|
1741
1776
|
return $e({
|
|
@@ -1753,12 +1788,12 @@ function xe(e, i) {
|
|
|
1753
1788
|
});
|
|
1754
1789
|
}
|
|
1755
1790
|
function Ie(e, i = "en") {
|
|
1756
|
-
const t =
|
|
1791
|
+
const t = Ge(e.translations);
|
|
1757
1792
|
Object.keys(t).length === 0 && e.name && (t[i] = {
|
|
1758
1793
|
name: e.name,
|
|
1759
1794
|
...e.description ? { description: e.description } : {}
|
|
1760
1795
|
});
|
|
1761
|
-
const
|
|
1796
|
+
const a = $e({
|
|
1762
1797
|
isActive: e.isActive,
|
|
1763
1798
|
compliance: e.compliance,
|
|
1764
1799
|
defaultLanguage: e.defaultLanguage ?? void 0,
|
|
@@ -1779,11 +1814,11 @@ function Ie(e, i = "en") {
|
|
|
1779
1814
|
condition: n.condition ?? void 0,
|
|
1780
1815
|
description: n.description ?? void 0
|
|
1781
1816
|
})),
|
|
1782
|
-
extra:
|
|
1817
|
+
extra: a,
|
|
1783
1818
|
readOnly: e.source === "seed" || e.source === "code"
|
|
1784
1819
|
};
|
|
1785
1820
|
}
|
|
1786
|
-
function
|
|
1821
|
+
function _t(e) {
|
|
1787
1822
|
const i = e.extra ?? {};
|
|
1788
1823
|
return {
|
|
1789
1824
|
slug: e.id,
|
|
@@ -1803,528 +1838,528 @@ function Gt(e) {
|
|
|
1803
1838
|
...typeof i.defaultLanguage == "string" ? { defaultLanguage: i.defaultLanguage } : {}
|
|
1804
1839
|
};
|
|
1805
1840
|
}
|
|
1806
|
-
const F = (...e) => e.filter(Boolean).join("/"),
|
|
1841
|
+
const F = (...e) => e.filter(Boolean).join("/"), Bt = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), zt = (e) => e.slice(e.lastIndexOf("/") + 1), me = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e) => typeof e == "string" && e ? e : void 0, Jt = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), ue = (e) => e.startsWith(".") || Jt.has(e), Ht = /^wizard-templates-.+\.seed\.json$/i, Zt = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
|
|
1807
1842
|
function fe(e) {
|
|
1808
|
-
const i = (t,
|
|
1843
|
+
const i = (t, a = 2) => String(t).padStart(a, "0");
|
|
1809
1844
|
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`;
|
|
1810
1845
|
}
|
|
1811
|
-
function
|
|
1812
|
-
const i =
|
|
1846
|
+
function Yt(e) {
|
|
1847
|
+
const i = Zt.exec(e);
|
|
1813
1848
|
return i ? Date.UTC(+i[1], +i[2] - 1, +i[3], +i[4], +i[5], +i[6], +i[7]) : void 0;
|
|
1814
1849
|
}
|
|
1815
|
-
const
|
|
1816
|
-
function
|
|
1817
|
-
const { roots: i } = e, t = e.revisions !== !1,
|
|
1850
|
+
const Xt = (e, i) => F(Bt(e), ".revisions", `${zt(e)}.${i}`), Qt = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
|
|
1851
|
+
function ai(e) {
|
|
1852
|
+
const { roots: i } = e, t = e.revisions !== !1, a = e.now ?? (() => /* @__PURE__ */ new Date()), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1818
1853
|
let r = null;
|
|
1819
|
-
const l = (
|
|
1820
|
-
const
|
|
1821
|
-
if (!
|
|
1822
|
-
throw new Error(`Unknown workspace "${
|
|
1823
|
-
return
|
|
1824
|
-
},
|
|
1825
|
-
const
|
|
1826
|
-
if (
|
|
1827
|
-
throw new Error(`Workspace "${
|
|
1828
|
-
return
|
|
1854
|
+
const l = (o) => {
|
|
1855
|
+
const c = i.find((y) => y.id === o);
|
|
1856
|
+
if (!c)
|
|
1857
|
+
throw new Error(`Unknown workspace "${o}"`);
|
|
1858
|
+
return c;
|
|
1859
|
+
}, h = (o) => {
|
|
1860
|
+
const c = l(o);
|
|
1861
|
+
if (c.readOnly)
|
|
1862
|
+
throw new Error(`Workspace "${c.label}" is read-only`);
|
|
1863
|
+
return c;
|
|
1829
1864
|
};
|
|
1830
|
-
async function d(
|
|
1831
|
-
const
|
|
1865
|
+
async function d(o, c) {
|
|
1866
|
+
const y = await o.read(c);
|
|
1832
1867
|
try {
|
|
1833
|
-
const
|
|
1834
|
-
return me(
|
|
1868
|
+
const g = y ? _(y.text).value : void 0;
|
|
1869
|
+
return me(g) ? g : {};
|
|
1835
1870
|
} catch {
|
|
1836
1871
|
return {};
|
|
1837
1872
|
}
|
|
1838
1873
|
}
|
|
1839
|
-
function
|
|
1840
|
-
const
|
|
1874
|
+
function p(o, c, y, g, x) {
|
|
1875
|
+
const m = ie(g.packageName) ?? (c || o.id);
|
|
1841
1876
|
return {
|
|
1842
|
-
workspaceId:
|
|
1843
|
-
id:
|
|
1844
|
-
packageId: ie(
|
|
1845
|
-
label: ie(
|
|
1846
|
-
description: ie(
|
|
1847
|
-
version: ie(
|
|
1848
|
-
location:
|
|
1849
|
-
readOnly:
|
|
1850
|
-
files:
|
|
1851
|
-
search: `${
|
|
1877
|
+
workspaceId: o.id,
|
|
1878
|
+
id: m,
|
|
1879
|
+
packageId: ie(g.category),
|
|
1880
|
+
label: ie(g.displayName) ?? m,
|
|
1881
|
+
description: ie(g.description),
|
|
1882
|
+
version: ie(g.version),
|
|
1883
|
+
location: c,
|
|
1884
|
+
readOnly: o.readOnly,
|
|
1885
|
+
files: x,
|
|
1886
|
+
search: `${c} ${y}`
|
|
1852
1887
|
};
|
|
1853
1888
|
}
|
|
1854
|
-
async function
|
|
1855
|
-
const
|
|
1856
|
-
const
|
|
1857
|
-
if (
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
await d(
|
|
1863
|
-
|
|
1889
|
+
async function k(o) {
|
|
1890
|
+
const c = /* @__PURE__ */ new Map(), y = async (g) => {
|
|
1891
|
+
const x = await o.fs.list(g), m = x.filter(($) => $.kind === "file" && $.name.toLowerCase().endsWith(".manifest.json")).map(($) => $.name).sort()[0];
|
|
1892
|
+
if (m) {
|
|
1893
|
+
const $ = x.filter((K) => K.kind === "file").map((K) => K.name), L = p(
|
|
1894
|
+
o,
|
|
1895
|
+
g,
|
|
1896
|
+
m,
|
|
1897
|
+
await d(o.fs, F(g, m)),
|
|
1898
|
+
$
|
|
1864
1899
|
);
|
|
1865
|
-
|
|
1900
|
+
c.has(L.id.toLowerCase()) || (c.set(L.id.toLowerCase(), { ref: L, dir: g }), s.set(`${o.id}:${L.id.toLowerCase()}`, g));
|
|
1866
1901
|
}
|
|
1867
|
-
for (const
|
|
1868
|
-
|
|
1902
|
+
for (const $ of x)
|
|
1903
|
+
$.kind === "directory" && !ue($.name) && !(g === "" && $.name === A(o)) && await y(F(g, $.name));
|
|
1869
1904
|
};
|
|
1870
|
-
return await
|
|
1905
|
+
return await y(""), c;
|
|
1871
1906
|
}
|
|
1872
|
-
const
|
|
1873
|
-
n.delete(
|
|
1874
|
-
},
|
|
1875
|
-
let
|
|
1876
|
-
return
|
|
1907
|
+
const A = (o) => o.templatesDir === !1 ? void 0 : o.templatesDir ?? "Templates", S = (o) => {
|
|
1908
|
+
n.delete(o.id), j.clear();
|
|
1909
|
+
}, T = (o) => {
|
|
1910
|
+
let c = n.get(o.id);
|
|
1911
|
+
return c || (c = k(o), n.set(o.id, c), c.catch(() => n.delete(o.id))), c;
|
|
1877
1912
|
};
|
|
1878
|
-
async function
|
|
1879
|
-
const
|
|
1880
|
-
if (!
|
|
1881
|
-
throw new Error(`Module "${
|
|
1882
|
-
return { root:
|
|
1913
|
+
async function I(o) {
|
|
1914
|
+
const c = l(o.workspaceId), y = await T(c), g = s.get(`${c.id}:${o.id.toLowerCase()}`), x = y.get(o.id.toLowerCase()) ?? (g === void 0 ? void 0 : [...y.values()].find((m) => m.dir === g));
|
|
1915
|
+
if (!x)
|
|
1916
|
+
throw new Error(`Module "${o.id}" is not in "${c.label}"`);
|
|
1917
|
+
return { root: c, module: x };
|
|
1883
1918
|
}
|
|
1884
|
-
async function
|
|
1885
|
-
const
|
|
1886
|
-
const
|
|
1887
|
-
if (!(
|
|
1888
|
-
for (const L of
|
|
1889
|
-
L.kind === "file" ?
|
|
1919
|
+
async function b(o, c) {
|
|
1920
|
+
const y = [], g = async (x, m) => {
|
|
1921
|
+
const $ = await o.list(F(c, x));
|
|
1922
|
+
if (!(m && $.some((L) => L.kind === "file" && L.name.toLowerCase().endsWith(".manifest.json"))))
|
|
1923
|
+
for (const L of $)
|
|
1924
|
+
L.kind === "file" ? y.push(F(x, L.name)) : ue(L.name) || await g(F(x, L.name), !0);
|
|
1890
1925
|
};
|
|
1891
|
-
return await
|
|
1926
|
+
return await g("", !1), y.sort();
|
|
1892
1927
|
}
|
|
1893
|
-
async function
|
|
1894
|
-
t && await
|
|
1928
|
+
async function D(o, c, y, g) {
|
|
1929
|
+
t && await o.write(Xt(c, g), y);
|
|
1895
1930
|
}
|
|
1896
|
-
async function
|
|
1897
|
-
const
|
|
1898
|
-
const
|
|
1899
|
-
for (const
|
|
1900
|
-
if (
|
|
1901
|
-
for (const L of await
|
|
1902
|
-
const
|
|
1903
|
-
L.kind === "file" &&
|
|
1904
|
-
path: F(
|
|
1905
|
-
stamp:
|
|
1906
|
-
at: F(
|
|
1931
|
+
async function u(o, c) {
|
|
1932
|
+
const y = [], g = async (x) => {
|
|
1933
|
+
const m = await o.list(F(c, x));
|
|
1934
|
+
for (const $ of m)
|
|
1935
|
+
if ($.kind === "directory" && $.name === ".revisions")
|
|
1936
|
+
for (const L of await o.list(F(c, x, $.name))) {
|
|
1937
|
+
const K = /^(.*)\.(\d{8}T\d{9}Z)$/.exec(L.name);
|
|
1938
|
+
L.kind === "file" && K && y.push({
|
|
1939
|
+
path: F(x, K[1]),
|
|
1940
|
+
stamp: K[2],
|
|
1941
|
+
at: F(x, ".revisions", L.name)
|
|
1907
1942
|
});
|
|
1908
1943
|
}
|
|
1909
|
-
else
|
|
1944
|
+
else $.kind === "directory" && !ue($.name) && await g(F(x, $.name));
|
|
1910
1945
|
};
|
|
1911
|
-
return await
|
|
1946
|
+
return await g(""), y;
|
|
1912
1947
|
}
|
|
1913
|
-
async function
|
|
1914
|
-
const
|
|
1915
|
-
return
|
|
1948
|
+
async function v(o) {
|
|
1949
|
+
const c = A(o);
|
|
1950
|
+
return c ? (await o.fs.list(c)).filter((y) => y.kind === "file" && Ht.test(y.name)).map((y) => F(c, y.name)).sort() : [];
|
|
1916
1951
|
}
|
|
1917
|
-
async function
|
|
1918
|
-
const
|
|
1919
|
-
if (!
|
|
1952
|
+
async function f(o, c) {
|
|
1953
|
+
const y = await o.fs.read(c);
|
|
1954
|
+
if (!y)
|
|
1920
1955
|
return { text: "", entries: [] };
|
|
1921
|
-
const
|
|
1922
|
-
return { text:
|
|
1956
|
+
const g = _(y.text).value;
|
|
1957
|
+
return { text: y.text, entries: Array.isArray(g) ? g : [] };
|
|
1923
1958
|
}
|
|
1924
|
-
const
|
|
1925
|
-
arrayKey: (
|
|
1959
|
+
const N = {
|
|
1960
|
+
arrayKey: (o) => o === "" ? "slug" : o.endsWith("/modules") ? "packageName" : void 0
|
|
1926
1961
|
};
|
|
1927
|
-
async function
|
|
1928
|
-
if (
|
|
1929
|
-
await
|
|
1962
|
+
async function C(o, c, y, g) {
|
|
1963
|
+
if (y && await D(o.fs, c, y, fe(a())), g.length === 0) {
|
|
1964
|
+
await o.fs.remove(c);
|
|
1930
1965
|
return;
|
|
1931
1966
|
}
|
|
1932
|
-
await
|
|
1933
|
-
|
|
1934
|
-
|
|
1967
|
+
await o.fs.write(
|
|
1968
|
+
c,
|
|
1969
|
+
y ? De(y, g, N) : ae(g)
|
|
1935
1970
|
);
|
|
1936
1971
|
}
|
|
1937
|
-
const
|
|
1938
|
-
function
|
|
1939
|
-
const
|
|
1940
|
-
let
|
|
1941
|
-
if (!
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
var
|
|
1972
|
+
const j = /* @__PURE__ */ new Map();
|
|
1973
|
+
function O(o, c) {
|
|
1974
|
+
const y = `${o.id}:${c.dir}`;
|
|
1975
|
+
let g = j.get(y);
|
|
1976
|
+
if (!g) {
|
|
1977
|
+
const x = (c.ref.files ?? []).filter((m) => /\.(manifest|entities)\.json$/i.test(m));
|
|
1978
|
+
g = Promise.all(
|
|
1979
|
+
x.map(async (m) => {
|
|
1980
|
+
var $;
|
|
1946
1981
|
return {
|
|
1947
|
-
path:
|
|
1948
|
-
text: ((
|
|
1982
|
+
path: m,
|
|
1983
|
+
text: (($ = await o.fs.read(F(c.dir, m))) == null ? void 0 : $.text) ?? ""
|
|
1949
1984
|
};
|
|
1950
1985
|
})
|
|
1951
|
-
).then((
|
|
1986
|
+
).then((m) => ({ location: c.dir, group: c.dir.split("/")[0], files: m })), j.set(y, g);
|
|
1952
1987
|
}
|
|
1953
|
-
return
|
|
1988
|
+
return g;
|
|
1954
1989
|
}
|
|
1955
|
-
async function
|
|
1956
|
-
var
|
|
1957
|
-
return r || await ((
|
|
1990
|
+
async function w(o) {
|
|
1991
|
+
var c;
|
|
1992
|
+
return r || await ((c = E.listTemplates) == null ? void 0 : c.call(E)), r == null ? void 0 : r.get(o.toLowerCase());
|
|
1958
1993
|
}
|
|
1959
|
-
const
|
|
1994
|
+
const E = {
|
|
1960
1995
|
invalidate() {
|
|
1961
|
-
n.clear(),
|
|
1996
|
+
n.clear(), j.clear(), r = null;
|
|
1962
1997
|
},
|
|
1963
1998
|
async listWorkspaces() {
|
|
1964
|
-
return i.map((
|
|
1965
|
-
id:
|
|
1966
|
-
label:
|
|
1967
|
-
...
|
|
1968
|
-
...
|
|
1969
|
-
...
|
|
1999
|
+
return i.map((o) => ({
|
|
2000
|
+
id: o.id,
|
|
2001
|
+
label: o.label,
|
|
2002
|
+
...o.description ? { description: o.description } : {},
|
|
2003
|
+
...o.icon ? { icon: o.icon } : {},
|
|
2004
|
+
...o.readOnly ? { readOnly: !0 } : {}
|
|
1970
2005
|
}));
|
|
1971
2006
|
},
|
|
1972
|
-
async listModules(
|
|
1973
|
-
const
|
|
1974
|
-
|
|
1975
|
-
const
|
|
1976
|
-
i.slice(0,
|
|
2007
|
+
async listModules(o) {
|
|
2008
|
+
const c = i.findIndex((m) => m.id === o), y = l(o);
|
|
2009
|
+
S(y);
|
|
2010
|
+
const g = await T(y), x = await Promise.all(
|
|
2011
|
+
i.slice(0, c).map(async (m) => ({ r: m, modules: await T(m) }))
|
|
1977
2012
|
);
|
|
1978
|
-
return [...
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
1981
|
-
}).sort((
|
|
2013
|
+
return [...g.values()].map(({ ref: m }) => {
|
|
2014
|
+
const $ = x.find((L) => L.modules.has(m.id.toLowerCase()));
|
|
2015
|
+
return $ ? { ...m, shadowedBy: $.r.id } : m;
|
|
2016
|
+
}).sort((m, $) => m.id.localeCompare($.id));
|
|
1982
2017
|
},
|
|
1983
|
-
async readModule(
|
|
1984
|
-
const { root:
|
|
1985
|
-
for (const
|
|
1986
|
-
const
|
|
1987
|
-
|
|
1988
|
-
path:
|
|
1989
|
-
text:
|
|
1990
|
-
version:
|
|
1991
|
-
...
|
|
2018
|
+
async readModule(o) {
|
|
2019
|
+
const { root: c, module: y } = await I(o), g = await b(c.fs, y.dir), x = [];
|
|
2020
|
+
for (const m of g) {
|
|
2021
|
+
const $ = await c.fs.read(F(y.dir, m));
|
|
2022
|
+
$ && x.push({
|
|
2023
|
+
path: m,
|
|
2024
|
+
text: $.text,
|
|
2025
|
+
version: $.version,
|
|
2026
|
+
...c.readOnly ? { readOnly: !0 } : {}
|
|
1992
2027
|
});
|
|
1993
2028
|
}
|
|
1994
|
-
return
|
|
2029
|
+
return x;
|
|
1995
2030
|
},
|
|
1996
|
-
async writeModule(
|
|
1997
|
-
const { module:
|
|
1998
|
-
for (const
|
|
1999
|
-
if (
|
|
2000
|
-
throw new Error(`Refusing to write outside the module: ${
|
|
2001
|
-
const R = await
|
|
2002
|
-
|
|
2003
|
-
const
|
|
2004
|
-
(
|
|
2031
|
+
async writeModule(o, c) {
|
|
2032
|
+
const { module: y } = await I(o), g = h(o.workspaceId), x = /* @__PURE__ */ new Map(), m = [];
|
|
2033
|
+
for (const K of c) {
|
|
2034
|
+
if (K.path.split("/").some((Y) => Y === ".." || Y === "" || Y.startsWith(".")))
|
|
2035
|
+
throw new Error(`Refusing to write outside the module: ${K.path}`);
|
|
2036
|
+
const R = await g.fs.read(F(y.dir, K.path));
|
|
2037
|
+
x.set(K.path, R);
|
|
2038
|
+
const z = K.baseVersion;
|
|
2039
|
+
(z === void 0 ? R !== null && K.type === "write" : (R == null ? void 0 : R.version) !== z) && m.push({ path: K.path, ...R ? { currentVersion: R.version } : {} });
|
|
2005
2040
|
}
|
|
2006
|
-
if (
|
|
2007
|
-
return { ok: !1, conflicts:
|
|
2008
|
-
const
|
|
2009
|
-
for (const
|
|
2010
|
-
const R = F(
|
|
2011
|
-
|
|
2041
|
+
if (m.length)
|
|
2042
|
+
return { ok: !1, conflicts: m };
|
|
2043
|
+
const $ = fe(a()), L = {};
|
|
2044
|
+
for (const K of c) {
|
|
2045
|
+
const R = F(y.dir, K.path), z = x.get(K.path);
|
|
2046
|
+
z && await D(g.fs, R, z.text, $), K.type === "write" ? L[K.path] = await g.fs.write(R, K.text) : await g.fs.remove(R);
|
|
2012
2047
|
}
|
|
2013
|
-
return
|
|
2048
|
+
return S(g), { ok: !0, versions: L, revision: $ };
|
|
2014
2049
|
},
|
|
2015
|
-
async createModule(
|
|
2016
|
-
var
|
|
2017
|
-
const
|
|
2018
|
-
P(
|
|
2019
|
-
P(
|
|
2050
|
+
async createModule(o) {
|
|
2051
|
+
var m;
|
|
2052
|
+
const c = h(o.workspaceId), y = o.id.startsWith(W) ? o.id.slice(W.length) : o.id.split(".").pop() ?? o.id, g = ((m = e.moduleFolder) == null ? void 0 : m.call(e, o)) ?? F(
|
|
2053
|
+
P(o.packageId ?? "") || "Custom",
|
|
2054
|
+
P(y) || "Module"
|
|
2020
2055
|
);
|
|
2021
|
-
if ((await
|
|
2022
|
-
throw new Error(`The folder ${
|
|
2023
|
-
if ((await
|
|
2024
|
-
throw new Error(`"${
|
|
2025
|
-
for (const
|
|
2026
|
-
await
|
|
2027
|
-
|
|
2028
|
-
const
|
|
2029
|
-
if (!
|
|
2030
|
-
throw new Error(`The new module ${
|
|
2031
|
-
return
|
|
2056
|
+
if ((await c.fs.list(g)).length > 0)
|
|
2057
|
+
throw new Error(`The folder ${g} is not empty`);
|
|
2058
|
+
if ((await T(c)).has(o.id.toLowerCase()))
|
|
2059
|
+
throw new Error(`"${o.id}" already exists in ${c.label}`);
|
|
2060
|
+
for (const $ of o.files)
|
|
2061
|
+
await c.fs.write(F(g, $.path), $.text);
|
|
2062
|
+
S(c);
|
|
2063
|
+
const x = (await T(c)).get(o.id.toLowerCase());
|
|
2064
|
+
if (!x)
|
|
2065
|
+
throw new Error(`The new module ${o.id} has no manifest naming it`);
|
|
2066
|
+
return x.ref;
|
|
2032
2067
|
},
|
|
2033
|
-
async deleteModule(
|
|
2034
|
-
const { module:
|
|
2035
|
-
await
|
|
2068
|
+
async deleteModule(o) {
|
|
2069
|
+
const { module: c } = await I(o), y = h(o.workspaceId);
|
|
2070
|
+
await y.fs.removeDir(c.dir), s.delete(`${y.id}:${o.id.toLowerCase()}`), S(y);
|
|
2036
2071
|
},
|
|
2037
2072
|
async listTemplates() {
|
|
2038
|
-
const
|
|
2039
|
-
for (const
|
|
2040
|
-
for (const
|
|
2041
|
-
let
|
|
2073
|
+
const o = /* @__PURE__ */ new Map(), c = [];
|
|
2074
|
+
for (const y of i)
|
|
2075
|
+
for (const g of await v(y)) {
|
|
2076
|
+
let x;
|
|
2042
2077
|
try {
|
|
2043
|
-
|
|
2078
|
+
x = (await f(y, g)).entries;
|
|
2044
2079
|
} catch {
|
|
2045
2080
|
continue;
|
|
2046
2081
|
}
|
|
2047
|
-
for (const
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2082
|
+
for (const m of x) {
|
|
2083
|
+
const $ = Gt(m, y.readOnly);
|
|
2084
|
+
$.id && !o.has($.id.toLowerCase()) && (o.set($.id.toLowerCase(), { rootId: y.id, path: g }), c.push($));
|
|
2050
2085
|
}
|
|
2051
2086
|
}
|
|
2052
|
-
return r =
|
|
2087
|
+
return r = o, c;
|
|
2053
2088
|
},
|
|
2054
|
-
async saveTemplate(
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
const
|
|
2058
|
-
(R) => me(R) && String(R.slug ?? "").toLowerCase() ===
|
|
2059
|
-
),
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
L < 0 ? void 0 :
|
|
2063
|
-
), await
|
|
2089
|
+
async saveTemplate(o, c) {
|
|
2090
|
+
const y = (c == null ? void 0 : c.previousId) ?? o.id, g = await w(y);
|
|
2091
|
+
if (g) {
|
|
2092
|
+
const x = h(g.rootId), { text: m, entries: $ } = await f(x, g.path), L = $.findIndex(
|
|
2093
|
+
(R) => me(R) && String(R.slug ?? "").toLowerCase() === y.toLowerCase()
|
|
2094
|
+
), K = [...$];
|
|
2095
|
+
K[L < 0 ? K.length : L] = xe(
|
|
2096
|
+
o,
|
|
2097
|
+
L < 0 ? void 0 : $[L]
|
|
2098
|
+
), await C(x, g.path, m, K);
|
|
2064
2099
|
} else {
|
|
2065
|
-
const
|
|
2066
|
-
if (!
|
|
2100
|
+
const x = i.find((K) => !K.readOnly && A(K));
|
|
2101
|
+
if (!x)
|
|
2067
2102
|
throw new Error("No writable folder holds templates");
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
`wizard-templates-${
|
|
2071
|
-
), { text:
|
|
2072
|
-
await
|
|
2103
|
+
const m = F(
|
|
2104
|
+
A(x),
|
|
2105
|
+
`wizard-templates-${Qt(o.category ?? "custom")}.seed.json`
|
|
2106
|
+
), { text: $, entries: L } = await f(x, m);
|
|
2107
|
+
await C(x, m, $, [...L, xe(o)]);
|
|
2073
2108
|
}
|
|
2074
|
-
return r = null, { ...
|
|
2109
|
+
return r = null, { ...o, extra: o.extra };
|
|
2075
2110
|
},
|
|
2076
|
-
async deleteTemplate(
|
|
2077
|
-
const
|
|
2078
|
-
if (!
|
|
2111
|
+
async deleteTemplate(o) {
|
|
2112
|
+
const c = await w(o);
|
|
2113
|
+
if (!c)
|
|
2079
2114
|
return;
|
|
2080
|
-
const
|
|
2081
|
-
await
|
|
2115
|
+
const y = h(c.rootId), { text: g, entries: x } = await f(y, c.path);
|
|
2116
|
+
await C(
|
|
2117
|
+
y,
|
|
2118
|
+
c.path,
|
|
2082
2119
|
g,
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
T.filter(
|
|
2086
|
-
(u) => !(me(u) && String(u.slug ?? "").toLowerCase() === a.toLowerCase())
|
|
2120
|
+
x.filter(
|
|
2121
|
+
(m) => !(me(m) && String(m.slug ?? "").toLowerCase() === o.toLowerCase())
|
|
2087
2122
|
)
|
|
2088
2123
|
), r = null;
|
|
2089
2124
|
},
|
|
2090
|
-
async validate(
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2093
|
-
),
|
|
2094
|
-
return
|
|
2095
|
-
[...
|
|
2125
|
+
async validate(o, c) {
|
|
2126
|
+
const y = l(o.workspaceId), g = [...(await T(y)).values()], x = await Promise.all(
|
|
2127
|
+
g.filter((L) => L.ref.id.toLowerCase() !== o.id.toLowerCase()).map((L) => O(y, L))
|
|
2128
|
+
), m = g.find((L) => L.ref.id.toLowerCase() === o.id.toLowerCase()), $ = (m == null ? void 0 : m.dir) ?? o.id;
|
|
2129
|
+
return Ut(
|
|
2130
|
+
[...x, { location: $, group: $.split("/")[0], files: c }],
|
|
2096
2131
|
{
|
|
2097
2132
|
knownDuplicates: e.knownDuplicates
|
|
2098
2133
|
}
|
|
2099
|
-
).filter((L) => L.message.split(/[ ,]+/).includes(
|
|
2134
|
+
).filter((L) => L.message.split(/[ ,]+/).includes($));
|
|
2100
2135
|
},
|
|
2101
|
-
async listRevisions(
|
|
2102
|
-
const { root:
|
|
2103
|
-
(
|
|
2104
|
-
),
|
|
2105
|
-
for (const
|
|
2106
|
-
|
|
2107
|
-
return [...
|
|
2108
|
-
id:
|
|
2109
|
-
timestamp:
|
|
2136
|
+
async listRevisions(o, c) {
|
|
2137
|
+
const { root: y, module: g } = await I(o), x = (await u(y.fs, g.dir)).filter(
|
|
2138
|
+
($) => !c || $.path === c
|
|
2139
|
+
), m = /* @__PURE__ */ new Map();
|
|
2140
|
+
for (const $ of x)
|
|
2141
|
+
m.set($.stamp, [...m.get($.stamp) ?? [], $.path]);
|
|
2142
|
+
return [...m].map(([$, L]) => ({
|
|
2143
|
+
id: $,
|
|
2144
|
+
timestamp: Yt($) ?? 0,
|
|
2110
2145
|
summary: L.sort().join(", "),
|
|
2111
|
-
...
|
|
2112
|
-
})).sort((
|
|
2146
|
+
...c ? { path: c } : {}
|
|
2147
|
+
})).sort(($, L) => L.timestamp - $.timestamp);
|
|
2113
2148
|
},
|
|
2114
|
-
async readRevision(
|
|
2149
|
+
async readRevision(o, c, y) {
|
|
2115
2150
|
var L;
|
|
2116
|
-
const { root:
|
|
2117
|
-
(
|
|
2151
|
+
const { root: g, module: x } = await I(o), m = (await u(g.fs, x.dir)).filter(
|
|
2152
|
+
(K) => K.stamp === c && (!y || K.path === y)
|
|
2118
2153
|
);
|
|
2119
|
-
if (
|
|
2120
|
-
throw new Error(`Unknown revision "${
|
|
2121
|
-
const
|
|
2122
|
-
for (const
|
|
2123
|
-
|
|
2124
|
-
return
|
|
2154
|
+
if (m.length === 0)
|
|
2155
|
+
throw new Error(`Unknown revision "${c}"`);
|
|
2156
|
+
const $ = {};
|
|
2157
|
+
for (const K of m)
|
|
2158
|
+
$[K.path] = ((L = await g.fs.read(F(x.dir, K.at))) == null ? void 0 : L.text) ?? "";
|
|
2159
|
+
return y ? $[y] : JSON.stringify($, null, 2);
|
|
2125
2160
|
},
|
|
2126
|
-
async rollback(
|
|
2161
|
+
async rollback(o, c, y) {
|
|
2127
2162
|
var L;
|
|
2128
|
-
const { module:
|
|
2129
|
-
(
|
|
2163
|
+
const { module: g } = await I(o), x = h(o.workspaceId), m = (await u(x.fs, g.dir)).filter(
|
|
2164
|
+
(K) => K.stamp === c && (!y || K.path === y)
|
|
2130
2165
|
);
|
|
2131
|
-
if (
|
|
2132
|
-
throw new Error(`Unknown revision "${
|
|
2133
|
-
const
|
|
2134
|
-
for (const
|
|
2135
|
-
const R = F(
|
|
2136
|
-
Y && await
|
|
2166
|
+
if (m.length === 0)
|
|
2167
|
+
throw new Error(`Unknown revision "${c}"`);
|
|
2168
|
+
const $ = fe(a());
|
|
2169
|
+
for (const K of m) {
|
|
2170
|
+
const R = F(g.dir, K.path), z = ((L = await x.fs.read(F(g.dir, K.at))) == null ? void 0 : L.text) ?? "", Y = await x.fs.read(R);
|
|
2171
|
+
Y && await D(x.fs, R, Y.text, $), await x.fs.write(R, z);
|
|
2137
2172
|
}
|
|
2138
|
-
|
|
2173
|
+
S(x);
|
|
2139
2174
|
}
|
|
2140
2175
|
};
|
|
2141
|
-
return
|
|
2176
|
+
return E;
|
|
2142
2177
|
}
|
|
2143
2178
|
class ye extends Error {
|
|
2144
|
-
constructor(i, t,
|
|
2145
|
-
super(i), this.status = t, this.body =
|
|
2179
|
+
constructor(i, t, a) {
|
|
2180
|
+
super(i), this.status = t, this.body = a, this.name = "OmniVerkRestError";
|
|
2146
2181
|
}
|
|
2147
2182
|
}
|
|
2148
|
-
const
|
|
2149
|
-
function
|
|
2183
|
+
const ei = new TextDecoder("utf-8", { ignoreBOM: !0 });
|
|
2184
|
+
function ti(e) {
|
|
2150
2185
|
const i = atob(e), t = new Uint8Array(i.length);
|
|
2151
|
-
for (let
|
|
2152
|
-
t[
|
|
2153
|
-
return
|
|
2186
|
+
for (let a = 0; a < i.length; a++)
|
|
2187
|
+
t[a] = i.charCodeAt(a);
|
|
2188
|
+
return ei.decode(t);
|
|
2154
2189
|
}
|
|
2155
2190
|
function Ce(e) {
|
|
2156
2191
|
const i = new TextEncoder().encode(e);
|
|
2157
2192
|
let t = "";
|
|
2158
|
-
for (let
|
|
2159
|
-
t += String.fromCharCode(...i.subarray(
|
|
2193
|
+
for (let a = 0; a < i.length; a += 32768)
|
|
2194
|
+
t += String.fromCharCode(...i.subarray(a, a + 32768));
|
|
2160
2195
|
return btoa(t);
|
|
2161
2196
|
}
|
|
2162
|
-
function
|
|
2197
|
+
function ii(e) {
|
|
2163
2198
|
let i = 2166136261;
|
|
2164
2199
|
for (let t = 0; t < e.length; t++)
|
|
2165
2200
|
i = Math.imul(i ^ e.charCodeAt(t), 16777619);
|
|
2166
2201
|
return `${e.length}:${(i >>> 0).toString(16)}`;
|
|
2167
2202
|
}
|
|
2168
|
-
function
|
|
2169
|
-
const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((d,
|
|
2170
|
-
async function s(d,
|
|
2171
|
-
const
|
|
2203
|
+
function ri(e = {}) {
|
|
2204
|
+
const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((d, p) => globalThis.fetch(d, p)), a = e.language ?? "en", n = encodeURIComponent;
|
|
2205
|
+
async function s(d, p, k, A = "json") {
|
|
2206
|
+
const S = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, T = await t(`${i}${p}`, {
|
|
2172
2207
|
method: d,
|
|
2173
2208
|
credentials: e.credentials ?? "same-origin",
|
|
2174
2209
|
headers: {
|
|
2175
|
-
Accept:
|
|
2176
|
-
...
|
|
2177
|
-
...
|
|
2210
|
+
Accept: A === "json" ? "application/json" : "text/plain, application/json",
|
|
2211
|
+
...k === void 0 ? {} : { "Content-Type": "application/json" },
|
|
2212
|
+
...S
|
|
2178
2213
|
},
|
|
2179
|
-
...
|
|
2180
|
-
}),
|
|
2181
|
-
let
|
|
2182
|
-
if (
|
|
2214
|
+
...k === void 0 ? {} : { body: JSON.stringify(k) }
|
|
2215
|
+
}), I = await T.text();
|
|
2216
|
+
let b = I;
|
|
2217
|
+
if (A === "json" || !T.ok)
|
|
2183
2218
|
try {
|
|
2184
|
-
|
|
2219
|
+
b = I ? JSON.parse(I) : void 0;
|
|
2185
2220
|
} catch {
|
|
2186
|
-
|
|
2221
|
+
b = I;
|
|
2187
2222
|
}
|
|
2188
|
-
if (!
|
|
2223
|
+
if (!T.ok)
|
|
2189
2224
|
throw new ye(
|
|
2190
|
-
`${d} ${
|
|
2191
|
-
|
|
2192
|
-
|
|
2225
|
+
`${d} ${p}: ${T.status} ${T.statusText}`,
|
|
2226
|
+
T.status,
|
|
2227
|
+
b
|
|
2193
2228
|
);
|
|
2194
|
-
return
|
|
2229
|
+
return b;
|
|
2195
2230
|
}
|
|
2196
2231
|
const r = e.templates === !1 ? {} : {
|
|
2197
2232
|
async listTemplates() {
|
|
2198
2233
|
const d = await s(
|
|
2199
2234
|
"GET",
|
|
2200
|
-
`/module-templates?lang=${n(
|
|
2235
|
+
`/module-templates?lang=${n(a)}&hidden=true`
|
|
2201
2236
|
);
|
|
2202
2237
|
return (await Promise.all(
|
|
2203
2238
|
(d ?? []).map(
|
|
2204
|
-
(
|
|
2239
|
+
(k) => s(
|
|
2205
2240
|
"GET",
|
|
2206
|
-
`/module-templates/${n(
|
|
2241
|
+
`/module-templates/${n(k.slug)}?lang=${n(a)}`
|
|
2207
2242
|
)
|
|
2208
2243
|
)
|
|
2209
|
-
)).map((
|
|
2244
|
+
)).map((k) => Ie(k, a));
|
|
2210
2245
|
},
|
|
2211
|
-
async saveTemplate(d,
|
|
2212
|
-
const
|
|
2213
|
-
let
|
|
2214
|
-
if ((
|
|
2215
|
-
|
|
2246
|
+
async saveTemplate(d, p) {
|
|
2247
|
+
const k = (p == null ? void 0 : p.previousId) ?? d.id, A = _t(d);
|
|
2248
|
+
let S;
|
|
2249
|
+
if ((p == null ? void 0 : p.previousId) === void 0)
|
|
2250
|
+
S = await s(
|
|
2216
2251
|
"GET",
|
|
2217
|
-
`/module-templates/${n(d.id)}?lang=${n(
|
|
2252
|
+
`/module-templates/${n(d.id)}?lang=${n(a)}`
|
|
2218
2253
|
).then(
|
|
2219
2254
|
() => !0,
|
|
2220
|
-
(
|
|
2255
|
+
(I) => I instanceof ye && I.status === 404 ? !1 : Promise.reject(I)
|
|
2221
2256
|
) ? await s(
|
|
2222
2257
|
"PUT",
|
|
2223
|
-
`/module-templates/${n(d.id)}?lang=${n(
|
|
2224
|
-
|
|
2225
|
-
) : await s("POST", `/module-templates?lang=${n(
|
|
2258
|
+
`/module-templates/${n(d.id)}?lang=${n(a)}`,
|
|
2259
|
+
A
|
|
2260
|
+
) : await s("POST", `/module-templates?lang=${n(a)}`, A);
|
|
2226
2261
|
else {
|
|
2227
|
-
if (
|
|
2262
|
+
if (k !== d.id)
|
|
2228
2263
|
throw new Error(
|
|
2229
2264
|
"The OmniVerk API keeps a template's slug: save it as a new template instead."
|
|
2230
2265
|
);
|
|
2231
|
-
|
|
2266
|
+
S = await s(
|
|
2232
2267
|
"PUT",
|
|
2233
|
-
`/module-templates/${n(
|
|
2234
|
-
|
|
2268
|
+
`/module-templates/${n(k)}?lang=${n(a)}`,
|
|
2269
|
+
A
|
|
2235
2270
|
);
|
|
2236
2271
|
}
|
|
2237
|
-
return Ie(
|
|
2272
|
+
return Ie(S, a);
|
|
2238
2273
|
},
|
|
2239
2274
|
async deleteTemplate(d) {
|
|
2240
2275
|
await s("DELETE", `/module-templates/${n(d)}`);
|
|
2241
2276
|
}
|
|
2242
2277
|
};
|
|
2243
2278
|
if ((e.mode ?? "manifest-only") === "manifest-only") {
|
|
2244
|
-
const d = "seed",
|
|
2245
|
-
var
|
|
2246
|
-
return ((
|
|
2247
|
-
},
|
|
2248
|
-
const
|
|
2249
|
-
return { path:
|
|
2279
|
+
const d = "seed", p = /* @__PURE__ */ new Map(), k = (S) => {
|
|
2280
|
+
var T, I;
|
|
2281
|
+
return ((T = p.get(S)) == null ? void 0 : T.manifestFile) ?? `${(I = S.split(".").pop()) == null ? void 0 : I.toLowerCase()}.manifest.json`;
|
|
2282
|
+
}, A = async (S) => {
|
|
2283
|
+
const T = await s("GET", `/module-manifests/${n(S)}`), I = ae(T, { finalNewline: !1 });
|
|
2284
|
+
return { path: k(S), text: I, version: ii(I) };
|
|
2250
2285
|
};
|
|
2251
2286
|
return {
|
|
2252
2287
|
async listWorkspaces() {
|
|
2253
2288
|
return [{ id: d, label: e.workspaceLabel ?? "Seed/Modules" }];
|
|
2254
2289
|
},
|
|
2255
2290
|
async listModules() {
|
|
2256
|
-
const
|
|
2257
|
-
return
|
|
2291
|
+
const S = await s("GET", "/module-manifests");
|
|
2292
|
+
return p.clear(), (S ?? []).map((T) => (p.set(T.packageName, T), {
|
|
2258
2293
|
workspaceId: d,
|
|
2259
|
-
id:
|
|
2294
|
+
id: T.packageName,
|
|
2260
2295
|
// the package is the manifest's category, as in the `files` mode and OmniVerk's own
|
|
2261
2296
|
// trees (1.3.14); the first folder only while the API does not list the category
|
|
2262
|
-
packageId:
|
|
2263
|
-
label:
|
|
2264
|
-
location:
|
|
2265
|
-
files: [
|
|
2266
|
-
search:
|
|
2297
|
+
packageId: T.category || T.path.split("/")[0] || void 0,
|
|
2298
|
+
label: T.packageName,
|
|
2299
|
+
location: T.path,
|
|
2300
|
+
files: [T.manifestFile],
|
|
2301
|
+
search: T.path,
|
|
2267
2302
|
// only the manifest: the checks and the preview do not count what is not given
|
|
2268
2303
|
contents: "manifest"
|
|
2269
2304
|
}));
|
|
2270
2305
|
},
|
|
2271
|
-
async readModule(
|
|
2272
|
-
return [await
|
|
2306
|
+
async readModule(S) {
|
|
2307
|
+
return [await A(S.id)];
|
|
2273
2308
|
},
|
|
2274
|
-
async writeModule(
|
|
2275
|
-
const
|
|
2276
|
-
if (
|
|
2309
|
+
async writeModule(S, T) {
|
|
2310
|
+
const I = k(S.id), b = T.find((N) => N.path !== I || N.type !== "write");
|
|
2311
|
+
if (b)
|
|
2277
2312
|
throw new Error(
|
|
2278
|
-
`This OmniVerk API stores only the manifest; "${
|
|
2313
|
+
`This OmniVerk API stores only the manifest; "${b.path}" was not saved.`
|
|
2279
2314
|
);
|
|
2280
|
-
const
|
|
2281
|
-
if (!
|
|
2315
|
+
const D = T[0];
|
|
2316
|
+
if (!D || D.type !== "write")
|
|
2282
2317
|
return { ok: !0, versions: {} };
|
|
2283
|
-
const
|
|
2284
|
-
if (
|
|
2285
|
-
return { ok: !1, conflicts: [{ path:
|
|
2286
|
-
const
|
|
2318
|
+
const u = await A(S.id);
|
|
2319
|
+
if (D.baseVersion !== void 0 && D.baseVersion !== u.version)
|
|
2320
|
+
return { ok: !1, conflicts: [{ path: I, currentVersion: u.version }] };
|
|
2321
|
+
const v = await s(
|
|
2287
2322
|
"PUT",
|
|
2288
|
-
`/module-manifests/${n(
|
|
2323
|
+
`/module-manifests/${n(S.id)}`,
|
|
2289
2324
|
{
|
|
2290
|
-
manifest: _(
|
|
2325
|
+
manifest: _(D.text).value
|
|
2291
2326
|
}
|
|
2292
|
-
),
|
|
2327
|
+
), f = await A(S.id);
|
|
2293
2328
|
return {
|
|
2294
2329
|
ok: !0,
|
|
2295
|
-
versions: { [
|
|
2296
|
-
...
|
|
2330
|
+
versions: { [I]: f.version },
|
|
2331
|
+
...v != null && v.revision ? { revision: v.revision } : {}
|
|
2297
2332
|
};
|
|
2298
2333
|
},
|
|
2299
|
-
async listRevisions(
|
|
2334
|
+
async listRevisions(S) {
|
|
2300
2335
|
return (await s(
|
|
2301
2336
|
"GET",
|
|
2302
|
-
`/module-manifests/${n(
|
|
2303
|
-
) ?? []).map((
|
|
2304
|
-
id:
|
|
2305
|
-
timestamp: Date.parse(
|
|
2306
|
-
path:
|
|
2307
|
-
...
|
|
2337
|
+
`/module-manifests/${n(S.id)}/revisions`
|
|
2338
|
+
) ?? []).map((I) => ({
|
|
2339
|
+
id: I.id,
|
|
2340
|
+
timestamp: Date.parse(I.at) || 0,
|
|
2341
|
+
path: k(S.id),
|
|
2342
|
+
...I.sizeBytes !== void 0 ? { summary: `${I.sizeBytes} B` } : {}
|
|
2308
2343
|
}));
|
|
2309
2344
|
},
|
|
2310
|
-
async readRevision(
|
|
2345
|
+
async readRevision(S, T) {
|
|
2311
2346
|
return s(
|
|
2312
2347
|
"GET",
|
|
2313
|
-
`/module-manifests/${n(
|
|
2348
|
+
`/module-manifests/${n(S.id)}/revisions/${n(T)}`,
|
|
2314
2349
|
void 0,
|
|
2315
2350
|
"text"
|
|
2316
2351
|
);
|
|
2317
2352
|
},
|
|
2318
|
-
async rollback(
|
|
2353
|
+
async rollback(S, T) {
|
|
2319
2354
|
await s(
|
|
2320
2355
|
"POST",
|
|
2321
|
-
`/module-manifests/${n(
|
|
2356
|
+
`/module-manifests/${n(S.id)}/revisions/${n(T)}/rollback`
|
|
2322
2357
|
);
|
|
2323
2358
|
},
|
|
2324
2359
|
...r
|
|
2325
2360
|
};
|
|
2326
2361
|
}
|
|
2327
|
-
const l = (d) => `/module-files/${n(d.workspaceId)}/modules/${n(d.id)}`,
|
|
2362
|
+
const l = (d) => `/module-files/${n(d.workspaceId)}/modules/${n(d.id)}`, h = (d) => d.map((p) => ({ path: p.path, content: Ce(p.text) }));
|
|
2328
2363
|
return {
|
|
2329
2364
|
async listWorkspaces() {
|
|
2330
2365
|
return s("GET", "/module-files/workspaces");
|
|
@@ -2333,43 +2368,43 @@ function ai(e = {}) {
|
|
|
2333
2368
|
return (await s(
|
|
2334
2369
|
"GET",
|
|
2335
2370
|
`/module-files/${n(d)}/modules`
|
|
2336
|
-
) ?? []).map((
|
|
2371
|
+
) ?? []).map((k) => ({ ...k, workspaceId: d }));
|
|
2337
2372
|
},
|
|
2338
2373
|
async readModule(d) {
|
|
2339
|
-
const
|
|
2340
|
-
return ((
|
|
2341
|
-
path:
|
|
2342
|
-
text:
|
|
2343
|
-
...
|
|
2344
|
-
...
|
|
2374
|
+
const p = await s("GET", l(d));
|
|
2375
|
+
return ((p == null ? void 0 : p.files) ?? []).map((k) => ({
|
|
2376
|
+
path: k.path,
|
|
2377
|
+
text: ti(k.content),
|
|
2378
|
+
...k.version ? { version: k.version } : {},
|
|
2379
|
+
...k.readOnly ? { readOnly: !0 } : {}
|
|
2345
2380
|
}));
|
|
2346
2381
|
},
|
|
2347
|
-
async writeModule(d,
|
|
2348
|
-
var
|
|
2382
|
+
async writeModule(d, p) {
|
|
2383
|
+
var k;
|
|
2349
2384
|
try {
|
|
2350
|
-
const
|
|
2385
|
+
const A = await s(
|
|
2351
2386
|
"PUT",
|
|
2352
2387
|
l(d),
|
|
2353
2388
|
{
|
|
2354
|
-
changes:
|
|
2355
|
-
(
|
|
2389
|
+
changes: p.map(
|
|
2390
|
+
(S) => S.type === "write" ? {
|
|
2356
2391
|
type: "write",
|
|
2357
|
-
path:
|
|
2358
|
-
content: Ce(
|
|
2359
|
-
baseVersion:
|
|
2360
|
-
} : { type: "delete", path:
|
|
2392
|
+
path: S.path,
|
|
2393
|
+
content: Ce(S.text),
|
|
2394
|
+
baseVersion: S.baseVersion
|
|
2395
|
+
} : { type: "delete", path: S.path, baseVersion: S.baseVersion }
|
|
2361
2396
|
)
|
|
2362
2397
|
}
|
|
2363
2398
|
);
|
|
2364
2399
|
return {
|
|
2365
2400
|
ok: !0,
|
|
2366
|
-
versions:
|
|
2367
|
-
...
|
|
2401
|
+
versions: A == null ? void 0 : A.versions,
|
|
2402
|
+
...A != null && A.revision ? { revision: A.revision } : {}
|
|
2368
2403
|
};
|
|
2369
|
-
} catch (
|
|
2370
|
-
if (
|
|
2371
|
-
return { ok: !1, conflicts: ((
|
|
2372
|
-
throw
|
|
2404
|
+
} catch (A) {
|
|
2405
|
+
if (A instanceof ye && A.status === 409)
|
|
2406
|
+
return { ok: !1, conflicts: ((k = A.body) == null ? void 0 : k.conflicts) ?? p.map((T) => ({ path: T.path })) };
|
|
2407
|
+
throw A;
|
|
2373
2408
|
}
|
|
2374
2409
|
},
|
|
2375
2410
|
async createModule(d) {
|
|
@@ -2379,44 +2414,44 @@ function ai(e = {}) {
|
|
|
2379
2414
|
{
|
|
2380
2415
|
packageId: d.packageId,
|
|
2381
2416
|
id: d.id,
|
|
2382
|
-
files:
|
|
2417
|
+
files: h(d.files)
|
|
2383
2418
|
}
|
|
2384
2419
|
), workspaceId: d.workspaceId };
|
|
2385
2420
|
},
|
|
2386
2421
|
async deleteModule(d) {
|
|
2387
2422
|
await s("DELETE", l(d));
|
|
2388
2423
|
},
|
|
2389
|
-
async listRevisions(d,
|
|
2424
|
+
async listRevisions(d, p) {
|
|
2390
2425
|
return s(
|
|
2391
2426
|
"GET",
|
|
2392
|
-
`${l(d)}/revisions${
|
|
2427
|
+
`${l(d)}/revisions${p ? `?path=${n(p)}` : ""}`
|
|
2393
2428
|
);
|
|
2394
2429
|
},
|
|
2395
|
-
async readRevision(d,
|
|
2430
|
+
async readRevision(d, p, k) {
|
|
2396
2431
|
return s(
|
|
2397
2432
|
"GET",
|
|
2398
|
-
`${l(d)}/revisions/${n(
|
|
2433
|
+
`${l(d)}/revisions/${n(p)}${k ? `?path=${n(k)}` : ""}`,
|
|
2399
2434
|
void 0,
|
|
2400
2435
|
"text"
|
|
2401
2436
|
);
|
|
2402
2437
|
},
|
|
2403
|
-
async rollback(d,
|
|
2438
|
+
async rollback(d, p, k) {
|
|
2404
2439
|
await s(
|
|
2405
2440
|
"POST",
|
|
2406
|
-
`${l(d)}/revisions/${n(
|
|
2441
|
+
`${l(d)}/revisions/${n(p)}/rollback${k ? `?path=${n(k)}` : ""}`
|
|
2407
2442
|
);
|
|
2408
2443
|
},
|
|
2409
2444
|
...e.serverValidation ? {
|
|
2410
|
-
async validate(d,
|
|
2445
|
+
async validate(d, p) {
|
|
2411
2446
|
return s("POST", `${l(d)}/validate`, {
|
|
2412
|
-
files:
|
|
2447
|
+
files: h(p)
|
|
2413
2448
|
});
|
|
2414
2449
|
}
|
|
2415
2450
|
} : {},
|
|
2416
2451
|
...r
|
|
2417
2452
|
};
|
|
2418
2453
|
}
|
|
2419
|
-
const
|
|
2454
|
+
const ni = [
|
|
2420
2455
|
"en",
|
|
2421
2456
|
"pl",
|
|
2422
2457
|
"de",
|
|
@@ -2445,12 +2480,12 @@ const ii = [
|
|
|
2445
2480
|
} catch {
|
|
2446
2481
|
return { path: i.path, value: {} };
|
|
2447
2482
|
}
|
|
2448
|
-
},
|
|
2483
|
+
}, si = (e) => {
|
|
2449
2484
|
var i;
|
|
2450
2485
|
return ((i = be(e)) == null ? void 0 : i.path.replace(/\.manifest\.json$/i, "")) ?? "module";
|
|
2451
2486
|
};
|
|
2452
|
-
function
|
|
2453
|
-
const i = e.t ?? ((s, r) => r), t = (s, r) => i(`devStudio.omniverk.${s}`, r),
|
|
2487
|
+
function li(e = {}) {
|
|
2488
|
+
const i = e.t ?? ((s, r) => r), t = (s, r) => i(`devStudio.omniverk.${s}`, r), a = {
|
|
2454
2489
|
type: "object",
|
|
2455
2490
|
properties: {
|
|
2456
2491
|
name: { type: "string", title: t("field.name", "Name") },
|
|
@@ -2458,7 +2493,7 @@ function ri(e = {}) {
|
|
|
2458
2493
|
dataType: {
|
|
2459
2494
|
type: "string",
|
|
2460
2495
|
title: t("field.dataType", "Data type"),
|
|
2461
|
-
enum: [...
|
|
2496
|
+
enum: [...kt]
|
|
2462
2497
|
},
|
|
2463
2498
|
maxLength: { type: "integer", title: t("field.maxLength", "Max length") },
|
|
2464
2499
|
isRequired: { type: "boolean", title: t("field.isRequired", "Required") },
|
|
@@ -2489,21 +2524,21 @@ function ri(e = {}) {
|
|
|
2489
2524
|
};
|
|
2490
2525
|
return {
|
|
2491
2526
|
id: "omniverk",
|
|
2492
|
-
kinds:
|
|
2493
|
-
manifestSections:
|
|
2494
|
-
entities: { entityMetaSchema: n, fieldSchema:
|
|
2495
|
-
locales: e.locales ??
|
|
2527
|
+
kinds: wt,
|
|
2528
|
+
manifestSections: $t(i, { scripting: e.scripting }),
|
|
2529
|
+
entities: { entityMetaSchema: n, fieldSchema: a },
|
|
2530
|
+
locales: e.locales ?? ni,
|
|
2496
2531
|
requiredLocales: ["en", "pl"],
|
|
2497
2532
|
moduleId: (s) => {
|
|
2498
2533
|
var l;
|
|
2499
2534
|
const r = (l = be(s)) == null ? void 0 : l.value.packageName;
|
|
2500
2535
|
return typeof r == "string" && r ? r : void 0;
|
|
2501
2536
|
},
|
|
2502
|
-
validateModule: (s) =>
|
|
2537
|
+
validateModule: (s) => Vt(s),
|
|
2503
2538
|
generateModule: async (s, { existingIds: r }) => {
|
|
2504
|
-
const l = await
|
|
2539
|
+
const l = await Ot(
|
|
2505
2540
|
{
|
|
2506
|
-
...
|
|
2541
|
+
...At(s),
|
|
2507
2542
|
iconConfig: e.iconConfig,
|
|
2508
2543
|
ownerTenantId: e.ownerTenantId
|
|
2509
2544
|
},
|
|
@@ -2518,7 +2553,7 @@ function ri(e = {}) {
|
|
|
2518
2553
|
files: l.package.files
|
|
2519
2554
|
};
|
|
2520
2555
|
},
|
|
2521
|
-
duplicateModule: (s, r) =>
|
|
2556
|
+
duplicateModule: (s, r) => Kt(s, r),
|
|
2522
2557
|
scripts: {
|
|
2523
2558
|
categories: [
|
|
2524
2559
|
"calculation",
|
|
@@ -2532,20 +2567,20 @@ function ri(e = {}) {
|
|
|
2532
2567
|
phases: ["preInstall", "postInstall", "preUninstall", "postUninstall", "migrations"]
|
|
2533
2568
|
},
|
|
2534
2569
|
newFile: (s, { files: r }) => {
|
|
2535
|
-
var
|
|
2536
|
-
const l =
|
|
2570
|
+
var A;
|
|
2571
|
+
const l = si(r), h = ((A = be(r)) == null ? void 0 : A.value) ?? {};
|
|
2537
2572
|
if (s === "scripts") {
|
|
2538
|
-
let
|
|
2539
|
-
for (let
|
|
2540
|
-
|
|
2541
|
-
const
|
|
2542
|
-
moduleName: String(
|
|
2573
|
+
let S = `${l}.scripts.json`;
|
|
2574
|
+
for (let I = 2; r.some((b) => b.path === S); I++)
|
|
2575
|
+
S = `${l}.${I}.scripts.json`;
|
|
2576
|
+
const T = {
|
|
2577
|
+
moduleName: String(h.packageName ?? l),
|
|
2543
2578
|
version: "1.0.0",
|
|
2544
2579
|
scripts: []
|
|
2545
2580
|
};
|
|
2546
|
-
return { path:
|
|
2581
|
+
return { path: S, text: ae(T) };
|
|
2547
2582
|
}
|
|
2548
|
-
const d = `${String(
|
|
2583
|
+
const d = `${String(h.packageName ?? l)}.Core`, k = {
|
|
2549
2584
|
entities: ["entities.json", { moduleName: d, version: "1.0.0", entities: [] }],
|
|
2550
2585
|
views: ["views.json", { moduleName: d, version: "1.0.0", views: [] }],
|
|
2551
2586
|
workflows: ["workflows.json", { moduleName: d, version: "1.0.0", workflows: [] }],
|
|
@@ -2553,9 +2588,13 @@ function ri(e = {}) {
|
|
|
2553
2588
|
"permissions.json",
|
|
2554
2589
|
{ moduleName: d, version: "1.0.0", permissions: [], permissionGroups: [] }
|
|
2555
2590
|
],
|
|
2556
|
-
seeds: ["seeds.json", { moduleName: d, version: "1.0.0", seeds: {} }]
|
|
2591
|
+
seeds: ["seeds.json", { moduleName: d, version: "1.0.0", seeds: {} }],
|
|
2592
|
+
dataSources: [
|
|
2593
|
+
"datasources.json",
|
|
2594
|
+
{ moduleName: String(h.packageName ?? l), version: "1.0.0", dataSources: [] }
|
|
2595
|
+
]
|
|
2557
2596
|
}[s];
|
|
2558
|
-
return
|
|
2597
|
+
return k ? { path: `${l}.${k[0]}`, text: ae(k[1]) } : void 0;
|
|
2559
2598
|
},
|
|
2560
2599
|
templateSchema: {
|
|
2561
2600
|
type: "object",
|
|
@@ -2579,22 +2618,22 @@ function ri(e = {}) {
|
|
|
2579
2618
|
}
|
|
2580
2619
|
};
|
|
2581
2620
|
}
|
|
2582
|
-
function
|
|
2621
|
+
function ci(e = {}) {
|
|
2583
2622
|
let i = 0;
|
|
2584
2623
|
const t = /* @__PURE__ */ new Map();
|
|
2585
2624
|
for (const [n, s] of Object.entries(e))
|
|
2586
2625
|
t.set(n, { text: s, version: String(++i) });
|
|
2587
|
-
const
|
|
2626
|
+
const a = (n) => n ? `${n}/` : "";
|
|
2588
2627
|
return {
|
|
2589
2628
|
async list(n) {
|
|
2590
|
-
const s =
|
|
2629
|
+
const s = a(n), r = /* @__PURE__ */ new Map();
|
|
2591
2630
|
for (const l of t.keys()) {
|
|
2592
2631
|
if (!l.startsWith(s))
|
|
2593
2632
|
continue;
|
|
2594
|
-
const
|
|
2595
|
-
r.set(d < 0 ?
|
|
2633
|
+
const h = l.slice(s.length), d = h.indexOf("/");
|
|
2634
|
+
r.set(d < 0 ? h : h.slice(0, d), d < 0 ? "file" : "directory");
|
|
2596
2635
|
}
|
|
2597
|
-
return [...r].map(([l,
|
|
2636
|
+
return [...r].map(([l, h]) => ({ name: l, kind: h }));
|
|
2598
2637
|
},
|
|
2599
2638
|
async read(n) {
|
|
2600
2639
|
const s = t.get(n);
|
|
@@ -2608,7 +2647,7 @@ function li(e = {}) {
|
|
|
2608
2647
|
t.delete(n);
|
|
2609
2648
|
},
|
|
2610
2649
|
async removeDir(n) {
|
|
2611
|
-
const s =
|
|
2650
|
+
const s = a(n);
|
|
2612
2651
|
for (const r of [...t.keys()])
|
|
2613
2652
|
r.startsWith(s) && t.delete(r);
|
|
2614
2653
|
},
|
|
@@ -2617,12 +2656,12 @@ function li(e = {}) {
|
|
|
2617
2656
|
}
|
|
2618
2657
|
};
|
|
2619
2658
|
}
|
|
2620
|
-
const
|
|
2621
|
-
function
|
|
2622
|
-
return typeof
|
|
2659
|
+
const _e = () => typeof window > "u" ? void 0 : window.showDirectoryPicker;
|
|
2660
|
+
function di() {
|
|
2661
|
+
return typeof _e() == "function";
|
|
2623
2662
|
}
|
|
2624
|
-
async function
|
|
2625
|
-
const i =
|
|
2663
|
+
async function pi(e = {}) {
|
|
2664
|
+
const i = _e();
|
|
2626
2665
|
if (!i)
|
|
2627
2666
|
throw new Error("This browser cannot open folders (File System Access API).");
|
|
2628
2667
|
return i({
|
|
@@ -2631,119 +2670,120 @@ async function di(e = {}) {
|
|
|
2631
2670
|
});
|
|
2632
2671
|
}
|
|
2633
2672
|
const le = (e) => typeof e == "object" && e !== null && (e.name === "NotFoundError" || e.name === "TypeMismatchError");
|
|
2634
|
-
function
|
|
2673
|
+
function mi(e) {
|
|
2635
2674
|
const i = new TextDecoder("utf-8", { ignoreBOM: !0 });
|
|
2636
2675
|
async function t(r, l = !1) {
|
|
2637
|
-
let
|
|
2676
|
+
let h = e;
|
|
2638
2677
|
for (const d of r.split("/").filter(Boolean))
|
|
2639
2678
|
try {
|
|
2640
|
-
|
|
2641
|
-
} catch (
|
|
2642
|
-
if (le(
|
|
2679
|
+
h = await h.getDirectoryHandle(d, { create: l });
|
|
2680
|
+
} catch (p) {
|
|
2681
|
+
if (le(p))
|
|
2643
2682
|
return null;
|
|
2644
|
-
throw
|
|
2683
|
+
throw p;
|
|
2645
2684
|
}
|
|
2646
|
-
return
|
|
2685
|
+
return h;
|
|
2647
2686
|
}
|
|
2648
|
-
const
|
|
2687
|
+
const a = (r) => {
|
|
2649
2688
|
const l = r.lastIndexOf("/");
|
|
2650
2689
|
return l < 0 ? ["", r] : [r.slice(0, l), r.slice(l + 1)];
|
|
2651
2690
|
};
|
|
2652
2691
|
async function n(r, l = !1) {
|
|
2653
|
-
const [
|
|
2654
|
-
if (!
|
|
2692
|
+
const [h, d] = a(r), p = await t(h, l);
|
|
2693
|
+
if (!p)
|
|
2655
2694
|
return null;
|
|
2656
2695
|
try {
|
|
2657
|
-
return await
|
|
2658
|
-
} catch (
|
|
2659
|
-
if (le(
|
|
2696
|
+
return await p.getFileHandle(d, { create: l });
|
|
2697
|
+
} catch (k) {
|
|
2698
|
+
if (le(k))
|
|
2660
2699
|
return null;
|
|
2661
|
-
throw
|
|
2700
|
+
throw k;
|
|
2662
2701
|
}
|
|
2663
2702
|
}
|
|
2664
2703
|
const s = (r) => `${r.lastModified}:${r.size}`;
|
|
2665
2704
|
return {
|
|
2666
2705
|
async list(r) {
|
|
2667
|
-
const l = await t(r),
|
|
2706
|
+
const l = await t(r), h = [];
|
|
2668
2707
|
if (l)
|
|
2669
2708
|
for await (const d of l.values())
|
|
2670
|
-
|
|
2671
|
-
return
|
|
2709
|
+
h.push({ name: d.name, kind: d.kind });
|
|
2710
|
+
return h;
|
|
2672
2711
|
},
|
|
2673
2712
|
async read(r) {
|
|
2674
2713
|
const l = await n(r);
|
|
2675
2714
|
if (!l)
|
|
2676
2715
|
return null;
|
|
2677
|
-
const
|
|
2678
|
-
return { text: i.decode(await
|
|
2716
|
+
const h = await l.getFile();
|
|
2717
|
+
return { text: i.decode(await h.arrayBuffer()), version: s(h) };
|
|
2679
2718
|
},
|
|
2680
2719
|
async write(r, l) {
|
|
2681
|
-
const
|
|
2682
|
-
if (!
|
|
2720
|
+
const h = await n(r, !0);
|
|
2721
|
+
if (!h)
|
|
2683
2722
|
throw new Error(`Cannot write ${r}`);
|
|
2684
|
-
const d = await
|
|
2685
|
-
return await d.write(l), await d.close(), s(await
|
|
2723
|
+
const d = await h.createWritable();
|
|
2724
|
+
return await d.write(l), await d.close(), s(await h.getFile());
|
|
2686
2725
|
},
|
|
2687
2726
|
async remove(r) {
|
|
2688
|
-
const [l,
|
|
2727
|
+
const [l, h] = a(r), d = await t(l);
|
|
2689
2728
|
try {
|
|
2690
|
-
await (d == null ? void 0 : d.removeEntry(
|
|
2691
|
-
} catch (
|
|
2692
|
-
if (!le(
|
|
2693
|
-
throw
|
|
2729
|
+
await (d == null ? void 0 : d.removeEntry(h));
|
|
2730
|
+
} catch (p) {
|
|
2731
|
+
if (!le(p))
|
|
2732
|
+
throw p;
|
|
2694
2733
|
}
|
|
2695
2734
|
},
|
|
2696
2735
|
async removeDir(r) {
|
|
2697
|
-
const [l,
|
|
2736
|
+
const [l, h] = a(r), d = await t(l);
|
|
2698
2737
|
try {
|
|
2699
|
-
await (d == null ? void 0 : d.removeEntry(
|
|
2700
|
-
} catch (
|
|
2701
|
-
if (!le(
|
|
2702
|
-
throw
|
|
2738
|
+
await (d == null ? void 0 : d.removeEntry(h, { recursive: !0 }));
|
|
2739
|
+
} catch (p) {
|
|
2740
|
+
if (!le(p))
|
|
2741
|
+
throw p;
|
|
2703
2742
|
}
|
|
2704
2743
|
}
|
|
2705
2744
|
};
|
|
2706
2745
|
}
|
|
2707
2746
|
export {
|
|
2708
2747
|
W as OMNIVERK_CUSTOM_PREFIX,
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2748
|
+
kt as OMNIVERK_DATA_TYPES,
|
|
2749
|
+
qt as OMNIVERK_LEGACY_LIST_VIEW_FILES,
|
|
2750
|
+
ni as OMNIVERK_LOCALES,
|
|
2712
2751
|
ye as OmniVerkRestError,
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2752
|
+
Ot as buildOmniVerkModule,
|
|
2753
|
+
mi as createDirectoryHandleFileSystem,
|
|
2754
|
+
ci as createMemorySeedFileSystem,
|
|
2755
|
+
ri as createOmniVerkRestProvider,
|
|
2756
|
+
li as createOmniVerkStudioPreset,
|
|
2757
|
+
ai as createSeedFolderProvider,
|
|
2758
|
+
Kt as duplicateOmniVerkModule,
|
|
2759
|
+
di as isSeedFolderPickerSupported,
|
|
2760
|
+
ht as omniverkDataSourcesKind,
|
|
2721
2761
|
Qe as omniverkEntitiesKind,
|
|
2722
|
-
|
|
2723
|
-
|
|
2762
|
+
wt as omniverkFileKinds,
|
|
2763
|
+
jt as omniverkFilePrefix,
|
|
2724
2764
|
et as omniverkI18nKind,
|
|
2725
2765
|
Ze as omniverkManifestKind,
|
|
2726
|
-
|
|
2766
|
+
$t as omniverkManifestSections,
|
|
2727
2767
|
P as omniverkPascalIdentifier,
|
|
2728
2768
|
ut as omniverkPermissionsKind,
|
|
2729
2769
|
fe as omniverkRevisionStamp,
|
|
2730
2770
|
yt as omniverkScriptKind,
|
|
2731
2771
|
gt as omniverkScriptsKind,
|
|
2732
2772
|
ft as omniverkSeedsKind,
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2773
|
+
At as omniverkSpecFromStudio,
|
|
2774
|
+
Ve as omniverkStableId,
|
|
2775
|
+
Ue as omniverkTableName,
|
|
2736
2776
|
Ie as omniverkTemplateFromDto,
|
|
2737
|
-
|
|
2777
|
+
Gt as omniverkTemplateFromEntry,
|
|
2738
2778
|
xe as omniverkTemplateToEntry,
|
|
2739
|
-
|
|
2779
|
+
_t as omniverkTemplateToInput,
|
|
2740
2780
|
ot as omniverkViewFromItem,
|
|
2741
2781
|
st as omniverkViewItem,
|
|
2742
2782
|
at as omniverkViewsKind,
|
|
2743
2783
|
ct as omniverkWorkflowFromItem,
|
|
2744
2784
|
lt as omniverkWorkflowItem,
|
|
2745
2785
|
dt as omniverkWorkflowsKind,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2786
|
+
pi as pickSeedDirectory,
|
|
2787
|
+
Vt as validateOmniVerkModule,
|
|
2788
|
+
Ut as validateOmniVerkWorkspace
|
|
2749
2789
|
};
|