@magda/org-tree 2.0.0-alpha.5 → 2.0.0-alpha.8

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.
@@ -18010,8 +18010,8 @@ function parseIntParam(p) {
18010
18010
  }
18011
18011
  exports.parseIntParam = parseIntParam;
18012
18012
  exports.MAX_PAGE_RECORD_NUMBER = 500;
18013
- function searchTableRecord(poolOrClient, table, contiditions = [], queryConfig) {
18014
- var _a, _b, _c;
18013
+ function searchTableRecord(poolOrClient, table, conditions = [], queryConfig) {
18014
+ var _a, _b, _c, _d;
18015
18015
  return __awaiter(this, void 0, void 0, function* () {
18016
18016
  if (!table.trim()) {
18017
18017
  throw new ServerError_1.default("invalid empty table name is supplied.");
@@ -18032,7 +18032,7 @@ function searchTableRecord(poolOrClient, table, contiditions = [], queryConfig)
18032
18032
  ]
18033
18033
  };
18034
18034
  const authConditions = authDecision.toSql(config);
18035
- const where = sql_syntax_1.default.where(sql_syntax_1.default.joinWithAnd([...contiditions, authConditions]));
18035
+ const where = sql_syntax_1.default.where(sql_syntax_1.default.joinWithAnd([...conditions, authConditions]));
18036
18036
  const sqlSyntax = sql_syntax_1.sqls `SELECT ${(queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.selectedFields) ? sql_syntax_1.default.csv(...queryConfig.selectedFields)
18037
18037
  : sql_syntax_1.sqls `*`}
18038
18038
  FROM ${escapeIdentifier(table)}
@@ -18043,11 +18043,15 @@ function searchTableRecord(poolOrClient, table, contiditions = [], queryConfig)
18043
18043
  ? sql_syntax_1.default.csv(...queryConfig.groupBy)
18044
18044
  : queryConfig.groupBy}`
18045
18045
  : sql_syntax_1.default.empty}
18046
+ ${(queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.orderBy) ? sql_syntax_1.sqls `ORDER BY ${typeof ((_c = queryConfig.orderBy) === null || _c === void 0 ? void 0 : _c.length) === "number"
18047
+ ? sql_syntax_1.default.csv(...queryConfig.orderBy)
18048
+ : queryConfig.orderBy}`
18049
+ : sql_syntax_1.default.empty}
18046
18050
  ${offset ? sql_syntax_1.sqls `OFFSET ${offset}` : sql_syntax_1.default.empty}
18047
18051
  ${limit ? sql_syntax_1.sqls `LIMIT ${limit}` : sql_syntax_1.default.empty}
18048
18052
  `;
18049
18053
  const result = yield poolOrClient.query(...sqlSyntax.toQuery());
18050
- if (!((_c = result === null || result === void 0 ? void 0 : result.rows) === null || _c === void 0 ? void 0 : _c.length)) {
18054
+ if (!((_d = result === null || result === void 0 ? void 0 : result.rows) === null || _d === void 0 ? void 0 : _d.length)) {
18051
18055
  return [];
18052
18056
  }
18053
18057
  else {
@@ -18072,9 +18076,9 @@ function getTableRecord(poolOrClient, table, id, authDecision = AuthDecision_1.U
18072
18076
  });
18073
18077
  }
18074
18078
  exports.getTableRecord = getTableRecord;
18075
- function countTableRecord(poolOrClient, table, contiditions = [], authDecision, objectKind, toSqlConfig) {
18079
+ function countTableRecord(poolOrClient, table, conditions = [], authDecision, objectKind, toSqlConfig) {
18076
18080
  return __awaiter(this, void 0, void 0, function* () {
18077
- const records = yield searchTableRecord(poolOrClient, table, contiditions, {
18081
+ const records = yield searchTableRecord(poolOrClient, table, conditions, {
18078
18082
  authDecision,
18079
18083
  objectKind,
18080
18084
  toSqlConfig,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magda/org-tree",
3
3
  "description": "MAGDA Organizational Hierarchy Management Utilities",
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.8",
5
5
  "bin": {
6
6
  "org-tree": "./bin/org-tree/org-tree.js"
7
7
  },
@@ -14,9 +14,9 @@
14
14
  "author": "",
15
15
  "license": "Apache-2.0",
16
16
  "devDependencies": {
17
- "@magda/authorization-api": "^2.0.0-alpha.5",
18
- "@magda/scripts": "^2.0.0-alpha.5",
19
- "@magda/typescript-common": "^2.0.0-alpha.5",
17
+ "@magda/authorization-api": "^2.0.0-alpha.8",
18
+ "@magda/scripts": "^2.0.0-alpha.8",
19
+ "@magda/typescript-common": "^2.0.0-alpha.8",
20
20
  "fs-extra": "^2.1.2",
21
21
  "webpack": "^4.41.2",
22
22
  "webpack-cli": "^3.3.10"
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "chalk": "^2.4.1",
26
26
  "commander": "^2.17.0",
27
- "pg": "^7.11.0",
27
+ "pg": "^8.7.3",
28
28
  "text-treeview": "^1.0.1"
29
29
  },
30
30
  "magda": {
@@ -41,7 +41,7 @@
41
41
  "org-tree"
42
42
  ],
43
43
  "engines": {
44
- "node": ">=10.0.0 <13.0.0"
44
+ "node": ">=14.0.0"
45
45
  },
46
46
  "files": [
47
47
  "bin"