prostgles-server 4.1.110 → 4.1.111
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/DboBuilder/ViewHandler/getInfo.d.ts.map +1 -1
- package/dist/DboBuilder/ViewHandler/getInfo.js +3 -31
- package/dist/DboBuilder/ViewHandler/getInfo.js.map +1 -1
- package/lib/DboBuilder/ViewHandler/getInfo.ts +3 -30
- package/package.json +2 -2
- package/tests/client/package-lock.json +15 -15
- package/tests/client/package.json +1 -1
- package/tests/server/package-lock.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInfo.d.ts","sourceRoot":"","sources":["../../../lib/DboBuilder/ViewHandler/getInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,KAAK,EAClB,MAAM,sBAAsB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"getInfo.d.ts","sourceRoot":"","sources":["../../../lib/DboBuilder/ViewHandler/getInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,KAAK,EAClB,MAAM,sBAAsB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAqB7J"}
|
|
@@ -6,36 +6,7 @@ async function getInfo(lang, param2, param3, tableRules, localParams) {
|
|
|
6
6
|
const p = this.getValidatedRules(tableRules, localParams);
|
|
7
7
|
if (!p.getInfo)
|
|
8
8
|
throw "Not allowed";
|
|
9
|
-
|
|
10
|
-
const mediaTable = this.dboBuilder.prostgles?.opts?.fileTable?.tableName;
|
|
11
|
-
if (!this.is_media && mediaTable) {
|
|
12
|
-
const joinConf = this.dboBuilder.prostgles?.opts?.fileTable?.referencedTables?.[this.name];
|
|
13
|
-
if (joinConf) {
|
|
14
|
-
has_media = typeof joinConf === "string" ? joinConf : "one";
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const jp = this.dboBuilder.getShortestJoinPath(this, mediaTable);
|
|
18
|
-
if (jp && jp.path.length <= 3) {
|
|
19
|
-
if (jp.path.length <= 2) {
|
|
20
|
-
has_media = "one";
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
await Promise.all(jp.path.map(async (tableName) => {
|
|
24
|
-
const pkeyFcols = this?.dboBuilder?.dbo?.[tableName]?.columns?.filter(c => c.is_pkey).map(c => c.name);
|
|
25
|
-
const cols = this?.dboBuilder?.dbo?.[tableName]?.columns?.filter(c => c?.references?.some(({ ftable }) => jp.path.includes(ftable)));
|
|
26
|
-
if (cols && cols.length && has_media !== "many") {
|
|
27
|
-
if (cols.some(c => !pkeyFcols?.includes(c.name))) {
|
|
28
|
-
has_media = "many";
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
has_media = "one";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
9
|
+
const fileTableName = this.dboBuilder.prostgles?.opts?.fileTable?.tableName;
|
|
39
10
|
return {
|
|
40
11
|
oid: this.tableOrViewInfo.oid,
|
|
41
12
|
comment: this.tableOrViewInfo.comment,
|
|
@@ -44,7 +15,8 @@ async function getInfo(lang, param2, param3, tableRules, localParams) {
|
|
|
44
15
|
allowedNestedInserts: tableRules?.insert?.allowedNestedInserts
|
|
45
16
|
},
|
|
46
17
|
isView: this.is_view,
|
|
47
|
-
|
|
18
|
+
hasFiles: Boolean(!this.is_media && fileTableName && this.columns.some(c => c.references?.some(r => r.ftable === fileTableName))),
|
|
19
|
+
fileTableName,
|
|
48
20
|
dynamicRules: {
|
|
49
21
|
update: Boolean(tableRules?.update?.dynamicFields?.length)
|
|
50
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInfo.js","sourceRoot":"","sources":["../../../lib/DboBuilder/ViewHandler/getInfo.ts"],"names":[],"mappings":";;;AAOO,KAAK,UAAU,OAAO,CAAoB,IAAa,EAAE,MAAY,EAAE,MAAY,EAAE,UAAsB,EAAE,WAAyB;IAC3I,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,CAAC,CAAC,CAAC,OAAO;QAAE,MAAM,aAAa,CAAC;IAEpC,
|
|
1
|
+
{"version":3,"file":"getInfo.js","sourceRoot":"","sources":["../../../lib/DboBuilder/ViewHandler/getInfo.ts"],"names":[],"mappings":";;;AAOO,KAAK,UAAU,OAAO,CAAoB,IAAa,EAAE,MAAY,EAAE,MAAY,EAAE,UAAsB,EAAE,WAAyB;IAC3I,MAAM,IAAI,CAAC,IA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
|
10
10
|
const p = this.getValidatedRules(tableRules, localParams);
|
|
11
11
|
if (!p.getInfo) throw "Not allowed";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const mediaTable = this.dboBuilder.prostgles?.opts?.fileTable?.tableName;
|
|
16
|
-
|
|
17
|
-
if (!this.is_media && mediaTable) {
|
|
18
|
-
const joinConf = this.dboBuilder.prostgles?.opts?.fileTable?.referencedTables?.[this.name]
|
|
19
|
-
if (joinConf) {
|
|
20
|
-
has_media = typeof joinConf === "string" ? joinConf : "one";
|
|
21
|
-
} else {
|
|
22
|
-
const jp = this.dboBuilder.getShortestJoinPath(this, mediaTable);
|
|
23
|
-
if (jp && jp.path.length <= 3) {
|
|
24
|
-
if (jp.path.length <= 2) {
|
|
25
|
-
has_media = "one"
|
|
26
|
-
} else {
|
|
27
|
-
await Promise.all(jp.path.map(async tableName => {
|
|
28
|
-
const pkeyFcols = this?.dboBuilder?.dbo?.[tableName]?.columns?.filter(c => c.is_pkey).map(c => c.name);
|
|
29
|
-
const cols = this?.dboBuilder?.dbo?.[tableName]?.columns?.filter(c => c?.references?.some(({ ftable }) => jp.path.includes(ftable)));
|
|
30
|
-
if (cols && cols.length && has_media !== "many") {
|
|
31
|
-
if (cols.some(c => !pkeyFcols?.includes(c.name))) {
|
|
32
|
-
has_media = "many"
|
|
33
|
-
} else {
|
|
34
|
-
has_media = "one"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
13
|
+
const fileTableName = this.dboBuilder.prostgles?.opts?.fileTable?.tableName;
|
|
42
14
|
|
|
43
15
|
return {
|
|
44
16
|
oid: this.tableOrViewInfo.oid,
|
|
@@ -48,7 +20,8 @@ export async function getInfo(this: ViewHandler, lang?: string, param2?: any, pa
|
|
|
48
20
|
allowedNestedInserts: tableRules?.insert?.allowedNestedInserts
|
|
49
21
|
},
|
|
50
22
|
isView: this.is_view,
|
|
51
|
-
|
|
23
|
+
hasFiles: Boolean(!this.is_media && fileTableName && this.columns.some(c => c.references?.some(r => r.ftable === fileTableName))),
|
|
24
|
+
fileTableName,
|
|
52
25
|
dynamicRules: {
|
|
53
26
|
update: Boolean(tableRules?.update?.dynamicFields?.length)
|
|
54
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prostgles-server",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.111",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"check-disk-space": "^3.3.1",
|
|
42
42
|
"file-type": "^18.5.0",
|
|
43
43
|
"pg-promise": "^11.3.0",
|
|
44
|
-
"prostgles-types": "^4.0.
|
|
44
|
+
"prostgles-types": "^4.0.49"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/bluebird": "^3.5.36",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@types/node": "^14.14.16",
|
|
13
|
-
"prostgles-client": "^4.0.
|
|
13
|
+
"prostgles-client": "^4.0.34",
|
|
14
14
|
"socket.io-client": "^4.7.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
|
75
75
|
},
|
|
76
76
|
"node_modules/prostgles-client": {
|
|
77
|
-
"version": "4.0.
|
|
78
|
-
"resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.
|
|
79
|
-
"integrity": "sha512-
|
|
77
|
+
"version": "4.0.34",
|
|
78
|
+
"resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.34.tgz",
|
|
79
|
+
"integrity": "sha512-aTEMeOnWl2Onbvt9V9Qntmmrvg9HBYRdbR3+7ooc+o4OxrZpoz77Yh/S/47UfUrEyuO4tZ7j83a/MZ0fSDQ0gw==",
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"prostgles-types": "^4.0.
|
|
81
|
+
"prostgles-types": "^4.0.49"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"node_modules/prostgles-types": {
|
|
93
|
-
"version": "4.0.
|
|
94
|
-
"resolved": "https://registry.npmjs.org/prostgles-types/-/prostgles-types-4.0.
|
|
95
|
-
"integrity": "sha512-
|
|
93
|
+
"version": "4.0.49",
|
|
94
|
+
"resolved": "https://registry.npmjs.org/prostgles-types/-/prostgles-types-4.0.49.tgz",
|
|
95
|
+
"integrity": "sha512-UQuYqwy9SgWWCuPFrxVg8+uznhu2RioEKFMmzVdrdBsv4b/SzI9iOAztsVdTfWF2+kviSMofr40mB8bksNGhrw==",
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"json-schema": "^0.4.0"
|
|
98
98
|
}
|
|
@@ -212,17 +212,17 @@
|
|
|
212
212
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
|
213
213
|
},
|
|
214
214
|
"prostgles-client": {
|
|
215
|
-
"version": "4.0.
|
|
216
|
-
"resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.
|
|
217
|
-
"integrity": "sha512-
|
|
215
|
+
"version": "4.0.34",
|
|
216
|
+
"resolved": "https://registry.npmjs.org/prostgles-client/-/prostgles-client-4.0.34.tgz",
|
|
217
|
+
"integrity": "sha512-aTEMeOnWl2Onbvt9V9Qntmmrvg9HBYRdbR3+7ooc+o4OxrZpoz77Yh/S/47UfUrEyuO4tZ7j83a/MZ0fSDQ0gw==",
|
|
218
218
|
"requires": {
|
|
219
|
-
"prostgles-types": "^4.0.
|
|
219
|
+
"prostgles-types": "^4.0.49"
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
"prostgles-types": {
|
|
223
|
-
"version": "4.0.
|
|
224
|
-
"resolved": "https://registry.npmjs.org/prostgles-types/-/prostgles-types-4.0.
|
|
225
|
-
"integrity": "sha512-
|
|
223
|
+
"version": "4.0.49",
|
|
224
|
+
"resolved": "https://registry.npmjs.org/prostgles-types/-/prostgles-types-4.0.49.tgz",
|
|
225
|
+
"integrity": "sha512-UQuYqwy9SgWWCuPFrxVg8+uznhu2RioEKFMmzVdrdBsv4b/SzI9iOAztsVdTfWF2+kviSMofr40mB8bksNGhrw==",
|
|
226
226
|
"requires": {
|
|
227
227
|
"json-schema": "^0.4.0"
|
|
228
228
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"../..": {
|
|
23
23
|
"name": "prostgles-server",
|
|
24
|
-
"version": "4.1.
|
|
24
|
+
"version": "4.1.110",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@types/express": "^4.17.13",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"check-disk-space": "^3.3.1",
|
|
31
31
|
"file-type": "^18.5.0",
|
|
32
32
|
"pg-promise": "^11.3.0",
|
|
33
|
-
"prostgles-types": "^4.0.
|
|
33
|
+
"prostgles-types": "^4.0.49"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/bluebird": "^3.5.36",
|
|
@@ -1523,7 +1523,7 @@
|
|
|
1523
1523
|
"eslint": "^8.51.0",
|
|
1524
1524
|
"file-type": "^18.5.0",
|
|
1525
1525
|
"pg-promise": "^11.3.0",
|
|
1526
|
-
"prostgles-types": "^4.0.
|
|
1526
|
+
"prostgles-types": "^4.0.49",
|
|
1527
1527
|
"typescript": "^5.2.2"
|
|
1528
1528
|
}
|
|
1529
1529
|
},
|