@xmobitea/gn-typescript-client 2.6.13 → 2.6.14

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 (286) hide show
  1. package/AGENTS.md +37 -0
  2. package/README.MD +420 -1
  3. package/dist/gearn.js.client.js +25056 -1056
  4. package/dist/gearn.js.client.min.js +1 -1
  5. package/dist/index.d.ts +30 -0
  6. package/dist/index.js +24236 -212
  7. package/dist/runtime/GNNetwork.d.ts +687 -3
  8. package/dist/runtime/GNNetworkAuthenticateApi.d.ts +327 -0
  9. package/dist/runtime/GNNetworkCharacterPlayerApi.d.ts +1026 -0
  10. package/dist/runtime/GNNetworkCloudScriptApi.d.ts +141 -0
  11. package/dist/runtime/GNNetworkContentApi.d.ts +243 -0
  12. package/dist/runtime/GNNetworkDashboardApi.d.ts +221 -0
  13. package/dist/runtime/GNNetworkGamePlayerApi.d.ts +1033 -0
  14. package/dist/runtime/GNNetworkGroupApi.d.ts +783 -0
  15. package/dist/runtime/GNNetworkInventoryApi.d.ts +673 -0
  16. package/dist/runtime/GNNetworkMasterPlayerApi.d.ts +1614 -6
  17. package/dist/runtime/GNNetworkMultiplayerApi.d.ts +234 -0
  18. package/dist/runtime/GNNetworkStoreInventoryApi.d.ts +309 -0
  19. package/dist/runtime/common/Action0.d.ts +30 -0
  20. package/dist/runtime/common/Action1.d.ts +32 -0
  21. package/dist/runtime/common/Action2.d.ts +21 -0
  22. package/dist/runtime/common/Action3.d.ts +16 -0
  23. package/dist/runtime/common/Action4.d.ts +17 -0
  24. package/dist/runtime/common/GNData.d.ts +368 -0
  25. package/dist/runtime/config/GNServerSettings.d.ts +442 -12
  26. package/dist/runtime/constant/Commands.d.ts +80 -0
  27. package/dist/runtime/constant/EventCode.d.ts +48 -0
  28. package/dist/runtime/constant/OperationCode.d.ts +74 -1
  29. package/dist/runtime/constant/ReturnCode.d.ts +72 -0
  30. package/dist/runtime/constant/enumType/ExecuteResponseStatus.d.ts +31 -0
  31. package/dist/runtime/constant/enumType/FriendStatus.d.ts +39 -0
  32. package/dist/runtime/constant/enumType/GoogleLoginType.d.ts +23 -0
  33. package/dist/runtime/constant/enumType/GroupStatus.d.ts +32 -0
  34. package/dist/runtime/constant/enumType/InvalidMemberType.d.ts +75 -0
  35. package/dist/runtime/constant/enumType/ItemType.d.ts +23 -0
  36. package/dist/runtime/constant/enumType/MatchStatus.d.ts +30 -0
  37. package/dist/runtime/constant/enumType/MatchmakingMemberStatus.d.ts +24 -0
  38. package/dist/runtime/constant/enumType/MatchmakingTicketStatus.d.ts +34 -0
  39. package/dist/runtime/constant/enumType/OwnerType.d.ts +40 -0
  40. package/dist/runtime/constant/enumType/PermissionDataItem.d.ts +22 -0
  41. package/dist/runtime/constant/enumType/PushPlatformType.d.ts +18 -0
  42. package/dist/runtime/constant/enumType/RequestRole.d.ts +32 -0
  43. package/dist/runtime/constant/enumType/RequestType.d.ts +70 -0
  44. package/dist/runtime/constant/enumType/StoreItemType.d.ts +21 -0
  45. package/dist/runtime/constant/enumType/StoreReceiveType.d.ts +30 -0
  46. package/dist/runtime/constant/errorCode/ErrorCode.d.ts +190 -8
  47. package/dist/runtime/constant/parameterCode/ParameterCode.d.ts +35 -5
  48. package/dist/runtime/entity/DataMember.d.ts +338 -0
  49. package/dist/runtime/entity/GNMetadata.d.ts +101 -0
  50. package/dist/runtime/entity/InvalidMember.d.ts +28 -0
  51. package/dist/runtime/entity/OperationEvent.d.ts +49 -0
  52. package/dist/runtime/entity/OperationRequest.d.ts +108 -0
  53. package/dist/runtime/entity/OperationResponse.d.ts +110 -0
  54. package/dist/runtime/entity/models/AuthenticateModels.d.ts +115 -0
  55. package/dist/runtime/entity/models/AuthenticateRequestModels.d.ts +131 -0
  56. package/dist/runtime/entity/models/AuthenticateResponseModels.d.ts +131 -0
  57. package/dist/runtime/entity/models/CharacterPlayerModels.d.ts +625 -1
  58. package/dist/runtime/entity/models/CharacterPlayerRequestModels.d.ts +972 -0
  59. package/dist/runtime/entity/models/CharacterPlayerResponseModels.d.ts +332 -0
  60. package/dist/runtime/entity/models/CloudScriptModels.d.ts +109 -0
  61. package/dist/runtime/entity/models/CloudScriptRequestModels.d.ts +107 -0
  62. package/dist/runtime/entity/models/CloudScriptResponseModels.d.ts +46 -0
  63. package/dist/runtime/entity/models/ContentModels.d.ts +124 -0
  64. package/dist/runtime/entity/models/ContentRequestModels.d.ts +152 -0
  65. package/dist/runtime/entity/models/ContentResponseModels.d.ts +58 -0
  66. package/dist/runtime/entity/models/DashboardModels.d.ts +371 -8
  67. package/dist/runtime/entity/models/DashboardRequestModels.d.ts +172 -0
  68. package/dist/runtime/entity/models/DashboardResponseModels.d.ts +170 -0
  69. package/dist/runtime/entity/models/GamePlayerModels.d.ts +644 -1
  70. package/dist/runtime/entity/models/GamePlayerRequestModels.d.ts +959 -0
  71. package/dist/runtime/entity/models/GamePlayerResponseModels.d.ts +333 -1
  72. package/dist/runtime/entity/models/GenericModels.d.ts +94 -0
  73. package/dist/runtime/entity/models/GroupModels.d.ts +484 -2
  74. package/dist/runtime/entity/models/GroupRequestModels.d.ts +737 -0
  75. package/dist/runtime/entity/models/GroupResponseModels.d.ts +254 -0
  76. package/dist/runtime/entity/models/InventoryModels.d.ts +415 -0
  77. package/dist/runtime/entity/models/InventoryRequestModels.d.ts +629 -0
  78. package/dist/runtime/entity/models/InventoryResponseModels.d.ts +218 -0
  79. package/dist/runtime/entity/models/MasterPlayerModels.d.ts +1065 -3
  80. package/dist/runtime/entity/models/MasterPlayerRequestModels.d.ts +1560 -6
  81. package/dist/runtime/entity/models/MasterPlayerResponseModels.d.ts +532 -1
  82. package/dist/runtime/entity/models/MultiplayerModels.d.ts +199 -0
  83. package/dist/runtime/entity/models/MultiplayerRequestModels.d.ts +196 -0
  84. package/dist/runtime/entity/models/MultiplayerResponseModels.d.ts +74 -0
  85. package/dist/runtime/entity/models/StoreInventoryModels.d.ts +262 -0
  86. package/dist/runtime/entity/models/StoreInventoryRequestModels.d.ts +268 -0
  87. package/dist/runtime/entity/models/StoreInventoryResponseModels.d.ts +98 -0
  88. package/dist/runtime/entity/request/CustomOperationRequest.d.ts +99 -0
  89. package/dist/runtime/entity/response/CustomOperationResponse.d.ts +118 -0
  90. package/dist/runtime/entity/response/GetAuthInfoResponse.d.ts +53 -0
  91. package/dist/runtime/entity/response/HealthCheckResponse.d.ts +56 -0
  92. package/dist/runtime/entity/response/UploadFileResponse.d.ts +19 -0
  93. package/dist/runtime/helper/CodeHelper.d.ts +122 -0
  94. package/dist/runtime/helper/ConverterService.d.ts +74 -0
  95. package/dist/runtime/helper/EnumUtility.d.ts +63 -0
  96. package/dist/runtime/helper/GNSupport.d.ts +64 -4
  97. package/dist/runtime/helper/GNUtils.d.ts +54 -0
  98. package/dist/runtime/helper/MessagePackConverterService.d.ts +48 -0
  99. package/dist/runtime/helper/OperationHelper.d.ts +51 -0
  100. package/dist/runtime/helper/StorageService.d.ts +48 -8
  101. package/dist/runtime/logger/GNDebug.d.ts +117 -0
  102. package/dist/runtime/networking/AuthenticateStatus.d.ts +64 -0
  103. package/dist/runtime/networking/IPeer.d.ts +83 -0
  104. package/dist/runtime/networking/NetworkingPeer.d.ts +256 -1
  105. package/dist/runtime/networking/OperationPending.d.ts +112 -0
  106. package/dist/runtime/networking/PeerBase.d.ts +231 -0
  107. package/dist/runtime/networking/handler/IServerEventHandler.d.ts +84 -0
  108. package/dist/runtime/networking/handler/OnCharacterPlayerFriendUpdateEventHandler.d.ts +69 -0
  109. package/dist/runtime/networking/handler/OnCharacterPlayerGroupUpdateEventHandler.d.ts +49 -0
  110. package/dist/runtime/networking/handler/OnGamePlayerFriendUpdateEventHandler.d.ts +50 -0
  111. package/dist/runtime/networking/handler/OnGamePlayerGroupUpdateEventHandler.d.ts +41 -0
  112. package/dist/runtime/networking/handler/OnGroupMemberUpdateEventHandler.d.ts +47 -0
  113. package/dist/runtime/networking/handler/OnGroupMessageUpdateEventHandler.d.ts +46 -0
  114. package/dist/runtime/networking/http/HttpPeer.d.ts +173 -0
  115. package/dist/runtime/networking/http/NetworkingHttpPeerBase.d.ts +87 -0
  116. package/dist/runtime/networking/http/NetworkingPeerAxiosRequest.d.ts +113 -0
  117. package/dist/runtime/networking/socket/NetworkingPeerSocketIOClient.d.ts +145 -0
  118. package/dist/runtime/networking/socket/NetworkingSocketPeerBase.d.ts +198 -0
  119. package/dist/runtime/networking/socket/SocketPeer.d.ts +155 -0
  120. package/dist/runtime/typescript/ServiceUpdate.d.ts +46 -0
  121. package/docs/AI_CHEATSHEET.md +211 -0
  122. package/docs/COOKBOOK.md +912 -0
  123. package/docs/RULES.md +307 -0
  124. package/docs/ai-manifest.json +725 -0
  125. package/docs/guides/AUTHENTICATE.md +246 -0
  126. package/docs/guides/CHARACTER_PLAYER.md +439 -0
  127. package/docs/guides/CLOUDSCRIPT.md +335 -0
  128. package/docs/guides/COCOS_CREATOR_INTEGRATION.md +150 -0
  129. package/docs/guides/CONTENT.md +291 -0
  130. package/docs/guides/DASHBOARD.md +262 -0
  131. package/docs/guides/GAME_PLAYER.md +473 -0
  132. package/docs/guides/GROUP.md +412 -0
  133. package/docs/guides/INVENTORY.md +375 -0
  134. package/docs/guides/MASTER_PLAYER.md +458 -0
  135. package/docs/guides/MULTIPLAYER.md +303 -0
  136. package/docs/guides/STORE_INVENTORY.md +313 -0
  137. package/docs/llms-full.txt +43 -0
  138. package/docs/reference/API_AUTHENTICATE.md +75 -0
  139. package/docs/reference/API_CHARACTER_PLAYER.md +226 -0
  140. package/docs/reference/API_CLOUDSCRIPT.md +82 -0
  141. package/docs/reference/API_CONTENT.md +88 -0
  142. package/docs/reference/API_DASHBOARD.md +82 -0
  143. package/docs/reference/API_GAME_PLAYER.md +223 -0
  144. package/docs/reference/API_GROUP.md +187 -0
  145. package/docs/reference/API_INDEX.md +57 -0
  146. package/docs/reference/API_INVENTORY.md +169 -0
  147. package/docs/reference/API_MASTER_PLAYER.md +323 -0
  148. package/docs/reference/API_MULTIPLAYER.md +97 -0
  149. package/docs/reference/API_STORE_INVENTORY.md +109 -0
  150. package/docs/reference/CONFIG.md +107 -0
  151. package/docs/reference/DTO_INDEX.md +2543 -0
  152. package/docs/reference/ENUMS.md +433 -0
  153. package/docs/reference/ERROR_HANDLING.md +159 -0
  154. package/docs/reference/EVENTS.md +188 -0
  155. package/docs/reference/PERMISSION_RULES.md +55 -0
  156. package/docs/reference/dto/AUTHENTICATE.md +619 -0
  157. package/docs/reference/dto/CHARACTER_PLAYER.md +3686 -0
  158. package/docs/reference/dto/CLOUDSCRIPT.md +400 -0
  159. package/docs/reference/dto/CONTENT.md +548 -0
  160. package/docs/reference/dto/DASHBOARD.md +1980 -0
  161. package/docs/reference/dto/GAME_PLAYER.md +3631 -0
  162. package/docs/reference/dto/GENERIC.md +151 -0
  163. package/docs/reference/dto/GROUP.md +2842 -0
  164. package/docs/reference/dto/INVENTORY.md +2385 -0
  165. package/docs/reference/dto/MASTER_PLAYER.md +6024 -0
  166. package/docs/reference/dto/MULTIPLAYER.md +850 -0
  167. package/docs/reference/dto/STORE_INVENTORY.md +1262 -0
  168. package/llms.txt +47 -0
  169. package/package.json +12 -3
  170. package/GNServerSettings.debug.json +0 -21
  171. package/docs/COCOS_CREATOR_INTEGRATION.md +0 -116
  172. package/examples/cocos-creator/GearNExample.ts.txt +0 -176
  173. package/srcSwift/Package.swift +0 -32
  174. package/srcSwift/Sources/GearN/runtime/GNNetwork.swift +0 -530
  175. package/srcSwift/Sources/GearN/runtime/GNNetworkAuthenticateApi.swift +0 -178
  176. package/srcSwift/Sources/GearN/runtime/GNNetworkCharacterPlayerApi.swift +0 -1162
  177. package/srcSwift/Sources/GearN/runtime/GNNetworkCloudScriptApi.swift +0 -154
  178. package/srcSwift/Sources/GearN/runtime/GNNetworkContentApi.swift +0 -208
  179. package/srcSwift/Sources/GearN/runtime/GNNetworkDashboardApi.swift +0 -240
  180. package/srcSwift/Sources/GearN/runtime/GNNetworkGamePlayerApi.swift +0 -1369
  181. package/srcSwift/Sources/GearN/runtime/GNNetworkGroupApi.swift +0 -1100
  182. package/srcSwift/Sources/GearN/runtime/GNNetworkInventoryApi.swift +0 -937
  183. package/srcSwift/Sources/GearN/runtime/GNNetworkMasterPlayerApi.swift +0 -2323
  184. package/srcSwift/Sources/GearN/runtime/GNNetworkMultiplayerApi.swift +0 -298
  185. package/srcSwift/Sources/GearN/runtime/GNNetworkStoreInventoryApi.swift +0 -397
  186. package/srcSwift/Sources/GearN/runtime/common/Action0.swift +0 -3
  187. package/srcSwift/Sources/GearN/runtime/common/Action1.swift +0 -3
  188. package/srcSwift/Sources/GearN/runtime/common/Action2.swift +0 -3
  189. package/srcSwift/Sources/GearN/runtime/common/Action3.swift +0 -3
  190. package/srcSwift/Sources/GearN/runtime/common/Action4.swift +0 -3
  191. package/srcSwift/Sources/GearN/runtime/common/GNArray.swift +0 -204
  192. package/srcSwift/Sources/GearN/runtime/common/GNData.swift +0 -108
  193. package/srcSwift/Sources/GearN/runtime/common/GNHashtable.swift +0 -200
  194. package/srcSwift/Sources/GearN/runtime/config/GNServerSettings.swift +0 -95
  195. package/srcSwift/Sources/GearN/runtime/constant/Commands.swift +0 -28
  196. package/srcSwift/Sources/GearN/runtime/constant/EventCode.swift +0 -10
  197. package/srcSwift/Sources/GearN/runtime/constant/OperationCode.swift +0 -252
  198. package/srcSwift/Sources/GearN/runtime/constant/ReturnCode.swift +0 -19
  199. package/srcSwift/Sources/GearN/runtime/constant/enumType/ExecuteResponseStatus.swift +0 -9
  200. package/srcSwift/Sources/GearN/runtime/constant/enumType/FriendStatus.swift +0 -8
  201. package/srcSwift/Sources/GearN/runtime/constant/enumType/GoogleLoginType.swift +0 -6
  202. package/srcSwift/Sources/GearN/runtime/constant/enumType/GroupStatus.swift +0 -8
  203. package/srcSwift/Sources/GearN/runtime/constant/enumType/InvalidMemberType.swift +0 -19
  204. package/srcSwift/Sources/GearN/runtime/constant/enumType/ItemType.swift +0 -6
  205. package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingMemberStatus.swift +0 -7
  206. package/srcSwift/Sources/GearN/runtime/constant/enumType/MatchmakingTicketStatus.swift +0 -9
  207. package/srcSwift/Sources/GearN/runtime/constant/enumType/OwnerType.swift +0 -10
  208. package/srcSwift/Sources/GearN/runtime/constant/enumType/PermissionDataItem.swift +0 -6
  209. package/srcSwift/Sources/GearN/runtime/constant/enumType/PushPlatformType.swift +0 -6
  210. package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestRole.swift +0 -7
  211. package/srcSwift/Sources/GearN/runtime/constant/enumType/RequestType.swift +0 -16
  212. package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreItemType.swift +0 -6
  213. package/srcSwift/Sources/GearN/runtime/constant/enumType/StoreReceiveType.swift +0 -9
  214. package/srcSwift/Sources/GearN/runtime/constant/errorCode/ErrorCode.swift +0 -58
  215. package/srcSwift/Sources/GearN/runtime/constant/parameterCode/ParameterCode.swift +0 -672
  216. package/srcSwift/Sources/GearN/runtime/entity/DataMember.swift +0 -196
  217. package/srcSwift/Sources/GearN/runtime/entity/GNMetadata.swift +0 -9
  218. package/srcSwift/Sources/GearN/runtime/entity/InvalidMember.swift +0 -11
  219. package/srcSwift/Sources/GearN/runtime/entity/OperationEvent.swift +0 -38
  220. package/srcSwift/Sources/GearN/runtime/entity/OperationHelper.swift +0 -28
  221. package/srcSwift/Sources/GearN/runtime/entity/OperationRequest.swift +0 -62
  222. package/srcSwift/Sources/GearN/runtime/entity/OperationResponse.swift +0 -98
  223. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateModels.swift +0 -351
  224. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateRequestModels.swift +0 -81
  225. package/srcSwift/Sources/GearN/runtime/entity/models/AuthenticateResponseModels.swift +0 -108
  226. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerModels.swift +0 -1045
  227. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerRequestModels.swift +0 -821
  228. package/srcSwift/Sources/GearN/runtime/entity/models/CharacterPlayerResponseModels.swift +0 -588
  229. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptModels.swift +0 -187
  230. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptRequestModels.swift +0 -84
  231. package/srcSwift/Sources/GearN/runtime/entity/models/CloudScriptResponseModels.swift +0 -59
  232. package/srcSwift/Sources/GearN/runtime/entity/models/ContentModels.swift +0 -195
  233. package/srcSwift/Sources/GearN/runtime/entity/models/ContentRequestModels.swift +0 -116
  234. package/srcSwift/Sources/GearN/runtime/entity/models/ContentResponseModels.swift +0 -81
  235. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardModels.swift +0 -426
  236. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardRequestModels.swift +0 -160
  237. package/srcSwift/Sources/GearN/runtime/entity/models/DashboardResponseModels.swift +0 -82
  238. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerModels.swift +0 -1334
  239. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerRequestModels.swift +0 -643
  240. package/srcSwift/Sources/GearN/runtime/entity/models/GamePlayerResponseModels.swift +0 -213
  241. package/srcSwift/Sources/GearN/runtime/entity/models/GenericModels.swift +0 -171
  242. package/srcSwift/Sources/GearN/runtime/entity/models/GroupModels.swift +0 -850
  243. package/srcSwift/Sources/GearN/runtime/entity/models/GroupRequestModels.swift +0 -485
  244. package/srcSwift/Sources/GearN/runtime/entity/models/GroupResponseModels.swift +0 -165
  245. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryModels.swift +0 -679
  246. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryRequestModels.swift +0 -413
  247. package/srcSwift/Sources/GearN/runtime/entity/models/InventoryResponseModels.swift +0 -141
  248. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerModels.swift +0 -378
  249. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerRequestModels.swift +0 -147
  250. package/srcSwift/Sources/GearN/runtime/entity/models/MasterPlayerResponseModels.swift +0 -318
  251. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerModels.swift +0 -319
  252. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerRequestModels.swift +0 -125
  253. package/srcSwift/Sources/GearN/runtime/entity/models/MultiplayerResponseModels.swift +0 -45
  254. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryModels.swift +0 -633
  255. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryRequestModels.swift +0 -173
  256. package/srcSwift/Sources/GearN/runtime/entity/models/StoreInventoryResponseModels.swift +0 -61
  257. package/srcSwift/Sources/GearN/runtime/entity/request/CustomOperationRequest.swift +0 -42
  258. package/srcSwift/Sources/GearN/runtime/entity/response/CustomOperationResponse.swift +0 -49
  259. package/srcSwift/Sources/GearN/runtime/entity/response/GetAuthInfoResponse.swift +0 -43
  260. package/srcSwift/Sources/GearN/runtime/entity/response/HealthCheckResponse.swift +0 -86
  261. package/srcSwift/Sources/GearN/runtime/entity/response/UploadFileResponse.swift +0 -15
  262. package/srcSwift/Sources/GearN/runtime/helper/CodeHelper.swift +0 -107
  263. package/srcSwift/Sources/GearN/runtime/helper/ConverterService.swift +0 -98
  264. package/srcSwift/Sources/GearN/runtime/helper/EnumUtility.swift +0 -34
  265. package/srcSwift/Sources/GearN/runtime/helper/GNSupport.swift +0 -41
  266. package/srcSwift/Sources/GearN/runtime/helper/GNUtils.swift +0 -66
  267. package/srcSwift/Sources/GearN/runtime/helper/MessagePackConverterService.swift +0 -21
  268. package/srcSwift/Sources/GearN/runtime/helper/StorageService.swift +0 -29
  269. package/srcSwift/Sources/GearN/runtime/logger/GNDebug.swift +0 -33
  270. package/srcSwift/Sources/GearN/runtime/networking/AuthenticateStatus.swift +0 -24
  271. package/srcSwift/Sources/GearN/runtime/networking/IPeer.swift +0 -8
  272. package/srcSwift/Sources/GearN/runtime/networking/NetworkingPeer.swift +0 -368
  273. package/srcSwift/Sources/GearN/runtime/networking/OperationPending.swift +0 -81
  274. package/srcSwift/Sources/GearN/runtime/networking/PeerBase.swift +0 -228
  275. package/srcSwift/Sources/GearN/runtime/networking/handler/IServerEventHandler.swift +0 -20
  276. package/srcSwift/Sources/GearN/runtime/networking/http/HttpPeer.swift +0 -226
  277. package/srcSwift/Sources/GearN/runtime/networking/http/HttpTypes.swift +0 -24
  278. package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingHttpPeerBase.swift +0 -13
  279. package/srcSwift/Sources/GearN/runtime/networking/http/NetworkingPeerUrlSession.swift +0 -125
  280. package/srcSwift/Sources/GearN/runtime/networking/request/NetRequest.swift +0 -19
  281. package/srcSwift/Sources/GearN/runtime/networking/response/NetResponse.swift +0 -13
  282. package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingPeerSocketIOClient.swift +0 -244
  283. package/srcSwift/Sources/GearN/runtime/networking/socket/NetworkingSocketPeerBase.swift +0 -59
  284. package/srcSwift/Sources/GearN/runtime/networking/socket/SocketPeer.swift +0 -136
  285. package/tsconfig-build.cocos.json +0 -31
  286. package/webpack.config.cocos.mjs +0 -78
@@ -2,13 +2,59 @@ import { Action1 } from "./../../common/Action1";
2
2
  import { OperationEvent } from "./../../entity/OperationEvent";
3
3
  import { GroupModels } from "./../../entity/models/GroupModels";
4
4
  import { IServerEventHandler } from "./IServerEventHandler";
5
+ /**
6
+ * Decoded payload of the `OnGroupMessageUpdate` server event.
7
+ *
8
+ * Pushed by the backend whenever new messages arrive in a group
9
+ * channel the local client is subscribed to. Use it to drive the
10
+ * group chat / wall UI in real time.
11
+ *
12
+ * Unlike the friend / member events, the payload here is a delta —
13
+ * `groupMessages` only contains the **new** messages since the last
14
+ * push, not the full history. The application is expected to append
15
+ * these to its own log.
16
+ */
5
17
  export declare class GroupMessageUpdate {
18
+ /**
19
+ * New group message items the application should append. Each
20
+ * entry is a fully decoded {@link GroupModels.GroupMessageResponseData}
21
+ * with sender id, timestamp, body and any embedded metadata.
22
+ */
6
23
  groupMessages: Array<GroupModels.GroupMessageResponseData>;
24
+ /**
25
+ * Identifier of the group whose message stream changed.
26
+ */
7
27
  groupId: string;
28
+ /**
29
+ * Optional character id when the message update is scoped to a
30
+ * specific character context (multi-character titles).
31
+ */
8
32
  characterId?: string;
9
33
  }
34
+ /**
35
+ * Auto-registered event handler for the `OnGroupMessageUpdate`
36
+ * server event.
37
+ *
38
+ * Application setup:
39
+ * ```ts
40
+ * OnGroupMessageUpdateEventHandler.onUpdate = update => {
41
+ * for (const msg of update.groupMessages) appendChat(update.groupId, msg);
42
+ * };
43
+ * ```
44
+ */
10
45
  export declare class OnGroupMessageUpdateEventHandler implements IServerEventHandler {
46
+ /**
47
+ * Static callback the application registers. Leave `null` to
48
+ * silently drop incoming messages.
49
+ */
11
50
  static onUpdate: Action1<GroupMessageUpdate>;
51
+ /**
52
+ * Returns {@link EventCode.OnGroupMessageUpdate}.
53
+ */
12
54
  getEventCode(): string;
55
+ /**
56
+ * Deserialises the parameters into a {@link GroupMessageUpdate}
57
+ * and forwards to {@link onUpdate}.
58
+ */
13
59
  handle(operationEvent: OperationEvent): void;
14
60
  }
@@ -1,25 +1,198 @@
1
1
  import { Action1 } from "./../../common/Action1";
2
2
  import { OperationPending } from "./../OperationPending";
3
3
  import { PeerBase } from "./../PeerBase";
4
+ /**
5
+ * Normalised HTTP response surface used by every HTTP-flavoured
6
+ * helper inside the SDK.
7
+ *
8
+ * Concrete transports ({@link NetworkingPeerAxiosRequest}) populate
9
+ * the four public fields, then call back into the SDK with this
10
+ * object. The downstream consumers only have to check
11
+ * {@link hasError} and `statusCode` before reading either `text`
12
+ * (JSON-shaped responses) or `data` (binary / MsgPack responses).
13
+ */
4
14
  export declare class HttpAppResponse {
15
+ /**
16
+ * HTTP status code as returned by the server. Set to `-1` when
17
+ * the transport raised an exception before receiving any
18
+ * response.
19
+ */
5
20
  statusCode: number;
21
+ /**
22
+ * Captured transport-level error message, or `null` when the
23
+ * request succeeded. The presence of this field is what
24
+ * {@link hasError} branches on.
25
+ */
6
26
  error: string;
27
+ /**
28
+ * Raw response body as bytes. Populated only for endpoints that
29
+ * request binary responses (the MsgPack and upload paths).
30
+ */
7
31
  data: Uint8Array;
32
+ /**
33
+ * Response body decoded as text. For JSON endpoints this carries
34
+ * the JSON string; for MsgPack endpoints this is a best-effort
35
+ * UTF-8 decode of the bytes used for diagnostic logs only.
36
+ */
8
37
  text: string;
38
+ /**
39
+ * Returns whether the transport captured a non-null error
40
+ * message. Cheaper than checking `error != null` everywhere and
41
+ * keeps the call sites readable.
42
+ */
9
43
  hasError(): boolean;
44
+ /**
45
+ * Returns a debug-friendly stringified summary of the response.
46
+ *
47
+ * Used by `[GN Http RECV]` log lines. The `<color=red>` markup
48
+ * is preserved from the original Unity SDK and rendered by the
49
+ * Unity console; web consoles display it as plain text.
50
+ */
10
51
  toString(): string;
11
52
  }
53
+ /**
54
+ * HTTP request body encoding used by the SDK.
55
+ *
56
+ * Resolved per-request by reading
57
+ * {@link GNServerSettings.getMessageType} — `MessageType.MsgPack`
58
+ * maps to {@link MsgPack} on Node.js / Cocos but is downgraded to
59
+ * {@link Json} in browser runtimes because the browser HTTP path
60
+ * does not handle binary responses uniformly across vendors.
61
+ */
12
62
  export declare enum PostType {
63
+ /** UTF-8 JSON request and response bodies. */
13
64
  Json = 0,
65
+ /** Binary MessagePack request and response bodies. */
14
66
  MsgPack = 1
15
67
  }
68
+ /**
69
+ * High-level HTTP peer used by {@link NetworkingPeer}.
70
+ *
71
+ * Bridges the {@link PeerBase} queue / timeout machinery with the
72
+ * concrete Axios-based transport in
73
+ * {@link NetworkingPeerAxiosRequest}. Owns the wire-format selection
74
+ * (`Json` vs `MsgPack`), URL composition (`/api/<cmd>/<requestType>/
75
+ * <role>/<operationCode>`) and the JSON-vs-MsgPack response decode
76
+ * path.
77
+ *
78
+ * Browser-vs-Node fallback: when the configured `messageType` is
79
+ * `MsgPack` and the SDK is running in a browser, this class downgrades
80
+ * the outgoing request to JSON because the browser path cannot
81
+ * reliably consume a MsgPack response. A warning is logged on every
82
+ * such downgrade so the application can surface the mismatch in
83
+ * development.
84
+ */
16
85
  export declare class HttpPeer extends PeerBase {
86
+ /** Concrete Axios-based HTTP client. */
17
87
  private networkingHttpPeerBase;
88
+ /**
89
+ * First character expected on a JSON response body. Used as a
90
+ * cheap heuristic to decide whether the response should be
91
+ * `JSON.parse`'d directly or fall through to MsgPack decode.
92
+ */
18
93
  private static readonly JSON_CHAR_KNOWN;
94
+ /**
95
+ * Builds and configures the underlying Axios client.
96
+ *
97
+ * Steps:
98
+ * 1. Validate the global server settings.
99
+ * 2. Capture the `useHttp` flag into {@link isUse} so the queue
100
+ * short-circuits when the HTTP transport is disabled.
101
+ * 3. Allocate {@link NetworkingPeerAxiosRequest} and pass the
102
+ * base URL plus the `User-Agent` string built from the SDK
103
+ * version + detected platform.
104
+ * 4. Forward the reverse-proxy flag from the server settings so
105
+ * the Axios layer knows whether to inline absolute URLs or
106
+ * relative paths.
107
+ *
108
+ * @throws Error when the global server settings are missing.
109
+ */
19
110
  protected initGNSocketObject(): void;
111
+ /**
112
+ * Sends a queued operation through the underlying HTTP transport.
113
+ *
114
+ * Steps:
115
+ * 1. Substitute the SDK-wide
116
+ * {@link OperationRequest.defaultTimeOut} sentinel with the
117
+ * configured `defaultTimeoutInSeconds`.
118
+ * 2. Chain into {@link PeerBase.send} so the in-flight map
119
+ * records the request id.
120
+ * 3. Pick the wire format from the active settings and apply
121
+ * the browser MsgPack-to-JSON downgrade described on
122
+ * {@link HttpPeer}.
123
+ * 4. Compose the sub-URI as
124
+ * `<api/cmd>/<requestType>/<role>/<operationCode>` using
125
+ * {@link CodeHelper} to resolve the camelCase enum names.
126
+ * 5. Delegate to the Axios transport, then route the response
127
+ * through {@link onSendOperationRequestResponse} so the
128
+ * inherited {@link PeerBase.onResponseHandler} machinery
129
+ * sees a normalised payload.
130
+ */
20
131
  send(operationPending: OperationPending): void;
132
+ /**
133
+ * Logs a diagnostic line whenever the queue accepts a new
134
+ * pending entry. The actual queueing is performed by
135
+ * {@link PeerBase.enqueue}; this override only adds telemetry.
136
+ */
21
137
  protected onEnqueue(operationPending: OperationPending): void;
138
+ /**
139
+ * Decodes a transport-level {@link HttpAppResponse} into the
140
+ * canonical SDK response container expected by
141
+ * {@link PeerBase.onResponseHandler}.
142
+ *
143
+ * Decode strategy:
144
+ * - If the body starts with `{` (the {@link JSON_CHAR_KNOWN}
145
+ * marker), parse it as JSON.
146
+ * - Otherwise fall back to MessagePack decode of the binary
147
+ * `data` field.
148
+ *
149
+ * On any non-200 response or transport error, synthesise a
150
+ * `ReturnCode.UnknownError` payload that carries the captured
151
+ * error message in `DebugMessage`. Either path ends with a call
152
+ * to {@link onResponseHandler} so the higher-level machinery can
153
+ * resolve the request callback.
154
+ */
22
155
  private onSendOperationRequestResponse;
156
+ /**
157
+ * Issues a raw HTTP GET request against the configured base URL.
158
+ *
159
+ * Used by the dedicated maintenance endpoints
160
+ * (`syncTs`, `getAuthInfo`, `healthCheck`) that bypass the
161
+ * operation-request pipeline because they do not produce a
162
+ * typed response. The auth token / secret key / game id are
163
+ * forwarded as request headers, matching the operation-request
164
+ * pipeline.
165
+ *
166
+ * @param subUri Path appended to the base URL
167
+ * (no leading slash).
168
+ * @param onHttpAppResponse Callback receiving the typed
169
+ * {@link HttpAppResponse}.
170
+ * @param timeout Optional timeout in seconds. Defaults
171
+ * to {@link OperationRequest.defaultTimeOut}.
172
+ * @param authToken Optional auth token override.
173
+ * @param secretKey Optional secret key override.
174
+ * @param gameId Optional game id override.
175
+ */
23
176
  getRequest(subUri: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout?: number, authToken?: string, secretKey?: string, gameId?: string): void;
177
+ /**
178
+ * Uploads a file through the authenticated multipart endpoint.
179
+ *
180
+ * Aborts immediately with status `401` when no auth token is
181
+ * cached — the upload endpoint always requires authentication
182
+ * and the cached token is the only auth source the upload path
183
+ * recognises (the upload helper does not accept an override).
184
+ *
185
+ * @param fileId Identifier returned by
186
+ * `content.createNewFileUploadInfo`.
187
+ * @param content Binary payload.
188
+ * @param filename Display name written into the
189
+ * multipart envelope.
190
+ * @param mimetype Content type for the file part.
191
+ * @param onHttpAppResponse Callback receiving the typed
192
+ * {@link HttpAppResponse}.
193
+ * @param timeout Timeout in seconds. Defaults to
194
+ * `6000` so large uploads do not race
195
+ * the SDK-wide 20-second default.
196
+ */
24
197
  uploadFile(fileId: string, content: Uint8Array, filename: string, mimetype: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout?: number): void;
25
198
  }
@@ -1,13 +1,100 @@
1
1
  import { Action1 } from "./../../common/Action1";
2
2
  import { GNHashtable } from "./../../common/GNData";
3
3
  import { HttpAppResponse, PostType } from "./HttpPeer";
4
+ /**
5
+ * Abstract HTTP client contract consumed by {@link HttpPeer}.
6
+ *
7
+ * The default — and currently only — implementation is
8
+ * {@link NetworkingPeerAxiosRequest}, which uses Axios for the actual
9
+ * network calls. The abstraction exists so future ports can swap in a
10
+ * different HTTP library (e.g. `fetch`-based for an Edge runtime)
11
+ * without touching the request queue, response decoding, or wire-
12
+ * format selection logic in {@link HttpPeer}.
13
+ *
14
+ * Lifecycle:
15
+ * - {@link init} captures the absolute base URL and the SDK's
16
+ * `User-Agent` string.
17
+ * - {@link setUseReverseProxy} mirrors the matching flag from the
18
+ * server settings.
19
+ * - The three abstract methods are invoked by {@link HttpPeer} on
20
+ * every send.
21
+ */
4
22
  export declare abstract class NetworkingHttpPeerBase {
23
+ /** Absolute base URL produced by {@link GNServerSettings.getHttpUrl}. */
5
24
  protected httpUrl: string;
25
+ /**
26
+ * SDK-issued `User-Agent` value emitted on every Node.js request
27
+ * (`GN-ts-<platform>@<version>`). Browsers manage their own
28
+ * `User-Agent` so the value is ignored there.
29
+ */
6
30
  protected userAgent: string;
31
+ /**
32
+ * Mirror of {@link GNServerSettings.getUseReverseProxy}. When
33
+ * `true`, concrete subclasses send relative URLs and forward the
34
+ * captured base URL through the `X-BaseUrl` header so a
35
+ * same-origin proxy can rewrite the destination without CORS
36
+ * preflight.
37
+ */
7
38
  protected useReverseProxy: boolean;
39
+ /**
40
+ * Performs an HTTP `GET` against `<httpUrl>/<subUri>`.
41
+ *
42
+ * @param subUri Path appended to the base URL
43
+ * (no leading slash).
44
+ * @param onHttpAppResponse Callback receiving the normalised
45
+ * {@link HttpAppResponse}.
46
+ * @param timeout Timeout in seconds (multiplied by
47
+ * 1000 inside the concrete call).
48
+ * @param authToken Optional auth token sent in the
49
+ * `Auth-Token` header.
50
+ * @param secretKey Optional secret key sent in the
51
+ * `Secret-Key` header.
52
+ * @param gameId Optional game id sent in the
53
+ * `Game-Id` header.
54
+ */
8
55
  abstract getRequest(subUri: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number, authToken: string, secretKey: string, gameId: string): void;
56
+ /**
57
+ * Performs an HTTP `POST` against `<httpUrl>/<subUri>` with
58
+ * either a JSON or MessagePack body.
59
+ *
60
+ * @param subUri Path appended to the base URL.
61
+ * @param param Operation parameter bag.
62
+ * @param postType Encoding choice: JSON or MessagePack.
63
+ * @param onHttpAppResponse Callback receiving the normalised
64
+ * {@link HttpAppResponse}.
65
+ * @param timeout Timeout in seconds.
66
+ * @param authToken Optional auth token.
67
+ * @param secretKey Optional secret key.
68
+ * @param customTags Optional routing tags merged into
69
+ * `param` under
70
+ * {@link ParameterCode.CustomTags}.
71
+ * @param gameId Optional game id.
72
+ */
9
73
  abstract postRequest(subUri: string, param: GNHashtable, postType: PostType, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number, authToken: string, secretKey: string, customTags: GNHashtable, gameId: string): void;
74
+ /**
75
+ * Performs a multipart upload `POST`.
76
+ *
77
+ * @param subUri Path appended to the base URL.
78
+ * @param content Binary payload.
79
+ * @param filename Display name written into the
80
+ * multipart envelope.
81
+ * @param mimetype Content type for the file part.
82
+ * @param onHttpAppResponse Callback receiving the normalised
83
+ * {@link HttpAppResponse}.
84
+ * @param timeout Timeout in seconds.
85
+ */
10
86
  abstract postRequestUpload(subUri: string, content: Uint8Array, filename: string, mimetype: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number): void;
87
+ /**
88
+ * Captures the base URL and `User-Agent`. Called once during
89
+ * {@link HttpPeer.initGNSocketObject}.
90
+ */
11
91
  init(httpUrl: string, userAgent: string): void;
92
+ /**
93
+ * Toggles reverse-proxy mode on the concrete HTTP client.
94
+ *
95
+ * Mirrors {@link GNServerSettings.setUseReverseProxy}; concrete
96
+ * subclasses inspect the flag every request to decide whether
97
+ * to send a relative or absolute URL.
98
+ */
12
99
  setUseReverseProxy(useReverseProxy: boolean): void;
13
100
  }
@@ -2,13 +2,126 @@ import { Action1 } from "./../../common/Action1";
2
2
  import { GNHashtable } from "./../../common/GNData";
3
3
  import { HttpAppResponse, PostType } from "./HttpPeer";
4
4
  import { NetworkingHttpPeerBase } from "./NetworkingHttpPeerBase";
5
+ /**
6
+ * Concrete HTTP client implemented on top of `axios`.
7
+ *
8
+ * Responsibilities:
9
+ * - Translate the abstract methods on
10
+ * {@link NetworkingHttpPeerBase} into Axios calls.
11
+ * - Apply per-platform tweaks: only emit `User-Agent` and
12
+ * `Content-Length` headers from Node.js, because browsers refuse
13
+ * to let JavaScript override them.
14
+ * - Drive the wire format conversion: JSON paths use
15
+ * `responseType: "text"`, MsgPack paths use
16
+ * `responseType: "arraybuffer"` so the SDK gets bytes back.
17
+ * - Implement the reverse-proxy URL rewrite: when
18
+ * `useReverseProxy === true`, requests are sent as relative paths
19
+ * with the original base URL forwarded in the `X-BaseUrl` header.
20
+ *
21
+ * Error handling: every Axios `try/catch` collapses the failure into
22
+ * the {@link HttpAppResponse} surface — `statusCode = -1`,
23
+ * `error = error.toString()`, `text = "[-2]"` (or `"[-3]"` for
24
+ * unsupported features). The SDK's higher-level decoder in
25
+ * {@link HttpPeer.onSendOperationRequestResponse} interprets either
26
+ * shape correctly.
27
+ */
5
28
  export declare class NetworkingPeerAxiosRequest extends NetworkingHttpPeerBase {
29
+ /**
30
+ * @inheritdoc
31
+ *
32
+ * Routes through the private async helper so the public method
33
+ * matches the abstract synchronous-looking signature. The helper
34
+ * always invokes the callback exactly once.
35
+ */
6
36
  getRequest(subUri: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number, authToken: string, secretKey: string, gameId: string): void;
37
+ /**
38
+ * @inheritdoc
39
+ *
40
+ * Routes through the private async helper. The helper picks the
41
+ * right Axios call shape for JSON vs MsgPack and converts the
42
+ * response to either text (JSON) or `Uint8Array` + best-effort
43
+ * UTF-8 text (MsgPack).
44
+ */
7
45
  postRequest(subUri: string, param: GNHashtable, postType: PostType, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number, authToken: string, secretKey: string, customTags: GNHashtable, gameId: string): void;
46
+ /**
47
+ * @inheritdoc
48
+ *
49
+ * Routes through the private async helper which constructs the
50
+ * `FormData` envelope and submits it as
51
+ * `multipart/form-data`.
52
+ */
8
53
  postRequestUpload(subUri: string, content: Uint8Array, filename: string, mimetype: string, onHttpAppResponse: Action1<HttpAppResponse>, timeout: number): void;
54
+ /**
55
+ * Real Axios call for HTTP `GET`.
56
+ *
57
+ * Builds the header bag (auth-token / secret-key / game-id /
58
+ * user-agent), composes the absolute or relative URL based on
59
+ * the reverse-proxy setting, and asks Axios for an
60
+ * `arraybuffer` response so binary payloads survive intact.
61
+ *
62
+ * On any thrown exception the helper collapses the failure into
63
+ * an {@link HttpAppResponse} with `statusCode = -1` and
64
+ * `text = "[-2]"`, then logs through {@link GNDebug.logError}.
65
+ */
9
66
  private getRequestAxios;
67
+ /**
68
+ * Real Axios call for HTTP `POST`.
69
+ *
70
+ * Wire format selection:
71
+ * - {@link PostType.Json}: serialise the parameter bag with
72
+ * `param.toData()`, send it as JSON, ask Axios for a `text`
73
+ * response. `Content-Length` is set explicitly on Node.js so
74
+ * reverse proxies that require it work correctly.
75
+ * - {@link PostType.MsgPack}: encode through
76
+ * {@link MessagePackConverterService.serialize}, send as
77
+ * `application/msgpack`, ask Axios for an `arraybuffer`
78
+ * response.
79
+ *
80
+ * Custom tags supplied by the caller are merged into the
81
+ * outgoing parameter bag under
82
+ * {@link ParameterCode.CustomTags} so the backend receives them
83
+ * in the same envelope as the operation parameters.
84
+ *
85
+ * Same error-handling shape as {@link getRequestAxios}.
86
+ */
10
87
  private postRequestAxios;
88
+ /**
89
+ * Real Axios call for the multipart upload endpoint.
90
+ *
91
+ * Builds a `FormData` envelope with a single `file` part — the
92
+ * field name is taken from {@link Commands.File}, the binary
93
+ * payload is wrapped in a `Blob` so both browser and Node.js
94
+ * Axios accept it. The auth token is read from the cached
95
+ * {@link AuthenticateStatus}; this endpoint cannot accept an
96
+ * override.
97
+ *
98
+ * Note: `content.buffer.slice(0)` clones the underlying buffer
99
+ * so the upload remains valid if the application later mutates
100
+ * `content` in place.
101
+ */
11
102
  private postRequestUploadAxios;
103
+ /**
104
+ * Decodes a `Uint8Array` to a string using the legacy
105
+ * `decodeURIComponent(escape(...))` pattern.
106
+ *
107
+ * Why the indirection: `String.fromCharCode(...uint8Array)`
108
+ * produces a Latin-1 string from the bytes, and the
109
+ * `decodeURIComponent`/`escape` pair re-interprets the result
110
+ * as UTF-8. Modern equivalents (`TextDecoder`) are not
111
+ * available across all the supported runtimes (older Cocos
112
+ * builds, ES5 polyfills) so the SDK keeps the legacy form.
113
+ */
12
114
  private uint8ArrayToString;
115
+ /**
116
+ * Normalises an Axios `arraybuffer` body into the
117
+ * `[Uint8Array, string]` pair stored on
118
+ * {@link HttpAppResponse}.
119
+ *
120
+ * The browser path wraps the `ArrayBuffer` in a `Uint8Array`
121
+ * and decodes the bytes as UTF-8 via
122
+ * {@link uint8ArrayToString}. The Node.js path receives a
123
+ * `Buffer` directly, which already supports `toString()`
124
+ * cheaply, so it returns the buffer + `buffer.toString()` as is.
125
+ */
13
126
  private toBuffers;
14
127
  }
@@ -4,21 +4,166 @@ import { NetworkingSocketPeerBase } from "./NetworkingSocketPeerBase";
4
4
  import { RequestType } from "./../../constant/enumType/RequestType";
5
5
  import { RequestRole } from "./../../constant/enumType/RequestRole";
6
6
  import { GNHashtable } from "./../../common/GNData";
7
+ /**
8
+ * Concrete socket transport built on top of the official
9
+ * `socket.io-client` package.
10
+ *
11
+ * Wires four inbound socket events to the buffered queues defined on
12
+ * the parent class:
13
+ * - `Commands.ResponseCmd_MsgPack` →
14
+ * {@link NetworkingSocketPeerBase.responsePacketLst} (binary).
15
+ * - `Commands.EventCmd_MsgPack` →
16
+ * {@link NetworkingSocketPeerBase.eventPacketLst} (binary).
17
+ * - `Commands.ResponseCmd_Json` → response queue (plain object).
18
+ * - `Commands.EventCmd_Json` → event queue (plain object).
19
+ *
20
+ * Outbound frames are emitted by {@link emit} which converts the
21
+ * supplied {@link OperationRequest} into the array shape produced by
22
+ * {@link OperationHelper.toSocketData}, optionally MsgPack-encodes
23
+ * it via {@link MessagePackConverterService.serialize}, and writes
24
+ * the matching `Commands.RequestCmd_*` event.
25
+ *
26
+ * Connect / disconnect lifecycle: {@link reInitNewSocket} sets up the
27
+ * `Manager` lazily (only on first call) with `autoConnect: false` so
28
+ * that {@link connect} controls the actual dial. Inbound `connect` /
29
+ * `disconnect` / `error` events route into {@link onConnect} /
30
+ * {@link onDisconnect} / {@link onError} respectively.
31
+ *
32
+ * Auth handshake: the SDK does not embed the auth token in the
33
+ * `Manager` query — instead it emits a dedicated
34
+ * `Commands.RequestAuthTokenCmd` frame from {@link sendRequestAuthSocket}
35
+ * once the connect handler fires.
36
+ */
7
37
  export declare class NetworkingPeerSocketIOClient extends NetworkingSocketPeerBase {
38
+ /** Reused socket.io `Manager` instance (one per SDK lifetime). */
8
39
  private socketManager;
40
+ /** Default namespace socket retrieved from {@link socketManager}. */
9
41
  private socket;
42
+ /**
43
+ * Local "have we asked for an open connection" flag — used by
44
+ * {@link connect} to short-circuit redundant dial calls.
45
+ */
10
46
  private isConnected;
47
+ /**
48
+ * Sends the cached auth token through the dedicated socket
49
+ * command so the backend can associate this socket session with
50
+ * the authenticated user.
51
+ *
52
+ * No-op when the socket has not assigned a `clientId` yet — the
53
+ * SDK retries automatically from {@link onConnectHandler} once
54
+ * the underlying socket reports `connect`.
55
+ */
11
56
  sendRequestAuthSocket(): void;
57
+ /**
58
+ * Lazily allocates the `socket.io-client` `Manager` and registers
59
+ * every event listener.
60
+ *
61
+ * Configuration:
62
+ * - `path`: derived from the supplied URL by appending the
63
+ * `socket.io` segment after whatever path component the URL
64
+ * already specifies. This supports both root-level deployments
65
+ * (`http://host`) and sub-path deployments
66
+ * (`http://host/api/`).
67
+ * - `reconnection: true` with `reconnectionDelay` from
68
+ * {@link GNServerSettings}.
69
+ * - `timeout: pingTimeout` so the underlying client honours the
70
+ * configured heartbeat ceiling.
71
+ * - `autoConnect: false` so the actual dial happens explicitly
72
+ * inside {@link connect}.
73
+ * - `transports: ["websocket"]` to skip the long-poll fallback;
74
+ * the GearN backend always supports WebSocket directly.
75
+ *
76
+ * Idempotent — repeated calls after the first succeed are no-ops.
77
+ */
12
78
  reInitNewSocket(): void;
79
+ /**
80
+ * Buffers an inbound MessagePack response frame. Decoded later on
81
+ * the next {@link service} tick.
82
+ */
13
83
  private onResponseMsgPack;
84
+ /**
85
+ * Buffers an inbound MessagePack event frame. Decoded later on
86
+ * the next {@link service} tick.
87
+ */
14
88
  private onEventMsgPack;
89
+ /**
90
+ * Buffers an inbound JSON response frame. Decoded later on the
91
+ * next {@link service} tick.
92
+ */
15
93
  private onResponseJson;
94
+ /**
95
+ * Buffers an inbound JSON event frame. Decoded later on the next
96
+ * {@link service} tick.
97
+ */
16
98
  private onEventJson;
99
+ /**
100
+ * Bridges the low-level `connect` event to
101
+ * {@link onConnectHandler} on the parent class. Captures
102
+ * `socket.id` as the public {@link clientId}.
103
+ */
17
104
  private onConnect;
105
+ /**
106
+ * Bridges the low-level `disconnect` event to
107
+ * {@link onDisconnectHandler} on the parent class. Clears
108
+ * {@link clientId} so {@link GNNetwork.isSocketConnected} starts
109
+ * reporting `false` immediately.
110
+ */
18
111
  private onDisconnect;
112
+ /**
113
+ * Logs transport errors via {@link GNDebug.logError}. The SDK
114
+ * does not propagate transport errors to the application; failed
115
+ * requests surface through their normal timeout / response-code
116
+ * path.
117
+ */
19
118
  private onError;
119
+ /**
120
+ * Forwards configuration to the parent. The actual `Manager`
121
+ * allocation is deferred to {@link reInitNewSocket} so the SDK
122
+ * can re-build the client after a connection drop without
123
+ * touching the captured configuration.
124
+ */
20
125
  init(url: string, reconnectDelay: number, pingInterval: number, pingTimeout: number): void;
126
+ /**
127
+ * Encodes the operation request into the wire shape and emits it
128
+ * over the active socket.
129
+ *
130
+ * Payload preparation:
131
+ * 1. Merge the supplied `customTags` into the request's
132
+ * parameter bag under {@link ParameterCode.CustomTags}.
133
+ * 2. Convert the request to the array shape via
134
+ * {@link OperationHelper.toSocketData} (`[type, role,
135
+ * opCode, params]` plus `requestId` when not the
136
+ * fire-and-forget sentinel).
137
+ * 3. Emit the JSON variant directly when `messageType === Json`,
138
+ * otherwise encode through MessagePack first.
139
+ *
140
+ * Silently no-ops when the underlying `Manager` / default-
141
+ * namespace `Socket` is unavailable (e.g. before
142
+ * {@link reInitNewSocket} has run). The intent is best-effort —
143
+ * any pending-with-callback request will eventually time out and
144
+ * surface through the regular response handler.
145
+ */
21
146
  protected emit(requestType: RequestType, role: RequestRole, operationRequest: OperationRequest, authToken: string, secretKey: string, customTags: GNHashtable, gameId: string): void;
147
+ /**
148
+ * Tears the socket down and notifies subscribers.
149
+ *
150
+ * Closes the underlying `Manager` first (the heavy carrier for
151
+ * the engine.io connection), then disconnects the namespace
152
+ * socket as a fallback if the manager was never created. After
153
+ * the underlying client closes, manually invokes
154
+ * {@link onDisconnectHandler} so the multi-subscriber channel
155
+ * fires even when the underlying client did not raise a fresh
156
+ * `disconnect` event (already-closed shortcut path).
157
+ */
22
158
  close(_onSocketDisconnect: Action0): void;
159
+ /**
160
+ * Opens the underlying socket.io connection.
161
+ *
162
+ * Short-circuits when the SDK has already issued a `connect()`
163
+ * call (logs "Reconnecting" and returns) so duplicate calls from
164
+ * application code do not start parallel dials. The first call
165
+ * dials both the engine.io manager and the default-namespace
166
+ * socket.
167
+ */
23
168
  connect(_onSocketConnect: Action0): void;
24
169
  }