@goa/goa
Version:
The Goa Source Code For Compilation Into @Goa/Koa That Includes Modules, Tests, Types And Dependencies.
172 lines (166 loc) • 8.28 kB
text/xml
<types namespace="_goa">
<import from="http" name="IncomingMessage" />
<import from="http" name="ServerResponse" />
<import from="url" name="URL" />
<import from="net" name="Socket" />
<import from=".." ns="_goa" name="Accepts" />
<import from=".." ns="_goa" name="Application" />
<import from=".." ns="_goa" name="Context" />
<import from=".." ns="_goa" name="Response" />
<type interface name="ContextDelegatedRequest" desc="The request API available via Context.">
<fn return="string|!Array<string>|boolean" name="acceptsLanguages">
<arg type="!Array<string>|string" name="language" opt>
The language to check as a parameter, or multiple languages as an array.
</arg>
<arg type="string" name="...languages">
Languages to check as parameters.
</arg>
Return accepted languages or best fit based on `langs`. Given `Accept-Language: en;q=0.8, es, pt` an array sorted by quality is returned: `['es', 'pt', 'en']`.
</fn>
<fn return="string|!Array<string>|boolean" name="acceptsEncodings">
<arg type="!Array<string>|string" name="encoding" opt>
The encoding to check as a parameter, or multiple encodings as an array.
</arg>
<arg type="string" name="...encodings">
Encodings to check as parameters.
</arg>
Return accepted encodings or best fit based on `encodings`. Given `Accept-Encoding: gzip, deflate` an array sorted by quality is returned: `['gzip', 'deflate']`.
</fn>
<fn return="string|!Array<string>|boolean" name="acceptsCharsets">
<arg type="!Array<string>|string" name="charset" opt>
The charset to check as a parameter, or multiple charsets as an array.
</arg>
<arg type="string" name="...charsets">
Charsets to check as parameters.
</arg>
Return accepted charsets or best fit based on `charsets`. Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` an array sorted by quality is returned: `['utf-8', 'utf-7', 'iso-8859-1']`.
</fn>
<fn return="string|!Array<string>|boolean" name="accepts" example="../example/jsdoc/request/accepts.js">
<arg type="!Array<string>|string" name="type" opt>
The type to check as a parameter, or multiple types as an array.
</arg>
<arg type="string" name="...types">
Types to check as parameters.
</arg>
Check if the given `type(s)` is acceptable, returning the best match when true, otherwise `false`, in which case you should respond with 406 "Not Acceptable".
The `type` value may be a single mime type string such as "application/json", the extension name such as "json" or an array `["json", "html", "text/plain"]`. When a list or array is given the _best_ match, if any is returned. When no types are given as arguments, returns all types accepted by the client in the preference order.
</fn>
<fn name="get" example="../example/jsdoc/request/get.js" return="string">
<arg string name="header">The name of the header to get.</arg>
Return request header. The `Referrer` header field is special-cased, both `Referrer` and `Referer` are interchangeable.
</fn>
<fn return="string|boolean|null" name="is" example="../example/jsdoc/request/is.js">
<arg type="!Array<string>|string" name="type">
The type to check as a parameter, or multiple types as an array.
</arg>
<arg type="string" name="...types">
Types to check as parameters.
</arg>
Check if the incoming request contains the "Content-Type" header field, and it contains any of the give mime `type`s. If there is no request body, `null` is returned. If there is no content type, `false` is returned. Otherwise, it returns the first `type` that matches.
</fn>
<prop string name="querystring">
Get/Set query string.
</prop>
<prop boolean name="idempotent">
Check if the request is idempotent.
</prop>
<prop type="net.Socket" name="socket">
Return the request socket.
</prop>
<prop string name="search">
Get the search string. Same as the querystring except it includes the leading ?. Set the search string. Same as `response.querystring=` but included for ubiquity.
</prop>
<prop string name="method">
Get/Set request method.
</prop>
<prop type="!Object|string" name="query">
Get parsed query-string. Set query-string as an object.
</prop>
<prop string name="path">
Get request pathname. Set pathname, retaining the query-string when present.
</prop>
<prop string name="url">
Get/Set request URL.
</prop>
<prop type="_goa.Accepts" name="accept">
Get accept object. Lazily memoized.
</prop>
<prop string name="origin">
Get origin of URL.
</prop>
<prop string name="href">
Get full request URL.
</prop>
<prop type="!Array<string>" name="subdomains">
Return subdomains as an array.
Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two parts of the host. This can be changed by setting `app.subdomainOffset`. For example, if the domain is "tobi.ferrets.example.com":
- If `app.subdomainOffset` is not set, this.subdomains is `["ferrets", "tobi"]`.
- If `app.subdomainOffset` is 3, this.subdomains is `["tobi"]`.
</prop>
<prop string name="protocol">
Return the protocol string "http" or "https" when requested with TLS. When the proxy setting is enabled the "X-Forwarded-Proto" header is enabled the "X-Forwarded-Proto" header a reverse proxy that supplies https for you this may be enabled.
</prop>
<prop string name="host">
Parse the "Host" header field host and support X-Forwarded-Host when a proxy is enabled.
</prop>
<prop string name="hostname">
Parse the "Host" header field hostname and support X-Forwarded-Host when a proxy is enabled.
</prop>
<prop type="url.URL|Object" name="URL">
Get WHATWG parsed URL object.
</prop>
<prop type="!Object<string, string>" name="header">
Return request header.
</prop>
<prop type="!Object<string, string>" name="headers">
Return request header, alias as `request.header`.
</prop>
<prop boolean name="secure">
Short-hand for: `this.protocol == 'https'`.
</prop>
<prop boolean name="stale">
Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.
</prop>
<prop boolean name="fresh">
Check if the request is fresh, aka Last-Modified and/or the ETag still match.
</prop>
<prop type="!Array<string>" name="ips">
When `app.proxy` is `true`, parse the "X-Forwarded-For" ip address list. For example if the value were "client, proxy1, proxy2" you would receive the array `["client", "proxy1", "proxy2"]` where "proxy2" is the furthest down-stream.
</prop>
<prop string name="ip">
Request remote address. Supports X-Forwarded-For when app.proxy is true.
</prop>
</type>
<type interface extends="_goa.ContextDelegatedRequest" name="BaseRequest"
desc="The additional API not available via Context.">
<prop opt string name="charset">
Get the charset when present or undefined.
</prop>
<prop type="?number" name="length">
Return parsed Content-Length when present.
</prop>
<prop opt string name="type">
Return the request mime type void of parameters such as "charset".
</prop>
</type>
<type interface extends="_goa.BaseRequest" name="Request" desc="The request object.">
<prop type="!_goa.Application" name="app">
The reference to the application.
</prop>
<prop type="!_goa.Context" name="ctx">
The reference to the context instance.
</prop>
<prop type="!_goa.Response" name="response">
The reference to the request instance.
</prop>
<prop type="!http.IncomingMessage" name="req">
The message from the client.
</prop>
<prop type="!http.ServerResponse" name="res">
The response from the server.
</prop>
<prop opt string name="originalUrl">
The original url set by the `parseurl` package.
</prop>
</type>
</types>