@hw-agconnect/cloud-server 1.0.1

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.
Files changed (211) hide show
  1. package/README.md +258 -0
  2. package/auth-service/agconnect-auth.json +7 -0
  3. package/auth-service/auth.d.ts +48 -0
  4. package/auth-service/auth.js +1 -0
  5. package/auth-service/backend/auth-backend.d.ts +11 -0
  6. package/auth-service/backend/auth-backend.js +1 -0
  7. package/auth-service/entity/auth-access-token-impl.d.ts +67 -0
  8. package/auth-service/entity/auth-access-token-impl.js +1 -0
  9. package/auth-service/entity/auth-access-token.d.ts +54 -0
  10. package/auth-service/entity/auth-access-token.js +1 -0
  11. package/auth-service/entity/provider.d.ts +17 -0
  12. package/auth-service/entity/provider.js +1 -0
  13. package/auth-service/entity/token-provider-info.d.ts +18 -0
  14. package/auth-service/entity/token-provider-info.js +1 -0
  15. package/auth-service/entity/user-import-export-result.d.ts +33 -0
  16. package/auth-service/entity/user-import-export-result.js +1 -0
  17. package/auth-service/error/agc-auth-error-message.d.ts +39 -0
  18. package/auth-service/error/agc-auth-error-message.js +1 -0
  19. package/auth-service/error/agc-auth-error.d.ts +7 -0
  20. package/auth-service/error/agc-auth-error.js +1 -0
  21. package/auth-service/index.d.ts +13 -0
  22. package/auth-service/index.js +1 -0
  23. package/auth-service/jwt/agc-auth-jwt.d.ts +17 -0
  24. package/auth-service/jwt/agc-auth-jwt.js +1 -0
  25. package/auth-service/jwt/agc-auth-jwttoken.d.ts +10 -0
  26. package/auth-service/jwt/agc-auth-jwttoken.js +1 -0
  27. package/auth-service/jwt/agc-auth-public-keys-manager.d.ts +4 -0
  28. package/auth-service/jwt/agc-auth-public-keys-manager.js +1 -0
  29. package/auth-service/jwt/agc-auth-rsa-verifier.d.ts +6 -0
  30. package/auth-service/jwt/agc-auth-rsa-verifier.js +1 -0
  31. package/auth-service/jwt/rsa-key-pair.d.ts +15 -0
  32. package/auth-service/jwt/rsa-key-pair.js +1 -0
  33. package/auth-service/params/fileParams.d.ts +6 -0
  34. package/auth-service/params/fileParams.js +1 -0
  35. package/auth-service/params/index.d.ts +7 -0
  36. package/auth-service/params/index.js +1 -0
  37. package/auth-service/params/signParams.d.ts +9 -0
  38. package/auth-service/params/signParams.js +1 -0
  39. package/auth-service/params/tokenParams.d.ts +7 -0
  40. package/auth-service/params/tokenParams.js +1 -0
  41. package/auth-service/params/uidParams.d.ts +6 -0
  42. package/auth-service/params/uidParams.js +1 -0
  43. package/auth-service/request/export-user-list-req.d.ts +13 -0
  44. package/auth-service/request/export-user-list-req.js +1 -0
  45. package/auth-service/request/export-user-req.d.ts +13 -0
  46. package/auth-service/request/export-user-req.js +1 -0
  47. package/auth-service/request/import-export-user-info.d.ts +40 -0
  48. package/auth-service/request/import-export-user-info.js +1 -0
  49. package/auth-service/request/import-user-req.d.ts +14 -0
  50. package/auth-service/request/import-user-req.js +1 -0
  51. package/auth-service/request/provider-info.d.ts +20 -0
  52. package/auth-service/request/provider-info.js +1 -0
  53. package/auth-service/request/public-key-req.d.ts +9 -0
  54. package/auth-service/request/public-key-req.js +1 -0
  55. package/auth-service/request/revoke-token-req.d.ts +13 -0
  56. package/auth-service/request/revoke-token-req.js +1 -0
  57. package/auth-service/request/verify-token-req.d.ts +13 -0
  58. package/auth-service/request/verify-token-req.js +1 -0
  59. package/auth-service/response/auth-operate-rsp.d.ts +7 -0
  60. package/auth-service/response/auth-operate-rsp.js +1 -0
  61. package/auth-service/response/export-user-list-rsp.d.ts +13 -0
  62. package/auth-service/response/export-user-list-rsp.js +1 -0
  63. package/auth-service/response/export-user-rsp.d.ts +14 -0
  64. package/auth-service/response/export-user-rsp.js +1 -0
  65. package/auth-service/response/import-success-user.d.ts +11 -0
  66. package/auth-service/response/import-success-user.js +1 -0
  67. package/auth-service/response/import-user-rsp.d.ts +11 -0
  68. package/auth-service/response/import-user-rsp.js +1 -0
  69. package/auth-service/response/publickey-rsp.d.ts +9 -0
  70. package/auth-service/response/publickey-rsp.js +1 -0
  71. package/auth-service/response/token-info.d.ts +11 -0
  72. package/auth-service/response/token-info.js +1 -0
  73. package/auth-service/response/verify-token-rsp.d.ts +14 -0
  74. package/auth-service/response/verify-token-rsp.js +1 -0
  75. package/auth-service/service/agc-auth.d.ts +4 -0
  76. package/auth-service/service/agc-auth.js +1 -0
  77. package/auth-service/service/impl/agc-auth-service-impl.d.ts +46 -0
  78. package/auth-service/service/impl/agc-auth-service-impl.js +1 -0
  79. package/auth-service/service/impl/agc-auth-service.d.ts +54 -0
  80. package/auth-service/service/impl/agc-auth-service.js +1 -0
  81. package/auth-service/utils/auth-service-api-util.d.ts +11 -0
  82. package/auth-service/utils/auth-service-api-util.js +1 -0
  83. package/auth-service/utils/key-header-util.d.ts +19 -0
  84. package/auth-service/utils/key-header-util.js +1 -0
  85. package/cloud.d.ts +24 -0
  86. package/cloud.js +1 -0
  87. package/common-server/agc-client/agc-client.d.ts +41 -0
  88. package/common-server/agc-client/agc-client.js +1 -0
  89. package/common-server/agconnect-common.json +29 -0
  90. package/common-server/config/cloud-gw-url-util.d.ts +7 -0
  91. package/common-server/config/cloud-gw-url-util.js +1 -0
  92. package/common-server/config/configService.d.ts +12 -0
  93. package/common-server/config/configService.js +1 -0
  94. package/common-server/credential-service/access-token.d.ts +11 -0
  95. package/common-server/credential-service/access-token.js +1 -0
  96. package/common-server/credential-service/clientid-credential.d.ts +27 -0
  97. package/common-server/credential-service/clientid-credential.js +1 -0
  98. package/common-server/credential-service/credential-parser.d.ts +23 -0
  99. package/common-server/credential-service/credential-parser.js +1 -0
  100. package/common-server/credential-service/credential-service.d.ts +41 -0
  101. package/common-server/credential-service/credential-service.js +1 -0
  102. package/common-server/credential-service/credential-type.d.ts +7 -0
  103. package/common-server/credential-service/credential-type.js +1 -0
  104. package/common-server/error/error-message.d.ts +30 -0
  105. package/common-server/error/error-message.js +1 -0
  106. package/common-server/error/error.d.ts +36 -0
  107. package/common-server/error/error.js +1 -0
  108. package/common-server/http-client/base-response.d.ts +11 -0
  109. package/common-server/http-client/base-response.js +1 -0
  110. package/common-server/http-client/common-headers.d.ts +37 -0
  111. package/common-server/http-client/common-headers.js +1 -0
  112. package/common-server/http-client/connect-ret.d.ts +12 -0
  113. package/common-server/http-client/connect-ret.js +1 -0
  114. package/common-server/http-client/http-client.d.ts +5 -0
  115. package/common-server/http-client/http-client.js +1 -0
  116. package/common-server/http-client/http-clinet-api.d.ts +66 -0
  117. package/common-server/http-client/http-clinet-api.js +1 -0
  118. package/common-server/http-client/request-constructor.d.ts +8 -0
  119. package/common-server/http-client/request-constructor.js +1 -0
  120. package/common-server/index.d.ts +19 -0
  121. package/common-server/index.js +1 -0
  122. package/common-server/service/agc-service.d.ts +14 -0
  123. package/common-server/service/agc-service.js +1 -0
  124. package/common-server/service/service-factory.d.ts +9 -0
  125. package/common-server/service/service-factory.js +1 -0
  126. package/common-server/utils/utils.d.ts +4 -0
  127. package/common-server/utils/utils.js +1 -0
  128. package/database-service/CloudDB.d.ts +13 -0
  129. package/database-service/CloudDB.js +1 -0
  130. package/database-service/CloudDBCollection.d.ts +108 -0
  131. package/database-service/CloudDBCollection.js +1 -0
  132. package/database-service/agconnect-database.json +4 -0
  133. package/database-service/communicator/https/HttpsCommunicator.d.ts +69 -0
  134. package/database-service/communicator/https/HttpsCommunicator.js +1 -0
  135. package/database-service/communicator/https/RequestHeader.d.ts +13 -0
  136. package/database-service/communicator/https/RequestHeader.js +1 -0
  137. package/database-service/exception/AGConnectCloudDBException.d.ts +10 -0
  138. package/database-service/exception/AGConnectCloudDBException.js +1 -0
  139. package/database-service/exception/CloudDBErrorCode.d.ts +672 -0
  140. package/database-service/exception/CloudDBErrorCode.js +1 -0
  141. package/database-service/exception/ErrorCodeMessage.d.ts +1 -0
  142. package/database-service/exception/ErrorCodeMessage.js +1 -0
  143. package/database-service/index.d.ts +14 -0
  144. package/database-service/index.js +1 -0
  145. package/database-service/model/DatabaseConfig.d.ts +7 -0
  146. package/database-service/model/DatabaseConfig.js +1 -0
  147. package/database-service/model/index.d.ts +4 -0
  148. package/database-service/model/index.js +1 -0
  149. package/database-service/query/CloudDBZoneConfig.d.ts +23 -0
  150. package/database-service/query/CloudDBZoneConfig.js +1 -0
  151. package/database-service/query/CloudDBZoneObjectOperator.d.ts +39 -0
  152. package/database-service/query/CloudDBZoneObjectOperator.js +1 -0
  153. package/database-service/query/CloudDBZoneObjectOperatorConstraint.d.ts +127 -0
  154. package/database-service/query/CloudDBZoneObjectOperatorConstraint.js +1 -0
  155. package/database-service/query/CloudDBZoneQuery.d.ts +188 -0
  156. package/database-service/query/CloudDBZoneQuery.js +1 -0
  157. package/database-service/query/CloudDBZoneSnapshot.d.ts +16 -0
  158. package/database-service/query/CloudDBZoneSnapshot.js +1 -0
  159. package/database-service/request/CloudDBZoneGenericObject.d.ts +58 -0
  160. package/database-service/request/CloudDBZoneGenericObject.js +1 -0
  161. package/database-service/services/AGConnectCloudDB.d.ts +63 -0
  162. package/database-service/services/AGConnectCloudDB.js +1 -0
  163. package/database-service/services/CloudDBService.d.ts +75 -0
  164. package/database-service/services/CloudDBService.js +1 -0
  165. package/database-service/services/CloudDBZone.d.ts +254 -0
  166. package/database-service/services/CloudDBZone.js +1 -0
  167. package/database-service/services/Transaction.d.ts +73 -0
  168. package/database-service/services/Transaction.js +1 -0
  169. package/database-service/utils/AggregareType.d.ts +10 -0
  170. package/database-service/utils/AggregareType.js +1 -0
  171. package/database-service/utils/CloudDBSdkUtils.d.ts +30 -0
  172. package/database-service/utils/CloudDBSdkUtils.js +1 -0
  173. package/database-service/utils/ConditionType.d.ts +26 -0
  174. package/database-service/utils/ConditionType.js +1 -0
  175. package/database-service/utils/ConditionValidate.d.ts +40 -0
  176. package/database-service/utils/ConditionValidate.js +1 -0
  177. package/database-service/utils/Constant.d.ts +9 -0
  178. package/database-service/utils/Constant.js +1 -0
  179. package/database-service/utils/DataModelHelper.d.ts +28 -0
  180. package/database-service/utils/DataModelHelper.js +1 -0
  181. package/database-service/utils/FieldType.d.ts +18 -0
  182. package/database-service/utils/FieldType.js +1 -0
  183. package/database-service/utils/SchemaUtils.d.ts +24 -0
  184. package/database-service/utils/SchemaUtils.js +1 -0
  185. package/database-service/utils/Utils.d.ts +134 -0
  186. package/database-service/utils/Utils.js +1 -0
  187. package/function-service/cloudFunction.d.ts +10 -0
  188. package/function-service/cloudFunction.js +1 -0
  189. package/function-service/exception/AGCFunctionException.d.ts +7 -0
  190. package/function-service/exception/AGCFunctionException.js +1 -0
  191. package/function-service/exception/FunctionErrorCode.d.ts +26 -0
  192. package/function-service/exception/FunctionErrorCode.js +1 -0
  193. package/function-service/index.d.ts +8 -0
  194. package/function-service/index.js +1 -0
  195. package/function-service/params/functionParams.d.ts +9 -0
  196. package/function-service/params/functionParams.js +1 -0
  197. package/function-service/params/index.d.ts +4 -0
  198. package/function-service/params/index.js +1 -0
  199. package/function-service/server/AGCFunction.d.ts +20 -0
  200. package/function-service/server/AGCFunction.js +1 -0
  201. package/function-service/server/FunctionCallable.d.ts +40 -0
  202. package/function-service/server/FunctionCallable.js +1 -0
  203. package/function-service/server/FunctionResult.d.ts +8 -0
  204. package/function-service/server/FunctionResult.js +1 -0
  205. package/function-service/server/request/RequestHeaders.d.ts +10 -0
  206. package/function-service/server/request/RequestHeaders.js +1 -0
  207. package/function-service/util/HashUtil.d.ts +10 -0
  208. package/function-service/util/HashUtil.js +1 -0
  209. package/index.d.ts +7 -0
  210. package/index.js +1 -0
  211. package/package.json +58 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2023 All rights reserved.
3
+ */
4
+ /**
5
+ * 通过MD5方法计算url中APPID
6
+ */
7
+ export declare class HashUtil {
8
+ static hash(teamId: string, productId: string): string;
9
+ private static encode;
10
+ }
@@ -0,0 +1 @@
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HashUtil=void 0;var bignumber_js_1=__importDefault(require("bignumber.js")),MD5_HASH=require("spark-md5"),BIT_MAX=61,DIVISOR=62,BASE_62="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",HashUtil=function(){function e(){}return e.hash=function(r,t){var u="agc:"+r+"@"+t,i=MD5_HASH.hash(u);i="0x"+i;var a=new bignumber_js_1.default(i);return e.encode(a)},e.encode=function(e){for(var r="";e.isGreaterThan(BIT_MAX);){var t=e.modulo(DIVISOR);r=BASE_62.charAt(t.toNumber())+r,e=e.dividedToIntegerBy(DIVISOR)}return r=BASE_62.charAt(e.toNumber())+r},e}();exports.HashUtil=HashUtil;
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2023 All rights reserved.
3
+ */
4
+ export * from './cloud';
5
+ export * from './auth-service/';
6
+ export * from './function-service/';
7
+ export * from './database-service/';
package/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./cloud"),exports),__exportStar(require("./auth-service/"),exports),__exportStar(require("./function-service/"),exports),__exportStar(require("./database-service/"),exports);
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@hw-agconnect/cloud-server",
3
+ "version": "1.0.1",
4
+ "description": "AppGallery Connect Server-SDK for Node.js common module",
5
+ "author": {
6
+ "name": "AppGallery Connect",
7
+ "url": "https://developer.huawei.com/consumer/cn/service/josp/agc/index.html#/"
8
+ },
9
+ "homepage": "https://developer.huawei.com/consumer/cn/service/josp/agc/index.html#/",
10
+ "engines": {
11
+ "node": ">=10.12.0"
12
+ },
13
+ "license": "ISC",
14
+ "main": "./index.js",
15
+ "scripts": {
16
+ "build": "gulp build",
17
+ "test": "jest",
18
+ "test-c": "jest --coverage",
19
+ "prettier-c": "prettier -c \"src/**/*.ts\"",
20
+ "prettier-w": "prettier -c \"src/**/*.ts\" --write --ignore-unknown",
21
+ "eslint": "eslint src --ext .ts",
22
+ "eslint-fix": "eslint src --ext .ts --fix"
23
+ },
24
+ "devDependencies": {
25
+ "@types/chai": "^4.2.12",
26
+ "@types/jest": "^26.0.10",
27
+ "@types/mocha": "^8.0.3",
28
+ "@types/node": "^16.3.0",
29
+ "@types/uuid": "^8.3.0",
30
+ "@typescript-eslint/eslint-plugin": "^4.0.1",
31
+ "@typescript-eslint/parser": "^4.0.1",
32
+ "chai": "^4.2.0",
33
+ "del": "^6.0.0",
34
+ "eslint": "^7.8.1",
35
+ "gulp": "^4.0.2",
36
+ "gulp-if": "^3.0.0",
37
+ "gulp-typescript": "^5.0.1",
38
+ "gulp-terser": "^2.1.0",
39
+ "jest": "^29.7.0",
40
+ "mocha": "^9.0.2",
41
+ "prettier": "^2.1.1",
42
+ "ts-jest": "^29.1.0",
43
+ "ts-node": "^10.0.0",
44
+ "axios-mock-adapter": "1.21.5",
45
+ "typescript": "^4.3.5"
46
+ },
47
+ "keywords": [
48
+ "agconnect",
49
+ "Node.js",
50
+ "server SDK"
51
+ ],
52
+ "dependencies": {
53
+ "axios": "1.6.8",
54
+ "uuid": "^8.3.2",
55
+ "bignumber.js": "9.1.2",
56
+ "spark-md5": "3.0.2"
57
+ }
58
+ }