prostgles-server 3.0.87 → 3.0.89
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/.eslintignore +5 -0
- package/.eslintrc.json +30 -0
- package/dist/DBEventsManager.js +1 -1
- package/dist/DBEventsManager.js.map +1 -1
- package/dist/DBSchemaBuilder.d.ts.map +1 -1
- package/dist/DBSchemaBuilder.js +6 -6
- package/dist/DBSchemaBuilder.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/Functions.js +9 -9
- package/dist/DboBuilder/QueryBuilder/Functions.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/QueryBuilder.d.ts.map +1 -1
- package/dist/DboBuilder/QueryBuilder/QueryBuilder.js +8 -7
- package/dist/DboBuilder/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/makeSelectQuery.d.ts.map +1 -1
- package/dist/DboBuilder/QueryBuilder/makeSelectQuery.js +4 -4
- package/dist/DboBuilder/QueryBuilder/makeSelectQuery.js.map +1 -1
- package/dist/DboBuilder/TableHandler.d.ts.map +1 -1
- package/dist/DboBuilder/TableHandler.js +18 -20
- package/dist/DboBuilder/TableHandler.js.map +1 -1
- package/dist/DboBuilder/ViewHandler.d.ts +0 -10
- package/dist/DboBuilder/ViewHandler.d.ts.map +1 -1
- package/dist/DboBuilder/ViewHandler.js +50 -63
- package/dist/DboBuilder/ViewHandler.js.map +1 -1
- package/dist/DboBuilder/delete.js +0 -1
- package/dist/DboBuilder/delete.js.map +1 -1
- package/dist/DboBuilder/getColumns.js +5 -4
- package/dist/DboBuilder/getColumns.js.map +1 -1
- package/dist/DboBuilder/getCondition.d.ts.map +1 -1
- package/dist/DboBuilder/getCondition.js +6 -6
- package/dist/DboBuilder/getCondition.js.map +1 -1
- package/dist/DboBuilder/insert.js +15 -16
- package/dist/DboBuilder/insert.js.map +1 -1
- package/dist/DboBuilder/insertDataParse.d.ts.map +1 -1
- package/dist/DboBuilder/insertDataParse.js +9 -10
- package/dist/DboBuilder/insertDataParse.js.map +1 -1
- package/dist/DboBuilder/parseUpdateRules.js +2 -2
- package/dist/DboBuilder/parseUpdateRules.js.map +1 -1
- package/dist/DboBuilder/runSQL.d.ts.map +1 -1
- package/dist/DboBuilder/runSQL.js +5 -5
- package/dist/DboBuilder/runSQL.js.map +1 -1
- package/dist/DboBuilder/subscribe.js +3 -3
- package/dist/DboBuilder/subscribe.js.map +1 -1
- package/dist/DboBuilder/update.js +5 -6
- package/dist/DboBuilder/update.js.map +1 -1
- package/dist/DboBuilder/uploadFile.d.ts.map +1 -1
- package/dist/DboBuilder/uploadFile.js +1 -1
- package/dist/DboBuilder/uploadFile.js.map +1 -1
- package/dist/DboBuilder.d.ts.map +1 -1
- package/dist/DboBuilder.js +13 -14
- package/dist/DboBuilder.js.map +1 -1
- package/dist/FileManager.d.ts.map +1 -1
- package/dist/FileManager.js +3 -5
- package/dist/FileManager.js.map +1 -1
- package/dist/Filtering.js +7 -7
- package/dist/Filtering.js.map +1 -1
- package/dist/JSONBValidation/validate_jsonb_schema_sql.d.ts +3 -0
- package/dist/JSONBValidation/validate_jsonb_schema_sql.d.ts.map +1 -0
- package/dist/JSONBValidation/validate_jsonb_schema_sql.js +295 -0
- package/dist/JSONBValidation/validate_jsonb_schema_sql.js.map +1 -0
- package/dist/JSONBValidation/validation.d.ts +108 -0
- package/dist/JSONBValidation/validation.d.ts.map +1 -0
- package/dist/JSONBValidation/validation.js +222 -0
- package/dist/JSONBValidation/validation.js.map +1 -0
- package/dist/PostgresNotifListenManager.js +1 -1
- package/dist/PostgresNotifListenManager.js.map +1 -1
- package/dist/Prostgles.d.ts.map +1 -1
- package/dist/Prostgles.js +20 -20
- package/dist/Prostgles.js.map +1 -1
- package/dist/PubSubManager/initPubSubManager.d.ts.map +1 -1
- package/dist/PubSubManager/initPubSubManager.js +10 -7
- package/dist/PubSubManager/initPubSubManager.js.map +1 -1
- package/dist/PublishParser.d.ts.map +1 -1
- package/dist/PublishParser.js +122 -125
- package/dist/PublishParser.js.map +1 -1
- package/dist/SyncReplication.d.ts.map +1 -1
- package/dist/SyncReplication.js +19 -16
- package/dist/SyncReplication.js.map +1 -1
- package/dist/TableConfig.d.ts +9 -5
- package/dist/TableConfig.d.ts.map +1 -1
- package/dist/TableConfig.js +33 -12
- package/dist/TableConfig.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/shortestPath.js +11 -11
- package/dist/shortestPath.js.map +1 -1
- package/dist/validation.d.ts +50 -24
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +177 -53
- package/dist/validation.js.map +1 -1
- package/lib/AuthHandler.d.ts +11 -11
- package/lib/AuthHandler.d.ts.map +1 -1
- package/lib/DBEventsManager.js +1 -1
- package/lib/DBEventsManager.ts +1 -1
- package/lib/DBSchemaBuilder.d.ts +3 -3
- package/lib/DBSchemaBuilder.d.ts.map +1 -1
- package/lib/DBSchemaBuilder.js +6 -6
- package/lib/DBSchemaBuilder.ts +10 -12
- package/lib/DboBuilder/QueryBuilder/Functions.d.ts +3 -3
- package/lib/DboBuilder/QueryBuilder/Functions.d.ts.map +1 -1
- package/lib/DboBuilder/QueryBuilder/Functions.js +9 -9
- package/lib/DboBuilder/QueryBuilder/Functions.ts +13 -13
- package/lib/DboBuilder/QueryBuilder/QueryBuilder.d.ts +3 -3
- package/lib/DboBuilder/QueryBuilder/QueryBuilder.d.ts.map +1 -1
- package/lib/DboBuilder/QueryBuilder/QueryBuilder.js +8 -7
- package/lib/DboBuilder/QueryBuilder/QueryBuilder.ts +12 -12
- package/lib/DboBuilder/QueryBuilder/makeSelectQuery.d.ts.map +1 -1
- package/lib/DboBuilder/QueryBuilder/makeSelectQuery.js +4 -4
- package/lib/DboBuilder/QueryBuilder/makeSelectQuery.ts +5 -5
- package/lib/DboBuilder/TableHandler.d.ts +1 -1
- package/lib/DboBuilder/TableHandler.d.ts.map +1 -1
- package/lib/DboBuilder/TableHandler.js +18 -20
- package/lib/DboBuilder/TableHandler.ts +21 -20
- package/lib/DboBuilder/ViewHandler.d.ts +1 -11
- package/lib/DboBuilder/ViewHandler.d.ts.map +1 -1
- package/lib/DboBuilder/ViewHandler.js +50 -63
- package/lib/DboBuilder/ViewHandler.ts +68 -97
- package/lib/DboBuilder/delete.js +0 -1
- package/lib/DboBuilder/delete.ts +1 -1
- package/lib/DboBuilder/getColumns.js +5 -4
- package/lib/DboBuilder/getColumns.ts +5 -5
- package/lib/DboBuilder/getCondition.d.ts.map +1 -1
- package/lib/DboBuilder/getCondition.js +6 -6
- package/lib/DboBuilder/getCondition.ts +7 -7
- package/lib/DboBuilder/insert.js +15 -16
- package/lib/DboBuilder/insert.ts +18 -18
- package/lib/DboBuilder/insertDataParse.d.ts.map +1 -1
- package/lib/DboBuilder/insertDataParse.js +9 -10
- package/lib/DboBuilder/insertDataParse.ts +42 -43
- package/lib/DboBuilder/parseUpdateRules.js +2 -2
- package/lib/DboBuilder/parseUpdateRules.ts +2 -2
- package/lib/DboBuilder/runSQL.d.ts.map +1 -1
- package/lib/DboBuilder/runSQL.js +5 -5
- package/lib/DboBuilder/runSQL.ts +6 -6
- package/lib/DboBuilder/subscribe.d.ts +1 -1
- package/lib/DboBuilder/subscribe.d.ts.map +1 -1
- package/lib/DboBuilder/subscribe.js +3 -3
- package/lib/DboBuilder/subscribe.ts +3 -3
- package/lib/DboBuilder/update.js +5 -6
- package/lib/DboBuilder/update.ts +6 -6
- package/lib/DboBuilder/uploadFile.d.ts.map +1 -1
- package/lib/DboBuilder/uploadFile.js +1 -1
- package/lib/DboBuilder/uploadFile.ts +2 -2
- package/lib/DboBuilder.d.ts +22 -22
- package/lib/DboBuilder.d.ts.map +1 -1
- package/lib/DboBuilder.js +13 -14
- package/lib/DboBuilder.ts +19 -19
- package/lib/FileManager.d.ts +6 -6
- package/lib/FileManager.d.ts.map +1 -1
- package/lib/FileManager.js +3 -5
- package/lib/FileManager.ts +7 -6
- package/lib/Filtering.d.ts +1 -1
- package/lib/Filtering.d.ts.map +1 -1
- package/lib/Filtering.js +7 -7
- package/lib/Filtering.ts +7 -7
- package/lib/JSONBValidation/validate_jsonb_schema_sql.d.ts +3 -0
- package/lib/JSONBValidation/validate_jsonb_schema_sql.d.ts.map +1 -0
- package/lib/JSONBValidation/validate_jsonb_schema_sql.js +294 -0
- package/lib/JSONBValidation/validate_jsonb_schema_sql.ts +293 -0
- package/lib/JSONBValidation/validation.d.ts +108 -0
- package/lib/JSONBValidation/validation.d.ts.map +1 -0
- package/lib/JSONBValidation/validation.js +221 -0
- package/lib/JSONBValidation/validation.ts +332 -0
- package/lib/PostgresNotifListenManager.d.ts +1 -1
- package/lib/PostgresNotifListenManager.d.ts.map +1 -1
- package/lib/PostgresNotifListenManager.js +1 -1
- package/lib/PostgresNotifListenManager.ts +1 -1
- package/lib/Prostgles.d.ts +14 -14
- package/lib/Prostgles.d.ts.map +1 -1
- package/lib/Prostgles.js +20 -20
- package/lib/Prostgles.ts +22 -21
- package/lib/PubSubManager/PubSubManager.d.ts +7 -7
- package/lib/PubSubManager/PubSubManager.d.ts.map +1 -1
- package/lib/PubSubManager/initPubSubManager.d.ts.map +1 -1
- package/lib/PubSubManager/initPubSubManager.js +10 -7
- package/lib/PubSubManager/initPubSubManager.ts +12 -7
- package/lib/PublishParser.d.ts +32 -32
- package/lib/PublishParser.d.ts.map +1 -1
- package/lib/PublishParser.js +121 -124
- package/lib/PublishParser.ts +125 -127
- package/lib/SchemaWatch.d.ts +1 -1
- package/lib/SchemaWatch.d.ts.map +1 -1
- package/lib/SyncReplication.d.ts +5 -5
- package/lib/SyncReplication.d.ts.map +1 -1
- package/lib/SyncReplication.js +19 -16
- package/lib/SyncReplication.ts +470 -471
- package/lib/TableConfig.d.ts +28 -24
- package/lib/TableConfig.d.ts.map +1 -1
- package/lib/TableConfig.js +33 -12
- package/lib/TableConfig.ts +55 -21
- package/lib/index.js +1 -1
- package/lib/index.ts +1 -1
- package/lib/shortestPath.d.ts +1 -1
- package/lib/shortestPath.d.ts.map +1 -1
- package/lib/shortestPath.js +11 -11
- package/lib/shortestPath.ts +11 -11
- package/package.json +10 -6
- package/tests/client/PID.txt +1 -1
- package/tests/client/package-lock.json +53 -31
- package/tests/client/package.json +4 -1
- package/tests/isomorphic_queries.d.ts +4 -1
- package/tests/isomorphic_queries.d.ts.map +1 -1
- package/tests/isomorphic_queries.js +38 -30
- package/tests/isomorphic_queries.ts +40 -33
- package/tests/server/DBoGenerated.d.ts +1 -1
- package/tests/server/index.js +8 -7
- package/tests/server/index.ts +10 -8
- package/tests/server/package-lock.json +76 -58
- package/tests/server/package.json +2 -2
- package/tests/server/server.ts +2 -3
- package/lib/validation.d.ts +0 -100
- package/lib/validation.d.ts.map +0 -1
- package/lib/validation.js +0 -280
- package/lib/validation.ts +0 -360
package/lib/DboBuilder/update.js
CHANGED
|
@@ -17,7 +17,7 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
17
17
|
}
|
|
18
18
|
let newData = _newData;
|
|
19
19
|
if (this.is_media && (0, uploadFile_1.isFile)(newData) && (!tableRules || tableRules.update)) {
|
|
20
|
-
|
|
20
|
+
const existingMediaId = !(!filter || !(0, prostgles_types_1.isObject)(filter) || (0, prostgles_types_1.getKeys)(filter).join() !== "id" || typeof filter.id !== "string") ? filter.id : undefined;
|
|
21
21
|
if (!existingMediaId) {
|
|
22
22
|
throw new Error(`Updating the file table with file data can only be done by providing a single id filter. E.g. { id: "9ea4e23c-2b1a-4e33-8ec0-c15919bb45ec"} `);
|
|
23
23
|
}
|
|
@@ -31,7 +31,7 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
31
31
|
const validate = tableRules?.[ACTION]?.validate ? async (row) => {
|
|
32
32
|
return tableRules?.[ACTION]?.validate({ update: row, filter }, this.dbTX || this.dboBuilder.dbo);
|
|
33
33
|
} : undefined;
|
|
34
|
-
|
|
34
|
+
const existingFile = await (localParams?.tx?.dbTX?.[this.name] || this).findOne({ id: existingMediaId });
|
|
35
35
|
if (!existingFile?.name)
|
|
36
36
|
throw new Error("Existing file record not found");
|
|
37
37
|
// oldFileDelete = () => fileManager.deleteFile(existingFile!.name!)
|
|
@@ -58,7 +58,7 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
58
58
|
}
|
|
59
59
|
const { data, allowedCols } = this.validateNewData({ row: newData, forcedData, allowedFields: fields, tableRules, fixIssues });
|
|
60
60
|
/* Patch data */
|
|
61
|
-
|
|
61
|
+
const patchedTextData = [];
|
|
62
62
|
this.columns.map(c => {
|
|
63
63
|
const d = data[c.name];
|
|
64
64
|
if (c.data_type === "text" && d && (0, DboBuilder_1.isPlainObject)(d) && !["from", "to"].find(key => typeof d[key] !== "number")) {
|
|
@@ -81,7 +81,7 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
81
81
|
// https://w3resource.com/PostgreSQL/overlay-function.p hp
|
|
82
82
|
// overlay(coalesce(status, '') placing 'hom' from 2 for 0)
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
const nData = { ...data };
|
|
85
85
|
let query = await this.colSet.getUpdateQuery(nData, allowedCols, this.dbTX || this.dboBuilder.dbo, validateRow);
|
|
86
86
|
query += (await this.prepareWhere({
|
|
87
87
|
filter,
|
|
@@ -94,7 +94,7 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
94
94
|
query += " ON CONFLICT DO NOTHING ";
|
|
95
95
|
/** postValidate */
|
|
96
96
|
const originalReturning = await this.prepareReturning(returning, this.parseFieldFilter(returningFields));
|
|
97
|
-
|
|
97
|
+
const fullReturning = await this.prepareReturning(returning, this.parseFieldFilter("*"));
|
|
98
98
|
/** Used for postValidate. Add any missing computed returning from original query */
|
|
99
99
|
fullReturning.concat(originalReturning.filter(s => !fullReturning.some(f => f.alias === s.alias)));
|
|
100
100
|
const finalSelect = tableRules?.insert?.postValidate ? fullReturning : originalReturning;
|
|
@@ -143,4 +143,3 @@ async function update(filter, _newData, params, tableRules, localParams) {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
exports.update = update;
|
|
146
|
-
;
|
package/lib/DboBuilder/update.ts
CHANGED
|
@@ -19,7 +19,7 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
19
19
|
|
|
20
20
|
let newData = _newData;
|
|
21
21
|
if(this.is_media && isFile(newData) && (!tableRules || tableRules.update)){
|
|
22
|
-
|
|
22
|
+
const existingMediaId: string = !(!filter || !isObject(filter) || getKeys(filter).join() !== "id" || typeof (filter as any).id !== "string")? (filter as any).id : undefined
|
|
23
23
|
if(!existingMediaId){
|
|
24
24
|
throw new Error(`Updating the file table with file data can only be done by providing a single id filter. E.g. { id: "9ea4e23c-2b1a-4e33-8ec0-c15919bb45ec"} `);
|
|
25
25
|
}
|
|
@@ -32,7 +32,7 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
32
32
|
return tableRules?.[ACTION]?.validate!({ update: row, filter }, this.dbTX || this.dboBuilder.dbo)
|
|
33
33
|
} : undefined;
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const existingFile: Media | undefined = await (localParams?.tx?.dbTX?.[this.name] as TableHandler || this).findOne({ id: existingMediaId });
|
|
36
36
|
|
|
37
37
|
if(!existingFile?.name) throw new Error("Existing file record not found");
|
|
38
38
|
|
|
@@ -66,7 +66,7 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
66
66
|
const { data, allowedCols } = this.validateNewData({ row: newData, forcedData, allowedFields: fields, tableRules, fixIssues });
|
|
67
67
|
|
|
68
68
|
/* Patch data */
|
|
69
|
-
|
|
69
|
+
const patchedTextData: {
|
|
70
70
|
fieldName: string;
|
|
71
71
|
from: number;
|
|
72
72
|
to: number;
|
|
@@ -97,7 +97,7 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
97
97
|
// overlay(coalesce(status, '') placing 'hom' from 2 for 0)
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
const nData = { ...data };
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
let query = await this.colSet.getUpdateQuery(nData, allowedCols, this.dbTX || this.dboBuilder.dbo, validateRow)
|
|
@@ -113,7 +113,7 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
113
113
|
|
|
114
114
|
/** postValidate */
|
|
115
115
|
const originalReturning = await this.prepareReturning(returning, this.parseFieldFilter(returningFields))
|
|
116
|
-
|
|
116
|
+
const fullReturning = await this.prepareReturning(returning, this.parseFieldFilter("*"));
|
|
117
117
|
/** Used for postValidate. Add any missing computed returning from original query */
|
|
118
118
|
fullReturning.concat(originalReturning.filter(s => !fullReturning.some(f => f.alias === s.alias)));
|
|
119
119
|
const finalSelect = tableRules?.insert?.postValidate? fullReturning : originalReturning;
|
|
@@ -164,4 +164,4 @@ export async function update(this: TableHandler, filter: Filter, _newData: AnyOb
|
|
|
164
164
|
if (localParams && localParams.testRule) throw e;
|
|
165
165
|
throw parseError(e, `dbo.${this.name}.${ACTION}(${JSON.stringify(filter || {}, null, 2)}, ${Array.isArray(_newData)? "[{...}]": "{...}"}, ${JSON.stringify(params || {}, null, 2)})`)
|
|
166
166
|
}
|
|
167
|
-
}
|
|
167
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["uploadFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["uploadFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,MAAM,QAAS,SAAS,YAEpC,CAAA;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CA+C9K"}
|
|
@@ -17,7 +17,7 @@ async function uploadFile(row, validate, localParams, mediaId) {
|
|
|
17
17
|
const type = await this.dboBuilder.prostgles.fileManager.parseFile({ file: data, fileName: name, tableName: nestedInsert?.previousTable, colName: nestedInsert?.referencingColumn });
|
|
18
18
|
const media_name = `${media_id}.${type.ext}`;
|
|
19
19
|
const parsedMediaKeys = ["id", "name", "original_name", "extension", "content_type"];
|
|
20
|
-
|
|
20
|
+
const media = {
|
|
21
21
|
id: media_id,
|
|
22
22
|
name: media_name,
|
|
23
23
|
original_name: name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyObject, getKeys, isObject } from "prostgles-types"
|
|
2
2
|
import { LocalParams, Media } from "../DboBuilder";
|
|
3
|
-
import { ValidateRow
|
|
3
|
+
import { ValidateRow } from "../PublishParser";
|
|
4
4
|
import { TableHandler } from "./TableHandler";
|
|
5
5
|
|
|
6
6
|
export const isFile = (row: AnyObject) => {
|
|
@@ -18,7 +18,7 @@ export async function uploadFile(this: TableHandler, row: AnyObject, validate: V
|
|
|
18
18
|
const type = await this.dboBuilder.prostgles.fileManager.parseFile({ file: data, fileName: name, tableName: nestedInsert?.previousTable, colName: nestedInsert?.referencingColumn });
|
|
19
19
|
const media_name = `${media_id}.${type.ext}`;
|
|
20
20
|
const parsedMediaKeys = ["id", "name", "original_name", "extension", "content_type"] as const
|
|
21
|
-
|
|
21
|
+
const media: Required<Pick<Media, typeof parsedMediaKeys[number]>> = {
|
|
22
22
|
id: media_id,
|
|
23
23
|
name: media_name,
|
|
24
24
|
original_name: name,
|
package/lib/DboBuilder.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as pgPromise from 'pg-promise';
|
|
2
2
|
import pg = require('pg-promise/typescript/pg-subset');
|
|
3
3
|
import { ColumnInfo, SQLOptions, DbJoinMaker, PG_COLUMN_UDT_DATA_TYPE, TS_PG_Types, TableInfo as TInfo, SQLHandler, AnyObject, ProstglesError, EXISTS_KEY } from "prostgles-types";
|
|
4
|
-
export
|
|
4
|
+
export type SortItem = {
|
|
5
5
|
asc: boolean;
|
|
6
6
|
nulls?: "first" | "last";
|
|
7
7
|
nullEmpty?: boolean;
|
|
@@ -10,8 +10,8 @@ export declare type SortItem = {
|
|
|
10
10
|
} | {
|
|
11
11
|
fieldPosition: number;
|
|
12
12
|
});
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type ParsedMedia = Required<Pick<Media, "extension" | "content_type">>;
|
|
14
|
+
export type Media = {
|
|
15
15
|
"id"?: string;
|
|
16
16
|
"title"?: string;
|
|
17
17
|
"extension"?: string;
|
|
@@ -27,16 +27,16 @@ export declare type Media = {
|
|
|
27
27
|
deleted?: string | null;
|
|
28
28
|
deleted_from_storage?: string | null;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export type TxCB<TH = TableHandlers> = {
|
|
31
31
|
(t: TH & Pick<DBHandlerServer, "sql">, _t: pgPromise.ITask<{}>): (any | void);
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type TX<TH = TableHandlers> = {
|
|
34
34
|
(t: TxCB<TH>): Promise<(any | void)>;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type TableHandlers = {
|
|
37
37
|
[key: string]: Partial<TableHandler> | TableHandler;
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type DBHandlerServer<TH = TableHandlers> = TH & Partial<DbJoinMaker> & {
|
|
40
40
|
sql?: SQLHandler;
|
|
41
41
|
} & {
|
|
42
42
|
tx?: TX<TH>;
|
|
@@ -46,22 +46,22 @@ import { Join, Prostgles, DB } from "./Prostgles";
|
|
|
46
46
|
import { PublishParser, PublishAllOrNothing } from "./PublishParser";
|
|
47
47
|
import { PubSubManager, BasicCallback } from "./PubSubManager/PubSubManager";
|
|
48
48
|
import { JoinPaths, ViewHandler } from "./DboBuilder/ViewHandler";
|
|
49
|
-
|
|
49
|
+
type PGP = pgPromise.IMain<{}, pg.IClient>;
|
|
50
50
|
export declare const pgp: PGP;
|
|
51
|
-
export
|
|
51
|
+
export type TableInfo = TInfo & {
|
|
52
52
|
schema: string;
|
|
53
53
|
name: string;
|
|
54
54
|
oid: number;
|
|
55
55
|
comment: string;
|
|
56
56
|
columns: ColumnInfo[];
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type ViewInfo = TableInfo & {
|
|
59
59
|
parent_tables: string[];
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type TableOrViewInfo = TableInfo & ViewInfo & {
|
|
62
62
|
is_view: boolean;
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type PRGLIOSocket = {
|
|
65
65
|
readonly id: string;
|
|
66
66
|
readonly handshake?: {
|
|
67
67
|
query?: Record<string, string>;
|
|
@@ -88,7 +88,7 @@ export declare type PRGLIOSocket = {
|
|
|
88
88
|
/** Used for publish error caching */
|
|
89
89
|
prostgles?: AnyObject;
|
|
90
90
|
};
|
|
91
|
-
export
|
|
91
|
+
export type LocalParams = {
|
|
92
92
|
httpReq?: any;
|
|
93
93
|
socket?: PRGLIOSocket;
|
|
94
94
|
func?: () => any;
|
|
@@ -108,18 +108,18 @@ export declare type LocalParams = {
|
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
110
|
export declare function escapeTSNames(str: string, capitalize?: boolean): string;
|
|
111
|
-
export
|
|
111
|
+
export type Aggregation = {
|
|
112
112
|
field: string;
|
|
113
113
|
query: string;
|
|
114
114
|
alias: string;
|
|
115
115
|
getQuery: (alias: string) => string;
|
|
116
116
|
};
|
|
117
|
-
export
|
|
117
|
+
export type Filter = AnyObject | {
|
|
118
118
|
$and: Filter[];
|
|
119
119
|
} | {
|
|
120
120
|
$or: Filter[];
|
|
121
121
|
};
|
|
122
|
-
export
|
|
122
|
+
export type JoinInfo = {
|
|
123
123
|
expectOne?: boolean;
|
|
124
124
|
paths: {
|
|
125
125
|
/**
|
|
@@ -144,7 +144,7 @@ export declare type JoinInfo = {
|
|
|
144
144
|
}[];
|
|
145
145
|
};
|
|
146
146
|
import { Graph } from "./shortestPath";
|
|
147
|
-
export
|
|
147
|
+
export type CommonTableRules = {
|
|
148
148
|
/**
|
|
149
149
|
* True by default. Allows clients to get column information on any columns that are allowed in (select, insert, update) field rules.
|
|
150
150
|
*/
|
|
@@ -154,7 +154,7 @@ export declare type CommonTableRules = {
|
|
|
154
154
|
*/
|
|
155
155
|
getInfo?: PublishAllOrNothing;
|
|
156
156
|
};
|
|
157
|
-
export
|
|
157
|
+
export type ValidatedTableRules = CommonTableRules & {
|
|
158
158
|
allColumns: FieldSpec[];
|
|
159
159
|
select: {
|
|
160
160
|
fields: string[];
|
|
@@ -186,7 +186,7 @@ export declare function makeErrorFromPGError(err: any, localParams?: LocalParams
|
|
|
186
186
|
* Ensure the error is an Object and has
|
|
187
187
|
*/
|
|
188
188
|
export declare function parseError(e: any, caller: string): ProstglesError;
|
|
189
|
-
export
|
|
189
|
+
export type ExistsFilterConfig = {
|
|
190
190
|
key: string;
|
|
191
191
|
f2: Filter;
|
|
192
192
|
existType: EXISTS_KEY;
|
|
@@ -254,13 +254,13 @@ export declare class DboBuilder {
|
|
|
254
254
|
build(): Promise<DBHandlerServer>;
|
|
255
255
|
getTX: (cb: TxCB) => Promise<any>;
|
|
256
256
|
}
|
|
257
|
-
export
|
|
257
|
+
export type TableSchemaColumn = ColumnInfo & {
|
|
258
258
|
privileges: {
|
|
259
259
|
privilege_type: "INSERT" | "REFERENCES" | "SELECT" | "UPDATE";
|
|
260
260
|
is_grantable: "YES" | "NO";
|
|
261
261
|
}[];
|
|
262
262
|
};
|
|
263
|
-
export
|
|
263
|
+
export type TableSchema = {
|
|
264
264
|
schema: string;
|
|
265
265
|
name: string;
|
|
266
266
|
oid: number;
|
|
@@ -276,7 +276,7 @@ export declare type TableSchema = {
|
|
|
276
276
|
delete: boolean;
|
|
277
277
|
};
|
|
278
278
|
};
|
|
279
|
-
|
|
279
|
+
type PGConstraint = {
|
|
280
280
|
/**
|
|
281
281
|
* Constraint type
|
|
282
282
|
*/
|
package/lib/DboBuilder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DboBuilder.d.ts","sourceRoot":"","sources":["DboBuilder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,GAAG,QAAQ,iCAAiC,CAAC,CAAC;AACvD,OAAO,EACL,UAAU,EAAE,UAAU,EACtB,WAAW,EACX,uBAAuB,EACvB,WAAW,EACX,SAAS,IAAI,KAAK,EAClB,UAAU,EACV,SAAS,EAIqB,cAAc,EAAiB,UAAU,EACxE,MAAM,iBAAiB,CAAC;AAEzB,
|
|
1
|
+
{"version":3,"file":"DboBuilder.d.ts","sourceRoot":"","sources":["DboBuilder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,GAAG,QAAQ,iCAAiC,CAAC,CAAC;AACvD,OAAO,EACL,UAAU,EAAE,UAAU,EACtB,WAAW,EACX,uBAAuB,EACvB,WAAW,EACX,SAAS,IAAI,KAAK,EAClB,UAAU,EACV,SAAS,EAIqB,cAAc,EAAiB,UAAU,EACxE,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,SAAS,CAA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AAC;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE;QACV,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;KACjB,CAAA;CACF,CAAA;AAED,KAAK,YAAY,GAAG;IAElB;;OAEG;IACH,OAAO,EACL,GAAG,GACH,GAAG,GACH,GAAG,CAAA;IAEL;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA6NF,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,GAAG,MAAM,OAAO,WAAW,CAKjG;AAiTD,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,6BAAyB,MASrE,CAAA;AAED,eAAO,MAAM,UAAU,8BAUtB,CAAA"}
|
package/lib/DboBuilder.js
CHANGED
|
@@ -154,7 +154,7 @@ class DboBuilder {
|
|
|
154
154
|
getPubSubManager = async () => {
|
|
155
155
|
if (!this._pubSubManager) {
|
|
156
156
|
let onSchemaChange;
|
|
157
|
-
const {
|
|
157
|
+
const { isSuperUs } = await PubSubManager_1.PubSubManager.canCreate(this.db);
|
|
158
158
|
if (!exports.canEXECUTE)
|
|
159
159
|
throw "PubSubManager based subscriptions not possible: Cannot run EXECUTE statements on this connection";
|
|
160
160
|
if (this.prostgles.opts.watchSchema && this.prostgles.opts.watchSchemaType === "DDL_trigger") {
|
|
@@ -205,7 +205,7 @@ class DboBuilder {
|
|
|
205
205
|
return this;
|
|
206
206
|
};
|
|
207
207
|
static create = async (prostgles) => {
|
|
208
|
-
|
|
208
|
+
const res = new DboBuilder(prostgles);
|
|
209
209
|
return await res.init();
|
|
210
210
|
};
|
|
211
211
|
destroy() {
|
|
@@ -214,7 +214,6 @@ class DboBuilder {
|
|
|
214
214
|
_joins;
|
|
215
215
|
get joins() {
|
|
216
216
|
return (0, utils_1.clone)(this._joins ?? []).filter(j => j.tables[0] !== j.tables[1]);
|
|
217
|
-
;
|
|
218
217
|
}
|
|
219
218
|
set joins(j) {
|
|
220
219
|
this._joins = (0, utils_1.clone)(j);
|
|
@@ -227,7 +226,7 @@ class DboBuilder {
|
|
|
227
226
|
let _joins = await this.prostgles.opts.joins;
|
|
228
227
|
if (!this.tablesOrViews)
|
|
229
228
|
throw new Error("Could not create join config. this.tablesOrViews missing");
|
|
230
|
-
|
|
229
|
+
const inferredJoins = await getInferredJoins2(this.tablesOrViews);
|
|
231
230
|
if (_joins === "inferred") {
|
|
232
231
|
_joins = inferredJoins;
|
|
233
232
|
/* If joins are specified then include inferred joins except the explicit tables */
|
|
@@ -239,7 +238,7 @@ class DboBuilder {
|
|
|
239
238
|
else if (_joins) {
|
|
240
239
|
throw new Error("Unexpected joins init param. Expecting 'inferred' OR joinConfig but got: " + JSON.stringify(_joins));
|
|
241
240
|
}
|
|
242
|
-
|
|
241
|
+
const joins = JSON.parse(JSON.stringify(_joins));
|
|
243
242
|
this.joins = joins;
|
|
244
243
|
// Validate joins
|
|
245
244
|
try {
|
|
@@ -255,8 +254,8 @@ class DboBuilder {
|
|
|
255
254
|
on.map(cond => {
|
|
256
255
|
const f1s = Object.keys(cond), f2s = Object.values(cond);
|
|
257
256
|
[[t1, f1s], [t2, f2s]].map(v => {
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
const t = v[0], f = v[1];
|
|
258
|
+
const tov = this.tablesOrViews.find(_t => _t.name === t);
|
|
260
259
|
if (!tov)
|
|
261
260
|
throw "Table not found: " + t;
|
|
262
261
|
const m1 = f.filter(k => !tov.columns.map(c => c.name).includes(k));
|
|
@@ -281,7 +280,7 @@ class DboBuilder {
|
|
|
281
280
|
// Make joins graph
|
|
282
281
|
this.joinGraph = {};
|
|
283
282
|
this.joins.forEach(({ tables }) => {
|
|
284
|
-
|
|
283
|
+
const _t = tables.slice().sort(), t1 = _t[0], t2 = _t[1];
|
|
285
284
|
if (t1 === t2)
|
|
286
285
|
return;
|
|
287
286
|
this.joinGraph[t1] ??= {};
|
|
@@ -340,7 +339,7 @@ class DboBuilder {
|
|
|
340
339
|
}
|
|
341
340
|
this.dbo[tov.name] = new (tov.is_view ? ViewHandler_1.ViewHandler : TableHandler_1.TableHandler)(this.db, tov, this, undefined, undefined, this.joinPaths);
|
|
342
341
|
if (this.joinPaths && this.joinPaths.find(jp => [jp.t1, jp.t2].includes(tov.name))) {
|
|
343
|
-
|
|
342
|
+
const table = tov.name;
|
|
344
343
|
const makeJoin = (isLeft = true, filter, select, options) => {
|
|
345
344
|
return {
|
|
346
345
|
[isLeft ? "$leftJoin" : "$innerJoin"]: table,
|
|
@@ -388,7 +387,7 @@ class DboBuilder {
|
|
|
388
387
|
}
|
|
389
388
|
getTX = (cb) => {
|
|
390
389
|
return this.db.tx((t) => {
|
|
391
|
-
|
|
390
|
+
const dbTX = {};
|
|
392
391
|
this.tablesOrViews?.map(tov => {
|
|
393
392
|
dbTX[tov.name] = new (tov.is_view ? ViewHandler_1.ViewHandler : TableHandler_1.TableHandler)(this.db, tov, this, t, dbTX, this.joinPaths);
|
|
394
393
|
});
|
|
@@ -878,10 +877,10 @@ const arrayValuesMatch = (arr1, arr2) => {
|
|
|
878
877
|
return arr1.slice().sort().join() === arr2.slice().sort().join();
|
|
879
878
|
};
|
|
880
879
|
async function getInferredJoins2(schema) {
|
|
881
|
-
|
|
880
|
+
const joins = [];
|
|
882
881
|
const upsertJoin = (t1, t2, cols, type) => {
|
|
883
|
-
|
|
884
|
-
|
|
882
|
+
const existingIdx = joins.findIndex(j => arrayValuesMatch(j.tables.slice(0), [t1, t2]));
|
|
883
|
+
const existing = joins[existingIdx];
|
|
885
884
|
const normalCond = cols.reduce((a, v) => ({ ...a, [v.col1]: v.col2 }), {});
|
|
886
885
|
const revertedCond = cols.reduce((a, v) => ({ ...a, [v.col2]: v.col1 }), {});
|
|
887
886
|
if (existing) {
|
|
@@ -926,7 +925,7 @@ const prepareSort = (items, excludeOrder = false) => {
|
|
|
926
925
|
return (excludeOrder ? "" : " ORDER BY ") + items.map(d => {
|
|
927
926
|
const orderType = d.asc ? " ASC " : " DESC ";
|
|
928
927
|
const nullOrder = d.nulls ? ` NULLS ${d.nulls === "first" ? " FIRST " : " LAST "}` : "";
|
|
929
|
-
|
|
928
|
+
const colKey = "fieldQuery" in d ? d.fieldQuery : d.fieldPosition;
|
|
930
929
|
return `${colKey} ${orderType} ${nullOrder}`;
|
|
931
930
|
}).join(", ");
|
|
932
931
|
};
|
package/lib/DboBuilder.ts
CHANGED
|
@@ -394,7 +394,7 @@ export type ExistsFilterConfig = {
|
|
|
394
394
|
|
|
395
395
|
import { JOIN_TYPES } from "./Prostgles";
|
|
396
396
|
import { BasicSession } from "./AuthHandler";
|
|
397
|
-
import {
|
|
397
|
+
import { getDBSchema } from "./DBSchemaBuilder";
|
|
398
398
|
import { TableHandler } from "./DboBuilder/TableHandler";
|
|
399
399
|
|
|
400
400
|
export class DboBuilder {
|
|
@@ -405,7 +405,7 @@ export class DboBuilder {
|
|
|
405
405
|
constraints?: PGConstraint[];
|
|
406
406
|
|
|
407
407
|
db: DB;
|
|
408
|
-
schema
|
|
408
|
+
schema = "public";
|
|
409
409
|
|
|
410
410
|
// dbo: DBHandlerServer | DBHandlerServerTX;
|
|
411
411
|
dbo: DBHandlerServer;
|
|
@@ -437,7 +437,7 @@ export class DboBuilder {
|
|
|
437
437
|
if (!this._pubSubManager) {
|
|
438
438
|
let onSchemaChange;
|
|
439
439
|
|
|
440
|
-
const {
|
|
440
|
+
const { isSuperUs } = await PubSubManager.canCreate(this.db);
|
|
441
441
|
if (!canEXECUTE) throw "PubSubManager based subscriptions not possible: Cannot run EXECUTE statements on this connection";
|
|
442
442
|
|
|
443
443
|
if (this.prostgles.opts.watchSchema && this.prostgles.opts.watchSchemaType === "DDL_trigger") {
|
|
@@ -502,7 +502,7 @@ export class DboBuilder {
|
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
public static create = async (prostgles: Prostgles): Promise<DboBuilder> => {
|
|
505
|
-
|
|
505
|
+
const res = new DboBuilder(prostgles)
|
|
506
506
|
return await res.init();
|
|
507
507
|
}
|
|
508
508
|
|
|
@@ -513,7 +513,7 @@ export class DboBuilder {
|
|
|
513
513
|
|
|
514
514
|
_joins?: Join[];
|
|
515
515
|
get joins(): Join[] {
|
|
516
|
-
return clone(this._joins ?? []).filter(j => j.tables[0] !== j.tables[1]) as Join[]
|
|
516
|
+
return clone(this._joins ?? []).filter(j => j.tables[0] !== j.tables[1]) as Join[];
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
set joins(j: Join[]) {
|
|
@@ -528,7 +528,7 @@ export class DboBuilder {
|
|
|
528
528
|
if (this.prostgles.opts.joins) {
|
|
529
529
|
let _joins = await this.prostgles.opts.joins;
|
|
530
530
|
if (!this.tablesOrViews) throw new Error("Could not create join config. this.tablesOrViews missing");
|
|
531
|
-
|
|
531
|
+
const inferredJoins = await getInferredJoins2(this.tablesOrViews);
|
|
532
532
|
if (_joins === "inferred") {
|
|
533
533
|
_joins = inferredJoins
|
|
534
534
|
/* If joins are specified then include inferred joins except the explicit tables */
|
|
@@ -538,7 +538,7 @@ export class DboBuilder {
|
|
|
538
538
|
} else if (_joins) {
|
|
539
539
|
throw new Error("Unexpected joins init param. Expecting 'inferred' OR joinConfig but got: " + JSON.stringify(_joins))
|
|
540
540
|
}
|
|
541
|
-
|
|
541
|
+
const joins = JSON.parse(JSON.stringify(_joins)) as Join[];
|
|
542
542
|
this.joins = joins;
|
|
543
543
|
|
|
544
544
|
// Validate joins
|
|
@@ -560,10 +560,10 @@ export class DboBuilder {
|
|
|
560
560
|
const f1s = Object.keys(cond),
|
|
561
561
|
f2s = Object.values(cond);
|
|
562
562
|
[[t1, f1s], [t2, f2s]].map(v => {
|
|
563
|
-
|
|
563
|
+
const t = <string>v[0],
|
|
564
564
|
f = <string[]>v[1];
|
|
565
565
|
|
|
566
|
-
|
|
566
|
+
const tov = this.tablesOrViews!.find(_t => _t.name === t);
|
|
567
567
|
if (!tov) throw "Table not found: " + t;
|
|
568
568
|
const m1 = f.filter(k => !tov!.columns.map(c => c.name).includes(k))
|
|
569
569
|
if (m1 && m1.length) {
|
|
@@ -588,7 +588,7 @@ export class DboBuilder {
|
|
|
588
588
|
// Make joins graph
|
|
589
589
|
this.joinGraph = {};
|
|
590
590
|
this.joins.forEach(({ tables }) => {
|
|
591
|
-
|
|
591
|
+
const _t = tables.slice().sort(),
|
|
592
592
|
t1 = _t[0],
|
|
593
593
|
t2 = _t[1];
|
|
594
594
|
|
|
@@ -666,7 +666,7 @@ export class DboBuilder {
|
|
|
666
666
|
|
|
667
667
|
if (this.joinPaths && this.joinPaths.find(jp => [jp.t1, jp.t2].includes(tov.name))) {
|
|
668
668
|
|
|
669
|
-
|
|
669
|
+
const table = tov.name;
|
|
670
670
|
|
|
671
671
|
const makeJoin = (
|
|
672
672
|
isLeft = true,
|
|
@@ -725,7 +725,7 @@ export class DboBuilder {
|
|
|
725
725
|
|
|
726
726
|
getTX = (cb: TxCB) => {
|
|
727
727
|
return this.db.tx((t) => {
|
|
728
|
-
|
|
728
|
+
const dbTX: TableHandlers & Pick<DBHandlerServer, "sql"> = {};
|
|
729
729
|
this.tablesOrViews?.map(tov => {
|
|
730
730
|
dbTX[tov.name] = new (tov.is_view ? ViewHandler : TableHandler)(this.db, tov, this, t, dbTX, this.joinPaths);
|
|
731
731
|
});
|
|
@@ -794,7 +794,7 @@ type PGConstraint = {
|
|
|
794
794
|
relname: string;
|
|
795
795
|
};
|
|
796
796
|
|
|
797
|
-
async function getConstraints(db: DB, schema
|
|
797
|
+
async function getConstraints(db: DB, schema = "public"): Promise<PGConstraint[]> {
|
|
798
798
|
return db.any(`
|
|
799
799
|
SELECT rel.relname, con.conkey, con.conname, con.contype
|
|
800
800
|
FROM pg_catalog.pg_constraint con
|
|
@@ -806,7 +806,7 @@ async function getConstraints(db: DB, schema: string = "public"): Promise<PGCons
|
|
|
806
806
|
`);
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
async function getTablesForSchemaPostgresSQL({ db, runSQL }: DboBuilder, schema
|
|
809
|
+
async function getTablesForSchemaPostgresSQL({ db, runSQL }: DboBuilder, schema = "public"): Promise<TableSchema[]> {
|
|
810
810
|
const query =
|
|
811
811
|
`
|
|
812
812
|
SELECT
|
|
@@ -1283,10 +1283,10 @@ const arrayValuesMatch = <T>(arr1: T[], arr2: T[]): boolean => {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
|
|
1285
1285
|
async function getInferredJoins2(schema: TableSchema[]): Promise<Join[]> {
|
|
1286
|
-
|
|
1286
|
+
const joins: Join[] = [];
|
|
1287
1287
|
const upsertJoin = (t1: string, t2: string, cols: { col1: string; col2: string }[], type: Join["type"]) => {
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
const existingIdx = joins.findIndex(j => arrayValuesMatch(j.tables.slice(0), [t1, t2]));
|
|
1289
|
+
const existing = joins[existingIdx];
|
|
1290
1290
|
const normalCond = cols.reduce((a, v) => ({ ...a, [v.col1]: v.col2 }), {});
|
|
1291
1291
|
const revertedCond = cols.reduce((a, v) => ({ ...a, [v.col2]: v.col1 }), {});
|
|
1292
1292
|
if (existing) {
|
|
@@ -1327,13 +1327,13 @@ async function getInferredJoins2(schema: TableSchema[]): Promise<Join[]> {
|
|
|
1327
1327
|
return joins;
|
|
1328
1328
|
}
|
|
1329
1329
|
|
|
1330
|
-
export const prepareSort = (items: SortItem[], excludeOrder
|
|
1330
|
+
export const prepareSort = (items: SortItem[], excludeOrder = false): string => {
|
|
1331
1331
|
if (!items.length) return "";
|
|
1332
1332
|
return (excludeOrder ? "" : " ORDER BY ") + items.map(d => {
|
|
1333
1333
|
|
|
1334
1334
|
const orderType = d.asc ? " ASC " : " DESC ";
|
|
1335
1335
|
const nullOrder = d.nulls ? ` NULLS ${d.nulls === "first" ? " FIRST " : " LAST "}` : "";
|
|
1336
|
-
|
|
1336
|
+
const colKey = "fieldQuery" in d ? d.fieldQuery : d.fieldPosition;
|
|
1337
1337
|
return `${colKey} ${orderType} ${nullOrder}`;
|
|
1338
1338
|
}).join(", ")
|
|
1339
1339
|
}
|
package/lib/FileManager.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import * as stream from 'stream';
|
|
|
5
5
|
import { DB, DBHandlerServer, ExpressApp, Prostgles } from './Prostgles';
|
|
6
6
|
import { ALLOWED_CONTENT_TYPE, ALLOWED_EXTENSION, ValidatedColumnInfo } from 'prostgles-types';
|
|
7
7
|
export declare const asSQLIdentifier: (name: string, db: DB) => Promise<string>;
|
|
8
|
-
|
|
9
|
-
export
|
|
8
|
+
type OnProgress = (progress: S3.ManagedUpload.Progress) => void;
|
|
9
|
+
export type ImageOptions = {
|
|
10
10
|
keepMetadata?: boolean;
|
|
11
11
|
compression?:
|
|
12
12
|
/**
|
|
@@ -25,13 +25,13 @@ export declare type ImageOptions = {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type S3Config = {
|
|
29
29
|
region: string;
|
|
30
30
|
bucket: string;
|
|
31
31
|
accessKeyId: string;
|
|
32
32
|
secretAccessKey: string;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type LocalConfig = {
|
|
35
35
|
/**
|
|
36
36
|
* example: path.join(__dirname+'/media')
|
|
37
37
|
* note that this location will be relative to the compiled file location
|
|
@@ -43,13 +43,13 @@ export declare type LocalConfig = {
|
|
|
43
43
|
*/
|
|
44
44
|
minFreeBytes?: number;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type UploadItem = {
|
|
47
47
|
name: string;
|
|
48
48
|
content_type: string;
|
|
49
49
|
data: Buffer;
|
|
50
50
|
extension: string;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type UploadedItem = {
|
|
53
53
|
/**
|
|
54
54
|
* Url that is passed to client
|
|
55
55
|
*/
|
package/lib/FileManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["FileManager.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAO,MAAM,SAAS,CAAC;AAIlC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAKjC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAA6D,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK1J,eAAO,MAAM,eAAe,SAAgB,MAAM,aAAW,QAAQ,MAAM,CAE1E,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["FileManager.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAO,MAAM,SAAS,CAAC;AAIlC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAKjC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAA6D,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK1J,eAAO,MAAM,eAAe,SAAgB,MAAM,aAAW,QAAQ,MAAM,CAE1E,CAAA;AAED,KAAK,UAAU,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,KAAK,IAAI,CAAA;AAE/D,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC;IACV;;OAEG;IACD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