@nice2dev/ui-forms 1.4.11 → 1.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +59 -0
- package/dist/index.mjs +2065 -2036
- package/dist/studio.cjs +8 -8
- package/dist/studio.d.ts +51 -0
- package/dist/studio.mjs +222 -202
- package/package.json +5 -5
package/dist/studio.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (e, t, n) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var Q = (e, t, n) => we(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
const D = () => ({
|
|
5
5
|
version: 1,
|
|
6
6
|
sections: [],
|
|
7
7
|
folders: [],
|
|
8
8
|
placement: {}
|
|
9
|
-
}),
|
|
10
|
-
function
|
|
9
|
+
}), pt = (e, t) => `${e}:${t}`, U = ".studio.json", Se = /^([^/]+?)\.(manifest|entities|views|workflows|permissions|rbac|seeds|datasources|scripts)\.json$/i, $e = (e) => !e.includes("/") && e.toLowerCase().endsWith(U);
|
|
10
|
+
function ut(e) {
|
|
11
11
|
const t = e.find((n) => $e(n.path));
|
|
12
12
|
if (t)
|
|
13
13
|
return t.path;
|
|
14
14
|
for (const n of e) {
|
|
15
15
|
const s = Se.exec(n.path);
|
|
16
16
|
if (s)
|
|
17
|
-
return `${s[1]}${
|
|
17
|
+
return `${s[1]}${U}`;
|
|
18
18
|
}
|
|
19
|
-
return `module${
|
|
19
|
+
return `module${U}`;
|
|
20
20
|
}
|
|
21
21
|
const N = (e) => typeof e == "object" && e !== null && !Array.isArray(e), b = (e) => typeof e == "string" && e ? e : void 0;
|
|
22
|
-
function
|
|
22
|
+
function mt(e) {
|
|
23
23
|
if (!e)
|
|
24
|
-
return
|
|
24
|
+
return D();
|
|
25
25
|
let t;
|
|
26
26
|
try {
|
|
27
27
|
t = JSON.parse(e.replace(/^\uFEFF/, ""));
|
|
28
28
|
} catch {
|
|
29
|
-
return
|
|
29
|
+
return D();
|
|
30
30
|
}
|
|
31
31
|
if (!N(t))
|
|
32
|
-
return
|
|
32
|
+
return D();
|
|
33
33
|
const n = (Array.isArray(t.sections) ? t.sections : []).filter(N).map((i) => ({ id: b(i.id), label: b(i.label) ?? b(i.id) })).filter((i) => !!i.id && !!i.label), s = (Array.isArray(t.folders) ? t.folders : []).filter(N).map((i) => ({
|
|
34
34
|
id: b(i.id),
|
|
35
35
|
label: b(i.label) ?? b(i.id),
|
|
@@ -46,8 +46,8 @@ function pt(e) {
|
|
|
46
46
|
}
|
|
47
47
|
return { version: 1, sections: n, folders: s, placement: r };
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const ht = (e) => e.sections.length === 0 && e.folders.length === 0 && Object.keys(e.placement).length === 0;
|
|
50
|
+
function yt(e, t) {
|
|
51
51
|
const n = JSON.stringify(e, null, 2) + `
|
|
52
52
|
`;
|
|
53
53
|
return t != null && t.includes(`\r
|
|
@@ -55,25 +55,25 @@ function mt(e, t) {
|
|
|
55
55
|
`) : n;
|
|
56
56
|
}
|
|
57
57
|
const je = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "item";
|
|
58
|
-
function
|
|
58
|
+
function ie(e, t) {
|
|
59
59
|
const n = je(e);
|
|
60
60
|
let s = n;
|
|
61
61
|
for (let r = 2; t.has(s); r++)
|
|
62
62
|
s = `${n}-${r}`;
|
|
63
63
|
return s;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const n =
|
|
65
|
+
function gt(e, t) {
|
|
66
|
+
const n = ie(t, new Set(e.sections.map((s) => s.id)));
|
|
67
67
|
return { layout: { ...e, sections: [...e.sections, { id: n, label: t }] }, id: n };
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const n =
|
|
69
|
+
function bt(e, t) {
|
|
70
|
+
const n = ie(t.label, new Set(e.folders.map((r) => r.id))), s = { id: n, label: t.label, group: t.group };
|
|
71
71
|
return t.parent && (s.parent = t.parent), t.section && (s.section = t.section), { layout: { ...e, folders: [...e.folders, s] }, id: n };
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function kt(e, t, n) {
|
|
74
74
|
return t.kind === "section" ? { ...e, sections: e.sections.map((s) => s.id === t.id ? { ...s, label: n } : s) } : { ...e, folders: e.folders.map((s) => s.id === t.id ? { ...s, label: n } : s) };
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function vt(e, t) {
|
|
77
77
|
const n = {};
|
|
78
78
|
if (t.kind === "folder") {
|
|
79
79
|
const s = e.folders.find((r) => r.id === t.id);
|
|
@@ -88,7 +88,7 @@ function bt(e, t) {
|
|
|
88
88
|
}
|
|
89
89
|
return r;
|
|
90
90
|
}),
|
|
91
|
-
placement:
|
|
91
|
+
placement: R(n)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
for (const [s, r] of Object.entries(e.placement))
|
|
@@ -107,16 +107,16 @@ function bt(e, t) {
|
|
|
107
107
|
}
|
|
108
108
|
return s;
|
|
109
109
|
}),
|
|
110
|
-
placement:
|
|
110
|
+
placement: R(n)
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function R(e) {
|
|
114
114
|
const t = {};
|
|
115
115
|
for (const [n, s] of Object.entries(e))
|
|
116
116
|
(s.section || s.folder || s.order !== void 0) && (t[n] = s);
|
|
117
117
|
return t;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function wt(e, t, n) {
|
|
120
120
|
var i;
|
|
121
121
|
const s = (i = e.placement[t]) == null ? void 0 : i.order, r = {};
|
|
122
122
|
if (n.folder) {
|
|
@@ -124,15 +124,15 @@ function kt(e, t, n) {
|
|
|
124
124
|
const a = e.folders.find((l) => l.id === n.folder);
|
|
125
125
|
a != null && a.section && (r.section = a.section);
|
|
126
126
|
} else n.section && (r.section = n.section);
|
|
127
|
-
return s !== void 0 && (r.order = s), { ...e, placement:
|
|
127
|
+
return s !== void 0 && (r.order = s), { ...e, placement: R({ ...e.placement, [t]: r }) };
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function St(e, t, n) {
|
|
130
130
|
if (t === n || !e.placement[t])
|
|
131
131
|
return e;
|
|
132
132
|
const s = { ...e.placement, [n]: e.placement[t] };
|
|
133
133
|
return delete s[t], { ...e, placement: s };
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const oe = "\uFEFF", ae = {
|
|
136
136
|
bom: !1,
|
|
137
137
|
eol: `
|
|
138
138
|
`,
|
|
@@ -140,12 +140,12 @@ const ie = "\uFEFF", oe = {
|
|
|
140
140
|
finalNewline: !0,
|
|
141
141
|
colonSpace: !0
|
|
142
142
|
};
|
|
143
|
-
function
|
|
143
|
+
function Z(e) {
|
|
144
144
|
const t = e.charCodeAt(0) === 65279, n = e.includes(`\r
|
|
145
145
|
`) ? `\r
|
|
146
146
|
` : `
|
|
147
147
|
`;
|
|
148
|
-
let s =
|
|
148
|
+
let s = ae.indent;
|
|
149
149
|
const r = e.split(/\r?\n/);
|
|
150
150
|
for (let a = 1; a < r.length; a++) {
|
|
151
151
|
const l = /^([ \t]+)\S/.exec(r[a]);
|
|
@@ -164,12 +164,12 @@ function X(e) {
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
function x(e) {
|
|
167
|
-
const t =
|
|
167
|
+
const t = Z(e);
|
|
168
168
|
return { value: JSON.parse(t.bom ? e.slice(1) : e), format: t };
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
const n = { ...
|
|
172
|
-
return (n.bom ?
|
|
170
|
+
function S(e, t) {
|
|
171
|
+
const n = { ...ae, ...t }, s = A(e, n, "");
|
|
172
|
+
return (n.bom ? oe : "") + s + (n.finalNewline ? n.eol : "");
|
|
173
173
|
}
|
|
174
174
|
function Oe(e, t) {
|
|
175
175
|
if (t === void 0)
|
|
@@ -177,7 +177,7 @@ function Oe(e, t) {
|
|
|
177
177
|
let n = t.includes(`\r
|
|
178
178
|
`) ? e.replace(/\r?\n/g, `\r
|
|
179
179
|
`) : e;
|
|
180
|
-
return t.charCodeAt(0) === 65279 && n.charCodeAt(0) !== 65279 && (n =
|
|
180
|
+
return t.charCodeAt(0) === 65279 && n.charCodeAt(0) !== 65279 && (n = oe + n), n;
|
|
181
181
|
}
|
|
182
182
|
function F(e, t) {
|
|
183
183
|
if (e === t)
|
|
@@ -193,12 +193,12 @@ function F(e, t) {
|
|
|
193
193
|
(i) => Object.prototype.hasOwnProperty.call(s, i) && F(n[i], s[i])
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function ce(e, t, n) {
|
|
197
197
|
return Ae(e, t, n).text;
|
|
198
198
|
}
|
|
199
199
|
function Ae(e, t, n) {
|
|
200
|
-
const s =
|
|
201
|
-
text:
|
|
200
|
+
const s = Z(e), r = (o) => ({
|
|
201
|
+
text: S(t, s),
|
|
202
202
|
exact: !1,
|
|
203
203
|
reason: o
|
|
204
204
|
});
|
|
@@ -208,7 +208,7 @@ function Ae(e, t, n) {
|
|
|
208
208
|
} catch (o) {
|
|
209
209
|
return r(o instanceof Error ? o.message : String(o));
|
|
210
210
|
}
|
|
211
|
-
if (
|
|
211
|
+
if (q(i))
|
|
212
212
|
return r("duplicate keys");
|
|
213
213
|
const a = [], l = {
|
|
214
214
|
text: e,
|
|
@@ -218,7 +218,7 @@ function Ae(e, t, n) {
|
|
|
218
218
|
compact: !e.trimEnd().includes(`
|
|
219
219
|
`)
|
|
220
220
|
};
|
|
221
|
-
|
|
221
|
+
H(l, i, t, "", !1);
|
|
222
222
|
const f = Ke(e, a);
|
|
223
223
|
try {
|
|
224
224
|
const o = JSON.parse(s.bom ? f.slice(1) : f);
|
|
@@ -231,7 +231,7 @@ function Ae(e, t, n) {
|
|
|
231
231
|
}
|
|
232
232
|
class Ee {
|
|
233
233
|
constructor(t) {
|
|
234
|
-
|
|
234
|
+
Q(this, "pos", 0);
|
|
235
235
|
this.text = t;
|
|
236
236
|
}
|
|
237
237
|
parseDocument() {
|
|
@@ -312,16 +312,16 @@ class Ee {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function q(e) {
|
|
316
316
|
if (e.kind === "object") {
|
|
317
317
|
const t = /* @__PURE__ */ new Set();
|
|
318
318
|
for (const n of e.members) {
|
|
319
|
-
if (t.has(n.key) ||
|
|
319
|
+
if (t.has(n.key) || q(n.value))
|
|
320
320
|
return !0;
|
|
321
321
|
t.add(n.key);
|
|
322
322
|
}
|
|
323
323
|
} else if (e.kind === "array")
|
|
324
|
-
return e.items.some(
|
|
324
|
+
return e.items.some(q);
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
327
|
function C(e) {
|
|
@@ -356,7 +356,7 @@ function E(e, t, n = !1) {
|
|
|
356
356
|
), a = n ? "" : " ";
|
|
357
357
|
return i.length === 0 ? "{}" : `{${a}${i.map(([l, f]) => `${JSON.stringify(l)}${s}${E(f, t, n)}`).join(r)}${a}}`;
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const le = (e) => e.compact ? "," : ", ";
|
|
360
360
|
function Ke(e, t) {
|
|
361
361
|
let n = e;
|
|
362
362
|
for (const s of [...t].sort((r, i) => i.start - r.start))
|
|
@@ -369,37 +369,37 @@ function L(e, t) {
|
|
|
369
369
|
`, t - 1) + 1;
|
|
370
370
|
return ((s = /^[ \t]*/.exec(e.slice(n, t))) == null ? void 0 : s[0]) ?? "";
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function de(e, t) {
|
|
373
373
|
return !e.slice(t.start, t.end).includes(`
|
|
374
374
|
`);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
return e.compact ? !0 : t.kind === "scalar" || (t.kind === "object" ? t.members.length === 0 : t.items.length === 0) ? n :
|
|
376
|
+
function G(e, t, n) {
|
|
377
|
+
return e.compact ? !0 : t.kind === "scalar" || (t.kind === "object" ? t.members.length === 0 : t.items.length === 0) ? n : de(e.text, t);
|
|
378
378
|
}
|
|
379
379
|
function T(e, t, n, s) {
|
|
380
|
-
const r =
|
|
380
|
+
const r = G(e, t, s);
|
|
381
381
|
e.edits.push({
|
|
382
382
|
start: t.start,
|
|
383
383
|
end: t.end,
|
|
384
384
|
text: r ? E(n, e.format, e.compact) : A(n, e.format, L(e.text, t.start))
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
387
|
+
const fe = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
388
|
+
function H(e, t, n, s, r) {
|
|
389
389
|
if (t.kind === "scalar") {
|
|
390
390
|
if (t.value === n)
|
|
391
391
|
return;
|
|
392
392
|
T(e, t, n, r);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
F(C(t), n) || (t.kind === "object" &&
|
|
395
|
+
F(C(t), n) || (t.kind === "object" && fe(n) ? Ne(e, t, n, s, r) : t.kind === "array" && Array.isArray(n) ? Te(e, t, n, s, r) : T(e, t, n, r));
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function pe(e, t, n) {
|
|
398
398
|
return n !== void 0 ? L(e.text, n) : L(e.text, t.start) + e.format.indent;
|
|
399
399
|
}
|
|
400
400
|
function Ne(e, t, n, s, r) {
|
|
401
401
|
var d;
|
|
402
|
-
const i =
|
|
402
|
+
const i = G(e, t, r), a = t.members.filter(
|
|
403
403
|
(p) => Object.prototype.hasOwnProperty.call(n, p.key) && n[p.key] !== void 0
|
|
404
404
|
), l = Object.keys(n).filter(
|
|
405
405
|
(p) => n[p] !== void 0 && !t.members.some((h) => h.key === p)
|
|
@@ -409,8 +409,8 @@ function Ne(e, t, n, s, r) {
|
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
for (const p of a)
|
|
412
|
-
|
|
413
|
-
if (
|
|
412
|
+
H(e, p.value, n[p.key], `${s}/${Le(p.key)}`, i);
|
|
413
|
+
if (ue(
|
|
414
414
|
e,
|
|
415
415
|
t.members.map((p) => ({ start: p.start, end: p.value.end })),
|
|
416
416
|
t.members.map((p) => a.includes(p))
|
|
@@ -421,19 +421,19 @@ function Ne(e, t, n, s, r) {
|
|
|
421
421
|
const p = l.map(
|
|
422
422
|
(h) => `${JSON.stringify(h)}${f}${E(n[h], e.format, e.compact)}`
|
|
423
423
|
);
|
|
424
|
-
|
|
424
|
+
he(e, t, a.length > 0 ? a[a.length - 1].value.end : void 0, p);
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
|
-
const o =
|
|
427
|
+
const o = pe(e, t, (d = t.members[0]) == null ? void 0 : d.start), c = l.map(
|
|
428
428
|
(p) => `${o}${JSON.stringify(p)}${f}${A(n[p], e.format, o)}`
|
|
429
429
|
);
|
|
430
|
-
|
|
430
|
+
me(e, t, a.length > 0 ? a[a.length - 1].value.end : void 0, c);
|
|
431
431
|
}
|
|
432
432
|
const Ie = ["name", "id", "code", "key", "slug", "state", "Id"];
|
|
433
433
|
function xe(e, t, n, s) {
|
|
434
434
|
var f, o;
|
|
435
435
|
const r = [...n, ...s];
|
|
436
|
-
if (r.length === 0 || !r.every(
|
|
436
|
+
if (r.length === 0 || !r.every(fe))
|
|
437
437
|
return;
|
|
438
438
|
const i = (c, d) => {
|
|
439
439
|
const p = c.map((h) => h[d]);
|
|
@@ -443,7 +443,7 @@ function xe(e, t, n, s) {
|
|
|
443
443
|
}
|
|
444
444
|
function Te(e, t, n, s, r) {
|
|
445
445
|
var g;
|
|
446
|
-
const i =
|
|
446
|
+
const i = G(e, t, r), a = t.items.map(C), l = xe(e, s, a, n), f = (u) => u[l], o = l !== void 0 ? a.map((u) => {
|
|
447
447
|
const m = f(u);
|
|
448
448
|
return n.findIndex((k) => f(k) === m);
|
|
449
449
|
}) : Ce(a, n);
|
|
@@ -481,13 +481,13 @@ function Te(e, t, n, s, r) {
|
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
t.items.forEach((u, m) => {
|
|
484
|
-
o[m] >= 0 &&
|
|
485
|
-
}),
|
|
484
|
+
o[m] >= 0 && H(e, u, n[o[m]], `${s}/${o[m]}`, i);
|
|
485
|
+
}), ue(
|
|
486
486
|
e,
|
|
487
487
|
t.items.map((u) => ({ start: u.start, end: u.end })),
|
|
488
488
|
o.map((u) => u >= 0)
|
|
489
489
|
);
|
|
490
|
-
const d = t.items.length > 0 && t.items.every((u) => u.kind !== "scalar" &&
|
|
490
|
+
const d = t.items.length > 0 && t.items.every((u) => u.kind !== "scalar" && de(e.text, u)), p = pe(e, t, (g = t.items[0]) == null ? void 0 : g.start), h = /* @__PURE__ */ new Map();
|
|
491
491
|
n.forEach((u, m) => {
|
|
492
492
|
if (o.includes(m))
|
|
493
493
|
return;
|
|
@@ -503,7 +503,7 @@ function Te(e, t, n, s, r) {
|
|
|
503
503
|
for (const [u, m] of h) {
|
|
504
504
|
const k = u === void 0 ? void 0 : t.items[u].end;
|
|
505
505
|
if (u === void 0 && c.length > 0) {
|
|
506
|
-
const j = t.items[o.findIndex((O) => O >= 0)], y = i ?
|
|
506
|
+
const j = t.items[o.findIndex((O) => O >= 0)], y = i ? le(e) : `,${e.format.eol}`;
|
|
507
507
|
e.edits.push({
|
|
508
508
|
start: j.start,
|
|
509
509
|
end: j.start,
|
|
@@ -511,7 +511,7 @@ function Te(e, t, n, s, r) {
|
|
|
511
511
|
});
|
|
512
512
|
continue;
|
|
513
513
|
}
|
|
514
|
-
i ?
|
|
514
|
+
i ? he(e, t, k, m) : me(e, t, k, m);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
const Fe = 4e6;
|
|
@@ -529,7 +529,7 @@ function Ce(e, t) {
|
|
|
529
529
|
r[f] === i[o] ? l[f++] = o++ : a[f + 1][o] >= a[f][o + 1] ? f++ : o++;
|
|
530
530
|
return l;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function ue(e, t, n) {
|
|
533
533
|
for (let s = 0; s < t.length; s++) {
|
|
534
534
|
if (n[s])
|
|
535
535
|
continue;
|
|
@@ -539,7 +539,7 @@ function pe(e, t, n) {
|
|
|
539
539
|
r + 1 < t.length ? e.edits.push({ start: t[s].start, end: t[r + 1].start, text: "" }) : s > 0 ? e.edits.push({ start: t[s - 1].end, end: t[r].end, text: "" }) : e.edits.push({ start: t[s].start, end: t[r].end, text: "" }), s = r;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function me(e, t, n, s) {
|
|
543
543
|
const r = e.format.eol;
|
|
544
544
|
if (n !== void 0) {
|
|
545
545
|
e.edits.push({ start: n, end: n, text: `,${r}${s.join(`,${r}`)}` });
|
|
@@ -557,8 +557,8 @@ function ue(e, t, n, s) {
|
|
|
557
557
|
e.edits.push({ start: l, end: l, text: `${s.join(`,${r}`).trimStart()}` });
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const r =
|
|
560
|
+
function he(e, t, n, s) {
|
|
561
|
+
const r = le(e);
|
|
562
562
|
if (n !== void 0) {
|
|
563
563
|
e.edits.push({ start: n, end: n, text: `${r}${s.join(r)}` });
|
|
564
564
|
return;
|
|
@@ -589,13 +589,13 @@ function M(e) {
|
|
|
589
589
|
const r = n[0].text, i = x(r).value, a = e.assign(i, t, s);
|
|
590
590
|
return {
|
|
591
591
|
files: [
|
|
592
|
-
{ path: n[0].path, text:
|
|
592
|
+
{ path: n[0].path, text: ce(r, a, { arrayKey: e.arrayKey }) }
|
|
593
593
|
]
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
const
|
|
598
|
+
const z = M({
|
|
599
599
|
id: "json",
|
|
600
600
|
label: "JSON",
|
|
601
601
|
labelKey: "devStudio.kind.json",
|
|
@@ -604,7 +604,7 @@ const q = M({
|
|
|
604
604
|
editor: "json",
|
|
605
605
|
select: (e) => e,
|
|
606
606
|
assign: (e, t) => t
|
|
607
|
-
}),
|
|
607
|
+
}), V = {
|
|
608
608
|
id: "text",
|
|
609
609
|
label: "Text",
|
|
610
610
|
labelKey: "devStudio.kind.text",
|
|
@@ -617,10 +617,10 @@ const q = M({
|
|
|
617
617
|
})
|
|
618
618
|
};
|
|
619
619
|
function Pe(e, t) {
|
|
620
|
-
return e.find((n) => n.match(t)) ?? (
|
|
620
|
+
return e.find((n) => n.match(t)) ?? (z.match(t) ? z : V);
|
|
621
621
|
}
|
|
622
622
|
function Je(e, t, n) {
|
|
623
|
-
for (const s of [
|
|
623
|
+
for (const s of [z, V])
|
|
624
624
|
if (s.match(e.path))
|
|
625
625
|
try {
|
|
626
626
|
const r = s.decode([e], n);
|
|
@@ -636,7 +636,7 @@ function Je(e, t, n) {
|
|
|
636
636
|
}
|
|
637
637
|
return {
|
|
638
638
|
key: `text:${e.path}`,
|
|
639
|
-
kind:
|
|
639
|
+
kind: V,
|
|
640
640
|
paths: [e.path],
|
|
641
641
|
label: K(e.path),
|
|
642
642
|
model: e.text,
|
|
@@ -649,7 +649,7 @@ function De(e, t, n, s) {
|
|
|
649
649
|
if (a !== void 0)
|
|
650
650
|
throw new Error(`${K(a)} would not be stored as it is`);
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function $t(e, t, n) {
|
|
653
653
|
const s = /* @__PURE__ */ new Map();
|
|
654
654
|
for (const i of t) {
|
|
655
655
|
const a = Pe(e, i.path), l = a.group ? a.group(i.path) : i.path, f = `${a.id}:${l}`, o = s.get(f) ?? { kind: a, group: l, files: [] };
|
|
@@ -669,7 +669,7 @@ function vt(e, t, n) {
|
|
|
669
669
|
}
|
|
670
670
|
return r.sort((i, a) => i.label.localeCompare(a.label));
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function jt(e, t, n, s) {
|
|
673
673
|
const r = n.filter((f) => e.paths.includes(f.path)), i = e.kind.encode(t, r, s), a = new Map(n.map((f) => [f.path, f])), l = [];
|
|
674
674
|
for (const f of i.files) {
|
|
675
675
|
const o = a.get(f.path);
|
|
@@ -688,7 +688,7 @@ function _e(e, t) {
|
|
|
688
688
|
return t;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const
|
|
691
|
+
const v = (e) => typeof e == "object" && e !== null && !Array.isArray(e), w = (...e) => (t) => {
|
|
692
692
|
const n = t.toLowerCase();
|
|
693
693
|
return e.some((s) => n.endsWith(s.toLowerCase()));
|
|
694
694
|
};
|
|
@@ -703,14 +703,14 @@ function P(e) {
|
|
|
703
703
|
select: (t) => {
|
|
704
704
|
if (Array.isArray(t))
|
|
705
705
|
return t;
|
|
706
|
-
const n =
|
|
706
|
+
const n = v(t) ? t[e.property] : void 0;
|
|
707
707
|
return Array.isArray(n) ? n : [];
|
|
708
708
|
},
|
|
709
|
-
assign: (t, n) => Array.isArray(t) ? n :
|
|
709
|
+
assign: (t, n) => Array.isArray(t) ? n : v(t) && !(e.property in t) && n.length === 0 ? t : { ...v(t) ? t : {}, [e.property]: n },
|
|
710
710
|
arrayKey: e.itemKey ? () => e.itemKey : void 0
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function ye(e) {
|
|
714
714
|
const t = P(e);
|
|
715
715
|
return {
|
|
716
716
|
...t,
|
|
@@ -722,32 +722,32 @@ function he(e) {
|
|
|
722
722
|
)
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function J(e) {
|
|
726
726
|
return M({
|
|
727
727
|
...e,
|
|
728
|
-
select: (t) =>
|
|
728
|
+
select: (t) => v(t) ? t : {},
|
|
729
729
|
assign: (t, n) => n
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
732
|
const Ue = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Re = (e) => {
|
|
733
733
|
const t = Ue.exec(e);
|
|
734
734
|
return t ? { group: t[1], locale: t[2] } : null;
|
|
735
|
-
},
|
|
735
|
+
}, W = (e) => v(e) && Object.values(e).every((t) => typeof t == "string");
|
|
736
736
|
function qe(e) {
|
|
737
|
-
if (
|
|
737
|
+
if (v(e)) {
|
|
738
738
|
for (const t of ["translations", "keys"])
|
|
739
739
|
if (t in e) {
|
|
740
|
-
if (
|
|
740
|
+
if (W(e[t]))
|
|
741
741
|
return e[t];
|
|
742
742
|
throw new Error(`"${t}" is not a flat map of texts`);
|
|
743
743
|
}
|
|
744
|
-
if (
|
|
744
|
+
if (W(e))
|
|
745
745
|
return e;
|
|
746
746
|
}
|
|
747
747
|
throw new Error("no translations in this file");
|
|
748
748
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
749
|
+
function ee(e, t) {
|
|
750
|
+
return v(e) ? v(e.translations) ? { ...e, translations: t } : v(e.keys) ? { ...e, keys: t } : W(e) ? t : { ...e, translations: t } : { translations: t };
|
|
751
751
|
}
|
|
752
752
|
function ze(e = {}) {
|
|
753
753
|
const t = e.parse ?? Re, n = e.pathFor ?? ((s, r) => `${s}.${r}.i18n.json`);
|
|
@@ -784,34 +784,34 @@ function ze(e = {}) {
|
|
|
784
784
|
const g = x(p.text).value;
|
|
785
785
|
f.push({
|
|
786
786
|
path: p.path,
|
|
787
|
-
text:
|
|
787
|
+
text: ce(p.text, ee(g, d))
|
|
788
788
|
});
|
|
789
789
|
continue;
|
|
790
790
|
}
|
|
791
791
|
const h = n(a || K((l == null ? void 0 : l.path) ?? "module"), c);
|
|
792
792
|
if (l) {
|
|
793
|
-
const g = x(l.text).value, u =
|
|
793
|
+
const g = x(l.text).value, u = v(g) && "locale" in g ? { ...g, locale: c } : g;
|
|
794
794
|
f.push({
|
|
795
795
|
path: h,
|
|
796
|
-
text:
|
|
797
|
-
|
|
798
|
-
|
|
796
|
+
text: S(
|
|
797
|
+
ee(u, d),
|
|
798
|
+
Z(l.text)
|
|
799
799
|
)
|
|
800
800
|
});
|
|
801
801
|
} else
|
|
802
|
-
f.push({ path: h, text:
|
|
802
|
+
f.push({ path: h, text: S({ locale: c, translations: d }) });
|
|
803
803
|
}
|
|
804
804
|
const o = [...i.entries()].filter(([c]) => !(c in s)).map(([, c]) => c.path);
|
|
805
805
|
return { files: f, deleted: o };
|
|
806
806
|
}
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
|
-
const
|
|
809
|
+
const $ = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ve = [
|
|
810
810
|
"frontend",
|
|
811
811
|
"backend",
|
|
812
812
|
"noCode",
|
|
813
813
|
"sql"
|
|
814
|
-
],
|
|
814
|
+
], Ot = [
|
|
815
815
|
"preInstall",
|
|
816
816
|
"postInstall",
|
|
817
817
|
"preUninstall",
|
|
@@ -840,8 +840,8 @@ const Be = /* @__PURE__ */ new Set([
|
|
|
840
840
|
"write",
|
|
841
841
|
"callScript",
|
|
842
842
|
"return"
|
|
843
|
-
]), ge = (e) => Array.isArray(e) && e.every((t) =>
|
|
844
|
-
function
|
|
843
|
+
]), ge = (e) => Array.isArray(e) && e.every((t) => $(t) && typeof t.id == "string" && Be.has(String(t.type)));
|
|
844
|
+
function B(e) {
|
|
845
845
|
if (Ve.includes(e.kind))
|
|
846
846
|
return e.kind;
|
|
847
847
|
if (e.source === void 0 && ge(e.steps))
|
|
@@ -859,11 +859,11 @@ const be = [
|
|
|
859
859
|
"returnType",
|
|
860
860
|
"source",
|
|
861
861
|
"sourcePath"
|
|
862
|
-
], Xe = (e) => Array.isArray(e) && e.every((t) =>
|
|
862
|
+
], Xe = (e) => Array.isArray(e) && e.every((t) => $(t) && typeof t.name == "string");
|
|
863
863
|
function Ze(e, t) {
|
|
864
864
|
const n = `#${t + 1}`;
|
|
865
|
-
if (
|
|
866
|
-
const l =
|
|
865
|
+
if (!$(e) || typeof e.name != "string" || !e.name) {
|
|
866
|
+
const l = $(e) && typeof e.displayName == "string" ? e.displayName : n;
|
|
867
867
|
return { key: `#${t}`, label: l, rawReason: "no name", source: e };
|
|
868
868
|
}
|
|
869
869
|
const s = e.name, r = typeof e.displayName == "string" && e.displayName ? e.displayName : s, i = (l) => ({
|
|
@@ -871,7 +871,7 @@ function Ze(e, t) {
|
|
|
871
871
|
label: r,
|
|
872
872
|
rawReason: l,
|
|
873
873
|
source: e
|
|
874
|
-
}), a = { name: s, kind:
|
|
874
|
+
}), a = { name: s, kind: B(e) };
|
|
875
875
|
for (const l of be) {
|
|
876
876
|
const f = e[l];
|
|
877
877
|
if (f !== void 0) {
|
|
@@ -896,20 +896,20 @@ function Ge(e) {
|
|
|
896
896
|
const t = e.definition;
|
|
897
897
|
if (!t)
|
|
898
898
|
return e.source;
|
|
899
|
-
const n =
|
|
899
|
+
const n = $(e.source) ? e.source : {}, s = { ...n, name: t.name };
|
|
900
900
|
for (const r of be)
|
|
901
901
|
t[r] === void 0 ? delete s[r] : s[r] = t[r];
|
|
902
|
-
return t.parameters === void 0 ? delete s.parameters : s.parameters = t.parameters, t.kind === "noCode" ? s.steps = t.steps ?? [] :
|
|
902
|
+
return t.parameters === void 0 ? delete s.parameters : s.parameters = t.parameters, t.kind === "noCode" ? s.steps = t.steps ?? [] : B(n) === "noCode" && delete s.steps, delete s.kind, ("kind" in n || B(s) !== t.kind) && (s.kind = t.kind), s;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function _(e) {
|
|
905
905
|
const t = /* @__PURE__ */ new Set();
|
|
906
906
|
return e.map((n, s) => {
|
|
907
907
|
const r = Ze(n, s);
|
|
908
908
|
return t.has(r.key) && (r.key = `${r.key}#${s}`), t.add(r.key), r;
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
if (
|
|
911
|
+
function te(e, t) {
|
|
912
|
+
if (!$(e) || !Object.values(e).every((n) => Array.isArray(n) && n.every((s) => typeof s == "string")))
|
|
913
913
|
throw new Error(`"${t}" is not lists of SQL statements per phase`);
|
|
914
914
|
return e;
|
|
915
915
|
}
|
|
@@ -924,18 +924,18 @@ function He(e) {
|
|
|
924
924
|
match: e.match,
|
|
925
925
|
select: (i) => {
|
|
926
926
|
if (Array.isArray(i))
|
|
927
|
-
return { scripts:
|
|
928
|
-
if (
|
|
927
|
+
return { scripts: _(i), ...s ? { holds: "scripts" } : {} };
|
|
928
|
+
if (!$(i) || i[t] === void 0 && i[n] === void 0)
|
|
929
929
|
throw new Error(`no "${t}" in this file`);
|
|
930
930
|
const a = i[t];
|
|
931
931
|
if (s)
|
|
932
|
-
return Array.isArray(a) ? { scripts:
|
|
932
|
+
return Array.isArray(a) ? { scripts: _(a), holds: "scripts" } : { scripts: [], phases: te(a, t), holds: "phases" };
|
|
933
933
|
if (a !== void 0 && !Array.isArray(a))
|
|
934
934
|
throw new Error(`"${t}" is not a list`);
|
|
935
935
|
const l = i[n];
|
|
936
936
|
return {
|
|
937
|
-
scripts:
|
|
938
|
-
...l !== void 0 ? { phases:
|
|
937
|
+
scripts: _(a ?? []),
|
|
938
|
+
...l !== void 0 ? { phases: te(l, n) } : {}
|
|
939
939
|
};
|
|
940
940
|
},
|
|
941
941
|
assign: (i, a) => {
|
|
@@ -943,7 +943,7 @@ function He(e) {
|
|
|
943
943
|
throw new Error("This file holds database scripts only; add scripts to another file.");
|
|
944
944
|
if (Array.isArray(i) && a.phases === void 0)
|
|
945
945
|
return r(a);
|
|
946
|
-
const l =
|
|
946
|
+
const l = $(i) ? i : {};
|
|
947
947
|
if (s)
|
|
948
948
|
return {
|
|
949
949
|
...l,
|
|
@@ -959,7 +959,7 @@ function Ye(e) {
|
|
|
959
959
|
const n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((s, r) => r === 0 ? s[0].toLowerCase() + s.slice(1) : s[0].toUpperCase() + s.slice(1)).join("");
|
|
960
960
|
return /^[A-Za-z_]/.test(n) ? n : `script${n}`;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function At(e) {
|
|
963
963
|
const t = Ye(e.name), n = e.language ?? We(e.kind)[0], s = {
|
|
964
964
|
name: t,
|
|
965
965
|
kind: e.kind,
|
|
@@ -1002,7 +1002,7 @@ SELECT 1;
|
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
1004
|
const I = (e) => JSON.parse(JSON.stringify(e));
|
|
1005
|
-
function
|
|
1005
|
+
function Et(e) {
|
|
1006
1006
|
const t = e.revisions !== !1;
|
|
1007
1007
|
let n = 0;
|
|
1008
1008
|
const s = e.workspaces.map((o) => ({
|
|
@@ -1185,10 +1185,10 @@ function Ot(e) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function Kt(e) {
|
|
1189
1189
|
return e;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function X(e, t) {
|
|
1192
1192
|
if (!t || e === void 0 || e === null)
|
|
1193
1193
|
return !0;
|
|
1194
1194
|
if (t.enum && !t.enum.includes(e))
|
|
@@ -1203,24 +1203,24 @@ function B(e, t) {
|
|
|
1203
1203
|
case "boolean":
|
|
1204
1204
|
return typeof e == "boolean";
|
|
1205
1205
|
case "array":
|
|
1206
|
-
return Array.isArray(e) && (!t.items || e.every((n) =>
|
|
1206
|
+
return Array.isArray(e) && (!t.items || e.every((n) => X(n, t.items)));
|
|
1207
1207
|
case "object": {
|
|
1208
1208
|
if (typeof e != "object" || Array.isArray(e))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
const n = t.properties;
|
|
1211
|
-
return !n || Object.entries(e).every(([s, r]) => s in n &&
|
|
1211
|
+
return !n || Object.entries(e).every(([s, r]) => s in n && X(r, n[s]));
|
|
1212
1212
|
}
|
|
1213
1213
|
default:
|
|
1214
1214
|
return !0;
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function Nt(e, t) {
|
|
1218
1218
|
var a;
|
|
1219
1219
|
const n = (e.fields ?? []).map((l) => l.name), s = (a = e.schema) == null ? void 0 : a.properties;
|
|
1220
1220
|
if (!e.schema || !s)
|
|
1221
1221
|
return { section: e, keys: n };
|
|
1222
1222
|
const r = Object.entries(s).filter(
|
|
1223
|
-
([l, f]) => !(l in t) ||
|
|
1223
|
+
([l, f]) => !(l in t) || X(t[l], f)
|
|
1224
1224
|
), i = r.map(([l]) => l);
|
|
1225
1225
|
return {
|
|
1226
1226
|
section: {
|
|
@@ -1234,7 +1234,7 @@ function Et(e, t) {
|
|
|
1234
1234
|
keys: [...i, ...n]
|
|
1235
1235
|
};
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function It(e) {
|
|
1238
1238
|
var n;
|
|
1239
1239
|
const t = /* @__PURE__ */ new Set();
|
|
1240
1240
|
for (const s of e) {
|
|
@@ -1245,7 +1245,7 @@ function Kt(e) {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
return t;
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function xt(e) {
|
|
1249
1249
|
const t = (n) => {
|
|
1250
1250
|
const s = e.find((r) => r.name === n);
|
|
1251
1251
|
return String((s == null ? void 0 : s.tableName) || (s == null ? void 0 : s.name) || n);
|
|
@@ -1276,7 +1276,7 @@ function Nt(e) {
|
|
|
1276
1276
|
};
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function Tt(e) {
|
|
1280
1280
|
const t = e.manifest ?? {}, n = String(t.displayName || t.packageName || "Module"), s = (e.views ?? []).map((i) => ({
|
|
1281
1281
|
id: `view:${i.id}`,
|
|
1282
1282
|
label: i.name,
|
|
@@ -1310,20 +1310,20 @@ function It(e) {
|
|
|
1310
1310
|
grants: {}
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
1313
|
-
const
|
|
1313
|
+
const Y = J({
|
|
1314
1314
|
id: "manifest",
|
|
1315
1315
|
label: "Manifest",
|
|
1316
1316
|
labelKey: "devStudio.kind.manifest",
|
|
1317
1317
|
icon: "file",
|
|
1318
1318
|
editor: "manifest",
|
|
1319
|
-
match:
|
|
1319
|
+
match: w(".manifest.json")
|
|
1320
1320
|
}), Qe = P({
|
|
1321
1321
|
id: "entities",
|
|
1322
1322
|
label: "Entities",
|
|
1323
1323
|
labelKey: "devStudio.kind.entities",
|
|
1324
1324
|
icon: "database",
|
|
1325
1325
|
editor: "entities",
|
|
1326
|
-
match:
|
|
1326
|
+
match: w(".entities.json"),
|
|
1327
1327
|
property: "entities",
|
|
1328
1328
|
itemKey: "name"
|
|
1329
1329
|
}), et = ze();
|
|
@@ -1336,24 +1336,24 @@ function ke(e, t) {
|
|
|
1336
1336
|
source: e
|
|
1337
1337
|
};
|
|
1338
1338
|
}
|
|
1339
|
-
const tt =
|
|
1339
|
+
const tt = ye({
|
|
1340
1340
|
id: "views",
|
|
1341
1341
|
label: "Views",
|
|
1342
1342
|
labelKey: "devStudio.kind.views",
|
|
1343
1343
|
icon: "grid",
|
|
1344
1344
|
editor: "views",
|
|
1345
|
-
match:
|
|
1345
|
+
match: w(".views.json"),
|
|
1346
1346
|
property: "views",
|
|
1347
1347
|
itemKey: "id",
|
|
1348
1348
|
toItem: (e, t) => ke(e, t),
|
|
1349
1349
|
fromItem: (e) => e.definition ?? e.source
|
|
1350
|
-
}), nt =
|
|
1350
|
+
}), nt = ye({
|
|
1351
1351
|
id: "workflows",
|
|
1352
1352
|
label: "Workflows",
|
|
1353
1353
|
labelKey: "devStudio.kind.workflows",
|
|
1354
1354
|
icon: "git-branch",
|
|
1355
1355
|
editor: "workflows",
|
|
1356
|
-
match:
|
|
1356
|
+
match: w(".workflows.json"),
|
|
1357
1357
|
property: "workflows",
|
|
1358
1358
|
itemKey: "id",
|
|
1359
1359
|
toItem: (e, t) => ke(e, t),
|
|
@@ -1364,29 +1364,43 @@ const tt = he({
|
|
|
1364
1364
|
labelKey: "devStudio.kind.dataSources",
|
|
1365
1365
|
icon: "database",
|
|
1366
1366
|
editor: "dataSources",
|
|
1367
|
-
match:
|
|
1367
|
+
match: w(".datasources.json"),
|
|
1368
1368
|
property: "dataSources",
|
|
1369
1369
|
itemKey: "key"
|
|
1370
|
-
}), rt =
|
|
1370
|
+
}), rt = J({
|
|
1371
1371
|
id: "rbac",
|
|
1372
1372
|
label: "Access",
|
|
1373
1373
|
labelKey: "devStudio.kind.rbac",
|
|
1374
1374
|
icon: "shield",
|
|
1375
1375
|
editor: "rbac",
|
|
1376
|
-
match:
|
|
1376
|
+
match: w(".rbac.json")
|
|
1377
1377
|
}), it = P({
|
|
1378
1378
|
id: "hooks",
|
|
1379
1379
|
label: "Lifecycle hooks",
|
|
1380
1380
|
labelKey: "devStudio.kind.hooks",
|
|
1381
1381
|
icon: "zap",
|
|
1382
1382
|
editor: "hooks",
|
|
1383
|
-
match:
|
|
1383
|
+
match: w(".hooks.json"),
|
|
1384
1384
|
property: "bindings",
|
|
1385
1385
|
itemKey: "id"
|
|
1386
|
-
}), ot =
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1386
|
+
}), ot = J({
|
|
1387
|
+
id: "integrations",
|
|
1388
|
+
label: "Integrations",
|
|
1389
|
+
labelKey: "devStudio.kind.integrations",
|
|
1390
|
+
icon: "plug",
|
|
1391
|
+
editor: "integrations",
|
|
1392
|
+
match: w(".integrations.json")
|
|
1393
|
+
}), at = J({
|
|
1394
|
+
id: "environments",
|
|
1395
|
+
label: "Environment sets",
|
|
1396
|
+
labelKey: "devStudio.kind.environments",
|
|
1397
|
+
icon: "globe",
|
|
1398
|
+
editor: "environments",
|
|
1399
|
+
match: w(".environments.json")
|
|
1400
|
+
}), ct = He({
|
|
1401
|
+
match: w(".scripts.json")
|
|
1402
|
+
}), lt = [
|
|
1403
|
+
Y,
|
|
1390
1404
|
Qe,
|
|
1391
1405
|
et,
|
|
1392
1406
|
tt,
|
|
@@ -1394,30 +1408,32 @@ const tt = he({
|
|
|
1394
1408
|
st,
|
|
1395
1409
|
rt,
|
|
1396
1410
|
it,
|
|
1397
|
-
|
|
1411
|
+
ct,
|
|
1412
|
+
ot,
|
|
1413
|
+
at
|
|
1398
1414
|
];
|
|
1399
|
-
function
|
|
1415
|
+
function ne(e) {
|
|
1400
1416
|
return e.normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/ł/g, "l").replace(/Ł/g, "L").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "module";
|
|
1401
1417
|
}
|
|
1402
|
-
const
|
|
1403
|
-
const t = e.find((n) =>
|
|
1418
|
+
const se = (e) => {
|
|
1419
|
+
const t = e.find((n) => Y.match(n.path));
|
|
1404
1420
|
return t ? _e(t.text, void 0) : void 0;
|
|
1405
1421
|
};
|
|
1406
|
-
function
|
|
1407
|
-
const t = e.find((n) =>
|
|
1422
|
+
function dt(e) {
|
|
1423
|
+
const t = e.find((n) => Y.match(n.path));
|
|
1408
1424
|
return t ? K(t.path).replace(/\.manifest\.json$/i, "") : "module";
|
|
1409
1425
|
}
|
|
1410
|
-
const
|
|
1426
|
+
const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
1411
1427
|
id: "native",
|
|
1412
|
-
kinds:
|
|
1428
|
+
kinds: lt,
|
|
1413
1429
|
locales: ["en", "pl", "de", "fr", "es", "uk"],
|
|
1414
1430
|
requiredLocales: ["en"],
|
|
1415
1431
|
moduleId: (e) => {
|
|
1416
|
-
const t =
|
|
1432
|
+
const t = se(e), n = (t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.packageName);
|
|
1417
1433
|
return typeof n == "string" ? n : void 0;
|
|
1418
1434
|
},
|
|
1419
1435
|
validateModule: ({ files: e }) => {
|
|
1420
|
-
const t =
|
|
1436
|
+
const t = se(e);
|
|
1421
1437
|
return t ? ["id", "name", "version"].filter((n) => typeof t[n] != "string" || !t[n]).map((n) => ({
|
|
1422
1438
|
severity: "error",
|
|
1423
1439
|
code: "manifest.required",
|
|
@@ -1435,25 +1451,27 @@ const se = (e) => Array.isArray(e.fields) ? e.fields : [], xt = {
|
|
|
1435
1451
|
];
|
|
1436
1452
|
},
|
|
1437
1453
|
newFile: (e, { files: t }) => {
|
|
1438
|
-
const n =
|
|
1454
|
+
const n = dt(t), r = {
|
|
1439
1455
|
entities: ["entities.json", { entities: [] }],
|
|
1440
1456
|
views: ["views.json", { views: [] }],
|
|
1441
1457
|
workflows: ["workflows.json", { workflows: [] }],
|
|
1442
1458
|
dataSources: ["datasources.json", { dataSources: [] }],
|
|
1443
1459
|
rbac: ["rbac.json", { roles: [], actions: [], resources: [], grants: {} }],
|
|
1444
1460
|
hooks: ["hooks.json", { bindings: [] }],
|
|
1445
|
-
scripts: ["scripts.json", { scripts: [] }]
|
|
1461
|
+
scripts: ["scripts.json", { scripts: [] }],
|
|
1462
|
+
integrations: ["integrations.json", { integrations: [] }],
|
|
1463
|
+
environments: ["environments.json", { variables: [], sets: [] }]
|
|
1446
1464
|
}[e];
|
|
1447
|
-
return r ? { path: `${n}.${r[0]}`, text:
|
|
1465
|
+
return r ? { path: `${n}.${r[0]}`, text: S(r[1]) } : void 0;
|
|
1448
1466
|
},
|
|
1449
1467
|
generateModule: async (e, { existingIds: t }) => {
|
|
1450
|
-
let n =
|
|
1468
|
+
let n = ne(e.name);
|
|
1451
1469
|
for (let r = 2; t.has(n); r++)
|
|
1452
|
-
n = `${
|
|
1470
|
+
n = `${ne(e.name)}-${r}`;
|
|
1453
1471
|
const s = [
|
|
1454
1472
|
{
|
|
1455
1473
|
path: `${n}.manifest.json`,
|
|
1456
|
-
text:
|
|
1474
|
+
text: S({
|
|
1457
1475
|
id: n,
|
|
1458
1476
|
name: e.name,
|
|
1459
1477
|
version: "1.0.0",
|
|
@@ -1462,19 +1480,19 @@ const se = (e) => Array.isArray(e.fields) ? e.fields : [], xt = {
|
|
|
1462
1480
|
...e.packageId ? { category: e.packageId } : {}
|
|
1463
1481
|
})
|
|
1464
1482
|
},
|
|
1465
|
-
{ path: `${n}.entities.json`, text:
|
|
1483
|
+
{ path: `${n}.entities.json`, text: S({ entities: e.entities }) }
|
|
1466
1484
|
];
|
|
1467
1485
|
for (const r of e.locales) {
|
|
1468
1486
|
const i = { "module.displayName": e.name };
|
|
1469
1487
|
for (const a of e.entities) {
|
|
1470
1488
|
const l = String(a.name ?? "");
|
|
1471
1489
|
i[`entity.${l}.displayName`] = l;
|
|
1472
|
-
for (const f of
|
|
1490
|
+
for (const f of re(a))
|
|
1473
1491
|
i[`field.${l}.${String(f.name)}.label`] = String(f.name);
|
|
1474
1492
|
}
|
|
1475
1493
|
s.push({
|
|
1476
1494
|
path: `${n}.${r}.i18n.json`,
|
|
1477
|
-
text:
|
|
1495
|
+
text: S({ locale: r, translations: i })
|
|
1478
1496
|
});
|
|
1479
1497
|
}
|
|
1480
1498
|
if (e.views) {
|
|
@@ -1496,7 +1514,7 @@ const se = (e) => Array.isArray(e.fields) ? e.fields : [], xt = {
|
|
|
1496
1514
|
controlType: "dataGrid",
|
|
1497
1515
|
colSpan: 12,
|
|
1498
1516
|
props: {
|
|
1499
|
-
columns:
|
|
1517
|
+
columns: re(i).map((l) => ({
|
|
1500
1518
|
field: String(l.name),
|
|
1501
1519
|
header: String(l.name)
|
|
1502
1520
|
}))
|
|
@@ -1508,7 +1526,7 @@ const se = (e) => Array.isArray(e.fields) ? e.fields : [], xt = {
|
|
|
1508
1526
|
]
|
|
1509
1527
|
};
|
|
1510
1528
|
});
|
|
1511
|
-
s.push({ path: `${n}.views.json`, text:
|
|
1529
|
+
s.push({ path: `${n}.views.json`, text: S({ views: r }) });
|
|
1512
1530
|
}
|
|
1513
1531
|
if (e.permissions) {
|
|
1514
1532
|
const r = {
|
|
@@ -1529,74 +1547,76 @@ const se = (e) => Array.isArray(e.fields) ? e.fields : [], xt = {
|
|
|
1529
1547
|
})),
|
|
1530
1548
|
grants: {}
|
|
1531
1549
|
};
|
|
1532
|
-
s.push({ path: `${n}.rbac.json`, text:
|
|
1550
|
+
s.push({ path: `${n}.rbac.json`, text: S(r) });
|
|
1533
1551
|
}
|
|
1534
1552
|
return { id: n, packageId: e.packageId, files: s };
|
|
1535
1553
|
}
|
|
1536
1554
|
};
|
|
1537
1555
|
export {
|
|
1538
1556
|
Ve as NICE_STUDIO_SCRIPT_KINDS,
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1557
|
+
Ot as NICE_STUDIO_SCRIPT_PHASES,
|
|
1558
|
+
bt as addStudioFolder,
|
|
1559
|
+
gt as addStudioSection,
|
|
1542
1560
|
P as arrayFileKind,
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1561
|
+
$t as buildDocuments,
|
|
1562
|
+
Et as createMemoryStudioProvider,
|
|
1563
|
+
Kt as defineManifestSection,
|
|
1564
|
+
Tt as deriveDefaultRbac,
|
|
1565
|
+
Z as detectJsonTextFormat,
|
|
1566
|
+
D as emptyStudioLayout,
|
|
1567
|
+
jt as encodeDocument,
|
|
1568
|
+
w as endsWithAny,
|
|
1569
|
+
xt as entitiesToSchemas,
|
|
1552
1570
|
K as fileName,
|
|
1553
|
-
|
|
1571
|
+
Nt as fitManifestSection,
|
|
1554
1572
|
Ge as fromStudioScriptItem,
|
|
1555
1573
|
ze as i18nFileKind,
|
|
1556
|
-
|
|
1557
|
-
|
|
1574
|
+
B as inferStudioScriptKind,
|
|
1575
|
+
ht as isEmptyStudioLayout,
|
|
1558
1576
|
$e as isStudioLayoutPath,
|
|
1559
|
-
|
|
1560
|
-
|
|
1577
|
+
ye as itemsFileKind,
|
|
1578
|
+
z as jsonFallbackKind,
|
|
1561
1579
|
M as jsonFileKind,
|
|
1562
|
-
|
|
1580
|
+
X as jsonValueFitsSchema,
|
|
1563
1581
|
F as jsonValuesEqual,
|
|
1564
1582
|
Oe as keepTextFormat,
|
|
1565
|
-
|
|
1566
|
-
|
|
1583
|
+
It as manifestSectionKeys,
|
|
1584
|
+
dt as modulePrefix,
|
|
1567
1585
|
st as nativeDataSourcesKind,
|
|
1568
1586
|
Qe as nativeEntitiesKind,
|
|
1569
|
-
at as
|
|
1587
|
+
at as nativeEnvironmentsKind,
|
|
1588
|
+
lt as nativeFileKinds,
|
|
1570
1589
|
it as nativeHooksKind,
|
|
1571
1590
|
et as nativeI18nKind,
|
|
1572
|
-
|
|
1591
|
+
ot as nativeIntegrationsKind,
|
|
1592
|
+
Y as nativeManifestKind,
|
|
1573
1593
|
rt as nativeRbacKind,
|
|
1574
|
-
|
|
1575
|
-
|
|
1594
|
+
ct as nativeScriptsKind,
|
|
1595
|
+
Ft as nativeStudioPreset,
|
|
1576
1596
|
tt as nativeViewsKind,
|
|
1577
1597
|
nt as nativeWorkflowsKind,
|
|
1578
|
-
|
|
1579
|
-
|
|
1598
|
+
At as newStudioScript,
|
|
1599
|
+
J as objectFileKind,
|
|
1580
1600
|
x as parseJsonText,
|
|
1581
|
-
|
|
1582
|
-
|
|
1601
|
+
mt as parseStudioLayout,
|
|
1602
|
+
ce as patchJsonText,
|
|
1583
1603
|
Ae as patchJsonTextDetailed,
|
|
1584
|
-
|
|
1604
|
+
wt as placeStudioEntry,
|
|
1585
1605
|
qe as readTranslations,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1606
|
+
vt as removeStudioLayoutNode,
|
|
1607
|
+
St as renameStudioEntryRef,
|
|
1608
|
+
kt as renameStudioLayoutNode,
|
|
1589
1609
|
Pe as resolveFileKind,
|
|
1590
1610
|
_e as safeJson,
|
|
1591
1611
|
He as scriptsFileKind,
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1612
|
+
yt as serializeStudioLayout,
|
|
1613
|
+
ne as slugifyModuleId,
|
|
1614
|
+
S as stringifyJsonText,
|
|
1615
|
+
pt as studioEntryRef,
|
|
1616
|
+
ut as studioLayoutPath,
|
|
1597
1617
|
Ye as studioScriptIdentifier,
|
|
1598
1618
|
We as studioScriptLanguages,
|
|
1599
|
-
|
|
1619
|
+
V as textFallbackKind,
|
|
1600
1620
|
Ze as toStudioScriptItem,
|
|
1601
|
-
|
|
1621
|
+
ee as writeTranslations
|
|
1602
1622
|
};
|