@eggjs/orm-decorator 4.0.0-beta.35 → 4.0.0-beta.36
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/builder/AttributeMetaBuilder.d.ts +11 -7
- package/dist/builder/AttributeMetaBuilder.js +28 -24
- package/dist/builder/IndexMetaBuilder.d.ts +13 -8
- package/dist/builder/IndexMetaBuilder.js +32 -34
- package/dist/builder/ModelMetaBuilder.d.ts +10 -6
- package/dist/builder/ModelMetaBuilder.js +21 -18
- package/dist/builder/index.d.ts +3 -3
- package/dist/builder/index.js +5 -4
- package/dist/decorator/Attribute.d.ts +6 -1
- package/dist/decorator/Attribute.js +14 -9
- package/dist/decorator/DataSource.d.ts +6 -2
- package/dist/decorator/DataSource.js +11 -6
- package/dist/decorator/Model.d.ts +6 -2
- package/dist/decorator/Model.js +21 -20
- package/dist/decorator/ModelIndex.d.ts +6 -2
- package/dist/decorator/ModelIndex.js +11 -6
- package/dist/decorator/index.d.ts +4 -4
- package/dist/decorator/index.js +6 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.js +20 -6
- package/dist/model/AttributeMeta.d.ts +12 -9
- package/dist/model/AttributeMeta.js +22 -19
- package/dist/model/IndexMeta.d.ts +9 -6
- package/dist/model/IndexMeta.js +16 -13
- package/dist/model/ModelMetadata.d.ts +12 -8
- package/dist/model/ModelMetadata.js +16 -15
- package/dist/util/ModelInfoUtil.d.ts +16 -13
- package/dist/util/ModelInfoUtil.js +45 -43
- package/dist/util/ModelMetadataUtil.d.ts +10 -6
- package/dist/util/ModelMetadataUtil.js +15 -12
- package/dist/util/NameUtil.d.ts +24 -21
- package/dist/util/NameUtil.js +34 -32
- package/dist/util/index.d.ts +3 -3
- package/dist/util/index.js +5 -4
- package/package.json +25 -29
- package/dist/model/index.d.ts +0 -3
- package/dist/model/index.js +0 -4
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { AttributeMeta } from "../model/AttributeMeta.js";
|
|
2
|
+
import { EggProtoImplClass } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/builder/AttributeMetaBuilder.d.ts
|
|
5
|
+
declare class AttributeMetaBuilder {
|
|
6
|
+
private readonly clazz;
|
|
7
|
+
constructor(clazz: EggProtoImplClass);
|
|
8
|
+
build(): Array<AttributeMeta>;
|
|
9
|
+
private buildAttributeMeta;
|
|
8
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AttributeMetaBuilder };
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { AttributeMeta } from "../model/
|
|
2
|
-
import { ModelInfoUtil
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { AttributeMeta } from "../model/AttributeMeta.js";
|
|
2
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
3
|
+
import { NameUtil } from "../util/NameUtil.js";
|
|
4
|
+
import "../util/index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/builder/AttributeMetaBuilder.ts
|
|
7
|
+
var AttributeMetaBuilder = class {
|
|
8
|
+
clazz;
|
|
9
|
+
constructor(clazz) {
|
|
10
|
+
this.clazz = clazz;
|
|
11
|
+
}
|
|
12
|
+
build() {
|
|
13
|
+
const modelAttributes = ModelInfoUtil.getModelAttributes(this.clazz);
|
|
14
|
+
const attributes = [];
|
|
15
|
+
if (!modelAttributes) throw new Error(`model ${this.clazz.name} has no attributes`);
|
|
16
|
+
for (const [propertyName, attributeInfo] of modelAttributes) {
|
|
17
|
+
const attribute = this.buildAttributeMeta(propertyName, attributeInfo);
|
|
18
|
+
attributes.push(attribute);
|
|
19
|
+
}
|
|
20
|
+
return attributes;
|
|
21
|
+
}
|
|
22
|
+
buildAttributeMeta(propertyName, attributeInfo) {
|
|
23
|
+
return new AttributeMeta(attributeInfo.dataType, propertyName, attributeInfo.options?.name ?? NameUtil.getAttributeName(propertyName), attributeInfo.options?.allowNull ?? true, attributeInfo.options?.autoIncrement ?? false, attributeInfo.options?.primary ?? false, attributeInfo.options?.unique ?? false);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AttributeMetaBuilder };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IndexMeta
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { AttributeMeta } from "../model/AttributeMeta.js";
|
|
2
|
+
import { IndexMeta } from "../model/IndexMeta.js";
|
|
3
|
+
import { EggProtoImplClass } from "@eggjs/tegg-types";
|
|
4
|
+
|
|
5
|
+
//#region src/builder/IndexMetaBuilder.d.ts
|
|
6
|
+
declare class IndexMetaBuilder {
|
|
7
|
+
private readonly clazz;
|
|
8
|
+
private readonly attributes;
|
|
9
|
+
constructor(clazz: EggProtoImplClass, attributes: Array<AttributeMeta>);
|
|
10
|
+
build(): Array<IndexMeta>;
|
|
11
|
+
private buildIndexMeta;
|
|
9
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { IndexMetaBuilder };
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import { IndexMeta
|
|
2
|
-
import { ModelInfoUtil
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5kZXhNZXRhQnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZGVyL0luZGV4TWV0YUJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxhQUFhLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUM3RCxPQUFPLEVBQUUsYUFBYSxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRTNELE1BQU0sT0FBTyxnQkFBZ0I7SUFDVixLQUFLLENBQW9CO0lBQ3pCLFVBQVUsQ0FBdUI7SUFFbEQsWUFBWSxLQUF3QixFQUFFLFVBQWdDO1FBQ3BFLElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDO1FBQ25CLElBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxDQUFDO0lBQy9CLENBQUM7SUFFRCxLQUFLO1FBQ0gsT0FBTyxhQUFhLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxTQUFTLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQztJQUN0RyxDQUFDO0lBRU8sY0FBYyxDQUFDLFNBQXlCO1FBQzlDLE1BQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQztRQUM1QixLQUFLLE1BQU0sS0FBSyxJQUFJLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUNyQyxNQUFNLFNBQVMsR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLFlBQVksS0FBSyxLQUFLLENBQUMsQ0FBQztZQUN4RSxJQUFJLENBQUMsU0FBUyxFQUFFLENBQUM7Z0JBQ2YsTUFBTSxJQUFJLEtBQUssQ0FBQyxTQUFTLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSwyQkFBMkIsS0FBSyxFQUFFLENBQUMsQ0FBQztZQUM5RSxDQUFDO1lBQ0QsTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDdkMsQ0FBQztRQUVELElBQUksU0FBaUIsQ0FBQztRQUN0QixJQUFJLFNBQVMsQ0FBQyxPQUFPLEVBQUUsSUFBSSxFQUFFLENBQUM7WUFDNUIsU0FBUyxHQUFHLFNBQVMsQ0FBQyxPQUFRLENBQUMsSUFBSSxDQUFDO1FBQ3RDLENBQUM7YUFBTSxDQUFDO1lBQ04sU0FBUyxHQUFHLFFBQVEsQ0FBQyxZQUFZLENBQUMsTUFBTSxFQUFFO2dCQUN4QyxNQUFNLEVBQUUsU0FBUyxDQUFDLE9BQU8sRUFBRSxNQUFNO2FBQ2xDLENBQUMsQ0FBQztRQUNMLENBQUM7UUFDRCxPQUFPLElBQUksU0FBUyxDQUFDLFNBQVMsRUFBRSxNQUFNLEVBQUUsU0FBUyxDQUFDLE9BQU8sRUFBRSxNQUFNLElBQUksS0FBSyxFQUFFLFNBQVMsQ0FBQyxPQUFPLEVBQUUsT0FBTyxJQUFJLEtBQUssQ0FBQyxDQUFDO0lBQ25ILENBQUM7Q0FDRiJ9
|
|
1
|
+
import { IndexMeta } from "../model/IndexMeta.js";
|
|
2
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
3
|
+
import { NameUtil } from "../util/NameUtil.js";
|
|
4
|
+
import "../util/index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/builder/IndexMetaBuilder.ts
|
|
7
|
+
var IndexMetaBuilder = class {
|
|
8
|
+
clazz;
|
|
9
|
+
attributes;
|
|
10
|
+
constructor(clazz, attributes) {
|
|
11
|
+
this.clazz = clazz;
|
|
12
|
+
this.attributes = attributes;
|
|
13
|
+
}
|
|
14
|
+
build() {
|
|
15
|
+
return ModelInfoUtil.getModelIndices(this.clazz).map((indexInfo) => this.buildIndexMeta(indexInfo));
|
|
16
|
+
}
|
|
17
|
+
buildIndexMeta(indexInfo) {
|
|
18
|
+
const fields = [];
|
|
19
|
+
for (const field of indexInfo.fields) {
|
|
20
|
+
const attribute = this.attributes.find((t) => t.propertyName === field);
|
|
21
|
+
if (!attribute) throw new Error(`model ${this.clazz.name} has no attribute named ${field}`);
|
|
22
|
+
fields.push(attribute.attributeName);
|
|
23
|
+
}
|
|
24
|
+
let indexName;
|
|
25
|
+
if (indexInfo.options?.name) indexName = indexInfo.options.name;
|
|
26
|
+
else indexName = NameUtil.getIndexName(fields, { unique: indexInfo.options?.unique });
|
|
27
|
+
return new IndexMeta(indexName, fields, indexInfo.options?.unique ?? false, indexInfo.options?.primary ?? false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { IndexMetaBuilder };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ModelMetadata } from "../model/ModelMetadata.js";
|
|
2
|
+
import { EggProtoImplClass } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/builder/ModelMetaBuilder.d.ts
|
|
5
|
+
declare class ModelMetaBuilder {
|
|
6
|
+
private readonly clazz;
|
|
7
|
+
constructor(clazz: EggProtoImplClass);
|
|
8
|
+
build(): ModelMetadata;
|
|
7
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ModelMetaBuilder };
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { ModelMetadata } from "../model/
|
|
2
|
-
import { ModelInfoUtil
|
|
1
|
+
import { ModelMetadata } from "../model/ModelMetadata.js";
|
|
2
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
3
|
+
import { NameUtil } from "../util/NameUtil.js";
|
|
4
|
+
import "../util/index.js";
|
|
3
5
|
import { AttributeMetaBuilder } from "./AttributeMetaBuilder.js";
|
|
4
6
|
import { IndexMetaBuilder } from "./IndexMetaBuilder.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//#
|
|
7
|
+
|
|
8
|
+
//#region src/builder/ModelMetaBuilder.ts
|
|
9
|
+
var ModelMetaBuilder = class {
|
|
10
|
+
clazz;
|
|
11
|
+
constructor(clazz) {
|
|
12
|
+
this.clazz = clazz;
|
|
13
|
+
}
|
|
14
|
+
build() {
|
|
15
|
+
const dataSource = ModelInfoUtil.getDataSource(this.clazz);
|
|
16
|
+
const tableName = ModelInfoUtil.getTableName(this.clazz) || NameUtil.getTableName(this.clazz.name);
|
|
17
|
+
const attributes = new AttributeMetaBuilder(this.clazz).build();
|
|
18
|
+
return new ModelMetadata(dataSource, tableName, attributes, new IndexMetaBuilder(this.clazz, attributes).build());
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ModelMetaBuilder };
|
package/dist/builder/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { AttributeMetaBuilder } from "./AttributeMetaBuilder.js";
|
|
2
|
+
import { IndexMetaBuilder } from "./IndexMetaBuilder.js";
|
|
3
|
+
import { ModelMetaBuilder } from "./ModelMetaBuilder.js";
|
package/dist/builder/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { AttributeMetaBuilder } from "./AttributeMetaBuilder.js";
|
|
2
|
+
import { IndexMetaBuilder } from "./IndexMetaBuilder.js";
|
|
3
|
+
import { ModelMetaBuilder } from "./ModelMetaBuilder.js";
|
|
4
|
+
|
|
5
|
+
export { };
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { AttributeOptions } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/decorator/Attribute.d.ts
|
|
4
|
+
declare function Attribute(dataType: string, options?: AttributeOptions): (target: any, propertyKey: PropertyKey) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Attribute };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
2
|
+
import "../util/index.js";
|
|
3
|
+
import assert from "node:assert";
|
|
4
|
+
|
|
5
|
+
//#region src/decorator/Attribute.ts
|
|
6
|
+
function Attribute(dataType, options) {
|
|
7
|
+
return function(target, propertyKey) {
|
|
8
|
+
const clazz = target.constructor;
|
|
9
|
+
assert(typeof propertyKey === "string", `[model/${clazz.name}] expect method name be typeof string, but now is ${String(propertyKey)}`);
|
|
10
|
+
ModelInfoUtil.addModelAttribute(dataType, options, clazz, propertyKey);
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
|
-
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Attribute };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { EggProtoImplClass } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/decorator/DataSource.d.ts
|
|
4
|
+
declare function DataSource(dataSource: string): (clazz: EggProtoImplClass) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { DataSource };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ModelInfoUtil } from "../util/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
2
|
+
import "../util/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/decorator/DataSource.ts
|
|
5
|
+
function DataSource(dataSource) {
|
|
6
|
+
return function(clazz) {
|
|
7
|
+
ModelInfoUtil.setDataSource(dataSource, clazz);
|
|
8
|
+
};
|
|
6
9
|
}
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { DataSource };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { EggProtoImplClass, ModelParams } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/decorator/Model.d.ts
|
|
4
|
+
declare function Model(param?: ModelParams): (clazz: EggProtoImplClass) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Model };
|
package/dist/decorator/Model.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
2
|
+
import "../util/index.js";
|
|
3
|
+
import { SingletonProto } from "@eggjs/core-decorator";
|
|
4
|
+
import { AccessLevel, MODEL_PROTO_IMPL_TYPE } from "@eggjs/tegg-types";
|
|
5
|
+
|
|
6
|
+
//#region src/decorator/Model.ts
|
|
7
|
+
function Model(param) {
|
|
8
|
+
return function(clazz) {
|
|
9
|
+
ModelInfoUtil.setIsModel(true, clazz);
|
|
10
|
+
const func = SingletonProto({
|
|
11
|
+
name: clazz.name,
|
|
12
|
+
accessLevel: AccessLevel.PUBLIC,
|
|
13
|
+
protoImplType: MODEL_PROTO_IMPL_TYPE
|
|
14
|
+
});
|
|
15
|
+
if (param?.tableName) ModelInfoUtil.setTableName(param.tableName, clazz);
|
|
16
|
+
if (param?.dataSource) ModelInfoUtil.setDataSource(param.dataSource, clazz);
|
|
17
|
+
func(clazz);
|
|
18
|
+
};
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Model };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { EggProtoImplClass, IndexOptions } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/decorator/ModelIndex.d.ts
|
|
4
|
+
declare function Index(fields: string[], params?: IndexOptions): (clazz: EggProtoImplClass) => void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Index };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ModelInfoUtil } from "../util/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ModelInfoUtil } from "../util/ModelInfoUtil.js";
|
|
2
|
+
import "../util/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/decorator/ModelIndex.ts
|
|
5
|
+
function Index(fields, params) {
|
|
6
|
+
return function(clazz) {
|
|
7
|
+
ModelInfoUtil.addModelIndex(fields, params, clazz);
|
|
8
|
+
};
|
|
6
9
|
}
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Index };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Attribute } from "./Attribute.js";
|
|
2
|
+
import { DataSource } from "./DataSource.js";
|
|
3
|
+
import { Model } from "./Model.js";
|
|
4
|
+
import { Index } from "./ModelIndex.js";
|
package/dist/decorator/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Attribute } from "./Attribute.js";
|
|
2
|
+
import { DataSource } from "./DataSource.js";
|
|
3
|
+
import { Model } from "./Model.js";
|
|
4
|
+
import { Index } from "./ModelIndex.js";
|
|
5
|
+
|
|
6
|
+
export { };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { AttributeMeta } from "./model/AttributeMeta.js";
|
|
2
|
+
import { IndexMeta } from "./model/IndexMeta.js";
|
|
3
|
+
import { ModelMetadata } from "./model/ModelMetadata.js";
|
|
4
|
+
import { AttributeMetaBuilder } from "./builder/AttributeMetaBuilder.js";
|
|
5
|
+
import { IndexMetaBuilder } from "./builder/IndexMetaBuilder.js";
|
|
6
|
+
import { ModelMetaBuilder } from "./builder/ModelMetaBuilder.js";
|
|
7
|
+
import "./builder/index.js";
|
|
8
|
+
import { Attribute } from "./decorator/Attribute.js";
|
|
9
|
+
import { DataSource } from "./decorator/DataSource.js";
|
|
10
|
+
import { Model } from "./decorator/Model.js";
|
|
11
|
+
import { Index } from "./decorator/ModelIndex.js";
|
|
12
|
+
import "./decorator/index.js";
|
|
13
|
+
import { ModelInfoUtil } from "./util/ModelInfoUtil.js";
|
|
14
|
+
import { MODEL_METADATA, ModelMetadataUtil } from "./util/ModelMetadataUtil.js";
|
|
15
|
+
import { NameUtil } from "./util/NameUtil.js";
|
|
16
|
+
import "./util/index.js";
|
|
17
|
+
export * from "@eggjs/tegg-types/orm";
|
|
18
|
+
export { Attribute, AttributeMeta, AttributeMetaBuilder, DataSource, Index, IndexMeta, IndexMetaBuilder, MODEL_METADATA, Model, ModelInfoUtil, ModelMetaBuilder, ModelMetadata, ModelMetadataUtil, NameUtil };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { AttributeMeta } from "./model/AttributeMeta.js";
|
|
2
|
+
import { IndexMeta } from "./model/IndexMeta.js";
|
|
3
|
+
import { ModelMetadata } from "./model/ModelMetadata.js";
|
|
4
|
+
import { ModelInfoUtil } from "./util/ModelInfoUtil.js";
|
|
5
|
+
import { MODEL_METADATA, ModelMetadataUtil } from "./util/ModelMetadataUtil.js";
|
|
6
|
+
import { NameUtil } from "./util/NameUtil.js";
|
|
7
|
+
import "./util/index.js";
|
|
8
|
+
import { AttributeMetaBuilder } from "./builder/AttributeMetaBuilder.js";
|
|
9
|
+
import { IndexMetaBuilder } from "./builder/IndexMetaBuilder.js";
|
|
10
|
+
import { ModelMetaBuilder } from "./builder/ModelMetaBuilder.js";
|
|
11
|
+
import "./builder/index.js";
|
|
12
|
+
import { Attribute } from "./decorator/Attribute.js";
|
|
13
|
+
import { DataSource } from "./decorator/DataSource.js";
|
|
14
|
+
import { Model } from "./decorator/Model.js";
|
|
15
|
+
import { Index } from "./decorator/ModelIndex.js";
|
|
16
|
+
import "./decorator/index.js";
|
|
17
|
+
|
|
18
|
+
export * from "@eggjs/tegg-types/orm"
|
|
19
|
+
|
|
20
|
+
export { Attribute, AttributeMeta, AttributeMetaBuilder, DataSource, Index, IndexMeta, IndexMetaBuilder, MODEL_METADATA, Model, ModelInfoUtil, ModelMetaBuilder, ModelMetadata, ModelMetadataUtil, NameUtil };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region src/model/AttributeMeta.d.ts
|
|
2
|
+
declare class AttributeMeta {
|
|
3
|
+
readonly dataType: string;
|
|
4
|
+
readonly propertyName: string;
|
|
5
|
+
readonly attributeName: string;
|
|
6
|
+
readonly allowNull: boolean;
|
|
7
|
+
readonly autoIncrement: boolean;
|
|
8
|
+
readonly primary: boolean;
|
|
9
|
+
readonly unique: boolean;
|
|
10
|
+
constructor(dataType: string, propertyName: string, attributeName: string, allowNull: boolean, autoIncrement: boolean, primary: boolean, unique: boolean);
|
|
10
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { AttributeMeta };
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
1
|
+
//#region src/model/AttributeMeta.ts
|
|
2
|
+
var AttributeMeta = class {
|
|
3
|
+
dataType;
|
|
4
|
+
propertyName;
|
|
5
|
+
attributeName;
|
|
6
|
+
allowNull;
|
|
7
|
+
autoIncrement;
|
|
8
|
+
primary;
|
|
9
|
+
unique;
|
|
10
|
+
constructor(dataType, propertyName, attributeName, allowNull, autoIncrement, primary, unique) {
|
|
11
|
+
this.dataType = dataType;
|
|
12
|
+
this.propertyName = propertyName;
|
|
13
|
+
this.attributeName = attributeName;
|
|
14
|
+
this.allowNull = allowNull;
|
|
15
|
+
this.autoIncrement = autoIncrement;
|
|
16
|
+
this.primary = primary;
|
|
17
|
+
this.unique = unique;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AttributeMeta };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
//#region src/model/IndexMeta.d.ts
|
|
2
|
+
declare class IndexMeta {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly fields: string[];
|
|
5
|
+
readonly unique: boolean;
|
|
6
|
+
readonly primary: boolean;
|
|
7
|
+
constructor(name: string, fields: string[], unique: boolean, primary: boolean);
|
|
7
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { IndexMeta };
|
package/dist/model/IndexMeta.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
//#region src/model/IndexMeta.ts
|
|
2
|
+
var IndexMeta = class {
|
|
3
|
+
name;
|
|
4
|
+
fields;
|
|
5
|
+
unique;
|
|
6
|
+
primary;
|
|
7
|
+
constructor(name, fields, unique, primary) {
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.fields = fields;
|
|
10
|
+
this.unique = unique;
|
|
11
|
+
this.primary = primary;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { IndexMeta };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { AttributeMeta } from
|
|
2
|
-
import { IndexMeta } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { AttributeMeta } from "./AttributeMeta.js";
|
|
2
|
+
import { IndexMeta } from "./IndexMeta.js";
|
|
3
|
+
|
|
4
|
+
//#region src/model/ModelMetadata.d.ts
|
|
5
|
+
declare class ModelMetadata {
|
|
6
|
+
readonly dataSource: string | undefined;
|
|
7
|
+
readonly tableName: string;
|
|
8
|
+
readonly attributes: Array<AttributeMeta>;
|
|
9
|
+
readonly indices: Array<IndexMeta>;
|
|
10
|
+
constructor(dataSource: string | undefined, tableName: string, attributes: Array<AttributeMeta>, indices: Array<IndexMeta>);
|
|
9
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ModelMetadata };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//#
|
|
1
|
+
//#region src/model/ModelMetadata.ts
|
|
2
|
+
var ModelMetadata = class {
|
|
3
|
+
dataSource;
|
|
4
|
+
tableName;
|
|
5
|
+
attributes;
|
|
6
|
+
indices;
|
|
7
|
+
constructor(dataSource, tableName, attributes, indices) {
|
|
8
|
+
this.dataSource = dataSource;
|
|
9
|
+
this.tableName = tableName;
|
|
10
|
+
this.attributes = attributes;
|
|
11
|
+
this.indices = indices;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ModelMetadata };
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AttributeOptions, EggProtoImplClass, IndexOptions, ModelAttributeInfo, ModelIndexInfo } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/util/ModelInfoUtil.d.ts
|
|
2
4
|
type ModelAttributeMap = Map<string, ModelAttributeInfo>;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
declare class ModelInfoUtil {
|
|
6
|
+
static setIsModel(isModel: boolean, clazz: EggProtoImplClass): void;
|
|
7
|
+
static getIsModel(clazz: EggProtoImplClass): boolean;
|
|
8
|
+
static setDataSource(dataSource: string, clazz: EggProtoImplClass): void;
|
|
9
|
+
static getDataSource(clazz: EggProtoImplClass): string | undefined;
|
|
10
|
+
static setTableName(tableName: string, clazz: EggProtoImplClass): void;
|
|
11
|
+
static getTableName(clazz: EggProtoImplClass): string | undefined;
|
|
12
|
+
static addModelIndex(fields: string[], options: IndexOptions | undefined, clazz: EggProtoImplClass): void;
|
|
13
|
+
static getModelIndices(clazz: EggProtoImplClass): Array<ModelIndexInfo>;
|
|
14
|
+
static addModelAttribute(dataType: string, options: AttributeOptions | undefined, clazz: EggProtoImplClass, property: string): void;
|
|
15
|
+
static getModelAttributes(clazz: EggProtoImplClass): ModelAttributeMap | undefined;
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ModelInfoUtil };
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import { MetadataUtil } from
|
|
2
|
-
import { IS_MODEL, MODEL_DATA_ATTRIBUTES, MODEL_DATA_INDICES, MODEL_DATA_SOURCE, MODEL_DATA_TABLE_NAME
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
import { IS_MODEL, MODEL_DATA_ATTRIBUTES, MODEL_DATA_INDICES, MODEL_DATA_SOURCE, MODEL_DATA_TABLE_NAME } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/ModelInfoUtil.ts
|
|
5
|
+
var ModelInfoUtil = class {
|
|
6
|
+
static setIsModel(isModel, clazz) {
|
|
7
|
+
MetadataUtil.defineMetaData(IS_MODEL, isModel, clazz);
|
|
8
|
+
}
|
|
9
|
+
static getIsModel(clazz) {
|
|
10
|
+
return MetadataUtil.getBooleanMetaData(IS_MODEL, clazz);
|
|
11
|
+
}
|
|
12
|
+
static setDataSource(dataSource, clazz) {
|
|
13
|
+
MetadataUtil.defineMetaData(MODEL_DATA_SOURCE, dataSource, clazz);
|
|
14
|
+
}
|
|
15
|
+
static getDataSource(clazz) {
|
|
16
|
+
return MetadataUtil.getMetaData(MODEL_DATA_SOURCE, clazz);
|
|
17
|
+
}
|
|
18
|
+
static setTableName(tableName, clazz) {
|
|
19
|
+
MetadataUtil.defineMetaData(MODEL_DATA_TABLE_NAME, tableName, clazz);
|
|
20
|
+
}
|
|
21
|
+
static getTableName(clazz) {
|
|
22
|
+
return MetadataUtil.getMetaData(MODEL_DATA_TABLE_NAME, clazz);
|
|
23
|
+
}
|
|
24
|
+
static addModelIndex(fields, options, clazz) {
|
|
25
|
+
MetadataUtil.initOwnArrayMetaData(MODEL_DATA_INDICES, clazz, []).push({
|
|
26
|
+
fields,
|
|
27
|
+
options
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static getModelIndices(clazz) {
|
|
31
|
+
return MetadataUtil.getArrayMetaData(MODEL_DATA_INDICES, clazz);
|
|
32
|
+
}
|
|
33
|
+
static addModelAttribute(dataType, options, clazz, property) {
|
|
34
|
+
MetadataUtil.initOwnMapMetaData(MODEL_DATA_ATTRIBUTES, clazz, /* @__PURE__ */ new Map()).set(property, {
|
|
35
|
+
dataType,
|
|
36
|
+
options
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
static getModelAttributes(clazz) {
|
|
40
|
+
return MetadataUtil.getMetaData(MODEL_DATA_ATTRIBUTES, clazz);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ModelInfoUtil };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ModelMetadata } from "../model/ModelMetadata.js";
|
|
2
|
+
import { EggProtoImplClass } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/ModelMetadataUtil.d.ts
|
|
5
|
+
declare const MODEL_METADATA: symbol;
|
|
6
|
+
declare class ModelMetadataUtil {
|
|
7
|
+
static setModelMetadata(clazz: EggProtoImplClass, metaData: ModelMetadata): void;
|
|
8
|
+
static getModelMetadata(clazz: EggProtoImplClass): ModelMetadata | undefined;
|
|
7
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MODEL_METADATA, ModelMetadataUtil };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { MetadataUtil } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
|
|
3
|
+
//#region src/util/ModelMetadataUtil.ts
|
|
4
|
+
const MODEL_METADATA = Symbol.for("EggPrototype#model#metadata");
|
|
5
|
+
var ModelMetadataUtil = class {
|
|
6
|
+
static setModelMetadata(clazz, metaData) {
|
|
7
|
+
MetadataUtil.defineMetaData(MODEL_METADATA, metaData, clazz);
|
|
8
|
+
}
|
|
9
|
+
static getModelMetadata(clazz) {
|
|
10
|
+
return MetadataUtil.getMetaData(MODEL_METADATA, clazz);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MODEL_METADATA, ModelMetadataUtil };
|
package/dist/util/NameUtil.d.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
//#region src/util/NameUtil.d.ts
|
|
2
|
+
declare class NameUtil {
|
|
3
|
+
/**
|
|
4
|
+
* get table name
|
|
5
|
+
* StudentScore -> student_scores
|
|
6
|
+
*/
|
|
7
|
+
static getTableName(modelName: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* get attribute name
|
|
10
|
+
* userName -> user_name
|
|
11
|
+
*/
|
|
12
|
+
static getAttributeName(propertyName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* [ 'user_name' ], unique
|
|
15
|
+
* uk_user_name
|
|
16
|
+
*
|
|
17
|
+
* [ 'user_name', 'gender' ]
|
|
18
|
+
* idx_user_name_gender
|
|
19
|
+
*/
|
|
20
|
+
static getIndexName(fields: string[], options?: {
|
|
21
|
+
unique?: boolean;
|
|
22
|
+
}): string;
|
|
22
23
|
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { NameUtil };
|
package/dist/util/NameUtil.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import _ from
|
|
2
|
-
import pluralize from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import pluralize from "pluralize";
|
|
3
|
+
|
|
4
|
+
//#region src/util/NameUtil.ts
|
|
5
|
+
var NameUtil = class {
|
|
6
|
+
/**
|
|
7
|
+
* get table name
|
|
8
|
+
* StudentScore -> student_scores
|
|
9
|
+
*/
|
|
10
|
+
static getTableName(modelName) {
|
|
11
|
+
const modelNames = pluralize(modelName);
|
|
12
|
+
return _.snakeCase(modelNames);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* get attribute name
|
|
16
|
+
* userName -> user_name
|
|
17
|
+
*/
|
|
18
|
+
static getAttributeName(propertyName) {
|
|
19
|
+
return _.snakeCase(propertyName);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* [ 'user_name' ], unique
|
|
23
|
+
* uk_user_name
|
|
24
|
+
*
|
|
25
|
+
* [ 'user_name', 'gender' ]
|
|
26
|
+
* idx_user_name_gender
|
|
27
|
+
*/
|
|
28
|
+
static getIndexName(fields, options) {
|
|
29
|
+
return (options?.unique ? "uk_" : "idx_") + fields.join("_");
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { NameUtil };
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ModelInfoUtil } from "./ModelInfoUtil.js";
|
|
2
|
+
import { MODEL_METADATA, ModelMetadataUtil } from "./ModelMetadataUtil.js";
|
|
3
|
+
import { NameUtil } from "./NameUtil.js";
|
package/dist/util/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ModelInfoUtil } from "./ModelInfoUtil.js";
|
|
2
|
+
import { MODEL_METADATA, ModelMetadataUtil } from "./ModelMetadataUtil.js";
|
|
3
|
+
import { NameUtil } from "./NameUtil.js";
|
|
4
|
+
|
|
5
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,58 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/orm-decorator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.36",
|
|
4
4
|
"description": "tegg orm decorator",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./dist/index.js",
|
|
8
|
-
"./package.json": "./package.json"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
5
|
"keywords": [
|
|
14
6
|
"egg",
|
|
15
|
-
"typescript",
|
|
16
7
|
"runtime",
|
|
17
|
-
"tegg"
|
|
8
|
+
"tegg",
|
|
9
|
+
"typescript"
|
|
18
10
|
],
|
|
19
|
-
"author": "killagu <killa123@126.com>",
|
|
20
|
-
"license": "MIT",
|
|
21
11
|
"homepage": "https://github.com/eggjs/egg/tree/next/tegg/core/orm-decorator",
|
|
22
12
|
"bugs": {
|
|
23
13
|
"url": "https://github.com/eggjs/egg/issues"
|
|
24
14
|
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "killagu <killa123@126.com>",
|
|
25
17
|
"repository": {
|
|
26
18
|
"type": "git",
|
|
27
19
|
"url": "git+https://github.com/eggjs/egg.git",
|
|
28
20
|
"directory": "tegg/core/orm-decorator"
|
|
29
21
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
32
35
|
},
|
|
33
36
|
"dependencies": {
|
|
34
37
|
"lodash": "^4.17.21",
|
|
35
38
|
"pluralize": "^8.0.0",
|
|
36
|
-
"@eggjs/
|
|
37
|
-
"@eggjs/
|
|
39
|
+
"@eggjs/tegg-types": "4.0.0-beta.36",
|
|
40
|
+
"@eggjs/core-decorator": "4.0.0-beta.36"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
43
|
"@types/lodash": "^4.17.20",
|
|
41
|
-
"@types/node": "^24.10.
|
|
44
|
+
"@types/node": "^24.10.2",
|
|
42
45
|
"@types/pluralize": "^0.0.33",
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^5.9.3",
|
|
45
|
-
"unplugin-unused": "^0.5.4"
|
|
46
|
+
"typescript": "^5.9.3"
|
|
46
47
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=22.18.0"
|
|
49
50
|
},
|
|
50
|
-
"main": "./dist/index.js",
|
|
51
|
-
"module": "./dist/index.js",
|
|
52
|
-
"types": "./dist/index.d.ts",
|
|
53
51
|
"scripts": {
|
|
54
|
-
"
|
|
55
|
-
"build": "tsdown && npm run clean && tsc -p tsconfig.build.json",
|
|
56
|
-
"typecheck": "tsc --noEmit"
|
|
52
|
+
"typecheck": "tsgo --noEmit"
|
|
57
53
|
}
|
|
58
54
|
}
|
package/dist/model/index.d.ts
DELETED
package/dist/model/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from "./AttributeMeta.js";
|
|
2
|
-
export * from "./IndexMeta.js";
|
|
3
|
-
export * from "./ModelMetadata.js";
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbW9kZWwvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsb0JBQW9CLENBQUMifQ==
|