@vite-hub/schedule 0.1.0 → 0.3.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.
Files changed (54) hide show
  1. package/README.md +114 -96
  2. package/dist/console-wEhr0LWn.d.ts +330 -0
  3. package/dist/definition.d.ts +6 -2
  4. package/dist/definition.js +47 -1
  5. package/dist/due-BVMRQ93v.js +144 -0
  6. package/dist/durability.d.ts +14 -0
  7. package/dist/durability.js +23 -0
  8. package/dist/error-diagnostics-DSkCJC_L.js +266 -0
  9. package/dist/error-diagnostics-Mpeks7J0.js +166 -0
  10. package/dist/index.d.ts +59 -5
  11. package/dist/index.js +27 -2
  12. package/dist/invariant-DolT9EEx.js +22 -0
  13. package/dist/{kv-storage-Bv9ocZT-.d.ts → kv-storage-C0KZZB6v.d.ts} +2 -2
  14. package/dist/{kv-storage-DWinmLLy.js → kv-storage-iJChCS5A.js} +2 -2
  15. package/dist/object-Da1zyPCR.js +11 -0
  16. package/dist/{operations-tNUdj3G4.d.ts → operation-definition-8gOe-ubD.d.ts} +37 -15
  17. package/dist/{operations-gk2qzhYV.js → operations-DwZWFIUX.js} +75 -22
  18. package/dist/operations.d.ts +27 -4
  19. package/dist/operations.js +127 -730
  20. package/dist/os.d.ts +167 -0
  21. package/dist/os.js +1659 -0
  22. package/dist/runtime/console.d.ts +12 -0
  23. package/dist/runtime/console.js +85 -0
  24. package/dist/runtime/kv.d.ts +1 -1
  25. package/dist/runtime/kv.js +1 -1
  26. package/dist/runtime/process.d.ts +32 -5
  27. package/dist/runtime/process.js +401 -413
  28. package/dist/runtime/state.d.ts +2 -9
  29. package/dist/runtime/state.js +2 -2
  30. package/dist/runtime/static.d.ts +28 -2
  31. package/dist/runtime/static.js +2 -2
  32. package/dist/runtime.d.ts +34 -32
  33. package/dist/runtime.js +6 -5
  34. package/dist/started-BuGmnus4.js +201 -0
  35. package/dist/started-Bx7MDbrl.js +146 -0
  36. package/dist/{execute-BJrgNgQ0.js → started-errors-p7cu_rI7.js} +69 -20
  37. package/dist/{state-DSxmHPn3.js → state-B-Fuyfb4.js} +42 -22
  38. package/dist/state-Do2wV4Tx.d.ts +49 -0
  39. package/dist/{static-6g82xguw.js → static-DQwzzvPg.js} +63 -42
  40. package/dist/store-Df0-fzCl.d.ts +53 -0
  41. package/dist/time-zone-SBldrUgt.js +59 -0
  42. package/dist/{types-CHdV9FQU.d.ts → types-Cw5LjPuc.d.ts} +62 -8
  43. package/dist/vite.d.ts +255 -2
  44. package/dist/vite.js +5876 -2
  45. package/dist/{wait-until-BmIqRo4x.js → wait-until-Dy4Bn3ZN.js} +26 -1
  46. package/package.json +19 -24
  47. package/dist/definition-CMiOg1lg.js +0 -111
  48. package/dist/error-diagnostics-A_8Kp-48.js +0 -116
  49. package/dist/error-diagnostics-in7mif5s.js +0 -45
  50. package/dist/nuxt.d.ts +0 -17
  51. package/dist/nuxt.js +0 -27
  52. package/dist/store-QAOd8bxm.d.ts +0 -11
  53. package/dist/vite-BAVyZ8hZ.d.ts +0 -474
  54. package/dist/vite-BJwZkMrn.js +0 -5193
@@ -1,474 +0,0 @@
1
- import { t as DiscoveredScheduleDefinition } from "./types-CHdV9FQU.js";
2
- import { n as OperationContributionEntry } from "./operations-tNUdj3G4.js";
3
- //#region ../internal/src/inspect.d.ts
4
- interface ViteHubDefinitionField {
5
- label: string;
6
- value: string;
7
- }
8
- /** Serializable summary of one discovered Definition. Files are relative to the project root. */
9
- interface ViteHubDefinitionSummary {
10
- fields: readonly ViteHubDefinitionField[];
11
- file: string;
12
- name: string;
13
- source: string;
14
- }
15
- /** Lists the Definitions that one owner package discovered for the resolved Vite config. */
16
- interface ViteHubDefinitionInspector {
17
- /** Stable singular kind, for example `queue` or `rate-limit`. */
18
- kind: string;
19
- label: string;
20
- list: () => Promise<readonly ViteHubDefinitionSummary[]> | readonly ViteHubDefinitionSummary[];
21
- }
22
- /** One generated Provider Output file or directory that an owner package can write. */
23
- interface ViteHubProviderOutputEntry {
24
- description: string;
25
- owner: string;
26
- /** Absolute path. */
27
- path: string;
28
- }
29
- interface ViteHubInspectionContributor {
30
- definitions?: readonly ViteHubDefinitionInspector[];
31
- providerOutput?: readonly ViteHubProviderOutputEntry[];
32
- }
33
- type ViteHubInspectionContributorFactory = () => ViteHubInspectionContributor | undefined | Promise<ViteHubInspectionContributor | undefined>;
34
- interface ViteHubInspectionPluginMetadata {
35
- inspect?: ViteHubInspectionContributor | ViteHubInspectionContributorFactory;
36
- }
37
- //#endregion
38
- //#region ../internal/src/contributions.d.ts
39
- /** Module and export that hold a contributed Definition. */
40
- interface ContributionDefinition {
41
- /**
42
- * Absolute file path, `file:` URL, or package specifier that the application can import. Relative paths are
43
- * rejected because they have no stable base.
44
- */
45
- module: string;
46
- /** Named export that holds the Definition. Defaults to `default`. */
47
- export?: string;
48
- }
49
- /**
50
- * One Definition that a Vite plugin adds to a Server Primitive, for example a Workspace, a Schedule, or Database tables.
51
- * Every owner package reads this shape from `plugin.vitehub.<key>`. Owners can add fields, such as `database`.
52
- */
53
- interface Contribution {
54
- /** Unique name in the owner, for example the Workspace or Schedule name. */
55
- name: string;
56
- definition: ContributionDefinition;
57
- /** Why the plugin adds the Definition. `vitehub inspect` and the Console show it. */
58
- reason?: string;
59
- }
60
- /** Roots that ViteHub passes to every contribution factory. */
61
- interface ContributionContext {
62
- /** Vite root. */
63
- root: string;
64
- /** ViteHub project root. It can differ from the Vite root, for example in a Nuxt app with a `srcDir`. */
65
- projectRoot: string;
66
- /** Server directories that the host forwards, for example Nuxt's `serverDir` and the server directories of layers. */
67
- serverDirs?: readonly string[];
68
- }
69
- /**
70
- * Returns the contributions of a plugin. It runs once per discovery pass, so it must be idempotent and must not depend
71
- * on the order of Vite config hooks.
72
- */
73
- type ContributionFactory<TEntry extends Contribution = Contribution> = (context: ContributionContext) => readonly TEntry[] | undefined | Promise<readonly TEntry[] | undefined>;
74
- type ContributionSource<TEntry extends Contribution = Contribution> = readonly TEntry[] | ContributionFactory<TEntry>;
75
- /** A Vite plugin that contributes Definitions under `vitehub[TKey]`. */
76
- type ContributingPlugin<TKey extends string, TEntry extends Contribution = Contribution> = {
77
- name?: string;
78
- vitehub?: { [K in TKey]?: ContributionSource<TEntry>; };
79
- };
80
- /** A validated contribution with its export resolved and the name of the plugin that added it. */
81
- interface CollectedContribution {
82
- name: string;
83
- definition: {
84
- module: string;
85
- export: string;
86
- };
87
- reason?: string;
88
- /** Name of the contributing Vite plugin. */
89
- plugin: string;
90
- }
91
- //#endregion
92
- //#region src/contributions.d.ts
93
- /**
94
- * A Schedule Definition that another package adds from its Vite plugin. The Schedule plugin merges it with the
95
- * discovered files, so provider wake output, the Process Runtime, `vitehub schedule run`, inspection,
96
- * and the Console treat it like `server/schedules/<name>.ts`.
97
- *
98
- * The build reads the cron and the `manual` option from the source of the Definition module without running it, as it
99
- * does for discovered files. `definition.module` must therefore be an absolute file path or `file:` URL, and
100
- * `definition.export` must be `default`: `export default defineSchedule({ cron: "...", handler })` with literal options.
101
- */
102
- type ScheduleContribution = Contribution;
103
- /** Roots that ViteHub passes to contribution factories. `root` is the Vite root. */
104
- type ScheduleContributionContext = ContributionContext;
105
- type ScheduleContributionFactory = ContributionFactory<ScheduleContribution>;
106
- /** A Vite plugin that contributes Schedule Definitions through `vitehub.schedules`. */
107
- type ScheduleContributingPlugin = ContributingPlugin<"schedules", ScheduleContribution>;
108
- /** A validated contribution with the name of the plugin that contributed it. */
109
- type CollectedScheduleContribution = CollectedContribution;
110
- /**
111
- * Collects `vitehub.schedules` contributions from Vite plugins. Two contributions with one name fail with
112
- * `SCHEDULE_B0006`. Invalid entries fail with `SCHEDULE_B0007`.
113
- */
114
- declare function collectScheduleContributions(plugins: readonly unknown[] | undefined, context: ScheduleContributionContext): Promise<CollectedScheduleContribution[]>;
115
- //#endregion
116
- //#region src/discovery.d.ts
117
- /** Discovery source of Schedule Definitions that Vite plugins contribute through `vitehub.schedules`. */
118
- declare const contributedScheduleSource = "vite-plugin-contribution";
119
- interface ScheduleDiscoveryOptions {
120
- /** Schedule Definitions that Vite plugins contribute. See `collectScheduleContributions()`. */
121
- contributions?: readonly CollectedScheduleContribution[];
122
- mode?: "vite-suffix";
123
- rootDir: string;
124
- scanDirs?: string[];
125
- serverDirs?: string[];
126
- serverRootDir?: string;
127
- }
128
- declare function discoverScheduleDefinitions(options: ScheduleDiscoveryOptions | {
129
- mode: "server-schedules";
130
- scanDirs: string[];
131
- }): DiscoveredScheduleDefinition[];
132
- //#endregion
133
- //#region ../internal/src/console.d.ts
134
- type MaybePromise<T> = T | Promise<T>;
135
- /** Lists discovered Definitions in a sidebar and shows the selected Definition's fields. */
136
- interface ViteHubConsoleDefinitionCatalogView {
137
- kind: "definition-catalog";
138
- /** States which runtime data this catalog does not include. */
139
- notice: string;
140
- }
141
- interface ViteHubConsoleRecordColumn {
142
- /** Key in `ViteHubConsoleRecord.cells`. */
143
- key: string;
144
- label: string;
145
- }
146
- /** Shows records in a table and the selected record's fields in a detail panel. */
147
- interface ViteHubConsoleRecordTableView {
148
- columns: readonly ViteHubConsoleRecordColumn[];
149
- kind: "record-table";
150
- /** States the source and limits of the records. */
151
- notice: string;
152
- }
153
- /**
154
- * Lists the collections and documents of an owner runtime and edits them with owner actions: a form generated from each
155
- * collection's JSON Schema, a Markdown body, save, publish, and revision history.
156
- */
157
- interface ViteHubConsoleDocumentEditorView {
158
- kind: "document-editor";
159
- /** States where documents are stored and what the editor does not do. */
160
- notice: string;
161
- }
162
- interface ViteHubConsoleOperationColumn {
163
- /** Dot path into each item of the result, such as `author.name` or `messages.0.body`. */
164
- key: string;
165
- label: string;
166
- /** `datetime` shows a time in milliseconds since the epoch as a date. `excerpt` cuts a long text. */
167
- format?: "datetime" | "excerpt";
168
- }
169
- /** A chip above the list. Choosing it merges `input` into the operation input. The first chip is the default. */
170
- interface ViteHubConsoleOperationFilter {
171
- id: string;
172
- label: string;
173
- input: Readonly<Record<string, unknown>>;
174
- }
175
- /**
176
- * Lists the items that an operation returns, called over the Console RPC with the signed-in Console user. The operation
177
- * checks the access of that user for each item, so the view shows only what the user may read. `operation` must return an
178
- * array of objects with an `id`. A failure of the operation, with its `fix`, shows where the list would be.
179
- */
180
- interface ViteHubConsoleOperationView {
181
- columns: readonly ViteHubConsoleOperationColumn[];
182
- filters?: readonly ViteHubConsoleOperationFilter[];
183
- kind: "operation-view";
184
- /**
185
- * Makes each row a link: `{path}` placeholders take values from the item and are URL-encoded, and `{path:path}` takes an
186
- * app path and encodes each segment (a value that is not an app path, such as `//evil.com/x`, gives no link). Rows where
187
- * `when.path` is not `when.equals` get none.
188
- */
189
- link?: {
190
- label?: string;
191
- template: string;
192
- when?: {
193
- equals: string;
194
- path: string;
195
- };
196
- };
197
- notice: string;
198
- /** Operation name, such as `comments.list`. */
199
- operation: string;
200
- /** Fetch every page with `limit` and a `before` object whose keys read these dot paths from the last item. */
201
- pagination?: {
202
- limit: number;
203
- cursor: Readonly<Record<string, string>>;
204
- };
205
- }
206
- interface ViteHubConsoleAuthView {
207
- kind: "auth-management";
208
- notice: string;
209
- }
210
- interface ViteHubConsoleAuthSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleAuthView> {}
211
- type ViteHubConsoleSectionView = ViteHubConsoleOperationView | ViteHubConsoleAuthView | ViteHubConsoleDefinitionCatalogView | ViteHubConsoleRecordTableView | ViteHubConsoleDocumentEditorView;
212
- /**
213
- * The overview of a document editor section: document counts by state, the changes that wait for a publish, recent
214
- * activity, and a New button per collection. It reads the owner `overview` action.
215
- */
216
- interface ViteHubConsoleDocumentDashboardView {
217
- kind: "document-dashboard";
218
- }
219
- /**
220
- * The media library of a document editor section: folders, uploads, alt text, focal points, and crops of the Blob Store
221
- * that `blob.serve` serves. The owner decides who may use it with `mediaAccess`, and finds the documents that use a file
222
- * with `references`. The page needs the Blob section, so declare it with `requires: ["blob"]`.
223
- */
224
- interface ViteHubConsoleMediaLibraryView {
225
- kind: "media-library";
226
- }
227
- /**
228
- * The singletons of a document editor section, such as site settings: one row per singleton that opens it in the
229
- * editor. Singletons appear here instead of among the collections, and the Console hides the page when the section has
230
- * none.
231
- */
232
- interface ViteHubConsoleDocumentSettingsView {
233
- kind: "document-settings";
234
- }
235
- /** A view that the Console UI in `vite-hub` renders for a section page. */
236
- type ViteHubConsoleSectionPageView = ViteHubConsoleDocumentDashboardView | ViteHubConsoleDocumentSettingsView | ViteHubConsoleMediaLibraryView;
237
- /**
238
- * A page of a section next to its main view, such as the Content dashboard or media library. The section sidebar lists
239
- * the pages, and each page has its own URL:
240
- *
241
- * - `/_vitehub/<section>` serves the `index` page, or the main view when the section has none.
242
- * - `/_vitehub/<section>/-/<page>` serves every other page. The `-` segment keeps page URLs apart from the main view's
243
- * own segments, such as a collection name.
244
- *
245
- * Pages share the access of their section: `console.authorize` that allows the section allows every page of it.
246
- */
247
- interface ViteHubConsoleSectionPage {
248
- /** Lowercase route segment, for example `media`. */
249
- id: string;
250
- /** Display name, for example `Media`. */
251
- label: string;
252
- /** Iconify class name, for example `i-lucide-image`. */
253
- icon: string;
254
- view: ViteHubConsoleSectionPageView;
255
- /**
256
- * Serve this page at the section root. At most one page sets it, and `/_vitehub/<section>/-/<id>` then redirects to
257
- * the root.
258
- */
259
- index?: boolean;
260
- /**
261
- * Sidebar heading, for example `Assets`. Pages without a group lead the sidebar, above the main view's navigation.
262
- * Grouped pages follow it, in the order their group first appears.
263
- */
264
- group?: string;
265
- /** Section ids that the project must enable, such as `["blob"]`. The Console leaves the page out otherwise. */
266
- requires?: readonly string[];
267
- }
268
- /** One entry of a record's activity, such as a comment in a thread. `at` is an ISO 8601 timestamp. */
269
- interface ViteHubConsoleRecordActivity {
270
- author: string;
271
- at: string;
272
- text: string;
273
- }
274
- /** One serializable record row. Values are display strings. Do not put credentials in records. */
275
- interface ViteHubConsoleRecord {
276
- cells: Readonly<Record<string, string>>;
277
- fields: readonly ViteHubDefinitionField[];
278
- id: string;
279
- /** The Console can run this record when it represents a runnable Schedule Definition. */
280
- runnable?: boolean;
281
- /**
282
- * Where the record lives in the app, such as the page of a comment thread. `href` is an app path that starts with one
283
- * `/`, or an `https:` URL. The Console opens it in a new tab.
284
- */
285
- link?: {
286
- href: string;
287
- label: string;
288
- };
289
- /** Entries in time order, such as the comments of a thread. The Console shows them as a conversation. */
290
- activity?: readonly ViteHubConsoleRecordActivity[];
291
- }
292
- /** Serializable description of a Console section. The Console UI in `vite-hub` renders the view. */
293
- interface ViteHubConsoleSectionDescriptor<TView extends ViteHubConsoleSectionView = ViteHubConsoleSectionView> {
294
- description: string;
295
- /**
296
- * Iconify class name, for example `i-lucide-inbox`. The Console draws with Lucide; `ph` also resolves. The
297
- * Console build bundles the icon of every section in the `vite-hub` Console registry and fails if it cannot resolve one.
298
- */
299
- icon: string;
300
- /** Lowercase route segment, for example `queues`. The Console serves the section at `/_vitehub/<id>`. */
301
- id: string;
302
- /** Plural display name, for example `Queues`. */
303
- label: string;
304
- view: TView;
305
- /** Pages next to the main view, in sidebar order. Only document editor sections render pages today. */
306
- pages?: readonly ViteHubConsoleSectionPage[];
307
- }
308
- interface ViteHubConsoleDefinitionCatalogSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleDefinitionCatalogView> {
309
- /** Reads the section data on the server. The Console never runs it in the browser. */
310
- read: (options: TOptions) => MaybePromise<readonly ViteHubDefinitionSummary[]>;
311
- }
312
- interface ViteHubConsoleRecordTableSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleRecordTableView> {
313
- /** Reads the section data on the server. The Console never runs it in the browser. */
314
- read: (options: TOptions) => MaybePromise<readonly ViteHubConsoleRecord[]>;
315
- }
316
- /** A named export of an owner package server module that the host imports in its generated server code. */
317
- interface ViteHubConsoleServerExport {
318
- /** Named export of `module`. */
319
- export: string;
320
- /**
321
- * Owner package module specifier, for example `@vite-hub/email/runtime/console`. The host maps it to the module
322
- * path that the application can import.
323
- */
324
- module: string;
325
- }
326
- /**
327
- * Server module export that returns records on each Console request. The export must be a
328
- * {@link ViteHubConsoleRuntimeRecordReader}.
329
- */
330
- interface ViteHubConsoleRuntimeReader extends ViteHubConsoleServerExport {}
331
- /**
332
- * A record table that also reads records at request time. The Console shows the build-time records of `read` first,
333
- * then the records of the `runtime` reader. A runtime record replaces a build-time record with the same id.
334
- */
335
- interface ViteHubConsoleRuntimeRecordTableSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleRecordTableView> {
336
- /** Reads build-time records on the server. When omitted, the section has only runtime records. */
337
- read?: (options: TOptions) => MaybePromise<readonly ViteHubConsoleRecord[]>;
338
- runtime: ViteHubConsoleRuntimeReader;
339
- /**
340
- * Returns the absolute path of the application module that turns the section on, such as `server/comments.ts`, or
341
- * `undefined` when the project has none. With it, the host shows the section only when the module exists; without
342
- * it, a Vite option enables the section.
343
- */
344
- entry?: (options: TOptions) => MaybePromise<string | undefined>;
345
- }
346
- /** A section whose list comes from an operation, called with the Console user on each visit. It has no build-time data. */
347
- interface ViteHubConsoleOperationSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleOperationView> {}
348
- /**
349
- * A document editor section. The owner finds the application module that holds its runtime, such as `server/content.ts`,
350
- * and names the server export that turns that module into {@link ViteHubConsoleDocumentActions}. The host shows the
351
- * section only when `entry` finds a module, imports the module on the first Console request, and checks the Console
352
- * section before it calls an action. The owner actions check their own access policy for the signed-in user.
353
- */
354
- interface ViteHubConsoleDocumentEditorSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleDocumentEditorView> {
355
- /** Returns the absolute path of the application module, or `undefined` when the project has none. */
356
- entry: (options: TOptions) => MaybePromise<string | undefined>;
357
- /**
358
- * Reads, at build time and without running the application, what the project lacks for some editor features, such as
359
- * a runner for scheduled publishes. The Console merges it with the owner `setup` action on each request.
360
- */
361
- inspect?: (options: TOptions, entry: string) => MaybePromise<ViteHubConsoleDocumentSetup>;
362
- /** Owner export that must be a {@link ViteHubConsoleDocumentActionsFactory}. */
363
- actions: ViteHubConsoleServerExport;
364
- }
365
- /**
366
- * A Console section that an owner package contributes. The owner defines the label, icon, view, and data reader.
367
- * `TOptions` is the discovery context that the host passes to `read`.
368
- */
369
- type ViteHubConsoleSectionContribution<TOptions = void> = ViteHubConsoleAuthSection | ViteHubConsoleDefinitionCatalogSection<TOptions> | ViteHubConsoleRecordTableSection<TOptions> | ViteHubConsoleRuntimeRecordTableSection<TOptions> | ViteHubConsoleDocumentEditorSection<TOptions> | ViteHubConsoleOperationSection;
370
- /** A fix that the owner names for a feature the project lacks, such as `Add authorize to defineContent().` */
371
- interface ViteHubConsoleDocumentHint {
372
- /** One sentence that names the fix. Text in backticks shows as code. */
373
- message: string;
374
- /** Absolute URL of the documentation for the fix. */
375
- docs?: string;
376
- }
377
- /**
378
- * What the project lacks for some editor features. The editor names each fix where the feature would be, instead of
379
- * failing without a reason.
380
- */
381
- interface ViteHubConsoleDocumentSetup {
382
- /** Present when no user can read anything because the owner has no access policy. */
383
- access?: ViteHubConsoleDocumentHint;
384
- /**
385
- * Live co-editing. `definition` names the Realtime Definition whose rooms are `<collection>/<id>`; the editor joins
386
- * the room of a Markdown document instead of taking the edit lease. `unavailable` names why the owner wanted live
387
- * editing and the host cannot run it, such as a host without a Realtime authority. Absent when live editing is off.
388
- */
389
- live?: {
390
- definition: string;
391
- } | {
392
- unavailable: string;
393
- };
394
- /**
395
- * Present when nothing runs scheduled publishes. The editor disables Schedule, and overdue schedules name the fix.
396
- */
397
- schedule?: ViteHubConsoleDocumentHint;
398
- }
399
- //#endregion
400
- //#region src/inspect.d.ts
401
- interface ScheduleInspectionOptions {
402
- /** Vite plugins that can contribute Schedule Definitions through `vitehub.schedules`. */
403
- plugins?: readonly unknown[];
404
- projectRoot: string;
405
- rootDir: string;
406
- serverDirs?: string[];
407
- serverRootDir: string;
408
- }
409
- /**
410
- * Lists Schedule Definitions with their static cron when the Definition declares one. Contributed Definitions name the
411
- * plugin that added them and its reason.
412
- */
413
- declare function inspectScheduleDefinitions(options: ScheduleInspectionOptions): Promise<ViteHubDefinitionSummary[]>;
414
- /**
415
- * Console section for Schedules. Records list discovered Schedule Definitions. `vitehub inspect definitions` reads the
416
- * same Definitions, and `vitehub schedule runs <name>` lists the runs that a runtime recorded.
417
- */
418
- declare const scheduleConsoleSection: ViteHubConsoleSectionContribution<ScheduleInspectionOptions>;
419
- //#endregion
420
- //#region src/vite.d.ts
421
- declare function readScheduleDefinitionCrons(definitions: DiscoveredScheduleDefinition[]): Promise<Map<string, string>>;
422
- interface ScheduleProcessRuntimeOptions {
423
- catchUpMs?: number;
424
- concurrency?: number;
425
- driver: "process";
426
- intervalMs?: number;
427
- prefix?: string;
428
- }
429
- interface ScheduleVitePluginOptions {
430
- providerOutput?: "auto" | "standalone" | "nitro" | false;
431
- projectRoot?: string;
432
- runtime?: ScheduleProcessRuntimeOptions;
433
- }
434
- interface ScheduleNitroConfigOptions extends ScheduleVitePluginOptions {
435
- command?: "build" | "serve";
436
- /** @internal Resolve generated Nitro registrations from the ViteHub project root. */
437
- nitroOwnsPaths?: boolean;
438
- nitro?: unknown;
439
- /** Vite plugins that can contribute Schedule Definitions through `vitehub.schedules`. */
440
- plugins?: readonly unknown[];
441
- root?: string;
442
- /** @internal Framework-resolved server definition directories. */
443
- serverDirs?: string[];
444
- }
445
- interface ScheduleVitePlugin {
446
- name: string;
447
- [hook: string]: unknown;
448
- vitehub?: ViteHubInspectionPluginMetadata & {
449
- operations?: readonly OperationContributionEntry[];
450
- };
451
- }
452
- type NitroConfig = Record<string, unknown> & {
453
- cloudflare?: {
454
- wrangler?: {
455
- triggers?: {
456
- crons?: string[];
457
- } & Record<string, unknown>;
458
- } & Record<string, unknown>;
459
- } & Record<string, unknown>;
460
- modules?: unknown[];
461
- plugins?: unknown[];
462
- vercel?: {
463
- config?: {
464
- crons?: Array<{
465
- path: string;
466
- schedule: string;
467
- }>;
468
- } & Record<string, unknown>;
469
- } & Record<string, unknown>;
470
- };
471
- declare function createScheduleNitroConfig(options?: ScheduleNitroConfigOptions): Promise<NitroConfig | null>;
472
- declare function hubSchedule(options?: ScheduleVitePluginOptions): ScheduleVitePlugin;
473
- //#endregion
474
- export { ScheduleContributionContext as _, createScheduleNitroConfig as a, ScheduleInspectionOptions as c, ScheduleDiscoveryOptions as d, contributedScheduleSource as f, ScheduleContribution as g, ScheduleContributingPlugin as h, ScheduleVitePluginOptions as i, inspectScheduleDefinitions as l, CollectedScheduleContribution as m, ScheduleProcessRuntimeOptions as n, hubSchedule as o, discoverScheduleDefinitions as p, ScheduleVitePlugin as r, readScheduleDefinitionCrons as s, ScheduleNitroConfigOptions as t, scheduleConsoleSection as u, ScheduleContributionFactory as v, collectScheduleContributions as y };