@aiao/rxdb-query-builder 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as U } from "uuid";
|
|
2
2
|
import { BehaviorSubject as W, map as k, distinctUntilChanged as $ } from "rxjs";
|
|
3
|
-
import { RelationKind as B, PropertyType as
|
|
3
|
+
import { RelationKind as B, PropertyType as m } from "@aiao/rxdb";
|
|
4
4
|
function v(n) {
|
|
5
5
|
return "combinator" in n && "rules" in n;
|
|
6
6
|
}
|
|
@@ -179,6 +179,7 @@ const Y = [
|
|
|
179
179
|
], X = {
|
|
180
180
|
uuid: "string",
|
|
181
181
|
string: "string",
|
|
182
|
+
enum: "string",
|
|
182
183
|
number: "number",
|
|
183
184
|
integer: "number",
|
|
184
185
|
boolean: "boolean",
|
|
@@ -985,7 +986,7 @@ function he(n) {
|
|
|
985
986
|
if (s.set(i.name, p), o.length === 1)
|
|
986
987
|
r.push(p);
|
|
987
988
|
else {
|
|
988
|
-
const
|
|
989
|
+
const g = o.slice(0, -1).join("."), b = s.get(g);
|
|
989
990
|
if (b)
|
|
990
991
|
b.children = b.children ?? [], b.children.push(p);
|
|
991
992
|
else {
|
|
@@ -1065,22 +1066,23 @@ function be(n, e) {
|
|
|
1065
1066
|
const oe = 4, L = ["id", "createdAt", "updatedAt", "createdBy", "updatedBy"];
|
|
1066
1067
|
function G(n) {
|
|
1067
1068
|
switch (n) {
|
|
1068
|
-
case
|
|
1069
|
+
case m.uuid:
|
|
1069
1070
|
return "string";
|
|
1070
|
-
case
|
|
1071
|
+
case m.string:
|
|
1072
|
+
case m.enum:
|
|
1071
1073
|
return "string";
|
|
1072
|
-
case
|
|
1073
|
-
case
|
|
1074
|
+
case m.number:
|
|
1075
|
+
case m.integer:
|
|
1074
1076
|
return "number";
|
|
1075
|
-
case
|
|
1077
|
+
case m.boolean:
|
|
1076
1078
|
return "boolean";
|
|
1077
|
-
case
|
|
1079
|
+
case m.date:
|
|
1078
1080
|
return "date";
|
|
1079
|
-
case
|
|
1080
|
-
case
|
|
1081
|
+
case m.stringArray:
|
|
1082
|
+
case m.numberArray:
|
|
1081
1083
|
return "array";
|
|
1082
|
-
case
|
|
1083
|
-
case
|
|
1084
|
+
case m.json:
|
|
1085
|
+
case m.keyValue:
|
|
1084
1086
|
return "object";
|
|
1085
1087
|
default:
|
|
1086
1088
|
return "string";
|
|
@@ -1118,7 +1120,7 @@ function K(n, e, t, r, s, a, l, i) {
|
|
|
1118
1120
|
for (const u of n.foreignKeyNames) {
|
|
1119
1121
|
const c = a ? `${a}.${u}` : u;
|
|
1120
1122
|
if (!o.some((p) => p.name === c)) {
|
|
1121
|
-
const p = u.slice(0, -2),
|
|
1123
|
+
const p = u.slice(0, -2), g = n.foreignKeyRelationMap.get(p), b = g?.displayName ?? p, d = g && "nullable" in g ? g.nullable ?? !1 : !1;
|
|
1122
1124
|
o.push({
|
|
1123
1125
|
name: c,
|
|
1124
1126
|
displayName: `${b}ID`,
|
|
@@ -1132,9 +1134,9 @@ function K(n, e, t, r, s, a, l, i) {
|
|
|
1132
1134
|
if (s.includes(u)) continue;
|
|
1133
1135
|
const p = e.get(c.mappedEntity);
|
|
1134
1136
|
if (!p || i > 0 && p.metadata === r || l.has(p.metadata.name)) continue;
|
|
1135
|
-
const
|
|
1137
|
+
const g = a ? `${a}.${u}` : u, b = c.displayName || u, d = ue(p.metadata, t);
|
|
1136
1138
|
o.push({
|
|
1137
|
-
name:
|
|
1139
|
+
name: g,
|
|
1138
1140
|
displayName: `${b} (${c.kind})`,
|
|
1139
1141
|
type: "relation",
|
|
1140
1142
|
isRelation: !0,
|
|
@@ -1149,12 +1151,12 @@ function K(n, e, t, r, s, a, l, i) {
|
|
|
1149
1151
|
t,
|
|
1150
1152
|
r,
|
|
1151
1153
|
N,
|
|
1152
|
-
|
|
1154
|
+
g,
|
|
1153
1155
|
T,
|
|
1154
1156
|
i + 1
|
|
1155
1157
|
);
|
|
1156
1158
|
for (const h of y) {
|
|
1157
|
-
const S = `${
|
|
1159
|
+
const S = `${g}.${h}`, F = p.metadata.properties.find((A) => A.name === h);
|
|
1158
1160
|
F && !o.some((A) => A.name === S) && o.push({
|
|
1159
1161
|
name: S,
|
|
1160
1162
|
displayName: `${b}.${F.displayName ?? h}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-parser.service.d.ts","sourceRoot":"","sources":["../../src/services/schema-parser.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-parser.service.d.ts","sourceRoot":"","sources":["../../src/services/schema-parser.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAoBtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEhD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;IAEhD;;OAEG;IACH,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CAC3F;AA4BD;;;G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;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,MAAM,GAAE,oBAAyB,GAChC,aAAa,EAAE,CAEjB;AAiID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,cAAc,EACxB,MAAM,GAAE,oBAAyB,GAChC,aAAa,EAAE,CA4CjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CAOvE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiao/rxdb-query-builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"rxjs": "^7.8.2",
|
|
32
32
|
"uuid": "^13.0.0",
|
|
33
|
-
"@aiao/rxdb": "0.0.
|
|
33
|
+
"@aiao/rxdb": "0.0.14"
|
|
34
34
|
}
|
|
35
35
|
}
|