@uns-kit/cron 0.0.17 → 0.0.18

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Aljoša Vister
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Aljoša Vister
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,45 @@
1
- # @uns-kit/cron
2
-
3
- `@uns-kit/cron` adds cron-style scheduling to the UNS runtime. It registers a `createCrontabProxy` method on `UnsProxyProcess`, emitting `cronEvent` notifications that can be bridged to MQTT topics or any downstream integration.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pnpm add @uns-kit/cron
9
- # or
10
- npm install @uns-kit/cron
11
- ```
12
-
13
- You will also need `@uns-kit/core` in your project because the plugin augments `UnsProxyProcess`.
14
-
15
- ## Quick Start
16
-
17
- ```ts
18
- import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
19
- import type { UnsProxyProcessWithCron } from "@uns-kit/cron";
20
- import "@uns-kit/cron";
21
-
22
- async function main() {
23
- const process = new UnsProxyProcess("mqtt-broker:1883", { processName: "cron-demo" }) as UnsProxyProcessWithCron;
24
-
25
- const cronProxy = await process.createCrontabProxy("*/5 * * * *");
26
- cronProxy.event.on("cronEvent", () => {
27
- console.log("tick");
28
- });
29
- }
30
-
31
- void main();
32
- ```
33
-
34
- ## Scripts
35
-
36
- ```bash
37
- pnpm run typecheck
38
- pnpm run build
39
- ```
40
-
41
- `build` emits ESM JavaScript and type declarations into `dist/`.
42
-
43
- ## License
44
-
45
- MIT © Aljoša Vister
1
+ # @uns-kit/cron
2
+
3
+ `@uns-kit/cron` adds cron-style scheduling to the UNS runtime. It registers a `createCrontabProxy` method on `UnsProxyProcess`, emitting `cronEvent` notifications that can be bridged to MQTT topics or any downstream integration.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @uns-kit/cron
9
+ # or
10
+ npm install @uns-kit/cron
11
+ ```
12
+
13
+ You will also need `@uns-kit/core` in your project because the plugin augments `UnsProxyProcess`.
14
+
15
+ ## Quick Start
16
+
17
+ ```ts
18
+ import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
19
+ import type { UnsProxyProcessWithCron } from "@uns-kit/cron";
20
+ import "@uns-kit/cron";
21
+
22
+ async function main() {
23
+ const process = new UnsProxyProcess("mqtt-broker:1883", { processName: "cron-demo" }) as UnsProxyProcessWithCron;
24
+
25
+ const cronProxy = await process.createCrontabProxy("*/5 * * * *");
26
+ cronProxy.event.on("cronEvent", () => {
27
+ console.log("tick");
28
+ });
29
+ }
30
+
31
+ void main();
32
+ ```
33
+
34
+ ## Scripts
35
+
36
+ ```bash
37
+ pnpm run typecheck
38
+ pnpm run build
39
+ ```
40
+
41
+ `build` emits ESM JavaScript and type declarations into `dist/`.
42
+
43
+ ## License
44
+
45
+ MIT © Aljoša Vister
@@ -1,5 +1,5 @@
1
1
  import type { TaskOptions } from "node-cron";
2
- import UnsProxyProcess, { type UnsProxyProcessPlugin } from "@uns-kit/core/uns/uns-proxy-process";
2
+ import UnsProxyProcess, { type UnsProxyProcessPlugin } from "@uns-kit/core/uns/uns-proxy-process.js";
3
3
  import UnsCronProxy from "./uns-cron-proxy.js";
4
4
  declare const unsCronPlugin: UnsProxyProcessPlugin;
5
5
  export default unsCronPlugin;
@@ -1,4 +1,4 @@
1
- import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
1
+ import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process.js";
2
2
  import UnsCronProxy from "./uns-cron-proxy.js";
3
3
  const cronProxyRegistry = new WeakMap();
4
4
  const getCronProxies = (instance) => {
@@ -1,5 +1,5 @@
1
1
  import { TaskOptions } from "node-cron";
2
- import UnsProxy from "@uns-kit/core/uns/uns-proxy";
2
+ import UnsProxy from "@uns-kit/core/uns/uns-proxy.js";
3
3
  export default class UnsCronProxy extends UnsProxy {
4
4
  private readonly cronExpression;
5
5
  private readonly task;
@@ -1,5 +1,5 @@
1
1
  import cron from "node-cron";
2
- import UnsProxy from "@uns-kit/core/uns/uns-proxy";
2
+ import UnsProxy from "@uns-kit/core/uns/uns-proxy.js";
3
3
  export default class UnsCronProxy extends UnsProxy {
4
4
  cronExpression;
5
5
  task;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uns-kit/cron",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Cron-driven plugin for UnsProxyProcess that emits UNS events on a schedule.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "types": "dist/index.d.ts",
33
33
  "dependencies": {
34
34
  "node-cron": "^4.2.1",
35
- "@uns-kit/core": "0.0.35"
35
+ "@uns-kit/core": "0.0.36"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -p tsconfig.build.json",