@eggjs/tegg-types 4.0.0-beta.34 → 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/aop/Advice.d.ts +39 -36
- package/dist/aop/Advice.js +1 -2
- package/dist/aop/Aspect.d.ts +15 -11
- package/dist/aop/Aspect.js +5 -2
- package/dist/aop/Crosscut.d.ts +27 -23
- package/dist/aop/Crosscut.js +6 -3
- package/dist/aop/Pointcut.d.ts +27 -23
- package/dist/aop/Pointcut.js +9 -15
- package/dist/aop/index.d.ts +5 -4
- package/dist/aop/index.js +5 -5
- package/dist/common/Graph.d.ts +5 -2
- package/dist/common/Graph.js +1 -2
- package/dist/common/Logger.d.ts +9 -6
- package/dist/common/Logger.js +1 -2
- package/dist/common/ModuleConfig.d.ts +24 -22
- package/dist/common/ModuleConfig.js +1 -2
- package/dist/common/RuntimeConfig.d.ts +17 -14
- package/dist/common/RuntimeConfig.js +1 -2
- package/dist/common/index.d.ts +5 -4
- package/dist/common/index.js +1 -5
- package/dist/controller-decorator/HTTPController.d.ts +7 -4
- package/dist/controller-decorator/HTTPController.js +1 -2
- package/dist/controller-decorator/HTTPMethod.d.ts +10 -5
- package/dist/controller-decorator/HTTPMethod.js +1 -2
- package/dist/controller-decorator/HTTPParam.d.ts +9 -6
- package/dist/controller-decorator/HTTPParam.js +1 -2
- package/dist/controller-decorator/MetadataKey.d.ts +23 -20
- package/dist/controller-decorator/MetadataKey.js +24 -21
- package/dist/controller-decorator/builder.d.ts +10 -5
- package/dist/controller-decorator/builder.js +1 -2
- package/dist/controller-decorator/index.d.ts +10 -6
- package/dist/controller-decorator/index.js +4 -7
- package/dist/controller-decorator/model/ControllerMetadata.d.ts +14 -10
- package/dist/controller-decorator/model/ControllerMetadata.js +1 -2
- package/dist/controller-decorator/model/MethodMeta.d.ts +9 -5
- package/dist/controller-decorator/model/MethodMeta.js +1 -2
- package/dist/controller-decorator/model/index.d.ts +4 -3
- package/dist/controller-decorator/model/index.js +3 -4
- package/dist/controller-decorator/model/types.d.ts +47 -44
- package/dist/controller-decorator/model/types.js +37 -34
- package/dist/core-decorator/ContextProto.d.ts +9 -5
- package/dist/core-decorator/ContextProto.js +3 -2
- package/dist/core-decorator/Inject.d.ts +6 -3
- package/dist/core-decorator/Inject.js +1 -2
- package/dist/core-decorator/Metadata.d.ts +4 -1
- package/dist/core-decorator/Metadata.js +1 -2
- package/dist/core-decorator/MultiInstanceProto.d.ts +28 -23
- package/dist/core-decorator/MultiInstanceProto.js +1 -2
- package/dist/core-decorator/Prototype.d.ts +12 -7
- package/dist/core-decorator/Prototype.js +5 -2
- package/dist/core-decorator/SingletonProto.d.ts +9 -5
- package/dist/core-decorator/SingletonProto.js +1 -2
- package/dist/core-decorator/enum/AccessLevel.d.ts +7 -4
- package/dist/core-decorator/enum/AccessLevel.js +7 -6
- package/dist/core-decorator/enum/EggType.d.ts +7 -4
- package/dist/core-decorator/enum/EggType.js +7 -4
- package/dist/core-decorator/enum/InjectType.d.ts +7 -4
- package/dist/core-decorator/enum/InjectType.js +7 -4
- package/dist/core-decorator/enum/MultiInstanceType.d.ts +7 -4
- package/dist/core-decorator/enum/MultiInstanceType.js +7 -4
- package/dist/core-decorator/enum/ObjectInitType.d.ts +10 -7
- package/dist/core-decorator/enum/ObjectInitType.js +12 -12
- package/dist/core-decorator/enum/Qualifier.d.ts +10 -7
- package/dist/core-decorator/enum/Qualifier.js +11 -8
- package/dist/core-decorator/enum/index.d.ts +7 -6
- package/dist/core-decorator/enum/index.js +8 -7
- package/dist/core-decorator/index.d.ts +18 -8
- package/dist/core-decorator/index.js +12 -9
- package/dist/core-decorator/model/EggMultiInstancePrototypeInfo.d.ts +58 -53
- package/dist/core-decorator/model/EggMultiInstancePrototypeInfo.js +4 -4
- package/dist/core-decorator/model/EggPrototypeInfo.d.ts +38 -33
- package/dist/core-decorator/model/EggPrototypeInfo.js +3 -3
- package/dist/core-decorator/model/InjectConstructorInfo.d.ts +22 -18
- package/dist/core-decorator/model/InjectConstructorInfo.js +1 -2
- package/dist/core-decorator/model/InjectObjectInfo.d.ts +17 -14
- package/dist/core-decorator/model/InjectObjectInfo.js +1 -2
- package/dist/core-decorator/model/QualifierInfo.d.ts +39 -36
- package/dist/core-decorator/model/QualifierInfo.js +1 -2
- package/dist/core-decorator/model/index.d.ts +6 -5
- package/dist/core-decorator/model/index.js +4 -6
- package/dist/dal/Qualifier.d.ts +9 -6
- package/dist/dal/Qualifier.js +10 -7
- package/dist/dal/decorator/Column.d.ts +145 -141
- package/dist/dal/decorator/Column.js +1 -2
- package/dist/dal/decorator/DataSourceQualifier.d.ts +5 -2
- package/dist/dal/decorator/DataSourceQualifier.js +6 -3
- package/dist/dal/decorator/Table.d.ts +26 -20
- package/dist/dal/decorator/Table.js +1 -2
- package/dist/dal/decorator/index.d.ts +18 -13
- package/dist/dal/decorator/index.js +3 -4
- package/dist/dal/enum/ColumnFormat.d.ts +8 -5
- package/dist/dal/enum/ColumnFormat.js +8 -5
- package/dist/dal/enum/ColumnType.d.ts +43 -40
- package/dist/dal/enum/ColumnType.js +43 -46
- package/dist/dal/enum/CompressionType.d.ts +8 -5
- package/dist/dal/enum/CompressionType.js +8 -5
- package/dist/dal/enum/IndexStoreType.d.ts +7 -4
- package/dist/dal/enum/IndexStoreType.js +7 -4
- package/dist/dal/enum/IndexType.d.ts +10 -7
- package/dist/dal/enum/IndexType.js +10 -7
- package/dist/dal/enum/InsertMethod.d.ts +8 -5
- package/dist/dal/enum/InsertMethod.js +8 -5
- package/dist/dal/enum/RowFormat.d.ts +11 -8
- package/dist/dal/enum/RowFormat.js +11 -8
- package/dist/dal/enum/SqlType.d.ts +10 -7
- package/dist/dal/enum/SqlType.js +10 -7
- package/dist/dal/enum/Templates.d.ts +8 -5
- package/dist/dal/enum/Templates.js +8 -5
- package/dist/dal/enum/index.d.ts +10 -9
- package/dist/dal/enum/index.js +11 -10
- package/dist/dal/index.d.ts +21 -4
- package/dist/dal/index.js +13 -5
- package/dist/dal/type/BaseDao.d.ts +12 -8
- package/dist/dal/type/BaseDao.js +1 -2
- package/dist/dal/type/CodeGenerator.d.ts +8 -5
- package/dist/dal/type/CodeGenerator.js +1 -2
- package/dist/dal/type/ColumnTsType.d.ts +44 -40
- package/dist/dal/type/ColumnTsType.js +1 -2
- package/dist/dal/type/DateSource.d.ts +14 -11
- package/dist/dal/type/DateSource.js +1 -2
- package/dist/dal/type/Spatial.d.ts +13 -10
- package/dist/dal/type/Spatial.js +1 -2
- package/dist/dal/type/SqlMap.d.ts +18 -14
- package/dist/dal/type/SqlMap.js +1 -2
- package/dist/dal/type/index.d.ts +7 -6
- package/dist/dal/type/index.js +1 -7
- package/dist/dynamic-inject.d.ts +15 -10
- package/dist/dynamic-inject.js +5 -2
- package/dist/index.d.ts +73 -12
- package/dist/index.js +38 -13
- package/dist/lifecycle/EggObjectLifecycle.d.ts +38 -33
- package/dist/lifecycle/EggObjectLifecycle.js +1 -2
- package/dist/lifecycle/IdenticalObject.d.ts +6 -3
- package/dist/lifecycle/IdenticalObject.js +1 -2
- package/dist/lifecycle/LifecycleHook.d.ts +14 -11
- package/dist/lifecycle/LifecycleHook.js +1 -2
- package/dist/lifecycle/index.d.ts +4 -3
- package/dist/lifecycle/index.js +1 -4
- package/dist/metadata/enum/ProtoDescriptorType.d.ts +6 -3
- package/dist/metadata/enum/ProtoDescriptorType.js +5 -4
- package/dist/metadata/enum/index.d.ts +2 -1
- package/dist/metadata/enum/index.js +3 -2
- package/dist/metadata/errors.d.ts +8 -5
- package/dist/metadata/errors.js +8 -5
- package/dist/metadata/index.d.ts +7 -3
- package/dist/metadata/index.js +6 -4
- package/dist/metadata/model/EggPrototype.d.ts +138 -129
- package/dist/metadata/model/EggPrototype.js +3 -4
- package/dist/metadata/model/LoadUnit.d.ts +31 -26
- package/dist/metadata/model/LoadUnit.js +8 -5
- package/dist/metadata/model/Loader.d.ts +10 -5
- package/dist/metadata/model/Loader.js +1 -2
- package/dist/metadata/model/ProtoDescriptor.d.ts +27 -20
- package/dist/metadata/model/ProtoDescriptor.js +3 -3
- package/dist/metadata/model/index.d.ts +5 -4
- package/dist/metadata/model/index.js +5 -5
- package/dist/orm.d.ts +28 -25
- package/dist/orm.js +10 -7
- package/dist/runtime/Factory.d.ts +11 -6
- package/dist/runtime/Factory.js +1 -2
- package/dist/runtime/index.d.ts +6 -2
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/model/EggContainer.d.ts +15 -10
- package/dist/runtime/model/EggContainer.js +1 -2
- package/dist/runtime/model/EggContext.d.ts +9 -6
- package/dist/runtime/model/EggContext.js +1 -2
- package/dist/runtime/model/EggObject.d.ts +27 -22
- package/dist/runtime/model/EggObject.js +10 -7
- package/dist/runtime/model/LoadUnitInstance.d.ts +11 -7
- package/dist/runtime/model/LoadUnitInstance.js +1 -2
- package/dist/runtime/model/index.d.ts +5 -4
- package/dist/runtime/model/index.js +3 -5
- package/dist/schedule.d.ts +42 -38
- package/dist/schedule.js +11 -8
- package/dist/transaction.d.ts +24 -21
- package/dist/transaction.js +9 -8
- package/package.json +29 -33
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { EggContainer } from "./EggContainer.js";
|
|
2
|
+
|
|
3
|
+
//#region src/runtime/model/EggContext.d.ts
|
|
4
|
+
interface EggContextLifecycleContext {}
|
|
5
|
+
interface EggRuntimeContext extends EggContainer<EggContextLifecycleContext> {
|
|
6
|
+
get(key: string | symbol): any | undefined;
|
|
7
|
+
set(key: string | symbol, val: any): void;
|
|
7
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { EggContextLifecycleContext, EggRuntimeContext };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRWdnQ29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ydW50aW1lL21vZGVsL0VnZ0NvbnRleHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
1
|
+
export { };
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { EggPrototypeName } from "../../core-decorator/model/EggPrototypeInfo.js";
|
|
2
|
+
import { LoadUnit } from "../../metadata/model/LoadUnit.js";
|
|
3
|
+
import { EggPrototype } from "../../metadata/model/EggPrototype.js";
|
|
4
|
+
import { EggRuntimeContext } from "./EggContext.js";
|
|
5
|
+
import { LoadUnitInstance } from "./LoadUnitInstance.js";
|
|
6
|
+
import { LifecycleContext, LifecycleObject } from "../../lifecycle/LifecycleHook.js";
|
|
7
|
+
|
|
8
|
+
//#region src/runtime/model/EggObject.d.ts
|
|
9
|
+
declare const EggObjectStatus: {
|
|
10
|
+
readonly PENDING: "PENDING";
|
|
11
|
+
readonly READY: "READY";
|
|
12
|
+
readonly ERROR: "ERROR";
|
|
13
|
+
readonly DESTROYING: "DESTROYING";
|
|
14
|
+
readonly DESTROYED: "DESTROYED";
|
|
12
15
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
type EggObjectStatus = (typeof EggObjectStatus)[keyof typeof EggObjectStatus];
|
|
17
|
+
interface EggObjectLifeCycleContext extends LifecycleContext {
|
|
18
|
+
readonly loadUnit: LoadUnit;
|
|
19
|
+
readonly loadUnitInstance: LoadUnitInstance;
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
interface EggObject extends LifecycleObject<EggObjectLifeCycleContext> {
|
|
22
|
+
readonly isReady: boolean;
|
|
23
|
+
readonly obj: Record<string | symbol, any>;
|
|
24
|
+
readonly proto: EggPrototype;
|
|
25
|
+
readonly name: EggPrototypeName;
|
|
26
|
+
readonly ctx?: EggRuntimeContext;
|
|
27
|
+
injectProperty(name: string, descriptor: PropertyDescriptor): void;
|
|
25
28
|
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { EggObject, EggObjectLifeCycleContext, EggObjectStatus };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
//#region src/runtime/model/EggObject.ts
|
|
2
|
+
const EggObjectStatus = {
|
|
3
|
+
PENDING: "PENDING",
|
|
4
|
+
READY: "READY",
|
|
5
|
+
ERROR: "ERROR",
|
|
6
|
+
DESTROYING: "DESTROYING",
|
|
7
|
+
DESTROYED: "DESTROYED"
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { EggObjectStatus };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { LoadUnit } from "../../metadata/model/LoadUnit.js";
|
|
2
|
+
import { EggContainer } from "./EggContainer.js";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/model/LoadUnitInstance.d.ts
|
|
5
|
+
interface LoadUnitInstanceLifecycleContext {
|
|
6
|
+
loadUnit: LoadUnit;
|
|
5
7
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
interface LoadUnitInstance extends EggContainer<LoadUnitInstanceLifecycleContext> {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly loadUnit: LoadUnit;
|
|
9
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { LoadUnitInstance, LoadUnitInstanceLifecycleContext };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9hZFVuaXRJbnN0YW5jZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ydW50aW1lL21vZGVsL0xvYWRVbml0SW5zdGFuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { EggContextLifecycleContext, EggRuntimeContext } from "./EggContext.js";
|
|
2
|
+
import { LoadUnitInstance, LoadUnitInstanceLifecycleContext } from "./LoadUnitInstance.js";
|
|
3
|
+
import { EggObject, EggObjectLifeCycleContext, EggObjectStatus } from "./EggObject.js";
|
|
4
|
+
import { EggContainer } from "./EggContainer.js";
|
|
5
|
+
export { EggContainer, EggContextLifecycleContext, EggObject, EggObjectLifeCycleContext, EggObjectStatus, EggRuntimeContext, LoadUnitInstance, LoadUnitInstanceLifecycleContext };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export * from "./LoadUnitInstance.js";
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcnVudGltZS9tb2RlbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHVCQUF1QixDQUFDIn0=
|
|
1
|
+
import { EggObjectStatus } from "./EggObject.js";
|
|
2
|
+
|
|
3
|
+
export { EggObjectStatus };
|
package/dist/schedule.d.ts
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { EggEnvType } from "egg";
|
|
2
|
+
import { CronOptions } from "egg/schedule";
|
|
3
|
+
|
|
4
|
+
//#region src/schedule.d.ts
|
|
5
|
+
declare const ScheduleType: {
|
|
6
|
+
readonly WORKER: "worker";
|
|
7
|
+
readonly ALL: "all";
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
type ScheduleType = (typeof ScheduleType)[keyof typeof ScheduleType];
|
|
10
|
+
declare const IS_SCHEDULE: symbol;
|
|
11
|
+
declare const SCHEDULE_PARAMS: symbol;
|
|
12
|
+
declare const SCHEDULE_OPTIONS: symbol;
|
|
13
|
+
declare const SCHEDULE_METADATA: symbol;
|
|
14
|
+
type ScheduleTypeLike = ScheduleType | string;
|
|
15
|
+
interface ScheduleParams<T> {
|
|
16
|
+
type: ScheduleTypeLike;
|
|
17
|
+
scheduleData: T;
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
interface CronParams {
|
|
20
|
+
cron: string;
|
|
21
|
+
cronOptions?: CronOptions;
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
interface IntervalParams {
|
|
24
|
+
interval: string | number;
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
type CronScheduleParams = ScheduleParams<CronParams>;
|
|
27
|
+
type IntervalScheduleParams = ScheduleParams<IntervalParams>;
|
|
28
|
+
interface ScheduleOptions {
|
|
29
|
+
immediate?: boolean;
|
|
30
|
+
disable?: boolean;
|
|
31
|
+
env?: EggEnvType[];
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
* Schedule subscriber interface
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* export class FooSubscriber implements ScheduleSubscriber {
|
|
39
|
+
* async subscribe(data?: any): Promise<any> {
|
|
40
|
+
* return 'foo';
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
interface ScheduleSubscriber {
|
|
46
|
+
subscribe(data?: any): Promise<any>;
|
|
45
47
|
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CronParams, CronScheduleParams, IS_SCHEDULE, IntervalParams, IntervalScheduleParams, SCHEDULE_METADATA, SCHEDULE_OPTIONS, SCHEDULE_PARAMS, ScheduleOptions, ScheduleParams, ScheduleSubscriber, ScheduleType, ScheduleTypeLike };
|
package/dist/schedule.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/schedule.ts
|
|
2
|
+
const ScheduleType = {
|
|
3
|
+
WORKER: "worker",
|
|
4
|
+
ALL: "all"
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const IS_SCHEDULE = Symbol.for("EggPrototype#isSchedule");
|
|
7
|
+
const SCHEDULE_PARAMS = Symbol.for("EggPrototype#schedule#params");
|
|
8
|
+
const SCHEDULE_OPTIONS = Symbol.for("EggPrototype#schedule#options");
|
|
9
|
+
const SCHEDULE_METADATA = Symbol.for("EggPrototype#schedule#metadata");
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { IS_SCHEDULE, SCHEDULE_METADATA, SCHEDULE_OPTIONS, SCHEDULE_PARAMS, ScheduleType };
|
package/dist/transaction.d.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/transaction.d.ts
|
|
2
|
+
declare const PropagationType: {
|
|
3
|
+
/** 不管是当前调用栈是否存在事务,始终让当前函数在新的事务中执行 */
|
|
4
|
+
readonly ALWAYS_NEW: "ALWAYS_NEW";
|
|
5
|
+
/** 如果当前调用栈存在事务则复用,否则创建一个 */
|
|
6
|
+
readonly REQUIRED: "REQUIRED";
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
type PropagationType = (typeof PropagationType)[keyof typeof PropagationType];
|
|
9
|
+
interface TransactionalParams {
|
|
10
|
+
/** 事务传播方式,默认 REQUIRED */
|
|
11
|
+
propagation?: PropagationType;
|
|
12
|
+
/**
|
|
13
|
+
* 数据源,默认使用 module 的数据源,非 module 时将使用 default 数据源
|
|
14
|
+
* 需要注意的是数据源之间的连接是隔离的,回滚也是独立的
|
|
15
|
+
* 比如函数 B 在函数 A 中执行,A 执行异常时,不会回滚 B 中执行的 sql
|
|
16
|
+
* */
|
|
17
|
+
datasourceName?: string;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
interface TransactionMetadata {
|
|
20
|
+
propagation: PropagationType;
|
|
21
|
+
method: PropertyKey;
|
|
22
|
+
datasourceName?: string;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
declare const TRANSACTION_META_DATA: symbol;
|
|
25
|
+
declare const IS_TRANSACTION_CLAZZ: symbol;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { IS_TRANSACTION_CLAZZ, PropagationType, TRANSACTION_META_DATA, TransactionMetadata, TransactionalParams };
|
package/dist/transaction.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
REQUIRED: 'REQUIRED',
|
|
1
|
+
//#region src/transaction.ts
|
|
2
|
+
const PropagationType = {
|
|
3
|
+
ALWAYS_NEW: "ALWAYS_NEW",
|
|
4
|
+
REQUIRED: "REQUIRED"
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const TRANSACTION_META_DATA = Symbol.for("EggPrototype#transaction#metaData");
|
|
7
|
+
const IS_TRANSACTION_CLAZZ = Symbol.for("EggPrototype#IS_TRANSACTION_CLAZZ");
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { IS_TRANSACTION_CLAZZ, PropagationType, TRANSACTION_META_DATA };
|
package/package.json
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/tegg-types",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.36",
|
|
4
4
|
"description": "tegg types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"egg",
|
|
7
|
-
"typescript",
|
|
8
7
|
"tegg",
|
|
9
|
-
"types"
|
|
8
|
+
"types",
|
|
9
|
+
"typescript"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/eggjs/egg/tree/next/tegg/core/types",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/eggjs/egg/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "gxkl <gxkl203@gmail.com>",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/eggjs/egg.git",
|
|
20
|
+
"directory": "tegg/core/types"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
10
24
|
],
|
|
11
25
|
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
12
29
|
"exports": {
|
|
13
30
|
".": "./dist/index.js",
|
|
14
31
|
"./aop": "./dist/aop/index.js",
|
|
@@ -100,42 +117,21 @@
|
|
|
100
117
|
"./transaction": "./dist/transaction.js",
|
|
101
118
|
"./package.json": "./package.json"
|
|
102
119
|
},
|
|
103
|
-
"files": [
|
|
104
|
-
"dist"
|
|
105
|
-
],
|
|
106
|
-
"author": "gxkl <gxkl203@gmail.com>",
|
|
107
|
-
"license": "MIT",
|
|
108
|
-
"homepage": "https://github.com/eggjs/egg/tree/next/tegg/core/types",
|
|
109
|
-
"bugs": {
|
|
110
|
-
"url": "https://github.com/eggjs/egg/issues"
|
|
111
|
-
},
|
|
112
|
-
"repository": {
|
|
113
|
-
"type": "git",
|
|
114
|
-
"url": "git@github.com:eggjs/egg.git",
|
|
115
|
-
"directory": "tegg/core/types"
|
|
116
|
-
},
|
|
117
|
-
"engines": {
|
|
118
|
-
"node": ">=22.18.0"
|
|
119
|
-
},
|
|
120
120
|
"publishConfig": {
|
|
121
121
|
"access": "public"
|
|
122
122
|
},
|
|
123
|
-
"peerDependencies": {
|
|
124
|
-
"egg": "4.1.0-beta.34"
|
|
125
|
-
},
|
|
126
123
|
"devDependencies": {
|
|
127
|
-
"@types/node": "^24.
|
|
128
|
-
"tsdown": "0.15.11",
|
|
124
|
+
"@types/node": "^24.10.2",
|
|
129
125
|
"typescript": "^5.9.3",
|
|
130
|
-
"
|
|
131
|
-
|
|
126
|
+
"egg": "4.1.0-beta.36"
|
|
127
|
+
},
|
|
128
|
+
"peerDependencies": {
|
|
129
|
+
"egg": "4.1.0-beta.36"
|
|
130
|
+
},
|
|
131
|
+
"engines": {
|
|
132
|
+
"node": ">=22.18.0"
|
|
132
133
|
},
|
|
133
|
-
"main": "./dist/index.js",
|
|
134
|
-
"module": "./dist/index.js",
|
|
135
|
-
"types": "./dist/index.d.ts",
|
|
136
134
|
"scripts": {
|
|
137
|
-
"
|
|
138
|
-
"build": "tsdown && npm run clean && tsc -p tsconfig.build.json",
|
|
139
|
-
"typecheck": "tsc --noEmit"
|
|
135
|
+
"typecheck": "tsgo --noEmit"
|
|
140
136
|
}
|
|
141
137
|
}
|