@nice2dev/erp-adapter 1.4.11 → 1.4.13
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 +39 -0
- package/dist/omniverk/index.d.ts +2 -0
- package/dist/omniverk/integrations.d.ts +106 -0
- package/dist/omniverk/kinds.d.ts +7 -0
- package/dist/omniverk.cjs +2 -2
- package/dist/omniverk.mjs +2006 -1726
- package/package.json +3 -3
package/dist/omniverk.mjs
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { objectFileKind as
|
|
2
|
-
const
|
|
1
|
+
import { objectFileKind as Ee, endsWithAny as _, arrayFileKind as Fe, i18nFileKind as Ye, itemsFileKind as Pe, jsonFileKind as Re, scriptsFileKind as Xe, jsonValuesEqual as Ve, keepTextFormat as et, parseJsonText as z, patchJsonText as qe, stringifyJsonText as le } from "@nice2dev/ui-forms/studio";
|
|
2
|
+
const U = (e) => typeof e == "object" && e !== null && !Array.isArray(e), J = (e) => typeof e == "string" && e ? e : void 0, W = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), tt = Ee({
|
|
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: _(".manifest.json")
|
|
9
|
+
}), Ue = [
|
|
10
10
|
["dataType", "type"],
|
|
11
11
|
["isRequired", "required"]
|
|
12
|
-
],
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
12
|
+
], ue = "$aliases";
|
|
13
|
+
function it(e) {
|
|
14
|
+
if (!U(e))
|
|
15
15
|
return e;
|
|
16
|
-
const i =
|
|
16
|
+
const i = Ue.filter(([o, n]) => !(o 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(([,
|
|
22
|
-
t[s ? s[0] :
|
|
20
|
+
for (const [o, n] of Object.entries(e)) {
|
|
21
|
+
const s = i.find(([, a]) => a === o);
|
|
22
|
+
t[s ? s[0] : o] = n;
|
|
23
23
|
}
|
|
24
|
-
return t[
|
|
24
|
+
return t[ue] = i.map(([, o]) => o), t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
26
|
+
function nt(e) {
|
|
27
|
+
if (!U(e) || !Array.isArray(e[ue]))
|
|
28
28
|
return e;
|
|
29
|
-
const i = e[
|
|
30
|
-
for (const [
|
|
31
|
-
if (
|
|
29
|
+
const i = e[ue], t = {};
|
|
30
|
+
for (const [o, n] of Object.entries(e)) {
|
|
31
|
+
if (o === ue)
|
|
32
32
|
continue;
|
|
33
|
-
const s =
|
|
34
|
-
t[s ? s[1] :
|
|
33
|
+
const s = Ue.find(([a, l]) => a === o && i.includes(l));
|
|
34
|
+
t[s ? s[1] : o] = n;
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const e =
|
|
38
|
+
const xe = (e, i) => U(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.map(i) } : e, st = (() => {
|
|
39
|
+
const e = Fe({
|
|
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: _(".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,
|
|
53
|
-
i.map((n) =>
|
|
51
|
+
decode: (i, t) => e.decode(i, t).map((o) => xe(o, it)),
|
|
52
|
+
encode: (i, t, o) => e.encode(
|
|
53
|
+
i.map((n) => xe(n, nt)),
|
|
54
54
|
t,
|
|
55
|
-
|
|
55
|
+
o
|
|
56
56
|
)
|
|
57
57
|
};
|
|
58
|
-
})(),
|
|
58
|
+
})(), ot = Ye(), $e = {
|
|
59
59
|
input: "textInput",
|
|
60
60
|
text: "textInput",
|
|
61
61
|
textarea: "textArea",
|
|
@@ -68,7 +68,7 @@ const Se = (e, i) => V(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.
|
|
|
68
68
|
lookup: "select",
|
|
69
69
|
select: "select"
|
|
70
70
|
};
|
|
71
|
-
function
|
|
71
|
+
function at(e) {
|
|
72
72
|
const i = e.columns.map((t) => ({
|
|
73
73
|
field: String(t.field ?? ""),
|
|
74
74
|
header: String(t.displayName ?? t.header ?? t.label ?? t.field ?? "")
|
|
@@ -96,25 +96,25 @@ function tt(e) {
|
|
|
96
96
|
]
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
var l,
|
|
101
|
-
const t = (e.rows ?? []).flatMap((
|
|
102
|
-
return
|
|
99
|
+
function We(e, i) {
|
|
100
|
+
var l, y, p;
|
|
101
|
+
const t = (e.rows ?? []).flatMap((u) => u.cells).find((u) => u.controlType === "dataGrid"), o = ((l = t == null ? void 0 : t.props) == null ? void 0 : l.columns) ?? [], n = i.columns ?? [], s = (p = (y = e.dataSources) == null ? void 0 : y.find((u) => u.type === "entity")) == null ? void 0 : p.entity, a = (u) => "displayName" in u ? "displayName" : "header" in u ? "header" : "label" in u ? "label" : "displayName";
|
|
102
|
+
return W({
|
|
103
103
|
...i,
|
|
104
104
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
105
105
|
entityName: s ?? i.entityName,
|
|
106
|
-
columns:
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
return { field:
|
|
110
|
-
const
|
|
111
|
-
return
|
|
106
|
+
columns: o.map((u) => {
|
|
107
|
+
const N = n.find((x) => x.field === u.field);
|
|
108
|
+
if (!N)
|
|
109
|
+
return { field: u.field, displayName: u.header ?? u.field };
|
|
110
|
+
const L = a(N), I = u.header ?? u.field;
|
|
111
|
+
return N[L] === void 0 && I === u.field ? N : { ...N, [L]: I };
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function rt(e) {
|
|
116
116
|
const i = [];
|
|
117
|
-
return e.tabs.forEach((
|
|
117
|
+
return e.tabs.forEach((o, n) => {
|
|
118
118
|
i.push({
|
|
119
119
|
id: `tab-${n}`,
|
|
120
120
|
cells: [
|
|
@@ -122,15 +122,15 @@ function it(e) {
|
|
|
122
122
|
id: `tab-${n}`,
|
|
123
123
|
controlType: "heading",
|
|
124
124
|
colSpan: 12,
|
|
125
|
-
props: { text: String(
|
|
125
|
+
props: { text: String(o.displayName ?? o.name ?? ""), level: 2, name: o.name }
|
|
126
126
|
}
|
|
127
127
|
]
|
|
128
|
-
}), (
|
|
128
|
+
}), (o.sections ?? []).forEach((s, a) => {
|
|
129
129
|
i.push({
|
|
130
|
-
id: `tab-${n}-section-${
|
|
130
|
+
id: `tab-${n}-section-${a}`,
|
|
131
131
|
cells: [
|
|
132
132
|
{
|
|
133
|
-
id: `tab-${n}-section-${
|
|
133
|
+
id: `tab-${n}-section-${a}`,
|
|
134
134
|
controlType: "heading",
|
|
135
135
|
colSpan: 12,
|
|
136
136
|
props: {
|
|
@@ -141,25 +141,25 @@ function it(e) {
|
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
143
|
});
|
|
144
|
-
let l = [],
|
|
145
|
-
const
|
|
146
|
-
l.length && (i.push({ id: `tab-${n}-section-${
|
|
144
|
+
let l = [], y = 0;
|
|
145
|
+
const p = () => {
|
|
146
|
+
l.length && (i.push({ id: `tab-${n}-section-${a}-row-${i.length}`, cells: l }), l = [], y = 0);
|
|
147
147
|
};
|
|
148
|
-
(s.controls ?? []).forEach((
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
id: `c-${n}-${
|
|
152
|
-
controlType:
|
|
153
|
-
colSpan:
|
|
148
|
+
(s.controls ?? []).forEach((u, N) => {
|
|
149
|
+
const L = typeof u.colSpan == "number" ? u.colSpan : 6;
|
|
150
|
+
y + L > 12 && p(), l.push({
|
|
151
|
+
id: `c-${n}-${a}-${N}`,
|
|
152
|
+
controlType: $e[String(u.type)] ?? "textInput",
|
|
153
|
+
colSpan: L,
|
|
154
154
|
props: {
|
|
155
|
-
label: String(
|
|
156
|
-
required:
|
|
157
|
-
field:
|
|
158
|
-
type:
|
|
155
|
+
label: String(u.label ?? u.field ?? ""),
|
|
156
|
+
required: u.required === !0,
|
|
157
|
+
field: u.field,
|
|
158
|
+
type: u.type
|
|
159
159
|
},
|
|
160
|
-
bindings: { value: { source: "record", field: String(
|
|
161
|
-
}),
|
|
162
|
-
}),
|
|
160
|
+
bindings: { value: { source: "record", field: String(u.field ?? "") } }
|
|
161
|
+
}), y += L;
|
|
162
|
+
}), p();
|
|
163
163
|
});
|
|
164
164
|
}), {
|
|
165
165
|
id: String(e.name),
|
|
@@ -171,202 +171,202 @@ function it(e) {
|
|
|
171
171
|
rows: i
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
const t = i.tabs ?? [],
|
|
177
|
-
(
|
|
174
|
+
function Ge(e, i) {
|
|
175
|
+
var p, u, N, L, I;
|
|
176
|
+
const t = i.tabs ?? [], o = t.flatMap(
|
|
177
|
+
(x) => (x.sections ?? []).flatMap((O) => O.controls ?? [])
|
|
178
178
|
), n = [];
|
|
179
|
-
let s = null,
|
|
180
|
-
const l = () => (s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s)),
|
|
181
|
-
for (const
|
|
182
|
-
for (const
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
s = { ...t.find((
|
|
179
|
+
let s = null, a = null;
|
|
180
|
+
const l = () => (s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s)), a || (a = { name: "Details", displayName: "Details", controls: [] }, s.sections.push(a)), a);
|
|
181
|
+
for (const x of e.rows ?? [])
|
|
182
|
+
for (const O of x.cells) {
|
|
183
|
+
const w = O.props ?? {};
|
|
184
|
+
if (O.controlType === "heading" && (w.level === 2 || w.level === 3)) {
|
|
185
|
+
const E = J(w.name) ?? String(w.text ?? "").replace(/\s+/g, "");
|
|
186
|
+
if (w.level === 2)
|
|
187
|
+
s = { ...t.find((h) => h.name === E) ?? {}, name: E, displayName: String(w.text ?? E), sections: [] }, n.push(s), a = null;
|
|
188
188
|
else {
|
|
189
189
|
s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s));
|
|
190
|
-
const C = t.flatMap((
|
|
191
|
-
|
|
190
|
+
const C = t.flatMap((S) => S.sections ?? []).find((S) => S.name === E);
|
|
191
|
+
a = { ...C ? Object.fromEntries(Object.entries(C).filter(([S]) => S !== "controls")) : {}, name: E, displayName: String(w.text ?? E), controls: [] }, s.sections.push(a);
|
|
192
192
|
}
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
195
|
+
const T = ((u = (p = O.bindings) == null ? void 0 : p.value) == null ? void 0 : u.field) ?? J(w.field);
|
|
196
|
+
if (!T)
|
|
197
197
|
continue;
|
|
198
|
-
const
|
|
199
|
-
...
|
|
200
|
-
field:
|
|
201
|
-
type:
|
|
202
|
-
label:
|
|
203
|
-
colSpan: (
|
|
204
|
-
required:
|
|
198
|
+
const m = o.find((E) => E.field === T), b = m && $e[String(m.type)] === O.controlType ? m.type : ((N = Object.entries($e).find(([, E]) => E === O.controlType)) == null ? void 0 : N[0]) ?? "input", g = W({
|
|
199
|
+
...m ?? {},
|
|
200
|
+
field: T,
|
|
201
|
+
type: b,
|
|
202
|
+
label: w.label !== void 0 ? String(w.label) : m == null ? void 0 : m.label,
|
|
203
|
+
colSpan: (m == null ? void 0 : m.colSpan) !== void 0 || O.colSpan !== 6 ? O.colSpan : void 0,
|
|
204
|
+
required: w.required === !0 ? !0 : (m == null ? void 0 : m.required) === !0 ? !1 : m == null ? void 0 : m.required
|
|
205
205
|
});
|
|
206
|
-
l().controls.push(
|
|
206
|
+
l().controls.push(g);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
return
|
|
208
|
+
const y = n.map((x) => {
|
|
209
|
+
const O = t.find((w) => w.name === x.name);
|
|
210
|
+
return O ? { ...O, ...x } : x;
|
|
211
211
|
});
|
|
212
|
-
return
|
|
212
|
+
return W({
|
|
213
213
|
...i,
|
|
214
214
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
215
|
-
entityName: ((
|
|
216
|
-
tabs:
|
|
215
|
+
entityName: ((I = (L = e.dataSources) == null ? void 0 : L.find((x) => x.type === "entity")) == null ? void 0 : I.entity) ?? i.entityName,
|
|
216
|
+
tabs: y
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const lt = (e) => {
|
|
220
220
|
const i = String(e.type ?? "").toLowerCase();
|
|
221
221
|
return i === "list" && typeof e.entityName == "string" && Array.isArray(e.columns) && e.columns.length > 0 ? "List" : i === "form" && typeof e.entityName == "string" && Array.isArray(e.tabs) ? "Form" : null;
|
|
222
222
|
};
|
|
223
|
-
function
|
|
224
|
-
const t =
|
|
223
|
+
function ct(e, i) {
|
|
224
|
+
const t = U(e) ? e : {}, o = J(t.name) ?? J(t.id) ?? `#${i}`, n = J(t.displayName) ?? o, s = lt(t);
|
|
225
225
|
if (!s)
|
|
226
226
|
return {
|
|
227
|
-
key:
|
|
227
|
+
key: o,
|
|
228
228
|
label: n,
|
|
229
229
|
source: e,
|
|
230
230
|
rawReason: String(t.type ?? (t.viewJson ? "viewJson" : "unknown"))
|
|
231
231
|
};
|
|
232
|
-
const
|
|
233
|
-
return
|
|
232
|
+
const a = s === "List" ? at(t) : rt(t), l = s === "List" ? We(a, t) : Ge(a, t);
|
|
233
|
+
return Ve(l, e) ? { key: o, label: n, definition: a, source: e } : { key: o, label: n, source: e, rawReason: `${s} (round-trip)` };
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function dt(e) {
|
|
236
236
|
if (!e.definition)
|
|
237
237
|
return e.source;
|
|
238
|
-
const i =
|
|
239
|
-
return e.definition.kind === "form" ?
|
|
238
|
+
const i = U(e.source) ? e.source : { name: e.definition.id };
|
|
239
|
+
return e.definition.kind === "form" ? Ge(e.definition, {
|
|
240
240
|
type: "Form",
|
|
241
241
|
...i,
|
|
242
242
|
name: i.name ?? e.definition.id
|
|
243
|
-
}) :
|
|
243
|
+
}) : We(e.definition, {
|
|
244
244
|
type: "List",
|
|
245
245
|
...i,
|
|
246
246
|
name: i.name ?? e.definition.id
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
const
|
|
249
|
+
const pt = Pe({
|
|
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: _(".views.json"),
|
|
256
256
|
property: "views",
|
|
257
257
|
itemKey: "name",
|
|
258
|
-
toItem:
|
|
259
|
-
fromItem:
|
|
258
|
+
toItem: ct,
|
|
259
|
+
fromItem: dt
|
|
260
260
|
});
|
|
261
|
-
function
|
|
261
|
+
function ut(e) {
|
|
262
262
|
const i = e.steps ?? [], t = e.connections ?? [];
|
|
263
263
|
return {
|
|
264
264
|
id: String(e.name),
|
|
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((o, n) => ({
|
|
269
|
+
id: String(o.state),
|
|
270
|
+
name: String(o.displayName ?? o.state),
|
|
271
|
+
type: o.isInitial === !0 ? "initial" : o.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((o, n) => ({
|
|
275
275
|
id: `t${n}`,
|
|
276
|
-
fromStateId: String(
|
|
277
|
-
toStateId: String(
|
|
278
|
-
name: String(
|
|
279
|
-
...typeof
|
|
276
|
+
fromStateId: String(o.fromState),
|
|
277
|
+
toStateId: String(o.toState),
|
|
278
|
+
name: String(o.actionName ?? ""),
|
|
279
|
+
...typeof o.requiredPermission == "string" ? { requiredPermission: o.requiredPermission } : {}
|
|
280
280
|
}))
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
const t = i.steps ?? [],
|
|
285
|
-
return
|
|
283
|
+
function Je(e, i) {
|
|
284
|
+
const t = i.steps ?? [], o = i.connections ?? [];
|
|
285
|
+
return W({
|
|
286
286
|
...i,
|
|
287
287
|
displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
|
|
288
288
|
entityName: e.entityType || i.entityName,
|
|
289
289
|
steps: e.states.map((n) => {
|
|
290
|
-
const s = t.find((l) => l.state === n.id),
|
|
291
|
-
return
|
|
292
|
-
...
|
|
290
|
+
const s = t.find((l) => l.state === n.id), a = s ?? { state: n.id };
|
|
291
|
+
return W({
|
|
292
|
+
...a,
|
|
293
293
|
displayName: s && "displayName" in s || n.name !== n.id ? n.name : void 0,
|
|
294
294
|
isInitial: n.type === "initial" ? !0 : (s == null ? void 0 : s.isInitial) === !0 || s == null ? void 0 : s.isInitial,
|
|
295
295
|
isFinal: n.type === "final" ? !0 : (s == null ? void 0 : s.isFinal) === !0 || s == null ? void 0 : s.isFinal
|
|
296
296
|
});
|
|
297
297
|
}),
|
|
298
298
|
connections: e.transitions.map((n) => {
|
|
299
|
-
const s = /^t(\d+)$/.exec(n.id),
|
|
300
|
-
return
|
|
301
|
-
...
|
|
299
|
+
const s = /^t(\d+)$/.exec(n.id), a = s ? o[Number(s[1])] : o.find((l) => l.fromState === n.fromStateId && l.toState === n.toStateId);
|
|
300
|
+
return W({
|
|
301
|
+
...a ?? {},
|
|
302
302
|
fromState: n.fromStateId,
|
|
303
303
|
toState: n.toStateId,
|
|
304
|
-
actionName: n.name || (
|
|
304
|
+
actionName: n.name || (a == null ? void 0 : a.actionName),
|
|
305
305
|
requiredPermission: n.requiredPermission
|
|
306
306
|
});
|
|
307
307
|
})
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
const t =
|
|
312
|
-
if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((
|
|
313
|
-
return { key:
|
|
314
|
-
const l =
|
|
315
|
-
return
|
|
310
|
+
function mt(e, i) {
|
|
311
|
+
const t = U(e) ? e : {}, o = J(t.name) ?? `#${i}`, n = J(t.displayName) ?? o, s = t.steps;
|
|
312
|
+
if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((y) => U(y) && typeof y.state == "string")))
|
|
313
|
+
return { key: o, label: n, source: e, rawReason: J(t.triggerType) ?? "automation" };
|
|
314
|
+
const l = ut(t);
|
|
315
|
+
return Ve(Je(l, t), e) ? { key: o, label: n, definition: l, source: e } : { key: o, label: n, source: e, rawReason: "state machine (round-trip)" };
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function ft(e) {
|
|
318
318
|
if (!e.definition)
|
|
319
319
|
return e.source;
|
|
320
|
-
const i =
|
|
321
|
-
return
|
|
320
|
+
const i = U(e.source) ? e.source : { name: e.definition.id };
|
|
321
|
+
return Je(e.definition, {
|
|
322
322
|
...i,
|
|
323
323
|
name: i.name ?? e.definition.id
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
const
|
|
326
|
+
const yt = Pe({
|
|
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: _(".workflows.json"),
|
|
333
333
|
property: "workflows",
|
|
334
334
|
itemKey: "name",
|
|
335
|
-
toItem:
|
|
336
|
-
fromItem:
|
|
335
|
+
toItem: mt,
|
|
336
|
+
fromItem: ft
|
|
337
337
|
});
|
|
338
|
-
function
|
|
339
|
-
const i =
|
|
338
|
+
function gt(e) {
|
|
339
|
+
const i = U(e) ? e : {};
|
|
340
340
|
return {
|
|
341
341
|
permissions: (i.permissions ?? []).map(
|
|
342
|
-
(t) =>
|
|
342
|
+
(t) => W({
|
|
343
343
|
code: String(t.code ?? ""),
|
|
344
|
-
name:
|
|
345
|
-
description:
|
|
344
|
+
name: J(t.name),
|
|
345
|
+
description: J(t.description)
|
|
346
346
|
})
|
|
347
347
|
),
|
|
348
348
|
groups: (i.permissionGroups ?? []).map(
|
|
349
|
-
(t) =>
|
|
349
|
+
(t) => W({
|
|
350
350
|
id: String(t.name ?? ""),
|
|
351
351
|
label: String(t.name ?? ""),
|
|
352
|
-
description:
|
|
352
|
+
description: J(t.description),
|
|
353
353
|
permissions: Array.isArray(t.permissions) ? t.permissions : []
|
|
354
354
|
})
|
|
355
355
|
)
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
const t =
|
|
358
|
+
function ht(e, i) {
|
|
359
|
+
const t = U(e) ? e : {}, o = t.permissions ?? [], n = t.permissionGroups ?? [];
|
|
360
360
|
return {
|
|
361
361
|
...t,
|
|
362
362
|
permissions: i.permissions.map((s) => {
|
|
363
|
-
const
|
|
364
|
-
return
|
|
363
|
+
const a = o.find((l) => l.code === s.code);
|
|
364
|
+
return W({ ...a ?? {}, code: s.code, name: s.name, description: s.description });
|
|
365
365
|
}),
|
|
366
366
|
permissionGroups: i.groups.map((s) => {
|
|
367
|
-
const
|
|
368
|
-
return
|
|
369
|
-
...
|
|
367
|
+
const a = n.find((l) => l.name === s.id);
|
|
368
|
+
return W({
|
|
369
|
+
...a ?? {},
|
|
370
370
|
name: s.label,
|
|
371
371
|
description: s.description,
|
|
372
372
|
permissions: s.permissions
|
|
@@ -374,32 +374,32 @@ function mt(e, i) {
|
|
|
374
374
|
})
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
const
|
|
377
|
+
const wt = Re({
|
|
378
378
|
id: "permissions",
|
|
379
379
|
label: "Permissions",
|
|
380
380
|
labelKey: "devStudio.kind.permissions",
|
|
381
381
|
icon: "shield",
|
|
382
382
|
editor: "permissions",
|
|
383
|
-
match:
|
|
384
|
-
select:
|
|
385
|
-
assign:
|
|
383
|
+
match: _(".permissions.json"),
|
|
384
|
+
select: gt,
|
|
385
|
+
assign: ht,
|
|
386
386
|
arrayKey: (e) => e === "/permissions" ? "code" : e === "/permissionGroups" ? "name" : void 0
|
|
387
|
-
}),
|
|
387
|
+
}), vt = Re({
|
|
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: _(".seeds.json"),
|
|
394
394
|
select: (e) => {
|
|
395
|
-
const i =
|
|
396
|
-
if (!
|
|
395
|
+
const i = U(e) ? e : {};
|
|
396
|
+
if (!U(i.seeds) || i.demoSeeds !== void 0 && !U(i.demoSeeds))
|
|
397
397
|
throw new Error("seeds is not an object of rows per entity");
|
|
398
|
-
return
|
|
398
|
+
return W({ seeds: i.seeds, demoSeeds: i.demoSeeds });
|
|
399
399
|
},
|
|
400
|
-
assign: (e, i) =>
|
|
400
|
+
assign: (e, i) => W({ ...U(e) ? e : {}, seeds: i.seeds, demoSeeds: i.demoSeeds }),
|
|
401
401
|
arrayKey: () => "Id"
|
|
402
|
-
}),
|
|
402
|
+
}), bt = {
|
|
403
403
|
id: "script",
|
|
404
404
|
label: "Script",
|
|
405
405
|
labelKey: "devStudio.kind.script",
|
|
@@ -408,405 +408,962 @@ const ut = Le({
|
|
|
408
408
|
match: (e) => /(^|\/)(services|scripts|jobs|handlers)\/[^/]+\.(js|ts|cs)$/i.test(e) || /\.cs$/i.test(e),
|
|
409
409
|
decode: (e) => e[0].text,
|
|
410
410
|
encode: (e, i) => ({
|
|
411
|
-
files: [{ path: i[0].path, text:
|
|
411
|
+
files: [{ path: i[0].path, text: et(e, i[0].text) }]
|
|
412
412
|
})
|
|
413
|
-
},
|
|
414
|
-
match:
|
|
413
|
+
}, $t = Xe({
|
|
414
|
+
match: _(".scripts.json"),
|
|
415
415
|
property: "scripts",
|
|
416
416
|
phasesProperty: "scripts"
|
|
417
|
-
}),
|
|
417
|
+
}), St = Fe({
|
|
418
418
|
id: "dataSources",
|
|
419
419
|
label: "Data sources",
|
|
420
420
|
labelKey: "devStudio.kind.dataSources",
|
|
421
421
|
icon: "database",
|
|
422
422
|
editor: "dataSources",
|
|
423
|
-
match:
|
|
423
|
+
match: _(".datasources.json"),
|
|
424
424
|
property: "dataSources",
|
|
425
425
|
itemKey: "key"
|
|
426
|
-
}),
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
426
|
+
}), kt = Ee({
|
|
427
|
+
id: "integrations",
|
|
428
|
+
label: "Integrations",
|
|
429
|
+
labelKey: "devStudio.kind.integrations",
|
|
430
|
+
icon: "plug",
|
|
431
|
+
editor: "integrations",
|
|
432
|
+
match: _(".integrations.json")
|
|
433
|
+
}), Nt = Ee({
|
|
434
|
+
id: "environments",
|
|
435
|
+
label: "Environment sets",
|
|
436
|
+
labelKey: "devStudio.kind.environments",
|
|
437
|
+
icon: "globe",
|
|
438
|
+
editor: "environments",
|
|
439
|
+
match: _(".environments.json")
|
|
440
|
+
}), jt = [
|
|
441
|
+
tt,
|
|
442
|
+
st,
|
|
443
|
+
ot,
|
|
444
|
+
pt,
|
|
445
|
+
yt,
|
|
446
|
+
wt,
|
|
447
|
+
vt,
|
|
448
|
+
St,
|
|
449
|
+
$t,
|
|
450
|
+
bt,
|
|
451
|
+
kt,
|
|
452
|
+
Nt
|
|
453
|
+
], G = "Custom.", Oe = "Core", Tt = {
|
|
454
|
+
string: "string",
|
|
455
|
+
varchar: "string",
|
|
456
|
+
nvarchar: "string",
|
|
457
|
+
text: "text",
|
|
458
|
+
longtext: "text",
|
|
459
|
+
int: "int",
|
|
460
|
+
integer: "int",
|
|
461
|
+
int32: "int",
|
|
462
|
+
long: "long",
|
|
463
|
+
bigint: "long",
|
|
464
|
+
int64: "long",
|
|
465
|
+
decimal: "decimal",
|
|
466
|
+
double: "decimal",
|
|
467
|
+
float: "decimal",
|
|
468
|
+
number: "decimal",
|
|
469
|
+
currency: "currency",
|
|
470
|
+
money: "currency",
|
|
471
|
+
bool: "bool",
|
|
472
|
+
boolean: "bool",
|
|
473
|
+
datetime: "DateTime",
|
|
474
|
+
timestamp: "DateTime",
|
|
475
|
+
date: "DateOnly",
|
|
476
|
+
dateonly: "DateOnly",
|
|
477
|
+
time: "TimeOnly",
|
|
478
|
+
timeonly: "TimeOnly",
|
|
479
|
+
json: "json",
|
|
480
|
+
enum: "enum",
|
|
481
|
+
guid: "Guid",
|
|
482
|
+
uuid: "Guid"
|
|
483
|
+
}, Et = [
|
|
484
|
+
"string",
|
|
485
|
+
"text",
|
|
486
|
+
"int",
|
|
487
|
+
"long",
|
|
488
|
+
"decimal",
|
|
489
|
+
"currency",
|
|
490
|
+
"bool",
|
|
491
|
+
"DateTime",
|
|
492
|
+
"DateOnly",
|
|
493
|
+
"TimeOnly",
|
|
494
|
+
"json",
|
|
495
|
+
"enum",
|
|
496
|
+
"Guid"
|
|
497
|
+
], It = {
|
|
498
|
+
ł: "l",
|
|
499
|
+
Ł: "L",
|
|
500
|
+
ß: "ss",
|
|
501
|
+
æ: "ae",
|
|
502
|
+
Æ: "AE",
|
|
503
|
+
ø: "o",
|
|
504
|
+
Ø: "O"
|
|
505
|
+
};
|
|
506
|
+
function xt(e) {
|
|
507
|
+
return [...e.normalize("NFD")].map((i) => It[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
|
|
508
|
+
}
|
|
509
|
+
function P(e) {
|
|
510
|
+
const i = xt(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
|
|
511
|
+
return /^[0-9]/.test(i) ? `M${i}` : i;
|
|
512
|
+
}
|
|
513
|
+
const Ce = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
|
|
514
|
+
function Se(e) {
|
|
515
|
+
return [...e].map(
|
|
516
|
+
(i, t) => t > 0 && Ce(i) && !Ce(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
|
|
517
|
+
).join("");
|
|
518
|
+
}
|
|
519
|
+
function Ot(e) {
|
|
520
|
+
return (e.startsWith(G) ? e.slice(G.length) : e.split(".").pop() ?? e).toLowerCase().replace(/[^a-z0-9_-]+/g, "") || "module";
|
|
521
|
+
}
|
|
522
|
+
async function _e(e) {
|
|
523
|
+
const i = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
524
|
+
return new Uint8Array(i);
|
|
525
|
+
}
|
|
526
|
+
const Ie = (e) => Array.from(e, (i) => i.toString(16).padStart(2, "0")).join("");
|
|
527
|
+
async function fe(e, i) {
|
|
528
|
+
const t = (await _e(`${e}/${i}`.toLowerCase())).slice(0, 16), o = Ie([3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15].map((n) => t[n]));
|
|
529
|
+
return `${o.slice(0, 8)}-${o.slice(8, 12)}-${o.slice(12, 16)}-${o.slice(16, 20)}-${o.slice(20)}`;
|
|
530
|
+
}
|
|
531
|
+
async function Be(e, i) {
|
|
532
|
+
const t = `custom_${e}_${Se(i)}`;
|
|
533
|
+
return t.length <= 63 ? t : `${t.slice(0, 54)}_${Ie(await _e(t)).slice(0, 8)}`;
|
|
534
|
+
}
|
|
535
|
+
function Ct(e, i) {
|
|
536
|
+
const t = new Set([...i].map((o) => o.toLowerCase()));
|
|
537
|
+
for (let o = 1; o < 100; o++) {
|
|
538
|
+
const n = o === 1 ? e : `${e}${o}`;
|
|
539
|
+
if (!t.has(n.toLowerCase()))
|
|
540
|
+
return n;
|
|
541
|
+
}
|
|
542
|
+
return e + Ie(globalThis.crypto.getRandomValues(new Uint8Array(3)));
|
|
543
|
+
}
|
|
544
|
+
const oe = (e) => e.name.toLowerCase() === "id", q = (e) => {
|
|
545
|
+
var i;
|
|
546
|
+
return (((i = e.displayName) == null ? void 0 : i.trim()) || e.name).trim();
|
|
547
|
+
};
|
|
548
|
+
function ae(e) {
|
|
549
|
+
return e.isForeignKey ? "Guid" : Tt[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
|
|
550
|
+
}
|
|
551
|
+
function ye(e) {
|
|
552
|
+
if (e.isForeignKey)
|
|
553
|
+
return ["Reference", "lookup"];
|
|
554
|
+
switch (ae(e)) {
|
|
555
|
+
case "text":
|
|
556
|
+
case "json":
|
|
557
|
+
return ["Text", "textarea"];
|
|
558
|
+
case "int":
|
|
559
|
+
case "long":
|
|
560
|
+
case "decimal":
|
|
561
|
+
return ["Number", "number"];
|
|
562
|
+
case "currency":
|
|
563
|
+
return ["Currency", "currency"];
|
|
564
|
+
case "bool":
|
|
565
|
+
return ["Boolean", "toggle"];
|
|
566
|
+
case "DateTime":
|
|
567
|
+
return ["DateTime", "datetime"];
|
|
568
|
+
case "DateOnly":
|
|
569
|
+
return ["Date", "date"];
|
|
570
|
+
default:
|
|
571
|
+
return ["Text", "input"];
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const At = {
|
|
575
|
+
lookup: "EntitySelect",
|
|
576
|
+
textarea: "Textarea",
|
|
577
|
+
number: "number",
|
|
578
|
+
currency: "number",
|
|
579
|
+
toggle: "Toggle",
|
|
580
|
+
date: "date",
|
|
581
|
+
datetime: "datetime"
|
|
582
|
+
};
|
|
583
|
+
function Lt(e) {
|
|
584
|
+
var o;
|
|
585
|
+
const i = [];
|
|
586
|
+
(!((o = e.name) != null && o.trim()) || P(e.name).length === 0) && i.push("The module needs a name with letters or digits."), e.entities.length === 0 && i.push("The module has no entities — add at least one.");
|
|
587
|
+
const t = /* @__PURE__ */ new Set();
|
|
588
|
+
for (const n of e.entities) {
|
|
589
|
+
const s = P(n.name);
|
|
590
|
+
if (s.length === 0) {
|
|
591
|
+
i.push(`Entity "${n.name}" needs a name with letters or digits.`);
|
|
592
|
+
continue;
|
|
462
593
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
defaultInstanceName: {
|
|
487
|
-
type: "string",
|
|
488
|
-
title: t("field.defaultInstanceName", "Default instance name")
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
required: ["packageName", "version", "category"]
|
|
594
|
+
t.has(s.toLowerCase()) && i.push(`Entity ${s} appears twice.`), t.add(s.toLowerCase());
|
|
595
|
+
const a = n.fields.filter((y) => !oe(y));
|
|
596
|
+
a.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
|
|
597
|
+
const l = /* @__PURE__ */ new Set();
|
|
598
|
+
for (const y of a) {
|
|
599
|
+
const p = P(y.name);
|
|
600
|
+
p.length === 0 ? i.push(`${s}: field "${y.name}" needs a name with letters or digits.`) : l.has(p.toLowerCase()) ? i.push(`${s}: field ${p} appears twice.`) : l.add(p.toLowerCase());
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return i;
|
|
604
|
+
}
|
|
605
|
+
const Mt = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), ee = (e) => le(e, { finalNewline: !1 }), Z = (e, i) => ({
|
|
606
|
+
icon: { name: e, package: "@nice2dev/icons", style: i }
|
|
607
|
+
});
|
|
608
|
+
function Dt(e) {
|
|
609
|
+
const i = e && /^Ntd[A-Z]/.test(e), t = e && /^[A-Z]\w*Icon$/.test(e);
|
|
610
|
+
return {
|
|
611
|
+
module: {
|
|
612
|
+
icon: {
|
|
613
|
+
name: i || t ? e : "NtdGrid",
|
|
614
|
+
package: t ? "@nice2dev/icons-business" : "@nice2dev/icons",
|
|
615
|
+
style: "duotone"
|
|
492
616
|
},
|
|
493
|
-
|
|
494
|
-
uiSchema: { description: { type: "textarea" } }
|
|
617
|
+
animation: { type: "none" }
|
|
495
618
|
},
|
|
496
|
-
{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
title: t("field.modules", "Units"),
|
|
505
|
-
items: {
|
|
506
|
-
type: "object",
|
|
507
|
-
properties: {
|
|
508
|
-
name: { type: "string", title: t("field.name", "Name") },
|
|
509
|
-
displayName: { type: "string", title: t("field.displayName", "Display name") },
|
|
510
|
-
description: { type: "string", title: t("field.description", "Description") },
|
|
511
|
-
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
512
|
-
color: { type: "string", title: t("field.color", "Colour") },
|
|
513
|
-
parts: J(t("field.parts", "Files"))
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
i18n: J(t("field.i18n", "Translation files"))
|
|
518
|
-
}
|
|
519
|
-
}
|
|
619
|
+
entities: {},
|
|
620
|
+
views: { list: Z("NtdList", "outline"), form: Z("NtdEdit", "outline") },
|
|
621
|
+
permissions: {
|
|
622
|
+
read: Z("NtdEye", "outline"),
|
|
623
|
+
create: Z("NtdPlus", "outline"),
|
|
624
|
+
update: Z("NtdEdit", "outline"),
|
|
625
|
+
delete: Z("NtdTrash", "outline"),
|
|
626
|
+
admin: Z("NtdShield", "solid")
|
|
520
627
|
},
|
|
521
|
-
{
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
628
|
+
workflowStates: {}
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
async function Kt(e, i = {}) {
|
|
632
|
+
var b, g, E, C;
|
|
633
|
+
const t = Lt(e);
|
|
634
|
+
if (t.length > 0)
|
|
635
|
+
return { problems: t };
|
|
636
|
+
const o = e.name.toLowerCase().startsWith(G.toLowerCase()), n = P(
|
|
637
|
+
o ? e.name.slice(G.length) : e.name
|
|
638
|
+
), s = Ct(
|
|
639
|
+
G + n,
|
|
640
|
+
i.existingPackageNames ?? /* @__PURE__ */ new Set()
|
|
641
|
+
), a = s.slice(G.length), l = a.toLowerCase(), y = `${s}.${Oe}`, p = o ? a : e.name.trim(), u = ((b = e.description) == null ? void 0 : b.trim()) || void 0, N = e.entities.map((h) => ({ ...h, name: P(h.name) })), L = e.views !== !1, I = e.permissions !== !1, x = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], O = e.icon ?? "widgets", w = [], T = [
|
|
642
|
+
`${l}.entities.json`,
|
|
643
|
+
...L ? [`${l}.views.json`] : [],
|
|
644
|
+
...I ? [`${l}.permissions.json`] : []
|
|
645
|
+
];
|
|
646
|
+
w.push({
|
|
647
|
+
path: `${l}.manifest.json`,
|
|
648
|
+
text: ee({
|
|
649
|
+
packageName: s,
|
|
650
|
+
version: "1.0.0",
|
|
651
|
+
displayName: p,
|
|
652
|
+
description: u ?? p,
|
|
653
|
+
author: "OmniVerk Module Builder",
|
|
654
|
+
license: "Proprietary",
|
|
655
|
+
category: ((g = e.category) == null ? void 0 : g.trim()) || "Custom",
|
|
656
|
+
icon: O,
|
|
657
|
+
exportedAt: Mt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
|
|
658
|
+
modules: [
|
|
659
|
+
{
|
|
660
|
+
name: Oe,
|
|
661
|
+
displayName: p,
|
|
662
|
+
description: e.description ?? p,
|
|
663
|
+
icon: O,
|
|
664
|
+
parts: T
|
|
556
665
|
}
|
|
557
|
-
|
|
558
|
-
|
|
666
|
+
],
|
|
667
|
+
dependencies: ["Core.Users"],
|
|
668
|
+
i18n: x.map((h) => `${l}.${h}.i18n.json`),
|
|
669
|
+
...e.ownerTenantId ? { ownerTenantId: e.ownerTenantId } : {},
|
|
670
|
+
...e.sourceDefinitionId ? { sourceDefinitionId: e.sourceDefinitionId } : {}
|
|
671
|
+
})
|
|
672
|
+
});
|
|
673
|
+
const m = [];
|
|
674
|
+
for (const h of N) {
|
|
675
|
+
const S = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
|
|
676
|
+
for (const d of h.fields.filter((j) => !oe(j))) {
|
|
677
|
+
const j = ae(d), r = {
|
|
678
|
+
name: P(d.name),
|
|
679
|
+
displayName: q(d),
|
|
680
|
+
dataType: j
|
|
681
|
+
};
|
|
682
|
+
j === "string" && (r.maxLength = d.maxLength && d.maxLength > 0 ? d.maxLength : 200), d.isRequired && (r.isRequired = !0), d.isUnique && (r.isUnique = !0), (d.isIndexed || d.isForeignKey) && (r.isIndexed = !0), d.isForeignKey && (r.isForeignKey = !0, d.referencedEntity && (r.referencedEntity = P(d.referencedEntity))), (E = d.defaultValue) != null && E.trim() && (r.defaultValue = d.defaultValue), (C = d.description) != null && C.trim() && (r.description = d.description), S.push(r);
|
|
683
|
+
}
|
|
684
|
+
m.push({
|
|
685
|
+
id: await fe(s, h.name),
|
|
686
|
+
name: h.name,
|
|
687
|
+
displayName: q(h),
|
|
688
|
+
tableName: await Be(l, h.name),
|
|
689
|
+
description: h.description ?? q(h),
|
|
690
|
+
entityIcon: h.icon ?? "table_rows",
|
|
691
|
+
isAudited: !0,
|
|
692
|
+
isSoftDeleteEnabled: !1,
|
|
693
|
+
fields: S
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
if (w.push({
|
|
697
|
+
path: `${l}.entities.json`,
|
|
698
|
+
text: ee({ moduleName: y, version: "1.0.0", entities: m })
|
|
699
|
+
}), L) {
|
|
700
|
+
const h = (d) => {
|
|
701
|
+
const j = N.find((c) => c.name === P(d)), r = j == null ? void 0 : j.fields.find(
|
|
702
|
+
(c) => !oe(c) && !c.isForeignKey && ae(c) === "string"
|
|
703
|
+
);
|
|
704
|
+
return r ? P(r.name) : "Name";
|
|
705
|
+
}, S = [];
|
|
706
|
+
for (const d of N) {
|
|
707
|
+
const j = d.fields.filter((f) => !oe(f)), r = j.filter((f) => !["text", "json"].includes(ae(f))).slice(0, 6), c = (r.length ? r : [j[0]]).map((f) => ({
|
|
708
|
+
field: P(f.name),
|
|
709
|
+
displayName: q(f),
|
|
710
|
+
sortable: !0,
|
|
711
|
+
type: ye(f)[0],
|
|
712
|
+
...f.isForeignKey && f.referencedEntity ? { referencedEntity: P(f.referencedEntity) } : {}
|
|
713
|
+
})), v = j.filter((f) => ["string", "text"].includes(ae(f))).map((f) => P(f.name)), $ = j.map((f) => ({
|
|
714
|
+
field: P(f.name),
|
|
715
|
+
type: At[ye(f)[1]] ?? "TextInput",
|
|
716
|
+
label: q(f),
|
|
717
|
+
...f.isRequired ? { required: !0 } : {},
|
|
718
|
+
...f.isForeignKey && f.referencedEntity ? {
|
|
719
|
+
entity: P(f.referencedEntity),
|
|
720
|
+
displayField: h(f.referencedEntity)
|
|
721
|
+
} : {}
|
|
722
|
+
}));
|
|
723
|
+
S.push({
|
|
724
|
+
id: `vw-${l}-${Se(d.name)}-list`,
|
|
725
|
+
name: `${d.name}List`,
|
|
726
|
+
displayName: q(d),
|
|
727
|
+
type: "List",
|
|
728
|
+
icon: "list",
|
|
729
|
+
entityName: d.name,
|
|
730
|
+
columns: c,
|
|
731
|
+
searchFields: v,
|
|
732
|
+
pageSize: 25,
|
|
733
|
+
createControls: $,
|
|
734
|
+
allowEdit: !0,
|
|
735
|
+
allowDelete: !0
|
|
736
|
+
});
|
|
737
|
+
const A = j.map((f) => {
|
|
738
|
+
const k = ye(f)[1];
|
|
739
|
+
return {
|
|
740
|
+
field: P(f.name),
|
|
741
|
+
type: k,
|
|
742
|
+
label: q(f),
|
|
743
|
+
colSpan: k === "textarea" ? 12 : 6,
|
|
744
|
+
...f.isRequired ? { required: !0 } : {},
|
|
745
|
+
...f.isForeignKey && f.referencedEntity ? { entity: P(f.referencedEntity) } : {}
|
|
746
|
+
};
|
|
747
|
+
});
|
|
748
|
+
S.push({
|
|
749
|
+
id: `vw-${l}-${Se(d.name)}-form`,
|
|
750
|
+
name: `${d.name}Form`,
|
|
751
|
+
displayName: q(d),
|
|
752
|
+
type: "Form",
|
|
753
|
+
icon: "edit",
|
|
754
|
+
entityName: d.name,
|
|
755
|
+
tabs: [
|
|
756
|
+
{
|
|
757
|
+
name: "Main",
|
|
758
|
+
displayName: q(d),
|
|
759
|
+
sections: [{ name: "Details", displayName: "Details", controls: A }]
|
|
760
|
+
}
|
|
761
|
+
]
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
w.push({
|
|
765
|
+
path: `${l}.views.json`,
|
|
766
|
+
text: ee({ moduleName: y, version: "1.0.0", views: S })
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
if (I) {
|
|
770
|
+
const h = (j) => `${a}.${j}`, S = (j, r) => ({
|
|
771
|
+
code: h(j),
|
|
772
|
+
name: `${p} — ${r}`,
|
|
773
|
+
description: `${r}: ${p}`
|
|
774
|
+
}), d = (j, r, ...c) => ({
|
|
775
|
+
name: `${G}${a} ${j}`,
|
|
776
|
+
description: `${p} — ${r}`,
|
|
777
|
+
permissions: c.map(h)
|
|
778
|
+
});
|
|
779
|
+
w.push({
|
|
780
|
+
path: `${l}.permissions.json`,
|
|
781
|
+
text: ee({
|
|
782
|
+
moduleName: y,
|
|
783
|
+
version: "1.0.0",
|
|
784
|
+
permissions: [
|
|
785
|
+
S("Read", "view records"),
|
|
786
|
+
S("Create", "add records"),
|
|
787
|
+
S("Edit", "edit records"),
|
|
788
|
+
S("Delete", "delete records"),
|
|
789
|
+
S("Admin", "administer the module")
|
|
790
|
+
],
|
|
791
|
+
permissionGroups: [
|
|
792
|
+
d("Viewer", "read only", "Read"),
|
|
793
|
+
d("Editor", "read and edit", "Read", "Create", "Edit"),
|
|
794
|
+
d("Admin", "full access", "Read", "Create", "Edit", "Delete", "Admin")
|
|
795
|
+
]
|
|
796
|
+
})
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
for (const h of x) {
|
|
800
|
+
const S = {
|
|
801
|
+
"module.displayName": p,
|
|
802
|
+
"module.description": u ?? p
|
|
803
|
+
};
|
|
804
|
+
for (const d of N) {
|
|
805
|
+
S[`entity.${d.name}.displayName`] = q(d);
|
|
806
|
+
for (const j of d.fields.filter((r) => !oe(r)))
|
|
807
|
+
S[`field.${d.name}.${P(j.name)}.displayName`] = q(j);
|
|
808
|
+
L && (S[`view.${d.name}List.displayName`] = q(d), S[`view.${d.name}Form.displayName`] = q(d), S[`view.${d.name}Form.tab.Main`] = q(d), S[`view.${d.name}Form.section.Details`] = h === "pl" ? "Szczegóły" : "Details");
|
|
809
|
+
}
|
|
810
|
+
w.push({
|
|
811
|
+
path: `${l}.${h}.i18n.json`,
|
|
812
|
+
text: ee({ moduleName: s, locale: h, version: "1.0.0", translations: S })
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
return e.iconConfig !== !1 && w.push({ path: `${l}.iconconfig.json`, text: ee(Dt(e.icon)) }), { package: { packageName: s, folder: `Custom/${a}`, files: w }, problems: [] };
|
|
816
|
+
}
|
|
817
|
+
function Ft(e) {
|
|
818
|
+
const i = (t) => typeof t == "string" && t ? t : void 0;
|
|
819
|
+
return {
|
|
820
|
+
name: e.name,
|
|
821
|
+
description: e.description,
|
|
822
|
+
category: e.packageId,
|
|
823
|
+
icon: e.icon,
|
|
824
|
+
locales: e.locales,
|
|
825
|
+
views: e.views,
|
|
826
|
+
permissions: e.permissions,
|
|
827
|
+
entities: e.entities.map((t) => ({
|
|
828
|
+
name: String(t.name ?? ""),
|
|
829
|
+
displayName: i(t.displayName),
|
|
830
|
+
description: i(t.description),
|
|
831
|
+
icon: i(t.entityIcon) ?? i(t.icon),
|
|
832
|
+
fields: (Array.isArray(t.fields) ? t.fields : []).map((o) => ({
|
|
833
|
+
name: String(o.name ?? ""),
|
|
834
|
+
displayName: i(o.displayName),
|
|
835
|
+
dataType: i(o.dataType) ?? i(o.type),
|
|
836
|
+
isRequired: o.isRequired === !0 || o.required === !0,
|
|
837
|
+
maxLength: typeof o.maxLength == "number" ? o.maxLength : void 0,
|
|
838
|
+
isUnique: o.isUnique === !0,
|
|
839
|
+
isIndexed: o.isIndexed === !0,
|
|
840
|
+
isForeignKey: o.isForeignKey === !0,
|
|
841
|
+
referencedEntity: i(o.referencedEntity),
|
|
842
|
+
defaultValue: o.defaultValue === void 0 || o.defaultValue === null ? void 0 : String(o.defaultValue),
|
|
843
|
+
description: i(o.description)
|
|
844
|
+
}))
|
|
845
|
+
}))
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
const Y = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
849
|
+
function ke(e, i) {
|
|
850
|
+
return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) => ke(t, i)) : Y(e) ? Object.fromEntries(Object.entries(e).map(([t, o]) => [t, ke(o, i)])) : e;
|
|
851
|
+
}
|
|
852
|
+
const Pt = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
853
|
+
async function Rt(e, i) {
|
|
854
|
+
const t = e.find(
|
|
855
|
+
(w) => !w.path.includes("/") && w.path.toLowerCase().endsWith(".manifest.json")
|
|
856
|
+
);
|
|
857
|
+
if (!t)
|
|
858
|
+
throw new Error("The module has no manifest.");
|
|
859
|
+
const o = z(t.text).value, n = String(o.packageName ?? ""), s = t.path.slice(0, -14), a = i.id, l = Ot(a), y = (w) => w.startsWith(G) ? w.slice(G.length) : w.split(".").pop() ?? w, p = y(n), u = y(a), N = (w) => w.startsWith(`${s}.`) ? `${l}${w.slice(s.length)}` : w, L = new Map(e.map((w) => [w.path, N(w.path)])), I = /* @__PURE__ */ new Map();
|
|
860
|
+
for (const w of e.filter((T) => T.path.toLowerCase().endsWith(".permissions.json")))
|
|
861
|
+
try {
|
|
862
|
+
const T = z(w.text).value;
|
|
863
|
+
for (const m of Y(T) && Array.isArray(T.permissions) ? T.permissions : []) {
|
|
864
|
+
const b = typeof m.code == "string" ? m.code : "";
|
|
865
|
+
b.startsWith(`${p}.`) && I.set(b, `${u}${b.slice(p.length)}`);
|
|
866
|
+
}
|
|
867
|
+
} catch {
|
|
868
|
+
}
|
|
869
|
+
const x = (w) => n && (w === n || w.startsWith(`${n}.`) || w.startsWith(`${n} `)) ? a + w.slice(n.length) : I.get(w) ?? L.get(w) ?? w, O = [];
|
|
870
|
+
for (const w of e) {
|
|
871
|
+
if (w.path.startsWith(".revisions/"))
|
|
872
|
+
continue;
|
|
873
|
+
const T = N(w.path);
|
|
874
|
+
if (!w.path.toLowerCase().endsWith(".json")) {
|
|
875
|
+
O.push({ path: T, text: w.text });
|
|
876
|
+
continue;
|
|
877
|
+
}
|
|
878
|
+
let m;
|
|
879
|
+
try {
|
|
880
|
+
m = z(w.text).value;
|
|
881
|
+
} catch {
|
|
882
|
+
O.push({ path: T, text: w.text });
|
|
883
|
+
continue;
|
|
884
|
+
}
|
|
885
|
+
let b = ke(m, x);
|
|
886
|
+
if (w === t && Y(b)) {
|
|
887
|
+
const { sourceDefinitionId: g, ...E } = b;
|
|
888
|
+
b = {
|
|
889
|
+
...E,
|
|
890
|
+
packageName: a,
|
|
891
|
+
...i.name ? { displayName: i.name } : {},
|
|
892
|
+
...i.packageId ? { category: i.packageId } : {}
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
if (w.path.toLowerCase().endsWith(".entities.json") && Y(b) && Array.isArray(b.entities)) {
|
|
896
|
+
const g = [];
|
|
897
|
+
for (const E of b.entities) {
|
|
898
|
+
if (!Y(E) || typeof E.name != "string") {
|
|
899
|
+
g.push(E);
|
|
900
|
+
continue;
|
|
901
|
+
}
|
|
902
|
+
g.push({
|
|
903
|
+
...E,
|
|
904
|
+
...typeof E.id == "string" && Pt.test(E.id) ? { id: await fe(a, E.name) } : {},
|
|
905
|
+
...typeof E.tableName == "string" ? { tableName: await Be(l, E.name) } : {}
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
b = { ...b, entities: g };
|
|
909
|
+
}
|
|
910
|
+
i.name && /\.en\.i18n\.json$/i.test(w.path) && Y(b) && Y(b.translations) && typeof b.translations["module.displayName"] == "string" && (b = {
|
|
911
|
+
...b,
|
|
912
|
+
translations: { ...b.translations, "module.displayName": i.name }
|
|
913
|
+
}), O.push({ path: T, text: qe(w.text, b) });
|
|
914
|
+
}
|
|
915
|
+
return {
|
|
916
|
+
id: a,
|
|
917
|
+
packageId: i.packageId ?? o.category,
|
|
918
|
+
files: O
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
const ce = (e) => !!e && typeof e == "object" && !Array.isArray(e), B = (e) => Array.isArray(e) ? e.filter(ce) : [], V = (e) => typeof e == "string" && e ? e : void 0;
|
|
922
|
+
function Vt(e) {
|
|
923
|
+
const i = /* @__PURE__ */ new Map();
|
|
924
|
+
for (const o of B(e.integrations))
|
|
925
|
+
for (const n of B(o.providers))
|
|
926
|
+
for (const s of B(n.fields)) {
|
|
927
|
+
const a = V(s.key);
|
|
928
|
+
!a || i.has(a) || i.set(a, {
|
|
929
|
+
key: a,
|
|
930
|
+
description: V(s.label) ?? V(s.description),
|
|
931
|
+
secret: s.isSensitive === !0 || s.fieldType === "password" || void 0,
|
|
932
|
+
required: s.isRequired === !0 || void 0,
|
|
933
|
+
defaultValue: s.isSensitive === !0 ? void 0 : V(s.defaultValue)
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
const t = ce(e.deployment) ? e.deployment : {};
|
|
937
|
+
for (const o of B(t.envVars)) {
|
|
938
|
+
const n = V(o.key);
|
|
939
|
+
!n || i.has(n) || i.set(n, { key: n, description: V(o.description), defaultValue: V(o.defaultValue) });
|
|
940
|
+
}
|
|
941
|
+
return [...i.values()];
|
|
942
|
+
}
|
|
943
|
+
function vi(e, i) {
|
|
944
|
+
const t = ce(e.deployment) ? e.deployment : {}, o = new Map(B(t.envVars).map((s) => [V(s.key) ?? "", s])), n = i.filter((s) => !s.secret && s.key).map((s) => {
|
|
945
|
+
const a = { ...o.get(s.key) ?? {}, key: s.key };
|
|
946
|
+
return s.defaultValue !== void 0 ? a.defaultValue = s.defaultValue : delete a.defaultValue, s.description && (a.description = s.description), a;
|
|
947
|
+
});
|
|
948
|
+
return { ...e, deployment: { ...t, envVars: n } };
|
|
949
|
+
}
|
|
950
|
+
const qt = {
|
|
951
|
+
Anonymous: "none",
|
|
952
|
+
User: "session",
|
|
953
|
+
Admin: "session"
|
|
954
|
+
};
|
|
955
|
+
function Ut(e, i) {
|
|
956
|
+
const t = e.replace(/\/+$/, ""), o = i.replace(/^\/+/, "");
|
|
957
|
+
return o ? `${t}/${o}` : t || "/";
|
|
958
|
+
}
|
|
959
|
+
function Wt(e) {
|
|
960
|
+
const i = ce(e.scripting) ? e.scripting : {}, t = [];
|
|
961
|
+
for (const o of B(i.controllers)) {
|
|
962
|
+
const n = V(o.route) ?? "";
|
|
963
|
+
for (const s of B(o.actions)) {
|
|
964
|
+
const a = (V(s.verb) ?? "GET").toUpperCase(), l = Ut(n, V(s.path) ?? ""), y = V(s.auth) ?? V(o.auth);
|
|
965
|
+
t.push({
|
|
966
|
+
key: `${a} ${l}`,
|
|
967
|
+
method: a,
|
|
968
|
+
path: l,
|
|
969
|
+
handler: V(s.handler),
|
|
970
|
+
auth: y ? qt[y] ?? "session" : void 0
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return t;
|
|
975
|
+
}
|
|
976
|
+
function Gt(e, i) {
|
|
977
|
+
const t = Wt(e), o = i.flatMap((l) => l.expose ?? []), n = (l) => `${l.method.toUpperCase()} ${l.path.replace(/\/+$/, "")}`, s = new Set(t.map(n)), a = new Set(o.map(n));
|
|
978
|
+
return {
|
|
979
|
+
missingInControllers: o.filter((l) => !s.has(n(l))),
|
|
980
|
+
notExposed: t.filter((l) => !a.has(n(l)))
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
function bi(e, i) {
|
|
984
|
+
const t = ce(e.scripting) ? e.scripting : {}, o = B(t.controllers).map((s) => ({
|
|
985
|
+
...s,
|
|
986
|
+
actions: [...B(s.actions)]
|
|
987
|
+
})), { missingInControllers: n } = Gt(e, i);
|
|
988
|
+
for (const s of n) {
|
|
989
|
+
const a = s.path.replace(/^\/+/, "").split("/"), l = `/${a[0] ?? ""}`;
|
|
990
|
+
let y = o.find((p) => V(p.route) === l);
|
|
991
|
+
y || (y = { route: l, actions: [] }, o.push(y)), y.actions.push({
|
|
992
|
+
verb: s.method.toUpperCase(),
|
|
993
|
+
path: a.slice(1).join("/"),
|
|
994
|
+
handler: s.handler ?? "",
|
|
995
|
+
auth: s.auth === "none" || s.auth === "signature" || s.auth === "apiKey" ? "Anonymous" : "User"
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
return { ...e, scripting: { ...t, controllers: o } };
|
|
999
|
+
}
|
|
1000
|
+
function ze(e) {
|
|
1001
|
+
const i = [];
|
|
1002
|
+
for (const t of e) {
|
|
1003
|
+
const o = t;
|
|
1004
|
+
o.kind === "folder" || Array.isArray(o.items) ? i.push(...ze(o.items ?? [])) : i.push(o);
|
|
1005
|
+
}
|
|
1006
|
+
return i;
|
|
1007
|
+
}
|
|
1008
|
+
const ge = (e) => {
|
|
1009
|
+
switch (e == null ? void 0 : e.type) {
|
|
1010
|
+
case "bearer":
|
|
1011
|
+
return "Bearer";
|
|
1012
|
+
case "basic":
|
|
1013
|
+
return "Basic";
|
|
1014
|
+
case "apiKey":
|
|
1015
|
+
return "ApiKey";
|
|
1016
|
+
case "oauth2":
|
|
1017
|
+
return "OAuth2";
|
|
1018
|
+
case "digest":
|
|
1019
|
+
return "Digest";
|
|
1020
|
+
case "awsSigV4":
|
|
1021
|
+
return "AwsSigV4";
|
|
1022
|
+
case "hmac":
|
|
1023
|
+
return "Hmac";
|
|
1024
|
+
case void 0:
|
|
1025
|
+
case "none":
|
|
1026
|
+
return "None";
|
|
1027
|
+
default:
|
|
1028
|
+
return "Custom";
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
function Jt(e, i) {
|
|
1032
|
+
let t = (e ?? "").split("?")[0];
|
|
1033
|
+
return i && t.startsWith(i) && (t = t.slice(i.length)), t = t.replace(/^\{\{[^}]+\}\}/, "").replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, ""), t.startsWith("/") ? t : `/${t}`;
|
|
1034
|
+
}
|
|
1035
|
+
async function $i(e) {
|
|
1036
|
+
var t, o, n, s, a, l, y, p, u, N, L, I, x, O;
|
|
1037
|
+
const i = {
|
|
1038
|
+
RESTConnection: [],
|
|
1039
|
+
RESTEndpointDefinition: [],
|
|
1040
|
+
SOAPConnection: [],
|
|
1041
|
+
SOAPSavedCall: [],
|
|
1042
|
+
GraphQLEndpoint: [],
|
|
1043
|
+
GraphQLSavedQuery: []
|
|
1044
|
+
};
|
|
1045
|
+
for (const w of e) {
|
|
1046
|
+
const T = w.connection, m = await fe("integration", w.key), b = (h, S) => fe("integration", `${w.key}/${h.id ?? S}`), g = ze(w.endpoints.items), E = (h) => {
|
|
1047
|
+
var S;
|
|
1048
|
+
return (S = w.operations) == null ? void 0 : S.find((d) => d.endpoint && d.endpoint === h);
|
|
1049
|
+
}, C = (h) => h != null && h.startsWith("schedule:") ? h.slice(9) : void 0;
|
|
1050
|
+
if (T.protocol === "soap") {
|
|
1051
|
+
i.SOAPConnection.push({
|
|
1052
|
+
Id: m,
|
|
1053
|
+
Name: w.name,
|
|
1054
|
+
WsdlUrl: T.baseUrl,
|
|
1055
|
+
EndpointUrl: T.baseUrl,
|
|
1056
|
+
SoapVersion: ((o = (t = g.find((h) => {
|
|
1057
|
+
var S;
|
|
1058
|
+
return (S = h.body) == null ? void 0 : S.version;
|
|
1059
|
+
})) == null ? void 0 : t.body) == null ? void 0 : o.version) ?? "1.1",
|
|
1060
|
+
AuthType: ge(T.auth),
|
|
1061
|
+
AuthConfigJson: T.auth ? JSON.stringify(T.auth) : void 0,
|
|
1062
|
+
TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
|
|
1063
|
+
IsActive: !0
|
|
1064
|
+
});
|
|
1065
|
+
for (const [h, S] of g.entries()) {
|
|
1066
|
+
const d = E(S.id);
|
|
1067
|
+
i.SOAPSavedCall.push({
|
|
1068
|
+
Id: await b(S, h),
|
|
1069
|
+
ConnectionId: m,
|
|
1070
|
+
Name: S.name ?? `Call ${h + 1}`,
|
|
1071
|
+
Description: S.description,
|
|
1072
|
+
ServiceName: w.name,
|
|
1073
|
+
OperationName: S.name ?? `Call${h + 1}`,
|
|
1074
|
+
SoapAction: (n = S.body) == null ? void 0 : n.action,
|
|
1075
|
+
InputTemplateXml: (s = S.body) == null ? void 0 : s.envelope,
|
|
1076
|
+
LocalEntityName: d == null ? void 0 : d.target,
|
|
1077
|
+
FieldMappingsJson: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
|
|
1078
|
+
SyncCronExpression: C(d == null ? void 0 : d.trigger),
|
|
1079
|
+
SyncEnabled: !!C(d == null ? void 0 : d.trigger),
|
|
1080
|
+
SortOrder: h,
|
|
1081
|
+
IsActive: !0
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
continue;
|
|
1085
|
+
}
|
|
1086
|
+
if (T.protocol === "graphql") {
|
|
1087
|
+
i.GraphQLEndpoint.push({
|
|
1088
|
+
Id: m,
|
|
1089
|
+
Name: w.name,
|
|
1090
|
+
EndpointUrl: T.baseUrl,
|
|
1091
|
+
AuthType: ge(T.auth),
|
|
1092
|
+
CustomHeaders: (a = T.headers) != null && a.length ? JSON.stringify(Object.fromEntries(T.headers.map((h) => [h.key, h.value]))) : void 0,
|
|
1093
|
+
TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
|
|
1094
|
+
IsEnabled: !0
|
|
1095
|
+
});
|
|
1096
|
+
for (const [h, S] of g.entries()) {
|
|
1097
|
+
const d = E(S.id), j = ((l = S.body) == null ? void 0 : l.query) ?? "";
|
|
1098
|
+
i.GraphQLSavedQuery.push({
|
|
1099
|
+
Id: await b(S, h),
|
|
1100
|
+
GraphQLEndpointId: m,
|
|
1101
|
+
Name: S.name ?? `Query ${h + 1}`,
|
|
1102
|
+
OperationType: /^\s*mutation/.test(j) ? "mutation" : /^\s*subscription/.test(j) ? "subscription" : "query",
|
|
1103
|
+
QueryText: j,
|
|
1104
|
+
DefaultVariables: (y = S.body) == null ? void 0 : y.variables,
|
|
1105
|
+
LocalEntityName: d == null ? void 0 : d.target,
|
|
1106
|
+
FieldMappings: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
|
|
1107
|
+
IsScheduled: !!C(d == null ? void 0 : d.trigger),
|
|
1108
|
+
CronExpression: C(d == null ? void 0 : d.trigger)
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
continue;
|
|
1112
|
+
}
|
|
1113
|
+
if (!(T.protocol !== "rest" && T.protocol !== "odata" && T.protocol !== "webhook")) {
|
|
1114
|
+
i.RESTConnection.push({
|
|
1115
|
+
Id: m,
|
|
1116
|
+
Name: w.name,
|
|
1117
|
+
BaseUrl: T.baseUrl,
|
|
1118
|
+
AuthType: ge(T.auth),
|
|
1119
|
+
AuthConfigJson: T.auth ? JSON.stringify(T.auth) : void 0,
|
|
1120
|
+
DefaultHeadersJson: (p = T.headers) != null && p.length ? JSON.stringify(Object.fromEntries(T.headers.map((h) => [h.key, h.value]))) : void 0,
|
|
1121
|
+
PaginationType: ((u = T.pagination) == null ? void 0 : u.style) ?? "None",
|
|
1122
|
+
PaginationConfigJson: T.pagination ? JSON.stringify(T.pagination) : void 0,
|
|
1123
|
+
RateLimitMaxRequests: T.rateLimit,
|
|
1124
|
+
RateLimitWindowSeconds: T.rateLimit ? 1 : void 0,
|
|
1125
|
+
TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
|
|
1126
|
+
RetryCount: (N = T.retry) == null ? void 0 : N.attempts,
|
|
1127
|
+
RetryBackoffMs: (L = T.retry) == null ? void 0 : L.delayMs,
|
|
1128
|
+
WebhookPath: (x = (I = w.expose) == null ? void 0 : I.find((h) => h.auth === "signature")) == null ? void 0 : x.path,
|
|
1129
|
+
IsActive: !0
|
|
1130
|
+
});
|
|
1131
|
+
for (const [h, S] of g.entries()) {
|
|
1132
|
+
const d = E(S.id), j = (S.params ?? []).filter((c) => c.in === "query" && c.enabled !== !1), r = (S.params ?? []).filter((c) => c.in === "header" && c.enabled !== !1);
|
|
1133
|
+
i.RESTEndpointDefinition.push({
|
|
1134
|
+
Id: await b(S, h),
|
|
1135
|
+
ConnectionId: m,
|
|
1136
|
+
Name: S.name ?? `Endpoint ${h + 1}`,
|
|
1137
|
+
Description: S.description,
|
|
1138
|
+
HttpMethod: (S.method ?? "GET").toUpperCase(),
|
|
1139
|
+
PathTemplate: Jt(S.url, T.baseUrl),
|
|
1140
|
+
QueryParamsJson: j.length ? JSON.stringify(Object.fromEntries(j.map((c) => [c.key, c.value]))) : void 0,
|
|
1141
|
+
HeadersJson: r.length ? JSON.stringify(Object.fromEntries(r.map((c) => [c.key, c.value]))) : void 0,
|
|
1142
|
+
BodyTemplate: (O = S.body) == null ? void 0 : O.text,
|
|
1143
|
+
LocalEntityName: d == null ? void 0 : d.target,
|
|
1144
|
+
FieldMappingsJson: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
|
|
1145
|
+
SyncDirection: d ? "Inbound" : void 0,
|
|
1146
|
+
SyncCronExpression: C(d == null ? void 0 : d.trigger),
|
|
1147
|
+
SyncEnabled: !!C(d == null ? void 0 : d.trigger),
|
|
1148
|
+
ConflictResolution: d == null ? void 0 : d.conflict,
|
|
1149
|
+
SortOrder: h,
|
|
1150
|
+
IsActive: !0
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
for (const w of Object.values(i))
|
|
1156
|
+
w.forEach((T, m) => {
|
|
1157
|
+
w[m] = Object.fromEntries(Object.entries(T).filter(([, b]) => b !== void 0));
|
|
1158
|
+
});
|
|
1159
|
+
return i;
|
|
1160
|
+
}
|
|
1161
|
+
const _t = (e, i) => i, Q = (e) => ({
|
|
1162
|
+
type: "array",
|
|
1163
|
+
title: e,
|
|
1164
|
+
items: { type: "string" }
|
|
1165
|
+
});
|
|
1166
|
+
function Bt(e = _t, i = {}) {
|
|
1167
|
+
const t = (s, a) => e(`devStudio.omniverk.${s}`, a), o = {
|
|
1168
|
+
type: "object",
|
|
1169
|
+
properties: {
|
|
1170
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1171
|
+
label: { type: "string", title: t("field.label", "Label") },
|
|
1172
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1173
|
+
fieldType: {
|
|
1174
|
+
type: "string",
|
|
1175
|
+
title: t("field.fieldType", "Field type"),
|
|
1176
|
+
enum: ["text", "select", "toggle", "number", "password"]
|
|
1177
|
+
},
|
|
1178
|
+
defaultValue: { type: "string", title: t("field.defaultValue", "Default value") },
|
|
1179
|
+
isRequired: { type: "boolean", title: t("field.isRequired", "Required") },
|
|
1180
|
+
isSensitive: { type: "boolean", title: t("field.isSensitive", "Sensitive") },
|
|
1181
|
+
group: { type: "string", title: t("field.group", "Group") },
|
|
1182
|
+
validationPattern: {
|
|
1183
|
+
type: "string",
|
|
1184
|
+
title: t("field.validationPattern", "Validation pattern")
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}, n = [
|
|
559
1188
|
{
|
|
560
|
-
id: "
|
|
561
|
-
title: t("section.
|
|
1189
|
+
id: "general",
|
|
1190
|
+
title: t("section.general", "General"),
|
|
562
1191
|
schema: {
|
|
563
1192
|
type: "object",
|
|
564
1193
|
properties: {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
},
|
|
581
|
-
installOptions: {
|
|
582
|
-
type: "array",
|
|
583
|
-
title: t("field.installOptions", "Install options"),
|
|
584
|
-
items: {
|
|
585
|
-
type: "object",
|
|
586
|
-
properties: {
|
|
587
|
-
key: { type: "string", title: t("field.key", "Key") },
|
|
588
|
-
label: { type: "string", title: t("field.label", "Label") },
|
|
589
|
-
description: { type: "string", title: t("field.description", "Description") },
|
|
590
|
-
optionType: {
|
|
591
|
-
type: "string",
|
|
592
|
-
title: t("field.optionType", "Option type"),
|
|
593
|
-
enum: ["toggle", "select"]
|
|
594
|
-
},
|
|
595
|
-
defaultValue: { type: "string", title: t("field.defaultValue", "Default value") },
|
|
596
|
-
isRequired: { type: "boolean", title: t("field.isRequired", "Required") }
|
|
597
|
-
}
|
|
598
|
-
}
|
|
1194
|
+
packageName: { type: "string", title: t("field.packageName", "Package name") },
|
|
1195
|
+
version: { type: "string", title: t("field.version", "Version") },
|
|
1196
|
+
displayName: { type: "string", title: t("field.displayName", "Display name") },
|
|
1197
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1198
|
+
category: { type: "string", title: t("field.category", "Category") },
|
|
1199
|
+
subCategory: { type: "string", title: t("field.subCategory", "Sub-category") },
|
|
1200
|
+
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
1201
|
+
author: { type: "string", title: t("field.author", "Author") },
|
|
1202
|
+
license: { type: "string", title: t("field.license", "License") },
|
|
1203
|
+
// seeds use free, standard, premium, pro, professional, core, enterprise, community…
|
|
1204
|
+
tier: { type: "string", title: t("field.tier", "Tier") },
|
|
1205
|
+
isCore: { type: "boolean", title: t("field.isCore", "Core module") },
|
|
1206
|
+
allowMultipleInstances: {
|
|
1207
|
+
type: "boolean",
|
|
1208
|
+
title: t("field.allowMultipleInstances", "Allow several instances")
|
|
599
1209
|
},
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
1210
|
+
defaultInstanceName: {
|
|
1211
|
+
type: "string",
|
|
1212
|
+
title: t("field.defaultInstanceName", "Default instance name")
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
required: ["packageName", "version", "category"]
|
|
1216
|
+
},
|
|
1217
|
+
// a module's description runs to several sentences (1.3.14: it was a one-line field)
|
|
1218
|
+
uiSchema: { description: { type: "textarea" } }
|
|
603
1219
|
},
|
|
604
1220
|
{
|
|
605
|
-
id: "
|
|
606
|
-
title: t("section.
|
|
1221
|
+
id: "modules",
|
|
1222
|
+
title: t("section.modules", "Units"),
|
|
607
1223
|
schema: {
|
|
608
1224
|
type: "object",
|
|
609
1225
|
properties: {
|
|
610
|
-
|
|
1226
|
+
modules: {
|
|
611
1227
|
type: "array",
|
|
612
|
-
title: t("field.
|
|
1228
|
+
title: t("field.modules", "Units"),
|
|
613
1229
|
items: {
|
|
614
1230
|
type: "object",
|
|
615
1231
|
properties: {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
label: { type: "string", title: t("field.label", "Label") },
|
|
1232
|
+
name: { type: "string", title: t("field.name", "Name") },
|
|
1233
|
+
displayName: { type: "string", title: t("field.displayName", "Display name") },
|
|
619
1234
|
description: { type: "string", title: t("field.description", "Description") },
|
|
620
1235
|
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
title: t("field.selectionMode", "Selection"),
|
|
624
|
-
enum: ["multi", "single"]
|
|
625
|
-
},
|
|
626
|
-
optional: { type: "boolean", title: t("field.isOptional", "Optional") },
|
|
627
|
-
providers: {
|
|
628
|
-
type: "array",
|
|
629
|
-
title: t("field.providers", "Providers"),
|
|
630
|
-
items: {
|
|
631
|
-
type: "object",
|
|
632
|
-
properties: {
|
|
633
|
-
key: { type: "string", title: t("field.key", "Key") },
|
|
634
|
-
name: { type: "string", title: t("field.name", "Name") },
|
|
635
|
-
description: { type: "string", title: t("field.description", "Description") },
|
|
636
|
-
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
637
|
-
profile: { type: "string", title: t("field.profile", "Profile") },
|
|
638
|
-
fields: {
|
|
639
|
-
type: "array",
|
|
640
|
-
title: t("field.fields", "Fields"),
|
|
641
|
-
items: a
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
1236
|
+
color: { type: "string", title: t("field.color", "Colour") },
|
|
1237
|
+
parts: Q(t("field.parts", "Files"))
|
|
646
1238
|
}
|
|
647
1239
|
}
|
|
648
|
-
}
|
|
1240
|
+
},
|
|
1241
|
+
i18n: Q(t("field.i18n", "Translation files"))
|
|
649
1242
|
}
|
|
650
1243
|
}
|
|
651
1244
|
},
|
|
652
1245
|
{
|
|
653
|
-
id: "
|
|
654
|
-
title: t("section.
|
|
1246
|
+
id: "dependencies",
|
|
1247
|
+
title: t("section.dependencies", "Dependencies"),
|
|
655
1248
|
schema: {
|
|
656
1249
|
type: "object",
|
|
657
1250
|
properties: {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
title: t("field.dataSources", "Data sources"),
|
|
661
|
-
items: {
|
|
662
|
-
type: "object",
|
|
663
|
-
properties: {
|
|
664
|
-
key: { type: "string", title: t("field.key", "Key") },
|
|
665
|
-
entity: { type: "string", title: t("field.entity", "Entity") },
|
|
666
|
-
description: { type: "string", title: t("field.description", "Description") }
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
routes: {
|
|
671
|
-
type: "array",
|
|
672
|
-
title: t("field.routes", "Routes"),
|
|
673
|
-
items: { type: "object" }
|
|
674
|
-
},
|
|
675
|
-
eventTriggers: {
|
|
1251
|
+
dependencies: Q(t("field.dependencies", "Required packages")),
|
|
1252
|
+
dependencyRefs: {
|
|
676
1253
|
type: "array",
|
|
677
|
-
title: t("field.
|
|
1254
|
+
title: t("field.dependencyRefs", "Dependency details"),
|
|
678
1255
|
items: {
|
|
679
1256
|
type: "object",
|
|
680
1257
|
properties: {
|
|
681
|
-
|
|
682
|
-
|
|
1258
|
+
package: { type: "string", title: t("field.package", "Package") },
|
|
1259
|
+
isOptional: { type: "boolean", title: t("field.isOptional", "Optional") },
|
|
1260
|
+
minVersion: { type: "string", title: t("field.minVersion", "Minimum version") },
|
|
1261
|
+
reason: { type: "string", title: t("field.reason", "Reason") },
|
|
1262
|
+
relationKind: {
|
|
1263
|
+
type: "string",
|
|
1264
|
+
title: t("field.relationKind", "Relation"),
|
|
1265
|
+
enum: ["operational", "job", "event", "data-flow", "config"]
|
|
1266
|
+
},
|
|
1267
|
+
dataFlowDirection: {
|
|
1268
|
+
type: "string",
|
|
1269
|
+
title: t("field.dataFlowDirection", "Data flow")
|
|
1270
|
+
},
|
|
1271
|
+
instanceBinding: {
|
|
1272
|
+
type: "string",
|
|
1273
|
+
title: t("field.instanceBinding", "Instance binding")
|
|
1274
|
+
}
|
|
683
1275
|
}
|
|
684
1276
|
}
|
|
685
1277
|
},
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
title: t("field.actions", "Actions"),
|
|
689
|
-
items: {
|
|
690
|
-
type: "object",
|
|
691
|
-
properties: {
|
|
692
|
-
key: { type: "string", title: t("field.key", "Key") },
|
|
693
|
-
label: { type: "string", title: t("field.label", "Label") },
|
|
694
|
-
description: { type: "string", title: t("field.description", "Description") },
|
|
695
|
-
input: { type: "string", title: t("field.input", "Input") }
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
1278
|
+
provides: Q(t("field.provides", "Provides")),
|
|
1279
|
+
requiredControls: Q(t("field.requiredControls", "Required controls"))
|
|
699
1280
|
}
|
|
700
1281
|
}
|
|
701
1282
|
},
|
|
702
1283
|
{
|
|
703
|
-
id: "
|
|
704
|
-
title: t("section.
|
|
1284
|
+
id: "setup",
|
|
1285
|
+
title: t("section.setup", "Installation"),
|
|
705
1286
|
schema: {
|
|
706
1287
|
type: "object",
|
|
707
1288
|
properties: {
|
|
708
|
-
|
|
1289
|
+
setupWizard: {
|
|
709
1290
|
type: "array",
|
|
710
|
-
title: t("field.
|
|
1291
|
+
title: t("field.setupWizard", "Setup wizard steps"),
|
|
711
1292
|
items: {
|
|
712
1293
|
type: "object",
|
|
713
1294
|
properties: {
|
|
714
|
-
|
|
715
|
-
|
|
1295
|
+
stepId: { type: "string", title: t("field.stepId", "Step id") },
|
|
1296
|
+
name: { type: "string", title: t("field.name", "Name") },
|
|
716
1297
|
description: { type: "string", title: t("field.description", "Description") },
|
|
717
|
-
|
|
1298
|
+
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
1299
|
+
isOptional: { type: "boolean", title: t("field.isOptional", "Optional") },
|
|
1300
|
+
order: { type: "integer", title: t("field.order", "Order") },
|
|
1301
|
+
fields: { type: "array", title: t("field.fields", "Fields"), items: o }
|
|
718
1302
|
}
|
|
719
1303
|
}
|
|
720
1304
|
},
|
|
721
|
-
|
|
1305
|
+
installOptions: {
|
|
722
1306
|
type: "array",
|
|
723
|
-
title: t("field.
|
|
1307
|
+
title: t("field.installOptions", "Install options"),
|
|
724
1308
|
items: {
|
|
725
1309
|
type: "object",
|
|
726
1310
|
properties: {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
tag: { type: "string", title: t("field.tag", "Tag") },
|
|
1311
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1312
|
+
label: { type: "string", title: t("field.label", "Label") },
|
|
730
1313
|
description: { type: "string", title: t("field.description", "Description") },
|
|
731
|
-
|
|
732
|
-
volumes: J(t("field.volumes", "Volumes")),
|
|
733
|
-
command: { type: "string", title: t("field.command", "Command") },
|
|
734
|
-
healthCheckCmd: {
|
|
735
|
-
type: "string",
|
|
736
|
-
title: t("field.healthCheckCmd", "Health check")
|
|
737
|
-
},
|
|
738
|
-
restartPolicy: {
|
|
1314
|
+
optionType: {
|
|
739
1315
|
type: "string",
|
|
740
|
-
title: t("field.
|
|
1316
|
+
title: t("field.optionType", "Option type"),
|
|
1317
|
+
enum: ["toggle", "select"]
|
|
741
1318
|
},
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
title: t("field.requiresOption", "Requires option")
|
|
745
|
-
}
|
|
1319
|
+
defaultValue: { type: "string", title: t("field.defaultValue", "Default value") },
|
|
1320
|
+
isRequired: { type: "boolean", title: t("field.isRequired", "Required") }
|
|
746
1321
|
}
|
|
747
1322
|
}
|
|
748
|
-
}
|
|
1323
|
+
},
|
|
1324
|
+
onInstall: { type: "object", title: t("field.onInstall", "On install") }
|
|
749
1325
|
}
|
|
750
1326
|
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
type: "string",
|
|
756
|
-
title: t("field.auth", "Access"),
|
|
757
|
-
enum: ["Anonymous", "User", "Admin"]
|
|
758
|
-
};
|
|
759
|
-
n.push({
|
|
760
|
-
id: "scripting",
|
|
761
|
-
title: t("section.scripting", "Server code"),
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
id: "integrations",
|
|
1330
|
+
title: t("section.integrations", "Integrations"),
|
|
762
1331
|
schema: {
|
|
763
1332
|
type: "object",
|
|
764
1333
|
properties: {
|
|
765
|
-
|
|
1334
|
+
integrations: {
|
|
766
1335
|
type: "array",
|
|
767
|
-
title: t("field.
|
|
1336
|
+
title: t("field.integrations", "Integrations"),
|
|
768
1337
|
items: {
|
|
769
1338
|
type: "object",
|
|
770
|
-
required: ["name", "language", "script"],
|
|
771
1339
|
properties: {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
language: {
|
|
1340
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1341
|
+
category: { type: "string", title: t("field.category", "Category") },
|
|
1342
|
+
label: { type: "string", title: t("field.label", "Label") },
|
|
1343
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1344
|
+
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
1345
|
+
selectionMode: {
|
|
779
1346
|
type: "string",
|
|
780
|
-
title: t("field.
|
|
781
|
-
enum: ["
|
|
1347
|
+
title: t("field.selectionMode", "Selection"),
|
|
1348
|
+
enum: ["multi", "single"]
|
|
782
1349
|
},
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
},
|
|
787
|
-
controllers: {
|
|
788
|
-
type: "array",
|
|
789
|
-
title: t("field.controllers", "Controllers"),
|
|
790
|
-
items: {
|
|
791
|
-
type: "object",
|
|
792
|
-
required: ["route"],
|
|
793
|
-
properties: {
|
|
794
|
-
route: { type: "string", title: t("field.route", "Route") },
|
|
795
|
-
auth: s,
|
|
796
|
-
actions: {
|
|
1350
|
+
optional: { type: "boolean", title: t("field.isOptional", "Optional") },
|
|
1351
|
+
providers: {
|
|
797
1352
|
type: "array",
|
|
798
|
-
title: t("field.
|
|
1353
|
+
title: t("field.providers", "Providers"),
|
|
799
1354
|
items: {
|
|
800
1355
|
type: "object",
|
|
801
1356
|
properties: {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1357
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1358
|
+
name: { type: "string", title: t("field.name", "Name") },
|
|
1359
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1360
|
+
icon: { type: "string", title: t("field.icon", "Icon") },
|
|
1361
|
+
profile: { type: "string", title: t("field.profile", "Profile") },
|
|
1362
|
+
fields: {
|
|
1363
|
+
type: "array",
|
|
1364
|
+
title: t("field.fields", "Fields"),
|
|
1365
|
+
items: o
|
|
1366
|
+
}
|
|
810
1367
|
}
|
|
811
1368
|
}
|
|
812
1369
|
}
|
|
@@ -815,486 +1372,185 @@ function $t(e = vt, i = {}) {
|
|
|
815
1372
|
}
|
|
816
1373
|
}
|
|
817
1374
|
}
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
return n;
|
|
821
|
-
}
|
|
822
|
-
const W = "Custom.", Ne = "Core", bt = {
|
|
823
|
-
string: "string",
|
|
824
|
-
varchar: "string",
|
|
825
|
-
nvarchar: "string",
|
|
826
|
-
text: "text",
|
|
827
|
-
longtext: "text",
|
|
828
|
-
int: "int",
|
|
829
|
-
integer: "int",
|
|
830
|
-
int32: "int",
|
|
831
|
-
long: "long",
|
|
832
|
-
bigint: "long",
|
|
833
|
-
int64: "long",
|
|
834
|
-
decimal: "decimal",
|
|
835
|
-
double: "decimal",
|
|
836
|
-
float: "decimal",
|
|
837
|
-
number: "decimal",
|
|
838
|
-
currency: "currency",
|
|
839
|
-
money: "currency",
|
|
840
|
-
bool: "bool",
|
|
841
|
-
boolean: "bool",
|
|
842
|
-
datetime: "DateTime",
|
|
843
|
-
timestamp: "DateTime",
|
|
844
|
-
date: "DateOnly",
|
|
845
|
-
dateonly: "DateOnly",
|
|
846
|
-
time: "TimeOnly",
|
|
847
|
-
timeonly: "TimeOnly",
|
|
848
|
-
json: "json",
|
|
849
|
-
enum: "enum",
|
|
850
|
-
guid: "Guid",
|
|
851
|
-
uuid: "Guid"
|
|
852
|
-
}, kt = [
|
|
853
|
-
"string",
|
|
854
|
-
"text",
|
|
855
|
-
"int",
|
|
856
|
-
"long",
|
|
857
|
-
"decimal",
|
|
858
|
-
"currency",
|
|
859
|
-
"bool",
|
|
860
|
-
"DateTime",
|
|
861
|
-
"DateOnly",
|
|
862
|
-
"TimeOnly",
|
|
863
|
-
"json",
|
|
864
|
-
"enum",
|
|
865
|
-
"Guid"
|
|
866
|
-
], St = {
|
|
867
|
-
ł: "l",
|
|
868
|
-
Ł: "L",
|
|
869
|
-
ß: "ss",
|
|
870
|
-
æ: "ae",
|
|
871
|
-
Æ: "AE",
|
|
872
|
-
ø: "o",
|
|
873
|
-
Ø: "O"
|
|
874
|
-
};
|
|
875
|
-
function Nt(e) {
|
|
876
|
-
return [...e.normalize("NFD")].map((i) => St[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
|
|
877
|
-
}
|
|
878
|
-
function P(e) {
|
|
879
|
-
const i = Nt(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
|
|
880
|
-
return /^[0-9]/.test(i) ? `M${i}` : i;
|
|
881
|
-
}
|
|
882
|
-
const je = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
|
|
883
|
-
function he(e) {
|
|
884
|
-
return [...e].map(
|
|
885
|
-
(i, t) => t > 0 && je(i) && !je(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
|
|
886
|
-
).join("");
|
|
887
|
-
}
|
|
888
|
-
function jt(e) {
|
|
889
|
-
return (e.startsWith(W) ? e.slice(W.length) : e.split(".").pop() ?? e).toLowerCase().replace(/[^a-z0-9_-]+/g, "") || "module";
|
|
890
|
-
}
|
|
891
|
-
async function qe(e) {
|
|
892
|
-
const i = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
893
|
-
return new Uint8Array(i);
|
|
894
|
-
}
|
|
895
|
-
const ke = (e) => Array.from(e, (i) => i.toString(16).padStart(2, "0")).join("");
|
|
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) {
|
|
901
|
-
const t = `custom_${e}_${he(i)}`;
|
|
902
|
-
return t.length <= 63 ? t : `${t.slice(0, 54)}_${ke(await qe(t)).slice(0, 8)}`;
|
|
903
|
-
}
|
|
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}`;
|
|
908
|
-
if (!t.has(n.toLowerCase()))
|
|
909
|
-
return n;
|
|
910
|
-
}
|
|
911
|
-
return e + ke(globalThis.crypto.getRandomValues(new Uint8Array(3)));
|
|
912
|
-
}
|
|
913
|
-
const ne = (e) => e.name.toLowerCase() === "id", q = (e) => {
|
|
914
|
-
var i;
|
|
915
|
-
return (((i = e.displayName) == null ? void 0 : i.trim()) || e.name).trim();
|
|
916
|
-
};
|
|
917
|
-
function se(e) {
|
|
918
|
-
return e.isForeignKey ? "Guid" : bt[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
|
|
919
|
-
}
|
|
920
|
-
function pe(e) {
|
|
921
|
-
if (e.isForeignKey)
|
|
922
|
-
return ["Reference", "lookup"];
|
|
923
|
-
switch (se(e)) {
|
|
924
|
-
case "text":
|
|
925
|
-
case "json":
|
|
926
|
-
return ["Text", "textarea"];
|
|
927
|
-
case "int":
|
|
928
|
-
case "long":
|
|
929
|
-
case "decimal":
|
|
930
|
-
return ["Number", "number"];
|
|
931
|
-
case "currency":
|
|
932
|
-
return ["Currency", "currency"];
|
|
933
|
-
case "bool":
|
|
934
|
-
return ["Boolean", "toggle"];
|
|
935
|
-
case "DateTime":
|
|
936
|
-
return ["DateTime", "datetime"];
|
|
937
|
-
case "DateOnly":
|
|
938
|
-
return ["Date", "date"];
|
|
939
|
-
default:
|
|
940
|
-
return ["Text", "input"];
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
const Et = {
|
|
944
|
-
lookup: "EntitySelect",
|
|
945
|
-
textarea: "Textarea",
|
|
946
|
-
number: "number",
|
|
947
|
-
currency: "number",
|
|
948
|
-
toggle: "Toggle",
|
|
949
|
-
date: "date",
|
|
950
|
-
datetime: "datetime"
|
|
951
|
-
};
|
|
952
|
-
function xt(e) {
|
|
953
|
-
var a;
|
|
954
|
-
const i = [];
|
|
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.");
|
|
956
|
-
const t = /* @__PURE__ */ new Set();
|
|
957
|
-
for (const n of e.entities) {
|
|
958
|
-
const s = P(n.name);
|
|
959
|
-
if (s.length === 0) {
|
|
960
|
-
i.push(`Entity "${n.name}" needs a name with letters or digits.`);
|
|
961
|
-
continue;
|
|
962
|
-
}
|
|
963
|
-
t.has(s.toLowerCase()) && i.push(`Entity ${s} appears twice.`), t.add(s.toLowerCase());
|
|
964
|
-
const r = n.fields.filter((h) => !ne(h));
|
|
965
|
-
r.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
|
|
966
|
-
const l = /* @__PURE__ */ new Set();
|
|
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());
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
return i;
|
|
973
|
-
}
|
|
974
|
-
const It = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), X = (e) => ae(e, { finalNewline: !1 }), H = (e, i) => ({
|
|
975
|
-
icon: { name: e, package: "@nice2dev/icons", style: i }
|
|
976
|
-
});
|
|
977
|
-
function Ct(e) {
|
|
978
|
-
const i = e && /^Ntd[A-Z]/.test(e), t = e && /^[A-Z]\w*Icon$/.test(e);
|
|
979
|
-
return {
|
|
980
|
-
module: {
|
|
981
|
-
icon: {
|
|
982
|
-
name: i || t ? e : "NtdGrid",
|
|
983
|
-
package: t ? "@nice2dev/icons-business" : "@nice2dev/icons",
|
|
984
|
-
style: "duotone"
|
|
985
|
-
},
|
|
986
|
-
animation: { type: "none" }
|
|
987
|
-
},
|
|
988
|
-
entities: {},
|
|
989
|
-
views: { list: H("NtdList", "outline"), form: H("NtdEdit", "outline") },
|
|
990
|
-
permissions: {
|
|
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")
|
|
996
1375
|
},
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1376
|
+
{
|
|
1377
|
+
id: "runtime",
|
|
1378
|
+
title: t("section.runtime", "Runtime"),
|
|
1379
|
+
schema: {
|
|
1380
|
+
type: "object",
|
|
1381
|
+
properties: {
|
|
1382
|
+
dataSources: {
|
|
1383
|
+
type: "array",
|
|
1384
|
+
title: t("field.dataSources", "Data sources"),
|
|
1385
|
+
items: {
|
|
1386
|
+
type: "object",
|
|
1387
|
+
properties: {
|
|
1388
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1389
|
+
entity: { type: "string", title: t("field.entity", "Entity") },
|
|
1390
|
+
description: { type: "string", title: t("field.description", "Description") }
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
routes: {
|
|
1395
|
+
type: "array",
|
|
1396
|
+
title: t("field.routes", "Routes"),
|
|
1397
|
+
items: { type: "object" }
|
|
1398
|
+
},
|
|
1399
|
+
eventTriggers: {
|
|
1400
|
+
type: "array",
|
|
1401
|
+
title: t("field.eventTriggers", "Events"),
|
|
1402
|
+
items: {
|
|
1403
|
+
type: "object",
|
|
1404
|
+
properties: {
|
|
1405
|
+
event: { type: "string", title: t("field.event", "Event") },
|
|
1406
|
+
description: { type: "string", title: t("field.description", "Description") }
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
actions: {
|
|
1411
|
+
type: "array",
|
|
1412
|
+
title: t("field.actions", "Actions"),
|
|
1413
|
+
items: {
|
|
1414
|
+
type: "object",
|
|
1415
|
+
properties: {
|
|
1416
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1417
|
+
label: { type: "string", title: t("field.label", "Label") },
|
|
1418
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1419
|
+
input: { type: "string", title: t("field.input", "Input") }
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1034
1423
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
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)
|
|
1090
|
-
} : {}
|
|
1091
|
-
}));
|
|
1092
|
-
O.push({
|
|
1093
|
-
id: `vw-${l}-${he(w.name)}-list`,
|
|
1094
|
-
name: `${w.name}List`,
|
|
1095
|
-
displayName: q(w),
|
|
1096
|
-
type: "List",
|
|
1097
|
-
icon: "list",
|
|
1098
|
-
entityName: w.name,
|
|
1099
|
-
columns: c,
|
|
1100
|
-
searchFields: y,
|
|
1101
|
-
pageSize: 25,
|
|
1102
|
-
createControls: g,
|
|
1103
|
-
allowEdit: !0,
|
|
1104
|
-
allowDelete: !0
|
|
1105
|
-
});
|
|
1106
|
-
const x = E.map((m) => {
|
|
1107
|
-
const $ = pe(m)[1];
|
|
1108
|
-
return {
|
|
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) } : {}
|
|
1115
|
-
};
|
|
1116
|
-
});
|
|
1117
|
-
O.push({
|
|
1118
|
-
id: `vw-${l}-${he(w.name)}-form`,
|
|
1119
|
-
name: `${w.name}Form`,
|
|
1120
|
-
displayName: q(w),
|
|
1121
|
-
type: "Form",
|
|
1122
|
-
icon: "edit",
|
|
1123
|
-
entityName: w.name,
|
|
1124
|
-
tabs: [
|
|
1125
|
-
{
|
|
1126
|
-
name: "Main",
|
|
1127
|
-
displayName: q(w),
|
|
1128
|
-
sections: [{ name: "Details", displayName: "Details", controls: x }]
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
id: "deployment",
|
|
1428
|
+
title: t("section.deployment", "Deployment"),
|
|
1429
|
+
schema: {
|
|
1430
|
+
type: "object",
|
|
1431
|
+
properties: {
|
|
1432
|
+
envVars: {
|
|
1433
|
+
type: "array",
|
|
1434
|
+
title: t("field.envVars", "Environment variables"),
|
|
1435
|
+
items: {
|
|
1436
|
+
type: "object",
|
|
1437
|
+
properties: {
|
|
1438
|
+
key: { type: "string", title: t("field.key", "Key") },
|
|
1439
|
+
defaultValue: { type: "string", title: t("field.defaultValue", "Default value") },
|
|
1440
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1441
|
+
boundToField: { type: "string", title: t("field.boundToField", "Bound to field") }
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
dockerServices: {
|
|
1446
|
+
type: "array",
|
|
1447
|
+
title: t("field.dockerServices", "Docker services"),
|
|
1448
|
+
items: {
|
|
1449
|
+
type: "object",
|
|
1450
|
+
properties: {
|
|
1451
|
+
name: { type: "string", title: t("field.name", "Name") },
|
|
1452
|
+
image: { type: "string", title: t("field.image", "Image") },
|
|
1453
|
+
tag: { type: "string", title: t("field.tag", "Tag") },
|
|
1454
|
+
description: { type: "string", title: t("field.description", "Description") },
|
|
1455
|
+
ports: Q(t("field.ports", "Ports")),
|
|
1456
|
+
volumes: Q(t("field.volumes", "Volumes")),
|
|
1457
|
+
command: { type: "string", title: t("field.command", "Command") },
|
|
1458
|
+
healthCheckCmd: {
|
|
1459
|
+
type: "string",
|
|
1460
|
+
title: t("field.healthCheckCmd", "Health check")
|
|
1461
|
+
},
|
|
1462
|
+
restartPolicy: {
|
|
1463
|
+
type: "string",
|
|
1464
|
+
title: t("field.restartPolicy", "Restart policy")
|
|
1465
|
+
},
|
|
1466
|
+
requiresOption: {
|
|
1467
|
+
type: "string",
|
|
1468
|
+
title: t("field.requiresOption", "Requires option")
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1129
1472
|
}
|
|
1130
|
-
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
b.push({
|
|
1134
|
-
path: `${l}.views.json`,
|
|
1135
|
-
text: X({ moduleName: h, version: "1.0.0", views: O })
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
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)
|
|
1147
|
-
});
|
|
1148
|
-
b.push({
|
|
1149
|
-
path: `${l}.permissions.json`,
|
|
1150
|
-
text: X({
|
|
1151
|
-
moduleName: h,
|
|
1152
|
-
version: "1.0.0",
|
|
1153
|
-
permissions: [
|
|
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")
|
|
1159
|
-
],
|
|
1160
|
-
permissionGroups: [
|
|
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")
|
|
1164
|
-
]
|
|
1165
|
-
})
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
for (const j of T) {
|
|
1169
|
-
const O = {
|
|
1170
|
-
"module.displayName": d,
|
|
1171
|
-
"module.description": p ?? d
|
|
1172
|
-
};
|
|
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");
|
|
1178
|
-
}
|
|
1179
|
-
b.push({
|
|
1180
|
-
path: `${l}.${j}.i18n.json`,
|
|
1181
|
-
text: X({ moduleName: s, locale: j, version: "1.0.0", translations: O })
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
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: [] };
|
|
1185
|
-
}
|
|
1186
|
-
function At(e) {
|
|
1187
|
-
const i = (t) => typeof t == "string" && t ? t : void 0;
|
|
1188
|
-
return {
|
|
1189
|
-
name: e.name,
|
|
1190
|
-
description: e.description,
|
|
1191
|
-
category: e.packageId,
|
|
1192
|
-
icon: e.icon,
|
|
1193
|
-
locales: e.locales,
|
|
1194
|
-
views: e.views,
|
|
1195
|
-
permissions: e.permissions,
|
|
1196
|
-
entities: e.entities.map((t) => ({
|
|
1197
|
-
name: String(t.name ?? ""),
|
|
1198
|
-
displayName: i(t.displayName),
|
|
1199
|
-
description: i(t.description),
|
|
1200
|
-
icon: i(t.entityIcon) ?? i(t.icon),
|
|
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)
|
|
1213
|
-
}))
|
|
1214
|
-
}))
|
|
1215
|
-
};
|
|
1216
|
-
}
|
|
1217
|
-
const Z = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1218
|
-
function we(e, 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;
|
|
1220
|
-
}
|
|
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) {
|
|
1223
|
-
const t = e.find(
|
|
1224
|
-
(b) => !b.path.includes("/") && b.path.toLowerCase().endsWith(".manifest.json")
|
|
1225
|
-
);
|
|
1226
|
-
if (!t)
|
|
1227
|
-
throw new Error("The module has no manifest.");
|
|
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")))
|
|
1230
|
-
try {
|
|
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)}`);
|
|
1473
|
+
}
|
|
1235
1474
|
}
|
|
1236
|
-
} catch {
|
|
1237
1475
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1476
|
+
];
|
|
1477
|
+
if (i.scripting) {
|
|
1478
|
+
const s = {
|
|
1479
|
+
type: "string",
|
|
1480
|
+
title: t("field.auth", "Access"),
|
|
1481
|
+
enum: ["Anonymous", "User", "Admin"]
|
|
1482
|
+
};
|
|
1483
|
+
n.push({
|
|
1484
|
+
id: "scripting",
|
|
1485
|
+
title: t("section.scripting", "Server code"),
|
|
1486
|
+
schema: {
|
|
1487
|
+
type: "object",
|
|
1488
|
+
properties: {
|
|
1489
|
+
services: {
|
|
1490
|
+
type: "array",
|
|
1491
|
+
title: t("field.services", "Services"),
|
|
1492
|
+
items: {
|
|
1493
|
+
type: "object",
|
|
1494
|
+
required: ["name", "language", "script"],
|
|
1495
|
+
properties: {
|
|
1496
|
+
name: { type: "string", title: t("field.name", "Name") },
|
|
1497
|
+
scope: {
|
|
1498
|
+
type: "string",
|
|
1499
|
+
title: t("field.scope", "Lifetime"),
|
|
1500
|
+
enum: ["scoped", "singleton", "transient"]
|
|
1501
|
+
},
|
|
1502
|
+
language: {
|
|
1503
|
+
type: "string",
|
|
1504
|
+
title: t("field.language", "Language"),
|
|
1505
|
+
enum: ["js", "csharp"]
|
|
1506
|
+
},
|
|
1507
|
+
script: { type: "string", title: t("field.script", "Script") }
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
},
|
|
1511
|
+
controllers: {
|
|
1512
|
+
type: "array",
|
|
1513
|
+
title: t("field.controllers", "Controllers"),
|
|
1514
|
+
items: {
|
|
1515
|
+
type: "object",
|
|
1516
|
+
required: ["route"],
|
|
1517
|
+
properties: {
|
|
1518
|
+
route: { type: "string", title: t("field.route", "Route") },
|
|
1519
|
+
auth: s,
|
|
1520
|
+
actions: {
|
|
1521
|
+
type: "array",
|
|
1522
|
+
title: t("field.actions", "Actions"),
|
|
1523
|
+
items: {
|
|
1524
|
+
type: "object",
|
|
1525
|
+
properties: {
|
|
1526
|
+
verb: {
|
|
1527
|
+
type: "string",
|
|
1528
|
+
title: t("field.verb", "Method"),
|
|
1529
|
+
enum: ["GET", "POST", "PUT", "PATCH", "DELETE"]
|
|
1530
|
+
},
|
|
1531
|
+
path: { type: "string", title: t("field.path", "Path") },
|
|
1532
|
+
handler: { type: "string", title: t("field.handler", "Handler") },
|
|
1533
|
+
auth: s
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1270
1540
|
}
|
|
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) } : {}
|
|
1275
|
-
});
|
|
1276
1541
|
}
|
|
1277
|
-
|
|
1278
|
-
}
|
|
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) });
|
|
1542
|
+
});
|
|
1283
1543
|
}
|
|
1284
|
-
return
|
|
1285
|
-
id: r,
|
|
1286
|
-
packageId: i.packageId ?? a.category,
|
|
1287
|
-
files: I
|
|
1288
|
-
};
|
|
1544
|
+
return n;
|
|
1289
1545
|
}
|
|
1290
|
-
const
|
|
1546
|
+
const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e, i) => K(e) && Array.isArray(e[i]) ? e[i] : [], re = (e, i) => e.toLowerCase().endsWith(i), Ne = (e) => !e.includes("/"), zt = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Ht = [
|
|
1291
1547
|
"ING Bank Śląski",
|
|
1292
1548
|
"Bank Śląski",
|
|
1293
1549
|
"BOŚ",
|
|
1294
1550
|
"e-Zamówienia",
|
|
1295
1551
|
"eZamówienia",
|
|
1296
1552
|
"Plataforma de Contratación del Sector Público"
|
|
1297
|
-
],
|
|
1553
|
+
], de = (e) => zt.test(Ht.reduce((i, t) => i.split(t).join(""), e)), Zt = /* @__PURE__ */ new Set([
|
|
1298
1554
|
"module",
|
|
1299
1555
|
"entity",
|
|
1300
1556
|
"field",
|
|
@@ -1303,8 +1559,8 @@ const M = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ee = (
|
|
|
1303
1559
|
"nav",
|
|
1304
1560
|
"action",
|
|
1305
1561
|
"tutorial"
|
|
1306
|
-
]),
|
|
1307
|
-
function
|
|
1562
|
+
]), Qt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
|
|
1563
|
+
function Yt(e) {
|
|
1308
1564
|
for (let i = 0; i < e.length; i++) {
|
|
1309
1565
|
const t = e.charCodeAt(i);
|
|
1310
1566
|
if (t >= 55296 && t <= 56319 || t >= 9728 && t <= 10175)
|
|
@@ -1312,13 +1568,13 @@ function Rt(e) {
|
|
|
1312
1568
|
}
|
|
1313
1569
|
return !1;
|
|
1314
1570
|
}
|
|
1315
|
-
function
|
|
1316
|
-
if (!
|
|
1571
|
+
function Ae(e) {
|
|
1572
|
+
if (!K(e))
|
|
1317
1573
|
return [];
|
|
1318
|
-
const i =
|
|
1574
|
+
const i = K(e.translations) ? e.translations : K(e.keys) ? e.keys : void 0;
|
|
1319
1575
|
return i ? Object.entries(i) : [];
|
|
1320
1576
|
}
|
|
1321
|
-
const
|
|
1577
|
+
const Le = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Xt = /* @__PURE__ */ new Set([
|
|
1322
1578
|
"hotel.views.json",
|
|
1323
1579
|
"restaurant.views.json",
|
|
1324
1580
|
"backup-dr.views.json",
|
|
@@ -1327,395 +1583,395 @@ const Ee = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, qt = /* @__PU
|
|
|
1327
1583
|
"shelf_management.views.json",
|
|
1328
1584
|
"psa.views.json"
|
|
1329
1585
|
]);
|
|
1330
|
-
function
|
|
1331
|
-
var
|
|
1586
|
+
function ei(e, i = {}) {
|
|
1587
|
+
var T;
|
|
1332
1588
|
const t = new Set(
|
|
1333
|
-
[...i.legacyListViewFiles ??
|
|
1334
|
-
(
|
|
1589
|
+
[...i.legacyListViewFiles ?? Xt].map(
|
|
1590
|
+
(m) => m.toLowerCase()
|
|
1335
1591
|
)
|
|
1336
|
-
),
|
|
1337
|
-
|
|
1592
|
+
), o = [], n = (m) => {
|
|
1593
|
+
o.push({ severity: "error", ...m });
|
|
1338
1594
|
}, s = [];
|
|
1339
|
-
for (const
|
|
1340
|
-
if (!(!
|
|
1595
|
+
for (const m of e.files)
|
|
1596
|
+
if (!(!re(m.path, ".json") || m.path.startsWith(".revisions/")))
|
|
1341
1597
|
try {
|
|
1342
|
-
s.push({ file:
|
|
1343
|
-
} catch (
|
|
1598
|
+
s.push({ file: m, value: z(m.text).value });
|
|
1599
|
+
} catch (b) {
|
|
1344
1600
|
n({
|
|
1345
1601
|
code: "json.invalid",
|
|
1346
|
-
message: `${
|
|
1602
|
+
message: `${m.path} is not valid JSON: ${b instanceof Error ? b.message : String(b)}`,
|
|
1347
1603
|
messageKey: "devStudio.issue.jsonInvalid",
|
|
1348
|
-
params: { path:
|
|
1349
|
-
path:
|
|
1604
|
+
params: { path: m.path, error: b instanceof Error ? b.message : String(b) },
|
|
1605
|
+
path: m.path
|
|
1350
1606
|
});
|
|
1351
1607
|
}
|
|
1352
|
-
const
|
|
1608
|
+
const a = (m) => s.filter((b) => Ne(b.file.path) && re(b.file.path, m)), l = a(".manifest.json");
|
|
1353
1609
|
l.length === 0 && n({
|
|
1354
1610
|
code: "manifest.missing",
|
|
1355
1611
|
message: "The module has no *.manifest.json.",
|
|
1356
1612
|
messageKey: "devStudio.issue.manifestMissing"
|
|
1357
1613
|
});
|
|
1358
|
-
for (const { file:
|
|
1359
|
-
for (const
|
|
1360
|
-
(!
|
|
1614
|
+
for (const { file: m, value: b } of l)
|
|
1615
|
+
for (const g of ["packageName", "version", "category"])
|
|
1616
|
+
(!K(b) || !(g in b)) && n({
|
|
1361
1617
|
code: "manifest.required",
|
|
1362
|
-
message: `The manifest needs "${
|
|
1618
|
+
message: `The manifest needs "${g}".`,
|
|
1363
1619
|
messageKey: "devStudio.issue.manifestRequired",
|
|
1364
|
-
params: { field:
|
|
1365
|
-
path:
|
|
1366
|
-
pointer: `/${
|
|
1620
|
+
params: { field: g },
|
|
1621
|
+
path: m.path,
|
|
1622
|
+
pointer: `/${g}`
|
|
1367
1623
|
});
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1624
|
+
const y = a(".iconconfig.json");
|
|
1625
|
+
y.length === 0 && e.contents !== "manifest" && n({
|
|
1370
1626
|
severity: "info",
|
|
1371
1627
|
code: "iconconfig.missing",
|
|
1372
1628
|
message: "The module has no *.iconconfig.json: its menu shows a default icon (the CI wants one in every Category/Module folder).",
|
|
1373
1629
|
messageKey: "devStudio.issue.iconconfigMissing"
|
|
1374
1630
|
});
|
|
1375
|
-
for (const { file:
|
|
1376
|
-
const
|
|
1377
|
-
...
|
|
1378
|
-
...
|
|
1379
|
-
...
|
|
1380
|
-
...
|
|
1631
|
+
for (const { file: m, value: b } of y) {
|
|
1632
|
+
const g = K(b) ? b.module : void 0, E = K(g) ? g.icon : void 0, C = [
|
|
1633
|
+
...K(g) ? [] : ["module"],
|
|
1634
|
+
...K(g) && !K(E) ? ["module.icon"] : [],
|
|
1635
|
+
...K(E) && !("name" in E) ? ["module.icon.name"] : [],
|
|
1636
|
+
...K(E) && !("package" in E) ? ["module.icon.package"] : [],
|
|
1381
1637
|
...["views", "permissions", "workflowStates"].filter(
|
|
1382
|
-
(
|
|
1638
|
+
(h) => !K(b) || !(h in b)
|
|
1383
1639
|
)
|
|
1384
1640
|
];
|
|
1385
|
-
for (const
|
|
1641
|
+
for (const h of C)
|
|
1386
1642
|
n({
|
|
1387
1643
|
code: "iconconfig.structure",
|
|
1388
|
-
message: `The icon config needs "${
|
|
1644
|
+
message: `The icon config needs "${h}".`,
|
|
1389
1645
|
messageKey: "devStudio.issue.iconconfigStructure",
|
|
1390
|
-
params: { field:
|
|
1391
|
-
path:
|
|
1392
|
-
pointer: `/${
|
|
1646
|
+
params: { field: h },
|
|
1647
|
+
path: m.path,
|
|
1648
|
+
pointer: `/${h.split(".").join("/")}`
|
|
1393
1649
|
});
|
|
1394
1650
|
}
|
|
1395
|
-
const
|
|
1396
|
-
for (const { file:
|
|
1397
|
-
if (!
|
|
1651
|
+
const p = [], u = [];
|
|
1652
|
+
for (const { file: m, value: b } of a(".entities.json")) {
|
|
1653
|
+
if (!K(b) || !("entities" in b))
|
|
1398
1654
|
continue;
|
|
1399
|
-
const
|
|
1400
|
-
if (!Array.isArray(
|
|
1655
|
+
const g = [], E = b.entities;
|
|
1656
|
+
if (!Array.isArray(E) || E.length === 0) {
|
|
1401
1657
|
n({
|
|
1402
1658
|
code: "entities.empty",
|
|
1403
1659
|
message: "The file has no entities.",
|
|
1404
1660
|
messageKey: "devStudio.issue.entitiesEmpty",
|
|
1405
|
-
path:
|
|
1661
|
+
path: m.path,
|
|
1406
1662
|
pointer: "/entities"
|
|
1407
1663
|
});
|
|
1408
1664
|
continue;
|
|
1409
1665
|
}
|
|
1410
|
-
|
|
1411
|
-
const
|
|
1412
|
-
if (
|
|
1666
|
+
E.forEach((C, h) => {
|
|
1667
|
+
const S = `/entities/${h}`, d = K(C) && typeof C.name == "string" ? C.name : void 0;
|
|
1668
|
+
if (d ? p.push(d) : n({
|
|
1413
1669
|
code: "entities.name",
|
|
1414
|
-
message: `Entity #${
|
|
1670
|
+
message: `Entity #${h + 1} has no name.`,
|
|
1415
1671
|
messageKey: "devStudio.issue.entitiesName",
|
|
1416
|
-
params: { n:
|
|
1417
|
-
path:
|
|
1418
|
-
pointer:
|
|
1419
|
-
}), !
|
|
1672
|
+
params: { n: h + 1 },
|
|
1673
|
+
path: m.path,
|
|
1674
|
+
pointer: S
|
|
1675
|
+
}), !K(C) || !Array.isArray(C.fields)) {
|
|
1420
1676
|
n({
|
|
1421
1677
|
code: "entities.fields",
|
|
1422
|
-
message: `Entity ${
|
|
1678
|
+
message: `Entity ${d ?? `#${h + 1}`} has no fields array.`,
|
|
1423
1679
|
messageKey: "devStudio.issue.entitiesFields",
|
|
1424
|
-
params: { name:
|
|
1425
|
-
path:
|
|
1426
|
-
pointer:
|
|
1680
|
+
params: { name: d ?? `#${h + 1}` },
|
|
1681
|
+
path: m.path,
|
|
1682
|
+
pointer: S
|
|
1427
1683
|
});
|
|
1428
1684
|
return;
|
|
1429
1685
|
}
|
|
1430
|
-
|
|
1686
|
+
K(C) && typeof C.displayName == "string" && de(C.displayName) && n({
|
|
1431
1687
|
code: "labels.polish",
|
|
1432
|
-
message: `Entity ${
|
|
1688
|
+
message: `Entity ${d}: the display name "${C.displayName}" is Polish — seed labels are English, Polish goes to the .pl bundle.`,
|
|
1433
1689
|
messageKey: "devStudio.issue.polishEntity",
|
|
1434
|
-
params: { name:
|
|
1435
|
-
path:
|
|
1436
|
-
pointer: `${
|
|
1437
|
-
}), C.fields.forEach((
|
|
1438
|
-
if (!
|
|
1690
|
+
params: { name: d ?? "", text: C.displayName },
|
|
1691
|
+
path: m.path,
|
|
1692
|
+
pointer: `${S}/displayName`
|
|
1693
|
+
}), C.fields.forEach((j, r) => {
|
|
1694
|
+
if (!K(j))
|
|
1439
1695
|
return;
|
|
1440
|
-
const c = typeof
|
|
1441
|
-
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1696
|
+
const c = typeof j.name == "string" ? j.name : void 0, v = `${S}/fields/${r}`;
|
|
1697
|
+
d && c && j.isPrimaryKey !== !0 && u.push(`field.${d}.${c}`);
|
|
1698
|
+
const $ = typeof j.dataType == "string" ? j.dataType.replace(/\?+$/, "") : void 0;
|
|
1699
|
+
$ === void 0 && typeof j.type == "string" && g.push({ name: `${d}.${c}`, pointer: `${v}/type` }), $ && Qt.has($.toLowerCase()) && (c === "Id" || j.isForeignKey === !0) && n({
|
|
1444
1700
|
code: "entities.keyNotGuid",
|
|
1445
|
-
message: `${
|
|
1701
|
+
message: `${d}.${c} is ${$}: keys must be Guid (every row's Id is a uuid).`,
|
|
1446
1702
|
messageKey: "devStudio.issue.keyNotGuid",
|
|
1447
|
-
params: { name: `${
|
|
1448
|
-
path:
|
|
1449
|
-
pointer: `${
|
|
1450
|
-
}), typeof
|
|
1703
|
+
params: { name: `${d}.${c}`, type: $ },
|
|
1704
|
+
path: m.path,
|
|
1705
|
+
pointer: `${v}/dataType`
|
|
1706
|
+
}), typeof j.displayName == "string" && de(j.displayName) && n({
|
|
1451
1707
|
code: "labels.polish",
|
|
1452
|
-
message: `${
|
|
1708
|
+
message: `${d}.${c}: the display name "${j.displayName}" is Polish — seed labels are English.`,
|
|
1453
1709
|
messageKey: "devStudio.issue.polishField",
|
|
1454
|
-
params: { name: `${
|
|
1455
|
-
path:
|
|
1456
|
-
pointer: `${
|
|
1710
|
+
params: { name: `${d}.${c}`, text: j.displayName },
|
|
1711
|
+
path: m.path,
|
|
1712
|
+
pointer: `${v}/displayName`
|
|
1457
1713
|
});
|
|
1458
1714
|
});
|
|
1459
|
-
}),
|
|
1715
|
+
}), g.length && n({
|
|
1460
1716
|
severity: "warning",
|
|
1461
1717
|
code: "entities.typeIgnored",
|
|
1462
|
-
message: `${
|
|
1718
|
+
message: `${g.length} field(s) give their type as "type", which installing ignores — it reads "dataType": ${g.slice(0, 5).map((C) => C.name).join(", ")}${g.length > 5 ? ", …" : ""}`,
|
|
1463
1719
|
messageKey: "devStudio.issue.typeIgnored",
|
|
1464
1720
|
params: {
|
|
1465
|
-
count:
|
|
1466
|
-
names: `${
|
|
1721
|
+
count: g.length,
|
|
1722
|
+
names: `${g.slice(0, 5).map((C) => C.name).join(", ")}${g.length > 5 ? ", …" : ""}`
|
|
1467
1723
|
},
|
|
1468
|
-
path:
|
|
1469
|
-
pointer:
|
|
1724
|
+
path: m.path,
|
|
1725
|
+
pointer: g[0].pointer
|
|
1470
1726
|
});
|
|
1471
1727
|
}
|
|
1472
|
-
for (const { file:
|
|
1473
|
-
(!
|
|
1728
|
+
for (const { file: m, value: b } of a(".permissions.json"))
|
|
1729
|
+
(!K(b) || !Array.isArray(b.permissions) || b.permissions.length === 0) && n({
|
|
1474
1730
|
code: "permissions.empty",
|
|
1475
1731
|
message: 'The file needs a non-empty "permissions" array.',
|
|
1476
1732
|
messageKey: "devStudio.issue.permissionsEmpty",
|
|
1477
|
-
path:
|
|
1733
|
+
path: m.path,
|
|
1478
1734
|
pointer: "/permissions"
|
|
1479
1735
|
});
|
|
1480
|
-
const
|
|
1481
|
-
for (const { file:
|
|
1482
|
-
if (!
|
|
1736
|
+
const N = [];
|
|
1737
|
+
for (const { file: m, value: b } of a(".views.json")) {
|
|
1738
|
+
if (!K(b) || Object.keys(b).length === 0) {
|
|
1483
1739
|
n({
|
|
1484
1740
|
code: "views.empty",
|
|
1485
1741
|
message: "A views file is a JSON object with at least one property.",
|
|
1486
1742
|
messageKey: "devStudio.issue.viewsEmpty",
|
|
1487
|
-
path:
|
|
1743
|
+
path: m.path
|
|
1488
1744
|
});
|
|
1489
1745
|
continue;
|
|
1490
1746
|
}
|
|
1491
|
-
|
|
1492
|
-
if (!
|
|
1747
|
+
ie(b, "views").forEach((g, E) => {
|
|
1748
|
+
if (!K(g))
|
|
1493
1749
|
return;
|
|
1494
|
-
const C = `/views/${
|
|
1495
|
-
typeof
|
|
1750
|
+
const C = `/views/${E}`, h = typeof g.name == "string" ? g.name : "(unnamed)";
|
|
1751
|
+
typeof g.name == "string" && N.push(g.name), typeof g.type == "string" && g.type.toLowerCase() === "list" && !t.has(m.path.toLowerCase()) && (typeof g.entityName != "string" || !g.entityName.trim() ? n({
|
|
1496
1752
|
code: "views.listEntity",
|
|
1497
|
-
message: `List view ${
|
|
1753
|
+
message: `List view ${h} needs a top-level "entityName".`,
|
|
1498
1754
|
messageKey: "devStudio.issue.listEntity",
|
|
1499
|
-
params: { name:
|
|
1500
|
-
path:
|
|
1755
|
+
params: { name: h },
|
|
1756
|
+
path: m.path,
|
|
1501
1757
|
pointer: C
|
|
1502
|
-
}) : (!Array.isArray(
|
|
1758
|
+
}) : (!Array.isArray(g.columns) || g.columns.length === 0) && n({
|
|
1503
1759
|
code: "views.listColumns",
|
|
1504
|
-
message: `List view ${
|
|
1760
|
+
message: `List view ${h} needs non-empty top-level "columns".`,
|
|
1505
1761
|
messageKey: "devStudio.issue.listColumns",
|
|
1506
|
-
params: { name:
|
|
1507
|
-
path:
|
|
1762
|
+
params: { name: h },
|
|
1763
|
+
path: m.path,
|
|
1508
1764
|
pointer: C
|
|
1509
1765
|
}));
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
for (const
|
|
1513
|
-
|
|
1514
|
-
}),
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
(
|
|
1766
|
+
const S = [[g, "displayName", C]];
|
|
1767
|
+
ie(g, "columns").forEach((d, j) => {
|
|
1768
|
+
for (const r of ["header", "displayName", "label"])
|
|
1769
|
+
S.push([d, r, `${C}/columns/${j}`]);
|
|
1770
|
+
}), ie(g, "tabs").forEach((d, j) => {
|
|
1771
|
+
S.push([d, "displayName", `${C}/tabs/${j}`]), ie(d, "sections").forEach((r, c) => {
|
|
1772
|
+
S.push([r, "displayName", `${C}/tabs/${j}/sections/${c}`]), ie(r, "controls").forEach(
|
|
1773
|
+
(v, $) => S.push([v, "label", `${C}/tabs/${j}/sections/${c}/controls/${$}`])
|
|
1518
1774
|
);
|
|
1519
1775
|
});
|
|
1520
1776
|
});
|
|
1521
|
-
for (const [
|
|
1522
|
-
const c =
|
|
1523
|
-
typeof c == "string" &&
|
|
1777
|
+
for (const [d, j, r] of S) {
|
|
1778
|
+
const c = K(d) ? d[j] : void 0;
|
|
1779
|
+
typeof c == "string" && de(c) && n({
|
|
1524
1780
|
code: "labels.polish",
|
|
1525
|
-
message: `View ${
|
|
1781
|
+
message: `View ${h}: "${c}" is Polish — seed labels are English.`,
|
|
1526
1782
|
messageKey: "devStudio.issue.polishView",
|
|
1527
|
-
params: { name:
|
|
1528
|
-
path:
|
|
1529
|
-
pointer: `${
|
|
1783
|
+
params: { name: h, text: c },
|
|
1784
|
+
path: m.path,
|
|
1785
|
+
pointer: `${r}/${j}`
|
|
1530
1786
|
});
|
|
1531
1787
|
}
|
|
1532
1788
|
});
|
|
1533
1789
|
}
|
|
1534
|
-
const
|
|
1535
|
-
for (const
|
|
1536
|
-
const [,
|
|
1537
|
-
|
|
1790
|
+
const L = s.filter((m) => Ne(m.file.path) && Le.test(m.file.path)), I = /* @__PURE__ */ new Map();
|
|
1791
|
+
for (const m of L) {
|
|
1792
|
+
const [, b, g] = Le.exec(m.file.path), E = I.get(b) ?? /* @__PURE__ */ new Map();
|
|
1793
|
+
E.set(g.toLowerCase(), m), I.set(b, E);
|
|
1538
1794
|
}
|
|
1539
|
-
const
|
|
1540
|
-
[...
|
|
1541
|
-
),
|
|
1542
|
-
for (const [
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1795
|
+
const x = new Set(
|
|
1796
|
+
[...I.keys()].map((m) => m.split(".")[0]).filter((m) => !Zt.has(m))
|
|
1797
|
+
), O = /* @__PURE__ */ new Set();
|
|
1798
|
+
for (const [m, b] of I) {
|
|
1799
|
+
const g = b.get("en"), E = b.get("pl"), C = (h) => new Set(Ae(h == null ? void 0 : h.value).map(([S]) => S));
|
|
1800
|
+
if (g && !E && n({
|
|
1545
1801
|
code: "i18n.polishMissing",
|
|
1546
|
-
message: `${
|
|
1802
|
+
message: `${m}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
|
|
1547
1803
|
messageKey: "devStudio.issue.polishBundleMissing",
|
|
1548
|
-
params: { group:
|
|
1549
|
-
path:
|
|
1550
|
-
}),
|
|
1804
|
+
params: { group: m },
|
|
1805
|
+
path: g.file.path
|
|
1806
|
+
}), E && !g && n({
|
|
1551
1807
|
code: "i18n.englishMissing",
|
|
1552
|
-
message: `${
|
|
1808
|
+
message: `${m}.pl.i18n.json needs an .en.i18n.json baseline.`,
|
|
1553
1809
|
messageKey: "devStudio.issue.englishBundleMissing",
|
|
1554
|
-
params: { group:
|
|
1555
|
-
path:
|
|
1556
|
-
}),
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1810
|
+
params: { group: m },
|
|
1811
|
+
path: E.file.path
|
|
1812
|
+
}), g && E) {
|
|
1813
|
+
const h = C(g), S = C(E), d = [...h].filter((r) => !S.has(r)), j = [...S].filter((r) => !h.has(r));
|
|
1814
|
+
d.length && n({
|
|
1559
1815
|
code: "i18n.keyMissing",
|
|
1560
|
-
message: `${
|
|
1816
|
+
message: `${E.file.path} is missing ${d.length} key(s) of English: ${d.slice(0, 10).join(", ")}`,
|
|
1561
1817
|
messageKey: "devStudio.issue.keysMissingPl",
|
|
1562
1818
|
params: {
|
|
1563
|
-
path:
|
|
1564
|
-
count:
|
|
1565
|
-
keys:
|
|
1819
|
+
path: E.file.path,
|
|
1820
|
+
count: d.length,
|
|
1821
|
+
keys: d.slice(0, 10).join(", ")
|
|
1566
1822
|
},
|
|
1567
|
-
path:
|
|
1568
|
-
}),
|
|
1823
|
+
path: E.file.path
|
|
1824
|
+
}), j.length && n({
|
|
1569
1825
|
code: "i18n.keyMissing",
|
|
1570
|
-
message: `${
|
|
1826
|
+
message: `${g.file.path} is missing ${j.length} key(s) of Polish: ${j.slice(0, 10).join(", ")}`,
|
|
1571
1827
|
messageKey: "devStudio.issue.keysMissingEn",
|
|
1572
1828
|
params: {
|
|
1573
|
-
path:
|
|
1574
|
-
count:
|
|
1575
|
-
keys:
|
|
1829
|
+
path: g.file.path,
|
|
1830
|
+
count: j.length,
|
|
1831
|
+
keys: j.slice(0, 10).join(", ")
|
|
1576
1832
|
},
|
|
1577
|
-
path:
|
|
1833
|
+
path: g.file.path
|
|
1578
1834
|
});
|
|
1579
1835
|
}
|
|
1580
|
-
for (const [
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1836
|
+
for (const [h, S] of b) {
|
|
1837
|
+
const d = Ae(S.value), j = d.filter(([r]) => x.has(r.split(".")[0])).map(([r]) => r);
|
|
1838
|
+
if (j.length && n({
|
|
1583
1839
|
severity: "warning",
|
|
1584
1840
|
code: "i18n.fileKey",
|
|
1585
|
-
message: `${
|
|
1841
|
+
message: `${S.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${j.slice(0, 5).join(", ")}).`,
|
|
1586
1842
|
messageKey: "devStudio.issue.fileKey",
|
|
1587
|
-
params: { path:
|
|
1588
|
-
path:
|
|
1589
|
-
}),
|
|
1590
|
-
for (const [
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
["module", "entity", "field", "view"].includes(
|
|
1843
|
+
params: { path: S.file.path, keys: j.slice(0, 5).join(", ") },
|
|
1844
|
+
path: S.file.path
|
|
1845
|
+
}), h === "en")
|
|
1846
|
+
for (const [r, c] of d) {
|
|
1847
|
+
O.add(r);
|
|
1848
|
+
const v = r.split(".")[0];
|
|
1849
|
+
["module", "entity", "field", "view"].includes(v) && typeof c == "string" && de(c) && n({
|
|
1594
1850
|
code: "i18n.polishInEnglish",
|
|
1595
|
-
message: `${
|
|
1851
|
+
message: `${S.file.path}: ${r} = "${c}" — the English bundle is the English UI.`,
|
|
1596
1852
|
messageKey: "devStudio.issue.polishInEnglish",
|
|
1597
|
-
params: { path:
|
|
1598
|
-
path:
|
|
1853
|
+
params: { path: S.file.path, key: r, text: c },
|
|
1854
|
+
path: S.file.path
|
|
1599
1855
|
});
|
|
1600
1856
|
}
|
|
1601
1857
|
}
|
|
1602
1858
|
}
|
|
1603
|
-
if (l.length &&
|
|
1604
|
-
const
|
|
1859
|
+
if (l.length && L.length) {
|
|
1860
|
+
const b = [
|
|
1605
1861
|
"module.displayName",
|
|
1606
|
-
...
|
|
1607
|
-
...
|
|
1608
|
-
...
|
|
1862
|
+
...p.map((g) => `entity.${g}.displayName`),
|
|
1863
|
+
...u.map((g) => `${g}.displayName`),
|
|
1864
|
+
...N.map((g) => `view.${g}.displayName`)
|
|
1609
1865
|
].filter(
|
|
1610
|
-
(
|
|
1866
|
+
(g) => !O.has(g) && !(g.startsWith("field.") && O.has(`${g.slice(0, -12)}.label`))
|
|
1611
1867
|
);
|
|
1612
|
-
|
|
1868
|
+
b.length && n({
|
|
1613
1869
|
code: "i18n.labelMissing",
|
|
1614
|
-
message: `The English bundle has no label for ${
|
|
1870
|
+
message: `The English bundle has no label for ${b.length} name(s): ${b.slice(0, 10).join(", ")}`,
|
|
1615
1871
|
messageKey: "devStudio.issue.labelMissing",
|
|
1616
|
-
params: { count:
|
|
1872
|
+
params: { count: b.length, keys: b.slice(0, 10).join(", ") }
|
|
1617
1873
|
});
|
|
1618
1874
|
}
|
|
1619
|
-
for (const { file:
|
|
1620
|
-
|
|
1621
|
-
|
|
1875
|
+
for (const { file: m, value: b } of s)
|
|
1876
|
+
me(
|
|
1877
|
+
b,
|
|
1622
1878
|
void 0,
|
|
1623
1879
|
"",
|
|
1624
|
-
(
|
|
1880
|
+
(g, E, C) => n({
|
|
1625
1881
|
code: "icons.emoji",
|
|
1626
|
-
message: `${
|
|
1882
|
+
message: `${E} = "${C}": icon fields take an Ntd* name and column headers are words, never emoji.`,
|
|
1627
1883
|
messageKey: "devStudio.issue.iconsEmoji",
|
|
1628
|
-
params: { key:
|
|
1629
|
-
path:
|
|
1630
|
-
pointer:
|
|
1884
|
+
params: { key: E, text: C },
|
|
1885
|
+
path: m.path,
|
|
1886
|
+
pointer: g
|
|
1631
1887
|
})
|
|
1632
1888
|
);
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1635
|
-
const
|
|
1636
|
-
for (const { value:
|
|
1637
|
-
const
|
|
1638
|
-
for (const C of Array.isArray(
|
|
1639
|
-
const
|
|
1640
|
-
typeof
|
|
1889
|
+
const w = a(".datasources.json");
|
|
1890
|
+
if (w.length && l.length) {
|
|
1891
|
+
const m = /* @__PURE__ */ new Set();
|
|
1892
|
+
for (const { value: g } of w) {
|
|
1893
|
+
const E = Array.isArray(g) ? g : g == null ? void 0 : g.dataSources;
|
|
1894
|
+
for (const C of Array.isArray(E) ? E : []) {
|
|
1895
|
+
const h = (C == null ? void 0 : C.key) ?? (C == null ? void 0 : C.name);
|
|
1896
|
+
typeof h == "string" && m.add(h);
|
|
1641
1897
|
}
|
|
1642
1898
|
}
|
|
1643
|
-
const
|
|
1644
|
-
(Array.isArray(
|
|
1645
|
-
const C = (
|
|
1646
|
-
typeof C == "string" && !
|
|
1899
|
+
const b = (T = l[0].value) == null ? void 0 : T.dataSources;
|
|
1900
|
+
(Array.isArray(b) ? b : []).forEach((g, E) => {
|
|
1901
|
+
const C = (g == null ? void 0 : g.key) ?? (g == null ? void 0 : g.name);
|
|
1902
|
+
typeof C == "string" && !m.has(C) && n({
|
|
1647
1903
|
severity: "warning",
|
|
1648
1904
|
code: "dataSources.undefined",
|
|
1649
1905
|
message: `The manifest lists the data source "${C}", which no *.datasources.json defines.`,
|
|
1650
1906
|
messageKey: "devStudio.issue.dataSourceUndefined",
|
|
1651
1907
|
params: { key: C },
|
|
1652
1908
|
path: l[0].file.path,
|
|
1653
|
-
pointer: `/dataSources/${
|
|
1909
|
+
pointer: `/dataSources/${E}`
|
|
1654
1910
|
});
|
|
1655
1911
|
});
|
|
1656
1912
|
}
|
|
1657
|
-
return
|
|
1913
|
+
return o;
|
|
1658
1914
|
}
|
|
1659
|
-
function
|
|
1915
|
+
function me(e, i, t, o) {
|
|
1660
1916
|
if (Array.isArray(e)) {
|
|
1661
|
-
e.forEach((n, s) =>
|
|
1917
|
+
e.forEach((n, s) => me(n, i, `${t}/${s}`, o));
|
|
1662
1918
|
return;
|
|
1663
1919
|
}
|
|
1664
|
-
if (
|
|
1920
|
+
if (K(e))
|
|
1665
1921
|
for (const [n, s] of Object.entries(e)) {
|
|
1666
|
-
const
|
|
1667
|
-
if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" &&
|
|
1922
|
+
const a = `${t}/${n}`;
|
|
1923
|
+
if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && Yt(s) && o(a, n, s), n === "optionsJson" && typeof s == "string")
|
|
1668
1924
|
try {
|
|
1669
|
-
|
|
1925
|
+
me(JSON.parse(s), "optionsJson", a, o);
|
|
1670
1926
|
} catch {
|
|
1671
1927
|
}
|
|
1672
|
-
|
|
1928
|
+
me(s, n, a, o);
|
|
1673
1929
|
}
|
|
1674
1930
|
}
|
|
1675
|
-
function
|
|
1676
|
-
const t = [],
|
|
1677
|
-
for (const
|
|
1678
|
-
for (const l of
|
|
1679
|
-
if (!
|
|
1931
|
+
function ti(e, i = {}) {
|
|
1932
|
+
const t = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1933
|
+
for (const a of e)
|
|
1934
|
+
for (const l of a.files) {
|
|
1935
|
+
if (!Ne(l.path) || !re(l.path, ".json"))
|
|
1680
1936
|
continue;
|
|
1681
|
-
let
|
|
1937
|
+
let y;
|
|
1682
1938
|
try {
|
|
1683
|
-
|
|
1939
|
+
y = z(l.text).value;
|
|
1684
1940
|
} catch {
|
|
1685
1941
|
continue;
|
|
1686
1942
|
}
|
|
1687
|
-
if (
|
|
1688
|
-
const
|
|
1689
|
-
|
|
1943
|
+
if (re(l.path, ".manifest.json") && K(y) && typeof y.packageName == "string" && y.packageName) {
|
|
1944
|
+
const p = y.packageName.toLowerCase();
|
|
1945
|
+
o.set(p, [...o.get(p) ?? [], a.location]);
|
|
1690
1946
|
}
|
|
1691
|
-
if (
|
|
1692
|
-
for (const
|
|
1693
|
-
if (
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1947
|
+
if (re(l.path, ".entities.json") && a.group) {
|
|
1948
|
+
for (const p of ie(y, "entities"))
|
|
1949
|
+
if (K(p) && typeof p.name == "string" && p.name) {
|
|
1950
|
+
const u = `${a.group}/${p.name}`.toLowerCase(), N = n.get(u) ?? [];
|
|
1951
|
+
N.includes(a.location) || n.set(u, [...N, a.location]);
|
|
1696
1952
|
}
|
|
1697
1953
|
}
|
|
1698
1954
|
}
|
|
1699
|
-
for (const [
|
|
1955
|
+
for (const [a, l] of o)
|
|
1700
1956
|
l.length > 1 && t.push({
|
|
1701
1957
|
severity: "error",
|
|
1702
1958
|
code: "workspace.packageName",
|
|
1703
|
-
message: `Package name ${
|
|
1959
|
+
message: `Package name ${a} is declared by ${l.length} modules: ${l.join(", ")}`,
|
|
1704
1960
|
messageKey: "devStudio.issue.duplicatePackage",
|
|
1705
|
-
params: { name:
|
|
1961
|
+
params: { name: a, count: l.length, modules: l.join(", ") }
|
|
1706
1962
|
});
|
|
1707
|
-
const s = new Set([...i.knownDuplicates ?? []].map((
|
|
1708
|
-
for (const [
|
|
1709
|
-
l.length > 1 && !s.has(
|
|
1963
|
+
const s = new Set([...i.knownDuplicates ?? []].map((a) => a.toLowerCase()));
|
|
1964
|
+
for (const [a, l] of n)
|
|
1965
|
+
l.length > 1 && !s.has(a) && t.push({
|
|
1710
1966
|
severity: "error",
|
|
1711
1967
|
code: "workspace.entityName",
|
|
1712
|
-
message: `Entity ${
|
|
1968
|
+
message: `Entity ${a} is declared by ${l.length} modules of the same group: ${l.join(", ")}`,
|
|
1713
1969
|
messageKey: "devStudio.issue.duplicateEntity",
|
|
1714
|
-
params: { name:
|
|
1970
|
+
params: { name: a, count: l.length, modules: l.join(", ") }
|
|
1715
1971
|
});
|
|
1716
1972
|
return t;
|
|
1717
1973
|
}
|
|
1718
|
-
const
|
|
1974
|
+
const ne = (e) => typeof e == "object" && e !== null && !Array.isArray(e), te = (e) => typeof e == "string" && e ? e : void 0, ii = /* @__PURE__ */ new Set([
|
|
1719
1975
|
"slug",
|
|
1720
1976
|
"category",
|
|
1721
1977
|
"subCategory",
|
|
@@ -1726,54 +1982,54 @@ const te = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (
|
|
|
1726
1982
|
"translations",
|
|
1727
1983
|
"modules"
|
|
1728
1984
|
]);
|
|
1729
|
-
function
|
|
1985
|
+
function He(e) {
|
|
1730
1986
|
if (Array.isArray(e))
|
|
1731
1987
|
return e.filter((i) => typeof i == "string");
|
|
1732
1988
|
if (typeof e == "string")
|
|
1733
1989
|
return e.split(",").map((i) => i.trim()).filter(Boolean);
|
|
1734
1990
|
}
|
|
1735
|
-
function
|
|
1991
|
+
function Ze(e) {
|
|
1736
1992
|
const i = {};
|
|
1737
|
-
for (const [t,
|
|
1738
|
-
|
|
1993
|
+
for (const [t, o] of Object.entries(ne(e) ? e : {}))
|
|
1994
|
+
ne(o) && (i[t] = { ...o, name: String(o.name ?? "") });
|
|
1739
1995
|
return i;
|
|
1740
1996
|
}
|
|
1741
|
-
function
|
|
1742
|
-
const t =
|
|
1997
|
+
function ni(e, i) {
|
|
1998
|
+
const t = ne(e) ? e : {}, o = Object.fromEntries(Object.entries(t).filter(([n]) => !ii.has(n)));
|
|
1743
1999
|
return {
|
|
1744
2000
|
id: String(t.slug ?? ""),
|
|
1745
|
-
category:
|
|
1746
|
-
subCategory:
|
|
1747
|
-
parentId:
|
|
1748
|
-
icon:
|
|
2001
|
+
category: te(t.category),
|
|
2002
|
+
subCategory: te(t.subCategory),
|
|
2003
|
+
parentId: te(t.parentSlug),
|
|
2004
|
+
icon: te(t.icon),
|
|
1749
2005
|
sortOrder: typeof t.sortOrder == "number" ? t.sortOrder : void 0,
|
|
1750
|
-
tags:
|
|
1751
|
-
translations:
|
|
1752
|
-
modules: (Array.isArray(t.modules) ? t.modules : []).filter(
|
|
2006
|
+
tags: He(t.tags),
|
|
2007
|
+
translations: Ze(t.translations),
|
|
2008
|
+
modules: (Array.isArray(t.modules) ? t.modules : []).filter(ne).map((n) => ({
|
|
1753
2009
|
moduleId: String(n.packageName ?? ""),
|
|
1754
2010
|
required: n.required === !0,
|
|
1755
|
-
condition:
|
|
1756
|
-
description:
|
|
2011
|
+
condition: te(n.condition),
|
|
2012
|
+
description: te(n.description)
|
|
1757
2013
|
})),
|
|
1758
|
-
...Object.keys(
|
|
2014
|
+
...Object.keys(o).length ? { extra: o } : {},
|
|
1759
2015
|
...i ? { readOnly: i } : {}
|
|
1760
2016
|
};
|
|
1761
2017
|
}
|
|
1762
|
-
const
|
|
1763
|
-
function
|
|
2018
|
+
const je = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
|
|
2019
|
+
function Me(e, i) {
|
|
1764
2020
|
var l;
|
|
1765
|
-
const t =
|
|
1766
|
-
const
|
|
1767
|
-
return
|
|
1768
|
-
...
|
|
1769
|
-
packageName:
|
|
2021
|
+
const t = ne(i) ? i : {}, o = (Array.isArray(t.modules) ? t.modules : []).filter(ne), s = JSON.stringify(He(t.tags) ?? []) === JSON.stringify(e.tags ?? []) ? t.tags : (l = e.tags) != null && l.length ? typeof t.tags == "string" ? e.tags.join(",") : e.tags : void 0, a = (y) => {
|
|
2022
|
+
const p = o.find((u) => u.packageName === y.moduleId);
|
|
2023
|
+
return je({
|
|
2024
|
+
...p,
|
|
2025
|
+
packageName: y.moduleId,
|
|
1770
2026
|
// seed entries spell `required` out, also when it is false
|
|
1771
|
-
required:
|
|
1772
|
-
condition:
|
|
1773
|
-
description:
|
|
2027
|
+
required: y.required === !0 ? !0 : !p || "required" in p ? !1 : void 0,
|
|
2028
|
+
condition: y.condition || void 0,
|
|
2029
|
+
description: y.description || void 0
|
|
1774
2030
|
});
|
|
1775
2031
|
};
|
|
1776
|
-
return
|
|
2032
|
+
return je({
|
|
1777
2033
|
...t,
|
|
1778
2034
|
slug: e.id,
|
|
1779
2035
|
category: e.category,
|
|
@@ -1784,16 +2040,16 @@ function xe(e, i) {
|
|
|
1784
2040
|
...e.extra,
|
|
1785
2041
|
tags: s,
|
|
1786
2042
|
translations: e.translations,
|
|
1787
|
-
modules: e.modules.map(
|
|
2043
|
+
modules: e.modules.map(a)
|
|
1788
2044
|
});
|
|
1789
2045
|
}
|
|
1790
|
-
function
|
|
1791
|
-
const t =
|
|
2046
|
+
function De(e, i = "en") {
|
|
2047
|
+
const t = Ze(e.translations);
|
|
1792
2048
|
Object.keys(t).length === 0 && e.name && (t[i] = {
|
|
1793
2049
|
name: e.name,
|
|
1794
2050
|
...e.description ? { description: e.description } : {}
|
|
1795
2051
|
});
|
|
1796
|
-
const
|
|
2052
|
+
const o = je({
|
|
1797
2053
|
isActive: e.isActive,
|
|
1798
2054
|
compliance: e.compliance,
|
|
1799
2055
|
defaultLanguage: e.defaultLanguage ?? void 0,
|
|
@@ -1814,11 +2070,11 @@ function Ie(e, i = "en") {
|
|
|
1814
2070
|
condition: n.condition ?? void 0,
|
|
1815
2071
|
description: n.description ?? void 0
|
|
1816
2072
|
})),
|
|
1817
|
-
extra:
|
|
2073
|
+
extra: o,
|
|
1818
2074
|
readOnly: e.source === "seed" || e.source === "code"
|
|
1819
2075
|
};
|
|
1820
2076
|
}
|
|
1821
|
-
function
|
|
2077
|
+
function si(e) {
|
|
1822
2078
|
const i = e.extra ?? {};
|
|
1823
2079
|
return {
|
|
1824
2080
|
slug: e.id,
|
|
@@ -1838,620 +2094,620 @@ function _t(e) {
|
|
|
1838
2094
|
...typeof i.defaultLanguage == "string" ? { defaultLanguage: i.defaultLanguage } : {}
|
|
1839
2095
|
};
|
|
1840
2096
|
}
|
|
1841
|
-
const F = (...e) => e.filter(Boolean).join("/"),
|
|
1842
|
-
function
|
|
1843
|
-
const i = (t,
|
|
2097
|
+
const F = (...e) => e.filter(Boolean).join("/"), oi = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), ai = (e) => e.slice(e.lastIndexOf("/") + 1), he = (e) => typeof e == "object" && e !== null && !Array.isArray(e), se = (e) => typeof e == "string" && e ? e : void 0, ri = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), we = (e) => e.startsWith(".") || ri.has(e), li = /^wizard-templates-.+\.seed\.json$/i, ci = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
|
|
2098
|
+
function ve(e) {
|
|
2099
|
+
const i = (t, o = 2) => String(t).padStart(o, "0");
|
|
1844
2100
|
return `${e.getUTCFullYear()}${i(e.getUTCMonth() + 1)}${i(e.getUTCDate())}T${i(e.getUTCHours())}${i(e.getUTCMinutes())}${i(e.getUTCSeconds())}${i(e.getUTCMilliseconds(), 3)}Z`;
|
|
1845
2101
|
}
|
|
1846
|
-
function
|
|
1847
|
-
const i =
|
|
2102
|
+
function di(e) {
|
|
2103
|
+
const i = ci.exec(e);
|
|
1848
2104
|
return i ? Date.UTC(+i[1], +i[2] - 1, +i[3], +i[4], +i[5], +i[6], +i[7]) : void 0;
|
|
1849
2105
|
}
|
|
1850
|
-
const
|
|
1851
|
-
function
|
|
1852
|
-
const { roots: i } = e, t = e.revisions !== !1,
|
|
1853
|
-
let
|
|
1854
|
-
const l = (
|
|
1855
|
-
const c = i.find((
|
|
2106
|
+
const pi = (e, i) => F(oi(e), ".revisions", `${ai(e)}.${i}`), ui = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
|
|
2107
|
+
function Si(e) {
|
|
2108
|
+
const { roots: i } = e, t = e.revisions !== !1, o = e.now ?? (() => /* @__PURE__ */ new Date()), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
2109
|
+
let a = null;
|
|
2110
|
+
const l = (r) => {
|
|
2111
|
+
const c = i.find((v) => v.id === r);
|
|
1856
2112
|
if (!c)
|
|
1857
|
-
throw new Error(`Unknown workspace "${
|
|
2113
|
+
throw new Error(`Unknown workspace "${r}"`);
|
|
1858
2114
|
return c;
|
|
1859
|
-
},
|
|
1860
|
-
const c = l(
|
|
2115
|
+
}, y = (r) => {
|
|
2116
|
+
const c = l(r);
|
|
1861
2117
|
if (c.readOnly)
|
|
1862
2118
|
throw new Error(`Workspace "${c.label}" is read-only`);
|
|
1863
2119
|
return c;
|
|
1864
2120
|
};
|
|
1865
|
-
async function
|
|
1866
|
-
const
|
|
2121
|
+
async function p(r, c) {
|
|
2122
|
+
const v = await r.read(c);
|
|
1867
2123
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
2124
|
+
const $ = v ? z(v.text).value : void 0;
|
|
2125
|
+
return he($) ? $ : {};
|
|
1870
2126
|
} catch {
|
|
1871
2127
|
return {};
|
|
1872
2128
|
}
|
|
1873
2129
|
}
|
|
1874
|
-
function
|
|
1875
|
-
const
|
|
2130
|
+
function u(r, c, v, $, A) {
|
|
2131
|
+
const f = se($.packageName) ?? (c || r.id);
|
|
1876
2132
|
return {
|
|
1877
|
-
workspaceId:
|
|
1878
|
-
id:
|
|
1879
|
-
packageId:
|
|
1880
|
-
label:
|
|
1881
|
-
description:
|
|
1882
|
-
version:
|
|
2133
|
+
workspaceId: r.id,
|
|
2134
|
+
id: f,
|
|
2135
|
+
packageId: se($.category),
|
|
2136
|
+
label: se($.displayName) ?? f,
|
|
2137
|
+
description: se($.description),
|
|
2138
|
+
version: se($.version),
|
|
1883
2139
|
location: c,
|
|
1884
|
-
readOnly:
|
|
1885
|
-
files:
|
|
1886
|
-
search: `${c} ${
|
|
2140
|
+
readOnly: r.readOnly,
|
|
2141
|
+
files: A,
|
|
2142
|
+
search: `${c} ${v}`
|
|
1887
2143
|
};
|
|
1888
2144
|
}
|
|
1889
|
-
async function
|
|
1890
|
-
const c = /* @__PURE__ */ new Map(),
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
await
|
|
1898
|
-
|
|
2145
|
+
async function N(r) {
|
|
2146
|
+
const c = /* @__PURE__ */ new Map(), v = async ($) => {
|
|
2147
|
+
const A = await r.fs.list($), f = A.filter((k) => k.kind === "file" && k.name.toLowerCase().endsWith(".manifest.json")).map((k) => k.name).sort()[0];
|
|
2148
|
+
if (f) {
|
|
2149
|
+
const k = A.filter((D) => D.kind === "file").map((D) => D.name), M = u(
|
|
2150
|
+
r,
|
|
2151
|
+
$,
|
|
2152
|
+
f,
|
|
2153
|
+
await p(r.fs, F($, f)),
|
|
2154
|
+
k
|
|
1899
2155
|
);
|
|
1900
|
-
c.has(
|
|
2156
|
+
c.has(M.id.toLowerCase()) || (c.set(M.id.toLowerCase(), { ref: M, dir: $ }), s.set(`${r.id}:${M.id.toLowerCase()}`, $));
|
|
1901
2157
|
}
|
|
1902
|
-
for (const
|
|
1903
|
-
|
|
2158
|
+
for (const k of A)
|
|
2159
|
+
k.kind === "directory" && !we(k.name) && !($ === "" && k.name === L(r)) && await v(F($, k.name));
|
|
1904
2160
|
};
|
|
1905
|
-
return await
|
|
2161
|
+
return await v(""), c;
|
|
1906
2162
|
}
|
|
1907
|
-
const
|
|
1908
|
-
n.delete(
|
|
1909
|
-
},
|
|
1910
|
-
let c = n.get(
|
|
1911
|
-
return c || (c =
|
|
2163
|
+
const L = (r) => r.templatesDir === !1 ? void 0 : r.templatesDir ?? "Templates", I = (r) => {
|
|
2164
|
+
n.delete(r.id), h.clear();
|
|
2165
|
+
}, x = (r) => {
|
|
2166
|
+
let c = n.get(r.id);
|
|
2167
|
+
return c || (c = N(r), n.set(r.id, c), c.catch(() => n.delete(r.id))), c;
|
|
1912
2168
|
};
|
|
1913
|
-
async function
|
|
1914
|
-
const c = l(
|
|
1915
|
-
if (!
|
|
1916
|
-
throw new Error(`Module "${
|
|
1917
|
-
return { root: c, module:
|
|
2169
|
+
async function O(r) {
|
|
2170
|
+
const c = l(r.workspaceId), v = await x(c), $ = s.get(`${c.id}:${r.id.toLowerCase()}`), A = v.get(r.id.toLowerCase()) ?? ($ === void 0 ? void 0 : [...v.values()].find((f) => f.dir === $));
|
|
2171
|
+
if (!A)
|
|
2172
|
+
throw new Error(`Module "${r.id}" is not in "${c.label}"`);
|
|
2173
|
+
return { root: c, module: A };
|
|
1918
2174
|
}
|
|
1919
|
-
async function
|
|
1920
|
-
const
|
|
1921
|
-
const
|
|
1922
|
-
if (!(
|
|
1923
|
-
for (const
|
|
1924
|
-
|
|
2175
|
+
async function w(r, c) {
|
|
2176
|
+
const v = [], $ = async (A, f) => {
|
|
2177
|
+
const k = await r.list(F(c, A));
|
|
2178
|
+
if (!(f && k.some((M) => M.kind === "file" && M.name.toLowerCase().endsWith(".manifest.json"))))
|
|
2179
|
+
for (const M of k)
|
|
2180
|
+
M.kind === "file" ? v.push(F(A, M.name)) : we(M.name) || await $(F(A, M.name), !0);
|
|
1925
2181
|
};
|
|
1926
|
-
return await
|
|
2182
|
+
return await $("", !1), v.sort();
|
|
1927
2183
|
}
|
|
1928
|
-
async function
|
|
1929
|
-
t && await
|
|
2184
|
+
async function T(r, c, v, $) {
|
|
2185
|
+
t && await r.write(pi(c, $), v);
|
|
1930
2186
|
}
|
|
1931
|
-
async function
|
|
1932
|
-
const
|
|
1933
|
-
const
|
|
1934
|
-
for (const
|
|
1935
|
-
if (
|
|
1936
|
-
for (const
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1939
|
-
path: F(
|
|
1940
|
-
stamp:
|
|
1941
|
-
at: F(
|
|
2187
|
+
async function m(r, c) {
|
|
2188
|
+
const v = [], $ = async (A) => {
|
|
2189
|
+
const f = await r.list(F(c, A));
|
|
2190
|
+
for (const k of f)
|
|
2191
|
+
if (k.kind === "directory" && k.name === ".revisions")
|
|
2192
|
+
for (const M of await r.list(F(c, A, k.name))) {
|
|
2193
|
+
const D = /^(.*)\.(\d{8}T\d{9}Z)$/.exec(M.name);
|
|
2194
|
+
M.kind === "file" && D && v.push({
|
|
2195
|
+
path: F(A, D[1]),
|
|
2196
|
+
stamp: D[2],
|
|
2197
|
+
at: F(A, ".revisions", M.name)
|
|
1942
2198
|
});
|
|
1943
2199
|
}
|
|
1944
|
-
else
|
|
2200
|
+
else k.kind === "directory" && !we(k.name) && await $(F(A, k.name));
|
|
1945
2201
|
};
|
|
1946
|
-
return await
|
|
2202
|
+
return await $(""), v;
|
|
1947
2203
|
}
|
|
1948
|
-
async function
|
|
1949
|
-
const c =
|
|
1950
|
-
return c ? (await
|
|
2204
|
+
async function b(r) {
|
|
2205
|
+
const c = L(r);
|
|
2206
|
+
return c ? (await r.fs.list(c)).filter((v) => v.kind === "file" && li.test(v.name)).map((v) => F(c, v.name)).sort() : [];
|
|
1951
2207
|
}
|
|
1952
|
-
async function
|
|
1953
|
-
const
|
|
1954
|
-
if (!
|
|
2208
|
+
async function g(r, c) {
|
|
2209
|
+
const v = await r.fs.read(c);
|
|
2210
|
+
if (!v)
|
|
1955
2211
|
return { text: "", entries: [] };
|
|
1956
|
-
const
|
|
1957
|
-
return { text:
|
|
2212
|
+
const $ = z(v.text).value;
|
|
2213
|
+
return { text: v.text, entries: Array.isArray($) ? $ : [] };
|
|
1958
2214
|
}
|
|
1959
|
-
const
|
|
1960
|
-
arrayKey: (
|
|
2215
|
+
const E = {
|
|
2216
|
+
arrayKey: (r) => r === "" ? "slug" : r.endsWith("/modules") ? "packageName" : void 0
|
|
1961
2217
|
};
|
|
1962
|
-
async function C(
|
|
1963
|
-
if (
|
|
1964
|
-
await
|
|
2218
|
+
async function C(r, c, v, $) {
|
|
2219
|
+
if (v && await T(r.fs, c, v, ve(o())), $.length === 0) {
|
|
2220
|
+
await r.fs.remove(c);
|
|
1965
2221
|
return;
|
|
1966
2222
|
}
|
|
1967
|
-
await
|
|
2223
|
+
await r.fs.write(
|
|
1968
2224
|
c,
|
|
1969
|
-
|
|
2225
|
+
v ? qe(v, $, E) : le($)
|
|
1970
2226
|
);
|
|
1971
2227
|
}
|
|
1972
|
-
const
|
|
1973
|
-
function
|
|
1974
|
-
const
|
|
1975
|
-
let
|
|
1976
|
-
if (
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
var
|
|
2228
|
+
const h = /* @__PURE__ */ new Map();
|
|
2229
|
+
function S(r, c) {
|
|
2230
|
+
const v = `${r.id}:${c.dir}`;
|
|
2231
|
+
let $ = h.get(v);
|
|
2232
|
+
if (!$) {
|
|
2233
|
+
const A = (c.ref.files ?? []).filter((f) => /\.(manifest|entities)\.json$/i.test(f));
|
|
2234
|
+
$ = Promise.all(
|
|
2235
|
+
A.map(async (f) => {
|
|
2236
|
+
var k;
|
|
1981
2237
|
return {
|
|
1982
|
-
path:
|
|
1983
|
-
text: ((
|
|
2238
|
+
path: f,
|
|
2239
|
+
text: ((k = await r.fs.read(F(c.dir, f))) == null ? void 0 : k.text) ?? ""
|
|
1984
2240
|
};
|
|
1985
2241
|
})
|
|
1986
|
-
).then((
|
|
2242
|
+
).then((f) => ({ location: c.dir, group: c.dir.split("/")[0], files: f })), h.set(v, $);
|
|
1987
2243
|
}
|
|
1988
|
-
return
|
|
2244
|
+
return $;
|
|
1989
2245
|
}
|
|
1990
|
-
async function
|
|
2246
|
+
async function d(r) {
|
|
1991
2247
|
var c;
|
|
1992
|
-
return
|
|
2248
|
+
return a || await ((c = j.listTemplates) == null ? void 0 : c.call(j)), a == null ? void 0 : a.get(r.toLowerCase());
|
|
1993
2249
|
}
|
|
1994
|
-
const
|
|
2250
|
+
const j = {
|
|
1995
2251
|
invalidate() {
|
|
1996
|
-
n.clear(),
|
|
2252
|
+
n.clear(), h.clear(), a = null;
|
|
1997
2253
|
},
|
|
1998
2254
|
async listWorkspaces() {
|
|
1999
|
-
return i.map((
|
|
2000
|
-
id:
|
|
2001
|
-
label:
|
|
2002
|
-
...
|
|
2003
|
-
...
|
|
2004
|
-
...
|
|
2255
|
+
return i.map((r) => ({
|
|
2256
|
+
id: r.id,
|
|
2257
|
+
label: r.label,
|
|
2258
|
+
...r.description ? { description: r.description } : {},
|
|
2259
|
+
...r.icon ? { icon: r.icon } : {},
|
|
2260
|
+
...r.readOnly ? { readOnly: !0 } : {}
|
|
2005
2261
|
}));
|
|
2006
2262
|
},
|
|
2007
|
-
async listModules(
|
|
2008
|
-
const c = i.findIndex((
|
|
2009
|
-
|
|
2010
|
-
const
|
|
2011
|
-
i.slice(0, c).map(async (
|
|
2263
|
+
async listModules(r) {
|
|
2264
|
+
const c = i.findIndex((f) => f.id === r), v = l(r);
|
|
2265
|
+
I(v);
|
|
2266
|
+
const $ = await x(v), A = await Promise.all(
|
|
2267
|
+
i.slice(0, c).map(async (f) => ({ r: f, modules: await x(f) }))
|
|
2012
2268
|
);
|
|
2013
|
-
return [
|
|
2014
|
-
const
|
|
2015
|
-
return
|
|
2016
|
-
}).sort((
|
|
2269
|
+
return [...$.values()].map(({ ref: f }) => {
|
|
2270
|
+
const k = A.find((M) => M.modules.has(f.id.toLowerCase()));
|
|
2271
|
+
return k ? { ...f, shadowedBy: k.r.id } : f;
|
|
2272
|
+
}).sort((f, k) => f.id.localeCompare(k.id));
|
|
2017
2273
|
},
|
|
2018
|
-
async readModule(
|
|
2019
|
-
const { root: c, module:
|
|
2020
|
-
for (const
|
|
2021
|
-
const
|
|
2022
|
-
|
|
2023
|
-
path:
|
|
2024
|
-
text:
|
|
2025
|
-
version:
|
|
2274
|
+
async readModule(r) {
|
|
2275
|
+
const { root: c, module: v } = await O(r), $ = await w(c.fs, v.dir), A = [];
|
|
2276
|
+
for (const f of $) {
|
|
2277
|
+
const k = await c.fs.read(F(v.dir, f));
|
|
2278
|
+
k && A.push({
|
|
2279
|
+
path: f,
|
|
2280
|
+
text: k.text,
|
|
2281
|
+
version: k.version,
|
|
2026
2282
|
...c.readOnly ? { readOnly: !0 } : {}
|
|
2027
2283
|
});
|
|
2028
2284
|
}
|
|
2029
|
-
return
|
|
2285
|
+
return A;
|
|
2030
2286
|
},
|
|
2031
|
-
async writeModule(
|
|
2032
|
-
const { module:
|
|
2033
|
-
for (const
|
|
2034
|
-
if (
|
|
2035
|
-
throw new Error(`Refusing to write outside the module: ${
|
|
2036
|
-
const R = await
|
|
2037
|
-
|
|
2038
|
-
const
|
|
2039
|
-
(
|
|
2287
|
+
async writeModule(r, c) {
|
|
2288
|
+
const { module: v } = await O(r), $ = y(r.workspaceId), A = /* @__PURE__ */ new Map(), f = [];
|
|
2289
|
+
for (const D of c) {
|
|
2290
|
+
if (D.path.split("/").some((X) => X === ".." || X === "" || X.startsWith(".")))
|
|
2291
|
+
throw new Error(`Refusing to write outside the module: ${D.path}`);
|
|
2292
|
+
const R = await $.fs.read(F(v.dir, D.path));
|
|
2293
|
+
A.set(D.path, R);
|
|
2294
|
+
const H = D.baseVersion;
|
|
2295
|
+
(H === void 0 ? R !== null && D.type === "write" : (R == null ? void 0 : R.version) !== H) && f.push({ path: D.path, ...R ? { currentVersion: R.version } : {} });
|
|
2040
2296
|
}
|
|
2041
|
-
if (
|
|
2042
|
-
return { ok: !1, conflicts:
|
|
2043
|
-
const
|
|
2044
|
-
for (const
|
|
2045
|
-
const R = F(
|
|
2046
|
-
|
|
2297
|
+
if (f.length)
|
|
2298
|
+
return { ok: !1, conflicts: f };
|
|
2299
|
+
const k = ve(o()), M = {};
|
|
2300
|
+
for (const D of c) {
|
|
2301
|
+
const R = F(v.dir, D.path), H = A.get(D.path);
|
|
2302
|
+
H && await T($.fs, R, H.text, k), D.type === "write" ? M[D.path] = await $.fs.write(R, D.text) : await $.fs.remove(R);
|
|
2047
2303
|
}
|
|
2048
|
-
return
|
|
2304
|
+
return I($), { ok: !0, versions: M, revision: k };
|
|
2049
2305
|
},
|
|
2050
|
-
async createModule(
|
|
2051
|
-
var
|
|
2052
|
-
const c =
|
|
2053
|
-
P(
|
|
2054
|
-
P(
|
|
2306
|
+
async createModule(r) {
|
|
2307
|
+
var f;
|
|
2308
|
+
const c = y(r.workspaceId), v = r.id.startsWith(G) ? r.id.slice(G.length) : r.id.split(".").pop() ?? r.id, $ = ((f = e.moduleFolder) == null ? void 0 : f.call(e, r)) ?? F(
|
|
2309
|
+
P(r.packageId ?? "") || "Custom",
|
|
2310
|
+
P(v) || "Module"
|
|
2055
2311
|
);
|
|
2056
|
-
if ((await c.fs.list(
|
|
2057
|
-
throw new Error(`The folder ${
|
|
2058
|
-
if ((await
|
|
2059
|
-
throw new Error(`"${
|
|
2060
|
-
for (const
|
|
2061
|
-
await c.fs.write(F(
|
|
2062
|
-
|
|
2063
|
-
const
|
|
2064
|
-
if (!
|
|
2065
|
-
throw new Error(`The new module ${
|
|
2066
|
-
return
|
|
2312
|
+
if ((await c.fs.list($)).length > 0)
|
|
2313
|
+
throw new Error(`The folder ${$} is not empty`);
|
|
2314
|
+
if ((await x(c)).has(r.id.toLowerCase()))
|
|
2315
|
+
throw new Error(`"${r.id}" already exists in ${c.label}`);
|
|
2316
|
+
for (const k of r.files)
|
|
2317
|
+
await c.fs.write(F($, k.path), k.text);
|
|
2318
|
+
I(c);
|
|
2319
|
+
const A = (await x(c)).get(r.id.toLowerCase());
|
|
2320
|
+
if (!A)
|
|
2321
|
+
throw new Error(`The new module ${r.id} has no manifest naming it`);
|
|
2322
|
+
return A.ref;
|
|
2067
2323
|
},
|
|
2068
|
-
async deleteModule(
|
|
2069
|
-
const { module: c } = await
|
|
2070
|
-
await
|
|
2324
|
+
async deleteModule(r) {
|
|
2325
|
+
const { module: c } = await O(r), v = y(r.workspaceId);
|
|
2326
|
+
await v.fs.removeDir(c.dir), s.delete(`${v.id}:${r.id.toLowerCase()}`), I(v);
|
|
2071
2327
|
},
|
|
2072
2328
|
async listTemplates() {
|
|
2073
|
-
const
|
|
2074
|
-
for (const
|
|
2075
|
-
for (const
|
|
2076
|
-
let
|
|
2329
|
+
const r = /* @__PURE__ */ new Map(), c = [];
|
|
2330
|
+
for (const v of i)
|
|
2331
|
+
for (const $ of await b(v)) {
|
|
2332
|
+
let A;
|
|
2077
2333
|
try {
|
|
2078
|
-
|
|
2334
|
+
A = (await g(v, $)).entries;
|
|
2079
2335
|
} catch {
|
|
2080
2336
|
continue;
|
|
2081
2337
|
}
|
|
2082
|
-
for (const
|
|
2083
|
-
const
|
|
2084
|
-
|
|
2338
|
+
for (const f of A) {
|
|
2339
|
+
const k = ni(f, v.readOnly);
|
|
2340
|
+
k.id && !r.has(k.id.toLowerCase()) && (r.set(k.id.toLowerCase(), { rootId: v.id, path: $ }), c.push(k));
|
|
2085
2341
|
}
|
|
2086
2342
|
}
|
|
2087
|
-
return
|
|
2343
|
+
return a = r, c;
|
|
2088
2344
|
},
|
|
2089
|
-
async saveTemplate(
|
|
2090
|
-
const
|
|
2091
|
-
if (
|
|
2092
|
-
const
|
|
2093
|
-
(R) =>
|
|
2094
|
-
),
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
), await C(
|
|
2345
|
+
async saveTemplate(r, c) {
|
|
2346
|
+
const v = (c == null ? void 0 : c.previousId) ?? r.id, $ = await d(v);
|
|
2347
|
+
if ($) {
|
|
2348
|
+
const A = y($.rootId), { text: f, entries: k } = await g(A, $.path), M = k.findIndex(
|
|
2349
|
+
(R) => he(R) && String(R.slug ?? "").toLowerCase() === v.toLowerCase()
|
|
2350
|
+
), D = [...k];
|
|
2351
|
+
D[M < 0 ? D.length : M] = Me(
|
|
2352
|
+
r,
|
|
2353
|
+
M < 0 ? void 0 : k[M]
|
|
2354
|
+
), await C(A, $.path, f, D);
|
|
2099
2355
|
} else {
|
|
2100
|
-
const
|
|
2101
|
-
if (!
|
|
2356
|
+
const A = i.find((D) => !D.readOnly && L(D));
|
|
2357
|
+
if (!A)
|
|
2102
2358
|
throw new Error("No writable folder holds templates");
|
|
2103
|
-
const
|
|
2104
|
-
A
|
|
2105
|
-
`wizard-templates-${
|
|
2106
|
-
), { text:
|
|
2107
|
-
await C(
|
|
2359
|
+
const f = F(
|
|
2360
|
+
L(A),
|
|
2361
|
+
`wizard-templates-${ui(r.category ?? "custom")}.seed.json`
|
|
2362
|
+
), { text: k, entries: M } = await g(A, f);
|
|
2363
|
+
await C(A, f, k, [...M, Me(r)]);
|
|
2108
2364
|
}
|
|
2109
|
-
return
|
|
2365
|
+
return a = null, { ...r, extra: r.extra };
|
|
2110
2366
|
},
|
|
2111
|
-
async deleteTemplate(
|
|
2112
|
-
const c = await
|
|
2367
|
+
async deleteTemplate(r) {
|
|
2368
|
+
const c = await d(r);
|
|
2113
2369
|
if (!c)
|
|
2114
2370
|
return;
|
|
2115
|
-
const
|
|
2371
|
+
const v = y(c.rootId), { text: $, entries: A } = await g(v, c.path);
|
|
2116
2372
|
await C(
|
|
2117
|
-
|
|
2373
|
+
v,
|
|
2118
2374
|
c.path,
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
(
|
|
2375
|
+
$,
|
|
2376
|
+
A.filter(
|
|
2377
|
+
(f) => !(he(f) && String(f.slug ?? "").toLowerCase() === r.toLowerCase())
|
|
2122
2378
|
)
|
|
2123
|
-
),
|
|
2379
|
+
), a = null;
|
|
2124
2380
|
},
|
|
2125
|
-
async validate(
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2128
|
-
),
|
|
2129
|
-
return
|
|
2130
|
-
[...
|
|
2381
|
+
async validate(r, c) {
|
|
2382
|
+
const v = l(r.workspaceId), $ = [...(await x(v)).values()], A = await Promise.all(
|
|
2383
|
+
$.filter((M) => M.ref.id.toLowerCase() !== r.id.toLowerCase()).map((M) => S(v, M))
|
|
2384
|
+
), f = $.find((M) => M.ref.id.toLowerCase() === r.id.toLowerCase()), k = (f == null ? void 0 : f.dir) ?? r.id;
|
|
2385
|
+
return ti(
|
|
2386
|
+
[...A, { location: k, group: k.split("/")[0], files: c }],
|
|
2131
2387
|
{
|
|
2132
2388
|
knownDuplicates: e.knownDuplicates
|
|
2133
2389
|
}
|
|
2134
|
-
).filter((
|
|
2390
|
+
).filter((M) => M.message.split(/[ ,]+/).includes(k));
|
|
2135
2391
|
},
|
|
2136
|
-
async listRevisions(
|
|
2137
|
-
const { root:
|
|
2138
|
-
(
|
|
2139
|
-
),
|
|
2140
|
-
for (const
|
|
2141
|
-
|
|
2142
|
-
return [...
|
|
2143
|
-
id:
|
|
2144
|
-
timestamp:
|
|
2145
|
-
summary:
|
|
2392
|
+
async listRevisions(r, c) {
|
|
2393
|
+
const { root: v, module: $ } = await O(r), A = (await m(v.fs, $.dir)).filter(
|
|
2394
|
+
(k) => !c || k.path === c
|
|
2395
|
+
), f = /* @__PURE__ */ new Map();
|
|
2396
|
+
for (const k of A)
|
|
2397
|
+
f.set(k.stamp, [...f.get(k.stamp) ?? [], k.path]);
|
|
2398
|
+
return [...f].map(([k, M]) => ({
|
|
2399
|
+
id: k,
|
|
2400
|
+
timestamp: di(k) ?? 0,
|
|
2401
|
+
summary: M.sort().join(", "),
|
|
2146
2402
|
...c ? { path: c } : {}
|
|
2147
|
-
})).sort((
|
|
2403
|
+
})).sort((k, M) => M.timestamp - k.timestamp);
|
|
2148
2404
|
},
|
|
2149
|
-
async readRevision(
|
|
2150
|
-
var
|
|
2151
|
-
const { root:
|
|
2152
|
-
(
|
|
2405
|
+
async readRevision(r, c, v) {
|
|
2406
|
+
var M;
|
|
2407
|
+
const { root: $, module: A } = await O(r), f = (await m($.fs, A.dir)).filter(
|
|
2408
|
+
(D) => D.stamp === c && (!v || D.path === v)
|
|
2153
2409
|
);
|
|
2154
|
-
if (
|
|
2410
|
+
if (f.length === 0)
|
|
2155
2411
|
throw new Error(`Unknown revision "${c}"`);
|
|
2156
|
-
const
|
|
2157
|
-
for (const
|
|
2158
|
-
|
|
2159
|
-
return
|
|
2412
|
+
const k = {};
|
|
2413
|
+
for (const D of f)
|
|
2414
|
+
k[D.path] = ((M = await $.fs.read(F(A.dir, D.at))) == null ? void 0 : M.text) ?? "";
|
|
2415
|
+
return v ? k[v] : JSON.stringify(k, null, 2);
|
|
2160
2416
|
},
|
|
2161
|
-
async rollback(
|
|
2162
|
-
var
|
|
2163
|
-
const { module:
|
|
2164
|
-
(
|
|
2417
|
+
async rollback(r, c, v) {
|
|
2418
|
+
var M;
|
|
2419
|
+
const { module: $ } = await O(r), A = y(r.workspaceId), f = (await m(A.fs, $.dir)).filter(
|
|
2420
|
+
(D) => D.stamp === c && (!v || D.path === v)
|
|
2165
2421
|
);
|
|
2166
|
-
if (
|
|
2422
|
+
if (f.length === 0)
|
|
2167
2423
|
throw new Error(`Unknown revision "${c}"`);
|
|
2168
|
-
const
|
|
2169
|
-
for (const
|
|
2170
|
-
const R = F(
|
|
2171
|
-
|
|
2424
|
+
const k = ve(o());
|
|
2425
|
+
for (const D of f) {
|
|
2426
|
+
const R = F($.dir, D.path), H = ((M = await A.fs.read(F($.dir, D.at))) == null ? void 0 : M.text) ?? "", X = await A.fs.read(R);
|
|
2427
|
+
X && await T(A.fs, R, X.text, k), await A.fs.write(R, H);
|
|
2172
2428
|
}
|
|
2173
|
-
|
|
2429
|
+
I(A);
|
|
2174
2430
|
}
|
|
2175
2431
|
};
|
|
2176
|
-
return
|
|
2432
|
+
return j;
|
|
2177
2433
|
}
|
|
2178
|
-
class
|
|
2179
|
-
constructor(i, t,
|
|
2180
|
-
super(i), this.status = t, this.body =
|
|
2434
|
+
class be extends Error {
|
|
2435
|
+
constructor(i, t, o) {
|
|
2436
|
+
super(i), this.status = t, this.body = o, this.name = "OmniVerkRestError";
|
|
2181
2437
|
}
|
|
2182
2438
|
}
|
|
2183
|
-
const
|
|
2184
|
-
function
|
|
2439
|
+
const mi = new TextDecoder("utf-8", { ignoreBOM: !0 });
|
|
2440
|
+
function fi(e) {
|
|
2185
2441
|
const i = atob(e), t = new Uint8Array(i.length);
|
|
2186
|
-
for (let
|
|
2187
|
-
t[
|
|
2188
|
-
return
|
|
2442
|
+
for (let o = 0; o < i.length; o++)
|
|
2443
|
+
t[o] = i.charCodeAt(o);
|
|
2444
|
+
return mi.decode(t);
|
|
2189
2445
|
}
|
|
2190
|
-
function
|
|
2446
|
+
function Ke(e) {
|
|
2191
2447
|
const i = new TextEncoder().encode(e);
|
|
2192
2448
|
let t = "";
|
|
2193
|
-
for (let
|
|
2194
|
-
t += String.fromCharCode(...i.subarray(
|
|
2449
|
+
for (let o = 0; o < i.length; o += 32768)
|
|
2450
|
+
t += String.fromCharCode(...i.subarray(o, o + 32768));
|
|
2195
2451
|
return btoa(t);
|
|
2196
2452
|
}
|
|
2197
|
-
function
|
|
2453
|
+
function yi(e) {
|
|
2198
2454
|
let i = 2166136261;
|
|
2199
2455
|
for (let t = 0; t < e.length; t++)
|
|
2200
2456
|
i = Math.imul(i ^ e.charCodeAt(t), 16777619);
|
|
2201
2457
|
return `${e.length}:${(i >>> 0).toString(16)}`;
|
|
2202
2458
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((
|
|
2205
|
-
async function s(
|
|
2206
|
-
const
|
|
2207
|
-
method:
|
|
2459
|
+
function ki(e = {}) {
|
|
2460
|
+
const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((p, u) => globalThis.fetch(p, u)), o = e.language ?? "en", n = encodeURIComponent;
|
|
2461
|
+
async function s(p, u, N, L = "json") {
|
|
2462
|
+
const I = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, x = await t(`${i}${u}`, {
|
|
2463
|
+
method: p,
|
|
2208
2464
|
credentials: e.credentials ?? "same-origin",
|
|
2209
2465
|
headers: {
|
|
2210
|
-
Accept:
|
|
2211
|
-
...
|
|
2212
|
-
...
|
|
2466
|
+
Accept: L === "json" ? "application/json" : "text/plain, application/json",
|
|
2467
|
+
...N === void 0 ? {} : { "Content-Type": "application/json" },
|
|
2468
|
+
...I
|
|
2213
2469
|
},
|
|
2214
|
-
...
|
|
2215
|
-
}),
|
|
2216
|
-
let
|
|
2217
|
-
if (
|
|
2470
|
+
...N === void 0 ? {} : { body: JSON.stringify(N) }
|
|
2471
|
+
}), O = await x.text();
|
|
2472
|
+
let w = O;
|
|
2473
|
+
if (L === "json" || !x.ok)
|
|
2218
2474
|
try {
|
|
2219
|
-
|
|
2475
|
+
w = O ? JSON.parse(O) : void 0;
|
|
2220
2476
|
} catch {
|
|
2221
|
-
|
|
2477
|
+
w = O;
|
|
2222
2478
|
}
|
|
2223
|
-
if (!
|
|
2224
|
-
throw new
|
|
2225
|
-
`${
|
|
2226
|
-
|
|
2227
|
-
|
|
2479
|
+
if (!x.ok)
|
|
2480
|
+
throw new be(
|
|
2481
|
+
`${p} ${u}: ${x.status} ${x.statusText}`,
|
|
2482
|
+
x.status,
|
|
2483
|
+
w
|
|
2228
2484
|
);
|
|
2229
|
-
return
|
|
2485
|
+
return w;
|
|
2230
2486
|
}
|
|
2231
|
-
const
|
|
2487
|
+
const a = e.templates === !1 ? {} : {
|
|
2232
2488
|
async listTemplates() {
|
|
2233
|
-
const
|
|
2489
|
+
const p = await s(
|
|
2234
2490
|
"GET",
|
|
2235
|
-
`/module-templates?lang=${n(
|
|
2491
|
+
`/module-templates?lang=${n(o)}&hidden=true`
|
|
2236
2492
|
);
|
|
2237
2493
|
return (await Promise.all(
|
|
2238
|
-
(
|
|
2239
|
-
(
|
|
2494
|
+
(p ?? []).map(
|
|
2495
|
+
(N) => s(
|
|
2240
2496
|
"GET",
|
|
2241
|
-
`/module-templates/${n(
|
|
2497
|
+
`/module-templates/${n(N.slug)}?lang=${n(o)}`
|
|
2242
2498
|
)
|
|
2243
2499
|
)
|
|
2244
|
-
)).map((
|
|
2500
|
+
)).map((N) => De(N, o));
|
|
2245
2501
|
},
|
|
2246
|
-
async saveTemplate(
|
|
2247
|
-
const
|
|
2248
|
-
let
|
|
2249
|
-
if ((
|
|
2250
|
-
|
|
2502
|
+
async saveTemplate(p, u) {
|
|
2503
|
+
const N = (u == null ? void 0 : u.previousId) ?? p.id, L = si(p);
|
|
2504
|
+
let I;
|
|
2505
|
+
if ((u == null ? void 0 : u.previousId) === void 0)
|
|
2506
|
+
I = await s(
|
|
2251
2507
|
"GET",
|
|
2252
|
-
`/module-templates/${n(
|
|
2508
|
+
`/module-templates/${n(p.id)}?lang=${n(o)}`
|
|
2253
2509
|
).then(
|
|
2254
2510
|
() => !0,
|
|
2255
|
-
(
|
|
2511
|
+
(O) => O instanceof be && O.status === 404 ? !1 : Promise.reject(O)
|
|
2256
2512
|
) ? await s(
|
|
2257
2513
|
"PUT",
|
|
2258
|
-
`/module-templates/${n(
|
|
2259
|
-
|
|
2260
|
-
) : await s("POST", `/module-templates?lang=${n(
|
|
2514
|
+
`/module-templates/${n(p.id)}?lang=${n(o)}`,
|
|
2515
|
+
L
|
|
2516
|
+
) : await s("POST", `/module-templates?lang=${n(o)}`, L);
|
|
2261
2517
|
else {
|
|
2262
|
-
if (
|
|
2518
|
+
if (N !== p.id)
|
|
2263
2519
|
throw new Error(
|
|
2264
2520
|
"The OmniVerk API keeps a template's slug: save it as a new template instead."
|
|
2265
2521
|
);
|
|
2266
|
-
|
|
2522
|
+
I = await s(
|
|
2267
2523
|
"PUT",
|
|
2268
|
-
`/module-templates/${n(
|
|
2269
|
-
|
|
2524
|
+
`/module-templates/${n(N)}?lang=${n(o)}`,
|
|
2525
|
+
L
|
|
2270
2526
|
);
|
|
2271
2527
|
}
|
|
2272
|
-
return
|
|
2528
|
+
return De(I, o);
|
|
2273
2529
|
},
|
|
2274
|
-
async deleteTemplate(
|
|
2275
|
-
await s("DELETE", `/module-templates/${n(
|
|
2530
|
+
async deleteTemplate(p) {
|
|
2531
|
+
await s("DELETE", `/module-templates/${n(p)}`);
|
|
2276
2532
|
}
|
|
2277
2533
|
};
|
|
2278
2534
|
if ((e.mode ?? "manifest-only") === "manifest-only") {
|
|
2279
|
-
const
|
|
2280
|
-
var
|
|
2281
|
-
return ((
|
|
2282
|
-
},
|
|
2283
|
-
const
|
|
2284
|
-
return { path:
|
|
2535
|
+
const p = "seed", u = /* @__PURE__ */ new Map(), N = (I) => {
|
|
2536
|
+
var x, O;
|
|
2537
|
+
return ((x = u.get(I)) == null ? void 0 : x.manifestFile) ?? `${(O = I.split(".").pop()) == null ? void 0 : O.toLowerCase()}.manifest.json`;
|
|
2538
|
+
}, L = async (I) => {
|
|
2539
|
+
const x = await s("GET", `/module-manifests/${n(I)}`), O = le(x, { finalNewline: !1 });
|
|
2540
|
+
return { path: N(I), text: O, version: yi(O) };
|
|
2285
2541
|
};
|
|
2286
2542
|
return {
|
|
2287
2543
|
async listWorkspaces() {
|
|
2288
|
-
return [{ id:
|
|
2544
|
+
return [{ id: p, label: e.workspaceLabel ?? "Seed/Modules" }];
|
|
2289
2545
|
},
|
|
2290
2546
|
async listModules() {
|
|
2291
|
-
const
|
|
2292
|
-
return
|
|
2293
|
-
workspaceId:
|
|
2294
|
-
id:
|
|
2547
|
+
const I = await s("GET", "/module-manifests");
|
|
2548
|
+
return u.clear(), (I ?? []).map((x) => (u.set(x.packageName, x), {
|
|
2549
|
+
workspaceId: p,
|
|
2550
|
+
id: x.packageName,
|
|
2295
2551
|
// the package is the manifest's category, as in the `files` mode and OmniVerk's own
|
|
2296
2552
|
// trees (1.3.14); the first folder only while the API does not list the category
|
|
2297
|
-
packageId:
|
|
2298
|
-
label:
|
|
2299
|
-
location:
|
|
2300
|
-
files: [
|
|
2301
|
-
search:
|
|
2553
|
+
packageId: x.category || x.path.split("/")[0] || void 0,
|
|
2554
|
+
label: x.packageName,
|
|
2555
|
+
location: x.path,
|
|
2556
|
+
files: [x.manifestFile],
|
|
2557
|
+
search: x.path,
|
|
2302
2558
|
// only the manifest: the checks and the preview do not count what is not given
|
|
2303
2559
|
contents: "manifest"
|
|
2304
2560
|
}));
|
|
2305
2561
|
},
|
|
2306
|
-
async readModule(
|
|
2307
|
-
return [await
|
|
2562
|
+
async readModule(I) {
|
|
2563
|
+
return [await L(I.id)];
|
|
2308
2564
|
},
|
|
2309
|
-
async writeModule(
|
|
2310
|
-
const
|
|
2311
|
-
if (
|
|
2565
|
+
async writeModule(I, x) {
|
|
2566
|
+
const O = N(I.id), w = x.find((E) => E.path !== O || E.type !== "write");
|
|
2567
|
+
if (w)
|
|
2312
2568
|
throw new Error(
|
|
2313
|
-
`This OmniVerk API stores only the manifest; "${
|
|
2569
|
+
`This OmniVerk API stores only the manifest; "${w.path}" was not saved.`
|
|
2314
2570
|
);
|
|
2315
|
-
const
|
|
2316
|
-
if (!
|
|
2571
|
+
const T = x[0];
|
|
2572
|
+
if (!T || T.type !== "write")
|
|
2317
2573
|
return { ok: !0, versions: {} };
|
|
2318
|
-
const
|
|
2319
|
-
if (
|
|
2320
|
-
return { ok: !1, conflicts: [{ path:
|
|
2321
|
-
const
|
|
2574
|
+
const m = await L(I.id);
|
|
2575
|
+
if (T.baseVersion !== void 0 && T.baseVersion !== m.version)
|
|
2576
|
+
return { ok: !1, conflicts: [{ path: O, currentVersion: m.version }] };
|
|
2577
|
+
const b = await s(
|
|
2322
2578
|
"PUT",
|
|
2323
|
-
`/module-manifests/${n(
|
|
2579
|
+
`/module-manifests/${n(I.id)}`,
|
|
2324
2580
|
{
|
|
2325
|
-
manifest:
|
|
2581
|
+
manifest: z(T.text).value
|
|
2326
2582
|
}
|
|
2327
|
-
),
|
|
2583
|
+
), g = await L(I.id);
|
|
2328
2584
|
return {
|
|
2329
2585
|
ok: !0,
|
|
2330
|
-
versions: { [
|
|
2331
|
-
...
|
|
2586
|
+
versions: { [O]: g.version },
|
|
2587
|
+
...b != null && b.revision ? { revision: b.revision } : {}
|
|
2332
2588
|
};
|
|
2333
2589
|
},
|
|
2334
|
-
async listRevisions(
|
|
2590
|
+
async listRevisions(I) {
|
|
2335
2591
|
return (await s(
|
|
2336
2592
|
"GET",
|
|
2337
|
-
`/module-manifests/${n(
|
|
2338
|
-
) ?? []).map((
|
|
2339
|
-
id:
|
|
2340
|
-
timestamp: Date.parse(
|
|
2341
|
-
path:
|
|
2342
|
-
...
|
|
2593
|
+
`/module-manifests/${n(I.id)}/revisions`
|
|
2594
|
+
) ?? []).map((O) => ({
|
|
2595
|
+
id: O.id,
|
|
2596
|
+
timestamp: Date.parse(O.at) || 0,
|
|
2597
|
+
path: N(I.id),
|
|
2598
|
+
...O.sizeBytes !== void 0 ? { summary: `${O.sizeBytes} B` } : {}
|
|
2343
2599
|
}));
|
|
2344
2600
|
},
|
|
2345
|
-
async readRevision(
|
|
2601
|
+
async readRevision(I, x) {
|
|
2346
2602
|
return s(
|
|
2347
2603
|
"GET",
|
|
2348
|
-
`/module-manifests/${n(
|
|
2604
|
+
`/module-manifests/${n(I.id)}/revisions/${n(x)}`,
|
|
2349
2605
|
void 0,
|
|
2350
2606
|
"text"
|
|
2351
2607
|
);
|
|
2352
2608
|
},
|
|
2353
|
-
async rollback(
|
|
2609
|
+
async rollback(I, x) {
|
|
2354
2610
|
await s(
|
|
2355
2611
|
"POST",
|
|
2356
|
-
`/module-manifests/${n(
|
|
2612
|
+
`/module-manifests/${n(I.id)}/revisions/${n(x)}/rollback`
|
|
2357
2613
|
);
|
|
2358
2614
|
},
|
|
2359
|
-
...
|
|
2615
|
+
...a
|
|
2360
2616
|
};
|
|
2361
2617
|
}
|
|
2362
|
-
const l = (
|
|
2618
|
+
const l = (p) => `/module-files/${n(p.workspaceId)}/modules/${n(p.id)}`, y = (p) => p.map((u) => ({ path: u.path, content: Ke(u.text) }));
|
|
2363
2619
|
return {
|
|
2364
2620
|
async listWorkspaces() {
|
|
2365
2621
|
return s("GET", "/module-files/workspaces");
|
|
2366
2622
|
},
|
|
2367
|
-
async listModules(
|
|
2623
|
+
async listModules(p) {
|
|
2368
2624
|
return (await s(
|
|
2369
2625
|
"GET",
|
|
2370
|
-
`/module-files/${n(
|
|
2371
|
-
) ?? []).map((
|
|
2626
|
+
`/module-files/${n(p)}/modules`
|
|
2627
|
+
) ?? []).map((N) => ({ ...N, workspaceId: p }));
|
|
2372
2628
|
},
|
|
2373
|
-
async readModule(
|
|
2374
|
-
const
|
|
2375
|
-
return ((
|
|
2376
|
-
path:
|
|
2377
|
-
text:
|
|
2378
|
-
...
|
|
2379
|
-
...
|
|
2629
|
+
async readModule(p) {
|
|
2630
|
+
const u = await s("GET", l(p));
|
|
2631
|
+
return ((u == null ? void 0 : u.files) ?? []).map((N) => ({
|
|
2632
|
+
path: N.path,
|
|
2633
|
+
text: fi(N.content),
|
|
2634
|
+
...N.version ? { version: N.version } : {},
|
|
2635
|
+
...N.readOnly ? { readOnly: !0 } : {}
|
|
2380
2636
|
}));
|
|
2381
2637
|
},
|
|
2382
|
-
async writeModule(
|
|
2383
|
-
var
|
|
2638
|
+
async writeModule(p, u) {
|
|
2639
|
+
var N;
|
|
2384
2640
|
try {
|
|
2385
|
-
const
|
|
2641
|
+
const L = await s(
|
|
2386
2642
|
"PUT",
|
|
2387
|
-
l(
|
|
2643
|
+
l(p),
|
|
2388
2644
|
{
|
|
2389
|
-
changes:
|
|
2390
|
-
(
|
|
2645
|
+
changes: u.map(
|
|
2646
|
+
(I) => I.type === "write" ? {
|
|
2391
2647
|
type: "write",
|
|
2392
|
-
path:
|
|
2393
|
-
content:
|
|
2394
|
-
baseVersion:
|
|
2395
|
-
} : { type: "delete", path:
|
|
2648
|
+
path: I.path,
|
|
2649
|
+
content: Ke(I.text),
|
|
2650
|
+
baseVersion: I.baseVersion
|
|
2651
|
+
} : { type: "delete", path: I.path, baseVersion: I.baseVersion }
|
|
2396
2652
|
)
|
|
2397
2653
|
}
|
|
2398
2654
|
);
|
|
2399
2655
|
return {
|
|
2400
2656
|
ok: !0,
|
|
2401
|
-
versions:
|
|
2402
|
-
...
|
|
2657
|
+
versions: L == null ? void 0 : L.versions,
|
|
2658
|
+
...L != null && L.revision ? { revision: L.revision } : {}
|
|
2403
2659
|
};
|
|
2404
|
-
} catch (
|
|
2405
|
-
if (
|
|
2406
|
-
return { ok: !1, conflicts: ((
|
|
2407
|
-
throw
|
|
2660
|
+
} catch (L) {
|
|
2661
|
+
if (L instanceof be && L.status === 409)
|
|
2662
|
+
return { ok: !1, conflicts: ((N = L.body) == null ? void 0 : N.conflicts) ?? u.map((x) => ({ path: x.path })) };
|
|
2663
|
+
throw L;
|
|
2408
2664
|
}
|
|
2409
2665
|
},
|
|
2410
|
-
async createModule(
|
|
2666
|
+
async createModule(p) {
|
|
2411
2667
|
return { ...await s(
|
|
2412
2668
|
"POST",
|
|
2413
|
-
`/module-files/${n(
|
|
2669
|
+
`/module-files/${n(p.workspaceId)}/modules`,
|
|
2414
2670
|
{
|
|
2415
|
-
packageId:
|
|
2416
|
-
id:
|
|
2417
|
-
files:
|
|
2671
|
+
packageId: p.packageId,
|
|
2672
|
+
id: p.id,
|
|
2673
|
+
files: y(p.files)
|
|
2418
2674
|
}
|
|
2419
|
-
), workspaceId:
|
|
2675
|
+
), workspaceId: p.workspaceId };
|
|
2420
2676
|
},
|
|
2421
|
-
async deleteModule(
|
|
2422
|
-
await s("DELETE", l(
|
|
2677
|
+
async deleteModule(p) {
|
|
2678
|
+
await s("DELETE", l(p));
|
|
2423
2679
|
},
|
|
2424
|
-
async listRevisions(
|
|
2680
|
+
async listRevisions(p, u) {
|
|
2425
2681
|
return s(
|
|
2426
2682
|
"GET",
|
|
2427
|
-
`${l(
|
|
2683
|
+
`${l(p)}/revisions${u ? `?path=${n(u)}` : ""}`
|
|
2428
2684
|
);
|
|
2429
2685
|
},
|
|
2430
|
-
async readRevision(
|
|
2686
|
+
async readRevision(p, u, N) {
|
|
2431
2687
|
return s(
|
|
2432
2688
|
"GET",
|
|
2433
|
-
`${l(
|
|
2689
|
+
`${l(p)}/revisions/${n(u)}${N ? `?path=${n(N)}` : ""}`,
|
|
2434
2690
|
void 0,
|
|
2435
2691
|
"text"
|
|
2436
2692
|
);
|
|
2437
2693
|
},
|
|
2438
|
-
async rollback(
|
|
2694
|
+
async rollback(p, u, N) {
|
|
2439
2695
|
await s(
|
|
2440
2696
|
"POST",
|
|
2441
|
-
`${l(
|
|
2697
|
+
`${l(p)}/revisions/${n(u)}/rollback${N ? `?path=${n(N)}` : ""}`
|
|
2442
2698
|
);
|
|
2443
2699
|
},
|
|
2444
2700
|
...e.serverValidation ? {
|
|
2445
|
-
async validate(
|
|
2446
|
-
return s("POST", `${l(
|
|
2447
|
-
files:
|
|
2701
|
+
async validate(p, u) {
|
|
2702
|
+
return s("POST", `${l(p)}/validate`, {
|
|
2703
|
+
files: y(u)
|
|
2448
2704
|
});
|
|
2449
2705
|
}
|
|
2450
2706
|
} : {},
|
|
2451
|
-
...
|
|
2707
|
+
...a
|
|
2452
2708
|
};
|
|
2453
2709
|
}
|
|
2454
|
-
const
|
|
2710
|
+
const gi = [
|
|
2455
2711
|
"en",
|
|
2456
2712
|
"pl",
|
|
2457
2713
|
"de",
|
|
@@ -2466,13 +2722,13 @@ const ni = [
|
|
|
2466
2722
|
"ja",
|
|
2467
2723
|
"ko",
|
|
2468
2724
|
"zh-CN"
|
|
2469
|
-
],
|
|
2725
|
+
], Te = (e) => {
|
|
2470
2726
|
const i = e.find(
|
|
2471
2727
|
(t) => !t.path.includes("/") && t.path.toLowerCase().endsWith(".manifest.json")
|
|
2472
2728
|
);
|
|
2473
2729
|
if (i)
|
|
2474
2730
|
try {
|
|
2475
|
-
const t =
|
|
2731
|
+
const t = z(i.text).value;
|
|
2476
2732
|
return {
|
|
2477
2733
|
path: i.path,
|
|
2478
2734
|
value: typeof t == "object" && t !== null ? t : {}
|
|
@@ -2480,12 +2736,12 @@ const ni = [
|
|
|
2480
2736
|
} catch {
|
|
2481
2737
|
return { path: i.path, value: {} };
|
|
2482
2738
|
}
|
|
2483
|
-
},
|
|
2739
|
+
}, hi = (e) => {
|
|
2484
2740
|
var i;
|
|
2485
|
-
return ((i =
|
|
2741
|
+
return ((i = Te(e)) == null ? void 0 : i.path.replace(/\.manifest\.json$/i, "")) ?? "module";
|
|
2486
2742
|
};
|
|
2487
|
-
function
|
|
2488
|
-
const i = e.t ?? ((s,
|
|
2743
|
+
function Ni(e = {}) {
|
|
2744
|
+
const i = e.t ?? ((s, a) => a), t = (s, a) => i(`devStudio.omniverk.${s}`, a), o = {
|
|
2489
2745
|
type: "object",
|
|
2490
2746
|
properties: {
|
|
2491
2747
|
name: { type: "string", title: t("field.name", "Name") },
|
|
@@ -2493,7 +2749,7 @@ function li(e = {}) {
|
|
|
2493
2749
|
dataType: {
|
|
2494
2750
|
type: "string",
|
|
2495
2751
|
title: t("field.dataType", "Data type"),
|
|
2496
|
-
enum: [...
|
|
2752
|
+
enum: [...Et]
|
|
2497
2753
|
},
|
|
2498
2754
|
maxLength: { type: "integer", title: t("field.maxLength", "Max length") },
|
|
2499
2755
|
isRequired: { type: "boolean", title: t("field.isRequired", "Required") },
|
|
@@ -2524,25 +2780,25 @@ function li(e = {}) {
|
|
|
2524
2780
|
};
|
|
2525
2781
|
return {
|
|
2526
2782
|
id: "omniverk",
|
|
2527
|
-
kinds:
|
|
2528
|
-
manifestSections:
|
|
2529
|
-
entities: { entityMetaSchema: n, fieldSchema:
|
|
2530
|
-
locales: e.locales ??
|
|
2783
|
+
kinds: jt,
|
|
2784
|
+
manifestSections: Bt(i, { scripting: e.scripting }),
|
|
2785
|
+
entities: { entityMetaSchema: n, fieldSchema: o },
|
|
2786
|
+
locales: e.locales ?? gi,
|
|
2531
2787
|
requiredLocales: ["en", "pl"],
|
|
2532
2788
|
moduleId: (s) => {
|
|
2533
2789
|
var l;
|
|
2534
|
-
const
|
|
2535
|
-
return typeof
|
|
2790
|
+
const a = (l = Te(s)) == null ? void 0 : l.value.packageName;
|
|
2791
|
+
return typeof a == "string" && a ? a : void 0;
|
|
2536
2792
|
},
|
|
2537
|
-
validateModule: (s) =>
|
|
2538
|
-
generateModule: async (s, { existingIds:
|
|
2539
|
-
const l = await
|
|
2793
|
+
validateModule: (s) => ei(s),
|
|
2794
|
+
generateModule: async (s, { existingIds: a }) => {
|
|
2795
|
+
const l = await Kt(
|
|
2540
2796
|
{
|
|
2541
|
-
...
|
|
2797
|
+
...Ft(s),
|
|
2542
2798
|
iconConfig: e.iconConfig,
|
|
2543
2799
|
ownerTenantId: e.ownerTenantId
|
|
2544
2800
|
},
|
|
2545
|
-
{ existingPackageNames:
|
|
2801
|
+
{ existingPackageNames: a }
|
|
2546
2802
|
);
|
|
2547
2803
|
if (!l.package)
|
|
2548
2804
|
throw new Error(l.problems.join(`
|
|
@@ -2553,7 +2809,7 @@ function li(e = {}) {
|
|
|
2553
2809
|
files: l.package.files
|
|
2554
2810
|
};
|
|
2555
2811
|
},
|
|
2556
|
-
duplicateModule: (s,
|
|
2812
|
+
duplicateModule: (s, a) => Rt(s, a),
|
|
2557
2813
|
scripts: {
|
|
2558
2814
|
categories: [
|
|
2559
2815
|
"calculation",
|
|
@@ -2566,35 +2822,53 @@ function li(e = {}) {
|
|
|
2566
2822
|
],
|
|
2567
2823
|
phases: ["preInstall", "postInstall", "preUninstall", "postUninstall", "migrations"]
|
|
2568
2824
|
},
|
|
2569
|
-
newFile: (s, { files:
|
|
2570
|
-
var
|
|
2571
|
-
const l =
|
|
2825
|
+
newFile: (s, { files: a }) => {
|
|
2826
|
+
var L;
|
|
2827
|
+
const l = hi(a), y = ((L = Te(a)) == null ? void 0 : L.value) ?? {};
|
|
2572
2828
|
if (s === "scripts") {
|
|
2573
|
-
let
|
|
2574
|
-
for (let
|
|
2575
|
-
|
|
2576
|
-
const
|
|
2577
|
-
moduleName: String(
|
|
2829
|
+
let I = `${l}.scripts.json`;
|
|
2830
|
+
for (let O = 2; a.some((w) => w.path === I); O++)
|
|
2831
|
+
I = `${l}.${O}.scripts.json`;
|
|
2832
|
+
const x = {
|
|
2833
|
+
moduleName: String(y.packageName ?? l),
|
|
2578
2834
|
version: "1.0.0",
|
|
2579
2835
|
scripts: []
|
|
2580
2836
|
};
|
|
2581
|
-
return { path:
|
|
2837
|
+
return { path: I, text: le(x) };
|
|
2582
2838
|
}
|
|
2583
|
-
const
|
|
2584
|
-
entities: ["entities.json", { moduleName:
|
|
2585
|
-
views: ["views.json", { moduleName:
|
|
2586
|
-
workflows: ["workflows.json", { moduleName:
|
|
2839
|
+
const p = `${String(y.packageName ?? l)}.Core`, N = {
|
|
2840
|
+
entities: ["entities.json", { moduleName: p, version: "1.0.0", entities: [] }],
|
|
2841
|
+
views: ["views.json", { moduleName: p, version: "1.0.0", views: [] }],
|
|
2842
|
+
workflows: ["workflows.json", { moduleName: p, version: "1.0.0", workflows: [] }],
|
|
2587
2843
|
permissions: [
|
|
2588
2844
|
"permissions.json",
|
|
2589
|
-
{ moduleName:
|
|
2845
|
+
{ moduleName: p, version: "1.0.0", permissions: [], permissionGroups: [] }
|
|
2590
2846
|
],
|
|
2591
|
-
seeds: ["seeds.json", { moduleName:
|
|
2847
|
+
seeds: ["seeds.json", { moduleName: p, version: "1.0.0", seeds: {} }],
|
|
2592
2848
|
dataSources: [
|
|
2593
2849
|
"datasources.json",
|
|
2594
|
-
{ moduleName: String(
|
|
2850
|
+
{ moduleName: String(y.packageName ?? l), version: "1.0.0", dataSources: [] }
|
|
2851
|
+
],
|
|
2852
|
+
// 1.4.12: the variables start from what the manifest's wizard fields and env vars declare
|
|
2853
|
+
integrations: [
|
|
2854
|
+
"integrations.json",
|
|
2855
|
+
{
|
|
2856
|
+
moduleName: String(y.packageName ?? l),
|
|
2857
|
+
version: "1.0.0",
|
|
2858
|
+
integrations: []
|
|
2859
|
+
}
|
|
2860
|
+
],
|
|
2861
|
+
environments: [
|
|
2862
|
+
"environments.json",
|
|
2863
|
+
{
|
|
2864
|
+
moduleName: String(y.packageName ?? l),
|
|
2865
|
+
version: "1.0.0",
|
|
2866
|
+
variables: Vt(y),
|
|
2867
|
+
sets: [{ id: "default", name: "Default", values: {} }]
|
|
2868
|
+
}
|
|
2595
2869
|
]
|
|
2596
2870
|
}[s];
|
|
2597
|
-
return
|
|
2871
|
+
return N ? { path: `${l}.${N[0]}`, text: le(N[1]) } : void 0;
|
|
2598
2872
|
},
|
|
2599
2873
|
templateSchema: {
|
|
2600
2874
|
type: "object",
|
|
@@ -2618,50 +2892,50 @@ function li(e = {}) {
|
|
|
2618
2892
|
}
|
|
2619
2893
|
};
|
|
2620
2894
|
}
|
|
2621
|
-
function
|
|
2895
|
+
function ji(e = {}) {
|
|
2622
2896
|
let i = 0;
|
|
2623
2897
|
const t = /* @__PURE__ */ new Map();
|
|
2624
2898
|
for (const [n, s] of Object.entries(e))
|
|
2625
2899
|
t.set(n, { text: s, version: String(++i) });
|
|
2626
|
-
const
|
|
2900
|
+
const o = (n) => n ? `${n}/` : "";
|
|
2627
2901
|
return {
|
|
2628
2902
|
async list(n) {
|
|
2629
|
-
const s =
|
|
2903
|
+
const s = o(n), a = /* @__PURE__ */ new Map();
|
|
2630
2904
|
for (const l of t.keys()) {
|
|
2631
2905
|
if (!l.startsWith(s))
|
|
2632
2906
|
continue;
|
|
2633
|
-
const
|
|
2634
|
-
|
|
2907
|
+
const y = l.slice(s.length), p = y.indexOf("/");
|
|
2908
|
+
a.set(p < 0 ? y : y.slice(0, p), p < 0 ? "file" : "directory");
|
|
2635
2909
|
}
|
|
2636
|
-
return [...
|
|
2910
|
+
return [...a].map(([l, y]) => ({ name: l, kind: y }));
|
|
2637
2911
|
},
|
|
2638
2912
|
async read(n) {
|
|
2639
2913
|
const s = t.get(n);
|
|
2640
2914
|
return s ? { ...s } : null;
|
|
2641
2915
|
},
|
|
2642
2916
|
async write(n, s) {
|
|
2643
|
-
const
|
|
2644
|
-
return t.set(n, { text: s, version:
|
|
2917
|
+
const a = String(++i);
|
|
2918
|
+
return t.set(n, { text: s, version: a }), a;
|
|
2645
2919
|
},
|
|
2646
2920
|
async remove(n) {
|
|
2647
2921
|
t.delete(n);
|
|
2648
2922
|
},
|
|
2649
2923
|
async removeDir(n) {
|
|
2650
|
-
const s =
|
|
2651
|
-
for (const
|
|
2652
|
-
|
|
2924
|
+
const s = o(n);
|
|
2925
|
+
for (const a of [...t.keys()])
|
|
2926
|
+
a.startsWith(s) && t.delete(a);
|
|
2653
2927
|
},
|
|
2654
2928
|
snapshot() {
|
|
2655
2929
|
return Object.fromEntries([...t].map(([n, s]) => [n, s.text]));
|
|
2656
2930
|
}
|
|
2657
2931
|
};
|
|
2658
2932
|
}
|
|
2659
|
-
const
|
|
2660
|
-
function
|
|
2661
|
-
return typeof
|
|
2933
|
+
const Qe = () => typeof window > "u" ? void 0 : window.showDirectoryPicker;
|
|
2934
|
+
function Ti() {
|
|
2935
|
+
return typeof Qe() == "function";
|
|
2662
2936
|
}
|
|
2663
|
-
async function
|
|
2664
|
-
const i =
|
|
2937
|
+
async function Ei(e = {}) {
|
|
2938
|
+
const i = Qe();
|
|
2665
2939
|
if (!i)
|
|
2666
2940
|
throw new Error("This browser cannot open folders (File System Access API).");
|
|
2667
2941
|
return i({
|
|
@@ -2669,121 +2943,127 @@ async function pi(e = {}) {
|
|
|
2669
2943
|
...e.id ? { id: e.id } : {}
|
|
2670
2944
|
});
|
|
2671
2945
|
}
|
|
2672
|
-
const
|
|
2673
|
-
function
|
|
2946
|
+
const pe = (e) => typeof e == "object" && e !== null && (e.name === "NotFoundError" || e.name === "TypeMismatchError");
|
|
2947
|
+
function Ii(e) {
|
|
2674
2948
|
const i = new TextDecoder("utf-8", { ignoreBOM: !0 });
|
|
2675
|
-
async function t(
|
|
2676
|
-
let
|
|
2677
|
-
for (const
|
|
2949
|
+
async function t(a, l = !1) {
|
|
2950
|
+
let y = e;
|
|
2951
|
+
for (const p of a.split("/").filter(Boolean))
|
|
2678
2952
|
try {
|
|
2679
|
-
|
|
2680
|
-
} catch (
|
|
2681
|
-
if (
|
|
2953
|
+
y = await y.getDirectoryHandle(p, { create: l });
|
|
2954
|
+
} catch (u) {
|
|
2955
|
+
if (pe(u))
|
|
2682
2956
|
return null;
|
|
2683
|
-
throw
|
|
2957
|
+
throw u;
|
|
2684
2958
|
}
|
|
2685
|
-
return
|
|
2959
|
+
return y;
|
|
2686
2960
|
}
|
|
2687
|
-
const
|
|
2688
|
-
const l =
|
|
2689
|
-
return l < 0 ? ["",
|
|
2961
|
+
const o = (a) => {
|
|
2962
|
+
const l = a.lastIndexOf("/");
|
|
2963
|
+
return l < 0 ? ["", a] : [a.slice(0, l), a.slice(l + 1)];
|
|
2690
2964
|
};
|
|
2691
|
-
async function n(
|
|
2692
|
-
const [
|
|
2693
|
-
if (!
|
|
2965
|
+
async function n(a, l = !1) {
|
|
2966
|
+
const [y, p] = o(a), u = await t(y, l);
|
|
2967
|
+
if (!u)
|
|
2694
2968
|
return null;
|
|
2695
2969
|
try {
|
|
2696
|
-
return await
|
|
2697
|
-
} catch (
|
|
2698
|
-
if (
|
|
2970
|
+
return await u.getFileHandle(p, { create: l });
|
|
2971
|
+
} catch (N) {
|
|
2972
|
+
if (pe(N))
|
|
2699
2973
|
return null;
|
|
2700
|
-
throw
|
|
2974
|
+
throw N;
|
|
2701
2975
|
}
|
|
2702
2976
|
}
|
|
2703
|
-
const s = (
|
|
2977
|
+
const s = (a) => `${a.lastModified}:${a.size}`;
|
|
2704
2978
|
return {
|
|
2705
|
-
async list(
|
|
2706
|
-
const l = await t(
|
|
2979
|
+
async list(a) {
|
|
2980
|
+
const l = await t(a), y = [];
|
|
2707
2981
|
if (l)
|
|
2708
|
-
for await (const
|
|
2709
|
-
|
|
2710
|
-
return
|
|
2982
|
+
for await (const p of l.values())
|
|
2983
|
+
y.push({ name: p.name, kind: p.kind });
|
|
2984
|
+
return y;
|
|
2711
2985
|
},
|
|
2712
|
-
async read(
|
|
2713
|
-
const l = await n(
|
|
2986
|
+
async read(a) {
|
|
2987
|
+
const l = await n(a);
|
|
2714
2988
|
if (!l)
|
|
2715
2989
|
return null;
|
|
2716
|
-
const
|
|
2717
|
-
return { text: i.decode(await
|
|
2990
|
+
const y = await l.getFile();
|
|
2991
|
+
return { text: i.decode(await y.arrayBuffer()), version: s(y) };
|
|
2718
2992
|
},
|
|
2719
|
-
async write(
|
|
2720
|
-
const
|
|
2721
|
-
if (!
|
|
2722
|
-
throw new Error(`Cannot write ${
|
|
2723
|
-
const
|
|
2724
|
-
return await
|
|
2993
|
+
async write(a, l) {
|
|
2994
|
+
const y = await n(a, !0);
|
|
2995
|
+
if (!y)
|
|
2996
|
+
throw new Error(`Cannot write ${a}`);
|
|
2997
|
+
const p = await y.createWritable();
|
|
2998
|
+
return await p.write(l), await p.close(), s(await y.getFile());
|
|
2725
2999
|
},
|
|
2726
|
-
async remove(
|
|
2727
|
-
const [l,
|
|
3000
|
+
async remove(a) {
|
|
3001
|
+
const [l, y] = o(a), p = await t(l);
|
|
2728
3002
|
try {
|
|
2729
|
-
await (
|
|
2730
|
-
} catch (
|
|
2731
|
-
if (!
|
|
2732
|
-
throw
|
|
3003
|
+
await (p == null ? void 0 : p.removeEntry(y));
|
|
3004
|
+
} catch (u) {
|
|
3005
|
+
if (!pe(u))
|
|
3006
|
+
throw u;
|
|
2733
3007
|
}
|
|
2734
3008
|
},
|
|
2735
|
-
async removeDir(
|
|
2736
|
-
const [l,
|
|
3009
|
+
async removeDir(a) {
|
|
3010
|
+
const [l, y] = o(a), p = await t(l);
|
|
2737
3011
|
try {
|
|
2738
|
-
await (
|
|
2739
|
-
} catch (
|
|
2740
|
-
if (!
|
|
2741
|
-
throw
|
|
3012
|
+
await (p == null ? void 0 : p.removeEntry(y, { recursive: !0 }));
|
|
3013
|
+
} catch (u) {
|
|
3014
|
+
if (!pe(u))
|
|
3015
|
+
throw u;
|
|
2742
3016
|
}
|
|
2743
3017
|
}
|
|
2744
3018
|
};
|
|
2745
3019
|
}
|
|
2746
3020
|
export {
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
3021
|
+
G as OMNIVERK_CUSTOM_PREFIX,
|
|
3022
|
+
Et as OMNIVERK_DATA_TYPES,
|
|
3023
|
+
Xt as OMNIVERK_LEGACY_LIST_VIEW_FILES,
|
|
3024
|
+
gi as OMNIVERK_LOCALES,
|
|
3025
|
+
be as OmniVerkRestError,
|
|
3026
|
+
Kt as buildOmniVerkModule,
|
|
3027
|
+
Gt as controllerDifferences,
|
|
3028
|
+
bi as controllersFromExposed,
|
|
3029
|
+
Ii as createDirectoryHandleFileSystem,
|
|
3030
|
+
ji as createMemorySeedFileSystem,
|
|
3031
|
+
ki as createOmniVerkRestProvider,
|
|
3032
|
+
Ni as createOmniVerkStudioPreset,
|
|
3033
|
+
Si as createSeedFolderProvider,
|
|
3034
|
+
Rt as duplicateOmniVerkModule,
|
|
3035
|
+
vi as envVarsToManifest,
|
|
3036
|
+
Wt as exposedFromControllers,
|
|
3037
|
+
Ti as isSeedFolderPickerSupported,
|
|
3038
|
+
St as omniverkDataSourcesKind,
|
|
3039
|
+
st as omniverkEntitiesKind,
|
|
3040
|
+
jt as omniverkFileKinds,
|
|
3041
|
+
Ot as omniverkFilePrefix,
|
|
3042
|
+
ot as omniverkI18nKind,
|
|
3043
|
+
tt as omniverkManifestKind,
|
|
3044
|
+
Bt as omniverkManifestSections,
|
|
2767
3045
|
P as omniverkPascalIdentifier,
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
3046
|
+
wt as omniverkPermissionsKind,
|
|
3047
|
+
ve as omniverkRevisionStamp,
|
|
3048
|
+
bt as omniverkScriptKind,
|
|
3049
|
+
$t as omniverkScriptsKind,
|
|
3050
|
+
vt as omniverkSeedsKind,
|
|
3051
|
+
Ft as omniverkSpecFromStudio,
|
|
3052
|
+
fe as omniverkStableId,
|
|
3053
|
+
Be as omniverkTableName,
|
|
3054
|
+
De as omniverkTemplateFromDto,
|
|
3055
|
+
ni as omniverkTemplateFromEntry,
|
|
3056
|
+
Me as omniverkTemplateToEntry,
|
|
3057
|
+
si as omniverkTemplateToInput,
|
|
3058
|
+
dt as omniverkViewFromItem,
|
|
3059
|
+
ct as omniverkViewItem,
|
|
3060
|
+
pt as omniverkViewsKind,
|
|
3061
|
+
ft as omniverkWorkflowFromItem,
|
|
3062
|
+
mt as omniverkWorkflowItem,
|
|
3063
|
+
yt as omniverkWorkflowsKind,
|
|
3064
|
+
Ei as pickSeedDirectory,
|
|
3065
|
+
$i as toOmniVerkConnectorSeeds,
|
|
3066
|
+
ei as validateOmniVerkModule,
|
|
3067
|
+
ti as validateOmniVerkWorkspace,
|
|
3068
|
+
Vt as variablesFromManifest
|
|
2789
3069
|
};
|