@saltcorn/data 0.7.4-beta.1 → 0.7.4-beta.3
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/base-plugin/actions.d.ts +1 -1
- package/dist/base-plugin/actions.d.ts.map +1 -1
- package/dist/base-plugin/actions.js +25 -5
- package/dist/base-plugin/actions.js.map +1 -1
- package/dist/base-plugin/index.d.ts +17 -5
- package/dist/base-plugin/index.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.d.ts +3 -2
- package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.js +83 -13
- package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
- package/dist/base-plugin/viewtemplates/feed.d.ts +2 -1
- package/dist/base-plugin/viewtemplates/feed.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/feed.js +51 -4
- package/dist/base-plugin/viewtemplates/feed.js.map +1 -1
- package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/filter.js +27 -10
- package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
- package/dist/base-plugin/viewtemplates/list.d.ts +2 -1
- package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/list.js +59 -6
- package/dist/base-plugin/viewtemplates/list.js.map +1 -1
- package/dist/base-plugin/viewtemplates/listshowlist.d.ts +9 -0
- package/dist/base-plugin/viewtemplates/listshowlist.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/listshowlist.js +39 -0
- package/dist/base-plugin/viewtemplates/listshowlist.js.map +1 -1
- package/dist/base-plugin/viewtemplates/room.d.ts +1 -0
- package/dist/base-plugin/viewtemplates/room.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/room.js +4 -0
- package/dist/base-plugin/viewtemplates/room.js.map +1 -1
- package/dist/base-plugin/viewtemplates/show.d.ts +2 -1
- package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/show.js +57 -23
- package/dist/base-plugin/viewtemplates/show.js.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.js +13 -15
- package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
- package/dist/diagram/cy_generate_utils.d.ts +9 -0
- package/dist/diagram/cy_generate_utils.d.ts.map +1 -0
- package/dist/diagram/cy_generate_utils.js +76 -0
- package/dist/diagram/cy_generate_utils.js.map +1 -0
- package/dist/diagram/cy_raster.d.ts +31 -0
- package/dist/diagram/cy_raster.d.ts.map +1 -0
- package/dist/diagram/cy_raster.js +244 -0
- package/dist/diagram/cy_raster.js.map +1 -0
- package/dist/diagram/node.d.ts +18 -0
- package/dist/diagram/node.d.ts.map +1 -0
- package/dist/diagram/node.js +21 -0
- package/dist/diagram/node.js.map +1 -0
- package/dist/diagram/node_extract_utils.d.ts +29 -0
- package/dist/diagram/node_extract_utils.d.ts.map +1 -0
- package/dist/diagram/node_extract_utils.js +191 -0
- package/dist/diagram/node_extract_utils.js.map +1 -0
- package/dist/migrations/202208101144.d.ts +3 -0
- package/dist/migrations/202208101144.d.ts.map +1 -0
- package/dist/migrations/202208101144.js +32 -0
- package/dist/migrations/202208101144.js.map +1 -0
- package/dist/models/email.d.ts +1 -1
- package/dist/models/expression.d.ts +7 -0
- package/dist/models/expression.d.ts.map +1 -1
- package/dist/models/expression.js +50 -2
- package/dist/models/expression.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/page.d.ts +5 -4
- package/dist/models/page.d.ts.map +1 -1
- package/dist/models/page.js +14 -6
- package/dist/models/page.js.map +1 -1
- package/dist/models/table.d.ts +2 -1
- package/dist/models/table.d.ts.map +1 -1
- package/dist/models/table.js +79 -20
- package/dist/models/table.js.map +1 -1
- package/dist/models/tag.d.ts +47 -0
- package/dist/models/tag.d.ts.map +1 -0
- package/dist/models/tag.js +124 -0
- package/dist/models/tag.js.map +1 -0
- package/dist/models/tag_entry.d.ts +29 -0
- package/dist/models/tag_entry.d.ts.map +1 -0
- package/dist/models/tag_entry.js +48 -0
- package/dist/models/tag_entry.js.map +1 -0
- package/dist/models/trigger.js +1 -1
- package/dist/models/trigger.js.map +1 -1
- package/dist/models/user.d.ts +7 -0
- package/dist/models/user.d.ts.map +1 -1
- package/dist/models/user.js +45 -3
- package/dist/models/user.js.map +1 -1
- package/dist/models/view.d.ts +4 -3
- package/dist/models/view.d.ts.map +1 -1
- package/dist/models/view.js +24 -3
- package/dist/models/view.js.map +1 -1
- package/dist/plugin-helper.d.ts +3 -1
- package/dist/plugin-helper.d.ts.map +1 -1
- package/dist/plugin-helper.js +20 -10
- package/dist/plugin-helper.js.map +1 -1
- package/dist/tests/auxtest.test.js +19 -1
- package/dist/tests/auxtest.test.js.map +1 -1
- package/dist/tests/calc.test.js +44 -1
- package/dist/tests/calc.test.js.map +1 -1
- package/dist/tests/exact_views.test.js +74 -0
- package/dist/tests/exact_views.test.js.map +1 -1
- package/dist/tests/mocks.d.ts +3 -1
- package/dist/tests/mocks.d.ts.map +1 -1
- package/dist/tests/mocks.js +13 -1
- package/dist/tests/mocks.js.map +1 -1
- package/dist/tests/table.test.js +33 -0
- package/dist/tests/table.test.js.map +1 -1
- package/dist/tests/tag.test.d.ts +2 -0
- package/dist/tests/tag.test.d.ts.map +1 -0
- package/dist/tests/tag.test.js +97 -0
- package/dist/tests/tag.test.js.map +1 -0
- package/dist/tests/view.test.js +128 -0
- package/dist/tests/view.test.js.map +1 -1
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +32 -0
- package/dist/utils.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Node from "./node";
|
|
2
|
+
/**
|
|
3
|
+
* aligns the nodes from the application object tree on a raster
|
|
4
|
+
*/
|
|
5
|
+
export default class CytoscapeRaster {
|
|
6
|
+
private raster;
|
|
7
|
+
private cyIds;
|
|
8
|
+
private links;
|
|
9
|
+
constructor(entryNodes: Array<Node>);
|
|
10
|
+
private initRaster;
|
|
11
|
+
private alignNodes;
|
|
12
|
+
addNode(node: Node, row: number, col: number): void;
|
|
13
|
+
addLink(source: Node, target: Node, type: LinkType): void;
|
|
14
|
+
/**
|
|
15
|
+
* builds cytoscape.js nodes with 'data' and 'position'
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
buildCyNodes(): any[];
|
|
19
|
+
/**
|
|
20
|
+
* builds cytoscape.js edges with 'data'
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
buildCyEdges(): any[];
|
|
24
|
+
rowsCount(): number;
|
|
25
|
+
colsCount(): number;
|
|
26
|
+
hasId(cyId: string): boolean;
|
|
27
|
+
private enlargeIfNecessary;
|
|
28
|
+
}
|
|
29
|
+
declare type LinkType = "new_target" | "existing_target";
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=cy_raster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cy_raster.d.ts","sourceRoot":"","sources":["../../diagram/cy_raster.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,KAAK,CAAqB;gBAEtB,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC;IAKnC,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,UAAU;IAiBX,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAM5C,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;IAQzD;;;OAGG;IACI,YAAY,IAAI,GAAG,EAAE;IA2B5B;;;OAGG;IACI,YAAY,IAAI,GAAG,EAAE;IAa5B,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;IAInB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI5B,OAAO,CAAC,kBAAkB;CAiB3B;AAwID,aAAK,QAAQ,GAAG,YAAY,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_1 = __importDefault(require("./node"));
|
|
7
|
+
/**
|
|
8
|
+
* aligns the nodes from the application object tree on a raster
|
|
9
|
+
*/
|
|
10
|
+
class CytoscapeRaster {
|
|
11
|
+
constructor(entryNodes) {
|
|
12
|
+
this.raster = new Array();
|
|
13
|
+
this.cyIds = new Set();
|
|
14
|
+
this.links = new Array();
|
|
15
|
+
this.initRaster();
|
|
16
|
+
this.alignNodes(entryNodes);
|
|
17
|
+
}
|
|
18
|
+
initRaster() {
|
|
19
|
+
const initialRows = 2;
|
|
20
|
+
const initialCols = 2;
|
|
21
|
+
for (let row = 0; row < initialRows; row++) {
|
|
22
|
+
const row = new Array();
|
|
23
|
+
for (let col = 0; col < initialCols; col++) {
|
|
24
|
+
row.push(null);
|
|
25
|
+
}
|
|
26
|
+
this.raster.push(row);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
alignNodes(entryNodes) {
|
|
30
|
+
let startRow = 10;
|
|
31
|
+
let startCol = 2;
|
|
32
|
+
const visitor = buildVisitor(this);
|
|
33
|
+
for (const node of entryNodes) {
|
|
34
|
+
const dummyRoot = new node_1.default("dummy", "");
|
|
35
|
+
dummyRoot.linked.push(node);
|
|
36
|
+
const usedSpace = traverse(dummyRoot, visitor, startRow, startCol);
|
|
37
|
+
if (usedSpace.maxCol < 5) {
|
|
38
|
+
startCol = usedSpace.maxCol;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
startRow = usedSpace.maxRow;
|
|
42
|
+
startCol = 2;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
addNode(node, row, col) {
|
|
47
|
+
this.enlargeIfNecessary(row, col);
|
|
48
|
+
this.raster[row][col] = node;
|
|
49
|
+
this.cyIds.add(node.cyId);
|
|
50
|
+
}
|
|
51
|
+
addLink(source, target, type) {
|
|
52
|
+
this.links.push({
|
|
53
|
+
source,
|
|
54
|
+
target,
|
|
55
|
+
type,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* builds cytoscape.js nodes with 'data' and 'position'
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
buildCyNodes() {
|
|
63
|
+
const hSpacing = 150;
|
|
64
|
+
const vSpacing = 90;
|
|
65
|
+
const cyNodes = new Array();
|
|
66
|
+
const rowsCount = this.rowsCount();
|
|
67
|
+
const colsCount = this.colsCount();
|
|
68
|
+
for (let row = 0; row < rowsCount; row++) {
|
|
69
|
+
for (let col = 0; col < colsCount; col++) {
|
|
70
|
+
const node = this.raster[row][col];
|
|
71
|
+
if (node) {
|
|
72
|
+
cyNodes.push({
|
|
73
|
+
data: {
|
|
74
|
+
id: node.cyId,
|
|
75
|
+
type: node.type,
|
|
76
|
+
label: node.label,
|
|
77
|
+
},
|
|
78
|
+
position: {
|
|
79
|
+
x: col * hSpacing,
|
|
80
|
+
y: row * vSpacing,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return cyNodes;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* builds cytoscape.js edges with 'data'
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
buildCyEdges() {
|
|
93
|
+
return this.links.map((link) => {
|
|
94
|
+
return {
|
|
95
|
+
data: {
|
|
96
|
+
id: `${link.source.cyId}-${link.target.cyId}`,
|
|
97
|
+
source: link.source.cyId,
|
|
98
|
+
target: link.target.cyId,
|
|
99
|
+
type: link.type,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
rowsCount() {
|
|
105
|
+
return this.raster.length;
|
|
106
|
+
}
|
|
107
|
+
colsCount() {
|
|
108
|
+
return this.raster[0].length;
|
|
109
|
+
}
|
|
110
|
+
hasId(cyId) {
|
|
111
|
+
return this.cyIds.has(cyId);
|
|
112
|
+
}
|
|
113
|
+
enlargeIfNecessary(row, col) {
|
|
114
|
+
const currentColSize = this.raster[0].length;
|
|
115
|
+
if (row >= this.raster.length) {
|
|
116
|
+
const diff = row - this.raster.length;
|
|
117
|
+
for (let i = 0; i <= diff; i++) {
|
|
118
|
+
const newRow = new Array();
|
|
119
|
+
for (let j = 0; j < currentColSize; j++)
|
|
120
|
+
newRow.push(null);
|
|
121
|
+
this.raster.push(newRow);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (col >= currentColSize) {
|
|
125
|
+
const diff = col - currentColSize;
|
|
126
|
+
for (let i = 0; i < this.raster.length; i++) {
|
|
127
|
+
for (let j = 0; j <= diff; j++)
|
|
128
|
+
this.raster[i].push(null);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.default = CytoscapeRaster;
|
|
134
|
+
const buildVisitor = (raster) => {
|
|
135
|
+
return {
|
|
136
|
+
linked(source, target, row, col, noLink) {
|
|
137
|
+
if (!raster.hasId(target.cyId)) {
|
|
138
|
+
const pos = { row: row, col: col };
|
|
139
|
+
const embedDepth = maxEmbedDepth(target.embedded, raster);
|
|
140
|
+
if (embedDepth > 0)
|
|
141
|
+
pos.col += embedDepth + 1;
|
|
142
|
+
raster.addNode(target, pos.row, pos.col);
|
|
143
|
+
if (!noLink)
|
|
144
|
+
raster.addLink(source, target, "new_target");
|
|
145
|
+
return pos;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
raster.addLink(source, target, "existing_target");
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
embedded(source, target, row, col) {
|
|
153
|
+
if (!raster.hasId(target.cyId)) {
|
|
154
|
+
raster.addNode(target, row, col);
|
|
155
|
+
raster.addLink(source, target, "new_target");
|
|
156
|
+
return { row, col };
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
raster.addLink(source, target, "existing_target");
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
table(node, row, col) {
|
|
164
|
+
return true;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
const traverse = (node, visitor, startRow, startCol) => {
|
|
169
|
+
let maxRow = 0;
|
|
170
|
+
let maxCol = 0;
|
|
171
|
+
const go = (current, row, col, ignoreLinks, parentIsDummy, shiftEmbedsY) => {
|
|
172
|
+
let insertEmbedCol = col - 1;
|
|
173
|
+
let insertLinkedCol = col + 1;
|
|
174
|
+
let insertEmbedRow = row > maxRow ? row : maxRow;
|
|
175
|
+
let insertLinkedRow = insertEmbedRow;
|
|
176
|
+
// put links from embeds to the parent
|
|
177
|
+
const embeddedLinks = new Array();
|
|
178
|
+
collectEmbeddedLinks(current, embeddedLinks);
|
|
179
|
+
if (shiftEmbedsY)
|
|
180
|
+
insertEmbedRow++;
|
|
181
|
+
// align embeds
|
|
182
|
+
for (const embedded of current.embedded) {
|
|
183
|
+
if (visitor.embedded(current, embedded, insertEmbedRow, insertEmbedCol)) {
|
|
184
|
+
go(embedded, insertEmbedRow, insertEmbedCol, true);
|
|
185
|
+
if (++insertEmbedRow > maxRow)
|
|
186
|
+
maxRow = insertEmbedRow;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (parentIsDummy) {
|
|
190
|
+
// branches left from the root shouldn't affect right branches
|
|
191
|
+
maxRow = 0;
|
|
192
|
+
insertEmbedRow = row;
|
|
193
|
+
insertLinkedRow = row;
|
|
194
|
+
}
|
|
195
|
+
if (!ignoreLinks) {
|
|
196
|
+
const currentIsDummy = current.type === "dummy";
|
|
197
|
+
let shiftEmbedsY = !currentIsDummy; // don't shift embeds from the first node
|
|
198
|
+
// align links
|
|
199
|
+
for (const linked of [...current.linked, ...embeddedLinks]) {
|
|
200
|
+
const rasterPos = visitor.linked(current, linked, insertLinkedRow, insertLinkedCol, currentIsDummy);
|
|
201
|
+
if (rasterPos) {
|
|
202
|
+
insertLinkedCol = rasterPos.col;
|
|
203
|
+
go(linked, insertLinkedRow, insertLinkedCol, false, currentIsDummy, shiftEmbedsY);
|
|
204
|
+
if (maxRow > insertLinkedRow)
|
|
205
|
+
insertLinkedRow = maxRow;
|
|
206
|
+
else if (++insertLinkedRow > maxRow)
|
|
207
|
+
maxRow = insertLinkedRow;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (insertLinkedCol > maxCol)
|
|
212
|
+
maxCol = insertLinkedCol;
|
|
213
|
+
if (insertEmbedCol > maxCol)
|
|
214
|
+
maxCol = insertEmbedCol;
|
|
215
|
+
};
|
|
216
|
+
go(node, startRow, startCol, false);
|
|
217
|
+
return { maxRow: maxRow + 1, maxCol };
|
|
218
|
+
};
|
|
219
|
+
const maxEmbedDepth = (nodes, raster) => {
|
|
220
|
+
let max = 0;
|
|
221
|
+
for (const node of nodes) {
|
|
222
|
+
const depth = embedDepth(node, raster);
|
|
223
|
+
if (depth > max)
|
|
224
|
+
max = depth;
|
|
225
|
+
}
|
|
226
|
+
return max;
|
|
227
|
+
};
|
|
228
|
+
const embedDepth = (parent, raster) => {
|
|
229
|
+
if (parent.embedded.length === 0)
|
|
230
|
+
return 0;
|
|
231
|
+
let maxDepth = 0;
|
|
232
|
+
for (const node of parent.embedded) {
|
|
233
|
+
const branchDepth = embedDepth(node, raster);
|
|
234
|
+
maxDepth = branchDepth > maxDepth ? branchDepth : maxDepth;
|
|
235
|
+
}
|
|
236
|
+
return maxDepth + (!raster.hasId(parent.cyId) ? 1 : 0);
|
|
237
|
+
};
|
|
238
|
+
const collectEmbeddedLinks = (parent, result) => {
|
|
239
|
+
for (const embedded of parent.embedded) {
|
|
240
|
+
result.push(...embedded.linked);
|
|
241
|
+
collectEmbeddedLinks(embedded, result);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=cy_raster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cy_raster.js","sourceRoot":"","sources":["../../diagram/cy_raster.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B;;GAEG;AACH,MAAqB,eAAe;IAKlC,YAAY,UAAuB;QAJ3B,WAAM,GAAG,IAAI,KAAK,EAAsB,CAAC;QACzC,UAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAC1B,UAAK,GAAG,IAAI,KAAK,EAAQ,CAAC;QAGhC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAEO,UAAU;QAChB,MAAM,WAAW,GAAG,CAAC,CAAC;QACtB,MAAM,WAAW,GAAG,CAAC,CAAC;QACtB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,WAAW,EAAE,GAAG,EAAE,EAAE;YAC1C,MAAM,GAAG,GAAG,IAAI,KAAK,EAAe,CAAC;YACrC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,WAAW,EAAE,GAAG,EAAE,EAAE;gBAC1C,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChB;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;IACH,CAAC;IAEO,UAA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AC3D,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;QAClC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC7C,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;KAC5D;IACD,OAAO,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,MAAY,EAAE,MAAmB,EAAE,EAAE;IACjE,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE;QACtC,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KACxC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare type NodeType = "view" | "page" | "table" | "dummy";
|
|
2
|
+
/**
|
|
3
|
+
* resembles a page or a view in the application object tree
|
|
4
|
+
*/
|
|
5
|
+
export default class Node {
|
|
6
|
+
type: NodeType;
|
|
7
|
+
label: string;
|
|
8
|
+
cyId: string;
|
|
9
|
+
linked: Node[];
|
|
10
|
+
embedded: Node[];
|
|
11
|
+
tables: Node[];
|
|
12
|
+
/**
|
|
13
|
+
* @param type page or view
|
|
14
|
+
* @param label
|
|
15
|
+
*/
|
|
16
|
+
constructor(type: NodeType, label: string);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../diagram/node.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,SAAqB;IAC3B,QAAQ,SAAqB;IAC7B,MAAM,SAAqB;IAE3B;;;OAGG;gBACS,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;CAK1C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* resembles a page or a view in the application object tree
|
|
5
|
+
*/
|
|
6
|
+
class Node {
|
|
7
|
+
/**
|
|
8
|
+
* @param type page or view
|
|
9
|
+
* @param label
|
|
10
|
+
*/
|
|
11
|
+
constructor(type, label) {
|
|
12
|
+
this.linked = new Array();
|
|
13
|
+
this.embedded = new Array();
|
|
14
|
+
this.tables = new Array();
|
|
15
|
+
this.type = type;
|
|
16
|
+
this.label = label;
|
|
17
|
+
this.cyId = `${type}_${label}`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Node;
|
|
21
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../diagram/node.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAqB,IAAI;IAQvB;;;OAGG;IACH,YAAY,IAAc,EAAE,KAAa;QARzC,WAAM,GAAG,IAAI,KAAK,EAAQ,CAAC;QAC3B,aAAQ,GAAG,IAAI,KAAK,EAAQ,CAAC;QAC7B,WAAM,GAAG,IAAI,KAAK,EAAQ,CAAC;QAOzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;IACjC,CAAC;CACF;AAjBD,uBAiBC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Node from "./node";
|
|
2
|
+
import { AbstractPage as Page } from "@saltcorn/types/model-abstracts/abstract_page";
|
|
3
|
+
import type { ConnectedObjects } from "@saltcorn/types/base_types";
|
|
4
|
+
/**
|
|
5
|
+
* builds object trees for 'views/pages' with branches for all possible paths
|
|
6
|
+
* @param entryPages if given, those will be the start nodes of the first graphs
|
|
7
|
+
* @returns root nodes
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildObjectTrees(entryPages?: Array<Page>): Promise<Array<Node>>;
|
|
10
|
+
/**
|
|
11
|
+
* extracts all 'views/pages' aligned in the layout
|
|
12
|
+
* @param layout view or page layout
|
|
13
|
+
* @returns all found objects
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractFromLayout(layout: any): ConnectedObjects;
|
|
16
|
+
/**
|
|
17
|
+
* extracts all views from 'columns'
|
|
18
|
+
* @param columns columns from a view configuration
|
|
19
|
+
* @returns all found objects
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractFromColumns(columns: any[]): ConnectedObjects;
|
|
22
|
+
/**
|
|
23
|
+
* extracts one view that is used to create new entries
|
|
24
|
+
* e.g. an embedded edit under the table of a list
|
|
25
|
+
* @param configuration config of the view
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractViewToCreate(configuration: any): ConnectedObjects | null;
|
|
29
|
+
//# sourceMappingURL=node_extract_utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_extract_utils.d.ts","sourceRoot":"","sources":["../../diagram/node_extract_utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,MAAM,+CAA+C,CAAC;AAMrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,GAAE,KAAK,CAAC,IAAI,CAAqB,GAC1C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAQtB;AAoBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,GAAG,gBAAgB,CAqC/D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,gBAAgB,CAanE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,GACjB,gBAAgB,GAAG,IAAI,CAkBzB"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractViewToCreate = exports.extractFromColumns = exports.extractFromLayout = exports.buildObjectTrees = void 0;
|
|
7
|
+
const node_1 = __importDefault(require("./node"));
|
|
8
|
+
const layout_1 = __importDefault(require("../models/layout"));
|
|
9
|
+
const { traverseSync } = layout_1.default;
|
|
10
|
+
const { parse_view_select, } = require("../base-plugin/viewtemplates/viewable_fields");
|
|
11
|
+
/**
|
|
12
|
+
* builds object trees for 'views/pages' with branches for all possible paths
|
|
13
|
+
* @param entryPages if given, those will be the start nodes of the first graphs
|
|
14
|
+
* @returns root nodes
|
|
15
|
+
*/
|
|
16
|
+
async function buildObjectTrees(entryPages = new Array()) {
|
|
17
|
+
const helper = new ExtractHelper();
|
|
18
|
+
const entryPageTrees = await buildTree("page", entryPages, helper);
|
|
19
|
+
const allPages = await require("../models/page").find();
|
|
20
|
+
const pageTrees = await buildTree("page", allPages, helper);
|
|
21
|
+
const allViews = await require("../models/view").find();
|
|
22
|
+
const viewTrees = await buildTree("view", allViews, helper);
|
|
23
|
+
return [...entryPageTrees, ...pageTrees, ...viewTrees];
|
|
24
|
+
}
|
|
25
|
+
exports.buildObjectTrees = buildObjectTrees;
|
|
26
|
+
async function buildTree(type, objects, helper) {
|
|
27
|
+
const result = new Array();
|
|
28
|
+
for (const object of objects) {
|
|
29
|
+
const node = new node_1.default(type, object.name);
|
|
30
|
+
if (!helper.cyIds.has(node.cyId)) {
|
|
31
|
+
helper.cyIds.add(node.cyId);
|
|
32
|
+
const connected = await object.connected_objects();
|
|
33
|
+
await helper.handleNodeConnections(node, connected);
|
|
34
|
+
result.push(node);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* extracts all 'views/pages' aligned in the layout
|
|
41
|
+
* @param layout view or page layout
|
|
42
|
+
* @returns all found objects
|
|
43
|
+
*/
|
|
44
|
+
function extractFromLayout(layout) {
|
|
45
|
+
const embeddedViews = new Array();
|
|
46
|
+
const linkedPages = new Array();
|
|
47
|
+
const linkedViews = new Array();
|
|
48
|
+
const _View = require("../models/view");
|
|
49
|
+
const _Page = require("../models/page");
|
|
50
|
+
traverseSync(layout, {
|
|
51
|
+
view(segment) {
|
|
52
|
+
const select = parse_view_select(segment.view);
|
|
53
|
+
const view = _View.findOne({ name: select.viewname });
|
|
54
|
+
if (view)
|
|
55
|
+
embeddedViews.push(view);
|
|
56
|
+
},
|
|
57
|
+
view_link(segment) {
|
|
58
|
+
const select = parse_view_select(segment.view);
|
|
59
|
+
const view = _View.findOne({ name: select.viewname });
|
|
60
|
+
if (view)
|
|
61
|
+
linkedViews.push(view);
|
|
62
|
+
},
|
|
63
|
+
link(segment) {
|
|
64
|
+
if (segment.link_src === "View") {
|
|
65
|
+
const parts = segment.url.split("/");
|
|
66
|
+
const viewName = parts[parts.length - 1];
|
|
67
|
+
const view = _View.findOne({ name: viewName });
|
|
68
|
+
if (view)
|
|
69
|
+
linkedViews.push(view);
|
|
70
|
+
}
|
|
71
|
+
else if (segment.link_src === "Page") {
|
|
72
|
+
const parts = segment.url.split("/");
|
|
73
|
+
const pagename = parts[parts.length - 1];
|
|
74
|
+
const page = _Page.findOne({ name: pagename });
|
|
75
|
+
if (page)
|
|
76
|
+
linkedPages.push(page);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
embeddedViews,
|
|
82
|
+
linkedViews,
|
|
83
|
+
linkedPages,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
exports.extractFromLayout = extractFromLayout;
|
|
87
|
+
/**
|
|
88
|
+
* extracts all views from 'columns'
|
|
89
|
+
* @param columns columns from a view configuration
|
|
90
|
+
* @returns all found objects
|
|
91
|
+
*/
|
|
92
|
+
function extractFromColumns(columns) {
|
|
93
|
+
const linkedViews = new Array();
|
|
94
|
+
const _View = require("../models/view");
|
|
95
|
+
for (const column of columns) {
|
|
96
|
+
if (column.type === "ViewLink") {
|
|
97
|
+
const select = parse_view_select(column.view);
|
|
98
|
+
const view = _View.findOne({ name: select.viewname });
|
|
99
|
+
if (view)
|
|
100
|
+
linkedViews.push(view);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// currently only used for list
|
|
104
|
+
// TODO embedded views and linked pages for other templates
|
|
105
|
+
return { linkedViews };
|
|
106
|
+
}
|
|
107
|
+
exports.extractFromColumns = extractFromColumns;
|
|
108
|
+
/**
|
|
109
|
+
* extracts one view that is used to create new entries
|
|
110
|
+
* e.g. an embedded edit under the table of a list
|
|
111
|
+
* @param configuration config of the view
|
|
112
|
+
* @returns
|
|
113
|
+
*/
|
|
114
|
+
function extractViewToCreate(configuration) {
|
|
115
|
+
const { view_to_create, create_view_display } = configuration;
|
|
116
|
+
if (view_to_create) {
|
|
117
|
+
const View = require("../models/view");
|
|
118
|
+
const viewToCreate = View.findOne({ name: view_to_create });
|
|
119
|
+
if (viewToCreate) {
|
|
120
|
+
if (create_view_display === "Link" || create_view_display === "Popup") {
|
|
121
|
+
return {
|
|
122
|
+
linkedViews: [viewToCreate],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return {
|
|
127
|
+
embeddedViews: [viewToCreate],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
exports.extractViewToCreate = extractViewToCreate;
|
|
135
|
+
/**
|
|
136
|
+
* helper to keep track of added nodes ('cyIds')
|
|
137
|
+
*/
|
|
138
|
+
class ExtractHelper {
|
|
139
|
+
constructor() {
|
|
140
|
+
this.cyIds = new Set();
|
|
141
|
+
}
|
|
142
|
+
async handleNodeConnections(oldNode, connected) {
|
|
143
|
+
for (const embeddedView of connected.embeddedViews || []) {
|
|
144
|
+
if (embeddedView)
|
|
145
|
+
await this.addEmbeddedView(oldNode, embeddedView);
|
|
146
|
+
}
|
|
147
|
+
for (const linkedPage of connected.linkedPages || []) {
|
|
148
|
+
if (linkedPage)
|
|
149
|
+
await this.addLinkedPageNode(oldNode, linkedPage);
|
|
150
|
+
}
|
|
151
|
+
for (const linkedView of connected.linkedViews || []) {
|
|
152
|
+
if (linkedView)
|
|
153
|
+
await this.addLinkedViewNode(oldNode, linkedView);
|
|
154
|
+
}
|
|
155
|
+
for (const table of connected.tables || []) {
|
|
156
|
+
if (table) {
|
|
157
|
+
const tableNode = new node_1.default("table", table.name);
|
|
158
|
+
this.cyIds.add(tableNode.cyId);
|
|
159
|
+
oldNode.tables.push(tableNode);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async addLinkedViewNode(oldNode, newView) {
|
|
164
|
+
const newNode = new node_1.default("view", newView.name);
|
|
165
|
+
oldNode.linked.push(newNode);
|
|
166
|
+
if (!this.cyIds.has(newNode.cyId)) {
|
|
167
|
+
this.cyIds.add(newNode.cyId);
|
|
168
|
+
const connections = await newView.connected_objects();
|
|
169
|
+
await this.handleNodeConnections(newNode, connections);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async addEmbeddedView(oldNode, embedded) {
|
|
173
|
+
const newNode = new node_1.default("view", embedded.name);
|
|
174
|
+
oldNode.embedded.push(newNode);
|
|
175
|
+
if (!this.cyIds.has(newNode.cyId)) {
|
|
176
|
+
this.cyIds.add(newNode.cyId);
|
|
177
|
+
const connections = await embedded.connected_objects();
|
|
178
|
+
await this.handleNodeConnections(newNode, connections);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async addLinkedPageNode(oldNode, newPage) {
|
|
182
|
+
const newNode = new node_1.default("page", newPage.name);
|
|
183
|
+
oldNode.linked.push(newNode);
|
|
184
|
+
if (!this.cyIds.has(newNode.cyId)) {
|
|
185
|
+
this.cyIds.add(newNode.cyId);
|
|
186
|
+
const connections = await newPage.connected_objects();
|
|
187
|
+
await this.handleNodeConnections(newNode, connections);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=node_extract_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_extract_utils.js","sourceRoot":"","sources":["../../diagram/node_extract_utils.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAI1B,8DAAsC;AACtC,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAM,CAAC;AAChC,MAAM,EACJ,iBAAiB,GAClB,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;AAI5D;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CACpC,aAA0B,IAAI,KAAK,EAAQ;IAE3C,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACnE,MAAM,QA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AC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7B,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACtD,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;SACxD;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202208101144.d.ts","sourceRoot":"","sources":["../../migrations/202208101144.js"],"names":[],"mappings":"AAAA,8BAaE;AAEF,kCAcE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const sql_pg = [
|
|
3
|
+
`CREATE TABLE _sc_tags (
|
|
4
|
+
id serial primary key,
|
|
5
|
+
name text NOT NULL
|
|
6
|
+
);`,
|
|
7
|
+
`CREATE TABLE _sc_tag_entries(
|
|
8
|
+
id serial primary key,
|
|
9
|
+
tag_id integer references _sc_tags(id) NOT NULL,
|
|
10
|
+
table_id integer references _sc_tables(id),
|
|
11
|
+
view_id integer references _sc_views(id),
|
|
12
|
+
page_id integer references _sc_pages(id),
|
|
13
|
+
trigger_id integer references _sc_triggers(id)
|
|
14
|
+
);`,
|
|
15
|
+
];
|
|
16
|
+
const sql_sqlite = [
|
|
17
|
+
`CREATE TABLE _sc_tags (
|
|
18
|
+
id integer primary key,
|
|
19
|
+
name text NOT NULL
|
|
20
|
+
);`,
|
|
21
|
+
`CREATE TABLE _sc_tag_entries (
|
|
22
|
+
id integer primary key,
|
|
23
|
+
tag_id integer references _sc_tags(id) NOT NULL,
|
|
24
|
+
table_id integer references _sc_tables(id),
|
|
25
|
+
view_id integer references _sc_views(id),
|
|
26
|
+
page_id integer references _sc_pages(id),
|
|
27
|
+
trigger_id integer references _sc_triggers(id)
|
|
28
|
+
);
|
|
29
|
+
`,
|
|
30
|
+
];
|
|
31
|
+
module.exports = { sql_pg, sql_sqlite };
|
|
32
|
+
//# sourceMappingURL=202208101144.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"202208101144.js","sourceRoot":"","sources":["../../migrations/202208101144.js"],"names":[],"mappings":";AAAA,MAAM,MAAM,GAAG;IACb;;;GAGC;IACD;;;;;;;KAOG;CACJ,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB;;;GAGC;IACD;;;;;;;;CAQD;CACA,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/models/email.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ import { PluginFunction } from "@saltcorn/types/base_types";
|
|
|
8
8
|
*/
|
|
9
9
|
declare function expressionValidator(s: string): true | string;
|
|
10
10
|
declare function expressionChecker(s: string, prefix: string, errors: string[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} expression
|
|
13
|
+
* @throws {Error}
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
declare function jsexprToSQL(expression: string, extraCtx?: any): String;
|
|
11
17
|
/**
|
|
12
18
|
* @param {string} expression
|
|
13
19
|
* @throws {Error}
|
|
@@ -60,6 +66,7 @@ declare const _default: {
|
|
|
60
66
|
transform_for_async: typeof transform_for_async;
|
|
61
67
|
apply_calculated_fields_stored: (row: Row, fields: Field[]) => Promise<Row>;
|
|
62
68
|
jsexprToWhere: typeof jsexprToWhere;
|
|
69
|
+
jsexprToSQL: typeof jsexprToSQL;
|
|
63
70
|
freeVariables: typeof freeVariables;
|
|
64
71
|
};
|
|
65
72
|
export = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../models/expression.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,8BA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