@cronvello/sdk 0.1.3 → 0.2.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/CHANGELOG.md +53 -0
- package/README.md +135 -2
- package/dist/cli.cjs +1106 -10
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1104 -12
- package/dist/cli.js.map +1 -1
- package/dist/dev.cjs +1186 -0
- package/dist/dev.cjs.map +1 -0
- package/dist/dev.d.cts +318 -0
- package/dist/dev.d.ts +318 -0
- package/dist/dev.js +1173 -0
- package/dist/dev.js.map +1 -0
- package/dist/index.cjs +645 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +644 -7
- package/dist/index.js.map +1 -1
- package/docs/dashboard.png +0 -0
- package/package.json +12 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,8 @@ import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody,
|
|
|
2
2
|
export { o as CallbackStatus, p as CronvelloHooks, q as CronvelloJobConfig, r as CronvelloJobConfigWithKey, s as CronvelloJobContext, t as CronvelloJobHandler, u as CronvelloJobsInput, v as CronvelloLogger, w as CronvelloRunSource, E as ExecutionMode, H as HttpMethod, x as JobStatus, y as Pagination, z as ReconcileTaskChange, B as RegistryReconcileChange, G as RegistryTaskInput, I as RunStatus, K as RunType, L as SuccessCriteria, N as Urgency } from './dispatch-handler-DazGcFHz.cjs';
|
|
3
3
|
import { ExpressDispatchHandler } from './express.cjs';
|
|
4
4
|
import { NextRouteHandler } from './next.cjs';
|
|
5
|
+
import { LocalEngineOptions, DashboardOptions, LocalEngine } from './dev.cjs';
|
|
6
|
+
export { NextOccurrenceOptions, PreviewOptions, nextOccurrence, previewSchedule } from './dev.cjs';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Low-level, fully-typed client for the Cronvello public `/v1` API.
|
|
@@ -154,9 +156,30 @@ interface CronvelloApp {
|
|
|
154
156
|
expressHandler(): ExpressDispatchHandler;
|
|
155
157
|
/** Next.js App Router (Route Handler) for the dispatch endpoint. */
|
|
156
158
|
nextHandler(): NextRouteHandler;
|
|
159
|
+
/**
|
|
160
|
+
* Start the **local engine** — run your jobs on this machine with no account, no cloud, no
|
|
161
|
+
* network. Each job's next fire time is computed from its schedule (timezone/DST-aware) and its
|
|
162
|
+
* handler runs locally, with overlap protection, per-run timeout, and retry/backoff enforced just
|
|
163
|
+
* like the cloud. Returns the engine handle (history, snapshot, `stop()`); powers `cronvello dev`.
|
|
164
|
+
*
|
|
165
|
+
* Pass `autoStart: false` to construct the engine without starting it (the CLI does this to render
|
|
166
|
+
* the job table first). Existing `sync()` / dispatch paths are untouched.
|
|
167
|
+
*/
|
|
168
|
+
dev(options?: DevOptions): LocalEngine;
|
|
157
169
|
/** The registry keys, for diagnostics. */
|
|
158
170
|
keys(): string[];
|
|
159
171
|
}
|
|
172
|
+
/** Options for {@link CronvelloApp.dev}. */
|
|
173
|
+
interface DevOptions extends LocalEngineOptions {
|
|
174
|
+
/** Start the scheduler immediately (default true). Set false to start it yourself later. */
|
|
175
|
+
autoStart?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Also start the local web dashboard alongside the engine. `true` uses the defaults
|
|
178
|
+
* (`http://127.0.0.1:4747`); pass an object to set `port`/`host`. `engine.stop()` closes it too.
|
|
179
|
+
* The dashboard module is loaded lazily, so it never weighs down the main bundle.
|
|
180
|
+
*/
|
|
181
|
+
dashboard?: boolean | DashboardOptions;
|
|
182
|
+
}
|
|
160
183
|
/** Config for `defineCronvello.fromEnv` — the three secret fields become optional (read from env). */
|
|
161
184
|
type CronvelloEnvConfig = Omit<CronvelloAppConfig, "apiKey" | "dispatchSecret" | "appUrl"> & Partial<Pick<CronvelloAppConfig, "apiKey" | "dispatchSecret" | "appUrl">>;
|
|
162
185
|
declare function defineCronvello(config: CronvelloAppConfig): CronvelloApp;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody,
|
|
|
2
2
|
export { o as CallbackStatus, p as CronvelloHooks, q as CronvelloJobConfig, r as CronvelloJobConfigWithKey, s as CronvelloJobContext, t as CronvelloJobHandler, u as CronvelloJobsInput, v as CronvelloLogger, w as CronvelloRunSource, E as ExecutionMode, H as HttpMethod, x as JobStatus, y as Pagination, z as ReconcileTaskChange, B as RegistryReconcileChange, G as RegistryTaskInput, I as RunStatus, K as RunType, L as SuccessCriteria, N as Urgency } from './dispatch-handler-DazGcFHz.js';
|
|
3
3
|
import { ExpressDispatchHandler } from './express.js';
|
|
4
4
|
import { NextRouteHandler } from './next.js';
|
|
5
|
+
import { LocalEngineOptions, DashboardOptions, LocalEngine } from './dev.js';
|
|
6
|
+
export { NextOccurrenceOptions, PreviewOptions, nextOccurrence, previewSchedule } from './dev.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Low-level, fully-typed client for the Cronvello public `/v1` API.
|
|
@@ -154,9 +156,30 @@ interface CronvelloApp {
|
|
|
154
156
|
expressHandler(): ExpressDispatchHandler;
|
|
155
157
|
/** Next.js App Router (Route Handler) for the dispatch endpoint. */
|
|
156
158
|
nextHandler(): NextRouteHandler;
|
|
159
|
+
/**
|
|
160
|
+
* Start the **local engine** — run your jobs on this machine with no account, no cloud, no
|
|
161
|
+
* network. Each job's next fire time is computed from its schedule (timezone/DST-aware) and its
|
|
162
|
+
* handler runs locally, with overlap protection, per-run timeout, and retry/backoff enforced just
|
|
163
|
+
* like the cloud. Returns the engine handle (history, snapshot, `stop()`); powers `cronvello dev`.
|
|
164
|
+
*
|
|
165
|
+
* Pass `autoStart: false` to construct the engine without starting it (the CLI does this to render
|
|
166
|
+
* the job table first). Existing `sync()` / dispatch paths are untouched.
|
|
167
|
+
*/
|
|
168
|
+
dev(options?: DevOptions): LocalEngine;
|
|
157
169
|
/** The registry keys, for diagnostics. */
|
|
158
170
|
keys(): string[];
|
|
159
171
|
}
|
|
172
|
+
/** Options for {@link CronvelloApp.dev}. */
|
|
173
|
+
interface DevOptions extends LocalEngineOptions {
|
|
174
|
+
/** Start the scheduler immediately (default true). Set false to start it yourself later. */
|
|
175
|
+
autoStart?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Also start the local web dashboard alongside the engine. `true` uses the defaults
|
|
178
|
+
* (`http://127.0.0.1:4747`); pass an object to set `port`/`host`. `engine.stop()` closes it too.
|
|
179
|
+
* The dashboard module is loaded lazily, so it never weighs down the main bundle.
|
|
180
|
+
*/
|
|
181
|
+
dashboard?: boolean | DashboardOptions;
|
|
182
|
+
}
|
|
160
183
|
/** Config for `defineCronvello.fromEnv` — the three secret fields become optional (read from env). */
|
|
161
184
|
type CronvelloEnvConfig = Omit<CronvelloAppConfig, "apiKey" | "dispatchSecret" | "appUrl"> & Partial<Pick<CronvelloAppConfig, "apiKey" | "dispatchSecret" | "appUrl">>;
|
|
162
185
|
declare function defineCronvello(config: CronvelloAppConfig): CronvelloApp;
|