@saltcorn/common-code 0.9.4-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 (34) hide show
  1. package/dist/index.d.ts +9 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +16 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/relations/relation.d.ts +23 -0
  6. package/dist/relations/relation.d.ts.map +1 -0
  7. package/dist/relations/relation.js +48 -0
  8. package/dist/relations/relation.js.map +1 -0
  9. package/dist/relations/relation_helpers.d.ts +52 -0
  10. package/dist/relations/relation_helpers.d.ts.map +1 -0
  11. package/dist/relations/relation_helpers.js +133 -0
  12. package/dist/relations/relation_helpers.js.map +1 -0
  13. package/dist/relations/relation_types.d.ts +14 -0
  14. package/dist/relations/relation_types.d.ts.map +1 -0
  15. package/dist/relations/relation_types.js +19 -0
  16. package/dist/relations/relation_types.js.map +1 -0
  17. package/dist/relations/relations_finder.d.ts +39 -0
  18. package/dist/relations/relations_finder.d.ts.map +1 -0
  19. package/dist/relations/relations_finder.js +192 -0
  20. package/dist/relations/relations_finder.js.map +1 -0
  21. package/dist/tests/expected_relations.d.ts +7 -0
  22. package/dist/tests/expected_relations.d.ts.map +1 -0
  23. package/dist/tests/expected_relations.js +52 -0
  24. package/dist/tests/expected_relations.js.map +1 -0
  25. package/dist/tests/relations_finder.test.d.ts +2 -0
  26. package/dist/tests/relations_finder.test.d.ts.map +1 -0
  27. package/dist/tests/relations_finder.test.js +138 -0
  28. package/dist/tests/relations_finder.test.js.map +1 -0
  29. package/dist/tests/test_data.d.ts +29 -0
  30. package/dist/tests/test_data.d.ts.map +1 -0
  31. package/dist/tests/test_data.js +162 -0
  32. package/dist/tests/test_data.js.map +1 -0
  33. package/dist/tsconfig.ref.tsbuildinfo +1 -0
  34. package/package.json +48 -0
@@ -0,0 +1,9 @@
1
+ import { Relation } from "./relations/relation";
2
+ export { Relation };
3
+ import { RelationsFinder } from "./relations/relations_finder";
4
+ export { RelationsFinder };
5
+ import { ViewDisplayType, RelationType } from "./relations/relation_types";
6
+ export { ViewDisplayType, RelationType };
7
+ import { parseRelationPath, parseLegacyRelation, buildTableCaches } from "./relations/relation_helpers";
8
+ export { parseRelationPath, parseLegacyRelation, buildTableCaches };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAEzC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTableCaches = exports.parseLegacyRelation = exports.parseRelationPath = exports.RelationType = exports.ViewDisplayType = exports.RelationsFinder = exports.Relation = void 0;
4
+ const relation_1 = require("./relations/relation");
5
+ Object.defineProperty(exports, "Relation", { enumerable: true, get: function () { return relation_1.Relation; } });
6
+ const relations_finder_1 = require("./relations/relations_finder");
7
+ Object.defineProperty(exports, "RelationsFinder", { enumerable: true, get: function () { return relations_finder_1.RelationsFinder; } });
8
+ const relation_types_1 = require("./relations/relation_types");
9
+ Object.defineProperty(exports, "ViewDisplayType", { enumerable: true, get: function () { return relation_types_1.ViewDisplayType; } });
10
+ Object.defineProperty(exports, "RelationType", { enumerable: true, get: function () { return relation_types_1.RelationType; } });
11
+ const relation_helpers_1 = require("./relations/relation_helpers");
12
+ Object.defineProperty(exports, "parseRelationPath", { enumerable: true, get: function () { return relation_helpers_1.parseRelationPath; } });
13
+ Object.defineProperty(exports, "parseLegacyRelation", { enumerable: true, get: function () { return relation_helpers_1.parseLegacyRelation; } });
14
+ Object.defineProperty(exports, "buildTableCaches", { enumerable: true, get: function () { return relation_helpers_1.buildTableCaches; } });
15
+ // TODO when we add more then we need namspaces that work with node, webpack and jest
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AACvC,yFADA,mBAAQ,OACA;AAEjB,mEAA+D;AACtD,gGADA,kCAAe,OACA;AAExB,+DAA2E;AAClE,gGADA,gCAAe,OACA;AAAE,6FADA,6BAAY,OACA;AAEtC,mEAIsC;AAC7B,kGAJP,oCAAiB,OAIO;AAAE,oGAH1B,sCAAmB,OAG0B;AAAE,iGAF/C,mCAAgB,OAE+C;AACjE,qFAAqF"}
@@ -0,0 +1,23 @@
1
+ import { RelationType, ViewDisplayType } from "./relation_types";
2
+ /**
3
+ * Relation class
4
+ * This is a more common interface for the relation string
5
+ */
6
+ export declare class Relation {
7
+ relationString: string;
8
+ sourceTblName: string;
9
+ targetTblName: string;
10
+ viewDisplayType: any;
11
+ path: any[];
12
+ /**
13
+ * @param relationString
14
+ * @param targetTblName
15
+ * @param subView
16
+ */
17
+ constructor(relationString: string, targetTblName: string, viewDisplayType: ViewDisplayType);
18
+ /**
19
+ * get the relation type
20
+ */
21
+ get type(): RelationType | null;
22
+ }
23
+ //# sourceMappingURL=relation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../../relations/relation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjE;;;GAGG;AACH,qBAAa,QAAQ;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,GAAG,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IAEZ;;;;OAIG;gBAED,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,eAAe;IAUlC;;OAEG;IACH,IAAI,IAAI,wBAiBP;CACF"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Relation = void 0;
4
+ const relation_helpers_1 = require("./relation_helpers");
5
+ const relation_types_1 = require("./relation_types");
6
+ /**
7
+ * Relation class
8
+ * This is a more common interface for the relation string
9
+ */
10
+ class Relation {
11
+ /**
12
+ * @param relationString
13
+ * @param targetTblName
14
+ * @param subView
15
+ */
16
+ constructor(relationString, targetTblName, viewDisplayType) {
17
+ this.relationString = relationString;
18
+ this.targetTblName = targetTblName;
19
+ this.viewDisplayType = viewDisplayType;
20
+ const { sourcetable, path } = (0, relation_helpers_1.parseRelationPath)(relationString);
21
+ this.sourceTblName = sourcetable;
22
+ this.path = path;
23
+ }
24
+ /**
25
+ * get the relation type
26
+ */
27
+ get type() {
28
+ if (this.path.length === 1 && this.path[0].inboundKey)
29
+ return this.viewDisplayType === relation_types_1.ViewDisplayType.NO_ROW_LIMIT
30
+ ? relation_types_1.RelationType.CHILD_LIST
31
+ : relation_types_1.ViewDisplayType.ROW_REQUIRED
32
+ ? relation_types_1.RelationType.ONE_TO_ONE_SHOW
33
+ : null;
34
+ // or throw ??
35
+ else if (this.path.length === 2 && this.path.every((p) => p.inboundKey))
36
+ return relation_types_1.RelationType.CHILD_LIST;
37
+ else if (this.path.length === 1 && this.path[0].fkey)
38
+ return relation_types_1.RelationType.PARENT_SHOW;
39
+ else if (this.path.length === 0)
40
+ return this.targetTblName && this.sourceTblName === this.targetTblName
41
+ ? relation_types_1.RelationType.OWN
42
+ : relation_types_1.RelationType.INDEPENDENT;
43
+ else
44
+ return relation_types_1.RelationType.RELATION_PATH;
45
+ }
46
+ }
47
+ exports.Relation = Relation;
48
+ //# sourceMappingURL=relation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation.js","sourceRoot":"","sources":["../../relations/relation.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AACvD,qDAAiE;AAEjE;;;GAGG;AACH,MAAa,QAAQ;IAOnB;;;;OAIG;IACH,YACE,cAAsB,EACtB,aAAqB,EACrB,eAAgC;QAEhC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAA,oCAAiB,EAAC,cAAc,CAAC,CAAC;QAChE,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU;YACnD,OAAO,IAAI,CAAC,eAAe,KAAK,gCAAe,CAAC,YAAY;gBAC1D,CAAC,CAAC,6BAAY,CAAC,UAAU;gBACzB,CAAC,CAAC,gCAAe,CAAC,YAAY;oBAC9B,CAAC,CAAC,6BAAY,CAAC,eAAe;oBAC9B,CAAC,CAAC,IAAI,CAAC;QACX,cAAc;aACT,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;YACrE,OAAO,6BAAY,CAAC,UAAU,CAAC;aAC5B,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,OAAO,6BAAY,CAAC,WAAW,CAAC;aAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YAC7B,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa;gBACpE,CAAC,CAAC,6BAAY,CAAC,GAAG;gBAClB,CAAC,CAAC,6BAAY,CAAC,WAAW,CAAC;;YAC1B,OAAO,6BAAY,CAAC,aAAa,CAAC;IACzC,CAAC;CACF;AA9CD,4BA8CC"}
@@ -0,0 +1,52 @@
1
+ import { RelationType } from "./relation_types";
2
+ /**
3
+ * when we don't have the saltcorn state those caches can be used
4
+ * @param allTables
5
+ * @returns tableIdCache, tableNameCache, fieldCache
6
+ */
7
+ export declare const buildTableCaches: (allTables: any[]) => {
8
+ tableIdCache: any;
9
+ tableNameCache: any;
10
+ fieldCache: any;
11
+ };
12
+ /**
13
+ * build an array from the relation string
14
+ * @param s relation syntax
15
+ * @returns the first table (source) and the relation as path array
16
+ */
17
+ export declare const parseRelationPath: (s: string) => any;
18
+ /**
19
+ * convert a relation array back to string
20
+ * @param sourcetable the first table (source)
21
+ * @param path relation as path array
22
+ * @returns relation syntax as string
23
+ */
24
+ export declare const buildRelationPath: (sourcetable: string, path: {
25
+ table: string;
26
+ fkey?: string;
27
+ inboundKey?: string;
28
+ }[]) => string;
29
+ /**
30
+ * @param type
31
+ * @param relation
32
+ * @param parentTbl
33
+ * @returns
34
+ */
35
+ export declare const parseLegacyRelation: (type: any, relation: string, parentTbl: string) => never[] | {
36
+ type: RelationType;
37
+ path: {
38
+ table: string;
39
+ inboundKey: string;
40
+ }[];
41
+ } | {
42
+ type: RelationType;
43
+ path: {
44
+ table: string;
45
+ }[];
46
+ } | {
47
+ type: RelationType;
48
+ path: {
49
+ fkey: string;
50
+ }[];
51
+ };
52
+ //# sourceMappingURL=relation_helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation_helpers.d.ts","sourceRoot":"","sources":["../../relations/relation_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAAe,GAAG,EAAE;;;;CAchD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,MAAO,MAAM,KAAG,GAY7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBACf,MAAM,QACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,WAO9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,GAAG,YACC,MAAM,aACL,MAAM;;;;;;;;;;;;;;;;CA+DlB,CAAC"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseLegacyRelation = exports.buildRelationPath = exports.parseRelationPath = exports.buildTableCaches = void 0;
4
+ const relation_types_1 = require("./relation_types");
5
+ /**
6
+ * when we don't have the saltcorn state those caches can be used
7
+ * @param allTables
8
+ * @returns tableIdCache, tableNameCache, fieldCache
9
+ */
10
+ const buildTableCaches = (allTables) => {
11
+ const tableIdCache = {};
12
+ const tableNameCache = {};
13
+ const fieldCache = {};
14
+ for (const table of allTables) {
15
+ tableIdCache[table.id] = table;
16
+ tableNameCache[table.name] = table;
17
+ for (const field of table.foreign_keys) {
18
+ if (!fieldCache[field.reftable_name])
19
+ fieldCache[field.reftable_name] = [];
20
+ fieldCache[field.reftable_name].push(field);
21
+ }
22
+ }
23
+ return { tableIdCache, tableNameCache, fieldCache };
24
+ };
25
+ exports.buildTableCaches = buildTableCaches;
26
+ /**
27
+ * build an array from the relation string
28
+ * @param s relation syntax
29
+ * @returns the first table (source) and the relation as path array
30
+ */
31
+ const parseRelationPath = (s) => {
32
+ const tokens = s.split(".");
33
+ const path = [];
34
+ for (const relation of tokens.slice(2)) {
35
+ if (relation.indexOf("$") > 0) {
36
+ const [table, inboundKey] = relation.split("$");
37
+ path.push({ table, inboundKey });
38
+ }
39
+ else {
40
+ path.push({ fkey: relation });
41
+ }
42
+ }
43
+ return { sourcetable: tokens[1], path };
44
+ };
45
+ exports.parseRelationPath = parseRelationPath;
46
+ /**
47
+ * convert a relation array back to string
48
+ * @param sourcetable the first table (source)
49
+ * @param path relation as path array
50
+ * @returns relation syntax as string
51
+ */
52
+ const buildRelationPath = (sourcetable, path) => {
53
+ return `.${sourcetable}.${path
54
+ .map(({ table, fkey, inboundKey }) => {
55
+ return inboundKey ? `${table}$${inboundKey} ` : fkey;
56
+ })
57
+ .join(".")}`;
58
+ };
59
+ exports.buildRelationPath = buildRelationPath;
60
+ /**
61
+ * @param type
62
+ * @param relation
63
+ * @param parentTbl
64
+ * @returns
65
+ */
66
+ const parseLegacyRelation = (type, relation, parentTbl) => {
67
+ switch (type) {
68
+ case "ChildList": {
69
+ const path = relation ? relation.split(".") : [];
70
+ if (path.length === 3) {
71
+ const [viewName, table, key] = path;
72
+ return {
73
+ type: relation_types_1.RelationType.CHILD_LIST,
74
+ path: [
75
+ {
76
+ table,
77
+ inboundKey: key,
78
+ },
79
+ ],
80
+ };
81
+ }
82
+ else if (path.length === 5) {
83
+ const [viewName, thrTbl, thrTblFkey, fromTbl, fromTblFkey] = path;
84
+ return {
85
+ type: relation_types_1.RelationType.CHILD_LIST,
86
+ path: [
87
+ {
88
+ table: thrTbl,
89
+ inboundKey: thrTblFkey,
90
+ },
91
+ {
92
+ table: fromTbl,
93
+ inboundKey: fromTblFkey,
94
+ },
95
+ ],
96
+ };
97
+ }
98
+ break;
99
+ }
100
+ case "Independent": {
101
+ return {
102
+ type: relation_types_1.RelationType.INDEPENDENT,
103
+ path: [{ table: "None (no relation)" }],
104
+ };
105
+ }
106
+ case "Own": {
107
+ return {
108
+ type: relation_types_1.RelationType.OWN,
109
+ path: [{ table: `${parentTbl} (same table)` }],
110
+ };
111
+ }
112
+ case "OneToOneShow": {
113
+ const tokens = relation ? relation.split(".") : [];
114
+ if (tokens.length !== 3)
115
+ break;
116
+ const [viewname, relatedTbl, fkey] = tokens;
117
+ return {
118
+ type: relation_types_1.RelationType.ONE_TO_ONE_SHOW,
119
+ path: [{ table: relatedTbl, inboundKey: fkey }],
120
+ };
121
+ }
122
+ case "ParentShow": {
123
+ const tokens = relation ? relation.split(".") : [];
124
+ if (tokens.length !== 3)
125
+ break;
126
+ const [viewname, parentTbl, fkey] = tokens;
127
+ return { type: relation_types_1.RelationType.PARENT_SHOW, path: [{ fkey }] };
128
+ }
129
+ }
130
+ return [];
131
+ };
132
+ exports.parseLegacyRelation = parseLegacyRelation;
133
+ //# sourceMappingURL=relation_helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation_helpers.js","sourceRoot":"","sources":["../../relations/relation_helpers.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,SAAgB,EAAE,EAAE;IACnD,MAAM,YAAY,GAAQ,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAQ,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAQ,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;QAC7B,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;QAC/B,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACnC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,YAAY,EAAE;YACtC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC;gBAClC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;YACvC,UAAU,CAAC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,GAAG,SAAS,eAAe,EAAE,CAAC;aAC/C,CAAC;SACH;QACD,KAAK,cAAc,CAAC,CAAC;YACnB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,MAAM;YAC/B,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC;YAC5C,OAAO;gBACL,IAAI,EAAE,6BAAY,CAAC,eAAe;gBAClC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;aAChD,CAAC;SACH;QACD,KAAK,YAAY,CAAC,CAAC;YACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,MAAM;YAC/B,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC;YAC3C,OAAO,EAAE,IAAI,EAAE,6BAAY,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;SAC7D;KACF;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAlEW,QAAA,mBAAmB,uBAkE9B"}
@@ -0,0 +1,14 @@
1
+ export declare enum RelationType {
2
+ RELATION_PATH = "RelationPath",
3
+ OWN = "Own",
4
+ INDEPENDENT = "Independent",
5
+ CHILD_LIST = "ChildList",
6
+ ONE_TO_ONE_SHOW = "OneToOneShow",
7
+ PARENT_SHOW = "ParentShow"
8
+ }
9
+ export declare enum ViewDisplayType {
10
+ ROW_REQUIRED = "ROW_REQUIRED",
11
+ NO_ROW_LIMIT = "NO_ROW_LIMIT",
12
+ INVALID = "INVALID"
13
+ }
14
+ //# sourceMappingURL=relation_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation_types.d.ts","sourceRoot":"","sources":["../../relations/relation_types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,aAAa,iBAAiB;IAC9B,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,UAAU,cAAc;IACxB,eAAe,iBAAiB;IAChC,WAAW,eAAe;CAC3B;AAED,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,OAAO,YAAY;CACpB"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ViewDisplayType = exports.RelationType = void 0;
4
+ var RelationType;
5
+ (function (RelationType) {
6
+ RelationType["RELATION_PATH"] = "RelationPath";
7
+ RelationType["OWN"] = "Own";
8
+ RelationType["INDEPENDENT"] = "Independent";
9
+ RelationType["CHILD_LIST"] = "ChildList";
10
+ RelationType["ONE_TO_ONE_SHOW"] = "OneToOneShow";
11
+ RelationType["PARENT_SHOW"] = "ParentShow";
12
+ })(RelationType = exports.RelationType || (exports.RelationType = {}));
13
+ var ViewDisplayType;
14
+ (function (ViewDisplayType) {
15
+ ViewDisplayType["ROW_REQUIRED"] = "ROW_REQUIRED";
16
+ ViewDisplayType["NO_ROW_LIMIT"] = "NO_ROW_LIMIT";
17
+ ViewDisplayType["INVALID"] = "INVALID";
18
+ })(ViewDisplayType = exports.ViewDisplayType || (exports.ViewDisplayType = {}));
19
+ //# sourceMappingURL=relation_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation_types.js","sourceRoot":"","sources":["../../relations/relation_types.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,8CAA8B,CAAA;IAC9B,2BAAW,CAAA;IACX,2CAA2B,CAAA;IAC3B,wCAAwB,CAAA;IACxB,gDAAgC,CAAA;IAChC,0CAA0B,CAAA;AAC5B,CAAC,EAPW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAOvB;AAED,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,gDAA6B,CAAA;IAC7B,sCAAmB,CAAA;AACrB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B"}
@@ -0,0 +1,39 @@
1
+ import { Relation } from "./relation";
2
+ /**
3
+ * RelationsFinder class
4
+ * this finder searches for relations between a sourceTable (table of the topView)
5
+ * and a subView (here the targetTable is used)
6
+ */
7
+ export declare class RelationsFinder {
8
+ private maxDepth;
9
+ private allViews;
10
+ private tableIdCache;
11
+ private tableNameCache;
12
+ private fieldCache;
13
+ constructor(allTables: any, allViews: any, maxDepth: number);
14
+ /**
15
+ * creates an array of Relation objects
16
+ * @param sourceTblName
17
+ * @param subView
18
+ * @param excluded
19
+ * @returns
20
+ */
21
+ findRelations(sourceTblName: string, subView: string, excluded: string[]): Array<Relation>;
22
+ /**
23
+ * This is a helper method for findRelations() it returns raw relation strings
24
+ * @param sourceTblName
25
+ * @param subView
26
+ * @param excluded
27
+ * @returns
28
+ */
29
+ singleRelationPaths(sourceTblName: string, subView: string, excluded: string[]): Array<string>;
30
+ /**
31
+ * This is a helper method for findRelations() it returns raw relation strings
32
+ * @param sourceTblName
33
+ * @param subView
34
+ * @param excluded
35
+ * @returns
36
+ */
37
+ multiRelationPaths(sourceTblName: string, subView: string, excluded: string[]): string[];
38
+ }
39
+ //# sourceMappingURL=relations_finder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations_finder.d.ts","sourceRoot":"","sources":["../../relations/relations_finder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,UAAU,CAAM;gBAEZ,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM;IAW3D;;;;;;OAMG;IACI,aAAa,CAClB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE,GACjB,KAAK,CAAC,QAAQ,CAAC;IAoDlB;;;;;;OAMG;IACH,mBAAmB,CACjB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE,GACjB,KAAK,CAAC,MAAM,CAAC;IAgEhB;;;;;;OAMG;IACH,kBAAkB,CAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE;CA4CrB"}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationsFinder = void 0;
4
+ const relation_helpers_1 = require("./relation_helpers");
5
+ const relation_types_1 = require("./relation_types");
6
+ const relation_1 = require("./relation");
7
+ /**
8
+ * RelationsFinder class
9
+ * this finder searches for relations between a sourceTable (table of the topView)
10
+ * and a subView (here the targetTable is used)
11
+ */
12
+ class RelationsFinder {
13
+ constructor(allTables, allViews, maxDepth) {
14
+ this.maxDepth = +maxDepth;
15
+ if (isNaN(this.maxDepth))
16
+ this.maxDepth = 6;
17
+ this.allViews = allViews;
18
+ const { tableIdCache, tableNameCache, fieldCache } = (0, relation_helpers_1.buildTableCaches)(allTables);
19
+ this.tableIdCache = tableIdCache;
20
+ this.tableNameCache = tableNameCache;
21
+ this.fieldCache = fieldCache;
22
+ }
23
+ /**
24
+ * creates an array of Relation objects
25
+ * @param sourceTblName
26
+ * @param subView
27
+ * @param excluded
28
+ * @returns
29
+ */
30
+ findRelations(sourceTblName, subView, excluded) {
31
+ let result = new Array();
32
+ try {
33
+ const view = this.allViews.find((v) => v.name === subView);
34
+ if (!view)
35
+ throw new Error(`The view ${subView} does not exist`);
36
+ if (excluded?.find((e) => e === view.viewtemplate)) {
37
+ console.log(`view ${subView} is excluded`);
38
+ return result;
39
+ }
40
+ const subViewObj = this.allViews.find((v) => v.name === subView);
41
+ const targetTbl = this.tableIdCache[subViewObj.table_id];
42
+ if (!targetTbl) {
43
+ result.push(new relation_1.Relation(".", "", relation_types_1.ViewDisplayType.NO_ROW_LIMIT));
44
+ return result;
45
+ }
46
+ switch (view.display_type) {
47
+ case relation_types_1.ViewDisplayType.ROW_REQUIRED: {
48
+ const paths = this.singleRelationPaths(sourceTblName, subView, excluded);
49
+ for (const path of paths)
50
+ result.push(new relation_1.Relation(path, targetTbl.name, relation_types_1.ViewDisplayType.ROW_REQUIRED));
51
+ break;
52
+ }
53
+ case relation_types_1.ViewDisplayType.NO_ROW_LIMIT: {
54
+ const paths = this.multiRelationPaths(sourceTblName, subView, excluded);
55
+ for (const path of paths)
56
+ result.push(new relation_1.Relation(path, targetTbl.name, relation_types_1.ViewDisplayType.NO_ROW_LIMIT));
57
+ break;
58
+ }
59
+ default:
60
+ throw new Error(`view ${subView}: The displayType (${view.display_type}) is not valid`);
61
+ }
62
+ }
63
+ catch (error) {
64
+ console.log(error);
65
+ }
66
+ finally {
67
+ return result;
68
+ }
69
+ }
70
+ /**
71
+ * This is a helper method for findRelations() it returns raw relation strings
72
+ * @param sourceTblName
73
+ * @param subView
74
+ * @param excluded
75
+ * @returns
76
+ */
77
+ singleRelationPaths(sourceTblName, subView, excluded) {
78
+ const result = new Set();
79
+ const subViewObj = this.allViews.find((v) => v.name === subView);
80
+ if (!subViewObj)
81
+ throw new Error(`The view ${subView} does not exist`);
82
+ if (excluded?.find((e) => e === subViewObj.viewtemplate)) {
83
+ console.log(`view ${subView} is excluded`);
84
+ return Array.from(result);
85
+ }
86
+ const sourceTbl = this.tableNameCache[sourceTblName];
87
+ if (!sourceTbl)
88
+ throw new Error(`The table ${sourceTblName} does not exist`);
89
+ // 1. parent relations
90
+ const parentRelsFinder = (currentTbl, path, level, visited) => {
91
+ if (level > this.maxDepth)
92
+ return;
93
+ const visitedFkCopy = new Set(visited);
94
+ for (const fk of currentTbl.foreign_keys || []) {
95
+ if (visitedFkCopy.has(fk.id))
96
+ continue;
97
+ visitedFkCopy.add(fk.id);
98
+ const nextPath = `${path}.${fk.name}`;
99
+ const nextTbl = this.tableNameCache[fk.reftable_name];
100
+ if (!nextTbl)
101
+ throw new Error(`The table ${fk.reftable_name} does not exist`);
102
+ if (nextTbl.id === subViewObj.table_id)
103
+ result.add(nextPath);
104
+ parentRelsFinder(nextTbl, nextPath, level + 1, visitedFkCopy);
105
+ }
106
+ };
107
+ const startPath = `.${sourceTblName}`;
108
+ if (sourceTbl.id === subViewObj.table_id)
109
+ result.add(startPath);
110
+ parentRelsFinder(sourceTbl, startPath, 0, new Set());
111
+ // 2. OneToOneShow
112
+ const uniqueFksToSrc = (this.fieldCache[sourceTblName] || []).filter((f) => f.is_unique);
113
+ for (const relation of uniqueFksToSrc) {
114
+ const targetTbl = this.tableIdCache[relation.table_id];
115
+ if (!targetTbl)
116
+ throw new Error(`The table ${relation.table_id} does not exist`);
117
+ if (targetTbl.id === subViewObj.table_id)
118
+ result.add(`.${sourceTblName}.${targetTbl.name}$${relation.name}`);
119
+ }
120
+ // 3. inbound_self_relations
121
+ const srcFks = sourceTbl.foreign_keys;
122
+ for (const fkToSrc of uniqueFksToSrc) {
123
+ const refTable = this.tableIdCache[fkToSrc.table_id];
124
+ if (!refTable)
125
+ throw new Error(`The table ${fkToSrc.table_id} does not exist`);
126
+ const fromSrcToRef = srcFks.filter((field) => field.reftable_name === refTable.name);
127
+ for (const toRef of fromSrcToRef) {
128
+ if (fkToSrc.reftable_name === sourceTblName)
129
+ result.add(`.${sourceTblName}.${toRef.name}.${fkToSrc.name}`);
130
+ }
131
+ }
132
+ return Array.from(result);
133
+ }
134
+ /**
135
+ * This is a helper method for findRelations() it returns raw relation strings
136
+ * @param sourceTblName
137
+ * @param subView
138
+ * @param excluded
139
+ * @returns
140
+ */
141
+ multiRelationPaths(sourceTblName, subView, excluded) {
142
+ const result = ["."]; // none no relation
143
+ const subViewObj = this.allViews.find((v) => v.name === subView);
144
+ if (!subViewObj)
145
+ throw new Error(`The view ${subView} does not exist`);
146
+ if (excluded?.find((e) => e === subViewObj.viewtemplate)) {
147
+ console.log(`view ${subView} is excluded`);
148
+ return result;
149
+ }
150
+ const sourceTbl = this.tableNameCache[sourceTblName];
151
+ if (!sourceTbl)
152
+ throw new Error(`The table ${sourceTblName} does not exist`);
153
+ if (sourceTbl.id === subViewObj.table_id)
154
+ result.push(`.${sourceTblName}`);
155
+ const searcher = (current, path, level, visited) => {
156
+ if (level > this.maxDepth)
157
+ return;
158
+ const visitedFkCopy = new Set(visited);
159
+ for (const fk of current.foreign_keys) {
160
+ if (visitedFkCopy.has(fk.id))
161
+ continue;
162
+ visitedFkCopy.add(fk.id);
163
+ const target = this.tableNameCache[fk.reftable_name];
164
+ if (!target)
165
+ throw new Error(`The table ${fk.reftable_name} does not exist`);
166
+ const newPath = `${path}.${fk.name}`;
167
+ if (target.id === subViewObj.table_id)
168
+ result.push(newPath);
169
+ searcher(target, newPath, level + 1, visitedFkCopy);
170
+ }
171
+ const visitedInboundCopy = new Set(visited);
172
+ for (const inbound of this.fieldCache[current.name] || []) {
173
+ if (visitedInboundCopy.has(inbound.id))
174
+ continue;
175
+ visitedInboundCopy.add(inbound.id);
176
+ const target = this.tableIdCache[inbound.table_id];
177
+ if (!target)
178
+ throw new Error(`The table ${inbound.table_id} does not exist`);
179
+ const newPath = `${path}.${target.name}$${inbound.name}`;
180
+ if (target.id === subViewObj.table_id)
181
+ result.push(newPath);
182
+ searcher(target, newPath, level + 1, visitedInboundCopy);
183
+ }
184
+ };
185
+ const path = `.${sourceTblName}`;
186
+ const visited = new Set();
187
+ searcher(sourceTbl, path, 0, visited);
188
+ return result;
189
+ }
190
+ }
191
+ exports.RelationsFinder = RelationsFinder;
192
+ //# sourceMappingURL=relations_finder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations_finder.js","sourceRoot":"","sources":["../../relations/relations_finder.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,qDAAmD;AACnD,yCAAsC;AAEtC;;;;GAIG;AACH,MAAa,eAAe;IAO1B,YAAY,SAAc,EAAE,QAAa,EAAE,QAAgB;QACzD,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC;QAC1B,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;YAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,GAChD,IAAA,mCAAgB,EAAC,SAAS,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,aAAa,CAClB,aAAqB,EACrB,OAAe,EACf,QAAkB;QAElB,IAAI,MAAM,GAAG,IAAI,KAAK,EAAY,CAAC;QACnC,IAAI;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;YAChE,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,iBAAiB,CAAC,CAAC;YACjE,IAAI,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,EAAE;gBAClD,OAAO,CAAC,GAAG,CAAC,QAAQ,OAAO,cAAc,CAAC,CAAC;gB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,MAAM,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;gBACzD,IAAI,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBAAE,SAAS;gBACjD,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACnC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACnD,IAAI,CAAC,MAAM;oBACT,MAAM,IAAI,KAAK,CAAC,aAAa,OAAO,CAAC,QAAQ,iBAAiB,CAAC,CAAC;gBAClE,MAAM,OAAO,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;gBACzD,IAAI,MAAM,CAAC,EAAE,KAAK,UAAU,CAAC,QAAQ;oBAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5D,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAC;aAC1D;QACH,CAAC,CAAC;QACF,MAAM,IAAI,GAAG,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlND,0CAkNC"}
@@ -0,0 +1,7 @@
1
+ export declare const expectedOne: string[];
2
+ export declare const expectedTwo: string[];
3
+ export declare const expectedThree: string[];
4
+ export declare const expectedFour: string[];
5
+ export declare const expectedFive: string[];
6
+ export declare const expectedSix: string[];
7
+ //# sourceMappingURL=expected_relations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected_relations.d.ts","sourceRoot":"","sources":["../../tests/expected_relations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAKvB,CAAC;AAEF,eAAO,MAAM,WAAW,UAKvB,CAAC;AAEF,eAAO,MAAM,aAAa,UAMzB,CAAC;AAEF,eAAO,MAAM,YAAY,UASxB,CAAC;AAEF,eAAO,MAAM,YAAY,UASxB,CAAC;AAEF,eAAO,MAAM,WAAW,UAQvB,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expectedSix = exports.expectedFive = exports.expectedFour = exports.expectedThree = exports.expectedTwo = exports.expectedOne = void 0;
4
+ exports.expectedOne = [
5
+ ".",
6
+ ".users.user_interested_in_topic$user.topic.blog_in_topic$topic",
7
+ ".users.user_interested_in_topic$user.topic.inbound_inbound$topic.bp_inbound.post.blog_in_topic$post",
8
+ ".users.messages$user.room.participants$room.user.user_interested_in_topic$user.topic.blog_in_topic$topic",
9
+ ];
10
+ exports.expectedTwo = [
11
+ ...exports.expectedOne,
12
+ ".users.user_interested_in_topic$another_user.topic.blog_in_topic$topic",
13
+ ".users.user_interested_in_topic$another_user.topic.inbound_inbound$topic.bp_inbound.post.blog_in_topic$post",
14
+ ".users.messages$user.room.participants$room.user.user_interested_in_topic$another_user.topic.blog_in_topic$topic",
15
+ ];
16
+ exports.expectedThree = [
17
+ ...exports.expectedTwo,
18
+ ".users.user_interested_in_topic$user.topic.blog_in_topic$second_topic",
19
+ ".users.user_interested_in_topic$another_user.topic.blog_in_topic$second_topic",
20
+ ".users.messages$user.room.participants$room.user.user_interested_in_topic$user.topic.blog_in_topic$second_topic",
21
+ ".users.messages$user.room.participants$room.user.user_interested_in_topic$another_user.topic.blog_in_topic$second_topic",
22
+ ];
23
+ exports.expectedFour = [
24
+ ...exports.expectedThree,
25
+ ".users.user_interested_in_topic$user.another_user.second_inbound$user.topic.blog_in_topic$topic",
26
+ ".users.user_interested_in_topic$user.another_user.second_inbound$user.topic.blog_in_topic$second_topic",
27
+ ".users.second_inbound$user.topic.blog_in_topic$topic",
28
+ ".users.second_inbound$user.topic.blog_in_topic$second_topic",
29
+ ".users.second_inbound$user.topic.inbound_inbound$topic.bp_inbound.post.blog_in_topic$post",
30
+ ".users.messages$user.room.participants$room.user.second_inbound$user.topic.blog_in_topic$topic",
31
+ ".users.messages$user.room.participants$room.user.second_inbound$user.topic.blog_in_topic$second_topic",
32
+ ];
33
+ exports.expectedFive = [
34
+ ...exports.expectedFour,
35
+ ".users.user_interested_in_topic$user.topic.inbound_inbound$topic.post_from_layer_two.blog_in_topic$post",
36
+ ".users.user_interested_in_topic$another_user.topic.inbound_inbound$topic.post_from_layer_two.blog_in_topic$post",
37
+ ".users.second_inbound$user.topic.inbound_inbound$topic.post_from_layer_two.blog_in_topic$post",
38
+ ".users.user_interested_in_topic$user.topic.blog_in_topic$topic.post.inbound_inbound$post_from_layer_two.topic.blog_in_topic$second_topic",
39
+ ".users.user_interested_in_topic$user.another_user.second_inbound$user.topic.inbound_inbound$topic.post_from_layer_two.blog_in_topic$post",
40
+ ".users.user_interested_in_topic$another_user.topic.blog_in_topic$topic.post.inbound_inbound$post_from_layer_two.topic.blog_in_topic$second_topic",
41
+ ".users.second_inbound$user.topic.blog_in_topic$topic.post.inbound_inbound$post_from_layer_two.topic.blog_in_topic$second_topic",
42
+ ];
43
+ exports.expectedSix = [
44
+ ...exports.expectedFive,
45
+ ".users.user_interested_in_topic$user.topic.inbound_level_three$topic.inbound_level_two.bp_inbound.post.blog_in_topic$post",
46
+ ".users.user_interested_in_topic$user.topic.inbound_level_three$topic.inbound_level_two.post_from_layer_two.blog_in_topic$post",
47
+ ".users.user_interested_in_topic$another_user.topic.inbound_level_three$topic.inbound_level_two.bp_inbound.post.blog_in_topic$post",
48
+ ".users.user_interested_in_topic$another_user.topic.inbound_level_three$topic.inbound_level_two.post_from_layer_two.blog_in_topic$post",
49
+ ".users.second_inbound$user.topic.inbound_level_three$topic.inbound_level_two.bp_inbound.post.blog_in_topic$post",
50
+ ".users.second_inbound$user.topic.inbound_level_three$topic.inbound_level_two.post_from_layer_two.blog_in_topic$post",
51
+ ];
52
+ //# sourceMappingURL=expected_relations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected_relations.js","sourceRoot":"","sources":["../../tests/expected_relations.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,GAAG;IACH,gEAAgE;IAChE,qGAAqG;IACrG,0GAA0G;CAC3G,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,GAAG,mBAAW;IACd,wEAAwE;IACxE,6GAA6G;IAC7G,kHAAkH;CACnH,CAAC;AAEW,QAAA,aAAa,GAAG;IAC3B,GAAG,mBAAW;IACd,uEAAuE;IACvE,+EAA+E;IAC/E,iHAAiH;IACjH,yHAAyH;CAC1H,CAAC;AAEW,QAAA,YAAY,GAAG;IAC1B,GAAG,qBAAa;IAChB,iGAAiG;IACjG,wGAAwG;IACxG,sDAAsD;IACtD,6DAA6D;IAC7D,2FAA2F;IAC3F,gGAAgG;IAChG,uGAAuG;CACxG,CAAC;AAEW,QAAA,YAAY,GAAG;IAC1B,GAAG,oBAAY;IACf,yGAAyG;IACzG,iHAAiH;IACjH,+FAA+F;IAC/F,0IAA0I;IAC1I,0IAA0I;IAC1I,kJAAkJ;IAClJ,gIAAgI;CACjI,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,GAAG,oBAAY;IACf,2HAA2H;IAC3H,+HAA+H;IAC/H,mIAAmI;IACnI,uIAAuI;IACvI,iHAAiH;IACjH,qHAAqH;CACtH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=relations_finder.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations_finder.test.d.ts","sourceRoot":"","sources":["../../tests/relations_finder.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_data_1 = require("./test_data");
4
+ const expected_relations_1 = require("./expected_relations");
5
+ const relations_finder_1 = require("../relations/relations_finder");
6
+ describe("single relations", () => {
7
+ it("parent relations", () => {
8
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
9
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
10
+ expect(finder.singleRelationPaths("fan_club", "show_artist", [])).toEqual([
11
+ ".fan_club.artist",
12
+ ]);
13
+ });
14
+ it("parent relations with layers", () => {
15
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
16
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
17
+ expect(finder.singleRelationPaths("patients", "show_publisher", [])).toEqual([".patients.favbook.publisher"]);
18
+ });
19
+ it("one to one relations", () => {
20
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
21
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
22
+ expect(finder.singleRelationPaths("covers", "show_album", [])).toEqual([
23
+ ".covers.albums$cover",
24
+ ]);
25
+ });
26
+ it("employee department relation", () => {
27
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
28
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
29
+ expect(finder.singleRelationPaths("employee", "show_manager", [])).toEqual([
30
+ ".employee",
31
+ ".employee.department.manager",
32
+ ]);
33
+ });
34
+ });
35
+ describe("multi relations", () => {
36
+ describe("inbound relations", () => {
37
+ it("single keys to source and rel table", () => {
38
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
39
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
40
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
41
+ expect(result).toHaveLength(expected_relations_1.expectedOne.length);
42
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedOne));
43
+ });
44
+ it("multiple keys to source and single key to rel table", () => {
45
+ const { tables, views } = (0, test_data_1.withAnotherUserField)(__dirname);
46
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
47
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
48
+ expect(result).toHaveLength(expected_relations_1.expectedTwo.length);
49
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedTwo));
50
+ });
51
+ it("multiple keys to source and rel table", () => {
52
+ const { tables, views } = (0, test_data_1.withSecondTopicField)(__dirname);
53
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
54
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
55
+ expect(result).toHaveLength(expected_relations_1.expectedThree.length);
56
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedThree));
57
+ });
58
+ it("multiple inbound tables", () => {
59
+ const { tables, views } = (0, test_data_1.withMultipleInbounds)(__dirname);
60
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
61
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
62
+ expect(result).toHaveLength(expected_relations_1.expectedFour.length);
63
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedFour));
64
+ });
65
+ it("key to source from layer two", () => {
66
+ const { tables, views } = (0, test_data_1.withKeyFromLayerTwo)(__dirname);
67
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
68
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
69
+ expect(result).toHaveLength(expected_relations_1.expectedFive.length);
70
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedFive));
71
+ });
72
+ it("three levels inbound", async () => {
73
+ const { tables, views } = (0, test_data_1.withKeyFromLayerThree)(__dirname);
74
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
75
+ const result = finder.multiRelationPaths("users", "blog_in_topic_feed", []);
76
+ expect(result).toHaveLength(expected_relations_1.expectedSix.length);
77
+ expect(result).toEqual(expect.arrayContaining(expected_relations_1.expectedSix));
78
+ });
79
+ it("simple post topic relation", () => {
80
+ const expected = [
81
+ ".",
82
+ ".users.favsimpletopic.simple_posts$topic",
83
+ ".users.favsimpletopic.simple_post_inbound$topic.post",
84
+ ".users.messages$user.room.participants$room.user.favsimpletopic.simple_posts$topic",
85
+ ".users.messages$user.room.participants$room.user.favsimpletopic.simple_post_inbound$topic.post",
86
+ ];
87
+ const { tables, views } = (0, test_data_1.withSimplePostTopicrelation)(__dirname);
88
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
89
+ const result = finder.multiRelationPaths("users", "simple_posts_list", []);
90
+ expect(result).toHaveLength(expected.length);
91
+ expect(result).toEqual(expect.arrayContaining(expected));
92
+ });
93
+ });
94
+ describe("many to many relations", () => {
95
+ it("artist_plays_on_album", () => {
96
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
97
+ const expected = [".", ".artists.artist_plays_on_album$artist.album"];
98
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
99
+ const result = finder.multiRelationPaths("artists", "albums_feed", []);
100
+ expect(result).toHaveLength(expected.length);
101
+ expect(result).toEqual(expect.arrayContaining(expected));
102
+ });
103
+ it("tracks on album", () => {
104
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
105
+ const expected = [
106
+ ".",
107
+ ".artists.artist_plays_on_album$artist.album.tracks_on_album$album",
108
+ ];
109
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
110
+ const result = finder.multiRelationPaths("artists", "tracks_on_album_feed", []);
111
+ expect(result).toHaveLength(expected.length);
112
+ expect(result).toEqual(expect.arrayContaining(expected));
113
+ });
114
+ it("show pressing_job with embedded fan club feed", () => {
115
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
116
+ const expected = [
117
+ ".",
118
+ ".pressing_job.album.artist_plays_on_album$album.artist.fan_club$artist",
119
+ ];
120
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
121
+ const result = finder.multiRelationPaths("pressing_job", "fan_club_feed", []);
122
+ expect(result).toHaveLength(expected.length);
123
+ expect(result).toEqual(expect.arrayContaining(expected));
124
+ });
125
+ });
126
+ describe("excluded viewtemplates", () => {
127
+ it("excluded viewtemplates", () => {
128
+ const { tables, views } = (0, test_data_1.fixturesData)(__dirname);
129
+ const expected = [];
130
+ const excluded = ["Room"];
131
+ const finder = new relations_finder_1.RelationsFinder(tables, views, 6);
132
+ const result = finder.singleRelationPaths("participants", "rooms_view", excluded);
133
+ expect(result).toHaveLength(expected.length);
134
+ expect(result).toEqual(expect.arrayContaining(expected));
135
+ });
136
+ });
137
+ });
138
+ //# sourceMappingURL=relations_finder.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations_finder.test.js","sourceRoot":"","sources":["../../tests/relations_finder.test.ts"],"names":[],"mappings":";;AAAA,2CAQqB;AAErB,6DAO8B;AAE9B,oEAAgE;AAEhE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,wBAAY,EAAC,SAAS,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,kCAAe,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACxE,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,wBAAY,EAAC,SAAS,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,kCAAe,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACrD,MAAM,CACJ,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAC7D,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAA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AAC,MAAM,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,wBAAY,EAAC,SAAS,CAAC,CAAC;YAClD,MAAM,QAAQ,GAAQ,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,IAAI,kCAAe,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CACvC,cAAc,EACd,YAAY,EACZ,QAAQ,CACT,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ export declare const fixturesData: (dir: string) => {
2
+ tables: any;
3
+ views: any;
4
+ };
5
+ export declare const withAnotherUserField: (dir: string) => {
6
+ tables: any;
7
+ views: any;
8
+ };
9
+ export declare const withSecondTopicField: (dir: string) => {
10
+ tables: any;
11
+ views: any;
12
+ };
13
+ export declare const withMultipleInbounds: (dir: string) => {
14
+ tables: any;
15
+ views: any;
16
+ };
17
+ export declare const withKeyFromLayerTwo: (dir: string) => {
18
+ tables: any;
19
+ views: any;
20
+ };
21
+ export declare const withKeyFromLayerThree: (dir: string) => {
22
+ tables: any;
23
+ views: any;
24
+ };
25
+ export declare const withSimplePostTopicrelation: (dir: string) => {
26
+ tables: any;
27
+ views: any;
28
+ };
29
+ //# sourceMappingURL=test_data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test_data.d.ts","sourceRoot":"","sources":["../../tests/test_data.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,QAAS,MAAM;;;CAKvC,CAAC;AAIF,eAAO,MAAM,oBAAoB,QAAS,MAAM;;;CAa/C,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAS,MAAM;;;CAa/C,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAS,MAAM;;;CA0B/C,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAS,MAAM;;;CAe9C,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAS,MAAM;;;CA0BhD,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAAS,MAAM;;;CA2DtD,CAAC"}
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withSimplePostTopicrelation = exports.withKeyFromLayerThree = exports.withKeyFromLayerTwo = exports.withMultipleInbounds = exports.withSecondTopicField = exports.withAnotherUserField = exports.fixturesData = void 0;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ const fixturesData = (dir) => {
7
+ const { tables, views } = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(dir, "schema_data.json")).toString());
8
+ return { tables, views };
9
+ };
10
+ exports.fixturesData = fixturesData;
11
+ let nextFieldId = 3000;
12
+ const withAnotherUserField = (dir) => {
13
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.fixturesData)(dir)));
14
+ const uiit = tables.find(({ name }) => name === "user_interested_in_topic");
15
+ uiit.foreign_keys.push({
16
+ name: "another_user",
17
+ id: nextFieldId++,
18
+ table_id: uiit.id,
19
+ reftable_name: "users",
20
+ is_unique: false,
21
+ });
22
+ return { tables, views };
23
+ };
24
+ exports.withAnotherUserField = withAnotherUserField;
25
+ const withSecondTopicField = (dir) => {
26
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.withAnotherUserField)(dir)));
27
+ const bit = tables.find(({ name }) => name === "blog_in_topic");
28
+ bit.foreign_keys.push({
29
+ name: "second_topic",
30
+ id: nextFieldId++,
31
+ table_id: bit.id,
32
+ reftable_name: "topics",
33
+ is_unique: false,
34
+ });
35
+ return { tables, views };
36
+ };
37
+ exports.withSecondTopicField = withSecondTopicField;
38
+ const withMultipleInbounds = (dir) => {
39
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.withSecondTopicField)(dir)));
40
+ const nextTableId = tables.length + 1;
41
+ tables.push({
42
+ name: "second_inbound",
43
+ id: nextTableId,
44
+ foreign_keys: [
45
+ {
46
+ name: "topic",
47
+ id: nextFieldId++,
48
+ table_id: nextTableId,
49
+ reftable_name: "topics",
50
+ is_unique: false,
51
+ },
52
+ {
53
+ name: "user",
54
+ id: nextFieldId++,
55
+ table_id: nextTableId,
56
+ reftable_name: "users",
57
+ is_unique: false,
58
+ },
59
+ ],
60
+ });
61
+ return { tables, views };
62
+ };
63
+ exports.withMultipleInbounds = withMultipleInbounds;
64
+ const withKeyFromLayerTwo = (dir) => {
65
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.withMultipleInbounds)(dir)));
66
+ const inboundInbound = tables.find(({ name }) => name === "inbound_inbound");
67
+ inboundInbound.foreign_keys.push({
68
+ name: "post_from_layer_two",
69
+ id: nextFieldId++,
70
+ table_id: inboundInbound.id,
71
+ reftable_name: "blog_posts",
72
+ is_unique: false,
73
+ });
74
+ return { tables, views };
75
+ };
76
+ exports.withKeyFromLayerTwo = withKeyFromLayerTwo;
77
+ const withKeyFromLayerThree = (dir) => {
78
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.withKeyFromLayerTwo)(dir)));
79
+ const nextTableId = tables.length + 1;
80
+ tables.push({
81
+ name: "inbound_level_three",
82
+ id: nextTableId,
83
+ foreign_keys: [
84
+ {
85
+ name: "inbound_level_two",
86
+ id: nextFieldId++,
87
+ table_id: nextTableId,
88
+ reftable_name: "inbound_inbound",
89
+ is_unique: false,
90
+ },
91
+ {
92
+ name: "topic",
93
+ id: nextFieldId++,
94
+ table_id: nextTableId,
95
+ reftable_name: "topics",
96
+ is_unique: false,
97
+ },
98
+ ],
99
+ });
100
+ return { tables, views };
101
+ };
102
+ exports.withKeyFromLayerThree = withKeyFromLayerThree;
103
+ const withSimplePostTopicrelation = (dir) => {
104
+ const { tables, views } = JSON.parse(JSON.stringify((0, exports.fixturesData)(dir)));
105
+ const simpleTopicsId = tables.length + 1;
106
+ const simplePostsId = simpleTopicsId + 1;
107
+ const simplePostInboundId = simplePostsId + 1;
108
+ tables.push({
109
+ name: "simple_posts",
110
+ id: simplePostsId,
111
+ foreign_keys: [
112
+ {
113
+ name: "topic",
114
+ table_id: simplePostsId,
115
+ id: nextFieldId++,
116
+ reftable_name: "simple_topics",
117
+ is_unique: false,
118
+ },
119
+ ],
120
+ });
121
+ tables.push({
122
+ name: "simple_topics",
123
+ id: simpleTopicsId,
124
+ foreign_keys: [],
125
+ });
126
+ tables.push({
127
+ name: "simple_post_inbound",
128
+ id: simplePostInboundId,
129
+ foreign_keys: [
130
+ {
131
+ name: "post",
132
+ table_id: simplePostInboundId,
133
+ id: nextFieldId++,
134
+ reftable_name: "simple_posts",
135
+ is_unique: false,
136
+ },
137
+ {
138
+ name: "topic",
139
+ table_id: simplePostInboundId,
140
+ id: nextFieldId++,
141
+ reftable_name: "simple_topics",
142
+ is_unique: false,
143
+ },
144
+ ],
145
+ });
146
+ const users = tables.find(({ name }) => name === "users");
147
+ users.foreign_keys.push({
148
+ name: "favsimpletopic",
149
+ table_id: users.id,
150
+ id: nextFieldId++,
151
+ reftable_name: "simple_topics",
152
+ is_unique: false,
153
+ });
154
+ views.push({
155
+ name: "simple_posts_list",
156
+ table_id: simplePostsId,
157
+ display_type: "NO_ROW_LIMIT",
158
+ });
159
+ return { tables, views };
160
+ };
161
+ exports.withSimplePostTopicrelation = withSimplePostTopicrelation;
162
+ //# sourceMappingURL=test_data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test_data.js","sourceRoot":"","sources":["../../tests/test_data.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+BAA4B;AAErB,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAClC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,CAAC,QAAQ,EAAE,CACvD,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEF,IAAI,WAAW,GAAG,IAAI,CAAC;AAEhB,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,oBAAY,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CACtB,CAAC,EAAE,IAAI,EAAO,EAAE,EAAE,CAAC,IAAI,KAAK,0BAA0B,CACvD,CAAC;IACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;QACrB,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,WAAW,EAAE;QACjB,QAAQ,EAAE,IAAI,CAAC,EAAE;QACjB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B;AAEK,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,EAAE;IAClD,MAAM,EAAE,MA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,OAAO;gBACb,QAAQ,EAAE,mBAAmB;gBAC7B,EAAE,EAAE,WAAW,EAAE;gBACjB,aAAa,EAAE,eAAe;gBAC9B,SAAS,EAAE,KAAK;aACjB;SACF;KACF,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAO,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/D,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,KAAK,CAAC,EAAE;QAClB,EAAE,EAAE,WAAW,EAAE;QACjB,aAAa,EAAE,eAAe;QAC9B,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IAEH,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,aAAa;QACvB,YAAY,EAAE,cAAc;KAC7B,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC,CAAC;AA3DW,QAAA,2BAA2B,+BA2DtC"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../relations/relation_types.ts","../relations/relation_helpers.ts","../relations/relation.ts","../relations/relations_finder.ts","../index.ts","../tests/expected_relations.ts","../tests/test_data.ts","../tests/relations_finder.test.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/adm-zip/index.d.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/bcryptjs/index.d.ts","../../../node_modules/@types/cookie/index.d.ts","../../../node_modules/@types/cors/index.d.ts","../../../node_modules/@types/dateformat/index.d.ts","../../../node_modules/@types/ms/index.d.ts","../../../node_modules/@types/debug/index.d.ts","../../../node_modules/@types/dumb-passwords/index.d.ts","../../../node_modules/@types/escape-html/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/estraverse/index.d.ts","../../../node_modules/@types/fs-extra/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/i18n/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/expect/node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/expect/node_modules/pretty-format/build/index.d.ts","../../../node_modules/expect/node_modules/jest-diff/build/index.d.ts","../../../node_modules/expect/node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/parse5/dist/common/html.d.ts","../../../node_modules/parse5/dist/common/token.d.ts","../../../node_modules/parse5/dist/common/error-codes.d.ts","../../../node_modules/parse5/dist/tokenizer/preprocessor.d.ts","../../../node_modules/parse5/dist/tokenizer/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/interface.d.ts","../../../node_modules/parse5/dist/parser/open-element-stack.d.ts","../../../node_modules/parse5/dist/parser/formatting-element-list.d.ts","../../../node_modules/parse5/dist/parser/index.d.ts","../../../node_modules/parse5/dist/tree-adapters/default.d.ts","../../../node_modules/parse5/dist/serializer/index.d.ts","../../../node_modules/parse5/dist/common/foreign-content.d.ts","../../../node_modules/parse5/dist/index.d.ts","../../../node_modules/@types/tough-cookie/index.d.ts","../../../node_modules/@types/jsdom/base.d.ts","../../../node_modules/@types/jsdom/index.d.ts","../../../node_modules/@types/jsonwebtoken/index.d.ts","../../../node_modules/@types/lockfile/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/mime-types/index.d.ts","../../../node_modules/@types/minipass/index.d.ts","../../../node_modules/@types/mjml-core/index.d.ts","../../../node_modules/@types/mjml/index.d.ts","../../../node_modules/form-data/index.d.ts","../../../node_modules/@types/node-fetch/externals.d.ts","../../../node_modules/@types/node-fetch/index.d.ts","../../../node_modules/@types/nodemailer/lib/dkim/index.d.ts","../../../node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts","../../../node_modules/@types/nodemailer/lib/xoauth2/index.d.ts","../../../node_modules/@types/nodemailer/lib/mailer/index.d.ts","../../../node_modules/@types/nodemailer/lib/mime-node/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts","../../../node_modules/@types/nodemailer/lib/shared/index.d.ts","../../../node_modules/@types/nodemailer/lib/json-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/ses-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/stream-transport/index.d.ts","../../../node_modules/@types/nodemailer/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/pg-types/index.d.ts","../../../node_modules/pg-protocol/dist/messages.d.ts","../../../node_modules/@types/pg/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/scheduler/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/sqlite3/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/tar/index.d.ts","../../../node_modules/@types/tmp/index.d.ts","../../../node_modules/@types/url-join/index.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/@types/xml2js/lib/processors.d.ts","../../../node_modules/@types/xml2js/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"b5b6526e9865ae6d16328c5ec0d96a835973227f04f2d99883458978e341169e","signature":"9e07511c28f90428442548cf21d227a5cc9c95ca257212523946265f3e48e265"},{"version":"8a29c32202f8c52b0bac4c8981bccde763b1271372eea5664dee74a35b05ecff","signature":"9c98d8d9fe9471f8851ee28c83fc0ed24dfa126bf2173d62739a098201bf66d6"},{"version":"866e0e4953de2b49c3d5199ee45c289cf80e117d102609b9b31d371703f5b183","signature":"9ff7b4ec97caa287e562aa2cd310ece1ee65870600af409dafacdab4ea53f10a"},{"version":"9ed98101affddd1ff39062c4238e6abe2f722a7e4f7663e97f13ab910451a631","signature":"b3c0c26f0d7fc64385eab931885cc8fd59bff3f5c75e3217aba82b3d9eea919b"},{"version":"8c8bda75003ce85b28a34e6aadf16ccbf39917d3aa8b7adb2314d0b424527d55","signature":"8b922ece893d0d4b35efdccd4e88722b5539742a7fa20572ea2f4b1f07c2c3dc"},{"version":"6d1780ecd15dd34a7714038d059d5a6b15b0efb4be9cc56cb04b807fa2e4620a","signature":"763b437dabf210b3d4a7c6b97c8bff90fc18e50fa62a25e9ea64f97b6db0dbca"},{"version":"ded08ba6df173fcdaf0265cd04183d471a5c9cf95c54f55a4ba6b927198d1972","signature":"e83243f7157c27a2e93aba8242c30e393c4c0e6841ec100739d57970e57d3111"},{"version":"eccf6d66ad71a3559cbaacd74f6d59b92e7d4db1b757cb72212ae73a1bb2edf1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"2f6c9750131d5d2fdaba85c164a930dc07d2d7e7e8970b89d32864aa6c72620c","affectsGlobalScope":true},"56d13f223ab40f71840795f5bef2552a397a70666ee60878222407f3893fb8d0",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","90b94d3d2aa3432cc9dd2d15f56a38b166163fc555404c74243e1af29c5549d8","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","c993aac3b6d4a4620ef9651497069eb84806a131420e4f158ea9396fb8eb9b8c","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","06ccebc2c2db57d6bdbca63b71c4ae5e6ddc42d972fd8f122d4c1a28aa111b25",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"be57ed74f6dc1a2c92e6f8e00b1d758bb6ec513680b5547c67ac7c0193371b93","57951685bd0e57e5a7aebfd62512e365bc1db66315992211a647cacfcfa65965","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","d2f5c67858e65ebb932c2f4bd2af646f5764e8ad7f1e4fbe942a0b5ea05dc0e7","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","7f249c599e7a9335dd8e94a4bfe63f00e911756c3c23f77cdb6ef0ec4d479e4a",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"2cabc86ea4f972f2c8386903eccb8c19e2f2370fb9808b66dd8759c1f2ab30c7","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","02b3239cf1b1ff8737e383ed5557f0247499d15f5bd21ab849b1a24687b6100c","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"aee7013623e7632fba449d4df1da92925b27d9b816cb05546044dbfe54c88ef4","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","f6b2d700c02c818151361abb13737527e8bc0aab9b7065b662b25d9eaba4c5de","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"1aad825534c73852a1f3275e527d729a2c0640f539198fdfdfeb83b839851910","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","bf7ccda18d9cb9ed3047d96a6542fee3c3bc4e7a7822af40332c5c2f6e07c2b7","ddb0b9fcd2670bce028e60ca5768719c5d21508b00dc83acf6af25cbe1fcc5ec","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","fc72135da24040641388fb5f2c2a7a99aa5b962c0fa125bd96fabeec63dd2e63","5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3","a3d3f704c5339a36da3ca8c62b29072f87e86c783b8452d235992142ec71aa2d","117ffeecf6c55e25b6446f449ad079029b5e7317399b0a693858faaaea5ca73e","efdced704bd09db6984a2a26e3573bc43cdc2379bdef3bcff6cff77efe8ba82b","8ec9097acdc9121929a436eeb1b186a224b50e652b6f475eb8cff36a832b78f7","6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","0f92c072c93961ce5b1fb27e0e2400bdcc924457add1aa9643413e8c487f044d","f1d0a09e5b4f75c1dbaa52b12611cf9def542cb24eead9e6d8b4f404c5386173",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"a1c79f857f5c7754e14c93949dad8cfefcd7df2ecc0dc9dd79a30fd493e28449","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","2d474dfb84cd28ea43f27fe684da8c00382cbd40cee45e1dad4e9f41f6c437b6","dc33ce27fbeaf0ea3da556c80a6cc8af9d13eb443088c8f25cdc39fca8e756f6","cc5ba25bed3b3c220977e96f797e65f81c4f7cb8da066051f56fed478be60a7f","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba",{"version":"f9a5370a085b7fc81a626a65863211701594fab0615aca1b928d7147fd5c5350","affectsGlobalScope":true},"8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e",{"version":"5ab630d466ac55baa6d32820378098404fc18ba9da6f7bc5df30c5dbb1cffae8","affectsGlobalScope":true},"ba600bf38b5c1a5dffa1b99dd7a783549082bbba3b4fe9497eaaf5e4c1764b20","ae8cd6af37275eac75f5369cdb5f01063bcf1f48d74cb434303ee50ec446acfe","2518830a2fda9c272ba48798d0e7b857037443b06594db8e42c87e86944ee9e4","95c1cf650d16b197525b5bfdf8dd7abba0a49d99ddb12a4ba66466a8a6903e49","1fe0aabe758d56ad72495d6e6c7b6ae75619faaeaaf03f0ddf1948eea4cfac84","bbc57966c8c48ee78fd58aadb893784025be056ae538ae22d1e83c502a987e68","5e5d6f6697e378b0660b567866bf67d099d0ea754f8810c0dabe737805f5cf03","99ab49d4732fdc98cf5c495925e65e796544cb4086fe42afc235dfc02bcf2351","af8339d509c40da075088e544c28ed37b519876e5c4d36a48644ebfb3c6ae6c8","d393adc32e520d4274bb4c3dfdcdb342b806a230b66ef0f82b35bffbc4aa2590","c26af7eaedb4f710984634e419ab15e54e5bb99a0b3cae71188c2fff572276de","38b58ef018d0aeee42ef74c42978bb5805503233fdeeb82cd2aed2199fb0d013","3b6040253231d44e6778eb6861cc86c1758562e77783d21b7ecbc73322ded539","03c258e060b7da220973f84b89615e4e9850e9b5d30b3a8e4840b3e3268ae8eb","fd0589ca571ad090b531d8c095e26caa53d4825c64d3ff2b2b1ab95d72294175",{"version":"669843ecafb89ae1e944df06360e8966219e4c1c34c0d28aa2503272cdd444a7","affectsGlobalScope":true},"0bf811dcbddc95e2551f704cfd2afc267bf619f8b8f2b7bdbb94df96ec3cbfe3","23c77af9fdadb3569d425dbc7bbf06a118a4b02bd9db14b7abfafc3183d58bb6","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"c757372a092924f5c16eaf11a1475b80b95bb4dae49fe3242d2ad908f97d5abe","2d7833f437e0f41a91d9ac5b156157fde7e5380558ff44832afae705ac0e795d","4b12f610434504df3735461567d933b7c557406e0ab737aac99ea588e47eb429","2ef891dcd51bcb4135a6ad47a51bf75f4793062f821898487bca7f705fea6a29","736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","208bb742e0f201470da121bc73847c74b62cff4172f38ae5949ae77d6c9c6b71","062bd2910098fc059ba93e347649b3e126c555f7b144033d21d3f8ef63d3e39b","6825eb4d1c8beb77e9ed6681c830326a15ebf52b171f83ffbca1b1574c90a3b0","1741975791f9be7f803a826457273094096e8bba7a50f8fa960d5ed2328cdbcc","6ec0d1c15d14d63d08ccb10d09d839bf8a724f6b4b9ed134a3ab5042c54a7721","75dabc9afdb451a85e6d46e9ca65ec82ead2256476c0686f671f3421923667a7","ddfc215bfbddf5854d80ab8fb0256bd802f2a8acb6be62f9e630041266d56cd5","2c3bcb8a4ea2fcb4208a06672af7540dd65bf08298d742f041ffa6cbe487cf80","1cce0460d75645fc40044c729da9a16c2e0dabe11a58b5e4bfd62ac840a1835d","c784a9f75a6f27cf8c43cc9a12c66d68d3beb2e7376e1babfae5ae4998ffbc4a","feb4c51948d875fdbbaa402dad77ee40cf1752b179574094b613d8ad98921ce1","a6d3984b706cefe5f4a83c1d3f0918ff603475a2a3afa9d247e4114f18b1f1ef","b457d606cabde6ea3b0bc32c23dc0de1c84bb5cb06d9e101f7076440fc244727","9d59919309a2d462b249abdefba8ca36b06e8e480a77b36c0d657f83a63af465","9faa2661daa32d2369ec31e583df91fd556f74bcbd036dab54184303dee4f311","b08de5693ec0119e033ced692f3ad0c0449c7331fd1d84033ea9b4b22e7f269c","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","f60e3e3060207ac982da13363181fd7ee4beecc19a7c569f0d6bb034331066c2","17230b34bb564a3a2e36f9d3985372ccab4ad1722df2c43f7c5c2b553f68e5db","02eed0b92a38540d94adccf11b067084cc16a815da1d62e80cec9511d9f0eef2","f1d8b21cdf08726021c8cce0cd6159486236cf1d633eeabbc435b5b2e5869c2e","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ba7617784f6b9aeac5e20c5eea869bbc3ef31b905f59c796b0fd401dae17c111","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"a2037c0eea8dc883f41b8dcbc7e0f9b305f79989f4d310d77c9c321432a66411","affectsGlobalScope":true},"8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57","d9e55d93aa33fad61bd5c63800972d00ba8879ec5d29f6f3bce67d16d86abc33","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","77c1d91a129ba60b8c405f9f539e42df834afb174fe0785f89d92a2c7c16b77a","c544d81603149987796b24cca297c965db427b84b2580fb27e52fb37ddc1f470","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","71405cc70f183d029cc5018375f6c35117ffdaf11846c35ebf85ee3956b1b2a6","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","6eef5113135a0f2bbac8259909a5bbb7666bcde022c28f4ab95145623cbe1f72","058b8dd97b7c67b6bf33e7bda7b1e247b019b675d4b6449d14ac002091a8b4f8","89c8a7b88c378663a8124664f2d9b8c2887e186b55aa066edf6d67177ca1aa04","5a30ba65ad753eb2ef65355dbb3011b28b192cb9df2ef0b5f595b51ca7faf353","b15e55c5fa977c2f25ca0b1db52cfa2d1fd4bf0baf90a8b90d4a7678ca462ff1","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","86d425f7fcd8d100dafa6286cc289af88cbb639ecbdbd25c3018a8f0f7b09fe5","9795e0a3a45d5b6f1a791ee54b7c8b58bc931e8900966cea2dff9c5bae56073b","5890be29879d02424b7654f40592915189034948f7a18c5ad121c006d4e92811","0ab49086f10c75a1cb3b18bffe799dae021774146d8a2d5a4bb42dda67b64f9b","81c77839e152b8f715ec67b0a8b910bcc2d6cf916794c3519f8798c40efd12ac","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","464843c00fb3dd4735b28255c5c9fe713f16b8e47a3db09ba1647687440f7aef","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","d0f6d36b2d86f934560c48d8bfdc7ab60c67cfb2ab6dc1916706aa68e83d6dc2","7a255524a57e2a24851fd794ed17f3ed7b93b10d85adf437669fb0ad04f34ef1","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","239f0c1d83d1ca9677327198196ee2ce6827dc7b469771ab5abf7bea7fbdb674","6061aa83817c30d3a590f037b3cba22cdd809fbe697926d6511b45147928a342","d9c5f8d21771758700d7b6eeef796700b99c643a5818195cf0d01bed98407df1","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","c0288f54de6f544706a3150c8b579b1a975870695c4be866f727ece6a16f3976","ec2c7505ede4bc3ee37cfe431cfd87e545f55f27fe15b0809c1a411765145615","70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":8},"fileIdsList":[[99,108],[99],[99,138],[99,106],[99,108,109,110,111,112],[99,108,110],[74,99,106],[99,118],[99,123,125],[99,122,123,124],[99,123],[72,99,106],[71,72,99,106,129],[99,133],[99,134],[99,140,143],[99,139],[71,99,101,106,158,159,161],[99,160],[65,99,106],[99,164,166,167,168,169,170,171,172,173,174,175,176],[99,164,165,167,168,169,170,171,172,173,174,175,176],[99,165,166,167,168,169,170,171,172,173,174,175,176],[99,164,165,166,168,169,170,171,172,173,174,175,176],[99,164,165,166,167,169,170,171,172,173,174,175,176],[99,164,165,166,167,168,170,171,172,173,174,175,176],[99,164,165,166,167,168,169,171,172,173,174,175,176],[99,164,165,166,167,168,169,170,172,173,174,175,176],[99,164,165,166,167,168,169,170,171,173,174,175,176],[99,164,165,166,167,168,169,170,171,172,174,175,176],[99,164,165,166,167,168,169,170,171,172,173,175,176],[99,164,165,166,167,168,169,170,171,172,173,174,176],[99,164,165,166,167,168,169,170,171,172,173,174,175],[71,99,106],[99,179],[74,98,99,106,181,182],[56,99],[59,99],[60,65,99],[61,71,72,79,88,98,99],[61,62,71,79,99],[63,99],[64,65,72,80,99],[65,88,95,99],[66,68,71,79,99],[67,99],[68,69,99],[70,71,99],[71,99],[71,72,73,88,98,99],[71,72,73,88,99],[74,79,88,98,99],[71,72,74,75,79,88,95,98,99],[74,76,88,95,98,99],[56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105],[71,77,99],[78,98,99],[68,71,79,88,99],[80,99],[81,99],[59,82,99],[83,97,99,103],[84,99],[85,99],[71,86,99],[86,87,99,101],[71,88,89,90,99],[88,90,99],[88,89,99],[91,99],[92,99],[71,93,94,99],[93,94,99],[65,79,95,99],[96,99],[79,97,99],[60,74,85,98,99],[65,99],[88,99,100],[99,101],[99,102],[60,65,71,73,82,88,98,99,101,103],[88,99,104],[99,106,185,187,191,192,193,194,195,196],[88,99,106],[71,99,106,185,187,188,190,197],[71,79,88,98,99,106,184,185,186,188,189,190,197],[88,99,106,187,188],[88,99,106,187,189],[99,106,185,187,188,190,197],[88,99,106,189],[71,79,88,95,99,106,186,188,190],[71,99,106,185,187,188,189,190,197],[71,88,99,106,185,186,187,188,189,190,197],[71,88,99,106,185,187,188,190,197],[74,88,99,106,190],[71,88,95,99,106,199,200,201],[99,203,204,205,206],[99,210,249],[99,210,234,249],[99,249],[99,210],[99,210,235,249],[99,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248],[99,235,249],[71,88,99,104,106,178],[71,99,106,256],[99,258],[99,136,142],[99,140],[99,137,141],[74,88,99,106],[99,147],[99,146,147],[99,146],[99,146,147,148,150,151,154,155,156,157],[99,147,151],[99,146,147,148,150,151,152,153],[99,146,151],[99,151,155],[99,147,148,149],[99,148],[99,146,147,151],[48,49,50,51,99],[48,49,99],[48,99],[48,49,50,99],[51,53,54,99],[72,81,99],[48,49,50,51],[48],[50]],"referencedMap":[[110,1],[108,2],[136,2],[139,3],[138,2],[107,4],[113,5],[109,1],[111,6],[112,1],[114,2],[115,2],[116,7],[117,2],[119,8],[120,2],[121,2],[126,9],[122,2],[125,10],[127,11],[123,2],[128,12],[130,13],[131,12],[132,2],[133,2],[134,14],[135,15],[145,16],[144,17],[160,18],[161,19],[124,2],[162,20],[163,2],[165,21],[166,22],[164,23],[167,24],[168,25],[169,26],[170,27],[171,28],[172,29],[173,30],[174,31],[175,32],[176,33],[177,2],[129,2],[178,34],[179,2],[180,35],[118,2],[182,2],[183,36],[56,37],[57,37],[59,38],[60,39],[61,40],[62,41],[63,42],[64,43],[65,44],[66,45],[67,46],[68,47],[69,47],[70,48],[71,49],[72,50],[73,51],[58,2],[105,2],[74,52],[75,53],[76,54],[106,55],[77,56],[78,57],[79,58],[80,59],[81,60],[82,61],[83,62],[84,63],[85,64],[86,65],[87,66],[88,67],[90,68],[89,69],[91,70],[92,71],[93,72],[94,73],[95,74],[96,75],[97,76],[98,77],[99,78],[100,79],[101,80],[102,81],[103,82],[104,83],[197,84],[184,85],[191,86],[187,87],[185,88],[188,89],[192,90],[193,86],[190,91],[189,92],[194,93],[195,94],[196,95],[186,96],[198,2],[201,97],[202,2],[203,2],[204,2],[207,98],[208,4],[209,2],[206,2],[234,99],[235,100],[210,101],[213,101],[232,99],[233,99],[223,99],[222,102],[220,99],[215,99],[228,99],[226,99],[230,99],[214,99],[227,99],[231,99],[216,99],[217,99],[229,99],[211,99],[218,99],[219,99],[221,99],[225,99],[236,103],[224,99],[212,99],[249,104],[248,2],[243,103],[245,105],[244,103],[237,103],[238,103],[240,103],[242,103],[246,105],[247,105],[239,105],[241,105],[250,34],[251,2],[252,106],[253,2],[159,2],[254,2],[255,2],[257,107],[256,2],[258,2],[259,108],[205,2],[143,109],[137,2],[141,110],[142,111],[140,17],[181,112],[148,113],[157,114],[146,2],[147,115],[158,116],[153,117],[154,118],[152,119],[156,120],[150,121],[149,122],[155,123],[151,114],[200,4],[199,2],[9,2],[10,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[36,2],[41,2],[42,2],[37,2],[38,2],[39,2],[40,2],[8,2],[46,2],[43,2],[44,2],[45,2],[1,2],[47,2],[52,124],[50,125],[49,126],[48,2],[51,127],[53,2],[55,128],[54,129]],"exportedModulesMap":[[110,1],[108,2],[136,2],[139,3],[138,2],[107,4],[113,5],[109,1],[111,6],[112,1],[114,2],[115,2],[116,7],[117,2],[119,8],[120,2],[121,2],[126,9],[122,2],[125,10],[127,11],[123,2],[128,12],[130,13],[131,12],[132,2],[133,2],[134,14],[135,15],[145,16],[144,17],[160,18],[161,19],[124,2],[162,20],[163,2],[165,21],[166,22],[164,23],[167,24],[168,25],[169,26],[170,27],[171,28],[172,29],[173,30],[174,31],[175,32],[176,33],[177,2],[129,2],[178,34],[179,2],[180,35],[118,2],[182,2],[183,36],[56,37],[57,37],[59,38],[60,39],[61,40],[62,41],[63,42],[64,43],[65,44],[66,45],[67,46],[68,47],[69,47],[70,48],[71,49],[72,50],[73,51],[58,2],[105,2],[74,52],[75,53],[76,54],[106,55],[77,56],[78,57],[79,58],[80,59],[81,60],[82,61],[83,62],[84,63],[85,64],[86,65],[87,66],[88,67],[90,68],[89,69],[91,70],[92,71],[93,72],[94,73],[95,74],[96,75],[97,76],[98,77],[99,78],[100,79],[101,80],[102,81],[103,82],[104,83],[197,84],[184,85],[191,86],[187,87],[185,88],[188,89],[192,90],[193,86],[190,91],[189,92],[194,93],[195,94],[196,95],[186,96],[198,2],[201,97],[202,2],[203,2],[204,2],[207,98],[208,4],[209,2],[206,2],[234,99],[235,100],[210,101],[213,101],[232,99],[233,99],[223,99],[222,102],[220,99],[215,99],[228,99],[226,99],[230,99],[214,99],[227,99],[231,99],[216,99],[217,99],[229,99],[211,99],[218,99],[219,99],[221,99],[225,99],[236,103],[224,99],[212,99],[249,104],[248,2],[243,103],[245,105],[244,103],[237,103],[238,103],[240,103],[242,103],[246,105],[247,105],[239,105],[241,105],[250,34],[251,2],[252,106],[253,2],[159,2],[254,2],[255,2],[257,107],[256,2],[258,2],[259,108],[205,2],[143,109],[137,2],[141,110],[142,111],[140,17],[181,112],[148,113],[157,114],[146,2],[147,115],[158,116],[153,117],[154,118],[152,119],[156,120],[150,121],[149,122],[155,123],[151,114],[200,4],[199,2],[9,2],[10,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[36,2],[41,2],[42,2],[37,2],[38,2],[39,2],[40,2],[8,2],[46,2],[43,2],[44,2],[45,2],[1,2],[47,2],[52,130],[50,131],[49,131],[51,132]],"semanticDiagnosticsPerFile":[110,108,136,139,138,107,113,109,111,112,114,115,116,117,119,120,121,126,122,125,127,123,128,130,131,132,133,134,135,145,144,160,161,124,162,163,165,166,164,167,168,169,170,171,172,173,174,175,176,177,129,178,179,180,118,182,183,56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,58,105,74,75,76,106,77,78,79,80,81,82,83,84,85,86,87,88,90,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,197,184,191,187,185,188,192,193,190,189,194,195,196,186,198,201,202,203,204,207,208,209,206,234,235,210,213,232,233,223,222,220,215,228,226,230,214,227,231,216,217,229,211,218,219,221,225,236,224,212,249,248,243,245,244,237,238,240,242,246,247,239,241,250,251,252,253,159,254,255,257,256,258,259,205,143,137,141,142,140,181,148,157,146,147,158,153,154,152,156,150,149,155,151,200,199,9,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,1,47,52,50,49,48,51,53,55,54]},"version":"4.7.4"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@saltcorn/common-code",
3
+ "version": "0.9.4-beta.10",
4
+ "description": "Code that can be used on both server and client",
5
+ "homepage": "https://saltcorn.com",
6
+ "scripts": {
7
+ "test": "jest tests --runInBand",
8
+ "tsc": "tsc --build",
9
+ "clean": "tsc --build --clean"
10
+ },
11
+ "author": "Christian Hugo",
12
+ "license": "MIT",
13
+ "main": "dist/index.js",
14
+ "exports": {
15
+ ".": "./dist/index.js",
16
+ "./*": "./dist/*.js",
17
+ "./relations/*": "./dist/relations/*.js"
18
+ },
19
+ "devDependencies": {
20
+ "@types/jest": "^29.5.11",
21
+ "jest": "^29.7.0",
22
+ "ts-jest": "^29.1.1"
23
+ },
24
+ "typesVersions": {
25
+ "*": {
26
+ "*": [
27
+ "dist/*"
28
+ ]
29
+ }
30
+ },
31
+ "files": [
32
+ "dist/**/*"
33
+ ],
34
+ "repository": "github:saltcorn/saltcorn",
35
+ "jest": {
36
+ "preset": "ts-jest",
37
+ "testEnvironment": "node",
38
+ "modulePathIgnorePatterns": [
39
+ ".*\\.js$"
40
+ ],
41
+ "coveragePathIgnorePatterns": [
42
+ "/tests/"
43
+ ]
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }