@ez4/database 0.15.0 → 0.17.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 +105 -96
- package/dist/library.mjs +107 -94
- package/dist/main.cjs +6 -5
- package/dist/main.d.ts +1 -0
- package/dist/main.mjs +3 -2
- package/dist/metadata/engine.d.ts +3 -0
- package/dist/metadata/stream.d.ts +2 -4
- package/dist/metadata/table.d.ts +2 -2
- package/dist/metadata/utils.d.ts +1 -0
- package/dist/services/client.d.ts +4 -3
- package/dist/services/database.d.ts +10 -2
- package/dist/services/engine.d.ts +14 -0
- package/dist/services/query.d.ts +36 -8
- package/dist/services/relations.d.ts +5 -5
- package/dist/services/table.d.ts +8 -8
- package/dist/services/transaction.d.ts +19 -3
- package/dist/types/engine.d.ts +5 -0
- package/dist/types/service.d.ts +3 -2
- package/package.json +7 -7
package/dist/library.cjs
CHANGED
|
@@ -1,101 +1,110 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
typeof t=="object"||typeof t=="function")for(let
|
|
3
|
-
|
|
4
|
-
IncompleteTableError:()=>
|
|
5
|
-
IncorrectSchemaTypeError:()
|
|
6
|
-
InvalidIndexTypeError:()=>
|
|
7
|
-
InvalidRelationColumnError:()=>
|
|
8
|
-
InvalidRelationsTypeError:()=>
|
|
9
|
-
ServiceType:()=>
|
|
10
|
-
isDatabaseService:()=>
|
|
11
|
-
super("Invalid table relations type",void 0,"Database.Relations",t)}},
|
|
12
|
-
super("Incorrect table relations type",r,"Database.Relations",
|
|
13
|
-
r}},
|
|
14
|
-
the pattern 'column@alias'.`,
|
|
15
|
-
super(`Relation table ${r} don't exists.`,
|
|
16
|
-
super(`Relation column ${r} don't exists.`,
|
|
17
|
-
super(`Relation alias ${r} can't override table columns.`,
|
|
18
|
-
r}};var
|
|
19
|
-
super("Incomplete database service",t,r)}};var
|
|
20
|
-
e)&&(0,
|
|
21
|
-
(0,
|
|
22
|
-
e),
|
|
23
|
-
e,"Database.
|
|
24
|
-
e,"Database.Stream");var
|
|
25
|
-
super("Incomplete database table",t,r)}};var
|
|
26
|
-
super("Invalid table indexes type",void 0,"Database.Indexes",t)}},
|
|
27
|
-
super("Incorrect table indexes type",r,"Database.Indexes",
|
|
28
|
-
|
|
29
|
-
t follow one of the Index options.`,
|
|
30
|
-
super(`Invalid index reference, ${r} must be valid column.`,
|
|
31
|
-
return
|
|
32
|
-
e),r):(0,
|
|
33
|
-
new
|
|
34
|
-
if(!(0,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
return
|
|
39
|
-
e),r):(0,
|
|
40
|
-
new
|
|
41
|
-
if(!(0,
|
|
42
|
-
|
|
43
|
-
columns:
|
|
44
|
-
return
|
|
45
|
-
super("Invalid table schema type",void 0,"Database.Schema",t)}}
|
|
46
|
-
super("Incorrect table schema type",r,"Database.Schema",
|
|
47
|
-
return
|
|
48
|
-
e)?
|
|
49
|
-
|
|
50
|
-
null};var
|
|
51
|
-
super("Incomplete table stream",t,r)}}
|
|
52
|
-
super("Invalid table stream type",void 0,"Database.Stream",t)}},
|
|
53
|
-
super("Incorrect table stream type",r,"Database.Stream",
|
|
54
|
-
super("Incomplete stream handler",t,r)}};var
|
|
55
|
-
return e.description&&(
|
|
56
|
-
ame"),(
|
|
57
|
-
0&&
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
e),r,
|
|
61
|
-
let
|
|
62
|
-
inherited))switch(
|
|
63
|
-
name,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
e),t,
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
o)
|
|
86
|
-
|
|
87
|
-
continue
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
push(new
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
"use strict";var L=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var r in t)L(e,r,{get:t[r],enumerable:!0})},_e=(e,t,r,n)=>{if(t&&
|
|
2
|
+
typeof t=="object"||typeof t=="function")for(let o of qe(t))!Ve.call(e,o)&&o!==r&&
|
|
3
|
+
L(e,o,{get:()=>t[o],enumerable:!(n=$e(t,o))||n.enumerable});return e};var Be=e=>_e(L({},"__esModule",{value:!0}),e);var nr={};Ue(nr,{IncompleteHandlerError:()=>_,IncompleteServiceError:()=>A,IncompleteStreamError:()=>q,
|
|
4
|
+
IncompleteTableError:()=>x,IncorrectIndexesTypeError:()=>C,IncorrectRelationsTypeError:()=>w,
|
|
5
|
+
IncorrectSchemaTypeError:()=>$,IncorrectStreamTypeError:()=>U,InvalidIndexReferenceError:()=>H,
|
|
6
|
+
InvalidIndexTypeError:()=>N,InvalidIndexesTypeError:()=>z,InvalidRelationAliasError:()=>R,
|
|
7
|
+
InvalidRelationColumnError:()=>M,InvalidRelationTableError:()=>O,InvalidRelationTargetError:()=>k,
|
|
8
|
+
InvalidRelationsTypeError:()=>P,InvalidSchemaTypeError:()=>F,InvalidStreamTypeError:()=>V,
|
|
9
|
+
ServiceType:()=>B,getDatabaseServices:()=>te,getDatabaseTable:()=>re,getTableSchema:()=>ee,
|
|
10
|
+
isDatabaseService:()=>Ge,registerTriggers:()=>tr});module.exports=Be(nr);var Ce=require("@ez4/common/library"),Ne=require("@ez4/schema/library"),He=require("@ez4/project/library");var c=require("@ez4/common/library"),Re=require("@ez4/reflection");var y=require("@ez4/common/library"),P=class extends y.InvalidTypeError{constructor(t){
|
|
11
|
+
super("Invalid table relations type",void 0,"Database.Relations",t)}},w=class extends y.IncorrectTypeError{constructor(r,n){
|
|
12
|
+
super("Incorrect table relations type",r,"Database.Relations",n);this.schemaType=
|
|
13
|
+
r}},k=class extends y.TypeError{constructor(r,n){super(`Target ${r} must follow \
|
|
14
|
+
the pattern 'column@alias'.`,n);this.relationSource=r}},O=class extends y.TypeError{constructor(r,n){
|
|
15
|
+
super(`Relation table ${r} don't exists.`,n);this.relationTable=r}},M=class extends y.TypeError{constructor(r,n){
|
|
16
|
+
super(`Relation column ${r} don't exists.`,n);this.relationColumn=r}},R=class extends y.TypeError{constructor(r,n){
|
|
17
|
+
super(`Relation alias ${r} can't override table columns.`,n);this.relationAlias=
|
|
18
|
+
r}};var oe=require("@ez4/common/library"),A=class extends oe.IncompleteTypeError{constructor(t,r){
|
|
19
|
+
super("Incomplete database service",t,r)}};var B="@ez4/database",Ge=e=>e.type===B;var u=require("@ez4/common/library"),G=require("@ez4/reflection"),J=e=>(0,u.isClassDeclaration)(
|
|
20
|
+
e)&&(0,u.hasHeritageType)(e,"Database.Service"),ae=e=>(0,u.isModelDeclaration)(e)&&
|
|
21
|
+
(0,u.hasHeritageType)(e,"Database.Engine"),se=e=>(0,u.isModelDeclaration)(e)&&(0,u.hasHeritageType)(
|
|
22
|
+
e,"Database.Table"),ie=e=>(0,G.isTypeCallback)(e)||(0,G.isTypeFunction)(e),le=e=>(0,u.hasHeritageType)(
|
|
23
|
+
e,"Database.Relations"),pe=e=>(0,u.hasHeritageType)(e,"Database.Indexes"),me=e=>(0,u.hasHeritageType)(
|
|
24
|
+
e,"Database.Schema"),ce=e=>(0,u.hasHeritageType)(e,"Database.Stream");var T=require("@ez4/common/library"),v=require("@ez4/reflection");var ue=require("@ez4/common/library"),x=class extends ue.IncompleteTypeError{constructor(t,r){
|
|
25
|
+
super("Incomplete database table",t,r)}};var g=require("@ez4/common/library"),z=class extends g.InvalidTypeError{constructor(t){
|
|
26
|
+
super("Invalid table indexes type",void 0,"Database.Indexes",t)}},C=class extends g.IncorrectTypeError{constructor(r,n){
|
|
27
|
+
super("Incorrect table indexes type",r,"Database.Indexes",n);this.schemaType=r}},
|
|
28
|
+
N=class extends g.TypeError{constructor(r,n){super(`Invalid index type, ${r} mus\
|
|
29
|
+
t follow one of the Index options.`,n);this.indexName=r}},H=class extends g.TypeError{constructor(r,n){
|
|
30
|
+
super(`Invalid index reference, ${r} must be valid column.`,n);this.indexName=r}};var d=require("@ez4/common/library"),S=require("@ez4/reflection");var fe=(e,t,r,n)=>{if(!(0,S.isTypeReference)(e))return be(e,t,n);let o=(0,d.getReferenceType)(
|
|
31
|
+
e,r);return o?be(o,t,n):null},be=(e,t,r)=>(0,S.isTypeObject)(e)?de(e,(0,d.getObjectMembers)(
|
|
32
|
+
e),r):(0,d.isModelDeclaration)(e)?le(e)?de(e,(0,d.getModelMembers)(e),r):(r.push(
|
|
33
|
+
new w(e.name,e.file)),null):(r.push(new P(t.file)),null),de=(e,t,r)=>{let n=[];for(let o of t){
|
|
34
|
+
if(!(0,S.isModelProperty)(o)||o.inherited)continue;let a=(0,d.getPropertyString)(
|
|
35
|
+
o),s=o.name;if(!a)return r.push(new k(s,e.file)),null;let[i,l]=s.split("@",2),[p,
|
|
36
|
+
j]=a.split(":",2);n.push({sourceTable:p,sourceColumn:j,targetColumn:i,targetAlias:l})}
|
|
37
|
+
return n};var f=require("@ez4/common/library"),I=require("@ez4/reflection");var xe=(e,t,r,n)=>{if(!(0,I.isTypeReference)(e))return Te(e,t,n);let o=(0,f.getReferenceType)(
|
|
38
|
+
e,r);return o?Te(o,t,n):null},Te=(e,t,r)=>(0,I.isTypeObject)(e)?ye(e,(0,f.getObjectMembers)(
|
|
39
|
+
e),r):(0,f.isModelDeclaration)(e)?pe(e)?ye(e,(0,f.getModelMembers)(e),r):(r.push(
|
|
40
|
+
new C(e.name,e.file)),null):(r.push(new z(t.file)),null),ye=(e,t,r)=>{let n=[];for(let o of t){
|
|
41
|
+
if(!(0,I.isModelProperty)(o)||o.inherited)continue;let a=o.name,s=(0,f.getPropertyString)(
|
|
42
|
+
o);switch(s){case"primary":case"secondary":case"unique":case"ttl":n.push({name:a,
|
|
43
|
+
columns:a.split(":"),type:s});break;default:return r.push(new N(a,e.file)),null}}
|
|
44
|
+
return n};var Q=require("@ez4/common/library"),W=require("@ez4/schema/library"),X=require("@ez4/reflection");var K=require("@ez4/common/library"),F=class extends K.InvalidTypeError{constructor(t){
|
|
45
|
+
super("Invalid table schema type",void 0,"Database.Schema",t)}},$=class extends K.IncorrectTypeError{constructor(r,n){
|
|
46
|
+
super("Incorrect table schema type",r,"Database.Schema",n);this.schemaType=r}};var ee=(e,t,r,n)=>{if(!(0,X.isTypeReference)(e))return ge(e,t,r,n);let o=(0,Q.getReferenceType)(
|
|
47
|
+
e,r);return o?ge(o,t,r,n):null},ge=(e,t,r,n)=>(0,X.isTypeObject)(e)?Me(e,r):(0,Q.isModelDeclaration)(
|
|
48
|
+
e)?me(e)?Me(e,r):(n.push(new $(e.name,e.file)),null):(n.push(new F(t.file)),null),
|
|
49
|
+
Me=(e,t)=>{let r=(0,W.getObjectSchema)(e,t);return r&&(0,W.isObjectSchema)(r)?r:
|
|
50
|
+
null};var m=require("@ez4/common/library"),D=require("@ez4/reflection");var h=require("@ez4/common/library"),q=class extends h.IncompleteTypeError{constructor(t,r){
|
|
51
|
+
super("Incomplete table stream",t,r)}},V=class extends h.InvalidTypeError{constructor(t){
|
|
52
|
+
super("Invalid table stream type",void 0,"Database.Stream",t)}},U=class extends h.IncorrectTypeError{constructor(r,n){
|
|
53
|
+
super("Incorrect table stream type",r,"Database.Stream",n);this.streamType=r}};var Se=require("@ez4/common/library"),_=class extends Se.IncompleteTypeError{constructor(t,r){
|
|
54
|
+
super("Incomplete stream handler",t,r)}};var Ie=(e,t,r)=>{if(!ie(e))return null;let n={},o=new Set(["name","file","change"]);
|
|
55
|
+
return e.description&&(n.description=e.description),(n.name=e.name)&&o.delete("n\
|
|
56
|
+
ame"),(n.file=e.file)&&o.delete("file"),e.parameters&&o.delete("change"),o.size===
|
|
57
|
+
0&&Je(n)?n:(r.push(new _([...o],e.file)),null)},Je=e=>!!e.name&&!!e.file;var ve=(e,t,r,n)=>{if(!(0,D.isTypeReference)(e))return he(e,t,r,n);let o=(0,m.getReferenceType)(
|
|
58
|
+
e,r);return o?he(o,t,r,n):null},Ke=e=>!!e.handler,he=(e,t,r,n)=>(0,D.isTypeObject)(
|
|
59
|
+
e)?De(e,t,(0,m.getObjectMembers)(e),r,n):(0,m.isModelDeclaration)(e)?ce(e)?De(e,
|
|
60
|
+
t,(0,m.getModelMembers)(e),r,n):(n.push(new U(e.name,e.file)),null):(n.push(new V(
|
|
61
|
+
t.file)),null),De=(e,t,r,n,o)=>{let a={},s=new Set(["handler"]);for(let i of r)if(!(!(0,D.isModelProperty)(
|
|
62
|
+
i)||i.inherited))switch(i.name){default:o.push(new m.InvalidServicePropertyError(
|
|
63
|
+
t.name,i.name,e.file));break;case"handler":a.handler=Ie(i.value,n,o);break;case"\
|
|
64
|
+
listener":a.listener=(0,m.getServiceListener)(i.value,o);break;case"memory":case"\
|
|
65
|
+
timeout":a[i.name]=(0,m.getPropertyNumber)(i);break;case"variables":a.variables=
|
|
66
|
+
(0,m.getLinkedVariableList)(i,o);break}return Ke(a)?a:(o.push(new q([...s],e.file)),
|
|
67
|
+
null)};var re=(e,t,r,n)=>{if(!(0,v.isTypeReference)(e))return Ee(e,t,r,n);let o=(0,T.getReferenceType)(
|
|
68
|
+
e,r);return o?Ee(o,t,r,n):null},Qe=e=>!!e.name&&!!e.schema&&!!e.indexes,Ee=(e,t,r,n)=>se(
|
|
69
|
+
e)?je(e,t,(0,T.getModelMembers)(e),r,n):(0,v.isTypeObject)(e)?je(e,t,(0,T.getObjectMembers)(
|
|
70
|
+
e),r,n):null,je=(e,t,r,n,o)=>{let a={},s=new Set(["name","schema","indexes"]);for(let l of r)
|
|
71
|
+
if(!(!(0,v.isModelProperty)(l)||l.inherited))switch(l.name){default:o.push(new T.InvalidServicePropertyError(
|
|
72
|
+
t.name,l.name,e.file));break;case"name":(a.name=(0,T.getPropertyString)(l))&&s.delete(
|
|
73
|
+
l.name);break;case"schema":(a.schema=ee(l.value,e,n,o))&&s.delete(l.name);break;case"\
|
|
74
|
+
indexes":(a.indexes=xe(l.value,e,n,o))&&s.delete(l.name);break;case"relations":a.
|
|
75
|
+
relations=fe(l.value,e,n,o);break;case"stream":a.stream=ve(l.value,t,n,o);break}
|
|
76
|
+
if(!Qe(a))return o.push(new x([...s],e.file)),null;let i=We(e,a.indexes,a.schema);
|
|
77
|
+
return i.length?(o.push(...i),null):a},We=(e,t,r)=>{let n=r.properties,o=[];for(let{
|
|
78
|
+
name:a,columns:s}of t)s.some(l=>!n[l])&&o.push(new H(a,e.file));return o};var b=require("@ez4/common/library"),E=require("@ez4/reflection");var ke=(e,t,r,n)=>{if(!(0,E.isTypeReference)(e))return Pe(e,t,n);let o=(0,b.getReferenceType)(
|
|
79
|
+
e,r);return o?Pe(o,t,n):null},Xe=e=>!!e.name&&!!e.transaction,Pe=(e,t,r)=>ae(e)?
|
|
80
|
+
we(e,t,(0,b.getModelMembers)(e),r):(0,E.isTypeObject)(e)?we(e,t,(0,b.getObjectMembers)(
|
|
81
|
+
e),r):null,we=(e,t,r,n)=>{let o={},a=new Set(["name","transaction"]);for(let s of r)
|
|
82
|
+
if(!(!(0,E.isModelProperty)(s)||s.inherited))switch(s.name){default:n.push(new b.InvalidServicePropertyError(
|
|
83
|
+
t.name,s.name,e.file));break;case"name":(o.name=(0,b.getPropertyString)(s))&&a.delete(
|
|
84
|
+
s.name);break;case"transaction":(o.transaction=Ye(s))&&a.delete(s.name);break}return Xe(
|
|
85
|
+
o)?o:(n.push(new x([...a],e.file)),null)},Ye=e=>{let t=(0,b.getPropertyString)(e);
|
|
86
|
+
switch(t){case"interactive":case"static":return t}return null};var te=e=>{let t={},r=[];for(let n in e){let o=e[n];if(!J(o)||(0,c.isExternalStatement)(
|
|
87
|
+
o))continue;let a={type:B,extras:{}},s=new Set(["engine","tables"]),i=o.file;a.name=
|
|
88
|
+
o.name;for(let p of(0,c.getModelMembers)(o))if(!(!(0,Re.isModelProperty)(p)||p.inherited))
|
|
89
|
+
switch(p.name){default:r.push(new c.InvalidServicePropertyError(a.name,p.name,i));
|
|
90
|
+
break;case"engine":(a.engine=ke(p.value,o,e,r))&&s.delete(p.name);break;case"tab\
|
|
91
|
+
les":(a.tables=Le(p,o,e,r))&&s.delete(p.name);break;case"variables":a.variables=
|
|
92
|
+
(0,c.getLinkedVariableList)(p,r);break;case"services":a.services=(0,c.getLinkedServiceList)(
|
|
93
|
+
p,e,r);break}if(!Ze(a)){r.push(new A([...s],i));continue}let l=er(o,a.tables);if(l.
|
|
94
|
+
length){r.push(...l);continue}if(t[o.name]){r.push(new c.DuplicateServiceError(o.
|
|
95
|
+
name,i));continue}t[o.name]=a}return{services:t,errors:r}},Ze=e=>!!e.name&&!!e.tables&&
|
|
96
|
+
!!e.extras,Le=(e,t,r,n)=>{let o=(0,c.getPropertyTuple)(e)??[],a=[];for(let s of o){
|
|
97
|
+
let i=re(s,t,r,n);i&&a.push(i)}return a},er=(e,t)=>{let r=rr(t),n=[];for(let{relations:o,
|
|
98
|
+
schema:a,indexes:s}of t){if(!o)continue;let i=a.properties;for(let l of o){let{sourceTable:p,
|
|
99
|
+
sourceColumn:j,targetColumn:Y,targetAlias:ne}=l;i[Y]||n.push(new M(Y,e.file)),i[ne]&&
|
|
100
|
+
n.push(new R(ne,e.file));let Z=r[p]?.schema.properties;Z||n.push(new O(p,e.file)),
|
|
101
|
+
Z&&!Z[j]&&n.push(new M(j,e.file));let Fe=r[p]?.indexes??[];l.sourceIndex=Oe(Fe,j),
|
|
102
|
+
l.targetIndex=Oe(s,Y)}}return n},Oe=(e,t)=>e.find(({name:r})=>r===t)?.type,rr=e=>e.
|
|
103
|
+
reduce((t,r)=>({...t,[r.name]:r}),{});var Ae=e=>J(e)?e.name:null;var ze=!1,tr=()=>{ze||((0,Ce.registerTriggers)(),(0,Ne.registerTriggers)(),(0,He.createTrigger)(
|
|
104
|
+
"@ez4/database",{"metadata:getServices":te,"metadata:getLinkedService":Ae}),ze=!0)};0&&(module.exports={IncompleteHandlerError,IncompleteServiceError,IncompleteStreamError,
|
|
97
105
|
IncompleteTableError,IncorrectIndexesTypeError,IncorrectRelationsTypeError,IncorrectSchemaTypeError,
|
|
98
106
|
IncorrectStreamTypeError,InvalidIndexReferenceError,InvalidIndexTypeError,InvalidIndexesTypeError,
|
|
99
107
|
InvalidRelationAliasError,InvalidRelationColumnError,InvalidRelationTableError,InvalidRelationTargetError,
|
|
100
108
|
InvalidRelationsTypeError,InvalidSchemaTypeError,InvalidStreamTypeError,ServiceType,
|
|
101
109
|
getDatabaseServices,getDatabaseTable,getTableSchema,isDatabaseService,registerTriggers});
|
|
110
|
+
//# sourceMappingURL=library.cjs.map
|
package/dist/library.mjs
CHANGED
|
@@ -1,94 +1,107 @@
|
|
|
1
|
-
import{registerTriggers as
|
|
2
|
-
import{createTrigger as
|
|
3
|
-
|
|
4
|
-
import{isModelProperty as
|
|
5
|
-
var
|
|
6
|
-
"Database.Relations",
|
|
7
|
-
able relations type",r,"Database.Relations",
|
|
8
|
-
super(`Target ${r} must follow the pattern 'column@alias'.`,
|
|
9
|
-
r}},
|
|
10
|
-
|
|
11
|
-
umn ${r} don't exists.`,
|
|
12
|
-
super(`Relation alias ${r} can't override table columns.`,
|
|
13
|
-
r}};
|
|
14
|
-
super("Incomplete database service",
|
|
15
|
-
import{isTypeCallback as
|
|
16
|
-
e)&&
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
getPropertyString as
|
|
20
|
-
isTypeReference as
|
|
21
|
-
super("Incomplete database table",
|
|
22
|
-
var I=class extends
|
|
23
|
-
"Database.Indexes",
|
|
24
|
-
le indexes type",r,"Database.Indexes",
|
|
25
|
-
super(`Invalid index type, ${r} must follow one of the Index options.`,
|
|
26
|
-
r}},v=class extends
|
|
27
|
-
be valid column.`,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
import{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
super("Incomplete stream
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
o.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
new
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
import{registerTriggers as _r}from"@ez4/common/library";import{registerTriggers as Br}from"@ez4/schema/library";
|
|
2
|
+
import{createTrigger as Gr}from"@ez4/project/library";import{DuplicateServiceError as Or,InvalidServicePropertyError as Rr,isExternalStatement as Ar,
|
|
3
|
+
getLinkedServiceList as zr,getLinkedVariableList as Cr,getPropertyTuple as Nr,getModelMembers as Hr}from"@ez4/common/library";
|
|
4
|
+
import{isModelProperty as Fr}from"@ez4/reflection";import{IncorrectTypeError as Te,InvalidTypeError as ye,TypeError as g}from"@ez4/common/library";
|
|
5
|
+
var d=class extends ye{constructor(t){super("Invalid table relations type",void 0,
|
|
6
|
+
"Database.Relations",t)}},f=class extends Te{constructor(r,n){super("Incorrect t\
|
|
7
|
+
able relations type",r,"Database.Relations",n);this.schemaType=r}},T=class extends g{constructor(r,n){
|
|
8
|
+
super(`Target ${r} must follow the pattern 'column@alias'.`,n);this.relationSource=
|
|
9
|
+
r}},y=class extends g{constructor(r,n){super(`Relation table ${r} don't exists.`,
|
|
10
|
+
n);this.relationTable=r}},b=class extends g{constructor(r,n){super(`Relation col\
|
|
11
|
+
umn ${r} don't exists.`,n);this.relationColumn=r}},x=class extends g{constructor(r,n){
|
|
12
|
+
super(`Relation alias ${r} can't override table columns.`,n);this.relationAlias=
|
|
13
|
+
r}};import{IncompleteTypeError as xe}from"@ez4/common/library";var M=class extends xe{constructor(t,r){
|
|
14
|
+
super("Incomplete database service",t,r)}};var z="@ez4/database",Xr=e=>e.type===z;import{hasHeritageType as m,isClassDeclaration as ge,isModelDeclaration as N}from"@ez4/common/library";
|
|
15
|
+
import{isTypeCallback as Me,isTypeFunction as Se}from"@ez4/reflection";var S=e=>ge(
|
|
16
|
+
e)&&m(e,"Database.Service"),H=e=>N(e)&&m(e,"Database.Engine"),F=e=>N(e)&&m(e,"Da\
|
|
17
|
+
tabase.Table"),$=e=>Me(e)||Se(e),q=e=>m(e,"Database.Relations"),V=e=>m(e,"Databa\
|
|
18
|
+
se.Indexes"),U=e=>m(e,"Database.Schema"),_=e=>m(e,"Database.Stream");import{InvalidServicePropertyError as ur,getModelMembers as br,getObjectMembers as dr,
|
|
19
|
+
getPropertyString as fr,getReferenceType as Tr}from"@ez4/common/library";import{
|
|
20
|
+
isModelProperty as yr,isTypeObject as xr,isTypeReference as gr}from"@ez4/reflection";import{IncompleteTypeError as Ie}from"@ez4/common/library";var c=class extends Ie{constructor(t,r){
|
|
21
|
+
super("Incomplete database table",t,r)}};import{IncorrectTypeError as he,InvalidTypeError as De,TypeError as B}from"@ez4/common/library";
|
|
22
|
+
var I=class extends De{constructor(t){super("Invalid table indexes type",void 0,
|
|
23
|
+
"Database.Indexes",t)}},h=class extends he{constructor(r,n){super("Incorrect tab\
|
|
24
|
+
le indexes type",r,"Database.Indexes",n);this.schemaType=r}},D=class extends B{constructor(r,n){
|
|
25
|
+
super(`Invalid index type, ${r} must follow one of the Index options.`,n);this.indexName=
|
|
26
|
+
r}},v=class extends B{constructor(r,n){super(`Invalid index reference, ${r} must\
|
|
27
|
+
be valid column.`,n);this.indexName=r}};import{isModelDeclaration as ve,getModelMembers as Ee,getObjectMembers as je,getPropertyString as Pe,
|
|
28
|
+
getReferenceType as we}from"@ez4/common/library";import{isModelProperty as ke,isTypeObject as Oe,
|
|
29
|
+
isTypeReference as Re}from"@ez4/reflection";var K=(e,t,r,n)=>{if(!Re(e))return G(e,t,n);let o=we(e,r);return o?G(o,t,n):null},
|
|
30
|
+
G=(e,t,r)=>Oe(e)?J(e,je(e),r):ve(e)?q(e)?J(e,Ee(e),r):(r.push(new f(e.name,e.file)),
|
|
31
|
+
null):(r.push(new d(t.file)),null),J=(e,t,r)=>{let n=[];for(let o of t){if(!ke(o)||
|
|
32
|
+
o.inherited)continue;let a=Pe(o),s=o.name;if(!a)return r.push(new T(s,e.file)),null;
|
|
33
|
+
let[i,l]=s.split("@",2),[p,u]=a.split(":",2);n.push({sourceTable:p,sourceColumn:u,
|
|
34
|
+
targetColumn:i,targetAlias:l})}return n};import{isModelDeclaration as Ae,getModelMembers as ze,getObjectMembers as Ce,getPropertyString as Ne,
|
|
35
|
+
getReferenceType as He}from"@ez4/common/library";import{isModelProperty as Fe,isTypeObject as $e,
|
|
36
|
+
isTypeReference as qe}from"@ez4/reflection";var X=(e,t,r,n)=>{if(!qe(e))return Q(e,t,n);let o=He(e,r);return o?Q(o,t,n):null},
|
|
37
|
+
Q=(e,t,r)=>$e(e)?W(e,Ce(e),r):Ae(e)?V(e)?W(e,ze(e),r):(r.push(new h(e.name,e.file)),
|
|
38
|
+
null):(r.push(new I(t.file)),null),W=(e,t,r)=>{let n=[];for(let o of t){if(!Fe(o)||
|
|
39
|
+
o.inherited)continue;let a=o.name,s=Ne(o);switch(s){case"primary":case"secondary":case"\
|
|
40
|
+
unique":case"ttl":n.push({name:a,columns:a.split(":"),type:s});break;default:return r.
|
|
41
|
+
push(new D(a,e.file)),null}}return n};import{getReferenceType as _e,isModelDeclaration as Be}from"@ez4/common/library";
|
|
42
|
+
import{getObjectSchema as Ge,isObjectSchema as Je}from"@ez4/schema/library";import{
|
|
43
|
+
isTypeObject as Ke,isTypeReference as Qe}from"@ez4/reflection";import{IncorrectTypeError as Ve,InvalidTypeError as Ue}from"@ez4/common/library";
|
|
44
|
+
var E=class extends Ue{constructor(t){super("Invalid table schema type",void 0,"\
|
|
45
|
+
Database.Schema",t)}},j=class extends Ve{constructor(r,n){super("Incorrect table\
|
|
46
|
+
schema type",r,"Database.Schema",n);this.schemaType=r}};var L=(e,t,r,n)=>{if(!Qe(e))return Y(e,t,r,n);let o=_e(e,r);return o?Y(o,t,r,n):
|
|
47
|
+
null},Y=(e,t,r,n)=>Ke(e)?Z(e,r):Be(e)?U(e)?Z(e,r):(n.push(new j(e.name,e.file)),
|
|
48
|
+
null):(n.push(new E(t.file)),null),Z=(e,t)=>{let r=Ge(e,t);return r&&Je(r)?r:null};import{InvalidServicePropertyError as er,isModelDeclaration as rr,getLinkedVariableList as tr,
|
|
49
|
+
getModelMembers as nr,getObjectMembers as or,getPropertyNumber as ar,getServiceListener as sr,
|
|
50
|
+
getReferenceType as ir}from"@ez4/common/library";import{isModelProperty as lr,isTypeObject as pr,
|
|
51
|
+
isTypeReference as mr}from"@ez4/reflection";import{IncompleteTypeError as We,IncorrectTypeError as Xe,InvalidTypeError as Ye}from"@ez4/common/library";
|
|
52
|
+
var P=class extends We{constructor(t,r){super("Incomplete table stream",t,r)}},w=class extends Ye{constructor(t){
|
|
53
|
+
super("Invalid table stream type",void 0,"Database.Stream",t)}},k=class extends Xe{constructor(r,n){
|
|
54
|
+
super("Incorrect table stream type",r,"Database.Stream",n);this.streamType=r}};import{IncompleteTypeError as Ze}from"@ez4/common/library";var O=class extends Ze{constructor(t,r){
|
|
55
|
+
super("Incomplete stream handler",t,r)}};var ee=(e,t,r)=>{if(!$(e))return null;let n={},o=new Set(["name","file","change"]);
|
|
56
|
+
return e.description&&(n.description=e.description),(n.name=e.name)&&o.delete("n\
|
|
57
|
+
ame"),(n.file=e.file)&&o.delete("file"),e.parameters&&o.delete("change"),o.size===
|
|
58
|
+
0&&Le(n)?n:(r.push(new O([...o],e.file)),null)},Le=e=>!!e.name&&!!e.file;var ne=(e,t,r,n)=>{if(!mr(e))return re(e,t,r,n);let o=ir(e,r);return o?re(o,t,r,
|
|
59
|
+
n):null},cr=e=>!!e.handler,re=(e,t,r,n)=>pr(e)?te(e,t,or(e),r,n):rr(e)?_(e)?te(e,
|
|
60
|
+
t,nr(e),r,n):(n.push(new k(e.name,e.file)),null):(n.push(new w(t.file)),null),te=(e,t,r,n,o)=>{
|
|
61
|
+
let a={},s=new Set(["handler"]);for(let i of r)if(!(!lr(i)||i.inherited))switch(i.
|
|
62
|
+
name){default:o.push(new er(t.name,i.name,e.file));break;case"handler":a.handler=
|
|
63
|
+
ee(i.value,n,o);break;case"listener":a.listener=sr(i.value,o);break;case"memory":case"\
|
|
64
|
+
timeout":a[i.name]=ar(i);break;case"variables":a.variables=tr(i,o);break}return cr(
|
|
65
|
+
a)?a:(o.push(new P([...s],e.file)),null)};var se=(e,t,r,n)=>{if(!gr(e))return oe(e,t,r,n);let o=Tr(e,r);return o?oe(o,t,r,
|
|
66
|
+
n):null},Mr=e=>!!e.name&&!!e.schema&&!!e.indexes,oe=(e,t,r,n)=>F(e)?ae(e,t,br(e),
|
|
67
|
+
r,n):xr(e)?ae(e,t,dr(e),r,n):null,ae=(e,t,r,n,o)=>{let a={},s=new Set(["name","s\
|
|
68
|
+
chema","indexes"]);for(let l of r)if(!(!yr(l)||l.inherited))switch(l.name){default:
|
|
69
|
+
o.push(new ur(t.name,l.name,e.file));break;case"name":(a.name=fr(l))&&s.delete(l.
|
|
70
|
+
name);break;case"schema":(a.schema=L(l.value,e,n,o))&&s.delete(l.name);break;case"\
|
|
71
|
+
indexes":(a.indexes=X(l.value,e,n,o))&&s.delete(l.name);break;case"relations":a.
|
|
72
|
+
relations=K(l.value,e,n,o);break;case"stream":a.stream=ne(l.value,t,n,o);break}if(!Mr(
|
|
73
|
+
a))return o.push(new c([...s],e.file)),null;let i=Sr(e,a.indexes,a.schema);return i.
|
|
74
|
+
length?(o.push(...i),null):a},Sr=(e,t,r)=>{let n=r.properties,o=[];for(let{name:a,
|
|
75
|
+
columns:s}of t)s.some(l=>!n[l])&&o.push(new v(a,e.file));return o};import{InvalidServicePropertyError as Ir,getModelMembers as hr,getObjectMembers as Dr,
|
|
76
|
+
getPropertyString as pe,getReferenceType as vr}from"@ez4/common/library";import{
|
|
77
|
+
isModelProperty as Er,isTypeObject as jr,isTypeReference as Pr}from"@ez4/reflection";var me=(e,t,r,n)=>{if(!Pr(e))return ie(e,t,n);let o=vr(e,r);return o?ie(o,t,n):null},
|
|
78
|
+
wr=e=>!!e.name&&!!e.transaction,ie=(e,t,r)=>H(e)?le(e,t,hr(e),r):jr(e)?le(e,t,Dr(
|
|
79
|
+
e),r):null,le=(e,t,r,n)=>{let o={},a=new Set(["name","transaction"]);for(let s of r)
|
|
80
|
+
if(!(!Er(s)||s.inherited))switch(s.name){default:n.push(new Ir(t.name,s.name,e.file));
|
|
81
|
+
break;case"name":(o.name=pe(s))&&a.delete(s.name);break;case"transaction":(o.transaction=
|
|
82
|
+
kr(s))&&a.delete(s.name);break}return wr(o)?o:(n.push(new c([...a],e.file)),null)},
|
|
83
|
+
kr=e=>{let t=pe(e);switch(t){case"interactive":case"static":return t}return null};var ue=e=>{let t={},r=[];for(let n in e){let o=e[n];if(!S(o)||Ar(o))continue;let a={
|
|
84
|
+
type:z,extras:{}},s=new Set(["engine","tables"]),i=o.file;a.name=o.name;for(let p of Hr(
|
|
85
|
+
o))if(!(!Fr(p)||p.inherited))switch(p.name){default:r.push(new Rr(a.name,p.name,
|
|
86
|
+
i));break;case"engine":(a.engine=me(p.value,o,e,r))&&s.delete(p.name);break;case"\
|
|
87
|
+
tables":(a.tables=qr(p,o,e,r))&&s.delete(p.name);break;case"variables":a.variables=
|
|
88
|
+
Cr(p,r);break;case"services":a.services=zr(p,e,r);break}if(!$r(a)){r.push(new M(
|
|
89
|
+
[...s],i));continue}let l=Vr(o,a.tables);if(l.length){r.push(...l);continue}if(t[o.
|
|
90
|
+
name]){r.push(new Or(o.name,i));continue}t[o.name]=a}return{services:t,errors:r}},
|
|
91
|
+
$r=e=>!!e.name&&!!e.tables&&!!e.extras,qr=(e,t,r,n)=>{let o=Nr(e)??[],a=[];for(let s of o){
|
|
92
|
+
let i=se(s,t,r,n);i&&a.push(i)}return a},Vr=(e,t)=>{let r=Ur(t),n=[];for(let{relations:o,
|
|
93
|
+
schema:a,indexes:s}of t){if(!o)continue;let i=a.properties;for(let l of o){let{sourceTable:p,
|
|
94
|
+
sourceColumn:u,targetColumn:R,targetAlias:C}=l;i[R]||n.push(new b(R,e.file)),i[C]&&
|
|
95
|
+
n.push(new x(C,e.file));let A=r[p]?.schema.properties;A||n.push(new y(p,e.file)),
|
|
96
|
+
A&&!A[u]&&n.push(new b(u,e.file));let fe=r[p]?.indexes??[];l.sourceIndex=ce(fe,u),
|
|
97
|
+
l.targetIndex=ce(s,R)}}return n},ce=(e,t)=>e.find(({name:r})=>r===t)?.type,Ur=e=>e.
|
|
98
|
+
reduce((t,r)=>({...t,[r.name]:r}),{});var be=e=>S(e)?e.name:null;var de=!1,Mn=()=>{de||(_r(),Br(),Gr("@ez4/database",{"metadata:getServices":ue,"\
|
|
99
|
+
metadata:getLinkedService":be}),de=!0)};export{O as IncompleteHandlerError,M as IncompleteServiceError,P as IncompleteStreamError,
|
|
100
|
+
c as IncompleteTableError,h as IncorrectIndexesTypeError,f as IncorrectRelationsTypeError,
|
|
101
|
+
j as IncorrectSchemaTypeError,k as IncorrectStreamTypeError,v as InvalidIndexReferenceError,
|
|
102
|
+
D as InvalidIndexTypeError,I as InvalidIndexesTypeError,x as InvalidRelationAliasError,
|
|
103
|
+
b as InvalidRelationColumnError,y as InvalidRelationTableError,T as InvalidRelationTargetError,
|
|
104
|
+
d as InvalidRelationsTypeError,E as InvalidSchemaTypeError,w as InvalidStreamTypeError,
|
|
105
|
+
z as ServiceType,ue as getDatabaseServices,se as getDatabaseTable,L as getTableSchema,
|
|
106
|
+
Xr as isDatabaseService,Mn as registerTriggers};
|
|
107
|
+
//# sourceMappingURL=library.mjs.map
|
package/dist/main.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var
|
|
2
|
-
typeof
|
|
3
|
-
s(
|
|
4
|
-
|
|
5
|
-
ttl",
|
|
1
|
+
"use strict";var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var y=(r,a)=>{for(var e in a)s(r,e,{get:a[e],enumerable:!0})},I=(r,a,e,n)=>{if(a&&
|
|
2
|
+
typeof a=="object"||typeof a=="function")for(let t of c(a))!T.call(r,t)&&t!==e&&
|
|
3
|
+
s(r,t,{get:()=>a[t],enumerable:!(n=d(a,t))||n.enumerable});return r};var b=r=>I(s({},"__esModule",{value:!0}),r);var l={};y(l,{Database:()=>x,Index:()=>p,Order:()=>i,StreamType:()=>m,TransactionType:()=>o});
|
|
4
|
+
module.exports=b(l);var m=(n=>(n.Insert="insert",n.Update="update",n.Delete="delete",n))(m||{});var o=(e=>(e.Interactive="interactive",e.Static="static",e))(o||{});var x;(r=>{})(x||={});var p=(t=>(t.Primary="primary",t.Secondary="secondary",t.Unique="unique",t.TTL="\
|
|
5
|
+
ttl",t))(p||{});var i=(e=>(e.Asc="asc",e.Desc="desc",e))(i||{});0&&(module.exports={Database,Index,Order,StreamType,TransactionType});
|
|
6
|
+
//# sourceMappingURL=main.cjs.map
|
package/dist/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './services/streams.js';
|
|
2
2
|
export { Client } from './services/client.js';
|
|
3
3
|
export { RelationMetadata } from './services/relations.js';
|
|
4
|
+
export { TransactionType } from './services/engine.js';
|
|
4
5
|
export { Transaction } from './services/transaction.js';
|
|
5
6
|
export { Database } from './services/database.js';
|
|
6
7
|
export { Index } from './services/indexes.js';
|
package/dist/main.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
ttl",
|
|
1
|
+
var x=(a=>(a.Insert="insert",a.Update="update",a.Delete="delete",a))(x||{});var r=(e=>(e.Interactive="interactive",e.Static="static",e))(r||{});var n;(p=>{})(n||={});var s=(t=>(t.Primary="primary",t.Secondary="secondary",t.Unique="unique",t.TTL="\
|
|
2
|
+
ttl",t))(s||{});var o=(e=>(e.Asc="asc",e.Desc="desc",e))(o||{});export{n as Database,s as Index,o as Order,x as StreamType,r as TransactionType};
|
|
3
|
+
//# sourceMappingURL=main.mjs.map
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { AllType, SourceMap, TypeModel
|
|
1
|
+
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
2
|
import type { TableStream } from '../types/stream.js';
|
|
3
|
-
type
|
|
4
|
-
export declare const getTableStream: (type: AllType, parent: TypeParent, reflection: SourceMap, errorList: Error[]) => TableStream | null;
|
|
5
|
-
export {};
|
|
3
|
+
export declare const getTableStream: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => TableStream | null;
|
package/dist/metadata/table.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AllType, SourceMap } from '@ez4/reflection';
|
|
1
|
+
import type { AllType, SourceMap, TypeModel } from '@ez4/reflection';
|
|
2
2
|
import type { DatabaseTable } from '../types/table.js';
|
|
3
|
-
export declare const getDatabaseTable: (type: AllType, reflection: SourceMap, errorList: Error[]) => DatabaseTable | null;
|
|
3
|
+
export declare const getDatabaseTable: (type: AllType, parent: TypeModel, reflection: SourceMap, errorList: Error[]) => DatabaseTable | null;
|
package/dist/metadata/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AllType, TypeCallback, TypeClass, TypeFunction, TypeModel } from '@ez4/reflection';
|
|
2
2
|
export declare const isDatabaseService: (type: AllType) => type is TypeClass;
|
|
3
|
+
export declare const isDatabaseEngine: (type: AllType) => type is TypeModel;
|
|
3
4
|
export declare const isDatabaseTable: (type: AllType) => type is TypeModel;
|
|
4
5
|
export declare const isStreamHandler: (type: AllType) => type is TypeCallback | TypeFunction;
|
|
5
6
|
export declare const isTableRelations: (type: TypeModel) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TableClients } from './table.js';
|
|
2
1
|
import type { Transaction } from './transaction.js';
|
|
2
|
+
import type { TableClients } from './table.js';
|
|
3
3
|
import type { Database } from './database.js';
|
|
4
4
|
/**
|
|
5
5
|
* Database client.
|
|
@@ -16,7 +16,8 @@ export type Client<T extends Database.Service> = TableClients<T> & {
|
|
|
16
16
|
/**
|
|
17
17
|
* Prepare and execute the given transaction.
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param operation Transaction operation.
|
|
20
|
+
* @returns Returns the transaction result if the given transaction is interactive.
|
|
20
21
|
*/
|
|
21
|
-
transaction<O extends Transaction.
|
|
22
|
+
transaction<O extends Transaction.Operation<T, R>, R>(operation: O): Promise<Transaction.Result<O>>;
|
|
22
23
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Service } from '@ez4/common';
|
|
2
1
|
import type { LinkedVariables } from '@ez4/project/library';
|
|
2
|
+
import type { Service } from '@ez4/common';
|
|
3
3
|
import type { StreamChange } from './streams.js';
|
|
4
|
+
import type { DatabaseEngine } from './engine.js';
|
|
4
5
|
import type { Client } from './client.js';
|
|
5
6
|
/**
|
|
6
7
|
* Given a database service `T`, it returns all its table.
|
|
@@ -43,7 +44,14 @@ export declare namespace Database {
|
|
|
43
44
|
* Stream handler.
|
|
44
45
|
*/
|
|
45
46
|
type Handler<T extends Schema> = (request: Incoming<T> | StreamChange<T>, context: Service.Context<Database.Service>) => Promise<void> | void;
|
|
47
|
+
/**
|
|
48
|
+
* Service event.
|
|
49
|
+
*/
|
|
46
50
|
type ServiceEvent<T extends Schema = Schema> = Service.Event<Incoming<T>>;
|
|
51
|
+
/**
|
|
52
|
+
* Service engine.
|
|
53
|
+
*/
|
|
54
|
+
type Engine = DatabaseEngine;
|
|
47
55
|
/**
|
|
48
56
|
* Table stream.
|
|
49
57
|
*/
|
|
@@ -102,7 +110,7 @@ export declare namespace Database {
|
|
|
102
110
|
* Determines which database engine to use.
|
|
103
111
|
* Check the provider package to know all the possible values.
|
|
104
112
|
*/
|
|
105
|
-
abstract engine:
|
|
113
|
+
abstract engine: Engine;
|
|
106
114
|
/**
|
|
107
115
|
* Describe all available tables for the service.
|
|
108
116
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction type.
|
|
3
|
+
*/
|
|
4
|
+
export declare const enum TransactionType {
|
|
5
|
+
Interactive = "interactive",
|
|
6
|
+
Static = "static"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Database engine.
|
|
10
|
+
*/
|
|
11
|
+
export type DatabaseEngine = {
|
|
12
|
+
transaction: TransactionType;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
package/dist/services/query.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { DecomposeIndexName, DecomposePrimaryIndexNames, DecomposeUniqueIndexNames } from './indexes.js';
|
|
1
2
|
import type { RelationMetadata } from './relations.js';
|
|
2
3
|
import type { Database } from './database.js';
|
|
3
4
|
import type { Order } from './order.js';
|
|
4
|
-
import type { DecomposeIndexName, DecomposePrimaryIndexNames, DecomposeUniqueIndexNames } from './indexes.js';
|
|
5
5
|
import type { AnyObject, PartialProperties, PartialObject, FlatObject, OptionalObject, StrictObject, IsNullable, IsObjectEmpty, IsObject, IsArray } from '@ez4/utils';
|
|
6
6
|
/**
|
|
7
7
|
* Query builder types.
|
|
8
8
|
*/
|
|
9
9
|
export declare namespace Query {
|
|
10
|
-
export type InsertOneInput<T extends Database.Schema, R extends RelationMetadata> = {
|
|
10
|
+
export type InsertOneInput<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = {
|
|
11
|
+
select?: StrictSelectInput<T, S, R>;
|
|
11
12
|
data: InsertDataInput<T, R>;
|
|
12
13
|
};
|
|
13
14
|
export type UpdateOneInput<T extends Database.Schema, S extends AnyObject, I extends Database.Indexes, R extends RelationMetadata> = {
|
|
@@ -43,7 +44,8 @@ export declare namespace Query {
|
|
|
43
44
|
where?: WhereInput<T, {}, R>;
|
|
44
45
|
limit?: number;
|
|
45
46
|
};
|
|
46
|
-
export type FindManyInput<T extends Database.Schema, S extends AnyObject, I extends Database.Indexes, R extends RelationMetadata> = {
|
|
47
|
+
export type FindManyInput<T extends Database.Schema, S extends AnyObject, I extends Database.Indexes, R extends RelationMetadata, C extends boolean> = {
|
|
48
|
+
count?: C;
|
|
47
49
|
select: StrictSelectInput<T, S, R>;
|
|
48
50
|
include?: StrictIncludeInput<S, R>;
|
|
49
51
|
where?: WhereInput<T, {}, R>;
|
|
@@ -60,23 +62,27 @@ export declare namespace Query {
|
|
|
60
62
|
export type CountInput<T extends Database.Schema, R extends RelationMetadata> = {
|
|
61
63
|
where?: WhereInput<T, {}, R>;
|
|
62
64
|
};
|
|
63
|
-
export type InsertOneResult =
|
|
65
|
+
export type InsertOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R>;
|
|
64
66
|
export type UpdateOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
|
|
65
67
|
export type FindOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
|
|
66
68
|
export type UpsertOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
|
|
67
69
|
export type DeleteOneResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R> | undefined;
|
|
68
70
|
export type InsertManyResult = void;
|
|
69
71
|
export type UpdateManyResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R>[];
|
|
70
|
-
export type FindManyResult<T extends Database.Schema, S extends Database.Schema, R extends RelationMetadata> = {
|
|
72
|
+
export type FindManyResult<T extends Database.Schema, S extends Database.Schema, R extends RelationMetadata, C extends boolean> = C extends true ? {
|
|
73
|
+
records: Record<T, S, R>[];
|
|
74
|
+
cursor?: number | string;
|
|
75
|
+
total: number;
|
|
76
|
+
} : {
|
|
71
77
|
records: Record<T, S, R>[];
|
|
72
78
|
cursor?: number | string;
|
|
73
79
|
};
|
|
74
80
|
export type DeleteManyResult<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = Record<T, S, R>[];
|
|
75
|
-
export type Record<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = PartialObject<SelectFields<T, R>, S, false>;
|
|
81
|
+
export type Record<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = S extends never ? undefined : PartialObject<SelectFields<T, R>, S, false>;
|
|
76
82
|
export type SelectInput<T extends Database.Schema, R extends RelationMetadata> = PartialProperties<SelectFields<T, R>>;
|
|
77
83
|
export type StrictSelectInput<T extends Database.Schema, S extends AnyObject, R extends RelationMetadata> = StrictObject<S, FlatObject<SelectFields<T, R>>>;
|
|
78
84
|
export type InsertDataInput<T extends Database.Schema, R extends RelationMetadata> = Omit<IsObjectEmpty<R['changes']> extends true ? T : T & R['changes'], IndexFields<R>>;
|
|
79
|
-
export type UpdateDataInput<T extends Database.Schema, R extends RelationMetadata> = Omit<IsObjectEmpty<R['changes']> extends true ? T : T & FlatObject<R['changes']>, IndexFields<R
|
|
85
|
+
export type UpdateDataInput<T extends Database.Schema, R extends RelationMetadata> = AtomicDataInput<Omit<IsObjectEmpty<R['changes']> extends true ? T : T & FlatObject<R['changes']>, IndexFields<R>>>;
|
|
80
86
|
export type StrictIncludeInput<S extends AnyObject, R extends RelationMetadata> = IsObjectEmpty<R['filters']> extends true ? never : IncludeFilters<R['filters'], S>;
|
|
81
87
|
export type OrderInput<I extends Database.Indexes> = {
|
|
82
88
|
[P in DecomposeIndexName<keyof I>]?: Order;
|
|
@@ -86,7 +92,7 @@ export declare namespace Query {
|
|
|
86
92
|
type IndexFields<R extends RelationMetadata> = string extends R['indexes'] ? never : R['indexes'];
|
|
87
93
|
type SelectFields<T extends Database.Schema, R extends RelationMetadata> = IsObjectEmpty<R['selects']> extends true ? T : T & R['selects'];
|
|
88
94
|
type IncludeFilters<T extends AnyObject, S extends AnyObject> = {
|
|
89
|
-
[P in keyof T]?: P extends keyof S ? IsObject<T[P]> extends true ? null | WhereRelationField<NonNullable<T[P]>> : never : never;
|
|
95
|
+
[P in keyof T]?: P extends keyof S ? (IsObject<T[P]> extends true ? null | WhereRelationField<NonNullable<T[P]>> : never) : never;
|
|
90
96
|
};
|
|
91
97
|
type WhereOperations<T> = WhereNegate<T> | WhereEqual<T> | WhereGreaterThan<T> | WhereGreaterThanOrEqual<T> | WhereLessThan<T> | WhereLessThanOrEqual<T> | WhereIn<T> | WhereBetween<T> | WhereIsMissing | WhereIsNull | WhereStartsWith | WhereContains<T>;
|
|
92
98
|
type WhereField<T> = IsObject<T> extends false ? T | WhereOperations<T> : IsNullable<T> extends true ? null | WhereObjectField<NonNullable<T>> : WhereObjectField<NonNullable<T>>;
|
|
@@ -150,5 +156,27 @@ export declare namespace Query {
|
|
|
150
156
|
type WhereContains<T> = {
|
|
151
157
|
contains: IsObject<T> extends true ? Partial<T> : T;
|
|
152
158
|
};
|
|
159
|
+
export type AtomicOperators = keyof (AtomicIncrement & AtomicDecrement & AtomicMultiply & AtomicDivide);
|
|
160
|
+
type AtomicDataInput<T extends AnyObject> = AtomicRequiredFields<T> & AtomicOptionalFields<T>;
|
|
161
|
+
type AtomicDataField<T> = T extends number ? AtomicOperation | T : T extends AnyObject ? AtomicDataInput<T> : NonNullable<T> extends AnyObject ? null | AtomicDataInput<NonNullable<T>> : T;
|
|
162
|
+
type AtomicRequiredFields<T extends AnyObject> = {
|
|
163
|
+
[P in keyof T as T[P] extends undefined ? never : P]: AtomicDataField<T[P]>;
|
|
164
|
+
};
|
|
165
|
+
type AtomicOptionalFields<T extends AnyObject> = {
|
|
166
|
+
[P in keyof T as T[P] extends undefined ? P : never]?: AtomicDataField<T[P]>;
|
|
167
|
+
};
|
|
168
|
+
type AtomicOperation = AtomicIncrement | AtomicDecrement | AtomicMultiply | AtomicDivide;
|
|
169
|
+
type AtomicIncrement = {
|
|
170
|
+
increment: number;
|
|
171
|
+
};
|
|
172
|
+
type AtomicDecrement = {
|
|
173
|
+
decrement: number;
|
|
174
|
+
};
|
|
175
|
+
type AtomicMultiply = {
|
|
176
|
+
multiply: number;
|
|
177
|
+
};
|
|
178
|
+
type AtomicDivide = {
|
|
179
|
+
divide: number;
|
|
180
|
+
};
|
|
153
181
|
export {};
|
|
154
182
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { AnyObject, ArrayRest, PropertyType, ExclusiveType, IsArrayEmpty, IsUndefined } from '@ez4/utils';
|
|
1
2
|
import type { IndexedTables, PrimaryIndexes, UniqueIndexes } from './indexes.js';
|
|
2
3
|
import type { Database, DatabaseTables } from './database.js';
|
|
3
4
|
import type { TableSchemas } from './schemas.js';
|
|
4
|
-
import type { AnyObject, ArrayRest, PropertyType, ExclusiveType, IsArrayEmpty, IsUndefined } from '@ez4/utils';
|
|
5
5
|
/**
|
|
6
6
|
* Internal relation type.
|
|
7
7
|
*/
|
|
@@ -54,25 +54,25 @@ type TableRelation<T, S extends Record<string, Database.Schema>, I extends Recor
|
|
|
54
54
|
* Produce an object containing all required relation indexes.
|
|
55
55
|
*/
|
|
56
56
|
type RequiredRelationIndexes<T extends Database.Schema, I extends Record<string, Database.Indexes>, R extends AnyObject> = keyof {
|
|
57
|
-
[C in keyof R as IsOptionalRelation<
|
|
57
|
+
[C in keyof R as IsOptionalRelation<R[C], C, T, I, true> extends true ? never : RelationTargetColumn<C>]: never;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Produce an object containing all filterable relation schemas.
|
|
61
61
|
*/
|
|
62
62
|
type FilterableRelationSchemas<S extends Record<string, Database.Schema>, I extends Record<string, Database.Indexes>, R extends AnyObject> = {
|
|
63
|
-
[C in keyof R as RelationTargetAlias<
|
|
63
|
+
[C in keyof R as RelationTargetAlias<C>]: IsPrimaryIndex<R[C], I> extends false ? Omit<PropertyType<RelationSourceTable<R[C]>, S>, RelationSourceColumn<R[C]>> : PropertyType<RelationSourceTable<R[C]>, S>;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* Produce an object containing only required relation schemas.
|
|
67
67
|
*/
|
|
68
68
|
type RequiredRelationSchemas<T extends Database.Schema, S extends Record<string, Database.Schema>, I extends Record<string, Database.Indexes>, R extends AnyObject, E extends boolean> = {
|
|
69
|
-
[C in keyof R as IsOptionalRelation<
|
|
69
|
+
[C in keyof R as IsOptionalRelation<R[C], C, T, I, E> extends false ? RelationTargetAlias<C> : never]: RelationSchema<R[C], C, T, S, I, E>;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* Produce an object containing only optional relation schemas.
|
|
73
73
|
*/
|
|
74
74
|
type OptionalRelationSchemas<T extends Database.Schema, S extends Record<string, Database.Schema>, I extends Record<string, Database.Indexes>, R extends AnyObject, E extends boolean> = {
|
|
75
|
-
[C in keyof R as IsOptionalRelation<
|
|
75
|
+
[C in keyof R as IsOptionalRelation<R[C], C, T, I, E> extends true ? RelationTargetAlias<C> : never]?: RelationSchema<R[C], C, T, S, I, E>;
|
|
76
76
|
};
|
|
77
77
|
/**
|
|
78
78
|
* Check whether a relation is optional or not.
|
package/dist/services/table.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type TableIndex<P, T extends AnyObject> = PropertyExists<P, T> extends tr
|
|
|
13
13
|
* Given a table `T` and a property `P`, it returns all the relations corresponding to the
|
|
14
14
|
* given property.
|
|
15
15
|
*/
|
|
16
|
-
export type TableRelation<P, T extends AnyObject> = PropertyExists<P, T> extends true ? T[P] extends RelationMetadata ? T[P] : RelationMetadata : RelationMetadata;
|
|
16
|
+
export type TableRelation<P, T extends AnyObject> = PropertyExists<P, T> extends true ? (T[P] extends RelationMetadata ? T[P] : RelationMetadata) : RelationMetadata;
|
|
17
17
|
/**
|
|
18
18
|
* Given a database service `T`, it returns all table clients.
|
|
19
19
|
*/
|
|
@@ -29,7 +29,7 @@ export interface Table<T extends Database.Schema, I extends Database.Indexes, R
|
|
|
29
29
|
*
|
|
30
30
|
* @param query Input query.
|
|
31
31
|
*/
|
|
32
|
-
insertOne(query: Query.InsertOneInput<T, R>): Promise<Query.InsertOneResult
|
|
32
|
+
insertOne<S extends Query.SelectInput<T, R> = never>(query: Query.InsertOneInput<T, S, R>): Promise<Query.InsertOneResult<T, S, R>>;
|
|
33
33
|
/**
|
|
34
34
|
* Find one database record.
|
|
35
35
|
*
|
|
@@ -41,19 +41,19 @@ export interface Table<T extends Database.Schema, I extends Database.Indexes, R
|
|
|
41
41
|
*
|
|
42
42
|
* @param query Input query.
|
|
43
43
|
*/
|
|
44
|
-
updateOne<S extends Query.SelectInput<T, R
|
|
44
|
+
updateOne<S extends Query.SelectInput<T, R> = never>(query: Query.UpdateOneInput<T, S, I, R>): Promise<Query.UpdateOneResult<T, S, R>>;
|
|
45
45
|
/**
|
|
46
46
|
* Try to insert a database record, and if it already exists, perform an update instead.
|
|
47
47
|
*
|
|
48
48
|
* @param query Input query.
|
|
49
49
|
*/
|
|
50
|
-
upsertOne<S extends Query.SelectInput<T, R
|
|
50
|
+
upsertOne<S extends Query.SelectInput<T, R> = never>(query: Query.UpsertOneInput<T, S, I, R>): Promise<Query.UpsertOneResult<T, S, R>>;
|
|
51
51
|
/**
|
|
52
52
|
* Delete one database record.
|
|
53
53
|
*
|
|
54
54
|
* @param query Input query.
|
|
55
55
|
*/
|
|
56
|
-
deleteOne<S extends Query.SelectInput<T, R
|
|
56
|
+
deleteOne<S extends Query.SelectInput<T, R> = never>(query: Query.DeleteOneInput<T, S, I, R>): Promise<Query.DeleteOneResult<T, S, R>>;
|
|
57
57
|
/**
|
|
58
58
|
* Insert multiple records into the database.
|
|
59
59
|
*
|
|
@@ -65,19 +65,19 @@ export interface Table<T extends Database.Schema, I extends Database.Indexes, R
|
|
|
65
65
|
*
|
|
66
66
|
* @param query Input query.
|
|
67
67
|
*/
|
|
68
|
-
findMany<S extends Query.SelectInput<T, R
|
|
68
|
+
findMany<S extends Query.SelectInput<T, R>, C extends boolean = false>(query: Query.FindManyInput<T, S, I, R, C>): Promise<Query.FindManyResult<T, S, R, C>>;
|
|
69
69
|
/**
|
|
70
70
|
* Update multiple database records.
|
|
71
71
|
*
|
|
72
72
|
* @param query Input query.
|
|
73
73
|
*/
|
|
74
|
-
updateMany<S extends Query.SelectInput<T, R
|
|
74
|
+
updateMany<S extends Query.SelectInput<T, R> = never>(query: Query.UpdateManyInput<T, S, R>): Promise<Query.UpdateManyResult<T, S, R>>;
|
|
75
75
|
/**
|
|
76
76
|
* Delete multiple database records.
|
|
77
77
|
*
|
|
78
78
|
* @param query Input query.
|
|
79
79
|
*/
|
|
80
|
-
deleteMany<S extends Query.SelectInput<T, R
|
|
80
|
+
deleteMany<S extends Query.SelectInput<T, R> = never>(query: Query.DeleteManyInput<T, S, R>): Promise<Query.DeleteManyResult<T, S, R>>;
|
|
81
81
|
/**
|
|
82
82
|
* Count database records.
|
|
83
83
|
*
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
import type { AnyObject } from '@ez4/utils';
|
|
2
|
-
import type { RelationMetadata, RelationTables } from './relations.js';
|
|
3
2
|
import type { TableIndex, TableRelation } from './table.js';
|
|
3
|
+
import type { RelationMetadata, RelationTables } from './relations.js';
|
|
4
4
|
import type { IndexedTables } from './indexes.js';
|
|
5
|
+
import type { TransactionType } from './engine.js';
|
|
5
6
|
import type { TableSchemas } from './schemas.js';
|
|
6
7
|
import type { Database } from './database.js';
|
|
8
|
+
import type { Client } from './client.js';
|
|
7
9
|
import type { Query } from './query.js';
|
|
8
10
|
/**
|
|
9
11
|
* Transaction builder types.
|
|
10
12
|
*/
|
|
11
13
|
export declare namespace Transaction {
|
|
14
|
+
/**
|
|
15
|
+
* Extract the operation result from an interactive transaction.
|
|
16
|
+
*/
|
|
17
|
+
export type Result<O> = O extends (client: any) => infer R ? R : void;
|
|
18
|
+
/**
|
|
19
|
+
* Determines the transaction operation based on the given database service.
|
|
20
|
+
*/
|
|
21
|
+
export type Operation<T extends Database.Service, R> = T['engine'] extends {
|
|
22
|
+
transaction: infer O;
|
|
23
|
+
} ? O extends TransactionType.Interactive ? WriteOperation<T> | InteractiveOperation<T, R> : WriteOperation<T> : never;
|
|
24
|
+
/**
|
|
25
|
+
* Interactive operations.
|
|
26
|
+
*/
|
|
27
|
+
export type InteractiveOperation<T extends Database.Service, R = void> = (client: Client<T>) => Promise<R> | R;
|
|
12
28
|
/**
|
|
13
29
|
* Write operations.
|
|
14
30
|
*/
|
|
15
|
-
export type
|
|
31
|
+
export type WriteOperation<T extends Database.Service> = {
|
|
16
32
|
[P in keyof TableSchemas<T>]?: (TableSchemas<T>[P] extends Database.Schema ? AnyOperation<TableSchemas<T>[P], TableIndex<P, IndexedTables<T>>, TableRelation<P, RelationTables<T>>> : AnyObject)[];
|
|
17
33
|
};
|
|
18
34
|
type AnyOperation<T extends Database.Schema, I extends Database.Indexes, R extends RelationMetadata> = InsertOperation<T, R> | UpdateOperation<T, I, R> | DeleteOperation<T, I, R>;
|
|
19
35
|
type InsertOperation<T extends Database.Schema, R extends RelationMetadata> = {
|
|
20
|
-
insert: Query.InsertOneInput<T, R>;
|
|
36
|
+
insert: Omit<Query.InsertOneInput<T, Query.SelectInput<T, R>, R>, 'select'>;
|
|
21
37
|
};
|
|
22
38
|
type UpdateOperation<T extends Database.Schema, I extends Database.Indexes, R extends RelationMetadata> = {
|
|
23
39
|
update: Omit<Query.UpdateOneInput<T, Query.SelectInput<T, R>, I, R>, 'select' | 'include'>;
|
package/dist/types/service.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ServiceMetadata } from '@ez4/project/library';
|
|
2
|
+
import type { DatabaseEngine } from './engine.js';
|
|
2
3
|
import type { DatabaseTable } from './table.js';
|
|
3
4
|
export declare const ServiceType = "@ez4/database";
|
|
4
5
|
export type DatabaseService = ServiceMetadata & {
|
|
5
6
|
type: typeof ServiceType;
|
|
6
|
-
|
|
7
|
-
engine: string;
|
|
7
|
+
engine: DatabaseEngine;
|
|
8
8
|
tables: DatabaseTable[];
|
|
9
|
+
name: string;
|
|
9
10
|
};
|
|
10
11
|
export declare const isDatabaseService: (service: ServiceMetadata) => service is DatabaseService;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ez4/database",
|
|
3
3
|
"description": "EZ4: Components to build database services",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.0",
|
|
5
5
|
"author": "Silas B.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"directory": "packages/database"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=22.3.0"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"live:publish": "npm run test && npm publish --access public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ez4/common": "^0.
|
|
46
|
-
"@ez4/project": "^0.
|
|
47
|
-
"@ez4/reflection": "^0.
|
|
48
|
-
"@ez4/schema": "^0.
|
|
49
|
-
"@ez4/utils": "^0.
|
|
45
|
+
"@ez4/common": "^0.17.0",
|
|
46
|
+
"@ez4/project": "^0.17.0",
|
|
47
|
+
"@ez4/reflection": "^0.17.0",
|
|
48
|
+
"@ez4/schema": "^0.17.0",
|
|
49
|
+
"@ez4/utils": "^0.17.0"
|
|
50
50
|
}
|
|
51
51
|
}
|