@domain.js/main 0.4.11 → 0.4.13

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.
@@ -69,18 +69,20 @@ function Utils(cnf, deps) {
69
69
  if (!value)
70
70
  return [[conf.default, conf.defaultDirection || "ASC"]];
71
71
  const orders = value.split(",").map((x) => {
72
+ var _a;
72
73
  const isDesc = x[0] === "-";
73
74
  const direction = isDesc ? "DESC" : "ASC";
74
75
  const order = isDesc ? x.slice(1) : x;
76
+ const theOrder = order.split(".");
75
77
  // 如果请求的排序方式不允许,则返回null
76
- if (!conf.allow || !_.includes(conf.allow, order))
78
+ if (theOrder.length !== 2 && (!conf.allow || !_.includes(conf.allow, order)))
77
79
  return undefined;
78
- const theOrder = order.split(".");
79
80
  // 处理使用模型名称作为关联名称按关联模型的 字段 排序
80
81
  if (theOrder.length === 2) {
81
82
  if (includes && Array.isArray(params._includes)) {
82
83
  const ret = _.filter(params._includes, (val) => includes[val]);
83
- if (!ret.includes(theOrder[0])) {
84
+ if (!ret.includes(theOrder[0]) ||
85
+ !((_a = includes[theOrder[0]].model.sort) === null || _a === void 0 ? void 0 : _a.allow.includes(theOrder[1]))) {
84
86
  return undefined;
85
87
  }
86
88
  }
@@ -158,12 +158,7 @@ function BridgeSocket(io, domain) {
158
158
  if (!client.inited)
159
159
  return;
160
160
  // 这里要取消对领域消息的监听
161
- try {
162
- return await unsubscribe(client.profile, client);
163
- }
164
- catch (e) {
165
- console.error(e);
166
- }
161
+ await unsubscribe(client.profile, client).catch(console.error);
167
162
  if (client.quit)
168
163
  client.quit();
169
164
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {