cgserver 7.9.2113 → 7.10.2113

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 (389) hide show
  1. package/package.json +1 -1
  2. package/dist/Framework/AI/AiObject.js +0 -11
  3. package/dist/Framework/AI/AiObject.js.map +0 -1
  4. package/dist/Framework/AI/Astar.js +0 -134
  5. package/dist/Framework/AI/Astar.js.map +0 -1
  6. package/dist/Framework/AI/BehaviorAI.js +0 -309
  7. package/dist/Framework/AI/BehaviorAI.js.map +0 -1
  8. package/dist/Framework/AI/Entity.js +0 -34
  9. package/dist/Framework/AI/Entity.js.map +0 -1
  10. package/dist/Framework/AI/Point.js +0 -69
  11. package/dist/Framework/AI/Point.js.map +0 -1
  12. package/dist/Framework/AI/TriggerMgr.js +0 -202
  13. package/dist/Framework/AI/TriggerMgr.js.map +0 -1
  14. package/dist/Framework/Config/Config.js +0 -55
  15. package/dist/Framework/Config/Config.js.map +0 -1
  16. package/dist/Framework/Config/FrameworkConfig.js +0 -241
  17. package/dist/Framework/Config/FrameworkConfig.js.map +0 -1
  18. package/dist/Framework/Config/IServerConfig.js +0 -27
  19. package/dist/Framework/Config/IServerConfig.js.map +0 -1
  20. package/dist/Framework/Config/_error_.js +0 -36
  21. package/dist/Framework/Config/_error_.js.map +0 -1
  22. package/dist/Framework/Core/Core.js +0 -641
  23. package/dist/Framework/Core/Core.js.map +0 -1
  24. package/dist/Framework/Core/Timer.js +0 -117
  25. package/dist/Framework/Core/Timer.js.map +0 -1
  26. package/dist/Framework/Database/Decorator/AutoIncrement.js +0 -12
  27. package/dist/Framework/Database/Decorator/AutoIncrement.js.map +0 -1
  28. package/dist/Framework/Database/Decorator/DBCache.js +0 -66
  29. package/dist/Framework/Database/Decorator/DBCache.js.map +0 -1
  30. package/dist/Framework/Database/Decorator/NotNull.js +0 -12
  31. package/dist/Framework/Database/Decorator/NotNull.js.map +0 -1
  32. package/dist/Framework/Database/Decorator/PrimaryKey.js +0 -12
  33. package/dist/Framework/Database/Decorator/PrimaryKey.js.map +0 -1
  34. package/dist/Framework/Database/Decorator/Property.js +0 -62
  35. package/dist/Framework/Database/Decorator/Property.js.map +0 -1
  36. package/dist/Framework/Database/Decorator/Table.js +0 -16
  37. package/dist/Framework/Database/Decorator/Table.js.map +0 -1
  38. package/dist/Framework/Database/Decorator/Type.js +0 -21
  39. package/dist/Framework/Database/Decorator/Type.js.map +0 -1
  40. package/dist/Framework/Database/MSSqlManager.js +0 -45
  41. package/dist/Framework/Database/MSSqlManager.js.map +0 -1
  42. package/dist/Framework/Database/MongoBaseService.js +0 -115
  43. package/dist/Framework/Database/MongoBaseService.js.map +0 -1
  44. package/dist/Framework/Database/MongoManager.js +0 -429
  45. package/dist/Framework/Database/MongoManager.js.map +0 -1
  46. package/dist/Framework/Database/MysqlBaseService.js +0 -282
  47. package/dist/Framework/Database/MysqlBaseService.js.map +0 -1
  48. package/dist/Framework/Database/MysqlManager.js +0 -182
  49. package/dist/Framework/Database/MysqlManager.js.map +0 -1
  50. package/dist/Framework/Database/RedisManager.js +0 -410
  51. package/dist/Framework/Database/RedisManager.js.map +0 -1
  52. package/dist/Framework/Logic/CacheTool.js +0 -75
  53. package/dist/Framework/Logic/CacheTool.js.map +0 -1
  54. package/dist/Framework/Logic/EventTool.js +0 -29
  55. package/dist/Framework/Logic/EventTool.js.map +0 -1
  56. package/dist/Framework/Logic/HttpTool.js +0 -77
  57. package/dist/Framework/Logic/HttpTool.js.map +0 -1
  58. package/dist/Framework/Logic/Log.js +0 -142
  59. package/dist/Framework/Logic/Log.js.map +0 -1
  60. package/dist/Framework/Logic/SyncQueueTool.js +0 -44
  61. package/dist/Framework/Logic/SyncQueueTool.js.map +0 -1
  62. package/dist/Framework/Service/AccountService.js +0 -482
  63. package/dist/Framework/Service/AccountService.js.map +0 -1
  64. package/dist/Framework/Service/MongoAccountService.js +0 -404
  65. package/dist/Framework/Service/MongoAccountService.js.map +0 -1
  66. package/dist/Framework/Service/MongoCacheService.js +0 -43
  67. package/dist/Framework/Service/MongoCacheService.js.map +0 -1
  68. package/dist/Framework/Service/MongoUserService.js +0 -95
  69. package/dist/Framework/Service/MongoUserService.js.map +0 -1
  70. package/dist/Framework/Service/UserService.js +0 -200
  71. package/dist/Framework/Service/UserService.js.map +0 -1
  72. package/dist/Framework/Service/ini.js +0 -37
  73. package/dist/Framework/Service/ini.js.map +0 -1
  74. package/dist/Framework/SocketServer/IClientWebSocket.js +0 -45
  75. package/dist/Framework/SocketServer/IClientWebSocket.js.map +0 -1
  76. package/dist/Framework/SocketServer/IRpc.js +0 -13
  77. package/dist/Framework/SocketServer/IRpc.js.map +0 -1
  78. package/dist/Framework/SocketServer/IRpcClientWebSocket.js +0 -64
  79. package/dist/Framework/SocketServer/IRpcClientWebSocket.js.map +0 -1
  80. package/dist/Framework/SocketServer/IRpcServerWebSocket.js +0 -64
  81. package/dist/Framework/SocketServer/IRpcServerWebSocket.js.map +0 -1
  82. package/dist/Framework/SocketServer/IServerWebSocket.js +0 -77
  83. package/dist/Framework/SocketServer/IServerWebSocket.js.map +0 -1
  84. package/dist/Framework/SocketServer/ISocketServer.js +0 -204
  85. package/dist/Framework/SocketServer/ISocketServer.js.map +0 -1
  86. package/dist/Framework/SocketServer/IWebSocket.js +0 -197
  87. package/dist/Framework/SocketServer/IWebSocket.js.map +0 -1
  88. package/dist/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js +0 -59
  89. package/dist/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +0 -1
  90. package/dist/Framework/SocketServer/ProtoFilter/IProtoFilter.js +0 -9
  91. package/dist/Framework/SocketServer/ProtoFilter/IProtoFilter.js.map +0 -1
  92. package/dist/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js +0 -30
  93. package/dist/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js.map +0 -1
  94. package/dist/Framework/SocketServer/ProtoFilter/ProtoFactory.js +0 -32
  95. package/dist/Framework/SocketServer/ProtoFilter/ProtoFactory.js.map +0 -1
  96. package/dist/Framework/ThirdParty/AlipayTool.js +0 -205
  97. package/dist/Framework/ThirdParty/AlipayTool.js.map +0 -1
  98. package/dist/Framework/ThirdParty/Alisms.js +0 -47
  99. package/dist/Framework/ThirdParty/Alisms.js.map +0 -1
  100. package/dist/Framework/ThirdParty/AppleTool.js +0 -236
  101. package/dist/Framework/ThirdParty/AppleTool.js.map +0 -1
  102. package/dist/Framework/ThirdParty/CgMq.js +0 -133
  103. package/dist/Framework/ThirdParty/CgMq.js.map +0 -1
  104. package/dist/Framework/ThirdParty/EmailTool.js +0 -35
  105. package/dist/Framework/ThirdParty/EmailTool.js.map +0 -1
  106. package/dist/Framework/ThirdParty/OpenSocial.js +0 -33
  107. package/dist/Framework/ThirdParty/OpenSocial.js.map +0 -1
  108. package/dist/Framework/ThirdParty/QQTool.js +0 -117
  109. package/dist/Framework/ThirdParty/QQTool.js.map +0 -1
  110. package/dist/Framework/ThirdParty/QiniuTool.js +0 -23
  111. package/dist/Framework/ThirdParty/QiniuTool.js.map +0 -1
  112. package/dist/Framework/ThirdParty/Rpc.js +0 -64
  113. package/dist/Framework/ThirdParty/Rpc.js.map +0 -1
  114. package/dist/Framework/ThirdParty/WechatOATool.js +0 -62
  115. package/dist/Framework/ThirdParty/WechatOATool.js.map +0 -1
  116. package/dist/Framework/ThirdParty/WechatTool.js +0 -76
  117. package/dist/Framework/ThirdParty/WechatTool.js.map +0 -1
  118. package/dist/Framework/WebServer/Controller/BaseController.js +0 -113
  119. package/dist/Framework/WebServer/Controller/BaseController.js.map +0 -1
  120. package/dist/Framework/WebServer/Controller/BaseUserController.js +0 -170
  121. package/dist/Framework/WebServer/Controller/BaseUserController.js.map +0 -1
  122. package/dist/Framework/WebServer/Controller/MongoBaseUserController.js +0 -170
  123. package/dist/Framework/WebServer/Controller/MongoBaseUserController.js.map +0 -1
  124. package/dist/Framework/WebServer/Decorator/AdminValidate.js +0 -20
  125. package/dist/Framework/WebServer/Decorator/AdminValidate.js.map +0 -1
  126. package/dist/Framework/WebServer/Decorator/AuthorityValidate.js +0 -23
  127. package/dist/Framework/WebServer/Decorator/AuthorityValidate.js.map +0 -1
  128. package/dist/Framework/WebServer/Decorator/CreatorValidate.js +0 -20
  129. package/dist/Framework/WebServer/Decorator/CreatorValidate.js.map +0 -1
  130. package/dist/Framework/WebServer/Decorator/JsonAdminValidate.js +0 -16
  131. package/dist/Framework/WebServer/Decorator/JsonAdminValidate.js.map +0 -1
  132. package/dist/Framework/WebServer/Decorator/JsonAuthorityValidate.js +0 -21
  133. package/dist/Framework/WebServer/Decorator/JsonAuthorityValidate.js.map +0 -1
  134. package/dist/Framework/WebServer/Decorator/JsonCreatorValidate.js +0 -20
  135. package/dist/Framework/WebServer/Decorator/JsonCreatorValidate.js.map +0 -1
  136. package/dist/Framework/WebServer/Decorator/SyncCall.js +0 -22
  137. package/dist/Framework/WebServer/Decorator/SyncCall.js.map +0 -1
  138. package/dist/Framework/WebServer/Decorator/SyncCallServer.js +0 -42
  139. package/dist/Framework/WebServer/Decorator/SyncCallServer.js.map +0 -1
  140. package/dist/Framework/WebServer/Engine/ControllerManager.js +0 -113
  141. package/dist/Framework/WebServer/Engine/ControllerManager.js.map +0 -1
  142. package/dist/Framework/WebServer/Engine/Engine.js +0 -155
  143. package/dist/Framework/WebServer/Engine/Engine.js.map +0 -1
  144. package/dist/Framework/WebServer/Engine/RazorJs.js +0 -545
  145. package/dist/Framework/WebServer/Engine/RazorJs.js.map +0 -1
  146. package/dist/Framework/WebServer/Engine/Request.js +0 -217
  147. package/dist/Framework/WebServer/Engine/Request.js.map +0 -1
  148. package/dist/Framework/WebServer/Engine/Response.js +0 -102
  149. package/dist/Framework/WebServer/Engine/Response.js.map +0 -1
  150. package/dist/Framework/WebServer/IWebServer.js +0 -55
  151. package/dist/Framework/WebServer/IWebServer.js.map +0 -1
  152. package/dist/Framework/cgserver.js +0 -88
  153. package/dist/Framework/cgserver.js.map +0 -1
  154. package/dist/Framework/index.js +0 -184
  155. package/dist/Framework/index.js.map +0 -1
  156. package/dist/lib/AI/AiObject.js +0 -13
  157. package/dist/lib/AI/Astar.js +0 -140
  158. package/dist/lib/AI/BehaviorAI.js +0 -302
  159. package/dist/lib/AI/Entity.js +0 -48
  160. package/dist/lib/AI/Point.js +0 -71
  161. package/dist/lib/AI/TriggerMgr.js +0 -207
  162. package/dist/lib/Config/Config.js +0 -54
  163. package/dist/lib/Config/FrameworkConfig.js +0 -261
  164. package/dist/lib/Config/IServerConfig.js +0 -48
  165. package/dist/lib/Config/_error_.js +0 -37
  166. package/dist/lib/Core/Core.js +0 -710
  167. package/dist/lib/Core/Timer.js +0 -149
  168. package/dist/lib/Database/Decorator/AutoIncrement.js +0 -11
  169. package/dist/lib/Database/Decorator/DBCache.js +0 -118
  170. package/dist/lib/Database/Decorator/NotNull.js +0 -11
  171. package/dist/lib/Database/Decorator/PrimaryKey.js +0 -11
  172. package/dist/lib/Database/Decorator/Property.js +0 -70
  173. package/dist/lib/Database/Decorator/Table.js +0 -15
  174. package/dist/lib/Database/Decorator/Type.js +0 -20
  175. package/dist/lib/Database/MSSqlManager.js +0 -106
  176. package/dist/lib/Database/MongoBaseService.js +0 -293
  177. package/dist/lib/Database/MongoManager.js +0 -670
  178. package/dist/lib/Database/MysqlBaseService.js +0 -478
  179. package/dist/lib/Database/MysqlManager.js +0 -250
  180. package/dist/lib/Database/RedisManager.js +0 -475
  181. package/dist/lib/Framework/AI/AiObject.js.map +0 -1
  182. package/dist/lib/Framework/AI/Astar.js.map +0 -1
  183. package/dist/lib/Framework/AI/BehaviorAI.js.map +0 -1
  184. package/dist/lib/Framework/AI/Entity.js.map +0 -1
  185. package/dist/lib/Framework/AI/Point.js.map +0 -1
  186. package/dist/lib/Framework/AI/TriggerMgr.js.map +0 -1
  187. package/dist/lib/Framework/Config/Config.js.map +0 -1
  188. package/dist/lib/Framework/Config/FrameworkConfig.js.map +0 -1
  189. package/dist/lib/Framework/Config/IServerConfig.js.map +0 -1
  190. package/dist/lib/Framework/Config/_error_.js.map +0 -1
  191. package/dist/lib/Framework/Core/Core.js.map +0 -1
  192. package/dist/lib/Framework/Core/Timer.js.map +0 -1
  193. package/dist/lib/Framework/Database/Decorator/AutoIncrement.js.map +0 -1
  194. package/dist/lib/Framework/Database/Decorator/DBCache.js.map +0 -1
  195. package/dist/lib/Framework/Database/Decorator/NotNull.js.map +0 -1
  196. package/dist/lib/Framework/Database/Decorator/PrimaryKey.js.map +0 -1
  197. package/dist/lib/Framework/Database/Decorator/Property.js.map +0 -1
  198. package/dist/lib/Framework/Database/Decorator/Table.js.map +0 -1
  199. package/dist/lib/Framework/Database/Decorator/Type.js.map +0 -1
  200. package/dist/lib/Framework/Database/MSSqlManager.js.map +0 -1
  201. package/dist/lib/Framework/Database/MongoBaseService.js.map +0 -1
  202. package/dist/lib/Framework/Database/MongoManager.js.map +0 -1
  203. package/dist/lib/Framework/Database/MysqlBaseService.js.map +0 -1
  204. package/dist/lib/Framework/Database/MysqlManager.js.map +0 -1
  205. package/dist/lib/Framework/Database/RedisManager.js.map +0 -1
  206. package/dist/lib/Framework/Logic/CacheTool.js.map +0 -1
  207. package/dist/lib/Framework/Logic/EventTool.js.map +0 -1
  208. package/dist/lib/Framework/Logic/HttpTool.js.map +0 -1
  209. package/dist/lib/Framework/Logic/Log.js.map +0 -1
  210. package/dist/lib/Framework/Logic/SyncQueueTool.js.map +0 -1
  211. package/dist/lib/Framework/Service/AccountService.js.map +0 -1
  212. package/dist/lib/Framework/Service/MongoAccountService.js.map +0 -1
  213. package/dist/lib/Framework/Service/MongoCacheService.js.map +0 -1
  214. package/dist/lib/Framework/Service/MongoUserService.js.map +0 -1
  215. package/dist/lib/Framework/Service/UserService.js.map +0 -1
  216. package/dist/lib/Framework/Service/ini.js.map +0 -1
  217. package/dist/lib/Framework/SocketServer/IClientWebSocket.js.map +0 -1
  218. package/dist/lib/Framework/SocketServer/IRpc.js.map +0 -1
  219. package/dist/lib/Framework/SocketServer/IRpcClientWebSocket.js.map +0 -1
  220. package/dist/lib/Framework/SocketServer/IRpcServerWebSocket.js.map +0 -1
  221. package/dist/lib/Framework/SocketServer/IServerWebSocket.js.map +0 -1
  222. package/dist/lib/Framework/SocketServer/ISocketServer.js.map +0 -1
  223. package/dist/lib/Framework/SocketServer/IWebSocket.js.map +0 -1
  224. package/dist/lib/Framework/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +0 -1
  225. package/dist/lib/Framework/SocketServer/ProtoFilter/IProtoFilter.js.map +0 -1
  226. package/dist/lib/Framework/SocketServer/ProtoFilter/JsonProtoFilter.js.map +0 -1
  227. package/dist/lib/Framework/SocketServer/ProtoFilter/ProtoFactory.js.map +0 -1
  228. package/dist/lib/Framework/ThirdParty/AlipayTool.js.map +0 -1
  229. package/dist/lib/Framework/ThirdParty/Alisms.js.map +0 -1
  230. package/dist/lib/Framework/ThirdParty/AppleTool.js.map +0 -1
  231. package/dist/lib/Framework/ThirdParty/CgMq.js.map +0 -1
  232. package/dist/lib/Framework/ThirdParty/EmailTool.js.map +0 -1
  233. package/dist/lib/Framework/ThirdParty/OpenSocial.js.map +0 -1
  234. package/dist/lib/Framework/ThirdParty/QQTool.js.map +0 -1
  235. package/dist/lib/Framework/ThirdParty/QiniuTool.js.map +0 -1
  236. package/dist/lib/Framework/ThirdParty/Rpc.js.map +0 -1
  237. package/dist/lib/Framework/ThirdParty/WechatOATool.js.map +0 -1
  238. package/dist/lib/Framework/ThirdParty/WechatTool.js.map +0 -1
  239. package/dist/lib/Framework/WebServer/Controller/BaseController.js.map +0 -1
  240. package/dist/lib/Framework/WebServer/Controller/BaseUserController.js.map +0 -1
  241. package/dist/lib/Framework/WebServer/Controller/MongoBaseUserController.js.map +0 -1
  242. package/dist/lib/Framework/WebServer/Decorator/AdminValidate.js.map +0 -1
  243. package/dist/lib/Framework/WebServer/Decorator/AuthorityValidate.js.map +0 -1
  244. package/dist/lib/Framework/WebServer/Decorator/CreatorValidate.js.map +0 -1
  245. package/dist/lib/Framework/WebServer/Decorator/JsonAdminValidate.js.map +0 -1
  246. package/dist/lib/Framework/WebServer/Decorator/JsonAuthorityValidate.js.map +0 -1
  247. package/dist/lib/Framework/WebServer/Decorator/JsonCreatorValidate.js.map +0 -1
  248. package/dist/lib/Framework/WebServer/Decorator/SyncCall.js.map +0 -1
  249. package/dist/lib/Framework/WebServer/Decorator/SyncCallServer.js.map +0 -1
  250. package/dist/lib/Framework/WebServer/Engine/ControllerManager.js.map +0 -1
  251. package/dist/lib/Framework/WebServer/Engine/Engine.js.map +0 -1
  252. package/dist/lib/Framework/WebServer/Engine/RazorJs.js.map +0 -1
  253. package/dist/lib/Framework/WebServer/Engine/Request.js.map +0 -1
  254. package/dist/lib/Framework/WebServer/Engine/Response.js.map +0 -1
  255. package/dist/lib/Framework/WebServer/IWebServer.js.map +0 -1
  256. package/dist/lib/Framework/cgserver.js.map +0 -1
  257. package/dist/lib/Framework/index.js.map +0 -1
  258. package/dist/lib/Logic/CacheTool.js +0 -77
  259. package/dist/lib/Logic/EventTool.js +0 -42
  260. package/dist/lib/Logic/HttpTool.js +0 -78
  261. package/dist/lib/Logic/Log.js +0 -148
  262. package/dist/lib/Logic/SyncQueueTool.js +0 -134
  263. package/dist/lib/Service/AccountService.js +0 -665
  264. package/dist/lib/Service/MongoAccountService.js +0 -598
  265. package/dist/lib/Service/MongoCacheService.js +0 -122
  266. package/dist/lib/Service/MongoUserService.js +0 -197
  267. package/dist/lib/Service/UserService.js +0 -296
  268. package/dist/lib/Service/ini.js +0 -36
  269. package/dist/lib/SocketServer/IClientWebSocket.js +0 -76
  270. package/dist/lib/SocketServer/IRpc.js +0 -36
  271. package/dist/lib/SocketServer/IRpcClientWebSocket.js +0 -130
  272. package/dist/lib/SocketServer/IRpcServerWebSocket.js +0 -130
  273. package/dist/lib/SocketServer/IServerWebSocket.js +0 -112
  274. package/dist/lib/SocketServer/ISocketServer.js +0 -275
  275. package/dist/lib/SocketServer/IWebSocket.js +0 -288
  276. package/dist/lib/SocketServer/ProtoFilter/GoogleProtoFilter.js +0 -60
  277. package/dist/lib/SocketServer/ProtoFilter/IProtoFilter.js +0 -8
  278. package/dist/lib/SocketServer/ProtoFilter/JsonProtoFilter.js +0 -32
  279. package/dist/lib/SocketServer/ProtoFilter/ProtoFactory.js +0 -34
  280. package/dist/lib/ThirdParty/AlipayTool.js +0 -264
  281. package/dist/lib/ThirdParty/Alisms.js +0 -50
  282. package/dist/lib/ThirdParty/AppleTool.js +0 -314
  283. package/dist/lib/ThirdParty/CgMq.js +0 -282
  284. package/dist/lib/ThirdParty/EmailTool.js +0 -36
  285. package/dist/lib/ThirdParty/OpenSocial.js +0 -91
  286. package/dist/lib/ThirdParty/QQTool.js +0 -182
  287. package/dist/lib/ThirdParty/QiniuTool.js +0 -28
  288. package/dist/lib/ThirdParty/Rpc.js +0 -181
  289. package/dist/lib/ThirdParty/WechatOATool.js +0 -67
  290. package/dist/lib/ThirdParty/WechatTool.js +0 -148
  291. package/dist/lib/WebServer/Controller/BaseController.js +0 -178
  292. package/dist/lib/WebServer/Controller/BaseUserController.js +0 -303
  293. package/dist/lib/WebServer/Controller/MongoBaseUserController.js +0 -303
  294. package/dist/lib/WebServer/Decorator/AdminValidate.js +0 -19
  295. package/dist/lib/WebServer/Decorator/AuthorityValidate.js +0 -22
  296. package/dist/lib/WebServer/Decorator/CreatorValidate.js +0 -19
  297. package/dist/lib/WebServer/Decorator/JsonAdminValidate.js +0 -15
  298. package/dist/lib/WebServer/Decorator/JsonAuthorityValidate.js +0 -20
  299. package/dist/lib/WebServer/Decorator/JsonCreatorValidate.js +0 -19
  300. package/dist/lib/WebServer/Decorator/SyncCall.js +0 -63
  301. package/dist/lib/WebServer/Decorator/SyncCallServer.js +0 -110
  302. package/dist/lib/WebServer/Engine/ControllerManager.js +0 -117
  303. package/dist/lib/WebServer/Engine/Engine.js +0 -207
  304. package/dist/lib/WebServer/Engine/RazorJs.js +0 -547
  305. package/dist/lib/WebServer/Engine/Request.js +0 -274
  306. package/dist/lib/WebServer/Engine/Response.js +0 -102
  307. package/dist/lib/WebServer/IWebServer.js +0 -107
  308. package/dist/lib/cgserver.js +0 -100
  309. package/dist/lib/index.js +0 -194
  310. package/dist/lib/test/test.js.map +0 -1
  311. package/dist/test/test.js +0 -11
  312. package/dist/test/test.js.map +0 -1
  313. package/dist/types/AI/AiObject.d.ts +0 -5
  314. package/dist/types/AI/Astar.d.ts +0 -38
  315. package/dist/types/AI/BehaviorAI.d.ts +0 -24
  316. package/dist/types/AI/Entity.d.ts +0 -12
  317. package/dist/types/AI/Point.d.ts +0 -17
  318. package/dist/types/AI/TriggerMgr.d.ts +0 -52
  319. package/dist/types/Config/Config.d.ts +0 -12
  320. package/dist/types/Config/FrameworkConfig.d.ts +0 -228
  321. package/dist/types/Config/IServerConfig.d.ts +0 -9
  322. package/dist/types/Config/_error_.d.ts +0 -99
  323. package/dist/types/Core/Core.d.ts +0 -108
  324. package/dist/types/Core/Timer.d.ts +0 -16
  325. package/dist/types/Database/Decorator/AutoIncrement.d.ts +0 -1
  326. package/dist/types/Database/Decorator/DBCache.d.ts +0 -23
  327. package/dist/types/Database/Decorator/NotNull.d.ts +0 -1
  328. package/dist/types/Database/Decorator/PrimaryKey.d.ts +0 -1
  329. package/dist/types/Database/Decorator/Property.d.ts +0 -57
  330. package/dist/types/Database/Decorator/Table.d.ts +0 -1
  331. package/dist/types/Database/Decorator/Type.d.ts +0 -1
  332. package/dist/types/Database/MSSqlManager.d.ts +0 -17
  333. package/dist/types/Database/MongoBaseService.d.ts +0 -81
  334. package/dist/types/Database/MongoManager.d.ts +0 -143
  335. package/dist/types/Database/MysqlBaseService.d.ts +0 -34
  336. package/dist/types/Database/MysqlManager.d.ts +0 -41
  337. package/dist/types/Database/RedisManager.d.ts +0 -64
  338. package/dist/types/Logic/CacheTool.d.ts +0 -27
  339. package/dist/types/Logic/EventTool.d.ts +0 -13
  340. package/dist/types/Logic/HttpTool.d.ts +0 -15
  341. package/dist/types/Logic/Log.d.ts +0 -25
  342. package/dist/types/Logic/SyncQueueTool.d.ts +0 -21
  343. package/dist/types/Service/AccountService.d.ts +0 -77
  344. package/dist/types/Service/MongoAccountService.d.ts +0 -78
  345. package/dist/types/Service/MongoCacheService.d.ts +0 -14
  346. package/dist/types/Service/MongoUserService.d.ts +0 -36
  347. package/dist/types/Service/UserService.d.ts +0 -36
  348. package/dist/types/Service/ini.d.ts +0 -29
  349. package/dist/types/SocketServer/IClientWebSocket.d.ts +0 -17
  350. package/dist/types/SocketServer/IRpc.d.ts +0 -8
  351. package/dist/types/SocketServer/IRpcClientWebSocket.d.ts +0 -16
  352. package/dist/types/SocketServer/IRpcServerWebSocket.d.ts +0 -16
  353. package/dist/types/SocketServer/IServerWebSocket.d.ts +0 -28
  354. package/dist/types/SocketServer/ISocketServer.d.ts +0 -45
  355. package/dist/types/SocketServer/IWebSocket.d.ts +0 -60
  356. package/dist/types/SocketServer/ProtoFilter/GoogleProtoFilter.d.ts +0 -9
  357. package/dist/types/SocketServer/ProtoFilter/IProtoFilter.d.ts +0 -9
  358. package/dist/types/SocketServer/ProtoFilter/JsonProtoFilter.d.ts +0 -6
  359. package/dist/types/SocketServer/ProtoFilter/ProtoFactory.d.ts +0 -8
  360. package/dist/types/ThirdParty/AlipayTool.d.ts +0 -109
  361. package/dist/types/ThirdParty/Alisms.d.ts +0 -14
  362. package/dist/types/ThirdParty/AppleTool.d.ts +0 -131
  363. package/dist/types/ThirdParty/CgMq.d.ts +0 -51
  364. package/dist/types/ThirdParty/EmailTool.d.ts +0 -5
  365. package/dist/types/ThirdParty/OpenSocial.d.ts +0 -7
  366. package/dist/types/ThirdParty/QQTool.d.ts +0 -41
  367. package/dist/types/ThirdParty/QiniuTool.d.ts +0 -6
  368. package/dist/types/ThirdParty/Rpc.d.ts +0 -20
  369. package/dist/types/ThirdParty/WechatOATool.d.ts +0 -13
  370. package/dist/types/ThirdParty/WechatTool.d.ts +0 -20
  371. package/dist/types/WebServer/Controller/BaseController.d.ts +0 -33
  372. package/dist/types/WebServer/Controller/BaseUserController.d.ts +0 -27
  373. package/dist/types/WebServer/Controller/MongoBaseUserController.d.ts +0 -27
  374. package/dist/types/WebServer/Decorator/AdminValidate.d.ts +0 -1
  375. package/dist/types/WebServer/Decorator/AuthorityValidate.d.ts +0 -2
  376. package/dist/types/WebServer/Decorator/CreatorValidate.d.ts +0 -1
  377. package/dist/types/WebServer/Decorator/JsonAdminValidate.d.ts +0 -1
  378. package/dist/types/WebServer/Decorator/JsonAuthorityValidate.d.ts +0 -2
  379. package/dist/types/WebServer/Decorator/JsonCreatorValidate.d.ts +0 -1
  380. package/dist/types/WebServer/Decorator/SyncCall.d.ts +0 -7
  381. package/dist/types/WebServer/Decorator/SyncCallServer.d.ts +0 -7
  382. package/dist/types/WebServer/Engine/ControllerManager.d.ts +0 -35
  383. package/dist/types/WebServer/Engine/Engine.d.ts +0 -21
  384. package/dist/types/WebServer/Engine/RazorJs.d.ts +0 -21
  385. package/dist/types/WebServer/Engine/Request.d.ts +0 -35
  386. package/dist/types/WebServer/Engine/Response.d.ts +0 -30
  387. package/dist/types/WebServer/IWebServer.d.ts +0 -20
  388. package/dist/types/cgserver.d.ts +0 -24
  389. package/dist/types/index.d.ts +0 -85
@@ -1,34 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.GProtoFactory = void 0;
4
- var GoogleProtoFilter_1 = require("./GoogleProtoFilter");
5
- var JsonProtoFilter_1 = require("./JsonProtoFilter");
6
- var IProtoFilter_1 = require("./IProtoFilter");
7
- exports.GProtoFactory = null;
8
- var ProtoFactory = /** @class */ (function () {
9
- function ProtoFactory() {
10
- this._filters = new Map();
11
- }
12
- ProtoFactory.prototype.createFilter = function (type) {
13
- var filter = this._filters.get(type);
14
- if (filter) {
15
- return filter;
16
- }
17
- switch (type) {
18
- case IProtoFilter_1.EProtoType.GoogleProtoBuffer:
19
- {
20
- filter = new GoogleProtoFilter_1.GoogleProtoFilter();
21
- break;
22
- }
23
- default:
24
- {
25
- filter = new JsonProtoFilter_1.JsonProtoFilter();
26
- break;
27
- }
28
- }
29
- this._filters.set(type, filter);
30
- return filter;
31
- };
32
- return ProtoFactory;
33
- }());
34
- exports.GProtoFactory = new ProtoFactory();
@@ -1,264 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- exports.__esModule = true;
39
- exports.GAlipayTool = exports.AlipayCallBack = exports.AlipayResult = void 0;
40
- var alipay_sdk_1 = require("alipay-sdk");
41
- var aliUtil = require("alipay-sdk/lib/util");
42
- var AliPayUtil_1 = require("alipay_sdk2/AliPayUtil");
43
- var fs = require("fs");
44
- var form_1 = require("alipay-sdk/lib/form");
45
- var Log_1 = require("../Logic/Log");
46
- var IServerConfig_1 = require("../Config/IServerConfig");
47
- var AlipayResult = /** @class */ (function () {
48
- function AlipayResult() {
49
- this.alipay_trade_app_pay_response = {
50
- code: "10000",
51
- msg: "Success",
52
- app_id: "2021003143637369",
53
- auth_app_id: "2021003143637369",
54
- charset: "utf-8",
55
- timestamp: "2022-08-10 16:38:04",
56
- out_trade_no: "62f36e657a355ecc1cb8eec2",
57
- total_amount: "0.05",
58
- trade_no: "2022081022001489431433911625",
59
- seller_id: "2088441785429273"
60
- };
61
- this.sign = "d/Guf6QYnuk9fFlRS1EUFTY+n3/jQKp7IwQENG4WXO+qxMGglPXa3RhUHaJELTMwC4tcKhz8Z8GCiiI1Y7G84kAql1jyoekaOMWvdPRDOjkAqouP3oh5v9r23BziJUxgv/kanBRfOoTKvIT7R0L5DyfxMpEoHdssPHAtENMiniCVZlRUkAhHxjmgMrP0rzMtBvqctC5Me6UiV1yBdGWecLk9RNwMTZF8QSXKVpWXmhmimdjjFjGMcE6r7LoV9YW1Bsvjoq2kdRMX7CJZufGk1Y5Qz8Cv+E9QxTnDJMtA0XyYzte53/dSw0W3Z4Gbosn/kV4QDBRzN39NwwuoFwGuVg==";
62
- this.sign_type = "RSA2";
63
- }
64
- return AlipayResult;
65
- }());
66
- exports.AlipayResult = AlipayResult;
67
- var AlipayCallBack = /** @class */ (function () {
68
- function AlipayCallBack() {
69
- this.gmt_create = "2022-08-10 16=38=03";
70
- this.charset = "utf-8";
71
- this.seller_email = "zdpuke@163.com";
72
- this.subject = "一把砖石";
73
- this.sign = "gytkeBGeea9V05lI6Qvvut8CZnXtXJmbb0dMDd76a6fgN2k2IO0HH4wkJylMQG3EXYJQctysURDtIB0dhqaZbDVtePsM3iQVeI2jwT3YS3XGS4xi13k8foag9vCcSgojKjxJS3ihfzuyK/Pc+KDTOQftoWP2s1dPUpJNGLcZp4sUFysl0Iyzf+2vXh4OJUPQ3DvCqePnDUawq1+AUUj63WHWvdsGCP70+eTsbKxJxWBhHfMVrwkOmUI0zivcHpHLVHbfTFvaM5LAa/ivSU8jiDHqgHYFZqqzTyZ1DLxEy0Ypo3sKBs5eK/UhdsNf5tjse7PxYJwMU2ziIo9gnqv6fQ==";
74
- this.buyer_id = 2088202482689432;
75
- this.invoice_amount = "0.05";
76
- this.notify_id = 2.022081000222164e+33;
77
- this.fund_bill_list = [{ amount: "0.05", fundChannel: "PCREDIT" }];
78
- this.notify_type = "trade_status_sync";
79
- this.trade_status = "TRADE_SUCCESS";
80
- this.receipt_amount = "0.05";
81
- this.app_id = 2021003143637369;
82
- this.buyer_pay_amount = "0.05";
83
- this.sign_type = "RSA2";
84
- this.seller_id = 2088441785429273;
85
- this.gmt_payment = "2022-08-10 16:38:03";
86
- this.notify_time = "2022-08-10 16:38:04";
87
- this.version = 1;
88
- this.out_trade_no = "62f36e657a355ecc1cb8eec2";
89
- this.total_amount = "0.05";
90
- this.trade_no = 2.0220810220014894e+27;
91
- this.auth_app_id = 2021003143637369;
92
- this.buyer_logon_id = "138****3531";
93
- this.point_amount = 0;
94
- }
95
- return AlipayCallBack;
96
- }());
97
- exports.AlipayCallBack = AlipayCallBack;
98
- exports.GAlipayTool = null;
99
- var AlipayTool = /** @class */ (function () {
100
- function AlipayTool() {
101
- this._alipaySdk = null;
102
- this._aliPay = null;
103
- this._cfg = {
104
- app_id: "",
105
- app_key: "",
106
- gateway: "",
107
- //RSA1 RSA2
108
- signType: 'RSA2',
109
- /** 指定private key类型, 默认: PKCS1, PKCS8: PRIVATE KEY, PKCS1: RSA PRIVATE KEY */
110
- keyType: 'PKCS1',
111
- alipay_root_cert_sn: "",
112
- alipay_cert_sn: "",
113
- app_cert_sn: "",
114
- notify_url: ""
115
- };
116
- }
117
- AlipayTool.prototype.init = function () {
118
- if (!IServerConfig_1.GServerCfg.third_cfg.alipay
119
- || !IServerConfig_1.GServerCfg.third_cfg.alipay.open) {
120
- return false;
121
- }
122
- var suffix = "";
123
- if (IServerConfig_1.GServerCfg.third_cfg.alipay.dev) {
124
- suffix = "_dev";
125
- }
126
- this._cfg = {
127
- app_id: IServerConfig_1.GServerCfg.third_cfg.alipay["app_id" + suffix],
128
- app_key: IServerConfig_1.GServerCfg.third_cfg.alipay["app_key" + suffix],
129
- gateway: IServerConfig_1.GServerCfg.third_cfg.alipay["gateway" + suffix],
130
- //RSA1 RSA2
131
- signType: IServerConfig_1.GServerCfg.third_cfg.alipay["signType" + suffix],
132
- /** 指定private key类型, 默认: PKCS1, PKCS8: PRIVATE KEY, PKCS1: RSA PRIVATE KEY */
133
- keyType: IServerConfig_1.GServerCfg.third_cfg.alipay["signType" + suffix],
134
- alipay_root_cert_sn: IServerConfig_1.GServerCfg.third_cfg.alipay["alipay_root_cert_sn" + suffix],
135
- alipay_cert_sn: IServerConfig_1.GServerCfg.third_cfg.alipay["alipay_cert_sn" + suffix],
136
- app_cert_sn: IServerConfig_1.GServerCfg.third_cfg.alipay["app_cert_sn" + suffix],
137
- notify_url: IServerConfig_1.GServerCfg.third_cfg.alipay["notify_url" + suffix]
138
- };
139
- if (this._cfg.alipay_cert_sn) {
140
- this._aliPay = new AliPayUtil_1.AliPayUtil(this._cfg.alipay_cert_sn, this._cfg.app_key);
141
- }
142
- else {
143
- var app_key = "";
144
- if (this._cfg.app_key.indexOf(".pem") > 0) {
145
- app_key = fs.readFileSync(this._cfg.app_key, 'ascii');
146
- }
147
- else {
148
- app_key = this._cfg.app_key;
149
- }
150
- this._alipaySdk = new alipay_sdk_1["default"]({
151
- appId: this._cfg.app_id,
152
- privateKey: app_key,
153
- gateway: this._cfg.gateway,
154
- signType: this._cfg.signType,
155
- keyType: this._cfg.keyType
156
- });
157
- }
158
- };
159
- /**
160
- * charset:"utf-8",method:"alipay.trade.app.pay",sign_type:"RSA2,version:"1.0"
161
- * @param out_trade_no
162
- * @param total_amount
163
- * @param subject
164
- * @param body
165
- * @param timeout_express
166
- * @param product_code
167
- * @returns
168
- */
169
- AlipayTool.prototype._buildOrderParams = function (out_trade_no, total_amount, subject, body, timeout_express, product_code) {
170
- if (subject === void 0) { subject = "1"; }
171
- if (body === void 0) { body = "我是测试数据"; }
172
- if (timeout_express === void 0) { timeout_express = "30m"; }
173
- if (product_code === void 0) { product_code = "QUICK_MSECURITY_PAY"; }
174
- var order_params = {
175
- notifyUrl: this._cfg.notify_url,
176
- bizContent: {
177
- timeout_express: timeout_express,
178
- product_code: product_code,
179
- total_amount: total_amount,
180
- subject: encodeURIComponent(subject),
181
- body: encodeURIComponent(body),
182
- out_trade_no: out_trade_no
183
- }
184
- };
185
- return order_params;
186
- };
187
- AlipayTool.prototype._sign = function (order_params) {
188
- var sign = aliUtil.sign("alipay.trade.app.pay", order_params, this._alipaySdk.config);
189
- return sign;
190
- };
191
- AlipayTool.prototype.getOrderInfo = function (out_trade_no, total_amount, subject, body) {
192
- if (subject === void 0) { subject = "1"; }
193
- if (body === void 0) { body = "我是测试数据"; }
194
- var order_params = this._buildOrderParams(out_trade_no, total_amount, subject, body);
195
- var sign = this._sign(order_params);
196
- var _a = this._alipaySdk["formatUrl"]("", sign), url = _a.url, execParams = _a.execParams;
197
- var order_info = (url + '&biz_content=' + encodeURIComponent(execParams.biz_content)).substring(1);
198
- return order_info;
199
- };
200
- /**
201
- *
202
- * @param title
203
- * @param order_id
204
- * @param money
205
- */
206
- AlipayTool.prototype.doPay = function (title, order_id, money) {
207
- var param = {
208
- app_id: this._cfg.app_id,
209
- notify_url: this._cfg.notify_url,
210
- app_cert_sn: this._cfg.app_cert_sn,
211
- alipay_root_cert_sn: this._cfg.alipay_root_cert_sn,
212
- subject: title,
213
- trade_no: order_id,
214
- total_amount: money
215
- };
216
- var str = this._aliPay.getPayCode(param);
217
- return str;
218
- };
219
- AlipayTool.prototype.rsaCheck = function (payInfo) {
220
- return this._aliPay.rsaCheck(payInfo);
221
- };
222
- /**
223
- *
224
- * @param method get|post
225
- * @param notifyUrl 通知回调
226
- * @param returnUrl
227
- * @param outTradeNo
228
- * @param money 价格
229
- * @param subject 标题
230
- * @param body 内容介绍
231
- */
232
- AlipayTool.prototype.getAlipayPage = function (method, notifyUrl, returnUrl, outTradeNo, money, subject, body) {
233
- return __awaiter(this, void 0, void 0, function () {
234
- var formData, url_or_html;
235
- return __generator(this, function (_a) {
236
- switch (_a.label) {
237
- case 0:
238
- if (!this._alipaySdk) {
239
- Log_1.GLog.error("并未配置alipay或者初始化失败");
240
- return [2 /*return*/];
241
- }
242
- formData = new form_1["default"]();
243
- // 调用 setMethod 并传入 get,会返回可以跳转到支付页面的 url
244
- formData.setMethod(method);
245
- formData.addField("return_url", returnUrl);
246
- formData.addField('notifyUrl', notifyUrl);
247
- formData.addField('bizContent', {
248
- outTradeNo: outTradeNo,
249
- productCode: "FAST_INSTANT_TRADE_PAY",
250
- totalAmount: money,
251
- subject: subject,
252
- body: body
253
- });
254
- return [4 /*yield*/, this._alipaySdk.exec('alipay.trade.page.pay', {}, { formData: formData })];
255
- case 1:
256
- url_or_html = _a.sent();
257
- return [2 /*return*/, url_or_html];
258
- }
259
- });
260
- });
261
- };
262
- return AlipayTool;
263
- }());
264
- exports.GAlipayTool = new AlipayTool();
@@ -1,50 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.GSmsTool = void 0;
4
- var IServerConfig_1 = require("../Config/IServerConfig");
5
- var Log_1 = require("./../Logic/Log");
6
- var SMSClient = require("@alicloud/sms-sdk");
7
- exports.GSmsTool = null;
8
- var SMSTool = /** @class */ (function () {
9
- function SMSTool() {
10
- this._is_init = false;
11
- this._sms_client = null;
12
- }
13
- SMSTool.prototype.init = function () {
14
- if (this._is_init) {
15
- return true;
16
- }
17
- this._is_init = true;
18
- this._sms_client = new SMSClient({ accessKeyId: IServerConfig_1.GServerCfg.third_cfg.aliSms.accessKeyId, secretAccessKey: IServerConfig_1.GServerCfg.third_cfg.aliSms.secretAccessKey });
19
- };
20
- /**
21
- * 发送短信验证码
22
- * @param code 验证码
23
- * @param phone 手机号
24
- * @param callback 回调
25
- */
26
- SMSTool.prototype.sendSMS = function (code, phone) {
27
- var _this = this;
28
- return new Promise(function (resolve, reject) {
29
- _this._sms_client.sendSMS({
30
- PhoneNumbers: phone,
31
- SignName: IServerConfig_1.GServerCfg.third_cfg.aliSms.signName,
32
- TemplateCode: IServerConfig_1.GServerCfg.third_cfg.aliSms.templateCode,
33
- TemplateParam: JSON.stringify({ code: code })
34
- }).then(function (res) {
35
- if (res.Code == "OK") {
36
- resolve(null);
37
- }
38
- else {
39
- Log_1.GLog.error("phone:" + phone + " code:" + res.Code);
40
- resolve(res.Code);
41
- }
42
- }, function (err) {
43
- Log_1.GLog.error(err);
44
- resolve(err);
45
- });
46
- });
47
- };
48
- return SMSTool;
49
- }());
50
- exports.GSmsTool = new SMSTool();
@@ -1,314 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- exports.__esModule = true;
39
- exports.GAppleTool = exports.NotificationBody = exports.NotificationType = exports.ResponseBody = void 0;
40
- var Log_1 = require("../Logic/Log");
41
- var HttpTool_1 = require("./../Logic/HttpTool");
42
- var ec_key_1 = require("ec-key");
43
- var uuid_1 = require("uuid");
44
- var fs = require("fs");
45
- var IServerConfig_1 = require("../Config/IServerConfig");
46
- //developer.apple.com/documentation/appstorereceipts/responsebody
47
- var ReceiptInfo = /** @class */ (function () {
48
- function ReceiptInfo() {
49
- this.cancellation_date = "";
50
- this.cancellation_date_ms = "";
51
- this.cancellation_date_pst = "";
52
- this.cancellation_date_reason = "";
53
- this.expires_date = "2021-03-10 14:25:54 Etc/GMT";
54
- this.expires_date_ms = "1615386354000";
55
- this.expires_date_pst = "2021-03-10 06:25:54 America/Los_Angeles";
56
- this.is_in_intro_offer_period = false;
57
- this.is_trial_period = false;
58
- this.is_upgraded = false;
59
- this.offer_code_ref_name = "";
60
- this.original_purchase_date = "2021-03-10 08:22:26 Etc/GMT";
61
- this.original_purchase_date_ms = "1615364546000";
62
- this.original_purchase_date_pst = "2021-03-10 00:22:26 America/Los_Angeles";
63
- this.original_transaction_id = "1000000786747716";
64
- this.purchase_date = "2021-03-10 14:22:54 Etc/GMT";
65
- this.purchase_date_ms = "1615386174000";
66
- this.purchase_date_pst = "2021-03-10 06:22:54 America/Los_Angeles";
67
- this.quantity = 1;
68
- this.subscription_group_identifier = "20745320";
69
- this.web_order_line_item_id = "1000000060695307";
70
- this.transaction_id = "1000000786974540";
71
- this.product_id = "com.eryi.eyreader.week";
72
- }
73
- return ReceiptInfo;
74
- }());
75
- var PendingRenewalInfo = /** @class */ (function () {
76
- function PendingRenewalInfo() {
77
- this.auto_renew_product_id = "com.eryi.eyreader.week";
78
- this.auto_renew_status = 0;
79
- this.expiration_intent = 1;
80
- this.grace_period_expires_date = "";
81
- this.grace_period_expires_date_ms = "";
82
- this.grace_period_expires_date_pst = "";
83
- this.is_in_billing_retry_period = 0;
84
- this.offer_code_ref_name = "";
85
- this.original_transaction_id = "1000000786747716";
86
- this.price_consent_status = "";
87
- this.product_id = "com.eryi.eyreader.week";
88
- this.promotional_offer_id = "";
89
- }
90
- return PendingRenewalInfo;
91
- }());
92
- var InApp = /** @class */ (function () {
93
- function InApp() {
94
- this.cancellation_date = "";
95
- this.cancellation_date_ms = "";
96
- this.cancellation_date_pst = "";
97
- this.cancellation_reason = "";
98
- this.expires_date = "2021-03-10 14:25:54 Etc/GMT";
99
- this.expires_date_ms = "1615386354000";
100
- this.expires_date_pst = "2021-03-10 06:25:54 America/Los_Angeles";
101
- this.is_in_intro_offer_period = false;
102
- this.is_trial_period = false;
103
- this.original_purchase_date = "2021-03-10 08:22:26 Etc/GMT";
104
- this.original_purchase_date_ms = "1615364546000";
105
- this.original_purchase_date_pst = "2021-03-10 00:22:26 America/Los_Angeles";
106
- this.original_transaction_id = "1000000786747716";
107
- this.product_id = "com.eryi.eyreader.week";
108
- this.promotional_offer_id = "";
109
- this.purchase_date = "2021-03-10 14:22:54 Etc/GMT";
110
- this.purchase_date_ms = "1615386174000";
111
- this.purchase_date_pst = "2021-03-10 06:22:54 America/Los_Angeles";
112
- this.quantity = 1;
113
- this.transaction_id = "1000000786974540";
114
- this.web_order_line_item_id = "1000000060695307";
115
- }
116
- return InApp;
117
- }());
118
- var Receipt = /** @class */ (function () {
119
- function Receipt() {
120
- this.adam_id = -1;
121
- this.app_item_id = -1;
122
- this.application_version = "";
123
- this.bundle_id = "";
124
- this.download_id = -1;
125
- this.expiration_date = "";
126
- this.expiration_date_ms = "";
127
- this.expiration_date_pst = "";
128
- this.in_app = null;
129
- this.original_application_version = "";
130
- this.original_purchase_date = "";
131
- this.original_purchase_date_ms = "";
132
- this.original_purchase_date_pst = "";
133
- this.preorder_date = "";
134
- this.preorder_date_ms = "";
135
- this.preorder_date_pst = "";
136
- this.receipt_creation_date = "";
137
- this.receipt_creation_date_ms = "";
138
- this.receipt_creation_date_pst = "";
139
- this.receipt_type = "";
140
- this.request_date = "";
141
- this.request_date_ms = "";
142
- this.request_date_pst = "";
143
- this.version_external_identifier = -1;
144
- }
145
- return Receipt;
146
- }());
147
- var ResponseBody = /** @class */ (function () {
148
- function ResponseBody() {
149
- this.environment = "Sandbox";
150
- this.is_retryable = false; //出错之后的重试
151
- this.latest_receipt = "0OkG/Sw==";
152
- this.latest_receipt_info = null;
153
- this.pending_renewal_info = null;
154
- this.receipt = null;
155
- this.status = 0;
156
- }
157
- return ResponseBody;
158
- }());
159
- exports.ResponseBody = ResponseBody;
160
- var NotificationType = /** @class */ (function () {
161
- function NotificationType() {
162
- }
163
- //退款
164
- NotificationType.CANCEL = "CANCEL";
165
- //变更续订方式,下次续订的时候生效,当前不变
166
- NotificationType.DID_CHANGE_RENEWAL_PREF = "DID_CHANGE_RENEWAL_PREF";
167
- /*
168
- 续订状态发生变化的时候通知
169
- 检查auto_renew_status_change_date_ms获取最新的状态更新时间.
170
- 通过auto_renew_status了解当前续订状态.
171
- */
172
- NotificationType.DID_CHANGE_RENEWAL_STATUS = "DID_CHANGE_RENEWAL_STATUS";
173
- //自动续订了一个之前续订失败了的续订
174
- NotificationType.DID_RECOVER = "DID_RECOVER";
175
- //自动续订成功
176
- NotificationType.DID_RENEW = "DID_RENEW";
177
- //客户交互更新订阅,订阅可以立刻生效
178
- NotificationType.INTERACTIVE_RENEWAL = "INTERACTIVE_RENEWAL";
179
- return NotificationType;
180
- }());
181
- exports.NotificationType = NotificationType;
182
- var NotificationBody = /** @class */ (function () {
183
- function NotificationBody() {
184
- this.unified_receipt = null;
185
- this.environment = "Sandbox";
186
- this.auto_renew_status = "false";
187
- this.auto_renew_status_change_date = "2021-03-11 03:03:14 Etc/GMT";
188
- this.bvrs = "1";
189
- this.bid = "com.eryi.eyreader";
190
- this.password = "5203c7781e254aac8942290a0a2467ac";
191
- this.auto_renew_product_id = "com.eryi.eyreader.week";
192
- this.notification_type = NotificationType.DID_RECOVER;
193
- }
194
- return NotificationBody;
195
- }());
196
- exports.NotificationBody = NotificationBody;
197
- var RequestBody = /** @class */ (function () {
198
- function RequestBody() {
199
- this["receipt-data"] = "";
200
- this.password = "5203c7781e254aac8942290a0a2467ac";
201
- this["exclude-old-transactions"] = true;
202
- }
203
- return RequestBody;
204
- }());
205
- exports.GAppleTool = null;
206
- var AppleTool = /** @class */ (function () {
207
- function AppleTool() {
208
- this._verifyUrl = "https://buy.itunes.apple.com/verifyReceipt";
209
- this._sandboxVerifyUrl = "https://sandbox.itunes.apple.com/verifyReceipt";
210
- }
211
- AppleTool.prototype.onNotify = function (nb) {
212
- var _a, _b, _c;
213
- return __awaiter(this, void 0, void 0, function () {
214
- var ris, latest_one, msg;
215
- return __generator(this, function (_d) {
216
- ris = (_a = nb.unified_receipt) === null || _a === void 0 ? void 0 : _a.latest_receipt_info;
217
- latest_one = ((ris === null || ris === void 0 ? void 0 : ris.length) > 0 ? ris[0] : null);
218
- msg = {
219
- "notification_type": nb.notification_type,
220
- "status": nb.unified_receipt.status,
221
- "environment": nb.environment,
222
- "auto_renew_status": nb.auto_renew_status,
223
- "orginal_transaction_id": latest_one === null || latest_one === void 0 ? void 0 : latest_one.original_transaction_id,
224
- "transaction_id": latest_one === null || latest_one === void 0 ? void 0 : latest_one.transaction_id,
225
- "expire_date": latest_one === null || latest_one === void 0 ? void 0 : latest_one.expires_date,
226
- "receipt_expire_date": (_c = (_b = nb.unified_receipt) === null || _b === void 0 ? void 0 : _b.receipt) === null || _c === void 0 ? void 0 : _c.expiration_date
227
- };
228
- Log_1.GLog.info(msg);
229
- Log_1.GLog.info(nb);
230
- return [2 /*return*/];
231
- });
232
- });
233
- };
234
- AppleTool.prototype.onVerify = function (receipt, environment) {
235
- return __awaiter(this, void 0, void 0, function () {
236
- var url, reqb, resb;
237
- return __generator(this, function (_a) {
238
- switch (_a.label) {
239
- case 0:
240
- Log_1.GLog.info("begin onVerify============================" + environment);
241
- url = this._verifyUrl;
242
- // if(environment.toLowerCase()=="sandbox")
243
- // {
244
- // url=this._sandboxVerifyUrl
245
- // }
246
- Log_1.GLog.info("url============================" + url);
247
- reqb = new RequestBody();
248
- reqb['receipt-data'] = receipt;
249
- return [4 /*yield*/, HttpTool_1.GHttpTool.post({ url: url, form: JSON.stringify(reqb) })];
250
- case 1:
251
- resb = (_a.sent()).body;
252
- Log_1.GLog.info("production end onVerify_Res============================status=" + (resb ? resb.status : "null"));
253
- if (!(resb && resb.status == 21007)) return [3 /*break*/, 3];
254
- url = this._sandboxVerifyUrl;
255
- return [4 /*yield*/, HttpTool_1.GHttpTool.post({ url: url, form: JSON.stringify(reqb) })];
256
- case 2:
257
- resb = (_a.sent()).body;
258
- Log_1.GLog.info("sandbox end onVerify_Res============================status=" + (resb ? resb.status : "null"));
259
- _a.label = 3;
260
- case 3:
261
- Log_1.GLog.info(resb);
262
- return [2 /*return*/, resb];
263
- }
264
- });
265
- });
266
- };
267
- AppleTool.prototype.signature = function (nickname, create_time, appBundleID, productIdentifier, offerIdentifier) {
268
- var keyIdentifier = "";
269
- for (var k in IServerConfig_1.GServerCfg.third_cfg.apple.keyIds) {
270
- keyIdentifier = k;
271
- break;
272
- }
273
- var nonce = (0, uuid_1.v4)();
274
- var payload = appBundleID + '\u2063' +
275
- keyIdentifier + '\u2063' +
276
- productIdentifier + '\u2063' +
277
- offerIdentifier + '\u2063' +
278
- nickname + '\u2063' +
279
- nonce.toLowerCase() + '\u2063' +
280
- create_time;
281
- // Get the PEM-formatted private key string associated with the Key ID.
282
- var path = IServerConfig_1.GServerCfg.third_cfg.apple.keyIds[keyIdentifier];
283
- var keyString = fs.readFileSync(path).toString();
284
- // Create an Elliptic Curve Digital Signature Algorithm (ECDSA) object using the private key.
285
- var key = new ec_key_1["default"](keyString, 'pem');
286
- // Set up the cryptographic format used to sign the key with the SHA-256 hashing algorithm.
287
- var cryptoSign = key.createSign('SHA256');
288
- // Add the payload string to sign.
289
- cryptoSign.update(payload);
290
- /*
291
- The Node.js crypto library creates a DER-formatted binary value signature,
292
- and then base-64 encodes it to create the string that you will use in StoreKit.
293
- */
294
- var signature = cryptoSign.sign('base64');
295
- /*
296
- Check that the signature passes verification by using the ec-key library.
297
- The verification process is similar to creating the signature, except it uses 'createVerify'
298
- instead of 'createSign', and after updating it with the payload, it uses `verify` to pass in
299
- the signature and encoding, instead of `sign` to get the signature.
300
-
301
- This step is not required, but it's useful to check when implementing your signature code.
302
- This helps debug issues with signing before sending transactions to Apple.
303
- If verification succeeds, the next recommended testing step is attempting a purchase
304
- in the Sandbox environment.
305
- */
306
- var verificationResult = key.createVerify('SHA256').update(payload).verify(signature, 'base64');
307
- if (verificationResult) {
308
- return { 'keyIdentifier': keyIdentifier, 'nonce': nonce, 'timestamp': create_time, 'signature': signature };
309
- }
310
- return;
311
- };
312
- return AppleTool;
313
- }());
314
- exports.GAppleTool = new AppleTool();