@spinajs/orm 2.0.180 → 2.0.182
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/lib/cjs/builders.d.ts +643 -643
- package/lib/cjs/builders.js +1602 -1602
- package/lib/cjs/builders.js.map +1 -1
- package/lib/cjs/converters.d.ts +34 -34
- package/lib/cjs/converters.js +104 -104
- package/lib/cjs/decorators.d.ts +152 -152
- package/lib/cjs/decorators.js +449 -449
- package/lib/cjs/dehydrators.d.ts +10 -10
- package/lib/cjs/dehydrators.js +47 -47
- package/lib/cjs/driver.d.ts +82 -82
- package/lib/cjs/driver.js +102 -102
- package/lib/cjs/driver.js.map +1 -1
- package/lib/cjs/enums.d.ts +116 -116
- package/lib/cjs/enums.js +126 -126
- package/lib/cjs/enums.js.map +1 -1
- package/lib/cjs/exceptions.d.ts +6 -6
- package/lib/cjs/exceptions.js +10 -10
- package/lib/cjs/hydrators.d.ts +19 -19
- package/lib/cjs/hydrators.js +132 -132
- package/lib/cjs/hydrators.js.map +1 -1
- package/lib/cjs/index.d.ts +17 -17
- package/lib/cjs/index.js +33 -33
- package/lib/cjs/interfaces.d.ts +921 -919
- package/lib/cjs/interfaces.d.ts.map +1 -1
- package/lib/cjs/interfaces.js +279 -279
- package/lib/cjs/interfaces.js.map +1 -1
- package/lib/cjs/middlewares.d.ts +62 -62
- package/lib/cjs/middlewares.js +258 -258
- package/lib/cjs/model.d.ts +288 -284
- package/lib/cjs/model.d.ts.map +1 -1
- package/lib/cjs/model.js +826 -810
- package/lib/cjs/model.js.map +1 -1
- package/lib/cjs/orm.d.ts +61 -61
- package/lib/cjs/orm.js +333 -333
- package/lib/cjs/orm.js.map +1 -1
- package/lib/cjs/relation-objects.d.ts +108 -108
- package/lib/cjs/relation-objects.js +221 -221
- package/lib/cjs/relations.d.ts +61 -61
- package/lib/cjs/relations.js +194 -194
- package/lib/cjs/relations.js.map +1 -1
- package/lib/cjs/statements.d.ts +143 -143
- package/lib/cjs/statements.js +309 -309
- package/lib/cjs/statements.js.map +1 -1
- package/lib/cjs/types.d.ts +32 -32
- package/lib/cjs/types.js +2 -2
- package/lib/cjs/wrappers.d.ts +5 -5
- package/lib/cjs/wrappers.js +12 -12
- package/lib/mjs/builders.d.ts +643 -643
- package/lib/mjs/builders.js +1594 -1594
- package/lib/mjs/builders.js.map +1 -1
- package/lib/mjs/converters.d.ts +34 -34
- package/lib/mjs/converters.js +96 -96
- package/lib/mjs/decorators.d.ts +152 -152
- package/lib/mjs/decorators.js +422 -422
- package/lib/mjs/dehydrators.d.ts +10 -10
- package/lib/mjs/dehydrators.js +41 -41
- package/lib/mjs/driver.d.ts +82 -82
- package/lib/mjs/driver.js +98 -98
- package/lib/mjs/driver.js.map +1 -1
- package/lib/mjs/enums.d.ts +116 -116
- package/lib/mjs/enums.js +123 -123
- package/lib/mjs/enums.js.map +1 -1
- package/lib/mjs/exceptions.d.ts +6 -6
- package/lib/mjs/exceptions.js +6 -6
- package/lib/mjs/hydrators.d.ts +19 -19
- package/lib/mjs/hydrators.js +128 -128
- package/lib/mjs/hydrators.js.map +1 -1
- package/lib/mjs/index.d.ts +17 -17
- package/lib/mjs/index.js +17 -17
- package/lib/mjs/interfaces.d.ts +921 -919
- package/lib/mjs/interfaces.d.ts.map +1 -1
- package/lib/mjs/interfaces.js +267 -267
- package/lib/mjs/interfaces.js.map +1 -1
- package/lib/mjs/middlewares.d.ts +62 -62
- package/lib/mjs/middlewares.js +249 -249
- package/lib/mjs/model.d.ts +288 -284
- package/lib/mjs/model.d.ts.map +1 -1
- package/lib/mjs/model.js +816 -800
- package/lib/mjs/model.js.map +1 -1
- package/lib/mjs/orm.d.ts +61 -61
- package/lib/mjs/orm.js +326 -326
- package/lib/mjs/orm.js.map +1 -1
- package/lib/mjs/relation-objects.d.ts +108 -108
- package/lib/mjs/relation-objects.js +211 -211
- package/lib/mjs/relations.d.ts +61 -61
- package/lib/mjs/relations.js +191 -191
- package/lib/mjs/relations.js.map +1 -1
- package/lib/mjs/statements.d.ts +143 -143
- package/lib/mjs/statements.js +301 -301
- package/lib/mjs/statements.js.map +1 -1
- package/lib/mjs/types.d.ts +32 -32
- package/lib/mjs/types.js +1 -1
- package/lib/mjs/wrappers.d.ts +5 -5
- package/lib/mjs/wrappers.js +9 -9
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +5 -5
package/lib/mjs/hydrators.js
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
/* eslint-disable prettier/prettier */
|
|
8
|
-
import { RelationType } from './interfaces.js';
|
|
9
|
-
import { Injectable, isConstructor } from '@spinajs/di';
|
|
10
|
-
import { OneToManyRelationList, SingleRelation } from './relation-objects.js';
|
|
11
|
-
export class ModelHydrator {
|
|
12
|
-
}
|
|
13
|
-
let DbPropertyHydrator = class DbPropertyHydrator extends ModelHydrator {
|
|
14
|
-
hydrate(target, values) {
|
|
15
|
-
const descriptor = target.ModelDescriptor;
|
|
16
|
-
if (!descriptor) {
|
|
17
|
-
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
18
|
-
}
|
|
19
|
-
// filter out model joined properties
|
|
20
|
-
// we handle it in later
|
|
21
|
-
const keys = Object.keys(values).filter((k) => descriptor.Columns?.find((c) => c.Name === k));
|
|
22
|
-
keys.forEach((k) => {
|
|
23
|
-
// skip if column is primary key & is null
|
|
24
|
-
// we dont want to override pkey of target model
|
|
25
|
-
if (k === descriptor.PrimaryKey && !values[k]) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const column = descriptor.Columns?.find((c) => c.Name === k);
|
|
29
|
-
target[k] = column.Converter ? column.Converter.fromDB(values[k], values, descriptor.Converters.get(column.Name).Options) : values[k];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
DbPropertyHydrator = __decorate([
|
|
34
|
-
Injectable(ModelHydrator)
|
|
35
|
-
], DbPropertyHydrator);
|
|
36
|
-
export { DbPropertyHydrator };
|
|
37
|
-
let NonDbPropertyHydrator = class NonDbPropertyHydrator extends ModelHydrator {
|
|
38
|
-
hydrate(target, values) {
|
|
39
|
-
const descriptor = target.ModelDescriptor;
|
|
40
|
-
if (!descriptor) {
|
|
41
|
-
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
42
|
-
}
|
|
43
|
-
// get only properties that are not in DB
|
|
44
|
-
const keys = Object.keys(values).filter((k) => descriptor.Columns?.find((c) => c.Name === k) === undefined);
|
|
45
|
-
keys.forEach((k) => {
|
|
46
|
-
target[k] = values[k];
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
NonDbPropertyHydrator = __decorate([
|
|
51
|
-
Injectable(ModelHydrator)
|
|
52
|
-
], NonDbPropertyHydrator);
|
|
53
|
-
export { NonDbPropertyHydrator };
|
|
54
|
-
let OneToManyRelationHydrator = class OneToManyRelationHydrator extends ModelHydrator {
|
|
55
|
-
hydrate(target, values) {
|
|
56
|
-
const descriptor = target.ModelDescriptor;
|
|
57
|
-
if (!descriptor) {
|
|
58
|
-
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
59
|
-
}
|
|
60
|
-
for (const [key, val] of descriptor.Relations) {
|
|
61
|
-
if (val.Type !== RelationType.Many) {
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if (values[key] != null) {
|
|
65
|
-
const entity = target;
|
|
66
|
-
const mapRel = values[key].map((x) => {
|
|
67
|
-
const tEntity = !isConstructor(val.TargetModel) ? new (val.TargetModel())() : new val.TargetModel();
|
|
68
|
-
tEntity['__relationKey__'] = key;
|
|
69
|
-
tEntity.hydrate(x);
|
|
70
|
-
return tEntity;
|
|
71
|
-
});
|
|
72
|
-
const rel = new OneToManyRelationList(target, val.TargetModel, val, mapRel);
|
|
73
|
-
entity[key] = rel;
|
|
74
|
-
delete target[val.ForeignKey];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
OneToManyRelationHydrator = __decorate([
|
|
80
|
-
Injectable(ModelHydrator)
|
|
81
|
-
], OneToManyRelationHydrator);
|
|
82
|
-
export { OneToManyRelationHydrator };
|
|
83
|
-
let OneToOneRelationHydrator = class OneToOneRelationHydrator extends ModelHydrator {
|
|
84
|
-
hydrate(target, values) {
|
|
85
|
-
const descriptor = target.ModelDescriptor;
|
|
86
|
-
if (!descriptor) {
|
|
87
|
-
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
88
|
-
}
|
|
89
|
-
for (const [key, val] of descriptor.Relations) {
|
|
90
|
-
if (val.Type !== RelationType.One) {
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
if (values[key] != null) {
|
|
94
|
-
const entity = target;
|
|
95
|
-
let tEntity = undefined;
|
|
96
|
-
if (!Object.values(values[key]).every((x) => x === null)) {
|
|
97
|
-
tEntity = !isConstructor(val.TargetModel) ? new (val.TargetModel())() : new val.TargetModel();
|
|
98
|
-
tEntity.hydrate(values[key]);
|
|
99
|
-
tEntity['__relationKey__'] = key;
|
|
100
|
-
}
|
|
101
|
-
const rel = new SingleRelation(target, val.TargetModel, val, tEntity);
|
|
102
|
-
entity[key] = rel;
|
|
103
|
-
delete target[val.ForeignKey];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
OneToOneRelationHydrator = __decorate([
|
|
109
|
-
Injectable(ModelHydrator)
|
|
110
|
-
], OneToOneRelationHydrator);
|
|
111
|
-
export { OneToOneRelationHydrator };
|
|
112
|
-
let JunctionModelPropertyHydrator = class JunctionModelPropertyHydrator extends ModelHydrator {
|
|
113
|
-
hydrate(target, values) {
|
|
114
|
-
const descriptor = target.ModelDescriptor;
|
|
115
|
-
if (!descriptor) {
|
|
116
|
-
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
117
|
-
}
|
|
118
|
-
for (const jt of descriptor.JunctionModelProperties) {
|
|
119
|
-
const entity = new jt.Model();
|
|
120
|
-
entity.hydrate(values.JunctionModel);
|
|
121
|
-
target[jt.Name] = entity;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
JunctionModelPropertyHydrator = __decorate([
|
|
126
|
-
Injectable(ModelHydrator)
|
|
127
|
-
], JunctionModelPropertyHydrator);
|
|
128
|
-
export { JunctionModelPropertyHydrator };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/* eslint-disable prettier/prettier */
|
|
8
|
+
import { RelationType } from './interfaces.js';
|
|
9
|
+
import { Injectable, isConstructor } from '@spinajs/di';
|
|
10
|
+
import { OneToManyRelationList, SingleRelation } from './relation-objects.js';
|
|
11
|
+
export class ModelHydrator {
|
|
12
|
+
}
|
|
13
|
+
let DbPropertyHydrator = class DbPropertyHydrator extends ModelHydrator {
|
|
14
|
+
hydrate(target, values) {
|
|
15
|
+
const descriptor = target.ModelDescriptor;
|
|
16
|
+
if (!descriptor) {
|
|
17
|
+
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
18
|
+
}
|
|
19
|
+
// filter out model joined properties
|
|
20
|
+
// we handle it in later
|
|
21
|
+
const keys = Object.keys(values).filter((k) => descriptor.Columns?.find((c) => c.Name === k));
|
|
22
|
+
keys.forEach((k) => {
|
|
23
|
+
// skip if column is primary key & is null
|
|
24
|
+
// we dont want to override pkey of target model
|
|
25
|
+
if (k === descriptor.PrimaryKey && !values[k]) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const column = descriptor.Columns?.find((c) => c.Name === k);
|
|
29
|
+
target[k] = column.Converter ? column.Converter.fromDB(values[k], values, descriptor.Converters.get(column.Name).Options) : values[k];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
DbPropertyHydrator = __decorate([
|
|
34
|
+
Injectable(ModelHydrator)
|
|
35
|
+
], DbPropertyHydrator);
|
|
36
|
+
export { DbPropertyHydrator };
|
|
37
|
+
let NonDbPropertyHydrator = class NonDbPropertyHydrator extends ModelHydrator {
|
|
38
|
+
hydrate(target, values) {
|
|
39
|
+
const descriptor = target.ModelDescriptor;
|
|
40
|
+
if (!descriptor) {
|
|
41
|
+
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
42
|
+
}
|
|
43
|
+
// get only properties that are not in DB
|
|
44
|
+
const keys = Object.keys(values).filter((k) => descriptor.Columns?.find((c) => c.Name === k) === undefined);
|
|
45
|
+
keys.forEach((k) => {
|
|
46
|
+
target[k] = values[k];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
NonDbPropertyHydrator = __decorate([
|
|
51
|
+
Injectable(ModelHydrator)
|
|
52
|
+
], NonDbPropertyHydrator);
|
|
53
|
+
export { NonDbPropertyHydrator };
|
|
54
|
+
let OneToManyRelationHydrator = class OneToManyRelationHydrator extends ModelHydrator {
|
|
55
|
+
hydrate(target, values) {
|
|
56
|
+
const descriptor = target.ModelDescriptor;
|
|
57
|
+
if (!descriptor) {
|
|
58
|
+
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
59
|
+
}
|
|
60
|
+
for (const [key, val] of descriptor.Relations) {
|
|
61
|
+
if (val.Type !== RelationType.Many) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (values[key] != null) {
|
|
65
|
+
const entity = target;
|
|
66
|
+
const mapRel = values[key].map((x) => {
|
|
67
|
+
const tEntity = !isConstructor(val.TargetModel) ? new (val.TargetModel())() : new val.TargetModel();
|
|
68
|
+
tEntity['__relationKey__'] = key;
|
|
69
|
+
tEntity.hydrate(x);
|
|
70
|
+
return tEntity;
|
|
71
|
+
});
|
|
72
|
+
const rel = new OneToManyRelationList(target, val.TargetModel, val, mapRel);
|
|
73
|
+
entity[key] = rel;
|
|
74
|
+
delete target[val.ForeignKey];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
OneToManyRelationHydrator = __decorate([
|
|
80
|
+
Injectable(ModelHydrator)
|
|
81
|
+
], OneToManyRelationHydrator);
|
|
82
|
+
export { OneToManyRelationHydrator };
|
|
83
|
+
let OneToOneRelationHydrator = class OneToOneRelationHydrator extends ModelHydrator {
|
|
84
|
+
hydrate(target, values) {
|
|
85
|
+
const descriptor = target.ModelDescriptor;
|
|
86
|
+
if (!descriptor) {
|
|
87
|
+
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
88
|
+
}
|
|
89
|
+
for (const [key, val] of descriptor.Relations) {
|
|
90
|
+
if (val.Type !== RelationType.One) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (values[key] != null) {
|
|
94
|
+
const entity = target;
|
|
95
|
+
let tEntity = undefined;
|
|
96
|
+
if (!Object.values(values[key]).every((x) => x === null)) {
|
|
97
|
+
tEntity = !isConstructor(val.TargetModel) ? new (val.TargetModel())() : new val.TargetModel();
|
|
98
|
+
tEntity.hydrate(values[key]);
|
|
99
|
+
tEntity['__relationKey__'] = key;
|
|
100
|
+
}
|
|
101
|
+
const rel = new SingleRelation(target, val.TargetModel, val, tEntity);
|
|
102
|
+
entity[key] = rel;
|
|
103
|
+
delete target[val.ForeignKey];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
OneToOneRelationHydrator = __decorate([
|
|
109
|
+
Injectable(ModelHydrator)
|
|
110
|
+
], OneToOneRelationHydrator);
|
|
111
|
+
export { OneToOneRelationHydrator };
|
|
112
|
+
let JunctionModelPropertyHydrator = class JunctionModelPropertyHydrator extends ModelHydrator {
|
|
113
|
+
hydrate(target, values) {
|
|
114
|
+
const descriptor = target.ModelDescriptor;
|
|
115
|
+
if (!descriptor) {
|
|
116
|
+
throw new Error(`cannot hydrate model ${target.constructor.name}, no model descriptor found`);
|
|
117
|
+
}
|
|
118
|
+
for (const jt of descriptor.JunctionModelProperties) {
|
|
119
|
+
const entity = new jt.Model();
|
|
120
|
+
entity.hydrate(values.JunctionModel);
|
|
121
|
+
target[jt.Name] = entity;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
JunctionModelPropertyHydrator = __decorate([
|
|
126
|
+
Injectable(ModelHydrator)
|
|
127
|
+
], JunctionModelPropertyHydrator);
|
|
128
|
+
export { JunctionModelPropertyHydrator };
|
|
129
129
|
//# sourceMappingURL=hydrators.js.map
|
package/lib/mjs/hydrators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrators.js","sourceRoot":"","sources":["../../src/hydrators.ts"],"names":[],"mappings":";;;;;;AAAA,sCAAsC;AACtC,OAAO,EAAsB,YAAY,EA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OAAQ,MAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;aACxC;SACF;IACH,CAAC;CACF,CAAA;AA3BY,wBAAwB;IADpC,UAAU,CAAC,aAAa,CAAC;GACb,wBAAwB,CA2BpC;;AAGM,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,aAAa;IACvD,OAAO,CAAC,MAAiB,EAAE,MAAW;QAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,CAAC,WAAW,CAAC,IAAI,6BAA6B,CAAC,CAAC;SAC/F;QAED,KAAK,MAAM,EAAE,IAAI,UAAU,CAAC,uBAAuB,EAAE;YACnD,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAEpC,MAAc,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;SACnC;IACH,CAAC;CACF,CAAA;AAdY,6BAA6B;IADzC,UAAU,CAAC,aAAa,CAAC;GACb,6BAA6B,CAczC"}
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from './interfaces.js';
|
|
2
|
-
export * from './enums.js';
|
|
3
|
-
export * from './statements.js';
|
|
4
|
-
export * from './builders.js';
|
|
5
|
-
export * from './model.js';
|
|
6
|
-
export * from './relations.js';
|
|
7
|
-
export * from './relation-objects.js';
|
|
8
|
-
export * from './middlewares.js';
|
|
9
|
-
export * from './orm.js';
|
|
10
|
-
export * from './types.js';
|
|
11
|
-
export * from './decorators.js';
|
|
12
|
-
export * from './hydrators.js';
|
|
13
|
-
export * from './dehydrators.js';
|
|
14
|
-
export * from './driver.js';
|
|
15
|
-
export * from './converters.js';
|
|
16
|
-
export * from './wrappers.js';
|
|
17
|
-
export * from './exceptions.js';
|
|
1
|
+
export * from './interfaces.js';
|
|
2
|
+
export * from './enums.js';
|
|
3
|
+
export * from './statements.js';
|
|
4
|
+
export * from './builders.js';
|
|
5
|
+
export * from './model.js';
|
|
6
|
+
export * from './relations.js';
|
|
7
|
+
export * from './relation-objects.js';
|
|
8
|
+
export * from './middlewares.js';
|
|
9
|
+
export * from './orm.js';
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
export * from './decorators.js';
|
|
12
|
+
export * from './hydrators.js';
|
|
13
|
+
export * from './dehydrators.js';
|
|
14
|
+
export * from './driver.js';
|
|
15
|
+
export * from './converters.js';
|
|
16
|
+
export * from './wrappers.js';
|
|
17
|
+
export * from './exceptions.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/mjs/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from './interfaces.js';
|
|
2
|
-
export * from './enums.js';
|
|
3
|
-
export * from './statements.js';
|
|
4
|
-
export * from './builders.js';
|
|
5
|
-
export * from './model.js';
|
|
6
|
-
export * from './relations.js';
|
|
7
|
-
export * from './relation-objects.js';
|
|
8
|
-
export * from './middlewares.js';
|
|
9
|
-
export * from './orm.js';
|
|
10
|
-
export * from './types.js';
|
|
11
|
-
export * from './decorators.js';
|
|
12
|
-
export * from './hydrators.js';
|
|
13
|
-
export * from './dehydrators.js';
|
|
14
|
-
export * from './driver.js';
|
|
15
|
-
export * from './converters.js';
|
|
16
|
-
export * from './wrappers.js';
|
|
17
|
-
export * from './exceptions.js';
|
|
1
|
+
export * from './interfaces.js';
|
|
2
|
+
export * from './enums.js';
|
|
3
|
+
export * from './statements.js';
|
|
4
|
+
export * from './builders.js';
|
|
5
|
+
export * from './model.js';
|
|
6
|
+
export * from './relations.js';
|
|
7
|
+
export * from './relation-objects.js';
|
|
8
|
+
export * from './middlewares.js';
|
|
9
|
+
export * from './orm.js';
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
export * from './decorators.js';
|
|
12
|
+
export * from './hydrators.js';
|
|
13
|
+
export * from './dehydrators.js';
|
|
14
|
+
export * from './driver.js';
|
|
15
|
+
export * from './converters.js';
|
|
16
|
+
export * from './wrappers.js';
|
|
17
|
+
export * from './exceptions.js';
|
|
18
18
|
//# sourceMappingURL=index.js.map
|