@ez4/gateway 0.25.0 → 0.27.0
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/dist/library.cjs +32 -32
- package/dist/library.d.ts +31 -31
- package/dist/library.mjs +36 -36
- package/dist/main.cjs +15 -15
- package/dist/main.d.ts +2 -2
- package/dist/main.mjs +11 -11
- package/dist/metadata/authorizer.d.ts +1 -1
- package/dist/metadata/body.d.ts +1 -1
- package/dist/metadata/cache.d.ts +1 -1
- package/dist/metadata/cors.d.ts +1 -1
- package/dist/metadata/defaults.d.ts +1 -1
- package/dist/metadata/errors.d.ts +1 -1
- package/dist/metadata/handler.d.ts +1 -1
- package/dist/metadata/preferences.d.ts +1 -1
- package/dist/metadata/request.d.ts +1 -1
- package/dist/metadata/response.d.ts +1 -1
- package/dist/metadata/route.d.ts +1 -1
- package/dist/metadata/schema.d.ts +1 -1
- package/dist/metadata/service.d.ts +1 -1
- package/dist/metadata/utils.d.ts +1 -1
- package/dist/services/common.d.ts +1 -1
- package/dist/services/contract.d.ts +3 -3
- package/dist/services/errors.d.ts +3 -4
- package/dist/services/utils.d.ts +1 -1
- package/dist/types/service.d.ts +1 -1
- package/dist/utils/body.d.ts +1 -1
- package/dist/utils.cjs +5 -5
- package/dist/utils.d.ts +6 -6
- package/dist/utils.mjs +4 -4
- package/package.json +14 -15
- package/dist/services/types.d.ts +0 -9
package/dist/library.cjs
CHANGED
|
@@ -12,10 +12,10 @@ InvalidPreferencesTypeError:()=>V,InvalidQueryTypeError:()=>ce,InvalidRequestTyp
|
|
|
12
12
|
InvalidResponseTypeError:()=>W,InvalidRouteErrorTypeError:()=>P,ServiceType:()=>Me,
|
|
13
13
|
getHttpAuthRequest:()=>Ge,getHttpAuthResponse:()=>Ne,getHttpAuthorizer:()=>We,getHttpBody:()=>oe,
|
|
14
14
|
getHttpCache:()=>Le,getHttpCors:()=>_e,getHttpHandler:()=>Xe,getHttpHandlerRequest:()=>Ke,
|
|
15
|
-
getHttpHandlerResponse:()=>Ve,getHttpHeaders:()=>ee,getHttpIdentity:()=>
|
|
15
|
+
getHttpHandlerResponse:()=>Ve,getHttpHeaders:()=>ee,getHttpIdentity:()=>O,getHttpParameters:()=>Qe,
|
|
16
16
|
getHttpQuery:()=>Je,getHttpRoutes:()=>Ze,getHttpServices:()=>er,isHttpService:()=>Lr,
|
|
17
17
|
registerTriggers:()=>dt});module.exports=$r(Tt);var Jr=require("@ez4/common/library"),Gr=require("@ez4/schema/library"),Kr=require("@ez4/project/library");var g=require("@ez4/common/library"),Vr=require("@ez4/reflection");var Me="@ez4/http",Lr=p(e=>e.type===Me,"isHttpService");var rr=require("@ez4/common/library");var N=class extends rr.IncompleteTypeError{static{p(this,"IncompleteServiceError")}constructor(r,t){
|
|
18
|
-
super("Incomplete service",r,t)}};var d=require("@ez4/common/library"),
|
|
18
|
+
super("Incomplete service",r,t)}};var d=require("@ez4/common/library"),w=require("@ez4/reflection");var M=require("@ez4/common/library"),R=require("@ez4/reflection");var a=require("@ez4/common/library"),v=require("@ez4/reflection");var et=new Set(["ANY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),tr=p(e=>{let[
|
|
19
19
|
r]=e.split(" ",2);return et.has(r)},"isHttpPath"),or=p(e=>(0,a.isClassDeclaration)(
|
|
20
20
|
e)&&(0,a.hasHeritageType)(e,"Http.Service"),"isHttpService"),nr=p(e=>(0,a.isModelDeclaration)(
|
|
21
21
|
e)&&(0,a.hasHeritageType)(e,"Http.Route"),"isHttpRoute");var pr=p(e=>(0,a.hasHeritageType)(e,"Http.Defaults"),"isHttpDefaults"),sr=p(e=>(0,a.hasHeritageType)(
|
|
@@ -43,11 +43,11 @@ i.name,e.file));let l=tt(i,c,r,o,n);l&&Object.assign(s,l)}return(0,be.isEmptyObj
|
|
|
43
43
|
s)?null:s},"getTypeFromMembers"),tt=p((e,r,t,o,n)=>{let s=(0,S.getPropertyTuple)(
|
|
44
44
|
e)??[],i={};for(let c of s){if(!(0,x.isTypeReference)(c)){n.push(new P(t.file));
|
|
45
45
|
continue}let l=(0,S.getReferenceType)(c,o);if(!l||!(0,x.isTypeClass)(l)){n.push(
|
|
46
|
-
new P(t.file));continue}i[l.name]=r}return i},"getErrorClasses");var hr=p((e,r,t,o)=>{if(!(0,
|
|
47
|
-
e,t);return n?Hr(n,r,t,o):null},"getHttpDefaults"),Hr=p((e,r,t,o)=>(0,
|
|
46
|
+
new P(t.file));continue}i[l.name]=r}return i},"getErrorClasses");var hr=p((e,r,t,o)=>{if(!(0,w.isTypeReference)(e))return Hr(e,r,t,o);let n=(0,d.getReferenceType)(
|
|
47
|
+
e,t);return n?Hr(n,r,t,o):null},"getHttpDefaults"),Hr=p((e,r,t,o)=>(0,w.isTypeObject)(
|
|
48
48
|
e)?br(r,(0,d.getObjectMembers)(e),t,o):(0,d.isModelDeclaration)(e)?pr(e)?br(r,(0,d.getModelMembers)(
|
|
49
49
|
e),t,o):(o.push(new G(e.name,r.file)),null):(o.push(new J(r.file)),null),"getTyp\
|
|
50
|
-
eDefaults"),br=p((e,r,t,o)=>{let n={};for(let s of r)if(!(!(0,
|
|
50
|
+
eDefaults"),br=p((e,r,t,o)=>{let n={};for(let s of r)if(!(!(0,w.isModelProperty)(
|
|
51
51
|
s)||s.inherited))switch(s.name){default:o.push(new d.InvalidServicePropertyError(
|
|
52
52
|
e.name,s.name,e.file));break;case"httpErrors":n.httpErrors=he(s.value,e,t,o);break;case"\
|
|
53
53
|
preferences":n.preferences=He(s.value,e,t,o);break;case"memory":case"logRetentio\
|
|
@@ -63,34 +63,34 @@ ponseTypeError")}};var h=require("@ez4/reflection"),ve=require("@ez4/common/libr
|
|
|
63
63
|
super("Invalid identity",void 0,"Http.Identity",r)}},_=class extends Ie.IncorrectTypeError{constructor(t,o){
|
|
64
64
|
super("Incorrect identity",t,"Http.Identity",o);this.identityType=t}static{p(this,
|
|
65
65
|
"IncorrectIdentityTypeError")}};var Ee=require("@ez4/schema/library");var f=p((e,r)=>{let t=(0,Ee.getObjectSchema)(e,r);return t&&(0,Ee.isObjectSchema)(
|
|
66
|
-
t)?t:null},"getSchemaFromType");var
|
|
66
|
+
t)?t:null},"getSchemaFromType");var O=p((e,r,t,o)=>{if((0,h.isTypeUndefined)(e))return null;if(!(0,h.isTypeReference)(
|
|
67
67
|
e))return xr(e,r,t,o);let n=(0,ve.getReferenceType)(e,t);return n?xr(n,r,t,o):null},
|
|
68
68
|
"getHttpIdentity"),xr=p((e,r,t,o)=>{if((0,h.isTypeUnion)(e))return ot(e.elements,
|
|
69
69
|
r,t,o);if((0,h.isTypeObject)(e)||(0,h.isTypeIntersection)(e))return f(e,t);if(!(0,ve.isModelDeclaration)(
|
|
70
70
|
e))return o.push(new Z(r.file)),null;if(!cr(e))return o.push(new _(e.name,r.file)),
|
|
71
71
|
null;let n=f(e,t);return n&&(n.definitions={...n.definitions,extensible:!0}),n},
|
|
72
|
-
"getTypeIdentity"),ot=p((e,r,t,o)=>{let n=[];for(let s of e){let i=
|
|
72
|
+
"getTypeIdentity"),ot=p((e,r,t,o)=>{let n=[];for(let s of e){let i=O(s,r,t,o);i&&
|
|
73
73
|
n.push(i)}return n.length>1?(0,Ir.createUnionSchema)({elements:n}):n[0]},"getIde\
|
|
74
|
-
ntityFromUnion");var
|
|
74
|
+
ntityFromUnion");var z=require("@ez4/reflection"),Re=require("@ez4/common/library");var Ae=require("@ez4/common/library");var $=class extends Ae.InvalidTypeError{static{p(this,"InvalidHeadersTypeError")}constructor(r){
|
|
75
75
|
super("Invalid headers",void 0,"Http.Headers",r)}},L=class extends Ae.IncorrectTypeError{constructor(t,o){
|
|
76
76
|
super("Incorrect headers",t,"Http.Headers",o);this.headersType=t}static{p(this,"\
|
|
77
|
-
IncorrectHeadersTypeError")}};var ee=p((e,r,t,o)=>{if(!(0,
|
|
78
|
-
e,t);return n?Er(n,r,t,o):null},"getHttpHeaders"),Er=p((e,r,t,o)=>(0,
|
|
79
|
-
e)||(0,
|
|
80
|
-
(o.push(new L(e.name,r.file)),null):(o.push(new $(r.file)),null),"getTypeHeaders");var
|
|
77
|
+
IncorrectHeadersTypeError")}};var ee=p((e,r,t,o)=>{if(!(0,z.isTypeReference)(e))return Er(e,r,t,o);let n=(0,Re.getReferenceType)(
|
|
78
|
+
e,t);return n?Er(n,r,t,o):null},"getHttpHeaders"),Er=p((e,r,t,o)=>(0,z.isTypeObject)(
|
|
79
|
+
e)||(0,z.isTypeIntersection)(e)?f(e,t):(0,Re.isModelDeclaration)(e)?ir(e)?f(e,t):
|
|
80
|
+
(o.push(new L(e.name,r.file)),null):(o.push(new $(r.file)),null),"getTypeHeaders");var j=require("@ez4/schema/library"),we=require("@ez4/common/library"),y=require("@ez4/reflection");var Pe=require("@ez4/common/library");var re=class extends Pe.InvalidTypeError{static{p(this,"InvalidBodyTypeError")}constructor(r){
|
|
81
81
|
super("Invalid body",void 0,"Http.JsonBody",r)}},te=class extends Pe.IncorrectTypeError{constructor(t,o){
|
|
82
82
|
super("Incorrect body",t,"Http.JsonBody",o);this.bodyType=t}static{p(this,"Incor\
|
|
83
83
|
rectBodyTypeError")}};var oe=p((e,r,t,o)=>Ue(e,t,n=>Fe(n)??Be(n,r,t,o)),"getHttpBody"),Ue=p((e,r,t)=>{
|
|
84
84
|
if((0,y.isTypeUndefined)(e))return null;if(!(0,y.isTypeReference)(e))return t(e);
|
|
85
|
-
let o=(0,
|
|
86
|
-
e)?(0,
|
|
85
|
+
let o=(0,we.getReferenceType)(e,r);return o?t(o):null},"getTypeBody"),Fe=p(e=>(0,y.isTypeScalar)(
|
|
86
|
+
e)?(0,j.getScalarSchema)(e):null,"getScalarTypeBody"),Be=p((e,r,t,o)=>(0,y.isTypeUnion)(
|
|
87
87
|
e)?nt(e.elements,t,n=>Fe(n)??Be(n,r,t,o)):(0,y.isTypeArray)(e)?pt(e.element,t,n=>Fe(
|
|
88
|
-
n)??Be(n,r,t,o)):(0,y.isTypeObject)(e)||(0,y.isTypeIntersection)(e)?f(e,t):(0,
|
|
88
|
+
n)??Be(n,r,t,o)):(0,y.isTypeObject)(e)||(0,y.isTypeIntersection)(e)?f(e,t):(0,we.isModelDeclaration)(
|
|
89
89
|
e)?ar(e)?f(e,t):(o.push(new te(e.name,e.file)),null):(o.push(new re(r.file)),null),
|
|
90
90
|
"getCompoundTypeBody"),nt=p((e,r,t)=>{let o={optional:!1,elements:[]};for(let n of e){
|
|
91
91
|
if((0,y.isTypeUndefined)(n)){o.optional=!0;continue}let s=Ue(n,r,t);s&&o.elements.
|
|
92
|
-
push(s)}return o.elements.length?(0,
|
|
93
|
-
ody"),pt=p((e,r,t)=>{let o=Ue(e,r,t);return o?(0,
|
|
92
|
+
push(s)}return o.elements.length?(0,j.createUnionSchema)(o):null},"getUnionTypeB\
|
|
93
|
+
ody"),pt=p((e,r,t)=>{let o=Ue(e,r,t);return o?(0,j.createArraySchema)({element:o}):
|
|
94
94
|
null},"getArrayTypeBody");var Ne=p((e,r,t,o)=>{let n=Pr(e,r,t,o,"Http.AuthResponse");return n&&st(n)?n:null},
|
|
95
95
|
"getHttpAuthResponse"),Ve=p((e,r,t,o)=>{let n=Pr(e,r,t,o,"Http.Response");return n&&
|
|
96
96
|
it(n)?n:null},"getHttpHandlerResponse"),Pr=p((e,r,t,o,n)=>{if(!(0,C.isTypeReference)(
|
|
@@ -103,38 +103,38 @@ e,n)?Ar(e,r,(0,T.getModelMembers)(e),t,o):(o.push(new X(e.name,n,e.file)),null):
|
|
|
103
103
|
if(!(!(0,C.isModelProperty)(i)||i.inherited))switch(i.name){default:n.push(new T.InvalidServicePropertyError(
|
|
104
104
|
r.name,i.name,e.file));break;case"status":s.status=(0,T.getPropertyNumber)(i);break;case"\
|
|
105
105
|
headers":{s.headers=ee(i.value,e,o,n),s.headers&&i.description&&(s.headers.description=
|
|
106
|
-
i.description);break}case"identity":{s.identity=
|
|
106
|
+
i.description);break}case"identity":{s.identity=O(i.value,e,o,n),s.identity&&i.description&&
|
|
107
107
|
(s.identity.description=i.description);break}case"body":{s.body=oe(i.value,e,o,n),
|
|
108
108
|
s.body&&i.description&&(s.body.description=i.description);break}}return s},"getT\
|
|
109
|
-
ypeFromMembers");var I=require("@ez4/reflection"),H=require("@ez4/common/library");var
|
|
110
|
-
equest",void 0,t,o);this.baseType=t}static{p(this,"InvalidRequestTypeError")}},pe=class extends
|
|
109
|
+
ypeFromMembers");var I=require("@ez4/reflection"),H=require("@ez4/common/library");var Oe=require("@ez4/common/library");var ne=class extends Oe.InvalidTypeError{constructor(t,o){super("Invalid route r\
|
|
110
|
+
equest",void 0,t,o);this.baseType=t}static{p(this,"InvalidRequestTypeError")}},pe=class extends Oe.IncorrectTypeError{constructor(t,o,n){
|
|
111
111
|
super("Incorrect route request",t,o,n);this.requestType=t;this.baseType=o}static{
|
|
112
|
-
p(this,"IncorrectRequestTypeError")}};var k=require("@ez4/reflection"),
|
|
112
|
+
p(this,"IncorrectRequestTypeError")}};var k=require("@ez4/reflection"),je=require("@ez4/common/library");var ze=require("@ez4/common/library");var se=class extends ze.InvalidTypeError{static{p(this,"InvalidParameterTypeErro\
|
|
113
113
|
r")}constructor(r){super("Invalid request parameters",void 0,"Http.PathParameter\
|
|
114
|
-
s",r)}},ie=class extends
|
|
114
|
+
s",r)}},ie=class extends ze.IncorrectTypeError{constructor(t,o){super("Incorrect\
|
|
115
115
|
request parameters",t,"Http.PathParameters",o);this.parametersType=t}static{p(this,
|
|
116
|
-
"IncorrectParameterTypeError")}};var Qe=p((e,r,t,o)=>{if(!(0,k.isTypeReference)(e))return
|
|
117
|
-
e,t);return n?
|
|
118
|
-
e)||(0,k.isTypeIntersection)(e)?f(e,t):(0,
|
|
116
|
+
"IncorrectParameterTypeError")}};var Qe=p((e,r,t,o)=>{if(!(0,k.isTypeReference)(e))return wr(e,r,t,o);let n=(0,je.getReferenceType)(
|
|
117
|
+
e,t);return n?wr(n,r,t,o):null},"getHttpParameters"),wr=p((e,r,t,o)=>(0,k.isTypeObject)(
|
|
118
|
+
e)||(0,k.isTypeIntersection)(e)?f(e,t):(0,je.isModelDeclaration)(e)?mr(e)?f(e,t):
|
|
119
119
|
(o.push(new ie(e.name,e.file)),null):(o.push(new se(r.file)),null),"getTypeParam\
|
|
120
120
|
eter");var q=require("@ez4/reflection"),ke=require("@ez4/common/library");var Ce=require("@ez4/common/library");var ce=class extends Ce.InvalidTypeError{static{p(this,"InvalidQueryTypeError")}constructor(r){
|
|
121
121
|
super("Invalid request query strings",void 0,"Http.QueryStrings",r)}},le=class extends Ce.IncorrectTypeError{constructor(t,o){
|
|
122
122
|
super("Incorrect request query strings",t,"Http.QueryStrings",o);this.queryType=
|
|
123
|
-
t}static{p(this,"IncorrectQueryTypeError")}};var Je=p((e,r,t,o)=>{if(!(0,q.isTypeReference)(e))return
|
|
124
|
-
e,t);return n?
|
|
123
|
+
t}static{p(this,"IncorrectQueryTypeError")}};var Je=p((e,r,t,o)=>{if(!(0,q.isTypeReference)(e))return Or(e,r,t,o);let n=(0,ke.getReferenceType)(
|
|
124
|
+
e,t);return n?Or(n,r,t,o):null},"getHttpQuery"),Or=p((e,r,t,o)=>(0,q.isTypeObject)(
|
|
125
125
|
e)||(0,q.isTypeIntersection)(e)?f(e,t):(0,ke.isModelDeclaration)(e)?lr(e)?f(e,t):
|
|
126
126
|
(o.push(new le(e.name,r.file)),null):(o.push(new ce(r.file)),null),"getTypeQuery");var Ge=p((e,r,t,o)=>Ye(e,r,t,o,"Http.AuthRequest"),"getHttpAuthRequest"),Ke=p((e,r,t,o)=>Ye(
|
|
127
127
|
e,r,t,o,"Http.Request"),"getHttpHandlerRequest"),Ye=p((e,r,t,o,n)=>{if((0,I.isTypeIntersection)(
|
|
128
128
|
e)&&e.elements.length>0)return Ye(e.elements[0],r,t,o,n);if(!(0,I.isTypeReference)(
|
|
129
|
-
e))return
|
|
130
|
-
null},"getHttpRequest"),
|
|
131
|
-
e),t,o):(0,H.isModelDeclaration)(e)?(0,H.hasHeritageType)(e,n)?
|
|
129
|
+
e))return zr(e,r,t,o,n);let s=(0,H.getReferenceType)(e,t);return s?zr(s,r,t,o,n):
|
|
130
|
+
null},"getHttpRequest"),zr=p((e,r,t,o,n)=>(0,I.isTypeObject)(e)?jr(e,r,(0,H.getObjectMembers)(
|
|
131
|
+
e),t,o):(0,H.isModelDeclaration)(e)?(0,H.hasHeritageType)(e,n)?jr(e,r,(0,H.getModelMembers)(
|
|
132
132
|
e),t,o):(o.push(new pe(e.name,n,e.file)),null):(o.push(new ne(n,r.file)),null),"\
|
|
133
|
-
getTypeRequest"),
|
|
133
|
+
getTypeRequest"),jr=p((e,r,t,o,n)=>{let s={};for(let i of t)if(!(!(0,I.isModelProperty)(
|
|
134
134
|
i)||i.inherited))switch(i.name){default:n.push(new H.InvalidServicePropertyError(
|
|
135
135
|
r.name,i.name,e.file));break;case"headers":{s.headers=ee(i.value,e,o,n),s.headers&&
|
|
136
136
|
i.description&&(s.headers.description=i.description);break}case"identity":{s.identity=
|
|
137
|
-
|
|
137
|
+
O(i.value,e,o,n),s.identity&&i.description&&(s.identity.description=i.description);
|
|
138
138
|
break}case"query":{s.query=Je(i.value,e,o,n),s.query&&i.description&&(s.query.description=
|
|
139
139
|
i.description);break}case"parameters":{s.parameters=Qe(i.value,e,o,n),s.parameters&&
|
|
140
140
|
i.description&&(s.parameters.description=i.description);break}case"body":{s.body=
|
package/dist/library.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export * from './triggers/register
|
|
2
|
-
export * from './metadata/service
|
|
3
|
-
export * from './metadata/route
|
|
4
|
-
export * from './metadata/handler
|
|
5
|
-
export * from './metadata/identity
|
|
6
|
-
export * from './metadata/authorizer
|
|
7
|
-
export * from './metadata/request
|
|
8
|
-
export * from './metadata/response
|
|
9
|
-
export * from './metadata/headers
|
|
10
|
-
export * from './metadata/parameters
|
|
11
|
-
export * from './metadata/query
|
|
12
|
-
export * from './metadata/body
|
|
13
|
-
export * from './metadata/cors
|
|
14
|
-
export * from './metadata/cache
|
|
15
|
-
export * from './errors/service
|
|
16
|
-
export * from './errors/defaults
|
|
17
|
-
export * from './errors/preferences
|
|
18
|
-
export * from './errors/route
|
|
19
|
-
export * from './errors/handler
|
|
20
|
-
export * from './errors/identity
|
|
21
|
-
export * from './errors/authorizer
|
|
22
|
-
export * from './errors/request
|
|
23
|
-
export * from './errors/response
|
|
24
|
-
export * from './errors/headers
|
|
25
|
-
export * from './errors/parameters
|
|
26
|
-
export * from './errors/query
|
|
27
|
-
export * from './errors/body
|
|
28
|
-
export * from './errors/cors
|
|
29
|
-
export * from './errors/cache
|
|
30
|
-
export * from './types/common
|
|
31
|
-
export * from './types/service
|
|
1
|
+
export * from './triggers/register';
|
|
2
|
+
export * from './metadata/service';
|
|
3
|
+
export * from './metadata/route';
|
|
4
|
+
export * from './metadata/handler';
|
|
5
|
+
export * from './metadata/identity';
|
|
6
|
+
export * from './metadata/authorizer';
|
|
7
|
+
export * from './metadata/request';
|
|
8
|
+
export * from './metadata/response';
|
|
9
|
+
export * from './metadata/headers';
|
|
10
|
+
export * from './metadata/parameters';
|
|
11
|
+
export * from './metadata/query';
|
|
12
|
+
export * from './metadata/body';
|
|
13
|
+
export * from './metadata/cors';
|
|
14
|
+
export * from './metadata/cache';
|
|
15
|
+
export * from './errors/service';
|
|
16
|
+
export * from './errors/defaults';
|
|
17
|
+
export * from './errors/preferences';
|
|
18
|
+
export * from './errors/route';
|
|
19
|
+
export * from './errors/handler';
|
|
20
|
+
export * from './errors/identity';
|
|
21
|
+
export * from './errors/authorizer';
|
|
22
|
+
export * from './errors/request';
|
|
23
|
+
export * from './errors/response';
|
|
24
|
+
export * from './errors/headers';
|
|
25
|
+
export * from './errors/parameters';
|
|
26
|
+
export * from './errors/query';
|
|
27
|
+
export * from './errors/body';
|
|
28
|
+
export * from './errors/cors';
|
|
29
|
+
export * from './errors/cache';
|
|
30
|
+
export * from './types/common';
|
|
31
|
+
export * from './types/service';
|
package/dist/library.mjs
CHANGED
|
@@ -4,7 +4,7 @@ getLinkedVariableList as rn,getModelMembers as tn,getPropertyString as on,Invali
|
|
|
4
4
|
import{isModelProperty as pn}from"@ez4/reflection";var Y="@ez4/http",Tn=p(e=>e.type===Y,"isHttpService");import{IncompleteTypeError as er}from"@ez4/common/library";var d=class extends er{static{p(this,"IncompleteServiceError")}constructor(t,r){
|
|
5
5
|
super("Incomplete service",t,r)}};import{InvalidServicePropertyError as xr,isModelDeclaration as Ir,getPropertyNumber as Er,
|
|
6
6
|
getObjectMembers as vr,getModelMembers as Ar,getServiceListener as Rr,getReferenceType as Pr}from"@ez4/common/library";
|
|
7
|
-
import{isModelProperty as
|
|
7
|
+
import{isModelProperty as wr,isTypeObject as Or,isTypeReference as zr}from"@ez4/reflection";import{InvalidServicePropertyError as nr,isModelDeclaration as pr,getObjectMembers as sr,
|
|
8
8
|
getModelMembers as ir,getReferenceType as cr,getPropertyStringIn as lr}from"@ez4/common/library";
|
|
9
9
|
import{isModelProperty as mr,isTypeObject as ar,isTypeReference as ur}from"@ez4/reflection";import{hasHeritageType as a,isClassDeclaration as rr,isModelDeclaration as tr}from"@ez4/common/library";
|
|
10
10
|
import{isTypeCallback as $,isTypeFunction as L}from"@ez4/reflection";var or=new Set(["ANY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),ee=p(e=>{let[
|
|
@@ -30,17 +30,17 @@ let c=parseInt(i.name,10);Tr(c)||n.push(new fr(t.name,i.name,e.file));let l=Sr(i
|
|
|
30
30
|
c,t,o,n);l&&Object.assign(s,l)}return gr(s)?null:s},"getTypeFromMembers"),Sr=p((e,t,r,o,n)=>{
|
|
31
31
|
let s=dr(e)??[],i={};for(let c of s){if(!Me(c)){n.push(new f(r.file));continue}let l=ge(
|
|
32
32
|
c,o);if(!l||!Hr(l)){n.push(new f(r.file));continue}i[l.name]=t}return i},"getErr\
|
|
33
|
-
orClasses");var he=p((e,t,r,o)=>{if(!
|
|
34
|
-
r,o):null},"getHttpDefaults"),He=p((e,t,r,o)=>
|
|
33
|
+
orClasses");var he=p((e,t,r,o)=>{if(!zr(e))return He(e,t,r,o);let n=Pr(e,r);return n?He(n,t,
|
|
34
|
+
r,o):null},"getHttpDefaults"),He=p((e,t,r,o)=>Or(e)?be(t,vr(e),r,o):Ir(e)?oe(e)?
|
|
35
35
|
be(t,Ar(e),r,o):(o.push(new h(e.name,t.file)),null):(o.push(new b(t.file)),null),
|
|
36
|
-
"getTypeDefaults"),be=p((e,t,r,o)=>{let n={};for(let s of t)if(!(!
|
|
36
|
+
"getTypeDefaults"),be=p((e,t,r,o)=>{let n={};for(let s of t)if(!(!wr(s)||s.inherited))
|
|
37
37
|
switch(s.name){default:o.push(new xr(e.name,s.name,e.file));break;case"httpError\
|
|
38
38
|
s":n.httpErrors=H(s.value,e,r,o);break;case"preferences":n.preferences=T(s.value,
|
|
39
39
|
e,r,o);break;case"memory":case"logRetention":case"timeout":n[s.name]=Er(s);break;case"\
|
|
40
40
|
listener":n.listener=Rr(s.value,o);break}return n},"getTypeFromMembers");import{isModelProperty as io,isTypeObject as co,isTypeReference as lo,isTypeTuple as mo}from"@ez4/reflection";
|
|
41
41
|
import{InvalidServicePropertyError as ao,getLinkedVariableList as uo,getPropertyBoolean as fo,
|
|
42
42
|
getPropertyNumber as yo,getPropertyString as To,getObjectMembers as go,getModelMembers as Mo,
|
|
43
|
-
getServiceListener as Ho,getReferenceType as bo,getPropertyTuple as ho}from"@ez4/common/library";import{IncompleteTypeError as
|
|
43
|
+
getServiceListener as Ho,getReferenceType as bo,getPropertyTuple as ho}from"@ez4/common/library";import{IncompleteTypeError as jr,TypeError as Cr}from"@ez4/common/library";var S=class extends jr{static{p(this,"IncompleteRouteError")}constructor(t,r){super(
|
|
44
44
|
"Incomplete gateway route",t,r)}},f=class extends Cr{static{p(this,"InvalidRoute\
|
|
45
45
|
ErrorTypeError")}constructor(t){super("Invalid route error type.",t)}};import{IncompleteTypeError as kr}from"@ez4/common/library";var x=class extends kr{static{p(this,"IncompleteAuthorizerError")}constructor(t,r){
|
|
46
46
|
super("Incomplete route authorizer",t,r)}};import{InvalidServicePropertyError as Ht,isModelDeclaration as bt,hasHeritageType as ht,
|
|
@@ -64,53 +64,53 @@ n[0]},"getIdentityFromUnion");import{isTypeIntersection as Lr,isTypeObject as et
|
|
|
64
64
|
import{getReferenceType as tt,isModelDeclaration as ot}from"@ez4/common/library";import{IncorrectTypeError as _r,InvalidTypeError as $r}from"@ez4/common/library";var R=class extends $r{static{p(this,"InvalidHeadersTypeError")}constructor(t){super(
|
|
65
65
|
"Invalid headers",void 0,"Http.Headers",t)}},P=class extends _r{constructor(r,o){
|
|
66
66
|
super("Incorrect headers",r,"Http.Headers",o);this.headersType=r}static{p(this,"\
|
|
67
|
-
IncorrectHeadersTypeError")}};var
|
|
67
|
+
IncorrectHeadersTypeError")}};var w=p((e,t,r,o)=>{if(!rt(e))return xe(e,t,r,o);let n=tt(e,r);return n?xe(n,t,r,
|
|
68
68
|
o):null},"getHttpHeaders"),xe=p((e,t,r,o)=>et(e)||Lr(e)?m(e,r):ot(e)?pe(e)?m(e,r):
|
|
69
69
|
(o.push(new P(e.name,t.file)),null):(o.push(new R(t.file)),null),"getTypeHeaders");import{createUnionSchema as st,getScalarSchema as it,createArraySchema as ct}from"@ez4/schema/library";
|
|
70
70
|
import{getReferenceType as lt,isModelDeclaration as mt}from"@ez4/common/library";
|
|
71
71
|
import{isTypeArray as at,isTypeIntersection as ut,isTypeObject as ft,isTypeReference as yt,
|
|
72
|
-
isTypeScalar as dt,isTypeUndefined as Ie,isTypeUnion as Tt}from"@ez4/reflection";import{IncorrectTypeError as nt,InvalidTypeError as pt}from"@ez4/common/library";var
|
|
73
|
-
"Invalid body",void 0,"Http.JsonBody",t)}},
|
|
72
|
+
isTypeScalar as dt,isTypeUndefined as Ie,isTypeUnion as Tt}from"@ez4/reflection";import{IncorrectTypeError as nt,InvalidTypeError as pt}from"@ez4/common/library";var O=class extends pt{static{p(this,"InvalidBodyTypeError")}constructor(t){super(
|
|
73
|
+
"Invalid body",void 0,"Http.JsonBody",t)}},z=class extends nt{constructor(r,o){super(
|
|
74
74
|
"Incorrect body",r,"Http.JsonBody",o);this.bodyType=r}static{p(this,"IncorrectBo\
|
|
75
|
-
dyTypeError")}};var
|
|
75
|
+
dyTypeError")}};var j=p((e,t,r,o)=>Z(e,r,n=>W(n)??X(n,t,r,o)),"getHttpBody"),Z=p((e,t,r)=>{if(Ie(
|
|
76
76
|
e))return null;if(!yt(e))return r(e);let o=lt(e,t);return o?r(o):null},"getTypeB\
|
|
77
77
|
ody"),W=p(e=>dt(e)?it(e):null,"getScalarTypeBody"),X=p((e,t,r,o)=>Tt(e)?gt(e.elements,
|
|
78
78
|
r,n=>W(n)??X(n,t,r,o)):at(e)?Mt(e.element,r,n=>W(n)??X(n,t,r,o)):ft(e)||ut(e)?m(
|
|
79
|
-
e,r):mt(e)?le(e)?m(e,r):(o.push(new
|
|
79
|
+
e,r):mt(e)?le(e)?m(e,r):(o.push(new z(e.name,e.file)),null):(o.push(new O(t.file)),
|
|
80
80
|
null),"getCompoundTypeBody"),gt=p((e,t,r)=>{let o={optional:!1,elements:[]};for(let n of e){
|
|
81
81
|
if(Ie(n)){o.optional=!0;continue}let s=Z(n,t,r);s&&o.elements.push(s)}return o.elements.
|
|
82
82
|
length?st(o):null},"getUnionTypeBody"),Mt=p((e,t,r)=>{let o=Z(e,t,r);return o?ct(
|
|
83
|
-
{element:o}):null},"getArrayTypeBody");var Ae=p((e,t,r,o)=>{let n=Pe(e,t,r,o,"Http.AuthResponse");return n&&
|
|
83
|
+
{element:o}):null},"getArrayTypeBody");var Ae=p((e,t,r,o)=>{let n=Pe(e,t,r,o,"Http.AuthResponse");return n&&wt(n)?n:null},
|
|
84
84
|
"getHttpAuthResponse"),Re=p((e,t,r,o)=>{let n=Pe(e,t,r,o,"Http.Response");return n&&
|
|
85
|
-
|
|
86
|
-
t,r,o,n);let s=Et(e,r);return s?Ee(s,t,r,o,n):null},"getHttpResponse"),
|
|
87
|
-
identity,"isValidAuthResponse"),
|
|
85
|
+
Ot(n)?n:null},"getHttpHandlerResponse"),Pe=p((e,t,r,o,n)=>{if(!Rt(e))return Ee(e,
|
|
86
|
+
t,r,o,n);let s=Et(e,r);return s?Ee(s,t,r,o,n):null},"getHttpResponse"),wt=p(e=>!!e.
|
|
87
|
+
identity,"isValidAuthResponse"),Ot=p(e=>Pt(e.status),"isValidHandlerResponse"),Ee=p(
|
|
88
88
|
(e,t,r,o,n)=>At(e)?ve(e,t,xt(e),r,o):bt(e)?ht(e,n)?ve(e,t,St(e),r,o):(o.push(new E(
|
|
89
89
|
e.name,n,e.file)),null):(o.push(new I(n,t.file)),null),"getTypeResponse"),ve=p((e,t,r,o,n)=>{
|
|
90
90
|
let s={};for(let i of r)if(!(!vt(i)||i.inherited))switch(i.name){default:n.push(
|
|
91
91
|
new Ht(t.name,i.name,e.file));break;case"status":s.status=It(i);break;case"heade\
|
|
92
|
-
rs":{s.headers=
|
|
92
|
+
rs":{s.headers=w(i.value,e,o,n),s.headers&&i.description&&(s.headers.description=
|
|
93
93
|
i.description);break}case"identity":{s.identity=y(i.value,e,o,n),s.identity&&i.description&&
|
|
94
|
-
(s.identity.description=i.description);break}case"body":{s.body=
|
|
94
|
+
(s.identity.description=i.description);break}case"body":{s.body=j(i.value,e,o,n),
|
|
95
95
|
s.body&&i.description&&(s.body.description=i.description);break}}return s},"getT\
|
|
96
96
|
ypeFromMembers");import{isModelProperty as Wt,isTypeIntersection as Xt,isTypeObject as Zt,isTypeReference as _t}from"@ez4/reflection";
|
|
97
97
|
import{InvalidServicePropertyError as $t,isModelDeclaration as Lt,hasHeritageType as eo,
|
|
98
|
-
getObjectMembers as ro,getModelMembers as to,getReferenceType as oo}from"@ez4/common/library";import{IncorrectTypeError as
|
|
99
|
-
this.baseType=r}static{p(this,"InvalidRequestTypeError")}},k=class extends
|
|
98
|
+
getObjectMembers as ro,getModelMembers as to,getReferenceType as oo}from"@ez4/common/library";import{IncorrectTypeError as zt,InvalidTypeError as jt}from"@ez4/common/library";var C=class extends jt{constructor(r,o){super("Invalid route request",void 0,r,o);
|
|
99
|
+
this.baseType=r}static{p(this,"InvalidRequestTypeError")}},k=class extends zt{constructor(r,o,n){
|
|
100
100
|
super("Incorrect route request",r,o,n);this.requestType=r;this.baseType=o}static{
|
|
101
101
|
p(this,"IncorrectRequestTypeError")}};import{isTypeIntersection as qt,isTypeObject as Dt,isTypeReference as Ft}from"@ez4/reflection";
|
|
102
102
|
import{getReferenceType as Bt,isModelDeclaration as Ut}from"@ez4/common/library";import{IncorrectTypeError as Ct,InvalidTypeError as kt}from"@ez4/common/library";var q=class extends kt{static{p(this,"InvalidParameterTypeError")}constructor(t){
|
|
103
103
|
super("Invalid request parameters",void 0,"Http.PathParameters",t)}},D=class extends Ct{constructor(r,o){
|
|
104
104
|
super("Incorrect request parameters",r,"Http.PathParameters",o);this.parametersType=
|
|
105
|
-
r}static{p(this,"IncorrectParameterTypeError")}};var
|
|
106
|
-
r,o):null},"getHttpParameters"),
|
|
105
|
+
r}static{p(this,"IncorrectParameterTypeError")}};var Oe=p((e,t,r,o)=>{if(!Ft(e))return we(e,t,r,o);let n=Bt(e,r);return n?we(n,t,
|
|
106
|
+
r,o):null},"getHttpParameters"),we=p((e,t,r,o)=>Dt(e)||qt(e)?m(e,r):Ut(e)?ce(e)?
|
|
107
107
|
m(e,r):(o.push(new D(e.name,e.file)),null):(o.push(new q(t.file)),null),"getType\
|
|
108
108
|
Parameter");import{isTypeIntersection as Qt,isTypeObject as Jt,isTypeReference as Gt}from"@ez4/reflection";
|
|
109
109
|
import{getReferenceType as Kt,isModelDeclaration as Yt}from"@ez4/common/library";import{IncorrectTypeError as Nt,InvalidTypeError as Vt}from"@ez4/common/library";var F=class extends Vt{static{p(this,"InvalidQueryTypeError")}constructor(t){super(
|
|
110
110
|
"Invalid request query strings",void 0,"Http.QueryStrings",t)}},B=class extends Nt{constructor(r,o){
|
|
111
111
|
super("Incorrect request query strings",r,"Http.QueryStrings",o);this.queryType=
|
|
112
|
-
r}static{p(this,"IncorrectQueryTypeError")}};var
|
|
113
|
-
r,o):null},"getHttpQuery"),
|
|
112
|
+
r}static{p(this,"IncorrectQueryTypeError")}};var je=p((e,t,r,o)=>{if(!Gt(e))return ze(e,t,r,o);let n=Kt(e,r);return n?ze(n,t,
|
|
113
|
+
r,o):null},"getHttpQuery"),ze=p((e,t,r,o)=>Jt(e)||Qt(e)?m(e,r):Yt(e)?ie(e)?m(e,r):
|
|
114
114
|
(o.push(new B(e.name,t.file)),null):(o.push(new F(t.file)),null),"getTypeQuery");var qe=p((e,t,r,o)=>_(e,t,r,o,"Http.AuthRequest"),"getHttpAuthRequest"),De=p((e,t,r,o)=>_(
|
|
115
115
|
e,t,r,o,"Http.Request"),"getHttpHandlerRequest"),_=p((e,t,r,o,n)=>{if(Xt(e)&&e.elements.
|
|
116
116
|
length>0)return _(e.elements[0],t,r,o,n);if(!_t(e))return Ce(e,t,r,o,n);let s=oo(
|
|
@@ -118,12 +118,12 @@ e,r);return s?Ce(s,t,r,o,n):null},"getHttpRequest"),Ce=p((e,t,r,o,n)=>Zt(e)?ke(e
|
|
|
118
118
|
t,ro(e),r,o):Lt(e)?eo(e,n)?ke(e,t,to(e),r,o):(o.push(new k(e.name,n,e.file)),null):
|
|
119
119
|
(o.push(new C(n,t.file)),null),"getTypeRequest"),ke=p((e,t,r,o,n)=>{let s={};for(let i of r)
|
|
120
120
|
if(!(!Wt(i)||i.inherited))switch(i.name){default:n.push(new $t(t.name,i.name,e.file));
|
|
121
|
-
break;case"headers":{s.headers=
|
|
121
|
+
break;case"headers":{s.headers=w(i.value,e,o,n),s.headers&&i.description&&(s.headers.
|
|
122
122
|
description=i.description);break}case"identity":{s.identity=y(i.value,e,o,n),s.identity&&
|
|
123
123
|
i.description&&(s.identity.description=i.description);break}case"query":{s.query=
|
|
124
|
-
|
|
125
|
-
parameters":{s.parameters=
|
|
126
|
-
description=i.description);break}case"body":{s.body=
|
|
124
|
+
je(i.value,e,o,n),s.query&&i.description&&(s.query.description=i.description);break}case"\
|
|
125
|
+
parameters":{s.parameters=Oe(i.value,e,o,n),s.parameters&&i.description&&(s.parameters.
|
|
126
|
+
description=i.description);break}case"body":{s.body=j(i.value,e,o,n),s.body&&i.description&&
|
|
127
127
|
(s.body.description=i.description);break}}return s},"getTypeFromMembers");var Fe=p((e,t,r,o)=>{if(!ue(e))return null;let{description:n,module:s}=e,i={...n&&
|
|
128
128
|
{description:n},...s&&{module:s}},c=new Set(["name","file"]);if((i.name=e.name)&&
|
|
129
129
|
c.delete("name"),(i.file=e.file)&&c.delete("file"),e.parameters){let[{value:l}]=e.
|
|
@@ -150,7 +150,7 @@ T(c.value,t,o,n);break;case"memory":case"logRetention":case"timeout":s[c.name]=y
|
|
|
150
150
|
c);break;case"cors":s.cors=fo(c);break;case"listener":s.listener=Ho(c.value,n);break;case"\
|
|
151
151
|
variables":s.variables=uo(c,n);break}return xo(s)?s:(n.push(new S([...i],e.file)),
|
|
152
152
|
null)},"getTypeFromMembers");import{InvalidServicePropertyError as Ao,isModelDeclaration as Ro,getModelMembers as Po,
|
|
153
|
-
getObjectMembers as
|
|
153
|
+
getObjectMembers as wo,getPropertyBoolean as Oo,getPropertyStringList as zo,getPropertyNumber as jo,
|
|
154
154
|
getReferenceType as Co}from"@ez4/common/library";import{isModelProperty as ko,isTypeObject as qo,
|
|
155
155
|
isTypeReference as Do}from"@ez4/reflection";import{IncompleteTypeError as Io,IncorrectTypeError as Eo,InvalidTypeError as vo}from"@ez4/common/library";var N=class extends Io{static{p(this,"IncompleteCorsError")}constructor(t,r){super(
|
|
156
156
|
"Incomplete HTTP CORS",t,r)}},V=class extends vo{static{p(this,"InvalidCorsTypeE\
|
|
@@ -158,12 +158,12 @@ rror")}constructor(t){super("Invalid HTTP CORS type",void 0,"Http.Cors",t)}},Q=c
|
|
|
158
158
|
super("Incorrect HTTP CORS type",r,"Http.Cors",o);this.fallbackType=r}static{p(this,
|
|
159
159
|
"IncorrectCorsTypeError")}};var Ke=p((e,t,r,o)=>{if(!Do(e))return Je(e,t,o);let n=Co(e,r);return n?Je(n,t,o):
|
|
160
160
|
null},"getHttpCors"),Fo=p(e=>!!e.allowOrigins?.length,"isValidCors"),Je=p((e,t,r)=>qo(
|
|
161
|
-
e)?Ge(e,t,
|
|
161
|
+
e)?Ge(e,t,wo(e),r):Ro(e)?me(e)?Ge(e,t,Po(e),r):(r.push(new Q(e.name,e.file)),null):
|
|
162
162
|
(r.push(new V(t.file)),null),"getTypeCors"),Ge=p((e,t,r,o)=>{let n={},s=new Set(
|
|
163
163
|
["allowOrigins"]);for(let i of r)if(!(!ko(i)||i.inherited))switch(i.name){default:
|
|
164
164
|
o.push(new Ao(t.name,i.name,e.file));break;case"allowOrigins":case"allowMethods":case"\
|
|
165
|
-
allowHeaders":case"exposeHeaders":n[i.name]=
|
|
166
|
-
allowCredentials=
|
|
165
|
+
allowHeaders":case"exposeHeaders":n[i.name]=zo(i);break;case"allowCredentials":n.
|
|
166
|
+
allowCredentials=Oo(i);break;case"maxAge":n.maxAge=jo(i);break}return Fo(n)?n:(o.
|
|
167
167
|
push(new N([...s],e.file)),null)},"getTypeFromMembers");import{InvalidServicePropertyError as Vo,isModelDeclaration as Qo,getModelMembers as Jo,
|
|
168
168
|
getObjectMembers as Go,getPropertyNumber as Ko,getReferenceType as Yo}from"@ez4/common/library";
|
|
169
169
|
import{isModelProperty as Wo,isTypeObject as Xo,isTypeReference as Zo}from"@ez4/reflection";
|
|
@@ -187,7 +187,7 @@ ts":s.defaults=he(l.value,n,e,r);break;case"cache":s.cache=Ze(l.value,n,e,r);bre
|
|
|
187
187
|
cors":s.cors=Ke(l.value,n,e,r);break;case"variables":s.variables=rn(l,r);break;case"\
|
|
188
188
|
services":s.services=en(l,e,r);break}if(!sn(s)){r.push(new d([...i],c));continue}
|
|
189
189
|
if(t[n.name]){r.push(new $o(n.name,c));continue}t[n.name]=s}return{services:t,errors:r}},
|
|
190
|
-
"getHttpServices"),sn=p(e=>!!e.name&&!!e.routes&&!!e.extras,"isValidService");var $e=!1,
|
|
190
|
+
"getHttpServices"),sn=p(e=>!!e.name&&!!e.routes&&!!e.extras,"isValidService");var $e=!1,wi=p(()=>{$e||(cn(),ln(),mn("@ez4/gateway",{"metadata:getServices":_e}),
|
|
191
191
|
$e=!0)},"registerTriggers");import{IncorrectTypeError as an,InvalidTypeError as un}from"@ez4/common/library";var b=class extends un{static{p(this,"InvalidDefaultsTypeError")}constructor(t){
|
|
192
192
|
super("Invalid defaults",void 0,"Http.Defaults",t)}},h=class extends an{constructor(r,o){
|
|
193
193
|
super("Incorrect defaults",r,"Http.Defaults",o);this.defaultsType=r}static{p(this,
|
|
@@ -196,16 +196,16 @@ super("Invalid preferences",void 0,"Http.Preferences",t)}},M=class extends fn{co
|
|
|
196
196
|
super("Incorrect preferences",r,"Http.Preferences",o);this.preferencesType=r}static{
|
|
197
197
|
p(this,"IncorrectPreferencesTypeError")}};export{x as IncompleteAuthorizerError,J as IncompleteCacheError,N as IncompleteCorsError,
|
|
198
198
|
U as IncompleteHandlerError,S as IncompleteRouteError,d as IncompleteServiceError,
|
|
199
|
-
|
|
199
|
+
z as IncorrectBodyTypeError,K as IncorrectCacheTypeError,Q as IncorrectCorsTypeError,
|
|
200
200
|
h as IncorrectDefaultsTypeError,P as IncorrectHeadersTypeError,A as IncorrectIdentityTypeError,
|
|
201
201
|
D as IncorrectParameterTypeError,M as IncorrectPreferencesTypeError,B as IncorrectQueryTypeError,
|
|
202
|
-
k as IncorrectRequestTypeError,E as IncorrectResponseTypeError,
|
|
202
|
+
k as IncorrectRequestTypeError,E as IncorrectResponseTypeError,O as InvalidBodyTypeError,
|
|
203
203
|
G as InvalidCacheTypeError,V as InvalidCorsTypeError,b as InvalidDefaultsTypeError,
|
|
204
204
|
R as InvalidHeadersTypeError,v as InvalidIdentityTypeError,q as InvalidParameterTypeError,
|
|
205
205
|
g as InvalidPreferencesTypeError,F as InvalidQueryTypeError,C as InvalidRequestTypeError,
|
|
206
206
|
I as InvalidResponseTypeError,f as InvalidRouteErrorTypeError,Y as ServiceType,qe as getHttpAuthRequest,
|
|
207
|
-
Ae as getHttpAuthResponse,Fe as getHttpAuthorizer,
|
|
207
|
+
Ae as getHttpAuthResponse,Fe as getHttpAuthorizer,j as getHttpBody,Ze as getHttpCache,
|
|
208
208
|
Ke as getHttpCors,Be as getHttpHandler,De as getHttpHandlerRequest,Re as getHttpHandlerResponse,
|
|
209
|
-
|
|
210
|
-
Ve as getHttpRoutes,_e as getHttpServices,Tn as isHttpService,
|
|
209
|
+
w as getHttpHeaders,y as getHttpIdentity,Oe as getHttpParameters,je as getHttpQuery,
|
|
210
|
+
Ve as getHttpRoutes,_e as getHttpServices,Tn as isHttpService,wi as registerTriggers};
|
|
211
211
|
//# sourceMappingURL=library.mjs.map
|
package/dist/main.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var
|
|
2
|
-
typeof e=="object"||typeof e=="function")for(let o of
|
|
3
|
-
u(s,o,{get:()=>e[o],enumerable:!(n=
|
|
4
|
-
HttpInternalServerError:()=>
|
|
1
|
+
"use strict";var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(s,e)=>u(s,"name",{value:e,configurable:!0});var S=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},q=(s,e,t,n)=>{if(e&&
|
|
2
|
+
typeof e=="object"||typeof e=="function")for(let o of h(e))!g.call(s,o)&&o!==t&&
|
|
3
|
+
u(s,o,{get:()=>e[o],enumerable:!(n=l(e,o))||n.enumerable});return s};var f=s=>q(u({},"__esModule",{value:!0}),s);var A={};S(A,{Http:()=>d,HttpBadRequestError:()=>c,HttpError:()=>r,HttpForbiddenError:()=>a,
|
|
4
|
+
HttpInternalServerError:()=>H,HttpNotFoundError:()=>x,HttpUnauthorizedError:()=>i,
|
|
5
5
|
HttpUnprocessableEntityError:()=>y,HttpUnsupportedMediaTypeError:()=>m});module.
|
|
6
|
-
exports=
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
e||"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
exports=f(A);var d;(s=>{})(d||={});var R=require("@ez4/common");var r=class extends R.ServiceError{constructor(t,n,o){super(n,o);this.status=t}static{
|
|
7
|
+
p(this,"HttpError")}},c=class extends r{static{p(this,"HttpBadRequestError")}constructor(e,t){
|
|
8
|
+
super(400,e||"Bad request",t)}},i=class extends r{static{p(this,"HttpUnauthorize\
|
|
9
|
+
dError")}constructor(e,t){super(401,e||"Unauthorized",t)}},a=class extends r{static{
|
|
10
|
+
p(this,"HttpForbiddenError")}constructor(e,t){super(403,e||"Forbidden",t)}},x=class extends r{static{
|
|
11
|
+
p(this,"HttpNotFoundError")}constructor(e,t){super(404,e||"Not found",t)}},m=class extends r{static{
|
|
12
|
+
p(this,"HttpUnsupportedMediaTypeError")}constructor(e,t){super(415,e||"Unsupport\
|
|
13
|
+
ed media type",t)}},y=class extends r{static{p(this,"HttpUnprocessableEntityErro\
|
|
14
|
+
r")}constructor(e,t){super(422,e||"Unprocessable entity",t)}},H=class extends r{static{
|
|
15
|
+
p(this,"HttpInternalServerError")}constructor(e,t){super(500,e||"Internal server\
|
|
16
|
+
error",t)}};0&&(module.exports={Http,HttpBadRequestError,HttpError,HttpForbiddenError,HttpInternalServerError,
|
|
17
17
|
HttpNotFoundError,HttpUnauthorizedError,HttpUnprocessableEntityError,HttpUnsupportedMediaTypeError});
|
|
18
18
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './services/contract
|
|
2
|
-
export * from './services/errors
|
|
1
|
+
export * from './services/contract';
|
|
2
|
+
export * from './services/errors';
|
package/dist/main.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
e||"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
r
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var H=Object.defineProperty;var r=(s,e)=>H(s,"name",{value:e,configurable:!0});var d;(s=>{})(d||={});import{ServiceError as R}from"@ez4/common";var p=class extends R{constructor(t,m,y){super(m,y);this.status=t}static{r(this,
|
|
2
|
+
"HttpError")}},o=class extends p{static{r(this,"HttpBadRequestError")}constructor(e,t){
|
|
3
|
+
super(400,e||"Bad request",t)}},n=class extends p{static{r(this,"HttpUnauthorize\
|
|
4
|
+
dError")}constructor(e,t){super(401,e||"Unauthorized",t)}},u=class extends p{static{
|
|
5
|
+
r(this,"HttpForbiddenError")}constructor(e,t){super(403,e||"Forbidden",t)}},c=class extends p{static{
|
|
6
|
+
r(this,"HttpNotFoundError")}constructor(e,t){super(404,e||"Not found",t)}},i=class extends p{static{
|
|
7
|
+
r(this,"HttpUnsupportedMediaTypeError")}constructor(e,t){super(415,e||"Unsupport\
|
|
8
|
+
ed media type",t)}},a=class extends p{static{r(this,"HttpUnprocessableEntityErro\
|
|
9
|
+
r")}constructor(e,t){super(422,e||"Unprocessable entity",t)}},x=class extends p{static{
|
|
10
|
+
r(this,"HttpInternalServerError")}constructor(e,t){super(500,e||"Internal server\
|
|
11
|
+
error",t)}};export{d as Http,o as HttpBadRequestError,p as HttpError,u as HttpForbiddenError,
|
|
12
12
|
x as HttpInternalServerError,c as HttpNotFoundError,n as HttpUnauthorizedError,a as HttpUnprocessableEntityError,
|
|
13
13
|
i as HttpUnsupportedMediaTypeError};
|
|
14
14
|
//# sourceMappingURL=main.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpAuthorizer } from '../types/common
|
|
2
|
+
import type { HttpAuthorizer } from '../types/common';
|
|
3
3
|
export declare const getHttpAuthorizer: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpAuthorizer | null;
|
package/dist/metadata/body.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
|
|
2
2
|
import type { ArraySchema, ObjectSchema, UnionSchema } from '@ez4/schema/library';
|
|
3
3
|
type TypeParent = TypeObject | TypeModel | TypeIntersection;
|
|
4
|
-
export declare const getHttpBody: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) =>
|
|
4
|
+
export declare const getHttpBody: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema").BooleanSchema | import("@ez4/schema").NumberSchema | import("@ez4/schema").StringSchema | ObjectSchema | UnionSchema | ArraySchema | null;
|
|
5
5
|
export {};
|
package/dist/metadata/cache.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpCache } from '../types/common
|
|
2
|
+
import type { HttpCache } from '../types/common';
|
|
3
3
|
export declare const getHttpCache: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpCache | null;
|
package/dist/metadata/cors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpCors } from '../types/common
|
|
2
|
+
import type { HttpCors } from '../types/common';
|
|
3
3
|
export declare const getHttpCors: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpCors | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpDefaults } from '../types/common
|
|
2
|
+
import type { HttpDefaults } from '../types/common';
|
|
3
3
|
export declare const getHttpDefaults: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpDefaults | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AllType, ModelProperty, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpErrors } from '../types/common
|
|
2
|
+
import type { HttpErrors } from '../types/common';
|
|
3
3
|
export declare const getHttpErrors: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpErrors | null;
|
|
4
4
|
export declare const getErrorClasses: (member: ModelProperty, errorCode: number, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpErrors;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpHandler } from '../types/common
|
|
2
|
+
import type { HttpHandler } from '../types/common';
|
|
3
3
|
export declare const getHttpHandler: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpHandler | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpPreferences } from '../types/common
|
|
2
|
+
import type { HttpPreferences } from '../types/common';
|
|
3
3
|
export declare const getHttpPreferences: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpPreferences | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpAuthRequest, HttpRequest } from '../types/common
|
|
2
|
+
import type { HttpAuthRequest, HttpRequest } from '../types/common';
|
|
3
3
|
export declare const getHttpAuthRequest: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => (HttpAuthRequest & HttpRequest) | null;
|
|
4
4
|
export declare const getHttpHandlerRequest: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => (HttpAuthRequest & HttpRequest) | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
2
|
import type { Incomplete } from '@ez4/utils';
|
|
3
|
-
import type { HttpAuthResponse, HttpResponse } from '../types/common
|
|
3
|
+
import type { HttpAuthResponse, HttpResponse } from '../types/common';
|
|
4
4
|
export declare const getHttpAuthResponse: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => Incomplete<HttpAuthResponse & HttpResponse> | null;
|
|
5
5
|
export declare const getHttpHandlerResponse: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpResponse | null;
|
package/dist/metadata/route.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ModelProperty, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpRoute } from '../types/common
|
|
2
|
+
import type { HttpRoute } from '../types/common';
|
|
3
3
|
export declare const getHttpRoutes: (parent: TypeModel, member: ModelProperty, reflection: SourceMap, errorList: Error[]) => HttpRoute[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
|
|
2
|
-
export declare const getSchemaFromType: (type: TypeObject | TypeModel | TypeIntersection, reflection: SourceMap) => import("@ez4/schema
|
|
2
|
+
export declare const getSchemaFromType: (type: TypeObject | TypeModel | TypeIntersection, reflection: SourceMap) => import("@ez4/schema").ObjectSchema | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SourceMap } from '@ez4/reflection';
|
|
2
|
-
import type { HttpService } from '../types/service
|
|
2
|
+
import type { HttpService } from '../types/service';
|
|
3
3
|
export declare const getHttpServices: (reflection: SourceMap) => {
|
|
4
4
|
services: Record<string, HttpService>;
|
|
5
5
|
errors: Error[];
|
package/dist/metadata/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AllType, TypeCallback, TypeClass, TypeFunction, TypeModel } from '@ez4/reflection';
|
|
2
|
-
import type { HttpPath } from '../types/common
|
|
2
|
+
import type { HttpPath } from '../types/common';
|
|
3
3
|
export declare const isHttpPath: (path: string) => path is HttpPath;
|
|
4
4
|
export declare const isHttpService: (type: AllType) => type is TypeClass;
|
|
5
5
|
export declare const isHttpRoute: (type: AllType) => type is TypeModel;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Service as CommonService } from '@ez4/common';
|
|
2
2
|
import type { LinkedVariables } from '@ez4/project/library';
|
|
3
|
-
import type { HttpPath } from '../types/common
|
|
4
|
-
import type { HttpSuccessStatuses, HttpEmptySuccessResponse, HttpSuccessResponse } from './utils
|
|
5
|
-
import type { HttpHeaders, HttpIdentity, HttpPathParameters, HttpQueryStrings, HttpJsonBody, HttpRawBody, HttpPreferences, HttpAuthRequest, HttpAuthResponse, HttpRequest, HttpResponse, HttpErrors, HttpProvider, HttpIncoming, HttpListener, HttpAuthorizer, HttpHandler, HttpCache, HttpCors } from './common
|
|
3
|
+
import type { HttpPath } from '../types/common';
|
|
4
|
+
import type { HttpSuccessStatuses, HttpEmptySuccessResponse, HttpSuccessResponse } from './utils';
|
|
5
|
+
import type { HttpHeaders, HttpIdentity, HttpPathParameters, HttpQueryStrings, HttpJsonBody, HttpRawBody, HttpPreferences, HttpAuthRequest, HttpAuthResponse, HttpRequest, HttpResponse, HttpErrors, HttpProvider, HttpIncoming, HttpListener, HttpAuthorizer, HttpHandler, HttpCache, HttpCors } from './common';
|
|
6
6
|
/**
|
|
7
7
|
* Provide all contracts for a self-managed HTTP service.
|
|
8
8
|
*/
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { ServiceError } from '@ez4/common';
|
|
1
2
|
/**
|
|
2
3
|
* Default HTTP error.
|
|
3
4
|
*/
|
|
4
|
-
export declare class HttpError extends
|
|
5
|
+
export declare class HttpError extends ServiceError {
|
|
5
6
|
status: number;
|
|
6
|
-
message: string;
|
|
7
|
-
details?: string[] | undefined;
|
|
8
|
-
constructor(status: number, message: string, details?: string[] | undefined);
|
|
7
|
+
constructor(status: number, message: string, details?: string[]);
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* HTTP Bad Request error.
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HttpResponse, HttpJsonBody, HttpRawBody } from './common
|
|
1
|
+
import type { HttpResponse, HttpJsonBody, HttpRawBody } from './common';
|
|
2
2
|
export type HttpSuccessStatuses = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208;
|
|
3
3
|
/**
|
|
4
4
|
* Common HTTP success response without a response body.
|
package/dist/types/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceMetadata } from '@ez4/project/library';
|
|
2
|
-
import type { HttpRoute, HttpCors, HttpDefaults, HttpCache } from './common
|
|
2
|
+
import type { HttpRoute, HttpCors, HttpDefaults, HttpCache } from './common';
|
|
3
3
|
export declare const ServiceType = "@ez4/http";
|
|
4
4
|
export type HttpService = ServiceMetadata & {
|
|
5
5
|
type: typeof ServiceType;
|
package/dist/utils/body.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AnySchema } from '@ez4/schema';
|
|
2
|
-
import type { Http } from '../services/contract
|
|
2
|
+
import type { Http } from '../services/contract';
|
|
3
3
|
export declare const getRequestBody: <T extends Http.JsonBody | Http.RawBody>(input: T | undefined, schema: AnySchema, preferences?: Http.Preferences | null) => Promise<T>;
|
|
4
4
|
export declare const getResponseBody: (body: unknown, schema: AnySchema, preferences?: Http.Preferences) => unknown;
|
package/dist/utils.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";var d=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var n=(e,t)=>d(e,"name",{value:t,configurable:!0});var b=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,o)=>{if(t&&
|
|
2
2
|
typeof t=="object"||typeof t=="function")for(let a of C(t))!P.call(e,a)&&a!==r&&
|
|
3
|
-
d(e,a,{get:()=>t[a],enumerable:!(o=q(t,a))||o.enumerable});return e};var M=e=>z(d({},"__esModule",{value:!0}),e);var A={};b(A,{getHeaders:()=>O,getIdentity:()=>R,getJsonError:()=>$,getPathParameters:()=>
|
|
4
|
-
getQueryStrings:()=>
|
|
5
|
-
M(A);var l=require("@ez4/transform"),s=require("@ez4/validator"),H=require("@ez4/gateway");var
|
|
3
|
+
d(e,a,{get:()=>t[a],enumerable:!(o=q(t,a))||o.enumerable});return e};var M=e=>z(d({},"__esModule",{value:!0}),e);var A={};b(A,{getHeaders:()=>O,getIdentity:()=>R,getJsonError:()=>$,getPathParameters:()=>B,
|
|
4
|
+
getQueryStrings:()=>j,getRequestBody:()=>U,getResponseBody:()=>V});module.exports=
|
|
5
|
+
M(A);var l=require("@ez4/transform"),s=require("@ez4/validator"),H=require("@ez4/gateway");var B=n(async(e,t)=>{let r=(0,l.transform)(e,t,(0,l.createTransformContext)({convert:!1})),
|
|
6
6
|
o=await(0,s.validate)(r,t,(0,s.createValidatorContext)({property:"$path"}));if(o.
|
|
7
7
|
length){let a=(0,s.getUniqueErrorMessages)(o);throw new H.HttpBadRequestError("M\
|
|
8
|
-
alformed path parameters.",a)}return r},"getPathParameters");var g=require("@ez4/transform"),m=require("@ez4/validator"),w=require("@ez4/gateway");var
|
|
8
|
+
alformed path parameters.",a)}return r},"getPathParameters");var g=require("@ez4/transform"),m=require("@ez4/validator"),w=require("@ez4/gateway");var j=n(async(e,t,r)=>{let o=r?.namingStyle,a=(0,g.createTransformContext)({convert:!0,
|
|
9
9
|
inputStyle:o}),y=(0,g.transform)(e,t,a),x=(0,m.createValidatorContext)({property:"\
|
|
10
|
-
$query"}),u=await(0,m.validate)(y,t,x);if(u.length){let T=(0,m.getUniqueErrorMessages)(
|
|
10
|
+
$query",pathStyle:o}),u=await(0,m.validate)(y,t,x);if(u.length){let T=(0,m.getUniqueErrorMessages)(
|
|
11
11
|
u);throw new w.HttpBadRequestError("Malformed query strings.",T)}return y},"getQ\
|
|
12
12
|
ueryStrings");var h=require("@ez4/transform"),p=require("@ez4/validator"),S=require("@ez4/gateway");var O=n(async(e,t)=>{let r=(0,h.transform)(e,t,(0,h.createTransformContext)({convert:!1})),
|
|
13
13
|
o=await(0,p.validate)(r,t,(0,p.createValidatorContext)({property:"$header"}));if(o.
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './utils/parameters
|
|
2
|
-
export * from './utils/query
|
|
3
|
-
export * from './utils/headers
|
|
4
|
-
export * from './utils/identity
|
|
5
|
-
export * from './utils/body
|
|
6
|
-
export * from './utils/errors
|
|
1
|
+
export * from './utils/parameters';
|
|
2
|
+
export * from './utils/query';
|
|
3
|
+
export * from './utils/headers';
|
|
4
|
+
export * from './utils/identity';
|
|
5
|
+
export * from './utils/body';
|
|
6
|
+
export * from './utils/errors';
|
package/dist/utils.mjs
CHANGED
|
@@ -5,13 +5,13 @@ th"}));if(o.length){let n=h(o);throw new u("Malformed path parameters.",n)}retur
|
|
|
5
5
|
"getPathParameters");import{createTransformContext as T,transform as H}from"@ez4/transform";import{validate as w,
|
|
6
6
|
createValidatorContext as S,getUniqueErrorMessages as v}from"@ez4/validator";import{
|
|
7
7
|
HttpBadRequestError as E}from"@ez4/gateway";var W=a(async(e,t,r)=>{let o=r?.namingStyle,n=T({convert:!0,inputStyle:o}),s=H(e,
|
|
8
|
-
t,n),m=S({property:"$query"}),p=await w(s,t,m);if(p.length){let i=v(
|
|
9
|
-
"Malformed query strings.",i)}return s},"getQueryStrings");import{createTransformContext as q,transform as C}from"@ez4/transform";import{validate as P,
|
|
8
|
+
t,n),m=S({property:"$query",pathStyle:o}),p=await w(s,t,m);if(p.length){let i=v(
|
|
9
|
+
p);throw new E("Malformed query strings.",i)}return s},"getQueryStrings");import{createTransformContext as q,transform as C}from"@ez4/transform";import{validate as P,
|
|
10
10
|
createValidatorContext as b,getUniqueErrorMessages as z}from"@ez4/validator";import{
|
|
11
11
|
HttpBadRequestError as M}from"@ez4/gateway";var et=a(async(e,t)=>{let r=C(e,t,q({convert:!1})),o=await P(r,t,b({property:"$h\
|
|
12
12
|
eader"}));if(o.length){let n=z(o);throw new M("Malformed request headers.",n)}return r},
|
|
13
|
-
"getHeaders");import{validate as
|
|
14
|
-
import{HttpBadRequestError as R}from"@ez4/gateway";var st=a(async(e,t)=>{let r=await
|
|
13
|
+
"getHeaders");import{validate as B,createValidatorContext as j,getUniqueErrorMessages as O}from"@ez4/validator";
|
|
14
|
+
import{HttpBadRequestError as R}from"@ez4/gateway";var st=a(async(e,t)=>{let r=await B(e,t,j({property:"$identity"}));if(r.length){
|
|
15
15
|
let o=O(r);throw new R("Malformed authorizer identity.",o)}return e},"getIdentit\
|
|
16
16
|
y");import{createTransformContext as c,transform as f}from"@ez4/transform";import{validate as U,
|
|
17
17
|
createValidatorContext as V,getUniqueErrorMessages as $}from"@ez4/validator";import{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ez4/gateway",
|
|
3
3
|
"description": "EZ4: Components to build gateway services",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.0",
|
|
5
5
|
"author": "Silas B.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/sbalmt/ez4.git",
|
|
14
|
-
"directory": "
|
|
14
|
+
"directory": "contracts/gateway"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=22.7"
|
|
@@ -34,26 +34,25 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"workspaces": [
|
|
37
|
-
"
|
|
37
|
+
"foundation/*",
|
|
38
|
+
"contracts/*"
|
|
38
39
|
],
|
|
39
40
|
"scripts": {
|
|
40
41
|
"lint": "eslint --cache",
|
|
41
42
|
"clean": "rm -f *.tsbuildinfo && rm -rf dist/*",
|
|
42
|
-
"build": "tsc
|
|
43
|
-
"test": "npm run
|
|
44
|
-
"test:only": "npm run test:types && node --test-only --test --import ../../tools/tsnode.mjs test/*.spec.ts",
|
|
45
|
-
"test:types": "npm run build && tsc -p tsconfig.test.json",
|
|
43
|
+
"build": "tsc && node tools/bundler.mjs",
|
|
44
|
+
"test": "npm run build && ez4 test",
|
|
46
45
|
"local:publish": "npm run build && npm run clean:registry && npm publish --registry http://localhost:4873",
|
|
47
46
|
"clean:registry": "rm -rf ../../.registry/@ez4/gateway",
|
|
48
|
-
"live:publish": "npm publish --access public"
|
|
47
|
+
"live:publish": "npm run build && npm publish --access public"
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@ez4/common": "^0.
|
|
52
|
-
"@ez4/project": "^0.
|
|
53
|
-
"@ez4/reflection": "^0.
|
|
54
|
-
"@ez4/schema": "^0.
|
|
55
|
-
"@ez4/transform": "^0.
|
|
56
|
-
"@ez4/utils": "^0.
|
|
57
|
-
"@ez4/validator": "^0.
|
|
50
|
+
"@ez4/common": "^0.27.0",
|
|
51
|
+
"@ez4/project": "^0.27.0",
|
|
52
|
+
"@ez4/reflection": "^0.27.0",
|
|
53
|
+
"@ez4/schema": "^0.27.0",
|
|
54
|
+
"@ez4/transform": "^0.27.0",
|
|
55
|
+
"@ez4/utils": "^0.27.0",
|
|
56
|
+
"@ez4/validator": "^0.27.0"
|
|
58
57
|
}
|
|
59
58
|
}
|