@ez4/gateway 0.19.0 → 0.20.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.
@@ -1,4 +1,7 @@
1
- import { IncompleteTypeError } from '@ez4/common/library';
1
+ import { IncompleteTypeError, TypeError } from '@ez4/common/library';
2
2
  export declare class IncompleteRouteError extends IncompleteTypeError {
3
3
  constructor(properties: string[], fileName?: string);
4
4
  }
5
+ export declare class InvalidRouteErrorTypeError extends TypeError {
6
+ constructor(fileName?: string);
7
+ }
package/dist/library.cjs CHANGED
@@ -1,180 +1,189 @@
1
- "use strict";var ve=Object.defineProperty;var Dr=Object.getOwnPropertyDescriptor;var Br=Object.getOwnPropertyNames;var Fr=Object.prototype.hasOwnProperty;var Ur=(e,t)=>{for(var r in t)ve(e,r,{get:t[r],enumerable:!0})},Nr=(e,t,r,n)=>{if(t&&
2
- typeof t=="object"||typeof t=="function")for(let o of Br(t))!Fr.call(e,o)&&o!==r&&
3
- ve(e,o,{get:()=>t[o],enumerable:!(n=Dr(t,o))||n.enumerable});return e};var Vr=e=>Nr(ve({},"__esModule",{value:!0}),e);var pt={};Ur(pt,{IncompleteAuthorizerError:()=>k,IncompleteCacheError:()=>re,IncompleteCorsError:()=>$,
4
- IncompleteHandlerError:()=>_,IncompleteRouteError:()=>C,IncompleteServiceError:()=>w,
5
- IncorrectBodyTypeError:()=>F,IncorrectCacheTypeError:()=>oe,IncorrectCorsTypeError:()=>ee,
6
- IncorrectDefaultsTypeError:()=>z,IncorrectHeadersTypeError:()=>Q,IncorrectIdentityTypeError:()=>N,
7
- IncorrectParameterTypeError:()=>W,IncorrectQueryTypeError:()=>Z,IncorrectRequestTypeError:()=>Y,
8
- IncorrectResponseTypeError:()=>D,InvalidBodyTypeError:()=>B,InvalidCacheTypeError:()=>te,
9
- InvalidCorsTypeError:()=>L,InvalidDefaultsTypeError:()=>P,InvalidHeadersTypeError:()=>V,
10
- InvalidIdentityTypeError:()=>U,InvalidParameterTypeError:()=>K,InvalidQueryTypeError:()=>X,
11
- InvalidRequestTypeError:()=>G,InvalidResponseTypeError:()=>q,ServiceType:()=>ne,
12
- getHttpAuthRequest:()=>Ce,getHttpAuthResponse:()=>Oe,getHttpAuthorizer:()=>qe,getHttpCache:()=>Ne,
13
- getHttpCors:()=>Fe,getHttpHandler:()=>De,getHttpHandlerRequest:()=>ke,getHttpHandlerResponse:()=>we,
14
- getHttpHeaders:()=>J,getHttpIdentity:()=>A,getHttpParameters:()=>Pe,getHttpQuery:()=>ze,
15
- getHttpRequestBody:()=>Ee,getHttpResponseBody:()=>je,getHttpRoutes:()=>Be,getHttpServices:()=>Ve,
16
- isHttpService:()=>Qr,registerTriggers:()=>nt});module.exports=Vr(pt);var Cr=require("@ez4/common/library"),kr=require("@ez4/schema/library"),qr=require("@ez4/project/library");var d=require("@ez4/common/library"),Pr=require("@ez4/reflection");var ne="@ez4/http",Qr=e=>e.type===ne;var Qe=require("@ez4/common/library"),w=class extends Qe.IncompleteTypeError{constructor(t,r){
17
- super("Incomplete service",t,r)}};var a=require("@ez4/common/library"),S=require("@ez4/reflection");var u=require("@ez4/common/library"),b=require("@ez4/reflection"),Jr=new Set(["A\
18
- NY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),Je=e=>{let[t]=e.split(" ",2);
19
- return Jr.has(t)},Ge=e=>(0,u.isClassDeclaration)(e)&&(0,u.hasHeritageType)(e,"Ht\
20
- tp.Service"),Ye=e=>(0,u.isModelDeclaration)(e)&&(0,u.hasHeritageType)(e,"Http.Ro\
21
- ute");var Ke=e=>(0,u.hasHeritageType)(e,"Http.Defaults"),We=e=>(0,u.hasHeritageType)(e,
22
- "Http.Headers"),Xe=e=>(0,u.hasHeritageType)(e,"Http.Identity"),Ze=e=>(0,u.hasHeritageType)(
23
- e,"Http.QueryStrings"),_e=e=>(0,u.hasHeritageType)(e,"Http.PathParameters"),$e=e=>(0,u.hasHeritageType)(
24
- e,"Http.JsonBody"),Le=e=>(0,u.hasHeritageType)(e,"Http.Cors"),er=e=>(0,u.hasHeritageType)(
25
- e,"Http.Cache"),rr=e=>(0,b.isTypeCallback)(e)||(0,b.isTypeFunction)(e),tr=e=>(0,b.isTypeCallback)(
26
- e)||(0,b.isTypeFunction)(e);var pr=(e,t,r,n)=>{if(!(0,S.isTypeReference)(e))return or(e,t,n);let o=(0,a.getReferenceType)(
27
- e,r);return o?or(o,t,n):null},or=(e,t,r)=>(0,S.isTypeObject)(e)?nr(t,(0,a.getObjectMembers)(
28
- e),r):(0,a.isModelDeclaration)(e)?Ke(e)?nr(t,(0,a.getModelMembers)(e),r):(r.push(
29
- new z(e.name,t.file)),null):(r.push(new P(t.file)),null),nr=(e,t,r)=>{let n={};for(let o of t)
30
- if(!(!(0,S.isModelProperty)(o)||o.inherited))switch(o.name){default:r.push(new a.InvalidServicePropertyError(
31
- e.name,o.name,e.file));break;case"memory":case"timeout":case"retention":n[o.name]=
32
- (0,a.getPropertyNumber)(o);break;case"listener":n.listener=(0,a.getServiceListener)(
33
- o.value,r);break}return n};var H=require("@ez4/reflection"),c=require("@ez4/common/library");var sr=require("@ez4/common/library"),C=class extends sr.IncompleteTypeError{constructor(t,r){
34
- super("Incomplete gateway route",t,r)}};var ir=require("@ez4/common/library"),k=class extends ir.IncompleteTypeError{constructor(t,r){
35
- super("Incomplete route authorizer",t,r)}};var f=require("@ez4/common/library"),I=require("@ez4/reflection"),yr=require("@ez4/utils");var pe=require("@ez4/common/library"),q=class extends pe.InvalidTypeError{constructor(r,n){
36
- super("Invalid route response",void 0,r,n);this.baseType=r}},D=class extends pe.IncorrectTypeError{constructor(r,n,o){
37
- super("Incorrect route response",r,n,o);this.responseType=r;this.baseType=n}};var y=require("@ez4/reflection"),h=require("@ez4/schema/library"),ce=require("@ez4/common/library");var se=require("@ez4/common/library"),B=class extends se.InvalidTypeError{constructor(t){
38
- super("Invalid body",void 0,"Http.JsonBody",t)}},F=class extends se.IncorrectTypeError{constructor(r,n){
39
- super("Incorrect body",r,"Http.JsonBody",n);this.bodyType=r}};var Ee=(e,t,r,n)=>le(e,r,o=>ie(o,t,r,n)),je=(e,t,r,n)=>le(e,r,o=>Re(o)??ie(o,t,r,
40
- n)),le=(e,t,r)=>{if((0,y.isTypeUndefined)(e))return null;if(!(0,y.isTypeReference)(
41
- e))return r(e);let n=(0,ce.getReferenceType)(e,t);return n?r(n):null},Re=e=>(0,y.isTypeScalar)(
42
- e)?(0,h.getScalarSchema)(e):null,ie=(e,t,r,n)=>(0,y.isTypeUnion)(e)?Gr(e.elements,
43
- r,o=>Re(o)??ie(o,t,r,n)):(0,y.isTypeArray)(e)?Yr(e.element,r,o=>Re(o)??ie(o,t,r,
44
- n)):(0,y.isTypeObject)(e)?cr(e,r):(0,ce.isModelDeclaration)(e)?$e(e)?cr(e,r):(n.
45
- push(new F(e.name,e.file)),null):(n.push(new B(t.file)),null),Gr=(e,t,r)=>{let n=[];
46
- for(let o of e){let p=le(o,t,r);p&&n.push(p)}return n.length?(0,h.createUnionSchema)(
47
- {elements:n}):null},Yr=(e,t,r)=>{let n=le(e,t,r);return n?(0,h.createArraySchema)(
48
- {element:n}):null},cr=(e,t)=>{let r=(0,h.getObjectSchema)(e,t);return r&&(0,h.isObjectSchema)(
49
- r)?r:null};var M=require("@ez4/reflection"),x=require("@ez4/schema/library"),ue=require("@ez4/common/library");var me=require("@ez4/common/library"),U=class extends me.InvalidTypeError{constructor(t){
50
- super("Invalid identity",void 0,"Http.Identity",t)}},N=class extends me.IncorrectTypeError{constructor(r,n){
51
- super("Incorrect identity",r,"Http.Identity",n);this.identityType=r}};var A=(e,t,r,n)=>{if((0,M.isTypeUndefined)(e))return null;if(!(0,M.isTypeReference)(
52
- e))return lr(e,t,r,n);let o=(0,ue.getReferenceType)(e,r);return o?lr(o,t,r,n):null},
53
- lr=(e,t,r,n)=>{if((0,M.isTypeUnion)(e))return Kr(e.elements,t,r,n);if((0,M.isTypeObject)(
54
- e))return mr(e,r);if(!(0,ue.isModelDeclaration)(e))return n.push(new U(t.file)),
55
- null;if(!Xe(e))return n.push(new N(e.name,t.file)),null;let o=mr(e,r);return o&&
56
- (o.definitions={...o.definitions,extensible:!0}),o},Kr=(e,t,r,n)=>{let o=[];for(let p of e){
57
- let s=A(p,t,r,n);s&&o.push(s)}return o.length>1?(0,x.createUnionSchema)({elements:o}):
58
- o[0]},mr=(e,t)=>{let r=(0,x.getObjectSchema)(e,t);return r&&(0,x.isObjectSchema)(
59
- r)?r:null};var fe=require("@ez4/common/library"),de=require("@ez4/schema/library"),ye=require("@ez4/reflection");var ae=require("@ez4/common/library"),V=class extends ae.InvalidTypeError{constructor(t){
60
- super("Invalid headers",void 0,"Http.Headers",t)}},Q=class extends ae.IncorrectTypeError{constructor(r,n){
61
- super("Incorrect headers",r,"Http.Headers",n);this.headersType=r}};var J=(e,t,r,n)=>{if(!(0,ye.isTypeReference)(e))return ur(e,t,r,n);let o=(0,fe.getReferenceType)(
62
- e,r);return o?ur(o,t,r,n):null},ur=(e,t,r,n)=>(0,ye.isTypeObject)(e)?ar(e,r):(0,fe.isModelDeclaration)(
63
- e)?We(e)?ar(e,r):(n.push(new Q(e.name,t.file)),null):(n.push(new V(t.file)),null),
64
- ar=(e,t)=>{let r=(0,de.getObjectSchema)(e,t);return r&&(0,de.isObjectSchema)(r)?
65
- r:null};var Oe=(e,t,r,n)=>{let o=Tr(e,t,r,n,"Http.AuthResponse");return o&&Wr(o)?o:null},
66
- we=(e,t,r,n)=>{let o=Tr(e,t,r,n,"Http.Response");return o&&Xr(o)?o:null},Tr=(e,t,r,n,o)=>{
67
- if(!(0,I.isTypeReference)(e))return fr(e,t,r,n,o);let p=(0,f.getReferenceType)(e,
68
- r);return p?fr(p,t,r,n,o):null},Wr=e=>!!e.identity,Xr=e=>(0,yr.isAnyNumber)(e.status),
69
- fr=(e,t,r,n,o)=>(0,I.isTypeObject)(e)?dr(e,t,(0,f.getObjectMembers)(e),r,n):(0,f.isModelDeclaration)(
70
- e)?(0,f.hasHeritageType)(e,o)?dr(e,t,(0,f.getModelMembers)(e),r,n):(n.push(new D(
71
- e.name,o,e.file)),null):(n.push(new q(o,t.file)),null),dr=(e,t,r,n,o)=>{let p={};
72
- for(let s of r)if(!(!(0,I.isModelProperty)(s)||s.inherited))switch(s.name){default:
73
- o.push(new f.InvalidServicePropertyError(t.name,s.name,e.file));break;case"statu\
74
- s":p.status=(0,f.getPropertyNumber)(s);break;case"headers":{p.headers=J(s.value,
75
- e,n,o),p.headers&&s.description&&(p.headers.description=s.description);break}case"\
76
- identity":{p.identity=A(s.value,e,n,o),p.identity&&s.description&&(p.identity.description=
77
- s.description);break}case"body":{p.body=je(s.value,e,n,o),p.body&&s.description&&
78
- (p.body.description=s.description);break}}return p};var T=require("@ez4/common/library"),v=require("@ez4/reflection");var Te=require("@ez4/common/library"),G=class extends Te.InvalidTypeError{constructor(r,n){
79
- super("Invalid route request",void 0,r,n);this.baseType=r}},Y=class extends Te.IncorrectTypeError{constructor(r,n,o){
80
- super("Incorrect route request",r,n,o);this.requestType=r;this.baseType=n}};var he=require("@ez4/common/library"),Me=require("@ez4/schema/library"),He=require("@ez4/reflection");var ge=require("@ez4/common/library"),K=class extends ge.InvalidTypeError{constructor(t){
81
- super("Invalid request parameters",void 0,"Http.PathParameters",t)}},W=class extends ge.IncorrectTypeError{constructor(r,n){
82
- super("Incorrect request parameters",r,"Http.PathParameters",n);this.parametersType=
83
- r}};var Pe=(e,t,r,n)=>{if(!(0,He.isTypeReference)(e))return gr(e,t,r,n);let o=(0,he.getReferenceType)(
84
- e,r);return o?gr(o,t,r,n):null},gr=(e,t,r,n)=>(0,He.isTypeObject)(e)?hr(e,r):(0,he.isModelDeclaration)(
85
- e)?_e(e)?hr(e,r):(n.push(new W(e.name,e.file)),null):(n.push(new K(t.file)),null),
86
- hr=(e,t)=>{let r=(0,Me.getObjectSchema)(e,t);return r&&(0,Me.isObjectSchema)(r)?
87
- r:null};var Se=require("@ez4/common/library"),xe=require("@ez4/schema/library"),Ae=require("@ez4/reflection");var be=require("@ez4/common/library"),X=class extends be.InvalidTypeError{constructor(t){
88
- super("Invalid request query strings",void 0,"Http.QueryStrings",t)}},Z=class extends be.IncorrectTypeError{constructor(r,n){
89
- super("Incorrect request query strings",r,"Http.QueryStrings",n);this.queryType=
90
- r}};var ze=(e,t,r,n)=>{if(!(0,Ae.isTypeReference)(e))return Mr(e,t,r,n);let o=(0,Se.getReferenceType)(
91
- e,r);return o?Mr(o,t,r,n):null},Mr=(e,t,r,n)=>(0,Ae.isTypeObject)(e)?Hr(e,r):(0,Se.isModelDeclaration)(
92
- e)?Ze(e)?Hr(e,r):(n.push(new Z(e.name,t.file)),null):(n.push(new X(t.file)),null),
93
- Hr=(e,t)=>{let r=(0,xe.getObjectSchema)(e,t);return r&&(0,xe.isObjectSchema)(r)?
94
- r:null};var Ce=(e,t,r,n)=>xr(e,t,r,n,"Http.AuthRequest"),ke=(e,t,r,n)=>xr(e,t,r,n,"Http.\
95
- Request"),xr=(e,t,r,n,o)=>{if(!(0,v.isTypeReference)(e))return br(e,t,r,n,o);let p=(0,T.getReferenceType)(
96
- e,r);return p?br(p,t,r,n,o):null},br=(e,t,r,n,o)=>(0,v.isTypeObject)(e)?Sr(e,t,(0,T.getObjectMembers)(
97
- e),r,n):(0,T.isModelDeclaration)(e)?(0,T.hasHeritageType)(e,o)?Sr(e,t,(0,T.getModelMembers)(
98
- e),r,n):(n.push(new Y(e.name,o,e.file)),null):(n.push(new G(o,t.file)),null),Sr=(e,t,r,n,o)=>{
99
- let p={};for(let s of r)if(!(!(0,v.isModelProperty)(s)||s.inherited))switch(s.name){default:
100
- o.push(new T.InvalidServicePropertyError(t.name,s.name,e.file));break;case"heade\
101
- rs":{p.headers=J(s.value,e,n,o),p.headers&&s.description&&(p.headers.description=
102
- s.description);break}case"identity":{p.identity=A(s.value,e,n,o),p.identity&&s.description&&
103
- (p.identity.description=s.description);break}case"query":{p.query=ze(s.value,e,n,
104
- o),p.query&&s.description&&(p.query.description=s.description);break}case"parame\
105
- ters":{p.parameters=Pe(s.value,e,n,o),p.parameters&&s.description&&(p.parameters.
106
- description=s.description);break}case"body":{p.body=Ee(s.value,e,n,o),p.body&&s.
107
- description&&(p.body.description=s.description);break}}return p};var qe=(e,t,r,n)=>{if(!rr(e))return null;let o={},p=new Set(["name","file"]);if(e.
108
- description&&(o.description=e.description),(o.name=e.name)&&p.delete("name"),(o.
109
- file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;o.request=
110
- Ce(s,t,r,n)}return e.return&&(o.response=Oe(e.return,t,r,n)),Zr(o)?o:(n.push(new k(
111
- [...p],e.file)),null)},Zr=e=>!!e.name&&!!e.file;var Ar=require("@ez4/common/library"),_=class extends Ar.IncompleteTypeError{constructor(t,r){
112
- super("Incomplete route handler",t,r)}};var De=(e,t,r,n)=>{if(!tr(e))return null;let o={},p=new Set(["name","file","resp\
113
- onse"]);if(e.description&&(o.description=e.description),(o.name=e.name)&&p.delete(
114
- "name"),(o.file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;
115
- o.request=ke(s,t,r,n)}if(e.return){let s=we(e.return,t,r,n);s&&(o.response=s,p.delete(
116
- "response"))}return _r(o)?o:(n.push(new _([...p],e.file)),null)},_r=e=>!!e.name&&
117
- !!e.file&&!!e.response;var Be=(e,t,r,n)=>{let o=(0,c.getPropertyTuple)(t)??[];return Rr(o,e,r,n)},Rr=(e,t,r,n)=>{
118
- let o=[];for(let p of e){let s=$r(p,t,r,n);Array.isArray(s)?o.push(...s):s&&o.push(
119
- s)}return o},$r=(e,t,r,n)=>{if(!(0,H.isTypeReference)(e))return Ir(e,t,r,n);let o=(0,c.getReferenceType)(
120
- e,r);return o?Ir(o,t,r,n):null},Lr=e=>!!e.path&&!!e.handler,Ir=(e,t,r,n)=>Ye(e)?
121
- vr(e,t,(0,c.getModelMembers)(e),r,n):(0,H.isTypeObject)(e)?vr(e,t,(0,c.getObjectMembers)(
122
- e),r,n):(0,H.isTypeTuple)(e)&&e.spread?Rr(e.elements,t,r,n):null,vr=(e,t,r,n,o)=>{
123
- let p={},s=new Set(["path","handler"]);for(let i of r)if(!(!(0,H.isModelProperty)(
124
- i)||i.inherited))switch(i.name){default:o.push(new c.InvalidServicePropertyError(
125
- t.name,i.name,e.file));break;case"path":{let m=(0,c.getPropertyString)(i);m&&Je(
126
- m)&&(s.delete(i.name),p.path=m);break}case"handler":(p.handler=De(i.value,t,n,o))&&
127
- s.delete(i.name);break;case"memory":case"timeout":case"retention":p[i.name]=(0,c.getPropertyNumber)(
128
- i);break;case"cors":p.cors=(0,c.getPropertyBoolean)(i);break;case"authorizer":p.
129
- authorizer=qe(i.value,t,n,o);break;case"listener":p.listener=(0,c.getServiceListener)(
130
- i.value,o);break;case"variables":p.variables=(0,c.getLinkedVariableList)(i,o);break}
131
- return Lr(p)?p:(o.push(new C([...s],e.file)),null)};var l=require("@ez4/common/library"),E=require("@ez4/reflection");var R=require("@ez4/common/library"),$=class extends R.IncompleteTypeError{constructor(t,r){
132
- super("Incomplete HTTP CORS",t,r)}},L=class extends R.InvalidTypeError{constructor(t){
133
- super("Invalid HTTP CORS type",void 0,"Http.Cors",t)}},ee=class extends R.IncorrectTypeError{constructor(r,n){
134
- super("Incorrect HTTP CORS type",r,"Http.Cors",n);this.fallbackType=r}};var Fe=(e,t,r,n)=>{if(!(0,E.isTypeReference)(e))return Er(e,t,n);let o=(0,l.getReferenceType)(
135
- e,r);return o?Er(o,t,n):null},et=e=>!!e.allowOrigins?.length,Er=(e,t,r)=>(0,E.isTypeObject)(
136
- e)?jr(e,t,(0,l.getObjectMembers)(e),r):(0,l.isModelDeclaration)(e)?Le(e)?jr(e,t,
137
- (0,l.getModelMembers)(e),r):(r.push(new ee(e.name,e.file)),null):(r.push(new L(t.
138
- file)),null),jr=(e,t,r,n)=>{let o={},p=new Set(["allowOrigins"]);for(let s of r)
139
- if(!(!(0,E.isModelProperty)(s)||s.inherited))switch(s.name){default:n.push(new l.InvalidServicePropertyError(
1
+ "use strict";var je=Object.defineProperty;var Dr=Object.getOwnPropertyDescriptor;var Fr=Object.getOwnPropertyNames;var Br=Object.prototype.hasOwnProperty;var Nr=(e,t)=>{for(var r in t)je(e,r,{get:t[r],enumerable:!0})},Ur=(e,t,r,o)=>{if(t&&
2
+ typeof t=="object"||typeof t=="function")for(let n of Fr(t))!Br.call(e,n)&&n!==r&&
3
+ je(e,n,{get:()=>t[n],enumerable:!(o=Dr(t,n))||o.enumerable});return e};var Vr=e=>Ur(je({},"__esModule",{value:!0}),e);var st={};Nr(st,{IncompleteAuthorizerError:()=>U,IncompleteCacheError:()=>ie,IncompleteCorsError:()=>ne,
4
+ IncompleteHandlerError:()=>oe,IncompleteRouteError:()=>N,IncompleteServiceError:()=>D,
5
+ IncorrectBodyTypeError:()=>G,IncorrectCacheTypeError:()=>le,IncorrectCorsTypeError:()=>se,
6
+ IncorrectDefaultsTypeError:()=>B,IncorrectHeadersTypeError:()=>X,IncorrectIdentityTypeError:()=>K,
7
+ IncorrectParameterTypeError:()=>ee,IncorrectQueryTypeError:()=>te,IncorrectRequestTypeError:()=>$,
8
+ IncorrectResponseTypeError:()=>Q,InvalidBodyTypeError:()=>J,InvalidCacheTypeError:()=>ce,
9
+ InvalidCorsTypeError:()=>pe,InvalidDefaultsTypeError:()=>F,InvalidHeadersTypeError:()=>W,
10
+ InvalidIdentityTypeError:()=>Y,InvalidParameterTypeError:()=>L,InvalidQueryTypeError:()=>re,
11
+ InvalidRequestTypeError:()=>_,InvalidResponseTypeError:()=>V,InvalidRouteErrorTypeError:()=>A,
12
+ ServiceType:()=>me,getHttpAuthRequest:()=>Fe,getHttpAuthResponse:()=>Ce,getHttpAuthorizer:()=>Ue,
13
+ getHttpCache:()=>Ye,getHttpCors:()=>Je,getHttpHandler:()=>Ve,getHttpHandlerRequest:()=>Be,
14
+ getHttpHandlerResponse:()=>ke,getHttpHeaders:()=>Z,getHttpIdentity:()=>R,getHttpParameters:()=>qe,
15
+ getHttpQuery:()=>De,getHttpRequestBody:()=>Oe,getHttpResponseBody:()=>ze,getHttpRoutes:()=>Qe,
16
+ getHttpServices:()=>Ke,isHttpService:()=>Qr,registerTriggers:()=>pt});module.exports=
17
+ Vr(st);var Cr=require("@ez4/common/library"),kr=require("@ez4/schema/library"),qr=require("@ez4/project/library");var T=require("@ez4/common/library"),Or=require("@ez4/reflection");var me="@ez4/http",Qr=e=>e.type===me;var We=require("@ez4/common/library"),D=class extends We.IncompleteTypeError{constructor(t,r){
18
+ super("Incomplete service",t,r)}};var f=require("@ez4/common/library"),E=require("@ez4/reflection");var a=require("@ez4/common/library"),I=require("@ez4/reflection"),Jr=new Set(["A\
19
+ NY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),Xe=e=>{let[t]=e.split(" ",2);
20
+ return Jr.has(t)},Ze=e=>(0,a.isClassDeclaration)(e)&&(0,a.hasHeritageType)(e,"Ht\
21
+ tp.Service"),_e=e=>(0,a.isModelDeclaration)(e)&&(0,a.hasHeritageType)(e,"Http.Ro\
22
+ ute");var $e=e=>(0,a.hasHeritageType)(e,"Http.Defaults"),Le=e=>(0,a.hasHeritageType)(e,
23
+ "Http.Headers"),er=e=>(0,a.hasHeritageType)(e,"Http.Identity"),rr=e=>(0,a.hasHeritageType)(
24
+ e,"Http.QueryStrings"),tr=e=>(0,a.hasHeritageType)(e,"Http.PathParameters"),or=e=>(0,a.hasHeritageType)(
25
+ e,"Http.JsonBody"),nr=e=>(0,a.hasHeritageType)(e,"Http.Cors"),pr=e=>(0,a.hasHeritageType)(
26
+ e,"Http.Cache"),sr=e=>(0,I.isTypeCallback)(e)||(0,I.isTypeFunction)(e),ir=e=>(0,I.isTypeCallback)(
27
+ e)||(0,I.isTypeFunction)(e);var h=require("@ez4/common/library"),ae=require("@ez4/utils"),b=require("@ez4/reflection");var ue=(e,t,r,o)=>{if(!(0,b.isTypeReference)(e))return cr(e,t,r,o);let n=(0,h.getReferenceType)(
28
+ e,r);return n?cr(n,t,r,o):null},cr=(e,t,r,o)=>(0,b.isTypeObject)(e)?Gr(e,t,(0,h.getObjectMembers)(
29
+ e),r,o):null,Gr=(e,t,r,o,n)=>{let p={};for(let s of r){if(!(0,b.isModelProperty)(
30
+ s)||s.inherited)continue;let i=parseInt(s.name,10);(0,ae.isAnyNumber)(i)||n.push(
31
+ new h.InvalidServicePropertyError(t.name,s.name,e.file));let c=Yr(s,i,t,o,n);c&&
32
+ Object.assign(p,c)}return(0,ae.isEmptyObject)(p)?null:p},Yr=(e,t,r,o,n)=>{let p=(0,h.getPropertyTuple)(
33
+ e)??[],s={};for(let i of p){if(!(0,b.isTypeReference)(i)){n.push(new A(r.file));
34
+ continue}let c=(0,h.getReferenceType)(i,o);if(!c||!(0,b.isTypeClass)(c)){n.push(
35
+ new A(r.file));continue}s[c.name]=t}return s};var ar=(e,t,r,o)=>{if(!(0,E.isTypeReference)(e))return lr(e,t,r,o);let n=(0,f.getReferenceType)(
36
+ e,r);return n?lr(n,t,r,o):null},lr=(e,t,r,o)=>(0,E.isTypeObject)(e)?mr(t,(0,f.getObjectMembers)(
37
+ e),r,o):(0,f.isModelDeclaration)(e)?$e(e)?mr(t,(0,f.getModelMembers)(e),r,o):(o.
38
+ push(new B(e.name,t.file)),null):(o.push(new F(t.file)),null),mr=(e,t,r,o)=>{let n={};
39
+ for(let p of t)if(!(!(0,E.isModelProperty)(p)||p.inherited))switch(p.name){default:
40
+ o.push(new f.InvalidServicePropertyError(e.name,p.name,e.file));break;case"httpE\
41
+ rrors":n.httpErrors=ue(p.value,e,r,o);break;case"memory":case"logRetention":case"\
42
+ timeout":n[p.name]=(0,f.getPropertyNumber)(p);break;case"listener":n.listener=(0,f.getServiceListener)(
43
+ p.value,o);break}return n};var x=require("@ez4/reflection"),l=require("@ez4/common/library");var fe=require("@ez4/common/library"),N=class extends fe.IncompleteTypeError{constructor(t,r){
44
+ super("Incomplete gateway route",t,r)}},A=class extends fe.TypeError{constructor(t){
45
+ super("Invalid route error type.",t)}};var ur=require("@ez4/common/library"),U=class extends ur.IncompleteTypeError{constructor(t,r){
46
+ super("Incomplete route authorizer",t,r)}};var d=require("@ez4/common/library"),j=require("@ez4/reflection"),Mr=require("@ez4/utils");var ye=require("@ez4/common/library"),V=class extends ye.InvalidTypeError{constructor(r,o){
47
+ super("Invalid route response",void 0,r,o);this.baseType=r}},Q=class extends ye.IncorrectTypeError{constructor(r,o,n){
48
+ super("Incorrect route response",r,o,n);this.responseType=r;this.baseType=o}};var v=require("@ez4/schema/library"),Me=require("@ez4/common/library"),y=require("@ez4/reflection");var de=require("@ez4/common/library"),J=class extends de.InvalidTypeError{constructor(t){
49
+ super("Invalid body",void 0,"Http.JsonBody",t)}},G=class extends de.IncorrectTypeError{constructor(r,o){
50
+ super("Incorrect body",r,"Http.JsonBody",o);this.bodyType=r}};var Te=require("@ez4/schema/library"),u=(e,t)=>{let r=(0,Te.getObjectSchema)(e,t);
51
+ return r&&(0,Te.isObjectSchema)(r)?r:null};var Oe=(e,t,r,o)=>He(e,r,n=>ge(n,t,r,o)),ze=(e,t,r,o)=>He(e,r,n=>we(n)??ge(n,t,r,
52
+ o)),He=(e,t,r)=>{if((0,y.isTypeUndefined)(e))return null;if(!(0,y.isTypeReference)(
53
+ e))return r(e);let o=(0,Me.getReferenceType)(e,t);return o?r(o):null},we=e=>(0,y.isTypeScalar)(
54
+ e)?(0,v.getScalarSchema)(e):null,ge=(e,t,r,o)=>(0,y.isTypeUnion)(e)?Kr(e.elements,
55
+ r,n=>we(n)??ge(n,t,r,o)):(0,y.isTypeArray)(e)?Wr(e.element,r,n=>we(n)??ge(n,t,r,
56
+ o)):(0,y.isTypeObject)(e)||(0,y.isTypeIntersection)(e)?u(e,r):(0,Me.isModelDeclaration)(
57
+ e)?or(e)?u(e,r):(o.push(new G(e.name,e.file)),null):(o.push(new J(t.file)),null),
58
+ Kr=(e,t,r)=>{let o=[];for(let n of e){let p=He(n,t,r);p&&o.push(p)}return o.length?
59
+ (0,v.createUnionSchema)({elements:o}):null},Wr=(e,t,r)=>{let o=He(e,t,r);return o?
60
+ (0,v.createArraySchema)({element:o}):null};var H=require("@ez4/reflection"),be=require("@ez4/common/library"),yr=require("@ez4/schema/library");var he=require("@ez4/common/library"),Y=class extends he.InvalidTypeError{constructor(t){
61
+ super("Invalid identity",void 0,"Http.Identity",t)}},K=class extends he.IncorrectTypeError{constructor(r,o){
62
+ super("Incorrect identity",r,"Http.Identity",o);this.identityType=r}};var R=(e,t,r,o)=>{if((0,H.isTypeUndefined)(e))return null;if(!(0,H.isTypeReference)(
63
+ e))return fr(e,t,r,o);let n=(0,be.getReferenceType)(e,r);return n?fr(n,t,r,o):null},
64
+ fr=(e,t,r,o)=>{if((0,H.isTypeUnion)(e))return Xr(e.elements,t,r,o);if((0,H.isTypeObject)(
65
+ e)||(0,H.isTypeIntersection)(e))return u(e,r);if(!(0,be.isModelDeclaration)(e))return o.
66
+ push(new Y(t.file)),null;if(!er(e))return o.push(new K(e.name,t.file)),null;let n=u(
67
+ e,r);return n&&(n.definitions={...n.definitions,extensible:!0}),n},Xr=(e,t,r,o)=>{
68
+ let n=[];for(let p of e){let s=R(p,t,r,o);s&&n.push(s)}return n.length>1?(0,yr.createUnionSchema)(
69
+ {elements:n}):n[0]};var P=require("@ez4/reflection"),xe=require("@ez4/common/library");var Se=require("@ez4/common/library"),W=class extends Se.InvalidTypeError{constructor(t){
70
+ super("Invalid headers",void 0,"Http.Headers",t)}},X=class extends Se.IncorrectTypeError{constructor(r,o){
71
+ super("Incorrect headers",r,"Http.Headers",o);this.headersType=r}};var Z=(e,t,r,o)=>{if(!(0,P.isTypeReference)(e))return dr(e,t,r,o);let n=(0,xe.getReferenceType)(
72
+ e,r);return n?dr(n,t,r,o):null},dr=(e,t,r,o)=>(0,P.isTypeObject)(e)||(0,P.isTypeIntersection)(
73
+ e)?u(e,r):(0,xe.isModelDeclaration)(e)?Le(e)?u(e,r):(o.push(new X(e.name,t.file)),
74
+ null):(o.push(new W(t.file)),null);var Ce=(e,t,r,o)=>{let n=Hr(e,t,r,o,"Http.AuthResponse");return n&&Zr(n)?n:null},
75
+ ke=(e,t,r,o)=>{let n=Hr(e,t,r,o,"Http.Response");return n&&_r(n)?n:null},Hr=(e,t,r,o,n)=>{
76
+ if(!(0,j.isTypeReference)(e))return Tr(e,t,r,o,n);let p=(0,d.getReferenceType)(e,
77
+ r);return p?Tr(p,t,r,o,n):null},Zr=e=>!!e.identity,_r=e=>(0,Mr.isAnyNumber)(e.status),
78
+ Tr=(e,t,r,o,n)=>(0,j.isTypeObject)(e)?gr(e,t,(0,d.getObjectMembers)(e),r,o):(0,d.isModelDeclaration)(
79
+ e)?(0,d.hasHeritageType)(e,n)?gr(e,t,(0,d.getModelMembers)(e),r,o):(o.push(new Q(
80
+ e.name,n,e.file)),null):(o.push(new V(n,t.file)),null),gr=(e,t,r,o,n)=>{let p={};
81
+ for(let s of r)if(!(!(0,j.isModelProperty)(s)||s.inherited))switch(s.name){default:
82
+ n.push(new d.InvalidServicePropertyError(t.name,s.name,e.file));break;case"statu\
83
+ s":p.status=(0,d.getPropertyNumber)(s);break;case"headers":{p.headers=Z(s.value,
84
+ e,o,n),p.headers&&s.description&&(p.headers.description=s.description);break}case"\
85
+ identity":{p.identity=R(s.value,e,o,n),p.identity&&s.description&&(p.identity.description=
86
+ s.description);break}case"body":{p.body=ze(s.value,e,o,n),p.body&&s.description&&
87
+ (p.body.description=s.description);break}}return p};var S=require("@ez4/reflection"),g=require("@ez4/common/library");var Ie=require("@ez4/common/library"),_=class extends Ie.InvalidTypeError{constructor(r,o){
88
+ super("Invalid route request",void 0,r,o);this.baseType=r}},$=class extends Ie.IncorrectTypeError{constructor(r,o,n){
89
+ super("Incorrect route request",r,o,n);this.requestType=r;this.baseType=o}};var w=require("@ez4/reflection"),Ee=require("@ez4/common/library");var Ae=require("@ez4/common/library"),L=class extends Ae.InvalidTypeError{constructor(t){
90
+ super("Invalid request parameters",void 0,"Http.PathParameters",t)}},ee=class extends Ae.IncorrectTypeError{constructor(r,o){
91
+ super("Incorrect request parameters",r,"Http.PathParameters",o);this.parametersType=
92
+ r}};var qe=(e,t,r,o)=>{if(!(0,w.isTypeReference)(e))return hr(e,t,r,o);let n=(0,Ee.getReferenceType)(
93
+ e,r);return n?hr(n,t,r,o):null},hr=(e,t,r,o)=>(0,w.isTypeObject)(e)||(0,w.isTypeIntersection)(
94
+ e)?u(e,r):(0,Ee.isModelDeclaration)(e)?tr(e)?u(e,r):(o.push(new ee(e.name,e.file)),
95
+ null):(o.push(new L(t.file)),null);var O=require("@ez4/reflection"),Re=require("@ez4/common/library");var ve=require("@ez4/common/library"),re=class extends ve.InvalidTypeError{constructor(t){
96
+ super("Invalid request query strings",void 0,"Http.QueryStrings",t)}},te=class extends ve.IncorrectTypeError{constructor(r,o){
97
+ super("Incorrect request query strings",r,"Http.QueryStrings",o);this.queryType=
98
+ r}};var De=(e,t,r,o)=>{if(!(0,O.isTypeReference)(e))return br(e,t,r,o);let n=(0,Re.getReferenceType)(
99
+ e,r);return n?br(n,t,r,o):null},br=(e,t,r,o)=>(0,O.isTypeObject)(e)||(0,O.isTypeIntersection)(
100
+ e)?u(e,r):(0,Re.isModelDeclaration)(e)?rr(e)?u(e,r):(o.push(new te(e.name,t.file)),
101
+ null):(o.push(new re(t.file)),null);var Fe=(e,t,r,o)=>Ne(e,t,r,o,"Http.AuthRequest"),Be=(e,t,r,o)=>Ne(e,t,r,o,"Http.\
102
+ Request"),Ne=(e,t,r,o,n)=>{if((0,S.isTypeIntersection)(e)&&e.elements.length>0)return Ne(
103
+ e.elements[0],t,r,o,n);if(!(0,S.isTypeReference)(e))return Sr(e,t,r,o,n);let p=(0,g.getReferenceType)(
104
+ e,r);return p?Sr(p,t,r,o,n):null},Sr=(e,t,r,o,n)=>(0,S.isTypeObject)(e)?xr(e,t,(0,g.getObjectMembers)(
105
+ e),r,o):(0,g.isModelDeclaration)(e)?(0,g.hasHeritageType)(e,n)?xr(e,t,(0,g.getModelMembers)(
106
+ e),r,o):(o.push(new $(e.name,n,e.file)),null):(o.push(new _(n,t.file)),null),xr=(e,t,r,o,n)=>{
107
+ let p={};for(let s of r)if(!(!(0,S.isModelProperty)(s)||s.inherited))switch(s.name){default:
108
+ n.push(new g.InvalidServicePropertyError(t.name,s.name,e.file));break;case"heade\
109
+ rs":{p.headers=Z(s.value,e,o,n),p.headers&&s.description&&(p.headers.description=
110
+ s.description);break}case"identity":{p.identity=R(s.value,e,o,n),p.identity&&s.description&&
111
+ (p.identity.description=s.description);break}case"query":{p.query=De(s.value,e,o,
112
+ n),p.query&&s.description&&(p.query.description=s.description);break}case"parame\
113
+ ters":{p.parameters=qe(s.value,e,o,n),p.parameters&&s.description&&(p.parameters.
114
+ description=s.description);break}case"body":{p.body=Oe(s.value,e,o,n),p.body&&s.
115
+ description&&(p.body.description=s.description);break}}return p};var Ue=(e,t,r,o)=>{if(!sr(e))return null;let n={},p=new Set(["name","file"]);if(e.
116
+ description&&(n.description=e.description),(n.name=e.name)&&p.delete("name"),(n.
117
+ file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;n.request=
118
+ Fe(s,t,r,o)}return e.return&&(n.response=Ce(e.return,t,r,o)),$r(n)?n:(o.push(new U(
119
+ [...p],e.file)),null)},$r=e=>!!e.name&&!!e.file;var Ir=require("@ez4/common/library"),oe=class extends Ir.IncompleteTypeError{constructor(t,r){
120
+ super("Incomplete route handler",t,r)}};var Ve=(e,t,r,o)=>{if(!ir(e))return null;let n={},p=new Set(["name","file","resp\
121
+ onse"]);if(e.description&&(n.description=e.description),(n.name=e.name)&&p.delete(
122
+ "name"),(n.file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;
123
+ n.request=Be(s,t,r,o)}if(e.return){let s=ke(e.return,t,r,o);s&&(n.response=s,p.delete(
124
+ "response"))}return Lr(n)?n:(o.push(new oe([...p],e.file)),null)},Lr=e=>!!e.name&&
125
+ !!e.file&&!!e.response;var Qe=(e,t,r,o)=>{let n=(0,l.getPropertyTuple)(t)??[];return vr(n,e,r,o)},vr=(e,t,r,o)=>{
126
+ let n=[];for(let p of e){let s=et(p,t,r,o);Array.isArray(s)?n.push(...s):s&&n.push(
127
+ s)}return n},et=(e,t,r,o)=>{if(!(0,x.isTypeReference)(e))return Ar(e,t,r,o);let n=(0,l.getReferenceType)(
128
+ e,r);return n?Ar(n,t,r,o):null},rt=e=>!!e.path&&!!e.handler,Ar=(e,t,r,o)=>_e(e)?
129
+ Er(e,t,(0,l.getModelMembers)(e),r,o):(0,x.isTypeObject)(e)?Er(e,t,(0,l.getObjectMembers)(
130
+ e),r,o):(0,x.isTypeTuple)(e)&&e.spread?vr(e.elements,t,r,o):null,Er=(e,t,r,o,n)=>{
131
+ let p={},s=new Set(["path","handler"]);for(let i of r)if(!(!(0,x.isModelProperty)(
132
+ i)||i.inherited))switch(i.name){default:n.push(new l.InvalidServicePropertyError(
133
+ t.name,i.name,e.file));break;case"path":{let c=(0,l.getPropertyString)(i);c&&Xe(
134
+ c)&&(s.delete(i.name),p.path=c);break}case"handler":(p.handler=Ve(i.value,t,o,n))&&
135
+ s.delete(i.name);break;case"authorizer":p.authorizer=Ue(i.value,t,o,n);break;case"\
136
+ httpErrors":p.httpErrors=ue(i.value,t,o,n);break;case"memory":case"logRetention":case"\
137
+ timeout":p[i.name]=(0,l.getPropertyNumber)(i);break;case"cors":p.cors=(0,l.getPropertyBoolean)(
138
+ i);break;case"listener":p.listener=(0,l.getServiceListener)(i.value,n);break;case"\
139
+ variables":p.variables=(0,l.getLinkedVariableList)(i,n);break}return rt(p)?p:(n.
140
+ push(new N([...s],e.file)),null)};var m=require("@ez4/common/library"),C=require("@ez4/reflection");var z=require("@ez4/common/library"),ne=class extends z.IncompleteTypeError{constructor(t,r){
141
+ super("Incomplete HTTP CORS",t,r)}},pe=class extends z.InvalidTypeError{constructor(t){
142
+ super("Invalid HTTP CORS type",void 0,"Http.Cors",t)}},se=class extends z.IncorrectTypeError{constructor(r,o){
143
+ super("Incorrect HTTP CORS type",r,"Http.Cors",o);this.fallbackType=r}};var Je=(e,t,r,o)=>{if(!(0,C.isTypeReference)(e))return Rr(e,t,o);let n=(0,m.getReferenceType)(
144
+ e,r);return n?Rr(n,t,o):null},tt=e=>!!e.allowOrigins?.length,Rr=(e,t,r)=>(0,C.isTypeObject)(
145
+ e)?Pr(e,t,(0,m.getObjectMembers)(e),r):(0,m.isModelDeclaration)(e)?nr(e)?Pr(e,t,
146
+ (0,m.getModelMembers)(e),r):(r.push(new se(e.name,e.file)),null):(r.push(new pe(
147
+ t.file)),null),Pr=(e,t,r,o)=>{let n={},p=new Set(["allowOrigins"]);for(let s of r)
148
+ if(!(!(0,C.isModelProperty)(s)||s.inherited))switch(s.name){default:o.push(new m.InvalidServicePropertyError(
140
149
  t.name,s.name,e.file));break;case"allowOrigins":case"allowMethods":case"allowHea\
141
- ders":case"exposeHeaders":o[s.name]=rt(s);break;case"allowCredentials":o.allowCredentials=
142
- (0,l.getPropertyBoolean)(s);break;case"maxAge":o.maxAge=(0,l.getPropertyNumber)(
143
- s);break}return et(o)?o:(n.push(new $([...p],e.file)),null)},rt=e=>{let t=(0,l.getPropertyTuple)(
144
- e)??[],r=[];for(let n of t){let o=(0,l.getLiteralString)(n);o&&r.push(o)}return r};var g=require("@ez4/common/library"),O=require("@ez4/reflection"),Ue=require("@ez4/utils");var j=require("@ez4/common/library"),re=class extends j.IncompleteTypeError{constructor(t,r){
145
- super("Incomplete gateway cache",t,r)}},te=class extends j.InvalidTypeError{constructor(t){
146
- super("Invalid gateway cache type",void 0,"Http.Cache",t)}},oe=class extends j.IncorrectTypeError{constructor(r,n){
147
- super("Incorrect gateway cache type",r,"Http.Cache",n);this.cacheType=r}};var Ne=(e,t,r,n)=>{if(!(0,O.isTypeReference)(e))return Or(e,t,n);let o=(0,g.getReferenceType)(
148
- e,r);return o?Or(o,t,n):null},tt=e=>(0,Ue.isAnyNumber)(e.authorizerTTL),Or=(e,t,r)=>(0,O.isTypeObject)(
149
- e)?wr(e,t,(0,g.getObjectMembers)(e),r):(0,g.isModelDeclaration)(e)?er(e)?wr(e,t,
150
- (0,g.getModelMembers)(e),r):(r.push(new oe(e.name,e.file)),null):(r.push(new te(
151
- t.file)),null),wr=(e,t,r,n)=>{let o={},p=new Set(["authorizerTTL"]);for(let s of r)
152
- if(!(!(0,O.isModelProperty)(s)||s.inherited))switch(s.name){default:n.push(new g.InvalidServicePropertyError(
153
- t.name,s.name,e.file));break;case"authorizerTTL":{let i=(0,g.getPropertyNumber)(
154
- s);(0,Ue.isAnyNumber)(i)&&(o[s.name]=i,p.delete(s.name));break}}return tt(o)?o:(n.
155
- push(new re([...p],e.file)),null)};var Ve=e=>{let t={},r=[];for(let n in e){let o=e[n];if(!Ge(o)||(0,d.isExternalStatement)(
156
- o))continue;let p={type:ne,extras:{}},s=new Set(["routes"]),i=o.file;p.name=o.name,
157
- o.description&&(p.description=o.description);for(let m of(0,d.getModelMembers)(o))
158
- if(!(!(0,Pr.isModelProperty)(m)||m.inherited))switch(m.name){default:r.push(new d.InvalidServicePropertyError(
159
- p.name,m.name,i));break;case"routes":(p.routes=Be(o,m,e,r))&&s.delete(m.name);break;case"\
160
- name":p.displayName=(0,d.getPropertyString)(m);break;case"defaults":p.defaults=pr(
161
- m.value,o,e,r);break;case"cors":p.cors=Fe(m.value,o,e,r);break;case"cache":p.cache=
162
- Ne(m.value,o,e,r);break;case"variables":p.variables=(0,d.getLinkedVariableList)(
163
- m,r);break;case"services":p.services=(0,d.getLinkedServiceList)(m,e,r);break}if(!ot(
164
- p)){r.push(new w([...s],i));continue}if(t[o.name]){r.push(new d.DuplicateServiceError(
165
- o.name,i));continue}t[o.name]=p}return{services:t,errors:r}},ot=e=>!!e.name&&!!e.
166
- routes&&!!e.extras;var zr=!1,nt=()=>{zr||((0,Cr.registerTriggers)(),(0,kr.registerTriggers)(),(0,qr.createTrigger)(
167
- "@ez4/gateway",{"metadata:getServices":Ve}),zr=!1)};var Ie=require("@ez4/common/library"),P=class extends Ie.InvalidTypeError{constructor(t){
168
- super("Invalid defaults",void 0,"Http.Defaults",t)}},z=class extends Ie.IncorrectTypeError{constructor(r,n){
169
- super("Incorrect defaults",r,"Http.Defaults",n);this.defaultsType=r}};0&&(module.exports={IncompleteAuthorizerError,IncompleteCacheError,IncompleteCorsError,
150
+ ders":case"exposeHeaders":n[s.name]=(0,m.getPropertyStringList)(s);break;case"al\
151
+ lowCredentials":n.allowCredentials=(0,m.getPropertyBoolean)(s);break;case"maxAge":
152
+ n.maxAge=(0,m.getPropertyNumber)(s);break}return tt(n)?n:(o.push(new ne([...p],e.
153
+ file)),null)};var M=require("@ez4/common/library"),q=require("@ez4/reflection"),Ge=require("@ez4/utils");var k=require("@ez4/common/library"),ie=class extends k.IncompleteTypeError{constructor(t,r){
154
+ super("Incomplete gateway cache",t,r)}},ce=class extends k.InvalidTypeError{constructor(t){
155
+ super("Invalid gateway cache type",void 0,"Http.Cache",t)}},le=class extends k.IncorrectTypeError{constructor(r,o){
156
+ super("Incorrect gateway cache type",r,"Http.Cache",o);this.cacheType=r}};var Ye=(e,t,r,o)=>{if(!(0,q.isTypeReference)(e))return jr(e,t,o);let n=(0,M.getReferenceType)(
157
+ e,r);return n?jr(n,t,o):null},ot=e=>(0,Ge.isAnyNumber)(e.authorizerTTL),jr=(e,t,r)=>(0,q.isTypeObject)(
158
+ e)?wr(e,t,(0,M.getObjectMembers)(e),r):(0,M.isModelDeclaration)(e)?pr(e)?wr(e,t,
159
+ (0,M.getModelMembers)(e),r):(r.push(new le(e.name,e.file)),null):(r.push(new ce(
160
+ t.file)),null),wr=(e,t,r,o)=>{let n={},p=new Set(["authorizerTTL"]);for(let s of r)
161
+ if(!(!(0,q.isModelProperty)(s)||s.inherited))switch(s.name){default:o.push(new M.InvalidServicePropertyError(
162
+ t.name,s.name,e.file));break;case"authorizerTTL":{let i=(0,M.getPropertyNumber)(
163
+ s);(0,Ge.isAnyNumber)(i)&&(n[s.name]=i,p.delete(s.name));break}}return ot(n)?n:(o.
164
+ push(new ie([...p],e.file)),null)};var Ke=e=>{let t={},r=[];for(let o in e){let n=e[o];if(!Ze(n)||(0,T.isExternalDeclaration)(
165
+ n))continue;let p={type:me,extras:{}},s=new Set(["routes"]),i=n.file;p.name=n.name,
166
+ n.description&&(p.description=n.description);for(let c of(0,T.getModelMembers)(n))
167
+ if(!(!(0,Or.isModelProperty)(c)||c.inherited))switch(c.name){default:r.push(new T.InvalidServicePropertyError(
168
+ p.name,c.name,i));break;case"routes":(p.routes=Qe(n,c,e,r))&&s.delete(c.name);break;case"\
169
+ name":p.displayName=(0,T.getPropertyString)(c);break;case"defaults":p.defaults=ar(
170
+ c.value,n,e,r);break;case"cache":p.cache=Ye(c.value,n,e,r);break;case"cors":p.cors=
171
+ Je(c.value,n,e,r);break;case"variables":p.variables=(0,T.getLinkedVariableList)(
172
+ c,r);break;case"services":p.services=(0,T.getLinkedServiceList)(c,e,r);break}if(!nt(
173
+ p)){r.push(new D([...s],i));continue}if(t[n.name]){r.push(new T.DuplicateServiceError(
174
+ n.name,i));continue}t[n.name]=p}return{services:t,errors:r}},nt=e=>!!e.name&&!!e.
175
+ routes&&!!e.extras;var zr=!1,pt=()=>{zr||((0,Cr.registerTriggers)(),(0,kr.registerTriggers)(),(0,qr.createTrigger)(
176
+ "@ez4/gateway",{"metadata:getServices":Ke}),zr=!1)};var Pe=require("@ez4/common/library"),F=class extends Pe.InvalidTypeError{constructor(t){
177
+ super("Invalid defaults",void 0,"Http.Defaults",t)}},B=class extends Pe.IncorrectTypeError{constructor(r,o){
178
+ super("Incorrect defaults",r,"Http.Defaults",o);this.defaultsType=r}};0&&(module.exports={IncompleteAuthorizerError,IncompleteCacheError,IncompleteCorsError,
170
179
  IncompleteHandlerError,IncompleteRouteError,IncompleteServiceError,IncorrectBodyTypeError,
171
180
  IncorrectCacheTypeError,IncorrectCorsTypeError,IncorrectDefaultsTypeError,IncorrectHeadersTypeError,
172
181
  IncorrectIdentityTypeError,IncorrectParameterTypeError,IncorrectQueryTypeError,IncorrectRequestTypeError,
173
182
  IncorrectResponseTypeError,InvalidBodyTypeError,InvalidCacheTypeError,InvalidCorsTypeError,
174
183
  InvalidDefaultsTypeError,InvalidHeadersTypeError,InvalidIdentityTypeError,InvalidParameterTypeError,
175
- InvalidQueryTypeError,InvalidRequestTypeError,InvalidResponseTypeError,ServiceType,
176
- getHttpAuthRequest,getHttpAuthResponse,getHttpAuthorizer,getHttpCache,getHttpCors,
177
- getHttpHandler,getHttpHandlerRequest,getHttpHandlerResponse,getHttpHeaders,getHttpIdentity,
178
- getHttpParameters,getHttpQuery,getHttpRequestBody,getHttpResponseBody,getHttpRoutes,
179
- getHttpServices,isHttpService,registerTriggers});
184
+ InvalidQueryTypeError,InvalidRequestTypeError,InvalidResponseTypeError,InvalidRouteErrorTypeError,
185
+ ServiceType,getHttpAuthRequest,getHttpAuthResponse,getHttpAuthorizer,getHttpCache,
186
+ getHttpCors,getHttpHandler,getHttpHandlerRequest,getHttpHandlerResponse,getHttpHeaders,
187
+ getHttpIdentity,getHttpParameters,getHttpQuery,getHttpRequestBody,getHttpResponseBody,
188
+ getHttpRoutes,getHttpServices,isHttpService,registerTriggers});
180
189
  //# sourceMappingURL=library.cjs.map
package/dist/library.mjs CHANGED
@@ -1,177 +1,183 @@
1
- import{registerTriggers as qo}from"@ez4/common/library";import{registerTriggers as Do}from"@ez4/schema/library";
2
- import{createTrigger as Bo}from"@ez4/project/library";import{DuplicateServiceError as Ro,isExternalStatement as Eo,getLinkedServiceList as jo,
3
- getLinkedVariableList as Oo,getModelMembers as wo,getPropertyString as Po,InvalidServicePropertyError as zo}from"@ez4/common/library";
4
- import{isModelProperty as Co}from"@ez4/reflection";var U="@ez4/http",No=e=>e.type===U;import{IncompleteTypeError as Je}from"@ez4/common/library";var u=class extends Je{constructor(t,r){
5
- super("Incomplete service",t,r)}};import{InvalidServicePropertyError as We,isModelDeclaration as Xe,getPropertyNumber as Ze,
6
- getObjectMembers as _e,getModelMembers as $e,getServiceListener as Le,getReferenceType as er}from"@ez4/common/library";
7
- import{isModelProperty as rr,isTypeObject as tr,isTypeReference as or}from"@ez4/reflection";import{hasHeritageType as l,isClassDeclaration as Ge,isModelDeclaration as Ye}from"@ez4/common/library";
8
- import{isTypeCallback as V,isTypeFunction as Q}from"@ez4/reflection";var Ke=new Set(
9
- ["ANY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),J=e=>{let[t]=e.split(" ",
10
- 2);return Ke.has(t)},G=e=>Ge(e)&&l(e,"Http.Service"),Y=e=>Ye(e)&&l(e,"Http.Route");var K=e=>l(e,"Http.Defaults"),W=e=>l(e,"Http.Headers"),X=e=>l(e,"Http.Identity"),
11
- Z=e=>l(e,"Http.QueryStrings"),_=e=>l(e,"Http.PathParameters"),$=e=>l(e,"Http.Jso\
12
- nBody"),L=e=>l(e,"Http.Cors"),ee=e=>l(e,"Http.Cache"),re=e=>V(e)||Q(e),te=e=>V(e)||
13
- Q(e);var pe=(e,t,r,n)=>{if(!or(e))return oe(e,t,n);let o=er(e,r);return o?oe(o,t,n):null},
14
- oe=(e,t,r)=>tr(e)?ne(t,_e(e),r):Xe(e)?K(e)?ne(t,$e(e),r):(r.push(new f(e.name,t.
15
- file)),null):(r.push(new a(t.file)),null),ne=(e,t,r)=>{let n={};for(let o of t)if(!(!rr(
16
- o)||o.inherited))switch(o.name){default:r.push(new We(e.name,o.name,e.file));break;case"\
17
- memory":case"timeout":case"retention":n[o.name]=Ze(o);break;case"listener":n.listener=
18
- Le(o.value,r);break}return n};import{isModelProperty as Ct,isTypeObject as kt,isTypeReference as qt,isTypeTuple as Dt}from"@ez4/reflection";
19
- import{InvalidServicePropertyError as Bt,getLinkedVariableList as Ft,getPropertyBoolean as Ut,
20
- getPropertyNumber as Nt,getPropertyString as Vt,getObjectMembers as Qt,getModelMembers as Jt,
21
- getServiceListener as Gt,getReferenceType as Yt,getPropertyTuple as Kt}from"@ez4/common/library";import{IncompleteTypeError as nr}from"@ez4/common/library";var d=class extends nr{constructor(t,r){
22
- super("Incomplete gateway route",t,r)}};import{IncompleteTypeError as pr}from"@ez4/common/library";var y=class extends pr{constructor(t,r){
23
- super("Incomplete route authorizer",t,r)}};import{InvalidServicePropertyError as Gr,isModelDeclaration as Yr,hasHeritageType as Kr,
24
- getModelMembers as Wr,getObjectMembers as Xr,getPropertyNumber as Zr,getReferenceType as _r}from"@ez4/common/library";
25
- import{isModelProperty as $r,isTypeObject as Lr,isTypeReference as et}from"@ez4/reflection";
26
- import{isAnyNumber as rt}from"@ez4/utils";import{IncorrectTypeError as sr,InvalidTypeError as ir}from"@ez4/common/library";
27
- var T=class extends ir{constructor(r,n){super("Invalid route response",void 0,r,
28
- n);this.baseType=r}},g=class extends sr{constructor(r,n,o){super("Incorrect rout\
29
- e response",r,n,o);this.responseType=r;this.baseType=n}};import{isTypeArray as mr,isTypeObject as ur,isTypeReference as ar,isTypeScalar as fr,
30
- isTypeUndefined as dr,isTypeUnion as yr}from"@ez4/reflection";import{isObjectSchema as Tr,
31
- createUnionSchema as gr,getObjectSchema as hr,getScalarSchema as Mr,createArraySchema as Hr}from"@ez4/schema/library";
32
- import{getReferenceType as br,isModelDeclaration as Sr}from"@ez4/common/library";import{IncorrectTypeError as cr,InvalidTypeError as lr}from"@ez4/common/library";
33
- var h=class extends lr{constructor(t){super("Invalid body",void 0,"Http.JsonBody",
34
- t)}},M=class extends cr{constructor(r,n){super("Incorrect body",r,"Http.JsonBody",
35
- n);this.bodyType=r}};var ie=(e,t,r,n)=>b(e,r,o=>H(o,t,r,n)),ce=(e,t,r,n)=>b(e,r,o=>N(o)??H(o,t,r,n)),
36
- b=(e,t,r)=>{if(dr(e))return null;if(!ar(e))return r(e);let n=br(e,t);return n?r(
37
- n):null},N=e=>fr(e)?Mr(e):null,H=(e,t,r,n)=>yr(e)?xr(e.elements,r,o=>N(o)??H(o,t,
38
- r,n)):mr(e)?Ar(e.element,r,o=>N(o)??H(o,t,r,n)):ur(e)?se(e,r):Sr(e)?$(e)?se(e,r):
39
- (n.push(new M(e.name,e.file)),null):(n.push(new h(t.file)),null),xr=(e,t,r)=>{let n=[];
40
- for(let o of e){let p=b(o,t,r);p&&n.push(p)}return n.length?gr({elements:n}):null},
41
- Ar=(e,t,r)=>{let n=b(e,t,r);return n?Hr({element:n}):null},se=(e,t)=>{let r=hr(e,
42
- t);return r&&Tr(r)?r:null};import{isTypeObject as Rr,isTypeReference as Er,isTypeUndefined as jr,isTypeUnion as Or}from"@ez4/reflection";
43
- import{createUnionSchema as wr,getObjectSchema as Pr,isObjectSchema as zr}from"@ez4/schema/library";
44
- import{getReferenceType as Cr,isModelDeclaration as kr}from"@ez4/common/library";import{IncorrectTypeError as Ir,InvalidTypeError as vr}from"@ez4/common/library";
45
- var S=class extends vr{constructor(t){super("Invalid identity",void 0,"Http.Iden\
46
- tity",t)}},x=class extends Ir{constructor(r,n){super("Incorrect identity",r,"Htt\
47
- p.Identity",n);this.identityType=r}};var m=(e,t,r,n)=>{if(jr(e))return null;if(!Er(e))return le(e,t,r,n);let o=Cr(e,r);
48
- return o?le(o,t,r,n):null},le=(e,t,r,n)=>{if(Or(e))return qr(e.elements,t,r,n);if(Rr(
49
- e))return me(e,r);if(!kr(e))return n.push(new S(t.file)),null;if(!X(e))return n.
50
- push(new x(e.name,t.file)),null;let o=me(e,r);return o&&(o.definitions={...o.definitions,
51
- extensible:!0}),o},qr=(e,t,r,n)=>{let o=[];for(let p of e){let s=m(p,t,r,n);s&&o.
52
- push(s)}return o.length>1?wr({elements:o}):o[0]},me=(e,t)=>{let r=Pr(e,t);return r&&
53
- zr(r)?r:null};import{getReferenceType as Fr,isModelDeclaration as Ur}from"@ez4/common/library";
54
- import{getObjectSchema as Nr,isObjectSchema as Vr}from"@ez4/schema/library";import{
55
- isTypeObject as Qr,isTypeReference as Jr}from"@ez4/reflection";import{IncorrectTypeError as Dr,InvalidTypeError as Br}from"@ez4/common/library";
56
- var A=class extends Br{constructor(t){super("Invalid headers",void 0,"Http.Heade\
57
- rs",t)}},I=class extends Dr{constructor(r,n){super("Incorrect headers",r,"Http.H\
58
- eaders",n);this.headersType=r}};var v=(e,t,r,n)=>{if(!Jr(e))return ue(e,t,r,n);let o=Fr(e,r);return o?ue(o,t,r,n):
59
- null},ue=(e,t,r,n)=>Qr(e)?ae(e,r):Ur(e)?W(e)?ae(e,r):(n.push(new I(e.name,t.file)),
60
- null):(n.push(new A(t.file)),null),ae=(e,t)=>{let r=Nr(e,t);return r&&Vr(r)?r:null};var ye=(e,t,r,n)=>{let o=ge(e,t,r,n,"Http.AuthResponse");return o&&tt(o)?o:null},
61
- Te=(e,t,r,n)=>{let o=ge(e,t,r,n,"Http.Response");return o&&ot(o)?o:null},ge=(e,t,r,n,o)=>{
62
- if(!et(e))return fe(e,t,r,n,o);let p=_r(e,r);return p?fe(p,t,r,n,o):null},tt=e=>!!e.
63
- identity,ot=e=>rt(e.status),fe=(e,t,r,n,o)=>Lr(e)?de(e,t,Xr(e),r,n):Yr(e)?Kr(e,o)?
64
- de(e,t,Wr(e),r,n):(n.push(new g(e.name,o,e.file)),null):(n.push(new T(o,t.file)),
65
- null),de=(e,t,r,n,o)=>{let p={};for(let s of r)if(!(!$r(s)||s.inherited))switch(s.
66
- name){default:o.push(new Gr(t.name,s.name,e.file));break;case"status":p.status=Zr(
67
- s);break;case"headers":{p.headers=v(s.value,e,n,o),p.headers&&s.description&&(p.
68
- headers.description=s.description);break}case"identity":{p.identity=m(s.value,e,
69
- n,o),p.identity&&s.description&&(p.identity.description=s.description);break}case"\
70
- body":{p.body=ce(s.value,e,n,o),p.body&&s.description&&(p.body.description=s.description);
71
- break}}return p};import{InvalidServicePropertyError as St,isModelDeclaration as xt,hasHeritageType as At,
72
- getModelMembers as It,getObjectMembers as vt,getReferenceType as Rt}from"@ez4/common/library";
73
- import{isModelProperty as Et,isTypeObject as jt,isTypeReference as Ot}from"@ez4/reflection";import{IncorrectTypeError as nt,InvalidTypeError as pt}from"@ez4/common/library";
74
- var R=class extends pt{constructor(r,n){super("Invalid route request",void 0,r,n);
75
- this.baseType=r}},E=class extends nt{constructor(r,n,o){super("Incorrect route r\
76
- equest",r,n,o);this.requestType=r;this.baseType=n}};import{getReferenceType as ct,isModelDeclaration as lt}from"@ez4/common/library";
77
- import{getObjectSchema as mt,isObjectSchema as ut}from"@ez4/schema/library";import{
78
- isTypeObject as at,isTypeReference as ft}from"@ez4/reflection";import{IncorrectTypeError as st,InvalidTypeError as it}from"@ez4/common/library";
79
- var j=class extends it{constructor(t){super("Invalid request parameters",void 0,
80
- "Http.PathParameters",t)}},O=class extends st{constructor(r,n){super("Incorrect \
81
- request parameters",r,"Http.PathParameters",n);this.parametersType=r}};var He=(e,t,r,n)=>{if(!ft(e))return he(e,t,r,n);let o=ct(e,r);return o?he(o,t,r,
82
- n):null},he=(e,t,r,n)=>at(e)?Me(e,r):lt(e)?_(e)?Me(e,r):(n.push(new O(e.name,e.file)),
83
- null):(n.push(new j(t.file)),null),Me=(e,t)=>{let r=mt(e,t);return r&&ut(r)?r:null};import{getReferenceType as Tt,isModelDeclaration as gt}from"@ez4/common/library";
84
- import{getObjectSchema as ht,isObjectSchema as Mt}from"@ez4/schema/library";import{
85
- isTypeObject as Ht,isTypeReference as bt}from"@ez4/reflection";import{IncorrectTypeError as dt,InvalidTypeError as yt}from"@ez4/common/library";
86
- var w=class extends yt{constructor(t){super("Invalid request query strings",void 0,
87
- "Http.QueryStrings",t)}},P=class extends dt{constructor(r,n){super("Incorrect re\
88
- quest query strings",r,"Http.QueryStrings",n);this.queryType=r}};var xe=(e,t,r,n)=>{if(!bt(e))return be(e,t,r,n);let o=Tt(e,r);return o?be(o,t,r,
89
- n):null},be=(e,t,r,n)=>Ht(e)?Se(e,r):gt(e)?Z(e)?Se(e,r):(n.push(new P(e.name,t.file)),
90
- null):(n.push(new w(t.file)),null),Se=(e,t)=>{let r=ht(e,t);return r&&Mt(r)?r:null};var ve=(e,t,r,n)=>Ee(e,t,r,n,"Http.AuthRequest"),Re=(e,t,r,n)=>Ee(e,t,r,n,"Http.\
91
- Request"),Ee=(e,t,r,n,o)=>{if(!Ot(e))return Ae(e,t,r,n,o);let p=Rt(e,r);return p?
92
- Ae(p,t,r,n,o):null},Ae=(e,t,r,n,o)=>jt(e)?Ie(e,t,vt(e),r,n):xt(e)?At(e,o)?Ie(e,t,
93
- It(e),r,n):(n.push(new E(e.name,o,e.file)),null):(n.push(new R(o,t.file)),null),
94
- Ie=(e,t,r,n,o)=>{let p={};for(let s of r)if(!(!Et(s)||s.inherited))switch(s.name){default:
95
- o.push(new St(t.name,s.name,e.file));break;case"headers":{p.headers=v(s.value,e,
96
- n,o),p.headers&&s.description&&(p.headers.description=s.description);break}case"\
97
- identity":{p.identity=m(s.value,e,n,o),p.identity&&s.description&&(p.identity.description=
98
- s.description);break}case"query":{p.query=xe(s.value,e,n,o),p.query&&s.description&&
99
- (p.query.description=s.description);break}case"parameters":{p.parameters=He(s.value,
100
- e,n,o),p.parameters&&s.description&&(p.parameters.description=s.description);break}case"\
101
- body":{p.body=ie(s.value,e,n,o),p.body&&s.description&&(p.body.description=s.description);
102
- break}}return p};var je=(e,t,r,n)=>{if(!re(e))return null;let o={},p=new Set(["name","file"]);if(e.
103
- description&&(o.description=e.description),(o.name=e.name)&&p.delete("name"),(o.
104
- file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;o.request=
105
- ve(s,t,r,n)}return e.return&&(o.response=ye(e.return,t,r,n)),wt(o)?o:(n.push(new y(
106
- [...p],e.file)),null)},wt=e=>!!e.name&&!!e.file;import{IncompleteTypeError as Pt}from"@ez4/common/library";var z=class extends Pt{constructor(t,r){
107
- super("Incomplete route handler",t,r)}};var Oe=(e,t,r,n)=>{if(!te(e))return null;let o={},p=new Set(["name","file","resp\
108
- onse"]);if(e.description&&(o.description=e.description),(o.name=e.name)&&p.delete(
109
- "name"),(o.file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;
110
- o.request=Re(s,t,r,n)}if(e.return){let s=Te(e.return,t,r,n);s&&(o.response=s,p.delete(
111
- "response"))}return zt(o)?o:(n.push(new z([...p],e.file)),null)},zt=e=>!!e.name&&
112
- !!e.file&&!!e.response;var ze=(e,t,r,n)=>{let o=Kt(t)??[];return Ce(o,e,r,n)},Ce=(e,t,r,n)=>{let o=[];for(let p of e){
113
- let s=Wt(p,t,r,n);Array.isArray(s)?o.push(...s):s&&o.push(s)}return o},Wt=(e,t,r,n)=>{
114
- if(!qt(e))return we(e,t,r,n);let o=Yt(e,r);return o?we(o,t,r,n):null},Xt=e=>!!e.
115
- path&&!!e.handler,we=(e,t,r,n)=>Y(e)?Pe(e,t,Jt(e),r,n):kt(e)?Pe(e,t,Qt(e),r,n):Dt(
116
- e)&&e.spread?Ce(e.elements,t,r,n):null,Pe=(e,t,r,n,o)=>{let p={},s=new Set(["pat\
117
- h","handler"]);for(let i of r)if(!(!Ct(i)||i.inherited))switch(i.name){default:o.
118
- push(new Bt(t.name,i.name,e.file));break;case"path":{let c=Vt(i);c&&J(c)&&(s.delete(
119
- i.name),p.path=c);break}case"handler":(p.handler=Oe(i.value,t,n,o))&&s.delete(i.
120
- name);break;case"memory":case"timeout":case"retention":p[i.name]=Nt(i);break;case"\
121
- cors":p.cors=Ut(i);break;case"authorizer":p.authorizer=je(i.value,t,n,o);break;case"\
122
- listener":p.listener=Gt(i.value,o);break;case"variables":p.variables=Ft(i,o);break}
123
- return Xt(p)?p:(o.push(new d([...s],e.file)),null)};import{InvalidServicePropertyError as Lt,isModelDeclaration as eo,getLiteralString as ro,
124
- getModelMembers as to,getObjectMembers as oo,getPropertyBoolean as no,getPropertyNumber as po,
125
- getPropertyTuple as so,getReferenceType as io}from"@ez4/common/library";import{isModelProperty as co,
126
- isTypeObject as lo,isTypeReference as mo}from"@ez4/reflection";import{IncompleteTypeError as Zt,IncorrectTypeError as _t,InvalidTypeError as $t}from"@ez4/common/library";
127
- var C=class extends Zt{constructor(t,r){super("Incomplete HTTP CORS",t,r)}},k=class extends $t{constructor(t){
128
- super("Invalid HTTP CORS type",void 0,"Http.Cors",t)}},q=class extends _t{constructor(r,n){
129
- super("Incorrect HTTP CORS type",r,"Http.Cors",n);this.fallbackType=r}};var De=(e,t,r,n)=>{if(!mo(e))return ke(e,t,n);let o=io(e,r);return o?ke(o,t,n):null},
130
- uo=e=>!!e.allowOrigins?.length,ke=(e,t,r)=>lo(e)?qe(e,t,oo(e),r):eo(e)?L(e)?qe(e,
131
- t,to(e),r):(r.push(new q(e.name,e.file)),null):(r.push(new k(t.file)),null),qe=(e,t,r,n)=>{
132
- let o={},p=new Set(["allowOrigins"]);for(let s of r)if(!(!co(s)||s.inherited))switch(s.
133
- name){default:n.push(new Lt(t.name,s.name,e.file));break;case"allowOrigins":case"\
134
- allowMethods":case"allowHeaders":case"exposeHeaders":o[s.name]=ao(s);break;case"\
135
- allowCredentials":o.allowCredentials=no(s);break;case"maxAge":o.maxAge=po(s);break}
136
- return uo(o)?o:(n.push(new C([...p],e.file)),null)},ao=e=>{let t=so(e)??[],r=[];
137
- for(let n of t){let o=ro(n);o&&r.push(o)}return r};import{InvalidServicePropertyError as go,isModelDeclaration as ho,getModelMembers as Mo,
138
- getObjectMembers as Ho,getPropertyNumber as bo,getReferenceType as So}from"@ez4/common/library";
139
- import{isModelProperty as xo,isTypeObject as Ao,isTypeReference as Io}from"@ez4/reflection";
140
- import{isAnyNumber as Ue}from"@ez4/utils";import{IncompleteTypeError as fo,IncorrectTypeError as yo,InvalidTypeError as To}from"@ez4/common/library";
141
- var D=class extends fo{constructor(t,r){super("Incomplete gateway cache",t,r)}},
142
- B=class extends To{constructor(t){super("Invalid gateway cache type",void 0,"Htt\
143
- p.Cache",t)}},F=class extends yo{constructor(r,n){super("Incorrect gateway cache\
144
- type",r,"Http.Cache",n);this.cacheType=r}};var Ne=(e,t,r,n)=>{if(!Io(e))return Be(e,t,n);let o=So(e,r);return o?Be(o,t,n):null},
145
- vo=e=>Ue(e.authorizerTTL),Be=(e,t,r)=>Ao(e)?Fe(e,t,Ho(e),r):ho(e)?ee(e)?Fe(e,t,Mo(
146
- e),r):(r.push(new F(e.name,e.file)),null):(r.push(new B(t.file)),null),Fe=(e,t,r,n)=>{
147
- let o={},p=new Set(["authorizerTTL"]);for(let s of r)if(!(!xo(s)||s.inherited))switch(s.
148
- name){default:n.push(new go(t.name,s.name,e.file));break;case"authorizerTTL":{let i=bo(
149
- s);Ue(i)&&(o[s.name]=i,p.delete(s.name));break}}return vo(o)?o:(n.push(new D([...p],
150
- e.file)),null)};var Ve=e=>{let t={},r=[];for(let n in e){let o=e[n];if(!G(o)||Eo(o))continue;let p={
151
- type:U,extras:{}},s=new Set(["routes"]),i=o.file;p.name=o.name,o.description&&(p.
152
- description=o.description);for(let c of wo(o))if(!(!Co(c)||c.inherited))switch(c.
153
- name){default:r.push(new zo(p.name,c.name,i));break;case"routes":(p.routes=ze(o,
154
- c,e,r))&&s.delete(c.name);break;case"name":p.displayName=Po(c);break;case"defaul\
155
- ts":p.defaults=pe(c.value,o,e,r);break;case"cors":p.cors=De(c.value,o,e,r);break;case"\
156
- cache":p.cache=Ne(c.value,o,e,r);break;case"variables":p.variables=Oo(c,r);break;case"\
157
- services":p.services=jo(c,e,r);break}if(!ko(p)){r.push(new u([...s],i));continue}
158
- if(t[o.name]){r.push(new Ro(o.name,i));continue}t[o.name]=p}return{services:t,errors:r}},
159
- ko=e=>!!e.name&&!!e.routes&&!!e.extras;var Qe=!1,ps=()=>{Qe||(qo(),Do(),Bo("@ez4/gateway",{"metadata:getServices":Ve}),
160
- Qe=!1)};import{IncorrectTypeError as Fo,InvalidTypeError as Uo}from"@ez4/common/library";
161
- var a=class extends Uo{constructor(t){super("Invalid defaults",void 0,"Http.Defa\
162
- ults",t)}},f=class extends Fo{constructor(r,n){super("Incorrect defaults",r,"Htt\
163
- p.Defaults",n);this.defaultsType=r}};export{y as IncompleteAuthorizerError,D as IncompleteCacheError,C as IncompleteCorsError,
164
- z as IncompleteHandlerError,d as IncompleteRouteError,u as IncompleteServiceError,
165
- M as IncorrectBodyTypeError,F as IncorrectCacheTypeError,q as IncorrectCorsTypeError,
166
- f as IncorrectDefaultsTypeError,I as IncorrectHeadersTypeError,x as IncorrectIdentityTypeError,
167
- O as IncorrectParameterTypeError,P as IncorrectQueryTypeError,E as IncorrectRequestTypeError,
168
- g as IncorrectResponseTypeError,h as InvalidBodyTypeError,B as InvalidCacheTypeError,
169
- k as InvalidCorsTypeError,a as InvalidDefaultsTypeError,A as InvalidHeadersTypeError,
170
- S as InvalidIdentityTypeError,j as InvalidParameterTypeError,w as InvalidQueryTypeError,
171
- R as InvalidRequestTypeError,T as InvalidResponseTypeError,U as ServiceType,ve as getHttpAuthRequest,
172
- ye as getHttpAuthResponse,je as getHttpAuthorizer,Ne as getHttpCache,De as getHttpCors,
173
- Oe as getHttpHandler,Re as getHttpHandlerRequest,Te as getHttpHandlerResponse,v as getHttpHeaders,
174
- m as getHttpIdentity,He as getHttpParameters,xe as getHttpQuery,ie as getHttpRequestBody,
175
- ce as getHttpResponseBody,ze as getHttpRoutes,Ve as getHttpServices,No as isHttpService,
176
- ps as registerTriggers};
1
+ import{registerTriggers as Jo}from"@ez4/common/library";import{registerTriggers as Go}from"@ez4/schema/library";
2
+ import{createTrigger as Yo}from"@ez4/project/library";import{DuplicateServiceError as ko,isExternalDeclaration as qo,getLinkedServiceList as Do,
3
+ getLinkedVariableList as Fo,getModelMembers as Bo,getPropertyString as No,InvalidServicePropertyError as Uo}from"@ez4/common/library";
4
+ import{isModelProperty as Vo}from"@ez4/reflection";var Q="@ez4/http",Xo=e=>e.type===Q;import{IncompleteTypeError as Ge}from"@ez4/common/library";var f=class extends Ge{constructor(t,r){
5
+ super("Incomplete service",t,r)}};import{InvalidServicePropertyError as pr,isModelDeclaration as sr,getPropertyNumber as ir,
6
+ getObjectMembers as cr,getModelMembers as lr,getServiceListener as mr,getReferenceType as ar}from"@ez4/common/library";
7
+ import{isModelProperty as ur,isTypeObject as fr,isTypeReference as yr}from"@ez4/reflection";import{hasHeritageType as m,isClassDeclaration as Ye,isModelDeclaration as Ke}from"@ez4/common/library";
8
+ import{isTypeCallback as Y,isTypeFunction as K}from"@ez4/reflection";var We=new Set(
9
+ ["ANY","GET","POST","PUT","PATCH","DELETE","OPTIONS"]),W=e=>{let[t]=e.split(" ",
10
+ 2);return We.has(t)},X=e=>Ye(e)&&m(e,"Http.Service"),Z=e=>Ke(e)&&m(e,"Http.Route");var _=e=>m(e,"Http.Defaults"),$=e=>m(e,"Http.Headers"),L=e=>m(e,"Http.Identity"),
11
+ ee=e=>m(e,"Http.QueryStrings"),re=e=>m(e,"Http.PathParameters"),te=e=>m(e,"Http.\
12
+ JsonBody"),oe=e=>m(e,"Http.Cors"),ne=e=>m(e,"Http.Cache"),pe=e=>Y(e)||K(e),se=e=>Y(
13
+ e)||K(e);import{InvalidServicePropertyError as Xe,getObjectMembers as Ze,getPropertyTuple as _e,
14
+ getReferenceType as ce}from"@ez4/common/library";import{isAnyNumber as $e,isEmptyObject as Le}from"@ez4/utils";
15
+ import{isModelProperty as er,isTypeClass as rr,isTypeObject as tr,isTypeReference as le}from"@ez4/reflection";var y=(e,t,r,o)=>{if(!le(e))return ie(e,t,r,o);let n=ce(e,r);return n?ie(n,t,r,o):
16
+ null},ie=(e,t,r,o)=>tr(e)?or(e,t,Ze(e),r,o):null,or=(e,t,r,o,n)=>{let p={};for(let s of r){
17
+ if(!er(s)||s.inherited)continue;let i=parseInt(s.name,10);$e(i)||n.push(new Xe(t.
18
+ name,s.name,e.file));let c=nr(s,i,t,o,n);c&&Object.assign(p,c)}return Le(p)?null:
19
+ p},nr=(e,t,r,o,n)=>{let p=_e(e)??[],s={};for(let i of p){if(!le(i)){n.push(new a(
20
+ r.file));continue}let c=ce(i,o);if(!c||!rr(c)){n.push(new a(r.file));continue}s[c.
21
+ name]=t}return s};var ue=(e,t,r,o)=>{if(!yr(e))return me(e,t,r,o);let n=ar(e,r);return n?me(n,t,r,
22
+ o):null},me=(e,t,r,o)=>fr(e)?ae(t,cr(e),r,o):sr(e)?_(e)?ae(t,lr(e),r,o):(o.push(
23
+ new T(e.name,t.file)),null):(o.push(new d(t.file)),null),ae=(e,t,r,o)=>{let n={};
24
+ for(let p of t)if(!(!ur(p)||p.inherited))switch(p.name){default:o.push(new pr(e.
25
+ name,p.name,e.file));break;case"httpErrors":n.httpErrors=y(p.value,e,r,o);break;case"\
26
+ memory":case"logRetention":case"timeout":n[p.name]=ir(p);break;case"listener":n.
27
+ listener=mr(p.value,o);break}return n};import{isModelProperty as Jt,isTypeObject as Gt,isTypeReference as Yt,isTypeTuple as Kt}from"@ez4/reflection";
28
+ import{InvalidServicePropertyError as Wt,getLinkedVariableList as Xt,getPropertyBoolean as Zt,
29
+ getPropertyNumber as _t,getPropertyString as $t,getObjectMembers as Lt,getModelMembers as eo,
30
+ getServiceListener as ro,getReferenceType as to,getPropertyTuple as oo}from"@ez4/common/library";import{IncompleteTypeError as dr,TypeError as Tr}from"@ez4/common/library";var g=class extends dr{constructor(t,r){
31
+ super("Incomplete gateway route",t,r)}},a=class extends Tr{constructor(t){super(
32
+ "Invalid route error type.",t)}};import{IncompleteTypeError as gr}from"@ez4/common/library";var M=class extends gr{constructor(t,r){
33
+ super("Incomplete route authorizer",t,r)}};import{InvalidServicePropertyError as tt,isModelDeclaration as ot,hasHeritageType as nt,
34
+ getModelMembers as pt,getObjectMembers as st,getPropertyNumber as it,getReferenceType as ct}from"@ez4/common/library";
35
+ import{isModelProperty as lt,isTypeObject as mt,isTypeReference as at}from"@ez4/reflection";
36
+ import{isAnyNumber as ut}from"@ez4/utils";import{IncorrectTypeError as Mr,InvalidTypeError as Hr}from"@ez4/common/library";
37
+ var H=class extends Hr{constructor(r,o){super("Invalid route response",void 0,r,
38
+ o);this.baseType=r}},h=class extends Mr{constructor(r,o,n){super("Incorrect rout\
39
+ e response",r,o,n);this.responseType=r;this.baseType=o}};import{createUnionSchema as Ir,getScalarSchema as Ar,createArraySchema as Er}from"@ez4/schema/library";
40
+ import{getReferenceType as vr,isModelDeclaration as Rr}from"@ez4/common/library";
41
+ import{isTypeArray as Pr,isTypeIntersection as jr,isTypeObject as wr,isTypeReference as Or,
42
+ isTypeScalar as zr,isTypeUndefined as Cr,isTypeUnion as kr}from"@ez4/reflection";import{IncorrectTypeError as hr,InvalidTypeError as br}from"@ez4/common/library";
43
+ var b=class extends br{constructor(t){super("Invalid body",void 0,"Http.JsonBody",
44
+ t)}},S=class extends hr{constructor(r,o){super("Incorrect body",r,"Http.JsonBody",
45
+ o);this.bodyType=r}};import{getObjectSchema as Sr,isObjectSchema as xr}from"@ez4/schema/library";var l=(e,t)=>{
46
+ let r=Sr(e,t);return r&&xr(r)?r:null};var fe=(e,t,r,o)=>I(e,r,n=>x(n,t,r,o)),ye=(e,t,r,o)=>I(e,r,n=>J(n)??x(n,t,r,o)),
47
+ I=(e,t,r)=>{if(Cr(e))return null;if(!Or(e))return r(e);let o=vr(e,t);return o?r(
48
+ o):null},J=e=>zr(e)?Ar(e):null,x=(e,t,r,o)=>kr(e)?qr(e.elements,r,n=>J(n)??x(n,t,
49
+ r,o)):Pr(e)?Dr(e.element,r,n=>J(n)??x(n,t,r,o)):wr(e)||jr(e)?l(e,r):Rr(e)?te(e)?
50
+ l(e,r):(o.push(new S(e.name,e.file)),null):(o.push(new b(t.file)),null),qr=(e,t,r)=>{
51
+ let o=[];for(let n of e){let p=I(n,t,r);p&&o.push(p)}return o.length?Ir({elements:o}):
52
+ null},Dr=(e,t,r)=>{let o=I(e,t,r);return o?Er({element:o}):null};import{isTypeIntersection as Nr,isTypeObject as Ur,isTypeReference as Vr,isTypeUndefined as Qr,
53
+ isTypeUnion as Jr}from"@ez4/reflection";import{getReferenceType as Gr,isModelDeclaration as Yr}from"@ez4/common/library";
54
+ import{createUnionSchema as Kr}from"@ez4/schema/library";import{IncorrectTypeError as Fr,InvalidTypeError as Br}from"@ez4/common/library";
55
+ var A=class extends Br{constructor(t){super("Invalid identity",void 0,"Http.Iden\
56
+ tity",t)}},E=class extends Fr{constructor(r,o){super("Incorrect identity",r,"Htt\
57
+ p.Identity",o);this.identityType=r}};var u=(e,t,r,o)=>{if(Qr(e))return null;if(!Vr(e))return de(e,t,r,o);let n=Gr(e,r);
58
+ return n?de(n,t,r,o):null},de=(e,t,r,o)=>{if(Jr(e))return Wr(e.elements,t,r,o);if(Ur(
59
+ e)||Nr(e))return l(e,r);if(!Yr(e))return o.push(new A(t.file)),null;if(!L(e))return o.
60
+ push(new E(e.name,t.file)),null;let n=l(e,r);return n&&(n.definitions={...n.definitions,
61
+ extensible:!0}),n},Wr=(e,t,r,o)=>{let n=[];for(let p of e){let s=u(p,t,r,o);s&&n.
62
+ push(s)}return n.length>1?Kr({elements:n}):n[0]};import{isTypeIntersection as _r,isTypeObject as $r,isTypeReference as Lr}from"@ez4/reflection";
63
+ import{getReferenceType as et,isModelDeclaration as rt}from"@ez4/common/library";import{IncorrectTypeError as Xr,InvalidTypeError as Zr}from"@ez4/common/library";
64
+ var v=class extends Zr{constructor(t){super("Invalid headers",void 0,"Http.Heade\
65
+ rs",t)}},R=class extends Xr{constructor(r,o){super("Incorrect headers",r,"Http.H\
66
+ eaders",o);this.headersType=r}};var P=(e,t,r,o)=>{if(!Lr(e))return Te(e,t,r,o);let n=et(e,r);return n?Te(n,t,r,o):
67
+ null},Te=(e,t,r,o)=>$r(e)||_r(e)?l(e,r):rt(e)?$(e)?l(e,r):(o.push(new R(e.name,t.
68
+ file)),null):(o.push(new v(t.file)),null);var He=(e,t,r,o)=>{let n=be(e,t,r,o,"Http.AuthResponse");return n&&ft(n)?n:null},
69
+ he=(e,t,r,o)=>{let n=be(e,t,r,o,"Http.Response");return n&&yt(n)?n:null},be=(e,t,r,o,n)=>{
70
+ if(!at(e))return ge(e,t,r,o,n);let p=ct(e,r);return p?ge(p,t,r,o,n):null},ft=e=>!!e.
71
+ identity,yt=e=>ut(e.status),ge=(e,t,r,o,n)=>mt(e)?Me(e,t,st(e),r,o):ot(e)?nt(e,n)?
72
+ Me(e,t,pt(e),r,o):(o.push(new h(e.name,n,e.file)),null):(o.push(new H(n,t.file)),
73
+ null),Me=(e,t,r,o,n)=>{let p={};for(let s of r)if(!(!lt(s)||s.inherited))switch(s.
74
+ name){default:n.push(new tt(t.name,s.name,e.file));break;case"status":p.status=it(
75
+ s);break;case"headers":{p.headers=P(s.value,e,o,n),p.headers&&s.description&&(p.
76
+ headers.description=s.description);break}case"identity":{p.identity=u(s.value,e,
77
+ o,n),p.identity&&s.description&&(p.identity.description=s.description);break}case"\
78
+ body":{p.body=ye(s.value,e,o,n),p.body&&s.description&&(p.body.description=s.description);
79
+ break}}return p};import{isModelProperty as wt,isTypeIntersection as Ot,isTypeObject as zt,isTypeReference as Ct}from"@ez4/reflection";
80
+ import{InvalidServicePropertyError as kt,isModelDeclaration as qt,hasHeritageType as Dt,
81
+ getObjectMembers as Ft,getModelMembers as Bt,getReferenceType as Nt}from"@ez4/common/library";import{IncorrectTypeError as dt,InvalidTypeError as Tt}from"@ez4/common/library";
82
+ var j=class extends Tt{constructor(r,o){super("Invalid route request",void 0,r,o);
83
+ this.baseType=r}},w=class extends dt{constructor(r,o,n){super("Incorrect route r\
84
+ equest",r,o,n);this.requestType=r;this.baseType=o}};import{isTypeIntersection as Ht,isTypeObject as ht,isTypeReference as bt}from"@ez4/reflection";
85
+ import{getReferenceType as St,isModelDeclaration as xt}from"@ez4/common/library";import{IncorrectTypeError as gt,InvalidTypeError as Mt}from"@ez4/common/library";
86
+ var O=class extends Mt{constructor(t){super("Invalid request parameters",void 0,
87
+ "Http.PathParameters",t)}},z=class extends gt{constructor(r,o){super("Incorrect \
88
+ request parameters",r,"Http.PathParameters",o);this.parametersType=r}};var xe=(e,t,r,o)=>{if(!bt(e))return Se(e,t,r,o);let n=St(e,r);return n?Se(n,t,r,
89
+ o):null},Se=(e,t,r,o)=>ht(e)||Ht(e)?l(e,r):xt(e)?re(e)?l(e,r):(o.push(new z(e.name,
90
+ e.file)),null):(o.push(new O(t.file)),null);import{isTypeIntersection as Et,isTypeObject as vt,isTypeReference as Rt}from"@ez4/reflection";
91
+ import{getReferenceType as Pt,isModelDeclaration as jt}from"@ez4/common/library";import{IncorrectTypeError as It,InvalidTypeError as At}from"@ez4/common/library";
92
+ var C=class extends At{constructor(t){super("Invalid request query strings",void 0,
93
+ "Http.QueryStrings",t)}},k=class extends It{constructor(r,o){super("Incorrect re\
94
+ quest query strings",r,"Http.QueryStrings",o);this.queryType=r}};var Ae=(e,t,r,o)=>{if(!Rt(e))return Ie(e,t,r,o);let n=Pt(e,r);return n?Ie(n,t,r,
95
+ o):null},Ie=(e,t,r,o)=>vt(e)||Et(e)?l(e,r):jt(e)?ee(e)?l(e,r):(o.push(new k(e.name,
96
+ t.file)),null):(o.push(new C(t.file)),null);var Re=(e,t,r,o)=>G(e,t,r,o,"Http.AuthRequest"),Pe=(e,t,r,o)=>G(e,t,r,o,"Http.Re\
97
+ quest"),G=(e,t,r,o,n)=>{if(Ot(e)&&e.elements.length>0)return G(e.elements[0],t,r,
98
+ o,n);if(!Ct(e))return Ee(e,t,r,o,n);let p=Nt(e,r);return p?Ee(p,t,r,o,n):null},Ee=(e,t,r,o,n)=>zt(
99
+ e)?ve(e,t,Ft(e),r,o):qt(e)?Dt(e,n)?ve(e,t,Bt(e),r,o):(o.push(new w(e.name,n,e.file)),
100
+ null):(o.push(new j(n,t.file)),null),ve=(e,t,r,o,n)=>{let p={};for(let s of r)if(!(!wt(
101
+ s)||s.inherited))switch(s.name){default:n.push(new kt(t.name,s.name,e.file));break;case"\
102
+ headers":{p.headers=P(s.value,e,o,n),p.headers&&s.description&&(p.headers.description=
103
+ s.description);break}case"identity":{p.identity=u(s.value,e,o,n),p.identity&&s.description&&
104
+ (p.identity.description=s.description);break}case"query":{p.query=Ae(s.value,e,o,
105
+ n),p.query&&s.description&&(p.query.description=s.description);break}case"parame\
106
+ ters":{p.parameters=xe(s.value,e,o,n),p.parameters&&s.description&&(p.parameters.
107
+ description=s.description);break}case"body":{p.body=fe(s.value,e,o,n),p.body&&s.
108
+ description&&(p.body.description=s.description);break}}return p};var je=(e,t,r,o)=>{if(!pe(e))return null;let n={},p=new Set(["name","file"]);if(e.
109
+ description&&(n.description=e.description),(n.name=e.name)&&p.delete("name"),(n.
110
+ file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;n.request=
111
+ Re(s,t,r,o)}return e.return&&(n.response=He(e.return,t,r,o)),Ut(n)?n:(o.push(new M(
112
+ [...p],e.file)),null)},Ut=e=>!!e.name&&!!e.file;import{IncompleteTypeError as Vt}from"@ez4/common/library";var q=class extends Vt{constructor(t,r){
113
+ super("Incomplete route handler",t,r)}};var we=(e,t,r,o)=>{if(!se(e))return null;let n={},p=new Set(["name","file","resp\
114
+ onse"]);if(e.description&&(n.description=e.description),(n.name=e.name)&&p.delete(
115
+ "name"),(n.file=e.file)&&p.delete("file"),e.parameters){let[{value:s}]=e.parameters;
116
+ n.request=Pe(s,t,r,o)}if(e.return){let s=he(e.return,t,r,o);s&&(n.response=s,p.delete(
117
+ "response"))}return Qt(n)?n:(o.push(new q([...p],e.file)),null)},Qt=e=>!!e.name&&
118
+ !!e.file&&!!e.response;var Ce=(e,t,r,o)=>{let n=oo(t)??[];return ke(n,e,r,o)},ke=(e,t,r,o)=>{let n=[];for(let p of e){
119
+ let s=no(p,t,r,o);Array.isArray(s)?n.push(...s):s&&n.push(s)}return n},no=(e,t,r,o)=>{
120
+ if(!Yt(e))return Oe(e,t,r,o);let n=to(e,r);return n?Oe(n,t,r,o):null},po=e=>!!e.
121
+ path&&!!e.handler,Oe=(e,t,r,o)=>Z(e)?ze(e,t,eo(e),r,o):Gt(e)?ze(e,t,Lt(e),r,o):Kt(
122
+ e)&&e.spread?ke(e.elements,t,r,o):null,ze=(e,t,r,o,n)=>{let p={},s=new Set(["pat\
123
+ h","handler"]);for(let i of r)if(!(!Jt(i)||i.inherited))switch(i.name){default:n.
124
+ push(new Wt(t.name,i.name,e.file));break;case"path":{let c=$t(i);c&&W(c)&&(s.delete(
125
+ i.name),p.path=c);break}case"handler":(p.handler=we(i.value,t,o,n))&&s.delete(i.
126
+ name);break;case"authorizer":p.authorizer=je(i.value,t,o,n);break;case"httpError\
127
+ s":p.httpErrors=y(i.value,t,o,n);break;case"memory":case"logRetention":case"time\
128
+ out":p[i.name]=_t(i);break;case"cors":p.cors=Zt(i);break;case"listener":p.listener=
129
+ ro(i.value,n);break;case"variables":p.variables=Xt(i,n);break}return po(p)?p:(n.
130
+ push(new g([...s],e.file)),null)};import{InvalidServicePropertyError as lo,isModelDeclaration as mo,getModelMembers as ao,
131
+ getObjectMembers as uo,getPropertyBoolean as fo,getPropertyStringList as yo,getPropertyNumber as To,
132
+ getReferenceType as go}from"@ez4/common/library";import{isModelProperty as Mo,isTypeObject as Ho,
133
+ isTypeReference as ho}from"@ez4/reflection";import{IncompleteTypeError as so,IncorrectTypeError as io,InvalidTypeError as co}from"@ez4/common/library";
134
+ var D=class extends so{constructor(t,r){super("Incomplete HTTP CORS",t,r)}},F=class extends co{constructor(t){
135
+ super("Invalid HTTP CORS type",void 0,"Http.Cors",t)}},B=class extends io{constructor(r,o){
136
+ super("Incorrect HTTP CORS type",r,"Http.Cors",o);this.fallbackType=r}};var Fe=(e,t,r,o)=>{if(!ho(e))return qe(e,t,o);let n=go(e,r);return n?qe(n,t,o):null},
137
+ bo=e=>!!e.allowOrigins?.length,qe=(e,t,r)=>Ho(e)?De(e,t,uo(e),r):mo(e)?oe(e)?De(
138
+ e,t,ao(e),r):(r.push(new B(e.name,e.file)),null):(r.push(new F(t.file)),null),De=(e,t,r,o)=>{
139
+ let n={},p=new Set(["allowOrigins"]);for(let s of r)if(!(!Mo(s)||s.inherited))switch(s.
140
+ name){default:o.push(new lo(t.name,s.name,e.file));break;case"allowOrigins":case"\
141
+ allowMethods":case"allowHeaders":case"exposeHeaders":n[s.name]=yo(s);break;case"\
142
+ allowCredentials":n.allowCredentials=fo(s);break;case"maxAge":n.maxAge=To(s);break}
143
+ return bo(n)?n:(o.push(new D([...p],e.file)),null)};import{InvalidServicePropertyError as Ao,isModelDeclaration as Eo,getModelMembers as vo,
144
+ getObjectMembers as Ro,getPropertyNumber as Po,getReferenceType as jo}from"@ez4/common/library";
145
+ import{isModelProperty as wo,isTypeObject as Oo,isTypeReference as zo}from"@ez4/reflection";
146
+ import{isAnyNumber as Ue}from"@ez4/utils";import{IncompleteTypeError as So,IncorrectTypeError as xo,InvalidTypeError as Io}from"@ez4/common/library";
147
+ var N=class extends So{constructor(t,r){super("Incomplete gateway cache",t,r)}},
148
+ U=class extends Io{constructor(t){super("Invalid gateway cache type",void 0,"Htt\
149
+ p.Cache",t)}},V=class extends xo{constructor(r,o){super("Incorrect gateway cache\
150
+ type",r,"Http.Cache",o);this.cacheType=r}};var Ve=(e,t,r,o)=>{if(!zo(e))return Be(e,t,o);let n=jo(e,r);return n?Be(n,t,o):null},
151
+ Co=e=>Ue(e.authorizerTTL),Be=(e,t,r)=>Oo(e)?Ne(e,t,Ro(e),r):Eo(e)?ne(e)?Ne(e,t,vo(
152
+ e),r):(r.push(new V(e.name,e.file)),null):(r.push(new U(t.file)),null),Ne=(e,t,r,o)=>{
153
+ let n={},p=new Set(["authorizerTTL"]);for(let s of r)if(!(!wo(s)||s.inherited))switch(s.
154
+ name){default:o.push(new Ao(t.name,s.name,e.file));break;case"authorizerTTL":{let i=Po(
155
+ s);Ue(i)&&(n[s.name]=i,p.delete(s.name));break}}return Co(n)?n:(o.push(new N([...p],
156
+ e.file)),null)};var Qe=e=>{let t={},r=[];for(let o in e){let n=e[o];if(!X(n)||qo(n))continue;let p={
157
+ type:Q,extras:{}},s=new Set(["routes"]),i=n.file;p.name=n.name,n.description&&(p.
158
+ description=n.description);for(let c of Bo(n))if(!(!Vo(c)||c.inherited))switch(c.
159
+ name){default:r.push(new Uo(p.name,c.name,i));break;case"routes":(p.routes=Ce(n,
160
+ c,e,r))&&s.delete(c.name);break;case"name":p.displayName=No(c);break;case"defaul\
161
+ ts":p.defaults=ue(c.value,n,e,r);break;case"cache":p.cache=Ve(c.value,n,e,r);break;case"\
162
+ cors":p.cors=Fe(c.value,n,e,r);break;case"variables":p.variables=Fo(c,r);break;case"\
163
+ services":p.services=Do(c,e,r);break}if(!Qo(p)){r.push(new f([...s],i));continue}
164
+ if(t[n.name]){r.push(new ko(n.name,i));continue}t[n.name]=p}return{services:t,errors:r}},
165
+ Qo=e=>!!e.name&&!!e.routes&&!!e.extras;var Je=!1,Is=()=>{Je||(Jo(),Go(),Yo("@ez4/gateway",{"metadata:getServices":Qe}),
166
+ Je=!1)};import{IncorrectTypeError as Ko,InvalidTypeError as Wo}from"@ez4/common/library";
167
+ var d=class extends Wo{constructor(t){super("Invalid defaults",void 0,"Http.Defa\
168
+ ults",t)}},T=class extends Ko{constructor(r,o){super("Incorrect defaults",r,"Htt\
169
+ p.Defaults",o);this.defaultsType=r}};export{M as IncompleteAuthorizerError,N as IncompleteCacheError,D as IncompleteCorsError,
170
+ q as IncompleteHandlerError,g as IncompleteRouteError,f as IncompleteServiceError,
171
+ S as IncorrectBodyTypeError,V as IncorrectCacheTypeError,B as IncorrectCorsTypeError,
172
+ T as IncorrectDefaultsTypeError,R as IncorrectHeadersTypeError,E as IncorrectIdentityTypeError,
173
+ z as IncorrectParameterTypeError,k as IncorrectQueryTypeError,w as IncorrectRequestTypeError,
174
+ h as IncorrectResponseTypeError,b as InvalidBodyTypeError,U as InvalidCacheTypeError,
175
+ F as InvalidCorsTypeError,d as InvalidDefaultsTypeError,v as InvalidHeadersTypeError,
176
+ A as InvalidIdentityTypeError,O as InvalidParameterTypeError,C as InvalidQueryTypeError,
177
+ j as InvalidRequestTypeError,H as InvalidResponseTypeError,a as InvalidRouteErrorTypeError,
178
+ Q as ServiceType,Re as getHttpAuthRequest,He as getHttpAuthResponse,je as getHttpAuthorizer,
179
+ Ve as getHttpCache,Fe as getHttpCors,we as getHttpHandler,Pe as getHttpHandlerRequest,
180
+ he as getHttpHandlerResponse,P as getHttpHeaders,u as getHttpIdentity,xe as getHttpParameters,
181
+ Ae as getHttpQuery,fe as getHttpRequestBody,ye as getHttpResponseBody,Ce as getHttpRoutes,
182
+ Qe as getHttpServices,Xo as isHttpService,Is as registerTriggers};
177
183
  //# sourceMappingURL=library.mjs.map
package/dist/main.cjs CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";var o=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var R=(s,e)=>{for(var t in e)o(s,t,{get:e[t],enumerable:!0})},g=(s,e,t,n)=>{if(e&&
2
- typeof e=="object"||typeof e=="function")for(let p of H(e))!h.call(s,p)&&p!==t&&
3
- o(s,p,{get:()=>e[p],enumerable:!(n=l(e,p))||n.enumerable});return s};var q=s=>g(o({},"__esModule",{value:!0}),s);var b={};R(b,{Http:()=>y,HttpBadRequestError:()=>u,HttpError:()=>r,HttpForbiddenError:()=>a,
1
+ "use strict";var n=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var R=(r,t)=>{for(var e in t)n(r,e,{get:t[e],enumerable:!0})},g=(r,t,e,o)=>{if(t&&
2
+ typeof t=="object"||typeof t=="function")for(let p of l(t))!h.call(r,p)&&p!==e&&
3
+ n(r,p,{get:()=>t[p],enumerable:!(o=H(t,p))||o.enumerable});return r};var q=r=>g(n({},"__esModule",{value:!0}),r);var b={};R(b,{Http:()=>y,HttpBadRequestError:()=>u,HttpError:()=>s,HttpForbiddenError:()=>a,
4
4
  HttpInternalServerError:()=>m,HttpNotFoundError:()=>c,HttpUnauthorizedError:()=>i,
5
5
  HttpUnprocessableEntityError:()=>d,HttpUnsupportedMediaTypeError:()=>x});module.
6
- exports=q(b);var y;(s=>{})(y||={});var r=class extends Error{constructor(t,n,p){super(n);this.status=t;this.message=
7
- n;this.details=p}},u=class extends r{constructor(e,t){super(400,e||"Bad request",
8
- t)}},i=class extends r{constructor(e,t){super(401,e||"Unauthorized",t)}},a=class extends r{constructor(e,t){
9
- super(403,e||"Forbidden",t)}},c=class extends r{constructor(e,t){super(404,e||"N\
10
- ot found",t)}},x=class extends r{constructor(e,t){super(415,e||"Unsupported medi\
11
- a type",t)}},d=class extends r{constructor(e,t){super(422,e||"Unprocessable enti\
12
- ty",t)}},m=class extends r{constructor(e,t){super(500,e||"Internal server error",
13
- t)}};0&&(module.exports={Http,HttpBadRequestError,HttpError,HttpForbiddenError,HttpInternalServerError,
6
+ exports=q(b);var y;(r=>{})(y||={});var s=class extends Error{constructor(e,o,p){super(o);this.status=e;this.message=
7
+ o;this.details=p}},u=class extends s{constructor(t,e){super(400,t||"Bad request",
8
+ e)}},i=class extends s{constructor(t,e){super(401,t||"Unauthorized",e)}},a=class extends s{constructor(t,e){
9
+ super(403,t||"Forbidden",e)}},c=class extends s{constructor(t,e){super(404,t||"N\
10
+ ot found",e)}},x=class extends s{constructor(t,e){super(415,t||"Unsupported medi\
11
+ a type",e)}},d=class extends s{constructor(t,e){super(422,t||"Unprocessable enti\
12
+ ty",e)}},m=class extends s{constructor(t,e){super(500,t||"Internal server error",
13
+ e)}};0&&(module.exports={Http,HttpBadRequestError,HttpError,HttpForbiddenError,HttpInternalServerError,
14
14
  HttpNotFoundError,HttpUnauthorizedError,HttpUnprocessableEntityError,HttpUnsupportedMediaTypeError});
15
15
  //# sourceMappingURL=main.cjs.map
package/dist/main.mjs CHANGED
@@ -1,11 +1,11 @@
1
- var d;(r=>{})(d||={});var s=class extends Error{constructor(t,x,m){super(x);this.status=t;this.message=
2
- x;this.details=m}},p=class extends s{constructor(e,t){super(400,e||"Bad request",
3
- t)}},n=class extends s{constructor(e,t){super(401,e||"Unauthorized",t)}},o=class extends s{constructor(e,t){
4
- super(403,e||"Forbidden",t)}},u=class extends s{constructor(e,t){super(404,e||"N\
5
- ot found",t)}},i=class extends s{constructor(e,t){super(415,e||"Unsupported medi\
6
- a type",t)}},a=class extends s{constructor(e,t){super(422,e||"Unprocessable enti\
7
- ty",t)}},c=class extends s{constructor(e,t){super(500,e||"Internal server error",
8
- t)}};export{d as Http,p as HttpBadRequestError,s as HttpError,o as HttpForbiddenError,
9
- c as HttpInternalServerError,u as HttpNotFoundError,n as HttpUnauthorizedError,a as HttpUnprocessableEntityError,
1
+ var d;(s=>{})(d||={});var r=class extends Error{constructor(e,x,m){super(x);this.status=e;this.message=
2
+ x;this.details=m}},p=class extends r{constructor(t,e){super(400,t||"Bad request",
3
+ e)}},o=class extends r{constructor(t,e){super(401,t||"Unauthorized",e)}},n=class extends r{constructor(t,e){
4
+ super(403,t||"Forbidden",e)}},u=class extends r{constructor(t,e){super(404,t||"N\
5
+ ot found",e)}},i=class extends r{constructor(t,e){super(415,t||"Unsupported medi\
6
+ a type",e)}},a=class extends r{constructor(t,e){super(422,t||"Unprocessable enti\
7
+ ty",e)}},c=class extends r{constructor(t,e){super(500,t||"Internal server error",
8
+ e)}};export{d as Http,p as HttpBadRequestError,r as HttpError,n as HttpForbiddenError,
9
+ c as HttpInternalServerError,u as HttpNotFoundError,o as HttpUnauthorizedError,a as HttpUnprocessableEntityError,
10
10
  i as HttpUnsupportedMediaTypeError};
11
11
  //# sourceMappingURL=main.mjs.map
@@ -1,6 +1,6 @@
1
- import type { AllType, SourceMap, TypeModel, TypeObject } from '@ez4/reflection';
1
+ import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
2
  import type { ArraySchema, ObjectSchema, UnionSchema } from '@ez4/schema/library';
3
- type TypeParent = TypeObject | TypeModel;
3
+ type TypeParent = TypeObject | TypeModel | TypeIntersection;
4
4
  export declare const getHttpRequestBody: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => ObjectSchema | UnionSchema | ArraySchema | null;
5
- export declare const getHttpResponseBody: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema/library").BooleanSchema | import("@ez4/schema/library").NumberSchema | import("@ez4/schema/library").StringSchema | ObjectSchema | UnionSchema | ArraySchema | null;
5
+ export declare const getHttpResponseBody: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => ObjectSchema | UnionSchema | ArraySchema | import("@ez4/schema/library").BooleanSchema | import("@ez4/schema/library").NumberSchema | import("@ez4/schema/library").StringSchema | null;
6
6
  export {};
@@ -0,0 +1,4 @@
1
+ import type { AllType, ModelProperty, SourceMap, TypeModel } from '@ez4/reflection';
2
+ import type { HttpErrors } from '../types/common.js';
3
+ export declare const getHttpErrors: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpErrors | null;
4
+ export declare const getErrorClasses: (member: ModelProperty, errorCode: number, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => HttpErrors;
@@ -1,2 +1,4 @@
1
- import type { AllType, SourceMap, TypeModel, TypeObject } from '@ez4/reflection';
2
- export declare const getHttpHeaders: (type: AllType, parent: TypeObject | TypeModel, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema/library").ObjectSchema | null;
1
+ import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
+ type TypeParent = TypeObject | TypeModel | TypeIntersection;
3
+ export declare const getHttpHeaders: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema").ObjectSchema | null;
4
+ export {};
@@ -1,3 +1,5 @@
1
- import type { AllType, SourceMap, TypeModel, TypeObject } from '@ez4/reflection';
1
+ import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
2
  import type { ObjectSchema, UnionSchema } from '@ez4/schema/library';
3
- export declare const getHttpIdentity: (type: AllType, parent: TypeObject | TypeModel, reflection: SourceMap, errorList: Error[]) => ObjectSchema | UnionSchema | null;
3
+ type TypeParent = TypeObject | TypeModel | TypeIntersection;
4
+ export declare const getHttpIdentity: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => ObjectSchema | UnionSchema | null;
5
+ export {};
@@ -1,2 +1,4 @@
1
- import type { AllType, SourceMap, TypeModel, TypeObject } from '@ez4/reflection';
2
- export declare const getHttpParameters: (type: AllType, parent: TypeObject | TypeModel, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema/library").ObjectSchema | null;
1
+ import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
+ type TypeParent = TypeObject | TypeModel | TypeIntersection;
3
+ export declare const getHttpParameters: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema").ObjectSchema | null;
4
+ export {};
@@ -1,2 +1,4 @@
1
- import type { AllType, SourceMap, TypeModel, TypeObject } from '@ez4/reflection';
2
- export declare const getHttpQuery: (type: AllType, parent: TypeObject | TypeModel, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema/library").ObjectSchema | null;
1
+ import type { AllType, SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
+ type TypeParent = TypeObject | TypeModel | TypeIntersection;
3
+ export declare const getHttpQuery: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => import("@ez4/schema").ObjectSchema | null;
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { SourceMap, TypeIntersection, TypeModel, TypeObject } from '@ez4/reflection';
2
+ export declare const getSchemaFromType: (type: TypeObject | TypeModel | TypeIntersection, reflection: SourceMap) => import("@ez4/schema/library").ObjectSchema | null;
@@ -170,3 +170,9 @@ export type HttpAuthorizer<T extends HttpAuthRequest> = (request: HttpIncoming<T
170
170
  * Request handler.
171
171
  */
172
172
  export type HttpHandler<T extends HttpRequest> = (request: HttpIncoming<T> | T, context: Service.Context<Http.Service | HttpProvider>) => Promise<HttpResponse> | HttpResponse;
173
+ /**
174
+ * HTTP errors.
175
+ */
176
+ export type HttpErrors = {
177
+ [code: number]: Error[];
178
+ };
@@ -1,13 +1,11 @@
1
1
  import type { Service } from '@ez4/common';
2
2
  import type { LinkedVariables } from '@ez4/project/library';
3
3
  import type { HttpPath } from '../types/common.js';
4
- import type { HttpCors, HttpHeaders, HttpIdentity, HttpPathParameters, HttpQueryStrings, HttpJsonBody, HttpAuthRequest, HttpAuthResponse, HttpRequest, HttpResponse, HttpProvider, HttpIncoming, HttpListener, HttpAuthorizer, HttpHandler, HttpCache } from './common.js';
4
+ import type { HttpHeaders, HttpIdentity, HttpPathParameters, HttpQueryStrings, HttpJsonBody, HttpAuthRequest, HttpAuthResponse, HttpRequest, HttpResponse, HttpErrors, HttpProvider, HttpIncoming, HttpListener, HttpAuthorizer, HttpHandler, HttpCache, HttpCors } from './common.js';
5
5
  /**
6
6
  * Provide all contracts for a self-managed HTTP service.
7
7
  */
8
8
  export declare namespace Http {
9
- type Cors = HttpCors;
10
- type Cache = HttpCache;
11
9
  type Headers = HttpHeaders;
12
10
  type Identity = HttpIdentity;
13
11
  type PathParameters = HttpPathParameters;
@@ -17,7 +15,10 @@ export declare namespace Http {
17
15
  type Request = HttpRequest;
18
16
  type AuthResponse = HttpAuthResponse;
19
17
  type Response = HttpResponse;
18
+ type Errors = HttpErrors;
20
19
  type Provider = HttpProvider;
20
+ type Cache = HttpCache;
21
+ type Cors = HttpCors;
21
22
  type Incoming<T extends Request | AuthRequest> = HttpIncoming<T>;
22
23
  type Listener<T extends Request | AuthRequest> = HttpListener<T>;
23
24
  type Authorizer<T extends AuthRequest> = HttpAuthorizer<T>;
@@ -43,6 +44,10 @@ export declare namespace Http {
43
44
  * Route handler.
44
45
  */
45
46
  handler: Handler<T>;
47
+ /**
48
+ * Map status codes and errors for all known exceptions.
49
+ */
50
+ httpErrors?: Errors;
46
51
  /**
47
52
  * Variables associated to the route.
48
53
  */
@@ -68,10 +73,14 @@ export declare namespace Http {
68
73
  * Default route listener.
69
74
  */
70
75
  listener?: Listener<T>;
76
+ /**
77
+ * Status codes for all known exceptions.
78
+ */
79
+ httpErrors?: Errors;
71
80
  /**
72
81
  * Default log retention (in days) for the handlers.
73
82
  */
74
- retention?: number;
83
+ logRetention?: number;
75
84
  /**
76
85
  * Default execution time (in seconds) for handlers and routes.
77
86
  */
@@ -25,10 +25,10 @@ export type HttpResponse = {
25
25
  };
26
26
  export type HttpHandler = {
27
27
  name: string;
28
- file: string;
29
28
  description?: string;
30
29
  response: HttpResponse;
31
30
  request?: HttpRequest;
31
+ file: string;
32
32
  };
33
33
  export type HttpAuthorizer = {
34
34
  name: string;
@@ -37,23 +37,31 @@ export type HttpAuthorizer = {
37
37
  response?: HttpAuthResponse;
38
38
  request?: HttpAuthRequest;
39
39
  };
40
+ export type HttpErrors = {
41
+ [name: string]: number;
42
+ };
40
43
  export type HttpRoute = {
41
44
  path: HttpPath;
42
- listener?: ServiceListener;
43
- authorizer?: HttpAuthorizer;
44
45
  handler: HttpHandler;
46
+ listener?: ServiceListener | null;
47
+ authorizer?: HttpAuthorizer | null;
45
48
  variables?: LinkedVariables | null;
46
- retention?: number;
47
- timeout?: number;
48
- memory?: number;
49
- cors?: boolean;
49
+ logRetention?: number | null;
50
+ httpErrors?: HttpErrors | null;
51
+ timeout?: number | null;
52
+ memory?: number | null;
53
+ cors?: boolean | null;
50
54
  };
51
55
  export type HttpDefaults = {
52
- retention?: number | null;
56
+ logRetention?: number | null;
57
+ httpErrors?: HttpErrors | null;
53
58
  listener?: ServiceListener | null;
54
59
  timeout?: number | null;
55
60
  memory?: number | null;
56
61
  };
62
+ export type HttpCache = {
63
+ authorizerTTL?: number;
64
+ };
57
65
  export type HttpCors = {
58
66
  allowOrigins: string[];
59
67
  allowMethods?: string[];
@@ -62,6 +70,3 @@ export type HttpCors = {
62
70
  allowHeaders?: string[];
63
71
  maxAge?: number;
64
72
  };
65
- export type HttpCache = {
66
- authorizerTTL?: number;
67
- };
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.19.0",
4
+ "version": "0.20.0",
5
5
  "author": "Silas B.",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -42,10 +42,10 @@
42
42
  "live:publish": "npm run test && npm publish --access public"
43
43
  },
44
44
  "dependencies": {
45
- "@ez4/common": "^0.19.0",
46
- "@ez4/project": "^0.19.0",
47
- "@ez4/reflection": "^0.19.0",
48
- "@ez4/schema": "^0.19.0",
49
- "@ez4/utils": "^0.19.0"
45
+ "@ez4/common": "^0.20.0",
46
+ "@ez4/project": "^0.20.0",
47
+ "@ez4/reflection": "^0.20.0",
48
+ "@ez4/schema": "^0.20.0",
49
+ "@ez4/utils": "^0.20.0"
50
50
  }
51
51
  }