@nice2dev/ui-forms 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +159 -1
- package/dist/index.mjs +3046 -2706
- package/dist/studio.cjs +9 -9
- package/dist/studio.d.ts +159 -1
- package/dist/studio.mjs +988 -710
- package/dist/ui-forms.css +1 -1
- package/package.json +5 -5
package/dist/studio.mjs
CHANGED
|
@@ -1,138 +1,183 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var Ke = Object.defineProperty;
|
|
2
|
+
var Ie = (e, t, n) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var oe = (e, t, n) => Ie(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
const U = () => ({
|
|
5
5
|
version: 1,
|
|
6
6
|
sections: [],
|
|
7
7
|
folders: [],
|
|
8
8
|
placement: {}
|
|
9
|
-
}),
|
|
10
|
-
function
|
|
11
|
-
const t = e.find((n) =>
|
|
9
|
+
}), It = (e, t) => `${e}:${t}`, W = ".studio.json", Ne = /^([^/]+?)\.(manifest|entities|views|workflows|permissions|rbac|seeds|datasources|scripts)\.json$/i, xe = (e) => !e.includes("/") && e.toLowerCase().endsWith(W);
|
|
10
|
+
function Nt(e) {
|
|
11
|
+
const t = e.find((n) => xe(n.path));
|
|
12
12
|
if (t)
|
|
13
13
|
return t.path;
|
|
14
14
|
for (const n of e) {
|
|
15
|
-
const s =
|
|
15
|
+
const s = Ne.exec(n.path);
|
|
16
16
|
if (s)
|
|
17
|
-
return `${s[1]}${
|
|
17
|
+
return `${s[1]}${W}`;
|
|
18
18
|
}
|
|
19
|
-
return `module${
|
|
19
|
+
return `module${W}`;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
function
|
|
21
|
+
const T = (e) => typeof e == "object" && e !== null && !Array.isArray(e), v = (e) => typeof e == "string" && e ? e : void 0;
|
|
22
|
+
function xt(e) {
|
|
23
23
|
if (!e)
|
|
24
|
-
return
|
|
24
|
+
return U();
|
|
25
25
|
let t;
|
|
26
26
|
try {
|
|
27
27
|
t = JSON.parse(e.replace(/^\uFEFF/, ""));
|
|
28
28
|
} catch {
|
|
29
|
-
return
|
|
29
|
+
return U();
|
|
30
30
|
}
|
|
31
|
-
if (!
|
|
32
|
-
return
|
|
33
|
-
const n = (Array.isArray(t.sections) ? t.sections : []).filter(
|
|
34
|
-
id:
|
|
35
|
-
label:
|
|
36
|
-
group:
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
})).filter((
|
|
40
|
-
if (
|
|
41
|
-
for (const [
|
|
42
|
-
if (!
|
|
31
|
+
if (!T(t))
|
|
32
|
+
return U();
|
|
33
|
+
const n = (Array.isArray(t.sections) ? t.sections : []).filter(T).map((r) => ({ id: v(r.id), label: v(r.label) ?? v(r.id) })).filter((r) => !!r.id && !!r.label), s = (Array.isArray(t.folders) ? t.folders : []).filter(T).map((r) => ({
|
|
34
|
+
id: v(r.id),
|
|
35
|
+
label: v(r.label) ?? v(r.id),
|
|
36
|
+
group: v(r.group),
|
|
37
|
+
...v(r.parent) ? { parent: v(r.parent) } : {},
|
|
38
|
+
...v(r.section) ? { section: v(r.section) } : {}
|
|
39
|
+
})).filter((r) => !!r.id && !!r.label && !!r.group), i = {};
|
|
40
|
+
if (T(t.placement))
|
|
41
|
+
for (const [r, o] of Object.entries(t.placement)) {
|
|
42
|
+
if (!T(o))
|
|
43
43
|
continue;
|
|
44
44
|
const l = {};
|
|
45
|
-
|
|
45
|
+
v(o.section) && (l.section = v(o.section)), v(o.folder) && (l.folder = v(o.folder)), typeof o.order == "number" && Number.isFinite(o.order) && (l.order = o.order), (l.section || l.folder || l.order !== void 0) && (i[r] = l);
|
|
46
46
|
}
|
|
47
|
-
return { version: 1, sections: n, folders: s, placement:
|
|
47
|
+
return { version: 1, sections: n, folders: s, placement: i };
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const Mt = (e) => e.sections.length === 0 && e.folders.length === 0 && Object.keys(e.placement).length === 0;
|
|
50
|
+
function Tt(e, t) {
|
|
51
51
|
const n = JSON.stringify(e, null, 2) + `
|
|
52
52
|
`;
|
|
53
53
|
return t != null && t.includes(`\r
|
|
54
54
|
`) ? n.replace(/\n/g, `\r
|
|
55
55
|
`) : n;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
const n =
|
|
57
|
+
const Me = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "item";
|
|
58
|
+
function ue(e, t) {
|
|
59
|
+
const n = Me(e);
|
|
60
60
|
let s = n;
|
|
61
|
-
for (let
|
|
62
|
-
s = `${n}-${
|
|
61
|
+
for (let i = 2; t.has(s); i++)
|
|
62
|
+
s = `${n}-${i}`;
|
|
63
63
|
return s;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const n =
|
|
65
|
+
function Ft(e, t) {
|
|
66
|
+
const n = ue(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 Ct(e, t) {
|
|
70
|
+
const n = ue(t.label, new Set(e.folders.map((i) => i.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 Lt(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 Pt(e, t) {
|
|
77
77
|
const n = {};
|
|
78
78
|
if (t.kind === "folder") {
|
|
79
|
-
const s = e.folders.find((
|
|
80
|
-
for (const [
|
|
81
|
-
n[
|
|
79
|
+
const s = e.folders.find((i) => i.id === t.id);
|
|
80
|
+
for (const [i, r] of Object.entries(e.placement))
|
|
81
|
+
n[i] = r.folder === t.id ? { ...r, folder: s == null ? void 0 : s.parent } : r, n[i].folder || delete n[i].folder;
|
|
82
82
|
return {
|
|
83
83
|
...e,
|
|
84
|
-
folders: e.folders.filter((
|
|
85
|
-
if (!
|
|
86
|
-
const { parent:
|
|
87
|
-
return
|
|
84
|
+
folders: e.folders.filter((i) => i.id !== t.id).map((i) => i.parent === t.id ? { ...i, parent: s == null ? void 0 : s.parent } : i).map((i) => {
|
|
85
|
+
if (!i.parent) {
|
|
86
|
+
const { parent: r, ...o } = i;
|
|
87
|
+
return o;
|
|
88
88
|
}
|
|
89
|
-
return
|
|
89
|
+
return i;
|
|
90
90
|
}),
|
|
91
|
-
placement:
|
|
91
|
+
placement: C(n)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
for (const [s,
|
|
95
|
-
if (
|
|
96
|
-
const { section:
|
|
97
|
-
n[s] =
|
|
94
|
+
for (const [s, i] of Object.entries(e.placement))
|
|
95
|
+
if (i.section === t.id) {
|
|
96
|
+
const { section: r, ...o } = i;
|
|
97
|
+
n[s] = o;
|
|
98
98
|
} else
|
|
99
|
-
n[s] =
|
|
99
|
+
n[s] = i;
|
|
100
100
|
return {
|
|
101
101
|
...e,
|
|
102
102
|
sections: e.sections.filter((s) => s.id !== t.id),
|
|
103
103
|
folders: e.folders.map((s) => {
|
|
104
104
|
if (s.section === t.id) {
|
|
105
|
-
const { section:
|
|
106
|
-
return
|
|
105
|
+
const { section: i, ...r } = s;
|
|
106
|
+
return r;
|
|
107
107
|
}
|
|
108
108
|
return s;
|
|
109
109
|
}),
|
|
110
|
-
placement:
|
|
110
|
+
placement: C(n)
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function C(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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
const Te = (e) => e.slice(0, Math.max(0, e.indexOf(":")));
|
|
120
|
+
function Jt(e, t, n) {
|
|
121
|
+
var r;
|
|
122
|
+
const s = (r = e.placement[t]) == null ? void 0 : r.order, i = {};
|
|
122
123
|
if (n.folder) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
const o = e.folders.find((l) => l.id === n.folder);
|
|
125
|
+
if (o && o.group !== Te(t))
|
|
126
|
+
return e;
|
|
127
|
+
i.folder = n.folder, o != null && o.section && (i.section = o.section);
|
|
128
|
+
} else n.section && (i.section = n.section);
|
|
129
|
+
return s !== void 0 && (i.order = s), { ...e, placement: C({ ...e.placement, [t]: i }) };
|
|
130
|
+
}
|
|
131
|
+
function qt(e, t) {
|
|
132
|
+
const n = { ...e.placement };
|
|
133
|
+
return t.forEach((s, i) => {
|
|
134
|
+
n[s] = { ...n[s], order: i };
|
|
135
|
+
}), { ...e, placement: C(n) };
|
|
136
|
+
}
|
|
137
|
+
function ae(e, t, n) {
|
|
138
|
+
var r;
|
|
139
|
+
const s = new Map(e.folders.map((o) => [o.id, o])), i = /* @__PURE__ */ new Set();
|
|
140
|
+
for (let o = t; o && !i.has(o); o = (r = s.get(o)) == null ? void 0 : r.parent) {
|
|
141
|
+
if (o === n)
|
|
142
|
+
return !0;
|
|
143
|
+
i.add(o);
|
|
144
|
+
}
|
|
145
|
+
return !1;
|
|
146
|
+
}
|
|
147
|
+
function Dt(e, t, n) {
|
|
148
|
+
const s = e.folders.find((d) => d.id === t);
|
|
149
|
+
if (!s)
|
|
150
|
+
return e;
|
|
151
|
+
let i = n.section;
|
|
152
|
+
if (n.parent) {
|
|
153
|
+
const d = e.folders.find((a) => a.id === n.parent);
|
|
154
|
+
if (!d || d.group !== s.group || ae(e, d.id, t))
|
|
155
|
+
return e;
|
|
156
|
+
i = d.section;
|
|
157
|
+
}
|
|
158
|
+
const r = new Set(
|
|
159
|
+
e.folders.filter((d) => ae(e, d.id, t)).map((d) => d.id)
|
|
160
|
+
), o = e.folders.map((d) => {
|
|
161
|
+
if (!r.has(d.id))
|
|
162
|
+
return d;
|
|
163
|
+
const a = { id: d.id, label: d.label, group: d.group }, c = d.id === t ? n.parent : d.parent;
|
|
164
|
+
return c && (a.parent = c), i && (a.section = i), a;
|
|
165
|
+
}), l = {};
|
|
166
|
+
for (const [d, a] of Object.entries(e.placement))
|
|
167
|
+
if (a.folder && r.has(a.folder)) {
|
|
168
|
+
const { section: c, ...u } = a;
|
|
169
|
+
l[d] = i ? { ...u, section: i } : u;
|
|
170
|
+
} else
|
|
171
|
+
l[d] = a;
|
|
172
|
+
return { ...e, folders: o, placement: C(l) };
|
|
128
173
|
}
|
|
129
|
-
function
|
|
174
|
+
function Rt(e, t, n) {
|
|
130
175
|
if (t === n || !e.placement[t])
|
|
131
176
|
return e;
|
|
132
177
|
const s = { ...e.placement, [n]: e.placement[t] };
|
|
133
178
|
return delete s[t], { ...e, placement: s };
|
|
134
179
|
}
|
|
135
|
-
const
|
|
180
|
+
const pe = "\uFEFF", me = {
|
|
136
181
|
bom: !1,
|
|
137
182
|
eol: `
|
|
138
183
|
`,
|
|
@@ -140,98 +185,98 @@ const oe = "\uFEFF", ae = {
|
|
|
140
185
|
finalNewline: !0,
|
|
141
186
|
colonSpace: !0
|
|
142
187
|
};
|
|
143
|
-
function
|
|
188
|
+
function Y(e) {
|
|
144
189
|
const t = e.charCodeAt(0) === 65279, n = e.includes(`\r
|
|
145
190
|
`) ? `\r
|
|
146
191
|
` : `
|
|
147
192
|
`;
|
|
148
|
-
let s =
|
|
149
|
-
const
|
|
150
|
-
for (let
|
|
151
|
-
const l = /^([ \t]+)\S/.exec(
|
|
193
|
+
let s = me.indent;
|
|
194
|
+
const i = e.split(/\r?\n/);
|
|
195
|
+
for (let o = 1; o < i.length; o++) {
|
|
196
|
+
const l = /^([ \t]+)\S/.exec(i[o]);
|
|
152
197
|
if (l) {
|
|
153
198
|
s = l[1];
|
|
154
199
|
break;
|
|
155
200
|
}
|
|
156
201
|
}
|
|
157
|
-
const
|
|
202
|
+
const r = /"\s*:(\s?)/.exec(e);
|
|
158
203
|
return {
|
|
159
204
|
bom: t,
|
|
160
205
|
eol: n,
|
|
161
206
|
indent: s,
|
|
162
207
|
finalNewline: /\n$/.test(e),
|
|
163
|
-
colonSpace:
|
|
208
|
+
colonSpace: r ? r[1] !== "" : !0
|
|
164
209
|
};
|
|
165
210
|
}
|
|
166
|
-
function
|
|
167
|
-
const t =
|
|
211
|
+
function K(e) {
|
|
212
|
+
const t = Y(e);
|
|
168
213
|
return { value: JSON.parse(t.bom ? e.slice(1) : e), format: t };
|
|
169
214
|
}
|
|
170
|
-
function
|
|
171
|
-
const n = { ...
|
|
172
|
-
return (n.bom ?
|
|
215
|
+
function j(e, t) {
|
|
216
|
+
const n = { ...me, ...t }, s = I(e, n, "");
|
|
217
|
+
return (n.bom ? pe : "") + s + (n.finalNewline ? n.eol : "");
|
|
173
218
|
}
|
|
174
|
-
function
|
|
219
|
+
function Fe(e, t) {
|
|
175
220
|
if (t === void 0)
|
|
176
221
|
return e;
|
|
177
222
|
let n = t.includes(`\r
|
|
178
223
|
`) ? e.replace(/\r?\n/g, `\r
|
|
179
224
|
`) : e;
|
|
180
|
-
return t.charCodeAt(0) === 65279 && n.charCodeAt(0) !== 65279 && (n =
|
|
225
|
+
return t.charCodeAt(0) === 65279 && n.charCodeAt(0) !== 65279 && (n = pe + n), n;
|
|
181
226
|
}
|
|
182
|
-
function
|
|
227
|
+
function P(e, t) {
|
|
183
228
|
if (e === t)
|
|
184
229
|
return !0;
|
|
185
230
|
if (typeof e != typeof t || e === null || t === null || typeof e != "object" || Array.isArray(e) !== Array.isArray(t))
|
|
186
231
|
return !1;
|
|
187
232
|
if (Array.isArray(e)) {
|
|
188
|
-
const
|
|
189
|
-
return e.length ===
|
|
233
|
+
const r = t;
|
|
234
|
+
return e.length === r.length && e.every((o, l) => P(o, r[l]));
|
|
190
235
|
}
|
|
191
|
-
const n = e, s = t,
|
|
192
|
-
return
|
|
193
|
-
(
|
|
236
|
+
const n = e, s = t, i = Object.keys(n);
|
|
237
|
+
return i.length !== Object.keys(s).length ? !1 : i.every(
|
|
238
|
+
(r) => Object.prototype.hasOwnProperty.call(s, r) && P(n[r], s[r])
|
|
194
239
|
);
|
|
195
240
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
241
|
+
function ee(e, t, n) {
|
|
242
|
+
return Ce(e, t, n).text;
|
|
198
243
|
}
|
|
199
|
-
function
|
|
200
|
-
const s =
|
|
201
|
-
text:
|
|
244
|
+
function Ce(e, t, n) {
|
|
245
|
+
const s = Y(e), i = (a) => ({
|
|
246
|
+
text: j(t, s),
|
|
202
247
|
exact: !1,
|
|
203
|
-
reason:
|
|
248
|
+
reason: a
|
|
204
249
|
});
|
|
205
|
-
let
|
|
250
|
+
let r;
|
|
206
251
|
try {
|
|
207
|
-
|
|
208
|
-
} catch (
|
|
209
|
-
return
|
|
252
|
+
r = new Le(e).parseDocument();
|
|
253
|
+
} catch (a) {
|
|
254
|
+
return i(a instanceof Error ? a.message : String(a));
|
|
210
255
|
}
|
|
211
|
-
if (
|
|
212
|
-
return
|
|
213
|
-
const
|
|
256
|
+
if (z(r))
|
|
257
|
+
return i("duplicate keys");
|
|
258
|
+
const o = [], l = {
|
|
214
259
|
text: e,
|
|
215
260
|
format: s,
|
|
216
|
-
edits:
|
|
261
|
+
edits: o,
|
|
217
262
|
options: n,
|
|
218
263
|
compact: !e.trimEnd().includes(`
|
|
219
264
|
`)
|
|
220
265
|
};
|
|
221
|
-
|
|
222
|
-
const
|
|
266
|
+
ne(l, r, t, "", !1);
|
|
267
|
+
const d = Pe(e, o);
|
|
223
268
|
try {
|
|
224
|
-
const
|
|
225
|
-
if (!
|
|
226
|
-
return
|
|
269
|
+
const a = JSON.parse(s.bom ? d.slice(1) : d);
|
|
270
|
+
if (!P(a, t))
|
|
271
|
+
return i("patch did not read back");
|
|
227
272
|
} catch {
|
|
228
|
-
return
|
|
273
|
+
return i("patch was not valid JSON");
|
|
229
274
|
}
|
|
230
|
-
return { text:
|
|
275
|
+
return { text: d, exact: !0 };
|
|
231
276
|
}
|
|
232
|
-
class
|
|
277
|
+
class Le {
|
|
233
278
|
constructor(t) {
|
|
234
|
-
|
|
279
|
+
oe(this, "pos", 0);
|
|
235
280
|
this.text = t;
|
|
236
281
|
}
|
|
237
282
|
parseDocument() {
|
|
@@ -287,14 +332,14 @@ class Ee {
|
|
|
287
332
|
const s = this.pos;
|
|
288
333
|
if (this.text[this.pos] !== '"')
|
|
289
334
|
throw new Error(`Expected a key at ${this.pos}`);
|
|
290
|
-
const
|
|
335
|
+
const i = JSON.parse(this.text.slice(s, this.stringEnd()));
|
|
291
336
|
if (this.ws(), this.text[this.pos] !== ":")
|
|
292
337
|
throw new Error(`Expected ':' at ${this.pos}`);
|
|
293
|
-
this.pos++, n.push({ key:
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
338
|
+
this.pos++, n.push({ key: i, start: s, value: this.value() }), this.ws();
|
|
339
|
+
const r = this.text[this.pos++];
|
|
340
|
+
if (r === "}")
|
|
296
341
|
return { kind: "object", start: t, end: this.pos, members: n };
|
|
297
|
-
if (
|
|
342
|
+
if (r !== ",")
|
|
298
343
|
throw new Error(`Expected ',' or '}' at ${this.pos - 1}`);
|
|
299
344
|
}
|
|
300
345
|
}
|
|
@@ -312,269 +357,448 @@ class Ee {
|
|
|
312
357
|
}
|
|
313
358
|
}
|
|
314
359
|
}
|
|
315
|
-
function
|
|
360
|
+
function z(e) {
|
|
316
361
|
if (e.kind === "object") {
|
|
317
362
|
const t = /* @__PURE__ */ new Set();
|
|
318
363
|
for (const n of e.members) {
|
|
319
|
-
if (t.has(n.key) ||
|
|
364
|
+
if (t.has(n.key) || z(n.value))
|
|
320
365
|
return !0;
|
|
321
366
|
t.add(n.key);
|
|
322
367
|
}
|
|
323
368
|
} else if (e.kind === "array")
|
|
324
|
-
return e.items.some(
|
|
369
|
+
return e.items.some(z);
|
|
325
370
|
return !1;
|
|
326
371
|
}
|
|
327
|
-
function
|
|
372
|
+
function J(e) {
|
|
328
373
|
if (e.kind === "scalar")
|
|
329
374
|
return e.value;
|
|
330
375
|
if (e.kind === "array")
|
|
331
|
-
return e.items.map(
|
|
376
|
+
return e.items.map(J);
|
|
332
377
|
const t = {};
|
|
333
378
|
for (const n of e.members)
|
|
334
|
-
t[n.key] =
|
|
379
|
+
t[n.key] = J(n.value);
|
|
335
380
|
return t;
|
|
336
381
|
}
|
|
337
|
-
function
|
|
382
|
+
function I(e, t, n) {
|
|
338
383
|
if (e === null || typeof e != "object")
|
|
339
384
|
return e === void 0 ? "null" : JSON.stringify(e);
|
|
340
|
-
const s = n + t.indent,
|
|
385
|
+
const s = n + t.indent, i = t.colonSpace ? ": " : ":";
|
|
341
386
|
if (Array.isArray(e))
|
|
342
|
-
return e.length === 0 ? "[]" : `[${t.eol}${e.map((
|
|
343
|
-
const
|
|
344
|
-
([,
|
|
387
|
+
return e.length === 0 ? "[]" : `[${t.eol}${e.map((o) => s + I(o, t, s)).join(`,${t.eol}`)}${t.eol}${n}]`;
|
|
388
|
+
const r = Object.entries(e).filter(
|
|
389
|
+
([, o]) => o !== void 0
|
|
345
390
|
);
|
|
346
|
-
return
|
|
391
|
+
return r.length === 0 ? "{}" : `{${t.eol}${r.map(([o, l]) => `${s}${JSON.stringify(o)}${i}${I(l, t, s)}`).join(`,${t.eol}`)}${t.eol}${n}}`;
|
|
347
392
|
}
|
|
348
|
-
function
|
|
393
|
+
function N(e, t, n = !1) {
|
|
349
394
|
if (e === null || typeof e != "object")
|
|
350
395
|
return e === void 0 ? "null" : JSON.stringify(e);
|
|
351
|
-
const s = t.colonSpace ? ": " : ":",
|
|
396
|
+
const s = t.colonSpace ? ": " : ":", i = n ? "," : ", ";
|
|
352
397
|
if (Array.isArray(e))
|
|
353
|
-
return `[${e.map((l) =>
|
|
354
|
-
const
|
|
398
|
+
return `[${e.map((l) => N(l, t, n)).join(i)}]`;
|
|
399
|
+
const r = Object.entries(e).filter(
|
|
355
400
|
([, l]) => l !== void 0
|
|
356
|
-
),
|
|
357
|
-
return
|
|
401
|
+
), o = n ? "" : " ";
|
|
402
|
+
return r.length === 0 ? "{}" : `{${o}${r.map(([l, d]) => `${JSON.stringify(l)}${s}${N(d, t, n)}`).join(i)}${o}}`;
|
|
358
403
|
}
|
|
359
|
-
const
|
|
360
|
-
function
|
|
404
|
+
const he = (e) => e.compact ? "," : ", ";
|
|
405
|
+
function Pe(e, t) {
|
|
361
406
|
let n = e;
|
|
362
|
-
for (const s of [...t].sort((
|
|
407
|
+
for (const s of [...t].sort((i, r) => r.start - i.start))
|
|
363
408
|
n = n.slice(0, s.start) + s.text + n.slice(s.end);
|
|
364
409
|
return n;
|
|
365
410
|
}
|
|
366
|
-
function
|
|
411
|
+
function q(e, t) {
|
|
367
412
|
var s;
|
|
368
413
|
const n = e.lastIndexOf(`
|
|
369
414
|
`, t - 1) + 1;
|
|
370
415
|
return ((s = /^[ \t]*/.exec(e.slice(n, t))) == null ? void 0 : s[0]) ?? "";
|
|
371
416
|
}
|
|
372
|
-
function
|
|
417
|
+
function ye(e, t) {
|
|
373
418
|
return !e.slice(t.start, t.end).includes(`
|
|
374
419
|
`);
|
|
375
420
|
}
|
|
376
|
-
function
|
|
377
|
-
return e.compact ? !0 : t.kind === "scalar" || (t.kind === "object" ? t.members.length === 0 : t.items.length === 0) ? n :
|
|
421
|
+
function te(e, t, n) {
|
|
422
|
+
return e.compact ? !0 : t.kind === "scalar" || (t.kind === "object" ? t.members.length === 0 : t.items.length === 0) ? n : ye(e.text, t);
|
|
378
423
|
}
|
|
379
|
-
function
|
|
380
|
-
const
|
|
424
|
+
function L(e, t, n, s) {
|
|
425
|
+
const i = te(e, t, s);
|
|
381
426
|
e.edits.push({
|
|
382
427
|
start: t.start,
|
|
383
428
|
end: t.end,
|
|
384
|
-
text:
|
|
429
|
+
text: i ? N(n, e.format, e.compact) : I(n, e.format, q(e.text, t.start))
|
|
385
430
|
});
|
|
386
431
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
432
|
+
const ge = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
433
|
+
function ne(e, t, n, s, i) {
|
|
389
434
|
if (t.kind === "scalar") {
|
|
390
435
|
if (t.value === n)
|
|
391
436
|
return;
|
|
392
|
-
|
|
437
|
+
L(e, t, n, i);
|
|
393
438
|
return;
|
|
394
439
|
}
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
function
|
|
398
|
-
return n !== void 0 ?
|
|
399
|
-
}
|
|
400
|
-
function
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
440
|
+
P(J(t), n) || (t.kind === "object" && ge(n) ? qe(e, t, n, s, i) : t.kind === "array" && Array.isArray(n) ? _e(e, t, n, s, i) : L(e, t, n, i));
|
|
441
|
+
}
|
|
442
|
+
function be(e, t, n) {
|
|
443
|
+
return n !== void 0 ? q(e.text, n) : q(e.text, t.start) + e.format.indent;
|
|
444
|
+
}
|
|
445
|
+
function Je(e, t) {
|
|
446
|
+
for (let n = t + 1; n < e.length; n++)
|
|
447
|
+
if (e[n] === "\\")
|
|
448
|
+
n++;
|
|
449
|
+
else if (e[n] === '"')
|
|
450
|
+
return n + 1;
|
|
451
|
+
return e.length;
|
|
452
|
+
}
|
|
453
|
+
function qe(e, t, n, s, i) {
|
|
454
|
+
var p;
|
|
455
|
+
const r = te(e, t, i), o = (f) => Object.prototype.hasOwnProperty.call(n, f) && n[f] !== void 0, l = Object.keys(n).filter(o), d = /* @__PURE__ */ new Map();
|
|
456
|
+
t.members.forEach((f, y) => {
|
|
457
|
+
const k = l[y];
|
|
458
|
+
k !== void 0 && !o(f.key) && !t.members.some((g) => g.key === k) && d.set(f, k);
|
|
459
|
+
});
|
|
460
|
+
const a = (f) => d.get(f) ?? f.key, c = t.members.filter((f) => o(f.key) || d.has(f)), u = l.filter(
|
|
461
|
+
(f) => !t.members.some((y) => y.key === f) && ![...d.values()].includes(f)
|
|
406
462
|
);
|
|
407
|
-
if (
|
|
408
|
-
|
|
463
|
+
if (c.length === 0 && t.members.length > 0) {
|
|
464
|
+
L(e, t, n, i);
|
|
409
465
|
return;
|
|
410
466
|
}
|
|
411
|
-
for (const
|
|
412
|
-
|
|
413
|
-
|
|
467
|
+
for (const f of c) {
|
|
468
|
+
const y = a(f);
|
|
469
|
+
y !== f.key && e.edits.push({
|
|
470
|
+
start: f.start,
|
|
471
|
+
end: Je(e.text, f.start),
|
|
472
|
+
text: JSON.stringify(y)
|
|
473
|
+
}), ne(e, f.value, n[y], `${s}/${We(y)}`, r);
|
|
474
|
+
}
|
|
475
|
+
if (ke(
|
|
414
476
|
e,
|
|
415
|
-
t.members.map((
|
|
416
|
-
t.members.map((
|
|
417
|
-
),
|
|
477
|
+
t.members.map((f) => ({ start: f.start, end: f.value.end })),
|
|
478
|
+
t.members.map((f) => c.includes(f))
|
|
479
|
+
), u.length === 0)
|
|
418
480
|
return;
|
|
419
|
-
const
|
|
420
|
-
if (
|
|
421
|
-
const
|
|
422
|
-
(
|
|
481
|
+
const m = e.format.colonSpace ? ": " : ":";
|
|
482
|
+
if (r) {
|
|
483
|
+
const f = u.map(
|
|
484
|
+
(y) => `${JSON.stringify(y)}${m}${N(n[y], e.format, e.compact)}`
|
|
423
485
|
);
|
|
424
|
-
|
|
486
|
+
ve(e, t, c.length > 0 ? c[c.length - 1].value.end : void 0, f);
|
|
425
487
|
return;
|
|
426
488
|
}
|
|
427
|
-
const
|
|
428
|
-
(
|
|
489
|
+
const h = be(e, t, (p = t.members[0]) == null ? void 0 : p.start), b = u.map(
|
|
490
|
+
(f) => `${h}${JSON.stringify(f)}${m}${I(n[f], e.format, h)}`
|
|
429
491
|
);
|
|
430
|
-
|
|
492
|
+
we(e, t, c.length > 0 ? c[c.length - 1].value.end : void 0, b);
|
|
431
493
|
}
|
|
432
|
-
const
|
|
433
|
-
function
|
|
434
|
-
var
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
494
|
+
const De = ["name", "id", "code", "key", "slug", "state", "Id"];
|
|
495
|
+
function Re(e, t, n, s) {
|
|
496
|
+
var d, a;
|
|
497
|
+
const i = [...n, ...s];
|
|
498
|
+
if (i.length === 0 || !i.every(ge))
|
|
437
499
|
return;
|
|
438
|
-
const
|
|
439
|
-
const
|
|
440
|
-
return
|
|
441
|
-
},
|
|
442
|
-
return (
|
|
443
|
-
}
|
|
444
|
-
function
|
|
445
|
-
var
|
|
446
|
-
const
|
|
447
|
-
const
|
|
448
|
-
return n.findIndex((
|
|
449
|
-
}) :
|
|
500
|
+
const r = (c, u) => {
|
|
501
|
+
const m = c.map((h) => h[u]);
|
|
502
|
+
return m.every((h) => typeof h == "string" || typeof h == "number") && new Set(m).size === m.length;
|
|
503
|
+
}, o = (a = (d = e.options) == null ? void 0 : d.arrayKey) == null ? void 0 : a.call(d, t);
|
|
504
|
+
return (o ? [o] : De).find((c) => r(n, c) && r(s, c));
|
|
505
|
+
}
|
|
506
|
+
function _e(e, t, n, s, i) {
|
|
507
|
+
var b;
|
|
508
|
+
const r = te(e, t, i), o = t.items.map(J), l = Re(e, s, o, n), d = (p) => p[l], a = l !== void 0 ? o.map((p) => {
|
|
509
|
+
const f = d(p);
|
|
510
|
+
return n.findIndex((y) => d(y) === f);
|
|
511
|
+
}) : Ve(o, n);
|
|
450
512
|
{
|
|
451
|
-
const
|
|
452
|
-
for (let
|
|
453
|
-
if (
|
|
513
|
+
const p = new Set(a.filter((f) => f >= 0));
|
|
514
|
+
for (let f = 0; f < a.length; f++) {
|
|
515
|
+
if (a[f] >= 0)
|
|
454
516
|
continue;
|
|
455
|
-
let
|
|
456
|
-
for (let
|
|
457
|
-
if (
|
|
458
|
-
|
|
517
|
+
let y = -1;
|
|
518
|
+
for (let g = f - 1; g >= 0; g--)
|
|
519
|
+
if (a[g] >= 0) {
|
|
520
|
+
y = a[g];
|
|
459
521
|
break;
|
|
460
522
|
}
|
|
461
|
-
let
|
|
462
|
-
for (let
|
|
463
|
-
if (
|
|
464
|
-
|
|
523
|
+
let k = n.length;
|
|
524
|
+
for (let g = f + 1; g < a.length; g++)
|
|
525
|
+
if (a[g] >= 0) {
|
|
526
|
+
k = a[g];
|
|
465
527
|
break;
|
|
466
528
|
}
|
|
467
|
-
for (let
|
|
468
|
-
if (!
|
|
469
|
-
|
|
529
|
+
for (let g = y + 1; g < k; g++)
|
|
530
|
+
if (!p.has(g)) {
|
|
531
|
+
a[f] = g, p.add(g);
|
|
470
532
|
break;
|
|
471
533
|
}
|
|
472
534
|
}
|
|
473
535
|
}
|
|
474
|
-
const c =
|
|
475
|
-
if (c.some((
|
|
476
|
-
|
|
536
|
+
const c = a.filter((p) => p >= 0);
|
|
537
|
+
if (c.some((p, f) => f > 0 && p < c[f - 1])) {
|
|
538
|
+
L(e, t, n, i);
|
|
477
539
|
return;
|
|
478
540
|
}
|
|
479
541
|
if (c.length === 0 && t.items.length > 0) {
|
|
480
|
-
|
|
542
|
+
L(e, t, n, i);
|
|
481
543
|
return;
|
|
482
544
|
}
|
|
483
|
-
t.items.forEach((
|
|
484
|
-
|
|
485
|
-
}),
|
|
545
|
+
t.items.forEach((p, f) => {
|
|
546
|
+
a[f] >= 0 && ne(e, p, n[a[f]], `${s}/${a[f]}`, r);
|
|
547
|
+
}), ke(
|
|
486
548
|
e,
|
|
487
|
-
t.items.map((
|
|
488
|
-
|
|
549
|
+
t.items.map((p) => ({ start: p.start, end: p.end })),
|
|
550
|
+
a.map((p) => p >= 0)
|
|
489
551
|
);
|
|
490
|
-
const
|
|
491
|
-
n.forEach((
|
|
492
|
-
if (
|
|
552
|
+
const u = t.items.length > 0 && t.items.every((p) => p.kind !== "scalar" && ye(e.text, p)), m = be(e, t, (b = t.items[0]) == null ? void 0 : b.start), h = /* @__PURE__ */ new Map();
|
|
553
|
+
n.forEach((p, f) => {
|
|
554
|
+
if (a.includes(f))
|
|
493
555
|
return;
|
|
494
|
-
let
|
|
495
|
-
for (let
|
|
496
|
-
if (
|
|
497
|
-
|
|
556
|
+
let y;
|
|
557
|
+
for (let w = t.items.length - 1; w >= 0; w--)
|
|
558
|
+
if (a[w] >= 0 && a[w] < f) {
|
|
559
|
+
y = w;
|
|
498
560
|
break;
|
|
499
561
|
}
|
|
500
|
-
const
|
|
501
|
-
|
|
562
|
+
const k = r ? N(p, e.format, e.compact) : u ? `${m}${N(p, e.format)}` : `${m}${I(p, e.format, m)}`, g = h.get(y) ?? [];
|
|
563
|
+
g.push(k), h.set(y, g);
|
|
502
564
|
});
|
|
503
|
-
for (const [
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
565
|
+
for (const [p, f] of h) {
|
|
566
|
+
const y = p === void 0 ? void 0 : t.items[p].end;
|
|
567
|
+
if (p === void 0 && c.length > 0) {
|
|
568
|
+
const k = t.items[a.findIndex((w) => w >= 0)], g = r ? he(e) : `,${e.format.eol}`;
|
|
507
569
|
e.edits.push({
|
|
508
|
-
start:
|
|
509
|
-
end:
|
|
510
|
-
text:
|
|
570
|
+
start: k.start,
|
|
571
|
+
end: k.start,
|
|
572
|
+
text: r ? f.join(g) + g : f.join(g).trimStart() + g + m
|
|
511
573
|
});
|
|
512
574
|
continue;
|
|
513
575
|
}
|
|
514
|
-
|
|
576
|
+
r ? ve(e, t, y, f) : we(e, t, y, f);
|
|
515
577
|
}
|
|
516
578
|
}
|
|
517
|
-
const
|
|
518
|
-
function
|
|
579
|
+
const Ue = 4e6;
|
|
580
|
+
function Ve(e, t) {
|
|
519
581
|
const n = e.length, s = t.length;
|
|
520
|
-
if (n * s >
|
|
521
|
-
return e.map((c,
|
|
522
|
-
const
|
|
582
|
+
if (n * s > Ue)
|
|
583
|
+
return e.map((c, u) => u < s ? u : -1);
|
|
584
|
+
const i = e.map((c) => JSON.stringify(c)), r = t.map((c) => JSON.stringify(c)), o = Array.from({ length: n + 1 }, () => new Uint32Array(s + 1));
|
|
523
585
|
for (let c = n - 1; c >= 0; c--)
|
|
524
|
-
for (let
|
|
525
|
-
|
|
586
|
+
for (let u = s - 1; u >= 0; u--)
|
|
587
|
+
o[c][u] = i[c] === r[u] ? o[c + 1][u + 1] + 1 : Math.max(o[c + 1][u], o[c][u + 1]);
|
|
526
588
|
const l = new Array(n).fill(-1);
|
|
527
|
-
let
|
|
528
|
-
for (;
|
|
529
|
-
|
|
589
|
+
let d = 0, a = 0;
|
|
590
|
+
for (; d < n && a < s; )
|
|
591
|
+
i[d] === r[a] ? l[d++] = a++ : o[d + 1][a] >= o[d][a + 1] ? d++ : a++;
|
|
530
592
|
return l;
|
|
531
593
|
}
|
|
532
|
-
function
|
|
594
|
+
function ke(e, t, n) {
|
|
533
595
|
for (let s = 0; s < t.length; s++) {
|
|
534
596
|
if (n[s])
|
|
535
597
|
continue;
|
|
536
|
-
let
|
|
537
|
-
for (;
|
|
538
|
-
|
|
539
|
-
|
|
598
|
+
let i = s;
|
|
599
|
+
for (; i + 1 < t.length && !n[i + 1]; )
|
|
600
|
+
i++;
|
|
601
|
+
i + 1 < t.length ? e.edits.push({ start: t[s].start, end: t[i + 1].start, text: "" }) : s > 0 ? e.edits.push({ start: t[s - 1].end, end: t[i].end, text: "" }) : e.edits.push({ start: t[s].start, end: t[i].end, text: "" }), s = i;
|
|
540
602
|
}
|
|
541
603
|
}
|
|
542
|
-
function
|
|
543
|
-
const
|
|
604
|
+
function we(e, t, n, s) {
|
|
605
|
+
const i = e.format.eol;
|
|
544
606
|
if (n !== void 0) {
|
|
545
|
-
e.edits.push({ start: n, end: n, text: `,${
|
|
607
|
+
e.edits.push({ start: n, end: n, text: `,${i}${s.join(`,${i}`)}` });
|
|
546
608
|
return;
|
|
547
609
|
}
|
|
548
|
-
const
|
|
610
|
+
const r = t.end - 1;
|
|
549
611
|
if ((t.kind === "object" ? t.members.length : t.items.length) === 0)
|
|
550
612
|
e.edits.push({
|
|
551
613
|
start: t.start + 1,
|
|
552
|
-
end:
|
|
553
|
-
text: `${
|
|
614
|
+
end: r,
|
|
615
|
+
text: `${i}${s.join(`,${i}`)}${i}${q(e.text, t.start)}`
|
|
554
616
|
});
|
|
555
617
|
else {
|
|
556
618
|
const l = t.kind === "object" ? t.members[0].start : t.items[0].start;
|
|
557
|
-
e.edits.push({ start: l, end: l, text: `${s.join(`,${
|
|
619
|
+
e.edits.push({ start: l, end: l, text: `${s.join(`,${i}`).trimStart()}` });
|
|
558
620
|
}
|
|
559
621
|
}
|
|
560
|
-
function
|
|
561
|
-
const
|
|
622
|
+
function ve(e, t, n, s) {
|
|
623
|
+
const i = he(e);
|
|
562
624
|
if (n !== void 0) {
|
|
563
|
-
e.edits.push({ start: n, end: n, text: `${
|
|
625
|
+
e.edits.push({ start: n, end: n, text: `${i}${s.join(i)}` });
|
|
564
626
|
return;
|
|
565
627
|
}
|
|
566
|
-
const
|
|
628
|
+
const r = t.kind === "object" && !e.compact ? " " : "";
|
|
567
629
|
e.edits.push({
|
|
568
630
|
start: t.start + 1,
|
|
569
631
|
end: t.end - 1,
|
|
570
|
-
text: `${
|
|
632
|
+
text: `${r}${s.join(i)}${r}`
|
|
571
633
|
});
|
|
572
634
|
}
|
|
573
|
-
function
|
|
635
|
+
function We(e) {
|
|
574
636
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
575
637
|
}
|
|
576
|
-
|
|
577
|
-
|
|
638
|
+
function ze(e, t, n, s, i) {
|
|
639
|
+
const r = t.prefix ?? "";
|
|
640
|
+
if (!e.startsWith(r))
|
|
641
|
+
return null;
|
|
642
|
+
const o = e.slice(r.length), l = t.part ?? "whole";
|
|
643
|
+
if (!i.qualifiedOnly && o === n)
|
|
644
|
+
return r + s;
|
|
645
|
+
switch (l) {
|
|
646
|
+
case "head":
|
|
647
|
+
return !i.qualifiedOnly && o.startsWith(`${n}.`) ? r + s + o.slice(n.length) : null;
|
|
648
|
+
case "query":
|
|
649
|
+
return !i.qualifiedOnly && o.startsWith(`${n}?`) ? r + s + o.slice(n.length) : null;
|
|
650
|
+
case "tail":
|
|
651
|
+
for (const d of i.qualifiers ?? [])
|
|
652
|
+
for (const a of [".", "/"])
|
|
653
|
+
if (o === `${d}${a}${n}`)
|
|
654
|
+
return `${r}${d}${a}${s}`;
|
|
655
|
+
return null;
|
|
656
|
+
default:
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
const Be = (e, t, n) => (!e.files || e.files.test(t)) && !("table" in e && e.table && n.ownTable), Xe = (e, t) => {
|
|
661
|
+
const n = t.split(".");
|
|
662
|
+
return n.length > e.length ? !1 : n.every((s, i) => s === "*" || e[e.length - n.length + i] === s);
|
|
663
|
+
};
|
|
664
|
+
function $e(e, t, n, s, i) {
|
|
665
|
+
let r = 0;
|
|
666
|
+
const o = t.filter((f) => "prop" in f), l = t.flatMap(
|
|
667
|
+
(f) => "value" in f ? [[f.value.replace("{name}", n), f.value.replace("{name}", s)]] : []
|
|
668
|
+
), d = t.filter(
|
|
669
|
+
(f) => "keysOf" in f
|
|
670
|
+
), a = t.flatMap(
|
|
671
|
+
(f) => "keyPattern" in f ? [[f.keyPattern.replace("{name}", n), f.keyPattern.replace("{name}", s)]] : []
|
|
672
|
+
), c = new Set(t.flatMap((f) => "jsonIn" in f ? [f.jsonIn] : [])), u = (f) => {
|
|
673
|
+
for (const [y, k] of l)
|
|
674
|
+
if (f === y)
|
|
675
|
+
return k;
|
|
676
|
+
return null;
|
|
677
|
+
}, m = (f, y, k) => {
|
|
678
|
+
if (y !== null) {
|
|
679
|
+
for (const w of o)
|
|
680
|
+
if (w.prop === y && (!w.within || w.within === k)) {
|
|
681
|
+
const A = ze(f, w, n, s, i);
|
|
682
|
+
if (A !== null)
|
|
683
|
+
return r++, A;
|
|
684
|
+
}
|
|
685
|
+
if (c.has(y))
|
|
686
|
+
try {
|
|
687
|
+
const w = $e(JSON.parse(f), t, n, s, i);
|
|
688
|
+
if (w.count > 0)
|
|
689
|
+
return r += w.count, JSON.stringify(w.value);
|
|
690
|
+
} catch {
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
const g = i.qualifiedOnly ? null : u(f);
|
|
694
|
+
return g !== null ? (r++, g) : f;
|
|
695
|
+
}, h = (f, y) => {
|
|
696
|
+
if (i.qualifiedOnly)
|
|
697
|
+
return f;
|
|
698
|
+
for (const k of d) {
|
|
699
|
+
const g = k.prefix ?? "";
|
|
700
|
+
if (f === g + n && Xe(y, k.keysOf))
|
|
701
|
+
return r++, g + s;
|
|
702
|
+
}
|
|
703
|
+
for (const [k, g] of a)
|
|
704
|
+
if (f.startsWith(k))
|
|
705
|
+
return r++, g + f.slice(k.length);
|
|
706
|
+
return f;
|
|
707
|
+
}, b = (f, y, k, g) => {
|
|
708
|
+
if (typeof f == "string")
|
|
709
|
+
return m(f, y, k);
|
|
710
|
+
if (Array.isArray(f)) {
|
|
711
|
+
let w = !1;
|
|
712
|
+
const A = f.map((E) => {
|
|
713
|
+
const M = b(E, y, y ?? k, g);
|
|
714
|
+
return w || (w = M !== E), M;
|
|
715
|
+
});
|
|
716
|
+
return w ? A : f;
|
|
717
|
+
}
|
|
718
|
+
if (f && typeof f == "object") {
|
|
719
|
+
let w = !1;
|
|
720
|
+
const A = {};
|
|
721
|
+
for (const [E, M] of Object.entries(f)) {
|
|
722
|
+
const ie = h(E, g), re = b(M, E, y, [...g, E]);
|
|
723
|
+
w || (w = ie !== E || re !== M), A[ie] = re;
|
|
724
|
+
}
|
|
725
|
+
return w ? A : f;
|
|
726
|
+
}
|
|
727
|
+
return f;
|
|
728
|
+
};
|
|
729
|
+
return { value: b(e, null, null, []), count: r };
|
|
730
|
+
}
|
|
731
|
+
function Ze(e, t, n, s, i = {}) {
|
|
732
|
+
const r = [];
|
|
733
|
+
let o = 0;
|
|
734
|
+
if (!n || !s || n === s)
|
|
735
|
+
return { files: r, count: o };
|
|
736
|
+
for (const l of e) {
|
|
737
|
+
if (!/\.json$/i.test(l.path))
|
|
738
|
+
continue;
|
|
739
|
+
const d = t.filter((u) => Be(u, l.path, i));
|
|
740
|
+
if (d.length === 0)
|
|
741
|
+
continue;
|
|
742
|
+
let a;
|
|
743
|
+
try {
|
|
744
|
+
a = K(l.text).value;
|
|
745
|
+
} catch {
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
const c = $e(a, d, n, s, i);
|
|
749
|
+
c.count > 0 && (o += c.count, r.push({ path: l.path, text: ee(l.text, c.value) }));
|
|
750
|
+
}
|
|
751
|
+
return { files: r, count: o };
|
|
752
|
+
}
|
|
753
|
+
function _t(e, t, n, s = {}) {
|
|
754
|
+
const i = `${n}\0`, r = [];
|
|
755
|
+
for (const o of e) {
|
|
756
|
+
const l = Ze([o], t, n, i, s);
|
|
757
|
+
l.count > 0 && r.push({ path: o.path, count: l.count });
|
|
758
|
+
}
|
|
759
|
+
return r;
|
|
760
|
+
}
|
|
761
|
+
function Ge(e, t, n = []) {
|
|
762
|
+
const s = t.filter((l) => "prop" in l && l.part === "tail"), i = [], r = /* @__PURE__ */ new Set(), o = (l, d, a, c) => {
|
|
763
|
+
if (typeof l == "string")
|
|
764
|
+
for (const u of s) {
|
|
765
|
+
if (u.prop !== d || u.within && u.within !== a)
|
|
766
|
+
continue;
|
|
767
|
+
const m = l.startsWith(u.prefix ?? "") ? l.slice((u.prefix ?? "").length) : "", h = Math.max(m.lastIndexOf("."), m.lastIndexOf("/"));
|
|
768
|
+
if (h > 0 && h < m.length - 1) {
|
|
769
|
+
const b = m.slice(0, h), p = m.slice(h + 1), f = `${b}\0${p}\0${c}`;
|
|
770
|
+
!n.includes(b) && !r.has(f) && (r.add(f), i.push({ qualifier: b, name: p, path: c }));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
else if (Array.isArray(l))
|
|
774
|
+
l.forEach((u) => o(u, d, d ?? a, c));
|
|
775
|
+
else if (l && typeof l == "object")
|
|
776
|
+
for (const [u, m] of Object.entries(l))
|
|
777
|
+
o(m, u, d, c);
|
|
778
|
+
};
|
|
779
|
+
for (const l of e)
|
|
780
|
+
if (!(!/\.json$/i.test(l.path) || !s.some((d) => !d.files || d.files.test(l.path))))
|
|
781
|
+
try {
|
|
782
|
+
o(K(l.text).value, null, null, l.path);
|
|
783
|
+
} catch {
|
|
784
|
+
}
|
|
785
|
+
return i;
|
|
786
|
+
}
|
|
787
|
+
function He(e, t, n, s = []) {
|
|
788
|
+
const i = (d) => d.replace(/[\\/]/g, ".").toLowerCase(), r = e.map((d) => ({ ...d })), o = new Map(r.map((d) => [i(d.id), d])), l = new Set(s.map(i));
|
|
789
|
+
for (const d of Ge(t, n, s)) {
|
|
790
|
+
const a = i(d.qualifier);
|
|
791
|
+
if (l.has(a))
|
|
792
|
+
continue;
|
|
793
|
+
let c = o.get(a);
|
|
794
|
+
c || (c = { id: d.qualifier, via: "reference", refers: [] }, o.set(a, c), r.push(c));
|
|
795
|
+
const u = c.refers ?? (c.refers = []);
|
|
796
|
+
u.includes(d.name) || u.push(d.name);
|
|
797
|
+
}
|
|
798
|
+
return r;
|
|
799
|
+
}
|
|
800
|
+
const x = (e) => e.slice(e.lastIndexOf("/") + 1), Qe = (e) => e.charCodeAt(0) === 65279 ? e.slice(1) : e;
|
|
801
|
+
function D(e) {
|
|
578
802
|
return {
|
|
579
803
|
id: e.id,
|
|
580
804
|
label: e.label,
|
|
@@ -583,19 +807,19 @@ function M(e) {
|
|
|
583
807
|
match: e.match,
|
|
584
808
|
editor: e.editor,
|
|
585
809
|
decode(t, n) {
|
|
586
|
-
return e.select(
|
|
810
|
+
return e.select(K(t[0].text).value, n);
|
|
587
811
|
},
|
|
588
812
|
encode(t, n, s) {
|
|
589
|
-
const
|
|
813
|
+
const i = n[0].text, r = K(i).value, o = e.assign(r, t, s);
|
|
590
814
|
return {
|
|
591
815
|
files: [
|
|
592
|
-
{ path: n[0].path, text:
|
|
816
|
+
{ path: n[0].path, text: ee(i, o, { arrayKey: e.arrayKey }) }
|
|
593
817
|
]
|
|
594
818
|
};
|
|
595
819
|
}
|
|
596
820
|
};
|
|
597
821
|
}
|
|
598
|
-
const
|
|
822
|
+
const B = D({
|
|
599
823
|
id: "json",
|
|
600
824
|
label: "JSON",
|
|
601
825
|
labelKey: "devStudio.kind.json",
|
|
@@ -604,7 +828,7 @@ const z = M({
|
|
|
604
828
|
editor: "json",
|
|
605
829
|
select: (e) => e,
|
|
606
830
|
assign: (e, t) => t
|
|
607
|
-
}),
|
|
831
|
+
}), X = {
|
|
608
832
|
id: "text",
|
|
609
833
|
label: "Text",
|
|
610
834
|
labelKey: "devStudio.kind.text",
|
|
@@ -613,87 +837,87 @@ const z = M({
|
|
|
613
837
|
editor: "text",
|
|
614
838
|
decode: (e) => e[0].text,
|
|
615
839
|
encode: (e, t) => ({
|
|
616
|
-
files: [{ path: t[0].path, text:
|
|
840
|
+
files: [{ path: t[0].path, text: Fe(e, t[0].text) }]
|
|
617
841
|
})
|
|
618
842
|
};
|
|
619
|
-
function
|
|
620
|
-
return e.find((n) => n.match(t)) ?? (
|
|
843
|
+
function Ye(e, t) {
|
|
844
|
+
return e.find((n) => n.match(t)) ?? (B.match(t) ? B : X);
|
|
621
845
|
}
|
|
622
|
-
function
|
|
623
|
-
for (const s of [
|
|
846
|
+
function et(e, t, n) {
|
|
847
|
+
for (const s of [B, X])
|
|
624
848
|
if (s.match(e.path))
|
|
625
849
|
try {
|
|
626
|
-
const
|
|
850
|
+
const i = s.decode([e], n);
|
|
627
851
|
return {
|
|
628
852
|
key: `${s.id}:${e.path}`,
|
|
629
853
|
kind: s,
|
|
630
854
|
paths: [e.path],
|
|
631
|
-
label:
|
|
632
|
-
model:
|
|
855
|
+
label: x(e.path),
|
|
856
|
+
model: i,
|
|
633
857
|
error: t
|
|
634
858
|
};
|
|
635
859
|
} catch {
|
|
636
860
|
}
|
|
637
861
|
return {
|
|
638
862
|
key: `text:${e.path}`,
|
|
639
|
-
kind:
|
|
863
|
+
kind: X,
|
|
640
864
|
paths: [e.path],
|
|
641
|
-
label:
|
|
865
|
+
label: x(e.path),
|
|
642
866
|
model: e.text,
|
|
643
867
|
error: t
|
|
644
868
|
};
|
|
645
869
|
}
|
|
646
|
-
function
|
|
647
|
-
var l,
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
throw new Error(`${
|
|
870
|
+
function tt(e, t, n, s) {
|
|
871
|
+
var l, d;
|
|
872
|
+
const i = e.encode(t, n, s), r = new Map(n.map((a) => [a.path, a.text])), o = ((l = i.files.find((a) => r.get(a.path) !== a.text)) == null ? void 0 : l.path) ?? ((d = i.deleted) == null ? void 0 : d.find((a) => r.has(a)));
|
|
873
|
+
if (o !== void 0)
|
|
874
|
+
throw new Error(`${x(o)} would not be stored as it is`);
|
|
651
875
|
}
|
|
652
|
-
function
|
|
876
|
+
function Ut(e, t, n) {
|
|
653
877
|
const s = /* @__PURE__ */ new Map();
|
|
654
|
-
for (const
|
|
655
|
-
const
|
|
656
|
-
|
|
878
|
+
for (const r of t) {
|
|
879
|
+
const o = Ye(e, r.path), l = o.group ? o.group(r.path) : r.path, d = `${o.id}:${l}`, a = s.get(d) ?? { kind: o, group: l, files: [] };
|
|
880
|
+
a.files.push(r), s.set(d, a);
|
|
657
881
|
}
|
|
658
|
-
const
|
|
659
|
-
for (const [
|
|
660
|
-
const
|
|
882
|
+
const i = [];
|
|
883
|
+
for (const [r, { kind: o, group: l, files: d }] of s) {
|
|
884
|
+
const a = d.map((u) => u.path).sort(), c = x(o.group ? l : a[0]);
|
|
661
885
|
try {
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
} catch (
|
|
665
|
-
const
|
|
666
|
-
for (const h of
|
|
667
|
-
|
|
886
|
+
const u = o.decode(d, n);
|
|
887
|
+
tt(o, u, d, n), i.push({ key: r, kind: o, paths: a, label: c, model: u });
|
|
888
|
+
} catch (u) {
|
|
889
|
+
const m = u instanceof Error ? u.message : String(u);
|
|
890
|
+
for (const h of d)
|
|
891
|
+
i.push(et(h, m, n));
|
|
668
892
|
}
|
|
669
893
|
}
|
|
670
|
-
return
|
|
894
|
+
return i.sort((r, o) => r.label.localeCompare(o.label));
|
|
671
895
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
674
|
-
for (const
|
|
675
|
-
const
|
|
676
|
-
|
|
896
|
+
function Vt(e, t, n, s) {
|
|
897
|
+
const i = n.filter((d) => e.paths.includes(d.path)), r = e.kind.encode(t, i, s), o = new Map(n.map((d) => [d.path, d])), l = [];
|
|
898
|
+
for (const d of r.files) {
|
|
899
|
+
const a = o.get(d.path);
|
|
900
|
+
a && a.text === d.text || l.push({ type: "write", path: d.path, text: d.text, baseVersion: a == null ? void 0 : a.version });
|
|
677
901
|
}
|
|
678
|
-
for (const
|
|
679
|
-
const
|
|
680
|
-
|
|
902
|
+
for (const d of r.deleted ?? []) {
|
|
903
|
+
const a = o.get(d);
|
|
904
|
+
a && l.push({ type: "delete", path: d, baseVersion: a.version });
|
|
681
905
|
}
|
|
682
906
|
return l;
|
|
683
907
|
}
|
|
684
|
-
function
|
|
908
|
+
function nt(e, t) {
|
|
685
909
|
try {
|
|
686
|
-
return JSON.parse(
|
|
910
|
+
return JSON.parse(Qe(e));
|
|
687
911
|
} catch {
|
|
688
912
|
return t;
|
|
689
913
|
}
|
|
690
914
|
}
|
|
691
|
-
const
|
|
915
|
+
const $ = (e) => typeof e == "object" && e !== null && !Array.isArray(e), S = (...e) => (t) => {
|
|
692
916
|
const n = t.toLowerCase();
|
|
693
917
|
return e.some((s) => n.endsWith(s.toLowerCase()));
|
|
694
918
|
};
|
|
695
|
-
function
|
|
696
|
-
return
|
|
919
|
+
function R(e) {
|
|
920
|
+
return D({
|
|
697
921
|
id: e.id,
|
|
698
922
|
label: e.label,
|
|
699
923
|
labelKey: e.labelKey,
|
|
@@ -703,54 +927,54 @@ function P(e) {
|
|
|
703
927
|
select: (t) => {
|
|
704
928
|
if (Array.isArray(t))
|
|
705
929
|
return t;
|
|
706
|
-
const n =
|
|
930
|
+
const n = $(t) ? t[e.property] : void 0;
|
|
707
931
|
return Array.isArray(n) ? n : [];
|
|
708
932
|
},
|
|
709
|
-
assign: (t, n) => Array.isArray(t) ? n :
|
|
933
|
+
assign: (t, n) => Array.isArray(t) ? n : $(t) && !(e.property in t) && n.length === 0 ? t : { ...$(t) ? t : {}, [e.property]: n },
|
|
710
934
|
arrayKey: e.itemKey ? () => e.itemKey : void 0
|
|
711
935
|
});
|
|
712
936
|
}
|
|
713
|
-
function
|
|
714
|
-
const t =
|
|
937
|
+
function Se(e) {
|
|
938
|
+
const t = R(e);
|
|
715
939
|
return {
|
|
716
940
|
...t,
|
|
717
|
-
decode: (n, s) => t.decode(n, s).map((
|
|
718
|
-
encode: (n, s,
|
|
719
|
-
n.map((
|
|
941
|
+
decode: (n, s) => t.decode(n, s).map((i, r) => e.toItem(i, r)),
|
|
942
|
+
encode: (n, s, i) => t.encode(
|
|
943
|
+
n.map((r) => e.fromItem(r)),
|
|
720
944
|
s,
|
|
721
|
-
|
|
945
|
+
i
|
|
722
946
|
)
|
|
723
947
|
};
|
|
724
948
|
}
|
|
725
|
-
function
|
|
726
|
-
return
|
|
949
|
+
function _(e) {
|
|
950
|
+
return D({
|
|
727
951
|
...e,
|
|
728
|
-
select: (t) =>
|
|
952
|
+
select: (t) => $(t) ? t : {},
|
|
729
953
|
assign: (t, n) => n
|
|
730
954
|
});
|
|
731
955
|
}
|
|
732
|
-
const
|
|
733
|
-
const t =
|
|
956
|
+
const st = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, it = (e) => {
|
|
957
|
+
const t = st.exec(e);
|
|
734
958
|
return t ? { group: t[1], locale: t[2] } : null;
|
|
735
|
-
},
|
|
736
|
-
function
|
|
737
|
-
if (
|
|
959
|
+
}, Z = (e) => $(e) && Object.values(e).every((t) => typeof t == "string");
|
|
960
|
+
function rt(e) {
|
|
961
|
+
if ($(e)) {
|
|
738
962
|
for (const t of ["translations", "keys"])
|
|
739
963
|
if (t in e) {
|
|
740
|
-
if (
|
|
964
|
+
if (Z(e[t]))
|
|
741
965
|
return e[t];
|
|
742
966
|
throw new Error(`"${t}" is not a flat map of texts`);
|
|
743
967
|
}
|
|
744
|
-
if (
|
|
968
|
+
if (Z(e))
|
|
745
969
|
return e;
|
|
746
970
|
}
|
|
747
971
|
throw new Error("no translations in this file");
|
|
748
972
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
973
|
+
function ce(e, t) {
|
|
974
|
+
return $(e) ? $(e.translations) ? { ...e, translations: t } : $(e.keys) ? { ...e, keys: t } : Z(e) ? t : { ...e, translations: t } : { translations: t };
|
|
751
975
|
}
|
|
752
|
-
function
|
|
753
|
-
const t = e.parse ??
|
|
976
|
+
function ot(e = {}) {
|
|
977
|
+
const t = e.parse ?? it, n = e.pathFor ?? ((s, i) => `${s}.${i}.i18n.json`);
|
|
754
978
|
return {
|
|
755
979
|
id: e.id ?? "i18n",
|
|
756
980
|
label: e.label ?? "Translations",
|
|
@@ -759,65 +983,65 @@ function ze(e = {}) {
|
|
|
759
983
|
editor: "i18n",
|
|
760
984
|
match: (s) => t(s) !== null,
|
|
761
985
|
group: (s) => {
|
|
762
|
-
var
|
|
763
|
-
return ((
|
|
986
|
+
var i;
|
|
987
|
+
return ((i = t(s)) == null ? void 0 : i.group) ?? s;
|
|
764
988
|
},
|
|
765
989
|
decode(s) {
|
|
766
|
-
const
|
|
767
|
-
for (const
|
|
768
|
-
const
|
|
769
|
-
|
|
990
|
+
const i = {};
|
|
991
|
+
for (const r of s) {
|
|
992
|
+
const o = t(r.path);
|
|
993
|
+
o && (i[o.locale] = { ...rt(K(r.text).value) });
|
|
770
994
|
}
|
|
771
|
-
return
|
|
995
|
+
return i;
|
|
772
996
|
},
|
|
773
|
-
encode(s,
|
|
774
|
-
const
|
|
775
|
-
let
|
|
776
|
-
for (const c of
|
|
777
|
-
const
|
|
778
|
-
|
|
997
|
+
encode(s, i) {
|
|
998
|
+
const r = /* @__PURE__ */ new Map();
|
|
999
|
+
let o = "";
|
|
1000
|
+
for (const c of i) {
|
|
1001
|
+
const u = t(c.path);
|
|
1002
|
+
u && (r.set(u.locale, c), o = u.group);
|
|
779
1003
|
}
|
|
780
|
-
const l =
|
|
781
|
-
for (const [c,
|
|
782
|
-
const
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
path:
|
|
787
|
-
text:
|
|
1004
|
+
const l = r.get("en") ?? i[0], d = [];
|
|
1005
|
+
for (const [c, u] of Object.entries(s)) {
|
|
1006
|
+
const m = r.get(c);
|
|
1007
|
+
if (m) {
|
|
1008
|
+
const b = K(m.text).value;
|
|
1009
|
+
d.push({
|
|
1010
|
+
path: m.path,
|
|
1011
|
+
text: ee(m.text, ce(b, u))
|
|
788
1012
|
});
|
|
789
1013
|
continue;
|
|
790
1014
|
}
|
|
791
|
-
const h = n(
|
|
1015
|
+
const h = n(o || x((l == null ? void 0 : l.path) ?? "module"), c);
|
|
792
1016
|
if (l) {
|
|
793
|
-
const
|
|
794
|
-
|
|
1017
|
+
const b = K(l.text).value, p = $(b) && "locale" in b ? { ...b, locale: c } : b;
|
|
1018
|
+
d.push({
|
|
795
1019
|
path: h,
|
|
796
|
-
text:
|
|
797
|
-
|
|
798
|
-
|
|
1020
|
+
text: j(
|
|
1021
|
+
ce(p, u),
|
|
1022
|
+
Y(l.text)
|
|
799
1023
|
)
|
|
800
1024
|
});
|
|
801
1025
|
} else
|
|
802
|
-
|
|
1026
|
+
d.push({ path: h, text: j({ locale: c, translations: u }) });
|
|
803
1027
|
}
|
|
804
|
-
const
|
|
805
|
-
return { files:
|
|
1028
|
+
const a = [...r.entries()].filter(([c]) => !(c in s)).map(([, c]) => c.path);
|
|
1029
|
+
return { files: d, deleted: a };
|
|
806
1030
|
}
|
|
807
1031
|
};
|
|
808
1032
|
}
|
|
809
|
-
const
|
|
1033
|
+
const O = (e) => typeof e == "object" && e !== null && !Array.isArray(e), at = [
|
|
810
1034
|
"frontend",
|
|
811
1035
|
"backend",
|
|
812
1036
|
"noCode",
|
|
813
1037
|
"sql"
|
|
814
|
-
],
|
|
1038
|
+
], Wt = [
|
|
815
1039
|
"preInstall",
|
|
816
1040
|
"postInstall",
|
|
817
1041
|
"preUninstall",
|
|
818
1042
|
"postUninstall"
|
|
819
1043
|
];
|
|
820
|
-
function
|
|
1044
|
+
function ct(e) {
|
|
821
1045
|
switch (e) {
|
|
822
1046
|
case "frontend":
|
|
823
1047
|
return ["typescript", "javascript"];
|
|
@@ -829,7 +1053,7 @@ function We(e) {
|
|
|
829
1053
|
return [];
|
|
830
1054
|
}
|
|
831
1055
|
}
|
|
832
|
-
const
|
|
1056
|
+
const lt = /* @__PURE__ */ new Set([
|
|
833
1057
|
"read",
|
|
834
1058
|
"filter",
|
|
835
1059
|
"map",
|
|
@@ -840,16 +1064,16 @@ const Be = /* @__PURE__ */ new Set([
|
|
|
840
1064
|
"write",
|
|
841
1065
|
"callScript",
|
|
842
1066
|
"return"
|
|
843
|
-
]),
|
|
844
|
-
function
|
|
845
|
-
if (
|
|
1067
|
+
]), je = (e) => Array.isArray(e) && e.every((t) => O(t) && typeof t.id == "string" && lt.has(String(t.type)));
|
|
1068
|
+
function G(e) {
|
|
1069
|
+
if (at.includes(e.kind))
|
|
846
1070
|
return e.kind;
|
|
847
|
-
if (e.source === void 0 &&
|
|
1071
|
+
if (e.source === void 0 && je(e.steps))
|
|
848
1072
|
return "noCode";
|
|
849
1073
|
const t = typeof e.language == "string" ? e.language.toLowerCase() : "";
|
|
850
1074
|
return t.endsWith("sql") || e.source === void 0 && typeof e.sql == "string" ? "sql" : /^(csharp|c#|cs\b)/.test(t) ? "backend" : "frontend";
|
|
851
1075
|
}
|
|
852
|
-
const
|
|
1076
|
+
const Oe = [
|
|
853
1077
|
"id",
|
|
854
1078
|
"displayName",
|
|
855
1079
|
"description",
|
|
@@ -859,108 +1083,108 @@ const be = [
|
|
|
859
1083
|
"returnType",
|
|
860
1084
|
"source",
|
|
861
1085
|
"sourcePath"
|
|
862
|
-
],
|
|
863
|
-
function
|
|
1086
|
+
], dt = (e) => Array.isArray(e) && e.every((t) => O(t) && typeof t.name == "string");
|
|
1087
|
+
function ft(e, t) {
|
|
864
1088
|
const n = `#${t + 1}`;
|
|
865
|
-
if (
|
|
866
|
-
const l =
|
|
1089
|
+
if (!O(e) || typeof e.name != "string" || !e.name) {
|
|
1090
|
+
const l = O(e) && typeof e.displayName == "string" ? e.displayName : n;
|
|
867
1091
|
return { key: `#${t}`, label: l, rawReason: "no name", source: e };
|
|
868
1092
|
}
|
|
869
|
-
const s = e.name,
|
|
1093
|
+
const s = e.name, i = typeof e.displayName == "string" && e.displayName ? e.displayName : s, r = (l) => ({
|
|
870
1094
|
key: s,
|
|
871
|
-
label:
|
|
1095
|
+
label: i,
|
|
872
1096
|
rawReason: l,
|
|
873
1097
|
source: e
|
|
874
|
-
}),
|
|
875
|
-
for (const l of
|
|
876
|
-
const
|
|
877
|
-
if (
|
|
878
|
-
if (typeof
|
|
879
|
-
return
|
|
880
|
-
|
|
1098
|
+
}), o = { name: s, kind: G(e) };
|
|
1099
|
+
for (const l of Oe) {
|
|
1100
|
+
const d = e[l];
|
|
1101
|
+
if (d !== void 0) {
|
|
1102
|
+
if (typeof d != "string")
|
|
1103
|
+
return r(`"${l}" is not text`);
|
|
1104
|
+
o[l] = d;
|
|
881
1105
|
}
|
|
882
1106
|
}
|
|
883
1107
|
if (e.parameters !== void 0) {
|
|
884
|
-
if (!
|
|
885
|
-
return
|
|
886
|
-
|
|
1108
|
+
if (!dt(e.parameters))
|
|
1109
|
+
return r('"parameters" is not a list of named parameters');
|
|
1110
|
+
o.parameters = e.parameters;
|
|
887
1111
|
}
|
|
888
|
-
if (
|
|
889
|
-
if (e.steps !== void 0 && !
|
|
890
|
-
return
|
|
891
|
-
|
|
1112
|
+
if (o.kind === "noCode") {
|
|
1113
|
+
if (e.steps !== void 0 && !je(e.steps))
|
|
1114
|
+
return r('"steps" are not no-code steps');
|
|
1115
|
+
o.steps = e.steps ?? [];
|
|
892
1116
|
}
|
|
893
|
-
return { key: s, label:
|
|
1117
|
+
return { key: s, label: i, definition: o, source: e };
|
|
894
1118
|
}
|
|
895
|
-
function
|
|
1119
|
+
function ut(e) {
|
|
896
1120
|
const t = e.definition;
|
|
897
1121
|
if (!t)
|
|
898
1122
|
return e.source;
|
|
899
|
-
const n =
|
|
900
|
-
for (const
|
|
901
|
-
t[
|
|
902
|
-
return t.parameters === void 0 ? delete s.parameters : s.parameters = t.parameters, t.kind === "noCode" ? s.steps = t.steps ?? [] :
|
|
1123
|
+
const n = O(e.source) ? e.source : {}, s = { ...n, name: t.name };
|
|
1124
|
+
for (const i of Oe)
|
|
1125
|
+
t[i] === void 0 ? delete s[i] : s[i] = t[i];
|
|
1126
|
+
return t.parameters === void 0 ? delete s.parameters : s.parameters = t.parameters, t.kind === "noCode" ? s.steps = t.steps ?? [] : G(n) === "noCode" && delete s.steps, delete s.kind, ("kind" in n || G(s) !== t.kind) && (s.kind = t.kind), s;
|
|
903
1127
|
}
|
|
904
|
-
function
|
|
1128
|
+
function V(e) {
|
|
905
1129
|
const t = /* @__PURE__ */ new Set();
|
|
906
1130
|
return e.map((n, s) => {
|
|
907
|
-
const
|
|
908
|
-
return t.has(
|
|
1131
|
+
const i = ft(n, s);
|
|
1132
|
+
return t.has(i.key) && (i.key = `${i.key}#${s}`), t.add(i.key), i;
|
|
909
1133
|
});
|
|
910
1134
|
}
|
|
911
|
-
function
|
|
912
|
-
if (
|
|
1135
|
+
function le(e, t) {
|
|
1136
|
+
if (!O(e) || !Object.values(e).every((n) => Array.isArray(n) && n.every((s) => typeof s == "string")))
|
|
913
1137
|
throw new Error(`"${t}" is not lists of SQL statements per phase`);
|
|
914
1138
|
return e;
|
|
915
1139
|
}
|
|
916
|
-
function
|
|
917
|
-
const t = e.property ?? "scripts", n = e.phasesProperty ?? "phases", s = t === n,
|
|
918
|
-
return
|
|
1140
|
+
function pt(e) {
|
|
1141
|
+
const t = e.property ?? "scripts", n = e.phasesProperty ?? "phases", s = t === n, i = (r) => r.scripts.map(ut);
|
|
1142
|
+
return D({
|
|
919
1143
|
id: e.id ?? "scripts",
|
|
920
1144
|
label: e.label ?? "Scripts",
|
|
921
1145
|
labelKey: e.labelKey ?? "devStudio.kind.scripts",
|
|
922
1146
|
icon: e.icon ?? "code",
|
|
923
1147
|
editor: "scriptList",
|
|
924
1148
|
match: e.match,
|
|
925
|
-
select: (
|
|
926
|
-
if (Array.isArray(
|
|
927
|
-
return { scripts:
|
|
928
|
-
if (
|
|
1149
|
+
select: (r) => {
|
|
1150
|
+
if (Array.isArray(r))
|
|
1151
|
+
return { scripts: V(r), ...s ? { holds: "scripts" } : {} };
|
|
1152
|
+
if (!O(r) || r[t] === void 0 && r[n] === void 0)
|
|
929
1153
|
throw new Error(`no "${t}" in this file`);
|
|
930
|
-
const
|
|
1154
|
+
const o = r[t];
|
|
931
1155
|
if (s)
|
|
932
|
-
return Array.isArray(
|
|
933
|
-
if (
|
|
1156
|
+
return Array.isArray(o) ? { scripts: V(o), holds: "scripts" } : { scripts: [], phases: le(o, t), holds: "phases" };
|
|
1157
|
+
if (o !== void 0 && !Array.isArray(o))
|
|
934
1158
|
throw new Error(`"${t}" is not a list`);
|
|
935
|
-
const l =
|
|
1159
|
+
const l = r[n];
|
|
936
1160
|
return {
|
|
937
|
-
scripts:
|
|
938
|
-
...l !== void 0 ? { phases:
|
|
1161
|
+
scripts: V(o ?? []),
|
|
1162
|
+
...l !== void 0 ? { phases: le(l, n) } : {}
|
|
939
1163
|
};
|
|
940
1164
|
},
|
|
941
|
-
assign: (
|
|
942
|
-
if (
|
|
1165
|
+
assign: (r, o) => {
|
|
1166
|
+
if (o.holds === "phases" && o.scripts.length > 0)
|
|
943
1167
|
throw new Error("This file holds database scripts only; add scripts to another file.");
|
|
944
|
-
if (Array.isArray(
|
|
945
|
-
return
|
|
946
|
-
const l =
|
|
1168
|
+
if (Array.isArray(r) && o.phases === void 0)
|
|
1169
|
+
return i(o);
|
|
1170
|
+
const l = O(r) ? r : {};
|
|
947
1171
|
if (s)
|
|
948
1172
|
return {
|
|
949
1173
|
...l,
|
|
950
|
-
[t]:
|
|
1174
|
+
[t]: o.holds === "phases" ? o.phases ?? {} : i(o)
|
|
951
1175
|
};
|
|
952
|
-
const
|
|
953
|
-
return (t in l ||
|
|
1176
|
+
const d = { ...l };
|
|
1177
|
+
return (t in l || o.scripts.length > 0) && (d[t] = i(o)), o.phases === void 0 ? delete d[n] : d[n] = o.phases, d;
|
|
954
1178
|
},
|
|
955
|
-
arrayKey: (
|
|
1179
|
+
arrayKey: (r) => r === `/${t}` ? "name" : void 0
|
|
956
1180
|
});
|
|
957
1181
|
}
|
|
958
|
-
function
|
|
959
|
-
const n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((s,
|
|
1182
|
+
function mt(e) {
|
|
1183
|
+
const n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((s, i) => i === 0 ? s[0].toLowerCase() + s.slice(1) : s[0].toUpperCase() + s.slice(1)).join("");
|
|
960
1184
|
return /^[A-Za-z_]/.test(n) ? n : `script${n}`;
|
|
961
1185
|
}
|
|
962
|
-
function
|
|
963
|
-
const t =
|
|
1186
|
+
function zt(e) {
|
|
1187
|
+
const t = mt(e.name), n = e.language ?? ct(e.kind)[0], s = {
|
|
964
1188
|
name: t,
|
|
965
1189
|
kind: e.kind,
|
|
966
1190
|
...e.name !== t ? { displayName: e.name } : {},
|
|
@@ -968,7 +1192,7 @@ function At(e) {
|
|
|
968
1192
|
...e.category ? { category: e.category } : {},
|
|
969
1193
|
...e.trigger ? { trigger: e.trigger } : {},
|
|
970
1194
|
parameters: []
|
|
971
|
-
},
|
|
1195
|
+
}, i = t[0].toUpperCase() + t.slice(1);
|
|
972
1196
|
switch (e.kind) {
|
|
973
1197
|
case "noCode":
|
|
974
1198
|
return { ...s, steps: [] };
|
|
@@ -980,7 +1204,7 @@ SELECT 1;
|
|
|
980
1204
|
return {
|
|
981
1205
|
...s,
|
|
982
1206
|
returnType: "object",
|
|
983
|
-
source: n === "csharp" ? `public static object ${
|
|
1207
|
+
source: n === "csharp" ? `public static object ${i}(IDictionary<string, object> args)
|
|
984
1208
|
{
|
|
985
1209
|
return null;
|
|
986
1210
|
}
|
|
@@ -1001,27 +1225,27 @@ SELECT 1;
|
|
|
1001
1225
|
};
|
|
1002
1226
|
}
|
|
1003
1227
|
}
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1228
|
+
const F = (e) => JSON.parse(JSON.stringify(e));
|
|
1229
|
+
function Bt(e) {
|
|
1006
1230
|
const t = e.revisions !== !1;
|
|
1007
1231
|
let n = 0;
|
|
1008
|
-
const s = e.workspaces.map((
|
|
1232
|
+
const s = e.workspaces.map((a) => ({
|
|
1009
1233
|
meta: {
|
|
1010
|
-
id:
|
|
1011
|
-
label:
|
|
1012
|
-
description:
|
|
1013
|
-
icon:
|
|
1014
|
-
readOnly:
|
|
1234
|
+
id: a.id,
|
|
1235
|
+
label: a.label,
|
|
1236
|
+
description: a.description,
|
|
1237
|
+
icon: a.icon,
|
|
1238
|
+
readOnly: a.readOnly
|
|
1015
1239
|
},
|
|
1016
|
-
packages: new Map((
|
|
1240
|
+
packages: new Map((a.packages ?? []).map((c) => [c.id, { ...c, workspaceId: a.id }])),
|
|
1017
1241
|
modules: new Map(
|
|
1018
|
-
|
|
1242
|
+
a.modules.map((c) => [
|
|
1019
1243
|
c.id,
|
|
1020
1244
|
{
|
|
1021
1245
|
...c,
|
|
1022
1246
|
files: new Map(
|
|
1023
1247
|
Object.entries(c.files).map(
|
|
1024
|
-
([
|
|
1248
|
+
([u, m]) => [u, { text: m, version: ++n }]
|
|
1025
1249
|
)
|
|
1026
1250
|
),
|
|
1027
1251
|
revisions: []
|
|
@@ -1029,146 +1253,146 @@ function Et(e) {
|
|
|
1029
1253
|
])
|
|
1030
1254
|
)
|
|
1031
1255
|
}));
|
|
1032
|
-
let
|
|
1033
|
-
const
|
|
1034
|
-
const c = s.find((
|
|
1256
|
+
let i = (e.templates ?? []).map((a) => F(a));
|
|
1257
|
+
const r = (a) => {
|
|
1258
|
+
const c = s.find((u) => u.meta.id === a);
|
|
1035
1259
|
if (!c)
|
|
1036
|
-
throw new Error(`Unknown workspace "${
|
|
1260
|
+
throw new Error(`Unknown workspace "${a}"`);
|
|
1037
1261
|
return c;
|
|
1038
|
-
},
|
|
1039
|
-
const c =
|
|
1262
|
+
}, o = (a) => {
|
|
1263
|
+
const c = r(a.workspaceId).modules.get(a.id);
|
|
1040
1264
|
if (!c)
|
|
1041
|
-
throw new Error(`Unknown module "${
|
|
1265
|
+
throw new Error(`Unknown module "${a.id}"`);
|
|
1042
1266
|
return c;
|
|
1043
|
-
}, l = (
|
|
1044
|
-
workspaceId:
|
|
1267
|
+
}, l = (a, c) => ({
|
|
1268
|
+
workspaceId: a,
|
|
1045
1269
|
id: c.id,
|
|
1046
1270
|
packageId: c.packageId,
|
|
1047
1271
|
label: c.label ?? c.id,
|
|
1048
1272
|
description: c.description,
|
|
1049
1273
|
icon: c.icon,
|
|
1050
1274
|
version: c.version,
|
|
1051
|
-
readOnly: c.readOnly ||
|
|
1275
|
+
readOnly: c.readOnly || r(a).meta.readOnly,
|
|
1052
1276
|
files: [...c.files.keys()].sort()
|
|
1053
|
-
}),
|
|
1054
|
-
path:
|
|
1277
|
+
}), d = (a, c) => ({
|
|
1278
|
+
path: a,
|
|
1055
1279
|
text: c.text,
|
|
1056
1280
|
version: String(c.version)
|
|
1057
1281
|
});
|
|
1058
1282
|
return {
|
|
1059
1283
|
async listWorkspaces() {
|
|
1060
|
-
return s.map((
|
|
1284
|
+
return s.map((a) => ({ ...a.meta }));
|
|
1061
1285
|
},
|
|
1062
|
-
async listModules(
|
|
1063
|
-
return [...
|
|
1286
|
+
async listModules(a) {
|
|
1287
|
+
return [...r(a).modules.values()].map((u) => l(a, u));
|
|
1064
1288
|
},
|
|
1065
|
-
async listPackages(
|
|
1066
|
-
const c =
|
|
1067
|
-
return [...
|
|
1289
|
+
async listPackages(a) {
|
|
1290
|
+
const c = r(a), u = [...c.packages.values()], m = [...new Set([...c.modules.values()].map((h) => h.packageId).filter(Boolean))].filter((h) => !c.packages.has(h)).map((h) => ({ id: h, workspaceId: a, label: h, derived: !0 }));
|
|
1291
|
+
return [...u, ...m];
|
|
1068
1292
|
},
|
|
1069
|
-
async readModule(
|
|
1070
|
-
return [...a
|
|
1293
|
+
async readModule(a) {
|
|
1294
|
+
return [...o(a).files.entries()].map(([u, m]) => d(u, m));
|
|
1071
1295
|
},
|
|
1072
|
-
async writeModule(
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
throw new Error(`Module "${
|
|
1076
|
-
const
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
}).map((
|
|
1080
|
-
var
|
|
1081
|
-
return { path:
|
|
1296
|
+
async writeModule(a, c) {
|
|
1297
|
+
const u = o(a);
|
|
1298
|
+
if (u.readOnly || r(a.workspaceId).meta.readOnly)
|
|
1299
|
+
throw new Error(`Module "${a.id}" is read-only`);
|
|
1300
|
+
const m = c.filter((p) => p.baseVersion !== void 0).filter((p) => {
|
|
1301
|
+
const f = u.files.get(p.path);
|
|
1302
|
+
return f ? String(f.version) !== p.baseVersion : !1;
|
|
1303
|
+
}).map((p) => {
|
|
1304
|
+
var f;
|
|
1305
|
+
return { path: p.path, currentVersion: String((f = u.files.get(p.path)) == null ? void 0 : f.version) };
|
|
1082
1306
|
});
|
|
1083
|
-
if (
|
|
1084
|
-
return { ok: !1, conflicts:
|
|
1307
|
+
if (m.length > 0)
|
|
1308
|
+
return { ok: !1, conflicts: m };
|
|
1085
1309
|
let h;
|
|
1086
1310
|
if (t) {
|
|
1087
|
-
const
|
|
1088
|
-
for (const [
|
|
1089
|
-
|
|
1090
|
-
h = `r${++n}`,
|
|
1311
|
+
const p = {};
|
|
1312
|
+
for (const [f, y] of u.files)
|
|
1313
|
+
p[f] = y.text;
|
|
1314
|
+
h = `r${++n}`, u.revisions.unshift({
|
|
1091
1315
|
id: h,
|
|
1092
1316
|
timestamp: Date.now(),
|
|
1093
1317
|
label: h,
|
|
1094
|
-
summary: c.map((
|
|
1095
|
-
files:
|
|
1318
|
+
summary: c.map((f) => `${f.type} ${f.path}`).join(", "),
|
|
1319
|
+
files: p
|
|
1096
1320
|
});
|
|
1097
1321
|
}
|
|
1098
|
-
const
|
|
1099
|
-
for (const
|
|
1100
|
-
if (
|
|
1101
|
-
|
|
1322
|
+
const b = {};
|
|
1323
|
+
for (const p of c)
|
|
1324
|
+
if (p.type === "delete")
|
|
1325
|
+
u.files.delete(p.path);
|
|
1102
1326
|
else {
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1327
|
+
const f = ++n;
|
|
1328
|
+
u.files.set(p.path, { text: p.text, version: f }), b[p.path] = String(f);
|
|
1105
1329
|
}
|
|
1106
|
-
return { ok: !0, versions:
|
|
1330
|
+
return { ok: !0, versions: b, revision: h };
|
|
1107
1331
|
},
|
|
1108
|
-
async createModule(
|
|
1109
|
-
const c =
|
|
1332
|
+
async createModule(a) {
|
|
1333
|
+
const c = r(a.workspaceId);
|
|
1110
1334
|
if (c.meta.readOnly)
|
|
1111
|
-
throw new Error(`Workspace "${
|
|
1112
|
-
if (c.modules.has(
|
|
1113
|
-
throw new Error(`Module "${
|
|
1114
|
-
const
|
|
1115
|
-
id:
|
|
1116
|
-
packageId:
|
|
1335
|
+
throw new Error(`Workspace "${a.workspaceId}" is read-only`);
|
|
1336
|
+
if (c.modules.has(a.id))
|
|
1337
|
+
throw new Error(`Module "${a.id}" already exists`);
|
|
1338
|
+
const u = {
|
|
1339
|
+
id: a.id,
|
|
1340
|
+
packageId: a.packageId,
|
|
1117
1341
|
files: new Map(
|
|
1118
|
-
|
|
1342
|
+
a.files.map((m) => [m.path, { text: m.text, version: ++n }])
|
|
1119
1343
|
),
|
|
1120
1344
|
revisions: []
|
|
1121
1345
|
};
|
|
1122
|
-
return c.modules.set(
|
|
1346
|
+
return c.modules.set(a.id, u), l(a.workspaceId, u);
|
|
1123
1347
|
},
|
|
1124
|
-
async deleteModule(
|
|
1125
|
-
const c =
|
|
1348
|
+
async deleteModule(a) {
|
|
1349
|
+
const c = r(a.workspaceId);
|
|
1126
1350
|
if (c.meta.readOnly)
|
|
1127
|
-
throw new Error(`Workspace "${
|
|
1128
|
-
c.modules.delete(
|
|
1351
|
+
throw new Error(`Workspace "${a.workspaceId}" is read-only`);
|
|
1352
|
+
c.modules.delete(a.id);
|
|
1129
1353
|
},
|
|
1130
|
-
async savePackage(
|
|
1131
|
-
return
|
|
1354
|
+
async savePackage(a) {
|
|
1355
|
+
return r(a.workspaceId).packages.set(a.id, { ...a, derived: !1 }), { ...a, derived: !1 };
|
|
1132
1356
|
},
|
|
1133
|
-
async deletePackage(
|
|
1134
|
-
|
|
1357
|
+
async deletePackage(a) {
|
|
1358
|
+
r(a.workspaceId).packages.delete(a.id);
|
|
1135
1359
|
},
|
|
1136
1360
|
async listTemplates() {
|
|
1137
|
-
return
|
|
1361
|
+
return i.map((a) => F(a));
|
|
1138
1362
|
},
|
|
1139
|
-
async saveTemplate(
|
|
1140
|
-
const
|
|
1141
|
-
return
|
|
1363
|
+
async saveTemplate(a, c) {
|
|
1364
|
+
const u = (c == null ? void 0 : c.previousId) ?? a.id, m = F(a), h = i.findIndex((b) => b.id === u);
|
|
1365
|
+
return i = h >= 0 ? i.map((b, p) => p === h ? m : b) : [...i, m], F(m);
|
|
1142
1366
|
},
|
|
1143
|
-
async deleteTemplate(
|
|
1144
|
-
|
|
1367
|
+
async deleteTemplate(a) {
|
|
1368
|
+
i = i.filter((c) => c.id !== a);
|
|
1145
1369
|
},
|
|
1146
|
-
async listRevisions(
|
|
1147
|
-
return a
|
|
1370
|
+
async listRevisions(a, c) {
|
|
1371
|
+
return o(a).revisions.filter((u) => !c || c in u.files).map(({ files: u, ...m }) => ({ ...m, ...c ? { path: c } : {} }));
|
|
1148
1372
|
},
|
|
1149
|
-
async readRevision(
|
|
1150
|
-
const
|
|
1151
|
-
if (!
|
|
1373
|
+
async readRevision(a, c, u) {
|
|
1374
|
+
const m = o(a).revisions.find((h) => h.id === c);
|
|
1375
|
+
if (!m)
|
|
1152
1376
|
throw new Error(`Unknown revision "${c}"`);
|
|
1153
|
-
return
|
|
1377
|
+
return u ? m.files[u] ?? "" : JSON.stringify(m.files, null, 2);
|
|
1154
1378
|
},
|
|
1155
|
-
async rollback(
|
|
1156
|
-
const
|
|
1379
|
+
async rollback(a, c, u) {
|
|
1380
|
+
const m = o(a), h = m.revisions.find((p) => p.id === c);
|
|
1157
1381
|
if (!h)
|
|
1158
1382
|
throw new Error(`Unknown revision "${c}"`);
|
|
1159
|
-
const
|
|
1160
|
-
if (!
|
|
1161
|
-
for (const
|
|
1162
|
-
|
|
1163
|
-
for (const [
|
|
1164
|
-
|
|
1383
|
+
const b = u ? { [u]: h.files[u] } : h.files;
|
|
1384
|
+
if (!u)
|
|
1385
|
+
for (const p of [...m.files.keys()])
|
|
1386
|
+
p in b || m.files.delete(p);
|
|
1387
|
+
for (const [p, f] of Object.entries(b))
|
|
1388
|
+
f !== void 0 && m.files.set(p, { text: f, version: ++n });
|
|
1165
1389
|
},
|
|
1166
1390
|
snapshot() {
|
|
1167
1391
|
return {
|
|
1168
|
-
workspaces: s.map((
|
|
1169
|
-
...
|
|
1170
|
-
packages: [...
|
|
1171
|
-
modules: [...
|
|
1392
|
+
workspaces: s.map((a) => ({
|
|
1393
|
+
...a.meta,
|
|
1394
|
+
packages: [...a.packages.values()].map(({ workspaceId: c, ...u }) => u),
|
|
1395
|
+
modules: [...a.modules.values()].map((c) => ({
|
|
1172
1396
|
id: c.id,
|
|
1173
1397
|
packageId: c.packageId,
|
|
1174
1398
|
label: c.label,
|
|
@@ -1176,19 +1400,19 @@ function Et(e) {
|
|
|
1176
1400
|
icon: c.icon,
|
|
1177
1401
|
version: c.version,
|
|
1178
1402
|
readOnly: c.readOnly,
|
|
1179
|
-
files: Object.fromEntries([...c.files.entries()].map(([
|
|
1403
|
+
files: Object.fromEntries([...c.files.entries()].map(([u, m]) => [u, m.text]))
|
|
1180
1404
|
}))
|
|
1181
1405
|
})),
|
|
1182
|
-
templates:
|
|
1406
|
+
templates: i.map((a) => F(a)),
|
|
1183
1407
|
revisions: t
|
|
1184
1408
|
};
|
|
1185
1409
|
}
|
|
1186
1410
|
};
|
|
1187
1411
|
}
|
|
1188
|
-
function
|
|
1412
|
+
function Xt(e) {
|
|
1189
1413
|
return e;
|
|
1190
1414
|
}
|
|
1191
|
-
function
|
|
1415
|
+
function H(e, t) {
|
|
1192
1416
|
if (!t || e === void 0 || e === null)
|
|
1193
1417
|
return !0;
|
|
1194
1418
|
if (t.enum && !t.enum.includes(e))
|
|
@@ -1203,72 +1427,72 @@ function X(e, t) {
|
|
|
1203
1427
|
case "boolean":
|
|
1204
1428
|
return typeof e == "boolean";
|
|
1205
1429
|
case "array":
|
|
1206
|
-
return Array.isArray(e) && (!t.items || e.every((n) =>
|
|
1430
|
+
return Array.isArray(e) && (!t.items || e.every((n) => H(n, t.items)));
|
|
1207
1431
|
case "object": {
|
|
1208
1432
|
if (typeof e != "object" || Array.isArray(e))
|
|
1209
1433
|
return !1;
|
|
1210
1434
|
const n = t.properties;
|
|
1211
|
-
return !n || Object.entries(e).every(([s,
|
|
1435
|
+
return !n || Object.entries(e).every(([s, i]) => s in n && H(i, n[s]));
|
|
1212
1436
|
}
|
|
1213
1437
|
default:
|
|
1214
1438
|
return !0;
|
|
1215
1439
|
}
|
|
1216
1440
|
}
|
|
1217
|
-
function
|
|
1218
|
-
var
|
|
1219
|
-
const n = (e.fields ?? []).map((l) => l.name), s = (
|
|
1441
|
+
function Zt(e, t) {
|
|
1442
|
+
var o;
|
|
1443
|
+
const n = (e.fields ?? []).map((l) => l.name), s = (o = e.schema) == null ? void 0 : o.properties;
|
|
1220
1444
|
if (!e.schema || !s)
|
|
1221
1445
|
return { section: e, keys: n };
|
|
1222
|
-
const
|
|
1223
|
-
([l,
|
|
1224
|
-
),
|
|
1446
|
+
const i = Object.entries(s).filter(
|
|
1447
|
+
([l, d]) => !(l in t) || H(t[l], d)
|
|
1448
|
+
), r = i.map(([l]) => l);
|
|
1225
1449
|
return {
|
|
1226
1450
|
section: {
|
|
1227
1451
|
...e,
|
|
1228
1452
|
schema: {
|
|
1229
1453
|
...e.schema,
|
|
1230
|
-
properties: Object.fromEntries(
|
|
1231
|
-
...e.schema.required ? { required: e.schema.required.filter((l) =>
|
|
1454
|
+
properties: Object.fromEntries(i),
|
|
1455
|
+
...e.schema.required ? { required: e.schema.required.filter((l) => r.includes(l)) } : {}
|
|
1232
1456
|
}
|
|
1233
1457
|
},
|
|
1234
|
-
keys: [...
|
|
1458
|
+
keys: [...r, ...n]
|
|
1235
1459
|
};
|
|
1236
1460
|
}
|
|
1237
|
-
function
|
|
1461
|
+
function Gt(e) {
|
|
1238
1462
|
var n;
|
|
1239
1463
|
const t = /* @__PURE__ */ new Set();
|
|
1240
1464
|
for (const s of e) {
|
|
1241
|
-
for (const
|
|
1242
|
-
t.add(
|
|
1243
|
-
for (const
|
|
1244
|
-
t.add(
|
|
1465
|
+
for (const i of Object.keys(((n = s.schema) == null ? void 0 : n.properties) ?? {}))
|
|
1466
|
+
t.add(i);
|
|
1467
|
+
for (const i of s.fields ?? [])
|
|
1468
|
+
t.add(i.name);
|
|
1245
1469
|
}
|
|
1246
1470
|
return t;
|
|
1247
1471
|
}
|
|
1248
|
-
function
|
|
1472
|
+
function Ht(e) {
|
|
1249
1473
|
const t = (n) => {
|
|
1250
|
-
const s = e.find((
|
|
1474
|
+
const s = e.find((i) => i.name === n);
|
|
1251
1475
|
return String((s == null ? void 0 : s.tableName) || (s == null ? void 0 : s.name) || n);
|
|
1252
1476
|
};
|
|
1253
1477
|
return e.map((n) => {
|
|
1254
|
-
const s = n,
|
|
1478
|
+
const s = n, i = String(s.tableName || s.name || "Entity");
|
|
1255
1479
|
return {
|
|
1256
|
-
name:
|
|
1480
|
+
name: i,
|
|
1257
1481
|
// the entity, when the table goes by another name (1.4.7)
|
|
1258
|
-
...s.name && s.name !==
|
|
1482
|
+
...s.name && s.name !== i ? { entity: String(s.name) } : {},
|
|
1259
1483
|
...typeof s.description == "string" && s.description ? { description: s.description } : {},
|
|
1260
|
-
columns: (Array.isArray(s.fields) ? s.fields : []).map((
|
|
1261
|
-
const
|
|
1484
|
+
columns: (Array.isArray(s.fields) ? s.fields : []).map((r) => {
|
|
1485
|
+
const o = typeof r.referencedEntity == "string" ? r.referencedEntity : typeof r.references == "string" ? r.references : void 0;
|
|
1262
1486
|
return {
|
|
1263
|
-
name: String(
|
|
1487
|
+
name: String(r.name ?? ""),
|
|
1264
1488
|
// seeds spell the type both ways (OmniVerk: `dataType`, older files: `type`)
|
|
1265
|
-
dataType: String(
|
|
1266
|
-
isPrimaryKey: !!
|
|
1267
|
-
isForeignKey: !!(
|
|
1268
|
-
...
|
|
1489
|
+
dataType: String(r.dataType ?? r.type ?? "string"),
|
|
1490
|
+
isPrimaryKey: !!r.isPrimaryKey,
|
|
1491
|
+
isForeignKey: !!(r.isForeignKey ?? r.foreignKey ?? o),
|
|
1492
|
+
...o ? {
|
|
1269
1493
|
references: {
|
|
1270
|
-
table: t(
|
|
1271
|
-
column: typeof
|
|
1494
|
+
table: t(o),
|
|
1495
|
+
column: typeof r.referencedField == "string" ? r.referencedField : "Id"
|
|
1272
1496
|
}
|
|
1273
1497
|
} : {}
|
|
1274
1498
|
};
|
|
@@ -1276,14 +1500,14 @@ function xt(e) {
|
|
|
1276
1500
|
};
|
|
1277
1501
|
});
|
|
1278
1502
|
}
|
|
1279
|
-
function
|
|
1280
|
-
const t = e.manifest ?? {}, n = String(t.displayName || t.packageName || "Module"), s = (e.views ?? []).map((
|
|
1281
|
-
id: `view:${
|
|
1282
|
-
label:
|
|
1503
|
+
function Qt(e) {
|
|
1504
|
+
const t = e.manifest ?? {}, n = String(t.displayName || t.packageName || "Module"), s = (e.views ?? []).map((r) => ({
|
|
1505
|
+
id: `view:${r.id}`,
|
|
1506
|
+
label: r.name,
|
|
1283
1507
|
type: "view"
|
|
1284
|
-
})),
|
|
1285
|
-
const
|
|
1286
|
-
return { id: `entity:${
|
|
1508
|
+
})), i = (e.entities ?? []).map((r) => {
|
|
1509
|
+
const o = String(r.name ?? "Entity");
|
|
1510
|
+
return { id: `entity:${o}`, label: o, type: "entity" };
|
|
1287
1511
|
});
|
|
1288
1512
|
return {
|
|
1289
1513
|
roles: [
|
|
@@ -1303,31 +1527,31 @@ function Tt(e) {
|
|
|
1303
1527
|
type: "module",
|
|
1304
1528
|
children: [
|
|
1305
1529
|
...s.length ? [{ id: "views", label: "Views", type: "group", children: s }] : [],
|
|
1306
|
-
...
|
|
1530
|
+
...i.length ? [{ id: "entities", label: "Entities", type: "group", children: i }] : []
|
|
1307
1531
|
]
|
|
1308
1532
|
}
|
|
1309
1533
|
],
|
|
1310
1534
|
grants: {}
|
|
1311
1535
|
};
|
|
1312
1536
|
}
|
|
1313
|
-
const
|
|
1537
|
+
const se = _({
|
|
1314
1538
|
id: "manifest",
|
|
1315
1539
|
label: "Manifest",
|
|
1316
1540
|
labelKey: "devStudio.kind.manifest",
|
|
1317
1541
|
icon: "file",
|
|
1318
1542
|
editor: "manifest",
|
|
1319
|
-
match:
|
|
1320
|
-
}),
|
|
1543
|
+
match: S(".manifest.json")
|
|
1544
|
+
}), ht = R({
|
|
1321
1545
|
id: "entities",
|
|
1322
1546
|
label: "Entities",
|
|
1323
1547
|
labelKey: "devStudio.kind.entities",
|
|
1324
1548
|
icon: "database",
|
|
1325
1549
|
editor: "entities",
|
|
1326
|
-
match:
|
|
1550
|
+
match: S(".entities.json"),
|
|
1327
1551
|
property: "entities",
|
|
1328
1552
|
itemKey: "name"
|
|
1329
|
-
}),
|
|
1330
|
-
function
|
|
1553
|
+
}), yt = ot();
|
|
1554
|
+
function Ae(e, t) {
|
|
1331
1555
|
const n = e, s = typeof e == "object" && e !== null && typeof n.id == "string";
|
|
1332
1556
|
return {
|
|
1333
1557
|
key: s ? n.id : `#${t}`,
|
|
@@ -1336,104 +1560,150 @@ function ke(e, t) {
|
|
|
1336
1560
|
source: e
|
|
1337
1561
|
};
|
|
1338
1562
|
}
|
|
1339
|
-
const
|
|
1563
|
+
const gt = Se({
|
|
1340
1564
|
id: "views",
|
|
1341
1565
|
label: "Views",
|
|
1342
1566
|
labelKey: "devStudio.kind.views",
|
|
1343
1567
|
icon: "grid",
|
|
1344
1568
|
editor: "views",
|
|
1345
|
-
match:
|
|
1569
|
+
match: S(".views.json"),
|
|
1346
1570
|
property: "views",
|
|
1347
1571
|
itemKey: "id",
|
|
1348
|
-
toItem: (e, t) =>
|
|
1572
|
+
toItem: (e, t) => Ae(e, t),
|
|
1349
1573
|
fromItem: (e) => e.definition ?? e.source
|
|
1350
|
-
}),
|
|
1574
|
+
}), bt = Se({
|
|
1351
1575
|
id: "workflows",
|
|
1352
1576
|
label: "Workflows",
|
|
1353
1577
|
labelKey: "devStudio.kind.workflows",
|
|
1354
1578
|
icon: "git-branch",
|
|
1355
1579
|
editor: "workflows",
|
|
1356
|
-
match:
|
|
1580
|
+
match: S(".workflows.json"),
|
|
1357
1581
|
property: "workflows",
|
|
1358
1582
|
itemKey: "id",
|
|
1359
|
-
toItem: (e, t) =>
|
|
1583
|
+
toItem: (e, t) => Ae(e, t),
|
|
1360
1584
|
fromItem: (e) => e.definition ?? e.source
|
|
1361
|
-
}),
|
|
1585
|
+
}), kt = R({
|
|
1362
1586
|
id: "dataSources",
|
|
1363
1587
|
label: "Data sources",
|
|
1364
1588
|
labelKey: "devStudio.kind.dataSources",
|
|
1365
1589
|
icon: "database",
|
|
1366
1590
|
editor: "dataSources",
|
|
1367
|
-
match:
|
|
1591
|
+
match: S(".datasources.json"),
|
|
1368
1592
|
property: "dataSources",
|
|
1369
1593
|
itemKey: "key"
|
|
1370
|
-
}),
|
|
1594
|
+
}), wt = _({
|
|
1371
1595
|
id: "rbac",
|
|
1372
1596
|
label: "Access",
|
|
1373
1597
|
labelKey: "devStudio.kind.rbac",
|
|
1374
1598
|
icon: "shield",
|
|
1375
1599
|
editor: "rbac",
|
|
1376
|
-
match:
|
|
1377
|
-
}),
|
|
1600
|
+
match: S(".rbac.json")
|
|
1601
|
+
}), vt = R({
|
|
1378
1602
|
id: "hooks",
|
|
1379
1603
|
label: "Lifecycle hooks",
|
|
1380
1604
|
labelKey: "devStudio.kind.hooks",
|
|
1381
1605
|
icon: "zap",
|
|
1382
1606
|
editor: "hooks",
|
|
1383
|
-
match:
|
|
1607
|
+
match: S(".hooks.json"),
|
|
1384
1608
|
property: "bindings",
|
|
1385
1609
|
itemKey: "id"
|
|
1386
|
-
}),
|
|
1610
|
+
}), $t = _({
|
|
1387
1611
|
id: "integrations",
|
|
1388
1612
|
label: "Integrations",
|
|
1389
1613
|
labelKey: "devStudio.kind.integrations",
|
|
1390
1614
|
icon: "plug",
|
|
1391
1615
|
editor: "integrations",
|
|
1392
|
-
match:
|
|
1393
|
-
}),
|
|
1616
|
+
match: S(".integrations.json")
|
|
1617
|
+
}), St = _({
|
|
1394
1618
|
id: "environments",
|
|
1395
1619
|
label: "Environment sets",
|
|
1396
1620
|
labelKey: "devStudio.kind.environments",
|
|
1397
1621
|
icon: "globe",
|
|
1398
1622
|
editor: "environments",
|
|
1399
|
-
match:
|
|
1400
|
-
}),
|
|
1401
|
-
match:
|
|
1402
|
-
}),
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1623
|
+
match: S(".environments.json")
|
|
1624
|
+
}), jt = pt({
|
|
1625
|
+
match: S(".scripts.json")
|
|
1626
|
+
}), Ot = [
|
|
1627
|
+
se,
|
|
1628
|
+
ht,
|
|
1629
|
+
yt,
|
|
1630
|
+
gt,
|
|
1631
|
+
bt,
|
|
1632
|
+
kt,
|
|
1633
|
+
wt,
|
|
1634
|
+
vt,
|
|
1635
|
+
jt,
|
|
1636
|
+
$t,
|
|
1637
|
+
St
|
|
1414
1638
|
];
|
|
1415
|
-
function
|
|
1639
|
+
function de(e) {
|
|
1416
1640
|
return e.normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/ł/g, "l").replace(/Ł/g, "L").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "module";
|
|
1417
1641
|
}
|
|
1418
|
-
const
|
|
1419
|
-
const t = e.find((n) =>
|
|
1420
|
-
return t ?
|
|
1642
|
+
const Q = (e) => {
|
|
1643
|
+
const t = e.find((n) => se.match(n.path));
|
|
1644
|
+
return t ? nt(t.text, void 0) : void 0;
|
|
1421
1645
|
};
|
|
1422
|
-
function
|
|
1423
|
-
const t = e.find((n) =>
|
|
1424
|
-
return t ?
|
|
1646
|
+
function At(e) {
|
|
1647
|
+
const t = e.find((n) => se.match(n.path));
|
|
1648
|
+
return t ? x(t.path).replace(/\.manifest\.json$/i, "") : "module";
|
|
1649
|
+
}
|
|
1650
|
+
const fe = (e) => Array.isArray(e.fields) ? e.fields : [], Ee = {
|
|
1651
|
+
entity: [
|
|
1652
|
+
{ prop: "references", part: "tail", files: /\.entities\.json$/i },
|
|
1653
|
+
{ prop: "entity", files: /\.views\.json$/i },
|
|
1654
|
+
{ value: "{name}All", files: /\.(views|scripts|datasources)\.json$/i },
|
|
1655
|
+
{ value: "{name}ById", files: /\.(views|scripts|datasources)\.json$/i },
|
|
1656
|
+
{ prop: "entityType", files: /\.workflows\.json$/i },
|
|
1657
|
+
{ prop: "name", within: "tables", table: !0, files: /\.datasources\.json$/i },
|
|
1658
|
+
{ prop: "id", prefix: "entity:", within: "resources", files: /\.rbac\.json$/i },
|
|
1659
|
+
{ prop: "id", prefix: "entity:", within: "children", files: /\.rbac\.json$/i },
|
|
1660
|
+
{ prop: "label", within: "resources", files: /\.rbac\.json$/i },
|
|
1661
|
+
{ keysOf: "grants", prefix: "entity:", files: /\.rbac\.json$/i },
|
|
1662
|
+
{ keyPattern: "entity.{name}." },
|
|
1663
|
+
{ keyPattern: "field.{name}." },
|
|
1664
|
+
{ prop: "target", files: /\.scripts\.json$/i },
|
|
1665
|
+
{ prop: "target", within: "operations", files: /\.integrations\.json$/i },
|
|
1666
|
+
{ prop: "source", within: "operations", files: /\.integrations\.json$/i }
|
|
1667
|
+
],
|
|
1668
|
+
dataSource: [
|
|
1669
|
+
{ prop: "ref", files: /\.views\.json$/i },
|
|
1670
|
+
{ prop: "source", files: /\.scripts\.json$/i },
|
|
1671
|
+
{ prop: "target", files: /\.scripts\.json$/i },
|
|
1672
|
+
{ prop: "sources", files: /\.datasources\.json$/i },
|
|
1673
|
+
{ prop: "source", within: "operations", files: /\.integrations\.json$/i }
|
|
1674
|
+
]
|
|
1675
|
+
};
|
|
1676
|
+
function Et(e, t) {
|
|
1677
|
+
const n = Q(t), s = [e.id, n == null ? void 0 : n.id, n == null ? void 0 : n.packageName].filter(
|
|
1678
|
+
(r) => typeof r == "string" && r !== ""
|
|
1679
|
+
), i = [];
|
|
1680
|
+
for (const r of Array.isArray(n == null ? void 0 : n.dependencies) ? n.dependencies : [])
|
|
1681
|
+
if (typeof r == "string" && r)
|
|
1682
|
+
i.push({ id: r, via: "manifest" });
|
|
1683
|
+
else if (r && typeof r == "object" && typeof r.moduleId == "string") {
|
|
1684
|
+
const o = r;
|
|
1685
|
+
i.push({
|
|
1686
|
+
id: o.moduleId,
|
|
1687
|
+
via: "manifest",
|
|
1688
|
+
...typeof o.required == "boolean" ? { required: o.required } : {},
|
|
1689
|
+
...typeof o.minVersion == "string" ? { minVersion: o.minVersion } : {}
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
return He(i, t, Ee.entity ?? [], s);
|
|
1425
1693
|
}
|
|
1426
|
-
const
|
|
1694
|
+
const Yt = {
|
|
1427
1695
|
id: "native",
|
|
1428
|
-
|
|
1696
|
+
references: Ee,
|
|
1697
|
+
dependencies: (e) => Et(e.key, e.files),
|
|
1698
|
+
kinds: Ot,
|
|
1429
1699
|
locales: ["en", "pl", "de", "fr", "es", "uk"],
|
|
1430
1700
|
requiredLocales: ["en"],
|
|
1431
1701
|
moduleId: (e) => {
|
|
1432
|
-
const t =
|
|
1702
|
+
const t = Q(e), n = (t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.packageName);
|
|
1433
1703
|
return typeof n == "string" ? n : void 0;
|
|
1434
1704
|
},
|
|
1435
1705
|
validateModule: ({ files: e }) => {
|
|
1436
|
-
const t =
|
|
1706
|
+
const t = Q(e);
|
|
1437
1707
|
return t ? ["id", "name", "version"].filter((n) => typeof t[n] != "string" || !t[n]).map((n) => ({
|
|
1438
1708
|
severity: "error",
|
|
1439
1709
|
code: "manifest.required",
|
|
@@ -1451,7 +1721,7 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1451
1721
|
];
|
|
1452
1722
|
},
|
|
1453
1723
|
newFile: (e, { files: t }) => {
|
|
1454
|
-
const n =
|
|
1724
|
+
const n = At(t), i = {
|
|
1455
1725
|
entities: ["entities.json", { entities: [] }],
|
|
1456
1726
|
views: ["views.json", { views: [] }],
|
|
1457
1727
|
workflows: ["workflows.json", { workflows: [] }],
|
|
@@ -1462,16 +1732,16 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1462
1732
|
integrations: ["integrations.json", { integrations: [] }],
|
|
1463
1733
|
environments: ["environments.json", { variables: [], sets: [] }]
|
|
1464
1734
|
}[e];
|
|
1465
|
-
return
|
|
1735
|
+
return i ? { path: `${n}.${i[0]}`, text: j(i[1]) } : void 0;
|
|
1466
1736
|
},
|
|
1467
1737
|
generateModule: async (e, { existingIds: t }) => {
|
|
1468
|
-
let n =
|
|
1469
|
-
for (let
|
|
1470
|
-
n = `${
|
|
1738
|
+
let n = de(e.name);
|
|
1739
|
+
for (let i = 2; t.has(n); i++)
|
|
1740
|
+
n = `${de(e.name)}-${i}`;
|
|
1471
1741
|
const s = [
|
|
1472
1742
|
{
|
|
1473
1743
|
path: `${n}.manifest.json`,
|
|
1474
|
-
text:
|
|
1744
|
+
text: j({
|
|
1475
1745
|
id: n,
|
|
1476
1746
|
name: e.name,
|
|
1477
1747
|
version: "1.0.0",
|
|
@@ -1480,31 +1750,31 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1480
1750
|
...e.packageId ? { category: e.packageId } : {}
|
|
1481
1751
|
})
|
|
1482
1752
|
},
|
|
1483
|
-
{ path: `${n}.entities.json`, text:
|
|
1753
|
+
{ path: `${n}.entities.json`, text: j({ entities: e.entities }) }
|
|
1484
1754
|
];
|
|
1485
|
-
for (const
|
|
1486
|
-
const
|
|
1487
|
-
for (const
|
|
1488
|
-
const l = String(
|
|
1489
|
-
|
|
1490
|
-
for (const
|
|
1491
|
-
|
|
1755
|
+
for (const i of e.locales) {
|
|
1756
|
+
const r = { "module.displayName": e.name };
|
|
1757
|
+
for (const o of e.entities) {
|
|
1758
|
+
const l = String(o.name ?? "");
|
|
1759
|
+
r[`entity.${l}.displayName`] = l;
|
|
1760
|
+
for (const d of fe(o))
|
|
1761
|
+
r[`field.${l}.${String(d.name)}.label`] = String(d.name);
|
|
1492
1762
|
}
|
|
1493
1763
|
s.push({
|
|
1494
|
-
path: `${n}.${
|
|
1495
|
-
text:
|
|
1764
|
+
path: `${n}.${i}.i18n.json`,
|
|
1765
|
+
text: j({ locale: i, translations: r })
|
|
1496
1766
|
});
|
|
1497
1767
|
}
|
|
1498
1768
|
if (e.views) {
|
|
1499
|
-
const
|
|
1500
|
-
const
|
|
1769
|
+
const i = e.entities.map((r) => {
|
|
1770
|
+
const o = String(r.name ?? "Item");
|
|
1501
1771
|
return {
|
|
1502
|
-
id: `${
|
|
1503
|
-
name: `${
|
|
1772
|
+
id: `${o}List`,
|
|
1773
|
+
name: `${o} list`,
|
|
1504
1774
|
kind: "grid",
|
|
1505
1775
|
version: 2,
|
|
1506
1776
|
columns: 12,
|
|
1507
|
-
dataSources: [{ key: "rows", type: "entity", entity:
|
|
1777
|
+
dataSources: [{ key: "rows", type: "entity", entity: o, autoLoad: !0 }],
|
|
1508
1778
|
rows: [
|
|
1509
1779
|
{
|
|
1510
1780
|
id: "r1",
|
|
@@ -1514,7 +1784,7 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1514
1784
|
controlType: "dataGrid",
|
|
1515
1785
|
colSpan: 12,
|
|
1516
1786
|
props: {
|
|
1517
|
-
columns:
|
|
1787
|
+
columns: fe(r).map((l) => ({
|
|
1518
1788
|
field: String(l.name),
|
|
1519
1789
|
header: String(l.name)
|
|
1520
1790
|
}))
|
|
@@ -1526,10 +1796,10 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1526
1796
|
]
|
|
1527
1797
|
};
|
|
1528
1798
|
});
|
|
1529
|
-
s.push({ path: `${n}.views.json`, text:
|
|
1799
|
+
s.push({ path: `${n}.views.json`, text: j({ views: i }) });
|
|
1530
1800
|
}
|
|
1531
1801
|
if (e.permissions) {
|
|
1532
|
-
const
|
|
1802
|
+
const i = {
|
|
1533
1803
|
roles: [
|
|
1534
1804
|
{ id: "viewer", label: "Viewer" },
|
|
1535
1805
|
{ id: "editor", label: "Editor" },
|
|
@@ -1540,83 +1810,91 @@ const re = (e) => Array.isArray(e.fields) ? e.fields : [], Ft = {
|
|
|
1540
1810
|
{ id: "edit", label: "Edit" },
|
|
1541
1811
|
{ id: "delete", label: "Delete" }
|
|
1542
1812
|
],
|
|
1543
|
-
resources: e.entities.map((
|
|
1544
|
-
id: `entity:${String(
|
|
1545
|
-
label: String(
|
|
1813
|
+
resources: e.entities.map((r) => ({
|
|
1814
|
+
id: `entity:${String(r.name)}`,
|
|
1815
|
+
label: String(r.name),
|
|
1546
1816
|
type: "entity"
|
|
1547
1817
|
})),
|
|
1548
1818
|
grants: {}
|
|
1549
1819
|
};
|
|
1550
|
-
s.push({ path: `${n}.rbac.json`, text:
|
|
1820
|
+
s.push({ path: `${n}.rbac.json`, text: j(i) });
|
|
1551
1821
|
}
|
|
1552
1822
|
return { id: n, packageId: e.packageId, files: s };
|
|
1553
1823
|
}
|
|
1554
1824
|
};
|
|
1555
1825
|
export {
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1826
|
+
at as NICE_STUDIO_SCRIPT_KINDS,
|
|
1827
|
+
Wt as NICE_STUDIO_SCRIPT_PHASES,
|
|
1828
|
+
Ct as addStudioFolder,
|
|
1829
|
+
Ft as addStudioSection,
|
|
1830
|
+
R as arrayFileKind,
|
|
1831
|
+
Ut as buildDocuments,
|
|
1832
|
+
Bt as createMemoryStudioProvider,
|
|
1833
|
+
Xt as defineManifestSection,
|
|
1834
|
+
Qt as deriveDefaultRbac,
|
|
1835
|
+
Y as detectJsonTextFormat,
|
|
1836
|
+
U as emptyStudioLayout,
|
|
1837
|
+
Vt as encodeDocument,
|
|
1838
|
+
S as endsWithAny,
|
|
1839
|
+
Ht as entitiesToSchemas,
|
|
1840
|
+
x as fileName,
|
|
1841
|
+
_t as findStudioReferences,
|
|
1842
|
+
Zt as fitManifestSection,
|
|
1843
|
+
ut as fromStudioScriptItem,
|
|
1844
|
+
ot as i18nFileKind,
|
|
1845
|
+
G as inferStudioScriptKind,
|
|
1846
|
+
Mt as isEmptyStudioLayout,
|
|
1847
|
+
ae as isStudioFolderWithin,
|
|
1848
|
+
xe as isStudioLayoutPath,
|
|
1849
|
+
Se as itemsFileKind,
|
|
1850
|
+
B as jsonFallbackKind,
|
|
1851
|
+
D as jsonFileKind,
|
|
1852
|
+
H as jsonValueFitsSchema,
|
|
1853
|
+
P as jsonValuesEqual,
|
|
1854
|
+
Fe as keepTextFormat,
|
|
1855
|
+
Gt as manifestSectionKeys,
|
|
1856
|
+
At as modulePrefix,
|
|
1857
|
+
Dt as moveStudioFolder,
|
|
1858
|
+
kt as nativeDataSourcesKind,
|
|
1859
|
+
ht as nativeEntitiesKind,
|
|
1860
|
+
St as nativeEnvironmentsKind,
|
|
1861
|
+
Ot as nativeFileKinds,
|
|
1862
|
+
vt as nativeHooksKind,
|
|
1863
|
+
yt as nativeI18nKind,
|
|
1864
|
+
$t as nativeIntegrationsKind,
|
|
1865
|
+
se as nativeManifestKind,
|
|
1866
|
+
wt as nativeRbacKind,
|
|
1867
|
+
jt as nativeScriptsKind,
|
|
1868
|
+
Yt as nativeStudioPreset,
|
|
1869
|
+
Ee as nativeStudioReferences,
|
|
1870
|
+
gt as nativeViewsKind,
|
|
1871
|
+
bt as nativeWorkflowsKind,
|
|
1872
|
+
zt as newStudioScript,
|
|
1873
|
+
_ as objectFileKind,
|
|
1874
|
+
qt as orderStudioEntries,
|
|
1875
|
+
K as parseJsonText,
|
|
1876
|
+
xt as parseStudioLayout,
|
|
1877
|
+
ee as patchJsonText,
|
|
1878
|
+
Ce as patchJsonTextDetailed,
|
|
1879
|
+
Jt as placeStudioEntry,
|
|
1880
|
+
rt as readTranslations,
|
|
1881
|
+
Pt as removeStudioLayoutNode,
|
|
1882
|
+
Rt as renameStudioEntryRef,
|
|
1883
|
+
Lt as renameStudioLayoutNode,
|
|
1884
|
+
Ze as renameStudioReferences,
|
|
1885
|
+
Ye as resolveFileKind,
|
|
1886
|
+
nt as safeJson,
|
|
1887
|
+
pt as scriptsFileKind,
|
|
1888
|
+
Tt as serializeStudioLayout,
|
|
1889
|
+
de as slugifyModuleId,
|
|
1890
|
+
j as stringifyJsonText,
|
|
1891
|
+
He as studioDependencies,
|
|
1892
|
+
It as studioEntryRef,
|
|
1893
|
+
Nt as studioLayoutPath,
|
|
1894
|
+
Ge as studioQualifiedReferences,
|
|
1895
|
+
mt as studioScriptIdentifier,
|
|
1896
|
+
ct as studioScriptLanguages,
|
|
1897
|
+
X as textFallbackKind,
|
|
1898
|
+
ft as toStudioScriptItem,
|
|
1899
|
+
ce as writeTranslations
|
|
1622
1900
|
};
|