sample.js 199 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146
  1. "use strict";
  2. // Test sample code for SoftEther VPN Server JSON-RPC Stub
  3. // Runs on both web browsers and Node.js
  4. //
  5. // sample.ts
  6. // Automatically generated at 2019-05-29 18:21:39 by vpnserver-jsonrpc-codegen
  7. //
  8. // This sample code shows how to call all available RPC functions.
  9. // You can copy and paste test code to write your own web browser TypeScript / JavaScript codes.
  10. //
  11. // Licensed under the Apache License 2.0
  12. // Copyright (c) 2014-2019 SoftEther VPN Project
  13. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14. return new (P || (P = Promise))(function (resolve, reject) {
  15. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  18. step((generator = generator.apply(thisArg, _arguments || [])).next());
  19. });
  20. };
  21. var __generator = (this && this.__generator) || function (thisArg, body) {
  22. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  23. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  24. function verb(n) { return function (v) { return step([n, v]); }; }
  25. function step(op) {
  26. if (f) throw new TypeError("Generator is already executing.");
  27. while (_) try {
  28. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  29. if (y = 0, t) op = [op[0] & 2, t.value];
  30. switch (op[0]) {
  31. case 0: case 1: t = op; break;
  32. case 4: _.label++; return { value: op[1], done: false };
  33. case 5: _.label++; y = op[1]; op = [0]; continue;
  34. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  35. default:
  36. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  37. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  38. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  39. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  40. if (t[2]) _.ops.pop();
  41. _.trys.pop(); continue;
  42. }
  43. op = body.call(thisArg, _);
  44. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  45. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  46. }
  47. };
  48. var __importStar = (this && this.__importStar) || function (mod) {
  49. if (mod && mod.__esModule) return mod;
  50. var result = {};
  51. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  52. result["default"] = mod;
  53. return result;
  54. };
  55. exports.__esModule = true;
  56. // On the web browser uncomment below imports as necessary to support old browsers.
  57. // import "core-js/es6/promise";
  58. // import "core-js/es6/string";
  59. // import "whatwg-fetch";
  60. // Import the vpnrpc.ts RPC stub.
  61. var VPN = __importStar(require("./vpnrpc"));
  62. // Output JSON-RPC request / reply strings to the debug console.
  63. VPN.VpnServerRpc.SetDebugMode(true);
  64. var api;
  65. // Creating the VpnServerRpc class instance here.
  66. if (VPN.VpnServerRpc.IsNodeJS() === false) // // Determine if this JavaScript environment is on the Node.js or not
  67. {
  68. // On the web browser. We do not need to specify any hostname, port or credential as the web browser already knows it.
  69. api = new VPN.VpnServerRpc();
  70. }
  71. else {
  72. // On the Node.js. We need to specify the target VPN Server's hostname, port and credential.
  73. api = new VPN.VpnServerRpc("127.0.0.1", 443, "", "PASSWORD_HERE", false);
  74. }
  75. // A variable for test
  76. var hub_name = "test";
  77. // Call the Test_All() function to test almost all VPN APIs.
  78. Test_All();
  79. /** Tests all VPN APIs */
  80. function Test_All() {
  81. return __awaiter(this, void 0, void 0, function () {
  82. var new_listener_port, farm_members, _i, _a, farm_member, enum_connection, _b, _c, connecton, hub_log_settings, enum_ca, _d, _e, ca, enum_link, _f, _g, link, enum_session, _h, _j, session, enum_mac, _k, _l, mac, enum_ip, _m, _o, ip, enum_crl, _p, _q, crl, got_crl, _r, _s, crl, enum_log_file, _t, _u, log, enum_etherip_id, _v, _w, etherip_id;
  83. return __generator(this, function (_x) {
  84. switch (_x.label) {
  85. case 0:
  86. hub_name = "TEST";
  87. return [4 /*yield*/, Test_Test()];
  88. case 1:
  89. _x.sent();
  90. return [4 /*yield*/, Test_GetServerInfo()];
  91. case 2:
  92. _x.sent();
  93. return [4 /*yield*/, Test_GetServerStatus()];
  94. case 3:
  95. _x.sent();
  96. return [4 /*yield*/, Test_CreateListener()];
  97. case 4:
  98. new_listener_port = _x.sent();
  99. return [4 /*yield*/, Test_EnableListener(new_listener_port, false)];
  100. case 5:
  101. _x.sent();
  102. return [4 /*yield*/, Test_EnumListener()];
  103. case 6:
  104. _x.sent();
  105. return [4 /*yield*/, Test_EnableListener(new_listener_port, true)];
  106. case 7:
  107. _x.sent();
  108. return [4 /*yield*/, Test_EnumListener()];
  109. case 8:
  110. _x.sent();
  111. return [4 /*yield*/, Test_DeleteListener(new_listener_port)];
  112. case 9:
  113. _x.sent();
  114. return [4 /*yield*/, Test_SetServerPassword()];
  115. case 10:
  116. _x.sent();
  117. return [4 /*yield*/, Test_GetFarmSetting()];
  118. case 11:
  119. _x.sent();
  120. if (!false) return [3 /*break*/, 19];
  121. return [4 /*yield*/, Test_SetFarmSetting()];
  122. case 12:
  123. _x.sent();
  124. return [4 /*yield*/, Test_EnumFarmMember()];
  125. case 13:
  126. farm_members = _x.sent();
  127. _i = 0, _a = farm_members.FarmMemberList;
  128. _x.label = 14;
  129. case 14:
  130. if (!(_i < _a.length)) return [3 /*break*/, 17];
  131. farm_member = _a[_i];
  132. return [4 /*yield*/, Test_GetFarmInfo(farm_member.Id_u32)];
  133. case 15:
  134. _x.sent();
  135. _x.label = 16;
  136. case 16:
  137. _i++;
  138. return [3 /*break*/, 14];
  139. case 17: return [4 /*yield*/, Test_GetFarmConnectionStatus()];
  140. case 18:
  141. _x.sent();
  142. return [3 /*break*/, 20];
  143. case 19:
  144. if (false) {
  145. console.log("abc");
  146. }
  147. else {
  148. console.log("def");
  149. }
  150. _x.label = 20;
  151. case 20: return [4 /*yield*/, Test_GetServerCert()];
  152. case 21:
  153. _x.sent();
  154. return [4 /*yield*/, Test_SetServerCert()];
  155. case 22:
  156. _x.sent();
  157. return [4 /*yield*/, Test_GetServerCipher()];
  158. case 23:
  159. _x.sent();
  160. return [4 /*yield*/, Test_SetServerCipher()];
  161. case 24:
  162. _x.sent();
  163. return [4 /*yield*/, Test_EnumConnection()];
  164. case 25:
  165. enum_connection = _x.sent();
  166. _b = 0, _c = enum_connection.ConnectionList;
  167. _x.label = 26;
  168. case 26:
  169. if (!(_b < _c.length)) return [3 /*break*/, 29];
  170. connecton = _c[_b];
  171. return [4 /*yield*/, Test_GetConnectionInfo(connecton.Name_str)];
  172. case 27:
  173. _x.sent();
  174. _x.label = 28;
  175. case 28:
  176. _b++;
  177. return [3 /*break*/, 26];
  178. case 29: return [4 /*yield*/, Test_CreateHub()];
  179. case 30:
  180. hub_name = _x.sent();
  181. return [4 /*yield*/, Test_SetHub()];
  182. case 31:
  183. _x.sent();
  184. return [4 /*yield*/, Test_GetHub()];
  185. case 32:
  186. _x.sent();
  187. return [4 /*yield*/, Test_EnumHub()];
  188. case 33:
  189. _x.sent();
  190. return [4 /*yield*/, Test_SetHubRadius()];
  191. case 34:
  192. _x.sent();
  193. return [4 /*yield*/, Test_GetHubRadius()];
  194. case 35:
  195. _x.sent();
  196. return [4 /*yield*/, Test_SetHubOnline()];
  197. case 36:
  198. _x.sent();
  199. return [4 /*yield*/, Test_GetHubStatus()];
  200. case 37:
  201. _x.sent();
  202. return [4 /*yield*/, Test_GetHubLog()];
  203. case 38:
  204. hub_log_settings = _x.sent();
  205. return [4 /*yield*/, Test_SetHubLog(hub_log_settings)];
  206. case 39:
  207. _x.sent();
  208. return [4 /*yield*/, Test_AddCa()];
  209. case 40:
  210. _x.sent();
  211. return [4 /*yield*/, Test_EnumCa()];
  212. case 41:
  213. enum_ca = _x.sent();
  214. _d = 0, _e = enum_ca.CAList;
  215. _x.label = 42;
  216. case 42:
  217. if (!(_d < _e.length)) return [3 /*break*/, 46];
  218. ca = _e[_d];
  219. return [4 /*yield*/, Test_GetCa(ca.Key_u32)];
  220. case 43:
  221. _x.sent();
  222. return [4 /*yield*/, Test_DeleteCa(ca.Key_u32)];
  223. case 44:
  224. _x.sent();
  225. _x.label = 45;
  226. case 45:
  227. _d++;
  228. return [3 /*break*/, 42];
  229. case 46: return [4 /*yield*/, Test_CreateLink()];
  230. case 47:
  231. _x.sent();
  232. return [4 /*yield*/, Test_GetLink()];
  233. case 48:
  234. _x.sent();
  235. return [4 /*yield*/, Test_SetLink()];
  236. case 49:
  237. _x.sent();
  238. return [4 /*yield*/, Test_SetLinkOffline()];
  239. case 50:
  240. _x.sent();
  241. return [4 /*yield*/, Test_SetLinkOnline()];
  242. case 51:
  243. _x.sent();
  244. return [4 /*yield*/, Test_EnumLink()];
  245. case 52:
  246. enum_link = _x.sent();
  247. _f = 0, _g = enum_link.LinkList;
  248. _x.label = 53;
  249. case 53:
  250. if (!(_f < _g.length)) return [3 /*break*/, 56];
  251. link = _g[_f];
  252. return [4 /*yield*/, Test_GetLinkStatus(link.AccountName_utf)];
  253. case 54:
  254. _x.sent();
  255. _x.label = 55;
  256. case 55:
  257. _f++;
  258. return [3 /*break*/, 53];
  259. case 56: return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 3000); })];
  260. case 57:
  261. _x.sent();
  262. return [4 /*yield*/, Test_RenameLink()];
  263. case 58:
  264. _x.sent();
  265. return [4 /*yield*/, Test_DeleteLink()];
  266. case 59:
  267. _x.sent();
  268. return [4 /*yield*/, Test_AddAccess()];
  269. case 60:
  270. _x.sent();
  271. return [4 /*yield*/, Test_EnumAccess()];
  272. case 61:
  273. _x.sent();
  274. return [4 /*yield*/, Test_DeleteAccess()];
  275. case 62:
  276. _x.sent();
  277. return [4 /*yield*/, Test_SetAccessList()];
  278. case 63:
  279. _x.sent();
  280. return [4 /*yield*/, Test_CreateGroup()];
  281. case 64:
  282. _x.sent();
  283. return [4 /*yield*/, Test_SetGroup()];
  284. case 65:
  285. _x.sent();
  286. return [4 /*yield*/, Test_GetGroup()];
  287. case 66:
  288. _x.sent();
  289. return [4 /*yield*/, Test_CreateUser()];
  290. case 67:
  291. _x.sent();
  292. return [4 /*yield*/, Test_SetUser()];
  293. case 68:
  294. _x.sent();
  295. return [4 /*yield*/, Test_GetUser()];
  296. case 69:
  297. _x.sent();
  298. return [4 /*yield*/, Test_EnumUser()];
  299. case 70:
  300. _x.sent();
  301. return [4 /*yield*/, Test_EnumGroup()];
  302. case 71:
  303. _x.sent();
  304. return [4 /*yield*/, Test_DeleteUser()];
  305. case 72:
  306. _x.sent();
  307. return [4 /*yield*/, Test_DeleteGroup()];
  308. case 73:
  309. _x.sent();
  310. return [4 /*yield*/, Test_EnumSession()];
  311. case 74:
  312. enum_session = _x.sent();
  313. _h = 0, _j = enum_session.SessionList;
  314. _x.label = 75;
  315. case 75:
  316. if (!(_h < _j.length)) return [3 /*break*/, 79];
  317. session = _j[_h];
  318. return [4 /*yield*/, Test_GetSessionStatus(session.Name_str)];
  319. case 76:
  320. _x.sent();
  321. return [4 /*yield*/, Test_DeleteSession(session.Name_str)];
  322. case 77:
  323. _x.sent();
  324. _x.label = 78;
  325. case 78:
  326. _h++;
  327. return [3 /*break*/, 75];
  328. case 79: return [4 /*yield*/, Test_EnumMacTable()];
  329. case 80:
  330. enum_mac = _x.sent();
  331. _k = 0, _l = enum_mac.MacTable;
  332. _x.label = 81;
  333. case 81:
  334. if (!(_k < _l.length)) return [3 /*break*/, 84];
  335. mac = _l[_k];
  336. return [4 /*yield*/, Test_DeleteMacTable(mac.Key_u32)];
  337. case 82:
  338. _x.sent();
  339. _x.label = 83;
  340. case 83:
  341. _k++;
  342. return [3 /*break*/, 81];
  343. case 84: return [4 /*yield*/, Test_EnumIpTable()];
  344. case 85:
  345. enum_ip = _x.sent();
  346. _m = 0, _o = enum_ip.IpTable;
  347. _x.label = 86;
  348. case 86:
  349. if (!(_m < _o.length)) return [3 /*break*/, 89];
  350. ip = _o[_m];
  351. return [4 /*yield*/, Test_DeleteIpTable(ip.Key_u32)];
  352. case 87:
  353. _x.sent();
  354. _x.label = 88;
  355. case 88:
  356. _m++;
  357. return [3 /*break*/, 86];
  358. case 89: return [4 /*yield*/, Test_SetKeep()];
  359. case 90:
  360. _x.sent();
  361. return [4 /*yield*/, Test_GetKeep()];
  362. case 91:
  363. _x.sent();
  364. return [4 /*yield*/, Test_EnableSecureNAT()];
  365. case 92:
  366. _x.sent();
  367. return [4 /*yield*/, Test_GetSecureNATOption()];
  368. case 93:
  369. _x.sent();
  370. return [4 /*yield*/, Test_SetSecureNATOption()];
  371. case 94:
  372. _x.sent();
  373. return [4 /*yield*/, Test_EnumNAT()];
  374. case 95:
  375. _x.sent();
  376. return [4 /*yield*/, Test_EnumDHCP()];
  377. case 96:
  378. _x.sent();
  379. return [4 /*yield*/, Test_GetSecureNATStatus()];
  380. case 97:
  381. _x.sent();
  382. return [4 /*yield*/, Test_DisableSecureNAT()];
  383. case 98:
  384. _x.sent();
  385. return [4 /*yield*/, Test_EnumEthernet()];
  386. case 99:
  387. _x.sent();
  388. return [4 /*yield*/, Test_EnumLocalBridge()];
  389. case 100:
  390. _x.sent();
  391. return [4 /*yield*/, Test_GetBridgeSupport()];
  392. case 101:
  393. _x.sent();
  394. return [4 /*yield*/, Test_GetCaps()];
  395. case 102:
  396. _x.sent();
  397. return [4 /*yield*/, Test_GetConfig()];
  398. case 103:
  399. _x.sent();
  400. return [4 /*yield*/, Test_GetDefaultHubAdminOptions()];
  401. case 104:
  402. _x.sent();
  403. return [4 /*yield*/, Test_GetHubAdminOptions()];
  404. case 105:
  405. _x.sent();
  406. return [4 /*yield*/, Test_SetHubAdminOptions()];
  407. case 106:
  408. _x.sent();
  409. return [4 /*yield*/, Test_GetHubExtOptions()];
  410. case 107:
  411. _x.sent();
  412. return [4 /*yield*/, Test_SetHubExtOptions()];
  413. case 108:
  414. _x.sent();
  415. return [4 /*yield*/, Test_AddL3Switch()];
  416. case 109:
  417. _x.sent();
  418. return [4 /*yield*/, Test_AddL3If()];
  419. case 110:
  420. _x.sent();
  421. return [4 /*yield*/, Test_EnumL3Switch()];
  422. case 111:
  423. _x.sent();
  424. return [4 /*yield*/, Test_EnumL3If()];
  425. case 112:
  426. _x.sent();
  427. return [4 /*yield*/, Test_AddL3Table()];
  428. case 113:
  429. _x.sent();
  430. return [4 /*yield*/, Test_EnumL3Table()];
  431. case 114:
  432. _x.sent();
  433. return [4 /*yield*/, Test_DelL3Table()];
  434. case 115:
  435. _x.sent();
  436. return [4 /*yield*/, Test_StartL3Switch()];
  437. case 116:
  438. _x.sent();
  439. return [4 /*yield*/, Test_StopL3Switch()];
  440. case 117:
  441. _x.sent();
  442. return [4 /*yield*/, Test_DelL3If()];
  443. case 118:
  444. _x.sent();
  445. return [4 /*yield*/, Test_DelL3Switch()];
  446. case 119:
  447. _x.sent();
  448. return [4 /*yield*/, Test_AddCrl()];
  449. case 120:
  450. _x.sent();
  451. return [4 /*yield*/, Test_EnumCrl()];
  452. case 121:
  453. enum_crl = _x.sent();
  454. _p = 0, _q = enum_crl.CRLList;
  455. _x.label = 122;
  456. case 122:
  457. if (!(_p < _q.length)) return [3 /*break*/, 126];
  458. crl = _q[_p];
  459. return [4 /*yield*/, Test_GetCrl(crl.Key_u32)];
  460. case 123:
  461. got_crl = _x.sent();
  462. got_crl.CommonName_utf = got_crl.CommonName_utf + "_a";
  463. return [4 /*yield*/, Test_SetCrl(got_crl)];
  464. case 124:
  465. _x.sent();
  466. _x.label = 125;
  467. case 125:
  468. _p++;
  469. return [3 /*break*/, 122];
  470. case 126: return [4 /*yield*/, Test_EnumCrl()];
  471. case 127:
  472. enum_crl = _x.sent();
  473. _r = 0, _s = enum_crl.CRLList;
  474. _x.label = 128;
  475. case 128:
  476. if (!(_r < _s.length)) return [3 /*break*/, 131];
  477. crl = _s[_r];
  478. return [4 /*yield*/, Test_DelCrl(crl.Key_u32)];
  479. case 129:
  480. _x.sent();
  481. _x.label = 130;
  482. case 130:
  483. _r++;
  484. return [3 /*break*/, 128];
  485. case 131: return [4 /*yield*/, Test_SetAcList()];
  486. case 132:
  487. _x.sent();
  488. return [4 /*yield*/, Test_GetAcList()];
  489. case 133:
  490. _x.sent();
  491. return [4 /*yield*/, Test_EnumLogFile()];
  492. case 134:
  493. enum_log_file = _x.sent();
  494. _t = 0, _u = enum_log_file.LogFiles;
  495. _x.label = 135;
  496. case 135:
  497. if (!(_t < _u.length)) return [3 /*break*/, 138];
  498. log = _u[_t];
  499. return [4 /*yield*/, Test_ReadLogFile(log.FilePath_str)];
  500. case 136:
  501. _x.sent();
  502. return [3 /*break*/, 138];
  503. case 137:
  504. _t++;
  505. return [3 /*break*/, 135];
  506. case 138: return [4 /*yield*/, Test_SetSysLog(true)];
  507. case 139:
  508. _x.sent();
  509. return [4 /*yield*/, Test_GetSysLog()];
  510. case 140:
  511. _x.sent();
  512. return [4 /*yield*/, Test_SetSysLog(false)];
  513. case 141:
  514. _x.sent();
  515. return [4 /*yield*/, Test_SetHubMsg()];
  516. case 142:
  517. _x.sent();
  518. return [4 /*yield*/, Test_GetHubMsg()];
  519. case 143:
  520. _x.sent();
  521. return [4 /*yield*/, Test_GetAdminMsg()];
  522. case 144:
  523. _x.sent();
  524. return [4 /*yield*/, Test_Flush()];
  525. case 145:
  526. _x.sent();
  527. return [4 /*yield*/, Test_SetIPsecServices()];
  528. case 146:
  529. _x.sent();
  530. return [4 /*yield*/, Test_GetIPsecServices()];
  531. case 147:
  532. _x.sent();
  533. return [4 /*yield*/, Test_AddEtherIpId()];
  534. case 148:
  535. _x.sent();
  536. return [4 /*yield*/, Test_EnumEtherIpId()];
  537. case 149:
  538. enum_etherip_id = _x.sent();
  539. _v = 0, _w = enum_etherip_id.Settings;
  540. _x.label = 150;
  541. case 150:
  542. if (!(_v < _w.length)) return [3 /*break*/, 154];
  543. etherip_id = _w[_v];
  544. return [4 /*yield*/, Test_GetEtherIpId(etherip_id.Id_str)];
  545. case 151:
  546. _x.sent();
  547. return [4 /*yield*/, Test_DeleteEtherIpId(etherip_id.Id_str)];
  548. case 152:
  549. _x.sent();
  550. _x.label = 153;
  551. case 153:
  552. _v++;
  553. return [3 /*break*/, 150];
  554. case 154: return [4 /*yield*/, Test_SetOpenVpnSstpConfig()];
  555. case 155:
  556. _x.sent();
  557. return [4 /*yield*/, Test_GetOpenVpnSstpConfig()];
  558. case 156:
  559. _x.sent();
  560. return [4 /*yield*/, Test_GetDDnsClientStatus()];
  561. case 157:
  562. _x.sent();
  563. return [4 /*yield*/, Test_SetDDnsInternetSetting()];
  564. case 158:
  565. _x.sent();
  566. return [4 /*yield*/, Test_GetDDnsInternetSetting()];
  567. case 159:
  568. _x.sent();
  569. return [4 /*yield*/, Test_ChangeDDnsClientHostname()];
  570. case 160:
  571. _x.sent();
  572. return [4 /*yield*/, Test_RegenerateServerCert()];
  573. case 161:
  574. _x.sent();
  575. return [4 /*yield*/, Test_MakeOpenVpnConfigFile()];
  576. case 162:
  577. _x.sent();
  578. return [4 /*yield*/, Test_SetSpecialListener()];
  579. case 163:
  580. _x.sent();
  581. return [4 /*yield*/, Test_GetSpecialListener()];
  582. case 164:
  583. _x.sent();
  584. return [4 /*yield*/, Test_GetAzureStatus()];
  585. case 165:
  586. _x.sent();
  587. return [4 /*yield*/, Test_SetAzureStatus()];
  588. case 166:
  589. _x.sent();
  590. return [4 /*yield*/, Test_SetVgsConfig()];
  591. case 167:
  592. _x.sent();
  593. return [4 /*yield*/, Test_GetVgsConfig()];
  594. case 168:
  595. _x.sent();
  596. return [4 /*yield*/, Test_DeleteHub()];
  597. case 169:
  598. _x.sent();
  599. return [2 /*return*/];
  600. }
  601. });
  602. });
  603. }
  604. /** API test for 'Test', test RPC function */
  605. function Test_Test() {
  606. return __awaiter(this, void 0, void 0, function () {
  607. var a, b;
  608. return __generator(this, function (_a) {
  609. switch (_a.label) {
  610. case 0:
  611. console.log("Begin: Test_Test");
  612. a = new VPN.VpnRpcTest({
  613. IntValue_u32: 12345
  614. });
  615. return [4 /*yield*/, api.Test(a)];
  616. case 1:
  617. b = _a.sent();
  618. console.log(b);
  619. console.log("End: Test_Test");
  620. console.log("-----");
  621. console.log();
  622. return [2 /*return*/];
  623. }
  624. });
  625. });
  626. }
  627. /** API test for 'GetServerInfo', Get server information */
  628. function Test_GetServerInfo() {
  629. return __awaiter(this, void 0, void 0, function () {
  630. var info;
  631. return __generator(this, function (_a) {
  632. switch (_a.label) {
  633. case 0:
  634. console.log("Begin: Test_GetServerInfo");
  635. return [4 /*yield*/, api.GetServerInfo()];
  636. case 1:
  637. info = _a.sent();
  638. console.log(info);
  639. console.log("End: Test_GetServerInfo");
  640. console.log("-----");
  641. console.log();
  642. return [2 /*return*/];
  643. }
  644. });
  645. });
  646. }
  647. /** API test for 'GetServerStatus', Get server status */
  648. function Test_GetServerStatus() {
  649. return __awaiter(this, void 0, void 0, function () {
  650. var out_rpc_server_status;
  651. return __generator(this, function (_a) {
  652. switch (_a.label) {
  653. case 0:
  654. console.log("Begin: Test_GetServerStatus");
  655. return [4 /*yield*/, api.GetServerStatus()];
  656. case 1:
  657. out_rpc_server_status = _a.sent();
  658. console.log(out_rpc_server_status);
  659. console.log("End: Test_GetServerStatus");
  660. console.log("-----");
  661. console.log();
  662. return [2 /*return*/];
  663. }
  664. });
  665. });
  666. }
  667. /** API test for 'CreateListener', Create a listener */
  668. function Test_CreateListener() {
  669. return __awaiter(this, void 0, void 0, function () {
  670. var port, in_rpc_listener, out_rpc_listener;
  671. return __generator(this, function (_a) {
  672. switch (_a.label) {
  673. case 0:
  674. console.log("Begin: Test_CreateListener");
  675. port = Math.floor((Math.random() * (65534 - 1025)) + 1025);
  676. console.log("Creating a new listener port: Port " + port);
  677. in_rpc_listener = new VPN.VpnRpcListener({
  678. Enable_bool: true,
  679. Port_u32: port
  680. });
  681. return [4 /*yield*/, api.CreateListener(in_rpc_listener)];
  682. case 1:
  683. out_rpc_listener = _a.sent();
  684. console.log("Done.");
  685. console.log("End: Test_CreateListener");
  686. console.log("-----");
  687. console.log();
  688. return [2 /*return*/, port];
  689. }
  690. });
  691. });
  692. }
  693. /** API test for 'EnumListener', Enumerating listeners */
  694. function Test_EnumListener() {
  695. return __awaiter(this, void 0, void 0, function () {
  696. var out_rpc_listener_list;
  697. return __generator(this, function (_a) {
  698. switch (_a.label) {
  699. case 0:
  700. console.log("Begin: Test_EnumListener");
  701. return [4 /*yield*/, api.EnumListener()];
  702. case 1:
  703. out_rpc_listener_list = _a.sent();
  704. console.log(out_rpc_listener_list);
  705. console.log("End: Test_EnumListener");
  706. console.log("-----");
  707. console.log();
  708. return [2 /*return*/];
  709. }
  710. });
  711. });
  712. }
  713. /** API test for 'DeleteListener', Delete a listener */
  714. function Test_DeleteListener(port) {
  715. return __awaiter(this, void 0, void 0, function () {
  716. var in_rpc_listener, out_rpc_listener;
  717. return __generator(this, function (_a) {
  718. switch (_a.label) {
  719. case 0:
  720. console.log("Begin: Test_DeleteListener");
  721. console.log("Deleting a new listener port: Port" + port);
  722. in_rpc_listener = new VPN.VpnRpcListener({
  723. Port_u32: port
  724. });
  725. return [4 /*yield*/, api.DeleteListener(in_rpc_listener)];
  726. case 1:
  727. out_rpc_listener = _a.sent();
  728. console.log("Done.");
  729. console.log("End: Test_DeleteListener");
  730. console.log("-----");
  731. console.log();
  732. return [2 /*return*/];
  733. }
  734. });
  735. });
  736. }
  737. /** API test for 'EnableListener', Enable / Disable listener */
  738. function Test_EnableListener(port, enabled) {
  739. return __awaiter(this, void 0, void 0, function () {
  740. var in_rpc_listener, out_rpc_listener;
  741. return __generator(this, function (_a) {
  742. switch (_a.label) {
  743. case 0:
  744. console.log("Begin: Test_EnableListener");
  745. if (enabled) {
  746. console.log("Enabling listener port = " + port);
  747. }
  748. else {
  749. console.log("Disabling listener port = " + port);
  750. }
  751. in_rpc_listener = new VPN.VpnRpcListener({
  752. Port_u32: port,
  753. Enable_bool: enabled
  754. });
  755. return [4 /*yield*/, api.EnableListener(in_rpc_listener)];
  756. case 1:
  757. out_rpc_listener = _a.sent();
  758. console.log("Done.");
  759. console.log("End: Test_EnableListener");
  760. console.log("-----");
  761. console.log();
  762. return [2 /*return*/];
  763. }
  764. });
  765. });
  766. }
  767. /** API test for 'SetServerPassword', Set server password */
  768. function Test_SetServerPassword() {
  769. return __awaiter(this, void 0, void 0, function () {
  770. var password, in_rpc_set_password, out_rpc_set_password;
  771. return __generator(this, function (_a) {
  772. switch (_a.label) {
  773. case 0:
  774. password = "microsoft";
  775. console.log("Begin: Test_SetServerPassword");
  776. console.log("Set the server administrator password to '" + password + "'.");
  777. in_rpc_set_password = new VPN.VpnRpcSetPassword({
  778. PlainTextPassword_str: password
  779. });
  780. return [4 /*yield*/, api.SetServerPassword(in_rpc_set_password)];
  781. case 1:
  782. out_rpc_set_password = _a.sent();
  783. console.log("Done.");
  784. console.log("End: Test_SetServerPassword");
  785. console.log("-----");
  786. console.log();
  787. return [2 /*return*/];
  788. }
  789. });
  790. });
  791. }
  792. /** API test for 'SetFarmSetting', Set clustering configuration */
  793. function Test_SetFarmSetting() {
  794. return __awaiter(this, void 0, void 0, function () {
  795. var in_rpc_farm, out_rpc_farm;
  796. return __generator(this, function (_a) {
  797. switch (_a.label) {
  798. case 0:
  799. console.log("Begin: Test_SetFarmSetting");
  800. in_rpc_farm = new VPN.VpnRpcFarm({
  801. ServerType_u32: VPN.VpnRpcServerType.FarmController,
  802. NumPort_u32: 2,
  803. Ports_u32: [443, 444, 445,],
  804. PublicIp_ip: "1.2.3.4",
  805. ControllerName_str: "controller",
  806. MemberPasswordPlaintext_str: "microsoft",
  807. ControllerPort_u32: 443,
  808. Weight_u32: 100,
  809. ControllerOnly_bool: false
  810. });
  811. return [4 /*yield*/, api.SetFarmSetting(in_rpc_farm)];
  812. case 1:
  813. out_rpc_farm = _a.sent();
  814. console.log("End: Test_SetFarmSetting");
  815. console.log("-----");
  816. console.log();
  817. return [2 /*return*/];
  818. }
  819. });
  820. });
  821. }
  822. /** API test for 'GetFarmSetting', Get clustering configuration */
  823. function Test_GetFarmSetting() {
  824. return __awaiter(this, void 0, void 0, function () {
  825. var out_rpc_farm;
  826. return __generator(this, function (_a) {
  827. switch (_a.label) {
  828. case 0:
  829. console.log("Begin: Test_GetFarmSetting");
  830. return [4 /*yield*/, api.GetFarmSetting()];
  831. case 1:
  832. out_rpc_farm = _a.sent();
  833. console.log(out_rpc_farm);
  834. console.log("End: Test_GetFarmSetting");
  835. console.log("-----");
  836. console.log();
  837. return [2 /*return*/];
  838. }
  839. });
  840. });
  841. }
  842. /** API test for 'GetFarmInfo', Get cluster member information */
  843. function Test_GetFarmInfo(id) {
  844. return __awaiter(this, void 0, void 0, function () {
  845. var in_rpc_farm_info, out_rpc_farm_info;
  846. return __generator(this, function (_a) {
  847. switch (_a.label) {
  848. case 0:
  849. console.log("Begin: Test_GetFarmInfo");
  850. in_rpc_farm_info = new VPN.VpnRpcFarmInfo({
  851. Id_u32: id
  852. });
  853. return [4 /*yield*/, api.GetFarmInfo(in_rpc_farm_info)];
  854. case 1:
  855. out_rpc_farm_info = _a.sent();
  856. console.log(out_rpc_farm_info);
  857. console.log("End: Test_GetFarmInfo");
  858. console.log("-----");
  859. console.log();
  860. return [2 /*return*/];
  861. }
  862. });
  863. });
  864. }
  865. /** API test for 'EnumFarmMember', Enumerate cluster members */
  866. function Test_EnumFarmMember() {
  867. return __awaiter(this, void 0, void 0, function () {
  868. var out_rpc_enum_farm;
  869. return __generator(this, function (_a) {
  870. switch (_a.label) {
  871. case 0:
  872. console.log("Begin: Test_EnumFarmMember");
  873. return [4 /*yield*/, api.EnumFarmMember()];
  874. case 1:
  875. out_rpc_enum_farm = _a.sent();
  876. console.log(out_rpc_enum_farm);
  877. console.log("End: Test_EnumFarmMember");
  878. console.log("-----");
  879. console.log();
  880. return [2 /*return*/, out_rpc_enum_farm];
  881. }
  882. });
  883. });
  884. }
  885. /** API test for 'GetFarmConnectionStatus', Get status of connection to cluster controller */
  886. function Test_GetFarmConnectionStatus() {
  887. return __awaiter(this, void 0, void 0, function () {
  888. var out_rpc_farm_connection_status;
  889. return __generator(this, function (_a) {
  890. switch (_a.label) {
  891. case 0:
  892. console.log("Begin: Test_GetFarmConnectionStatus");
  893. return [4 /*yield*/, api.GetFarmConnectionStatus()];
  894. case 1:
  895. out_rpc_farm_connection_status = _a.sent();
  896. console.log(out_rpc_farm_connection_status);
  897. console.log("End: Test_GetFarmConnectionStatus");
  898. console.log("-----");
  899. console.log();
  900. return [2 /*return*/];
  901. }
  902. });
  903. });
  904. }
  905. /** API test for 'SetServerCert', Set the server certification */
  906. function Test_SetServerCert() {
  907. return __awaiter(this, void 0, void 0, function () {
  908. var in_rpc_key_pair, out_rpc_key_pair;
  909. return __generator(this, function (_a) {
  910. switch (_a.label) {
  911. case 0:
  912. console.log("Begin: Test_SetServerCert");
  913. in_rpc_key_pair = new VPN.VpnRpcKeyPair({
  914. Cert_bin: new Uint8Array([0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x72, 0x6a, 0x43, 0x43, 0x41, 0x70, 0x61, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x57, 0x4d, 0x51, 0x77, 0x77, 0x43, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x4e, 0x68, 0x59, 0x57, 0x45, 0x78, 0x0a, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x4f, 0x4f, 0x42, 0x72, 0x2b, 0x4f, 0x42, 0x71, 0x75, 0x4f, 0x42, 0x6a, 0x2b, 0x4f, 0x42, 0x6e, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x6c, 0x41, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x30, 0x6c, 0x69, 0x0a, 0x59, 0x58, 0x4a, 0x68, 0x61, 0x32, 0x6b, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x42, 0x31, 0x52, 0x7a, 0x64, 0x57, 0x74, 0x31, 0x59, 0x6d, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x67, 0x78, 0x4d, 0x44, 0x45, 0x78, 0x4d, 0x6a, 0x4d, 0x7a, 0x4e, 0x54, 0x41, 0x78, 0x57, 0x68, 0x63, 0x4e, 0x4e, 0x44, 0x49, 0x78, 0x4d, 0x44, 0x41, 0x31, 0x0a, 0x4d, 0x6a, 0x4d, 0x7a, 0x4e, 0x54, 0x41, 0x78, 0x57, 0x6a, 0x42, 0x57, 0x4d, 0x51, 0x77, 0x77, 0x43, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x4e, 0x68, 0x59, 0x57, 0x45, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x4f, 0x4f, 0x42, 0x72, 0x2b, 0x4f, 0x42, 0x71, 0x75, 0x4f, 0x42, 0x6a, 0x2b, 0x4f, 0x42, 0x6e, 0x54, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x6c, 0x41, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x30, 0x6c, 0x69, 0x59, 0x58, 0x4a, 0x68, 0x61, 0x32, 0x6b, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x42, 0x31, 0x52, 0x7a, 0x64, 0x57, 0x74, 0x31, 0x59, 0x6d, 0x45, 0x77, 0x0a, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, 0x58, 0x45, 0x63, 0x76, 0x72, 0x59, 0x37, 0x56, 0x2b, 0x7a, 0x64, 0x42, 0x79, 0x72, 0x64, 0x4e, 0x78, 0x4a, 0x59, 0x45, 0x6d, 0x0a, 0x61, 0x41, 0x4e, 0x59, 0x55, 0x4f, 0x37, 0x76, 0x57, 0x34, 0x68, 0x64, 0x41, 0x35, 0x49, 0x42, 0x49, 0x46, 0x6d, 0x4d, 0x70, 0x6e, 0x62, 0x79, 0x69, 0x4e, 0x6e, 0x5a, 0x77, 0x36, 0x57, 0x39, 0x6f, 0x61, 0x67, 0x78, 0x33, 0x5a, 0x49, 0x65, 0x65, 0x48, 0x56, 0x59, 0x62, 0x52, 0x69, 0x4b, 0x36, 0x41, 0x66, 0x46, 0x74, 0x53, 0x31, 0x32, 0x2b, 0x45, 0x31, 0x4d, 0x59, 0x31, 0x64, 0x32, 0x0a, 0x61, 0x71, 0x51, 0x31, 0x53, 0x72, 0x49, 0x43, 0x39, 0x51, 0x35, 0x55, 0x6e, 0x5a, 0x61, 0x42, 0x72, 0x62, 0x57, 0x32, 0x32, 0x6d, 0x4e, 0x75, 0x6c, 0x4d, 0x34, 0x2f, 0x6c, 0x49, 0x4a, 0x72, 0x48, 0x70, 0x51, 0x55, 0x68, 0x50, 0x78, 0x6f, 0x62, 0x79, 0x34, 0x2f, 0x36, 0x4e, 0x41, 0x37, 0x71, 0x4b, 0x67, 0x55, 0x48, 0x69, 0x79, 0x4f, 0x64, 0x33, 0x4a, 0x42, 0x70, 0x4f, 0x66, 0x77, 0x0a, 0x38, 0x54, 0x76, 0x53, 0x74, 0x51, 0x78, 0x34, 0x4c, 0x38, 0x59, 0x64, 0x4b, 0x51, 0x35, 0x68, 0x74, 0x7a, 0x6b, 0x32, 0x68, 0x70, 0x52, 0x4a, 0x4c, 0x30, 0x6c, 0x4b, 0x67, 0x47, 0x31, 0x57, 0x34, 0x75, 0x4b, 0x32, 0x39, 0x39, 0x42, 0x74, 0x7a, 0x64, 0x41, 0x67, 0x66, 0x42, 0x76, 0x43, 0x54, 0x33, 0x41, 0x31, 0x61, 0x53, 0x70, 0x6a, 0x49, 0x47, 0x74, 0x6e, 0x69, 0x72, 0x49, 0x31, 0x0a, 0x46, 0x4c, 0x52, 0x58, 0x47, 0x79, 0x38, 0x31, 0x31, 0x57, 0x4a, 0x39, 0x4a, 0x68, 0x68, 0x34, 0x41, 0x4b, 0x4c, 0x66, 0x79, 0x56, 0x70, 0x42, 0x4a, 0x67, 0x65, 0x34, 0x73, 0x56, 0x72, 0x36, 0x4e, 0x75, 0x75, 0x49, 0x66, 0x32, 0x71, 0x47, 0x31, 0x6f, 0x79, 0x31, 0x30, 0x70, 0x61, 0x51, 0x4e, 0x65, 0x71, 0x32, 0x33, 0x55, 0x47, 0x61, 0x59, 0x74, 0x2f, 0x7a, 0x55, 0x56, 0x4a, 0x77, 0x0a, 0x55, 0x74, 0x30, 0x57, 0x45, 0x6b, 0x58, 0x38, 0x48, 0x4f, 0x63, 0x62, 0x33, 0x75, 0x49, 0x6f, 0x54, 0x6d, 0x61, 0x4f, 0x34, 0x72, 0x48, 0x42, 0x55, 0x4a, 0x71, 0x45, 0x79, 0x39, 0x51, 0x58, 0x7a, 0x53, 0x57, 0x77, 0x43, 0x35, 0x78, 0x45, 0x43, 0x64, 0x37, 0x43, 0x4a, 0x53, 0x53, 0x68, 0x31, 0x30, 0x4f, 0x75, 0x6e, 0x6c, 0x75, 0x4c, 0x32, 0x4d, 0x47, 0x65, 0x5a, 0x47, 0x6e, 0x76, 0x0a, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x59, 0x59, 0x77, 0x67, 0x59, 0x4d, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4c, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x66, 0x59, 0x77, 0x59, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6c, 0x0a, 0x42, 0x46, 0x77, 0x77, 0x57, 0x67, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x45, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x43, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x41, 0x77, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x51, 0x47, 0x43, 0x43, 0x73, 0x47, 0x0a, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x46, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x42, 0x67, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x63, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x49, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x43, 0x54, 0x41, 0x4e, 0x0a, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x46, 0x6d, 0x34, 0x37, 0x47, 0x55, 0x70, 0x50, 0x57, 0x35, 0x2b, 0x37, 0x69, 0x46, 0x74, 0x69, 0x6c, 0x6f, 0x6b, 0x35, 0x32, 0x49, 0x6f, 0x54, 0x57, 0x72, 0x74, 0x46, 0x67, 0x32, 0x79, 0x69, 0x36, 0x6b, 0x49, 0x32, 0x69, 0x52, 0x4e, 0x51, 0x0a, 0x4b, 0x75, 0x67, 0x48, 0x55, 0x49, 0x4f, 0x34, 0x4b, 0x53, 0x71, 0x4a, 0x56, 0x42, 0x50, 0x38, 0x61, 0x4b, 0x4f, 0x61, 0x54, 0x5a, 0x47, 0x45, 0x31, 0x4b, 0x4d, 0x68, 0x2f, 0x59, 0x6a, 0x68, 0x36, 0x71, 0x2f, 0x67, 0x50, 0x61, 0x6c, 0x67, 0x64, 0x2f, 0x38, 0x44, 0x6d, 0x72, 0x78, 0x53, 0x4a, 0x6d, 0x55, 0x78, 0x33, 0x62, 0x4e, 0x62, 0x38, 0x52, 0x59, 0x36, 0x70, 0x4b, 0x7a, 0x74, 0x0a, 0x5a, 0x64, 0x75, 0x53, 0x61, 0x53, 0x2b, 0x57, 0x55, 0x30, 0x59, 0x74, 0x2b, 0x6c, 0x47, 0x35, 0x76, 0x56, 0x67, 0x61, 0x70, 0x48, 0x45, 0x71, 0x36, 0x79, 0x71, 0x4c, 0x62, 0x65, 0x56, 0x78, 0x51, 0x4c, 0x75, 0x62, 0x54, 0x69, 0x6e, 0x4f, 0x66, 0x56, 0x56, 0x5a, 0x58, 0x79, 0x45, 0x43, 0x59, 0x47, 0x4d, 0x73, 0x59, 0x71, 0x65, 0x6e, 0x4a, 0x6a, 0x4e, 0x63, 0x62, 0x49, 0x5a, 0x4e, 0x0a, 0x79, 0x4d, 0x75, 0x72, 0x46, 0x63, 0x67, 0x30, 0x34, 0x36, 0x4f, 0x34, 0x59, 0x79, 0x68, 0x56, 0x79, 0x71, 0x53, 0x69, 0x74, 0x43, 0x59, 0x37, 0x68, 0x2f, 0x65, 0x71, 0x67, 0x6b, 0x50, 0x4a, 0x51, 0x30, 0x68, 0x6b, 0x70, 0x39, 0x45, 0x64, 0x51, 0x77, 0x62, 0x6e, 0x38, 0x56, 0x6c, 0x66, 0x78, 0x64, 0x42, 0x58, 0x77, 0x51, 0x34, 0x4e, 0x48, 0x4b, 0x30, 0x4a, 0x56, 0x46, 0x2f, 0x33, 0x0a, 0x71, 0x48, 0x61, 0x68, 0x4e, 0x48, 0x4f, 0x35, 0x64, 0x62, 0x4a, 0x5a, 0x57, 0x59, 0x41, 0x62, 0x42, 0x44, 0x70, 0x32, 0x51, 0x45, 0x53, 0x70, 0x76, 0x6f, 0x2b, 0x38, 0x33, 0x6c, 0x68, 0x34, 0x64, 0x6e, 0x58, 0x6a, 0x46, 0x58, 0x4d, 0x43, 0x48, 0x76, 0x52, 0x68, 0x35, 0x31, 0x79, 0x2f, 0x54, 0x71, 0x79, 0x42, 0x34, 0x56, 0x76, 0x72, 0x52, 0x4b, 0x49, 0x4b, 0x74, 0x54, 0x6f, 0x7a, 0x0a, 0x5a, 0x6a, 0x48, 0x59, 0x49, 0x63, 0x62, 0x6a, 0x76, 0x53, 0x58, 0x4d, 0x7a, 0x61, 0x44, 0x50, 0x6a, 0x50, 0x63, 0x5a, 0x47, 0x6a, 0x42, 0x4a, 0x6c, 0x47, 0x36, 0x43, 0x76, 0x44, 0x34, 0x4c, 0x6d, 0x59, 0x7a, 0x72, 0x6b, 0x48, 0x34, 0x31, 0x63, 0x7a, 0x72, 0x34, 0x57, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,]),
  915. Key_bin: new Uint8Array([0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x76, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43, 0x42, 0x4b, 0x67, 0x77, 0x67, 0x67, 0x53, 0x6b, 0x41, 0x67, 0x45, 0x41, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, 0x58, 0x45, 0x63, 0x76, 0x72, 0x59, 0x37, 0x56, 0x2b, 0x7a, 0x64, 0x42, 0x79, 0x0a, 0x72, 0x64, 0x4e, 0x78, 0x4a, 0x59, 0x45, 0x6d, 0x61, 0x41, 0x4e, 0x59, 0x55, 0x4f, 0x37, 0x76, 0x57, 0x34, 0x68, 0x64, 0x41, 0x35, 0x49, 0x42, 0x49, 0x46, 0x6d, 0x4d, 0x70, 0x6e, 0x62, 0x79, 0x69, 0x4e, 0x6e, 0x5a, 0x77, 0x36, 0x57, 0x39, 0x6f, 0x61, 0x67, 0x78, 0x33, 0x5a, 0x49, 0x65, 0x65, 0x48, 0x56, 0x59, 0x62, 0x52, 0x69, 0x4b, 0x36, 0x41, 0x66, 0x46, 0x74, 0x53, 0x31, 0x32, 0x0a, 0x2b, 0x45, 0x31, 0x4d, 0x59, 0x31, 0x64, 0x32, 0x61, 0x71, 0x51, 0x31, 0x53, 0x72, 0x49, 0x43, 0x39, 0x51, 0x35, 0x55, 0x6e, 0x5a, 0x61, 0x42, 0x72, 0x62, 0x57, 0x32, 0x32, 0x6d, 0x4e, 0x75, 0x6c, 0x4d, 0x34, 0x2f, 0x6c, 0x49, 0x4a, 0x72, 0x48, 0x70, 0x51, 0x55, 0x68, 0x50, 0x78, 0x6f, 0x62, 0x79, 0x34, 0x2f, 0x36, 0x4e, 0x41, 0x37, 0x71, 0x4b, 0x67, 0x55, 0x48, 0x69, 0x79, 0x4f, 0x0a, 0x64, 0x33, 0x4a, 0x42, 0x70, 0x4f, 0x66, 0x77, 0x38, 0x54, 0x76, 0x53, 0x74, 0x51, 0x78, 0x34, 0x4c, 0x38, 0x59, 0x64, 0x4b, 0x51, 0x35, 0x68, 0x74, 0x7a, 0x6b, 0x32, 0x68, 0x70, 0x52, 0x4a, 0x4c, 0x30, 0x6c, 0x4b, 0x67, 0x47, 0x31, 0x57, 0x34, 0x75, 0x4b, 0x32, 0x39, 0x39, 0x42, 0x74, 0x7a, 0x64, 0x41, 0x67, 0x66, 0x42, 0x76, 0x43, 0x54, 0x33, 0x41, 0x31, 0x61, 0x53, 0x70, 0x6a, 0x0a, 0x49, 0x47, 0x74, 0x6e, 0x69, 0x72, 0x49, 0x31, 0x46, 0x4c, 0x52, 0x58, 0x47, 0x79, 0x38, 0x31, 0x31, 0x57, 0x4a, 0x39, 0x4a, 0x68, 0x68, 0x34, 0x41, 0x4b, 0x4c, 0x66, 0x79, 0x56, 0x70, 0x42, 0x4a, 0x67, 0x65, 0x34, 0x73, 0x56, 0x72, 0x36, 0x4e, 0x75, 0x75, 0x49, 0x66, 0x32, 0x71, 0x47, 0x31, 0x6f, 0x79, 0x31, 0x30, 0x70, 0x61, 0x51, 0x4e, 0x65, 0x71, 0x32, 0x33, 0x55, 0x47, 0x61, 0x0a, 0x59, 0x74, 0x2f, 0x7a, 0x55, 0x56, 0x4a, 0x77, 0x55, 0x74, 0x30, 0x57, 0x45, 0x6b, 0x58, 0x38, 0x48, 0x4f, 0x63, 0x62, 0x33, 0x75, 0x49, 0x6f, 0x54, 0x6d, 0x61, 0x4f, 0x34, 0x72, 0x48, 0x42, 0x55, 0x4a, 0x71, 0x45, 0x79, 0x39, 0x51, 0x58, 0x7a, 0x53, 0x57, 0x77, 0x43, 0x35, 0x78, 0x45, 0x43, 0x64, 0x37, 0x43, 0x4a, 0x53, 0x53, 0x68, 0x31, 0x30, 0x4f, 0x75, 0x6e, 0x6c, 0x75, 0x4c, 0x0a, 0x32, 0x4d, 0x47, 0x65, 0x5a, 0x47, 0x6e, 0x76, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x43, 0x67, 0x67, 0x45, 0x41, 0x54, 0x77, 0x34, 0x52, 0x6f, 0x52, 0x4c, 0x6a, 0x73, 0x68, 0x72, 0x42, 0x56, 0x6f, 0x59, 0x69, 0x78, 0x4f, 0x4a, 0x2b, 0x57, 0x4c, 0x6d, 0x2f, 0x45, 0x51, 0x57, 0x65, 0x37, 0x6f, 0x6a, 0x38, 0x31, 0x51, 0x50, 0x73, 0x39, 0x56, 0x45, 0x49, 0x32, 0x62, 0x53, 0x4f, 0x0a, 0x34, 0x4a, 0x51, 0x42, 0x55, 0x42, 0x53, 0x6b, 0x70, 0x64, 0x48, 0x34, 0x57, 0x32, 0x77, 0x51, 0x75, 0x2f, 0x61, 0x58, 0x57, 0x38, 0x75, 0x75, 0x53, 0x39, 0x45, 0x43, 0x6d, 0x6d, 0x41, 0x41, 0x75, 0x45, 0x79, 0x4a, 0x54, 0x56, 0x7a, 0x75, 0x31, 0x32, 0x35, 0x58, 0x73, 0x65, 0x63, 0x6c, 0x44, 0x41, 0x55, 0x38, 0x49, 0x55, 0x70, 0x54, 0x2b, 0x70, 0x4c, 0x35, 0x79, 0x70, 0x37, 0x34, 0x0a, 0x45, 0x62, 0x76, 0x4e, 0x48, 0x48, 0x33, 0x67, 0x65, 0x72, 0x4f, 0x67, 0x78, 0x76, 0x49, 0x6a, 0x50, 0x64, 0x67, 0x77, 0x62, 0x66, 0x6d, 0x4d, 0x49, 0x59, 0x48, 0x62, 0x56, 0x70, 0x6e, 0x49, 0x30, 0x77, 0x32, 0x42, 0x43, 0x44, 0x51, 0x76, 0x74, 0x64, 0x64, 0x57, 0x6f, 0x42, 0x74, 0x41, 0x33, 0x43, 0x54, 0x6a, 0x63, 0x2f, 0x43, 0x56, 0x67, 0x73, 0x47, 0x77, 0x33, 0x43, 0x4e, 0x72, 0x0a, 0x46, 0x78, 0x41, 0x46, 0x35, 0x73, 0x4a, 0x34, 0x63, 0x5a, 0x4c, 0x6e, 0x5a, 0x31, 0x45, 0x36, 0x69, 0x74, 0x4c, 0x54, 0x50, 0x69, 0x6f, 0x6a, 0x74, 0x76, 0x48, 0x48, 0x34, 0x61, 0x64, 0x6d, 0x68, 0x68, 0x43, 0x61, 0x42, 0x49, 0x78, 0x76, 0x47, 0x2f, 0x53, 0x6e, 0x59, 0x77, 0x4e, 0x35, 0x38, 0x37, 0x55, 0x5a, 0x6d, 0x37, 0x4c, 0x57, 0x50, 0x61, 0x67, 0x4c, 0x41, 0x33, 0x67, 0x69, 0x0a, 0x48, 0x4b, 0x4f, 0x2b, 0x4b, 0x79, 0x42, 0x51, 0x39, 0x33, 0x31, 0x4e, 0x4d, 0x61, 0x65, 0x6a, 0x36, 0x6d, 0x75, 0x75, 0x46, 0x32, 0x30, 0x32, 0x76, 0x34, 0x37, 0x6c, 0x57, 0x6b, 0x64, 0x50, 0x4f, 0x6e, 0x52, 0x43, 0x69, 0x6f, 0x4d, 0x58, 0x30, 0x63, 0x31, 0x6a, 0x36, 0x76, 0x32, 0x61, 0x59, 0x34, 0x34, 0x77, 0x55, 0x4b, 0x71, 0x39, 0x4d, 0x52, 0x67, 0x6f, 0x52, 0x76, 0x4a, 0x37, 0x0a, 0x41, 0x39, 0x77, 0x65, 0x72, 0x4c, 0x6b, 0x68, 0x35, 0x78, 0x78, 0x35, 0x35, 0x32, 0x4f, 0x74, 0x71, 0x50, 0x36, 0x73, 0x61, 0x6d, 0x75, 0x47, 0x44, 0x52, 0x78, 0x31, 0x42, 0x70, 0x36, 0x53, 0x4f, 0x70, 0x68, 0x43, 0x45, 0x50, 0x48, 0x59, 0x67, 0x51, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x36, 0x33, 0x65, 0x2b, 0x52, 0x75, 0x6c, 0x36, 0x46, 0x78, 0x47, 0x43, 0x76, 0x67, 0x70, 0x6b, 0x33, 0x0a, 0x57, 0x67, 0x2f, 0x54, 0x31, 0x77, 0x2f, 0x59, 0x4b, 0x6b, 0x79, 0x4f, 0x49, 0x46, 0x4c, 0x63, 0x46, 0x4c, 0x57, 0x71, 0x42, 0x44, 0x71, 0x6c, 0x6e, 0x58, 0x65, 0x63, 0x6c, 0x6b, 0x50, 0x4b, 0x6a, 0x57, 0x4e, 0x2f, 0x32, 0x70, 0x4a, 0x6d, 0x4f, 0x31, 0x63, 0x46, 0x63, 0x44, 0x4a, 0x46, 0x59, 0x64, 0x32, 0x45, 0x49, 0x45, 0x72, 0x76, 0x42, 0x57, 0x54, 0x34, 0x51, 0x39, 0x4d, 0x42, 0x0a, 0x4e, 0x35, 0x6c, 0x44, 0x6b, 0x47, 0x75, 0x6a, 0x34, 0x2f, 0x6b, 0x68, 0x56, 0x6c, 0x79, 0x6e, 0x77, 0x62, 0x64, 0x42, 0x6e, 0x47, 0x43, 0x34, 0x61, 0x34, 0x48, 0x4a, 0x49, 0x4a, 0x76, 0x61, 0x35, 0x63, 0x70, 0x49, 0x63, 0x57, 0x65, 0x4a, 0x72, 0x35, 0x61, 0x57, 0x33, 0x69, 0x44, 0x36, 0x68, 0x53, 0x73, 0x61, 0x6c, 0x79, 0x55, 0x76, 0x4a, 0x4d, 0x6d, 0x64, 0x4d, 0x42, 0x6e, 0x47, 0x0a, 0x37, 0x2b, 0x50, 0x65, 0x53, 0x2b, 0x4e, 0x73, 0x4b, 0x30, 0x61, 0x63, 0x31, 0x67, 0x33, 0x4d, 0x6c, 0x56, 0x35, 0x42, 0x41, 0x32, 0x70, 0x55, 0x54, 0x77, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x62, 0x65, 0x46, 0x6d, 0x2b, 0x46, 0x46, 0x35, 0x62, 0x76, 0x6f, 0x4b, 0x7a, 0x49, 0x4c, 0x6c, 0x31, 0x62, 0x79, 0x6b, 0x6c, 0x52, 0x6b, 0x69, 0x76, 0x7a, 0x6b, 0x62, 0x7a, 0x49, 0x6b, 0x41, 0x78, 0x0a, 0x35, 0x56, 0x6b, 0x74, 0x67, 0x36, 0x4a, 0x35, 0x63, 0x76, 0x38, 0x44, 0x35, 0x2b, 0x72, 0x71, 0x50, 0x75, 0x6a, 0x4f, 0x66, 0x39, 0x67, 0x42, 0x6a, 0x4e, 0x37, 0x70, 0x64, 0x78, 0x39, 0x39, 0x35, 0x6b, 0x47, 0x49, 0x78, 0x5a, 0x39, 0x6d, 0x31, 0x68, 0x57, 0x69, 0x78, 0x55, 0x55, 0x31, 0x55, 0x6f, 0x38, 0x72, 0x70, 0x39, 0x4a, 0x69, 0x47, 0x4f, 0x36, 0x72, 0x65, 0x31, 0x77, 0x69, 0x0a, 0x6a, 0x56, 0x2f, 0x4c, 0x31, 0x64, 0x37, 0x55, 0x66, 0x39, 0x48, 0x6a, 0x65, 0x61, 0x70, 0x4f, 0x46, 0x62, 0x34, 0x6b, 0x72, 0x71, 0x52, 0x58, 0x54, 0x65, 0x75, 0x4d, 0x6e, 0x35, 0x35, 0x44, 0x33, 0x64, 0x70, 0x79, 0x6a, 0x51, 0x4e, 0x43, 0x30, 0x5a, 0x50, 0x72, 0x61, 0x6d, 0x58, 0x64, 0x38, 0x31, 0x57, 0x6f, 0x6f, 0x56, 0x77, 0x58, 0x59, 0x41, 0x66, 0x69, 0x46, 0x76, 0x4c, 0x49, 0x0a, 0x6f, 0x66, 0x31, 0x37, 0x51, 0x67, 0x67, 0x49, 0x59, 0x51, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x59, 0x55, 0x67, 0x67, 0x43, 0x34, 0x58, 0x49, 0x67, 0x5a, 0x76, 0x58, 0x34, 0x59, 0x65, 0x55, 0x38, 0x6c, 0x61, 0x79, 0x51, 0x50, 0x79, 0x4b, 0x71, 0x67, 0x38, 0x37, 0x2f, 0x76, 0x31, 0x2b, 0x7a, 0x35, 0x79, 0x65, 0x2f, 0x4d, 0x32, 0x5a, 0x65, 0x36, 0x53, 0x6e, 0x37, 0x48, 0x4a, 0x66, 0x59, 0x0a, 0x55, 0x5a, 0x4d, 0x36, 0x37, 0x48, 0x37, 0x52, 0x4b, 0x4e, 0x6f, 0x68, 0x46, 0x6c, 0x35, 0x43, 0x39, 0x65, 0x44, 0x4e, 0x7a, 0x67, 0x72, 0x50, 0x6b, 0x52, 0x63, 0x2f, 0x2f, 0x54, 0x77, 0x32, 0x45, 0x48, 0x74, 0x59, 0x68, 0x33, 0x42, 0x4b, 0x49, 0x6f, 0x72, 0x77, 0x39, 0x45, 0x64, 0x78, 0x59, 0x4e, 0x6c, 0x6b, 0x2b, 0x6a, 0x4e, 0x73, 0x30, 0x30, 0x64, 0x57, 0x35, 0x34, 0x64, 0x39, 0x0a, 0x65, 0x69, 0x69, 0x7a, 0x7a, 0x78, 0x59, 0x34, 0x34, 0x2f, 0x41, 0x32, 0x70, 0x39, 0x52, 0x49, 0x4d, 0x67, 0x79, 0x35, 0x49, 0x52, 0x77, 0x76, 0x53, 0x73, 0x6d, 0x50, 0x67, 0x61, 0x71, 0x34, 0x6f, 0x4b, 0x4d, 0x64, 0x54, 0x4e, 0x4d, 0x4f, 0x73, 0x30, 0x4a, 0x77, 0x65, 0x79, 0x50, 0x72, 0x42, 0x65, 0x49, 0x41, 0x72, 0x62, 0x46, 0x43, 0x67, 0x51, 0x4b, 0x42, 0x67, 0x51, 0x43, 0x71, 0x0a, 0x57, 0x30, 0x34, 0x56, 0x33, 0x49, 0x75, 0x74, 0x33, 0x55, 0x42, 0x6f, 0x75, 0x50, 0x4d, 0x63, 0x63, 0x38, 0x2f, 0x56, 0x62, 0x69, 0x77, 0x48, 0x77, 0x79, 0x2b, 0x52, 0x6c, 0x4c, 0x6d, 0x4e, 0x77, 0x59, 0x41, 0x71, 0x63, 0x79, 0x35, 0x50, 0x35, 0x58, 0x4b, 0x4c, 0x33, 0x70, 0x36, 0x62, 0x65, 0x33, 0x2b, 0x4d, 0x6f, 0x76, 0x48, 0x52, 0x71, 0x6a, 0x35, 0x78, 0x72, 0x4a, 0x54, 0x57, 0x0a, 0x54, 0x6a, 0x2f, 0x36, 0x59, 0x61, 0x51, 0x73, 0x31, 0x2b, 0x72, 0x74, 0x63, 0x51, 0x45, 0x61, 0x74, 0x64, 0x34, 0x4b, 0x50, 0x66, 0x64, 0x78, 0x53, 0x2f, 0x63, 0x66, 0x52, 0x74, 0x38, 0x71, 0x74, 0x75, 0x42, 0x77, 0x51, 0x61, 0x2f, 0x34, 0x39, 0x4d, 0x72, 0x41, 0x4c, 0x76, 0x57, 0x43, 0x4c, 0x53, 0x42, 0x75, 0x4b, 0x74, 0x33, 0x49, 0x49, 0x75, 0x53, 0x2f, 0x51, 0x44, 0x74, 0x43, 0x0a, 0x5a, 0x4e, 0x67, 0x6d, 0x36, 0x4d, 0x78, 0x71, 0x4e, 0x6e, 0x49, 0x43, 0x58, 0x35, 0x46, 0x34, 0x36, 0x6d, 0x52, 0x49, 0x52, 0x42, 0x42, 0x4f, 0x32, 0x4b, 0x7a, 0x6c, 0x30, 0x33, 0x68, 0x62, 0x51, 0x6c, 0x71, 0x58, 0x4c, 0x5a, 0x63, 0x38, 0x6f, 0x51, 0x4b, 0x42, 0x67, 0x43, 0x53, 0x77, 0x66, 0x46, 0x7a, 0x68, 0x48, 0x76, 0x78, 0x36, 0x68, 0x69, 0x64, 0x57, 0x67, 0x48, 0x4a, 0x63, 0x0a, 0x77, 0x79, 0x76, 0x64, 0x6e, 0x70, 0x58, 0x78, 0x36, 0x5a, 0x4c, 0x6e, 0x6f, 0x61, 0x7a, 0x61, 0x6f, 0x48, 0x47, 0x74, 0x4d, 0x47, 0x43, 0x45, 0x5a, 0x49, 0x50, 0x66, 0x6a, 0x4c, 0x42, 0x63, 0x30, 0x4d, 0x74, 0x79, 0x45, 0x64, 0x53, 0x4c, 0x78, 0x54, 0x6c, 0x35, 0x59, 0x70, 0x78, 0x6f, 0x6d, 0x43, 0x46, 0x55, 0x4d, 0x33, 0x55, 0x63, 0x59, 0x4e, 0x2f, 0x50, 0x5a, 0x66, 0x58, 0x41, 0x0a, 0x6d, 0x36, 0x31, 0x45, 0x6d, 0x71, 0x53, 0x53, 0x4d, 0x56, 0x63, 0x47, 0x50, 0x67, 0x65, 0x2f, 0x43, 0x34, 0x44, 0x42, 0x5a, 0x59, 0x6a, 0x53, 0x45, 0x71, 0x62, 0x67, 0x37, 0x6d, 0x73, 0x52, 0x30, 0x33, 0x37, 0x42, 0x58, 0x54, 0x48, 0x6b, 0x78, 0x44, 0x62, 0x33, 0x71, 0x48, 0x46, 0x54, 0x6f, 0x30, 0x6b, 0x48, 0x57, 0x4a, 0x66, 0x34, 0x39, 0x59, 0x77, 0x32, 0x73, 0x77, 0x6a, 0x54, 0x0a, 0x72, 0x4f, 0x38, 0x46, 0x46, 0x44, 0x52, 0x56, 0x50, 0x44, 0x4c, 0x5a, 0x61, 0x37, 0x36, 0x47, 0x67, 0x79, 0x41, 0x55, 0x4a, 0x38, 0x55, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,])
  916. });
  917. return [4 /*yield*/, api.SetServerCert(in_rpc_key_pair)];
  918. case 1:
  919. out_rpc_key_pair = _a.sent();
  920. console.log(out_rpc_key_pair);
  921. console.log("End: Test_SetServerCert");
  922. console.log("-----");
  923. console.log();
  924. return [2 /*return*/];
  925. }
  926. });
  927. });
  928. }
  929. /** API test for 'GetServerCert', Get the server certification */
  930. function Test_GetServerCert() {
  931. return __awaiter(this, void 0, void 0, function () {
  932. var out_rpc_key_pair;
  933. return __generator(this, function (_a) {
  934. switch (_a.label) {
  935. case 0:
  936. console.log("Begin: Test_GetServerCert");
  937. return [4 /*yield*/, api.GetServerCert()];
  938. case 1:
  939. out_rpc_key_pair = _a.sent();
  940. console.log(out_rpc_key_pair);
  941. console.log("End: Test_GetServerCert");
  942. console.log("-----");
  943. console.log();
  944. return [2 /*return*/];
  945. }
  946. });
  947. });
  948. }
  949. /** API test for 'GetServerCipher', Get cipher for SSL */
  950. function Test_GetServerCipher() {
  951. return __awaiter(this, void 0, void 0, function () {
  952. var out_rpc_str;
  953. return __generator(this, function (_a) {
  954. switch (_a.label) {
  955. case 0:
  956. console.log("Begin: Test_GetServerCipher");
  957. return [4 /*yield*/, api.GetServerCipher()];
  958. case 1:
  959. out_rpc_str = _a.sent();
  960. console.log(out_rpc_str);
  961. console.log("End: Test_GetServerCipher");
  962. console.log("-----");
  963. console.log();
  964. return [2 /*return*/];
  965. }
  966. });
  967. });
  968. }
  969. /** API test for 'SetServerCipher', Set cipher for SSL to the server */
  970. function Test_SetServerCipher() {
  971. return __awaiter(this, void 0, void 0, function () {
  972. var in_rpc_str, out_rpc_str;
  973. return __generator(this, function (_a) {
  974. switch (_a.label) {
  975. case 0:
  976. console.log("Begin: Test_SetServerCipher");
  977. in_rpc_str = new VPN.VpnRpcStr({
  978. String_str: "RC4-MD5"
  979. });
  980. return [4 /*yield*/, api.SetServerCipher(in_rpc_str)];
  981. case 1:
  982. out_rpc_str = _a.sent();
  983. console.log(out_rpc_str);
  984. console.log("End: Test_SetServerCipher");
  985. console.log("-----");
  986. console.log();
  987. return [2 /*return*/];
  988. }
  989. });
  990. });
  991. }
  992. /** API test for 'CreateHub', Create a hub */
  993. function Test_CreateHub() {
  994. return __awaiter(this, void 0, void 0, function () {
  995. var hub_name, in_rpc_create_hub, out_rpc_create_hub;
  996. return __generator(this, function (_a) {
  997. switch (_a.label) {
  998. case 0:
  999. hub_name = "Test_" + Math.floor((Math.random() * (999999 - 100000)) + 100000);
  1000. console.log("Begin: Test_CreateHub");
  1001. in_rpc_create_hub = new VPN.VpnRpcCreateHub({
  1002. HubName_str: hub_name,
  1003. HubType_u32: VPN.VpnRpcHubType.Standalone,
  1004. Online_bool: true,
  1005. AdminPasswordPlainText_str: "microsoft",
  1006. MaxSession_u32: 123,
  1007. NoEnum_bool: false
  1008. });
  1009. return [4 /*yield*/, api.CreateHub(in_rpc_create_hub)];
  1010. case 1:
  1011. out_rpc_create_hub = _a.sent();
  1012. console.log(out_rpc_create_hub);
  1013. console.log("End: Test_CreateHub");
  1014. console.log("-----");
  1015. console.log();
  1016. return [2 /*return*/, hub_name];
  1017. }
  1018. });
  1019. });
  1020. }
  1021. /** API test for 'SetHub', Set hub configuration */
  1022. function Test_SetHub() {
  1023. return __awaiter(this, void 0, void 0, function () {
  1024. var in_rpc_create_hub, out_rpc_create_hub;
  1025. return __generator(this, function (_a) {
  1026. switch (_a.label) {
  1027. case 0:
  1028. console.log("Begin: Test_SetHub");
  1029. in_rpc_create_hub = new VPN.VpnRpcCreateHub({
  1030. HubName_str: hub_name,
  1031. AdminPasswordPlainText_str: "aho",
  1032. HubType_u32: VPN.VpnRpcHubType.Standalone,
  1033. NoEnum_bool: false,
  1034. MaxSession_u32: 128,
  1035. Online_bool: true
  1036. });
  1037. return [4 /*yield*/, api.SetHub(in_rpc_create_hub)];
  1038. case 1:
  1039. out_rpc_create_hub = _a.sent();
  1040. console.log(out_rpc_create_hub);
  1041. console.log("End: Test_SetHub");
  1042. console.log("-----");
  1043. console.log();
  1044. return [2 /*return*/];
  1045. }
  1046. });
  1047. });
  1048. }
  1049. /** API test for 'GetHub', Get hub configuration */
  1050. function Test_GetHub() {
  1051. return __awaiter(this, void 0, void 0, function () {
  1052. var in_rpc_create_hub, out_rpc_create_hub;
  1053. return __generator(this, function (_a) {
  1054. switch (_a.label) {
  1055. case 0:
  1056. console.log("Begin: Test_GetHub");
  1057. in_rpc_create_hub = new VPN.VpnRpcCreateHub({
  1058. HubName_str: hub_name
  1059. });
  1060. return [4 /*yield*/, api.GetHub(in_rpc_create_hub)];
  1061. case 1:
  1062. out_rpc_create_hub = _a.sent();
  1063. console.log(out_rpc_create_hub);
  1064. console.log("End: Test_GetHub");
  1065. console.log("-----");
  1066. console.log();
  1067. return [2 /*return*/];
  1068. }
  1069. });
  1070. });
  1071. }
  1072. /** API test for 'EnumHub', Enumerate hubs */
  1073. function Test_EnumHub() {
  1074. return __awaiter(this, void 0, void 0, function () {
  1075. var out_rpc_enum_hub;
  1076. return __generator(this, function (_a) {
  1077. switch (_a.label) {
  1078. case 0:
  1079. console.log("Begin: Test_EnumHub");
  1080. return [4 /*yield*/, api.EnumHub()];
  1081. case 1:
  1082. out_rpc_enum_hub = _a.sent();
  1083. console.log(out_rpc_enum_hub);
  1084. console.log("End: Test_EnumHub");
  1085. console.log("-----");
  1086. console.log();
  1087. return [2 /*return*/];
  1088. }
  1089. });
  1090. });
  1091. }
  1092. /** API test for 'DeleteHub', Delete a hub */
  1093. function Test_DeleteHub() {
  1094. return __awaiter(this, void 0, void 0, function () {
  1095. var in_rpc_delete_hub, out_rpc_delete_hub;
  1096. return __generator(this, function (_a) {
  1097. switch (_a.label) {
  1098. case 0:
  1099. console.log("Begin: Test_DeleteHub");
  1100. in_rpc_delete_hub = new VPN.VpnRpcDeleteHub({
  1101. HubName_str: hub_name
  1102. });
  1103. return [4 /*yield*/, api.DeleteHub(in_rpc_delete_hub)];
  1104. case 1:
  1105. out_rpc_delete_hub = _a.sent();
  1106. console.log(out_rpc_delete_hub);
  1107. console.log("End: Test_DeleteHub");
  1108. console.log("-----");
  1109. console.log();
  1110. return [2 /*return*/];
  1111. }
  1112. });
  1113. });
  1114. }
  1115. /** API test for 'GetHubRadius', Get Radius options of the hub */
  1116. function Test_GetHubRadius() {
  1117. return __awaiter(this, void 0, void 0, function () {
  1118. var in_rpc_radius, out_rpc_radius;
  1119. return __generator(this, function (_a) {
  1120. switch (_a.label) {
  1121. case 0:
  1122. console.log("Begin: Test_GetHubRadius");
  1123. in_rpc_radius = new VPN.VpnRpcRadius({
  1124. HubName_str: hub_name
  1125. });
  1126. return [4 /*yield*/, api.GetHubRadius(in_rpc_radius)];
  1127. case 1:
  1128. out_rpc_radius = _a.sent();
  1129. console.log(out_rpc_radius);
  1130. console.log("End: Test_GetHubRadius");
  1131. console.log("-----");
  1132. console.log();
  1133. return [2 /*return*/];
  1134. }
  1135. });
  1136. });
  1137. }
  1138. /** API test for 'SetHubRadius', Set Radius options of the hub */
  1139. function Test_SetHubRadius() {
  1140. return __awaiter(this, void 0, void 0, function () {
  1141. var in_rpc_radius, out_rpc_radius;
  1142. return __generator(this, function (_a) {
  1143. switch (_a.label) {
  1144. case 0:
  1145. console.log("Begin: Test_SetHubRadius");
  1146. in_rpc_radius = new VPN.VpnRpcRadius({
  1147. HubName_str: hub_name,
  1148. RadiusServerName_str: "1.2.3.4",
  1149. RadiusPort_u32: 1234,
  1150. RadiusSecret_str: "microsoft",
  1151. RadiusRetryInterval_u32: 1000
  1152. });
  1153. return [4 /*yield*/, api.SetHubRadius(in_rpc_radius)];
  1154. case 1:
  1155. out_rpc_radius = _a.sent();
  1156. console.log(out_rpc_radius);
  1157. console.log("End: Test_SetHubRadius");
  1158. console.log("-----");
  1159. console.log();
  1160. return [2 /*return*/];
  1161. }
  1162. });
  1163. });
  1164. }
  1165. /** API test for 'EnumConnection', Enumerate connections */
  1166. function Test_EnumConnection() {
  1167. return __awaiter(this, void 0, void 0, function () {
  1168. var out_rpc_enum_connection;
  1169. return __generator(this, function (_a) {
  1170. switch (_a.label) {
  1171. case 0:
  1172. console.log("Begin: Test_EnumConnection");
  1173. return [4 /*yield*/, api.EnumConnection()];
  1174. case 1:
  1175. out_rpc_enum_connection = _a.sent();
  1176. console.log(out_rpc_enum_connection);
  1177. console.log("End: Test_EnumConnection");
  1178. console.log("-----");
  1179. console.log();
  1180. return [2 /*return*/, out_rpc_enum_connection];
  1181. }
  1182. });
  1183. });
  1184. }
  1185. /** API test for 'DisconnectConnection', Disconnect a connection */
  1186. function Test_DisconnectConnection(connection_id) {
  1187. return __awaiter(this, void 0, void 0, function () {
  1188. var in_rpc_disconnect_connection, out_rpc_disconnect_connection;
  1189. return __generator(this, function (_a) {
  1190. switch (_a.label) {
  1191. case 0:
  1192. console.log("Begin: Test_DisconnectConnection");
  1193. in_rpc_disconnect_connection = new VPN.VpnRpcDisconnectConnection({
  1194. Name_str: connection_id
  1195. });
  1196. return [4 /*yield*/, api.DisconnectConnection(in_rpc_disconnect_connection)];
  1197. case 1:
  1198. out_rpc_disconnect_connection = _a.sent();
  1199. console.log(out_rpc_disconnect_connection);
  1200. console.log("End: Test_DisconnectConnection");
  1201. console.log("-----");
  1202. console.log();
  1203. return [2 /*return*/];
  1204. }
  1205. });
  1206. });
  1207. }
  1208. /** API test for 'GetConnectionInfo', Get connection information */
  1209. function Test_GetConnectionInfo(name) {
  1210. return __awaiter(this, void 0, void 0, function () {
  1211. var in_rpc_connection_info, out_rpc_connection_info;
  1212. return __generator(this, function (_a) {
  1213. switch (_a.label) {
  1214. case 0:
  1215. console.log("Begin: Test_GetConnectionInfo");
  1216. in_rpc_connection_info = new VPN.VpnRpcConnectionInfo({
  1217. Name_str: name
  1218. });
  1219. return [4 /*yield*/, api.GetConnectionInfo(in_rpc_connection_info)];
  1220. case 1:
  1221. out_rpc_connection_info = _a.sent();
  1222. console.log(out_rpc_connection_info);
  1223. console.log("End: Test_GetConnectionInfo");
  1224. console.log("-----");
  1225. console.log();
  1226. return [2 /*return*/];
  1227. }
  1228. });
  1229. });
  1230. }
  1231. /** API test for 'SetHubOnline', Make a hub on-line or off-line */
  1232. function Test_SetHubOnline() {
  1233. return __awaiter(this, void 0, void 0, function () {
  1234. var in_rpc_set_hub_online, out_rpc_set_hub_online;
  1235. return __generator(this, function (_a) {
  1236. switch (_a.label) {
  1237. case 0:
  1238. console.log("Begin: Test_SetHubOnline");
  1239. in_rpc_set_hub_online = new VPN.VpnRpcSetHubOnline({
  1240. HubName_str: hub_name,
  1241. Online_bool: true
  1242. });
  1243. return [4 /*yield*/, api.SetHubOnline(in_rpc_set_hub_online)];
  1244. case 1:
  1245. out_rpc_set_hub_online = _a.sent();
  1246. console.log(out_rpc_set_hub_online);
  1247. console.log("End: Test_SetHubOnline");
  1248. console.log("-----");
  1249. console.log();
  1250. return [2 /*return*/];
  1251. }
  1252. });
  1253. });
  1254. }
  1255. /** API test for 'GetHubStatus', Get hub status */
  1256. function Test_GetHubStatus() {
  1257. return __awaiter(this, void 0, void 0, function () {
  1258. var in_rpc_hub_status, out_rpc_hub_status;
  1259. return __generator(this, function (_a) {
  1260. switch (_a.label) {
  1261. case 0:
  1262. console.log("Begin: Test_GetHubStatus");
  1263. in_rpc_hub_status = new VPN.VpnRpcHubStatus({
  1264. HubName_str: hub_name
  1265. });
  1266. return [4 /*yield*/, api.GetHubStatus(in_rpc_hub_status)];
  1267. case 1:
  1268. out_rpc_hub_status = _a.sent();
  1269. console.log(out_rpc_hub_status);
  1270. console.log("End: Test_GetHubStatus");
  1271. console.log("-----");
  1272. console.log();
  1273. return [2 /*return*/];
  1274. }
  1275. });
  1276. });
  1277. }
  1278. /** API test for 'SetHubLog', Set logging configuration into the hub */
  1279. function Test_SetHubLog(in_rpc_hub_log) {
  1280. return __awaiter(this, void 0, void 0, function () {
  1281. var out_rpc_hub_log;
  1282. return __generator(this, function (_a) {
  1283. switch (_a.label) {
  1284. case 0:
  1285. console.log("Begin: Test_SetHubLog");
  1286. return [4 /*yield*/, api.SetHubLog(in_rpc_hub_log)];
  1287. case 1:
  1288. out_rpc_hub_log = _a.sent();
  1289. console.log(out_rpc_hub_log);
  1290. console.log("End: Test_SetHubLog");
  1291. console.log("-----");
  1292. console.log();
  1293. return [2 /*return*/];
  1294. }
  1295. });
  1296. });
  1297. }
  1298. /** API test for 'GetHubLog', Get logging configuration of the hub */
  1299. function Test_GetHubLog() {
  1300. return __awaiter(this, void 0, void 0, function () {
  1301. var in_rpc_hub_log, out_rpc_hub_log;
  1302. return __generator(this, function (_a) {
  1303. switch (_a.label) {
  1304. case 0:
  1305. console.log("Begin: Test_GetHubLog");
  1306. in_rpc_hub_log = new VPN.VpnRpcHubLog({
  1307. HubName_str: hub_name
  1308. });
  1309. return [4 /*yield*/, api.GetHubLog(in_rpc_hub_log)];
  1310. case 1:
  1311. out_rpc_hub_log = _a.sent();
  1312. console.log(out_rpc_hub_log);
  1313. console.log("End: Test_GetHubLog");
  1314. console.log("-----");
  1315. console.log();
  1316. return [2 /*return*/, out_rpc_hub_log];
  1317. }
  1318. });
  1319. });
  1320. }
  1321. /** API test for 'AddCa', Add CA(Certificate Authority) into the hub */
  1322. function Test_AddCa() {
  1323. return __awaiter(this, void 0, void 0, function () {
  1324. var in_rpc_hub_add_ca, out_rpc_hub_add_ca;
  1325. return __generator(this, function (_a) {
  1326. switch (_a.label) {
  1327. case 0:
  1328. console.log("Begin: Test_AddCa");
  1329. in_rpc_hub_add_ca = new VPN.VpnRpcHubAddCA({
  1330. HubName_str: hub_name,
  1331. Cert_bin: new Uint8Array([0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x72, 0x6a, 0x43, 0x43, 0x41, 0x70, 0x61, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x57, 0x4d, 0x51, 0x77, 0x77, 0x43, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x4e, 0x68, 0x59, 0x57, 0x45, 0x78, 0x0a, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x4f, 0x4f, 0x42, 0x72, 0x2b, 0x4f, 0x42, 0x71, 0x75, 0x4f, 0x42, 0x6a, 0x2b, 0x4f, 0x42, 0x6e, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x6c, 0x41, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x30, 0x6c, 0x69, 0x0a, 0x59, 0x58, 0x4a, 0x68, 0x61, 0x32, 0x6b, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x42, 0x31, 0x52, 0x7a, 0x64, 0x57, 0x74, 0x31, 0x59, 0x6d, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x67, 0x78, 0x4d, 0x44, 0x45, 0x78, 0x4d, 0x6a, 0x4d, 0x7a, 0x4e, 0x54, 0x41, 0x78, 0x57, 0x68, 0x63, 0x4e, 0x4e, 0x44, 0x49, 0x78, 0x4d, 0x44, 0x41, 0x31, 0x0a, 0x4d, 0x6a, 0x4d, 0x7a, 0x4e, 0x54, 0x41, 0x78, 0x57, 0x6a, 0x42, 0x57, 0x4d, 0x51, 0x77, 0x77, 0x43, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x4e, 0x68, 0x59, 0x57, 0x45, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x4f, 0x4f, 0x42, 0x72, 0x2b, 0x4f, 0x42, 0x71, 0x75, 0x4f, 0x42, 0x6a, 0x2b, 0x4f, 0x42, 0x6e, 0x54, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x6c, 0x41, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x30, 0x6c, 0x69, 0x59, 0x58, 0x4a, 0x68, 0x61, 0x32, 0x6b, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x42, 0x31, 0x52, 0x7a, 0x64, 0x57, 0x74, 0x31, 0x59, 0x6d, 0x45, 0x77, 0x0a, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, 0x58, 0x45, 0x63, 0x76, 0x72, 0x59, 0x37, 0x56, 0x2b, 0x7a, 0x64, 0x42, 0x79, 0x72, 0x64, 0x4e, 0x78, 0x4a, 0x59, 0x45, 0x6d, 0x0a, 0x61, 0x41, 0x4e, 0x59, 0x55, 0x4f, 0x37, 0x76, 0x57, 0x34, 0x68, 0x64, 0x41, 0x35, 0x49, 0x42, 0x49, 0x46, 0x6d, 0x4d, 0x70, 0x6e, 0x62, 0x79, 0x69, 0x4e, 0x6e, 0x5a, 0x77, 0x36, 0x57, 0x39, 0x6f, 0x61, 0x67, 0x78, 0x33, 0x5a, 0x49, 0x65, 0x65, 0x48, 0x56, 0x59, 0x62, 0x52, 0x69, 0x4b, 0x36, 0x41, 0x66, 0x46, 0x74, 0x53, 0x31, 0x32, 0x2b, 0x45, 0x31, 0x4d, 0x59, 0x31, 0x64, 0x32, 0x0a, 0x61, 0x71, 0x51, 0x31, 0x53, 0x72, 0x49, 0x43, 0x39, 0x51, 0x35, 0x55, 0x6e, 0x5a, 0x61, 0x42, 0x72, 0x62, 0x57, 0x32, 0x32, 0x6d, 0x4e, 0x75, 0x6c, 0x4d, 0x34, 0x2f, 0x6c, 0x49, 0x4a, 0x72, 0x48, 0x70, 0x51, 0x55, 0x68, 0x50, 0x78, 0x6f, 0x62, 0x79, 0x34, 0x2f, 0x36, 0x4e, 0x41, 0x37, 0x71, 0x4b, 0x67, 0x55, 0x48, 0x69, 0x79, 0x4f, 0x64, 0x33, 0x4a, 0x42, 0x70, 0x4f, 0x66, 0x77, 0x0a, 0x38, 0x54, 0x76, 0x53, 0x74, 0x51, 0x78, 0x34, 0x4c, 0x38, 0x59, 0x64, 0x4b, 0x51, 0x35, 0x68, 0x74, 0x7a, 0x6b, 0x32, 0x68, 0x70, 0x52, 0x4a, 0x4c, 0x30, 0x6c, 0x4b, 0x67, 0x47, 0x31, 0x57, 0x34, 0x75, 0x4b, 0x32, 0x39, 0x39, 0x42, 0x74, 0x7a, 0x64, 0x41, 0x67, 0x66, 0x42, 0x76, 0x43, 0x54, 0x33, 0x41, 0x31, 0x61, 0x53, 0x70, 0x6a, 0x49, 0x47, 0x74, 0x6e, 0x69, 0x72, 0x49, 0x31, 0x0a, 0x46, 0x4c, 0x52, 0x58, 0x47, 0x79, 0x38, 0x31, 0x31, 0x57, 0x4a, 0x39, 0x4a, 0x68, 0x68, 0x34, 0x41, 0x4b, 0x4c, 0x66, 0x79, 0x56, 0x70, 0x42, 0x4a, 0x67, 0x65, 0x34, 0x73, 0x56, 0x72, 0x36, 0x4e, 0x75, 0x75, 0x49, 0x66, 0x32, 0x71, 0x47, 0x31, 0x6f, 0x79, 0x31, 0x30, 0x70, 0x61, 0x51, 0x4e, 0x65, 0x71, 0x32, 0x33, 0x55, 0x47, 0x61, 0x59, 0x74, 0x2f, 0x7a, 0x55, 0x56, 0x4a, 0x77, 0x0a, 0x55, 0x74, 0x30, 0x57, 0x45, 0x6b, 0x58, 0x38, 0x48, 0x4f, 0x63, 0x62, 0x33, 0x75, 0x49, 0x6f, 0x54, 0x6d, 0x61, 0x4f, 0x34, 0x72, 0x48, 0x42, 0x55, 0x4a, 0x71, 0x45, 0x79, 0x39, 0x51, 0x58, 0x7a, 0x53, 0x57, 0x77, 0x43, 0x35, 0x78, 0x45, 0x43, 0x64, 0x37, 0x43, 0x4a, 0x53, 0x53, 0x68, 0x31, 0x30, 0x4f, 0x75, 0x6e, 0x6c, 0x75, 0x4c, 0x32, 0x4d, 0x47, 0x65, 0x5a, 0x47, 0x6e, 0x76, 0x0a, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x59, 0x59, 0x77, 0x67, 0x59, 0x4d, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4c, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x66, 0x59, 0x77, 0x59, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6c, 0x0a, 0x42, 0x46, 0x77, 0x77, 0x57, 0x67, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x45, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x43, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x41, 0x77, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x51, 0x47, 0x43, 0x43, 0x73, 0x47, 0x0a, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x46, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x42, 0x67, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x63, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x49, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x43, 0x54, 0x41, 0x4e, 0x0a, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x46, 0x6d, 0x34, 0x37, 0x47, 0x55, 0x70, 0x50, 0x57, 0x35, 0x2b, 0x37, 0x69, 0x46, 0x74, 0x69, 0x6c, 0x6f, 0x6b, 0x35, 0x32, 0x49, 0x6f, 0x54, 0x57, 0x72, 0x74, 0x46, 0x67, 0x32, 0x79, 0x69, 0x36, 0x6b, 0x49, 0x32, 0x69, 0x52, 0x4e, 0x51, 0x0a, 0x4b, 0x75, 0x67, 0x48, 0x55, 0x49, 0x4f, 0x34, 0x4b, 0x53, 0x71, 0x4a, 0x56, 0x42, 0x50, 0x38, 0x61, 0x4b, 0x4f, 0x61, 0x54, 0x5a, 0x47, 0x45, 0x31, 0x4b, 0x4d, 0x68, 0x2f, 0x59, 0x6a, 0x68, 0x36, 0x71, 0x2f, 0x67, 0x50, 0x61, 0x6c, 0x67, 0x64, 0x2f, 0x38, 0x44, 0x6d, 0x72, 0x78, 0x53, 0x4a, 0x6d, 0x55, 0x78, 0x33, 0x62, 0x4e, 0x62, 0x38, 0x52, 0x59, 0x36, 0x70, 0x4b, 0x7a, 0x74, 0x0a, 0x5a, 0x64, 0x75, 0x53, 0x61, 0x53, 0x2b, 0x57, 0x55, 0x30, 0x59, 0x74, 0x2b, 0x6c, 0x47, 0x35, 0x76, 0x56, 0x67, 0x61, 0x70, 0x48, 0x45, 0x71, 0x36, 0x79, 0x71, 0x4c, 0x62, 0x65, 0x56, 0x78, 0x51, 0x4c, 0x75, 0x62, 0x54, 0x69, 0x6e, 0x4f, 0x66, 0x56, 0x56, 0x5a, 0x58, 0x79, 0x45, 0x43, 0x59, 0x47, 0x4d, 0x73, 0x59, 0x71, 0x65, 0x6e, 0x4a, 0x6a, 0x4e, 0x63, 0x62, 0x49, 0x5a, 0x4e, 0x0a, 0x79, 0x4d, 0x75, 0x72, 0x46, 0x63, 0x67, 0x30, 0x34, 0x36, 0x4f, 0x34, 0x59, 0x79, 0x68, 0x56, 0x79, 0x71, 0x53, 0x69, 0x74, 0x43, 0x59, 0x37, 0x68, 0x2f, 0x65, 0x71, 0x67, 0x6b, 0x50, 0x4a, 0x51, 0x30, 0x68, 0x6b, 0x70, 0x39, 0x45, 0x64, 0x51, 0x77, 0x62, 0x6e, 0x38, 0x56, 0x6c, 0x66, 0x78, 0x64, 0x42, 0x58, 0x77, 0x51, 0x34, 0x4e, 0x48, 0x4b, 0x30, 0x4a, 0x56, 0x46, 0x2f, 0x33, 0x0a, 0x71, 0x48, 0x61, 0x68, 0x4e, 0x48, 0x4f, 0x35, 0x64, 0x62, 0x4a, 0x5a, 0x57, 0x59, 0x41, 0x62, 0x42, 0x44, 0x70, 0x32, 0x51, 0x45, 0x53, 0x70, 0x76, 0x6f, 0x2b, 0x38, 0x33, 0x6c, 0x68, 0x34, 0x64, 0x6e, 0x58, 0x6a, 0x46, 0x58, 0x4d, 0x43, 0x48, 0x76, 0x52, 0x68, 0x35, 0x31, 0x79, 0x2f, 0x54, 0x71, 0x79, 0x42, 0x34, 0x56, 0x76, 0x72, 0x52, 0x4b, 0x49, 0x4b, 0x74, 0x54, 0x6f, 0x7a, 0x0a, 0x5a, 0x6a, 0x48, 0x59, 0x49, 0x63, 0x62, 0x6a, 0x76, 0x53, 0x58, 0x4d, 0x7a, 0x61, 0x44, 0x50, 0x6a, 0x50, 0x63, 0x5a, 0x47, 0x6a, 0x42, 0x4a, 0x6c, 0x47, 0x36, 0x43, 0x76, 0x44, 0x34, 0x4c, 0x6d, 0x59, 0x7a, 0x72, 0x6b, 0x48, 0x34, 0x31, 0x63, 0x7a, 0x72, 0x34, 0x57, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,])
  1332. });
  1333. return [4 /*yield*/, api.AddCa(in_rpc_hub_add_ca)];
  1334. case 1:
  1335. out_rpc_hub_add_ca = _a.sent();
  1336. console.log(out_rpc_hub_add_ca);
  1337. console.log("End: Test_AddCa");
  1338. console.log("-----");
  1339. console.log();
  1340. return [2 /*return*/];
  1341. }
  1342. });
  1343. });
  1344. }
  1345. /** API test for 'EnumCa', Enumerate CA(Certificate Authority) in the hub */
  1346. function Test_EnumCa() {
  1347. return __awaiter(this, void 0, void 0, function () {
  1348. var in_rpc_hub_enum_ca, out_rpc_hub_enum_ca;
  1349. return __generator(this, function (_a) {
  1350. switch (_a.label) {
  1351. case 0:
  1352. console.log("Begin: Test_EnumCa");
  1353. in_rpc_hub_enum_ca = new VPN.VpnRpcHubEnumCA({
  1354. HubName_str: hub_name
  1355. });
  1356. return [4 /*yield*/, api.EnumCa(in_rpc_hub_enum_ca)];
  1357. case 1:
  1358. out_rpc_hub_enum_ca = _a.sent();
  1359. console.log(out_rpc_hub_enum_ca);
  1360. console.log("End: Test_EnumCa");
  1361. console.log("-----");
  1362. console.log();
  1363. return [2 /*return*/, out_rpc_hub_enum_ca];
  1364. }
  1365. });
  1366. });
  1367. }
  1368. /** API test for 'GetCa', Get CA(Certificate Authority) setting from the hub */
  1369. function Test_GetCa(key) {
  1370. return __awaiter(this, void 0, void 0, function () {
  1371. var in_rpc_hub_get_ca, out_rpc_hub_get_ca;
  1372. return __generator(this, function (_a) {
  1373. switch (_a.label) {
  1374. case 0:
  1375. console.log("Begin: Test_GetCa");
  1376. in_rpc_hub_get_ca = new VPN.VpnRpcHubGetCA({
  1377. HubName_str: hub_name,
  1378. Key_u32: key
  1379. });
  1380. return [4 /*yield*/, api.GetCa(in_rpc_hub_get_ca)];
  1381. case 1:
  1382. out_rpc_hub_get_ca = _a.sent();
  1383. console.log(out_rpc_hub_get_ca);
  1384. console.log("End: Test_GetCa");
  1385. console.log("-----");
  1386. console.log();
  1387. return [2 /*return*/];
  1388. }
  1389. });
  1390. });
  1391. }
  1392. /** API test for 'DeleteCa', Delete a CA(Certificate Authority) setting from the hub */
  1393. function Test_DeleteCa(key) {
  1394. return __awaiter(this, void 0, void 0, function () {
  1395. var in_rpc_hub_delete_ca, out_rpc_hub_delete_ca;
  1396. return __generator(this, function (_a) {
  1397. switch (_a.label) {
  1398. case 0:
  1399. console.log("Begin: Test_DeleteCa");
  1400. in_rpc_hub_delete_ca = new VPN.VpnRpcHubDeleteCA({
  1401. HubName_str: hub_name,
  1402. Key_u32: key
  1403. });
  1404. return [4 /*yield*/, api.DeleteCa(in_rpc_hub_delete_ca)];
  1405. case 1:
  1406. out_rpc_hub_delete_ca = _a.sent();
  1407. console.log(out_rpc_hub_delete_ca);
  1408. console.log("End: Test_DeleteCa");
  1409. console.log("-----");
  1410. console.log();
  1411. return [2 /*return*/];
  1412. }
  1413. });
  1414. });
  1415. }
  1416. /** API test for 'SetLinkOnline', Make a link into on-line */
  1417. function Test_SetLinkOnline() {
  1418. return __awaiter(this, void 0, void 0, function () {
  1419. var in_rpc_link, out_rpc_link;
  1420. return __generator(this, function (_a) {
  1421. switch (_a.label) {
  1422. case 0:
  1423. console.log("Begin: Test_SetLinkOnline");
  1424. in_rpc_link = new VPN.VpnRpcLink({
  1425. HubName_str: hub_name,
  1426. AccountName_utf: "linktest"
  1427. });
  1428. return [4 /*yield*/, api.SetLinkOnline(in_rpc_link)];
  1429. case 1:
  1430. out_rpc_link = _a.sent();
  1431. console.log(out_rpc_link);
  1432. console.log("End: Test_SetLinkOnline");
  1433. console.log("-----");
  1434. console.log();
  1435. return [2 /*return*/];
  1436. }
  1437. });
  1438. });
  1439. }
  1440. /** API test for 'SetLinkOffline', Make a link into off-line */
  1441. function Test_SetLinkOffline() {
  1442. return __awaiter(this, void 0, void 0, function () {
  1443. var in_rpc_link, out_rpc_link;
  1444. return __generator(this, function (_a) {
  1445. switch (_a.label) {
  1446. case 0:
  1447. console.log("Begin: Test_SetLinkOffline");
  1448. in_rpc_link = new VPN.VpnRpcLink({
  1449. HubName_str: hub_name,
  1450. AccountName_utf: "linktest"
  1451. });
  1452. return [4 /*yield*/, api.SetLinkOffline(in_rpc_link)];
  1453. case 1:
  1454. out_rpc_link = _a.sent();
  1455. console.log(out_rpc_link);
  1456. console.log("End: Test_SetLinkOffline");
  1457. console.log("-----");
  1458. console.log();
  1459. return [2 /*return*/];
  1460. }
  1461. });
  1462. });
  1463. }
  1464. /** API test for 'DeleteLink', Delete a link */
  1465. function Test_DeleteLink() {
  1466. return __awaiter(this, void 0, void 0, function () {
  1467. var in_rpc_link, out_rpc_link;
  1468. return __generator(this, function (_a) {
  1469. switch (_a.label) {
  1470. case 0:
  1471. console.log("Begin: Test_DeleteLink");
  1472. in_rpc_link = new VPN.VpnRpcLink({
  1473. HubName_str: hub_name,
  1474. AccountName_utf: "linktest2"
  1475. });
  1476. return [4 /*yield*/, api.DeleteLink(in_rpc_link)];
  1477. case 1:
  1478. out_rpc_link = _a.sent();
  1479. console.log(out_rpc_link);
  1480. console.log("End: Test_DeleteLink");
  1481. console.log("-----");
  1482. console.log();
  1483. return [2 /*return*/];
  1484. }
  1485. });
  1486. });
  1487. }
  1488. /** API test for 'RenameLink', Rename link (cascade connection) */
  1489. function Test_RenameLink() {
  1490. return __awaiter(this, void 0, void 0, function () {
  1491. var in_rpc_rename_link, out_rpc_rename_link;
  1492. return __generator(this, function (_a) {
  1493. switch (_a.label) {
  1494. case 0:
  1495. console.log("Begin: Test_RenameLink");
  1496. in_rpc_rename_link = new VPN.VpnRpcRenameLink({
  1497. HubName_str: hub_name,
  1498. OldAccountName_utf: "linktest",
  1499. NewAccountName_utf: "linktest2"
  1500. });
  1501. return [4 /*yield*/, api.RenameLink(in_rpc_rename_link)];
  1502. case 1:
  1503. out_rpc_rename_link = _a.sent();
  1504. console.log(out_rpc_rename_link);
  1505. console.log("End: Test_RenameLink");
  1506. console.log("-----");
  1507. console.log();
  1508. return [2 /*return*/];
  1509. }
  1510. });
  1511. });
  1512. }
  1513. /** API test for 'CreateLink', Create a new link(cascade) */
  1514. function Test_CreateLink() {
  1515. return __awaiter(this, void 0, void 0, function () {
  1516. var _a, in_rpc_create_link, out_rpc_create_link;
  1517. return __generator(this, function (_b) {
  1518. switch (_b.label) {
  1519. case 0:
  1520. console.log("Begin: Test_CreateLink");
  1521. in_rpc_create_link = new VPN.VpnRpcCreateLink((_a = {
  1522. HubName_Ex_str: hub_name,
  1523. CheckServerCert_bool: false,
  1524. AccountName_utf: "linktest",
  1525. Hostname_str: "1.2.3.4",
  1526. Port_u32: 443,
  1527. ProxyType_u32: 0,
  1528. HubName_str: "ABC",
  1529. MaxConnection_u32: 16,
  1530. UseEncrypt_bool: true,
  1531. UseCompress_bool: false,
  1532. HalfConnection_bool: true,
  1533. AdditionalConnectionInterval_u32: 2,
  1534. ConnectionDisconnectSpan_u32: 24,
  1535. AuthType_u32: VPN.VpnRpcClientAuthType.PlainPassword,
  1536. Username_str: "181012",
  1537. PlainPassword_str: "microsoft",
  1538. HashedPassword_bin: new Uint8Array([]),
  1539. ClientX_bin: new Uint8Array([]),
  1540. ClientK_bin: new Uint8Array([])
  1541. },
  1542. _a["policy:DHCPFilter_bool"] = true,
  1543. _a["policy:DHCPNoServer_bool"] = true,
  1544. _a["policy:DHCPForce_bool"] = true,
  1545. _a.SecPol_CheckMac_bool = true,
  1546. _a.SecPol_CheckIP_bool = true,
  1547. _a["policy:ArpDhcpOnly_bool"] = true,
  1548. _a["policy:PrivacyFilter_bool"] = true,
  1549. _a["policy:NoServer_bool"] = true,
  1550. _a["policy:NoBroadcastLimiter_bool"] = true,
  1551. _a["policy:MaxMac_u32"] = 32,
  1552. _a["policy:MaxIP_u32"] = 64,
  1553. _a["policy:MaxUpload_u32"] = 960000,
  1554. _a["policy:MaxDownload_u32"] = 1280000,
  1555. _a["policy:RSandRAFilter_bool"] = true,
  1556. _a.SecPol_RAFilter_bool = true,
  1557. _a["policy:DHCPv6Filter_bool"] = true,
  1558. _a["policy:DHCPv6NoServer_bool"] = true,
  1559. _a.SecPol_CheckIPv6_bool = true,
  1560. _a["policy:NoServerV6_bool"] = true,
  1561. _a["policy:MaxIPv6_u32"] = 127,
  1562. _a["policy:FilterIPv4_bool"] = true,
  1563. _a["policy:FilterIPv6_bool"] = true,
  1564. _a["policy:FilterNonIP_bool"] = true,
  1565. _a["policy:NoIPv6DefaultRouterInRA_bool"] = true,
  1566. _a["policy:VLanId_u32"] = 123,
  1567. _a["policy:Ver3_bool"] = true,
  1568. _a));
  1569. return [4 /*yield*/, api.CreateLink(in_rpc_create_link)];
  1570. case 1:
  1571. out_rpc_create_link = _b.sent();
  1572. console.log(out_rpc_create_link);
  1573. console.log("End: Test_CreateLink");
  1574. console.log("-----");
  1575. console.log();
  1576. return [2 /*return*/];
  1577. }
  1578. });
  1579. });
  1580. }
  1581. /** API test for 'GetLink', Get link configuration */
  1582. function Test_GetLink() {
  1583. return __awaiter(this, void 0, void 0, function () {
  1584. var in_rpc_create_link, out_rpc_create_link;
  1585. return __generator(this, function (_a) {
  1586. switch (_a.label) {
  1587. case 0:
  1588. console.log("Begin: Test_GetLink");
  1589. in_rpc_create_link = new VPN.VpnRpcCreateLink({
  1590. HubName_Ex_str: hub_name,
  1591. AccountName_utf: "linktest"
  1592. });
  1593. return [4 /*yield*/, api.GetLink(in_rpc_create_link)];
  1594. case 1:
  1595. out_rpc_create_link = _a.sent();
  1596. console.log(out_rpc_create_link);
  1597. console.log("End: Test_GetLink");
  1598. console.log("-----");
  1599. console.log();
  1600. return [2 /*return*/];
  1601. }
  1602. });
  1603. });
  1604. }
  1605. /** API test for 'SetLink', Set link configuration */
  1606. function Test_SetLink() {
  1607. return __awaiter(this, void 0, void 0, function () {
  1608. var _a, in_rpc_create_link, out_rpc_create_link;
  1609. return __generator(this, function (_b) {
  1610. switch (_b.label) {
  1611. case 0:
  1612. console.log("Begin: Test_SetLink");
  1613. in_rpc_create_link = new VPN.VpnRpcCreateLink((_a = {
  1614. HubName_Ex_str: hub_name,
  1615. CheckServerCert_bool: false,
  1616. AccountName_utf: "linktest",
  1617. Hostname_str: "1.2.3.4",
  1618. Port_u32: 443,
  1619. ProxyType_u32: 0,
  1620. HubName_str: "ABC",
  1621. MaxConnection_u32: 16,
  1622. UseEncrypt_bool: true,
  1623. UseCompress_bool: false,
  1624. HalfConnection_bool: true,
  1625. AdditionalConnectionInterval_u32: 2,
  1626. ConnectionDisconnectSpan_u32: 24,
  1627. AuthType_u32: VPN.VpnRpcClientAuthType.PlainPassword,
  1628. Username_str: "181012",
  1629. PlainPassword_str: "microsoft",
  1630. HashedPassword_bin: new Uint8Array([]),
  1631. ClientX_bin: new Uint8Array([]),
  1632. ClientK_bin: new Uint8Array([])
  1633. },
  1634. _a["policy:DHCPFilter_bool"] = true,
  1635. _a["policy:DHCPNoServer_bool"] = true,
  1636. _a["policy:DHCPForce_bool"] = true,
  1637. _a.SecPol_CheckMac_bool = true,
  1638. _a.SecPol_CheckIP_bool = true,
  1639. _a["policy:ArpDhcpOnly_bool"] = true,
  1640. _a["policy:PrivacyFilter_bool"] = true,
  1641. _a["policy:NoServer_bool"] = true,
  1642. _a["policy:NoBroadcastLimiter_bool"] = true,
  1643. _a["policy:MaxMac_u32"] = 32,
  1644. _a["policy:MaxIP_u32"] = 64,
  1645. _a["policy:MaxUpload_u32"] = 960000,
  1646. _a["policy:MaxDownload_u32"] = 1280000,
  1647. _a["policy:RSandRAFilter_bool"] = true,
  1648. _a.SecPol_RAFilter_bool = true,
  1649. _a["policy:DHCPv6Filter_bool"] = true,
  1650. _a["policy:DHCPv6NoServer_bool"] = true,
  1651. _a.SecPol_CheckIPv6_bool = true,
  1652. _a["policy:NoServerV6_bool"] = true,
  1653. _a["policy:MaxIPv6_u32"] = 127,
  1654. _a["policy:FilterIPv4_bool"] = true,
  1655. _a["policy:FilterIPv6_bool"] = true,
  1656. _a["policy:FilterNonIP_bool"] = true,
  1657. _a["policy:NoIPv6DefaultRouterInRA_bool"] = true,
  1658. _a["policy:VLanId_u32"] = 123,
  1659. _a["policy:Ver3_bool"] = true,
  1660. _a));
  1661. return [4 /*yield*/, api.SetLink(in_rpc_create_link)];
  1662. case 1:
  1663. out_rpc_create_link = _b.sent();
  1664. console.log(out_rpc_create_link);
  1665. console.log("End: Test_SetLink");
  1666. console.log("-----");
  1667. console.log();
  1668. return [2 /*return*/];
  1669. }
  1670. });
  1671. });
  1672. }
  1673. /** API test for 'EnumLink', Enumerate links */
  1674. function Test_EnumLink() {
  1675. return __awaiter(this, void 0, void 0, function () {
  1676. var in_rpc_enum_link, out_rpc_enum_link;
  1677. return __generator(this, function (_a) {
  1678. switch (_a.label) {
  1679. case 0:
  1680. console.log("Begin: Test_EnumLink");
  1681. in_rpc_enum_link = new VPN.VpnRpcEnumLink({
  1682. HubName_str: hub_name
  1683. });
  1684. return [4 /*yield*/, api.EnumLink(in_rpc_enum_link)];
  1685. case 1:
  1686. out_rpc_enum_link = _a.sent();
  1687. console.log(out_rpc_enum_link);
  1688. console.log("End: Test_EnumLink");
  1689. console.log("-----");
  1690. console.log();
  1691. return [2 /*return*/, out_rpc_enum_link];
  1692. }
  1693. });
  1694. });
  1695. }
  1696. /** API test for 'GetLinkStatus', Get link status */
  1697. function Test_GetLinkStatus(name) {
  1698. return __awaiter(this, void 0, void 0, function () {
  1699. var in_rpc_link_status, out_rpc_link_status;
  1700. return __generator(this, function (_a) {
  1701. switch (_a.label) {
  1702. case 0:
  1703. console.log("Begin: Test_GetLinkStatus");
  1704. in_rpc_link_status = new VPN.VpnRpcLinkStatus({
  1705. HubName_Ex_str: hub_name,
  1706. AccountName_utf: name
  1707. });
  1708. return [4 /*yield*/, api.GetLinkStatus(in_rpc_link_status)];
  1709. case 1:
  1710. out_rpc_link_status = _a.sent();
  1711. console.log(out_rpc_link_status);
  1712. console.log("End: Test_GetLinkStatus");
  1713. console.log("-----");
  1714. console.log();
  1715. return [2 /*return*/];
  1716. }
  1717. });
  1718. });
  1719. }
  1720. /** API test for 'AddAccess', Add access list entry */
  1721. function Test_AddAccess() {
  1722. return __awaiter(this, void 0, void 0, function () {
  1723. var in_rpc_add_access_ipv4, out_rpc_add_access_ipv4, in_rpc_add_access_ipv6, out_rpc_add_access_ipv6;
  1724. return __generator(this, function (_a) {
  1725. switch (_a.label) {
  1726. case 0:
  1727. console.log("Begin: Test_AddAccess");
  1728. in_rpc_add_access_ipv4 = new VPN.VpnRpcAddAccess({
  1729. HubName_str: hub_name,
  1730. AccessListSingle: [new VPN.VpnAccess({
  1731. Note_utf: "IPv4 Test",
  1732. Active_bool: true,
  1733. Priority_u32: 100,
  1734. Discard_bool: true,
  1735. IsIPv6_bool: false,
  1736. SrcIpAddress_ip: "192.168.0.0",
  1737. SrcSubnetMask_ip: "255.255.255.0",
  1738. DestIpAddress_ip: "10.0.0.0",
  1739. DestSubnetMask_ip: "255.255.0.0",
  1740. Protocol_u32: VPN.VpnIpProtocolNumber.TCP,
  1741. SrcPortStart_u32: 123,
  1742. SrcPortEnd_u32: 456,
  1743. DestPortStart_u32: 555,
  1744. DestPortEnd_u32: 666,
  1745. SrcUsername_str: "dnobori",
  1746. DestUsername_str: "nekosan",
  1747. CheckSrcMac_bool: true,
  1748. SrcMacAddress_bin: new Uint8Array([1, 2, 3, 0, 0, 0,]),
  1749. SrcMacMask_bin: new Uint8Array([255, 255, 255, 0, 0, 0,]),
  1750. CheckTcpState_bool: true,
  1751. Established_bool: true,
  1752. Delay_u32: 10,
  1753. Jitter_u32: 20,
  1754. Loss_u32: 30,
  1755. RedirectUrl_str: "aho"
  1756. }),]
  1757. });
  1758. return [4 /*yield*/, api.AddAccess(in_rpc_add_access_ipv4)];
  1759. case 1:
  1760. out_rpc_add_access_ipv4 = _a.sent();
  1761. in_rpc_add_access_ipv6 = new VPN.VpnRpcAddAccess({
  1762. HubName_str: hub_name,
  1763. AccessListSingle: [new VPN.VpnAccess({
  1764. Note_utf: "IPv6 Test",
  1765. Active_bool: true,
  1766. Priority_u32: 100,
  1767. Discard_bool: true,
  1768. IsIPv6_bool: true,
  1769. SrcIpAddress6_bin: new Uint8Array([0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]),
  1770. SrcSubnetMask6_bin: new Uint8Array([0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]),
  1771. Protocol_u32: VPN.VpnIpProtocolNumber.UDP,
  1772. SrcPortStart_u32: 123,
  1773. SrcPortEnd_u32: 456,
  1774. DestPortStart_u32: 555,
  1775. DestPortEnd_u32: 666,
  1776. SrcUsername_str: "dnobori",
  1777. DestUsername_str: "nekosan",
  1778. CheckSrcMac_bool: true,
  1779. SrcMacAddress_bin: new Uint8Array([1, 2, 3, 0, 0, 0,]),
  1780. SrcMacMask_bin: new Uint8Array([255, 255, 255, 0, 0, 0,]),
  1781. CheckTcpState_bool: true,
  1782. Established_bool: true,
  1783. Delay_u32: 10,
  1784. Jitter_u32: 20,
  1785. Loss_u32: 30,
  1786. RedirectUrl_str: "aho"
  1787. }),]
  1788. });
  1789. return [4 /*yield*/, api.AddAccess(in_rpc_add_access_ipv6)];
  1790. case 2:
  1791. out_rpc_add_access_ipv6 = _a.sent();
  1792. console.log("End: Test_AddAccess");
  1793. console.log("-----");
  1794. console.log();
  1795. return [2 /*return*/];
  1796. }
  1797. });
  1798. });
  1799. }
  1800. /** API test for 'DeleteAccess', Delete access list entry */
  1801. function Test_DeleteAccess() {
  1802. return __awaiter(this, void 0, void 0, function () {
  1803. var in_rpc_delete_access, out_rpc_delete_access;
  1804. return __generator(this, function (_a) {
  1805. switch (_a.label) {
  1806. case 0:
  1807. console.log("Begin: Test_DeleteAccess");
  1808. in_rpc_delete_access = new VPN.VpnRpcDeleteAccess({
  1809. HubName_str: hub_name,
  1810. Id_u32: 1
  1811. });
  1812. return [4 /*yield*/, api.DeleteAccess(in_rpc_delete_access)];
  1813. case 1:
  1814. out_rpc_delete_access = _a.sent();
  1815. console.log(out_rpc_delete_access);
  1816. console.log("End: Test_DeleteAccess");
  1817. console.log("-----");
  1818. console.log();
  1819. return [2 /*return*/];
  1820. }
  1821. });
  1822. });
  1823. }
  1824. /** API test for 'EnumAccess', Get access list */
  1825. function Test_EnumAccess() {
  1826. return __awaiter(this, void 0, void 0, function () {
  1827. var in_rpc_enum_access_list, out_rpc_enum_access_list;
  1828. return __generator(this, function (_a) {
  1829. switch (_a.label) {
  1830. case 0:
  1831. console.log("Begin: Test_EnumAccess");
  1832. in_rpc_enum_access_list = new VPN.VpnRpcEnumAccessList({
  1833. HubName_str: hub_name
  1834. });
  1835. return [4 /*yield*/, api.EnumAccess(in_rpc_enum_access_list)];
  1836. case 1:
  1837. out_rpc_enum_access_list = _a.sent();
  1838. console.log(out_rpc_enum_access_list);
  1839. console.log("End: Test_EnumAccess");
  1840. console.log("-----");
  1841. console.log();
  1842. return [2 /*return*/];
  1843. }
  1844. });
  1845. });
  1846. }
  1847. /** API test for 'SetAccessList', Set access list */
  1848. function Test_SetAccessList() {
  1849. return __awaiter(this, void 0, void 0, function () {
  1850. var in_rpc_enum_access_list, out_rpc_enum_access_list;
  1851. return __generator(this, function (_a) {
  1852. switch (_a.label) {
  1853. case 0:
  1854. console.log("Begin: Test_SetAccessList");
  1855. in_rpc_enum_access_list = new VPN.VpnRpcEnumAccessList({
  1856. HubName_str: hub_name,
  1857. AccessList: [new VPN.VpnAccess({
  1858. Note_utf: "IPv4 Test 2",
  1859. Active_bool: true,
  1860. Priority_u32: 100,
  1861. Discard_bool: true,
  1862. IsIPv6_bool: false,
  1863. SrcIpAddress_ip: "192.168.0.0",
  1864. SrcSubnetMask_ip: "255.255.255.0",
  1865. DestIpAddress_ip: "10.0.0.0",
  1866. DestSubnetMask_ip: "255.255.0.0",
  1867. Protocol_u32: VPN.VpnIpProtocolNumber.TCP,
  1868. SrcPortStart_u32: 123,
  1869. SrcPortEnd_u32: 456,
  1870. DestPortStart_u32: 555,
  1871. DestPortEnd_u32: 666,
  1872. SrcUsername_str: "dnobori",
  1873. DestUsername_str: "nekosan",
  1874. CheckSrcMac_bool: true,
  1875. SrcMacAddress_bin: new Uint8Array([1, 2, 3, 0, 0, 0,]),
  1876. SrcMacMask_bin: new Uint8Array([255, 255, 255, 0, 0, 0,]),
  1877. CheckTcpState_bool: true,
  1878. Established_bool: true,
  1879. Delay_u32: 10,
  1880. Jitter_u32: 20,
  1881. Loss_u32: 30,
  1882. RedirectUrl_str: "aho"
  1883. }), new VPN.VpnAccess({
  1884. Note_utf: "IPv6 Test 2",
  1885. Active_bool: true,
  1886. Priority_u32: 100,
  1887. Discard_bool: true,
  1888. IsIPv6_bool: true,
  1889. SrcIpAddress6_bin: new Uint8Array([0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]),
  1890. SrcSubnetMask6_bin: new Uint8Array([0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]),
  1891. Protocol_u32: VPN.VpnIpProtocolNumber.UDP,
  1892. SrcPortStart_u32: 123,
  1893. SrcPortEnd_u32: 456,
  1894. DestPortStart_u32: 555,
  1895. DestPortEnd_u32: 666,
  1896. SrcUsername_str: "dnobori",
  1897. DestUsername_str: "nekosan",
  1898. CheckSrcMac_bool: true,
  1899. SrcMacAddress_bin: new Uint8Array([1, 2, 3, 0, 0, 0,]),
  1900. SrcMacMask_bin: new Uint8Array([255, 255, 255, 0, 0, 0,]),
  1901. CheckTcpState_bool: true,
  1902. Established_bool: true,
  1903. Delay_u32: 10,
  1904. Jitter_u32: 20,
  1905. Loss_u32: 30,
  1906. RedirectUrl_str: "aho"
  1907. }),]
  1908. });
  1909. return [4 /*yield*/, api.SetAccessList(in_rpc_enum_access_list)];
  1910. case 1:
  1911. out_rpc_enum_access_list = _a.sent();
  1912. console.log(out_rpc_enum_access_list);
  1913. console.log("End: Test_SetAccessList");
  1914. console.log("-----");
  1915. console.log();
  1916. return [2 /*return*/];
  1917. }
  1918. });
  1919. });
  1920. }
  1921. /** API test for 'CreateUser', Create a user */
  1922. function Test_CreateUser() {
  1923. return __awaiter(this, void 0, void 0, function () {
  1924. var _a, in_rpc_set_user, out_rpc_set_user;
  1925. return __generator(this, function (_b) {
  1926. switch (_b.label) {
  1927. case 0:
  1928. console.log("Begin: Test_CreateUser");
  1929. in_rpc_set_user = new VPN.VpnRpcSetUser((_a = {
  1930. HubName_str: hub_name,
  1931. Name_str: "test1",
  1932. Realname_utf: "Cat man",
  1933. Note_utf: "Hey!!!",
  1934. AuthType_u32: VPN.VpnRpcUserAuthType.Password,
  1935. Auth_Password_str: "microsoft",
  1936. UserX_bin: new Uint8Array([]),
  1937. Serial_bin: new Uint8Array([]),
  1938. CommonName_utf: "",
  1939. RadiusUsername_utf: "",
  1940. NtUsername_utf: "",
  1941. ExpireTime_dt: new Date(2019, 1, 1),
  1942. UsePolicy_bool: true
  1943. },
  1944. _a["policy:Access_bool"] = true,
  1945. _a["policy:DHCPFilter_bool"] = false,
  1946. _a["policy:DHCPNoServer_bool"] = true,
  1947. _a["policy:DHCPForce_bool"] = false,
  1948. _a["policy:NoBridge_bool"] = false,
  1949. _a["policy:NoRouting_bool"] = false,
  1950. _a["policy:CheckMac_bool"] = false,
  1951. _a["policy:CheckIP_bool"] = false,
  1952. _a["policy:ArpDhcpOnly_bool"] = false,
  1953. _a["policy:PrivacyFilter_bool"] = false,
  1954. _a["policy:NoServer_bool"] = false,
  1955. _a["policy:NoBroadcastLimiter_bool"] = false,
  1956. _a["policy:MonitorPort_bool"] = false,
  1957. _a["policy:MaxConnection_u32"] = 32,
  1958. _a["policy:TimeOut_u32"] = 15,
  1959. _a["policy:MaxMac_u32"] = 1000,
  1960. _a["policy:MaxIP_u32"] = 1000,
  1961. _a["policy:MaxUpload_u32"] = 1000000000,
  1962. _a["policy:MaxDownload_u32"] = 1000000000,
  1963. _a["policy:FixPassword_bool"] = false,
  1964. _a["policy:MultiLogins_u32"] = 1000,
  1965. _a["policy:NoQoS_bool"] = false,
  1966. _a["policy:RSandRAFilter_bool"] = false,
  1967. _a["policy:RAFilter_bool"] = false,
  1968. _a["policy:DHCPv6Filter_bool"] = false,
  1969. _a["policy:DHCPv6NoServer_bool"] = false,
  1970. _a["policy:NoRoutingV6_bool"] = false,
  1971. _a["policy:CheckIPv6_bool"] = false,
  1972. _a["policy:NoServerV6_bool"] = false,
  1973. _a["policy:MaxIPv6_u32"] = 1234,
  1974. _a["policy:NoSavePassword_bool"] = false,
  1975. _a["policy:AutoDisconnect_u32"] = 0,
  1976. _a["policy:FilterIPv4_bool"] = false,
  1977. _a["policy:FilterIPv6_bool"] = false,
  1978. _a["policy:FilterNonIP_bool"] = false,
  1979. _a["policy:NoIPv6DefaultRouterInRA_bool"] = false,
  1980. _a["policy:NoIPv6DefaultRouterInRAWhenIPv6_bool"] = false,
  1981. _a["policy:VLanId_u32"] = 0,
  1982. _a["policy:Ver3_bool"] = true,
  1983. _a));
  1984. return [4 /*yield*/, api.CreateUser(in_rpc_set_user)];
  1985. case 1:
  1986. out_rpc_set_user = _b.sent();
  1987. console.log("End: Test_CreateUser");
  1988. console.log("-----");
  1989. console.log();
  1990. return [2 /*return*/];
  1991. }
  1992. });
  1993. });
  1994. }
  1995. /** API test for 'SetUser', Set user setting */
  1996. function Test_SetUser() {
  1997. return __awaiter(this, void 0, void 0, function () {
  1998. var _a, in_rpc_set_user, out_rpc_set_user;
  1999. return __generator(this, function (_b) {
  2000. switch (_b.label) {
  2001. case 0:
  2002. console.log("Begin: Test_SetUser");
  2003. in_rpc_set_user = new VPN.VpnRpcSetUser((_a = {
  2004. HubName_str: hub_name,
  2005. Name_str: "test1",
  2006. Realname_utf: "Cat man",
  2007. Note_utf: "Hey!!!",
  2008. GroupName_str: "group1",
  2009. AuthType_u32: VPN.VpnRpcUserAuthType.Anonymous,
  2010. Auth_Password_str: "",
  2011. UserX_bin: new Uint8Array([]),
  2012. Serial_bin: new Uint8Array([]),
  2013. CommonName_utf: "",
  2014. RadiusUsername_utf: "",
  2015. NtUsername_utf: "",
  2016. ExpireTime_dt: new Date(2019, 1, 1),
  2017. UsePolicy_bool: true
  2018. },
  2019. _a["policy:Access_bool"] = true,
  2020. _a["policy:DHCPFilter_bool"] = false,
  2021. _a["policy:DHCPNoServer_bool"] = true,
  2022. _a["policy:DHCPForce_bool"] = false,
  2023. _a["policy:NoBridge_bool"] = false,
  2024. _a["policy:NoRouting_bool"] = false,
  2025. _a["policy:CheckMac_bool"] = false,
  2026. _a["policy:CheckIP_bool"] = false,
  2027. _a["policy:ArpDhcpOnly_bool"] = false,
  2028. _a["policy:PrivacyFilter_bool"] = false,
  2029. _a["policy:NoServer_bool"] = false,
  2030. _a["policy:NoBroadcastLimiter_bool"] = false,
  2031. _a["policy:MonitorPort_bool"] = false,
  2032. _a["policy:MaxConnection_u32"] = 32,
  2033. _a["policy:TimeOut_u32"] = 15,
  2034. _a["policy:MaxMac_u32"] = 1000,
  2035. _a["policy:MaxIP_u32"] = 1000,
  2036. _a["policy:MaxUpload_u32"] = 1000000000,
  2037. _a["policy:MaxDownload_u32"] = 1000000000,
  2038. _a["policy:FixPassword_bool"] = false,
  2039. _a["policy:MultiLogins_u32"] = 1000,
  2040. _a["policy:NoQoS_bool"] = false,
  2041. _a["policy:RSandRAFilter_bool"] = false,
  2042. _a["policy:RAFilter_bool"] = false,
  2043. _a["policy:DHCPv6Filter_bool"] = false,
  2044. _a["policy:DHCPv6NoServer_bool"] = false,
  2045. _a["policy:NoRoutingV6_bool"] = false,
  2046. _a["policy:CheckIPv6_bool"] = false,
  2047. _a["policy:NoServerV6_bool"] = false,
  2048. _a["policy:MaxIPv6_u32"] = 1234,
  2049. _a["policy:NoSavePassword_bool"] = false,
  2050. _a["policy:AutoDisconnect_u32"] = 0,
  2051. _a["policy:FilterIPv4_bool"] = false,
  2052. _a["policy:FilterIPv6_bool"] = false,
  2053. _a["policy:FilterNonIP_bool"] = false,
  2054. _a["policy:NoIPv6DefaultRouterInRA_bool"] = false,
  2055. _a["policy:NoIPv6DefaultRouterInRAWhenIPv6_bool"] = false,
  2056. _a["policy:VLanId_u32"] = 0,
  2057. _a["policy:Ver3_bool"] = true,
  2058. _a));
  2059. return [4 /*yield*/, api.SetUser(in_rpc_set_user)];
  2060. case 1:
  2061. out_rpc_set_user = _b.sent();
  2062. console.log("End: Test_SetUser");
  2063. console.log("-----");
  2064. console.log();
  2065. return [2 /*return*/];
  2066. }
  2067. });
  2068. });
  2069. }
  2070. /** API test for 'GetUser', Get user setting */
  2071. function Test_GetUser() {
  2072. return __awaiter(this, void 0, void 0, function () {
  2073. var in_rpc_set_user, out_rpc_set_user;
  2074. return __generator(this, function (_a) {
  2075. switch (_a.label) {
  2076. case 0:
  2077. console.log("Begin: Test_GetUser");
  2078. in_rpc_set_user = new VPN.VpnRpcSetUser({
  2079. HubName_str: hub_name,
  2080. Name_str: "test1"
  2081. });
  2082. return [4 /*yield*/, api.GetUser(in_rpc_set_user)];
  2083. case 1:
  2084. out_rpc_set_user = _a.sent();
  2085. console.log(out_rpc_set_user);
  2086. console.log("End: Test_GetUser");
  2087. console.log("-----");
  2088. console.log();
  2089. return [2 /*return*/];
  2090. }
  2091. });
  2092. });
  2093. }
  2094. /** API test for 'DeleteUser', Delete a user */
  2095. function Test_DeleteUser() {
  2096. return __awaiter(this, void 0, void 0, function () {
  2097. var in_rpc_delete_user, out_rpc_delete_user;
  2098. return __generator(this, function (_a) {
  2099. switch (_a.label) {
  2100. case 0:
  2101. console.log("Begin: Test_DeleteUser");
  2102. in_rpc_delete_user = new VPN.VpnRpcDeleteUser({
  2103. HubName_str: hub_name,
  2104. Name_str: "test1"
  2105. });
  2106. return [4 /*yield*/, api.DeleteUser(in_rpc_delete_user)];
  2107. case 1:
  2108. out_rpc_delete_user = _a.sent();
  2109. console.log("End: Test_DeleteUser");
  2110. console.log("-----");
  2111. console.log();
  2112. return [2 /*return*/];
  2113. }
  2114. });
  2115. });
  2116. }
  2117. /** API test for 'EnumUser', Enumerate users */
  2118. function Test_EnumUser() {
  2119. return __awaiter(this, void 0, void 0, function () {
  2120. var in_rpc_enum_user, out_rpc_enum_user;
  2121. return __generator(this, function (_a) {
  2122. switch (_a.label) {
  2123. case 0:
  2124. console.log("Begin: Test_EnumUser");
  2125. in_rpc_enum_user = new VPN.VpnRpcEnumUser({
  2126. HubName_str: hub_name
  2127. });
  2128. return [4 /*yield*/, api.EnumUser(in_rpc_enum_user)];
  2129. case 1:
  2130. out_rpc_enum_user = _a.sent();
  2131. console.log(out_rpc_enum_user);
  2132. console.log("End: Test_EnumUser");
  2133. console.log("-----");
  2134. console.log();
  2135. return [2 /*return*/];
  2136. }
  2137. });
  2138. });
  2139. }
  2140. /** API test for 'CreateGroup', Create a group */
  2141. function Test_CreateGroup() {
  2142. return __awaiter(this, void 0, void 0, function () {
  2143. var _a, in_rpc_set_group, out_rpc_set_group;
  2144. return __generator(this, function (_b) {
  2145. switch (_b.label) {
  2146. case 0:
  2147. console.log("Begin: Test_CreateGroup");
  2148. in_rpc_set_group = new VPN.VpnRpcSetGroup((_a = {
  2149. HubName_str: hub_name,
  2150. Name_str: "group1",
  2151. Realname_utf: "Cat group",
  2152. Note_utf: "This is it! This is it!!",
  2153. UsePolicy_bool: true
  2154. },
  2155. _a["policy:Access_bool"] = true,
  2156. _a["policy:DHCPFilter_bool"] = false,
  2157. _a["policy:DHCPNoServer_bool"] = true,
  2158. _a["policy:DHCPForce_bool"] = false,
  2159. _a["policy:NoBridge_bool"] = false,
  2160. _a["policy:NoRouting_bool"] = false,
  2161. _a["policy:CheckMac_bool"] = false,
  2162. _a["policy:CheckIP_bool"] = false,
  2163. _a["policy:ArpDhcpOnly_bool"] = false,
  2164. _a["policy:PrivacyFilter_bool"] = false,
  2165. _a["policy:NoServer_bool"] = false,
  2166. _a["policy:NoBroadcastLimiter_bool"] = false,
  2167. _a["policy:MonitorPort_bool"] = false,
  2168. _a["policy:MaxConnection_u32"] = 32,
  2169. _a["policy:TimeOut_u32"] = 15,
  2170. _a["policy:MaxMac_u32"] = 1000,
  2171. _a["policy:MaxIP_u32"] = 1000,
  2172. _a["policy:MaxUpload_u32"] = 1000000000,
  2173. _a["policy:MaxDownload_u32"] = 1000000000,
  2174. _a["policy:FixPassword_bool"] = false,
  2175. _a["policy:MultiLogins_u32"] = 1000,
  2176. _a["policy:NoQoS_bool"] = false,
  2177. _a["policy:RSandRAFilter_bool"] = false,
  2178. _a["policy:RAFilter_bool"] = false,
  2179. _a["policy:DHCPv6Filter_bool"] = false,
  2180. _a["policy:DHCPv6NoServer_bool"] = false,
  2181. _a["policy:NoRoutingV6_bool"] = false,
  2182. _a["policy:CheckIPv6_bool"] = false,
  2183. _a["policy:NoServerV6_bool"] = false,
  2184. _a["policy:MaxIPv6_u32"] = 1234,
  2185. _a["policy:NoSavePassword_bool"] = false,
  2186. _a["policy:AutoDisconnect_u32"] = 0,
  2187. _a["policy:FilterIPv4_bool"] = false,
  2188. _a["policy:FilterIPv6_bool"] = false,
  2189. _a["policy:FilterNonIP_bool"] = false,
  2190. _a["policy:NoIPv6DefaultRouterInRA_bool"] = false,
  2191. _a["policy:NoIPv6DefaultRouterInRAWhenIPv6_bool"] = false,
  2192. _a["policy:VLanId_u32"] = 0,
  2193. _a["policy:Ver3_bool"] = true,
  2194. _a));
  2195. return [4 /*yield*/, api.CreateGroup(in_rpc_set_group)];
  2196. case 1:
  2197. out_rpc_set_group = _b.sent();
  2198. console.log(out_rpc_set_group);
  2199. console.log("End: Test_CreateGroup");
  2200. console.log("-----");
  2201. console.log();
  2202. return [2 /*return*/];
  2203. }
  2204. });
  2205. });
  2206. }
  2207. /** API test for 'SetGroup', Set group setting */
  2208. function Test_SetGroup() {
  2209. return __awaiter(this, void 0, void 0, function () {
  2210. var _a, in_rpc_set_group, out_rpc_set_group;
  2211. return __generator(this, function (_b) {
  2212. switch (_b.label) {
  2213. case 0:
  2214. console.log("Begin: Test_SetGroup");
  2215. in_rpc_set_group = new VPN.VpnRpcSetGroup((_a = {
  2216. HubName_str: hub_name,
  2217. Name_str: "group1",
  2218. Realname_utf: "Cat group 2",
  2219. Note_utf: "This is it! This is it!! 2",
  2220. UsePolicy_bool: true
  2221. },
  2222. _a["policy:Access_bool"] = true,
  2223. _a["policy:DHCPFilter_bool"] = false,
  2224. _a["policy:DHCPNoServer_bool"] = true,
  2225. _a["policy:DHCPForce_bool"] = false,
  2226. _a["policy:NoBridge_bool"] = false,
  2227. _a["policy:NoRouting_bool"] = false,
  2228. _a["policy:CheckMac_bool"] = false,
  2229. _a["policy:CheckIP_bool"] = false,
  2230. _a["policy:ArpDhcpOnly_bool"] = false,
  2231. _a["policy:PrivacyFilter_bool"] = false,
  2232. _a["policy:NoServer_bool"] = false,
  2233. _a["policy:NoBroadcastLimiter_bool"] = false,
  2234. _a["policy:MonitorPort_bool"] = false,
  2235. _a["policy:MaxConnection_u32"] = 32,
  2236. _a["policy:TimeOut_u32"] = 15,
  2237. _a["policy:MaxMac_u32"] = 1000,
  2238. _a["policy:MaxIP_u32"] = 1000,
  2239. _a["policy:MaxUpload_u32"] = 1000000000,
  2240. _a["policy:MaxDownload_u32"] = 1000000000,
  2241. _a["policy:FixPassword_bool"] = false,
  2242. _a["policy:MultiLogins_u32"] = 1000,
  2243. _a["policy:NoQoS_bool"] = false,
  2244. _a["policy:RSandRAFilter_bool"] = false,
  2245. _a["policy:RAFilter_bool"] = false,
  2246. _a["policy:DHCPv6Filter_bool"] = false,
  2247. _a["policy:DHCPv6NoServer_bool"] = false,
  2248. _a["policy:NoRoutingV6_bool"] = false,
  2249. _a["policy:CheckIPv6_bool"] = false,
  2250. _a["policy:NoServerV6_bool"] = false,
  2251. _a["policy:MaxIPv6_u32"] = 1234,
  2252. _a["policy:NoSavePassword_bool"] = false,
  2253. _a["policy:AutoDisconnect_u32"] = 0,
  2254. _a["policy:FilterIPv4_bool"] = false,
  2255. _a["policy:FilterIPv6_bool"] = false,
  2256. _a["policy:FilterNonIP_bool"] = false,
  2257. _a["policy:NoIPv6DefaultRouterInRA_bool"] = false,
  2258. _a["policy:NoIPv6DefaultRouterInRAWhenIPv6_bool"] = false,
  2259. _a["policy:VLanId_u32"] = 0,
  2260. _a["policy:Ver3_bool"] = true,
  2261. _a));
  2262. return [4 /*yield*/, api.SetGroup(in_rpc_set_group)];
  2263. case 1:
  2264. out_rpc_set_group = _b.sent();
  2265. console.log(out_rpc_set_group);
  2266. console.log("End: Test_SetGroup");
  2267. console.log("-----");
  2268. console.log();
  2269. return [2 /*return*/];
  2270. }
  2271. });
  2272. });
  2273. }
  2274. /** API test for 'GetGroup', Get group information */
  2275. function Test_GetGroup() {
  2276. return __awaiter(this, void 0, void 0, function () {
  2277. var in_rpc_set_group, out_rpc_set_group;
  2278. return __generator(this, function (_a) {
  2279. switch (_a.label) {
  2280. case 0:
  2281. console.log("Begin: Test_GetGroup");
  2282. in_rpc_set_group = new VPN.VpnRpcSetGroup({
  2283. HubName_str: hub_name,
  2284. Name_str: "group1"
  2285. });
  2286. return [4 /*yield*/, api.GetGroup(in_rpc_set_group)];
  2287. case 1:
  2288. out_rpc_set_group = _a.sent();
  2289. console.log(out_rpc_set_group);
  2290. console.log("End: Test_GetGroup");
  2291. console.log("-----");
  2292. console.log();
  2293. return [2 /*return*/];
  2294. }
  2295. });
  2296. });
  2297. }
  2298. /** API test for 'DeleteGroup', Delete a group */
  2299. function Test_DeleteGroup() {
  2300. return __awaiter(this, void 0, void 0, function () {
  2301. var in_rpc_delete_user, out_rpc_delete_user;
  2302. return __generator(this, function (_a) {
  2303. switch (_a.label) {
  2304. case 0:
  2305. console.log("Begin: Test_DeleteGroup");
  2306. in_rpc_delete_user = new VPN.VpnRpcDeleteUser({
  2307. HubName_str: hub_name,
  2308. Name_str: "group1"
  2309. });
  2310. return [4 /*yield*/, api.DeleteGroup(in_rpc_delete_user)];
  2311. case 1:
  2312. out_rpc_delete_user = _a.sent();
  2313. console.log(out_rpc_delete_user);
  2314. console.log("End: Test_DeleteGroup");
  2315. console.log("-----");
  2316. console.log();
  2317. return [2 /*return*/];
  2318. }
  2319. });
  2320. });
  2321. }
  2322. /** API test for 'EnumGroup', Enumerate groups */
  2323. function Test_EnumGroup() {
  2324. return __awaiter(this, void 0, void 0, function () {
  2325. var in_rpc_enum_group, out_rpc_enum_group;
  2326. return __generator(this, function (_a) {
  2327. switch (_a.label) {
  2328. case 0:
  2329. console.log("Begin: Test_EnumGroup");
  2330. in_rpc_enum_group = new VPN.VpnRpcEnumGroup({
  2331. HubName_str: hub_name
  2332. });
  2333. return [4 /*yield*/, api.EnumGroup(in_rpc_enum_group)];
  2334. case 1:
  2335. out_rpc_enum_group = _a.sent();
  2336. console.log(out_rpc_enum_group);
  2337. console.log("End: Test_EnumGroup");
  2338. console.log("-----");
  2339. console.log();
  2340. return [2 /*return*/];
  2341. }
  2342. });
  2343. });
  2344. }
  2345. /** API test for 'EnumSession', Enumerate sessions */
  2346. function Test_EnumSession() {
  2347. return __awaiter(this, void 0, void 0, function () {
  2348. var in_rpc_enum_session, out_rpc_enum_session;
  2349. return __generator(this, function (_a) {
  2350. switch (_a.label) {
  2351. case 0:
  2352. console.log("Begin: Test_EnumSession");
  2353. in_rpc_enum_session = new VPN.VpnRpcEnumSession({
  2354. HubName_str: hub_name
  2355. });
  2356. return [4 /*yield*/, api.EnumSession(in_rpc_enum_session)];
  2357. case 1:
  2358. out_rpc_enum_session = _a.sent();
  2359. console.log(out_rpc_enum_session);
  2360. console.log("End: Test_EnumSession");
  2361. console.log("-----");
  2362. console.log();
  2363. return [2 /*return*/, out_rpc_enum_session];
  2364. }
  2365. });
  2366. });
  2367. }
  2368. /** API test for 'GetSessionStatus', Get session status */
  2369. function Test_GetSessionStatus(session_name) {
  2370. return __awaiter(this, void 0, void 0, function () {
  2371. var in_rpc_session_status, out_rpc_session_status;
  2372. return __generator(this, function (_a) {
  2373. switch (_a.label) {
  2374. case 0:
  2375. console.log("Begin: Test_GetSessionStatus");
  2376. in_rpc_session_status = new VPN.VpnRpcSessionStatus({
  2377. HubName_str: hub_name,
  2378. Name_str: session_name
  2379. });
  2380. return [4 /*yield*/, api.GetSessionStatus(in_rpc_session_status)];
  2381. case 1:
  2382. out_rpc_session_status = _a.sent();
  2383. console.log(out_rpc_session_status);
  2384. console.log("End: Test_GetSessionStatus");
  2385. console.log("-----");
  2386. console.log();
  2387. return [2 /*return*/];
  2388. }
  2389. });
  2390. });
  2391. }
  2392. /** API test for 'DeleteSession', Delete a session */
  2393. function Test_DeleteSession(session_id) {
  2394. return __awaiter(this, void 0, void 0, function () {
  2395. var in_rpc_delete_session, out_rpc_delete_session;
  2396. return __generator(this, function (_a) {
  2397. switch (_a.label) {
  2398. case 0:
  2399. console.log("Begin: Test_DeleteSession");
  2400. in_rpc_delete_session = new VPN.VpnRpcDeleteSession({
  2401. HubName_str: hub_name,
  2402. Name_str: session_id
  2403. });
  2404. return [4 /*yield*/, api.DeleteSession(in_rpc_delete_session)];
  2405. case 1:
  2406. out_rpc_delete_session = _a.sent();
  2407. console.log(out_rpc_delete_session);
  2408. console.log("End: Test_DeleteSession");
  2409. console.log("-----");
  2410. console.log();
  2411. return [2 /*return*/];
  2412. }
  2413. });
  2414. });
  2415. }
  2416. /** API test for 'EnumMacTable', Get MAC address table */
  2417. function Test_EnumMacTable() {
  2418. return __awaiter(this, void 0, void 0, function () {
  2419. var in_rpc_enum_mac_table, out_rpc_enum_mac_table;
  2420. return __generator(this, function (_a) {
  2421. switch (_a.label) {
  2422. case 0:
  2423. console.log("Begin: Test_EnumMacTable");
  2424. in_rpc_enum_mac_table = new VPN.VpnRpcEnumMacTable({
  2425. HubName_str: hub_name
  2426. });
  2427. return [4 /*yield*/, api.EnumMacTable(in_rpc_enum_mac_table)];
  2428. case 1:
  2429. out_rpc_enum_mac_table = _a.sent();
  2430. console.log(out_rpc_enum_mac_table);
  2431. console.log("End: Test_EnumMacTable");
  2432. console.log("-----");
  2433. console.log();
  2434. return [2 /*return*/, out_rpc_enum_mac_table];
  2435. }
  2436. });
  2437. });
  2438. }
  2439. /** API test for 'DeleteMacTable', Delete MAC address table entry */
  2440. function Test_DeleteMacTable(key32) {
  2441. return __awaiter(this, void 0, void 0, function () {
  2442. var in_rpc_delete_table, out_rpc_delete_table;
  2443. return __generator(this, function (_a) {
  2444. switch (_a.label) {
  2445. case 0:
  2446. console.log("Begin: Test_DeleteMacTable");
  2447. in_rpc_delete_table = new VPN.VpnRpcDeleteTable({
  2448. HubName_str: hub_name,
  2449. Key_u32: key32
  2450. });
  2451. return [4 /*yield*/, api.DeleteMacTable(in_rpc_delete_table)];
  2452. case 1:
  2453. out_rpc_delete_table = _a.sent();
  2454. console.log("End: Test_DeleteMacTable");
  2455. console.log("-----");
  2456. console.log();
  2457. return [2 /*return*/];
  2458. }
  2459. });
  2460. });
  2461. }
  2462. /** API test for 'EnumIpTable', Get IP address table */
  2463. function Test_EnumIpTable() {
  2464. return __awaiter(this, void 0, void 0, function () {
  2465. var in_rpc_enum_ip_table, out_rpc_enum_ip_table;
  2466. return __generator(this, function (_a) {
  2467. switch (_a.label) {
  2468. case 0:
  2469. console.log("Begin: Test_EnumIpTable");
  2470. in_rpc_enum_ip_table = new VPN.VpnRpcEnumIpTable({
  2471. HubName_str: hub_name
  2472. });
  2473. return [4 /*yield*/, api.EnumIpTable(in_rpc_enum_ip_table)];
  2474. case 1:
  2475. out_rpc_enum_ip_table = _a.sent();
  2476. console.log(out_rpc_enum_ip_table);
  2477. console.log("End: Test_EnumIpTable");
  2478. console.log("-----");
  2479. console.log();
  2480. return [2 /*return*/, out_rpc_enum_ip_table];
  2481. }
  2482. });
  2483. });
  2484. }
  2485. /** API test for 'DeleteIpTable', Delete IP address table entry */
  2486. function Test_DeleteIpTable(key32) {
  2487. return __awaiter(this, void 0, void 0, function () {
  2488. var in_rpc_delete_table, out_rpc_delete_table;
  2489. return __generator(this, function (_a) {
  2490. switch (_a.label) {
  2491. case 0:
  2492. console.log("Begin: Test_DeleteIpTable");
  2493. in_rpc_delete_table = new VPN.VpnRpcDeleteTable({
  2494. HubName_str: hub_name,
  2495. Key_u32: key32
  2496. });
  2497. return [4 /*yield*/, api.DeleteIpTable(in_rpc_delete_table)];
  2498. case 1:
  2499. out_rpc_delete_table = _a.sent();
  2500. console.log(out_rpc_delete_table);
  2501. console.log("End: Test_DeleteIpTable");
  2502. console.log("-----");
  2503. console.log();
  2504. return [2 /*return*/];
  2505. }
  2506. });
  2507. });
  2508. }
  2509. /** API test for 'SetKeep', Set keep-alive function setting */
  2510. function Test_SetKeep() {
  2511. return __awaiter(this, void 0, void 0, function () {
  2512. var in_rpc_keep, out_rpc_keep;
  2513. return __generator(this, function (_a) {
  2514. switch (_a.label) {
  2515. case 0:
  2516. console.log("Begin: Test_SetKeep");
  2517. in_rpc_keep = new VPN.VpnRpcKeep({
  2518. UseKeepConnect_bool: true,
  2519. KeepConnectHost_str: "www.softether.org",
  2520. KeepConnectPort_u32: 123,
  2521. KeepConnectProtocol_u32: VPN.VpnRpcKeepAliveProtocol.UDP,
  2522. KeepConnectInterval_u32: 1
  2523. });
  2524. return [4 /*yield*/, api.SetKeep(in_rpc_keep)];
  2525. case 1:
  2526. out_rpc_keep = _a.sent();
  2527. console.log(out_rpc_keep);
  2528. console.log("End: Test_SetKeep");
  2529. console.log("-----");
  2530. console.log();
  2531. return [2 /*return*/];
  2532. }
  2533. });
  2534. });
  2535. }
  2536. /** API test for 'GetKeep', Get keep-alive function setting */
  2537. function Test_GetKeep() {
  2538. return __awaiter(this, void 0, void 0, function () {
  2539. var in_rpc_keep, out_rpc_keep;
  2540. return __generator(this, function (_a) {
  2541. switch (_a.label) {
  2542. case 0:
  2543. console.log("Begin: Test_GetKeep");
  2544. in_rpc_keep = new VPN.VpnRpcKeep({});
  2545. return [4 /*yield*/, api.GetKeep(in_rpc_keep)];
  2546. case 1:
  2547. out_rpc_keep = _a.sent();
  2548. console.log(out_rpc_keep);
  2549. console.log("End: Test_GetKeep");
  2550. console.log("-----");
  2551. console.log();
  2552. return [2 /*return*/];
  2553. }
  2554. });
  2555. });
  2556. }
  2557. /** API test for 'EnableSecureNAT', Enable SecureNAT function of the hub */
  2558. function Test_EnableSecureNAT() {
  2559. return __awaiter(this, void 0, void 0, function () {
  2560. var in_rpc_hub, out_rpc_hub;
  2561. return __generator(this, function (_a) {
  2562. switch (_a.label) {
  2563. case 0:
  2564. console.log("Begin: Test_EnableSecureNAT");
  2565. in_rpc_hub = new VPN.VpnRpcHub({
  2566. HubName_str: hub_name
  2567. });
  2568. return [4 /*yield*/, api.EnableSecureNAT(in_rpc_hub)];
  2569. case 1:
  2570. out_rpc_hub = _a.sent();
  2571. console.log(out_rpc_hub);
  2572. console.log("End: Test_EnableSecureNAT");
  2573. console.log("-----");
  2574. console.log();
  2575. return [2 /*return*/];
  2576. }
  2577. });
  2578. });
  2579. }
  2580. /** API test for 'DisableSecureNAT', Disable the SecureNAT function of the hub */
  2581. function Test_DisableSecureNAT() {
  2582. return __awaiter(this, void 0, void 0, function () {
  2583. var in_rpc_hub, out_rpc_hub;
  2584. return __generator(this, function (_a) {
  2585. switch (_a.label) {
  2586. case 0:
  2587. console.log("Begin: Test_DisableSecureNAT");
  2588. in_rpc_hub = new VPN.VpnRpcHub({
  2589. HubName_str: hub_name
  2590. });
  2591. return [4 /*yield*/, api.DisableSecureNAT(in_rpc_hub)];
  2592. case 1:
  2593. out_rpc_hub = _a.sent();
  2594. console.log(out_rpc_hub);
  2595. console.log("End: Test_DisableSecureNAT");
  2596. console.log("-----");
  2597. console.log();
  2598. return [2 /*return*/];
  2599. }
  2600. });
  2601. });
  2602. }
  2603. /** API test for 'SetSecureNATOption', Set SecureNAT options */
  2604. function Test_SetSecureNATOption() {
  2605. return __awaiter(this, void 0, void 0, function () {
  2606. var in_vh_option, out_vh_option;
  2607. return __generator(this, function (_a) {
  2608. switch (_a.label) {
  2609. case 0:
  2610. console.log("Begin: Test_SetSecureNATOption");
  2611. in_vh_option = new VPN.VpnVhOption({
  2612. RpcHubName_str: hub_name,
  2613. MacAddress_bin: new Uint8Array([0x00, 0xAC, 0x00, 0x11, 0x22, 0x33,]),
  2614. Ip_ip: "10.0.0.254",
  2615. Mask_ip: "255.255.255.0",
  2616. UseNat_bool: true,
  2617. Mtu_u32: 1200,
  2618. NatTcpTimeout_u32: 100,
  2619. NatUdpTimeout_u32: 50,
  2620. UseDhcp_bool: true,
  2621. DhcpLeaseIPStart_ip: "10.0.0.101",
  2622. DhcpLeaseIPEnd_ip: "10.0.0.199",
  2623. DhcpSubnetMask_ip: "255.255.255.0",
  2624. DhcpExpireTimeSpan_u32: 3600,
  2625. DhcpGatewayAddress_ip: "10.0.0.254",
  2626. DhcpDnsServerAddress_ip: "10.0.0.254",
  2627. DhcpDnsServerAddress2_ip: "8.8.8.8",
  2628. DhcpDomainName_str: "lab.coe.ad.jp",
  2629. SaveLog_bool: true,
  2630. ApplyDhcpPushRoutes_bool: false,
  2631. DhcpPushRoutes_str: ""
  2632. });
  2633. return [4 /*yield*/, api.SetSecureNATOption(in_vh_option)];
  2634. case 1:
  2635. out_vh_option = _a.sent();
  2636. console.log(out_vh_option);
  2637. console.log("End: Test_SetSecureNATOption");
  2638. console.log("-----");
  2639. console.log();
  2640. return [2 /*return*/];
  2641. }
  2642. });
  2643. });
  2644. }
  2645. /** API test for 'GetSecureNATOption', Get SecureNAT options */
  2646. function Test_GetSecureNATOption() {
  2647. return __awaiter(this, void 0, void 0, function () {
  2648. var in_vh_option, out_vh_option;
  2649. return __generator(this, function (_a) {
  2650. switch (_a.label) {
  2651. case 0:
  2652. console.log("Begin: Test_GetSecureNATOption");
  2653. in_vh_option = new VPN.VpnVhOption({
  2654. RpcHubName_str: hub_name
  2655. });
  2656. return [4 /*yield*/, api.GetSecureNATOption(in_vh_option)];
  2657. case 1:
  2658. out_vh_option = _a.sent();
  2659. console.log(out_vh_option);
  2660. console.log("End: Test_GetSecureNATOption");
  2661. console.log("-----");
  2662. console.log();
  2663. return [2 /*return*/];
  2664. }
  2665. });
  2666. });
  2667. }
  2668. /** API test for 'EnumNAT', Enumerate NAT entries of the SecureNAT */
  2669. function Test_EnumNAT() {
  2670. return __awaiter(this, void 0, void 0, function () {
  2671. var in_rpc_enum_nat, out_rpc_enum_nat;
  2672. return __generator(this, function (_a) {
  2673. switch (_a.label) {
  2674. case 0:
  2675. console.log("Begin: Test_EnumNAT");
  2676. in_rpc_enum_nat = new VPN.VpnRpcEnumNat({
  2677. HubName_str: hub_name
  2678. });
  2679. return [4 /*yield*/, api.EnumNAT(in_rpc_enum_nat)];
  2680. case 1:
  2681. out_rpc_enum_nat = _a.sent();
  2682. console.log(out_rpc_enum_nat);
  2683. console.log("End: Test_EnumNAT");
  2684. console.log("-----");
  2685. console.log();
  2686. return [2 /*return*/];
  2687. }
  2688. });
  2689. });
  2690. }
  2691. /** API test for 'EnumDHCP', Enumerate DHCP entries */
  2692. function Test_EnumDHCP() {
  2693. return __awaiter(this, void 0, void 0, function () {
  2694. var in_rpc_enum_dhcp, out_rpc_enum_dhcp;
  2695. return __generator(this, function (_a) {
  2696. switch (_a.label) {
  2697. case 0:
  2698. console.log("Begin: Test_EnumDHCP");
  2699. in_rpc_enum_dhcp = new VPN.VpnRpcEnumDhcp({
  2700. HubName_str: hub_name
  2701. });
  2702. return [4 /*yield*/, api.EnumDHCP(in_rpc_enum_dhcp)];
  2703. case 1:
  2704. out_rpc_enum_dhcp = _a.sent();
  2705. console.log(out_rpc_enum_dhcp);
  2706. console.log("End: Test_EnumDHCP");
  2707. console.log("-----");
  2708. console.log();
  2709. return [2 /*return*/];
  2710. }
  2711. });
  2712. });
  2713. }
  2714. /** API test for 'GetSecureNATStatus', Get status of the SecureNAT */
  2715. function Test_GetSecureNATStatus() {
  2716. return __awaiter(this, void 0, void 0, function () {
  2717. var in_rpc_nat_status, out_rpc_nat_status;
  2718. return __generator(this, function (_a) {
  2719. switch (_a.label) {
  2720. case 0:
  2721. console.log("Begin: Test_GetSecureNATStatus");
  2722. in_rpc_nat_status = new VPN.VpnRpcNatStatus({
  2723. HubName_str: hub_name
  2724. });
  2725. return [4 /*yield*/, api.GetSecureNATStatus(in_rpc_nat_status)];
  2726. case 1:
  2727. out_rpc_nat_status = _a.sent();
  2728. console.log(out_rpc_nat_status);
  2729. console.log("End: Test_GetSecureNATStatus");
  2730. console.log("-----");
  2731. console.log();
  2732. return [2 /*return*/];
  2733. }
  2734. });
  2735. });
  2736. }
  2737. /** API test for 'EnumEthernet', Enumerate Ethernet devices */
  2738. function Test_EnumEthernet() {
  2739. return __awaiter(this, void 0, void 0, function () {
  2740. var out_rpc_enum_eth;
  2741. return __generator(this, function (_a) {
  2742. switch (_a.label) {
  2743. case 0:
  2744. console.log("Begin: Test_EnumEthernet");
  2745. return [4 /*yield*/, api.EnumEthernet()];
  2746. case 1:
  2747. out_rpc_enum_eth = _a.sent();
  2748. console.log(out_rpc_enum_eth);
  2749. console.log("End: Test_EnumEthernet");
  2750. console.log("-----");
  2751. console.log();
  2752. return [2 /*return*/];
  2753. }
  2754. });
  2755. });
  2756. }
  2757. /** API test for 'AddLocalBridge', Add a new local bridge */
  2758. function Test_AddLocalBridge() {
  2759. return __awaiter(this, void 0, void 0, function () {
  2760. var in_rpc_localbridge, out_rpc_localbridge;
  2761. return __generator(this, function (_a) {
  2762. switch (_a.label) {
  2763. case 0:
  2764. console.log("Begin: Test_AddLocalBridge");
  2765. in_rpc_localbridge = new VPN.VpnRpcLocalBridge({
  2766. DeviceName_str: "Intel(R) Ethernet Connection (2) I219-V (ID=3632031273)",
  2767. HubNameLB_str: hub_name
  2768. });
  2769. return [4 /*yield*/, api.AddLocalBridge(in_rpc_localbridge)];
  2770. case 1:
  2771. out_rpc_localbridge = _a.sent();
  2772. console.log(out_rpc_localbridge);
  2773. console.log("End: Test_AddLocalBridge");
  2774. console.log("-----");
  2775. console.log();
  2776. return [2 /*return*/];
  2777. }
  2778. });
  2779. });
  2780. }
  2781. /** API test for 'DeleteLocalBridge', Delete a local bridge */
  2782. function Test_DeleteLocalBridge() {
  2783. return __awaiter(this, void 0, void 0, function () {
  2784. var in_rpc_localbridge, out_rpc_localbridge;
  2785. return __generator(this, function (_a) {
  2786. switch (_a.label) {
  2787. case 0:
  2788. console.log("Begin: Test_DeleteLocalBridge");
  2789. in_rpc_localbridge = new VPN.VpnRpcLocalBridge({
  2790. DeviceName_str: "Intel(R) Ethernet Connection (2) I219-V (ID=3632031273)",
  2791. HubNameLB_str: hub_name
  2792. });
  2793. return [4 /*yield*/, api.DeleteLocalBridge(in_rpc_localbridge)];
  2794. case 1:
  2795. out_rpc_localbridge = _a.sent();
  2796. console.log(out_rpc_localbridge);
  2797. console.log("End: Test_DeleteLocalBridge");
  2798. console.log("-----");
  2799. console.log();
  2800. return [2 /*return*/];
  2801. }
  2802. });
  2803. });
  2804. }
  2805. /** API test for 'EnumLocalBridge', Enumerate local bridges */
  2806. function Test_EnumLocalBridge() {
  2807. return __awaiter(this, void 0, void 0, function () {
  2808. var out_rpc_enum_localbridge;
  2809. return __generator(this, function (_a) {
  2810. switch (_a.label) {
  2811. case 0:
  2812. console.log("Begin: Test_EnumLocalBridge");
  2813. return [4 /*yield*/, api.EnumLocalBridge()];
  2814. case 1:
  2815. out_rpc_enum_localbridge = _a.sent();
  2816. console.log(out_rpc_enum_localbridge);
  2817. console.log("End: Test_EnumLocalBridge");
  2818. console.log("-----");
  2819. console.log();
  2820. return [2 /*return*/];
  2821. }
  2822. });
  2823. });
  2824. }
  2825. /** API test for 'GetBridgeSupport', Get availability to localbridge function */
  2826. function Test_GetBridgeSupport() {
  2827. return __awaiter(this, void 0, void 0, function () {
  2828. var out_rpc_bridge_support;
  2829. return __generator(this, function (_a) {
  2830. switch (_a.label) {
  2831. case 0:
  2832. console.log("Begin: Test_GetBridgeSupport");
  2833. return [4 /*yield*/, api.GetBridgeSupport()];
  2834. case 1:
  2835. out_rpc_bridge_support = _a.sent();
  2836. console.log(out_rpc_bridge_support);
  2837. console.log("End: Test_GetBridgeSupport");
  2838. console.log("-----");
  2839. console.log();
  2840. return [2 /*return*/];
  2841. }
  2842. });
  2843. });
  2844. }
  2845. /** API test for 'RebootServer', Reboot server itself */
  2846. function Test_RebootServer() {
  2847. return __awaiter(this, void 0, void 0, function () {
  2848. var in_rpc_test, out_rpc_test;
  2849. return __generator(this, function (_a) {
  2850. switch (_a.label) {
  2851. case 0:
  2852. console.log("Begin: Test_RebootServer");
  2853. in_rpc_test = new VPN.VpnRpcTest({});
  2854. return [4 /*yield*/, api.RebootServer(in_rpc_test)];
  2855. case 1:
  2856. out_rpc_test = _a.sent();
  2857. console.log(out_rpc_test);
  2858. console.log("End: Test_RebootServer");
  2859. console.log("-----");
  2860. console.log();
  2861. return [2 /*return*/];
  2862. }
  2863. });
  2864. });
  2865. }
  2866. /** API test for 'GetCaps', Get capabilities */
  2867. function Test_GetCaps() {
  2868. return __awaiter(this, void 0, void 0, function () {
  2869. var out_capslist;
  2870. return __generator(this, function (_a) {
  2871. switch (_a.label) {
  2872. case 0:
  2873. console.log("Begin: Test_GetCaps");
  2874. return [4 /*yield*/, api.GetCaps()];
  2875. case 1:
  2876. out_capslist = _a.sent();
  2877. console.log(out_capslist);
  2878. console.log("End: Test_GetCaps");
  2879. console.log("-----");
  2880. console.log();
  2881. return [2 /*return*/];
  2882. }
  2883. });
  2884. });
  2885. }
  2886. /** API test for 'GetConfig', Get configuration file stream */
  2887. function Test_GetConfig() {
  2888. return __awaiter(this, void 0, void 0, function () {
  2889. var out_rpc_config;
  2890. return __generator(this, function (_a) {
  2891. switch (_a.label) {
  2892. case 0:
  2893. console.log("Begin: Test_GetConfig");
  2894. return [4 /*yield*/, api.GetConfig()];
  2895. case 1:
  2896. out_rpc_config = _a.sent();
  2897. console.log(out_rpc_config);
  2898. console.log("End: Test_GetConfig");
  2899. console.log("-----");
  2900. console.log();
  2901. return [2 /*return*/];
  2902. }
  2903. });
  2904. });
  2905. }
  2906. /** API test for 'SetConfig', Overwrite configuration file by specified data */
  2907. function Test_SetConfig() {
  2908. return __awaiter(this, void 0, void 0, function () {
  2909. var in_rpc_config, out_rpc_config;
  2910. return __generator(this, function (_a) {
  2911. switch (_a.label) {
  2912. case 0:
  2913. console.log("Begin: Test_SetConfig");
  2914. in_rpc_config = new VPN.VpnRpcConfig({
  2915. FileData_bin: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04,])
  2916. });
  2917. return [4 /*yield*/, api.SetConfig(in_rpc_config)];
  2918. case 1:
  2919. out_rpc_config = _a.sent();
  2920. console.log("End: Test_SetConfig");
  2921. console.log("-----");
  2922. console.log();
  2923. return [2 /*return*/];
  2924. }
  2925. });
  2926. });
  2927. }
  2928. /** API test for 'GetDefaultHubAdminOptions', Get default hub administration options */
  2929. function Test_GetDefaultHubAdminOptions() {
  2930. return __awaiter(this, void 0, void 0, function () {
  2931. var in_rpc_admin_option, out_rpc_admin_option;
  2932. return __generator(this, function (_a) {
  2933. switch (_a.label) {
  2934. case 0:
  2935. console.log("Begin: Test_GetDefaultHubAdminOptions");
  2936. in_rpc_admin_option = new VPN.VpnRpcAdminOption({
  2937. HubName_str: hub_name
  2938. });
  2939. return [4 /*yield*/, api.GetDefaultHubAdminOptions(in_rpc_admin_option)];
  2940. case 1:
  2941. out_rpc_admin_option = _a.sent();
  2942. console.log(out_rpc_admin_option);
  2943. console.log("End: Test_GetDefaultHubAdminOptions");
  2944. console.log("-----");
  2945. console.log();
  2946. return [2 /*return*/];
  2947. }
  2948. });
  2949. });
  2950. }
  2951. /** API test for 'GetHubAdminOptions', Get hub administration options */
  2952. function Test_GetHubAdminOptions() {
  2953. return __awaiter(this, void 0, void 0, function () {
  2954. var in_rpc_admin_option, out_rpc_admin_option;
  2955. return __generator(this, function (_a) {
  2956. switch (_a.label) {
  2957. case 0:
  2958. console.log("Begin: Test_GetHubAdminOptions");
  2959. in_rpc_admin_option = new VPN.VpnRpcAdminOption({
  2960. HubName_str: hub_name
  2961. });
  2962. return [4 /*yield*/, api.GetHubAdminOptions(in_rpc_admin_option)];
  2963. case 1:
  2964. out_rpc_admin_option = _a.sent();
  2965. console.log(out_rpc_admin_option);
  2966. console.log("End: Test_GetHubAdminOptions");
  2967. console.log("-----");
  2968. console.log();
  2969. return [2 /*return*/];
  2970. }
  2971. });
  2972. });
  2973. }
  2974. /** API test for 'SetHubAdminOptions', Set hub administration options */
  2975. function Test_SetHubAdminOptions() {
  2976. return __awaiter(this, void 0, void 0, function () {
  2977. var in_rpc_admin_option, out_rpc_admin_option;
  2978. return __generator(this, function (_a) {
  2979. switch (_a.label) {
  2980. case 0:
  2981. console.log("Begin: Test_SetHubAdminOptions");
  2982. in_rpc_admin_option = new VPN.VpnRpcAdminOption({
  2983. HubName_str: hub_name,
  2984. AdminOptionList: [new VPN.VpnAdminOption({
  2985. Name_str: "no_securenat_enablenat",
  2986. Value_u32: 1
  2987. }),]
  2988. });
  2989. return [4 /*yield*/, api.SetHubAdminOptions(in_rpc_admin_option)];
  2990. case 1:
  2991. out_rpc_admin_option = _a.sent();
  2992. console.log(out_rpc_admin_option);
  2993. console.log("End: Test_SetHubAdminOptions");
  2994. console.log("-----");
  2995. console.log();
  2996. return [2 /*return*/];
  2997. }
  2998. });
  2999. });
  3000. }
  3001. /** API test for 'GetHubExtOptions', Get hub extended options */
  3002. function Test_GetHubExtOptions() {
  3003. return __awaiter(this, void 0, void 0, function () {
  3004. var in_rpc_admin_option, out_rpc_admin_option;
  3005. return __generator(this, function (_a) {
  3006. switch (_a.label) {
  3007. case 0:
  3008. console.log("Begin: Test_GetHubExtOptions");
  3009. in_rpc_admin_option = new VPN.VpnRpcAdminOption({
  3010. HubName_str: hub_name
  3011. });
  3012. return [4 /*yield*/, api.GetHubExtOptions(in_rpc_admin_option)];
  3013. case 1:
  3014. out_rpc_admin_option = _a.sent();
  3015. console.log(out_rpc_admin_option);
  3016. console.log("End: Test_GetHubExtOptions");
  3017. console.log("-----");
  3018. console.log();
  3019. return [2 /*return*/];
  3020. }
  3021. });
  3022. });
  3023. }
  3024. /** API test for 'SetHubExtOptions', Set hub extended options */
  3025. function Test_SetHubExtOptions() {
  3026. return __awaiter(this, void 0, void 0, function () {
  3027. var in_rpc_admin_option, out_rpc_admin_option;
  3028. return __generator(this, function (_a) {
  3029. switch (_a.label) {
  3030. case 0:
  3031. console.log("Begin: Test_SetHubExtOptions");
  3032. in_rpc_admin_option = new VPN.VpnRpcAdminOption({
  3033. HubName_str: hub_name,
  3034. AdminOptionList: [new VPN.VpnAdminOption({
  3035. Name_str: "SecureNAT_RandomizeAssignIp",
  3036. Value_u32: 1
  3037. }),]
  3038. });
  3039. return [4 /*yield*/, api.SetHubExtOptions(in_rpc_admin_option)];
  3040. case 1:
  3041. out_rpc_admin_option = _a.sent();
  3042. console.log(out_rpc_admin_option);
  3043. console.log("End: Test_SetHubExtOptions");
  3044. console.log("-----");
  3045. console.log();
  3046. return [2 /*return*/];
  3047. }
  3048. });
  3049. });
  3050. }
  3051. /** API test for 'AddL3Switch', Add a new virtual layer-3 switch */
  3052. function Test_AddL3Switch() {
  3053. return __awaiter(this, void 0, void 0, function () {
  3054. var in_rpc_l3sw, out_rpc_l3sw;
  3055. return __generator(this, function (_a) {
  3056. switch (_a.label) {
  3057. case 0:
  3058. console.log("Begin: Test_AddL3Switch");
  3059. in_rpc_l3sw = new VPN.VpnRpcL3Sw({
  3060. Name_str: "L3SW1"
  3061. });
  3062. return [4 /*yield*/, api.AddL3Switch(in_rpc_l3sw)];
  3063. case 1:
  3064. out_rpc_l3sw = _a.sent();
  3065. console.log(out_rpc_l3sw);
  3066. console.log("End: Test_AddL3Switch");
  3067. console.log("-----");
  3068. console.log();
  3069. return [2 /*return*/];
  3070. }
  3071. });
  3072. });
  3073. }
  3074. /** API test for 'DelL3Switch', Delete a virtual layer-3 switch */
  3075. function Test_DelL3Switch() {
  3076. return __awaiter(this, void 0, void 0, function () {
  3077. var in_rpc_l3sw, out_rpc_l3sw;
  3078. return __generator(this, function (_a) {
  3079. switch (_a.label) {
  3080. case 0:
  3081. console.log("Begin: Test_DelL3Switch");
  3082. in_rpc_l3sw = new VPN.VpnRpcL3Sw({
  3083. Name_str: "L3SW1"
  3084. });
  3085. return [4 /*yield*/, api.DelL3Switch(in_rpc_l3sw)];
  3086. case 1:
  3087. out_rpc_l3sw = _a.sent();
  3088. console.log(out_rpc_l3sw);
  3089. console.log("End: Test_DelL3Switch");
  3090. console.log("-----");
  3091. console.log();
  3092. return [2 /*return*/];
  3093. }
  3094. });
  3095. });
  3096. }
  3097. /** API test for 'EnumL3Switch', Enumerate virtual layer-3 switches */
  3098. function Test_EnumL3Switch() {
  3099. return __awaiter(this, void 0, void 0, function () {
  3100. var out_rpc_enum_l3sw;
  3101. return __generator(this, function (_a) {
  3102. switch (_a.label) {
  3103. case 0:
  3104. console.log("Begin: Test_EnumL3Switch");
  3105. return [4 /*yield*/, api.EnumL3Switch()];
  3106. case 1:
  3107. out_rpc_enum_l3sw = _a.sent();
  3108. console.log(out_rpc_enum_l3sw);
  3109. console.log("End: Test_EnumL3Switch");
  3110. console.log("-----");
  3111. console.log();
  3112. return [2 /*return*/];
  3113. }
  3114. });
  3115. });
  3116. }
  3117. /** API test for 'StartL3Switch', Start a virtual layer-3 switch */
  3118. function Test_StartL3Switch() {
  3119. return __awaiter(this, void 0, void 0, function () {
  3120. var in_rpc_l3sw, out_rpc_l3sw;
  3121. return __generator(this, function (_a) {
  3122. switch (_a.label) {
  3123. case 0:
  3124. console.log("Begin: Test_StartL3Switch");
  3125. in_rpc_l3sw = new VPN.VpnRpcL3Sw({
  3126. Name_str: "L3SW1"
  3127. });
  3128. return [4 /*yield*/, api.StartL3Switch(in_rpc_l3sw)];
  3129. case 1:
  3130. out_rpc_l3sw = _a.sent();
  3131. console.log(out_rpc_l3sw);
  3132. console.log("End: Test_StartL3Switch");
  3133. console.log("-----");
  3134. console.log();
  3135. return [2 /*return*/];
  3136. }
  3137. });
  3138. });
  3139. }
  3140. /** API test for 'StopL3Switch', Stop a virtual layer-3 switch */
  3141. function Test_StopL3Switch() {
  3142. return __awaiter(this, void 0, void 0, function () {
  3143. var in_rpc_l3sw, out_rpc_l3sw;
  3144. return __generator(this, function (_a) {
  3145. switch (_a.label) {
  3146. case 0:
  3147. console.log("Begin: Test_StopL3Switch");
  3148. in_rpc_l3sw = new VPN.VpnRpcL3Sw({
  3149. Name_str: "L3SW1"
  3150. });
  3151. return [4 /*yield*/, api.StopL3Switch(in_rpc_l3sw)];
  3152. case 1:
  3153. out_rpc_l3sw = _a.sent();
  3154. console.log(out_rpc_l3sw);
  3155. console.log("End: Test_StopL3Switch");
  3156. console.log("-----");
  3157. console.log();
  3158. return [2 /*return*/];
  3159. }
  3160. });
  3161. });
  3162. }
  3163. /** API test for 'AddL3If', Add new virtual interface on virtual L3 switch */
  3164. function Test_AddL3If() {
  3165. return __awaiter(this, void 0, void 0, function () {
  3166. var in_rpc_l3if, out_rpc_l3if;
  3167. return __generator(this, function (_a) {
  3168. switch (_a.label) {
  3169. case 0:
  3170. console.log("Begin: Test_AddL3If");
  3171. in_rpc_l3if = new VPN.VpnRpcL3If({
  3172. Name_str: "L3SW1",
  3173. HubName_str: hub_name,
  3174. IpAddress_ip: "192.168.0.1",
  3175. SubnetMask_ip: "255.255.255.0"
  3176. });
  3177. return [4 /*yield*/, api.AddL3If(in_rpc_l3if)];
  3178. case 1:
  3179. out_rpc_l3if = _a.sent();
  3180. console.log(out_rpc_l3if);
  3181. console.log("End: Test_AddL3If");
  3182. console.log("-----");
  3183. console.log();
  3184. return [2 /*return*/];
  3185. }
  3186. });
  3187. });
  3188. }
  3189. /** API test for 'DelL3If', Delete a virtual interface on virtual L3 switch */
  3190. function Test_DelL3If() {
  3191. return __awaiter(this, void 0, void 0, function () {
  3192. var in_rpc_l3if, out_rpc_l3if;
  3193. return __generator(this, function (_a) {
  3194. switch (_a.label) {
  3195. case 0:
  3196. console.log("Begin: Test_DelL3If");
  3197. in_rpc_l3if = new VPN.VpnRpcL3If({
  3198. Name_str: "L3SW1",
  3199. HubName_str: hub_name
  3200. });
  3201. return [4 /*yield*/, api.DelL3If(in_rpc_l3if)];
  3202. case 1:
  3203. out_rpc_l3if = _a.sent();
  3204. console.log(out_rpc_l3if);
  3205. console.log("End: Test_DelL3If");
  3206. console.log("-----");
  3207. console.log();
  3208. return [2 /*return*/];
  3209. }
  3210. });
  3211. });
  3212. }
  3213. /** API test for 'EnumL3If', Enumerate virtual interfaces on virtual L3 switch */
  3214. function Test_EnumL3If() {
  3215. return __awaiter(this, void 0, void 0, function () {
  3216. var in_rpc_enum_l3if, out_rpc_enum_l3if;
  3217. return __generator(this, function (_a) {
  3218. switch (_a.label) {
  3219. case 0:
  3220. console.log("Begin: Test_EnumL3If");
  3221. in_rpc_enum_l3if = new VPN.VpnRpcEnumL3If({
  3222. Name_str: "L3SW1"
  3223. });
  3224. return [4 /*yield*/, api.EnumL3If(in_rpc_enum_l3if)];
  3225. case 1:
  3226. out_rpc_enum_l3if = _a.sent();
  3227. console.log(out_rpc_enum_l3if);
  3228. console.log("End: Test_EnumL3If");
  3229. console.log("-----");
  3230. console.log();
  3231. return [2 /*return*/];
  3232. }
  3233. });
  3234. });
  3235. }
  3236. /** API test for 'AddL3Table', Add new routing table entry on virtual L3 switch */
  3237. function Test_AddL3Table() {
  3238. return __awaiter(this, void 0, void 0, function () {
  3239. var in_rpc_l3table, out_rpc_l3table;
  3240. return __generator(this, function (_a) {
  3241. switch (_a.label) {
  3242. case 0:
  3243. console.log("Begin: Test_AddL3Table");
  3244. in_rpc_l3table = new VPN.VpnRpcL3Table({
  3245. Name_str: "L3SW1",
  3246. NetworkAddress_ip: "10.0.0.0",
  3247. SubnetMask_ip: "255.0.0.0",
  3248. GatewayAddress_ip: "192.168.7.1",
  3249. Metric_u32: 10
  3250. });
  3251. return [4 /*yield*/, api.AddL3Table(in_rpc_l3table)];
  3252. case 1:
  3253. out_rpc_l3table = _a.sent();
  3254. console.log(out_rpc_l3table);
  3255. console.log("End: Test_AddL3Table");
  3256. console.log("-----");
  3257. console.log();
  3258. return [2 /*return*/];
  3259. }
  3260. });
  3261. });
  3262. }
  3263. /** API test for 'DelL3Table', Delete routing table entry on virtual L3 switch */
  3264. function Test_DelL3Table() {
  3265. return __awaiter(this, void 0, void 0, function () {
  3266. var in_rpc_l3table, out_rpc_l3table;
  3267. return __generator(this, function (_a) {
  3268. switch (_a.label) {
  3269. case 0:
  3270. console.log("Begin: Test_DelL3Table");
  3271. in_rpc_l3table = new VPN.VpnRpcL3Table({
  3272. Name_str: "L3SW1",
  3273. NetworkAddress_ip: "10.0.0.0",
  3274. SubnetMask_ip: "255.0.0.0",
  3275. GatewayAddress_ip: "192.168.7.1",
  3276. Metric_u32: 10
  3277. });
  3278. return [4 /*yield*/, api.DelL3Table(in_rpc_l3table)];
  3279. case 1:
  3280. out_rpc_l3table = _a.sent();
  3281. console.log(out_rpc_l3table);
  3282. console.log("End: Test_DelL3Table");
  3283. console.log("-----");
  3284. console.log();
  3285. return [2 /*return*/];
  3286. }
  3287. });
  3288. });
  3289. }
  3290. /** API test for 'EnumL3Table', Get routing table on virtual L3 switch */
  3291. function Test_EnumL3Table() {
  3292. return __awaiter(this, void 0, void 0, function () {
  3293. var in_rpc_enum_l3table, out_rpc_enum_l3table;
  3294. return __generator(this, function (_a) {
  3295. switch (_a.label) {
  3296. case 0:
  3297. console.log("Begin: Test_EnumL3Table");
  3298. in_rpc_enum_l3table = new VPN.VpnRpcEnumL3Table({
  3299. Name_str: "L3SW1"
  3300. });
  3301. return [4 /*yield*/, api.EnumL3Table(in_rpc_enum_l3table)];
  3302. case 1:
  3303. out_rpc_enum_l3table = _a.sent();
  3304. console.log(out_rpc_enum_l3table);
  3305. console.log("End: Test_EnumL3Table");
  3306. console.log("-----");
  3307. console.log();
  3308. return [2 /*return*/];
  3309. }
  3310. });
  3311. });
  3312. }
  3313. /** API test for 'EnumCrl', Get CRL (Certificate Revocation List) index */
  3314. function Test_EnumCrl() {
  3315. return __awaiter(this, void 0, void 0, function () {
  3316. var in_rpc_enum_crl, out_rpc_enum_crl;
  3317. return __generator(this, function (_a) {
  3318. switch (_a.label) {
  3319. case 0:
  3320. console.log("Begin: Test_EnumCrl");
  3321. in_rpc_enum_crl = new VPN.VpnRpcEnumCrl({
  3322. HubName_str: hub_name
  3323. });
  3324. return [4 /*yield*/, api.EnumCrl(in_rpc_enum_crl)];
  3325. case 1:
  3326. out_rpc_enum_crl = _a.sent();
  3327. console.log(out_rpc_enum_crl);
  3328. console.log("End: Test_EnumCrl");
  3329. console.log("-----");
  3330. console.log();
  3331. return [2 /*return*/, out_rpc_enum_crl];
  3332. }
  3333. });
  3334. });
  3335. }
  3336. /** API test for 'AddCrl', Add new CRL (Certificate Revocation List) entry */
  3337. function Test_AddCrl() {
  3338. return __awaiter(this, void 0, void 0, function () {
  3339. var in_rpc_crl, out_rpc_crl;
  3340. return __generator(this, function (_a) {
  3341. switch (_a.label) {
  3342. case 0:
  3343. console.log("Begin: Test_AddCrl");
  3344. in_rpc_crl = new VPN.VpnRpcCrl({
  3345. HubName_str: hub_name,
  3346. CommonName_utf: "CN",
  3347. Organization_utf: "Org",
  3348. Unit_utf: "ICSCOE",
  3349. Country_utf: "JP",
  3350. State_utf: "Ibaraki",
  3351. Local_utf: "Tsukuba",
  3352. Serial_bin: new Uint8Array([1, 2, 3, 4, 5,]),
  3353. DigestMD5_bin: new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,]),
  3354. DigestSHA1_bin: new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,])
  3355. });
  3356. return [4 /*yield*/, api.AddCrl(in_rpc_crl)];
  3357. case 1:
  3358. out_rpc_crl = _a.sent();
  3359. console.log(out_rpc_crl);
  3360. console.log("End: Test_AddCrl");
  3361. console.log("-----");
  3362. console.log();
  3363. return [2 /*return*/];
  3364. }
  3365. });
  3366. });
  3367. }
  3368. /** API test for 'DelCrl', Delete CRL (Certificate Revocation List) entry */
  3369. function Test_DelCrl(key) {
  3370. return __awaiter(this, void 0, void 0, function () {
  3371. var in_rpc_crl, out_rpc_crl;
  3372. return __generator(this, function (_a) {
  3373. switch (_a.label) {
  3374. case 0:
  3375. console.log("Begin: Test_DelCrl");
  3376. in_rpc_crl = new VPN.VpnRpcCrl({
  3377. HubName_str: hub_name,
  3378. Key_u32: key
  3379. });
  3380. return [4 /*yield*/, api.DelCrl(in_rpc_crl)];
  3381. case 1:
  3382. out_rpc_crl = _a.sent();
  3383. console.log(out_rpc_crl);
  3384. console.log("End: Test_DelCrl");
  3385. console.log("-----");
  3386. console.log();
  3387. return [2 /*return*/];
  3388. }
  3389. });
  3390. });
  3391. }
  3392. /** API test for 'GetCrl', Get CRL (Certificate Revocation List) entry */
  3393. function Test_GetCrl(key) {
  3394. return __awaiter(this, void 0, void 0, function () {
  3395. var in_rpc_crl, out_rpc_crl;
  3396. return __generator(this, function (_a) {
  3397. switch (_a.label) {
  3398. case 0:
  3399. console.log("Begin: Test_GetCrl");
  3400. in_rpc_crl = new VPN.VpnRpcCrl({
  3401. HubName_str: hub_name,
  3402. Key_u32: key
  3403. });
  3404. return [4 /*yield*/, api.GetCrl(in_rpc_crl)];
  3405. case 1:
  3406. out_rpc_crl = _a.sent();
  3407. console.log(out_rpc_crl);
  3408. console.log("End: Test_GetCrl");
  3409. console.log("-----");
  3410. console.log();
  3411. return [2 /*return*/, out_rpc_crl];
  3412. }
  3413. });
  3414. });
  3415. }
  3416. /** API test for 'SetCrl', Set CRL (Certificate Revocation List) entry */
  3417. function Test_SetCrl(crl) {
  3418. return __awaiter(this, void 0, void 0, function () {
  3419. var out_rpc_crl;
  3420. return __generator(this, function (_a) {
  3421. switch (_a.label) {
  3422. case 0:
  3423. console.log("Begin: Test_SetCrl");
  3424. return [4 /*yield*/, api.SetCrl(crl)];
  3425. case 1:
  3426. out_rpc_crl = _a.sent();
  3427. console.log(out_rpc_crl);
  3428. console.log("End: Test_SetCrl");
  3429. console.log("-----");
  3430. console.log();
  3431. return [2 /*return*/];
  3432. }
  3433. });
  3434. });
  3435. }
  3436. /** API test for 'SetAcList', Set access control list */
  3437. function Test_SetAcList() {
  3438. return __awaiter(this, void 0, void 0, function () {
  3439. var in_rpc_ac_list, out_rpc_ac_list;
  3440. return __generator(this, function (_a) {
  3441. switch (_a.label) {
  3442. case 0:
  3443. console.log("Begin: Test_SetAcList");
  3444. in_rpc_ac_list = new VPN.VpnRpcAcList({
  3445. HubName_str: hub_name,
  3446. ACList: [new VPN.VpnAc({
  3447. Deny_bool: true,
  3448. IpAddress_ip: "192.168.0.0",
  3449. SubnetMask_ip: "255.255.0.0",
  3450. Masked_bool: true,
  3451. Priority_u32: 123
  3452. }), new VPN.VpnAc({
  3453. Deny_bool: false,
  3454. IpAddress_ip: "fe80::",
  3455. SubnetMask_ip: "8",
  3456. Masked_bool: true,
  3457. Priority_u32: 123
  3458. }),]
  3459. });
  3460. return [4 /*yield*/, api.SetAcList(in_rpc_ac_list)];
  3461. case 1:
  3462. out_rpc_ac_list = _a.sent();
  3463. console.log(out_rpc_ac_list);
  3464. console.log("End: Test_SetAcList");
  3465. console.log("-----");
  3466. console.log();
  3467. return [2 /*return*/];
  3468. }
  3469. });
  3470. });
  3471. }
  3472. /** API test for 'GetAcList', Get access control list */
  3473. function Test_GetAcList() {
  3474. return __awaiter(this, void 0, void 0, function () {
  3475. var in_rpc_ac_list, out_rpc_ac_list;
  3476. return __generator(this, function (_a) {
  3477. switch (_a.label) {
  3478. case 0:
  3479. console.log("Begin: Test_GetAcList");
  3480. in_rpc_ac_list = new VPN.VpnRpcAcList({
  3481. HubName_str: hub_name
  3482. });
  3483. return [4 /*yield*/, api.GetAcList(in_rpc_ac_list)];
  3484. case 1:
  3485. out_rpc_ac_list = _a.sent();
  3486. console.log(out_rpc_ac_list);
  3487. console.log("End: Test_GetAcList");
  3488. console.log("-----");
  3489. console.log();
  3490. return [2 /*return*/];
  3491. }
  3492. });
  3493. });
  3494. }
  3495. /** API test for 'EnumLogFile', Enumerate log files */
  3496. function Test_EnumLogFile() {
  3497. return __awaiter(this, void 0, void 0, function () {
  3498. var out_rpc_enum_log_file;
  3499. return __generator(this, function (_a) {
  3500. switch (_a.label) {
  3501. case 0:
  3502. console.log("Begin: Test_EnumLogFile");
  3503. return [4 /*yield*/, api.EnumLogFile()];
  3504. case 1:
  3505. out_rpc_enum_log_file = _a.sent();
  3506. console.log(out_rpc_enum_log_file);
  3507. console.log("End: Test_EnumLogFile");
  3508. console.log("-----");
  3509. console.log();
  3510. return [2 /*return*/, out_rpc_enum_log_file];
  3511. }
  3512. });
  3513. });
  3514. }
  3515. /** API test for 'ReadLogFile', Read a log file */
  3516. function Test_ReadLogFile(filename) {
  3517. return __awaiter(this, void 0, void 0, function () {
  3518. var in_rpc_read_log_file, out_rpc_read_log_file;
  3519. return __generator(this, function (_a) {
  3520. switch (_a.label) {
  3521. case 0:
  3522. console.log("Begin: Test_ReadLogFile");
  3523. in_rpc_read_log_file = new VPN.VpnRpcReadLogFile({
  3524. FilePath_str: filename
  3525. });
  3526. return [4 /*yield*/, api.ReadLogFile(in_rpc_read_log_file)];
  3527. case 1:
  3528. out_rpc_read_log_file = _a.sent();
  3529. console.log(out_rpc_read_log_file);
  3530. console.log("End: Test_ReadLogFile");
  3531. console.log("-----");
  3532. console.log();
  3533. return [2 /*return*/];
  3534. }
  3535. });
  3536. });
  3537. }
  3538. /** API test for 'SetSysLog', Set syslog function setting */
  3539. function Test_SetSysLog(flag) {
  3540. return __awaiter(this, void 0, void 0, function () {
  3541. var in_syslog_setting, out_syslog_setting;
  3542. return __generator(this, function (_a) {
  3543. switch (_a.label) {
  3544. case 0:
  3545. console.log("Begin: Test_SetSysLog");
  3546. in_syslog_setting = new VPN.VpnSyslogSetting({
  3547. SaveType_u32: flag ? VPN.VpnSyslogSaveType.ServerAndHubAllLog : VPN.VpnSyslogSaveType.None,
  3548. Hostname_str: "1.2.3.4",
  3549. Port_u32: 123
  3550. });
  3551. return [4 /*yield*/, api.SetSysLog(in_syslog_setting)];
  3552. case 1:
  3553. out_syslog_setting = _a.sent();
  3554. console.log(out_syslog_setting);
  3555. console.log("End: Test_SetSysLog");
  3556. console.log("-----");
  3557. console.log();
  3558. return [2 /*return*/];
  3559. }
  3560. });
  3561. });
  3562. }
  3563. /** API test for 'GetSysLog', Get syslog function setting */
  3564. function Test_GetSysLog() {
  3565. return __awaiter(this, void 0, void 0, function () {
  3566. var in_syslog_setting, out_syslog_setting;
  3567. return __generator(this, function (_a) {
  3568. switch (_a.label) {
  3569. case 0:
  3570. console.log("Begin: Test_GetSysLog");
  3571. in_syslog_setting = new VPN.VpnSyslogSetting({});
  3572. return [4 /*yield*/, api.GetSysLog(in_syslog_setting)];
  3573. case 1:
  3574. out_syslog_setting = _a.sent();
  3575. console.log(out_syslog_setting);
  3576. console.log("End: Test_GetSysLog");
  3577. console.log("-----");
  3578. console.log();
  3579. return [2 /*return*/];
  3580. }
  3581. });
  3582. });
  3583. }
  3584. /** API test for 'SetHubMsg', Set message of today on hub */
  3585. function Test_SetHubMsg() {
  3586. return __awaiter(this, void 0, void 0, function () {
  3587. var in_rpc_msg, out_rpc_msg;
  3588. return __generator(this, function (_a) {
  3589. switch (_a.label) {
  3590. case 0:
  3591. console.log("Begin: Test_SetHubMsg");
  3592. in_rpc_msg = new VPN.VpnRpcMsg({
  3593. HubName_str: hub_name,
  3594. Msg_bin: new Uint8Array([0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x4d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x21, 0x20, 0xe4, 0xb8, 0x87, 0xe5, 0x9b, 0xbd, 0xe3, 0x81, 0xae, 0xe5, 0x8a, 0xb4, 0xe5, 0x83, 0x8d, 0xe8, 0x80, 0x85, 0xe3, 0x82, 0x88, 0xe3, 0x80, 0x81, 0xe5, 0x9b, 0xa3, 0xe7, 0xb5, 0x90, 0xe3, 0x81, 0x9b, 0xe3, 0x82, 0x88, 0x21, 0x20, 0xd7, 0x92, 0xd7, 0x91, 0xd7, 0xa8, 0xd7, 0x99, 0xd7, 0x9d, 0x20, 0xd7, 0xa2, 0xd7, 0x95, 0xd7, 0x91, 0xd7, 0x93, 0xd7, 0x99, 0xd7, 0x9d, 0x20, 0xd7, 0xa9, 0xd7, 0x9c, 0x20, 0xd7, 0x9b, 0xd7, 0x9c, 0x20, 0xd7, 0x94, 0xd7, 0x9e, 0xd7, 0x93, 0xd7, 0x99, 0xd7, 0xa0, 0xd7, 0x95, 0xd7, 0xaa, 0x2c, 0x20, 0xd7, 0x94, 0xd7, 0xaa, 0xd7, 0x90, 0xd7, 0x97, 0xd7, 0x93, 0xd7, 0x95, 0x21,])
  3595. });
  3596. return [4 /*yield*/, api.SetHubMsg(in_rpc_msg)];
  3597. case 1:
  3598. out_rpc_msg = _a.sent();
  3599. console.log(out_rpc_msg);
  3600. console.log("End: Test_SetHubMsg");
  3601. console.log("-----");
  3602. console.log();
  3603. return [2 /*return*/];
  3604. }
  3605. });
  3606. });
  3607. }
  3608. /** API test for 'GetHubMsg', Get message of today on hub */
  3609. function Test_GetHubMsg() {
  3610. return __awaiter(this, void 0, void 0, function () {
  3611. var in_rpc_msg, out_rpc_msg;
  3612. return __generator(this, function (_a) {
  3613. switch (_a.label) {
  3614. case 0:
  3615. console.log("Begin: Test_GetHubMsg");
  3616. in_rpc_msg = new VPN.VpnRpcMsg({
  3617. HubName_str: hub_name
  3618. });
  3619. return [4 /*yield*/, api.GetHubMsg(in_rpc_msg)];
  3620. case 1:
  3621. out_rpc_msg = _a.sent();
  3622. console.log(out_rpc_msg);
  3623. console.log("End: Test_GetHubMsg");
  3624. console.log("-----");
  3625. console.log();
  3626. return [2 /*return*/];
  3627. }
  3628. });
  3629. });
  3630. }
  3631. /** API test for 'Crash', Do Crash */
  3632. function Test_Crash() {
  3633. return __awaiter(this, void 0, void 0, function () {
  3634. var in_rpc_test, out_rpc_test;
  3635. return __generator(this, function (_a) {
  3636. switch (_a.label) {
  3637. case 0:
  3638. console.log("Begin: Test_Crash");
  3639. in_rpc_test = new VPN.VpnRpcTest({});
  3640. return [4 /*yield*/, api.Crash(in_rpc_test)];
  3641. case 1:
  3642. out_rpc_test = _a.sent();
  3643. console.log(out_rpc_test);
  3644. console.log("End: Test_Crash");
  3645. console.log("-----");
  3646. console.log();
  3647. return [2 /*return*/];
  3648. }
  3649. });
  3650. });
  3651. }
  3652. /** API test for 'GetAdminMsg', Get message for administrators */
  3653. function Test_GetAdminMsg() {
  3654. return __awaiter(this, void 0, void 0, function () {
  3655. var out_rpc_msg;
  3656. return __generator(this, function (_a) {
  3657. switch (_a.label) {
  3658. case 0:
  3659. console.log("Begin: Test_GetAdminMsg");
  3660. return [4 /*yield*/, api.GetAdminMsg()];
  3661. case 1:
  3662. out_rpc_msg = _a.sent();
  3663. console.log(out_rpc_msg);
  3664. console.log("End: Test_GetAdminMsg");
  3665. console.log("-----");
  3666. console.log();
  3667. return [2 /*return*/];
  3668. }
  3669. });
  3670. });
  3671. }
  3672. /** API test for 'Flush', Flush configuration file */
  3673. function Test_Flush() {
  3674. return __awaiter(this, void 0, void 0, function () {
  3675. var in_rpc_test, out_rpc_test;
  3676. return __generator(this, function (_a) {
  3677. switch (_a.label) {
  3678. case 0:
  3679. console.log("Begin: Test_Flush");
  3680. in_rpc_test = new VPN.VpnRpcTest({});
  3681. return [4 /*yield*/, api.Flush(in_rpc_test)];
  3682. case 1:
  3683. out_rpc_test = _a.sent();
  3684. console.log(out_rpc_test);
  3685. console.log("End: Test_Flush");
  3686. console.log("-----");
  3687. console.log();
  3688. return [2 /*return*/];
  3689. }
  3690. });
  3691. });
  3692. }
  3693. /** API test for 'SetIPsecServices', Set IPsec service configuration */
  3694. function Test_SetIPsecServices() {
  3695. return __awaiter(this, void 0, void 0, function () {
  3696. var in_ipsec_services, out_ipsec_services;
  3697. return __generator(this, function (_a) {
  3698. switch (_a.label) {
  3699. case 0:
  3700. console.log("Begin: Test_SetIPsecServices");
  3701. in_ipsec_services = new VPN.VpnIPsecServices({
  3702. L2TP_Raw_bool: false,
  3703. L2TP_IPsec_bool: false,
  3704. EtherIP_IPsec_bool: false,
  3705. IPsec_Secret_str: "vpn",
  3706. L2TP_DefaultHub_str: "HUB_ABC"
  3707. });
  3708. return [4 /*yield*/, api.SetIPsecServices(in_ipsec_services)];
  3709. case 1:
  3710. out_ipsec_services = _a.sent();
  3711. console.log(out_ipsec_services);
  3712. console.log("End: Test_SetIPsecServices");
  3713. console.log("-----");
  3714. console.log();
  3715. return [2 /*return*/];
  3716. }
  3717. });
  3718. });
  3719. }
  3720. /** API test for 'GetIPsecServices', Get IPsec service configuration */
  3721. function Test_GetIPsecServices() {
  3722. return __awaiter(this, void 0, void 0, function () {
  3723. var out_ipsec_services;
  3724. return __generator(this, function (_a) {
  3725. switch (_a.label) {
  3726. case 0:
  3727. console.log("Begin: Test_GetIPsecServices");
  3728. return [4 /*yield*/, api.GetIPsecServices()];
  3729. case 1:
  3730. out_ipsec_services = _a.sent();
  3731. console.log(out_ipsec_services);
  3732. console.log("End: Test_GetIPsecServices");
  3733. console.log("-----");
  3734. console.log();
  3735. return [2 /*return*/];
  3736. }
  3737. });
  3738. });
  3739. }
  3740. /** API test for 'AddEtherIpId', Add EtherIP ID setting */
  3741. function Test_AddEtherIpId() {
  3742. return __awaiter(this, void 0, void 0, function () {
  3743. var in_etherip_id, out_etherip_id;
  3744. return __generator(this, function (_a) {
  3745. switch (_a.label) {
  3746. case 0:
  3747. console.log("Begin: Test_AddEtherIpId");
  3748. in_etherip_id = new VPN.VpnEtherIpId({
  3749. Id_str: "testid",
  3750. HubName_str: hub_name,
  3751. UserName_str: "nekosan",
  3752. Password_str: "torisan"
  3753. });
  3754. return [4 /*yield*/, api.AddEtherIpId(in_etherip_id)];
  3755. case 1:
  3756. out_etherip_id = _a.sent();
  3757. console.log(out_etherip_id);
  3758. console.log("End: Test_AddEtherIpId");
  3759. console.log("-----");
  3760. console.log();
  3761. return [2 /*return*/];
  3762. }
  3763. });
  3764. });
  3765. }
  3766. /** API test for 'GetEtherIpId', Get EtherIP ID setting */
  3767. function Test_GetEtherIpId(id) {
  3768. return __awaiter(this, void 0, void 0, function () {
  3769. var in_etherip_id, out_etherip_id;
  3770. return __generator(this, function (_a) {
  3771. switch (_a.label) {
  3772. case 0:
  3773. console.log("Begin: Test_GetEtherIpId");
  3774. in_etherip_id = new VPN.VpnEtherIpId({
  3775. Id_str: id
  3776. });
  3777. return [4 /*yield*/, api.GetEtherIpId(in_etherip_id)];
  3778. case 1:
  3779. out_etherip_id = _a.sent();
  3780. console.log(out_etherip_id);
  3781. console.log("End: Test_GetEtherIpId");
  3782. console.log("-----");
  3783. console.log();
  3784. return [2 /*return*/];
  3785. }
  3786. });
  3787. });
  3788. }
  3789. /** API test for 'DeleteEtherIpId', Delete EtherIP ID setting */
  3790. function Test_DeleteEtherIpId(id) {
  3791. return __awaiter(this, void 0, void 0, function () {
  3792. var in_etherip_id, out_etherip_id;
  3793. return __generator(this, function (_a) {
  3794. switch (_a.label) {
  3795. case 0:
  3796. console.log("Begin: Test_DeleteEtherIpId");
  3797. in_etherip_id = new VPN.VpnEtherIpId({
  3798. Id_str: id
  3799. });
  3800. return [4 /*yield*/, api.DeleteEtherIpId(in_etherip_id)];
  3801. case 1:
  3802. out_etherip_id = _a.sent();
  3803. console.log(out_etherip_id);
  3804. console.log("End: Test_DeleteEtherIpId");
  3805. console.log("-----");
  3806. console.log();
  3807. return [2 /*return*/];
  3808. }
  3809. });
  3810. });
  3811. }
  3812. /** API test for 'EnumEtherIpId', Enumerate EtherIP ID settings */
  3813. function Test_EnumEtherIpId() {
  3814. return __awaiter(this, void 0, void 0, function () {
  3815. var out_rpc_enum_etherip_id;
  3816. return __generator(this, function (_a) {
  3817. switch (_a.label) {
  3818. case 0:
  3819. console.log("Begin: Test_EnumEtherIpId");
  3820. return [4 /*yield*/, api.EnumEtherIpId()];
  3821. case 1:
  3822. out_rpc_enum_etherip_id = _a.sent();
  3823. console.log(out_rpc_enum_etherip_id);
  3824. console.log("End: Test_EnumEtherIpId");
  3825. console.log("-----");
  3826. console.log();
  3827. return [2 /*return*/, out_rpc_enum_etherip_id];
  3828. }
  3829. });
  3830. });
  3831. }
  3832. /** API test for 'SetOpenVpnSstpConfig', Set configurations for OpenVPN and SSTP */
  3833. function Test_SetOpenVpnSstpConfig() {
  3834. return __awaiter(this, void 0, void 0, function () {
  3835. var in_openvpn_sstp_config, out_openvpn_sstp_config;
  3836. return __generator(this, function (_a) {
  3837. switch (_a.label) {
  3838. case 0:
  3839. console.log("Begin: Test_SetOpenVpnSstpConfig");
  3840. in_openvpn_sstp_config = new VPN.VpnOpenVpnSstpConfig({
  3841. EnableOpenVPN_bool: true,
  3842. OpenVPNPortList_str: "1 2 3 4 5",
  3843. EnableSSTP_bool: true
  3844. });
  3845. return [4 /*yield*/, api.SetOpenVpnSstpConfig(in_openvpn_sstp_config)];
  3846. case 1:
  3847. out_openvpn_sstp_config = _a.sent();
  3848. console.log(out_openvpn_sstp_config);
  3849. console.log("End: Test_SetOpenVpnSstpConfig");
  3850. console.log("-----");
  3851. console.log();
  3852. return [2 /*return*/];
  3853. }
  3854. });
  3855. });
  3856. }
  3857. /** API test for 'GetOpenVpnSstpConfig', Get configurations for OpenVPN and SSTP */
  3858. function Test_GetOpenVpnSstpConfig() {
  3859. return __awaiter(this, void 0, void 0, function () {
  3860. var out_openvpn_sstp_config;
  3861. return __generator(this, function (_a) {
  3862. switch (_a.label) {
  3863. case 0:
  3864. console.log("Begin: Test_GetOpenVpnSstpConfig");
  3865. return [4 /*yield*/, api.GetOpenVpnSstpConfig()];
  3866. case 1:
  3867. out_openvpn_sstp_config = _a.sent();
  3868. console.log(out_openvpn_sstp_config);
  3869. console.log("End: Test_GetOpenVpnSstpConfig");
  3870. console.log("-----");
  3871. console.log();
  3872. return [2 /*return*/];
  3873. }
  3874. });
  3875. });
  3876. }
  3877. /** API test for 'GetDDnsClientStatus', Get status of DDNS client */
  3878. function Test_GetDDnsClientStatus() {
  3879. return __awaiter(this, void 0, void 0, function () {
  3880. var out_ddns_client_status;
  3881. return __generator(this, function (_a) {
  3882. switch (_a.label) {
  3883. case 0:
  3884. console.log("Begin: Test_GetDDnsClientStatus");
  3885. return [4 /*yield*/, api.GetDDnsClientStatus()];
  3886. case 1:
  3887. out_ddns_client_status = _a.sent();
  3888. console.log(out_ddns_client_status);
  3889. console.log("End: Test_GetDDnsClientStatus");
  3890. console.log("-----");
  3891. console.log();
  3892. return [2 /*return*/];
  3893. }
  3894. });
  3895. });
  3896. }
  3897. /** API test for 'ChangeDDnsClientHostname', Change host-name for DDNS client */
  3898. function Test_ChangeDDnsClientHostname() {
  3899. return __awaiter(this, void 0, void 0, function () {
  3900. var in_rpc_test, out_rpc_test;
  3901. return __generator(this, function (_a) {
  3902. switch (_a.label) {
  3903. case 0:
  3904. console.log("Begin: Test_ChangeDDnsClientHostname");
  3905. in_rpc_test = new VPN.VpnRpcTest({
  3906. StrValue_str: "nekotest" + Math.floor((Math.random() * (2100000000 - 1000000000)) + 1000000000)
  3907. });
  3908. return [4 /*yield*/, api.ChangeDDnsClientHostname(in_rpc_test)];
  3909. case 1:
  3910. out_rpc_test = _a.sent();
  3911. console.log(out_rpc_test);
  3912. console.log("End: Test_ChangeDDnsClientHostname");
  3913. console.log("-----");
  3914. console.log();
  3915. return [2 /*return*/];
  3916. }
  3917. });
  3918. });
  3919. }
  3920. /** API test for 'RegenerateServerCert', Regenerate server certification */
  3921. function Test_RegenerateServerCert() {
  3922. return __awaiter(this, void 0, void 0, function () {
  3923. var in_rpc_test, out_rpc_test;
  3924. return __generator(this, function (_a) {
  3925. switch (_a.label) {
  3926. case 0:
  3927. console.log("Begin: Test_RegenerateServerCert");
  3928. in_rpc_test = new VPN.VpnRpcTest({
  3929. StrValue_str: "abc.example.org"
  3930. });
  3931. return [4 /*yield*/, api.RegenerateServerCert(in_rpc_test)];
  3932. case 1:
  3933. out_rpc_test = _a.sent();
  3934. console.log(out_rpc_test);
  3935. console.log("End: Test_RegenerateServerCert");
  3936. console.log("-----");
  3937. console.log();
  3938. return [2 /*return*/];
  3939. }
  3940. });
  3941. });
  3942. }
  3943. /** API test for 'MakeOpenVpnConfigFile', Generate OpenVPN configuration files */
  3944. function Test_MakeOpenVpnConfigFile() {
  3945. return __awaiter(this, void 0, void 0, function () {
  3946. var out_rpc_read_log_file;
  3947. return __generator(this, function (_a) {
  3948. switch (_a.label) {
  3949. case 0:
  3950. console.log("Begin: Test_MakeOpenVpnConfigFile");
  3951. return [4 /*yield*/, api.MakeOpenVpnConfigFile()];
  3952. case 1:
  3953. out_rpc_read_log_file = _a.sent();
  3954. console.log(out_rpc_read_log_file);
  3955. console.log("End: Test_MakeOpenVpnConfigFile");
  3956. console.log("-----");
  3957. console.log();
  3958. return [2 /*return*/];
  3959. }
  3960. });
  3961. });
  3962. }
  3963. /** API test for 'SetSpecialListener', Set special listener status */
  3964. function Test_SetSpecialListener() {
  3965. return __awaiter(this, void 0, void 0, function () {
  3966. var in_rpc_special_listener, out_rpc_special_listener;
  3967. return __generator(this, function (_a) {
  3968. switch (_a.label) {
  3969. case 0:
  3970. console.log("Begin: Test_SetSpecialListener");
  3971. in_rpc_special_listener = new VPN.VpnRpcSpecialListener({
  3972. VpnOverDnsListener_bool: true,
  3973. VpnOverIcmpListener_bool: true
  3974. });
  3975. return [4 /*yield*/, api.SetSpecialListener(in_rpc_special_listener)];
  3976. case 1:
  3977. out_rpc_special_listener = _a.sent();
  3978. console.log(out_rpc_special_listener);
  3979. console.log("End: Test_SetSpecialListener");
  3980. console.log("-----");
  3981. console.log();
  3982. return [2 /*return*/];
  3983. }
  3984. });
  3985. });
  3986. }
  3987. /** API test for 'GetSpecialListener', Get special listener status */
  3988. function Test_GetSpecialListener() {
  3989. return __awaiter(this, void 0, void 0, function () {
  3990. var out_rpc_special_listener;
  3991. return __generator(this, function (_a) {
  3992. switch (_a.label) {
  3993. case 0:
  3994. console.log("Begin: Test_GetSpecialListener");
  3995. return [4 /*yield*/, api.GetSpecialListener()];
  3996. case 1:
  3997. out_rpc_special_listener = _a.sent();
  3998. console.log(out_rpc_special_listener);
  3999. console.log("End: Test_GetSpecialListener");
  4000. console.log("-----");
  4001. console.log();
  4002. return [2 /*return*/];
  4003. }
  4004. });
  4005. });
  4006. }
  4007. /** API test for 'GetAzureStatus', Get Azure status */
  4008. function Test_GetAzureStatus() {
  4009. return __awaiter(this, void 0, void 0, function () {
  4010. var out_rpc_azure_status;
  4011. return __generator(this, function (_a) {
  4012. switch (_a.label) {
  4013. case 0:
  4014. console.log("Begin: Test_GetAzureStatus");
  4015. return [4 /*yield*/, api.GetAzureStatus()];
  4016. case 1:
  4017. out_rpc_azure_status = _a.sent();
  4018. console.log(out_rpc_azure_status);
  4019. console.log("End: Test_GetAzureStatus");
  4020. console.log("-----");
  4021. console.log();
  4022. return [2 /*return*/];
  4023. }
  4024. });
  4025. });
  4026. }
  4027. /** API test for 'SetAzureStatus', Set Azure status */
  4028. function Test_SetAzureStatus() {
  4029. return __awaiter(this, void 0, void 0, function () {
  4030. var in_rpc_azure_status, out_rpc_azure_status;
  4031. return __generator(this, function (_a) {
  4032. switch (_a.label) {
  4033. case 0:
  4034. console.log("Begin: Test_SetAzureStatus");
  4035. in_rpc_azure_status = new VPN.VpnRpcAzureStatus({
  4036. IsEnabled_bool: true
  4037. });
  4038. return [4 /*yield*/, api.SetAzureStatus(in_rpc_azure_status)];
  4039. case 1:
  4040. out_rpc_azure_status = _a.sent();
  4041. console.log(out_rpc_azure_status);
  4042. console.log("End: Test_SetAzureStatus");
  4043. console.log("-----");
  4044. console.log();
  4045. return [2 /*return*/];
  4046. }
  4047. });
  4048. });
  4049. }
  4050. /** API test for 'GetDDnsInternetSetting', Get DDNS proxy configuration */
  4051. function Test_GetDDnsInternetSetting() {
  4052. return __awaiter(this, void 0, void 0, function () {
  4053. var out_internet_setting;
  4054. return __generator(this, function (_a) {
  4055. switch (_a.label) {
  4056. case 0:
  4057. console.log("Begin: Test_GetDDnsInternetSetting");
  4058. return [4 /*yield*/, api.GetDDnsInternetSetting()];
  4059. case 1:
  4060. out_internet_setting = _a.sent();
  4061. console.log(out_internet_setting);
  4062. console.log("End: Test_GetDDnsInternetSetting");
  4063. console.log("-----");
  4064. console.log();
  4065. return [2 /*return*/];
  4066. }
  4067. });
  4068. });
  4069. }
  4070. /** API test for 'SetDDnsInternetSetting', Set DDNS proxy configuration */
  4071. function Test_SetDDnsInternetSetting() {
  4072. return __awaiter(this, void 0, void 0, function () {
  4073. var in_internet_setting, out_internet_setting;
  4074. return __generator(this, function (_a) {
  4075. switch (_a.label) {
  4076. case 0:
  4077. console.log("Begin: Test_SetDDnsInternetSetting");
  4078. in_internet_setting = new VPN.VpnInternetSetting({
  4079. ProxyType_u32: VPN.VpnRpcProxyType.Direct,
  4080. ProxyHostName_str: "1.2.3.4",
  4081. ProxyPort_u32: 1234,
  4082. ProxyUsername_str: "neko",
  4083. ProxyPassword_str: "dog"
  4084. });
  4085. return [4 /*yield*/, api.SetDDnsInternetSetting(in_internet_setting)];
  4086. case 1:
  4087. out_internet_setting = _a.sent();
  4088. console.log(out_internet_setting);
  4089. console.log("End: Test_SetDDnsInternetSetting");
  4090. console.log("-----");
  4091. console.log();
  4092. return [2 /*return*/];
  4093. }
  4094. });
  4095. });
  4096. }
  4097. /** API test for 'SetVgsConfig', Setting VPN Gate Server Configuration */
  4098. function Test_SetVgsConfig() {
  4099. return __awaiter(this, void 0, void 0, function () {
  4100. var in_vgs_config, out_vgs_config;
  4101. return __generator(this, function (_a) {
  4102. switch (_a.label) {
  4103. case 0:
  4104. console.log("Begin: Test_SetVgsConfig");
  4105. in_vgs_config = new VPN.VpnVgsConfig({
  4106. IsEnabled_bool: false,
  4107. Message_utf: "Neko san!!!",
  4108. Owner_utf: "Go go go!!!",
  4109. Abuse_utf: "[email protected]",
  4110. NoLog_bool: false,
  4111. LogPermanent_bool: true,
  4112. EnableL2TP_bool: true
  4113. });
  4114. return [4 /*yield*/, api.SetVgsConfig(in_vgs_config)];
  4115. case 1:
  4116. out_vgs_config = _a.sent();
  4117. console.log(out_vgs_config);
  4118. console.log("End: Test_SetVgsConfig");
  4119. console.log("-----");
  4120. console.log();
  4121. return [2 /*return*/];
  4122. }
  4123. });
  4124. });
  4125. }
  4126. /** API test for 'GetVgsConfig', Get VPN Gate configuration */
  4127. function Test_GetVgsConfig() {
  4128. return __awaiter(this, void 0, void 0, function () {
  4129. var out_vgs_config;
  4130. return __generator(this, function (_a) {
  4131. switch (_a.label) {
  4132. case 0:
  4133. console.log("Begin: Test_GetVgsConfig");
  4134. return [4 /*yield*/, api.GetVgsConfig()];
  4135. case 1:
  4136. out_vgs_config = _a.sent();
  4137. console.log(out_vgs_config);
  4138. console.log("End: Test_GetVgsConfig");
  4139. console.log("-----");
  4140. console.log();
  4141. return [2 /*return*/];
  4142. }
  4143. });
  4144. });
  4145. }
  4146. //# sourceMappingURL=sample.js.map