@softure-ai/jobs 0.1.3 → 0.1.4

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 (60) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +65 -7
  3. package/dist/contract.d.ts +1 -1
  4. package/dist/contract.d.ts.map +1 -1
  5. package/dist/contract.js.map +1 -1
  6. package/dist/index.d.ts +7 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +4 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/messages/en.d.ts +2 -0
  11. package/dist/messages/en.d.ts.map +1 -1
  12. package/dist/messages/en.js +2 -0
  13. package/dist/messages/en.js.map +1 -1
  14. package/dist/messages/index.d.ts +2 -0
  15. package/dist/messages/index.d.ts.map +1 -1
  16. package/dist/options.d.ts +3 -0
  17. package/dist/options.d.ts.map +1 -1
  18. package/dist/options.js +4 -2
  19. package/dist/options.js.map +1 -1
  20. package/dist/schema.d.ts +253 -0
  21. package/dist/schema.d.ts.map +1 -1
  22. package/dist/schema.js +19 -1
  23. package/dist/schema.js.map +1 -1
  24. package/dist/server/index.d.ts +2 -0
  25. package/dist/server/index.d.ts.map +1 -1
  26. package/dist/server/index.js +2 -0
  27. package/dist/server/index.js.map +1 -1
  28. package/dist/server/sync-cursors.d.ts +23 -0
  29. package/dist/server/sync-cursors.d.ts.map +1 -0
  30. package/dist/server/sync-cursors.js +53 -0
  31. package/dist/server/sync-cursors.js.map +1 -0
  32. package/dist/server/sync-items.d.ts +45 -0
  33. package/dist/server/sync-items.d.ts.map +1 -0
  34. package/dist/server/sync-items.js +195 -0
  35. package/dist/server/sync-items.js.map +1 -0
  36. package/dist/sync.d.ts +65 -0
  37. package/dist/sync.d.ts.map +1 -0
  38. package/dist/sync.js +10 -0
  39. package/dist/sync.js.map +1 -0
  40. package/dist/testing/index.d.ts +9 -0
  41. package/dist/testing/index.d.ts.map +1 -1
  42. package/dist/testing/index.js +8 -1
  43. package/dist/testing/index.js.map +1 -1
  44. package/dist/worker/run-job-worker.d.ts.map +1 -1
  45. package/dist/worker/run-job-worker.js +9 -0
  46. package/dist/worker/run-job-worker.js.map +1 -1
  47. package/migrations/0004_create_sync_state.sql +41 -0
  48. package/module.json +2 -2
  49. package/package.json +1 -1
  50. package/src/contract.ts +3 -1
  51. package/src/index.ts +14 -3
  52. package/src/messages/en.ts +2 -0
  53. package/src/options.ts +4 -2
  54. package/src/schema.ts +27 -1
  55. package/src/server/index.ts +9 -0
  56. package/src/server/sync-cursors.ts +67 -0
  57. package/src/server/sync-items.ts +236 -0
  58. package/src/sync.ts +59 -0
  59. package/src/testing/index.ts +18 -2
  60. package/src/worker/run-job-worker.ts +7 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
4
4
  production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
5
5
  "Definition of done").
6
6
 
7
+ ## 0.1.4
8
+
9
+ - Sync state for jobs that poll a third-party source (#639): a cursor per source and a processed-item ledger, so a
10
+ second run never acts twice on the same item, a failed item is retried a bounded number of times and an overview
11
+ shows what passed, what failed and why. New in `@softure-ai/jobs/server`: `getSyncCursor`, `advanceSyncCursor`
12
+ (compare-and-set; `jobs.sync_cursor_moved` when another run moved it first), `processSyncItem` (runs the callback in
13
+ the item's transaction, so the app's writes commit with the ledger's `done`; returns `handled`, `retrying`, `failed`
14
+ or `skipped`), `listSyncItems`, `pruneSyncItems`. New in `@softure-ai/jobs`: `skipSyncItem`, `failSyncItem`, the
15
+ `SyncItem*` types, `SYNC_ITEM_STATUSES`, `jobSyncCursorsTable`, `jobSyncItemsTable`; in `@softure-ai/jobs/testing`:
16
+ `listSyncState`. Error codes `jobs.sync_cursor_moved` and `jobs.sync_item_threw` with their `errors.*` copy.
17
+ - `retention.syncItemsDays` (default 90): ledger items no run met for that long are deleted by the worker's hourly
18
+ prune (or `pruneSyncItems` from a cron).
19
+ - Migration for an app: run the module migrations (`0004_create_sync_state.sql` adds `jobs.sync_cursors` and
20
+ `jobs.sync_items`). An app that keeps its own cursor and processed-items tables for a polling job can move to these
21
+ (copy its rows into them, then drop its tables); nothing changes for an app that does not poll. Code or tests that
22
+ compare the whole parsed `retention` option with `toEqual` see the new key.
23
+
7
24
  ## 0.1.3
8
25
 
9
26
  - A health check of the worker's loop (#610): `runJobWorkerProcess({ healthFile })` (and `runJobWorker`) touches the
package/README.md CHANGED
@@ -10,7 +10,8 @@ received message.
10
10
  A job queue in one table (`jobs.jobs`) with enqueue inside the caller's transaction and dedup keys, claims with
11
11
  `FOR UPDATE SKIP LOCKED` under a lease, fenced completion, retry with exponential backoff, a worker process with
12
12
  graceful shutdown, recurring schedules that run once per period however many workers run, and an in-process runner
13
- for tests and cron-driven apps.
13
+ for tests and cron-driven apps. For jobs that poll a third-party source: a cursor per source and a processed-item
14
+ ledger, so a second run never acts twice on the same item (§3, "Sync state for polling").
14
15
 
15
16
  ## 2. Installation
16
17
 
@@ -53,7 +54,7 @@ export default defineSoftureConfig({
53
54
  | `schedules.<queue>.payload` | `{}` | the payload of every scheduled run |
54
55
  | `pollIntervalMs` | `1000` | how often an idle worker looks for due jobs |
55
56
  | `shutdownGraceMs` | `20000` | how long a stopping worker waits for running handlers before releasing their jobs |
56
- | `retention` | `{ succeededDays: 7, failedDays: 30, cancelledDays: 7 }` | how long finished jobs are kept; the worker prunes once an hour |
57
+ | `retention` | `{ succeededDays: 7, failedDays: 30, cancelledDays: 7, syncItemsDays: 90 }` | how long finished jobs, and sync ledger items no run met, are kept; the worker prunes once an hour |
57
58
 
58
59
  A queue name is lowercase letters, digits, `_`, `.` and `-`. A queue the config does not define is refused by
59
60
  `enqueueJob` and by the worker: a typo is a bug, not a new queue. A schedule defines its queue too, with the default
@@ -191,7 +192,7 @@ import { securityJobSchedules } from "@softure-ai/security/jobs";
191
192
  jobs({
192
193
  schedules: {
193
194
  ...authJobSchedules, // auth.prune-sessions hourly, auth.prune-password-resets daily
194
- ...securityJobSchedules, // security.prune-rate-limits hourly
195
+ ...securityJobSchedules, // security.prune-rate-limits hourly, security.prune-webhook-deliveries daily
195
196
  "app.digest": { every: "1d", payload: { kind: "weekly" } },
196
197
  // The trial-ending reminder at 09:00 and 21:00 in the users' time zone, in place of billing's daily UTC period.
197
198
  "billing.access-reminders": { at: ["09:00", "21:00"], timeZone: "Europe/Warsaw" },
@@ -264,6 +265,54 @@ among its queues, then runs every due job once, in this process, one after anoth
264
265
  `{ succeeded, retried, failed, stale }`. A cron can drain a queue with it; call `pruneJobs(ctx)` from the same cron.
265
266
  `enqueueDueSchedules(ctx, { queues? })` only enqueues the due scheduled runs.
266
267
 
268
+ ### Sync state for polling
269
+
270
+ A job that polls a source (new mails under a label, changed tasks in a list, rows flagged for export) needs a cursor
271
+ that moves only after its batch was handled, and a ledger that remembers which items were handled. From
272
+ `@softure-ai/jobs/server`:
273
+
274
+ ```ts
275
+ import { err, ok } from "@softure-ai/core";
276
+ import { skipSyncItem } from "@softure-ai/jobs";
277
+ import { advanceSyncCursor, getSyncCursor, processSyncItem } from "@softure-ai/jobs/server";
278
+
279
+ const from = await getSyncCursor(ctx, "gmail.inbox");
280
+ const batch = await gmail.listSince(from); // the app's own client
281
+ for (const message of batch.messages) {
282
+ await processSyncItem(ctx, { source: "gmail.inbox", itemId: message.id, maxAttempts: 3 }, async ({ db }) => {
283
+ if (!isTask(message)) return skipSyncItem("app.not_a_task");
284
+ const created = await createTask(db, message); // written through the item's transaction
285
+ return created.ok ? ok({ status: "done", resultRef: created.value.id }) : err("app.task_failed");
286
+ });
287
+ }
288
+ await advanceSyncCursor(ctx, { source: "gmail.inbox", from, to: batch.nextCursor });
289
+ ```
290
+
291
+ - `processSyncItem(ctx, { source, itemId, maxAttempts? }, run)` takes the item's ledger row (inserting it on first
292
+ sight, locking it so two workers on one item take turns) and runs `run` unless the item is already `done`,
293
+ `skipped` or `failed`, which returns `{ kind: "skipped", item }`. `run` gets `{ ...ctx, db, attempt }` where `db` is
294
+ the item's transaction: writes through it commit together with the ledger's `done`, so "effect first, then
295
+ acknowledge" needs no code of the app's. `ok()` or `ok({ status: "done", resultRef })` → `handled`, item `done`;
296
+ `skipSyncItem(reason?)` → `handled`, item `skipped`; an `Err` → the writes roll back, the attempt counts, the item
297
+ stays `pending` (`retrying`) until `maxAttempts` (default 5) runs failed, then `failed`; `failSyncItem(code)` fails
298
+ it at once. A throw is recorded as a failed attempt with `jobs.sync_item_threw` and rethrown, so a poison item still
299
+ ends `failed`.
300
+ - A call outside the database (an API) is not rolled back: a crash after it and before the commit repeats it on the
301
+ next run. Keep it idempotent where the source allows, and keep each item short: its transaction stays open while
302
+ `run` runs.
303
+ - `getSyncCursor(ctx, source)` returns the cursor or `null`. `advanceSyncCursor(ctx, { source, from, to })` is a
304
+ compare-and-set: refused with `jobs.sync_cursor_moved` when the stored cursor is no longer `from`, so a slower
305
+ worker cannot move it back; re-read and go on. Pass a transaction as `ctx.db` to move it with the batch's last write.
306
+ - `listSyncItems(ctx, { source?, status?, since?, limit? })` lists the ledger, most recently changed first (default
307
+ 100, at most 1000): what passed, what failed and with which code, for an overview page or an MCP tool.
308
+ - `pruneSyncItems(ctx)` deletes items no `processSyncItem` call met for `retention.syncItemsDays` (90), whatever
309
+ their status; every call touches `last_seen_at`, so an item the source still returns is never forgotten (and never
310
+ handled twice). The worker runs it with its hourly prune; an app without a worker calls it from its cron.
311
+ - A source name is lowercase letters, digits, `_ . : -`, starting with a letter, up to 127 characters (`gmail.inbox`,
312
+ `todoist:project-42`); an item id up to 500 characters.
313
+ - In tests, `listSyncState(db)` from `@softure-ai/jobs/testing` returns `{ cursors, items }` for assertions after
314
+ `runDueJobs` ran the polling job.
315
+
267
316
  ### Steering and overview
268
317
 
269
318
  From `@softure-ai/jobs/server`, each on `ctx = { db, clock, config }`:
@@ -286,8 +335,8 @@ Nothing to mount: the module has no routes or pages. The worker is a process (§
286
335
 
287
336
  ## 5. Migrations and tables
288
337
 
289
- Schema `jobs`, two tables, `migrations/0001_create_jobs.sql`, `migrations/0002_create_schedules.sql` and
290
- `migrations/0003_add_schedule_failures.sql`:
338
+ Schema `jobs`, four tables, `migrations/0001_create_jobs.sql`, `migrations/0002_create_schedules.sql`,
339
+ `migrations/0003_add_schedule_failures.sql` and `migrations/0004_create_sync_state.sql`:
291
340
 
292
341
  `jobs.jobs`: `id` (bigint identity; a string in the API), `queue`, `payload` (jsonb), `status` (`pending`, `running`,
293
342
  `succeeded`, `failed`, `cancelled`), `attempts`, `max_attempts`, `run_at`, `locked_until`, `locked_by` (the worker,
@@ -300,6 +349,13 @@ was enqueued for), `last_succeeded_at`, `last_failed_at`, `last_failure_code` (a
300
349
  `created_at`, `updated_at`. One row per schedule a worker has seen; a row of
301
350
  a schedule removed from the config stays and is ignored.
302
351
 
352
+ `jobs.sync_cursors`: `source` (primary key), `cursor` (1 to 2000 characters), `created_at`, `updated_at`.
353
+
354
+ `jobs.sync_items`: `source` and `item_id` (primary key), `status` (`pending`, `done`, `skipped`, `failed`),
355
+ `error_code` (the last failure's code or the skip reason, never a message), `attempts`, `result_ref` (done items only),
356
+ `first_seen_at`, `last_seen_at`, `updated_at`, `finished_at`. Checks keep `finished_at` set exactly for final items and
357
+ an error code on failed ones.
358
+
303
359
  The app role needs `SELECT, INSERT, UPDATE, DELETE` on the tables, which the `@softure-ai/ops` roles recipe grants on
304
360
  every schema the migrator creates.
305
361
 
@@ -318,7 +374,8 @@ No UI.
318
374
  ## 9. Copy
319
375
 
320
376
  `errors.*` in `src/messages/en.ts`, one key per error code (`invalid_payload`, `handler_threw`, `lease_expired`,
321
- `not_found`, `not_cancellable`, `not_retryable`, `dedup_key_taken`), for an admin screen that shows a job's state.
377
+ `not_found`, `not_cancellable`, `not_retryable`, `dedup_key_taken`, `sync_cursor_moved`, `sync_item_threw`), for an
378
+ admin screen that shows a job's or a sync item's state.
322
379
 
323
380
  ## 10. Hooks
324
381
 
@@ -330,7 +387,8 @@ a release, pruning.
330
387
 
331
388
  No export or deletion contributor: jobs are transient and pruned (§3, `retention`). Keep personal data out of
332
389
  payloads (ids only); then a deleted account leaves nothing personal in `jobs.jobs`. `last_error` holds codes, and the
333
- logger gets payload paths, never values, for a payload that does not match its schema.
390
+ logger gets payload paths, never values, for a payload that does not match its schema. The sync ledger holds the
391
+ source's item ids, not their content; if an id is personal (an e-mail address), the app hashes it before passing it.
334
392
 
335
393
  ## 12. Limitations
336
394
 
@@ -1,5 +1,5 @@
1
1
  import type { Err, ErrorCode } from "@softure-ai/core";
2
- export type JobsErrorCode = "jobs.invalid_payload" | "jobs.handler_threw" | "jobs.lease_expired" | "jobs.not_found" | "jobs.not_cancellable" | "jobs.not_retryable" | "jobs.dedup_key_taken";
2
+ export type JobsErrorCode = "jobs.invalid_payload" | "jobs.handler_threw" | "jobs.lease_expired" | "jobs.not_found" | "jobs.not_cancellable" | "jobs.not_retryable" | "jobs.dedup_key_taken" | "jobs.sync_cursor_moved" | "jobs.sync_item_threw";
3
3
  export declare const JOB_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled"];
4
4
  export type JobStatus = (typeof JOB_STATUSES)[number];
5
5
  /** One job as the module's functions return it. */
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,aAAa,GACrB,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,YAAY,qEAAsE,CAAC;AAEhG,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,mDAAmD;AACnD,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ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AACH,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACrD,0GAA0G;GACxG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC"}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export declare const jobs: import("@softure-ai/core").ModuleFactory<{}, {
12
12
  not_cancellable: string;
13
13
  not_retryable: string;
14
14
  dedup_key_taken: string;
15
+ sync_cursor_moved: string;
16
+ sync_item_threw: string;
15
17
  };
16
18
  }, import("zod").ZodPipe<import("zod").ZodObject<{
17
19
  queues: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -40,6 +42,7 @@ export declare const jobs: import("@softure-ai/core").ModuleFactory<{}, {
40
42
  succeededDays: import("zod").ZodDefault<import("zod").ZodNumber>;
41
43
  failedDays: import("zod").ZodDefault<import("zod").ZodNumber>;
42
44
  cancelledDays: import("zod").ZodDefault<import("zod").ZodNumber>;
45
+ syncItemsDays: import("zod").ZodDefault<import("zod").ZodNumber>;
43
46
  }, import("zod/v4/core").$strict>>;
44
47
  }, import("zod/v4/core").$strict>, import("zod").ZodTransform<{
45
48
  queues: {
@@ -60,6 +63,7 @@ export declare const jobs: import("@softure-ai/core").ModuleFactory<{}, {
60
63
  succeededDays: number;
61
64
  failedDays: number;
62
65
  cancelledDays: number;
66
+ syncItemsDays: number;
63
67
  };
64
68
  }, {
65
69
  queues: Record<string, {
@@ -78,11 +82,13 @@ export declare const jobs: import("@softure-ai/core").ModuleFactory<{}, {
78
82
  succeededDays: number;
79
83
  failedDays: number;
80
84
  cancelledDays: number;
85
+ syncItemsDays: number;
81
86
  };
82
87
  }>>>;
83
88
  export { JOB_STATUSES, type Job, type JobFailure, type JobOutcome, type JobsErrorCode, type JobStatus, } from "./contract.js";
84
89
  export { jobsMessages, type JobsMessages } from "./messages/index.js";
85
90
  export { jobsOptionsSchema, type JobQueueOptions, type JobScheduleOptions, type JobSchedulesInput, type JobsOptions, type JobsOptionsInput, type LocalTimeScheduleOptions, type PeriodScheduleOptions, } from "./options.js";
86
91
  export { defineJobHandler, failJob, retryJobLater, type JobHandler, type JobHandlerContext, type JobHandlers } from "./handlers.js";
87
- export { jobs as jobsTable, schedules as jobSchedulesTable } from "./schema.js";
92
+ export { jobs as jobsTable, schedules as jobSchedulesTable, syncCursors as jobSyncCursorsTable, syncItems as jobSyncItemsTable } from "./schema.js";
93
+ export { failSyncItem, skipSyncItem, SYNC_ITEM_STATUSES, type SyncItem, type SyncItemCompletion, type SyncItemFailure, type SyncItemOutcome, type SyncItemRunResult, type SyncItemStatus, } from "./sync.js";
88
94
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBf,CAAC;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACpI,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBf,CAAC;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACpI,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,SAAS,IAAI,iBAAiB,EAAE,WAAW,IAAI,mBAAmB,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpJ,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -13,10 +13,10 @@ export const MODULE_ID = "jobs";
13
13
  export const jobs = defineModule({
14
14
  manifest: {
15
15
  id: MODULE_ID,
16
- version: "0.1.3",
16
+ version: "0.1.4",
17
17
  dependsOn: {},
18
18
  dbSchema: "jobs",
19
- tables: ["jobs", "schedules"],
19
+ tables: ["jobs", "schedules", "sync_cursors", "sync_items"],
20
20
  env: [],
21
21
  switches: [],
22
22
  routes: {},
@@ -32,5 +32,6 @@ export { JOB_STATUSES, } from "./contract.js";
32
32
  export { jobsMessages } from "./messages/index.js";
33
33
  export { jobsOptionsSchema, } from "./options.js";
34
34
  export { defineJobHandler, failJob, retryJobLater } from "./handlers.js";
35
- export { jobs as jobsTable, schedules as jobSchedulesTable } from "./schema.js";
35
+ export { jobs as jobsTable, schedules as jobSchedulesTable, syncCursors as jobSyncCursorsTable, syncItems as jobSyncItemsTable } from "./schema.js";
36
+ export { failSyncItem, skipSyncItem, SYNC_ITEM_STATUSES, } from "./sync.js";
36
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,oHAAoH;AACpH,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;IAC/B,QAAQ,EAAE;QACR,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;QAC7B,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;KAC5C;IACD,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,iBAAiB;IAC1B,UAAU,EAAE,EAAE,GAAG,EAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE;IAC5E,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,OAAO,EACL,YAAY,GAMb,MAAM,eAAe,CAAC;AACvB,OAAO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Ac;CACvB,CAAC,CAAC;AAEH,OAAO,EACL,YAAY,GAMb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,iBAAiB,GAQlB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAA6D,MAAM,eAAe,CAAC;AACpI,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,SAAS,IAAI,iBAAiB,EAAE,WAAW,IAAI,mBAAmB,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpJ,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,GAOnB,MAAM,WAAW,CAAC"}
@@ -7,6 +7,8 @@ export declare const en: {
7
7
  not_cancellable: string;
8
8
  not_retryable: string;
9
9
  dedup_key_taken: string;
10
+ sync_cursor_moved: string;
11
+ sync_item_threw: string;
10
12
  };
11
13
  };
12
14
  //# sourceMappingURL=en.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;CAUd,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;CAYd,CAAC"}
@@ -7,6 +7,8 @@ export const en = {
7
7
  not_cancellable: "Only a job that has not started can be cancelled.",
8
8
  not_retryable: "Only a failed or cancelled job can be run again.",
9
9
  dedup_key_taken: "Another job for the same work is already waiting or running.",
10
+ sync_cursor_moved: "Another run moved the sync position first.",
11
+ sync_item_threw: "Handling the item failed unexpectedly.",
10
12
  },
11
13
  };
12
14
  //# sourceMappingURL=en.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,MAAM,EAAE;QACN,eAAe,EAAE,8BAA8B;QAC/C,aAAa,EAAE,sDAAsD;QACrE,aAAa,EAAE,iCAAiC;QAChD,SAAS,EAAE,yBAAyB;QACpC,eAAe,EAAE,mDAAmD;QACpE,aAAa,EAAE,kDAAkD;QACjE,eAAe,EAAE,8DAA8D;KAChF;CACF,CAAC"}
1
+ {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,MAAM,EAAE;QACN,eAAe,EAAE,8BAA8B;QAC/C,aAAa,EAAE,sDAAsD;QACrE,aAAa,EAAE,iCAAiC;QAChD,SAAS,EAAE,yBAAyB;QACpC,eAAe,EAAE,mDAAmD;QACpE,aAAa,EAAE,kDAAkD;QACjE,eAAe,EAAE,8DAA8D;QAC/E,iBAAiB,EAAE,4CAA4C;QAC/D,eAAe,EAAE,wCAAwC;KAC1D;CACF,CAAC"}
@@ -10,6 +10,8 @@ export declare const jobsMessages: {
10
10
  not_cancellable: string;
11
11
  not_retryable: string;
12
12
  dedup_key_taken: string;
13
+ sync_cursor_moved: string;
14
+ sync_item_threw: string;
13
15
  };
14
16
  };
15
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,0GAA0G;AAC1G,eAAO,MAAM,YAAY;;;;;;;;;;;;CAAS,CAAC;AAEnC,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,0GAA0G;AAC1G,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAAS,CAAC;AAEnC,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC"}
package/dist/options.d.ts CHANGED
@@ -39,6 +39,7 @@ export declare const jobsOptionsSchema: z.ZodPipe<z.ZodObject<{
39
39
  succeededDays: z.ZodDefault<z.ZodNumber>;
40
40
  failedDays: z.ZodDefault<z.ZodNumber>;
41
41
  cancelledDays: z.ZodDefault<z.ZodNumber>;
42
+ syncItemsDays: z.ZodDefault<z.ZodNumber>;
42
43
  }, z.core.$strict>>;
43
44
  }, z.core.$strict>, z.ZodTransform<{
44
45
  queues: {
@@ -59,6 +60,7 @@ export declare const jobsOptionsSchema: z.ZodPipe<z.ZodObject<{
59
60
  succeededDays: number;
60
61
  failedDays: number;
61
62
  cancelledDays: number;
63
+ syncItemsDays: number;
62
64
  };
63
65
  }, {
64
66
  queues: Record<string, {
@@ -77,6 +79,7 @@ export declare const jobsOptionsSchema: z.ZodPipe<z.ZodObject<{
77
79
  succeededDays: number;
78
80
  failedDays: number;
79
81
  cancelledDays: number;
82
+ syncItemsDays: number;
80
83
  };
81
84
  }>>;
82
85
  export type JobsOptionsInput = z.input<typeof jobsOptionsSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBtB,8GAA8G;AAC9G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK9D;AAyCH,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,iFAAiF;AACjF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QA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AM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyB1B,CAAC;AAQL,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC7D,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,iGAAiG;AACjG,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC"}
package/dist/options.js CHANGED
@@ -84,6 +84,8 @@ const retentionSchema = z.strictObject({
84
84
  failedDays: z.number().int().min(1).max(3650).default(30),
85
85
  /** Days a cancelled job is kept. */
86
86
  cancelledDays: z.number().int().min(0).max(3650).default(7),
87
+ /** Days a sync ledger item is kept after the last run that met it (`processSyncItem`). */
88
+ syncItemsDays: z.number().int().min(1).max(3650).default(90),
87
89
  });
88
90
  export const jobsOptionsSchema = z
89
91
  .strictObject({
@@ -99,8 +101,8 @@ export const jobsOptionsSchema = z
99
101
  pollIntervalMs: z.number().int().min(50).max(60_000).default(1000),
100
102
  /** How long a stopping worker waits for running handlers before it releases their jobs. */
101
103
  shutdownGraceMs: z.number().int().min(0).max(10 * 60_000).default(20_000),
102
- /** How long finished jobs are kept; the worker prunes once an hour. */
103
- retention: retentionSchema.default({ succeededDays: 7, failedDays: 30, cancelledDays: 7 }),
104
+ /** How long finished jobs and unseen sync ledger items are kept; the worker prunes once an hour. */
105
+ retention: retentionSchema.default({ succeededDays: 7, failedDays: 30, cancelledDays: 7, syncItemsDays: 90 }),
104
106
  })
105
107
  .superRefine((options, context) => {
106
108
  if (Object.keys(options.queues).length === 0 && Object.keys(options.schedules).length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAC9C,MAAM,eAAe,GAAG,mFAAmF,CAAC;AAC5G,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEjC,MAAM,aAAa,GAAG,CAAC;KACpB,YAAY,CAAC;IACV,kEAAkE;IAClE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjE,8CAA8C;IAC9C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CACvE,CAAC;KACD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE;IAC9D,OAAO,EAAE,yCAAyC;IAClD,IAAI,EAAE,CAAC,YAAY,CAAC;CACrB,CAAC,CAAC;AAEL,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAC3C,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,WAAW,EAAW,CAAC;AACpE,MAAM,iBAAiB,GAAG,CAAC,GAAG,WAAW,CAAC;AAC1C,MAAM,UAAU,GAAG,oFAAoF,CAAC;AAExG,8GAA8G;AAC9G,MAA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AE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -388,4 +388,257 @@ export declare const schedules: import("drizzle-orm/pg-core").PgTableWithColumns
388
388
  };
389
389
  dialect: "pg";
390
390
  }>;
391
+ export declare const syncCursors: import("drizzle-orm/pg-core").PgTableWithColumns<{
392
+ name: "sync_cursors";
393
+ schema: "jobs";
394
+ columns: {
395
+ source: import("drizzle-orm/pg-core").PgColumn<{
396
+ name: "source";
397
+ tableName: "sync_cursors";
398
+ dataType: "string";
399
+ columnType: "PgText";
400
+ data: string;
401
+ driverParam: string;
402
+ notNull: true;
403
+ hasDefault: false;
404
+ isPrimaryKey: true;
405
+ isAutoincrement: false;
406
+ hasRuntimeDefault: false;
407
+ enumValues: [string, ...string[]];
408
+ baseColumn: never;
409
+ identity: undefined;
410
+ generated: undefined;
411
+ }, {}, {}>;
412
+ cursor: import("drizzle-orm/pg-core").PgColumn<{
413
+ name: "cursor";
414
+ tableName: "sync_cursors";
415
+ dataType: "string";
416
+ columnType: "PgText";
417
+ data: string;
418
+ driverParam: string;
419
+ notNull: true;
420
+ hasDefault: false;
421
+ isPrimaryKey: false;
422
+ isAutoincrement: false;
423
+ hasRuntimeDefault: false;
424
+ enumValues: [string, ...string[]];
425
+ baseColumn: never;
426
+ identity: undefined;
427
+ generated: undefined;
428
+ }, {}, {}>;
429
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
430
+ name: "created_at";
431
+ tableName: "sync_cursors";
432
+ dataType: "date";
433
+ columnType: "PgTimestamp";
434
+ data: Date;
435
+ driverParam: string;
436
+ notNull: true;
437
+ hasDefault: false;
438
+ isPrimaryKey: false;
439
+ isAutoincrement: false;
440
+ hasRuntimeDefault: false;
441
+ enumValues: undefined;
442
+ baseColumn: never;
443
+ identity: undefined;
444
+ generated: undefined;
445
+ }, {}, {}>;
446
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
447
+ name: "updated_at";
448
+ tableName: "sync_cursors";
449
+ dataType: "date";
450
+ columnType: "PgTimestamp";
451
+ data: Date;
452
+ driverParam: string;
453
+ notNull: true;
454
+ hasDefault: false;
455
+ isPrimaryKey: false;
456
+ isAutoincrement: false;
457
+ hasRuntimeDefault: false;
458
+ enumValues: undefined;
459
+ baseColumn: never;
460
+ identity: undefined;
461
+ generated: undefined;
462
+ }, {}, {}>;
463
+ };
464
+ dialect: "pg";
465
+ }>;
466
+ export declare const syncItems: import("drizzle-orm/pg-core").PgTableWithColumns<{
467
+ name: "sync_items";
468
+ schema: "jobs";
469
+ columns: {
470
+ source: import("drizzle-orm/pg-core").PgColumn<{
471
+ name: "source";
472
+ tableName: "sync_items";
473
+ dataType: "string";
474
+ columnType: "PgText";
475
+ data: string;
476
+ driverParam: string;
477
+ notNull: true;
478
+ hasDefault: false;
479
+ isPrimaryKey: false;
480
+ isAutoincrement: false;
481
+ hasRuntimeDefault: false;
482
+ enumValues: [string, ...string[]];
483
+ baseColumn: never;
484
+ identity: undefined;
485
+ generated: undefined;
486
+ }, {}, {}>;
487
+ itemId: import("drizzle-orm/pg-core").PgColumn<{
488
+ name: "item_id";
489
+ tableName: "sync_items";
490
+ dataType: "string";
491
+ columnType: "PgText";
492
+ data: string;
493
+ driverParam: string;
494
+ notNull: true;
495
+ hasDefault: false;
496
+ isPrimaryKey: false;
497
+ isAutoincrement: false;
498
+ hasRuntimeDefault: false;
499
+ enumValues: [string, ...string[]];
500
+ baseColumn: never;
501
+ identity: undefined;
502
+ generated: undefined;
503
+ }, {}, {}>;
504
+ status: import("drizzle-orm/pg-core").PgColumn<{
505
+ name: "status";
506
+ tableName: "sync_items";
507
+ dataType: "string";
508
+ columnType: "PgText";
509
+ data: "pending" | "failed" | "done" | "skipped";
510
+ driverParam: string;
511
+ notNull: true;
512
+ hasDefault: false;
513
+ isPrimaryKey: false;
514
+ isAutoincrement: false;
515
+ hasRuntimeDefault: false;
516
+ enumValues: ["pending", "done", "skipped", "failed"];
517
+ baseColumn: never;
518
+ identity: undefined;
519
+ generated: undefined;
520
+ }, {}, {}>;
521
+ errorCode: import("drizzle-orm/pg-core").PgColumn<{
522
+ name: "error_code";
523
+ tableName: "sync_items";
524
+ dataType: "string";
525
+ columnType: "PgText";
526
+ data: string;
527
+ driverParam: string;
528
+ notNull: false;
529
+ hasDefault: false;
530
+ isPrimaryKey: false;
531
+ isAutoincrement: false;
532
+ hasRuntimeDefault: false;
533
+ enumValues: [string, ...string[]];
534
+ baseColumn: never;
535
+ identity: undefined;
536
+ generated: undefined;
537
+ }, {}, {}>;
538
+ attempts: import("drizzle-orm/pg-core").PgColumn<{
539
+ name: "attempts";
540
+ tableName: "sync_items";
541
+ dataType: "number";
542
+ columnType: "PgInteger";
543
+ data: number;
544
+ driverParam: string | number;
545
+ notNull: true;
546
+ hasDefault: false;
547
+ isPrimaryKey: false;
548
+ isAutoincrement: false;
549
+ hasRuntimeDefault: false;
550
+ enumValues: undefined;
551
+ baseColumn: never;
552
+ identity: undefined;
553
+ generated: undefined;
554
+ }, {}, {}>;
555
+ resultRef: import("drizzle-orm/pg-core").PgColumn<{
556
+ name: "result_ref";
557
+ tableName: "sync_items";
558
+ dataType: "string";
559
+ columnType: "PgText";
560
+ data: string;
561
+ driverParam: string;
562
+ notNull: false;
563
+ hasDefault: false;
564
+ isPrimaryKey: false;
565
+ isAutoincrement: false;
566
+ hasRuntimeDefault: false;
567
+ enumValues: [string, ...string[]];
568
+ baseColumn: never;
569
+ identity: undefined;
570
+ generated: undefined;
571
+ }, {}, {}>;
572
+ firstSeenAt: import("drizzle-orm/pg-core").PgColumn<{
573
+ name: "first_seen_at";
574
+ tableName: "sync_items";
575
+ dataType: "date";
576
+ columnType: "PgTimestamp";
577
+ data: Date;
578
+ driverParam: string;
579
+ notNull: true;
580
+ hasDefault: false;
581
+ isPrimaryKey: false;
582
+ isAutoincrement: false;
583
+ hasRuntimeDefault: false;
584
+ enumValues: undefined;
585
+ baseColumn: never;
586
+ identity: undefined;
587
+ generated: undefined;
588
+ }, {}, {}>;
589
+ lastSeenAt: import("drizzle-orm/pg-core").PgColumn<{
590
+ name: "last_seen_at";
591
+ tableName: "sync_items";
592
+ dataType: "date";
593
+ columnType: "PgTimestamp";
594
+ data: Date;
595
+ driverParam: string;
596
+ notNull: true;
597
+ hasDefault: false;
598
+ isPrimaryKey: false;
599
+ isAutoincrement: false;
600
+ hasRuntimeDefault: false;
601
+ enumValues: undefined;
602
+ baseColumn: never;
603
+ identity: undefined;
604
+ generated: undefined;
605
+ }, {}, {}>;
606
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
607
+ name: "updated_at";
608
+ tableName: "sync_items";
609
+ dataType: "date";
610
+ columnType: "PgTimestamp";
611
+ data: Date;
612
+ driverParam: string;
613
+ notNull: true;
614
+ hasDefault: false;
615
+ isPrimaryKey: false;
616
+ isAutoincrement: false;
617
+ hasRuntimeDefault: false;
618
+ enumValues: undefined;
619
+ baseColumn: never;
620
+ identity: undefined;
621
+ generated: undefined;
622
+ }, {}, {}>;
623
+ finishedAt: import("drizzle-orm/pg-core").PgColumn<{
624
+ name: "finished_at";
625
+ tableName: "sync_items";
626
+ dataType: "date";
627
+ columnType: "PgTimestamp";
628
+ data: Date;
629
+ driverParam: string;
630
+ notNull: false;
631
+ hasDefault: false;
632
+ isPrimaryKey: false;
633
+ isAutoincrement: false;
634
+ hasRuntimeDefault: false;
635
+ enumValues: undefined;
636
+ baseColumn: never;
637
+ identity: undefined;
638
+ generated: undefined;
639
+ }, {}, {}>;
640
+ };
641
+ dialect: "pg";
642
+ }>;
643
+ export type SyncItemRow = typeof syncItems.$inferSelect;
391
644
  //# sourceMappingURL=schema.d.ts.map