1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077 |
- /** @preserve This file is generated by the script
- * ../bin/generate-defs.js, which is not in general included in a
- * distribution, but is available in the source repository e.g. at
- * https://github.com/squaremo/amqp.node/
- */
- "use strict";
- function decodeBasicQos(buffer) {
- var val, offset = 0, fields = {
- prefetchSize: void 0,
- prefetchCount: void 0,
- global: void 0
- };
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.prefetchSize = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.prefetchCount = val;
- val = !!(1 & buffer[offset]);
- fields.global = val;
- return fields;
- }
- function encodeBasicQos(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(19);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932170, 7);
- offset = 11;
- val = fields.prefetchSize;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'prefetchSize' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- val = fields.prefetchCount;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'prefetchCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.global;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicQosOk(buffer) {
- return {};
- }
- function encodeBasicQosOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932171, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicConsume(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- consumerTag: void 0,
- noLocal: void 0,
- noAck: void 0,
- exclusive: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.consumerTag = val;
- val = !!(1 & buffer[offset]);
- fields.noLocal = val;
- val = !!(2 & buffer[offset]);
- fields.noAck = val;
- val = !!(4 & buffer[offset]);
- fields.exclusive = val;
- val = !!(8 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeBasicConsume(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- val = fields.consumerTag;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'consumerTag' is the wrong type; must be a string (up to 255 chars)");
- var consumerTag_len = Buffer.byteLength(val, "utf8");
- varyingSize += consumerTag_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932180, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.consumerTag;
- void 0 === val && (val = "");
- buffer[offset] = consumerTag_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += consumerTag_len;
- val = fields.noLocal;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.noAck;
- void 0 === val && (val = !1);
- val && (bits += 2);
- val = fields.exclusive;
- void 0 === val && (val = !1);
- val && (bits += 4);
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 8);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicConsumeOk(buffer) {
- var val, len, offset = 0, fields = {
- consumerTag: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.consumerTag = val;
- return fields;
- }
- function encodeBasicConsumeOk(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.consumerTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'consumerTag'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'consumerTag' is the wrong type; must be a string (up to 255 chars)");
- var consumerTag_len = Buffer.byteLength(val, "utf8");
- varyingSize += consumerTag_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932181, 7);
- offset = 11;
- val = fields.consumerTag;
- void 0 === val && (val = void 0);
- buffer[offset] = consumerTag_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += consumerTag_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicCancel(buffer) {
- var val, len, offset = 0, fields = {
- consumerTag: void 0,
- nowait: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.consumerTag = val;
- val = !!(1 & buffer[offset]);
- fields.nowait = val;
- return fields;
- }
- function encodeBasicCancel(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.consumerTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'consumerTag'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'consumerTag' is the wrong type; must be a string (up to 255 chars)");
- var consumerTag_len = Buffer.byteLength(val, "utf8");
- varyingSize += consumerTag_len;
- var buffer = Buffer.alloc(14 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932190, 7);
- offset = 11;
- val = fields.consumerTag;
- void 0 === val && (val = void 0);
- buffer[offset] = consumerTag_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += consumerTag_len;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicCancelOk(buffer) {
- var val, len, offset = 0, fields = {
- consumerTag: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.consumerTag = val;
- return fields;
- }
- function encodeBasicCancelOk(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.consumerTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'consumerTag'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'consumerTag' is the wrong type; must be a string (up to 255 chars)");
- var consumerTag_len = Buffer.byteLength(val, "utf8");
- varyingSize += consumerTag_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932191, 7);
- offset = 11;
- val = fields.consumerTag;
- void 0 === val && (val = void 0);
- buffer[offset] = consumerTag_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += consumerTag_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicPublish(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- exchange: void 0,
- routingKey: void 0,
- mandatory: void 0,
- immediate: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- val = !!(1 & buffer[offset]);
- fields.mandatory = val;
- val = !!(2 & buffer[offset]);
- fields.immediate = val;
- return fields;
- }
- function encodeBasicPublish(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.exchange;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932200, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.exchange;
- void 0 === val && (val = "");
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = "");
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- val = fields.mandatory;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.immediate;
- void 0 === val && (val = !1);
- val && (bits += 2);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicReturn(buffer) {
- var val, len, offset = 0, fields = {
- replyCode: void 0,
- replyText: void 0,
- exchange: void 0,
- routingKey: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.replyCode = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.replyText = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- return fields;
- }
- function encodeBasicReturn(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.replyText;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'replyText' is the wrong type; must be a string (up to 255 chars)");
- var replyText_len = Buffer.byteLength(val, "utf8");
- varyingSize += replyText_len;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'routingKey'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932210, 7);
- offset = 11;
- val = fields.replyCode;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'replyCode'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'replyCode' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.replyText;
- void 0 === val && (val = "");
- buffer[offset] = replyText_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += replyText_len;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = void 0);
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicDeliver(buffer) {
- var val, len, offset = 0, fields = {
- consumerTag: void 0,
- deliveryTag: void 0,
- redelivered: void 0,
- exchange: void 0,
- routingKey: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.consumerTag = val;
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.deliveryTag = val;
- val = !!(1 & buffer[offset]);
- fields.redelivered = val;
- offset++;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- return fields;
- }
- function encodeBasicDeliver(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.consumerTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'consumerTag'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'consumerTag' is the wrong type; must be a string (up to 255 chars)");
- var consumerTag_len = Buffer.byteLength(val, "utf8");
- varyingSize += consumerTag_len;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'routingKey'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- var buffer = Buffer.alloc(24 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932220, 7);
- offset = 11;
- val = fields.consumerTag;
- void 0 === val && (val = void 0);
- buffer[offset] = consumerTag_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += consumerTag_len;
- val = fields.deliveryTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'deliveryTag'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryTag' is the wrong type; must be a number (but not NaN)");
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- val = fields.redelivered;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = void 0);
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicGet(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- noAck: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- val = !!(1 & buffer[offset]);
- fields.noAck = val;
- return fields;
- }
- function encodeBasicGet(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932230, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.noAck;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicGetOk(buffer) {
- var val, len, offset = 0, fields = {
- deliveryTag: void 0,
- redelivered: void 0,
- exchange: void 0,
- routingKey: void 0,
- messageCount: void 0
- };
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.deliveryTag = val;
- val = !!(1 & buffer[offset]);
- fields.redelivered = val;
- offset++;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.messageCount = val;
- return fields;
- }
- function encodeBasicGetOk(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'routingKey'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- var buffer = Buffer.alloc(27 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932231, 7);
- offset = 11;
- val = fields.deliveryTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'deliveryTag'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryTag' is the wrong type; must be a number (but not NaN)");
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- val = fields.redelivered;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = void 0);
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- val = fields.messageCount;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'messageCount'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'messageCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicGetEmpty(buffer) {
- var val, len, offset = 0, fields = {
- clusterId: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.clusterId = val;
- return fields;
- }
- function encodeBasicGetEmpty(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.clusterId;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'clusterId' is the wrong type; must be a string (up to 255 chars)");
- var clusterId_len = Buffer.byteLength(val, "utf8");
- varyingSize += clusterId_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932232, 7);
- offset = 11;
- val = fields.clusterId;
- void 0 === val && (val = "");
- buffer[offset] = clusterId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += clusterId_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicAck(buffer) {
- var val, offset = 0, fields = {
- deliveryTag: void 0,
- multiple: void 0
- };
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.deliveryTag = val;
- val = !!(1 & buffer[offset]);
- fields.multiple = val;
- return fields;
- }
- function encodeBasicAck(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(21);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932240, 7);
- offset = 11;
- val = fields.deliveryTag;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryTag' is the wrong type; must be a number (but not NaN)");
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- val = fields.multiple;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicReject(buffer) {
- var val, offset = 0, fields = {
- deliveryTag: void 0,
- requeue: void 0
- };
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.deliveryTag = val;
- val = !!(1 & buffer[offset]);
- fields.requeue = val;
- return fields;
- }
- function encodeBasicReject(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(21);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932250, 7);
- offset = 11;
- val = fields.deliveryTag;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'deliveryTag'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryTag' is the wrong type; must be a number (but not NaN)");
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- val = fields.requeue;
- void 0 === val && (val = !0);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicRecoverAsync(buffer) {
- var val, fields = {
- requeue: void 0
- };
- val = !!(1 & buffer[0]);
- fields.requeue = val;
- return fields;
- }
- function encodeBasicRecoverAsync(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(13);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932260, 7);
- offset = 11;
- val = fields.requeue;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicRecover(buffer) {
- var val, fields = {
- requeue: void 0
- };
- val = !!(1 & buffer[0]);
- fields.requeue = val;
- return fields;
- }
- function encodeBasicRecover(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(13);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932270, 7);
- offset = 11;
- val = fields.requeue;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicRecoverOk(buffer) {
- return {};
- }
- function encodeBasicRecoverOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932271, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeBasicNack(buffer) {
- var val, offset = 0, fields = {
- deliveryTag: void 0,
- multiple: void 0,
- requeue: void 0
- };
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.deliveryTag = val;
- val = !!(1 & buffer[offset]);
- fields.multiple = val;
- val = !!(2 & buffer[offset]);
- fields.requeue = val;
- return fields;
- }
- function encodeBasicNack(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(21);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932280, 7);
- offset = 11;
- val = fields.deliveryTag;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryTag' is the wrong type; must be a number (but not NaN)");
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- val = fields.multiple;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.requeue;
- void 0 === val && (val = !0);
- val && (bits += 2);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionStart(buffer) {
- var val, len, offset = 0, fields = {
- versionMajor: void 0,
- versionMinor: void 0,
- serverProperties: void 0,
- mechanisms: void 0,
- locales: void 0
- };
- val = buffer[offset];
- offset++;
- fields.versionMajor = val;
- val = buffer[offset];
- offset++;
- fields.versionMinor = val;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.serverProperties = val;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.mechanisms = val;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.locales = val;
- return fields;
- }
- function encodeConnectionStart(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0, scratchOffset = 0;
- val = fields.serverProperties;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'serverProperties'");
- if ("object" != typeof val) throw new TypeError("Field 'serverProperties' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var serverProperties_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += serverProperties_encoded.length;
- val = fields.mechanisms;
- if (void 0 === val) val = Buffer.from("PLAIN"); else if (!Buffer.isBuffer(val)) throw new TypeError("Field 'mechanisms' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- val = fields.locales;
- if (void 0 === val) val = Buffer.from("en_US"); else if (!Buffer.isBuffer(val)) throw new TypeError("Field 'locales' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- var buffer = Buffer.alloc(22 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655370, 7);
- offset = 11;
- val = fields.versionMajor;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'versionMajor' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt8(val, offset);
- offset++;
- val = fields.versionMinor;
- if (void 0 === val) val = 9; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'versionMinor' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt8(val, offset);
- offset++;
- offset += serverProperties_encoded.copy(buffer, offset);
- val = fields.mechanisms;
- void 0 === val && (val = Buffer.from("PLAIN"));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- val = fields.locales;
- void 0 === val && (val = Buffer.from("en_US"));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionStartOk(buffer) {
- var val, len, offset = 0, fields = {
- clientProperties: void 0,
- mechanism: void 0,
- response: void 0,
- locale: void 0
- };
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.clientProperties = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.mechanism = val;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.response = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.locale = val;
- return fields;
- }
- function encodeConnectionStartOk(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0, scratchOffset = 0;
- val = fields.clientProperties;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'clientProperties'");
- if ("object" != typeof val) throw new TypeError("Field 'clientProperties' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var clientProperties_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += clientProperties_encoded.length;
- val = fields.mechanism;
- if (void 0 === val) val = "PLAIN"; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'mechanism' is the wrong type; must be a string (up to 255 chars)");
- var mechanism_len = Buffer.byteLength(val, "utf8");
- varyingSize += mechanism_len;
- val = fields.response;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'response'");
- if (!Buffer.isBuffer(val)) throw new TypeError("Field 'response' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- val = fields.locale;
- if (void 0 === val) val = "en_US"; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'locale' is the wrong type; must be a string (up to 255 chars)");
- var locale_len = Buffer.byteLength(val, "utf8");
- varyingSize += locale_len;
- var buffer = Buffer.alloc(18 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655371, 7);
- offset = 11;
- offset += clientProperties_encoded.copy(buffer, offset);
- val = fields.mechanism;
- void 0 === val && (val = "PLAIN");
- buffer[offset] = mechanism_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += mechanism_len;
- val = fields.response;
- void 0 === val && (val = Buffer.from(void 0));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- val = fields.locale;
- void 0 === val && (val = "en_US");
- buffer[offset] = locale_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += locale_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionSecure(buffer) {
- var val, len, offset = 0, fields = {
- challenge: void 0
- };
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.challenge = val;
- return fields;
- }
- function encodeConnectionSecure(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0;
- val = fields.challenge;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'challenge'");
- if (!Buffer.isBuffer(val)) throw new TypeError("Field 'challenge' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655380, 7);
- offset = 11;
- val = fields.challenge;
- void 0 === val && (val = Buffer.from(void 0));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionSecureOk(buffer) {
- var val, len, offset = 0, fields = {
- response: void 0
- };
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.response = val;
- return fields;
- }
- function encodeConnectionSecureOk(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0;
- val = fields.response;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'response'");
- if (!Buffer.isBuffer(val)) throw new TypeError("Field 'response' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655381, 7);
- offset = 11;
- val = fields.response;
- void 0 === val && (val = Buffer.from(void 0));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionTune(buffer) {
- var val, offset = 0, fields = {
- channelMax: void 0,
- frameMax: void 0,
- heartbeat: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.channelMax = val;
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.frameMax = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.heartbeat = val;
- return fields;
- }
- function encodeConnectionTune(channel, fields) {
- var offset = 0, val = null, buffer = Buffer.alloc(20);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655390, 7);
- offset = 11;
- val = fields.channelMax;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'channelMax' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.frameMax;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'frameMax' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- val = fields.heartbeat;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'heartbeat' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionTuneOk(buffer) {
- var val, offset = 0, fields = {
- channelMax: void 0,
- frameMax: void 0,
- heartbeat: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.channelMax = val;
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.frameMax = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.heartbeat = val;
- return fields;
- }
- function encodeConnectionTuneOk(channel, fields) {
- var offset = 0, val = null, buffer = Buffer.alloc(20);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655391, 7);
- offset = 11;
- val = fields.channelMax;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'channelMax' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.frameMax;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'frameMax' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- val = fields.heartbeat;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'heartbeat' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionOpen(buffer) {
- var val, len, offset = 0, fields = {
- virtualHost: void 0,
- capabilities: void 0,
- insist: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.virtualHost = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.capabilities = val;
- val = !!(1 & buffer[offset]);
- fields.insist = val;
- return fields;
- }
- function encodeConnectionOpen(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.virtualHost;
- if (void 0 === val) val = "/"; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'virtualHost' is the wrong type; must be a string (up to 255 chars)");
- var virtualHost_len = Buffer.byteLength(val, "utf8");
- varyingSize += virtualHost_len;
- val = fields.capabilities;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'capabilities' is the wrong type; must be a string (up to 255 chars)");
- var capabilities_len = Buffer.byteLength(val, "utf8");
- varyingSize += capabilities_len;
- var buffer = Buffer.alloc(15 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655400, 7);
- offset = 11;
- val = fields.virtualHost;
- void 0 === val && (val = "/");
- buffer[offset] = virtualHost_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += virtualHost_len;
- val = fields.capabilities;
- void 0 === val && (val = "");
- buffer[offset] = capabilities_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += capabilities_len;
- val = fields.insist;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionOpenOk(buffer) {
- var val, len, offset = 0, fields = {
- knownHosts: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.knownHosts = val;
- return fields;
- }
- function encodeConnectionOpenOk(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.knownHosts;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'knownHosts' is the wrong type; must be a string (up to 255 chars)");
- var knownHosts_len = Buffer.byteLength(val, "utf8");
- varyingSize += knownHosts_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655401, 7);
- offset = 11;
- val = fields.knownHosts;
- void 0 === val && (val = "");
- buffer[offset] = knownHosts_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += knownHosts_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionClose(buffer) {
- var val, len, offset = 0, fields = {
- replyCode: void 0,
- replyText: void 0,
- classId: void 0,
- methodId: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.replyCode = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.replyText = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.classId = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.methodId = val;
- return fields;
- }
- function encodeConnectionClose(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.replyText;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'replyText' is the wrong type; must be a string (up to 255 chars)");
- var replyText_len = Buffer.byteLength(val, "utf8");
- varyingSize += replyText_len;
- var buffer = Buffer.alloc(19 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655410, 7);
- offset = 11;
- val = fields.replyCode;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'replyCode'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'replyCode' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.replyText;
- void 0 === val && (val = "");
- buffer[offset] = replyText_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += replyText_len;
- val = fields.classId;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'classId'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'classId' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.methodId;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'methodId'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'methodId' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionCloseOk(buffer) {
- return {};
- }
- function encodeConnectionCloseOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655411, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionBlocked(buffer) {
- var val, len, offset = 0, fields = {
- reason: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.reason = val;
- return fields;
- }
- function encodeConnectionBlocked(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.reason;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'reason' is the wrong type; must be a string (up to 255 chars)");
- var reason_len = Buffer.byteLength(val, "utf8");
- varyingSize += reason_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655420, 7);
- offset = 11;
- val = fields.reason;
- void 0 === val && (val = "");
- buffer[offset] = reason_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += reason_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionUnblocked(buffer) {
- return {};
- }
- function encodeConnectionUnblocked(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655421, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionUpdateSecret(buffer) {
- var val, len, offset = 0, fields = {
- newSecret: void 0,
- reason: void 0
- };
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.newSecret = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.reason = val;
- return fields;
- }
- function encodeConnectionUpdateSecret(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0;
- val = fields.newSecret;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'newSecret'");
- if (!Buffer.isBuffer(val)) throw new TypeError("Field 'newSecret' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- val = fields.reason;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'reason'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'reason' is the wrong type; must be a string (up to 255 chars)");
- var reason_len = Buffer.byteLength(val, "utf8");
- varyingSize += reason_len;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655430, 7);
- offset = 11;
- val = fields.newSecret;
- void 0 === val && (val = Buffer.from(void 0));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- val = fields.reason;
- void 0 === val && (val = void 0);
- buffer[offset] = reason_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += reason_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConnectionUpdateSecretOk(buffer) {
- return {};
- }
- function encodeConnectionUpdateSecretOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(655431, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelOpen(buffer) {
- var val, len, offset = 0, fields = {
- outOfBand: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.outOfBand = val;
- return fields;
- }
- function encodeChannelOpen(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.outOfBand;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'outOfBand' is the wrong type; must be a string (up to 255 chars)");
- var outOfBand_len = Buffer.byteLength(val, "utf8");
- varyingSize += outOfBand_len;
- var buffer = Buffer.alloc(13 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310730, 7);
- offset = 11;
- val = fields.outOfBand;
- void 0 === val && (val = "");
- buffer[offset] = outOfBand_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += outOfBand_len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelOpenOk(buffer) {
- var val, len, offset = 0, fields = {
- channelId: void 0
- };
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = buffer.subarray(offset, offset + len);
- offset += len;
- fields.channelId = val;
- return fields;
- }
- function encodeChannelOpenOk(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0;
- val = fields.channelId;
- if (void 0 === val) val = Buffer.from(""); else if (!Buffer.isBuffer(val)) throw new TypeError("Field 'channelId' is the wrong type; must be a Buffer");
- varyingSize += val.length;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310731, 7);
- offset = 11;
- val = fields.channelId;
- void 0 === val && (val = Buffer.from(""));
- len = val.length;
- buffer.writeUInt32BE(len, offset);
- offset += 4;
- val.copy(buffer, offset);
- offset += len;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelFlow(buffer) {
- var val, fields = {
- active: void 0
- };
- val = !!(1 & buffer[0]);
- fields.active = val;
- return fields;
- }
- function encodeChannelFlow(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(13);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310740, 7);
- offset = 11;
- val = fields.active;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'active'");
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelFlowOk(buffer) {
- var val, fields = {
- active: void 0
- };
- val = !!(1 & buffer[0]);
- fields.active = val;
- return fields;
- }
- function encodeChannelFlowOk(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(13);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310741, 7);
- offset = 11;
- val = fields.active;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'active'");
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelClose(buffer) {
- var val, len, offset = 0, fields = {
- replyCode: void 0,
- replyText: void 0,
- classId: void 0,
- methodId: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.replyCode = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.replyText = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.classId = val;
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.methodId = val;
- return fields;
- }
- function encodeChannelClose(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.replyText;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'replyText' is the wrong type; must be a string (up to 255 chars)");
- var replyText_len = Buffer.byteLength(val, "utf8");
- varyingSize += replyText_len;
- var buffer = Buffer.alloc(19 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310760, 7);
- offset = 11;
- val = fields.replyCode;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'replyCode'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'replyCode' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.replyText;
- void 0 === val && (val = "");
- buffer[offset] = replyText_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += replyText_len;
- val = fields.classId;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'classId'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'classId' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.methodId;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'methodId'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'methodId' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeChannelCloseOk(buffer) {
- return {};
- }
- function encodeChannelCloseOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1310761, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeAccessRequest(buffer) {
- var val, len, offset = 0, fields = {
- realm: void 0,
- exclusive: void 0,
- passive: void 0,
- active: void 0,
- write: void 0,
- read: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.realm = val;
- val = !!(1 & buffer[offset]);
- fields.exclusive = val;
- val = !!(2 & buffer[offset]);
- fields.passive = val;
- val = !!(4 & buffer[offset]);
- fields.active = val;
- val = !!(8 & buffer[offset]);
- fields.write = val;
- val = !!(16 & buffer[offset]);
- fields.read = val;
- return fields;
- }
- function encodeAccessRequest(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.realm;
- if (void 0 === val) val = "/data"; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'realm' is the wrong type; must be a string (up to 255 chars)");
- var realm_len = Buffer.byteLength(val, "utf8");
- varyingSize += realm_len;
- var buffer = Buffer.alloc(14 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1966090, 7);
- offset = 11;
- val = fields.realm;
- void 0 === val && (val = "/data");
- buffer[offset] = realm_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += realm_len;
- val = fields.exclusive;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.passive;
- void 0 === val && (val = !0);
- val && (bits += 2);
- val = fields.active;
- void 0 === val && (val = !0);
- val && (bits += 4);
- val = fields.write;
- void 0 === val && (val = !0);
- val && (bits += 8);
- val = fields.read;
- void 0 === val && (val = !0);
- val && (bits += 16);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeAccessRequestOk(buffer) {
- var val, offset = 0, fields = {
- ticket: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- return fields;
- }
- function encodeAccessRequestOk(channel, fields) {
- var offset = 0, val = null, buffer = Buffer.alloc(14);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(1966091, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 1; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeDeclare(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- exchange: void 0,
- type: void 0,
- passive: void 0,
- durable: void 0,
- autoDelete: void 0,
- internal: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.type = val;
- val = !!(1 & buffer[offset]);
- fields.passive = val;
- val = !!(2 & buffer[offset]);
- fields.durable = val;
- val = !!(4 & buffer[offset]);
- fields.autoDelete = val;
- val = !!(8 & buffer[offset]);
- fields.internal = val;
- val = !!(16 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeExchangeDeclare(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.type;
- if (void 0 === val) val = "direct"; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'type' is the wrong type; must be a string (up to 255 chars)");
- var type_len = Buffer.byteLength(val, "utf8");
- varyingSize += type_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621450, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.type;
- void 0 === val && (val = "direct");
- buffer[offset] = type_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += type_len;
- val = fields.passive;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.durable;
- void 0 === val && (val = !1);
- val && (bits += 2);
- val = fields.autoDelete;
- void 0 === val && (val = !1);
- val && (bits += 4);
- val = fields.internal;
- void 0 === val && (val = !1);
- val && (bits += 8);
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 16);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeDeclareOk(buffer) {
- return {};
- }
- function encodeExchangeDeclareOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621451, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeDelete(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- exchange: void 0,
- ifUnused: void 0,
- nowait: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- val = !!(1 & buffer[offset]);
- fields.ifUnused = val;
- val = !!(2 & buffer[offset]);
- fields.nowait = val;
- return fields;
- }
- function encodeExchangeDelete(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621460, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.ifUnused;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 2);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeDeleteOk(buffer) {
- return {};
- }
- function encodeExchangeDeleteOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621461, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeBind(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- destination: void 0,
- source: void 0,
- routingKey: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.destination = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.source = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- val = !!(1 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeExchangeBind(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.destination;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'destination'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'destination' is the wrong type; must be a string (up to 255 chars)");
- var destination_len = Buffer.byteLength(val, "utf8");
- varyingSize += destination_len;
- val = fields.source;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'source'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'source' is the wrong type; must be a string (up to 255 chars)");
- var source_len = Buffer.byteLength(val, "utf8");
- varyingSize += source_len;
- val = fields.routingKey;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(18 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621470, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.destination;
- void 0 === val && (val = void 0);
- buffer[offset] = destination_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += destination_len;
- val = fields.source;
- void 0 === val && (val = void 0);
- buffer[offset] = source_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += source_len;
- val = fields.routingKey;
- void 0 === val && (val = "");
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeBindOk(buffer) {
- return {};
- }
- function encodeExchangeBindOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621471, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeUnbind(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- destination: void 0,
- source: void 0,
- routingKey: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.destination = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.source = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- val = !!(1 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeExchangeUnbind(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.destination;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'destination'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'destination' is the wrong type; must be a string (up to 255 chars)");
- var destination_len = Buffer.byteLength(val, "utf8");
- varyingSize += destination_len;
- val = fields.source;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'source'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'source' is the wrong type; must be a string (up to 255 chars)");
- var source_len = Buffer.byteLength(val, "utf8");
- varyingSize += source_len;
- val = fields.routingKey;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(18 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621480, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.destination;
- void 0 === val && (val = void 0);
- buffer[offset] = destination_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += destination_len;
- val = fields.source;
- void 0 === val && (val = void 0);
- buffer[offset] = source_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += source_len;
- val = fields.routingKey;
- void 0 === val && (val = "");
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeExchangeUnbindOk(buffer) {
- return {};
- }
- function encodeExchangeUnbindOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(2621491, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueDeclare(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- passive: void 0,
- durable: void 0,
- exclusive: void 0,
- autoDelete: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- val = !!(1 & buffer[offset]);
- fields.passive = val;
- val = !!(2 & buffer[offset]);
- fields.durable = val;
- val = !!(4 & buffer[offset]);
- fields.exclusive = val;
- val = !!(8 & buffer[offset]);
- fields.autoDelete = val;
- val = !!(16 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeQueueDeclare(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276810, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.passive;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.durable;
- void 0 === val && (val = !1);
- val && (bits += 2);
- val = fields.exclusive;
- void 0 === val && (val = !1);
- val && (bits += 4);
- val = fields.autoDelete;
- void 0 === val && (val = !1);
- val && (bits += 8);
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 16);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueDeclareOk(buffer) {
- var val, len, offset = 0, fields = {
- queue: void 0,
- messageCount: void 0,
- consumerCount: void 0
- };
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.messageCount = val;
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.consumerCount = val;
- return fields;
- }
- function encodeQueueDeclareOk(channel, fields) {
- var offset = 0, val = null, varyingSize = 0;
- val = fields.queue;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'queue'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- var buffer = Buffer.alloc(21 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276811, 7);
- offset = 11;
- val = fields.queue;
- void 0 === val && (val = void 0);
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.messageCount;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'messageCount'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'messageCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- val = fields.consumerCount;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'consumerCount'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'consumerCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueBind(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- exchange: void 0,
- routingKey: void 0,
- nowait: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- val = !!(1 & buffer[offset]);
- fields.nowait = val;
- offset++;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeQueueBind(channel, fields) {
- var len, offset = 0, val = null, bits = 0, varyingSize = 0, scratchOffset = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(18 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276820, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = "");
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- bits = 0;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueBindOk(buffer) {
- return {};
- }
- function encodeQueueBindOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276821, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueuePurge(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- nowait: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- val = !!(1 & buffer[offset]);
- fields.nowait = val;
- return fields;
- }
- function encodeQueuePurge(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276830, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueuePurgeOk(buffer) {
- var val, offset = 0, fields = {
- messageCount: void 0
- };
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.messageCount = val;
- return fields;
- }
- function encodeQueuePurgeOk(channel, fields) {
- var offset = 0, val = null, buffer = Buffer.alloc(16);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276831, 7);
- offset = 11;
- val = fields.messageCount;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'messageCount'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'messageCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueDelete(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- ifUnused: void 0,
- ifEmpty: void 0,
- nowait: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- val = !!(1 & buffer[offset]);
- fields.ifUnused = val;
- val = !!(2 & buffer[offset]);
- fields.ifEmpty = val;
- val = !!(4 & buffer[offset]);
- fields.nowait = val;
- return fields;
- }
- function encodeQueueDelete(channel, fields) {
- var offset = 0, val = null, bits = 0, varyingSize = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- var buffer = Buffer.alloc(16 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276840, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.ifUnused;
- void 0 === val && (val = !1);
- val && (bits += 1);
- val = fields.ifEmpty;
- void 0 === val && (val = !1);
- val && (bits += 2);
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 4);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueDeleteOk(buffer) {
- var val, offset = 0, fields = {
- messageCount: void 0
- };
- val = buffer.readUInt32BE(offset);
- offset += 4;
- fields.messageCount = val;
- return fields;
- }
- function encodeQueueDeleteOk(channel, fields) {
- var offset = 0, val = null, buffer = Buffer.alloc(16);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276841, 7);
- offset = 11;
- val = fields.messageCount;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'messageCount'");
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'messageCount' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt32BE(val, offset);
- offset += 4;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueUnbind(buffer) {
- var val, len, offset = 0, fields = {
- ticket: void 0,
- queue: void 0,
- exchange: void 0,
- routingKey: void 0,
- arguments: void 0
- };
- val = buffer.readUInt16BE(offset);
- offset += 2;
- fields.ticket = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.queue = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.exchange = val;
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.routingKey = val;
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.arguments = val;
- return fields;
- }
- function encodeQueueUnbind(channel, fields) {
- var len, offset = 0, val = null, varyingSize = 0, scratchOffset = 0;
- val = fields.queue;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'queue' is the wrong type; must be a string (up to 255 chars)");
- var queue_len = Buffer.byteLength(val, "utf8");
- varyingSize += queue_len;
- val = fields.exchange;
- if (void 0 === val) throw new Error("Missing value for mandatory field 'exchange'");
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'exchange' is the wrong type; must be a string (up to 255 chars)");
- var exchange_len = Buffer.byteLength(val, "utf8");
- varyingSize += exchange_len;
- val = fields.routingKey;
- if (void 0 === val) val = ""; else if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'routingKey' is the wrong type; must be a string (up to 255 chars)");
- var routingKey_len = Buffer.byteLength(val, "utf8");
- varyingSize += routingKey_len;
- val = fields.arguments;
- if (void 0 === val) val = {}; else if ("object" != typeof val) throw new TypeError("Field 'arguments' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var arguments_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += arguments_encoded.length;
- var buffer = Buffer.alloc(17 + varyingSize);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276850, 7);
- offset = 11;
- val = fields.ticket;
- if (void 0 === val) val = 0; else if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'ticket' is the wrong type; must be a number (but not NaN)");
- buffer.writeUInt16BE(val, offset);
- offset += 2;
- val = fields.queue;
- void 0 === val && (val = "");
- buffer[offset] = queue_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += queue_len;
- val = fields.exchange;
- void 0 === val && (val = void 0);
- buffer[offset] = exchange_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += exchange_len;
- val = fields.routingKey;
- void 0 === val && (val = "");
- buffer[offset] = routingKey_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += routingKey_len;
- offset += arguments_encoded.copy(buffer, offset);
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeQueueUnbindOk(buffer) {
- return {};
- }
- function encodeQueueUnbindOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3276851, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxSelect(buffer) {
- return {};
- }
- function encodeTxSelect(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898250, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxSelectOk(buffer) {
- return {};
- }
- function encodeTxSelectOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898251, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxCommit(buffer) {
- return {};
- }
- function encodeTxCommit(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898260, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxCommitOk(buffer) {
- return {};
- }
- function encodeTxCommitOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898261, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxRollback(buffer) {
- return {};
- }
- function encodeTxRollback(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898270, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeTxRollbackOk(buffer) {
- return {};
- }
- function encodeTxRollbackOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5898271, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConfirmSelect(buffer) {
- var val, fields = {
- nowait: void 0
- };
- val = !!(1 & buffer[0]);
- fields.nowait = val;
- return fields;
- }
- function encodeConfirmSelect(channel, fields) {
- var offset = 0, val = null, bits = 0, buffer = Buffer.alloc(13);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5570570, 7);
- offset = 11;
- val = fields.nowait;
- void 0 === val && (val = !1);
- val && (bits += 1);
- buffer[offset] = bits;
- offset++;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function decodeConfirmSelectOk(buffer) {
- return {};
- }
- function encodeConfirmSelectOk(channel, fields) {
- var offset = 0, buffer = Buffer.alloc(12);
- buffer[0] = 1;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(5570571, 7);
- offset = 11;
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- return buffer;
- }
- function encodeBasicProperties(channel, size, fields) {
- var val, len, offset = 0, flags = 0, scratchOffset = 0, varyingSize = 0;
- val = fields.contentType;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'contentType' is the wrong type; must be a string (up to 255 chars)");
- var contentType_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += contentType_len;
- }
- val = fields.contentEncoding;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'contentEncoding' is the wrong type; must be a string (up to 255 chars)");
- var contentEncoding_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += contentEncoding_len;
- }
- val = fields.headers;
- if (void 0 != val) {
- if ("object" != typeof val) throw new TypeError("Field 'headers' is the wrong type; must be an object");
- len = encodeTable(SCRATCH, val, scratchOffset);
- var headers_encoded = SCRATCH.slice(scratchOffset, scratchOffset + len);
- scratchOffset += len;
- varyingSize += headers_encoded.length;
- }
- val = fields.deliveryMode;
- if (void 0 != val) {
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'deliveryMode' is the wrong type; must be a number (but not NaN)");
- varyingSize += 1;
- }
- val = fields.priority;
- if (void 0 != val) {
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'priority' is the wrong type; must be a number (but not NaN)");
- varyingSize += 1;
- }
- val = fields.correlationId;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'correlationId' is the wrong type; must be a string (up to 255 chars)");
- var correlationId_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += correlationId_len;
- }
- val = fields.replyTo;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'replyTo' is the wrong type; must be a string (up to 255 chars)");
- var replyTo_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += replyTo_len;
- }
- val = fields.expiration;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'expiration' is the wrong type; must be a string (up to 255 chars)");
- var expiration_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += expiration_len;
- }
- val = fields.messageId;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'messageId' is the wrong type; must be a string (up to 255 chars)");
- var messageId_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += messageId_len;
- }
- val = fields.timestamp;
- if (void 0 != val) {
- if ("number" != typeof val || isNaN(val)) throw new TypeError("Field 'timestamp' is the wrong type; must be a number (but not NaN)");
- varyingSize += 8;
- }
- val = fields.type;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'type' is the wrong type; must be a string (up to 255 chars)");
- var type_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += type_len;
- }
- val = fields.userId;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'userId' is the wrong type; must be a string (up to 255 chars)");
- var userId_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += userId_len;
- }
- val = fields.appId;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'appId' is the wrong type; must be a string (up to 255 chars)");
- var appId_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += appId_len;
- }
- val = fields.clusterId;
- if (void 0 != val) {
- if (!("string" == typeof val && Buffer.byteLength(val) < 256)) throw new TypeError("Field 'clusterId' is the wrong type; must be a string (up to 255 chars)");
- var clusterId_len = Buffer.byteLength(val, "utf8");
- varyingSize += 1;
- varyingSize += clusterId_len;
- }
- var buffer = Buffer.alloc(22 + varyingSize);
- buffer[0] = 2;
- buffer.writeUInt16BE(channel, 1);
- buffer.writeUInt32BE(3932160, 7);
- ints.writeUInt64BE(buffer, size, 11);
- flags = 0;
- offset = 21;
- val = fields.contentType;
- if (void 0 != val) {
- flags += 32768;
- buffer[offset] = contentType_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += contentType_len;
- }
- val = fields.contentEncoding;
- if (void 0 != val) {
- flags += 16384;
- buffer[offset] = contentEncoding_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += contentEncoding_len;
- }
- val = fields.headers;
- if (void 0 != val) {
- flags += 8192;
- offset += headers_encoded.copy(buffer, offset);
- }
- val = fields.deliveryMode;
- if (void 0 != val) {
- flags += 4096;
- buffer.writeUInt8(val, offset);
- offset++;
- }
- val = fields.priority;
- if (void 0 != val) {
- flags += 2048;
- buffer.writeUInt8(val, offset);
- offset++;
- }
- val = fields.correlationId;
- if (void 0 != val) {
- flags += 1024;
- buffer[offset] = correlationId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += correlationId_len;
- }
- val = fields.replyTo;
- if (void 0 != val) {
- flags += 512;
- buffer[offset] = replyTo_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += replyTo_len;
- }
- val = fields.expiration;
- if (void 0 != val) {
- flags += 256;
- buffer[offset] = expiration_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += expiration_len;
- }
- val = fields.messageId;
- if (void 0 != val) {
- flags += 128;
- buffer[offset] = messageId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += messageId_len;
- }
- val = fields.timestamp;
- if (void 0 != val) {
- flags += 64;
- ints.writeUInt64BE(buffer, val, offset);
- offset += 8;
- }
- val = fields.type;
- if (void 0 != val) {
- flags += 32;
- buffer[offset] = type_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += type_len;
- }
- val = fields.userId;
- if (void 0 != val) {
- flags += 16;
- buffer[offset] = userId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += userId_len;
- }
- val = fields.appId;
- if (void 0 != val) {
- flags += 8;
- buffer[offset] = appId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += appId_len;
- }
- val = fields.clusterId;
- if (void 0 != val) {
- flags += 4;
- buffer[offset] = clusterId_len;
- offset++;
- buffer.write(val, offset, "utf8");
- offset += clusterId_len;
- }
- buffer[offset] = 206;
- buffer.writeUInt32BE(offset - 7, 3);
- buffer.writeUInt16BE(flags, 19);
- return buffer.subarray(0, offset + 1);
- }
- function decodeBasicProperties(buffer) {
- var flags, val, len, offset = 2;
- flags = buffer.readUInt16BE(0);
- if (0 === flags) return {};
- var fields = {
- contentType: void 0,
- contentEncoding: void 0,
- headers: void 0,
- deliveryMode: void 0,
- priority: void 0,
- correlationId: void 0,
- replyTo: void 0,
- expiration: void 0,
- messageId: void 0,
- timestamp: void 0,
- type: void 0,
- userId: void 0,
- appId: void 0,
- clusterId: void 0
- };
- if (32768 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.contentType = val;
- }
- if (16384 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.contentEncoding = val;
- }
- if (8192 & flags) {
- len = buffer.readUInt32BE(offset);
- offset += 4;
- val = decodeFields(buffer.subarray(offset, offset + len));
- offset += len;
- fields.headers = val;
- }
- if (4096 & flags) {
- val = buffer[offset];
- offset++;
- fields.deliveryMode = val;
- }
- if (2048 & flags) {
- val = buffer[offset];
- offset++;
- fields.priority = val;
- }
- if (1024 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.correlationId = val;
- }
- if (512 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.replyTo = val;
- }
- if (256 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.expiration = val;
- }
- if (128 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.messageId = val;
- }
- if (64 & flags) {
- val = ints.readUInt64BE(buffer, offset);
- offset += 8;
- fields.timestamp = val;
- }
- if (32 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.type = val;
- }
- if (16 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.userId = val;
- }
- if (8 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.appId = val;
- }
- if (4 & flags) {
- len = buffer.readUInt8(offset);
- offset++;
- val = buffer.toString("utf8", offset, offset + len);
- offset += len;
- fields.clusterId = val;
- }
- return fields;
- }
- var codec = require("./codec"), ints = require("buffer-more-ints"), encodeTable = codec.encodeTable, decodeFields = codec.decodeFields, SCRATCH = Buffer.alloc(65536), EMPTY_OBJECT = Object.freeze({});
- module.exports.constants = {
- FRAME_METHOD: 1,
- FRAME_HEADER: 2,
- FRAME_BODY: 3,
- FRAME_HEARTBEAT: 8,
- FRAME_MIN_SIZE: 4096,
- FRAME_END: 206,
- REPLY_SUCCESS: 200,
- CONTENT_TOO_LARGE: 311,
- NO_ROUTE: 312,
- NO_CONSUMERS: 313,
- ACCESS_REFUSED: 403,
- NOT_FOUND: 404,
- RESOURCE_LOCKED: 405,
- PRECONDITION_FAILED: 406,
- CONNECTION_FORCED: 320,
- INVALID_PATH: 402,
- FRAME_ERROR: 501,
- SYNTAX_ERROR: 502,
- COMMAND_INVALID: 503,
- CHANNEL_ERROR: 504,
- UNEXPECTED_FRAME: 505,
- RESOURCE_ERROR: 506,
- NOT_ALLOWED: 530,
- NOT_IMPLEMENTED: 540,
- INTERNAL_ERROR: 541
- };
- module.exports.constant_strs = {
- "1": "FRAME-METHOD",
- "2": "FRAME-HEADER",
- "3": "FRAME-BODY",
- "8": "FRAME-HEARTBEAT",
- "200": "REPLY-SUCCESS",
- "206": "FRAME-END",
- "311": "CONTENT-TOO-LARGE",
- "312": "NO-ROUTE",
- "313": "NO-CONSUMERS",
- "320": "CONNECTION-FORCED",
- "402": "INVALID-PATH",
- "403": "ACCESS-REFUSED",
- "404": "NOT-FOUND",
- "405": "RESOURCE-LOCKED",
- "406": "PRECONDITION-FAILED",
- "501": "FRAME-ERROR",
- "502": "SYNTAX-ERROR",
- "503": "COMMAND-INVALID",
- "504": "CHANNEL-ERROR",
- "505": "UNEXPECTED-FRAME",
- "506": "RESOURCE-ERROR",
- "530": "NOT-ALLOWED",
- "540": "NOT-IMPLEMENTED",
- "541": "INTERNAL-ERROR",
- "4096": "FRAME-MIN-SIZE"
- };
- module.exports.FRAME_OVERHEAD = 8;
- module.exports.decode = function(id, buf) {
- switch (id) {
- case 3932170:
- return decodeBasicQos(buf);
- case 3932171:
- return decodeBasicQosOk(buf);
- case 3932180:
- return decodeBasicConsume(buf);
- case 3932181:
- return decodeBasicConsumeOk(buf);
- case 3932190:
- return decodeBasicCancel(buf);
- case 3932191:
- return decodeBasicCancelOk(buf);
- case 3932200:
- return decodeBasicPublish(buf);
- case 3932210:
- return decodeBasicReturn(buf);
- case 3932220:
- return decodeBasicDeliver(buf);
- case 3932230:
- return decodeBasicGet(buf);
- case 3932231:
- return decodeBasicGetOk(buf);
- case 3932232:
- return decodeBasicGetEmpty(buf);
- case 3932240:
- return decodeBasicAck(buf);
- case 3932250:
- return decodeBasicReject(buf);
- case 3932260:
- return decodeBasicRecoverAsync(buf);
- case 3932270:
- return decodeBasicRecover(buf);
- case 3932271:
- return decodeBasicRecoverOk(buf);
- case 3932280:
- return decodeBasicNack(buf);
- case 655370:
- return decodeConnectionStart(buf);
- case 655371:
- return decodeConnectionStartOk(buf);
- case 655380:
- return decodeConnectionSecure(buf);
- case 655381:
- return decodeConnectionSecureOk(buf);
- case 655390:
- return decodeConnectionTune(buf);
- case 655391:
- return decodeConnectionTuneOk(buf);
- case 655400:
- return decodeConnectionOpen(buf);
- case 655401:
- return decodeConnectionOpenOk(buf);
- case 655410:
- return decodeConnectionClose(buf);
- case 655411:
- return decodeConnectionCloseOk(buf);
- case 655420:
- return decodeConnectionBlocked(buf);
- case 655421:
- return decodeConnectionUnblocked(buf);
- case 655430:
- return decodeConnectionUpdateSecret(buf);
- case 655431:
- return decodeConnectionUpdateSecretOk(buf);
- case 1310730:
- return decodeChannelOpen(buf);
- case 1310731:
- return decodeChannelOpenOk(buf);
- case 1310740:
- return decodeChannelFlow(buf);
- case 1310741:
- return decodeChannelFlowOk(buf);
- case 1310760:
- return decodeChannelClose(buf);
- case 1310761:
- return decodeChannelCloseOk(buf);
- case 1966090:
- return decodeAccessRequest(buf);
- case 1966091:
- return decodeAccessRequestOk(buf);
- case 2621450:
- return decodeExchangeDeclare(buf);
- case 2621451:
- return decodeExchangeDeclareOk(buf);
- case 2621460:
- return decodeExchangeDelete(buf);
- case 2621461:
- return decodeExchangeDeleteOk(buf);
- case 2621470:
- return decodeExchangeBind(buf);
- case 2621471:
- return decodeExchangeBindOk(buf);
- case 2621480:
- return decodeExchangeUnbind(buf);
- case 2621491:
- return decodeExchangeUnbindOk(buf);
- case 3276810:
- return decodeQueueDeclare(buf);
- case 3276811:
- return decodeQueueDeclareOk(buf);
- case 3276820:
- return decodeQueueBind(buf);
- case 3276821:
- return decodeQueueBindOk(buf);
- case 3276830:
- return decodeQueuePurge(buf);
- case 3276831:
- return decodeQueuePurgeOk(buf);
- case 3276840:
- return decodeQueueDelete(buf);
- case 3276841:
- return decodeQueueDeleteOk(buf);
- case 3276850:
- return decodeQueueUnbind(buf);
- case 3276851:
- return decodeQueueUnbindOk(buf);
- case 5898250:
- return decodeTxSelect(buf);
- case 5898251:
- return decodeTxSelectOk(buf);
- case 5898260:
- return decodeTxCommit(buf);
- case 5898261:
- return decodeTxCommitOk(buf);
- case 5898270:
- return decodeTxRollback(buf);
- case 5898271:
- return decodeTxRollbackOk(buf);
- case 5570570:
- return decodeConfirmSelect(buf);
- case 5570571:
- return decodeConfirmSelectOk(buf);
- case 60:
- return decodeBasicProperties(buf);
- default:
- throw new Error("Unknown class/method ID");
- }
- };
- module.exports.encodeMethod = function(id, channel, fields) {
- switch (id) {
- case 3932170:
- return encodeBasicQos(channel, fields);
- case 3932171:
- return encodeBasicQosOk(channel, fields);
- case 3932180:
- return encodeBasicConsume(channel, fields);
- case 3932181:
- return encodeBasicConsumeOk(channel, fields);
- case 3932190:
- return encodeBasicCancel(channel, fields);
- case 3932191:
- return encodeBasicCancelOk(channel, fields);
- case 3932200:
- return encodeBasicPublish(channel, fields);
- case 3932210:
- return encodeBasicReturn(channel, fields);
- case 3932220:
- return encodeBasicDeliver(channel, fields);
- case 3932230:
- return encodeBasicGet(channel, fields);
- case 3932231:
- return encodeBasicGetOk(channel, fields);
- case 3932232:
- return encodeBasicGetEmpty(channel, fields);
- case 3932240:
- return encodeBasicAck(channel, fields);
- case 3932250:
- return encodeBasicReject(channel, fields);
- case 3932260:
- return encodeBasicRecoverAsync(channel, fields);
- case 3932270:
- return encodeBasicRecover(channel, fields);
- case 3932271:
- return encodeBasicRecoverOk(channel, fields);
- case 3932280:
- return encodeBasicNack(channel, fields);
- case 655370:
- return encodeConnectionStart(channel, fields);
- case 655371:
- return encodeConnectionStartOk(channel, fields);
- case 655380:
- return encodeConnectionSecure(channel, fields);
- case 655381:
- return encodeConnectionSecureOk(channel, fields);
- case 655390:
- return encodeConnectionTune(channel, fields);
- case 655391:
- return encodeConnectionTuneOk(channel, fields);
- case 655400:
- return encodeConnectionOpen(channel, fields);
- case 655401:
- return encodeConnectionOpenOk(channel, fields);
- case 655410:
- return encodeConnectionClose(channel, fields);
- case 655411:
- return encodeConnectionCloseOk(channel, fields);
- case 655420:
- return encodeConnectionBlocked(channel, fields);
- case 655421:
- return encodeConnectionUnblocked(channel, fields);
- case 655430:
- return encodeConnectionUpdateSecret(channel, fields);
- case 655431:
- return encodeConnectionUpdateSecretOk(channel, fields);
- case 1310730:
- return encodeChannelOpen(channel, fields);
- case 1310731:
- return encodeChannelOpenOk(channel, fields);
- case 1310740:
- return encodeChannelFlow(channel, fields);
- case 1310741:
- return encodeChannelFlowOk(channel, fields);
- case 1310760:
- return encodeChannelClose(channel, fields);
- case 1310761:
- return encodeChannelCloseOk(channel, fields);
- case 1966090:
- return encodeAccessRequest(channel, fields);
- case 1966091:
- return encodeAccessRequestOk(channel, fields);
- case 2621450:
- return encodeExchangeDeclare(channel, fields);
- case 2621451:
- return encodeExchangeDeclareOk(channel, fields);
- case 2621460:
- return encodeExchangeDelete(channel, fields);
- case 2621461:
- return encodeExchangeDeleteOk(channel, fields);
- case 2621470:
- return encodeExchangeBind(channel, fields);
- case 2621471:
- return encodeExchangeBindOk(channel, fields);
- case 2621480:
- return encodeExchangeUnbind(channel, fields);
- case 2621491:
- return encodeExchangeUnbindOk(channel, fields);
- case 3276810:
- return encodeQueueDeclare(channel, fields);
- case 3276811:
- return encodeQueueDeclareOk(channel, fields);
- case 3276820:
- return encodeQueueBind(channel, fields);
- case 3276821:
- return encodeQueueBindOk(channel, fields);
- case 3276830:
- return encodeQueuePurge(channel, fields);
- case 3276831:
- return encodeQueuePurgeOk(channel, fields);
- case 3276840:
- return encodeQueueDelete(channel, fields);
- case 3276841:
- return encodeQueueDeleteOk(channel, fields);
- case 3276850:
- return encodeQueueUnbind(channel, fields);
- case 3276851:
- return encodeQueueUnbindOk(channel, fields);
- case 5898250:
- return encodeTxSelect(channel, fields);
- case 5898251:
- return encodeTxSelectOk(channel, fields);
- case 5898260:
- return encodeTxCommit(channel, fields);
- case 5898261:
- return encodeTxCommitOk(channel, fields);
- case 5898270:
- return encodeTxRollback(channel, fields);
- case 5898271:
- return encodeTxRollbackOk(channel, fields);
- case 5570570:
- return encodeConfirmSelect(channel, fields);
- case 5570571:
- return encodeConfirmSelectOk(channel, fields);
- default:
- throw new Error("Unknown class/method ID");
- }
- };
- module.exports.encodeProperties = function(id, channel, size, fields) {
- switch (id) {
- case 60:
- return encodeBasicProperties(channel, size, fields);
- default:
- throw new Error("Unknown class/properties ID");
- }
- };
- module.exports.info = function(id) {
- switch (id) {
- case 3932170:
- return methodInfoBasicQos;
- case 3932171:
- return methodInfoBasicQosOk;
- case 3932180:
- return methodInfoBasicConsume;
- case 3932181:
- return methodInfoBasicConsumeOk;
- case 3932190:
- return methodInfoBasicCancel;
- case 3932191:
- return methodInfoBasicCancelOk;
- case 3932200:
- return methodInfoBasicPublish;
- case 3932210:
- return methodInfoBasicReturn;
- case 3932220:
- return methodInfoBasicDeliver;
- case 3932230:
- return methodInfoBasicGet;
- case 3932231:
- return methodInfoBasicGetOk;
- case 3932232:
- return methodInfoBasicGetEmpty;
- case 3932240:
- return methodInfoBasicAck;
- case 3932250:
- return methodInfoBasicReject;
- case 3932260:
- return methodInfoBasicRecoverAsync;
- case 3932270:
- return methodInfoBasicRecover;
- case 3932271:
- return methodInfoBasicRecoverOk;
- case 3932280:
- return methodInfoBasicNack;
- case 655370:
- return methodInfoConnectionStart;
- case 655371:
- return methodInfoConnectionStartOk;
- case 655380:
- return methodInfoConnectionSecure;
- case 655381:
- return methodInfoConnectionSecureOk;
- case 655390:
- return methodInfoConnectionTune;
- case 655391:
- return methodInfoConnectionTuneOk;
- case 655400:
- return methodInfoConnectionOpen;
- case 655401:
- return methodInfoConnectionOpenOk;
- case 655410:
- return methodInfoConnectionClose;
- case 655411:
- return methodInfoConnectionCloseOk;
- case 655420:
- return methodInfoConnectionBlocked;
- case 655421:
- return methodInfoConnectionUnblocked;
- case 655430:
- return methodInfoConnectionUpdateSecret;
- case 655431:
- return methodInfoConnectionUpdateSecretOk;
- case 1310730:
- return methodInfoChannelOpen;
- case 1310731:
- return methodInfoChannelOpenOk;
- case 1310740:
- return methodInfoChannelFlow;
- case 1310741:
- return methodInfoChannelFlowOk;
- case 1310760:
- return methodInfoChannelClose;
- case 1310761:
- return methodInfoChannelCloseOk;
- case 1966090:
- return methodInfoAccessRequest;
- case 1966091:
- return methodInfoAccessRequestOk;
- case 2621450:
- return methodInfoExchangeDeclare;
- case 2621451:
- return methodInfoExchangeDeclareOk;
- case 2621460:
- return methodInfoExchangeDelete;
- case 2621461:
- return methodInfoExchangeDeleteOk;
- case 2621470:
- return methodInfoExchangeBind;
- case 2621471:
- return methodInfoExchangeBindOk;
- case 2621480:
- return methodInfoExchangeUnbind;
- case 2621491:
- return methodInfoExchangeUnbindOk;
- case 3276810:
- return methodInfoQueueDeclare;
- case 3276811:
- return methodInfoQueueDeclareOk;
- case 3276820:
- return methodInfoQueueBind;
- case 3276821:
- return methodInfoQueueBindOk;
- case 3276830:
- return methodInfoQueuePurge;
- case 3276831:
- return methodInfoQueuePurgeOk;
- case 3276840:
- return methodInfoQueueDelete;
- case 3276841:
- return methodInfoQueueDeleteOk;
- case 3276850:
- return methodInfoQueueUnbind;
- case 3276851:
- return methodInfoQueueUnbindOk;
- case 5898250:
- return methodInfoTxSelect;
- case 5898251:
- return methodInfoTxSelectOk;
- case 5898260:
- return methodInfoTxCommit;
- case 5898261:
- return methodInfoTxCommitOk;
- case 5898270:
- return methodInfoTxRollback;
- case 5898271:
- return methodInfoTxRollbackOk;
- case 5570570:
- return methodInfoConfirmSelect;
- case 5570571:
- return methodInfoConfirmSelectOk;
- case 60:
- return propertiesInfoBasicProperties;
- default:
- throw new Error("Unknown class/method ID");
- }
- };
- module.exports.BasicQos = 3932170;
- var methodInfoBasicQos = module.exports.methodInfoBasicQos = {
- id: 3932170,
- classId: 60,
- methodId: 10,
- name: "BasicQos",
- args: [ {
- type: "long",
- name: "prefetchSize",
- default: 0
- }, {
- type: "short",
- name: "prefetchCount",
- default: 0
- }, {
- type: "bit",
- name: "global",
- default: !1
- } ]
- };
- module.exports.BasicQosOk = 3932171;
- var methodInfoBasicQosOk = module.exports.methodInfoBasicQosOk = {
- id: 3932171,
- classId: 60,
- methodId: 11,
- name: "BasicQosOk",
- args: []
- };
- module.exports.BasicConsume = 3932180;
- var methodInfoBasicConsume = module.exports.methodInfoBasicConsume = {
- id: 3932180,
- classId: 60,
- methodId: 20,
- name: "BasicConsume",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "shortstr",
- name: "consumerTag",
- default: ""
- }, {
- type: "bit",
- name: "noLocal",
- default: !1
- }, {
- type: "bit",
- name: "noAck",
- default: !1
- }, {
- type: "bit",
- name: "exclusive",
- default: !1
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.BasicConsumeOk = 3932181;
- var methodInfoBasicConsumeOk = module.exports.methodInfoBasicConsumeOk = {
- id: 3932181,
- classId: 60,
- methodId: 21,
- name: "BasicConsumeOk",
- args: [ {
- type: "shortstr",
- name: "consumerTag"
- } ]
- };
- module.exports.BasicCancel = 3932190;
- var methodInfoBasicCancel = module.exports.methodInfoBasicCancel = {
- id: 3932190,
- classId: 60,
- methodId: 30,
- name: "BasicCancel",
- args: [ {
- type: "shortstr",
- name: "consumerTag"
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- } ]
- };
- module.exports.BasicCancelOk = 3932191;
- var methodInfoBasicCancelOk = module.exports.methodInfoBasicCancelOk = {
- id: 3932191,
- classId: 60,
- methodId: 31,
- name: "BasicCancelOk",
- args: [ {
- type: "shortstr",
- name: "consumerTag"
- } ]
- };
- module.exports.BasicPublish = 3932200;
- var methodInfoBasicPublish = module.exports.methodInfoBasicPublish = {
- id: 3932200,
- classId: 60,
- methodId: 40,
- name: "BasicPublish",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "exchange",
- default: ""
- }, {
- type: "shortstr",
- name: "routingKey",
- default: ""
- }, {
- type: "bit",
- name: "mandatory",
- default: !1
- }, {
- type: "bit",
- name: "immediate",
- default: !1
- } ]
- };
- module.exports.BasicReturn = 3932210;
- var methodInfoBasicReturn = module.exports.methodInfoBasicReturn = {
- id: 3932210,
- classId: 60,
- methodId: 50,
- name: "BasicReturn",
- args: [ {
- type: "short",
- name: "replyCode"
- }, {
- type: "shortstr",
- name: "replyText",
- default: ""
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "routingKey"
- } ]
- };
- module.exports.BasicDeliver = 3932220;
- var methodInfoBasicDeliver = module.exports.methodInfoBasicDeliver = {
- id: 3932220,
- classId: 60,
- methodId: 60,
- name: "BasicDeliver",
- args: [ {
- type: "shortstr",
- name: "consumerTag"
- }, {
- type: "longlong",
- name: "deliveryTag"
- }, {
- type: "bit",
- name: "redelivered",
- default: !1
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "routingKey"
- } ]
- };
- module.exports.BasicGet = 3932230;
- var methodInfoBasicGet = module.exports.methodInfoBasicGet = {
- id: 3932230,
- classId: 60,
- methodId: 70,
- name: "BasicGet",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "bit",
- name: "noAck",
- default: !1
- } ]
- };
- module.exports.BasicGetOk = 3932231;
- var methodInfoBasicGetOk = module.exports.methodInfoBasicGetOk = {
- id: 3932231,
- classId: 60,
- methodId: 71,
- name: "BasicGetOk",
- args: [ {
- type: "longlong",
- name: "deliveryTag"
- }, {
- type: "bit",
- name: "redelivered",
- default: !1
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "routingKey"
- }, {
- type: "long",
- name: "messageCount"
- } ]
- };
- module.exports.BasicGetEmpty = 3932232;
- var methodInfoBasicGetEmpty = module.exports.methodInfoBasicGetEmpty = {
- id: 3932232,
- classId: 60,
- methodId: 72,
- name: "BasicGetEmpty",
- args: [ {
- type: "shortstr",
- name: "clusterId",
- default: ""
- } ]
- };
- module.exports.BasicAck = 3932240;
- var methodInfoBasicAck = module.exports.methodInfoBasicAck = {
- id: 3932240,
- classId: 60,
- methodId: 80,
- name: "BasicAck",
- args: [ {
- type: "longlong",
- name: "deliveryTag",
- default: 0
- }, {
- type: "bit",
- name: "multiple",
- default: !1
- } ]
- };
- module.exports.BasicReject = 3932250;
- var methodInfoBasicReject = module.exports.methodInfoBasicReject = {
- id: 3932250,
- classId: 60,
- methodId: 90,
- name: "BasicReject",
- args: [ {
- type: "longlong",
- name: "deliveryTag"
- }, {
- type: "bit",
- name: "requeue",
- default: !0
- } ]
- };
- module.exports.BasicRecoverAsync = 3932260;
- var methodInfoBasicRecoverAsync = module.exports.methodInfoBasicRecoverAsync = {
- id: 3932260,
- classId: 60,
- methodId: 100,
- name: "BasicRecoverAsync",
- args: [ {
- type: "bit",
- name: "requeue",
- default: !1
- } ]
- };
- module.exports.BasicRecover = 3932270;
- var methodInfoBasicRecover = module.exports.methodInfoBasicRecover = {
- id: 3932270,
- classId: 60,
- methodId: 110,
- name: "BasicRecover",
- args: [ {
- type: "bit",
- name: "requeue",
- default: !1
- } ]
- };
- module.exports.BasicRecoverOk = 3932271;
- var methodInfoBasicRecoverOk = module.exports.methodInfoBasicRecoverOk = {
- id: 3932271,
- classId: 60,
- methodId: 111,
- name: "BasicRecoverOk",
- args: []
- };
- module.exports.BasicNack = 3932280;
- var methodInfoBasicNack = module.exports.methodInfoBasicNack = {
- id: 3932280,
- classId: 60,
- methodId: 120,
- name: "BasicNack",
- args: [ {
- type: "longlong",
- name: "deliveryTag",
- default: 0
- }, {
- type: "bit",
- name: "multiple",
- default: !1
- }, {
- type: "bit",
- name: "requeue",
- default: !0
- } ]
- };
- module.exports.ConnectionStart = 655370;
- var methodInfoConnectionStart = module.exports.methodInfoConnectionStart = {
- id: 655370,
- classId: 10,
- methodId: 10,
- name: "ConnectionStart",
- args: [ {
- type: "octet",
- name: "versionMajor",
- default: 0
- }, {
- type: "octet",
- name: "versionMinor",
- default: 9
- }, {
- type: "table",
- name: "serverProperties"
- }, {
- type: "longstr",
- name: "mechanisms",
- default: "PLAIN"
- }, {
- type: "longstr",
- name: "locales",
- default: "en_US"
- } ]
- };
- module.exports.ConnectionStartOk = 655371;
- var methodInfoConnectionStartOk = module.exports.methodInfoConnectionStartOk = {
- id: 655371,
- classId: 10,
- methodId: 11,
- name: "ConnectionStartOk",
- args: [ {
- type: "table",
- name: "clientProperties"
- }, {
- type: "shortstr",
- name: "mechanism",
- default: "PLAIN"
- }, {
- type: "longstr",
- name: "response"
- }, {
- type: "shortstr",
- name: "locale",
- default: "en_US"
- } ]
- };
- module.exports.ConnectionSecure = 655380;
- var methodInfoConnectionSecure = module.exports.methodInfoConnectionSecure = {
- id: 655380,
- classId: 10,
- methodId: 20,
- name: "ConnectionSecure",
- args: [ {
- type: "longstr",
- name: "challenge"
- } ]
- };
- module.exports.ConnectionSecureOk = 655381;
- var methodInfoConnectionSecureOk = module.exports.methodInfoConnectionSecureOk = {
- id: 655381,
- classId: 10,
- methodId: 21,
- name: "ConnectionSecureOk",
- args: [ {
- type: "longstr",
- name: "response"
- } ]
- };
- module.exports.ConnectionTune = 655390;
- var methodInfoConnectionTune = module.exports.methodInfoConnectionTune = {
- id: 655390,
- classId: 10,
- methodId: 30,
- name: "ConnectionTune",
- args: [ {
- type: "short",
- name: "channelMax",
- default: 0
- }, {
- type: "long",
- name: "frameMax",
- default: 0
- }, {
- type: "short",
- name: "heartbeat",
- default: 0
- } ]
- };
- module.exports.ConnectionTuneOk = 655391;
- var methodInfoConnectionTuneOk = module.exports.methodInfoConnectionTuneOk = {
- id: 655391,
- classId: 10,
- methodId: 31,
- name: "ConnectionTuneOk",
- args: [ {
- type: "short",
- name: "channelMax",
- default: 0
- }, {
- type: "long",
- name: "frameMax",
- default: 0
- }, {
- type: "short",
- name: "heartbeat",
- default: 0
- } ]
- };
- module.exports.ConnectionOpen = 655400;
- var methodInfoConnectionOpen = module.exports.methodInfoConnectionOpen = {
- id: 655400,
- classId: 10,
- methodId: 40,
- name: "ConnectionOpen",
- args: [ {
- type: "shortstr",
- name: "virtualHost",
- default: "/"
- }, {
- type: "shortstr",
- name: "capabilities",
- default: ""
- }, {
- type: "bit",
- name: "insist",
- default: !1
- } ]
- };
- module.exports.ConnectionOpenOk = 655401;
- var methodInfoConnectionOpenOk = module.exports.methodInfoConnectionOpenOk = {
- id: 655401,
- classId: 10,
- methodId: 41,
- name: "ConnectionOpenOk",
- args: [ {
- type: "shortstr",
- name: "knownHosts",
- default: ""
- } ]
- };
- module.exports.ConnectionClose = 655410;
- var methodInfoConnectionClose = module.exports.methodInfoConnectionClose = {
- id: 655410,
- classId: 10,
- methodId: 50,
- name: "ConnectionClose",
- args: [ {
- type: "short",
- name: "replyCode"
- }, {
- type: "shortstr",
- name: "replyText",
- default: ""
- }, {
- type: "short",
- name: "classId"
- }, {
- type: "short",
- name: "methodId"
- } ]
- };
- module.exports.ConnectionCloseOk = 655411;
- var methodInfoConnectionCloseOk = module.exports.methodInfoConnectionCloseOk = {
- id: 655411,
- classId: 10,
- methodId: 51,
- name: "ConnectionCloseOk",
- args: []
- };
- module.exports.ConnectionBlocked = 655420;
- var methodInfoConnectionBlocked = module.exports.methodInfoConnectionBlocked = {
- id: 655420,
- classId: 10,
- methodId: 60,
- name: "ConnectionBlocked",
- args: [ {
- type: "shortstr",
- name: "reason",
- default: ""
- } ]
- };
- module.exports.ConnectionUnblocked = 655421;
- var methodInfoConnectionUnblocked = module.exports.methodInfoConnectionUnblocked = {
- id: 655421,
- classId: 10,
- methodId: 61,
- name: "ConnectionUnblocked",
- args: []
- };
- module.exports.ConnectionUpdateSecret = 655430;
- var methodInfoConnectionUpdateSecret = module.exports.methodInfoConnectionUpdateSecret = {
- id: 655430,
- classId: 10,
- methodId: 70,
- name: "ConnectionUpdateSecret",
- args: [ {
- type: "longstr",
- name: "newSecret"
- }, {
- type: "shortstr",
- name: "reason"
- } ]
- };
- module.exports.ConnectionUpdateSecretOk = 655431;
- var methodInfoConnectionUpdateSecretOk = module.exports.methodInfoConnectionUpdateSecretOk = {
- id: 655431,
- classId: 10,
- methodId: 71,
- name: "ConnectionUpdateSecretOk",
- args: []
- };
- module.exports.ChannelOpen = 1310730;
- var methodInfoChannelOpen = module.exports.methodInfoChannelOpen = {
- id: 1310730,
- classId: 20,
- methodId: 10,
- name: "ChannelOpen",
- args: [ {
- type: "shortstr",
- name: "outOfBand",
- default: ""
- } ]
- };
- module.exports.ChannelOpenOk = 1310731;
- var methodInfoChannelOpenOk = module.exports.methodInfoChannelOpenOk = {
- id: 1310731,
- classId: 20,
- methodId: 11,
- name: "ChannelOpenOk",
- args: [ {
- type: "longstr",
- name: "channelId",
- default: ""
- } ]
- };
- module.exports.ChannelFlow = 1310740;
- var methodInfoChannelFlow = module.exports.methodInfoChannelFlow = {
- id: 1310740,
- classId: 20,
- methodId: 20,
- name: "ChannelFlow",
- args: [ {
- type: "bit",
- name: "active"
- } ]
- };
- module.exports.ChannelFlowOk = 1310741;
- var methodInfoChannelFlowOk = module.exports.methodInfoChannelFlowOk = {
- id: 1310741,
- classId: 20,
- methodId: 21,
- name: "ChannelFlowOk",
- args: [ {
- type: "bit",
- name: "active"
- } ]
- };
- module.exports.ChannelClose = 1310760;
- var methodInfoChannelClose = module.exports.methodInfoChannelClose = {
- id: 1310760,
- classId: 20,
- methodId: 40,
- name: "ChannelClose",
- args: [ {
- type: "short",
- name: "replyCode"
- }, {
- type: "shortstr",
- name: "replyText",
- default: ""
- }, {
- type: "short",
- name: "classId"
- }, {
- type: "short",
- name: "methodId"
- } ]
- };
- module.exports.ChannelCloseOk = 1310761;
- var methodInfoChannelCloseOk = module.exports.methodInfoChannelCloseOk = {
- id: 1310761,
- classId: 20,
- methodId: 41,
- name: "ChannelCloseOk",
- args: []
- };
- module.exports.AccessRequest = 1966090;
- var methodInfoAccessRequest = module.exports.methodInfoAccessRequest = {
- id: 1966090,
- classId: 30,
- methodId: 10,
- name: "AccessRequest",
- args: [ {
- type: "shortstr",
- name: "realm",
- default: "/data"
- }, {
- type: "bit",
- name: "exclusive",
- default: !1
- }, {
- type: "bit",
- name: "passive",
- default: !0
- }, {
- type: "bit",
- name: "active",
- default: !0
- }, {
- type: "bit",
- name: "write",
- default: !0
- }, {
- type: "bit",
- name: "read",
- default: !0
- } ]
- };
- module.exports.AccessRequestOk = 1966091;
- var methodInfoAccessRequestOk = module.exports.methodInfoAccessRequestOk = {
- id: 1966091,
- classId: 30,
- methodId: 11,
- name: "AccessRequestOk",
- args: [ {
- type: "short",
- name: "ticket",
- default: 1
- } ]
- };
- module.exports.ExchangeDeclare = 2621450;
- var methodInfoExchangeDeclare = module.exports.methodInfoExchangeDeclare = {
- id: 2621450,
- classId: 40,
- methodId: 10,
- name: "ExchangeDeclare",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "type",
- default: "direct"
- }, {
- type: "bit",
- name: "passive",
- default: !1
- }, {
- type: "bit",
- name: "durable",
- default: !1
- }, {
- type: "bit",
- name: "autoDelete",
- default: !1
- }, {
- type: "bit",
- name: "internal",
- default: !1
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.ExchangeDeclareOk = 2621451;
- var methodInfoExchangeDeclareOk = module.exports.methodInfoExchangeDeclareOk = {
- id: 2621451,
- classId: 40,
- methodId: 11,
- name: "ExchangeDeclareOk",
- args: []
- };
- module.exports.ExchangeDelete = 2621460;
- var methodInfoExchangeDelete = module.exports.methodInfoExchangeDelete = {
- id: 2621460,
- classId: 40,
- methodId: 20,
- name: "ExchangeDelete",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "bit",
- name: "ifUnused",
- default: !1
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- } ]
- };
- module.exports.ExchangeDeleteOk = 2621461;
- var methodInfoExchangeDeleteOk = module.exports.methodInfoExchangeDeleteOk = {
- id: 2621461,
- classId: 40,
- methodId: 21,
- name: "ExchangeDeleteOk",
- args: []
- };
- module.exports.ExchangeBind = 2621470;
- var methodInfoExchangeBind = module.exports.methodInfoExchangeBind = {
- id: 2621470,
- classId: 40,
- methodId: 30,
- name: "ExchangeBind",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "destination"
- }, {
- type: "shortstr",
- name: "source"
- }, {
- type: "shortstr",
- name: "routingKey",
- default: ""
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.ExchangeBindOk = 2621471;
- var methodInfoExchangeBindOk = module.exports.methodInfoExchangeBindOk = {
- id: 2621471,
- classId: 40,
- methodId: 31,
- name: "ExchangeBindOk",
- args: []
- };
- module.exports.ExchangeUnbind = 2621480;
- var methodInfoExchangeUnbind = module.exports.methodInfoExchangeUnbind = {
- id: 2621480,
- classId: 40,
- methodId: 40,
- name: "ExchangeUnbind",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "destination"
- }, {
- type: "shortstr",
- name: "source"
- }, {
- type: "shortstr",
- name: "routingKey",
- default: ""
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.ExchangeUnbindOk = 2621491;
- var methodInfoExchangeUnbindOk = module.exports.methodInfoExchangeUnbindOk = {
- id: 2621491,
- classId: 40,
- methodId: 51,
- name: "ExchangeUnbindOk",
- args: []
- };
- module.exports.QueueDeclare = 3276810;
- var methodInfoQueueDeclare = module.exports.methodInfoQueueDeclare = {
- id: 3276810,
- classId: 50,
- methodId: 10,
- name: "QueueDeclare",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "bit",
- name: "passive",
- default: !1
- }, {
- type: "bit",
- name: "durable",
- default: !1
- }, {
- type: "bit",
- name: "exclusive",
- default: !1
- }, {
- type: "bit",
- name: "autoDelete",
- default: !1
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.QueueDeclareOk = 3276811;
- var methodInfoQueueDeclareOk = module.exports.methodInfoQueueDeclareOk = {
- id: 3276811,
- classId: 50,
- methodId: 11,
- name: "QueueDeclareOk",
- args: [ {
- type: "shortstr",
- name: "queue"
- }, {
- type: "long",
- name: "messageCount"
- }, {
- type: "long",
- name: "consumerCount"
- } ]
- };
- module.exports.QueueBind = 3276820;
- var methodInfoQueueBind = module.exports.methodInfoQueueBind = {
- id: 3276820,
- classId: 50,
- methodId: 20,
- name: "QueueBind",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "routingKey",
- default: ""
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.QueueBindOk = 3276821;
- var methodInfoQueueBindOk = module.exports.methodInfoQueueBindOk = {
- id: 3276821,
- classId: 50,
- methodId: 21,
- name: "QueueBindOk",
- args: []
- };
- module.exports.QueuePurge = 3276830;
- var methodInfoQueuePurge = module.exports.methodInfoQueuePurge = {
- id: 3276830,
- classId: 50,
- methodId: 30,
- name: "QueuePurge",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- } ]
- };
- module.exports.QueuePurgeOk = 3276831;
- var methodInfoQueuePurgeOk = module.exports.methodInfoQueuePurgeOk = {
- id: 3276831,
- classId: 50,
- methodId: 31,
- name: "QueuePurgeOk",
- args: [ {
- type: "long",
- name: "messageCount"
- } ]
- };
- module.exports.QueueDelete = 3276840;
- var methodInfoQueueDelete = module.exports.methodInfoQueueDelete = {
- id: 3276840,
- classId: 50,
- methodId: 40,
- name: "QueueDelete",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "bit",
- name: "ifUnused",
- default: !1
- }, {
- type: "bit",
- name: "ifEmpty",
- default: !1
- }, {
- type: "bit",
- name: "nowait",
- default: !1
- } ]
- };
- module.exports.QueueDeleteOk = 3276841;
- var methodInfoQueueDeleteOk = module.exports.methodInfoQueueDeleteOk = {
- id: 3276841,
- classId: 50,
- methodId: 41,
- name: "QueueDeleteOk",
- args: [ {
- type: "long",
- name: "messageCount"
- } ]
- };
- module.exports.QueueUnbind = 3276850;
- var methodInfoQueueUnbind = module.exports.methodInfoQueueUnbind = {
- id: 3276850,
- classId: 50,
- methodId: 50,
- name: "QueueUnbind",
- args: [ {
- type: "short",
- name: "ticket",
- default: 0
- }, {
- type: "shortstr",
- name: "queue",
- default: ""
- }, {
- type: "shortstr",
- name: "exchange"
- }, {
- type: "shortstr",
- name: "routingKey",
- default: ""
- }, {
- type: "table",
- name: "arguments",
- default: {}
- } ]
- };
- module.exports.QueueUnbindOk = 3276851;
- var methodInfoQueueUnbindOk = module.exports.methodInfoQueueUnbindOk = {
- id: 3276851,
- classId: 50,
- methodId: 51,
- name: "QueueUnbindOk",
- args: []
- };
- module.exports.TxSelect = 5898250;
- var methodInfoTxSelect = module.exports.methodInfoTxSelect = {
- id: 5898250,
- classId: 90,
- methodId: 10,
- name: "TxSelect",
- args: []
- };
- module.exports.TxSelectOk = 5898251;
- var methodInfoTxSelectOk = module.exports.methodInfoTxSelectOk = {
- id: 5898251,
- classId: 90,
- methodId: 11,
- name: "TxSelectOk",
- args: []
- };
- module.exports.TxCommit = 5898260;
- var methodInfoTxCommit = module.exports.methodInfoTxCommit = {
- id: 5898260,
- classId: 90,
- methodId: 20,
- name: "TxCommit",
- args: []
- };
- module.exports.TxCommitOk = 5898261;
- var methodInfoTxCommitOk = module.exports.methodInfoTxCommitOk = {
- id: 5898261,
- classId: 90,
- methodId: 21,
- name: "TxCommitOk",
- args: []
- };
- module.exports.TxRollback = 5898270;
- var methodInfoTxRollback = module.exports.methodInfoTxRollback = {
- id: 5898270,
- classId: 90,
- methodId: 30,
- name: "TxRollback",
- args: []
- };
- module.exports.TxRollbackOk = 5898271;
- var methodInfoTxRollbackOk = module.exports.methodInfoTxRollbackOk = {
- id: 5898271,
- classId: 90,
- methodId: 31,
- name: "TxRollbackOk",
- args: []
- };
- module.exports.ConfirmSelect = 5570570;
- var methodInfoConfirmSelect = module.exports.methodInfoConfirmSelect = {
- id: 5570570,
- classId: 85,
- methodId: 10,
- name: "ConfirmSelect",
- args: [ {
- type: "bit",
- name: "nowait",
- default: !1
- } ]
- };
- module.exports.ConfirmSelectOk = 5570571;
- var methodInfoConfirmSelectOk = module.exports.methodInfoConfirmSelectOk = {
- id: 5570571,
- classId: 85,
- methodId: 11,
- name: "ConfirmSelectOk",
- args: []
- };
- module.exports.BasicProperties = 60;
- var propertiesInfoBasicProperties = module.exports.propertiesInfoBasicProperties = {
- id: 60,
- name: "BasicProperties",
- args: [ {
- type: "shortstr",
- name: "contentType"
- }, {
- type: "shortstr",
- name: "contentEncoding"
- }, {
- type: "table",
- name: "headers"
- }, {
- type: "octet",
- name: "deliveryMode"
- }, {
- type: "octet",
- name: "priority"
- }, {
- type: "shortstr",
- name: "correlationId"
- }, {
- type: "shortstr",
- name: "replyTo"
- }, {
- type: "shortstr",
- name: "expiration"
- }, {
- type: "shortstr",
- name: "messageId"
- }, {
- type: "timestamp",
- name: "timestamp"
- }, {
- type: "shortstr",
- name: "type"
- }, {
- type: "shortstr",
- name: "userId"
- }, {
- type: "shortstr",
- name: "appId"
- }, {
- type: "shortstr",
- name: "clusterId"
- } ]
- };
|