@andrewcaires/express 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -15
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.esm.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,35 +16,84 @@ The module is now available on npm! `npm i @andrewcaires/express`
|
|
|
16
16
|
```js
|
|
17
17
|
// index.ts
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
import {
|
|
20
|
+
|
|
21
|
+
Application,
|
|
22
|
+
Argument,
|
|
23
|
+
Body,
|
|
24
|
+
Controller,
|
|
25
|
+
Delete,
|
|
26
|
+
Get,
|
|
27
|
+
Middleware,
|
|
28
|
+
Next,
|
|
29
|
+
Params,
|
|
30
|
+
Post,
|
|
31
|
+
Put,
|
|
32
|
+
Responses,
|
|
33
|
+
Send
|
|
34
|
+
|
|
35
|
+
} from "@andrewcaires/express";
|
|
36
|
+
import { NextFunction } from "express";
|
|
37
|
+
|
|
38
|
+
@Controller("/test")
|
|
39
|
+
class TestController {
|
|
40
|
+
|
|
41
|
+
public middleware(@Argument() arg: boolean, @Next() next: NextFunction) {
|
|
42
|
+
|
|
43
|
+
console.log("middleware", arg);
|
|
44
|
+
|
|
45
|
+
next();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Post()
|
|
49
|
+
@Middleware("middleware", "add")
|
|
50
|
+
public add(@Body() body: object, @Send() res: Responses) {
|
|
51
|
+
|
|
52
|
+
res.data(body);
|
|
53
|
+
}
|
|
21
54
|
|
|
22
55
|
@Get()
|
|
23
|
-
|
|
56
|
+
@Middleware("middleware", "all")
|
|
57
|
+
public all(@Send() res: Responses) {
|
|
24
58
|
|
|
25
|
-
|
|
59
|
+
res.list([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
26
60
|
}
|
|
27
|
-
}
|
|
28
61
|
|
|
29
|
-
|
|
62
|
+
@Delete("/:id")
|
|
63
|
+
@Middleware("middleware", "del")
|
|
64
|
+
public del(@Params("id") id: string, @Send() res: Responses) {
|
|
65
|
+
|
|
66
|
+
res.success(id);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Get("/:id")
|
|
70
|
+
@Middleware("middleware", "get")
|
|
71
|
+
public get(@Params("id") id: string, @Send() res: Responses) {
|
|
72
|
+
|
|
73
|
+
res.data({ id, name: "test" });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@Put("/:id")
|
|
77
|
+
@Middleware("middleware", "set")
|
|
78
|
+
public set(@Params("id") id: string, @Send() res: Responses) {
|
|
79
|
+
|
|
80
|
+
res.success(id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
30
83
|
|
|
31
84
|
const main = async () => {
|
|
32
85
|
|
|
33
|
-
const app = new Application(
|
|
34
|
-
[
|
|
86
|
+
const app = new Application([
|
|
35
87
|
|
|
36
|
-
|
|
88
|
+
new TestController,
|
|
37
89
|
|
|
38
|
-
|
|
39
|
-
{
|
|
90
|
+
], {
|
|
40
91
|
|
|
41
|
-
|
|
92
|
+
path: "/api",
|
|
42
93
|
|
|
43
|
-
|
|
44
|
-
);
|
|
94
|
+
});
|
|
45
95
|
|
|
46
96
|
await app.listen();
|
|
47
|
-
|
|
48
97
|
};
|
|
49
98
|
|
|
50
99
|
main().catch(console.log);
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @andrewcaires/express v1.0.
|
|
2
|
+
* @andrewcaires/express v1.0.1
|
|
3
3
|
* Decorators for express
|
|
4
4
|
* (c) 2023 Andrew Caires
|
|
5
5
|
* @license: MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";require("reflect-metadata");var e=require("@andrewcaires/utils.js"),t=require("cors"),s=require("express"),r=require("fs"),o=require("http"),n=require("https"),p=require("net"),i=require("path");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var E,_=a(o),x=a(n);function h(e,t,s,r){return new(s||(s=Promise))((function(o,n){function p(e){try{a(r.next(e))}catch(e){n(e)}}function i(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(p,i)}a((r=r.apply(e,t||[])).next())}))}exports.MetadataKeys=void 0,(E=exports.MetadataKeys||(exports.MetadataKeys={})).MIDDLEWARE="@express_middleware",E.PATH="@express_path",E.ROUTERS="@express_routers",E.PARAMETERS="@express_parameters";const u=(e,t,s)=>Reflect.hasMetadata(e,t)?Reflect.getMetadata(e,t):s,d=200;class c{constructor(e){this.res=e}success(e){return c.success(this.res,e)}static success(e,t){return e.status(d).json({message:t})}data(e){return c.data(this.res,e)}static data(e,t){return e.status(d).json(Object.assign({},t))}error(e){return c.error(this.res,e)}static error(e,t){return e.status(500).json({message:t})}list(e){return c.list(this.res,e)}static list(e,t){return e.status(d).json([...t])}notfound(e){return c.notfound(this.res,e)}static notfound(e,t){return e.status(404).json({message:t})}validation(e){return c.validation(this.res,e)}static validation(e,t){return e.status(400).json({message:t})}unauthorized(e){return c.unauthorized(this.res,e)}static unauthorized(e,t){return e.status(401).json({message:t})}}class T extends e.EventEmitter{get instance(){return this._app}get router(){return this._router}constructor(o,n){var p;super(),this._app=s(),this._options={},this._default={cross:!1,hybrid:!1,path:"/",port:3e3},this._router=s.Router(),this._controlles=s.Router(),this._options=Object.assign(Object.assign({},this._default),n),this._app.use(s.json()),this._app.disable("x-powered-by"),this._app.use(s.urlencoded({extended:!0})),this._options.cross&&this._app.use(t()),this._app.use(this._router);const a=(null===(p=this._options.path)||void 0===p?void 0:p.length)?this._options.path:"/";if(this._app.use(a,this._controlles),this._app.all(a+"/*",((e,t)=>c.notfound(t,"Invalid API"))),this._options.public){const e=i.resolve(this._options.public);r.existsSync(e)&&this._app.use(s.static(e)),this._app.get("*",((t,s)=>{if(!r.existsSync(e))return c.notfound(s,'File "index.html" not found');s.sendFile(e+"/index.html")}))}o.forEach((t=>{const r=t.constructor,o=this._path(r),n=this._routers(r),p=this._middlewares(r),i=this._parameters(r),a=s.Router();n.forEach((s=>{const o=s.name.toString();if(e.isFunction(t[o])){if(!e.isFunction(a[s.method]))return this.error(new Error('Method "'+s.method+'" Not Found.'),"Express");const r=this._handles(t,o,p,i),n=this._indexes(o,i);a[s.method](s.path,...r,((e,s,r)=>t[o](...this._args(e,s,r,n))))}else this.error(new Error('Router "'+r.name+"."+o+'" Not Found.'),"Express")})),this._controlles.use(o,a)}))}error(t,s){e.isUndefined(s)?console.error(t):console.error(s+":",t)}log(t,s){e.isUndefined(s)?console.error(t):console.error(s+":",t)}_args(e,t,s,r,o){const n=[],p={req:e,res:t,next:s,app:this,send:new c(t),argument:o};return r.forEach((e=>{n[e.index]=e.callback(Object.assign(Object.assign({},p),{key:e.key}))})),n}_handles(t,s,r,o){return r.filter((e=>e.name==s)).map((s=>{if(e.isFunction(t[s.method])){const e=this._indexes(s.method,o);return(r,o,n)=>t[s.method](...this._args(r,o,n,e,s.argument))}this.error(new Error('Middleware "'+s.method+'" Not Found.'),"Express")})).filter(e.isFunction)}_indexes(e,t){const s=[];return t.forEach((t=>t.name==e&&s.push(t))),s}_middlewares(e){return[...u(exports.MetadataKeys.MIDDLEWARE,e,[])].reverse()}_parameters(e){return u(exports.MetadataKeys.PARAMETERS,e,[])}_path(e){return u(exports.MetadataKeys.PATH,e,"/")}_routers(e){return u(exports.MetadataKeys.ROUTERS,e,[])}listen(){return h(this,void 0,void 0,(function*(){if(this._options.cert&&this._options.key||(this._server=_.createServer(this._app),this._server.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express")))),!this._server){const e=_.createServer(((e,t)=>{const s=80==this._options.port?":80":"";t.writeHead(301,{Location:"https://"+e.headers.host+s+e.url}),t.end()})),t=x.createServer({key:this._options.key,cert:this._options.cert},this._app);if(this._options.hybrid){new p.Server((s=>{s.once("data",(r=>{s.pause(),s.unshift(r),(22===r[0]?t:e).emit("connection",s),process.nextTick((()=>s.resume()))}))})).listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=t}this._server||(443==this._options.port&&e.listen(80,(()=>this.log("Server started on port 80","Express"))),t.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=t)}}))}}var R;exports.Methods=void 0,(R=exports.Methods||(exports.Methods={})).GET="get",R.POST="post",R.PUT="put",R.HEAD="head",R.DELETE="delete",R.OPTIONS="options",R.PATCH="patch";const O=e=>t=>(s,r)=>{const o=s.constructor,n=u(exports.MetadataKeys.ROUTERS,o,[]);n.push({path:(null==t?void 0:t.length)?t:"/",method:e,name:r}),Reflect.defineMetadata(exports.MetadataKeys.ROUTERS,n,o)},l=O(exports.Methods.GET),A=O(exports.Methods.POST),N=O(exports.Methods.PUT),I=O(exports.Methods.HEAD),S=O(exports.Methods.DELETE),D=O(exports.Methods.OPTIONS),M=O(exports.Methods.PATCH),f=e=>t=>(s,r,o)=>{const n=s.constructor,p=u(exports.MetadataKeys.PARAMETERS,n,[]);p.push({callback:e,index:o,key:(null==t?void 0:t.length)?t:"",name:r}),Reflect.defineMetadata(exports.MetadataKeys.PARAMETERS,p,n)},P=(t,s)=>e.isUndefined(s)?t:t[s],U=f((({app:e})=>e)),m=f((({argument:e})=>e)),L=f((({req:e,key:t})=>P(e.body,t))),y=f((({req:e,key:t})=>P(e.cookies,t))),C=f((({req:e,key:t})=>P(e.cookies,t))),v=f((({next:e})=>e)),g=f((({req:e,key:t})=>P(e.params,t))),F=f((({req:e,key:t})=>P(e.query,t))),H=f((({req:e})=>e)),b=H,j=f((({res:e})=>e)),q=j,k=f((({send:e})=>e));exports.ACCEPTED=202,exports.ALREADY_REPORTED=208,exports.App=U,exports.Application=T,exports.Argument=m,exports.BAD_GATEWAY=502,exports.BAD_REQUEST=400,exports.Body=L,exports.CLIENT_CLOSED_REQUEST=499,exports.CONFLICT=409,exports.CONNECTION_CLOSED_WITHOUT_RESPONSE=444,exports.CONTINUE=100,exports.CREATED=201,exports.Controller=e=>t=>Reflect.defineMetadata(exports.MetadataKeys.PATH,(null==e?void 0:e.length)?e:"/",t),exports.Cookies=y,exports.Delete=S,exports.EXPECTATION_FAILED=417,exports.FAILED_DEPENDENCY=424,exports.FORBIDDEN=403,exports.FOUND=302,exports.GATEWAY_TIMEOUT=504,exports.GONE=410,exports.Get=l,exports.HTTP_VERSION_NOT_SUPPORTED=505,exports.Head=I,exports.Headers=C,exports.IM_A_TEAPOT=418,exports.IM_USED=226,exports.INSUFFICIENT_STORAGE=507,exports.INTERNAL_SERVER_ERROR=500,exports.LENGTH_REQUIRED=411,exports.LOCKED=423,exports.LOOP_DETECTED=508,exports.METHOD_NOT_ALLOWED=405,exports.MISDIRECTED_REQUEST=421,exports.MOVED_PERMANENTLY=301,exports.MULTIPLE_CHOICES=300,exports.MULTI_STATUS=207,exports.Metadata=u,exports.Middleware=(e,t)=>(s,r)=>{const o=s.constructor,n=u(exports.MetadataKeys.MIDDLEWARE,o,[]);n.push({name:r,method:e,argument:t}),Reflect.defineMetadata(exports.MetadataKeys.MIDDLEWARE,n,o)},exports.NETWORK_AUTHENTICATION_REQUIRED=511,exports.NETWORK_CONNECTION_TIMEOUT_ERROR=599,exports.NON_AUTHORITATIVE_INFORMATION=203,exports.NOT_ACCEPTABLE=406,exports.NOT_EXTENDED=510,exports.NOT_FOUND=404,exports.NOT_IMPLEMENTED=501,exports.NOT_MODIFIED=304,exports.NO_CONTENT=204,exports.Next=v,exports.OK=d,exports.Options=D,exports.PARTIAL_CONTENT=206,exports.PAYLOAD_TOO_LARGE=413,exports.PAYMENT_REQUIRED=402,exports.PERMANENT_REDIRECT=308,exports.PRECONDITION_FAILED=412,exports.PRECONDITION_REQUIRED=428,exports.PROCESSING=102,exports.PROXY_AUTHENTICATION_REQUIRED=407,exports.Params=g,exports.Patch=M,exports.Post=A,exports.Put=N,exports.Query=F,exports.REQUESTED_RANGE_NOT_SATISFIABLE=416,exports.REQUEST_HEADER_FIELDS_TOO_LARGE=431,exports.REQUEST_TIMEOUT=408,exports.REQUEST_URI_TOO_LONG=414,exports.RESET_CONTENT=205,exports.Req=b,exports.Request=H,exports.Res=q,exports.Response=j,exports.Responses=c,exports.SEE_OTHER=303,exports.SERVICE_UNAVAILABLE=503,exports.SWITCHING_PROTOCOLS=101,exports.Send=k,exports.TEMPORARY_REDIRECT=307,exports.TOO_MANY_REQUESTS=429,exports.UNAUTHORIZED=401,exports.UNAVAILABLE_FOR_LEGAL_REASONS=451,exports.UNPROCESSABLE_ENTITY=422,exports.UNSUPPORTED_MEDIA_TYPE=415,exports.UPGRADE_REQUIRED=426,exports.USE_PROXY=305,exports.VARIANT_ALSO_NEGOCIATES=506,exports.methodFactory=O,exports.parameterFactory=f;
|
|
7
|
+
"use strict";require("reflect-metadata");var e=require("@andrewcaires/utils.js"),t=require("cors"),s=require("express"),r=require("fs"),o=require("http"),n=require("https"),p=require("net"),i=require("path");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var E,_=a(o),x=a(n);function h(e,t,s,r){return new(s||(s=Promise))((function(o,n){function p(e){try{a(r.next(e))}catch(e){n(e)}}function i(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(p,i)}a((r=r.apply(e,t||[])).next())}))}exports.MetadataKeys=void 0,(E=exports.MetadataKeys||(exports.MetadataKeys={})).MIDDLEWARE="@express_middleware",E.PATH="@express_path",E.ROUTERS="@express_routers",E.PARAMETERS="@express_parameters";const u=(e,t,s)=>Reflect.hasMetadata(e,t)?Reflect.getMetadata(e,t):s,d=200;class c{constructor(e){this.res=e}success(e){return c.success(this.res,e)}static success(e,t){return e.status(d).json({message:t})}data(e){return c.data(this.res,e)}static data(e,t){return e.status(d).json(Object.assign({},t))}error(e){return c.error(this.res,e)}static error(e,t){return e.status(500).json({message:t})}list(e){return c.list(this.res,e)}static list(e,t){return e.status(d).json([...t])}notfound(e){return c.notfound(this.res,e)}static notfound(e,t){return e.status(404).json({message:t})}validation(e){return c.validation(this.res,e)}static validation(e,t){return e.status(400).json({message:t})}unauthorized(e){return c.unauthorized(this.res,e)}static unauthorized(e,t){return e.status(401).json({message:t})}}class T extends e.EventEmitter{get instance(){return this._app}get router(){return this._router}get server(){return this._server}constructor(o,n){var p;super(),this._app=s(),this._options={},this._default={cross:!1,hybrid:!1,path:"/",port:3e3},this._router=s.Router(),this._controlles=s.Router(),this._options=Object.assign(Object.assign({},this._default),n),this._app.use(s.json()),this._app.disable("x-powered-by"),this._app.use(s.urlencoded({extended:!0})),this._options.cross&&this._app.use(t()),this._app.use(this._router);const a=(null===(p=this._options.path)||void 0===p?void 0:p.length)?this._options.path:"/";if(this._app.use(a,this._controlles),this._app.all(a+"/*",((e,t)=>c.notfound(t,"Invalid API"))),this._options.public){const e=i.resolve(this._options.public);r.existsSync(e)&&this._app.use(s.static(e)),this._app.get("*",((t,s)=>{if(!r.existsSync(e))return c.notfound(s,'File "index.html" not found');s.sendFile(e+"/index.html")}))}o.forEach((t=>{const r=t.constructor,o=this._path(r),n=this._routers(r),p=this._middlewares(r),i=this._parameters(r),a=s.Router();n.forEach((s=>{const o=s.name.toString();if(e.isFunction(t[o])){if(!e.isFunction(a[s.method]))return this.error(new Error('Method "'+s.method+'" Not Found.'),"Express");const r=this._handles(t,o,p,i),n=this._indexes(o,i);a[s.method](s.path,...r,((e,s,r)=>t[o](...this._args(e,s,r,n))))}else this.error(new Error('Router "'+r.name+"."+o+'" Not Found.'),"Express")})),this._controlles.use(o,a)}))}error(t,s){e.isUndefined(s)?console.error(t):console.error(s+":",t)}log(t,s){e.isUndefined(s)?console.error(t):console.error(s+":",t)}_args(e,t,s,r,o){const n=[],p={req:e,res:t,next:s,app:this,send:new c(t),argument:o};return r.forEach((e=>{n[e.index]=e.callback(Object.assign(Object.assign({},p),{key:e.key}))})),n}_handles(t,s,r,o){return r.filter((e=>e.name==s)).map((s=>{if(e.isFunction(t[s.method])){const e=this._indexes(s.method,o);return(r,o,n)=>t[s.method](...this._args(r,o,n,e,s.argument))}this.error(new Error('Middleware "'+s.method+'" Not Found.'),"Express")})).filter(e.isFunction)}_indexes(e,t){const s=[];return t.forEach((t=>t.name==e&&s.push(t))),s}_middlewares(e){return[...u(exports.MetadataKeys.MIDDLEWARE,e,[])].reverse()}_parameters(e){return u(exports.MetadataKeys.PARAMETERS,e,[])}_path(e){return u(exports.MetadataKeys.PATH,e,"/")}_routers(e){return u(exports.MetadataKeys.ROUTERS,e,[])}listen(){return h(this,void 0,void 0,(function*(){if(this._options.cert&&this._options.key||(this._server=_.createServer(this._app),this._server.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express")))),!this._server){const e=_.createServer(((e,t)=>{const s=80==this._options.port?":80":"";t.writeHead(301,{Location:"https://"+e.headers.host+s+e.url}),t.end()})),t=x.createServer({key:this._options.key,cert:this._options.cert},this._app);if(this._options.hybrid){new p.Server((s=>{s.once("data",(r=>{s.pause(),s.unshift(r),(22===r[0]?t:e).emit("connection",s),process.nextTick((()=>s.resume()))}))})).listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=t}this._server||(443==this._options.port&&e.listen(80,(()=>this.log("Server started on port 80","Express"))),t.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=t)}}))}}var R;exports.Methods=void 0,(R=exports.Methods||(exports.Methods={})).GET="get",R.POST="post",R.PUT="put",R.HEAD="head",R.DELETE="delete",R.OPTIONS="options",R.PATCH="patch";const O=e=>t=>(s,r)=>{const o=s.constructor,n=u(exports.MetadataKeys.ROUTERS,o,[]);n.push({path:(null==t?void 0:t.length)?t:"/",method:e,name:r}),Reflect.defineMetadata(exports.MetadataKeys.ROUTERS,n,o)},l=O(exports.Methods.GET),A=O(exports.Methods.POST),N=O(exports.Methods.PUT),I=O(exports.Methods.HEAD),S=O(exports.Methods.DELETE),D=O(exports.Methods.OPTIONS),M=O(exports.Methods.PATCH),f=e=>t=>(s,r,o)=>{const n=s.constructor,p=u(exports.MetadataKeys.PARAMETERS,n,[]);p.push({callback:e,index:o,key:(null==t?void 0:t.length)?t:"",name:r}),Reflect.defineMetadata(exports.MetadataKeys.PARAMETERS,p,n)},P=(t,s)=>e.isUndefined(s)?t:t[s],U=f((({app:e})=>e)),m=f((({argument:e})=>e)),L=f((({req:e,key:t})=>P(e.body,t))),y=f((({req:e,key:t})=>P(e.cookies,t))),C=f((({req:e,key:t})=>P(e.cookies,t))),v=f((({next:e})=>e)),g=f((({req:e,key:t})=>P(e.params,t))),F=f((({req:e,key:t})=>P(e.query,t))),H=f((({req:e})=>e)),b=H,j=f((({res:e})=>e)),q=j,k=f((({send:e})=>e));exports.ACCEPTED=202,exports.ALREADY_REPORTED=208,exports.App=U,exports.Application=T,exports.Argument=m,exports.BAD_GATEWAY=502,exports.BAD_REQUEST=400,exports.Body=L,exports.CLIENT_CLOSED_REQUEST=499,exports.CONFLICT=409,exports.CONNECTION_CLOSED_WITHOUT_RESPONSE=444,exports.CONTINUE=100,exports.CREATED=201,exports.Controller=e=>t=>Reflect.defineMetadata(exports.MetadataKeys.PATH,(null==e?void 0:e.length)?e:"/",t),exports.Cookies=y,exports.Delete=S,exports.EXPECTATION_FAILED=417,exports.FAILED_DEPENDENCY=424,exports.FORBIDDEN=403,exports.FOUND=302,exports.GATEWAY_TIMEOUT=504,exports.GONE=410,exports.Get=l,exports.HTTP_VERSION_NOT_SUPPORTED=505,exports.Head=I,exports.Headers=C,exports.IM_A_TEAPOT=418,exports.IM_USED=226,exports.INSUFFICIENT_STORAGE=507,exports.INTERNAL_SERVER_ERROR=500,exports.LENGTH_REQUIRED=411,exports.LOCKED=423,exports.LOOP_DETECTED=508,exports.METHOD_NOT_ALLOWED=405,exports.MISDIRECTED_REQUEST=421,exports.MOVED_PERMANENTLY=301,exports.MULTIPLE_CHOICES=300,exports.MULTI_STATUS=207,exports.Metadata=u,exports.Middleware=(e,t)=>(s,r)=>{const o=s.constructor,n=u(exports.MetadataKeys.MIDDLEWARE,o,[]);n.push({name:r,method:e,argument:t}),Reflect.defineMetadata(exports.MetadataKeys.MIDDLEWARE,n,o)},exports.NETWORK_AUTHENTICATION_REQUIRED=511,exports.NETWORK_CONNECTION_TIMEOUT_ERROR=599,exports.NON_AUTHORITATIVE_INFORMATION=203,exports.NOT_ACCEPTABLE=406,exports.NOT_EXTENDED=510,exports.NOT_FOUND=404,exports.NOT_IMPLEMENTED=501,exports.NOT_MODIFIED=304,exports.NO_CONTENT=204,exports.Next=v,exports.OK=d,exports.Options=D,exports.PARTIAL_CONTENT=206,exports.PAYLOAD_TOO_LARGE=413,exports.PAYMENT_REQUIRED=402,exports.PERMANENT_REDIRECT=308,exports.PRECONDITION_FAILED=412,exports.PRECONDITION_REQUIRED=428,exports.PROCESSING=102,exports.PROXY_AUTHENTICATION_REQUIRED=407,exports.Params=g,exports.Patch=M,exports.Post=A,exports.Put=N,exports.Query=F,exports.REQUESTED_RANGE_NOT_SATISFIABLE=416,exports.REQUEST_HEADER_FIELDS_TOO_LARGE=431,exports.REQUEST_TIMEOUT=408,exports.REQUEST_URI_TOO_LONG=414,exports.RESET_CONTENT=205,exports.Req=b,exports.Request=H,exports.Res=q,exports.Response=j,exports.Responses=c,exports.SEE_OTHER=303,exports.SERVICE_UNAVAILABLE=503,exports.SWITCHING_PROTOCOLS=101,exports.Send=k,exports.TEMPORARY_REDIRECT=307,exports.TOO_MANY_REQUESTS=429,exports.UNAUTHORIZED=401,exports.UNAVAILABLE_FOR_LEGAL_REASONS=451,exports.UNPROCESSABLE_ENTITY=422,exports.UNSUPPORTED_MEDIA_TYPE=415,exports.UPGRADE_REQUIRED=426,exports.USE_PROXY=305,exports.VARIANT_ALSO_NEGOCIATES=506,exports.methodFactory=O,exports.parameterFactory=f;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @andrewcaires/express v1.0.
|
|
2
|
+
* @andrewcaires/express v1.0.1
|
|
3
3
|
* Decorators for express
|
|
4
4
|
* (c) 2023 Andrew Caires
|
|
5
5
|
* @license: MIT
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, TypeCallbackFunction } from '@andrewcaires/utils.js';
|
|
8
8
|
import { Response as Response$1, Request as Request$1, NextFunction, Express, Router } from 'express';
|
|
9
|
+
import * as http from 'http';
|
|
10
|
+
import * as https from 'https';
|
|
9
11
|
|
|
10
12
|
type ResponseJson = Response$1<any, Record<string, any>>;
|
|
11
13
|
declare class Responses {
|
|
@@ -54,6 +56,7 @@ declare class Application extends EventEmitter {
|
|
|
54
56
|
private readonly _controlles;
|
|
55
57
|
get instance(): Express;
|
|
56
58
|
get router(): Router;
|
|
59
|
+
get server(): http.Server | https.Server | undefined;
|
|
57
60
|
constructor(controlles: Array<object>, options?: IOptions);
|
|
58
61
|
error(error: any, source?: string): void;
|
|
59
62
|
log(message: string, source?: string): void;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @andrewcaires/express v1.0.
|
|
2
|
+
* @andrewcaires/express v1.0.1
|
|
3
3
|
* Decorators for express
|
|
4
4
|
* (c) 2023 Andrew Caires
|
|
5
5
|
* @license: MIT
|
|
6
6
|
*/
|
|
7
|
-
import"reflect-metadata";import{EventEmitter as t,isFunction as e,isUndefined as s}from"@andrewcaires/utils.js";import r from"cors";import o,{Router as n,json as i,urlencoded as a}from"express";import{existsSync as h}from"fs";import*as p from"http";import*as u from"https";import{Server as c}from"net";import{resolve as d}from"path";function l(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}h((r=r.apply(t,e||[])).next())}))}var _;!function(t){t.MIDDLEWARE="@express_middleware",t.PATH="@express_path",t.ROUTERS="@express_routers",t.PARAMETERS="@express_parameters"}(_||(_={}));const m=(t,e,s)=>Reflect.hasMetadata(t,e)?Reflect.getMetadata(t,e):s,f=100,E=101,g=102,v=200,x=201,R=202,T=203,A=204,S=205,y=206,P=207,k=208,M=226,w=300,O=301,b=302,j=303,D=304,q=305,H=307,I=308,L=400,U=401,F=402,N=403,W=404,z=405,C=406,G=407,B=408,J=409,K=410,Q=411,V=412,X=413,Y=414,Z=415,$=416,tt=417,et=418,st=421,rt=422,ot=423,nt=424,it=426,at=428,ht=429,pt=431,ut=444,ct=451,dt=499,lt=500,_t=501,mt=502,ft=503,Et=504,gt=505,vt=506,xt=507,Rt=508,Tt=510,At=511,St=599;class yt{constructor(t){this.res=t}success(t){return yt.success(this.res,t)}static success(t,e){return t.status(v).json({message:e})}data(t){return yt.data(this.res,t)}static data(t,e){return t.status(v).json(Object.assign({},e))}error(t){return yt.error(this.res,t)}static error(t,e){return t.status(500).json({message:e})}list(t){return yt.list(this.res,t)}static list(t,e){return t.status(v).json([...e])}notfound(t){return yt.notfound(this.res,t)}static notfound(t,e){return t.status(404).json({message:e})}validation(t){return yt.validation(this.res,t)}static validation(t,e){return t.status(400).json({message:e})}unauthorized(t){return yt.unauthorized(this.res,t)}static unauthorized(t,e){return t.status(401).json({message:e})}}class Pt extends t{get instance(){return this._app}get router(){return this._router}constructor(t,s){var p;super(),this._app=o(),this._options={},this._default={cross:!1,hybrid:!1,path:"/",port:3e3},this._router=n(),this._controlles=n(),this._options=Object.assign(Object.assign({},this._default),s),this._app.use(i()),this._app.disable("x-powered-by"),this._app.use(a({extended:!0})),this._options.cross&&this._app.use(r()),this._app.use(this._router);const u=(null===(p=this._options.path)||void 0===p?void 0:p.length)?this._options.path:"/";if(this._app.use(u,this._controlles),this._app.all(u+"/*",((t,e)=>yt.notfound(e,"Invalid API"))),this._options.public){const t=d(this._options.public);h(t)&&this._app.use(o.static(t)),this._app.get("*",((e,s)=>{if(!h(t))return yt.notfound(s,'File "index.html" not found');s.sendFile(t+"/index.html")}))}t.forEach((t=>{const s=t.constructor,r=this._path(s),o=this._routers(s),i=this._middlewares(s),a=this._parameters(s),h=n();o.forEach((r=>{const o=r.name.toString();if(e(t[o])){if(!e(h[r.method]))return this.error(new Error('Method "'+r.method+'" Not Found.'),"Express");const s=this._handles(t,o,i,a),n=this._indexes(o,a);h[r.method](r.path,...s,((e,s,r)=>t[o](...this._args(e,s,r,n))))}else this.error(new Error('Router "'+s.name+"."+o+'" Not Found.'),"Express")})),this._controlles.use(r,h)}))}error(t,e){s(e)?console.error(t):console.error(e+":",t)}log(t,e){s(e)?console.error(t):console.error(e+":",t)}_args(t,e,s,r,o){const n=[],i={req:t,res:e,next:s,app:this,send:new yt(e),argument:o};return r.forEach((t=>{n[t.index]=t.callback(Object.assign(Object.assign({},i),{key:t.key}))})),n}_handles(t,s,r,o){return r.filter((t=>t.name==s)).map((s=>{if(e(t[s.method])){const e=this._indexes(s.method,o);return(r,o,n)=>t[s.method](...this._args(r,o,n,e,s.argument))}this.error(new Error('Middleware "'+s.method+'" Not Found.'),"Express")})).filter(e)}_indexes(t,e){const s=[];return e.forEach((e=>e.name==t&&s.push(e))),s}_middlewares(t){return[...m(_.MIDDLEWARE,t,[])].reverse()}_parameters(t){return m(_.PARAMETERS,t,[])}_path(t){return m(_.PATH,t,"/")}_routers(t){return m(_.ROUTERS,t,[])}listen(){return l(this,void 0,void 0,(function*(){if(this._options.cert&&this._options.key||(this._server=p.createServer(this._app),this._server.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express")))),!this._server){const t=p.createServer(((t,e)=>{const s=80==this._options.port?":80":"";e.writeHead(301,{Location:"https://"+t.headers.host+s+t.url}),e.end()})),e=u.createServer({key:this._options.key,cert:this._options.cert},this._app);if(this._options.hybrid){new c((s=>{s.once("data",(r=>{s.pause(),s.unshift(r),(22===r[0]?e:t).emit("connection",s),process.nextTick((()=>s.resume()))}))})).listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=e}this._server||(443==this._options.port&&t.listen(80,(()=>this.log("Server started on port 80","Express"))),e.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=e)}}))}}const kt=t=>e=>Reflect.defineMetadata(_.PATH,(null==t?void 0:t.length)?t:"/",e);var Mt;!function(t){t.GET="get",t.POST="post",t.PUT="put",t.HEAD="head",t.DELETE="delete",t.OPTIONS="options",t.PATCH="patch"}(Mt||(Mt={}));const wt=t=>e=>(s,r)=>{const o=s.constructor,n=m(_.ROUTERS,o,[]);n.push({path:(null==e?void 0:e.length)?e:"/",method:t,name:r}),Reflect.defineMetadata(_.ROUTERS,n,o)},Ot=wt(Mt.GET),bt=wt(Mt.POST),jt=wt(Mt.PUT),Dt=wt(Mt.HEAD),qt=wt(Mt.DELETE),Ht=wt(Mt.OPTIONS),It=wt(Mt.PATCH),Lt=(t,e)=>(s,r)=>{const o=s.constructor,n=m(_.MIDDLEWARE,o,[]);n.push({name:r,method:t,argument:e}),Reflect.defineMetadata(_.MIDDLEWARE,n,o)},Ut=t=>e=>(s,r,o)=>{const n=s.constructor,i=m(_.PARAMETERS,n,[]);i.push({callback:t,index:o,key:(null==e?void 0:e.length)?e:"",name:r}),Reflect.defineMetadata(_.PARAMETERS,i,n)},Ft=(t,e)=>s(e)?t:t[e],Nt=Ut((({app:t})=>t)),Wt=Ut((({argument:t})=>t)),zt=Ut((({req:t,key:e})=>Ft(t.body,e))),Ct=Ut((({req:t,key:e})=>Ft(t.cookies,e))),Gt=Ut((({req:t,key:e})=>Ft(t.cookies,e))),Bt=Ut((({next:t})=>t)),Jt=Ut((({req:t,key:e})=>Ft(t.params,e))),Kt=Ut((({req:t,key:e})=>Ft(t.query,e))),Qt=Ut((({req:t})=>t)),Vt=Qt,Xt=Ut((({res:t})=>t)),Yt=Xt,Zt=Ut((({send:t})=>t));export{R as ACCEPTED,k as ALREADY_REPORTED,Nt as App,Pt as Application,Wt as Argument,mt as BAD_GATEWAY,L as BAD_REQUEST,zt as Body,dt as CLIENT_CLOSED_REQUEST,J as CONFLICT,ut as CONNECTION_CLOSED_WITHOUT_RESPONSE,f as CONTINUE,x as CREATED,kt as Controller,Ct as Cookies,qt as Delete,tt as EXPECTATION_FAILED,nt as FAILED_DEPENDENCY,N as FORBIDDEN,b as FOUND,Et as GATEWAY_TIMEOUT,K as GONE,Ot as Get,gt as HTTP_VERSION_NOT_SUPPORTED,Dt as Head,Gt as Headers,et as IM_A_TEAPOT,M as IM_USED,xt as INSUFFICIENT_STORAGE,lt as INTERNAL_SERVER_ERROR,Q as LENGTH_REQUIRED,ot as LOCKED,Rt as LOOP_DETECTED,z as METHOD_NOT_ALLOWED,st as MISDIRECTED_REQUEST,O as MOVED_PERMANENTLY,w as MULTIPLE_CHOICES,P as MULTI_STATUS,m as Metadata,_ as MetadataKeys,Mt as Methods,Lt as Middleware,At as NETWORK_AUTHENTICATION_REQUIRED,St as NETWORK_CONNECTION_TIMEOUT_ERROR,T as NON_AUTHORITATIVE_INFORMATION,C as NOT_ACCEPTABLE,Tt as NOT_EXTENDED,W as NOT_FOUND,_t as NOT_IMPLEMENTED,D as NOT_MODIFIED,A as NO_CONTENT,Bt as Next,v as OK,Ht as Options,y as PARTIAL_CONTENT,X as PAYLOAD_TOO_LARGE,F as PAYMENT_REQUIRED,I as PERMANENT_REDIRECT,V as PRECONDITION_FAILED,at as PRECONDITION_REQUIRED,g as PROCESSING,G as PROXY_AUTHENTICATION_REQUIRED,Jt as Params,It as Patch,bt as Post,jt as Put,Kt as Query,$ as REQUESTED_RANGE_NOT_SATISFIABLE,pt as REQUEST_HEADER_FIELDS_TOO_LARGE,B as REQUEST_TIMEOUT,Y as REQUEST_URI_TOO_LONG,S as RESET_CONTENT,Vt as Req,Qt as Request,Yt as Res,Xt as Response,yt as Responses,j as SEE_OTHER,ft as SERVICE_UNAVAILABLE,E as SWITCHING_PROTOCOLS,Zt as Send,H as TEMPORARY_REDIRECT,ht as TOO_MANY_REQUESTS,U as UNAUTHORIZED,ct as UNAVAILABLE_FOR_LEGAL_REASONS,rt as UNPROCESSABLE_ENTITY,Z as UNSUPPORTED_MEDIA_TYPE,it as UPGRADE_REQUIRED,q as USE_PROXY,vt as VARIANT_ALSO_NEGOCIATES,wt as methodFactory,Ut as parameterFactory};
|
|
7
|
+
import"reflect-metadata";import{EventEmitter as t,isFunction as e,isUndefined as s}from"@andrewcaires/utils.js";import r from"cors";import o,{Router as n,json as i,urlencoded as a}from"express";import{existsSync as h}from"fs";import*as p from"http";import*as u from"https";import{Server as c}from"net";import{resolve as d}from"path";function l(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}h((r=r.apply(t,e||[])).next())}))}var _;!function(t){t.MIDDLEWARE="@express_middleware",t.PATH="@express_path",t.ROUTERS="@express_routers",t.PARAMETERS="@express_parameters"}(_||(_={}));const m=(t,e,s)=>Reflect.hasMetadata(t,e)?Reflect.getMetadata(t,e):s,f=100,E=101,g=102,v=200,x=201,R=202,T=203,A=204,S=205,y=206,P=207,k=208,M=226,w=300,O=301,b=302,j=303,D=304,q=305,H=307,I=308,L=400,U=401,F=402,N=403,W=404,z=405,C=406,G=407,B=408,J=409,K=410,Q=411,V=412,X=413,Y=414,Z=415,$=416,tt=417,et=418,st=421,rt=422,ot=423,nt=424,it=426,at=428,ht=429,pt=431,ut=444,ct=451,dt=499,lt=500,_t=501,mt=502,ft=503,Et=504,gt=505,vt=506,xt=507,Rt=508,Tt=510,At=511,St=599;class yt{constructor(t){this.res=t}success(t){return yt.success(this.res,t)}static success(t,e){return t.status(v).json({message:e})}data(t){return yt.data(this.res,t)}static data(t,e){return t.status(v).json(Object.assign({},e))}error(t){return yt.error(this.res,t)}static error(t,e){return t.status(500).json({message:e})}list(t){return yt.list(this.res,t)}static list(t,e){return t.status(v).json([...e])}notfound(t){return yt.notfound(this.res,t)}static notfound(t,e){return t.status(404).json({message:e})}validation(t){return yt.validation(this.res,t)}static validation(t,e){return t.status(400).json({message:e})}unauthorized(t){return yt.unauthorized(this.res,t)}static unauthorized(t,e){return t.status(401).json({message:e})}}class Pt extends t{get instance(){return this._app}get router(){return this._router}get server(){return this._server}constructor(t,s){var p;super(),this._app=o(),this._options={},this._default={cross:!1,hybrid:!1,path:"/",port:3e3},this._router=n(),this._controlles=n(),this._options=Object.assign(Object.assign({},this._default),s),this._app.use(i()),this._app.disable("x-powered-by"),this._app.use(a({extended:!0})),this._options.cross&&this._app.use(r()),this._app.use(this._router);const u=(null===(p=this._options.path)||void 0===p?void 0:p.length)?this._options.path:"/";if(this._app.use(u,this._controlles),this._app.all(u+"/*",((t,e)=>yt.notfound(e,"Invalid API"))),this._options.public){const t=d(this._options.public);h(t)&&this._app.use(o.static(t)),this._app.get("*",((e,s)=>{if(!h(t))return yt.notfound(s,'File "index.html" not found');s.sendFile(t+"/index.html")}))}t.forEach((t=>{const s=t.constructor,r=this._path(s),o=this._routers(s),i=this._middlewares(s),a=this._parameters(s),h=n();o.forEach((r=>{const o=r.name.toString();if(e(t[o])){if(!e(h[r.method]))return this.error(new Error('Method "'+r.method+'" Not Found.'),"Express");const s=this._handles(t,o,i,a),n=this._indexes(o,a);h[r.method](r.path,...s,((e,s,r)=>t[o](...this._args(e,s,r,n))))}else this.error(new Error('Router "'+s.name+"."+o+'" Not Found.'),"Express")})),this._controlles.use(r,h)}))}error(t,e){s(e)?console.error(t):console.error(e+":",t)}log(t,e){s(e)?console.error(t):console.error(e+":",t)}_args(t,e,s,r,o){const n=[],i={req:t,res:e,next:s,app:this,send:new yt(e),argument:o};return r.forEach((t=>{n[t.index]=t.callback(Object.assign(Object.assign({},i),{key:t.key}))})),n}_handles(t,s,r,o){return r.filter((t=>t.name==s)).map((s=>{if(e(t[s.method])){const e=this._indexes(s.method,o);return(r,o,n)=>t[s.method](...this._args(r,o,n,e,s.argument))}this.error(new Error('Middleware "'+s.method+'" Not Found.'),"Express")})).filter(e)}_indexes(t,e){const s=[];return e.forEach((e=>e.name==t&&s.push(e))),s}_middlewares(t){return[...m(_.MIDDLEWARE,t,[])].reverse()}_parameters(t){return m(_.PARAMETERS,t,[])}_path(t){return m(_.PATH,t,"/")}_routers(t){return m(_.ROUTERS,t,[])}listen(){return l(this,void 0,void 0,(function*(){if(this._options.cert&&this._options.key||(this._server=p.createServer(this._app),this._server.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express")))),!this._server){const t=p.createServer(((t,e)=>{const s=80==this._options.port?":80":"";e.writeHead(301,{Location:"https://"+t.headers.host+s+t.url}),e.end()})),e=u.createServer({key:this._options.key,cert:this._options.cert},this._app);if(this._options.hybrid){new c((s=>{s.once("data",(r=>{s.pause(),s.unshift(r),(22===r[0]?e:t).emit("connection",s),process.nextTick((()=>s.resume()))}))})).listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=e}this._server||(443==this._options.port&&t.listen(80,(()=>this.log("Server started on port 80","Express"))),e.listen(this._options.port,(()=>this.log("Server started on port "+this._options.port+".","Express"))),this._server=e)}}))}}const kt=t=>e=>Reflect.defineMetadata(_.PATH,(null==t?void 0:t.length)?t:"/",e);var Mt;!function(t){t.GET="get",t.POST="post",t.PUT="put",t.HEAD="head",t.DELETE="delete",t.OPTIONS="options",t.PATCH="patch"}(Mt||(Mt={}));const wt=t=>e=>(s,r)=>{const o=s.constructor,n=m(_.ROUTERS,o,[]);n.push({path:(null==e?void 0:e.length)?e:"/",method:t,name:r}),Reflect.defineMetadata(_.ROUTERS,n,o)},Ot=wt(Mt.GET),bt=wt(Mt.POST),jt=wt(Mt.PUT),Dt=wt(Mt.HEAD),qt=wt(Mt.DELETE),Ht=wt(Mt.OPTIONS),It=wt(Mt.PATCH),Lt=(t,e)=>(s,r)=>{const o=s.constructor,n=m(_.MIDDLEWARE,o,[]);n.push({name:r,method:t,argument:e}),Reflect.defineMetadata(_.MIDDLEWARE,n,o)},Ut=t=>e=>(s,r,o)=>{const n=s.constructor,i=m(_.PARAMETERS,n,[]);i.push({callback:t,index:o,key:(null==e?void 0:e.length)?e:"",name:r}),Reflect.defineMetadata(_.PARAMETERS,i,n)},Ft=(t,e)=>s(e)?t:t[e],Nt=Ut((({app:t})=>t)),Wt=Ut((({argument:t})=>t)),zt=Ut((({req:t,key:e})=>Ft(t.body,e))),Ct=Ut((({req:t,key:e})=>Ft(t.cookies,e))),Gt=Ut((({req:t,key:e})=>Ft(t.cookies,e))),Bt=Ut((({next:t})=>t)),Jt=Ut((({req:t,key:e})=>Ft(t.params,e))),Kt=Ut((({req:t,key:e})=>Ft(t.query,e))),Qt=Ut((({req:t})=>t)),Vt=Qt,Xt=Ut((({res:t})=>t)),Yt=Xt,Zt=Ut((({send:t})=>t));export{R as ACCEPTED,k as ALREADY_REPORTED,Nt as App,Pt as Application,Wt as Argument,mt as BAD_GATEWAY,L as BAD_REQUEST,zt as Body,dt as CLIENT_CLOSED_REQUEST,J as CONFLICT,ut as CONNECTION_CLOSED_WITHOUT_RESPONSE,f as CONTINUE,x as CREATED,kt as Controller,Ct as Cookies,qt as Delete,tt as EXPECTATION_FAILED,nt as FAILED_DEPENDENCY,N as FORBIDDEN,b as FOUND,Et as GATEWAY_TIMEOUT,K as GONE,Ot as Get,gt as HTTP_VERSION_NOT_SUPPORTED,Dt as Head,Gt as Headers,et as IM_A_TEAPOT,M as IM_USED,xt as INSUFFICIENT_STORAGE,lt as INTERNAL_SERVER_ERROR,Q as LENGTH_REQUIRED,ot as LOCKED,Rt as LOOP_DETECTED,z as METHOD_NOT_ALLOWED,st as MISDIRECTED_REQUEST,O as MOVED_PERMANENTLY,w as MULTIPLE_CHOICES,P as MULTI_STATUS,m as Metadata,_ as MetadataKeys,Mt as Methods,Lt as Middleware,At as NETWORK_AUTHENTICATION_REQUIRED,St as NETWORK_CONNECTION_TIMEOUT_ERROR,T as NON_AUTHORITATIVE_INFORMATION,C as NOT_ACCEPTABLE,Tt as NOT_EXTENDED,W as NOT_FOUND,_t as NOT_IMPLEMENTED,D as NOT_MODIFIED,A as NO_CONTENT,Bt as Next,v as OK,Ht as Options,y as PARTIAL_CONTENT,X as PAYLOAD_TOO_LARGE,F as PAYMENT_REQUIRED,I as PERMANENT_REDIRECT,V as PRECONDITION_FAILED,at as PRECONDITION_REQUIRED,g as PROCESSING,G as PROXY_AUTHENTICATION_REQUIRED,Jt as Params,It as Patch,bt as Post,jt as Put,Kt as Query,$ as REQUESTED_RANGE_NOT_SATISFIABLE,pt as REQUEST_HEADER_FIELDS_TOO_LARGE,B as REQUEST_TIMEOUT,Y as REQUEST_URI_TOO_LONG,S as RESET_CONTENT,Vt as Req,Qt as Request,Yt as Res,Xt as Response,yt as Responses,j as SEE_OTHER,ft as SERVICE_UNAVAILABLE,E as SWITCHING_PROTOCOLS,Zt as Send,H as TEMPORARY_REDIRECT,ht as TOO_MANY_REQUESTS,U as UNAUTHORIZED,ct as UNAVAILABLE_FOR_LEGAL_REASONS,rt as UNPROCESSABLE_ENTITY,Z as UNSUPPORTED_MEDIA_TYPE,it as UPGRADE_REQUIRED,q as USE_PROXY,vt as VARIANT_ALSO_NEGOCIATES,wt as methodFactory,Ut as parameterFactory};
|