@cronvello/sdk 0.1.4 → 0.2.1

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/index.d.cts CHANGED
@@ -1,7 +1,9 @@
1
- import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody, b as PublicTask, c as TaskCreateBody, A as AccountTasksQuery, d as TasksPage, e as TaskUpdateBody, R as RunNowResult, f as RunsQuery, g as RunsPage, h as AccountRunsQuery, i as PublicRun, M as MeResponse, U as UsageResponse, F as FetchLike, j as RegistryReconcileRequest, k as RegistryReconcileResponse, l as ResolvedJob, S as SyncOptions, m as ReconcileResult, D as DispatchRequest, n as DispatchResponse, C as CronvelloAppConfig } from './dispatch-handler-DazGcFHz.cjs';
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';
1
+ import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody, b as PublicTask, c as TaskCreateBody, A as AccountTasksQuery, d as TasksPage, e as TaskUpdateBody, R as RunNowResult, f as RunsQuery, g as RunsPage, h as AccountRunsQuery, i as PublicRun, M as MeResponse, U as UsageResponse, F as FetchLike, j as RegistryReconcileRequest, k as RegistryReconcileResponse, l as ResolvedJob, S as SyncOptions, m as ReconcileResult, D as DispatchRequest, n as DispatchResponse, C as CronvelloAppConfig } from './dispatch-handler-BoadpsL9.cjs';
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-BoadpsL9.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
@@ -1,7 +1,9 @@
1
- import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody, b as PublicTask, c as TaskCreateBody, A as AccountTasksQuery, d as TasksPage, e as TaskUpdateBody, R as RunNowResult, f as RunsQuery, g as RunsPage, h as AccountRunsQuery, i as PublicRun, M as MeResponse, U as UsageResponse, F as FetchLike, j as RegistryReconcileRequest, k as RegistryReconcileResponse, l as ResolvedJob, S as SyncOptions, m as ReconcileResult, D as DispatchRequest, n as DispatchResponse, C as CronvelloAppConfig } from './dispatch-handler-DazGcFHz.js';
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';
1
+ import { T as Transport, P as PublicJob, J as JobCreateBody, a as JobUpdateBody, b as PublicTask, c as TaskCreateBody, A as AccountTasksQuery, d as TasksPage, e as TaskUpdateBody, R as RunNowResult, f as RunsQuery, g as RunsPage, h as AccountRunsQuery, i as PublicRun, M as MeResponse, U as UsageResponse, F as FetchLike, j as RegistryReconcileRequest, k as RegistryReconcileResponse, l as ResolvedJob, S as SyncOptions, m as ReconcileResult, D as DispatchRequest, n as DispatchResponse, C as CronvelloAppConfig } from './dispatch-handler-BoadpsL9.js';
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-BoadpsL9.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;