UNPKG

@sigiljs/sigil

Version:

TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating

2 lines (1 loc) 9.52 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./exception.js");function a(t,e){return e.length>0?e:[t]}class o extends s.default{static name="BadRequest";constructor(...e){super({code:400,name:"BadRequest",message:a("The server could not understand the request due to malformed syntax.",e)})}}class r extends s.default{static name="Unauthorized";constructor(...e){super({code:401,name:"Unauthorized",message:a("The request requires user authentication.",e)})}}class n extends s.default{static name="PaymentRequired";constructor(...e){super({code:402,name:"PaymentRequired",message:a("Payment is required to process the request.",e)})}}class d extends s.default{static name="Forbidden";constructor(...e){super({code:403,name:"Forbidden",message:a("The server understood the request, but refuses to authorize it.",e)})}}class c extends s.default{static name="NotFound";constructor(...e){super({code:404,name:"NotFound",message:a("The requested resource could not be found on the server.",e)})}}class i extends s.default{static name="MethodNotAllowed";constructor(...e){super({code:405,name:"MethodNotAllowed",message:a("The request method is not allowed on the requested resource.",e)})}}class u extends s.default{static name="NotAcceptable";constructor(...e){super({code:406,name:"NotAcceptable",message:a("The requested resource is capable of generating only response not acceptable according to the Accept headers.",e)})}}class l extends s.default{static name="ProxyAuthenticationRequired";constructor(...e){super({code:407,name:"ProxyAuthenticationRequired",message:a("Proxy authentication is required to process the request.",e)})}}class m extends s.default{static name="RequestTimeout";constructor(...e){super({code:408,name:"RequestTimeout",message:a("The server timed out waiting for the client request.",e)})}}class p extends s.default{static name="Conflict";constructor(...e){super({code:409,name:"Conflict",message:a("The request could not be completed due to a conflict with the current state of the resource.",e)})}}class h extends s.default{static name="Gone";constructor(...e){super({code:410,name:"Gone",message:a("The requested resource is no longer available and has been permanently removed.",e)})}}class g extends s.default{static name="LengthRequired";constructor(...e){super({code:411,name:"LengthRequired",message:a("The request did not specify the length of its response, which is required by the requested resource.",e)})}}class f extends s.default{static name="PreconditionFailed";constructor(...e){super({code:412,name:"PreconditionFailed",message:a("The precondition given in one or more request-header fields evaluated to false when it was tested on the server.",e)})}}class q extends s.default{static name="PayloadTooLarge";constructor(...e){super({code:413,name:"PayloadTooLarge",message:a("The request entity is larger than the server is willing or able to process.",e)})}}class T extends s.default{static name="URITooLong";constructor(...e){super({code:414,name:"URITooLong",message:a("The URI provided was too long for the server to process.",e)})}}class y extends s.default{static name="UnsupportedMediaType";constructor(...e){super({code:415,name:"UnsupportedMediaType",message:a("The request entity has a media type that the server or resource does not support.",e)})}}class x extends s.default{static name="RangeNotSatisfiable";constructor(...e){super({code:416,name:"RangeNotSatisfiable",message:a("The client has asked for a portion of the file, but the server cannot supply that portion.",e)})}}class v extends s.default{static name="ExpectationFailed";constructor(...e){super({code:417,name:"ExpectationFailed",message:a("The server cannot meet the requirements of the Expect request-header field.",e)})}}class R extends s.default{static name="ImATeapot";constructor(...e){super({code:418,name:"ImATeapot",message:a("The server refuses the attempt to brew coffee with a teapot.",e)})}}class b extends s.default{static name="MisdirectedRequest";constructor(...e){super({code:421,name:"MisdirectedRequest",message:a("The request was directed at a server that is not able to produce a response.",e)})}}class w extends s.default{static name="UnprocessableEntity";constructor(...e){super({code:422,name:"UnprocessableEntity",message:a("The request was well-formed but unable to be followed due to semantic errors.",e)})}}class N extends s.default{static name="Locked";constructor(...e){super({code:423,name:"Locked",message:a("The resource that is being accessed is locked.",e)})}}class F extends s.default{static name="FailedDependency";constructor(...e){super({code:424,name:"FailedDependency",message:a("The request failed due to the failure of a previous request.",e)})}}class U extends s.default{static name="TooEarly";constructor(...e){super({code:425,name:"TooEarly",message:a("The server is unwilling to risk processing a request that might be replayed.",e)})}}class L extends s.default{static name="UpgradeRequired";constructor(...e){super({code:426,name:"UpgradeRequired",message:a("The server refuses to process the request without an upgrade to a different protocol.",e)})}}class P extends s.default{static name="PreconditionRequired";constructor(...e){super({code:428,name:"PreconditionRequired",message:a("The origin server requires the request to be conditional.",e)})}}class A extends s.default{static name="TooManyRequests";constructor(...e){super({code:429,name:"TooManyRequests",message:a("The user has sent too many requests in a given amount of time.",e)})}}class E extends s.default{static name="RequestHeaderFieldsTooLarge";constructor(...e){super({code:431,name:"RequestHeaderFieldsTooLarge",message:a("The server is unwilling to process the request because its header fields are too large.",e)})}}class S extends s.default{static name="UnavailableForLegalReasons";constructor(...e){super({code:451,name:"UnavailableForLegalReasons",message:a("The resource requested is unavailable due to legal reasons.",e)})}}class I extends s.default{static name="InternalServerError";constructor(...e){super({code:500,name:"InternalServerError",message:a("The server encountered an unexpected condition that prevented it from fulfilling the request.",e)})}}class M extends s.default{static name="NotImplemented";constructor(...e){super({code:501,name:"NotImplemented",message:a("The server does not support the functionality required to fulfill the request.",e)})}}class k extends s.default{static name="BadGateway";constructor(...e){super({code:502,name:"BadGateway",message:a("The server, while acting as a gateway or proxy, received an invalid response from the upstream server.",e)})}}class G extends s.default{static name="ServiceUnavailable";constructor(...e){super({code:503,name:"ServiceUnavailable",message:a("The server is currently unable to handle the request due to a temporary overload or maintenance.",e)})}}class H extends s.default{static name="GatewayTimeout";constructor(...e){super({code:504,name:"GatewayTimeout",message:a("The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.",e)})}}class B extends s.default{static name="HTTPVersionNotSupported";constructor(...e){super({code:505,name:"HTTPVersionNotSupported",message:a("The server does not support the HTTP protocol version used in the request.",e)})}}class D extends s.default{static name="VariantAlsoNegotiates";constructor(...e){super({code:506,name:"VariantAlsoNegotiates",message:a("The server has an internal configuration error and is unable to complete the request.",e)})}}class V extends s.default{static name="InsufficientStorage";constructor(...e){super({code:507,name:"InsufficientStorage",message:a("The server is unable to store the representation needed to complete the request.",e)})}}class z extends s.default{static name="LoopDetected";constructor(...e){super({code:508,name:"LoopDetected",message:a("The server detected an infinite loop while processing the request.",e)})}}class C extends s.default{static name="NotExtended";constructor(...e){super({code:510,name:"NotExtended",message:a("Further extensions to the request are required for the server to fulfill it.",e)})}}class j extends s.default{static name="NetworkAuthenticationRequired";constructor(...e){super({code:511,name:"NetworkAuthenticationRequired",message:a("The client needs to authenticate to gain network access.",e)})}}exports.Exception=s.default;exports.BadGateway=k;exports.BadRequest=o;exports.Conflict=p;exports.ExpectationFailed=v;exports.FailedDependency=F;exports.Forbidden=d;exports.GatewayTimeout=H;exports.Gone=h;exports.HTTPVersionNotSupported=B;exports.ImATeapot=R;exports.InsufficientStorage=V;exports.InternalServerError=I;exports.LengthRequired=g;exports.Locked=N;exports.LoopDetected=z;exports.MethodNotAllowed=i;exports.MisdirectedRequest=b;exports.NetworkAuthenticationRequired=j;exports.NotAcceptable=u;exports.NotExtended=C;exports.NotFound=c;exports.NotImplemented=M;exports.PayloadTooLarge=q;exports.PaymentRequired=n;exports.PreconditionFailed=f;exports.PreconditionRequired=P;exports.ProxyAuthenticationRequired=l;exports.RangeNotSatisfiable=x;exports.RequestHeaderFieldsTooLarge=E;exports.RequestTimeout=m;exports.ServiceUnavailable=G;exports.TooEarly=U;exports.TooManyRequests=A;exports.URITooLong=T;exports.Unauthorized=r;exports.UnavailableForLegalReasons=S;exports.UnprocessableEntity=w;exports.UnsupportedMediaType=y;exports.UpgradeRequired=L;exports.VariantAlsoNegotiates=D;