@ez4/storage 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.cjs CHANGED
@@ -1,61 +1,66 @@
1
- "use strict";var B=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var o=(e,r)=>B(e,"name",{value:r,configurable:!0});var $=(e,r)=>{for(var t in r)B(e,t,{get:r[t],enumerable:!0})},ee=(e,r,t,i)=>{if(r&&
1
+ "use strict";var M=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var o=(e,r)=>M(e,"name",{value:r,configurable:!0});var $=(e,r)=>{for(var t in r)M(e,t,{get:r[t],enumerable:!0})},ee=(e,r,t,s)=>{if(r&&
2
2
  typeof r=="object"||typeof r=="function")for(let n of Z(r))!_.call(e,n)&&n!==t&&
3
- B(e,n,{get:()=>r[n],enumerable:!(i=Y(r,n))||i.enumerable});return e};var re=e=>ee(B({},"__esModule",{value:!0}),e);var pe={};$(pe,{IncompleteCorsError:()=>x,IncompleteEventError:()=>k,IncompleteServiceError:()=>g,
4
- IncorrectCorsTypeError:()=>E,IncorrectEventTypeError:()=>b,InvalidCorsTypeError:()=>S,
5
- InvalidEventTypeError:()=>T,ServiceType:()=>I,createBucketService:()=>w,getBucketCors:()=>R,
6
- getBucketEvent:()=>O,getBucketServices:()=>z,getEventHandler:()=>P,isBucketService:()=>te,
7
- registerTriggers:()=>ce});module.exports=re(pe);var U=require("@ez4/common/library"),X=require("@ez4/project/library");var a=require("@ez4/common/library"),K=require("@ez4/reflection"),L=require("@ez4/utils");var A=require("@ez4/project/library");var I="@ez4/bucket",te=o(e=>e.type===I,"isBucketService"),w=o(e=>({...(0,A.createServiceMetadata)(
8
- I,e),variables:{},services:{}}),"createBucketService");var j=require("@ez4/common/library");var g=class extends j.IncompleteTypeError{static{o(this,"IncompleteServiceError")}constructor(r,t){
9
- super("Incomplete bucket service",r,t)}};var u=require("@ez4/common/library"),M=require("@ez4/reflection");var h=o(e=>(0,u.isClassDeclaration)(e)&&(0,u.hasHeritageType)(e,"Bucket.Service"),
10
- "isBucketService"),D=o(e=>(0,M.isTypeCallback)(e)||(0,M.isTypeFunction)(e),"isEv\
11
- entHandler"),H=o(e=>(0,u.hasHeritageType)(e,"Bucket.Event"),"isBucketEvent"),F=o(
12
- e=>(0,u.hasHeritageType)(e,"Bucket.Cors"),"isBucketCors");var c=require("@ez4/common/library"),d=require("@ez4/reflection");var f=require("@ez4/common/library");var k=class extends f.IncompleteTypeError{static{o(this,"IncompleteEventError")}constructor(r,t){
13
- super("Incomplete bucket event",r,t)}},T=class extends f.InvalidTypeError{static{
3
+ M(e,n,{get:()=>r[n],enumerable:!(s=Y(r,n))||s.enumerable});return e};var re=e=>ee(M({},"__esModule",{value:!0}),e);var se={};$(se,{IncompleteCorsError:()=>T,IncompleteEventError:()=>g,IncompleteServiceError:()=>v,
4
+ IncorrectCorsTypeError:()=>S,IncorrectEventTypeError:()=>k,InvalidCorsTypeError:()=>x,
5
+ InvalidEventTypeError:()=>b,ServiceType:()=>R,createBucketService:()=>O,getBucketCorsMetadata:()=>w,
6
+ getBucketEventMetadata:()=>I,getBucketServicesMetadata:()=>A,getEventHandlerMetadata:()=>C,
7
+ isBucketCorsDeclaration:()=>q,isBucketEventDeclaration:()=>V,isBucketService:()=>ne,
8
+ isBucketServiceDeclaration:()=>B,isEventHandlerDeclaration:()=>j,registerTriggers:()=>ce});
9
+ module.exports=re(se);var U=require("@ez4/common/library"),X=require("@ez4/project/library");var a=require("@ez4/common/library"),J=require("@ez4/reflection"),K=require("@ez4/utils");var z=require("@ez4/common/library");var v=class extends z.IncompleteTypeError{static{o(this,"IncompleteServiceError")}constructor(r,t){
10
+ super("Incomplete bucket service",r,t)}};var c=require("@ez4/common/library"),f=require("@ez4/reflection"),N=require("@ez4/utils");var u=require("@ez4/common/library");var g=class extends u.IncompleteTypeError{static{o(this,"IncompleteEventError")}constructor(r,t){
11
+ super("Incomplete bucket event",r,t)}},b=class extends u.InvalidTypeError{static{
14
12
  o(this,"InvalidEventTypeError")}constructor(r){super("Invalid bucket event type",
15
- void 0,"Bucket.Event",r)}},b=class extends f.IncorrectTypeError{constructor(t,i){
16
- super("Incorrect bucket event type",t,"Bucket.Event",i);this.eventType=t}static{
17
- o(this,"IncorrectEventTypeError")}};var V=require("@ez4/common/library");var N=require("@ez4/common/library");var C=class extends N.IncompleteTypeError{static{o(this,"IncompleteHandlerError")}constructor(r){
18
- super("Incomplete event handler",[],r)}};var P=o((e,r)=>{if(!D(e))return;let t=(0,V.getFunctionSignature)(e);return t||r.
19
- push(new C(e.file)),t},"getEventHandler");var O=o((e,r,t,i)=>{if(!(0,d.isTypeReference)(e))return q(e,r,i);let n=(0,c.getReferenceType)(
20
- e,t);if(n)return q(n,r,i)},"getBucketEvent"),oe=o(e=>!!e.handler,"isValidEvent"),
21
- q=o((e,r,t)=>{if((0,d.isTypeObject)(e))return W(e,r,(0,c.getObjectMembers)(e),t);
22
- if(!(0,c.isModelDeclaration)(e)){t.push(new T(r.file));return}if(!H(e)){t.push(new b(
23
- e.name,e.file));return}return W(e,r,(0,c.getModelMembers)(e),t)},"getTypeEvent"),
24
- W=o((e,r,t,i)=>{let n={},m=new Set(["handler"]);for(let s of t)if(!(!(0,d.isModelProperty)(
25
- s)||s.inherited))switch(s.name){default:i.push(new c.InvalidServicePropertyError(
26
- r.name,s.name,e.file));break;case"path":n.path=(0,c.getPropertyString)(s);break;case"\
27
- listener":n.listener=(0,c.getServiceListener)(s.value,i);break;case"handler":n.handler=
28
- P(s.value,i);break;case"memory":case"logRetention":case"timeout":n[s.name]=(0,c.getPropertyNumber)(
29
- s);break;case"variables":n.variables=(0,c.getLinkedVariableList)(s,i);break}if(oe(
30
- n))return n;i.push(new k([...m],e.file))},"getTypeFromMembers");var p=require("@ez4/common/library"),v=require("@ez4/reflection");var y=require("@ez4/common/library");var x=class extends y.IncompleteTypeError{static{o(this,"IncompleteCorsError")}constructor(r,t){
31
- super("Incomplete bucket CORS",r,t)}},S=class extends y.InvalidTypeError{static{
13
+ void 0,"Bucket.Event",r)}},k=class extends u.IncorrectTypeError{constructor(t,s){
14
+ super("Incorrect bucket event type",t,"Bucket.Event",s);this.eventType=t}static{
15
+ o(this,"IncorrectEventTypeError")}};var E=require("@ez4/reflection"),D=require("@ez4/common/library");var P=require("@ez4/common/library");var h=class extends P.IncompleteTypeError{static{o(this,"IncompleteHandlerError")}constructor(r){
16
+ super("Incomplete event handler",[],r)}};var j=o(e=>(0,E.isTypeCallback)(e)||(0,E.isTypeFunction)(e),"isEventHandlerDecla\
17
+ ration"),C=o((e,r)=>{if(!j(e))return;let t=(0,D.getFunctionSignature)(e);return t||
18
+ r.push(new h(e.file)),t},"getEventHandlerMetadata");var V=o(e=>(0,c.hasHeritageType)(e,"Bucket.Event"),"isBucketEventDeclaration"),I=o(
19
+ (e,r,t,s)=>{if(!(0,f.isTypeReference)(e))return H(e,r,s);let n=(0,c.getReferenceType)(
20
+ e,t);if(n)return H(n,r,s)},"getBucketEventMetadata"),te=o(e=>(0,N.isObjectWith)(
21
+ e,["handler"]),"isCompleteEvent"),H=o((e,r,t)=>{if((0,f.isTypeObject)(e))return F(
22
+ e,r,(0,c.getObjectMembers)(e),t);if(!(0,c.isModelDeclaration)(e)){t.push(new b(r.
23
+ file));return}if(!V(e)){t.push(new k(e.name,e.file));return}return F(e,r,(0,c.getModelMembers)(
24
+ e),t)},"getTypeEvent"),F=o((e,r,t,s)=>{let n={},l=new Set(["handler"]);for(let i of t)
25
+ if(!(!(0,f.isModelProperty)(i)||i.inherited))switch(i.name){default:{s.push(new c.InvalidServicePropertyError(
26
+ r.name,i.name,e.file));break}case"path":{n.path=(0,c.getPropertyString)(i);break}case"\
27
+ listener":{n.listener=(0,c.getServiceListener)(i.value,s);break}case"handler":{n.
28
+ handler=C(i.value,s);break}case"memory":case"logRetention":case"timeout":{n[i.name]=
29
+ (0,c.getPropertyNumber)(i);break}case"architecture":{n[i.name]=(0,c.getServiceArchitecture)(
30
+ i);break}case"runtime":{n[i.name]=(0,c.getServiceRuntime)(i);break}case"variable\
31
+ s":{n.variables=(0,c.getLinkedVariableList)(i,s);break}}if(!te(n)){s.push(new g(
32
+ [...l],e.file));return}return n},"getTypeFromMembers");var p=require("@ez4/common/library"),y=require("@ez4/reflection");var d=require("@ez4/common/library");var T=class extends d.IncompleteTypeError{static{o(this,"IncompleteCorsError")}constructor(r,t){
33
+ super("Incomplete bucket CORS",r,t)}},x=class extends d.InvalidTypeError{static{
32
34
  o(this,"InvalidCorsTypeError")}constructor(r){super("Invalid bucket CORS type",void 0,
33
- "Bucket.Cors",r)}},E=class extends y.IncorrectTypeError{constructor(t,i){super("\
34
- Incorrect bucket CORS type",t,"Bucket.Cors",i);this.fallbackType=t}static{o(this,
35
- "IncorrectCorsTypeError")}};var R=o((e,r,t,i)=>{if(!(0,v.isTypeReference)(e))return G(e,r,i);let n=(0,p.getReferenceType)(
36
- e,t);if(n)return G(n,r,i)},"getBucketCors"),ne=o(e=>!!e.allowOrigins?.length,"is\
37
- ValidCors"),G=o((e,r,t)=>{if((0,v.isTypeObject)(e))return J(e,r,(0,p.getObjectMembers)(
38
- e),t);if(!(0,p.isModelDeclaration)(e)){t.push(new S(r.file));return}if(!F(e)){t.
39
- push(new E(e.name,e.file));return}return J(e,r,(0,p.getModelMembers)(e),t)},"get\
40
- TypeCors"),J=o((e,r,t,i)=>{let n={},m=new Set(["allowOrigins"]);for(let s of t)if(!(!(0,v.isModelProperty)(
41
- s)||s.inherited))switch(s.name){default:i.push(new p.InvalidServicePropertyError(
42
- r.name,s.name,e.file));break;case"allowOrigins":case"allowMethods":case"allowHea\
43
- ders":case"exposeHeaders":n[s.name]=ie(s);break;case"maxAge":n.maxAge=(0,p.getPropertyNumber)(
44
- s);break}if(ne(n))return n;i.push(new x([...m],e.file))},"getTypeFromMembers"),ie=o(
45
- e=>{let r=(0,p.getPropertyTuple)(e)??[],t=[];for(let i of r){let n=(0,p.getLiteralString)(
46
- i);n&&t.push(n)}return t},"getStringValues");var z=o(e=>{let r={},t=[];for(let i in e){let n=e[i];if(!h(n)||(0,a.isExternalDeclaration)(
47
- n))continue;let m=w(n.name),s=n.file;for(let l of(0,a.getModelMembers)(n))if(!(!(0,K.isModelProperty)(
48
- l)||l.inherited))switch(l.name){default:t.push(new a.InvalidServicePropertyError(
49
- m.name,l.name,s));break;case"client":break;case"localPath":case"globalName":m[l.
50
- name]=(0,a.getPropertyString)(l);break;case"autoExpireDays":m.autoExpireDays=(0,a.getPropertyNumber)(
51
- l);break;case"events":m.events=O(l.value,n,e,t);break;case"cors":m.cors=R(l.value,
52
- n,e,t);break;case"variables":m.variables=(0,a.getLinkedVariableList)(l,t);break;case"\
53
- services":m.services=(0,a.getLinkedServiceList)(l,e,t);break}if(!se(m)){t.push(new g(
54
- [],s));continue}if(r[n.name]){t.push(new a.DuplicateServiceError(n.name,s));continue}
55
- r[n.name]=m}return{services:r,errors:t}},"getBucketServices"),se=o(e=>(0,L.isObjectWith)(
56
- e,["variables","services"]),"isCompleteService");var Q=o(e=>h(e)?e.name:null,"getLinkedService");var ce=o(()=>{(0,U.registerTriggers)(),(0,X.tryCreateTrigger)("@ez4/bucket",{"me\
57
- tadata:getServices":z,"metadata:getLinkedService":Q})},"registerTriggers");0&&(module.exports={IncompleteCorsError,IncompleteEventError,IncompleteServiceError,
35
+ "Bucket.Cors",r)}},S=class extends d.IncorrectTypeError{constructor(t,s){super("\
36
+ Incorrect bucket CORS type",t,"Bucket.Cors",s);this.fallbackType=t}static{o(this,
37
+ "IncorrectCorsTypeError")}};var q=o(e=>(0,p.hasHeritageType)(e,"Bucket.Cors"),"isBucketCorsDeclaration"),w=o(
38
+ (e,r,t,s)=>{if(!(0,y.isTypeReference)(e))return L(e,r,s);let n=(0,p.getReferenceType)(
39
+ e,t);if(n)return L(n,r,s)},"getBucketCorsMetadata"),oe=o(e=>!!e.allowOrigins?.length,
40
+ "isCompleteCors"),L=o((e,r,t)=>{if((0,y.isTypeObject)(e))return W(e,r,(0,p.getObjectMembers)(
41
+ e),t);if(!(0,p.isModelDeclaration)(e)){t.push(new x(r.file));return}if(!q(e)){t.
42
+ push(new S(e.name,e.file));return}return W(e,r,(0,p.getModelMembers)(e),t)},"get\
43
+ TypeCors"),W=o((e,r,t,s)=>{let n={},l=new Set(["allowOrigins"]);for(let i of t)if(!(!(0,y.isModelProperty)(
44
+ i)||i.inherited))switch(i.name){default:{s.push(new p.InvalidServicePropertyError(
45
+ r.name,i.name,e.file));break}case"allowOrigins":case"allowMethods":case"allowHea\
46
+ ders":case"exposeHeaders":{n[i.name]=(0,p.getPropertyStringList)(i);break}case"m\
47
+ axAge":{n.maxAge=(0,p.getPropertyNumber)(i);break}}if(!oe(n)){s.push(new T([...l],
48
+ e.file));return}return n},"getTypeFromMembers");var G=require("@ez4/project/library");var R="@ez4/bucket",ne=o(e=>e.type===R,"isBucketService"),O=o(e=>({...(0,G.createServiceMetadata)(
49
+ R,e),variables:{},services:{}}),"createBucketService");var B=o(e=>(0,a.isClassDeclaration)(e)&&(0,a.hasHeritageType)(e,"Bucket.Service"),
50
+ "isBucketServiceDeclaration"),A=o(e=>{let r={},t=[];for(let s in e){let n=e[s];if(!B(
51
+ n)||(0,a.isExternalDeclaration)(n))continue;let l=O(n.name),i=n.file;for(let m of(0,a.getModelMembers)(
52
+ n))if(!(!(0,J.isModelProperty)(m)||m.inherited))switch(m.name){default:{t.push(new a.InvalidServicePropertyError(
53
+ l.name,m.name,i));break}case"client":break;case"localPath":case"globalName":{l[m.
54
+ name]=(0,a.getPropertyString)(m);break}case"autoExpireDays":{l.autoExpireDays=(0,a.getPropertyNumber)(
55
+ m);break}case"events":{l.events=I(m.value,n,e,t);break}case"cors":{l.cors=w(m.value,
56
+ n,e,t);break}case"variables":{l.variables=(0,a.getLinkedVariableList)(m,t);break}case"\
57
+ services":{l.services=(0,a.getLinkedServiceList)(m,e,t);break}}if(!ie(l)){t.push(
58
+ new v([],i));continue}if(r[n.name]){t.push(new a.DuplicateServiceError(n.name,i));
59
+ continue}r[n.name]=l}return{services:r,errors:t}},"getBucketServicesMetadata"),ie=o(
60
+ e=>(0,K.isObjectWith)(e,["variables","services"]),"isCompleteService");var Q=o(e=>B(e)?e.name:null,"getLinkedService");var ce=o(()=>{(0,U.registerTriggers)(),(0,X.tryCreateTrigger)("@ez4/bucket",{"me\
61
+ tadata:getServices":A,"metadata:getLinkedService":Q})},"registerTriggers");0&&(module.exports={IncompleteCorsError,IncompleteEventError,IncompleteServiceError,
58
62
  IncorrectCorsTypeError,IncorrectEventTypeError,InvalidCorsTypeError,InvalidEventTypeError,
59
- ServiceType,createBucketService,getBucketCors,getBucketEvent,getBucketServices,getEventHandler,
60
- isBucketService,registerTriggers});
63
+ ServiceType,createBucketService,getBucketCorsMetadata,getBucketEventMetadata,getBucketServicesMetadata,
64
+ getEventHandlerMetadata,isBucketCorsDeclaration,isBucketEventDeclaration,isBucketService,
65
+ isBucketServiceDeclaration,isEventHandlerDeclaration,registerTriggers});
61
66
  //# sourceMappingURL=library.cjs.map
package/dist/library.d.ts CHANGED
@@ -3,8 +3,7 @@ export * from './metadata/service';
3
3
  export * from './metadata/event';
4
4
  export * from './metadata/handler';
5
5
  export * from './metadata/cors';
6
+ export * from './metadata/types';
6
7
  export * from './errors/service';
7
8
  export * from './errors/event';
8
9
  export * from './errors/cors';
9
- export * from './types/service';
10
- export * from './types/common';
package/dist/library.mjs CHANGED
@@ -1,56 +1,59 @@
1
- var z=Object.defineProperty;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});import{registerTriggers as Pe}from"@ez4/common/library";import{tryCreateTrigger as Oe}from"@ez4/project/library";import{DuplicateServiceError as Te,InvalidServicePropertyError as be,isExternalDeclaration as xe,
2
- getLinkedVariableList as Se,getLinkedServiceList as Ee,getModelMembers as Be,getPropertyNumber as Me,
3
- getPropertyString as he}from"@ez4/common/library";import{isModelProperty as Ce}from"@ez4/reflection";
4
- import{isObjectWith as Ie}from"@ez4/utils";import{createServiceMetadata as A}from"@ez4/project/library";var T="@ez4/bucket",Ae=o(e=>e.type===T,"isBucketService"),b=o(e=>({...A(T,e),variables:{},
5
- services:{}}),"createBucketService");import{IncompleteTypeError as j}from"@ez4/common/library";var a=class extends j{static{o(this,"IncompleteServiceError")}constructor(t,r){super(
6
- "Incomplete bucket service",t,r)}};import{hasHeritageType as k,isClassDeclaration as D}from"@ez4/common/library";import{
7
- isTypeCallback as H,isTypeFunction as F}from"@ez4/reflection";var m=o(e=>D(e)&&k(e,"Bucket.Service"),"isBucketService"),x=o(e=>H(e)||F(e),"isE\
8
- ventHandler"),S=o(e=>k(e,"Bucket.Event"),"isBucketEvent"),E=o(e=>k(e,"Bucket.Cor\
9
- s"),"isBucketCors");import{InvalidServicePropertyError as J,isModelDeclaration as K,getLinkedVariableList as L,
10
- getModelMembers as Q,getObjectMembers as U,getPropertyNumber as X,getPropertyString as Y,
11
- getServiceListener as Z,getReferenceType as _}from"@ez4/common/library";import{isModelProperty as $,
12
- isTypeObject as ee,isTypeReference as re}from"@ez4/reflection";import{IncompleteTypeError as N,IncorrectTypeError as V,InvalidTypeError as q}from"@ez4/common/library";var l=class extends N{static{o(this,"IncompleteEventError")}constructor(t,r){super(
13
- "Incomplete bucket event",t,r)}},u=class extends q{static{o(this,"InvalidEventTy\
14
- peError")}constructor(t){super("Invalid bucket event type",void 0,"Bucket.Event",
15
- t)}},f=class extends V{constructor(r,i){super("Incorrect bucket event type",r,"B\
16
- ucket.Event",i);this.eventType=r}static{o(this,"IncorrectEventTypeError")}};import{getFunctionSignature as G}from"@ez4/common/library";import{IncompleteTypeError as W}from"@ez4/common/library";var d=class extends W{static{o(this,"IncompleteHandlerError")}constructor(t){super(
17
- "Incomplete event handler",[],t)}};var B=o((e,t)=>{if(!x(e))return;let r=G(e);return r||t.push(new d(e.file)),r},"g\
18
- etEventHandler");var C=o((e,t,r,i)=>{if(!re(e))return M(e,t,i);let n=_(e,r);if(n)return M(n,t,i)},
19
- "getBucketEvent"),te=o(e=>!!e.handler,"isValidEvent"),M=o((e,t,r)=>{if(ee(e))return h(
20
- e,t,U(e),r);if(!K(e)){r.push(new u(t.file));return}if(!S(e)){r.push(new f(e.name,
21
- e.file));return}return h(e,t,Q(e),r)},"getTypeEvent"),h=o((e,t,r,i)=>{let n={},c=new Set(
22
- ["handler"]);for(let s of r)if(!(!$(s)||s.inherited))switch(s.name){default:i.push(
23
- new J(t.name,s.name,e.file));break;case"path":n.path=Y(s);break;case"listener":n.
24
- listener=Z(s.value,i);break;case"handler":n.handler=B(s.value,i);break;case"memo\
25
- ry":case"logRetention":case"timeout":n[s.name]=X(s);break;case"variables":n.variables=
26
- L(s,i);break}if(te(n))return n;i.push(new l([...c],e.file))},"getTypeFromMembers");import{InvalidServicePropertyError as se,isModelDeclaration as ce,getLiteralString as pe,
27
- getModelMembers as ae,getObjectMembers as me,getPropertyNumber as le,getPropertyTuple as ue,
28
- getReferenceType as fe}from"@ez4/common/library";import{isModelProperty as de,isTypeObject as ye,
29
- isTypeReference as ve}from"@ez4/reflection";import{IncompleteTypeError as oe,IncorrectTypeError as ne,InvalidTypeError as ie}from"@ez4/common/library";var y=class extends oe{static{o(this,"IncompleteCorsError")}constructor(t,r){super(
30
- "Incomplete bucket CORS",t,r)}},v=class extends ie{static{o(this,"InvalidCorsTyp\
31
- eError")}constructor(t){super("Invalid bucket CORS type",void 0,"Bucket.Cors",t)}},
32
- g=class extends ne{constructor(r,i){super("Incorrect bucket CORS type",r,"Bucket\
33
- .Cors",i);this.fallbackType=r}static{o(this,"IncorrectCorsTypeError")}};var P=o((e,t,r,i)=>{if(!ve(e))return I(e,t,i);let n=fe(e,r);if(n)return I(n,t,i)},
34
- "getBucketCors"),ge=o(e=>!!e.allowOrigins?.length,"isValidCors"),I=o((e,t,r)=>{if(ye(
35
- e))return w(e,t,me(e),r);if(!ce(e)){r.push(new v(t.file));return}if(!E(e)){r.push(
36
- new g(e.name,e.file));return}return w(e,t,ae(e),r)},"getTypeCors"),w=o((e,t,r,i)=>{
37
- let n={},c=new Set(["allowOrigins"]);for(let s of r)if(!(!de(s)||s.inherited))switch(s.
38
- name){default:i.push(new se(t.name,s.name,e.file));break;case"allowOrigins":case"\
39
- allowMethods":case"allowHeaders":case"exposeHeaders":n[s.name]=ke(s);break;case"\
40
- maxAge":n.maxAge=le(s);break}if(ge(n))return n;i.push(new y([...c],e.file))},"ge\
41
- tTypeFromMembers"),ke=o(e=>{let t=ue(e)??[],r=[];for(let i of t){let n=pe(i);n&&
42
- r.push(n)}return r},"getStringValues");var O=o(e=>{let t={},r=[];for(let i in e){let n=e[i];if(!m(n)||xe(n))continue;let c=b(
43
- n.name),s=n.file;for(let p of Be(n))if(!(!Ce(p)||p.inherited))switch(p.name){default:
44
- r.push(new be(c.name,p.name,s));break;case"client":break;case"localPath":case"gl\
45
- obalName":c[p.name]=he(p);break;case"autoExpireDays":c.autoExpireDays=Me(p);break;case"\
46
- events":c.events=C(p.value,n,e,r);break;case"cors":c.cors=P(p.value,n,e,r);break;case"\
47
- variables":c.variables=Se(p,r);break;case"services":c.services=Ee(p,e,r);break}if(!we(
48
- c)){r.push(new a([],s));continue}if(t[n.name]){r.push(new Te(n.name,s));continue}
49
- t[n.name]=c}return{services:t,errors:r}},"getBucketServices"),we=o(e=>Ie(e,["var\
50
- iables","services"]),"isCompleteService");var R=o(e=>m(e)?e.name:null,"getLinkedService");var Ar=o(()=>{Pe(),Oe("@ez4/bucket",{"metadata:getServices":O,"metadata:getLinke\
51
- dService":R})},"registerTriggers");export{y as IncompleteCorsError,l as IncompleteEventError,a as IncompleteServiceError,
52
- g as IncorrectCorsTypeError,f as IncorrectEventTypeError,v as InvalidCorsTypeError,
53
- u as InvalidEventTypeError,T as ServiceType,b as createBucketService,P as getBucketCors,
54
- C as getBucketEvent,O as getBucketServices,B as getEventHandler,Ae as isBucketService,
55
- Ar as registerTriggers};
1
+ var w=Object.defineProperty;var o=(e,r)=>w(e,"name",{value:r,configurable:!0});import{registerTriggers as ze}from"@ez4/common/library";import{tryCreateTrigger as Pe}from"@ez4/project/library";import{DuplicateServiceError as Te,InvalidServicePropertyError as xe,isExternalDeclaration as Se,
2
+ isClassDeclaration as Me,getLinkedVariableList as he,getLinkedServiceList as Ee,
3
+ getModelMembers as Be,getPropertyNumber as Ce,getPropertyString as Ie,hasHeritageType as we}from"@ez4/common/library";
4
+ import{isModelProperty as Re}from"@ez4/reflection";import{isObjectWith as Oe}from"@ez4/utils";import{IncompleteTypeError as R}from"@ez4/common/library";var p=class extends R{static{o(this,"IncompleteServiceError")}constructor(r,t){super(
5
+ "Incomplete bucket service",r,t)}};import{InvalidServicePropertyError as N,isModelDeclaration as V,getLinkedVariableList as L,
6
+ getModelMembers as W,getObjectMembers as q,getPropertyNumber as G,getPropertyString as J,
7
+ getServiceListener as K,getServiceArchitecture as Q,getServiceRuntime as U,getReferenceType as X,
8
+ hasHeritageType as Y}from"@ez4/common/library";import{isModelProperty as Z,isTypeObject as _,
9
+ isTypeReference as $}from"@ez4/reflection";import{isObjectWith as ee}from"@ez4/utils";import{IncompleteTypeError as O,IncorrectTypeError as A,InvalidTypeError as z}from"@ez4/common/library";var l=class extends O{static{o(this,"IncompleteEventError")}constructor(r,t){super(
10
+ "Incomplete bucket event",r,t)}},m=class extends z{static{o(this,"InvalidEventTy\
11
+ peError")}constructor(r){super("Invalid bucket event type",void 0,"Bucket.Event",
12
+ r)}},u=class extends A{constructor(t,c){super("Incorrect bucket event type",t,"B\
13
+ ucket.Event",c);this.eventType=t}static{o(this,"IncorrectEventTypeError")}};import{isTypeCallback as D,isTypeFunction as j}from"@ez4/reflection";import{getFunctionSignature as H}from"@ez4/common/library";import{IncompleteTypeError as P}from"@ez4/common/library";var f=class extends P{static{o(this,"IncompleteHandlerError")}constructor(r){super(
14
+ "Incomplete event handler",[],r)}};var F=o(e=>D(e)||j(e),"isEventHandlerDeclaration"),b=o((e,r)=>{if(!F(e))return;let t=H(
15
+ e);return t||r.push(new f(e.file)),t},"getEventHandlerMetadata");var re=o(e=>Y(e,"Bucket.Event"),"isBucketEventDeclaration"),x=o((e,r,t,c)=>{if(!$(
16
+ e))return k(e,r,c);let n=X(e,t);if(n)return k(n,r,c)},"getBucketEventMetadata"),
17
+ te=o(e=>ee(e,["handler"]),"isCompleteEvent"),k=o((e,r,t)=>{if(_(e))return T(e,r,
18
+ q(e),t);if(!V(e)){t.push(new m(r.file));return}if(!re(e)){t.push(new u(e.name,e.
19
+ file));return}return T(e,r,W(e),t)},"getTypeEvent"),T=o((e,r,t,c)=>{let n={},s=new Set(
20
+ ["handler"]);for(let i of t)if(!(!Z(i)||i.inherited))switch(i.name){default:{c.push(
21
+ new N(r.name,i.name,e.file));break}case"path":{n.path=J(i);break}case"listener":{
22
+ n.listener=K(i.value,c);break}case"handler":{n.handler=b(i.value,c);break}case"m\
23
+ emory":case"logRetention":case"timeout":{n[i.name]=G(i);break}case"architecture":{
24
+ n[i.name]=Q(i);break}case"runtime":{n[i.name]=U(i);break}case"variables":{n.variables=
25
+ L(i,c);break}}if(!te(n)){c.push(new l([...s],e.file));return}return n},"getTypeF\
26
+ romMembers");import{InvalidServicePropertyError as ce,isModelDeclaration as se,getModelMembers as ae,
27
+ getObjectMembers as pe,getPropertyNumber as le,getPropertyStringList as me,getReferenceType as ue,
28
+ hasHeritageType as fe}from"@ez4/common/library";import{isModelProperty as de,isTypeObject as ye,
29
+ isTypeReference as ve}from"@ez4/reflection";import{IncompleteTypeError as oe,IncorrectTypeError as ne,InvalidTypeError as ie}from"@ez4/common/library";var d=class extends oe{static{o(this,"IncompleteCorsError")}constructor(r,t){super(
30
+ "Incomplete bucket CORS",r,t)}},y=class extends ie{static{o(this,"InvalidCorsTyp\
31
+ eError")}constructor(r){super("Invalid bucket CORS type",void 0,"Bucket.Cors",r)}},
32
+ v=class extends ne{constructor(t,c){super("Incorrect bucket CORS type",t,"Bucket\
33
+ .Cors",c);this.fallbackType=t}static{o(this,"IncorrectCorsTypeError")}};var ge=o(e=>fe(e,"Bucket.Cors"),"isBucketCorsDeclaration"),h=o((e,r,t,c)=>{if(!ve(
34
+ e))return S(e,r,c);let n=ue(e,t);if(n)return S(n,r,c)},"getBucketCorsMetadata"),
35
+ be=o(e=>!!e.allowOrigins?.length,"isCompleteCors"),S=o((e,r,t)=>{if(ye(e))return M(
36
+ e,r,pe(e),t);if(!se(e)){t.push(new y(r.file));return}if(!ge(e)){t.push(new v(e.name,
37
+ e.file));return}return M(e,r,ae(e),t)},"getTypeCors"),M=o((e,r,t,c)=>{let n={},s=new Set(
38
+ ["allowOrigins"]);for(let i of t)if(!(!de(i)||i.inherited))switch(i.name){default:{
39
+ c.push(new ce(r.name,i.name,e.file));break}case"allowOrigins":case"allowMethods":case"\
40
+ allowHeaders":case"exposeHeaders":{n[i.name]=me(i);break}case"maxAge":{n.maxAge=
41
+ le(i);break}}if(!be(n)){c.push(new d([...s],e.file));return}return n},"getTypeFr\
42
+ omMembers");import{createServiceMetadata as ke}from"@ez4/project/library";var E="@ez4/bucket",ur=o(e=>e.type===E,"isBucketService"),B=o(e=>({...ke(E,e),variables:{},
43
+ services:{}}),"createBucketService");var g=o(e=>Me(e)&&we(e,"Bucket.Service"),"isBucketServiceDeclaration"),C=o(e=>{let r={},
44
+ t=[];for(let c in e){let n=e[c];if(!g(n)||Se(n))continue;let s=B(n.name),i=n.file;
45
+ for(let a of Be(n))if(!(!Re(a)||a.inherited))switch(a.name){default:{t.push(new xe(
46
+ s.name,a.name,i));break}case"client":break;case"localPath":case"globalName":{s[a.
47
+ name]=Ie(a);break}case"autoExpireDays":{s.autoExpireDays=Ce(a);break}case"events":{
48
+ s.events=x(a.value,n,e,t);break}case"cors":{s.cors=h(a.value,n,e,t);break}case"v\
49
+ ariables":{s.variables=he(a,t);break}case"services":{s.services=Ee(a,e,t);break}}
50
+ if(!Ae(s)){t.push(new p([],i));continue}if(r[n.name]){t.push(new Te(n.name,i));continue}
51
+ r[n.name]=s}return{services:r,errors:t}},"getBucketServicesMetadata"),Ae=o(e=>Oe(
52
+ e,["variables","services"]),"isCompleteService");var I=o(e=>g(e)?e.name:null,"getLinkedService");var Or=o(()=>{ze(),Pe("@ez4/bucket",{"metadata:getServices":C,"metadata:getLinke\
53
+ dService":I})},"registerTriggers");export{d as IncompleteCorsError,l as IncompleteEventError,p as IncompleteServiceError,
54
+ v as IncorrectCorsTypeError,u as IncorrectEventTypeError,y as InvalidCorsTypeError,
55
+ m as InvalidEventTypeError,E as ServiceType,B as createBucketService,h as getBucketCorsMetadata,
56
+ x as getBucketEventMetadata,C as getBucketServicesMetadata,b as getEventHandlerMetadata,
57
+ ge as isBucketCorsDeclaration,re as isBucketEventDeclaration,ur as isBucketService,
58
+ g as isBucketServiceDeclaration,F as isEventHandlerDeclaration,Or as registerTriggers};
56
59
  //# sourceMappingURL=library.mjs.map
package/dist/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},a=(t,e,r,i)=>{if(e&&
2
- typeof e=="object"||typeof e=="function")for(let o of s(e))!v.call(t,o)&&o!==r&&
3
- n(t,o,{get:()=>e[o],enumerable:!(i=p(e,o))||i.enumerable});return t};var y=t=>a(n({},"__esModule",{value:!0}),t);var d={};u(d,{Bucket:()=>m,BucketEventType:()=>c});module.exports=y(d);var c=(r=>(r.Create="create",r.Delete="delete",r))(c||{});var m;(t=>{})(m||={});0&&(module.exports={Bucket,BucketEventType});
1
+ "use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},l=(t,e,r,m)=>{if(e&&
2
+ typeof e=="object"||typeof e=="function")for(let o of c(e))!a.call(t,o)&&o!==r&&
3
+ n(t,o,{get:()=>e[o],enumerable:!(m=s(e,o))||m.enumerable});return t};var y=t=>l(n({},"__esModule",{value:!0}),t);var u={};v(u,{Bucket:()=>i,BucketEventType:()=>p});module.exports=y(u);var i;(t=>{})(i||={});var p=(r=>(r.Create="create",r.Delete="delete",r))(p||{});0&&(module.exports={Bucket,BucketEventType});
4
4
  //# sourceMappingURL=main.cjs.map
package/dist/main.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { BucketEventType } from './services/common';
2
1
  export * from './services/contract';
3
2
  export * from './services/client';
3
+ export * from './types/event';
package/dist/main.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var t=(e=>(e.Create="create",e.Delete="delete",e))(t||{});var r;(o=>{})(r||={});export{r as Bucket,t as BucketEventType};
1
+ var t;(o=>{})(t||={});var r=(e=>(e.Create="create",e.Delete="delete",e))(r||{});export{t as Bucket,r as BucketEventType};
2
2
  //# sourceMappingURL=main.mjs.map
@@ -1,3 +1,4 @@
1
1
  import type { AllType, ReflectionTypes, TypeModel } from '@ez4/reflection';
2
- import type { BucketCors } from '../types/common';
3
- export declare const getBucketCors: (type: AllType, parent: TypeModel, reflection: ReflectionTypes, errorList: Error[]) => BucketCors | undefined;
2
+ import type { BucketCors } from './types';
3
+ export declare const isBucketCorsDeclaration: (type: TypeModel) => boolean;
4
+ export declare const getBucketCorsMetadata: (type: AllType, parent: TypeModel, reflection: ReflectionTypes, errorList: Error[]) => BucketCors | undefined;
@@ -1,3 +1,4 @@
1
1
  import type { AllType, ReflectionTypes, TypeModel } from '@ez4/reflection';
2
- import type { BucketEvent } from '../types/common';
3
- export declare const getBucketEvent: (type: AllType, parent: TypeModel, reflection: ReflectionTypes, errorList: Error[]) => BucketEvent | undefined;
2
+ import type { BucketEvent } from './types';
3
+ export declare const isBucketEventDeclaration: (type: TypeModel) => boolean;
4
+ export declare const getBucketEventMetadata: (type: AllType, parent: TypeModel, reflection: ReflectionTypes, errorList: Error[]) => BucketEvent | undefined;
@@ -1,2 +1,3 @@
1
- import type { AllType } from '@ez4/reflection';
2
- export declare const getEventHandler: (type: AllType, errorList: Error[]) => import("@ez4/common/library").FunctionSignature | undefined;
1
+ import type { AllType, TypeCallback, TypeFunction } from '@ez4/reflection';
2
+ export declare const isEventHandlerDeclaration: (type: AllType) => type is TypeCallback | TypeFunction;
3
+ export declare const getEventHandlerMetadata: (type: AllType, errorList: Error[]) => import("@ez4/common/library").FunctionSignature | undefined;
@@ -1,6 +1,7 @@
1
- import type { ReflectionTypes } from '@ez4/reflection';
2
- import type { BucketService } from '../types/service';
3
- export declare const getBucketServices: (reflection: ReflectionTypes) => {
1
+ import type { AllType, ReflectionTypes, TypeClass } from '@ez4/reflection';
2
+ import type { BucketService } from './types';
3
+ export declare const isBucketServiceDeclaration: (type: AllType) => type is TypeClass;
4
+ export declare const getBucketServicesMetadata: (reflection: ReflectionTypes) => {
4
5
  services: Record<string, BucketService>;
5
6
  errors: Error[];
6
7
  };
@@ -1,5 +1,6 @@
1
- import type { ServiceMetadata } from '@ez4/project/library';
2
- import type { BucketCors, BucketEvent } from './common';
1
+ import type { FunctionSignature, ServiceListener } from '@ez4/common/library';
2
+ import type { LinkedVariables, ServiceMetadata } from '@ez4/project/library';
3
+ import type { ArchitectureType, RuntimeType } from '@ez4/project';
3
4
  export declare const ServiceType = "@ez4/bucket";
4
5
  export type BucketService = Omit<ServiceMetadata, 'variables' | 'services'> & Required<Pick<ServiceMetadata, 'variables' | 'services'>> & {
5
6
  type: typeof ServiceType;
@@ -10,6 +11,25 @@ export type BucketService = Omit<ServiceMetadata, 'variables' | 'services'> & Re
10
11
  events?: BucketEvent;
11
12
  cors?: BucketCors;
12
13
  };
14
+ export type BucketCors = {
15
+ allowOrigins: string[];
16
+ allowMethods?: string[];
17
+ exposeHeaders?: string[];
18
+ allowHeaders?: string[];
19
+ maxAge?: number;
20
+ };
21
+ export type EventHandler = FunctionSignature;
22
+ export type BucketEvent = {
23
+ path?: string;
24
+ listener?: ServiceListener;
25
+ handler: EventHandler;
26
+ variables?: LinkedVariables;
27
+ architecture?: ArchitectureType;
28
+ runtime?: RuntimeType;
29
+ logRetention?: number;
30
+ timeout?: number;
31
+ memory?: number;
32
+ };
13
33
  export declare const isBucketService: (service: ServiceMetadata) => service is BucketService;
14
34
  export declare const createBucketService: (name: string) => {
15
35
  variables: {};
@@ -1,7 +1,11 @@
1
1
  import type { Service as CommonService } from '@ez4/common';
2
2
  import type { LinkedVariables } from '@ez4/project/library';
3
- import type { BucketEvent, BucketHandler, BucketIncoming, BucketListener, BucketRequest } from './common';
3
+ import type { BucketIncoming } from './incoming';
4
+ import type { BucketListener } from './listener';
5
+ import type { BucketRequest } from './request';
6
+ import type { BucketHandler } from './handler';
4
7
  import type { BucketEvents } from './events';
8
+ import type { BucketEvent } from './event';
5
9
  import type { BucketCors } from './cors';
6
10
  import type { Client } from './client';
7
11
  /**
@@ -0,0 +1,22 @@
1
+ import type { BucketEventType } from '../types/event';
2
+ /**
3
+ * Bucket event.
4
+ */
5
+ export type BucketEvent = {
6
+ /**
7
+ * Type of event.
8
+ */
9
+ readonly eventType: BucketEventType;
10
+ /**
11
+ * Bucket from the event.
12
+ */
13
+ readonly bucketName: string;
14
+ /**
15
+ * Object key in the bucket.
16
+ */
17
+ readonly objectKey: string;
18
+ /**
19
+ * Size of the created object.
20
+ */
21
+ readonly objectSize?: number;
22
+ };
@@ -1,5 +1,8 @@
1
+ import type { ArchitectureType, RuntimeType } from '@ez4/project';
1
2
  import type { LinkedVariables } from '@ez4/project/library';
2
- import type { BucketEvent, BucketHandler, BucketListener } from './common';
3
+ import type { BucketListener } from './listener';
4
+ import type { BucketHandler } from './handler';
5
+ import type { BucketEvent } from './event';
3
6
  /**
4
7
  * Bucket events.
5
8
  */
@@ -32,4 +35,12 @@ export interface BucketEvents {
32
35
  * Amount of memory available (in megabytes) for the handler.
33
36
  */
34
37
  readonly memory?: number;
38
+ /**
39
+ * Architecture for the handler.
40
+ */
41
+ readonly architecture?: ArchitectureType;
42
+ /**
43
+ * Runtime for the handler.
44
+ */
45
+ readonly runtime?: RuntimeType;
35
46
  }
@@ -0,0 +1,8 @@
1
+ import type { Service } from '@ez4/common';
2
+ import type { BucketIncoming } from './incoming';
3
+ import type { BucketEvent } from './event';
4
+ import type { Bucket } from './contract';
5
+ /**
6
+ * Bucket event handler.
7
+ */
8
+ export type BucketHandler<T extends BucketEvent> = (request: BucketIncoming<T> | T, context: Service.Context<Bucket.Service>) => Promise<void> | void;
@@ -0,0 +1,6 @@
1
+ import type { BucketRequest } from './request';
2
+ import type { BucketEvent } from './event';
3
+ /**
4
+ * Incoming event.
5
+ */
6
+ export type BucketIncoming<T extends BucketEvent> = T & BucketRequest;
@@ -0,0 +1,8 @@
1
+ import type { Service } from '@ez4/common';
2
+ import type { BucketIncoming } from './incoming';
3
+ import type { BucketEvent } from './event';
4
+ import type { Bucket } from './contract';
5
+ /**
6
+ * Bucket event listener.
7
+ */
8
+ export type BucketListener<T extends BucketEvent> = (event: Service.AnyEvent<BucketIncoming<T>>, context: Service.Context<Bucket.Service>) => Promise<void> | void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Bucket request.
3
+ */
4
+ export type BucketRequest = {
5
+ /**
6
+ * Unique identifier for the request.
7
+ */
8
+ readonly requestId: string;
9
+ /**
10
+ * Unique identifier across multiple services.
11
+ */
12
+ readonly traceId?: string;
13
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Bucket event type.
3
+ */
4
+ export declare const enum BucketEventType {
5
+ Create = "create",
6
+ Delete = "delete"
7
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ez4/storage",
3
3
  "description": "EZ4: Components to build storage services",
4
- "version": "0.37.0",
4
+ "version": "0.38.0",
5
5
  "author": "Silas B.",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -46,9 +46,9 @@
46
46
  "live:publish": "npm run build && npm publish --access public"
47
47
  },
48
48
  "dependencies": {
49
- "@ez4/common": "^0.37.0",
50
- "@ez4/project": "^0.37.0",
51
- "@ez4/reflection": "^0.37.0",
52
- "@ez4/utils": "^0.37.0"
49
+ "@ez4/common": "^0.38.0",
50
+ "@ez4/project": "^0.38.0",
51
+ "@ez4/reflection": "^0.38.0",
52
+ "@ez4/utils": "^0.38.0"
53
53
  }
54
54
  }
@@ -1,5 +0,0 @@
1
- import type { AllType, TypeCallback, TypeClass, TypeFunction, TypeModel } from '@ez4/reflection';
2
- export declare const isBucketService: (type: AllType) => type is TypeClass;
3
- export declare const isEventHandler: (type: AllType) => type is TypeCallback | TypeFunction;
4
- export declare const isBucketEvent: (type: TypeModel) => boolean;
5
- export declare const isBucketCors: (type: TypeModel) => boolean;
@@ -1,51 +0,0 @@
1
- import type { Service } from '@ez4/common';
2
- import type { Bucket } from './contract';
3
- /**
4
- * Bucket event type.
5
- */
6
- export declare const enum BucketEventType {
7
- Create = "create",
8
- Delete = "delete"
9
- }
10
- /**
11
- * Bucket event.
12
- */
13
- export type BucketEvent = {
14
- /**
15
- * Type of event.
16
- */
17
- readonly eventType: BucketEventType;
18
- /**
19
- * Bucket from the event.
20
- */
21
- readonly bucketName: string;
22
- /**
23
- * Object key in the bucket.
24
- */
25
- readonly objectKey: string;
26
- /**
27
- * Size of the created object.
28
- */
29
- readonly objectSize?: number;
30
- };
31
- /**
32
- * Incoming event.
33
- */
34
- export type BucketIncoming<T extends BucketEvent> = T & BucketRequest;
35
- /**
36
- * Bucket request.
37
- */
38
- export type BucketRequest = {
39
- /**
40
- * Request tracking Id.
41
- */
42
- readonly requestId: string;
43
- };
44
- /**
45
- * Bucket event listener.
46
- */
47
- export type BucketListener<T extends BucketEvent> = (event: Service.AnyEvent<BucketIncoming<T>>, context: Service.Context<Bucket.Service>) => Promise<void> | void;
48
- /**
49
- * Bucket event handler.
50
- */
51
- export type BucketHandler<T extends BucketEvent> = (request: BucketIncoming<T> | T, context: Service.Context<Bucket.Service>) => Promise<void> | void;
@@ -1,19 +0,0 @@
1
- import type { FunctionSignature, ServiceListener } from '@ez4/common/library';
2
- import type { LinkedVariables } from '@ez4/project/library';
3
- export type BucketCors = {
4
- allowOrigins: string[];
5
- allowMethods?: string[];
6
- exposeHeaders?: string[];
7
- allowHeaders?: string[];
8
- maxAge?: number;
9
- };
10
- export type EventHandler = FunctionSignature;
11
- export type BucketEvent = {
12
- path?: string;
13
- listener?: ServiceListener;
14
- handler: EventHandler;
15
- variables?: LinkedVariables;
16
- logRetention?: number;
17
- timeout?: number;
18
- memory?: number;
19
- };