linkdood-web-sdk 0.1.0

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 (204) hide show
  1. package/.babelrc +21 -0
  2. package/.browserslistrc +2 -0
  3. package/.prettierrc +7 -0
  4. package/README.md +108 -0
  5. package/dist/linkdoodWebSDK.js +13 -0
  6. package/docs/md/action/auth.md +45 -0
  7. package/docs/md/action/buddy.md +93 -0
  8. package/docs/md/action/chat.md +84 -0
  9. package/docs/md/action/config.md +16 -0
  10. package/docs/md/action/enterprise.md +5 -0
  11. package/docs/md/action/file.md +20 -0
  12. package/docs/md/action/group.md +235 -0
  13. package/docs/md/action/message.md +93 -0
  14. package/docs/md/action/org.md +37 -0
  15. package/docs/md/action/search.md +27 -0
  16. package/docs/md/action/system.md +27 -0
  17. package/docs/md/action/systemMessage.md +30 -0
  18. package/docs/md/action/user.md +34 -0
  19. package/docs/md/apiDescribe.md +24 -0
  20. package/docs/md/apiSummary.md +121 -0
  21. package/docs/md/errorCode.md +386 -0
  22. package/docs/md/install.md +39 -0
  23. package/docs/md/model/AccountType.md +7 -0
  24. package/docs/md/model/AddGroupMemberResult.md +8 -0
  25. package/docs/md/model/ChatRes.md +18 -0
  26. package/docs/md/model/CommonDataResult.md +11 -0
  27. package/docs/md/model/CommonSettingServerResult.md +11 -0
  28. package/docs/md/model/EnORet.md +9 -0
  29. package/docs/md/model/EnterpriseBean.md +25 -0
  30. package/docs/md/model/EnterpriseUserBean.md +22 -0
  31. package/docs/md/model/GetBuddyOnlineResult.md +7 -0
  32. package/docs/md/model/GetMyselfResult.md +10 -0
  33. package/docs/md/model/GetOrgUserResult.md +8 -0
  34. package/docs/md/model/GetUserResult.md +7 -0
  35. package/docs/md/model/GroupInfo.md +29 -0
  36. package/docs/md/model/GroupInfoResult.md +8 -0
  37. package/docs/md/model/GroupMemberInfo.md +18 -0
  38. package/docs/md/model/GroupMemberInfoRefreshBean.md +11 -0
  39. package/docs/md/model/GroupMemberInfoResult.md +7 -0
  40. package/docs/md/model/GroupMembersRefreshBean.md +10 -0
  41. package/docs/md/model/GroupRefreshBean.md +9 -0
  42. package/docs/md/model/GroupSet.md +7 -0
  43. package/docs/md/model/GroupSetResult.md +7 -0
  44. package/docs/md/model/GroupTransferBean.md +8 -0
  45. package/docs/md/model/LoginResult.md +16 -0
  46. package/docs/md/model/MessageStorageBean.md +35 -0
  47. package/docs/md/model/MessageStorageResult.md +7 -0
  48. package/docs/md/model/Messages.md +8 -0
  49. package/docs/md/model/NoDisturbMode.md +10 -0
  50. package/docs/md/model/NoDisturbModeExtension.md +9 -0
  51. package/docs/md/model/OnlineBean.md +9 -0
  52. package/docs/md/model/OperateBuddyInfo.md +8 -0
  53. package/docs/md/model/OrgOpenConfig.md +8 -0
  54. package/docs/md/model/OrgSearchUserRet.md +16 -0
  55. package/docs/md/model/OrgUserAndChildNodes.md +8 -0
  56. package/docs/md/model/OrganizationBean.md +32 -0
  57. package/docs/md/model/PersonalDataSwitch.md +21 -0
  58. package/docs/md/model/PltFRet.md +0 -0
  59. package/docs/md/model/RemoveGroupMemberResult.md +7 -0
  60. package/docs/md/model/SearchResult.md +12 -0
  61. package/docs/md/model/SendMessageResult.md +12 -0
  62. package/docs/md/model/ShieldGroupMessageSet.md +11 -0
  63. package/docs/md/model/SmallEntAppInfo.md +31 -0
  64. package/docs/md/model/SmallUserBean.md +34 -0
  65. package/docs/md/model/TinyGroupInfo.md +24 -0
  66. package/docs/md/model/TinyUserBean.md +31 -0
  67. package/docs/md/model/TransferGroupResult.md +7 -0
  68. package/docs/md/model/UserBean.md +35 -0
  69. package/docs/md/model/UserToTargetSwitch.md +8 -0
  70. package/docs/md/model/VerifyMessageRet.md +9 -0
  71. package/docs/md/model/YMD.md +7 -0
  72. package/docs/md/model/orgGroupInfo.md +8 -0
  73. package/docs/md/model/orgUserInfo.md +11 -0
  74. package/docs/md/model/systemMessageRes.md +28 -0
  75. package/docs/md/model/test.md +3 -0
  76. package/docs/md/model/tinyGroupMemberInfo.md +14 -0
  77. package/docs/md/notify/notify.md +66 -0
  78. package/docs/thrift/ap.thrift +3245 -0
  79. package/docs/thrift/aphead.thrift +2376 -0
  80. package/docs/thrift/aphold.thrift +14 -0
  81. package/docs/thrift/apnotify.thrift +275 -0
  82. package/gulpfile.js +21 -0
  83. package/lib/cache/BuddyCache.js +26 -0
  84. package/lib/cache/ChatCache.js +42 -0
  85. package/lib/cache/EnterpriseCache.js +22 -0
  86. package/lib/cache/GroupCache.js +31 -0
  87. package/lib/cache/GroupMemberCache.js +36 -0
  88. package/lib/cache/GroupMessageCache.js +29 -0
  89. package/lib/cache/HelpCache.js +3 -0
  90. package/lib/cache/MessageCache.js +40 -0
  91. package/lib/cache/MessageTimeStampCache.js +13 -0
  92. package/lib/cache/MyselfCache.js +14 -0
  93. package/lib/cache/SystemDictionaryCache.js +41 -0
  94. package/lib/cache/SystemMessageCache.js +19 -0
  95. package/lib/cache/TimeStampCache.js +3 -0
  96. package/lib/cache/db/IMDB.js +21 -0
  97. package/lib/cache/db/bean/Buddy.js +32 -0
  98. package/lib/cache/db/bean/Chat.js +20 -0
  99. package/lib/cache/db/bean/GroupMessage.js +5 -0
  100. package/lib/cache/db/bean/Message.js +30 -0
  101. package/lib/cache/db/bean/SystemDictionarie.js +9 -0
  102. package/lib/cache/db/bean/SystemMessage.js +13 -0
  103. package/lib/cache/db/bean/Timestamp.js +29 -0
  104. package/lib/config/thriftConfig.js +6 -0
  105. package/lib/constant/dictionaryConstant.js +10 -0
  106. package/lib/constant/storageConstant.js +16 -0
  107. package/lib/core/LinkdoodWebSDK.js +9 -0
  108. package/lib/core/action/ApplicationAction.js +19 -0
  109. package/lib/core/action/AuthAction.js +41 -0
  110. package/lib/core/action/BuddyAction.js +51 -0
  111. package/lib/core/action/ChatAction.js +33 -0
  112. package/lib/core/action/ConfigAction.js +16 -0
  113. package/lib/core/action/EnterpriseAction.js +9 -0
  114. package/lib/core/action/FeedBackAction.js +12 -0
  115. package/lib/core/action/FileAction.js +11 -0
  116. package/lib/core/action/GroupAction.js +121 -0
  117. package/lib/core/action/HelpAction.js +6 -0
  118. package/lib/core/action/MessageAction.js +38 -0
  119. package/lib/core/action/OrgAction.js +11 -0
  120. package/lib/core/action/SearchAction.js +11 -0
  121. package/lib/core/action/SubscribeAction.js +10 -0
  122. package/lib/core/action/SystemAction.js +11 -0
  123. package/lib/core/action/SystemMessageAction.js +10 -0
  124. package/lib/core/action/UserAction.js +43 -0
  125. package/lib/core/action/index.js +1 -0
  126. package/lib/decorator/ErrorORCompletionDecorator.js +5 -0
  127. package/lib/error/JSDKError.js +5 -0
  128. package/lib/index.js +1 -0
  129. package/lib/model/loginModel.js +5 -0
  130. package/lib/model/thriftConnectionModel.js +5 -0
  131. package/lib/model/userModel.js +5 -0
  132. package/lib/notify/NotifyAnalysis.js +5 -0
  133. package/lib/notify/NotifyHeartBeat.js +14 -0
  134. package/lib/notify/emitter/notifyEmitter.js +99 -0
  135. package/lib/notify/send/NotifyFactory.js +5 -0
  136. package/lib/notify/send/children/noticeReply.js +7 -0
  137. package/lib/notify/send/children/notifyCreateFaceGroupSuccess.js +5 -0
  138. package/lib/notify/send/children/notifyError.js +6 -0
  139. package/lib/notify/send/children/notifyExitFaceAddBuddy.js +5 -0
  140. package/lib/notify/send/children/notifyExitFaceJoinGroup.js +5 -0
  141. package/lib/notify/send/children/notifyFaceAddBuddy.js +5 -0
  142. package/lib/notify/send/children/notifyFaceAddBuddyConfirm.js +5 -0
  143. package/lib/notify/send/children/notifyFaceJoinGroup.js +5 -0
  144. package/lib/notify/send/children/notifyGroupMemberInfoRefresh.js +6 -0
  145. package/lib/notify/send/children/notifyGroupMembersRefresh.js +14 -0
  146. package/lib/notify/send/children/notifyGroupRefresh.js +5 -0
  147. package/lib/notify/send/children/notifyMessageCursor.js +5 -0
  148. package/lib/notify/send/children/notifyMessageJson.js +5 -0
  149. package/lib/notify/send/children/notifyMessageStatusStatsInfo.js +5 -0
  150. package/lib/notify/send/children/notifyOperateBuddy.js +5 -0
  151. package/lib/notify/send/children/notifyOperateUser.js +5 -0
  152. package/lib/notify/send/children/notifyPresent.js +5 -0
  153. package/lib/notify/send/children/notifySendMessage.js +27 -0
  154. package/lib/notify/send/children/notifyTransferGroup.js +7 -0
  155. package/lib/notify/send/children/notifyTransferMessage.js +5 -0
  156. package/lib/offline/OfflineBuddy.js +5 -0
  157. package/lib/offline/OfflineEnterprise.js +5 -0
  158. package/lib/offline/OfflineGroup.js +16 -0
  159. package/lib/offline/OfflineHelp.js +5 -0
  160. package/lib/offline/OfflineMessage.js +8 -0
  161. package/lib/offline/OfflineMyself.js +5 -0
  162. package/lib/service/ApplicationService.js +14 -0
  163. package/lib/service/BuddyService.js +64 -0
  164. package/lib/service/ChatService.js +98 -0
  165. package/lib/service/CommonService.js +17 -0
  166. package/lib/service/EnterpriseService.js +32 -0
  167. package/lib/service/GroupMemberService.js +77 -0
  168. package/lib/service/GroupMessageService.js +21 -0
  169. package/lib/service/GroupService.js +58 -0
  170. package/lib/service/HelpService.js +11 -0
  171. package/lib/service/LoginService.js +16 -0
  172. package/lib/service/MessageService.js +92 -0
  173. package/lib/service/MessageTimeStampService.js +14 -0
  174. package/lib/service/MyselfService.js +19 -0
  175. package/lib/service/SubscribeService.js +15 -0
  176. package/lib/service/SystemDictionaryService.js +27 -0
  177. package/lib/service/SystemMessageService.js +4 -0
  178. package/lib/service/TimeStampService.js +9 -0
  179. package/lib/thrift/client/ThriftBase.js +1 -0
  180. package/lib/thrift/client/ThriftHoldClient.js +1 -0
  181. package/lib/thrift/client/ThriftNotifyClient.js +1 -0
  182. package/lib/thrift/client/ThriftServiceClient.js +1 -0
  183. package/lib/thrift/lib/ap/APHold.js +7 -0
  184. package/lib/thrift/lib/ap/APNotify.js +7 -0
  185. package/lib/thrift/lib/ap/APService.js +7 -0
  186. package/lib/thrift/lib/ap/ap_types.js +6 -0
  187. package/lib/thrift/lib/ap/aphead_types.js +6 -0
  188. package/lib/thrift/lib/ap/aphold_types.js +6 -0
  189. package/lib/thrift/lib/ap/apnotify_types.js +6 -0
  190. package/lib/thrift/lib/thrift.js +397 -0
  191. package/lib/thrift/merge/thrift-merge.js +77841 -0
  192. package/lib/thrift/thriftClient.js +16 -0
  193. package/lib/utils/Logger.js +1 -0
  194. package/lib/utils/_decorators.js +11 -0
  195. package/lib/utils/browserUtil.js +7 -0
  196. package/lib/utils/commonUtil.js +35 -0
  197. package/lib/utils/filesUtil.js +50 -0
  198. package/lib/utils/groupJudgeUtil.js +57 -0
  199. package/lib/utils/md5Util.js +1 -0
  200. package/lib/utils/navi.js +11 -0
  201. package/lib/utils/proptypeExtend.js +13 -0
  202. package/lib/utils/request.js +8 -0
  203. package/package.json +83 -0
  204. package/webpack.config.js +3 -0
@@ -0,0 +1,6 @@
1
+ "use strict";//
2
+ // Autogenerated by Thrift Compiler (0.9.3)
3
+ //
4
+ // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ //
6
+ SendEmptyRequestReq=function SendEmptyRequestReq(args){this.sessionID=null;this.ticket=null;this.notifyID=null;this.timeout=null;this.nextReqInterval=null;if(args){if(args.sessionID!==undefined&&args.sessionID!==null){this.sessionID=args.sessionID}if(args.ticket!==undefined&&args.ticket!==null){this.ticket=args.ticket}if(args.notifyID!==undefined&&args.notifyID!==null){this.notifyID=args.notifyID}if(args.timeout!==undefined&&args.timeout!==null){this.timeout=args.timeout}if(args.nextReqInterval!==undefined&&args.nextReqInterval!==null){this.nextReqInterval=args.nextReqInterval}}};SendEmptyRequestReq.prototype={};SendEmptyRequestReq.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.sessionID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRING){this.ticket=input.readString().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.I64){this.notifyID=input.readI64().value}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.I32){this.timeout=input.readI32().value}else{input.skip(ftype)}break;case 5:if(ftype==Thrift.Type.I32){this.nextReqInterval=input.readI32().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};SendEmptyRequestReq.prototype.write=function(output){output.writeStructBegin("SendEmptyRequestReq");if(this.sessionID!==null&&this.sessionID!==undefined){output.writeFieldBegin("sessionID",Thrift.Type.I64,1);output.writeI64(this.sessionID);output.writeFieldEnd()}if(this.ticket!==null&&this.ticket!==undefined){output.writeFieldBegin("ticket",Thrift.Type.STRING,2);output.writeString(this.ticket);output.writeFieldEnd()}if(this.notifyID!==null&&this.notifyID!==undefined){output.writeFieldBegin("notifyID",Thrift.Type.I64,3);output.writeI64(this.notifyID);output.writeFieldEnd()}if(this.timeout!==null&&this.timeout!==undefined){output.writeFieldBegin("timeout",Thrift.Type.I32,4);output.writeI32(this.timeout);output.writeFieldEnd()}if(this.nextReqInterval!==null&&this.nextReqInterval!==undefined){output.writeFieldBegin("nextReqInterval",Thrift.Type.I32,5);output.writeI32(this.nextReqInterval);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};
@@ -0,0 +1,6 @@
1
+ "use strict";//
2
+ // Autogenerated by Thrift Compiler (0.9.3)
3
+ //
4
+ // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ //
6
+ NotifyResult=function NotifyResult(args){this.errorCode=null;if(args){if(args.errorCode!==undefined&&args.errorCode!==null){this.errorCode=args.errorCode}}};NotifyResult.prototype={};NotifyResult.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I16){this.errorCode=input.readI16().value}else{input.skip(ftype)}break;case 0:input.skip(ftype);break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};NotifyResult.prototype.write=function(output){output.writeStructBegin("NotifyResult");if(this.errorCode!==null&&this.errorCode!==undefined){output.writeFieldBegin("errorCode",Thrift.Type.I16,1);output.writeI16(this.errorCode);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};PresentBean=function PresentBean(args){this.userID=null;this.deviceType=null;this.flag=null;this.deviceInfo=null;this.operateDate=null;if(args){if(args.userID!==undefined&&args.userID!==null){this.userID=args.userID}if(args.deviceType!==undefined&&args.deviceType!==null){this.deviceType=args.deviceType}if(args.flag!==undefined&&args.flag!==null){this.flag=args.flag}if(args.deviceInfo!==undefined&&args.deviceInfo!==null){this.deviceInfo=args.deviceInfo}if(args.operateDate!==undefined&&args.operateDate!==null){this.operateDate=args.operateDate}}};PresentBean.prototype={};PresentBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.userID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.BYTE){this.deviceType=input.readByte().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.BYTE){this.flag=input.readByte().value}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.STRING){this.deviceInfo=input.readString().value}else{input.skip(ftype)}break;case 5:if(ftype==Thrift.Type.I64){this.operateDate=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};PresentBean.prototype.write=function(output){output.writeStructBegin("PresentBean");if(this.userID!==null&&this.userID!==undefined){output.writeFieldBegin("userID",Thrift.Type.I64,1);output.writeI64(this.userID);output.writeFieldEnd()}if(this.deviceType!==null&&this.deviceType!==undefined){output.writeFieldBegin("deviceType",Thrift.Type.BYTE,2);output.writeByte(this.deviceType);output.writeFieldEnd()}if(this.flag!==null&&this.flag!==undefined){output.writeFieldBegin("flag",Thrift.Type.BYTE,3);output.writeByte(this.flag);output.writeFieldEnd()}if(this.deviceInfo!==null&&this.deviceInfo!==undefined){output.writeFieldBegin("deviceInfo",Thrift.Type.STRING,4);output.writeString(this.deviceInfo);output.writeFieldEnd()}if(this.operateDate!==null&&this.operateDate!==undefined){output.writeFieldBegin("operateDate",Thrift.Type.I64,5);output.writeI64(this.operateDate);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};ResourceBean=function ResourceBean(args){this.appID=null;this.resourceType=null;this.deviceType=null;if(args){if(args.appID!==undefined&&args.appID!==null){this.appID=args.appID}if(args.resourceType!==undefined&&args.resourceType!==null){this.resourceType=args.resourceType}if(args.deviceType!==undefined&&args.deviceType!==null){this.deviceType=args.deviceType}}};ResourceBean.prototype={};ResourceBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.appID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.BYTE){this.resourceType=input.readByte().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.BYTE){this.deviceType=input.readByte().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};ResourceBean.prototype.write=function(output){output.writeStructBegin("ResourceBean");if(this.appID!==null&&this.appID!==undefined){output.writeFieldBegin("appID",Thrift.Type.I64,1);output.writeI64(this.appID);output.writeFieldEnd()}if(this.resourceType!==null&&this.resourceType!==undefined){output.writeFieldBegin("resourceType",Thrift.Type.BYTE,2);output.writeByte(this.resourceType);output.writeFieldEnd()}if(this.deviceType!==null&&this.deviceType!==undefined){output.writeFieldBegin("deviceType",Thrift.Type.BYTE,3);output.writeByte(this.deviceType);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};OperateBuddyInfo=function OperateBuddyInfo(args){this.operType=null;this.tub=null;this.timestamp=null;if(args){if(args.operType!==undefined&&args.operType!==null){this.operType=args.operType}if(args.tub!==undefined&&args.tub!==null){this.tub=new TinyUserBean(args.tub)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};OperateBuddyInfo.prototype={};OperateBuddyInfo.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.BYTE){this.operType=input.readByte().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.tub=new TinyUserBean;this.tub.read(input)}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};OperateBuddyInfo.prototype.write=function(output){output.writeStructBegin("OperateBuddyInfo");if(this.operType!==null&&this.operType!==undefined){output.writeFieldBegin("operType",Thrift.Type.BYTE,1);output.writeByte(this.operType);output.writeFieldEnd()}if(this.tub!==null&&this.tub!==undefined){output.writeFieldBegin("tub",Thrift.Type.STRUCT,2);this.tub.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,3);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};OperateUserInfo=function OperateUserInfo(args){this.ub=null;this.timestamp=null;if(args){if(args.ub!==undefined&&args.ub!==null){this.ub=new UserBean(args.ub)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};OperateUserInfo.prototype={};OperateUserInfo.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 2:if(ftype==Thrift.Type.STRUCT){this.ub=new UserBean;this.ub.read(input)}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};OperateUserInfo.prototype.write=function(output){output.writeStructBegin("OperateUserInfo");if(this.ub!==null&&this.ub!==undefined){output.writeFieldBegin("ub",Thrift.Type.STRUCT,2);this.ub.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,4);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};BuddyReqVerifyboxBean=function BuddyReqVerifyboxBean(args){this.brb=null;this.timestamp=null;if(args){if(args.brb!==undefined&&args.brb!==null){this.brb=new BuddyReqBean(args.brb)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};BuddyReqVerifyboxBean.prototype={};BuddyReqVerifyboxBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.brb=new BuddyReqBean;this.brb.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};BuddyReqVerifyboxBean.prototype.write=function(output){output.writeStructBegin("BuddyReqVerifyboxBean");if(this.brb!==null&&this.brb!==undefined){output.writeFieldBegin("brb",Thrift.Type.STRUCT,1);this.brb.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,2);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};BuddyRespVerifyboxBean=function BuddyRespVerifyboxBean(args){this.brb=null;this.timestamp=null;if(args){if(args.brb!==undefined&&args.brb!==null){this.brb=new BuddyRespBean(args.brb)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};BuddyRespVerifyboxBean.prototype={};BuddyRespVerifyboxBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.brb=new BuddyRespBean;this.brb.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};BuddyRespVerifyboxBean.prototype.write=function(output){output.writeStructBegin("BuddyRespVerifyboxBean");if(this.brb!==null&&this.brb!==undefined){output.writeFieldBegin("brb",Thrift.Type.STRUCT,1);this.brb.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,2);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupReqBean=function GroupReqBean(args){this.grq=null;this.timestamp=null;if(args){if(args.grq!==undefined&&args.grq!==null){this.grq=new GroupRequest(args.grq)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};GroupReqBean.prototype={};GroupReqBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.grq=new GroupRequest;this.grq.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupReqBean.prototype.write=function(output){output.writeStructBegin("GroupReqBean");if(this.grq!==null&&this.grq!==undefined){output.writeFieldBegin("grq",Thrift.Type.STRUCT,1);this.grq.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,2);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupRespBean=function GroupRespBean(args){this.grp=null;this.timestamp=null;if(args){if(args.grp!==undefined&&args.grp!==null){this.grp=new GroupResponse(args.grp)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};GroupRespBean.prototype={};GroupRespBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.grp=new GroupResponse;this.grp.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupRespBean.prototype.write=function(output){output.writeStructBegin("GroupRespBean");if(this.grp!==null&&this.grp!==undefined){output.writeFieldBegin("grp",Thrift.Type.STRUCT,1);this.grp.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,2);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupRespDoneBean=function GroupRespDoneBean(args){this.grp=null;this.timestamp=null;this.reqID=null;if(args){if(args.grp!==undefined&&args.grp!==null){this.grp=new GroupResponse(args.grp)}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}if(args.reqID!==undefined&&args.reqID!==null){this.reqID=args.reqID}}};GroupRespDoneBean.prototype={};GroupRespDoneBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.grp=new GroupResponse;this.grp.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.I64){this.reqID=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupRespDoneBean.prototype.write=function(output){output.writeStructBegin("GroupRespDoneBean");if(this.grp!==null&&this.grp!==undefined){output.writeFieldBegin("grp",Thrift.Type.STRUCT,1);this.grp.write(output);output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,2);output.writeI64(this.timestamp);output.writeFieldEnd()}if(this.reqID!==null&&this.reqID!==undefined){output.writeFieldBegin("reqID",Thrift.Type.I64,3);output.writeI64(this.reqID);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupRefreshBean=function GroupRefreshBean(args){this.timestamp=null;this.groupInfo=null;this.operType=null;this.userInfo=null;if(args){if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}if(args.groupInfo!==undefined&&args.groupInfo!==null){this.groupInfo=new GroupInfo(args.groupInfo)}if(args.operType!==undefined&&args.operType!==null){this.operType=args.operType}if(args.userInfo!==undefined&&args.userInfo!==null){this.userInfo=new SmallUserBean(args.userInfo)}}};GroupRefreshBean.prototype={};GroupRefreshBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.groupInfo=new GroupInfo;this.groupInfo.read(input)}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.BYTE){this.operType=input.readByte().value}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.STRUCT){this.userInfo=new SmallUserBean;this.userInfo.read(input)}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupRefreshBean.prototype.write=function(output){output.writeStructBegin("GroupRefreshBean");if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,1);output.writeI64(this.timestamp);output.writeFieldEnd()}if(this.groupInfo!==null&&this.groupInfo!==undefined){output.writeFieldBegin("groupInfo",Thrift.Type.STRUCT,2);this.groupInfo.write(output);output.writeFieldEnd()}if(this.operType!==null&&this.operType!==undefined){output.writeFieldBegin("operType",Thrift.Type.BYTE,3);output.writeByte(this.operType);output.writeFieldEnd()}if(this.userInfo!==null&&this.userInfo!==undefined){output.writeFieldBegin("userInfo",Thrift.Type.STRUCT,4);this.userInfo.write(output);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupTransferBean=function GroupTransferBean(args){this.userInfo=null;this.groupInfo=null;this.groupPageTimeStampMap=null;if(args){if(args.userInfo!==undefined&&args.userInfo!==null){this.userInfo=new SmallUserBean(args.userInfo)}if(args.groupInfo!==undefined&&args.groupInfo!==null){this.groupInfo=new TinyGroupInfo(args.groupInfo)}if(args.groupPageTimeStampMap!==undefined&&args.groupPageTimeStampMap!==null){this.groupPageTimeStampMap=Thrift.copyMap(args.groupPageTimeStampMap,[null])}}};GroupTransferBean.prototype={};GroupTransferBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.userInfo=new SmallUserBean;this.userInfo.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.groupInfo=new TinyGroupInfo;this.groupInfo.read(input)}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.MAP){var _size0=0;var _rtmp34;this.groupPageTimeStampMap={};var _ktype1=0;var _vtype2=0;_rtmp34=input.readMapBegin();_ktype1=_rtmp34.ktype;_vtype2=_rtmp34.vtype;_size0=_rtmp34.size;for(var _i5=0;_i5<_size0;++_i5){if(_i5>0){if(input.rstack.length>input.rpos[input.rpos.length-1]+1){input.rstack.pop()}}var key6=null;var val7=null;key6=input.readI16().value;val7=input.readI64().value;this.groupPageTimeStampMap[key6]=val7}input.readMapEnd()}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupTransferBean.prototype.write=function(output){output.writeStructBegin("GroupTransferBean");if(this.userInfo!==null&&this.userInfo!==undefined){output.writeFieldBegin("userInfo",Thrift.Type.STRUCT,1);this.userInfo.write(output);output.writeFieldEnd()}if(this.groupInfo!==null&&this.groupInfo!==undefined){output.writeFieldBegin("groupInfo",Thrift.Type.STRUCT,2);this.groupInfo.write(output);output.writeFieldEnd()}if(this.groupPageTimeStampMap!==null&&this.groupPageTimeStampMap!==undefined){output.writeFieldBegin("groupPageTimeStampMap",Thrift.Type.MAP,3);output.writeMapBegin(Thrift.Type.I16,Thrift.Type.I64,Thrift.objectLength(this.groupPageTimeStampMap));for(var kiter8 in this.groupPageTimeStampMap){if(this.groupPageTimeStampMap.hasOwnProperty(kiter8)){var viter9=this.groupPageTimeStampMap[kiter8];output.writeI16(kiter8);output.writeI64(viter9)}}output.writeMapEnd();output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupMemberInfoRefreshBean=function GroupMemberInfoRefreshBean(args){this.userInfo=null;this.tinyGroupMemberInfo=null;this.page=null;this.groupPageTimeStamp=null;this.groupID=null;this.appInfo=null;if(args){if(args.userInfo!==undefined&&args.userInfo!==null){this.userInfo=new SmallUserBean(args.userInfo)}if(args.tinyGroupMemberInfo!==undefined&&args.tinyGroupMemberInfo!==null){this.tinyGroupMemberInfo=new TinyGroupMemberInfo(args.tinyGroupMemberInfo)}if(args.page!==undefined&&args.page!==null){this.page=args.page}if(args.groupPageTimeStamp!==undefined&&args.groupPageTimeStamp!==null){this.groupPageTimeStamp=args.groupPageTimeStamp}if(args.groupID!==undefined&&args.groupID!==null){this.groupID=args.groupID}if(args.appInfo!==undefined&&args.appInfo!==null){this.appInfo=new SmallEntAppInfo(args.appInfo)}}};GroupMemberInfoRefreshBean.prototype={};GroupMemberInfoRefreshBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.userInfo=new SmallUserBean;this.userInfo.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.tinyGroupMemberInfo=new TinyGroupMemberInfo;this.tinyGroupMemberInfo.read(input)}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.I16){this.page=input.readI16().value}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.I64){this.groupPageTimeStamp=input.readI64().value}else{input.skip(ftype)}break;case 5:if(ftype==Thrift.Type.I64){this.groupID=input.readI64().value}else{input.skip(ftype)}break;case 6:if(ftype==Thrift.Type.STRUCT){this.appInfo=new SmallEntAppInfo;this.appInfo.read(input)}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupMemberInfoRefreshBean.prototype.write=function(output){output.writeStructBegin("GroupMemberInfoRefreshBean");if(this.userInfo!==null&&this.userInfo!==undefined){output.writeFieldBegin("userInfo",Thrift.Type.STRUCT,1);this.userInfo.write(output);output.writeFieldEnd()}if(this.tinyGroupMemberInfo!==null&&this.tinyGroupMemberInfo!==undefined){output.writeFieldBegin("tinyGroupMemberInfo",Thrift.Type.STRUCT,2);this.tinyGroupMemberInfo.write(output);output.writeFieldEnd()}if(this.page!==null&&this.page!==undefined){output.writeFieldBegin("page",Thrift.Type.I16,3);output.writeI16(this.page);output.writeFieldEnd()}if(this.groupPageTimeStamp!==null&&this.groupPageTimeStamp!==undefined){output.writeFieldBegin("groupPageTimeStamp",Thrift.Type.I64,4);output.writeI64(this.groupPageTimeStamp);output.writeFieldEnd()}if(this.groupID!==null&&this.groupID!==undefined){output.writeFieldBegin("groupID",Thrift.Type.I64,5);output.writeI64(this.groupID);output.writeFieldEnd()}if(this.appInfo!==null&&this.appInfo!==undefined){output.writeFieldBegin("appInfo",Thrift.Type.STRUCT,6);this.appInfo.write(output);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};GroupMembersRefreshBean=function GroupMembersRefreshBean(args){this.operType=null;this.GroupMemberInfoList=null;this.userInfoList=null;this.groupPageTimeStampMap=null;this.appList=null;if(args){if(args.operType!==undefined&&args.operType!==null){this.operType=args.operType}if(args.GroupMemberInfoList!==undefined&&args.GroupMemberInfoList!==null){this.GroupMemberInfoList=Thrift.copyList(args.GroupMemberInfoList,[GroupMemberInfo])}if(args.userInfoList!==undefined&&args.userInfoList!==null){this.userInfoList=Thrift.copyList(args.userInfoList,[SmallUserBean])}if(args.groupPageTimeStampMap!==undefined&&args.groupPageTimeStampMap!==null){this.groupPageTimeStampMap=Thrift.copyMap(args.groupPageTimeStampMap,[null])}if(args.appList!==undefined&&args.appList!==null){this.appList=Thrift.copyList(args.appList,[SmallEntAppInfo])}}};GroupMembersRefreshBean.prototype={};GroupMembersRefreshBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.BYTE){this.operType=input.readByte().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.LIST){var _size10=0;var _rtmp314;this.GroupMemberInfoList=[];var _etype13=0;_rtmp314=input.readListBegin();_etype13=_rtmp314.etype;_size10=_rtmp314.size;for(var _i15=0;_i15<_size10;++_i15){var elem16=null;elem16=new GroupMemberInfo;elem16.read(input);this.GroupMemberInfoList.push(elem16)}input.readListEnd()}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.LIST){var _size17=0;var _rtmp321;this.userInfoList=[];var _etype20=0;_rtmp321=input.readListBegin();_etype20=_rtmp321.etype;_size17=_rtmp321.size;for(var _i22=0;_i22<_size17;++_i22){var elem23=null;elem23=new SmallUserBean;elem23.read(input);this.userInfoList.push(elem23)}input.readListEnd()}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.MAP){var _size24=0;var _rtmp328;this.groupPageTimeStampMap={};var _ktype25=0;var _vtype26=0;_rtmp328=input.readMapBegin();_ktype25=_rtmp328.ktype;_vtype26=_rtmp328.vtype;_size24=_rtmp328.size;for(var _i29=0;_i29<_size24;++_i29){if(_i29>0){if(input.rstack.length>input.rpos[input.rpos.length-1]+1){input.rstack.pop()}}var key30=null;var val31=null;key30=input.readI16().value;val31=input.readI64().value;this.groupPageTimeStampMap[key30]=val31}input.readMapEnd()}else{input.skip(ftype)}break;case 5:if(ftype==Thrift.Type.LIST){var _size32=0;var _rtmp336;this.appList=[];var _etype35=0;_rtmp336=input.readListBegin();_etype35=_rtmp336.etype;_size32=_rtmp336.size;for(var _i37=0;_i37<_size32;++_i37){var elem38=null;elem38=new SmallEntAppInfo;elem38.read(input);this.appList.push(elem38)}input.readListEnd()}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};GroupMembersRefreshBean.prototype.write=function(output){output.writeStructBegin("GroupMembersRefreshBean");if(this.operType!==null&&this.operType!==undefined){output.writeFieldBegin("operType",Thrift.Type.BYTE,1);output.writeByte(this.operType);output.writeFieldEnd()}if(this.GroupMemberInfoList!==null&&this.GroupMemberInfoList!==undefined){output.writeFieldBegin("GroupMemberInfoList",Thrift.Type.LIST,2);output.writeListBegin(Thrift.Type.STRUCT,this.GroupMemberInfoList.length);for(var iter39 in this.GroupMemberInfoList){if(this.GroupMemberInfoList.hasOwnProperty(iter39)){iter39=this.GroupMemberInfoList[iter39];iter39.write(output)}}output.writeListEnd();output.writeFieldEnd()}if(this.userInfoList!==null&&this.userInfoList!==undefined){output.writeFieldBegin("userInfoList",Thrift.Type.LIST,3);output.writeListBegin(Thrift.Type.STRUCT,this.userInfoList.length);for(var iter40 in this.userInfoList){if(this.userInfoList.hasOwnProperty(iter40)){iter40=this.userInfoList[iter40];iter40.write(output)}}output.writeListEnd();output.writeFieldEnd()}if(this.groupPageTimeStampMap!==null&&this.groupPageTimeStampMap!==undefined){output.writeFieldBegin("groupPageTimeStampMap",Thrift.Type.MAP,4);output.writeMapBegin(Thrift.Type.I16,Thrift.Type.I64,Thrift.objectLength(this.groupPageTimeStampMap));for(var kiter41 in this.groupPageTimeStampMap){if(this.groupPageTimeStampMap.hasOwnProperty(kiter41)){var viter42=this.groupPageTimeStampMap[kiter41];output.writeI16(kiter41);output.writeI64(viter42)}}output.writeMapEnd();output.writeFieldEnd()}if(this.appList!==null&&this.appList!==undefined){output.writeFieldBegin("appList",Thrift.Type.LIST,5);output.writeListBegin(Thrift.Type.STRUCT,this.appList.length);for(var iter43 in this.appList){if(this.appList.hasOwnProperty(iter43)){iter43=this.appList[iter43];iter43.write(output)}}output.writeListEnd();output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};EnterpriseRegisterBean=function EnterpriseRegisterBean(args){this.code=null;this.message=null;this.registerEmail=null;this.registerUserID=null;this.registerTime=null;if(args){if(args.code!==undefined&&args.code!==null){this.code=args.code}if(args.message!==undefined&&args.message!==null){this.message=args.message}if(args.registerEmail!==undefined&&args.registerEmail!==null){this.registerEmail=args.registerEmail}if(args.registerUserID!==undefined&&args.registerUserID!==null){this.registerUserID=args.registerUserID}if(args.registerTime!==undefined&&args.registerTime!==null){this.registerTime=args.registerTime}}};EnterpriseRegisterBean.prototype={};EnterpriseRegisterBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.BYTE){this.code=input.readByte().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRING){this.message=input.readString().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.STRING){this.registerEmail=input.readString().value}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.I64){this.registerUserID=input.readI64().value}else{input.skip(ftype)}break;case 5:if(ftype==Thrift.Type.I64){this.registerTime=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};EnterpriseRegisterBean.prototype.write=function(output){output.writeStructBegin("EnterpriseRegisterBean");if(this.code!==null&&this.code!==undefined){output.writeFieldBegin("code",Thrift.Type.BYTE,1);output.writeByte(this.code);output.writeFieldEnd()}if(this.message!==null&&this.message!==undefined){output.writeFieldBegin("message",Thrift.Type.STRING,2);output.writeString(this.message);output.writeFieldEnd()}if(this.registerEmail!==null&&this.registerEmail!==undefined){output.writeFieldBegin("registerEmail",Thrift.Type.STRING,3);output.writeString(this.registerEmail);output.writeFieldEnd()}if(this.registerUserID!==null&&this.registerUserID!==undefined){output.writeFieldBegin("registerUserID",Thrift.Type.I64,4);output.writeI64(this.registerUserID);output.writeFieldEnd()}if(this.registerTime!==null&&this.registerTime!==undefined){output.writeFieldBegin("registerTime",Thrift.Type.I64,5);output.writeI64(this.registerTime);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};PushMessageBean=function PushMessageBean(args){this.previousMsgID=null;this.msgBean=null;if(args){if(args.previousMsgID!==undefined&&args.previousMsgID!==null){this.previousMsgID=args.previousMsgID}if(args.msgBean!==undefined&&args.msgBean!==null){this.msgBean=new PushMsgBean(args.msgBean)}}};PushMessageBean.prototype={};PushMessageBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.previousMsgID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.msgBean=new PushMsgBean;this.msgBean.read(input)}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};PushMessageBean.prototype.write=function(output){output.writeStructBegin("PushMessageBean");if(this.previousMsgID!==null&&this.previousMsgID!==undefined){output.writeFieldBegin("previousMsgID",Thrift.Type.I64,1);output.writeI64(this.previousMsgID);output.writeFieldEnd()}if(this.msgBean!==null&&this.msgBean!==undefined){output.writeFieldBegin("msgBean",Thrift.Type.STRUCT,2);this.msgBean.write(output);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};MessageStatusStatsBean=function MessageStatusStatsBean(args){this.messageID=null;this.statusMap=null;this.feedbackMap=null;this.timestamp=null;if(args){if(args.messageID!==undefined&&args.messageID!==null){this.messageID=args.messageID}if(args.statusMap!==undefined&&args.statusMap!==null){this.statusMap=Thrift.copyMap(args.statusMap,[null])}if(args.feedbackMap!==undefined&&args.feedbackMap!==null){this.feedbackMap=Thrift.copyMap(args.feedbackMap,[null])}if(args.timestamp!==undefined&&args.timestamp!==null){this.timestamp=args.timestamp}}};MessageStatusStatsBean.prototype={};MessageStatusStatsBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.messageID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.MAP){var _size44=0;var _rtmp348;this.statusMap={};var _ktype45=0;var _vtype46=0;_rtmp348=input.readMapBegin();_ktype45=_rtmp348.ktype;_vtype46=_rtmp348.vtype;_size44=_rtmp348.size;for(var _i49=0;_i49<_size44;++_i49){if(_i49>0){if(input.rstack.length>input.rpos[input.rpos.length-1]+1){input.rstack.pop()}}var key50=null;var val51=null;key50=input.readByte().value;val51=input.readI32().value;this.statusMap[key50]=val51}input.readMapEnd()}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.MAP){var _size52=0;var _rtmp356;this.feedbackMap={};var _ktype53=0;var _vtype54=0;_rtmp356=input.readMapBegin();_ktype53=_rtmp356.ktype;_vtype54=_rtmp356.vtype;_size52=_rtmp356.size;for(var _i57=0;_i57<_size52;++_i57){if(_i57>0){if(input.rstack.length>input.rpos[input.rpos.length-1]+1){input.rstack.pop()}}var key58=null;var val59=null;key58=input.readByte().value;val59=input.readI32().value;this.feedbackMap[key58]=val59}input.readMapEnd()}else{input.skip(ftype)}break;case 4:if(ftype==Thrift.Type.I64){this.timestamp=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};MessageStatusStatsBean.prototype.write=function(output){output.writeStructBegin("MessageStatusStatsBean");if(this.messageID!==null&&this.messageID!==undefined){output.writeFieldBegin("messageID",Thrift.Type.I64,1);output.writeI64(this.messageID);output.writeFieldEnd()}if(this.statusMap!==null&&this.statusMap!==undefined){output.writeFieldBegin("statusMap",Thrift.Type.MAP,2);output.writeMapBegin(Thrift.Type.BYTE,Thrift.Type.I32,Thrift.objectLength(this.statusMap));for(var kiter60 in this.statusMap){if(this.statusMap.hasOwnProperty(kiter60)){var viter61=this.statusMap[kiter60];output.writeByte(kiter60);output.writeI32(viter61)}}output.writeMapEnd();output.writeFieldEnd()}if(this.feedbackMap!==null&&this.feedbackMap!==undefined){output.writeFieldBegin("feedbackMap",Thrift.Type.MAP,3);output.writeMapBegin(Thrift.Type.BYTE,Thrift.Type.I32,Thrift.objectLength(this.feedbackMap));for(var kiter62 in this.feedbackMap){if(this.feedbackMap.hasOwnProperty(kiter62)){var viter63=this.feedbackMap[kiter62];output.writeByte(kiter62);output.writeI32(viter63)}}output.writeMapEnd();output.writeFieldEnd()}if(this.timestamp!==null&&this.timestamp!==undefined){output.writeFieldBegin("timestamp",Thrift.Type.I64,4);output.writeI64(this.timestamp);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};FaceJoinGroupBean=function FaceJoinGroupBean(args){this.roomID=null;this.userInfo=null;if(args){if(args.roomID!==undefined&&args.roomID!==null){this.roomID=args.roomID}if(args.userInfo!==undefined&&args.userInfo!==null){this.userInfo=new SmallUserBean(args.userInfo)}}};FaceJoinGroupBean.prototype={};FaceJoinGroupBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRING){this.roomID=input.readString().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRUCT){this.userInfo=new SmallUserBean;this.userInfo.read(input)}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};FaceJoinGroupBean.prototype.write=function(output){output.writeStructBegin("FaceJoinGroupBean");if(this.roomID!==null&&this.roomID!==undefined){output.writeFieldBegin("roomID",Thrift.Type.STRING,1);output.writeString(this.roomID);output.writeFieldEnd()}if(this.userInfo!==null&&this.userInfo!==undefined){output.writeFieldBegin("userInfo",Thrift.Type.STRUCT,2);this.userInfo.write(output);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};ExitFaceJoinGroupBean=function ExitFaceJoinGroupBean(args){this.roomID=null;this.userID=null;this.deleteRoom=null;if(args){if(args.roomID!==undefined&&args.roomID!==null){this.roomID=args.roomID}if(args.userID!==undefined&&args.userID!==null){this.userID=args.userID}if(args.deleteRoom!==undefined&&args.deleteRoom!==null){this.deleteRoom=args.deleteRoom}}};ExitFaceJoinGroupBean.prototype={};ExitFaceJoinGroupBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRING){this.roomID=input.readString().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.userID=input.readI64().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.BYTE){this.deleteRoom=input.readByte().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};ExitFaceJoinGroupBean.prototype.write=function(output){output.writeStructBegin("ExitFaceJoinGroupBean");if(this.roomID!==null&&this.roomID!==undefined){output.writeFieldBegin("roomID",Thrift.Type.STRING,1);output.writeString(this.roomID);output.writeFieldEnd()}if(this.userID!==null&&this.userID!==undefined){output.writeFieldBegin("userID",Thrift.Type.I64,2);output.writeI64(this.userID);output.writeFieldEnd()}if(this.deleteRoom!==null&&this.deleteRoom!==undefined){output.writeFieldBegin("deleteRoom",Thrift.Type.BYTE,3);output.writeByte(this.deleteRoom);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};CreateFaceGroupSuccessBean=function CreateFaceGroupSuccessBean(args){this.roomID=null;this.groupID=null;this.joinFlag=null;if(args){if(args.roomID!==undefined&&args.roomID!==null){this.roomID=args.roomID}if(args.groupID!==undefined&&args.groupID!==null){this.groupID=args.groupID}if(args.joinFlag!==undefined&&args.joinFlag!==null){this.joinFlag=args.joinFlag}}};CreateFaceGroupSuccessBean.prototype={};CreateFaceGroupSuccessBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRING){this.roomID=input.readString().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.groupID=input.readI64().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.BYTE){this.joinFlag=input.readByte().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};CreateFaceGroupSuccessBean.prototype.write=function(output){output.writeStructBegin("CreateFaceGroupSuccessBean");if(this.roomID!==null&&this.roomID!==undefined){output.writeFieldBegin("roomID",Thrift.Type.STRING,1);output.writeString(this.roomID);output.writeFieldEnd()}if(this.groupID!==null&&this.groupID!==undefined){output.writeFieldBegin("groupID",Thrift.Type.I64,2);output.writeI64(this.groupID);output.writeFieldEnd()}if(this.joinFlag!==null&&this.joinFlag!==undefined){output.writeFieldBegin("joinFlag",Thrift.Type.BYTE,3);output.writeByte(this.joinFlag);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};AppMsgBean=function AppMsgBean(args){this.smallEntAppInfo=null;this.operType=null;if(args){if(args.smallEntAppInfo!==undefined&&args.smallEntAppInfo!==null){this.smallEntAppInfo=new SmallEntAppInfo(args.smallEntAppInfo)}if(args.operType!==undefined&&args.operType!==null){this.operType=args.operType}}};AppMsgBean.prototype={};AppMsgBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.STRUCT){this.smallEntAppInfo=new SmallEntAppInfo;this.smallEntAppInfo.read(input)}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.BYTE){this.operType=input.readByte().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};AppMsgBean.prototype.write=function(output){output.writeStructBegin("AppMsgBean");if(this.smallEntAppInfo!==null&&this.smallEntAppInfo!==undefined){output.writeFieldBegin("smallEntAppInfo",Thrift.Type.STRUCT,1);this.smallEntAppInfo.write(output);output.writeFieldEnd()}if(this.operType!==null&&this.operType!==undefined){output.writeFieldBegin("operType",Thrift.Type.BYTE,2);output.writeByte(this.operType);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};MessageCursorBean=function MessageCursorBean(args){this.userID=null;this.targetID=null;this.maxReadID=null;if(args){if(args.userID!==undefined&&args.userID!==null){this.userID=args.userID}if(args.targetID!==undefined&&args.targetID!==null){this.targetID=args.targetID}if(args.maxReadID!==undefined&&args.maxReadID!==null){this.maxReadID=args.maxReadID}}};MessageCursorBean.prototype={};MessageCursorBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I64){this.userID=input.readI64().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.I64){this.targetID=input.readI64().value}else{input.skip(ftype)}break;case 3:if(ftype==Thrift.Type.I64){this.maxReadID=input.readI64().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};MessageCursorBean.prototype.write=function(output){output.writeStructBegin("MessageCursorBean");if(this.userID!==null&&this.userID!==undefined){output.writeFieldBegin("userID",Thrift.Type.I64,1);output.writeI64(this.userID);output.writeFieldEnd()}if(this.targetID!==null&&this.targetID!==undefined){output.writeFieldBegin("targetID",Thrift.Type.I64,2);output.writeI64(this.targetID);output.writeFieldEnd()}if(this.maxReadID!==null&&this.maxReadID!==undefined){output.writeFieldBegin("maxReadID",Thrift.Type.I64,3);output.writeI64(this.maxReadID);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};JsonMessageBean=function JsonMessageBean(args){this.msgType=null;this.respJson=null;if(args){if(args.msgType!==undefined&&args.msgType!==null){this.msgType=args.msgType}if(args.respJson!==undefined&&args.respJson!==null){this.respJson=args.respJson}}};JsonMessageBean.prototype={};JsonMessageBean.prototype.read=function(input){input.readStructBegin();while(true){var ret=input.readFieldBegin();var fname=ret.fname;var ftype=ret.ftype;var fid=ret.fid;if(ftype==Thrift.Type.STOP){break}switch(fid){case 1:if(ftype==Thrift.Type.I16){this.msgType=input.readI16().value}else{input.skip(ftype)}break;case 2:if(ftype==Thrift.Type.STRING){this.respJson=input.readString().value}else{input.skip(ftype)}break;default:input.skip(ftype);}input.readFieldEnd()}input.readStructEnd();return};JsonMessageBean.prototype.write=function(output){output.writeStructBegin("JsonMessageBean");if(this.msgType!==null&&this.msgType!==undefined){output.writeFieldBegin("msgType",Thrift.Type.I16,1);output.writeI16(this.msgType);output.writeFieldEnd()}if(this.respJson!==null&&this.respJson!==undefined){output.writeFieldBegin("respJson",Thrift.Type.STRING,2);output.writeString(this.respJson);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd();return};
@@ -0,0 +1,397 @@
1
+ "use strict";/*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */ /*jshint evil:true*/ /**
19
+ * The Thrift namespace houses the Apache Thrift JavaScript library
20
+ * elements providing JavaScript bindings for the Apache Thrift RPC
21
+ * system. End users will typically only directly make use of the
22
+ * Transport (TXHRTransport/TWebSocketTransport) and Protocol
23
+ * (TJSONPRotocol/TBinaryProtocol) constructors.
24
+ *
25
+ * Object methods beginning with a __ (e.g. __onOpen()) are internal
26
+ * and should not be called outside of the object's own methods.
27
+ *
28
+ * This library creates one global object: Thrift
29
+ * Code in this library must never create additional global identifiers,
30
+ * all features must be scoped within the Thrift namespace.
31
+ * @namespace
32
+ * @example
33
+ * var transport = new Thrift.Transport("http://localhost:8585");
34
+ * var protocol = new Thrift.Protocol(transport);
35
+ * var client = new MyThriftSvcClient(protocol);
36
+ * var result = client.MyMethod();
37
+ */var Thrift={/**
38
+ * Thrift JavaScript library version.
39
+ * @readonly
40
+ * @const {string} Version
41
+ * @memberof Thrift
42
+ */Version:"0.9.3",/**
43
+ * Thrift IDL type string to Id mapping.
44
+ * @readonly
45
+ * @property {number} STOP - End of a set of fields.
46
+ * @property {number} VOID - No value (only legal for return types).
47
+ * @property {number} BOOL - True/False integer.
48
+ * @property {number} BYTE - Signed 8 bit integer.
49
+ * @property {number} I08 - Signed 8 bit integer.
50
+ * @property {number} DOUBLE - 64 bit IEEE 854 floating point.
51
+ * @property {number} I16 - Signed 16 bit integer.
52
+ * @property {number} I32 - Signed 32 bit integer.
53
+ * @property {number} I64 - Signed 64 bit integer.
54
+ * @property {number} STRING - Array of bytes representing a string of characters.
55
+ * @property {number} UTF7 - Array of bytes representing a string of UTF7 encoded characters.
56
+ * @property {number} STRUCT - A multifield type.
57
+ * @property {number} MAP - A collection type (map/associative-array/dictionary).
58
+ * @property {number} SET - A collection type (unordered and without repeated values).
59
+ * @property {number} LIST - A collection type (unordered).
60
+ * @property {number} UTF8 - Array of bytes representing a string of UTF8 encoded characters.
61
+ * @property {number} UTF16 - Array of bytes representing a string of UTF16 encoded characters.
62
+ */Type:{"STOP":0,"VOID":1,"BOOL":2,"BYTE":3,"I08":3,"DOUBLE":4,"I16":6,"I32":8,"I64":10,"STRING":11,"UTF7":11,"STRUCT":12,"MAP":13,"SET":14,"LIST":15,"UTF8":16,"UTF16":17},/**
63
+ * Thrift RPC message type string to Id mapping.
64
+ * @readonly
65
+ * @property {number} CALL - RPC call sent from client to server.
66
+ * @property {number} REPLY - RPC call normal response from server to client.
67
+ * @property {number} EXCEPTION - RPC call exception response from server to client.
68
+ * @property {number} ONEWAY - Oneway RPC call from client to server with no response.
69
+ */MessageType:{"CALL":1,"REPLY":2,"EXCEPTION":3,"ONEWAY":4},/**
70
+ * Utility function returning the count of an object's own properties.
71
+ * @param {object} obj - Object to test.
72
+ * @returns {number} number of object's own properties
73
+ */objectLength:function objectLength(obj){var length=0;for(var k in obj){if(obj.hasOwnProperty(k)){length++}}return length},/**
74
+ * Utility function to establish prototype inheritance.
75
+ * @see {@link http://javascript.crockford.com/prototypal.html|Prototypal Inheritance}
76
+ * @param {function} constructor - Contstructor function to set as derived.
77
+ * @param {function} superConstructor - Contstructor function to set as base.
78
+ * @param {string} [name] - Type name to set as name property in derived prototype.
79
+ */inherits:function inherits(constructor,superConstructor,name){function F(){}F.prototype=superConstructor.prototype;constructor.prototype=new F;constructor.prototype.name=name||""}};/**
80
+ * Initializes a Thrift TException instance.
81
+ * @constructor
82
+ * @augments Error
83
+ * @param {string} message - The TException message (distinct from the Error message).
84
+ * @classdesc TException is the base class for all Thrift exceptions types.
85
+ */Thrift.TException=function(message){this.message=message};Thrift.inherits(Thrift.TException,Error,"TException");/**
86
+ * Returns the message set on the exception.
87
+ * @readonly
88
+ * @returns {string} exception message
89
+ */Thrift.TException.prototype.getMessage=function(){return this.message};/**
90
+ * Thrift Application Exception type string to Id mapping.
91
+ * @readonly
92
+ * @property {number} UNKNOWN - Unknown/undefined.
93
+ * @property {number} UNKNOWN_METHOD - Client attempted to call a method unknown to the server.
94
+ * @property {number} INVALID_MESSAGE_TYPE - Client passed an unknown/unsupported MessageType.
95
+ * @property {number} WRONG_METHOD_NAME - Unused.
96
+ * @property {number} BAD_SEQUENCE_ID - Unused in Thrift RPC, used to flag proprietary sequence number errors.
97
+ * @property {number} MISSING_RESULT - Raised by a server processor if a handler fails to supply the required return result.
98
+ * @property {number} INTERNAL_ERROR - Something bad happened.
99
+ * @property {number} PROTOCOL_ERROR - The protocol layer failed to serialize or deserialize data.
100
+ * @property {number} INVALID_TRANSFORM - Unused.
101
+ * @property {number} INVALID_PROTOCOL - The protocol (or version) is not supported.
102
+ * @property {number} UNSUPPORTED_CLIENT_TYPE - Unused.
103
+ */Thrift.TApplicationExceptionType={"UNKNOWN":0,"UNKNOWN_METHOD":1,"INVALID_MESSAGE_TYPE":2,"WRONG_METHOD_NAME":3,"BAD_SEQUENCE_ID":4,"MISSING_RESULT":5,"INTERNAL_ERROR":6,"PROTOCOL_ERROR":7,"INVALID_TRANSFORM":8,"INVALID_PROTOCOL":9,"UNSUPPORTED_CLIENT_TYPE":10};/**
104
+ * Initializes a Thrift TApplicationException instance.
105
+ * @constructor
106
+ * @augments Thrift.TException
107
+ * @param {string} message - The TApplicationException message (distinct from the Error message).
108
+ * @param {Thrift.TApplicationExceptionType} [code] - The TApplicationExceptionType code.
109
+ * @classdesc TApplicationException is the exception class used to propagate exceptions from an RPC server back to a calling client.
110
+ */Thrift.TApplicationException=function(message,code){this.message=message;this.code=typeof code==="number"?code:0};Thrift.inherits(Thrift.TApplicationException,Thrift.TException,"TApplicationException");/**
111
+ * Read a TApplicationException from the supplied protocol.
112
+ * @param {object} input - The input protocol to read from.
113
+ */Thrift.TApplicationException.prototype.read=function(input){while(1){var ret=input.readFieldBegin();if(ret.ftype==Thrift.Type.STOP){break}var fid=ret.fid;switch(fid){case 1:if(ret.ftype==Thrift.Type.STRING){ret=input.readString();this.message=ret.value}else{ret=input.skip(ret.ftype)}break;case 2:if(ret.ftype==Thrift.Type.I32){ret=input.readI32();this.code=ret.value}else{ret=input.skip(ret.ftype)}break;default:ret=input.skip(ret.ftype);break;}input.readFieldEnd()}input.readStructEnd()};/**
114
+ * Wite a TApplicationException to the supplied protocol.
115
+ * @param {object} output - The output protocol to write to.
116
+ */Thrift.TApplicationException.prototype.write=function(output){output.writeStructBegin("TApplicationException");if(this.message){output.writeFieldBegin("message",Thrift.Type.STRING,1);output.writeString(this.getMessage());output.writeFieldEnd()}if(this.code){output.writeFieldBegin("type",Thrift.Type.I32,2);output.writeI32(this.code);output.writeFieldEnd()}output.writeFieldStop();output.writeStructEnd()};/**
117
+ * Returns the application exception code set on the exception.
118
+ * @readonly
119
+ * @returns {Thrift.TApplicationExceptionType} exception code
120
+ */Thrift.TApplicationException.prototype.getCode=function(){return this.code};/**
121
+ * Constructor Function for the XHR transport.
122
+ * If you do not specify a url then you must handle XHR operations on
123
+ * your own. This type can also be constructed using the Transport alias
124
+ * for backward compatibility.
125
+ * @constructor
126
+ * @param {string} [url] - The URL to connect to.
127
+ * @classdesc The Apache Thrift Transport layer performs byte level I/O
128
+ * between RPC clients and servers. The JavaScript TXHRTransport object
129
+ * uses Http[s]/XHR. Target servers must implement the http[s] transport
130
+ * (see: node.js example server_http.js).
131
+ * @example
132
+ * var transport = new Thrift.TXHRTransport("http://localhost:8585");
133
+ */Thrift.Transport=Thrift.TXHRTransport=function(url,options){this.url=url;this.wpos=0;this.rpos=0;this.useCORS=options&&options.useCORS;this.send_buf="";this.recv_buf=""};Thrift.TXHRTransport.prototype={/**
134
+ * Gets the browser specific XmlHttpRequest Object.
135
+ * @returns {object} the browser XHR interface object
136
+ */getXmlHttpRequestObject:function getXmlHttpRequestObject(){try{return new XMLHttpRequest}catch(e1){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e2){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e3){}throw"Your browser doesn't support XHR."},/**
137
+ * Sends the current XRH request if the transport was created with a URL
138
+ * and the async parameter is false. If the transport was not created with
139
+ * a URL, or the async parameter is True and no callback is provided, or
140
+ * the URL is an empty string, the current send buffer is returned.
141
+ * @param {object} async - If true the current send buffer is returned.
142
+ * @param {object} callback - Optional async completion callback
143
+ * @returns {undefined|string} Nothing or the current send buffer.
144
+ * @throws {string} If XHR fails.
145
+ */flush:function flush(async,callback){var self=this;if(async&&!callback||this.url===undefined||this.url===""){return this.send_buf}var xreq=this.getXmlHttpRequestObject();if(xreq.overrideMimeType){xreq.overrideMimeType("application/vnd.apache.thrift.json; charset=utf-8")}if(callback){//Ignore XHR callbacks until the data arrives, then call the
146
+ // client's callback
147
+ xreq.onreadystatechange=function(){var clientCallback=callback;return function(){if(this.readyState==4&&this.status==200){self.setRecvBuffer(this.responseText);clientCallback()}}}()}xreq.open("POST",this.url,!!async);if(xreq.setRequestHeader){xreq.setRequestHeader("Accept","application/vnd.apache.thrift.json; charset=utf-8");xreq.setRequestHeader("Content-Type","application/vnd.apache.thrift.json; charset=utf-8")}xreq.send(this.send_buf);if(async&&callback){return}if(xreq.readyState!=4){throw"encountered an unknown ajax ready state: "+xreq.readyState}if(xreq.status!=200){throw"encountered a unknown request status: "+xreq.status}this.recv_buf=xreq.responseText;this.recv_buf_sz=this.recv_buf.length;this.wpos=this.recv_buf.length;this.rpos=0},/**
148
+ * Creates a jQuery XHR object to be used for a Thrift server call.
149
+ * @param {object} client - The Thrift Service client object generated by the IDL compiler.
150
+ * @param {object} postData - The message to send to the server.
151
+ * @param {function} args - The original call arguments with the success call back at the end.
152
+ * @param {function} recv_method - The Thrift Service Client receive method for the call.
153
+ * @returns {object} A new jQuery XHR object.
154
+ * @throws {string} If the jQuery version is prior to 1.5 or if jQuery is not found.
155
+ */jqRequest:function jqRequest(client,postData,args,recv_method){if(typeof jQuery==="undefined"||typeof jQuery.Deferred==="undefined"){throw"Thrift.js requires jQuery 1.5+ to use asynchronous requests"}var thriftTransport=this;var jqXHR=jQuery.ajax({url:this.url,data:postData,type:"POST",cache:false,contentType:"application/vnd.apache.thrift.json; charset=utf-8",dataType:"text thrift",converters:{"text thrift":function textThrift(responseData){thriftTransport.setRecvBuffer(responseData);var value=recv_method.call(client);return value}},context:client,success:jQuery.makeArray(args).pop()});return jqXHR},/**
156
+ * Sets the buffer to provide the protocol when deserializing.
157
+ * @param {string} buf - The buffer to supply the protocol.
158
+ */setRecvBuffer:function setRecvBuffer(buf){this.recv_buf=buf;this.recv_buf_sz=this.recv_buf.length;this.wpos=this.recv_buf.length;this.rpos=0},/**
159
+ * Returns true if the transport is open, XHR always returns true.
160
+ * @readonly
161
+ * @returns {boolean} Always True.
162
+ */isOpen:function isOpen(){return true},/**
163
+ * Opens the transport connection, with XHR this is a nop.
164
+ */open:function open(){},/**
165
+ * Closes the transport connection, with XHR this is a nop.
166
+ */close:function close(){},/**
167
+ * Returns the specified number of characters from the response
168
+ * buffer.
169
+ * @param {number} len - The number of characters to return.
170
+ * @returns {string} Characters sent by the server.
171
+ */read:function read(len){var avail=this.wpos-this.rpos;if(avail===0){return""}var give=len;if(avail<len){give=avail}var ret=this.read_buf.substr(this.rpos,give);this.rpos+=give;//clear buf when complete?
172
+ return ret},/**
173
+ * Returns the entire response buffer.
174
+ * @returns {string} Characters sent by the server.
175
+ */readAll:function readAll(){return this.recv_buf},/**
176
+ * Sets the send buffer to buf.
177
+ * @param {string} buf - The buffer to send.
178
+ */write:function write(buf){this.send_buf=buf},/**
179
+ * Returns the send buffer.
180
+ * @readonly
181
+ * @returns {string} The send buffer.
182
+ */getSendBuffer:function getSendBuffer(){return this.send_buf}};/**
183
+ * Constructor Function for the WebSocket transport.
184
+ * @constructor
185
+ * @param {string} [url] - The URL to connect to.
186
+ * @classdesc The Apache Thrift Transport layer performs byte level I/O
187
+ * between RPC clients and servers. The JavaScript TWebSocketTransport object
188
+ * uses the WebSocket protocol. Target servers must implement WebSocket.
189
+ * (see: node.js example server_http.js).
190
+ * @example
191
+ * var transport = new Thrift.TWebSocketTransport("http://localhost:8585");
192
+ */Thrift.TWebSocketTransport=function(url){this.__reset(url)};Thrift.TWebSocketTransport.prototype={__reset:function __reset(url){this.url=url;//Where to connect
193
+ this.socket=null;//The web socket
194
+ this.callbacks=[];//Pending callbacks
195
+ this.send_pending=[];//Buffers/Callback pairs waiting to be sent
196
+ this.send_buf="";//Outbound data, immutable until sent
197
+ this.recv_buf="";//Inbound data
198
+ this.rb_wpos=0;//Network write position in receive buffer
199
+ this.rb_rpos=0;//Client read position in receive buffer
200
+ },/**
201
+ * Sends the current WS request and registers callback. The async
202
+ * parameter is ignored (WS flush is always async) and the callback
203
+ * function parameter is required.
204
+ * @param {object} async - Ignored.
205
+ * @param {object} callback - The client completion callback.
206
+ * @returns {undefined|string} Nothing (undefined)
207
+ */flush:function flush(async,callback){var self=this;if(this.isOpen()){//Send data and register a callback to invoke the client callback
208
+ this.socket.send(this.send_buf);this.callbacks.push(function(){var clientCallback=callback;return function(msg){self.setRecvBuffer(msg);clientCallback()}}())}else{//Queue the send to go out __onOpen
209
+ this.send_pending.push({buf:this.send_buf,cb:callback})}},__onOpen:function __onOpen(){var self=this;if(this.send_pending.length>0){//If the user made calls before the connection was fully
210
+ //open, send them now
211
+ this.send_pending.forEach(function(elem){this.socket.send(elem.buf);this.callbacks.push(function(){var clientCallback=elem.cb;return function(msg){self.setRecvBuffer(msg);clientCallback()}}())});this.send_pending=[]}},__onClose:function __onClose(evt){this.__reset(this.url)},__onMessage:function __onMessage(evt){if(this.callbacks.length){this.callbacks.shift()(evt.data)}},__onError:function __onError(evt){console.log("Thrift WebSocket Error: "+evt.toString());this.socket.close()},/**
212
+ * Sets the buffer to use when receiving server responses.
213
+ * @param {string} buf - The buffer to receive server responses.
214
+ */setRecvBuffer:function setRecvBuffer(buf){this.recv_buf=buf;this.recv_buf_sz=this.recv_buf.length;this.wpos=this.recv_buf.length;this.rpos=0},/**
215
+ * Returns true if the transport is open
216
+ * @readonly
217
+ * @returns {boolean}
218
+ */isOpen:function isOpen(){return this.socket&&this.socket.readyState==this.socket.OPEN},/**
219
+ * Opens the transport connection
220
+ */open:function open(){//If OPEN/CONNECTING/CLOSING ignore additional opens
221
+ if(this.socket&&this.socket.readyState!=this.socket.CLOSED){return}//If there is no socket or the socket is closed:
222
+ this.socket=new WebSocket(this.url);this.socket.onopen=this.__onOpen.bind(this);this.socket.onmessage=this.__onMessage.bind(this);this.socket.onerror=this.__onError.bind(this);this.socket.onclose=this.__onClose.bind(this)},/**
223
+ * Closes the transport connection
224
+ */close:function close(){this.socket.close()},/**
225
+ * Returns the specified number of characters from the response
226
+ * buffer.
227
+ * @param {number} len - The number of characters to return.
228
+ * @returns {string} Characters sent by the server.
229
+ */read:function read(len){var avail=this.wpos-this.rpos;if(avail===0){return""}var give=len;if(avail<len){give=avail}var ret=this.read_buf.substr(this.rpos,give);this.rpos+=give;//clear buf when complete?
230
+ return ret},/**
231
+ * Returns the entire response buffer.
232
+ * @returns {string} Characters sent by the server.
233
+ */readAll:function readAll(){return this.recv_buf},/**
234
+ * Sets the send buffer to buf.
235
+ * @param {string} buf - The buffer to send.
236
+ */write:function write(buf){this.send_buf=buf},/**
237
+ * Returns the send buffer.
238
+ * @readonly
239
+ * @returns {string} The send buffer.
240
+ */getSendBuffer:function getSendBuffer(){return this.send_buf}};/**
241
+ * Initializes a Thrift JSON protocol instance.
242
+ * @constructor
243
+ * @param {Thrift.Transport} transport - The transport to serialize to/from.
244
+ * @classdesc Apache Thrift Protocols perform serialization which enables cross
245
+ * language RPC. The Protocol type is the JavaScript browser implementation
246
+ * of the Apache Thrift TJSONProtocol.
247
+ * @example
248
+ * var protocol = new Thrift.Protocol(transport);
249
+ */Thrift.TJSONProtocol=Thrift.Protocol=function(transport){this.tstack=[];this.tpos=[];this.transport=transport};/**
250
+ * Thrift IDL type Id to string mapping.
251
+ * @readonly
252
+ * @see {@link Thrift.Type}
253
+ */Thrift.Protocol.Type={};Thrift.Protocol.Type[Thrift.Type.BOOL]="\"tf\"";Thrift.Protocol.Type[Thrift.Type.BYTE]="\"i8\"";Thrift.Protocol.Type[Thrift.Type.I16]="\"i16\"";Thrift.Protocol.Type[Thrift.Type.I32]="\"i32\"";Thrift.Protocol.Type[Thrift.Type.I64]="\"i64\"";Thrift.Protocol.Type[Thrift.Type.DOUBLE]="\"dbl\"";Thrift.Protocol.Type[Thrift.Type.STRUCT]="\"rec\"";Thrift.Protocol.Type[Thrift.Type.STRING]="\"str\"";Thrift.Protocol.Type[Thrift.Type.MAP]="\"map\"";Thrift.Protocol.Type[Thrift.Type.LIST]="\"lst\"";Thrift.Protocol.Type[Thrift.Type.SET]="\"set\"";/**
254
+ * Thrift IDL type string to Id mapping.
255
+ * @readonly
256
+ * @see {@link Thrift.Type}
257
+ */Thrift.Protocol.RType={};Thrift.Protocol.RType.tf=Thrift.Type.BOOL;Thrift.Protocol.RType.i8=Thrift.Type.BYTE;Thrift.Protocol.RType.i16=Thrift.Type.I16;Thrift.Protocol.RType.i32=Thrift.Type.I32;Thrift.Protocol.RType.i64=Thrift.Type.I64;Thrift.Protocol.RType.dbl=Thrift.Type.DOUBLE;Thrift.Protocol.RType.rec=Thrift.Type.STRUCT;Thrift.Protocol.RType.str=Thrift.Type.STRING;Thrift.Protocol.RType.map=Thrift.Type.MAP;Thrift.Protocol.RType.lst=Thrift.Type.LIST;Thrift.Protocol.RType.set=Thrift.Type.SET;/**
258
+ * The TJSONProtocol version number.
259
+ * @readonly
260
+ * @const {number} Version
261
+ * @memberof Thrift.Protocol
262
+ */Thrift.Protocol.Version=1;Thrift.Protocol.prototype={/**
263
+ * Returns the underlying transport.
264
+ * @readonly
265
+ * @returns {Thrift.Transport} The underlying transport.
266
+ */getTransport:function getTransport(){return this.transport},/**
267
+ * Serializes the beginning of a Thrift RPC message.
268
+ * @param {string} name - The service method to call.
269
+ * @param {Thrift.MessageType} messageType - The type of method call.
270
+ * @param {number} seqid - The sequence number of this call (always 0 in Apache Thrift).
271
+ */writeMessageBegin:function writeMessageBegin(name,messageType,seqid){this.tstack=[];this.tpos=[];this.tstack.push([Thrift.Protocol.Version,"\""+name+"\"",messageType,seqid])},/**
272
+ * Serializes the end of a Thrift RPC message.
273
+ */writeMessageEnd:function writeMessageEnd(){var obj=this.tstack.pop();this.wobj=this.tstack.pop();this.wobj.push(obj);this.wbuf="["+this.wobj.join(",")+"]";this.transport.write(this.wbuf)},/**
274
+ * Serializes the beginning of a struct.
275
+ * @param {string} name - The name of the struct.
276
+ */writeStructBegin:function writeStructBegin(name){this.tpos.push(this.tstack.length);this.tstack.push({})},/**
277
+ * Serializes the end of a struct.
278
+ */writeStructEnd:function writeStructEnd(){var p=this.tpos.pop();var struct=this.tstack[p];var str="{";var first=true;for(var key in struct){if(first){first=false}else{str+=","}str+=key+":"+struct[key]}str+="}";this.tstack[p]=str},/**
279
+ * Serializes the beginning of a struct field.
280
+ * @param {string} name - The name of the field.
281
+ * @param {Thrift.Protocol.Type} fieldType - The data type of the field.
282
+ * @param {number} fieldId - The field's unique identifier.
283
+ */writeFieldBegin:function writeFieldBegin(name,fieldType,fieldId){this.tpos.push(this.tstack.length);this.tstack.push({"fieldId":"\""+fieldId+"\"","fieldType":Thrift.Protocol.Type[fieldType]})},/**
284
+ * Serializes the end of a field.
285
+ */writeFieldEnd:function writeFieldEnd(){var value=this.tstack.pop();var fieldInfo=this.tstack.pop();this.tstack[this.tstack.length-1][fieldInfo.fieldId]="{"+fieldInfo.fieldType+":"+value+"}";this.tpos.pop()},/**
286
+ * Serializes the end of the set of fields for a struct.
287
+ */writeFieldStop:function writeFieldStop(){//na
288
+ },/**
289
+ * Serializes the beginning of a map collection.
290
+ * @param {Thrift.Type} keyType - The data type of the key.
291
+ * @param {Thrift.Type} valType - The data type of the value.
292
+ * @param {number} [size] - The number of elements in the map (ignored).
293
+ */writeMapBegin:function writeMapBegin(keyType,valType,size){this.tpos.push(this.tstack.length);this.tstack.push([Thrift.Protocol.Type[keyType],Thrift.Protocol.Type[valType],0])},/**
294
+ * Serializes the end of a map.
295
+ */writeMapEnd:function writeMapEnd(){var p=this.tpos.pop();if(p==this.tstack.length){return}if((this.tstack.length-p-1)%2!==0){this.tstack.push("")}var size=(this.tstack.length-p-1)/2;this.tstack[p][this.tstack[p].length-1]=size;var map="}";var first=true;while(this.tstack.length>p+1){var v=this.tstack.pop();var k=this.tstack.pop();if(first){first=false}else{map=","+map}if(!isNaN(k)){k="\""+k+"\""}//json "keys" need to be strings
296
+ map=k+":"+v+map}map="{"+map;this.tstack[p].push(map);this.tstack[p]="["+this.tstack[p].join(",")+"]"},/**
297
+ * Serializes the beginning of a list collection.
298
+ * @param {Thrift.Type} elemType - The data type of the elements.
299
+ * @param {number} size - The number of elements in the list.
300
+ */writeListBegin:function writeListBegin(elemType,size){this.tpos.push(this.tstack.length);this.tstack.push([Thrift.Protocol.Type[elemType],size])},/**
301
+ * Serializes the end of a list.
302
+ */writeListEnd:function writeListEnd(){var p=this.tpos.pop();while(this.tstack.length>p+1){var tmpVal=this.tstack[p+1];this.tstack.splice(p+1,1);this.tstack[p].push(tmpVal)}this.tstack[p]="["+this.tstack[p].join(",")+"]"},/**
303
+ * Serializes the beginning of a set collection.
304
+ * @param {Thrift.Type} elemType - The data type of the elements.
305
+ * @param {number} size - The number of elements in the list.
306
+ */writeSetBegin:function writeSetBegin(elemType,size){this.tpos.push(this.tstack.length);this.tstack.push([Thrift.Protocol.Type[elemType],size])},/**
307
+ * Serializes the end of a set.
308
+ */writeSetEnd:function writeSetEnd(){var p=this.tpos.pop();while(this.tstack.length>p+1){var tmpVal=this.tstack[p+1];this.tstack.splice(p+1,1);this.tstack[p].push(tmpVal)}this.tstack[p]="["+this.tstack[p].join(",")+"]"},/** Serializes a boolean */writeBool:function writeBool(value){this.tstack.push(value?1:0)},/** Serializes a number */writeByte:function writeByte(i8){this.tstack.push(i8)},/** Serializes a number */writeI16:function writeI16(i16){this.tstack.push(i16)},/** Serializes a number */writeI32:function writeI32(i32){this.tstack.push(i32)},/** Serializes a number */writeI64:function writeI64(i64){this.tstack.push(i64)},/** Serializes a number */writeDouble:function writeDouble(dbl){this.tstack.push(dbl)},/** Serializes a string */writeString:function writeString(str){// We do not encode uri components for wire transfer:
309
+ if(str===null){this.tstack.push(null)}else{// concat may be slower than building a byte buffer
310
+ var escapedString="";for(var i=0;i<str.length;i++){var ch=str.charAt(i);// a single double quote: "
311
+ if(ch==="\""){escapedString+="\\\"";// write out as: \"
312
+ }else if(ch==="\\"){// a single backslash
313
+ escapedString+="\\\\";// write out as double backslash
314
+ }else if(ch==="\b"){// a single backspace: invisible
315
+ escapedString+="\\b";// write out as: \b"
316
+ }else if(ch==="\f"){// a single formfeed: invisible
317
+ escapedString+="\\f";// write out as: \f"
318
+ }else if(ch==="\n"){// a single newline: invisible
319
+ escapedString+="\\n";// write out as: \n"
320
+ }else if(ch==="\r"){// a single return: invisible
321
+ escapedString+="\\r";// write out as: \r"
322
+ }else if(ch==="\t"){// a single tab: invisible
323
+ escapedString+="\\t";// write out as: \t"
324
+ }else{escapedString+=ch;// Else it need not be escaped
325
+ }}this.tstack.push("\""+escapedString+"\"")}},/** Serializes a string */writeBinary:function writeBinary(str){this.writeString(str)},/**
326
+ @class
327
+ @name AnonReadMessageBeginReturn
328
+ @property {string} fname - The name of the service method.
329
+ @property {Thrift.MessageType} mtype - The type of message call.
330
+ @property {number} rseqid - The sequence number of the message (0 in Thrift RPC).
331
+ */ /**
332
+ * Deserializes the beginning of a message.
333
+ * @returns {AnonReadMessageBeginReturn}
334
+ */readMessageBegin:function readMessageBegin(){this.rstack=[];this.rpos=[];if(typeof JSON!=="undefined"&&typeof JSON.parse==="function"){this.robj=JSON.parse(this.transport.readAll())}else if(typeof jQuery!=="undefined"){this.robj=jQuery.parseJSON(this.transport.readAll())}else{this.robj=eval(this.transport.readAll())}var r={};var version=this.robj.shift();if(version!=Thrift.Protocol.Version){throw"Wrong thrift protocol version: "+version}r.fname=this.robj.shift();r.mtype=this.robj.shift();r.rseqid=this.robj.shift();//get to the main obj
335
+ this.rstack.push(this.robj.shift());return r},/** Deserializes the end of a message. */readMessageEnd:function readMessageEnd(){},/**
336
+ * Deserializes the beginning of a struct.
337
+ * @param {string} [name] - The name of the struct (ignored)
338
+ * @returns {object} - An object with an empty string fname property
339
+ */readStructBegin:function readStructBegin(name){var r={};r.fname="";//incase this is an array of structs
340
+ if(this.rstack[this.rstack.length-1]instanceof Array){this.rstack.push(this.rstack[this.rstack.length-1].shift())}return r},/** Deserializes the end of a struct. */readStructEnd:function readStructEnd(){if(this.rstack[this.rstack.length-2]instanceof Array){this.rstack.pop()}},/**
341
+ @class
342
+ @name AnonReadFieldBeginReturn
343
+ @property {string} fname - The name of the field (always '').
344
+ @property {Thrift.Type} ftype - The data type of the field.
345
+ @property {number} fid - The unique identifier of the field.
346
+ */ /**
347
+ * Deserializes the beginning of a field.
348
+ * @returns {AnonReadFieldBeginReturn}
349
+ */readFieldBegin:function readFieldBegin(){var r={};var fid=-1;var ftype=Thrift.Type.STOP;//get a fieldId
350
+ for(var f in this.rstack[this.rstack.length-1]){if(f===null){continue}fid=parseInt(f,10);this.rpos.push(this.rstack.length);var field=this.rstack[this.rstack.length-1][fid];//remove so we don't see it again
351
+ delete this.rstack[this.rstack.length-1][fid];this.rstack.push(field);break}if(fid!=-1){//should only be 1 of these but this is the only
352
+ //way to match a key
353
+ for(var i in this.rstack[this.rstack.length-1]){if(Thrift.Protocol.RType[i]===null){continue}ftype=Thrift.Protocol.RType[i];this.rstack[this.rstack.length-1]=this.rstack[this.rstack.length-1][i]}}r.fname="";r.ftype=ftype;r.fid=fid;return r},/** Deserializes the end of a field. */readFieldEnd:function readFieldEnd(){var pos=this.rpos.pop();//get back to the right place in the stack
354
+ while(this.rstack.length>pos){this.rstack.pop()}},/**
355
+ @class
356
+ @name AnonReadMapBeginReturn
357
+ @property {Thrift.Type} ktype - The data type of the key.
358
+ @property {Thrift.Type} vtype - The data type of the value.
359
+ @property {number} size - The number of elements in the map.
360
+ */ /**
361
+ * Deserializes the beginning of a map.
362
+ * @returns {AnonReadMapBeginReturn}
363
+ */readMapBegin:function readMapBegin(){var map=this.rstack.pop();var first=map.shift();if(first instanceof Array){this.rstack.push(map);map=first;first=map.shift()}var r={};r.ktype=Thrift.Protocol.RType[first];r.vtype=Thrift.Protocol.RType[map.shift()];r.size=map.shift();this.rpos.push(this.rstack.length);this.rstack.push(map.shift());return r},/** Deserializes the end of a map. */readMapEnd:function readMapEnd(){this.readFieldEnd()},/**
364
+ @class
365
+ @name AnonReadColBeginReturn
366
+ @property {Thrift.Type} etype - The data type of the element.
367
+ @property {number} size - The number of elements in the collection.
368
+ */ /**
369
+ * Deserializes the beginning of a list.
370
+ * @returns {AnonReadColBeginReturn}
371
+ */readListBegin:function readListBegin(){var list=this.rstack[this.rstack.length-1];var r={};r.etype=Thrift.Protocol.RType[list.shift()];r.size=list.shift();this.rpos.push(this.rstack.length);this.rstack.push(list.shift());return r},/** Deserializes the end of a list. */readListEnd:function readListEnd(){this.readFieldEnd()},/**
372
+ * Deserializes the beginning of a set.
373
+ * @returns {AnonReadColBeginReturn}
374
+ */readSetBegin:function readSetBegin(elemType,size){return this.readListBegin(elemType,size)},/** Deserializes the end of a set. */readSetEnd:function readSetEnd(){return this.readListEnd()},/** Returns an object with a value property set to
375
+ * False unless the next number in the protocol buffer
376
+ * is 1, in which case the value property is True */readBool:function readBool(){var r=this.readI32();if(r!==null&&r.value=="1"){r.value=true}else{r.value=false}return r},/** Returns the an object with a value property set to the
377
+ next value found in the protocol buffer */readByte:function readByte(){return this.readI32()},/** Returns the an object with a value property set to the
378
+ next value found in the protocol buffer */readI16:function readI16(){return this.readI32()},/** Returns the an object with a value property set to the
379
+ next value found in the protocol buffer */readI32:function readI32(f){if(f===undefined){f=this.rstack[this.rstack.length-1]}var r={};if(f instanceof Array){if(f.length===0){r.value=undefined}else{r.value=f.shift()}}else if(f instanceof Object){for(var i in f){if(i===null){continue}this.rstack.push(f[i]);delete f[i];r.value=i;break}}else{r.value=f;this.rstack.pop()}return r},/** Returns the an object with a value property set to the
380
+ next value found in the protocol buffer */readI64:function readI64(){return this.readI32()},/** Returns the an object with a value property set to the
381
+ next value found in the protocol buffer */readDouble:function readDouble(){return this.readI32()},/** Returns the an object with a value property set to the
382
+ next value found in the protocol buffer */readString:function readString(){var r=this.readI32();return r},/** Returns the an object with a value property set to the
383
+ next value found in the protocol buffer */readBinary:function readBinary(){return this.readString()},/**
384
+ * Method to arbitrarily skip over data */skip:function skip(type){var ret,i;switch(type){case Thrift.Type.STOP:return null;case Thrift.Type.BOOL:return this.readBool();case Thrift.Type.BYTE:return this.readByte();case Thrift.Type.I16:return this.readI16();case Thrift.Type.I32:return this.readI32();case Thrift.Type.I64:return this.readI64();case Thrift.Type.DOUBLE:return this.readDouble();case Thrift.Type.STRING:return this.readString();case Thrift.Type.STRUCT:this.readStructBegin();while(true){ret=this.readFieldBegin();if(ret.ftype==Thrift.Type.STOP){break}this.skip(ret.ftype);this.readFieldEnd()}this.readStructEnd();return null;case Thrift.Type.MAP:ret=this.readMapBegin();for(i=0;i<ret.size;i++){if(i>0){if(this.rstack.length>this.rpos[this.rpos.length-1]+1){this.rstack.pop()}}this.skip(ret.ktype);this.skip(ret.vtype)}this.readMapEnd();return null;case Thrift.Type.SET:ret=this.readSetBegin();for(i=0;i<ret.size;i++){this.skip(ret.etype)}this.readSetEnd();return null;case Thrift.Type.LIST:ret=this.readListBegin();for(i=0;i<ret.size;i++){this.skip(ret.etype)}this.readListEnd();return null;}}};/**
385
+ * Initializes a MutilplexProtocol Implementation as a Wrapper for Thrift.Protocol
386
+ * @constructor
387
+ */Thrift.MultiplexProtocol=function(srvName,trans,strictRead,strictWrite){Thrift.Protocol.call(this,trans,strictRead,strictWrite);this.serviceName=srvName};Thrift.inherits(Thrift.MultiplexProtocol,Thrift.Protocol,"multiplexProtocol");/** Override writeMessageBegin method of prototype*/Thrift.MultiplexProtocol.prototype.writeMessageBegin=function(name,type,seqid){if(type===Thrift.MessageType.CALL||type===Thrift.MessageType.ONEWAY){Thrift.Protocol.prototype.writeMessageBegin.call(this,this.serviceName+":"+name,type,seqid)}else{Thrift.Protocol.prototype.writeMessageBegin.call(this,name,type,seqid)}};Thrift.Multiplexer=function(){this.seqid=0};/** Instantiates a multiplexed client for a specific service
388
+ * @constructor
389
+ * @param {String} serviceName - The transport to serialize to/from.
390
+ * @param {Thrift.ServiceClient} SCl - The Service Client Class
391
+ * @param {Thrift.Transport} transport - Thrift.Transport instance which provides remote host:port
392
+ * @example
393
+ * var mp = new Thrift.Multiplexer();
394
+ * var transport = new Thrift.Transport("http://localhost:9090/foo.thrift");
395
+ * var protocol = new Thrift.Protocol(transport);
396
+ * var client = mp.createClient('AuthService', AuthServiceClient, transport);
397
+ */Thrift.Multiplexer.prototype.createClient=function(serviceName,SCl,transport){if(SCl.Client){SCl=SCl.Client}var self=this;SCl.prototype.new_seqid=function(){self.seqid+=1;return self.seqid};var client=new SCl(new Thrift.MultiplexProtocol(serviceName,transport));return client};var _copyList,_copyMap;_copyList=function copyList(lst,types){if(!lst){return lst}var type;if(types.shift===undefined){type=types}else{type=types[0]}var Type=type;var len=lst.length,result=[],i,val;for(i=0;i<len;i++){val=lst[i];if(type===null){result.push(val)}else if(type===_copyMap||type===_copyList){result.push(type(val,types.slice(1)))}else{result.push(new Type(val))}}return result};_copyMap=function copyMap(obj,types){if(!obj){return obj}var type;if(types.shift===undefined){type=types}else{type=types[0]}var Type=type;var result={},val;for(var prop in obj){if(obj.hasOwnProperty(prop)){val=obj[prop];if(type===null){result[prop]=val}else if(type===_copyMap||type===_copyList){result[prop]=type(val,types.slice(1))}else{result[prop]=new Type(val)}}}return result};Thrift.copyMap=_copyMap;Thrift.copyList=_copyList;