@saltcorn/server 0.9.3-beta.0 → 0.9.3-beta.1

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/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.3-beta.0",
3
+ "version": "0.9.3-beta.1",
4
4
  "description": "Server app for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "main": "index.js",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
9
  "@aws-sdk/client-s3": "^3.451.0",
10
- "@saltcorn/base-plugin": "0.9.3-beta.0",
11
- "@saltcorn/builder": "0.9.3-beta.0",
12
- "@saltcorn/data": "0.9.3-beta.0",
13
- "@saltcorn/admin-models": "0.9.3-beta.0",
14
- "@saltcorn/filemanager": "0.9.3-beta.0",
15
- "@saltcorn/markup": "0.9.3-beta.0",
16
- "@saltcorn/sbadmin2": "0.9.3-beta.0",
10
+ "@saltcorn/base-plugin": "0.9.3-beta.1",
11
+ "@saltcorn/builder": "0.9.3-beta.1",
12
+ "@saltcorn/data": "0.9.3-beta.1",
13
+ "@saltcorn/admin-models": "0.9.3-beta.1",
14
+ "@saltcorn/filemanager": "0.9.3-beta.1",
15
+ "@saltcorn/markup": "0.9.3-beta.1",
16
+ "@saltcorn/sbadmin2": "0.9.3-beta.1",
17
17
  "@socket.io/cluster-adapter": "^0.2.1",
18
18
  "@socket.io/sticky": "^1.0.1",
19
19
  "adm-zip": "0.5.10",
@@ -169,6 +169,10 @@ var relationHelpers = (() => {
169
169
  */
170
170
  const RelationsFinder = function (tablesCache, allViews, maxDepth) {
171
171
  this.maxDepth = +maxDepth;
172
+ if (isNaN(this.maxDepth)) {
173
+ console.log(`maxDepth '${maxDepth}' is not a number, set to 6`);
174
+ this.maxDepth = 6;
175
+ }
172
176
  this.allViews = allViews;
173
177
  const { tableIdCache, tableNameCache, fieldCache } = tablesCache;
174
178
  this.tableIdCache = tableIdCache;
@@ -303,8 +307,8 @@ var relationHelpers = (() => {
303
307
  const searcher = (current, path, level, visited) => {
304
308
  if (level > this.maxDepth) return;
305
309
  const visitedFkCopy = new Set(visited);
306
- const fks = current.foreign_keys.filter((f) => !visitedFkCopy.has(f.id));
307
- for (const fk of fks) {
310
+ for (const fk of current.foreign_keys) {
311
+ if (visitedFkCopy.has(fk.id)) continue;
308
312
  visitedFkCopy.add(fk.id);
309
313
  const target = this.tableNameCache[fk.reftable_name];
310
314
  if (!target)
@@ -315,10 +319,8 @@ var relationHelpers = (() => {
315
319
  }
316
320
 
317
321
  const visitedInboundCopy = new Set(visited);
318
- const inbounds = (this.fieldCache[current.name] || []).filter(
319
- (f) => !visitedInboundCopy.has(f.id)
320
- );
321
- for (const inbound of inbounds) {
322
+ for (const inbound of this.fieldCache[current.name] || []) {
323
+ if (visitedInboundCopy.has(inbound.id)) continue;
322
324
  visitedInboundCopy.add(inbound.id);
323
325
  const target = this.tableIdCache[inbound.table_id];
324
326
  if (!target)