@carno.js/schedule 0.2.10 → 1.0.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/entry.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { Carno } from '@carno.js/core';
2
- export declare const CarnoScheduler: Carno<import("@carno.js/core").ValidatorAdapterConstructor>;
2
+ export declare const CarnoScheduler: Carno;
@@ -1,14 +1,14 @@
1
- import { InjectorService } from '@carno.js/core';
1
+ import { Container } from '@carno.js/core';
2
2
  import { CronOptions } from './utils/cron-options';
3
3
  import { CronJobParams } from 'cron';
4
4
  import { SchedulerRegistry } from './scheduler.registry';
5
5
  export declare class SchedulerOrchestration {
6
6
  private readonly schedulerRegistry;
7
- private readonly injectorService;
7
+ private readonly container;
8
8
  private readonly cronJobs;
9
9
  private readonly timeouts;
10
10
  private readonly intervals;
11
- constructor(schedulerRegistry: SchedulerRegistry, injectorService: InjectorService);
11
+ constructor(schedulerRegistry: SchedulerRegistry, container: Container);
12
12
  onApplicationInit(): void;
13
13
  onApplicationShutdown(): void;
14
14
  mountIntervals(): void;
@@ -16,9 +16,9 @@ const scheduler_registry_1 = require("./scheduler.registry");
16
16
  const uuid_1 = require("uuid");
17
17
  const constants_1 = require("./utils/constants");
18
18
  let SchedulerOrchestration = class SchedulerOrchestration {
19
- constructor(schedulerRegistry, injectorService) {
19
+ constructor(schedulerRegistry, container) {
20
20
  this.schedulerRegistry = schedulerRegistry;
21
- this.injectorService = injectorService;
21
+ this.container = container;
22
22
  this.cronJobs = {};
23
23
  this.timeouts = {};
24
24
  this.intervals = {};
@@ -113,11 +113,7 @@ let SchedulerOrchestration = class SchedulerOrchestration {
113
113
  }
114
114
  resolveInstance(target) {
115
115
  const token = target.constructor;
116
- const provider = core_1.GlobalProvider.get(token);
117
- if (provider?.instance) {
118
- return provider.instance;
119
- }
120
- return this.injectorService.invoke(token);
116
+ return this.container.get(token);
121
117
  }
122
118
  };
123
119
  exports.SchedulerOrchestration = SchedulerOrchestration;
@@ -136,5 +132,5 @@ __decorate([
136
132
  exports.SchedulerOrchestration = SchedulerOrchestration = __decorate([
137
133
  (0, core_1.Service)(),
138
134
  __metadata("design:paramtypes", [scheduler_registry_1.SchedulerRegistry,
139
- core_1.InjectorService])
135
+ core_1.Container])
140
136
  ], SchedulerOrchestration);
@@ -108,5 +108,5 @@ let SchedulerRegistry = class SchedulerRegistry {
108
108
  };
109
109
  exports.SchedulerRegistry = SchedulerRegistry;
110
110
  exports.SchedulerRegistry = SchedulerRegistry = __decorate([
111
- (0, core_1.Injectable)()
111
+ (0, core_1.Service)()
112
112
  ], SchedulerRegistry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carno.js/schedule",
3
- "version": "0.2.10",
3
+ "version": "1.0.0",
4
4
  "description": "Schedule module for Carno framework (Bun) ⏰",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -25,12 +25,12 @@
25
25
  }
26
26
  },
27
27
  "peerDependencies": {
28
- "@carno.js/core": "^0.2.0"
28
+ "@carno.js/core": "^1.0.0"
29
29
  },
30
30
  "author": "",
31
31
  "license": "MIT",
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "5c765c2c9172bec7f509ca2513f6c10472ec89eb"
35
+ "gitHead": "d2b000eeb352a03569b90d8eb2bf3557c00b741b"
36
36
  }