@saltcorn/data 1.4.0-beta.0 → 1.4.0-beta.10

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.
Files changed (94) hide show
  1. package/dist/base-plugin/actions.d.ts +165 -49
  2. package/dist/base-plugin/actions.d.ts.map +1 -1
  3. package/dist/base-plugin/actions.js +120 -16
  4. package/dist/base-plugin/actions.js.map +1 -1
  5. package/dist/base-plugin/fileviews.js +3 -3
  6. package/dist/base-plugin/fileviews.js.map +1 -1
  7. package/dist/base-plugin/index.d.ts +3 -11
  8. package/dist/base-plugin/index.d.ts.map +1 -1
  9. package/dist/base-plugin/types.d.ts.map +1 -1
  10. package/dist/base-plugin/types.js +3 -1
  11. package/dist/base-plugin/types.js.map +1 -1
  12. package/dist/base-plugin/viewtemplates/edit.d.ts +1 -5
  13. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  14. package/dist/base-plugin/viewtemplates/edit.js +29 -13
  15. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  16. package/dist/base-plugin/viewtemplates/filter.d.ts +1 -5
  17. package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
  18. package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
  19. package/dist/base-plugin/viewtemplates/list.js +53 -2
  20. package/dist/base-plugin/viewtemplates/list.js.map +1 -1
  21. package/dist/base-plugin/viewtemplates/show.d.ts +1 -1
  22. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +1 -1
  23. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
  24. package/dist/base-plugin/viewtemplates/viewable_fields.js +14 -9
  25. package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
  26. package/dist/db/state.d.ts +9 -3
  27. package/dist/db/state.d.ts.map +1 -1
  28. package/dist/db/state.js +55 -29
  29. package/dist/db/state.js.map +1 -1
  30. package/dist/models/config.d.ts.map +1 -1
  31. package/dist/models/config.js +9 -0
  32. package/dist/models/config.js.map +1 -1
  33. package/dist/models/crash.d.ts.map +1 -1
  34. package/dist/models/crash.js +9 -3
  35. package/dist/models/crash.js.map +1 -1
  36. package/dist/models/expression.d.ts +1 -1
  37. package/dist/models/expression.d.ts.map +1 -1
  38. package/dist/models/expression.js +12 -3
  39. package/dist/models/expression.js.map +1 -1
  40. package/dist/models/fieldrepeat.d.ts +1 -1
  41. package/dist/models/fieldrepeat.d.ts.map +1 -1
  42. package/dist/models/fieldrepeat.js +12 -4
  43. package/dist/models/fieldrepeat.js.map +1 -1
  44. package/dist/models/file.d.ts.map +1 -1
  45. package/dist/models/file.js +2 -0
  46. package/dist/models/file.js.map +1 -1
  47. package/dist/models/form.js +1 -1
  48. package/dist/models/form.js.map +1 -1
  49. package/dist/models/index.d.ts +1 -1
  50. package/dist/models/index.d.ts.map +1 -1
  51. package/dist/models/page.d.ts.map +1 -1
  52. package/dist/models/page.js +2 -1
  53. package/dist/models/page.js.map +1 -1
  54. package/dist/models/scheduler.d.ts.map +1 -1
  55. package/dist/models/scheduler.js +2 -1
  56. package/dist/models/scheduler.js.map +1 -1
  57. package/dist/models/table.d.ts +17 -8
  58. package/dist/models/table.d.ts.map +1 -1
  59. package/dist/models/table.js +151 -80
  60. package/dist/models/table.js.map +1 -1
  61. package/dist/models/table_constraints.d.ts.map +1 -1
  62. package/dist/models/table_constraints.js +4 -6
  63. package/dist/models/table_constraints.js.map +1 -1
  64. package/dist/models/trigger.d.ts.map +1 -1
  65. package/dist/models/trigger.js +1 -1
  66. package/dist/models/trigger.js.map +1 -1
  67. package/dist/models/workflow_run.d.ts +1 -1
  68. package/dist/models/workflow_run.d.ts.map +1 -1
  69. package/dist/models/workflow_run.js +30 -5
  70. package/dist/models/workflow_run.js.map +1 -1
  71. package/dist/plugin-helper.d.ts.map +1 -1
  72. package/dist/plugin-helper.js +95 -6
  73. package/dist/plugin-helper.js.map +1 -1
  74. package/dist/tests/actions.test.js +18 -2
  75. package/dist/tests/actions.test.js.map +1 -1
  76. package/dist/tests/auth.test.js +15 -2
  77. package/dist/tests/auth.test.js.map +1 -1
  78. package/dist/tests/calc.test.js +17 -1
  79. package/dist/tests/calc.test.js.map +1 -1
  80. package/dist/tests/edit.test.js +2 -2
  81. package/dist/tests/edit.test.js.map +1 -1
  82. package/dist/tests/exact_views.test.js +14 -14
  83. package/dist/tests/exact_views.test.js.map +1 -1
  84. package/dist/tests/field.test.js +9 -11
  85. package/dist/tests/field.test.js.map +1 -1
  86. package/dist/tests/form.test.js +65 -0
  87. package/dist/tests/form.test.js.map +1 -1
  88. package/dist/tests/list.test.js +22 -7
  89. package/dist/tests/list.test.js.map +1 -1
  90. package/dist/tests/table.test.js +52 -0
  91. package/dist/tests/table.test.js.map +1 -1
  92. package/dist/tests/view.test.js +1 -1
  93. package/dist/tests/view.test.js.map +1 -1
  94. package/package.json +9 -9
@@ -539,12 +539,18 @@ export namespace insert_any_row {
539
539
  options: string[];
540
540
  type?: undefined;
541
541
  fieldview?: undefined;
542
+ class?: undefined;
543
+ attributes?: undefined;
542
544
  } | {
543
545
  name: string;
544
546
  label: string;
545
547
  sublabel: string;
546
548
  type: string;
547
549
  fieldview: string;
550
+ class: string;
551
+ attributes: {
552
+ spellcheck: boolean;
553
+ };
548
554
  input_type?: undefined;
549
555
  options?: undefined;
550
556
  } | {
@@ -555,6 +561,8 @@ export namespace insert_any_row {
555
561
  input_type?: undefined;
556
562
  options?: undefined;
557
563
  fieldview?: undefined;
564
+ class?: undefined;
565
+ attributes?: undefined;
558
566
  })[]>;
559
567
  export { configFields_9 as configFields };
560
568
  export function run_8({ row, table, configuration, user, referrer, ...rest }: {
@@ -698,7 +706,7 @@ export namespace delete_rows {
698
706
  table_name: any;
699
707
  };
700
708
  user: any;
701
- }): Promise<void>;
709
+ }): Promise<{}>;
702
710
  export { run_10 as run };
703
711
  let namespace_10: string;
704
712
  export { namespace_10 as namespace };
@@ -1209,10 +1217,118 @@ export namespace reload_embedded_view {
1209
1217
  let namespace_20: string;
1210
1218
  export { namespace_20 as namespace };
1211
1219
  }
1212
- export namespace sleep {
1220
+ export namespace progress_bar {
1213
1221
  let description_21: string;
1214
1222
  export { description_21 as description };
1215
1223
  let configFields_22: ({
1224
+ name: string;
1225
+ label: string;
1226
+ sublabel: string;
1227
+ type: string;
1228
+ class?: undefined;
1229
+ required?: undefined;
1230
+ showIf?: undefined;
1231
+ attributes?: undefined;
1232
+ } | {
1233
+ name: string;
1234
+ label: string;
1235
+ type: string;
1236
+ class: string;
1237
+ required: boolean;
1238
+ sublabel: string;
1239
+ showIf: {
1240
+ blocking: boolean;
1241
+ close: boolean;
1242
+ };
1243
+ attributes?: undefined;
1244
+ } | {
1245
+ name: string;
1246
+ label: string;
1247
+ type: string;
1248
+ sublabel: string;
1249
+ showIf: {
1250
+ blocking: boolean;
1251
+ close: boolean;
1252
+ };
1253
+ class?: undefined;
1254
+ required?: undefined;
1255
+ attributes?: undefined;
1256
+ } | {
1257
+ name: string;
1258
+ label: string;
1259
+ type: string;
1260
+ showIf: {
1261
+ blocking: boolean;
1262
+ close: boolean;
1263
+ };
1264
+ sublabel?: undefined;
1265
+ class?: undefined;
1266
+ required?: undefined;
1267
+ attributes?: undefined;
1268
+ } | {
1269
+ name: string;
1270
+ label: string;
1271
+ type: string;
1272
+ showIf: {
1273
+ close: boolean;
1274
+ blocking?: undefined;
1275
+ };
1276
+ sublabel?: undefined;
1277
+ class?: undefined;
1278
+ required?: undefined;
1279
+ attributes?: undefined;
1280
+ } | {
1281
+ name: string;
1282
+ label: string;
1283
+ type: string;
1284
+ sublabel: string;
1285
+ attributes: {
1286
+ min: number;
1287
+ max: number;
1288
+ };
1289
+ showIf: {
1290
+ close: boolean;
1291
+ blocking?: undefined;
1292
+ };
1293
+ class?: undefined;
1294
+ required?: undefined;
1295
+ })[];
1296
+ export { configFields_22 as configFields };
1297
+ export function run_20({ row, user, configuration: { blocking, id, close, title, message, percent, maxHeight, popupWidth, }, req, }: {
1298
+ row: any;
1299
+ user: any;
1300
+ configuration: {
1301
+ blocking: any;
1302
+ id: any;
1303
+ close: any;
1304
+ title: any;
1305
+ message: any;
1306
+ percent: any;
1307
+ maxHeight: any;
1308
+ popupWidth: any;
1309
+ };
1310
+ req: any;
1311
+ }): Promise<{
1312
+ page_load_tag: any;
1313
+ progress_bar_update: {
1314
+ blocking: any;
1315
+ id: string;
1316
+ close: any;
1317
+ message: string;
1318
+ title: string;
1319
+ percent: any;
1320
+ maxHeight: any;
1321
+ popupWidth: any;
1322
+ };
1323
+ }>;
1324
+ export { run_20 as run };
1325
+ let namespace_21: string;
1326
+ export { namespace_21 as namespace };
1327
+ }
1328
+ export namespace sleep {
1329
+ let description_22: string;
1330
+ export { description_22 as description };
1331
+ let configFields_23: ({
1216
1332
  name: string;
1217
1333
  label: string;
1218
1334
  type: string;
@@ -1227,8 +1343,8 @@ export namespace sleep {
1227
1343
  type?: undefined;
1228
1344
  required?: undefined;
1229
1345
  })[];
1230
- export { configFields_22 as configFields };
1231
- export function run_20({ configuration: { seconds, sleep_where } }: {
1346
+ export { configFields_23 as configFields };
1347
+ export function run_21({ configuration: { seconds, sleep_where } }: {
1232
1348
  configuration: {
1233
1349
  seconds: any;
1234
1350
  sleep_where: any;
@@ -1236,25 +1352,25 @@ export namespace sleep {
1236
1352
  }): Promise<{
1237
1353
  eval_js: string;
1238
1354
  } | undefined>;
1239
- export { run_20 as run };
1240
- let namespace_21: string;
1241
- export { namespace_21 as namespace };
1355
+ export { run_21 as run };
1356
+ let namespace_22: string;
1357
+ export { namespace_22 as namespace };
1242
1358
  }
1243
1359
  export namespace refresh_user_session {
1244
- let description_22: string;
1245
- export { description_22 as description };
1246
- export function run_21({ user, req }: {
1360
+ let description_23: string;
1361
+ export { description_23 as description };
1362
+ export function run_22({ user, req }: {
1247
1363
  user: any;
1248
1364
  req: any;
1249
1365
  }): Promise<void>;
1250
- export { run_21 as run };
1251
- let namespace_22: string;
1252
- export { namespace_22 as namespace };
1366
+ export { run_22 as run };
1367
+ let namespace_23: string;
1368
+ export { namespace_23 as namespace };
1253
1369
  }
1254
1370
  export namespace notify_user {
1255
- let description_23: string;
1256
- export { description_23 as description };
1257
- export function configFields_23(): ({
1371
+ let description_24: string;
1372
+ export { description_24 as description };
1373
+ export function configFields_24(): ({
1258
1374
  name: string;
1259
1375
  label: string;
1260
1376
  type: string;
@@ -1265,20 +1381,20 @@ export namespace notify_user {
1265
1381
  required: boolean;
1266
1382
  type: string;
1267
1383
  })[];
1268
- export { configFields_23 as configFields };
1269
- export function run_22({ row, user, configuration: { title, body, link, user_spec }, }: {
1384
+ export { configFields_24 as configFields };
1385
+ export function run_23({ row, user, configuration: { title, body, link, user_spec }, }: {
1270
1386
  row: object;
1271
1387
  configuration: object;
1272
1388
  user: object;
1273
1389
  }): Promise<void>;
1274
- export { run_22 as run };
1275
- let namespace_23: string;
1276
- export { namespace_23 as namespace };
1390
+ export { run_23 as run };
1391
+ let namespace_24: string;
1392
+ export { namespace_24 as namespace };
1277
1393
  }
1278
1394
  export namespace convert_session_to_user {
1279
- let description_24: string;
1280
- export { description_24 as description };
1281
- export function configFields_24({ table }: {
1395
+ let description_25: string;
1396
+ export { description_25 as description };
1397
+ export function configFields_25({ table }: {
1282
1398
  table: any;
1283
1399
  }): Promise<({
1284
1400
  name: string;
@@ -1299,8 +1415,8 @@ export namespace convert_session_to_user {
1299
1415
  input_type?: undefined;
1300
1416
  options?: undefined;
1301
1417
  })[]>;
1302
- export { configFields_24 as configFields };
1303
- export function run_23({ row, configuration: { table_name, session_field, user_field }, user, }: {
1418
+ export { configFields_25 as configFields };
1419
+ export function run_24({ row, configuration: { table_name, session_field, user_field }, user, }: {
1304
1420
  row: any;
1305
1421
  configuration: {
1306
1422
  table_name: any;
@@ -1309,15 +1425,15 @@ export namespace convert_session_to_user {
1309
1425
  };
1310
1426
  user: any;
1311
1427
  }): Promise<void>;
1312
- export { run_23 as run };
1313
- let namespace_24: string;
1314
- export { namespace_24 as namespace };
1428
+ export { run_24 as run };
1429
+ let namespace_25: string;
1430
+ export { namespace_25 as namespace };
1315
1431
  }
1316
1432
  export namespace train_model_instance {
1317
- let description_25: string;
1318
- export { description_25 as description };
1433
+ let description_26: string;
1434
+ export { description_26 as description };
1319
1435
  export function disableIf(): boolean;
1320
- export function configFields_25(): Promise<({
1436
+ export function configFields_26(): Promise<({
1321
1437
  name: string;
1322
1438
  label: string;
1323
1439
  input_type: string;
@@ -1356,8 +1472,8 @@ export namespace train_model_instance {
1356
1472
  options?: undefined;
1357
1473
  attributes?: undefined;
1358
1474
  })[]>;
1359
- export { configFields_25 as configFields };
1360
- export function run_24({ row, configuration: { model_id, instance_name, where, hyperparameters }, user, }: {
1475
+ export { configFields_26 as configFields };
1476
+ export function run_25({ row, configuration: { model_id, instance_name, where, hyperparameters }, user, }: {
1361
1477
  row: any;
1362
1478
  configuration: {
1363
1479
  model_id: any;
@@ -1367,14 +1483,14 @@ export namespace train_model_instance {
1367
1483
  };
1368
1484
  user: any;
1369
1485
  }): Promise<void>;
1370
- export { run_24 as run };
1371
- let namespace_25: string;
1372
- export { namespace_25 as namespace };
1486
+ export { run_25 as run };
1487
+ let namespace_26: string;
1488
+ export { namespace_26 as namespace };
1373
1489
  }
1374
1490
  export namespace download_file_to_browser {
1375
- let description_26: string;
1376
- export { description_26 as description };
1377
- export function configFields_26({ table, mode }: {
1491
+ let description_27: string;
1492
+ export { description_27 as description };
1493
+ export function configFields_27({ table, mode }: {
1378
1494
  table: any;
1379
1495
  mode: any;
1380
1496
  }): Promise<{
@@ -1392,8 +1508,8 @@ export namespace download_file_to_browser {
1392
1508
  options: any;
1393
1509
  };
1394
1510
  }[]>;
1395
- export { configFields_26 as configFields };
1396
- export function run_25({ row, configuration: { filepath_expr, file_field }, user, mode, }: {
1511
+ export { configFields_27 as configFields };
1512
+ export function run_26({ row, configuration: { filepath_expr, file_field }, user, mode, }: {
1397
1513
  row: any;
1398
1514
  configuration: {
1399
1515
  filepath_expr: any;
@@ -1408,14 +1524,14 @@ export namespace download_file_to_browser {
1408
1524
  blob: Buffer<ArrayBufferLike>;
1409
1525
  };
1410
1526
  } | undefined>;
1411
- export { run_25 as run };
1527
+ export { run_26 as run };
1412
1528
  }
1413
1529
  export namespace install_progressive_web_app {
1414
- let description_27: string;
1415
- export { description_27 as description };
1416
- export function configFields_27(): never[];
1417
- export { configFields_27 as configFields };
1418
- export function run_26({ req }: {
1530
+ let description_28: string;
1531
+ export { description_28 as description };
1532
+ export function configFields_28(): never[];
1533
+ export { configFields_28 as configFields };
1534
+ export function run_27({ req }: {
1419
1535
  req: any;
1420
1536
  }): Promise<{
1421
1537
  eval_js: string;
@@ -1424,7 +1540,7 @@ export namespace install_progressive_web_app {
1424
1540
  error: any;
1425
1541
  eval_js?: undefined;
1426
1542
  }>;
1427
- export { run_26 as run };
1543
+ export { run_27 as run };
1428
1544
  }
1429
1545
  export {};
1430
1546
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../base-plugin/actions.js"],"names":[],"mappings":"AA8FA;;;;;;;;;GASG;AACH;;;;;;;;;;iBAgHC;;;;;;;;;;;;;;;;IAyCiB;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqBb;;IAQI,oFALF;QAAqB,GAAG,EAAhB,MAAM;QACO,aAAa,EAA1B,MAAM;QACO,IAAI,EAAjB,MAAM;KACd,GAAU,OAAO,CAAC,IAAI,CAAC,CAazB;;;;;;;IASa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqEb;;IAQI,sIALF;QAAqB,GAAG,EAAhB,MAAM;QACO,aAAa,EAA1B,MAAM;QACO,IAAI,EAAjB,MAAM;KACd,GAAU,OAAO,CAAC,IAAI,CAAC,CAwCzB;;;;;;;;IAWa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0Db;;IAOI,iIAJF;QAAqB,GAAG,EAAhB,MAA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MAAM,GAAC,OAAO,CAAC,CA8FnC;;;;;;;;IAKa;;;;;;;;;;;;;;;;;;;;;;;;;;UAyBb;;IACI;;;;;;;;;;OAkBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoEI;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BJ;;;;;;;;;;;;;;;;;;;;;;;;IAoBI;;;;;;;mBAUJ;;;;;;;;IAMI;;;sBAKJ;;;;;;;;IAKa;;;;;;;;;;SAsBb;;IAQI,wFALF;QAAqB,GAAG,EAAhB,MAAM;QACO,aAAa,EAA1B,MAAM;QACO,IAAI,EAAjB,MAAM;KACd,GAAU,OAAO,CAAC,IAAI,CAAC,CAgCzB;;;;;;;;IAOa;;;;;;;;;;;;;;;;;;;;UA2Cb;;IACI;;;;;;;;sBAeJ;;;;;;;;IAMU,qCAA0B;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Db;;IACI;;;;;;;;;sBA0BJ;;;;;;;;IAKa;;;;;;;;;;;;;;;;;SA4Bb;;IACI;;;;;;;;;;;;;;mBAwBJ;;;;;;IAKa,2CAAQ;;IACjB;;;;;;;;OAKJ"}
@@ -23,6 +23,7 @@ const { sleep, getSessionId, urlStringToObject, dollarizeObject, objectToQuerySt
23
23
  const db = require("../db");
24
24
  const { isNode, isWeb, ppVal, getFetchProxyOptions } = require("../utils");
25
25
  const { available_languages } = require("../models/config");
26
+ const MetaData = require("../models/metadata");
26
27
  //action use cases: field modify, like/rate (insert join), notify, send row to webhook
27
28
  // todo add translation
28
29
  const consoleInterceptor = (state) => {
@@ -138,6 +139,7 @@ const run_code = async ({ row, table, channel, configuration: { code, run_where
138
139
  user,
139
140
  console: consoleInterceptor(getState()),
140
141
  Actions,
142
+ MetaData,
141
143
  emitEvent,
142
144
  sleep,
143
145
  fetchJSON,
@@ -1063,9 +1065,13 @@ module.exports = {
1063
1065
  {
1064
1066
  name: "row_expr",
1065
1067
  label: "Row expression",
1066
- sublabel: "Expression for JavaScript object. Example: <code>{first_name: name.split(' ')[0]}</code>",
1068
+ sublabel: "Expression for JavaScript object or array of objects. Example: <code>{first_name: name.split(' ')[0]}</code>",
1067
1069
  type: "String",
1068
1070
  fieldview: "textarea",
1071
+ class: "validate-expression",
1072
+ attributes: {
1073
+ spellcheck: false,
1074
+ },
1069
1075
  },
1070
1076
  ...(mode === "workflow"
1071
1077
  ? [
@@ -1098,14 +1104,30 @@ module.exports = {
1098
1104
  });
1099
1105
  const calcrow = await f(row || {}, user);
1100
1106
  const table_for_insert = Table.findOne({ name: configuration.table });
1101
- const results = {};
1102
- const res = await table_for_insert.tryInsertRow(calcrow, user, results);
1103
- if (res.error)
1104
- return res;
1105
- else if (configuration.id_variable)
1106
- return { [configuration.id_variable]: res.success, ...results };
1107
- else
1108
- return results;
1107
+ if (Array.isArray(calcrow)) {
1108
+ const ids = [];
1109
+ const all_results = {};
1110
+ for (const insrow of calcrow) {
1111
+ const results = {};
1112
+ const res = await table_for_insert.insertRow(insrow, user, results);
1113
+ ids.push(res);
1114
+ mergeActionResults(all_results, results);
1115
+ }
1116
+ if (configuration.id_variable)
1117
+ return { [configuration.id_variable]: ids, ...all_results };
1118
+ else
1119
+ return all_results;
1120
+ }
1121
+ else {
1122
+ const results = {};
1123
+ const res = await table_for_insert.tryInsertRow(calcrow, user, results);
1124
+ if (res.error)
1125
+ return res;
1126
+ else if (configuration.id_variable)
1127
+ return { [configuration.id_variable]: res.success, ...results };
1128
+ else
1129
+ return results;
1130
+ }
1109
1131
  },
1110
1132
  namespace: "Database",
1111
1133
  },
@@ -1240,16 +1262,17 @@ module.exports = {
1240
1262
  ];
1241
1263
  },
1242
1264
  run: async ({ row, table, configuration: { delete_triggering_row, delete_where, table_name }, user, ...rest }) => {
1265
+ const resultCollector = {};
1243
1266
  if (delete_triggering_row) {
1244
1267
  if (!table || !row?.[table.pk_name])
1245
1268
  throw new Error("delete_rows cannot find triggering row");
1246
- await table.deleteRows({ [table.pk_name]: row[table.pk_name] }, user);
1247
- return;
1269
+ await table.deleteRows({ [table.pk_name]: row[table.pk_name] }, user, false, resultCollector);
1270
+ return resultCollector;
1248
1271
  }
1249
1272
  const where = eval_expression(delete_where, row || {}, user, "recalculate_stored_fields where");
1250
1273
  const tbl = Table.findOne({ name: table_name });
1251
- await tbl.deleteRows(where, user);
1252
- return;
1274
+ await tbl.deleteRows(where, user, false, resultCollector);
1275
+ return resultCollector;
1253
1276
  },
1254
1277
  namespace: "Database",
1255
1278
  },
@@ -1495,15 +1518,15 @@ module.exports = {
1495
1518
  "console",
1496
1519
  "Actions",
1497
1520
  a({
1498
- href: "/admin/jsdoc/classes/_saltcorn_data.models.Table-1.html",
1521
+ href: "/admin/jsdoc/classes/_saltcorn_data.models_table.Table.html",
1499
1522
  target: "_blank",
1500
1523
  }, "Table"),
1501
1524
  a({
1502
- href: "/admin/jsdoc/classes/_saltcorn_data.models.File-1.html",
1525
+ href: "/admin/jsdoc/classes/_saltcorn_data.models_file.File.html",
1503
1526
  target: "_blank",
1504
1527
  }, "File"),
1505
1528
  a({
1506
- href: "/admin/jsdoc/classes/_saltcorn_data.models.User-1.html",
1529
+ href: "/admin/jsdoc/classes/_saltcorn_data.models_user.User.html",
1507
1530
  target: "_blank",
1508
1531
  }, "User"),
1509
1532
  ...(table ? ["table"] : []),
@@ -1925,6 +1948,87 @@ module.exports = {
1925
1948
  },
1926
1949
  namespace: "User interface",
1927
1950
  },
1951
+ progress_bar: {
1952
+ description: "Display or update progress messages and/or progress bar",
1953
+ configFields: [
1954
+ {
1955
+ name: "blocking",
1956
+ label: "Blocking",
1957
+ sublabel: "Display progress in a blocking popup modal, If not checked, display as toast",
1958
+ type: "Bool",
1959
+ },
1960
+ {
1961
+ name: "close",
1962
+ label: "Close",
1963
+ sublabel: "Close this progress window",
1964
+ type: "Bool",
1965
+ },
1966
+ {
1967
+ name: "id",
1968
+ label: "Identifier",
1969
+ type: "String",
1970
+ class: "validate-identifier",
1971
+ required: true,
1972
+ sublabel: "A valid JavaScript identifier for updating existing progress toasts",
1973
+ showIf: { blocking: false, close: false },
1974
+ },
1975
+ {
1976
+ name: "maxHeight",
1977
+ label: "max-height (px)",
1978
+ type: "Integer",
1979
+ sublabel: "If set, progress messages will be added to scrolling container with this maximum height",
1980
+ showIf: { blocking: true, close: false },
1981
+ },
1982
+ {
1983
+ name: "popupWidth",
1984
+ label: "Popup width (px)",
1985
+ type: "Integer",
1986
+ showIf: { blocking: true, close: false },
1987
+ },
1988
+ {
1989
+ name: "title",
1990
+ label: "Title",
1991
+ type: "String",
1992
+ showIf: { close: false },
1993
+ },
1994
+ {
1995
+ name: "message",
1996
+ label: "Message",
1997
+ type: "String",
1998
+ showIf: { close: false },
1999
+ },
2000
+ {
2001
+ name: "percent",
2002
+ label: "Percent",
2003
+ type: "Integer",
2004
+ sublabel: "Optional. 0-100",
2005
+ attributes: {
2006
+ min: 0,
2007
+ max: 100,
2008
+ },
2009
+ showIf: { close: false },
2010
+ },
2011
+ ],
2012
+ run: async ({ row, user, configuration: { blocking, id, close, title, message, percent, maxHeight, popupWidth, }, req, }) => {
2013
+ const msg = interpolate(message, row, user, "progress_bar message");
2014
+ const title1 = interpolate(title, row, user, "progress_bar title");
2015
+ const id1 = interpolate(id, row, user, "progress_bar id");
2016
+ return {
2017
+ page_load_tag: req?.headers?.["page-load-tag"],
2018
+ progress_bar_update: {
2019
+ blocking,
2020
+ id: id1,
2021
+ close,
2022
+ message: msg,
2023
+ title: title1,
2024
+ percent,
2025
+ maxHeight,
2026
+ popupWidth,
2027
+ },
2028
+ };
2029
+ },
2030
+ namespace: "User interface",
2031
+ },
1928
2032
  sleep: {
1929
2033
  description: "Delay for a set number of seconds",
1930
2034
  configFields: [