@carno.js/schedule 0.2.3
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/LICENSE +674 -0
- package/dist/decorator/index.d.ts +3 -0
- package/dist/decorator/index.js +19 -0
- package/dist/decorator/interval.decorator.d.ts +8 -0
- package/dist/decorator/interval.decorator.js +23 -0
- package/dist/decorator/schedule.decorator.d.ts +8 -0
- package/dist/decorator/schedule.decorator.js +24 -0
- package/dist/decorator/timeout.decorator.d.ts +8 -0
- package/dist/decorator/timeout.decorator.js +23 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.js +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/scheduler-orchestration.service.d.ts +26 -0
- package/dist/scheduler-orchestration.service.js +140 -0
- package/dist/scheduler.registry.d.ts +20 -0
- package/dist/scheduler.registry.js +112 -0
- package/dist/utils/constants.d.ts +5 -0
- package/dist/utils/constants.js +8 -0
- package/dist/utils/cron-expression.enum.d.ts +85 -0
- package/dist/utils/cron-expression.enum.js +89 -0
- package/dist/utils/cron-options.d.ts +32 -0
- package/dist/utils/cron-options.js +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/scheduler-type.enum.d.ts +5 -0
- package/dist/utils/scheduler-type.enum.js +9 -0
- package/package.json +36 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ref https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cron/index.d.ts
|
|
3
|
+
*/
|
|
4
|
+
export type CronOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Specify the name of your cron job. This will allow to inject your cron job reference through `@InjectCronRef`.
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
|
|
11
|
+
*/
|
|
12
|
+
timeZone?: unknown;
|
|
13
|
+
/**
|
|
14
|
+
* This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen.
|
|
15
|
+
*/
|
|
16
|
+
utcOffset?: unknown;
|
|
17
|
+
/**
|
|
18
|
+
* If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs.
|
|
19
|
+
*/
|
|
20
|
+
unrefTimeout?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This flag indicates whether the job will be executed at all.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
} & ({
|
|
27
|
+
timeZone?: string;
|
|
28
|
+
utcOffset?: never;
|
|
29
|
+
} | {
|
|
30
|
+
timeZone?: never;
|
|
31
|
+
utcOffset?: number;
|
|
32
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cron-expression.enum"), exports);
|
|
18
|
+
__exportStar(require("./cron-options"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchedulerType = void 0;
|
|
4
|
+
var SchedulerType;
|
|
5
|
+
(function (SchedulerType) {
|
|
6
|
+
SchedulerType[SchedulerType["CRON"] = 1] = "CRON";
|
|
7
|
+
SchedulerType[SchedulerType["TIMEOUT"] = 2] = "TIMEOUT";
|
|
8
|
+
SchedulerType[SchedulerType["INTERVAL"] = 3] = "INTERVAL";
|
|
9
|
+
})(SchedulerType || (exports.SchedulerType = SchedulerType = {}));
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@carno.js/schedule",
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Schedule module for Carno framework (Bun) ⏰",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"compile": "rm -rf ./dist tsconfig.tsbuildinfo && tsc --build --force",
|
|
10
|
+
"build": "tsc --build --force",
|
|
11
|
+
"prepublishOnly": "bun run build"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"cron": "3.1.6",
|
|
15
|
+
"uuid": "^9.0.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/uuid": "^9.0.6"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
".": {
|
|
23
|
+
"require": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@carno.js/core": "^0.2.0"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "179037d66f41ab7014a008b141afce3c9232190e"
|
|
36
|
+
}
|