abler-api 1.0.13 → 1.0.15

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.
@@ -1160,14 +1160,13 @@ class apiUtil$2 {
1160
1160
  * @param token
1161
1161
  * @returns {*}
1162
1162
  */
1163
- static tokenDataExist(token) {
1164
- return kvStorage.stored(token);
1163
+ static async tokenDataExist(token) {
1164
+ return await kvStorage.stored(token);
1165
1165
  }
1166
- static parametersOK(params) {
1166
+ static checkParametersOK(params, ...args) {
1167
1167
  configNeeded();
1168
1168
  let paramSufix = params._param_sufix || "";
1169
- for (let i = 1; i < arguments.length; i++) {
1170
- let paramName = arguments[i];
1169
+ for (let paramName of args) {
1171
1170
  let paramExists = false;
1172
1171
  if (paramName.includes("/")) {
1173
1172
  let names = paramName.split("/");
@@ -1195,11 +1194,13 @@ class apiUtil$2 {
1195
1194
  } else {
1196
1195
  paramExists = typeof params[paramName] != 'undefined' || typeof params[paramName + paramSufix] != 'undefined';
1197
1196
  }
1198
- if (!paramExists) return ppUtil$3.errorPormise(errCfg.ERROR(errCfg.PARAMETER_NEEDED, paramName));
1197
+ if (!paramExists) throw errCfg.ERROR(errCfg.PARAMETER_NEEDED, paramName);
1199
1198
  }
1200
- return Promise.resolve(paramSufix);
1199
+ return paramSufix;
1200
+ }
1201
+ static async parametersOK(params) {
1202
+ return apiUtil$2.checkParametersOK(...arguments);
1201
1203
  }
1202
-
1203
1204
  /**
1204
1205
  * 获取客户端IP地址
1205
1206
  * @param req
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",
@@ -15,11 +15,11 @@
15
15
  "author": "peng_peng",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "abler-db": "^1.0.14",
19
- "abler-i18n": "^1.0.1",
20
- "abler-messenger": "^1.0.13",
21
- "abler-net": "^1.0.3",
22
- "abler-util": "^1.0.3",
18
+ "abler-db": "^1.0.15",
19
+ "abler-i18n": "^1.0.2",
20
+ "abler-messenger": "^1.0.14",
21
+ "abler-net": "^1.0.5",
22
+ "abler-util": "^1.0.4",
23
23
  "basic-auth": "^2.0.1",
24
24
  "node-cron": "^3.0.1",
25
25
  "q": "^1.5.1"
@@ -42,5 +42,5 @@
42
42
  "rollup-plugin-json": "^4.0.0",
43
43
  "rollup-plugin-terser": "^7.0.2"
44
44
  },
45
- "gitHead": "4dd30efdd694df7d762fac14283391ae17fb6c43"
45
+ "gitHead": "1ea06c22dde68092a95f61be7324a6bb02c79c23"
46
46
  }