[{"data":1,"prerenderedAt":1625},["ShallowReactive",2],{"navigation_docs":3,"-server-request-and-response":195,"-server-request-and-response-surround":1620},[4,27,61,75,100,126,147,177],{"title":5,"icon":6,"redirect":7,"path":8,"stem":9,"children":10,"page":26},"Introduction","icon-park-outline:home","\u002Fintroduction\u002Fabout-mion","\u002Fintroduction","1.introduction",[11,14,18,22],{"title":12,"path":7,"stem":13},"About mion","1.introduction\u002F1.about-mion",{"title":15,"path":16,"stem":17},"Quick Start","\u002Fintroduction\u002Fquick-start","1.introduction\u002F2.quick-start",{"title":19,"path":20,"stem":21},"Manual Install","\u002Fintroduction\u002Fmanual-install","1.introduction\u002F3.manual-install",{"title":23,"path":24,"stem":25},"What's Next","\u002Fintroduction\u002Fwhat-is-next","1.introduction\u002F4.what-is-next",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Server","icon-park-outline:server","\u002Fserver","20.server",[33,37,41,45,49,53,57],{"title":34,"path":35,"stem":36},"Router Overview","\u002Fserver\u002Foverview","20.server\u002F0.overview",{"title":38,"path":39,"stem":40},"Routes","\u002Fserver\u002Froutes","20.server\u002F1.routes",{"title":42,"path":43,"stem":44},"Middleware","\u002Fserver\u002Fmiddle-fns","20.server\u002F2.middle-fns",{"title":46,"path":47,"stem":48},"Request & Response","\u002Fserver\u002Frequest-and-response","20.server\u002F5.request-and-response",{"title":50,"path":51,"stem":52},"Error Handling","\u002Fserver\u002Ferror-handling","20.server\u002F6.error-handling",{"title":54,"path":55,"stem":56},"Validation","\u002Fserver\u002Fvalidation","20.server\u002F7.validation",{"title":58,"path":59,"stem":60},"Serialization","\u002Fserver\u002Fserialization","20.server\u002F8.serialization",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":26},"Drizzle ORM","i-lineicons-drizzle","\u002Fdrizzle-orm","21.drizzle-orm",[67,71],{"title":68,"path":69,"stem":70},"Drizzle Overview","\u002Fdrizzle-orm\u002Fdrizzle-overview","21.drizzle-orm\u002F0.drizzle-overview",{"title":72,"path":73,"stem":74},"Column Mapping","\u002Fdrizzle-orm\u002Fcolumn-mapping","21.drizzle-orm\u002F1.column-mapping",{"title":76,"icon":77,"path":78,"stem":79,"children":80,"page":26},"Client","icon-park-outline:computer","\u002Fclient","3.client",[81,85,88,92,96],{"title":82,"path":83,"stem":84},"Client Overview","\u002Fclient\u002Fclient-overview","3.client\u002F0.client-overview",{"title":50,"path":86,"stem":87},"\u002Fclient\u002Ferror-handling","3.client\u002F1.error-handling",{"title":89,"path":90,"stem":91},"Validation Errors","\u002Fclient\u002Fvalidation-errors","3.client\u002F2.validation-errors",{"title":93,"path":94,"stem":95},"Routes Flow","\u002Fclient\u002Fclient-flow","3.client\u002F3.client-flow",{"title":97,"path":98,"stem":99},"Cancellation & Timeouts","\u002Fclient\u002Fcancellation-timeouts","3.client\u002F4.cancellation-timeouts",{"title":101,"icon":102,"redirect":103,"path":104,"stem":105,"children":106,"page":26},"RunTypes","i-lucide-scan-text","\u002Frun-types\u002Foverview","\u002Frun-types","4.run-types",[107,110,114,118,122],{"title":108,"path":103,"stem":109},"RunTypes Overview","4.run-types\u002F0.overview",{"title":111,"path":112,"stem":113},"Supported Types","\u002Frun-types\u002Ffeatures","4.run-types\u002F1.features",{"title":115,"path":116,"stem":117},"Type Formats","\u002Frun-types\u002Ftype-formats","4.run-types\u002F2.type-formats",{"title":119,"path":120,"stem":121},"Built-in Formats","\u002Frun-types\u002Fbuilt-in-formats","4.run-types\u002F3.built-in-formats",{"title":123,"path":124,"stem":125},"Caveats","\u002Frun-types\u002Fcaveats","4.run-types\u002F4.caveats",{"title":127,"path":128,"stem":129,"children":130,"page":26},"Devtools","\u002Fdevtools","5.devtools",[131,135,139,143],{"title":132,"path":133,"stem":134},"AOT Compilation","\u002Fdevtools\u002Faot-compilation","5.devtools\u002F0.aot-compilation",{"title":136,"path":137,"stem":138},"Pure Functions","\u002Fdevtools\u002Fpure-functions","5.devtools\u002F1.pure-functions",{"title":140,"path":141,"stem":142},"ESLint Rules","\u002Fdevtools\u002Feslint-rules","5.devtools\u002F2.eslint-rules",{"title":144,"path":145,"stem":146},"Vite Configuration","\u002Fdevtools\u002Fvite-config","5.devtools\u002F3.vite-config",{"title":148,"redirect":149,"icon":150,"path":151,"stem":152,"children":153,"page":26},"Platforms","\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Fplatforms","6.platforms",[154,157,161,165,169,173],{"title":155,"path":149,"stem":156},"Node.js","6.platforms\u002F1.node-js",{"title":158,"path":159,"stem":160},"Bun","\u002Fplatforms\u002Fbun","6.platforms\u002F2.bun",{"title":162,"path":163,"stem":164},"AWS Lambda","\u002Fplatforms\u002Faws-lambda","6.platforms\u002F3.aws-lambda",{"title":166,"path":167,"stem":168},"Google Cloud Functions","\u002Fplatforms\u002Fgoogle-cloud-functions","6.platforms\u002F4.google-cloud-functions",{"title":170,"path":171,"stem":172},"Cloudflare Workers","\u002Fplatforms\u002Fcloudflare","6.platforms\u002F5.cloudflare",{"title":174,"path":175,"stem":176},"Vercel","\u002Fplatforms\u002Fvercel","6.platforms\u002F6.vercel",{"title":178,"icon":179,"redirect":180,"path":181,"stem":182,"children":183,"page":26},"Benchmarks","icon-park-outline:chart-line","\u002Fbenchmarks\u002Fhello-world","\u002Fbenchmarks","7.benchmarks",[184,187,191],{"title":185,"path":180,"stem":186},"Hello World","7.benchmarks\u002F1.hello-world",{"title":188,"path":189,"stem":190},"Light Validation","\u002Fbenchmarks\u002Flight-validation","7.benchmarks\u002F2.light-validation",{"title":192,"path":193,"stem":194},"Heavy Validation","\u002Fbenchmarks\u002Fheavy-validation","7.benchmarks\u002F3.heavy-validation",{"id":196,"title":46,"body":197,"description":1615,"extension":310,"links":1616,"meta":1617,"navigation":479,"path":47,"seo":1618,"stem":48,"__hash__":1619},"docs\u002F20.server\u002F5.request-and-response.md",{"type":198,"value":199,"toc":1605},"minimark",[200,222,232,264,268,273,288,294,301,671,678,682,692,712,719,865,872,875,880,883,887,891,894,1151,1154,1157,1313,1316,1326,1525,1528,1531,1601],[201,202,203,204,209,210,214,215,221],"p",{},"The ",[205,206,208],"a",{"href":207},"#mionrequest","MionRequest"," and ",[205,211,213],{"href":212},"#mionresponse","MionResponse"," objects are available to every middleFn\u002Froute within the ",[205,216,217],{"href":39},[218,219,220],"code",{},"CallContext"," (the first parameter of every middleFn\u002Froute).",[201,223,224,225,209,228,231],{},"mion does not use the standard ",[218,226,227],{},"Request",[218,229,230],{},"Response"," objects from the Fetch API. Instead, it uses its own abstractions to better support multiple platforms that don't use these standards—such, ie:  Node.js, AWS lambda...",[201,233,234,238,243,244,209,247,250,251,256,257,209,260,263],{},[235,236,237],"strong",{},"Example:",[205,239,240],{"href":149},[218,241,242],{},"@mionjs\u002Fplatform-node"," uses node's native ",[218,245,246],{},"IncomingMessage",[218,248,249],{},"ServerResponse"," while ",[205,252,253],{"href":163},[218,254,255],{},"@mionjs\u002Fplatform-aws"," uses ",[218,258,259],{},"APIGatewayEvent",[218,261,262],{},"APIGatewayProxyResult",". But routes and middleFns will always receive a standard MionRequest & MionResponse.",[265,266,267],"note",{},"Passing parameters to routes and middleFns is automatically managed by mion so accessing the Request and Response objects is almost never required.\nDevelopers just need to take care of declaring the route\u002FmiddleFn parameters and their types.",[269,270,272],"h2",{"id":271},"how-data-is-sent-and-received","How Data is Sent and Received",[201,274,275,276,279,280,283,284,287],{},"When making a route call the ",[218,277,278],{},"URL.path"," is the route's id and is used for the route lookup. The HTTP request body is a JSON object where keys are the route or middleFn ",[218,281,282],{},"ids"," and the values are ",[218,285,286],{},"Arrays"," containing the parameters for each respective route or middleFn.",[201,289,290,291,293],{},"The HTTP response follows the same format where the body is a JSON object where the keys are the ",[218,292,282],{}," and the values are the return values from the remote methods.",[201,295,296,297,300],{},"This format is an important design decision that allows ",[235,298,299],{},"multiple subrequests (routes and middleFns) to be called in a single HTTP request",". For example, authentication middleFns can send\u002Freceive their own data alongside the main route, all within the same request-response cycle.",[302,303,304,432],"code-group",{},[305,306,312],"pre",{"className":307,"code":308,"filename":309,"language":310,"meta":311,"style":311},"language-md shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","| Request Path | Request Body                      | Response Body                          |\n| ------------ | --------------------------------- | -------------------------------------- |\n| `\u002FsayHello`  | `{\"sayHello\": [\"John\"] }`         | `{\"sayHello\": \"Hello John.\"}`          |\n| `\u002Fgreetings` | `{\"greetings\": [\"Adan\", \"Eve\"] }` | `{\"greetings\": \"Hello Adan and Eve.\"}` |\n","Example","md","",[218,313,314,340,362,400],{"__ignoreMap":311},[315,316,319,323,327,329,332,334,337],"span",{"class":317,"line":318},"line",1,[315,320,322],{"class":321},"sMK4o","|",[315,324,326],{"class":325},"sTEyZ"," Request Path ",[315,328,322],{"class":321},[315,330,331],{"class":325}," Request Body                      ",[315,333,322],{"class":321},[315,335,336],{"class":325}," Response Body                          ",[315,338,339],{"class":321},"|\n",[315,341,343,345,348,351,354,356,359],{"class":317,"line":342},2,[315,344,322],{"class":321},[315,346,347],{"class":321}," ------------",[315,349,350],{"class":321}," |",[315,352,353],{"class":321}," ---------------------------------",[315,355,350],{"class":321},[315,357,358],{"class":321}," --------------------------------------",[315,360,361],{"class":321}," |\n",[315,363,365,367,370,374,377,380,382,385,387,390,392,395,397],{"class":317,"line":364},3,[315,366,322],{"class":321},[315,368,369],{"class":321}," `",[315,371,373],{"class":372},"sfazB","\u002FsayHello",[315,375,376],{"class":321},"`",[315,378,379],{"class":321},"  |",[315,381,369],{"class":321},[315,383,384],{"class":372},"{\"sayHello\": [\"John\"] }",[315,386,376],{"class":321},[315,388,389],{"class":321},"         |",[315,391,369],{"class":321},[315,393,394],{"class":372},"{\"sayHello\": \"Hello John.\"}",[315,396,376],{"class":321},[315,398,399],{"class":321},"          |\n",[315,401,403,405,407,410,412,414,416,419,421,423,425,428,430],{"class":317,"line":402},4,[315,404,322],{"class":321},[315,406,369],{"class":321},[315,408,409],{"class":372},"\u002Fgreetings",[315,411,376],{"class":321},[315,413,350],{"class":321},[315,415,369],{"class":321},[315,417,418],{"class":372},"{\"greetings\": [\"Adan\", \"Eve\"] }",[315,420,376],{"class":321},[315,422,350],{"class":321},[315,424,369],{"class":321},[315,426,427],{"class":372},"{\"greetings\": \"Hello Adan and Eve.\"}",[315,429,376],{"class":321},[315,431,361],{"class":321},[305,433,438],{"className":434,"code":435,"filename":436,"language":437,"meta":311,"style":311},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {Routes, route} from '@mionjs\u002Frouter';\n\nconst routes = {\n    sayHello: route((ctx, name: string): string => {\n        return `Hello ${name}.`;\n    }),\n    greetings: route((ctx, name1: string, name2: string): string => {\n        return `Hello ${name1} and ${name2}.`;\n    }),\n} satisfies Routes;\n","routes","ts",[218,439,440,475,481,496,538,564,576,618,649,658],{"__ignoreMap":311},[315,441,442,446,449,451,454,457,460,463,466,469,472],{"class":317,"line":318},[315,443,445],{"class":444},"s7zQu","import",[315,447,448],{"class":321}," {",[315,450,38],{"class":325},[315,452,453],{"class":321},",",[315,455,456],{"class":325}," route",[315,458,459],{"class":321},"}",[315,461,462],{"class":444}," from",[315,464,465],{"class":321}," '",[315,467,468],{"class":372},"@mionjs\u002Frouter",[315,470,471],{"class":321},"'",[315,473,474],{"class":321},";\n",[315,476,477],{"class":317,"line":342},[315,478,480],{"emptyLinePlaceholder":479},true,"\n",[315,482,483,487,490,493],{"class":317,"line":364},[315,484,486],{"class":485},"spNyl","const",[315,488,489],{"class":325}," routes ",[315,491,492],{"class":321},"=",[315,494,495],{"class":321}," {\n",[315,497,498,502,505,508,511,513,517,519,522,524,528,531,533,536],{"class":317,"line":402},[315,499,501],{"class":500},"swJcz","    sayHello",[315,503,504],{"class":321},":",[315,506,456],{"class":507},"s2Zo4",[315,509,510],{"class":325},"(",[315,512,510],{"class":321},[315,514,516],{"class":515},"sHdIc","ctx",[315,518,453],{"class":321},[315,520,521],{"class":515}," name",[315,523,504],{"class":321},[315,525,527],{"class":526},"sBMFI"," string",[315,529,530],{"class":321},"):",[315,532,527],{"class":526},[315,534,535],{"class":485}," =>",[315,537,495],{"class":321},[315,539,541,544,546,549,552,555,557,560,562],{"class":317,"line":540},5,[315,542,543],{"class":444},"        return",[315,545,369],{"class":321},[315,547,548],{"class":372},"Hello ",[315,550,551],{"class":321},"${",[315,553,554],{"class":325},"name",[315,556,459],{"class":321},[315,558,559],{"class":372},".",[315,561,376],{"class":321},[315,563,474],{"class":321},[315,565,567,570,573],{"class":317,"line":566},6,[315,568,569],{"class":321},"    }",[315,571,572],{"class":325},")",[315,574,575],{"class":321},",\n",[315,577,579,582,584,586,588,590,592,594,597,599,601,603,606,608,610,612,614,616],{"class":317,"line":578},7,[315,580,581],{"class":500},"    greetings",[315,583,504],{"class":321},[315,585,456],{"class":507},[315,587,510],{"class":325},[315,589,510],{"class":321},[315,591,516],{"class":515},[315,593,453],{"class":321},[315,595,596],{"class":515}," name1",[315,598,504],{"class":321},[315,600,527],{"class":526},[315,602,453],{"class":321},[315,604,605],{"class":515}," name2",[315,607,504],{"class":321},[315,609,527],{"class":526},[315,611,530],{"class":321},[315,613,527],{"class":526},[315,615,535],{"class":485},[315,617,495],{"class":321},[315,619,621,623,625,627,629,632,634,636,638,641,643,645,647],{"class":317,"line":620},8,[315,622,543],{"class":444},[315,624,369],{"class":321},[315,626,548],{"class":372},[315,628,551],{"class":321},[315,630,631],{"class":325},"name1",[315,633,459],{"class":321},[315,635,209],{"class":372},[315,637,551],{"class":321},[315,639,640],{"class":325},"name2",[315,642,459],{"class":321},[315,644,559],{"class":372},[315,646,376],{"class":321},[315,648,474],{"class":321},[315,650,652,654,656],{"class":317,"line":651},9,[315,653,569],{"class":321},[315,655,572],{"class":325},[315,657,575],{"class":321},[315,659,661,663,666,669],{"class":317,"line":660},10,[315,662,459],{"class":321},[315,664,665],{"class":444}," satisfies",[315,667,668],{"class":526}," Routes",[315,670,474],{"class":321},[672,673,674,675,677],"tip",{},"The underlying logic to format request & parse response data is handled transparently by the ",[205,676,76],{"href":83},".\nDevelopers should only care about declaring the route\u002FmiddleFn parameters and their types.",[269,679,681],{"id":680},"error-handling-in-responses","Error Handling in Responses",[201,683,684,685,688,689,504],{},"Errors in mion are handled differently depending on whether they are ",[235,686,687],{},"returned"," or ",[235,690,691],{},"thrown",[693,694,695,702],"ul",{},[696,697,698,701],"li",{},[235,699,700],{},"Returned errors"," (strongly typed): Appear under the route id in the response body, preserving full type information",[696,703,704,707,708,711],{},[235,705,706],{},"Thrown errors"," (untyped): Collected in the special ",[218,709,710],{},"@thrownErrors"," field of the response body",[201,713,714,715,718],{},"Thrown errors are typically ",[235,716,717],{},"unexpected, non-application-logic errors"," such as validation failures, serialization errors, database connection issues, or unhandled exceptions. Since they are not strongly typed, they can be produced by any middleFn or route—including internal middleFns that are not part of the public API.",[305,720,724],{"className":721,"code":722,"language":723,"meta":311,"style":311},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n    \"getUser\": {\"id\": \"123\", \"name\": \"John\"},\n    \"@thrownErrors\": {\n        \"mionDeserializeRequest\": {\n            \"type\": \"parsing-json-request-error\",\n            \"publicMessage\": \"Invalid json request body ...\"\n        }\n    }\n}\n","json",[218,725,726,731,783,795,809,831,850,855,860],{"__ignoreMap":311},[315,727,728],{"class":317,"line":318},[315,729,730],{"class":321},"{\n",[315,732,733,736,739,742,744,746,748,751,753,755,758,761,763,765,767,769,771,773,775,778,780],{"class":317,"line":342},[315,734,735],{"class":321},"    \"",[315,737,738],{"class":485},"getUser",[315,740,741],{"class":321},"\"",[315,743,504],{"class":321},[315,745,448],{"class":321},[315,747,741],{"class":321},[315,749,750],{"class":526},"id",[315,752,741],{"class":321},[315,754,504],{"class":321},[315,756,757],{"class":321}," \"",[315,759,760],{"class":372},"123",[315,762,741],{"class":321},[315,764,453],{"class":321},[315,766,757],{"class":321},[315,768,554],{"class":526},[315,770,741],{"class":321},[315,772,504],{"class":321},[315,774,757],{"class":321},[315,776,777],{"class":372},"John",[315,779,741],{"class":321},[315,781,782],{"class":321},"},\n",[315,784,785,787,789,791,793],{"class":317,"line":364},[315,786,735],{"class":321},[315,788,710],{"class":485},[315,790,741],{"class":321},[315,792,504],{"class":321},[315,794,495],{"class":321},[315,796,797,800,803,805,807],{"class":317,"line":402},[315,798,799],{"class":321},"        \"",[315,801,802],{"class":526},"mionDeserializeRequest",[315,804,741],{"class":321},[315,806,504],{"class":321},[315,808,495],{"class":321},[315,810,811,814,818,820,822,824,827,829],{"class":317,"line":540},[315,812,813],{"class":321},"            \"",[315,815,817],{"class":816},"sbssI","type",[315,819,741],{"class":321},[315,821,504],{"class":321},[315,823,757],{"class":321},[315,825,826],{"class":372},"parsing-json-request-error",[315,828,741],{"class":321},[315,830,575],{"class":321},[315,832,833,835,838,840,842,844,847],{"class":317,"line":566},[315,834,813],{"class":321},[315,836,837],{"class":816},"publicMessage",[315,839,741],{"class":321},[315,841,504],{"class":321},[315,843,757],{"class":321},[315,845,846],{"class":372},"Invalid json request body ...",[315,848,849],{"class":321},"\"\n",[315,851,852],{"class":317,"line":578},[315,853,854],{"class":321},"        }\n",[315,856,857],{"class":317,"line":620},[315,858,859],{"class":321},"    }\n",[315,861,862],{"class":317,"line":651},[315,863,864],{"class":321},"}\n",[265,866,867,868,871],{},"All thrown errors are returned in ",[218,869,870],{},"response.body['@thrownErrors']",". The logic for correctly serializing and deserializing these errors is handled by the mion client, so you don't need to manually parse this field when using the client.",[672,873,874],{},"Thrown errors should be (unexpected or unrecoverable), When an error is expected and should be handled (ie: user not found) it should be returned as a strongly typed error instead of being thrown.",[201,876,877,878,559],{},"For more details on error handling patterns, see ",[205,879,50],{"href":51},[881,882],"spacer",{},[269,884,886],{"id":885},"type-reference","Type Reference",[888,889,208],"h3",{"id":890},"mionrequest",[201,892,893],{},"mion's Request object, does not depend on the underlying native request.",[305,895,897],{"className":434,"code":896,"language":437,"meta":311,"style":311},"\u002F** Router's own request object, do not confuse with the underlying raw request *\u002F\nexport interface MionRequest {\n    \u002F** parsed headers *\u002F\n    readonly headers: Readonly\u003COmit\u003CMionHeaders, 'append' | 'set' | 'delete'>>;\n    \u002F** Raw request body, can be string for json, arrayBuffer for binary or a javascript object in the case of pre-parsed body *\u002F\n    readonly rawBody: RawRequestBody;\n    readonly bodyType: SerializerCode;\n    \u002F** parsed request body *\u002F\n    readonly body: Readonly\u003CAnyObject>;\n    \u002F**\n     * Unexpected or thrown errors that are not part of the route\u002Fhandler return type.\n     * This includes:\n     * - Validation errors (params, headers)\n     * - Deserialization\u002Fserialization errors\n     * - Errors thrown by user code (not returned)\n     * - Route not found errors\n     * - Any other errors thrown during execution\n     *\n     * These errors are serialized separately from the route response and sent to the client\n     * in the thrownErrors middleFn response, allowing them to be properly deserialized\n     * without being part of the route's type signature.\n     *\u002F\n    readonly thrownErrors?: Readonly\u003CRecord\u003Cstring, RpcError\u003Cstring>>>;\n}\n",[218,898,899,905,918,923,977,982,996,1010,1015,1034,1039,1045,1051,1057,1063,1069,1075,1081,1087,1093,1099,1105,1111,1146],{"__ignoreMap":311},[315,900,901],{"class":317,"line":318},[315,902,904],{"class":903},"sHwdD","\u002F** Router's own request object, do not confuse with the underlying raw request *\u002F\n",[315,906,907,910,913,916],{"class":317,"line":342},[315,908,909],{"class":444},"export",[315,911,912],{"class":485}," interface",[315,914,915],{"class":526}," MionRequest",[315,917,495],{"class":321},[315,919,920],{"class":317,"line":364},[315,921,922],{"class":903},"    \u002F** parsed headers *\u002F\n",[315,924,925,928,931,933,936,939,942,944,947,949,951,954,956,958,960,963,965,967,969,972,974],{"class":317,"line":402},[315,926,927],{"class":485},"    readonly",[315,929,930],{"class":500}," headers",[315,932,504],{"class":321},[315,934,935],{"class":526}," Readonly",[315,937,938],{"class":321},"\u003C",[315,940,941],{"class":526},"Omit",[315,943,938],{"class":321},[315,945,946],{"class":526},"MionHeaders",[315,948,453],{"class":321},[315,950,465],{"class":321},[315,952,953],{"class":372},"append",[315,955,471],{"class":321},[315,957,350],{"class":321},[315,959,465],{"class":321},[315,961,962],{"class":372},"set",[315,964,471],{"class":321},[315,966,350],{"class":321},[315,968,465],{"class":321},[315,970,971],{"class":372},"delete",[315,973,471],{"class":321},[315,975,976],{"class":321},">>;\n",[315,978,979],{"class":317,"line":540},[315,980,981],{"class":903},"    \u002F** Raw request body, can be string for json, arrayBuffer for binary or a javascript object in the case of pre-parsed body *\u002F\n",[315,983,984,986,989,991,994],{"class":317,"line":566},[315,985,927],{"class":485},[315,987,988],{"class":500}," rawBody",[315,990,504],{"class":321},[315,992,993],{"class":526}," RawRequestBody",[315,995,474],{"class":321},[315,997,998,1000,1003,1005,1008],{"class":317,"line":578},[315,999,927],{"class":485},[315,1001,1002],{"class":500}," bodyType",[315,1004,504],{"class":321},[315,1006,1007],{"class":526}," SerializerCode",[315,1009,474],{"class":321},[315,1011,1012],{"class":317,"line":620},[315,1013,1014],{"class":903},"    \u002F** parsed request body *\u002F\n",[315,1016,1017,1019,1022,1024,1026,1028,1031],{"class":317,"line":651},[315,1018,927],{"class":485},[315,1020,1021],{"class":500}," body",[315,1023,504],{"class":321},[315,1025,935],{"class":526},[315,1027,938],{"class":321},[315,1029,1030],{"class":526},"AnyObject",[315,1032,1033],{"class":321},">;\n",[315,1035,1036],{"class":317,"line":660},[315,1037,1038],{"class":903},"    \u002F**\n",[315,1040,1042],{"class":317,"line":1041},11,[315,1043,1044],{"class":903},"     * Unexpected or thrown errors that are not part of the route\u002Fhandler return type.\n",[315,1046,1048],{"class":317,"line":1047},12,[315,1049,1050],{"class":903},"     * This includes:\n",[315,1052,1054],{"class":317,"line":1053},13,[315,1055,1056],{"class":903},"     * - Validation errors (params, headers)\n",[315,1058,1060],{"class":317,"line":1059},14,[315,1061,1062],{"class":903},"     * - Deserialization\u002Fserialization errors\n",[315,1064,1066],{"class":317,"line":1065},15,[315,1067,1068],{"class":903},"     * - Errors thrown by user code (not returned)\n",[315,1070,1072],{"class":317,"line":1071},16,[315,1073,1074],{"class":903},"     * - Route not found errors\n",[315,1076,1078],{"class":317,"line":1077},17,[315,1079,1080],{"class":903},"     * - Any other errors thrown during execution\n",[315,1082,1084],{"class":317,"line":1083},18,[315,1085,1086],{"class":903},"     *\n",[315,1088,1090],{"class":317,"line":1089},19,[315,1091,1092],{"class":903},"     * These errors are serialized separately from the route response and sent to the client\n",[315,1094,1096],{"class":317,"line":1095},20,[315,1097,1098],{"class":903},"     * in the thrownErrors middleFn response, allowing them to be properly deserialized\n",[315,1100,1102],{"class":317,"line":1101},21,[315,1103,1104],{"class":903},"     * without being part of the route's type signature.\n",[315,1106,1108],{"class":317,"line":1107},22,[315,1109,1110],{"class":903},"     *\u002F\n",[315,1112,1114,1116,1119,1122,1124,1126,1129,1131,1134,1136,1139,1141,1143],{"class":317,"line":1113},23,[315,1115,927],{"class":485},[315,1117,1118],{"class":500}," thrownErrors",[315,1120,1121],{"class":321},"?:",[315,1123,935],{"class":526},[315,1125,938],{"class":321},[315,1127,1128],{"class":526},"Record",[315,1130,938],{"class":321},[315,1132,1133],{"class":526},"string",[315,1135,453],{"class":321},[315,1137,1138],{"class":526}," RpcError",[315,1140,938],{"class":321},[315,1142,1133],{"class":526},[315,1144,1145],{"class":321},">>>;\n",[315,1147,1149],{"class":317,"line":1148},24,[315,1150,864],{"class":321},[888,1152,213],{"id":1153},"mionresponse",[201,1155,1156],{},"mion's Response object, does not depend on the underlying native response.",[305,1158,1160],{"className":434,"code":1159,"language":437,"meta":311,"style":311},"\u002F** Router's own response object, do not confuse with the underlying raw response *\u002F\nexport interface MionResponse {\n    \u002F** response http status code *\u002F\n    readonly statusCode: number;\n    \u002F** response headers *\u002F\n    readonly headers: Readonly\u003CMionHeaders>;\n    \u002F** Raw response body, can be string for json or an arrayBuffer for binary. *\u002F\n    readonly rawBody: RawResponseBody;\n    readonly serializer: SerializerCode;\n    \u002F** the router response data, body should not be modified manually so marked as Read Only *\u002F\n    readonly body: Readonly\u003CResponseBody>;\n    \u002F** response errors: empty if there were no errors during execution *\u002F\n    readonly hasErrors: boolean;\n    readonly binSerializer?: DataViewSerializer | undefined;\n}\n",[218,1161,1162,1167,1178,1183,1197,1202,1218,1223,1236,1249,1254,1271,1276,1290,1309],{"__ignoreMap":311},[315,1163,1164],{"class":317,"line":318},[315,1165,1166],{"class":903},"\u002F** Router's own response object, do not confuse with the underlying raw response *\u002F\n",[315,1168,1169,1171,1173,1176],{"class":317,"line":342},[315,1170,909],{"class":444},[315,1172,912],{"class":485},[315,1174,1175],{"class":526}," MionResponse",[315,1177,495],{"class":321},[315,1179,1180],{"class":317,"line":364},[315,1181,1182],{"class":903},"    \u002F** response http status code *\u002F\n",[315,1184,1185,1187,1190,1192,1195],{"class":317,"line":402},[315,1186,927],{"class":485},[315,1188,1189],{"class":500}," statusCode",[315,1191,504],{"class":321},[315,1193,1194],{"class":526}," number",[315,1196,474],{"class":321},[315,1198,1199],{"class":317,"line":540},[315,1200,1201],{"class":903},"    \u002F** response headers *\u002F\n",[315,1203,1204,1206,1208,1210,1212,1214,1216],{"class":317,"line":566},[315,1205,927],{"class":485},[315,1207,930],{"class":500},[315,1209,504],{"class":321},[315,1211,935],{"class":526},[315,1213,938],{"class":321},[315,1215,946],{"class":526},[315,1217,1033],{"class":321},[315,1219,1220],{"class":317,"line":578},[315,1221,1222],{"class":903},"    \u002F** Raw response body, can be string for json or an arrayBuffer for binary. *\u002F\n",[315,1224,1225,1227,1229,1231,1234],{"class":317,"line":620},[315,1226,927],{"class":485},[315,1228,988],{"class":500},[315,1230,504],{"class":321},[315,1232,1233],{"class":526}," RawResponseBody",[315,1235,474],{"class":321},[315,1237,1238,1240,1243,1245,1247],{"class":317,"line":651},[315,1239,927],{"class":485},[315,1241,1242],{"class":500}," serializer",[315,1244,504],{"class":321},[315,1246,1007],{"class":526},[315,1248,474],{"class":321},[315,1250,1251],{"class":317,"line":660},[315,1252,1253],{"class":903},"    \u002F** the router response data, body should not be modified manually so marked as Read Only *\u002F\n",[315,1255,1256,1258,1260,1262,1264,1266,1269],{"class":317,"line":1041},[315,1257,927],{"class":485},[315,1259,1021],{"class":500},[315,1261,504],{"class":321},[315,1263,935],{"class":526},[315,1265,938],{"class":321},[315,1267,1268],{"class":526},"ResponseBody",[315,1270,1033],{"class":321},[315,1272,1273],{"class":317,"line":1047},[315,1274,1275],{"class":903},"    \u002F** response errors: empty if there were no errors during execution *\u002F\n",[315,1277,1278,1280,1283,1285,1288],{"class":317,"line":1053},[315,1279,927],{"class":485},[315,1281,1282],{"class":500}," hasErrors",[315,1284,504],{"class":321},[315,1286,1287],{"class":526}," boolean",[315,1289,474],{"class":321},[315,1291,1292,1294,1297,1299,1302,1304,1307],{"class":317,"line":1059},[315,1293,927],{"class":485},[315,1295,1296],{"class":500}," binSerializer",[315,1298,1121],{"class":321},[315,1300,1301],{"class":526}," DataViewSerializer",[315,1303,350],{"class":321},[315,1305,1306],{"class":526}," undefined",[315,1308,474],{"class":321},[315,1310,1311],{"class":317,"line":1065},[315,1312,864],{"class":321},[888,1314,946],{"id":1315},"mionheaders",[201,1317,1318,1319,559],{},"mion's headers object, similar to the ",[205,1320,1325],{"href":1321,"rel":1322,"target":1324},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FHeaders",[1323],"nofollow","_blank","Fetch API Headers",[305,1327,1329],{"className":434,"code":1328,"language":437,"meta":311,"style":311},"export interface MionHeaders {\n    append(name: string, value: string): void;\n    delete(name: string): void;\n    set(name: string, value: string): void;\n    get(name: string): string | undefined | null;\n    has(name: string): boolean;\n    entries(): IterableIterator\u003C[string, string]>;\n    keys(): IterableIterator\u003Cstring>;\n    values(): IterableIterator\u003Cstring>;\n}\n",[218,1330,1331,1342,1371,1390,1417,1445,1464,1491,1506,1521],{"__ignoreMap":311},[315,1332,1333,1335,1337,1340],{"class":317,"line":318},[315,1334,909],{"class":444},[315,1336,912],{"class":485},[315,1338,1339],{"class":526}," MionHeaders",[315,1341,495],{"class":321},[315,1343,1344,1347,1349,1351,1353,1355,1357,1360,1362,1364,1366,1369],{"class":317,"line":342},[315,1345,1346],{"class":500},"    append",[315,1348,510],{"class":321},[315,1350,554],{"class":515},[315,1352,504],{"class":321},[315,1354,527],{"class":526},[315,1356,453],{"class":321},[315,1358,1359],{"class":515}," value",[315,1361,504],{"class":321},[315,1363,527],{"class":526},[315,1365,530],{"class":321},[315,1367,1368],{"class":526}," void",[315,1370,474],{"class":321},[315,1372,1373,1376,1378,1380,1382,1384,1386,1388],{"class":317,"line":364},[315,1374,1375],{"class":500},"    delete",[315,1377,510],{"class":321},[315,1379,554],{"class":515},[315,1381,504],{"class":321},[315,1383,527],{"class":526},[315,1385,530],{"class":321},[315,1387,1368],{"class":526},[315,1389,474],{"class":321},[315,1391,1392,1395,1397,1399,1401,1403,1405,1407,1409,1411,1413,1415],{"class":317,"line":402},[315,1393,1394],{"class":500},"    set",[315,1396,510],{"class":321},[315,1398,554],{"class":515},[315,1400,504],{"class":321},[315,1402,527],{"class":526},[315,1404,453],{"class":321},[315,1406,1359],{"class":515},[315,1408,504],{"class":321},[315,1410,527],{"class":526},[315,1412,530],{"class":321},[315,1414,1368],{"class":526},[315,1416,474],{"class":321},[315,1418,1419,1422,1424,1426,1428,1430,1432,1434,1436,1438,1440,1443],{"class":317,"line":540},[315,1420,1421],{"class":500},"    get",[315,1423,510],{"class":321},[315,1425,554],{"class":515},[315,1427,504],{"class":321},[315,1429,527],{"class":526},[315,1431,530],{"class":321},[315,1433,527],{"class":526},[315,1435,350],{"class":321},[315,1437,1306],{"class":526},[315,1439,350],{"class":321},[315,1441,1442],{"class":526}," null",[315,1444,474],{"class":321},[315,1446,1447,1450,1452,1454,1456,1458,1460,1462],{"class":317,"line":566},[315,1448,1449],{"class":500},"    has",[315,1451,510],{"class":321},[315,1453,554],{"class":515},[315,1455,504],{"class":321},[315,1457,527],{"class":526},[315,1459,530],{"class":321},[315,1461,1287],{"class":526},[315,1463,474],{"class":321},[315,1465,1466,1469,1472,1475,1477,1480,1482,1484,1486,1489],{"class":317,"line":578},[315,1467,1468],{"class":500},"    entries",[315,1470,1471],{"class":321},"():",[315,1473,1474],{"class":526}," IterableIterator",[315,1476,938],{"class":321},[315,1478,1479],{"class":325},"[",[315,1481,1133],{"class":526},[315,1483,453],{"class":321},[315,1485,527],{"class":526},[315,1487,1488],{"class":325},"]",[315,1490,1033],{"class":321},[315,1492,1493,1496,1498,1500,1502,1504],{"class":317,"line":620},[315,1494,1495],{"class":500},"    keys",[315,1497,1471],{"class":321},[315,1499,1474],{"class":526},[315,1501,938],{"class":321},[315,1503,1133],{"class":526},[315,1505,1033],{"class":321},[315,1507,1508,1511,1513,1515,1517,1519],{"class":317,"line":651},[315,1509,1510],{"class":500},"    values",[315,1512,1471],{"class":321},[315,1514,1474],{"class":526},[315,1516,938],{"class":321},[315,1518,1133],{"class":526},[315,1520,1033],{"class":321},[315,1522,1523],{"class":317,"line":660},[315,1524,864],{"class":321},[888,1526,1268],{"id":1527},"responsebody",[201,1529,1530],{},"The response body structure containing results and any thrown errors.",[305,1532,1534],{"className":434,"code":1533,"language":437,"meta":311,"style":311},"\u002F** Response body, a record containing the result of each handler or an error. *\u002F\nexport interface ResponseBody extends Record\u003Cstring, any> {\n    '@thrownErrors'?: Record\u003Cstring, RpcError\u003Cstring>>;\n}\n",[218,1535,1536,1541,1570,1597],{"__ignoreMap":311},[315,1537,1538],{"class":317,"line":318},[315,1539,1540],{"class":903},"\u002F** Response body, a record containing the result of each handler or an error. *\u002F\n",[315,1542,1543,1545,1547,1550,1553,1556,1558,1560,1562,1565,1568],{"class":317,"line":342},[315,1544,909],{"class":444},[315,1546,912],{"class":485},[315,1548,1549],{"class":526}," ResponseBody",[315,1551,1552],{"class":485}," extends",[315,1554,1555],{"class":526}," Record",[315,1557,938],{"class":321},[315,1559,1133],{"class":526},[315,1561,453],{"class":321},[315,1563,1564],{"class":526}," any",[315,1566,1567],{"class":321},">",[315,1569,495],{"class":321},[315,1571,1572,1575,1577,1579,1581,1583,1585,1587,1589,1591,1593,1595],{"class":317,"line":364},[315,1573,1574],{"class":321},"    '",[315,1576,710],{"class":372},[315,1578,471],{"class":321},[315,1580,1121],{"class":321},[315,1582,1555],{"class":526},[315,1584,938],{"class":321},[315,1586,1133],{"class":526},[315,1588,453],{"class":321},[315,1590,1138],{"class":526},[315,1592,938],{"class":321},[315,1594,1133],{"class":526},[315,1596,976],{"class":321},[315,1598,1599],{"class":317,"line":402},[315,1600,864],{"class":321},[1602,1603,1604],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":311,"searchDepth":342,"depth":342,"links":1606},[1607,1608,1609],{"id":271,"depth":342,"text":272},{"id":680,"depth":342,"text":681},{"id":885,"depth":342,"text":886,"children":1610},[1611,1612,1613,1614],{"id":890,"depth":364,"text":208},{"id":1153,"depth":364,"text":213},{"id":1315,"depth":364,"text":946},{"id":1527,"depth":364,"text":1268},"Understanding mion's request and response objects.",null,{},{"title":46,"description":1615},"_8967ASjsN8bxlwYz3yqKSyHOLt5AMSC18w1FTrF8n4",[1621,1623],{"title":42,"path":43,"stem":44,"description":1622,"children":-1},"Learn how to define and use middleFns (middleware) in mion APIs.",{"title":50,"path":51,"stem":52,"description":1624,"children":-1},"Learn how to handle errors in mion APIs with strongly typed error returns.",1778674527369]