@heswell/vuu-data-engine-local 3.0.0 → 4.0.0
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/91.js +248 -0
- package/README.md +49 -18
- package/index.js +114 -395
- package/legacy.js +5 -2
- package/package.json +6 -2
- package/react.js +64 -0
- package/src/core/engine/LocalEngine.d.ts +2 -1
- package/src/core/module/VuuModule.d.ts +12 -0
- package/src/core/table/TableContainer.d.ts +7 -4
- package/src/index.d.ts +0 -2
- package/src/legacy.d.ts +1 -0
- package/src/react.d.ts +7 -0
package/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Clock,
|
|
2
|
-
import { JoinTable, Table as vuu_table_Table } from "@heswell/vuu-table";
|
|
1
|
+
import { Clock, EventEmitter, NULL_RANGE, Range, StaleUpdateError, assertExpectedSessionTable, filterAsQuery, isAddRowRpcRequest, isBeginEditSessionRpcRequest, isConfigChanged, isCreateSessionTableRpcRequest, isDeleteSelectedRowsRpcRequest, isEditCellRpcRequest, isEndEditSessionRpcRequest, isRpcSuccess, isTypeaheadRequest, isUndoRowChangeRpcRequest, metadataKeys, sessionDataSourceConfig, toSchemaColumn, uuid, vanillaConfig, withConfigDefaults } from "@vuu-ui/vuu-utils";
|
|
3
2
|
import { inMemoryDataEngine } from "@heswell/vuu-viewport";
|
|
4
3
|
import { parseFilter } from "@vuu-ui/vuu-filter-parser";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { DataProvider } from "@vuu-ui/core";
|
|
7
4
|
import { USER_ADMIN_RPC_CONTRACT, USER_ADMIN_TABLE_SCHEMAS } from "@heswell/user-admin/contracts";
|
|
8
5
|
import { MODULE_ADMIN_RPC, executeModuleAdminRpc, managedModuleColumnValues, managedModulePermissionValues } from "@heswell/module-admin/contracts";
|
|
9
6
|
import { InMemoryUserAdminStore } from "@heswell/user-admin/in-memory";
|
|
7
|
+
import { TableContainer, createTable as TableContainer_createTable, createJoinTable, buildDataColumnMap as Table_buildDataColumnMap, getDefaultEngine, buildDataColumnMapFromSchema as Table_buildDataColumnMapFromSchema, Table as Table_Table } from "./91.js";
|
|
10
8
|
class ArrayProxy {
|
|
11
9
|
#getItem;
|
|
12
10
|
length = 0;
|
|
@@ -103,85 +101,6 @@ function PermissionFilter(arg, allowedValues) {
|
|
|
103
101
|
if ("string" == typeof arg) return new ContainsPermissionFilter(arg, allowedValues ?? new Set());
|
|
104
102
|
return new PermissionFilterChain(Array.from(arg));
|
|
105
103
|
}
|
|
106
|
-
class Table_Table extends EventEmitter {
|
|
107
|
-
engineTable;
|
|
108
|
-
#dataMap;
|
|
109
|
-
#indexOfKey;
|
|
110
|
-
#updateColumnName;
|
|
111
|
-
constructor(schemaOrEngineTable, data = [], dataMap, updateGenerator){
|
|
112
|
-
super();
|
|
113
|
-
this.engineTable = schemaOrEngineTable instanceof vuu_table_Table ? schemaOrEngineTable : new vuu_table_Table(schemaOrEngineTable);
|
|
114
|
-
this.#dataMap = dataMap ?? this.engineTable.columnMap;
|
|
115
|
-
this.#indexOfKey = this.engineTable.indexOfKeyField;
|
|
116
|
-
for (const row of data)this.engineTable.insert(row);
|
|
117
|
-
this.engineTable.addListener({
|
|
118
|
-
onInsert: (_rowIdx, row)=>this.emit("insert", row),
|
|
119
|
-
onUpdate: (_rowIdx, row)=>this.emit("update", row, this.#updateColumnName),
|
|
120
|
-
onDelete: (_rowIdx, row)=>this.emit("delete", String(row[this.#indexOfKey])),
|
|
121
|
-
onClear: ()=>void 0
|
|
122
|
-
});
|
|
123
|
-
updateGenerator?.setTable(this);
|
|
124
|
-
updateGenerator?.setRange({
|
|
125
|
-
from: 0,
|
|
126
|
-
to: 100
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
get data() {
|
|
130
|
-
return this.engineTable.rows;
|
|
131
|
-
}
|
|
132
|
-
get map() {
|
|
133
|
-
return this.#dataMap;
|
|
134
|
-
}
|
|
135
|
-
get schema() {
|
|
136
|
-
return this.engineTable.schema;
|
|
137
|
-
}
|
|
138
|
-
get name() {
|
|
139
|
-
return this.engineTable.name;
|
|
140
|
-
}
|
|
141
|
-
get rowCount() {
|
|
142
|
-
return this.engineTable.rowCount;
|
|
143
|
-
}
|
|
144
|
-
delete(key) {
|
|
145
|
-
if (!this.engineTable.delete(key)) throw Error(`[Table] delete key ${key} not found`);
|
|
146
|
-
}
|
|
147
|
-
insert(row, _emitEvent = true) {
|
|
148
|
-
const ts = Date.now();
|
|
149
|
-
const { vuuCreatedTimestamp, vuuUpdatedTimestamp } = this.#dataMap;
|
|
150
|
-
if (void 0 !== vuuUpdatedTimestamp) row[vuuUpdatedTimestamp] = ts;
|
|
151
|
-
if (void 0 !== vuuCreatedTimestamp) row[vuuCreatedTimestamp] = ts;
|
|
152
|
-
this.engineTable.insert(row);
|
|
153
|
-
}
|
|
154
|
-
findByKey(key) {
|
|
155
|
-
return this.engineTable.getRowAtKey(key, false);
|
|
156
|
-
}
|
|
157
|
-
update(key, columnName, value) {
|
|
158
|
-
const rowIdx = this.engineTable.rowIndexAtKey(key);
|
|
159
|
-
if (-1 !== rowIdx) {
|
|
160
|
-
const newRow = this.engineTable.rows[rowIdx].slice();
|
|
161
|
-
newRow[this.#dataMap[columnName]] = value;
|
|
162
|
-
this.#updateColumnName = columnName;
|
|
163
|
-
try {
|
|
164
|
-
this.engineTable.update(rowIdx, newRow);
|
|
165
|
-
} finally{
|
|
166
|
-
this.#updateColumnName = void 0;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
updateRow(row) {
|
|
171
|
-
const rowIdx = this.engineTable.rowIndexAtKey(String(row[this.#indexOfKey]));
|
|
172
|
-
if (-1 !== rowIdx) this.engineTable.update(rowIdx, row);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function Table_buildDataColumnMapFromSchema(schema) {
|
|
176
|
-
const map = {};
|
|
177
|
-
schema.columns.forEach((col, index)=>{
|
|
178
|
-
map[col.name] = index;
|
|
179
|
-
});
|
|
180
|
-
return map;
|
|
181
|
-
}
|
|
182
|
-
function buildDataColumnMap(schemas, tableName) {
|
|
183
|
-
return Table_buildDataColumnMapFromSchema(schemas[tableName]);
|
|
184
|
-
}
|
|
185
104
|
class RowKeys {
|
|
186
105
|
#from = 0;
|
|
187
106
|
#keys = [];
|
|
@@ -1153,86 +1072,6 @@ const setCurrentUser = (user)=>{
|
|
|
1153
1072
|
authorizations: []
|
|
1154
1073
|
} : user;
|
|
1155
1074
|
};
|
|
1156
|
-
const DEFAULT_RANGE_LIMITS = {
|
|
1157
|
-
maxRangeEnd: 1000000,
|
|
1158
|
-
maxRangeWidth: 1000
|
|
1159
|
-
};
|
|
1160
|
-
const tableKey = ({ module, table })=>`${module}:${table}`;
|
|
1161
|
-
const createTable = (schema, data = [], dataMap = Table_buildDataColumnMapFromSchema(schema), updateGenerator)=>new Table_Table(schema, data, dataMap, updateGenerator);
|
|
1162
|
-
const createJoinTable = (joinTable, table1, table2, joinColumn)=>{
|
|
1163
|
-
const { schema: schema1 } = table1;
|
|
1164
|
-
const { schema: schema2 } = table2;
|
|
1165
|
-
const combinedColumns = new Set([
|
|
1166
|
-
...schema1.columns,
|
|
1167
|
-
...schema2.columns
|
|
1168
|
-
].map((col)=>col.name).sort());
|
|
1169
|
-
const combinedSchema = {
|
|
1170
|
-
key: schema1.key,
|
|
1171
|
-
table: joinTable,
|
|
1172
|
-
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
1173
|
-
columns: Array.from(combinedColumns).map((columnName)=>({
|
|
1174
|
-
name: columnName,
|
|
1175
|
-
serverDataType: getServerDataType(columnName, schema1, schema2)
|
|
1176
|
-
}))
|
|
1177
|
-
};
|
|
1178
|
-
const engineJoinTable = new JoinTable({
|
|
1179
|
-
schema: combinedSchema,
|
|
1180
|
-
baseTable: table1.engineTable,
|
|
1181
|
-
joinTable: table2.engineTable,
|
|
1182
|
-
leftColumn: joinColumn,
|
|
1183
|
-
rightColumn: joinColumn,
|
|
1184
|
-
joinType: "inner"
|
|
1185
|
-
});
|
|
1186
|
-
return new Table_Table(engineJoinTable);
|
|
1187
|
-
};
|
|
1188
|
-
class TableContainer {
|
|
1189
|
-
#tables = new Map();
|
|
1190
|
-
createTable = (schema, data = [], dataMap = Table_buildDataColumnMapFromSchema(schema), updateGenerator)=>{
|
|
1191
|
-
const table = createTable(schema, data, dataMap, updateGenerator);
|
|
1192
|
-
this.addTable(table);
|
|
1193
|
-
return table;
|
|
1194
|
-
};
|
|
1195
|
-
createJoinTable(joinTable, table1, table2, joinColumn) {
|
|
1196
|
-
const newTable = createJoinTable(joinTable, this.getTable(table1), this.getTable(table2), joinColumn);
|
|
1197
|
-
this.addTable(newTable);
|
|
1198
|
-
return newTable;
|
|
1199
|
-
}
|
|
1200
|
-
addTable(table, as = table.schema.table) {
|
|
1201
|
-
this.#tables.set(tableKey(as), table);
|
|
1202
|
-
}
|
|
1203
|
-
removeTable(table) {
|
|
1204
|
-
return this.#tables.delete(tableKey(table));
|
|
1205
|
-
}
|
|
1206
|
-
hasTable(table) {
|
|
1207
|
-
return this.#tables.has(tableKey(table));
|
|
1208
|
-
}
|
|
1209
|
-
getTable(table) {
|
|
1210
|
-
if ("string" == typeof table) {
|
|
1211
|
-
const matches = Array.from(this.#tables.keys()).filter((key)=>key.endsWith(`:${table}`));
|
|
1212
|
-
if (1 === matches.length) return this.#tables.get(matches[0]);
|
|
1213
|
-
if (matches.length > 1) throw Error(`[TableContainer] table name ${table} is ambiguous (${matches.join(", ")}), use {module, table}`);
|
|
1214
|
-
throw Error(`[TableContainer] no table ${table}`);
|
|
1215
|
-
}
|
|
1216
|
-
const found = this.#tables.get(tableKey(table));
|
|
1217
|
-
if (found) return found;
|
|
1218
|
-
throw Error(`[TableContainer] no table ${tableKey(table)}`);
|
|
1219
|
-
}
|
|
1220
|
-
get tables() {
|
|
1221
|
-
return Array.from(this.#tables.values());
|
|
1222
|
-
}
|
|
1223
|
-
clear() {
|
|
1224
|
-
this.#tables.clear();
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
const getServerDataType = (columnName, { columns: cols1, table: t1 }, { columns: cols2, table: t2 })=>{
|
|
1228
|
-
const col1 = cols1.find((col)=>col.name === columnName);
|
|
1229
|
-
const col2 = cols2.find((col)=>col.name === columnName);
|
|
1230
|
-
if (col1 && col2) if (col1.serverDataType === col2.serverDataType) return col1.serverDataType;
|
|
1231
|
-
else throw Error(`both tables ${t1.table} and ${t2.table} implement column ${columnName}, but with types differ`);
|
|
1232
|
-
if (col1) return col1.serverDataType;
|
|
1233
|
-
if (col2) return col2.serverDataType;
|
|
1234
|
-
throw Error("how is this possible");
|
|
1235
|
-
};
|
|
1236
1075
|
const VUU_SYSTEM_COLUMNS = new Set([
|
|
1237
1076
|
"vuuCreatedTimestamp",
|
|
1238
1077
|
"vuuUpdatedTimestamp",
|
|
@@ -1544,54 +1383,78 @@ class VuuModule {
|
|
|
1544
1383
|
if (sessionTable) return sessionTable;
|
|
1545
1384
|
if (throwIfNotFound) throw Error(`getSessionTable: no session table with name ${sessionTableName}`);
|
|
1546
1385
|
}
|
|
1386
|
+
#markSessionRowDeleted(sessionTable, key) {
|
|
1387
|
+
const row = sessionTable.findByKey(key);
|
|
1388
|
+
if (!row) throw Error(`deleteRow: row ${key} not found`);
|
|
1389
|
+
if ("addRow" === row[sessionTable.map.vuuAction]) sessionTable.delete(key);
|
|
1390
|
+
else sessionTable.update(key, "vuuAction", "deleteRow");
|
|
1391
|
+
}
|
|
1547
1392
|
deleteRow = async (rpcRequest)=>{
|
|
1548
1393
|
if ("VIEWPORT_CONTEXT" === rpcRequest.context.type) {
|
|
1549
1394
|
const { viewPortId } = rpcRequest.context;
|
|
1550
|
-
const { key
|
|
1395
|
+
const { key } = rpcRequest.params;
|
|
1551
1396
|
const sessionTable = this.getSessionTable(viewPortId, false);
|
|
1552
|
-
if (sessionTable) {
|
|
1553
|
-
|
|
1554
|
-
|
|
1397
|
+
if (!sessionTable) return {
|
|
1398
|
+
type: "ERROR_RESULT",
|
|
1399
|
+
errorMessage: "deleteRow: only supported in an edit session"
|
|
1400
|
+
};
|
|
1401
|
+
try {
|
|
1402
|
+
this.#markSessionRowDeleted(sessionTable, String(key));
|
|
1555
1403
|
return {
|
|
1556
1404
|
type: "SUCCESS_RESULT",
|
|
1557
1405
|
data: void 0
|
|
1558
1406
|
};
|
|
1407
|
+
} catch (e) {
|
|
1408
|
+
return {
|
|
1409
|
+
type: "ERROR_RESULT",
|
|
1410
|
+
errorMessage: e.message
|
|
1411
|
+
};
|
|
1559
1412
|
}
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1413
|
+
}
|
|
1414
|
+
return {
|
|
1415
|
+
type: "ERROR_RESULT",
|
|
1416
|
+
errorMessage: "deleteRow: invalid rpc request"
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
deleteSourceRow = async (rpcRequest)=>{
|
|
1420
|
+
if ("VIEWPORT_CONTEXT" === rpcRequest.context.type) {
|
|
1421
|
+
const { viewPortId } = rpcRequest.context;
|
|
1422
|
+
const { key, mode = "hard" } = rpcRequest.params;
|
|
1423
|
+
const { dataSource } = this.getSubscriptionByViewport(viewPortId);
|
|
1424
|
+
const table = dataSource.table ? this.tables[dataSource.table.table] : void 0;
|
|
1425
|
+
if (table) {
|
|
1426
|
+
if ("soft" === mode) table.update(key, this.#sessionTableMessageColumn, "SOFT_DELETED");
|
|
1427
|
+
else table.delete(key);
|
|
1428
|
+
return {
|
|
1429
|
+
type: "SUCCESS_RESULT",
|
|
1430
|
+
data: void 0
|
|
1431
|
+
};
|
|
1573
1432
|
}
|
|
1574
1433
|
}
|
|
1575
1434
|
return {
|
|
1576
1435
|
type: "ERROR_RESULT",
|
|
1577
|
-
errorMessage: "
|
|
1436
|
+
errorMessage: "deleteSourceRow: table not found"
|
|
1578
1437
|
};
|
|
1579
1438
|
};
|
|
1580
1439
|
deleteSelectedRows = async (rpcRequest)=>{
|
|
1581
1440
|
if (isDeleteSelectedRowsRpcRequest(rpcRequest)) {
|
|
1582
1441
|
const { viewPortId } = rpcRequest.context;
|
|
1583
|
-
const { mode = "soft" } = rpcRequest.params;
|
|
1584
1442
|
const sessionTable = this.getSessionTable(viewPortId, false);
|
|
1585
1443
|
if (sessionTable) {
|
|
1586
1444
|
const { dataSource } = this.getSubscriptionByViewport(viewPortId);
|
|
1587
1445
|
const selectedRowIds = dataSource.getSelectedRowIds();
|
|
1588
|
-
|
|
1589
|
-
for (const key of selectedRowIds)if (
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1446
|
+
try {
|
|
1447
|
+
for (const key of selectedRowIds)if (!sessionTable.findByKey(key)) throw Error(`deleteSelectedRows: row ${key} not found`);
|
|
1448
|
+
for (const key of selectedRowIds)this.#markSessionRowDeleted(sessionTable, key);
|
|
1449
|
+
} catch (e) {
|
|
1450
|
+
return {
|
|
1451
|
+
type: "ERROR_RESULT",
|
|
1452
|
+
errorMessage: e.message
|
|
1453
|
+
};
|
|
1594
1454
|
}
|
|
1455
|
+
if (selectedRowIds.length > 0) dataSource.select?.({
|
|
1456
|
+
type: "DESELECT_ALL"
|
|
1457
|
+
});
|
|
1595
1458
|
return {
|
|
1596
1459
|
type: "SUCCESS_RESULT",
|
|
1597
1460
|
data: {
|
|
@@ -2176,92 +2039,6 @@ const mergeServices = (...serviceLists)=>{
|
|
|
2176
2039
|
for (const serviceList of serviceLists)if (Array.isArray(serviceList)) for (const service of serviceList)services.set(service.rpcName, service);
|
|
2177
2040
|
return Array.from(services.values());
|
|
2178
2041
|
};
|
|
2179
|
-
class LocalEngine {
|
|
2180
|
-
tableContainer = new TableContainer();
|
|
2181
|
-
#modules = new Map();
|
|
2182
|
-
#disposed = false;
|
|
2183
|
-
constructor({ modules = [] } = {}){
|
|
2184
|
-
for (const module of modules)this.register(module);
|
|
2185
|
-
}
|
|
2186
|
-
register(module) {
|
|
2187
|
-
const existing = this.#modules.get(module.name);
|
|
2188
|
-
if (existing === module) return module;
|
|
2189
|
-
if (existing) this.unregister(existing.name);
|
|
2190
|
-
this.#modules.set(module.name, module);
|
|
2191
|
-
for (const [tableName, table] of Object.entries(module.getTables()))this.tableContainer.addTable(table, {
|
|
2192
|
-
module: module.name,
|
|
2193
|
-
table: tableName
|
|
2194
|
-
});
|
|
2195
|
-
module.attachEngine(this);
|
|
2196
|
-
return module;
|
|
2197
|
-
}
|
|
2198
|
-
unregister(moduleName) {
|
|
2199
|
-
const module = this.#modules.get(moduleName);
|
|
2200
|
-
if (module) {
|
|
2201
|
-
this.#modules.delete(moduleName);
|
|
2202
|
-
for (const tableName of module.getTableList())this.tableContainer.removeTable({
|
|
2203
|
-
module: moduleName,
|
|
2204
|
-
table: tableName
|
|
2205
|
-
});
|
|
2206
|
-
module.detachEngine(this);
|
|
2207
|
-
return true;
|
|
2208
|
-
}
|
|
2209
|
-
return false;
|
|
2210
|
-
}
|
|
2211
|
-
hasModule(moduleName) {
|
|
2212
|
-
return this.#modules.has(moduleName);
|
|
2213
|
-
}
|
|
2214
|
-
getModule(moduleName) {
|
|
2215
|
-
const module = this.#modules.get(moduleName);
|
|
2216
|
-
if (module) return module;
|
|
2217
|
-
throw Error(`[LocalEngine] module ${moduleName} not found`);
|
|
2218
|
-
}
|
|
2219
|
-
get modules() {
|
|
2220
|
-
return Array.from(this.#modules.values());
|
|
2221
|
-
}
|
|
2222
|
-
get moduleNames() {
|
|
2223
|
-
return Array.from(this.#modules.keys());
|
|
2224
|
-
}
|
|
2225
|
-
getTableList() {
|
|
2226
|
-
return this.modules.flatMap((module)=>module.getTableList().map((table)=>({
|
|
2227
|
-
module: module.name,
|
|
2228
|
-
table
|
|
2229
|
-
})));
|
|
2230
|
-
}
|
|
2231
|
-
getTableSchema({ module, table }) {
|
|
2232
|
-
return this.getModule(module).getTableSchema(table);
|
|
2233
|
-
}
|
|
2234
|
-
createDataSource({ module, table }, viewport, config) {
|
|
2235
|
-
return this.getModule(module).createDataSource(table, viewport, config);
|
|
2236
|
-
}
|
|
2237
|
-
get disposed() {
|
|
2238
|
-
return this.#disposed;
|
|
2239
|
-
}
|
|
2240
|
-
dispose() {
|
|
2241
|
-
for (const module of this.modules){
|
|
2242
|
-
const owned = module.engine === this;
|
|
2243
|
-
this.unregister(module.name);
|
|
2244
|
-
if (owned) module.dispose();
|
|
2245
|
-
}
|
|
2246
|
-
this.tableContainer.clear();
|
|
2247
|
-
this.#disposed = true;
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
const createLocalEngine = (options)=>new LocalEngine(options);
|
|
2251
|
-
let defaultEngine;
|
|
2252
|
-
const getDefaultEngine = ()=>{
|
|
2253
|
-
if (void 0 === defaultEngine || defaultEngine.disposed) defaultEngine = new LocalEngine();
|
|
2254
|
-
return defaultEngine;
|
|
2255
|
-
};
|
|
2256
|
-
const resetDefaultEngine = ()=>{
|
|
2257
|
-
defaultEngine?.dispose();
|
|
2258
|
-
defaultEngine = void 0;
|
|
2259
|
-
};
|
|
2260
|
-
const ensureVuuModule = (module)=>{
|
|
2261
|
-
const engine = getDefaultEngine();
|
|
2262
|
-
if (!engine.hasModule(module.name)) engine.register(module);
|
|
2263
|
-
return module;
|
|
2264
|
-
};
|
|
2265
2042
|
const tableContainer = /* @__PURE__ */ new Proxy({}, {
|
|
2266
2043
|
get (_target, property) {
|
|
2267
2044
|
const container = getDefaultEngine().tableContainer;
|
|
@@ -2269,11 +2046,11 @@ const tableContainer = /* @__PURE__ */ new Proxy({}, {
|
|
|
2269
2046
|
return "function" == typeof value ? value.bind(container) : value;
|
|
2270
2047
|
}
|
|
2271
2048
|
});
|
|
2272
|
-
const
|
|
2049
|
+
const DEFAULT_RANGE_LIMITS = {
|
|
2273
2050
|
maxRangeEnd: 1000000,
|
|
2274
2051
|
maxRangeWidth: 1000
|
|
2275
2052
|
};
|
|
2276
|
-
const
|
|
2053
|
+
const schemas = {
|
|
2277
2054
|
algoType: {
|
|
2278
2055
|
columns: [
|
|
2279
2056
|
{
|
|
@@ -2286,7 +2063,7 @@ const basket_schemas_schemas = {
|
|
|
2286
2063
|
}
|
|
2287
2064
|
],
|
|
2288
2065
|
key: "id",
|
|
2289
|
-
rangeLimits:
|
|
2066
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2290
2067
|
table: {
|
|
2291
2068
|
module: "BASKET",
|
|
2292
2069
|
table: "algoType"
|
|
@@ -2312,7 +2089,7 @@ const basket_schemas_schemas = {
|
|
|
2312
2089
|
}
|
|
2313
2090
|
],
|
|
2314
2091
|
key: "id",
|
|
2315
|
-
rangeLimits:
|
|
2092
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2316
2093
|
table: {
|
|
2317
2094
|
module: "BASKET",
|
|
2318
2095
|
table: "basket"
|
|
@@ -2358,7 +2135,7 @@ const basket_schemas_schemas = {
|
|
|
2358
2135
|
}
|
|
2359
2136
|
],
|
|
2360
2137
|
key: "ricBasketId",
|
|
2361
|
-
rangeLimits:
|
|
2138
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2362
2139
|
table: {
|
|
2363
2140
|
module: "BASKET",
|
|
2364
2141
|
table: "basketConstituent"
|
|
@@ -2408,7 +2185,7 @@ const basket_schemas_schemas = {
|
|
|
2408
2185
|
}
|
|
2409
2186
|
],
|
|
2410
2187
|
key: "instanceId",
|
|
2411
|
-
rangeLimits:
|
|
2188
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2412
2189
|
table: {
|
|
2413
2190
|
module: "BASKET",
|
|
2414
2191
|
table: "basketTrading"
|
|
@@ -2490,7 +2267,7 @@ const basket_schemas_schemas = {
|
|
|
2490
2267
|
}
|
|
2491
2268
|
],
|
|
2492
2269
|
key: "instanceIdRic",
|
|
2493
|
-
rangeLimits:
|
|
2270
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2494
2271
|
table: {
|
|
2495
2272
|
module: "BASKET",
|
|
2496
2273
|
table: "basketTradingConstituent"
|
|
@@ -2608,7 +2385,7 @@ const basket_schemas_schemas = {
|
|
|
2608
2385
|
}
|
|
2609
2386
|
],
|
|
2610
2387
|
key: "instanceIdRic",
|
|
2611
|
-
rangeLimits:
|
|
2388
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2612
2389
|
table: {
|
|
2613
2390
|
module: "BASKET",
|
|
2614
2391
|
table: "basketTradingConstituentJoin"
|
|
@@ -2626,7 +2403,7 @@ const basket_schemas_schemas = {
|
|
|
2626
2403
|
}
|
|
2627
2404
|
],
|
|
2628
2405
|
key: "id",
|
|
2629
|
-
rangeLimits:
|
|
2406
|
+
rangeLimits: DEFAULT_RANGE_LIMITS,
|
|
2630
2407
|
table: {
|
|
2631
2408
|
module: "BASKET",
|
|
2632
2409
|
table: "priceStrategyType"
|
|
@@ -6634,7 +6411,7 @@ const getRic = (defaultRic)=>{
|
|
|
6634
6411
|
const row = instrumentsData.at(random(0, instrumentsData.length));
|
|
6635
6412
|
return row?.[InstrumentColumnMap.ric] ?? defaultRic;
|
|
6636
6413
|
};
|
|
6637
|
-
const createInstrumentsTable = ()=>
|
|
6414
|
+
const createInstrumentsTable = ()=>TableContainer_createTable(simul_schemas_schemas.instruments, cloneRows(getInstrumentsData()), Table_buildDataColumnMap(simul_schemas_schemas, "instruments"));
|
|
6638
6415
|
const getPricesData = lazy(()=>{
|
|
6639
6416
|
const now = Date.now();
|
|
6640
6417
|
const lastUpdate = now;
|
|
@@ -6703,7 +6480,7 @@ const getPricesData = lazy(()=>{
|
|
|
6703
6480
|
return pricesData;
|
|
6704
6481
|
});
|
|
6705
6482
|
const createPricesTable = ({ autoStart = false } = {})=>{
|
|
6706
|
-
const map =
|
|
6483
|
+
const map = Table_buildDataColumnMap(simul_schemas_schemas, "prices");
|
|
6707
6484
|
const { bid, bidSize, ask, askSize } = map;
|
|
6708
6485
|
const updateGenerator = new BaseUpdateGenerator({
|
|
6709
6486
|
bid,
|
|
@@ -6713,7 +6490,7 @@ const createPricesTable = ({ autoStart = false } = {})=>{
|
|
|
6713
6490
|
}, {
|
|
6714
6491
|
autoStart
|
|
6715
6492
|
});
|
|
6716
|
-
const table =
|
|
6493
|
+
const table = TableContainer_createTable(simul_schemas_schemas.prices, cloneRows(getPricesData()), map, updateGenerator);
|
|
6717
6494
|
return {
|
|
6718
6495
|
table,
|
|
6719
6496
|
updateGenerator
|
|
@@ -6741,18 +6518,18 @@ const undefinedTables = {
|
|
|
6741
6518
|
basketTradingConstituentJoin: void 0,
|
|
6742
6519
|
priceStrategyType: void 0
|
|
6743
6520
|
};
|
|
6744
|
-
const
|
|
6521
|
+
const buildDataColumnMap = (tableName)=>Object.values(schemas[tableName].columns).reduce((map, col, index)=>{
|
|
6745
6522
|
map[col.name] = index;
|
|
6746
6523
|
return map;
|
|
6747
6524
|
}, {});
|
|
6748
6525
|
const tableMaps = {
|
|
6749
|
-
algoType:
|
|
6750
|
-
basket:
|
|
6751
|
-
basketTrading:
|
|
6752
|
-
basketTradingConstituent:
|
|
6753
|
-
basketConstituent:
|
|
6754
|
-
basketTradingConstituentJoin:
|
|
6755
|
-
priceStrategyType:
|
|
6526
|
+
algoType: buildDataColumnMap("algoType"),
|
|
6527
|
+
basket: buildDataColumnMap("basket"),
|
|
6528
|
+
basketTrading: buildDataColumnMap("basketTrading"),
|
|
6529
|
+
basketTradingConstituent: buildDataColumnMap("basketTradingConstituent"),
|
|
6530
|
+
basketConstituent: buildDataColumnMap("basketConstituent"),
|
|
6531
|
+
basketTradingConstituentJoin: buildDataColumnMap("basketTradingConstituentJoin"),
|
|
6532
|
+
priceStrategyType: buildDataColumnMap("priceStrategyType")
|
|
6756
6533
|
};
|
|
6757
6534
|
class BasketModule extends VuuModule {
|
|
6758
6535
|
#prices;
|
|
@@ -6762,9 +6539,9 @@ class BasketModule extends VuuModule {
|
|
|
6762
6539
|
super("BASKET");
|
|
6763
6540
|
this.#ownsPrices = void 0 === prices;
|
|
6764
6541
|
this.#prices = prices ?? createPricesTable();
|
|
6765
|
-
const basketTradingConstituent =
|
|
6542
|
+
const basketTradingConstituent = TableContainer_createTable(schemas.basketTradingConstituent, [], tableMaps.basketTradingConstituent);
|
|
6766
6543
|
this.#tables = {
|
|
6767
|
-
algoType:
|
|
6544
|
+
algoType: TableContainer_createTable(schemas.algoType, [
|
|
6768
6545
|
[
|
|
6769
6546
|
"Sniper",
|
|
6770
6547
|
0
|
|
@@ -6786,7 +6563,7 @@ class BasketModule extends VuuModule {
|
|
|
6786
6563
|
4
|
|
6787
6564
|
]
|
|
6788
6565
|
], tableMaps.algoType),
|
|
6789
|
-
basket:
|
|
6566
|
+
basket: TableContainer_createTable(schemas.basket, [
|
|
6790
6567
|
[
|
|
6791
6568
|
".NASDAQ100",
|
|
6792
6569
|
".NASDAQ100",
|
|
@@ -6812,14 +6589,14 @@ class BasketModule extends VuuModule {
|
|
|
6812
6589
|
0
|
|
6813
6590
|
]
|
|
6814
6591
|
], tableMaps.basket),
|
|
6815
|
-
basketConstituent:
|
|
6816
|
-
basketTrading:
|
|
6592
|
+
basketConstituent: TableContainer_createTable(schemas.basketConstituent, cloneRows(reference_data_constituents), tableMaps.basketConstituent),
|
|
6593
|
+
basketTrading: TableContainer_createTable(schemas.basketTrading, [], tableMaps.basketTrading),
|
|
6817
6594
|
basketTradingConstituent,
|
|
6818
6595
|
basketTradingConstituentJoin: createJoinTable({
|
|
6819
6596
|
module: "BASKET",
|
|
6820
6597
|
table: "basketTradingConstituentJoin"
|
|
6821
6598
|
}, basketTradingConstituent, this.#prices.table, "ric"),
|
|
6822
|
-
priceStrategyType:
|
|
6599
|
+
priceStrategyType: TableContainer_createTable(schemas.priceStrategyType, [
|
|
6823
6600
|
[
|
|
6824
6601
|
"Peg to Near Touch",
|
|
6825
6602
|
0
|
|
@@ -6863,7 +6640,7 @@ class BasketModule extends VuuModule {
|
|
|
6863
6640
|
};
|
|
6864
6641
|
}
|
|
6865
6642
|
get schemas() {
|
|
6866
|
-
return
|
|
6643
|
+
return schemas;
|
|
6867
6644
|
}
|
|
6868
6645
|
get services() {
|
|
6869
6646
|
return {
|
|
@@ -6915,7 +6692,7 @@ class BasketModule extends VuuModule {
|
|
|
6915
6692
|
createTradingBasket(basketId, basketName) {
|
|
6916
6693
|
const basketTradingRow = createBasketTradingRow(basketId, basketName);
|
|
6917
6694
|
this.tables.basketTrading.insert(basketTradingRow);
|
|
6918
|
-
const { basketId: key } =
|
|
6695
|
+
const { basketId: key } = buildDataColumnMap("basketConstituent");
|
|
6919
6696
|
const constituents = this.tables.basketConstituent.data.filter((c)=>c[key] === basketId);
|
|
6920
6697
|
const { instanceId } = tableMaps.basketTrading;
|
|
6921
6698
|
constituents.forEach(([, , description, , ric, , , quantity, weighting])=>{
|
|
@@ -6995,7 +6772,7 @@ const getInstrumentsExtendedData = lazy(()=>getInstrumentsData().map((row)=>row.
|
|
|
6995
6772
|
1 === random(0, 1),
|
|
6996
6773
|
new Date().getTime()
|
|
6997
6774
|
])));
|
|
6998
|
-
const createInstrumentsExtendedTable = ()=>
|
|
6775
|
+
const createInstrumentsExtendedTable = ()=>TableContainer_createTable(simul_schemas_schemas.instrumentsExtended, cloneRows(getInstrumentsExtendedData()), Table_buildDataColumnMap(simul_schemas_schemas, "instrumentsExtended"));
|
|
6999
6776
|
const sides = [
|
|
7000
6777
|
"BUY",
|
|
7001
6778
|
"SELL"
|
|
@@ -7047,7 +6824,7 @@ const getOrdersData = lazy(()=>{
|
|
|
7047
6824
|
}
|
|
7048
6825
|
return ordersData;
|
|
7049
6826
|
});
|
|
7050
|
-
const createOrdersTable = ()=>
|
|
6827
|
+
const createOrdersTable = ()=>TableContainer_createTable(simul_schemas_schemas.orders, cloneRows(getOrdersData()), Table_buildDataColumnMap(simul_schemas_schemas, "orders"));
|
|
7051
6828
|
const accounts = [
|
|
7052
6829
|
"Account 01",
|
|
7053
6830
|
"Account 02",
|
|
@@ -7083,7 +6860,7 @@ const orderStatus_orderStatus = [
|
|
|
7083
6860
|
"CANCELLED",
|
|
7084
6861
|
"FILLED"
|
|
7085
6862
|
];
|
|
7086
|
-
const instrumentMap =
|
|
6863
|
+
const instrumentMap = Table_buildDataColumnMap(simul_schemas_schemas, "instruments");
|
|
7087
6864
|
const PARENT_ORDER_COUNT = 5000;
|
|
7088
6865
|
const CHILD_ORDER_COUNT = 20000;
|
|
7089
6866
|
const avgChildOrderPerOrder = Math.round(CHILD_ORDER_COUNT / PARENT_ORDER_COUNT);
|
|
@@ -7096,8 +6873,8 @@ class ParentChildOrders {
|
|
|
7096
6873
|
#childOrderCount = 0;
|
|
7097
6874
|
#newOrderInterval;
|
|
7098
6875
|
constructor(){
|
|
7099
|
-
this.parentOrdersTable =
|
|
7100
|
-
this.childOrdersTable =
|
|
6876
|
+
this.parentOrdersTable = TableContainer_createTable(simul_schemas_schemas.parentOrders, [], Table_buildDataColumnMap(simul_schemas_schemas, "parentOrders"));
|
|
6877
|
+
this.childOrdersTable = TableContainer_createTable(simul_schemas_schemas.childOrders, [], Table_buildDataColumnMap(simul_schemas_schemas, "childOrders"));
|
|
7101
6878
|
for(let i = 0; i < PARENT_ORDER_COUNT; i++){
|
|
7102
6879
|
this.#clock.advance(random(0, 100));
|
|
7103
6880
|
this.createParentAndChildOrders();
|
|
@@ -7313,7 +7090,7 @@ class SimulModule extends VuuModule {
|
|
|
7313
7090
|
instruments: [
|
|
7314
7091
|
{
|
|
7315
7092
|
rpcName: "DELETE_ROW",
|
|
7316
|
-
service: this.
|
|
7093
|
+
service: this.deleteSourceRow
|
|
7317
7094
|
}
|
|
7318
7095
|
],
|
|
7319
7096
|
parentOrders: [
|
|
@@ -7635,7 +7412,7 @@ const testSchemas = {
|
|
|
7635
7412
|
class TestModule extends VuuModule {
|
|
7636
7413
|
#schemas = testSchemas;
|
|
7637
7414
|
#tables = {
|
|
7638
|
-
TestDates:
|
|
7415
|
+
TestDates: TableContainer_createTable(this.#schemas.TestDates, [
|
|
7639
7416
|
[
|
|
7640
7417
|
1000000000000000001n,
|
|
7641
7418
|
Date.now(),
|
|
@@ -7686,9 +7463,9 @@ class TestModule extends VuuModule {
|
|
|
7686
7463
|
Date.now(),
|
|
7687
7464
|
Date.now()
|
|
7688
7465
|
]
|
|
7689
|
-
],
|
|
7690
|
-
TwoHundredColumns:
|
|
7691
|
-
LinkParent:
|
|
7466
|
+
], Table_buildDataColumnMap(this.#schemas, "TestDates")),
|
|
7467
|
+
TwoHundredColumns: TableContainer_createTable(this.#schemas.TwoHundredColumns, generateRows(this.#schemas.TwoHundredColumns, 100), Table_buildDataColumnMap(this.#schemas, "TwoHundredColumns")),
|
|
7468
|
+
LinkParent: TableContainer_createTable(this.#schemas.LinkParent, [
|
|
7692
7469
|
[
|
|
7693
7470
|
"1000000001",
|
|
7694
7471
|
"data 1"
|
|
@@ -7701,8 +7478,8 @@ class TestModule extends VuuModule {
|
|
|
7701
7478
|
"1000000003",
|
|
7702
7479
|
"data 2"
|
|
7703
7480
|
]
|
|
7704
|
-
],
|
|
7705
|
-
LinkChild:
|
|
7481
|
+
], Table_buildDataColumnMap(this.#schemas, "LinkParent")),
|
|
7482
|
+
LinkChild: TableContainer_createTable(this.#schemas.LinkChild, [
|
|
7706
7483
|
[
|
|
7707
7484
|
"200001",
|
|
7708
7485
|
"1000000001",
|
|
@@ -7753,8 +7530,8 @@ class TestModule extends VuuModule {
|
|
|
7753
7530
|
"1000000003",
|
|
7754
7531
|
"child 10 (linked to 003)"
|
|
7755
7532
|
]
|
|
7756
|
-
],
|
|
7757
|
-
ChartTable:
|
|
7533
|
+
], Table_buildDataColumnMap(this.#schemas, "LinkChild")),
|
|
7534
|
+
ChartTable: TableContainer_createTable(this.#schemas.ChartTable, [
|
|
7758
7535
|
[
|
|
7759
7536
|
"001",
|
|
7760
7537
|
"2026-04-02",
|
|
@@ -7955,10 +7732,10 @@ class TestModule extends VuuModule {
|
|
|
7955
7732
|
1350,
|
|
7956
7733
|
false
|
|
7957
7734
|
]
|
|
7958
|
-
],
|
|
7959
|
-
MaxScrollEndTable:
|
|
7960
|
-
TestEditEmpty:
|
|
7961
|
-
TestEdit:
|
|
7735
|
+
], Table_buildDataColumnMap(this.#schemas, "ChartTable")),
|
|
7736
|
+
MaxScrollEndTable: TableContainer_createTable(this.#schemas.MaxScrollEndTable, generateRows(this.#schemas.MaxScrollEndTable, 1000), Table_buildDataColumnMap(this.#schemas, "MaxScrollEndTable")),
|
|
7737
|
+
TestEditEmpty: TableContainer_createTable(this.#schemas.TestEditEmpty, [], Table_buildDataColumnMap(this.#schemas, "TestEditEmpty")),
|
|
7738
|
+
TestEdit: TableContainer_createTable(this.#schemas.TestEdit, [
|
|
7962
7739
|
[
|
|
7963
7740
|
"TEST-001",
|
|
7964
7741
|
"Alpha",
|
|
@@ -8009,7 +7786,7 @@ class TestModule extends VuuModule {
|
|
|
8009
7786
|
withNanoMs(Date.now(), 5),
|
|
8010
7787
|
1000000000000000005n
|
|
8011
7788
|
]
|
|
8012
|
-
],
|
|
7789
|
+
], Table_buildDataColumnMap(this.#schemas, "TestEdit"))
|
|
8013
7790
|
};
|
|
8014
7791
|
constructor(){
|
|
8015
7792
|
super("TEST");
|
|
@@ -8040,65 +7817,6 @@ const registerDemoModules = (engine = getDefaultEngine())=>{
|
|
|
8040
7817
|
testModule
|
|
8041
7818
|
};
|
|
8042
7819
|
};
|
|
8043
|
-
const providers = new WeakMap();
|
|
8044
|
-
const createDataSourceProvider = (engine)=>{
|
|
8045
|
-
const cached = providers.get(engine);
|
|
8046
|
-
if (cached) return cached;
|
|
8047
|
-
const getModule = (moduleName)=>{
|
|
8048
|
-
if (!engine.hasModule(moduleName)) throw Error(`[LocalDataSourceProvider] module ${moduleName} is not available on this server`);
|
|
8049
|
-
return engine.getModule(moduleName);
|
|
8050
|
-
};
|
|
8051
|
-
const serverAPI = {
|
|
8052
|
-
getTableList: async ()=>({
|
|
8053
|
-
tables: engine.getTableList()
|
|
8054
|
-
}),
|
|
8055
|
-
getTableSchema: async ({ module, table })=>getModule(module).getTableSchema(table),
|
|
8056
|
-
rpcCall: async ()=>{
|
|
8057
|
-
throw Error("RpcCall no longer supported on LocalDataSourceProvider ServerAPI");
|
|
8058
|
-
}
|
|
8059
|
-
};
|
|
8060
|
-
const getServerAPI = async ()=>serverAPI;
|
|
8061
|
-
class VuuDataSource {
|
|
8062
|
-
constructor({ aggregations, columns, filterSpec, groupBy, session, sort, table, viewport, visualLink }){
|
|
8063
|
-
const config = {
|
|
8064
|
-
aggregations,
|
|
8065
|
-
columns,
|
|
8066
|
-
filterSpec,
|
|
8067
|
-
groupBy,
|
|
8068
|
-
session,
|
|
8069
|
-
sort,
|
|
8070
|
-
visualLink
|
|
8071
|
-
};
|
|
8072
|
-
const module = getModule(table.module);
|
|
8073
|
-
return module.createDataSource(table.table, viewport, config);
|
|
8074
|
-
}
|
|
8075
|
-
}
|
|
8076
|
-
const DataSourceProvider = ({ children })=>/*#__PURE__*/ jsx(vuu_utils_DataProvider, {
|
|
8077
|
-
VuuDataSource: VuuDataSource,
|
|
8078
|
-
getServerAPI: getServerAPI,
|
|
8079
|
-
children: /*#__PURE__*/ jsx(DataProvider, {
|
|
8080
|
-
VuuDataSource: VuuDataSource,
|
|
8081
|
-
getServerAPI: getServerAPI,
|
|
8082
|
-
children: children
|
|
8083
|
-
})
|
|
8084
|
-
});
|
|
8085
|
-
providers.set(engine, DataSourceProvider);
|
|
8086
|
-
return DataSourceProvider;
|
|
8087
|
-
};
|
|
8088
|
-
const LocalDataSourceProvider = ({ children })=>{
|
|
8089
|
-
const DataSourceProvider = createDataSourceProvider(getDefaultEngine());
|
|
8090
|
-
return /*#__PURE__*/ jsx(DataSourceProvider, {
|
|
8091
|
-
children: children
|
|
8092
|
-
});
|
|
8093
|
-
};
|
|
8094
|
-
const createLocalVuuServer = ({ connectionId, modules, engine = new LocalEngine() })=>{
|
|
8095
|
-
for (const module of modules)engine.register(module);
|
|
8096
|
-
return {
|
|
8097
|
-
connectionId,
|
|
8098
|
-
DataSourceProvider: createDataSourceProvider(engine),
|
|
8099
|
-
engine
|
|
8100
|
-
};
|
|
8101
|
-
};
|
|
8102
7820
|
const checkPattern = (value, pattern)=>new RegExp(`^${pattern}`, "i").test(value);
|
|
8103
7821
|
const getUniqueValues = (data, columnIndex, pattern = "")=>{
|
|
8104
7822
|
const uniqueValues = [];
|
|
@@ -8211,7 +7929,7 @@ class NotificationModule extends VuuModule {
|
|
|
8211
7929
|
table: TABLE_NAME
|
|
8212
7930
|
}
|
|
8213
7931
|
};
|
|
8214
|
-
const table =
|
|
7932
|
+
const table = TableContainer_createTable(schema, [], Table_buildDataColumnMapFromSchema(schema));
|
|
8215
7933
|
this.#schemas = {
|
|
8216
7934
|
[TABLE_NAME]: schema
|
|
8217
7935
|
};
|
|
@@ -8549,14 +8267,14 @@ const MODULE_ADMIN_TABLE_SCHEMAS = {
|
|
|
8549
8267
|
}
|
|
8550
8268
|
};
|
|
8551
8269
|
const schemas_schemas = {
|
|
8552
|
-
...
|
|
8270
|
+
...schemas,
|
|
8553
8271
|
...simul_schemas_schemas,
|
|
8554
8272
|
...testSchemas,
|
|
8555
8273
|
...USER_ADMIN_TABLE_SCHEMAS,
|
|
8556
8274
|
...MODULE_ADMIN_TABLE_SCHEMAS
|
|
8557
8275
|
};
|
|
8558
8276
|
const allSchemas = {
|
|
8559
|
-
...
|
|
8277
|
+
...schemas,
|
|
8560
8278
|
...simul_schemas_schemas,
|
|
8561
8279
|
...testSchemas,
|
|
8562
8280
|
...USER_ADMIN_TABLE_SCHEMAS,
|
|
@@ -8594,13 +8312,13 @@ const reconcileModuleAdminTables = (snapshot, tables)=>{
|
|
|
8594
8312
|
}
|
|
8595
8313
|
}
|
|
8596
8314
|
};
|
|
8597
|
-
const
|
|
8315
|
+
const createTable = (tableName)=>{
|
|
8598
8316
|
const schema = MODULE_ADMIN_TABLE_SCHEMAS[tableName];
|
|
8599
|
-
return
|
|
8317
|
+
return TableContainer_createTable(schema, [], Table_buildDataColumnMapFromSchema(schema));
|
|
8600
8318
|
};
|
|
8601
8319
|
const createTables = ()=>({
|
|
8602
|
-
modulePermissions:
|
|
8603
|
-
modules:
|
|
8320
|
+
modulePermissions: createTable("modulePermissions"),
|
|
8321
|
+
modules: createTable("modules")
|
|
8604
8322
|
});
|
|
8605
8323
|
const INITIAL_TIMESTAMP = 1710000000000;
|
|
8606
8324
|
const svgIcon = (body)=>`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`)}`;
|
|
@@ -9387,13 +9105,13 @@ const reconcileUserAdminTables = (snapshot, tables)=>{
|
|
|
9387
9105
|
}
|
|
9388
9106
|
};
|
|
9389
9107
|
const UserAdminModule_createTables = ()=>({
|
|
9390
|
-
clients:
|
|
9391
|
-
group_roles:
|
|
9392
|
-
groups:
|
|
9393
|
-
roles:
|
|
9394
|
-
user_group_roles:
|
|
9395
|
-
user_groups:
|
|
9396
|
-
users:
|
|
9108
|
+
clients: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.clients),
|
|
9109
|
+
group_roles: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.group_roles),
|
|
9110
|
+
groups: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.groups),
|
|
9111
|
+
roles: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.roles),
|
|
9112
|
+
user_group_roles: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.user_group_roles),
|
|
9113
|
+
user_groups: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.user_groups),
|
|
9114
|
+
users: TableContainer_createTable(USER_ADMIN_TABLE_SCHEMAS.users)
|
|
9397
9115
|
});
|
|
9398
9116
|
const UserAdminModule_errorResult = (error)=>({
|
|
9399
9117
|
errorMessage: error instanceof Error ? error.message : "User admin request failed",
|
|
@@ -9944,4 +9662,5 @@ class UserAdminModule extends VuuModule {
|
|
|
9944
9662
|
if (existingUser) throw new Error("username must be unique");
|
|
9945
9663
|
}
|
|
9946
9664
|
}
|
|
9947
|
-
export {
|
|
9665
|
+
export { LocalEngine, Table, TableContainer, buildDataColumnMap, buildDataColumnMapFromSchema, createJoinTable, createLocalEngine, createTable, ensureVuuModule, getDefaultEngine, resetDefaultEngine } from "./91.js";
|
|
9666
|
+
export { AllowAllPermissionFilter, ArrayProxy, BaseUpdateGenerator, BasketModule, DUPLICATE_KEY, DefaultColumnGenerator, DefaultRowGenerator, DenyAllPermissionFilter, DismissNotificationRpcHandler, EngineDataSource, MODULE_ADMIN_INITIAL_SNAPSHOT, MODULE_ADMIN_MODULE_NAME, MODULE_ADMIN_TABLE_SCHEMAS, ModuleAdminModule, ModuleDataSource, NotificationModule, NotificationsSchema, NotificationsSchema_toColumn as toColumn, PermissionFilter, SAVE_FAILED, SAVE_NOT_PERMITTED, STALE_UPDATE, SimulModule, SimulatedNotificationsModule, SimulatedNotificationsProvider, TestModule, TickingArrayDataSource, USER_ADMIN_INITIAL_SNAPSHOT, UserAdminModule, VUU_SYSTEM_COLUMNS, VuuModule, defaultApplySessionSave, defaultCanEditSource, defaultGenerators, defaultGetStaleColumns, defaultIsEditableColumn, formatMessage, getAllSchemas, getColumnAndRowGenerator, getCurrentUser, getSchema, isBasketTable, isSimulTable, isSystemColumn, makeSuggestions, populateArray, projectModuleAdminSnapshot, projectUserAdminSnapshot, reconcileModuleAdminTables, reconcileUserAdminTables, registerDemoModules, schemas as basketSchemas, schemas_schemas as schemas, setCurrentUser, simul_schemas_schemas as simulSchemas, tableContainer, testSchemas, toRange };
|