@eggjs/schedule 6.0.0-beta.22 → 6.0.0-beta.24

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.
@@ -2,7 +2,7 @@ import { Application } from 'egg';
2
2
  import { ScheduleWorker } from '../../lib/schedule_worker.ts';
3
3
  export default class ScheduleApplication extends Application {
4
4
  /**
5
- * @member app#schedule
5
+ * @member app#scheduleWorker
6
6
  */
7
7
  get scheduleWorker(): ScheduleWorker;
8
8
  }
@@ -3,7 +3,7 @@ import { ScheduleWorker } from "../../lib/schedule_worker.js";
3
3
  const SCHEDULE_WORKER = Symbol('application scheduleWorker');
4
4
  export default class ScheduleApplication extends Application {
5
5
  /**
6
- * @member app#schedule
6
+ * @member app#scheduleWorker
7
7
  */
8
8
  get scheduleWorker() {
9
9
  let scheduleWorker = this[SCHEDULE_WORKER];
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
+ import './types.ts';
1
2
  import Agent from './app/extend/agent.ts';
2
3
  import Application from './app/extend/application.ts';
3
4
  import ApplicationUnittest from './app/extend/application.unittest.ts';
4
5
  export { Agent, Application, ApplicationUnittest };
5
6
  export { ScheduleWorker } from './lib/schedule_worker.ts';
6
7
  export { Schedule } from './lib/schedule.ts';
7
- import './types.ts';
8
8
  export * from './lib/types.ts';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
+ import "./types.js";
1
2
  import Agent from "./app/extend/agent.js";
2
3
  import Application from "./app/extend/application.js";
3
4
  import ApplicationUnittest from "./app/extend/application.unittest.js";
4
5
  export { Agent, Application, ApplicationUnittest };
5
6
  export { ScheduleWorker } from "./lib/schedule_worker.js";
6
7
  export { Schedule } from "./lib/schedule.js";
7
- import "./types.js";
8
8
  export * from "./lib/types.js";
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sdUJBQXVCLENBQUM7QUFDMUMsT0FBTyxXQUFXLE1BQU0sNkJBQTZCLENBQUM7QUFDdEQsT0FBTyxtQkFBbUIsTUFBTSxzQ0FBc0MsQ0FBQztBQUV2RSxPQUFPLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFN0MsT0FBTyxZQUFZLENBQUM7QUFFcEIsY0FBYyxnQkFBZ0IsQ0FBQyJ9
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxZQUFZLENBQUM7QUFFcEIsT0FBTyxLQUFLLE1BQU0sdUJBQXVCLENBQUM7QUFDMUMsT0FBTyxXQUFXLE1BQU0sNkJBQTZCLENBQUM7QUFDdEQsT0FBTyxtQkFBbUIsTUFBTSxzQ0FBc0MsQ0FBQztBQUV2RSxPQUFPLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFN0MsY0FBYyxnQkFBZ0IsQ0FBQyJ9
package/dist/types.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import type { EggScheduleConfig } from './config/config.default.ts';
2
+ import type { Schedule } from './lib/schedule.ts';
3
+ import type { ScheduleWorker } from './lib/schedule_worker.ts';
4
+ import type { BaseStrategy } from './lib/strategy/base.ts';
5
+ import type { TimerStrategy } from './lib/strategy/timer.ts';
2
6
  declare module 'egg' {
3
7
  interface EggAppConfig {
4
8
  /**
@@ -7,7 +11,25 @@ declare module 'egg' {
7
11
  */
8
12
  schedule: EggScheduleConfig;
9
13
  }
14
+ interface Agent {
15
+ /**
16
+ * Schedule Strategy
17
+ */
18
+ ScheduleStrategy: typeof BaseStrategy;
19
+ /**
20
+ * Timer Schedule Strategy
21
+ */
22
+ TimerScheduleStrategy: typeof TimerStrategy;
23
+ /**
24
+ * Schedule
25
+ */
26
+ schedule: Schedule;
27
+ }
10
28
  interface Application {
29
+ /**
30
+ * Schedule Worker
31
+ */
32
+ scheduleWorker: ScheduleWorker;
11
33
  /**
12
34
  * Run a schedule, only for unit test
13
35
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/schedule",
3
- "version": "6.0.0-beta.22",
3
+ "version": "6.0.0-beta.24",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,10 +33,10 @@
33
33
  "is-type-of": "^2.2.0",
34
34
  "safe-timers": "^1.1.0",
35
35
  "utility": "^2.5.0",
36
- "@eggjs/utils": "5.0.0-beta.22"
36
+ "@eggjs/utils": "5.0.0-beta.24"
37
37
  },
38
38
  "peerDependencies": {
39
- "egg": "4.1.0-beta.22"
39
+ "egg": "4.1.0-beta.24"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/safe-timers": "^1.1.2",
@@ -44,9 +44,9 @@
44
44
  "tsdown": "^0.15.4",
45
45
  "typescript": "^5.9.3",
46
46
  "vitest": "4.0.0-beta.16",
47
- "@eggjs/tsconfig": "3.1.0-beta.22",
48
- "@eggjs/bin": "8.0.0-beta.22",
49
- "@eggjs/mock": "7.0.0-beta.22"
47
+ "@eggjs/tsconfig": "3.1.0-beta.24",
48
+ "@eggjs/bin": "8.0.0-beta.24",
49
+ "@eggjs/mock": "7.0.0-beta.24"
50
50
  },
51
51
  "author": "dead_horse",
52
52
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "main": "./dist/index.js",
78
78
  "module": "./dist/index.js",
79
79
  "scripts": {
80
- "build": "tsdown && rimraf dist && tsc -b --clean && tsc",
80
+ "build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
81
81
  "typecheck": "tsc --noEmit",
82
82
  "lint": "oxlint --type-aware",
83
83
  "lint:fix": "npm run lint -- --fix",