@shivaedev/jobs 0.25.0 → 0.27.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.
Files changed (165) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +58 -19
  3. package/dist/server/adapters/clientErrorReporter.d.ts +3 -0
  4. package/dist/server/adapters/clientErrorReporter.d.ts.map +1 -0
  5. package/dist/server/adapters/clientErrorReporter.js +8 -0
  6. package/dist/server/adapters/clientErrorReporter.js.map +1 -0
  7. package/dist/server/adapters/installSchema.d.ts +5 -0
  8. package/dist/server/adapters/installSchema.d.ts.map +1 -0
  9. package/dist/server/adapters/installSchema.js +57 -0
  10. package/dist/server/adapters/installSchema.js.map +1 -0
  11. package/dist/server/adapters/registerWorker.d.ts +5 -0
  12. package/dist/server/adapters/registerWorker.d.ts.map +1 -0
  13. package/dist/server/{internal → adapters}/registerWorker.js +3 -2
  14. package/dist/server/adapters/registerWorker.js.map +1 -0
  15. package/dist/server/adapters/retireJobs.d.ts +5 -0
  16. package/dist/server/adapters/retireJobs.d.ts.map +1 -0
  17. package/dist/server/adapters/retireJobs.js +28 -0
  18. package/dist/server/adapters/retireJobs.js.map +1 -0
  19. package/dist/server/{internal → adapters}/runSchemaPlan.d.ts.map +1 -1
  20. package/dist/server/{internal → adapters}/runSchemaPlan.js.map +1 -1
  21. package/dist/server/{internal → adapters}/schemaIndexBuilds.d.ts.map +1 -1
  22. package/dist/server/{internal → adapters}/schemaIndexBuilds.js.map +1 -1
  23. package/dist/server/{internal → adapters}/testingExpirations.d.ts.map +1 -1
  24. package/dist/server/{internal → adapters}/testingExpirations.js.map +1 -1
  25. package/dist/server/{internal → adapters}/transactionDb.d.ts.map +1 -1
  26. package/dist/server/{internal → adapters}/transactionDb.js.map +1 -1
  27. package/dist/server/adapters/workerDiagnostics.d.ts +3 -0
  28. package/dist/server/adapters/workerDiagnostics.d.ts.map +1 -0
  29. package/dist/server/adapters/workerDiagnostics.js +24 -0
  30. package/dist/server/adapters/workerDiagnostics.js.map +1 -0
  31. package/dist/server/client.d.ts +2 -1
  32. package/dist/server/client.d.ts.map +1 -1
  33. package/dist/server/client.js +1 -2
  34. package/dist/server/client.js.map +1 -1
  35. package/dist/server/defaultClientFactory.d.ts +3 -0
  36. package/dist/server/defaultClientFactory.d.ts.map +1 -0
  37. package/dist/server/{internal/nativeClient.js → defaultClientFactory.js} +2 -2
  38. package/dist/server/defaultClientFactory.js.map +1 -0
  39. package/dist/server/defineSchedule.d.ts +3 -0
  40. package/dist/server/defineSchedule.d.ts.map +1 -0
  41. package/dist/server/{internal/scheduleDefinition.js → defineSchedule.js} +2 -2
  42. package/dist/server/defineSchedule.js.map +1 -0
  43. package/dist/server/definition.d.ts +0 -1
  44. package/dist/server/definition.d.ts.map +1 -1
  45. package/dist/server/definition.js +0 -4
  46. package/dist/server/definition.js.map +1 -1
  47. package/dist/server/error.d.ts +11 -1
  48. package/dist/server/error.d.ts.map +1 -1
  49. package/dist/server/error.js +6 -1
  50. package/dist/server/error.js.map +1 -1
  51. package/dist/server/health.d.ts +1 -0
  52. package/dist/server/health.d.ts.map +1 -1
  53. package/dist/server/internal/adapters/testingFetches.d.ts +7 -0
  54. package/dist/server/internal/adapters/testingFetches.d.ts.map +1 -0
  55. package/dist/server/internal/adapters/testingFetches.js +30 -0
  56. package/dist/server/internal/adapters/testingFetches.js.map +1 -0
  57. package/dist/server/internal/batchHandler.d.ts +1 -2
  58. package/dist/server/internal/batchHandler.d.ts.map +1 -1
  59. package/dist/server/internal/batchHandler.js +9 -1
  60. package/dist/server/internal/batchHandler.js.map +1 -1
  61. package/dist/server/internal/deadLetterResolutionPlan.d.ts +2 -0
  62. package/dist/server/internal/deadLetterResolutionPlan.d.ts.map +1 -0
  63. package/dist/server/internal/deadLetterResolutionPlan.js +28 -0
  64. package/dist/server/internal/deadLetterResolutionPlan.js.map +1 -0
  65. package/dist/server/internal/enqueueFor.d.ts.map +1 -1
  66. package/dist/server/internal/enqueueFor.js +2 -2
  67. package/dist/server/internal/enqueueFor.js.map +1 -1
  68. package/dist/server/internal/jobControl.d.ts.map +1 -1
  69. package/dist/server/internal/jobControl.js +2 -1
  70. package/dist/server/internal/jobControl.js.map +1 -1
  71. package/dist/server/internal/jobStorePlans.d.ts +2 -0
  72. package/dist/server/internal/jobStorePlans.d.ts.map +1 -0
  73. package/dist/server/internal/jobStorePlans.js +6 -0
  74. package/dist/server/internal/jobStorePlans.js.map +1 -0
  75. package/dist/server/internal/lifecycle.d.ts +1 -1
  76. package/dist/server/internal/lifecycle.d.ts.map +1 -1
  77. package/dist/server/internal/lifecycle.js +5 -3
  78. package/dist/server/internal/lifecycle.js.map +1 -1
  79. package/dist/server/internal/listJobs.d.ts.map +1 -1
  80. package/dist/server/internal/listJobs.js +3 -2
  81. package/dist/server/internal/listJobs.js.map +1 -1
  82. package/dist/server/internal/makeService.js +1 -1
  83. package/dist/server/internal/makeService.js.map +1 -1
  84. package/dist/server/internal/register.d.ts +1 -2
  85. package/dist/server/internal/register.d.ts.map +1 -1
  86. package/dist/server/internal/register.js +8 -8
  87. package/dist/server/internal/register.js.map +1 -1
  88. package/dist/server/internal/registerReleasedJobs.d.ts +1 -2
  89. package/dist/server/internal/registerReleasedJobs.d.ts.map +1 -1
  90. package/dist/server/internal/registerReleasedJobs.js +5 -4
  91. package/dist/server/internal/registerReleasedJobs.js.map +1 -1
  92. package/dist/server/internal/runQueueWorker.d.ts.map +1 -1
  93. package/dist/server/internal/runQueueWorker.js +3 -2
  94. package/dist/server/internal/runQueueWorker.js.map +1 -1
  95. package/dist/server/internal/storedRows.js +1 -1
  96. package/dist/server/internal/storedRows.js.map +1 -1
  97. package/dist/server/internal/testingClient.d.ts.map +1 -1
  98. package/dist/server/internal/testingClient.js +1 -1
  99. package/dist/server/internal/testingClient.js.map +1 -1
  100. package/dist/server/internal/testingWaits.d.ts +16 -0
  101. package/dist/server/internal/testingWaits.d.ts.map +1 -0
  102. package/dist/server/internal/testingWaits.js +56 -0
  103. package/dist/server/internal/testingWaits.js.map +1 -0
  104. package/dist/server/schema.d.ts.map +1 -1
  105. package/dist/server/schema.js +11 -53
  106. package/dist/server/schema.js.map +1 -1
  107. package/dist/server/service.d.ts +5 -4
  108. package/dist/server/service.d.ts.map +1 -1
  109. package/dist/server/service.js +6 -10
  110. package/dist/server/service.js.map +1 -1
  111. package/dist/server/testing.d.ts +5 -0
  112. package/dist/server/testing.d.ts.map +1 -1
  113. package/dist/server/testing.js +7 -2
  114. package/dist/server/testing.js.map +1 -1
  115. package/package.json +4 -4
  116. package/src/server/adapters/clientErrorReporter.ts +8 -0
  117. package/src/server/adapters/installSchema.ts +68 -0
  118. package/src/server/{internal → adapters}/registerWorker.ts +6 -7
  119. package/src/server/adapters/retireJobs.ts +30 -0
  120. package/src/server/adapters/workerDiagnostics.ts +28 -0
  121. package/src/server/client.ts +2 -3
  122. package/src/server/{internal/nativeClient.ts → defaultClientFactory.ts} +1 -1
  123. package/src/server/{internal/scheduleDefinition.ts → defineSchedule.ts} +1 -1
  124. package/src/server/definition.ts +0 -5
  125. package/src/server/error.ts +11 -1
  126. package/src/server/health.ts +1 -0
  127. package/src/server/internal/adapters/testingFetches.ts +36 -0
  128. package/src/server/internal/batchHandler.ts +11 -8
  129. package/src/server/internal/deadLetterResolutionPlan.ts +28 -0
  130. package/src/server/internal/enqueueFor.ts +2 -2
  131. package/src/server/internal/jobControl.ts +2 -1
  132. package/src/server/internal/jobStorePlans.ts +6 -0
  133. package/src/server/internal/lifecycle.ts +6 -3
  134. package/src/server/internal/listJobs.ts +11 -3
  135. package/src/server/internal/makeService.ts +1 -1
  136. package/src/server/internal/register.ts +6 -21
  137. package/src/server/internal/registerReleasedJobs.ts +6 -5
  138. package/src/server/internal/runQueueWorker.ts +3 -1
  139. package/src/server/internal/storedRows.ts +1 -1
  140. package/src/server/internal/testingClient.ts +1 -1
  141. package/src/server/internal/testingWaits.ts +98 -0
  142. package/src/server/schema.ts +14 -65
  143. package/src/server/service.ts +11 -14
  144. package/src/server/testing.ts +11 -2
  145. package/dist/server/internal/nativeClient.d.ts +0 -3
  146. package/dist/server/internal/nativeClient.d.ts.map +0 -1
  147. package/dist/server/internal/nativeClient.js.map +0 -1
  148. package/dist/server/internal/registerWorker.d.ts +0 -6
  149. package/dist/server/internal/registerWorker.d.ts.map +0 -1
  150. package/dist/server/internal/registerWorker.js.map +0 -1
  151. package/dist/server/internal/scheduleDefinition.d.ts +0 -3
  152. package/dist/server/internal/scheduleDefinition.d.ts.map +0 -1
  153. package/dist/server/internal/scheduleDefinition.js.map +0 -1
  154. /package/dist/server/{internal → adapters}/runSchemaPlan.d.ts +0 -0
  155. /package/dist/server/{internal → adapters}/runSchemaPlan.js +0 -0
  156. /package/dist/server/{internal → adapters}/schemaIndexBuilds.d.ts +0 -0
  157. /package/dist/server/{internal → adapters}/schemaIndexBuilds.js +0 -0
  158. /package/dist/server/{internal → adapters}/testingExpirations.d.ts +0 -0
  159. /package/dist/server/{internal → adapters}/testingExpirations.js +0 -0
  160. /package/dist/server/{internal → adapters}/transactionDb.d.ts +0 -0
  161. /package/dist/server/{internal → adapters}/transactionDb.js +0 -0
  162. /package/src/server/{internal → adapters}/runSchemaPlan.ts +0 -0
  163. /package/src/server/{internal → adapters}/schemaIndexBuilds.ts +0 -0
  164. /package/src/server/{internal → adapters}/testingExpirations.ts +0 -0
  165. /package/src/server/{internal → adapters}/transactionDb.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.0 - 2026-10-31
4
+
5
+ ### Added
6
+
7
+ - Jobs Layers accept `retired` queue names, deleting their queues and schedules before registering current workers once the database release is active. Dead-letter queues remain unless explicitly retired. Custom clients can expose native `deleteQueue` and `unschedule` capabilities.
8
+ - Jobs health accepts explicit queue names. Jobs admin pages use their declared names for health and accept a browser-safe `{ name }` entry for schedules registered only by a worker, with null payloads for their runs.
9
+
10
+ ## 0.26.0 - 2026-10-31
11
+
12
+ ### Added
13
+
14
+ - Jobs dead-letter entries and admin Jobs RPC responses carry `sourceQueue`, the name of the original queue.
15
+ - The testing controller's `untilJob(queue, id, state)` waits on the controller's change signal until a job reaches a state and returns it with its data decoded through the queue's Schema.
16
+ - The testing controller's `fetchesPass(queue, n)` completes once `n` worker fetches on the queue that began after the wait have finished, so a story can show a job stayed untaken without sleeping.
17
+ - Both waits give up after `within` (default 20 seconds of wall time, unaffected by a `TestClock`) with `PgBossWaitError`, whose message names what the wait expected and what it last saw.
18
+ - Jobs encode and decode durable payloads through Effect's JSON codec, so native `Schema.Redacted` fields reach workers with their real values.
19
+
20
+ ### Changed
21
+
22
+ - The testing controller's `waitForChange` also wakes after each worker fetch that claims nothing, so a kit waiting on it re-reads once per poll.
23
+ - Generated starters import schedule definitions and the default queue client factory from their defining modules.
24
+
25
+ ### Fixed
26
+
27
+ - Report ambient runtime workarounds in core code: runners over Clock, Config and Random, unsafe clock reads, cryptographic randomness, performance time, process state and scheduling. Entry points, tool configs, adapters and test-support retain their boundary role for these checks.
28
+ - Run pg-boss callbacks through adapters that capture the worker Layer's Effect context, preserving application services in job handlers.
29
+ - Keep a claimed job running until its translated expiry deadline when the host timer wakes early, including deadlines with fractional milliseconds from PostgreSQL.
30
+ - Successful jobs clear their dead-letter copies in the completion transaction. Copies of unretried jobs and failed retries remain listed. Schema installation also clears copies whose retained source already completed.
31
+ - Job inspection and worker logs mask native `Redacted` values and fields recognized by the errors package's sensitive-key policy. The admin Jobs page carries masked inspection data over RPC without re-encoding it through the payload schema.
32
+ - Report exported type aliases of imports, value aliases with `typeof` annotations or local const chains, object facades and unchanged forwarding functions, with repairs naming their defining modules. Keep wrappers that transform inputs, add steps, supply defaults or declare overloads.
33
+
34
+ ### Breaking
35
+
36
+ - Repositories upgrading Quality must repair the newly reported ambient access or record existing adoption debt with `quality baseline write --rule biome/plugin`, then lower it as repairs land.
37
+ - `createApp` reads secret bytes from Effect's Crypto service. Applications embedding this Effect must provide `Crypto.Crypto`, for example with `NodeServices.layer` or `NodeCrypto.layer` from `@effect/platform-node`. The create-app command already provides it.
38
+ - The pg-boss testing-expiration bridge moved from `@shivaedev/jobs/server/internal/testingExpirations.ts` to `@shivaedev/jobs/server/adapters/testingExpirations.ts`. Consumers importing that internal path must import the adapter path instead.
39
+ - Consumers constructing `DeadLetteredJob` values or admin dead-letter responses must supply `sourceQueue`. Applications using `migrate: false` must run `installPgBossSchema` during upgrade to install the completion trigger.
40
+ - Jobs `getJob`, `failedJobs` and `deadLetteredJobs`, and admin Jobs RPC results, now return masked `data: unknown` instead of a typed worker payload. Consumers must treat this as diagnostic data and narrow it before reading fields; obtain operational payloads in queue handlers. Admin RPC no longer applies the queue's payload encoding or requires its encoding services for results.
41
+ - Quality: the gate now rejects imported second names even when they use type aliases, value annotations, object facades or forwarding functions. Import from the defining module and remove the second name; existing facade debt can be recorded at adoption. Import `USAGE` from `cli/messages.ts` instead of `cli/args.ts`.
42
+ - Jobs: import `defaultClientFactory` from `@shivaedev/jobs/server/defaultClientFactory.ts` instead of `server/client.ts`. Import `defineSchedule` from `@shivaedev/jobs/server/defineSchedule.ts` instead of `server/definition.ts`. The removed `server/internal/nativeClient.ts` and `server/internal/scheduleDefinition.ts` exports migrate to those same modules as `defaultClientFactory` and `defineSchedule`. The default factory now exposes its native pg-boss return type; type custom factory mocks against `PgBossClient` or `PgBossClientFactory` from `server/client.ts`.
43
+ - React: import `resumeSignal`, `ResumeOptions`, `ResumeSource` and `ResumeWindow` from `@shivaedev/contract/resume.ts`; `@shivaedev/react/resumeSignal.ts` is removed.
44
+ - Work Board: import `Identity` from `path/Identity.ts`, view state helpers from `browser/views/state.ts`, `isMarkdown` from `path/isMarkdown.ts`, and `processes` from `server/processOwnership.ts`. The forwarding `server/views/state.ts` and `server/integration/processes.ts` modules are removed. Replace the removed `attention` facade with imports of `managedRequestReceipt` from `server/attention/managedRequestReceipt.ts`, `attentionProjection` from `server/attention/projection.ts`, and `RequestReceipt` from `attention/RequestReceipt.ts`. Replace the removed `publication` facade with direct imports from `server/responses/publicationDirectory.ts`. Import `Changes` from `server/files/changes.ts`, `MarkdownFile` from `server/files/list.ts`, `Snapshot` from `server/search/snapshot.ts`, metadata document/model/diagnostic/parsed types from `integration/metadata.ts`, `InboxProjection` from `browser/views/schema.ts` instead of `AttentionProjection`, `SourceFailure` from `diagnostics/source.ts`, and `WorkspaceOptions` from `server/workspace.ts` instead of the integration facades. Metadata types are also removed from `server/metadata/model.ts` and `server/metadata/parse.ts`; import them from `integration/metadata.ts`.
45
+ - Work Fleet: import `WAIT_EXIT`, `WaitState`, `WaitOutcome` and `settled` from `host/waitOutcome.ts` instead of `host/wait.ts`; import `fleetRecords` from `fleetRecords.ts` instead of `operations.ts`.
46
+
3
47
  ## 0.25.0 - 2026-10-31
4
48
 
5
49
  ### Fixed
package/README.md CHANGED
@@ -50,7 +50,8 @@ export const queueNames = [emailQueue.name, cleanupSchedule.name] as const;
50
50
  The client imports `queueNames` for its queue filter, or passes `emailQueue` to the admin jobs page. Server definitions reference the same declarations:
51
51
 
52
52
  ```ts
53
- import { defineQueue, defineSchedule } from "@shivaedev/jobs/server/definition.ts";
53
+ import { defineQueue } from "@shivaedev/jobs/server/definition.ts";
54
+ import { defineSchedule } from "@shivaedev/jobs/server/defineSchedule.ts";
54
55
  import { makePgBoss } from "@shivaedev/jobs/server/service.ts";
55
56
  import { cleanupSchedule, emailQueue, queueNames } from "./queues.ts";
56
57
 
@@ -69,7 +70,7 @@ For an application on the app host of `@shivaedev/server`, register `pgBossSchem
69
70
 
70
71
  ```ts
71
72
  import { pgBossSchema } from "@shivaedev/jobs/server/schema.ts";
72
- import { appDatabase } from "@shivaedev/server/appHost.ts";
73
+ import { appDatabase } from "@shivaedev/server/appDatabase.ts";
73
74
 
74
75
  const database = appDatabase({
75
76
  migrations: {
@@ -80,7 +81,7 @@ const database = appDatabase({
80
81
  });
81
82
  ```
82
83
 
83
- The component uses `installPgBossSchema` as its only install and upgrade path. It is pending when the schema is missing or its stored version is below the installed pg-boss package's required schema version; the readiness error names the schema and both versions (`missing` for an absent version). Start every producer and worker with the same schema and `migrate: false`. Use host mode `"wait"` for services that must wait for a deployment's migration process; no additional jobs-layer wait is needed.
84
+ The component uses `installPgBossSchema` as its only install and upgrade path. It is pending when the schema is missing, its stored version is below the installed pg-boss package's required schema version, or its dead-letter resolution trigger is missing. Version errors name the schema and both versions (`missing` for an absent version); a missing trigger is named in its error. Start every producer and worker with the same schema and `migrate: false`. Use host mode `"wait"` for services that must wait for a deployment's migration process; no additional jobs-layer wait is needed.
84
85
 
85
86
  With server's `appDatabase({ migrations: { mode: "wait", release, ... } })`, each jobs Layer automatically reads sql's optional `WorkerRelease` Context service. When the database belongs to another release, it calls pg-boss `offWork` for every registered worker queue, lets active jobs finish, logs `Workers paused for another database release` once, and idles. Producers and enqueueing continue. When its release owns the marker again and old workers have drained, it registers workers through the normal path and logs `Workers resumed for database release`. Equality permits rollbacks; no version ordering or payload compatibility policy is added. Without that service, the Layer registers its workers at startup and never pauses them.
86
87
 
@@ -129,7 +130,8 @@ export const MailLive = Mail.layer;
129
130
  Define the feature's registrations in `jobs.ts`:
130
131
 
131
132
  ```ts
132
- import { defineQueue, defineSchedule } from "@shivaedev/jobs/server/definition.ts";
133
+ import { defineQueue } from "@shivaedev/jobs/server/definition.ts";
134
+ import { defineSchedule } from "@shivaedev/jobs/server/defineSchedule.ts";
133
135
  import { Effect, Schema } from "effect";
134
136
  import { Mail } from "./services.ts";
135
137
 
@@ -163,6 +165,18 @@ Only a Layer whose `jobs` list contains a schedule registration such as `cleanup
163
165
 
164
166
  The Layer requires the workers' Effect services. Leaving `Mail` unprovided leaves that requirement in the resulting Effect's type. A primitive Schema such as `Schema.String` is rejected as a queue definition because the durable contract must be an object.
165
167
 
168
+ ### Retire queues and schedules
169
+
170
+ Declare obsolete queue names in the worker Layer:
171
+
172
+ ```ts
173
+ const live = Jobs.layer({ jobs: [sendEmailWorker, cleanupWorker], retired: ["old-mail", "old-cleanup"] });
174
+ ```
175
+
176
+ Startup stops local workers for each retired name and deletes its queue through pg-boss, including its schedules and queued jobs, before registering current workers. Missing queues can be retired again on subsequent starts. With `WorkerRelease`, retirement waits until this deployment holds the database release, including Layers with no current jobs. Names still registered by the Layer, and their dead-letter queue names, are rejected before any deletion.
177
+
178
+ Dead-letter queues remain unless explicitly included in `retired`; list a source queue before its dead-letter queue when retiring both. Put retirement in the worker deployment that owns those queues and remove the old registrations from other running deployments. Custom clients need the native `deleteQueue` capability for retirement; `PgBossClient` also exposes optional native `unschedule` for removing a single schedule while keeping its queue.
179
+
166
180
  ### Backlog throughput and concurrency
167
181
 
168
182
  Queue and schedule workers default to `batchSize: 10` and `burstWhenBatchFull: true`. pg-boss fetches again immediately after a full batch completes, until a fetch returns fewer than ten jobs. The adapter runs handlers sequentially within each batch, and pg-boss defaults `localConcurrency` to one. Set native `localConcurrency` to run multiple batches at once:
@@ -350,6 +364,8 @@ export const readJobCounts = Effect.gen(function* () {
350
364
 
351
365
  `health` exposes pg-boss cached queue counts as data. It stays cheap and follows the pg-boss monitor interval; it does not establish that a queue has just drained. Its total fields include the registered queue's active, failed, queued and ready counts, plus the dead-letter queue's queued count. Decide in the application which values affect an HTTP health response or an alert.
352
366
 
367
+ `health([{ name: "cleanup-mail" }])` reads only the supplied queues, in order, even when another runtime registered them. Omitting the argument keeps the Layer's registered names. Admin pages use this to include worker-only schedules without registering those schedules in the request runtime.
368
+
353
369
  ### Read live counts and retry a job
354
370
 
355
371
  ```ts
@@ -371,7 +387,7 @@ export const inspectEmail = (id: string) =>
371
387
 
372
388
  `counts(queue)` reads the job table directly on each call. `queuedCount` includes created and retry-waiting jobs, including future jobs; `activeCount` counts running jobs, `failedCount` counts retained failures, and `totalCount` includes retained terminal jobs. A queue has drained when queued and active counts are both zero. These counts are a snapshot, so a producer can enqueue more work after the query returns.
373
389
 
374
- `getJob(queue, id)` returns `None` when the ID is absent, or `Some` pg-boss job metadata with `data` decoded by the queue's Schema. Invalid stored data fails with `PgBossPayloadError`, and the Effect requires the Schema's decoding services. `retry(queue, id)` reuses the original ID: it makes a failed job eligible for another attempt and pulls a retry-waiting job forward to run now. Missing IDs and jobs in other states are left unchanged. It does not remove an earlier copy from the dead-letter queue.
390
+ `getJob(queue, id)` returns `None` when the ID is absent, or `Some` pg-boss job metadata with masked inspection `data: unknown`. The queue's Schema decodes the stored payload before the errors package's redactor masks native `Redacted` values and sensitive keys, including nested objects and arrays. Invalid stored data fails with `PgBossPayloadError`, and the Effect requires the Schema's decoding services. `retry(queue, id)` reuses the original ID: it makes a failed job eligible for another attempt and pulls a retry-waiting job forward to run now. Missing IDs and jobs in other states are left unchanged. Its dead-letter copies stay listed while the retry is pending or fails again; a successful completion removes those copies in the same database transaction.
375
391
 
376
392
  ### List failed and dead-lettered jobs
377
393
 
@@ -387,19 +403,19 @@ export const failedEmails = (cursor?: string) =>
387
403
  const deadLettered = yield* jobs.deadLetteredJobs(SendEmail, { limit: 20 });
388
404
  return {
389
405
  deadLettered: deadLettered.jobs.map((job) => ({ id: job.id, original: Option.getOrNull(job.sourceId), error: job.sourceOutput })),
390
- failed: failed.jobs.map((job) => ({ id: job.id, attempt: job.attempt, error: job.output, userId: job.data.userId })),
406
+ failed: failed.jobs.map((job) => ({ id: job.id, attempt: job.attempt, error: job.output, data: job.data })),
391
407
  next: Option.getOrUndefined(failed.next),
392
408
  };
393
409
  });
394
410
  ```
395
411
 
396
- `health` and `counts` say how many jobs failed; these two listings say which ones and why. `failedJobs(queue, options)` lists the queue's jobs in the `failed` state, the ones that used up their retries. `deadLetteredJobs(queue, options)` lists every job in the queue's dead-letter queue. Dead-letter entries live in the `-dlq` queue: each is a new job with its own ID that pg-boss copied there when the original failed for good. Both listings read pg-boss's `job` table on each call, through the jobs Layer's own pg-boss connection and in its configured schema, so applications never query pg-boss tables themselves. A custom client needs the native `getDb` capability for them.
412
+ `health` and `counts` say how many jobs failed; these two listings say which ones and why. `failedJobs(queue, options)` lists the queue's jobs in the `failed` state, the ones that used up their retries. `deadLetteredJobs(queue, options)` lists every job in the queue's dead-letter queue. Dead-letter entries live in the `-dlq` queue: each is a new job with its own ID that pg-boss copied there when the original failed for good. Both listings read pg-boss's `job` table on each call, through the jobs Layer's own pg-boss connection and in its configured schema, so applications never query pg-boss tables themselves. A custom client needs the native `getDb` capability for them. Automatic migration and `installPgBossSchema` install the completion trigger that clears resolved copies, including copies whose retained source already completed. Applications using `migrate: false` must run `installPgBossSchema` when upgrading.
397
413
 
398
414
  Each page holds at most `limit` jobs, newest first by creation time; a dead-letter copy is created when its original fails for good. `limit` must be a positive integer. When more jobs remain, `next` is `Some` opaque cursor; pass it back as `cursor` for the following page, and stop when `next` is `None`. Paging continues from the last job it returned, so jobs that fail while you page appear in a fresh listing instead of shifting later pages, and no job appears twice. A malformed cursor or limit fails with `SchemaError` before pg-boss is called.
399
415
 
400
- An entry carries the job's `id`, `queue`, native `state`, `retryCount`, `retryLimit` and `attempt`, the one-based number of its last started attempt (zero for a job that never started). `createdOn` is a UTC `DateTime`; `startedOn` and `completedOn` are `Option`s of UTC `DateTime`s. `output` is `JobFailure | null`, decoded through `JobFailure` from `@shivaedev/jobs/JobFailure.ts`. Handler failures store only `{ _tag: string, message: string }`, with the message redacted through `@shivaedev/errors`; stack traces, cause chains and other error fields are omitted. `null` means pg-boss stored no output. Native pg-boss failures without a tag decode with `_tag: "Error"`; decoding also redacts messages from older stored failures. Stored output that does not match the Schema fails the listing with `PgBossPayloadError`. `data` is decoded by the queue's Schema, including traced payloads; invalid stored data fails the listing with `PgBossPayloadError`, as `getJob` does, and the Effect requires the Schema's decoding services. A dead-letter entry adds `sourceId`, the original job's ID as an `Option`, and `sourceOutput`, the original's decoded `JobFailure | null`. The copy has not run, so its own `output` stays `null` and its `attempt` is zero.
416
+ An entry carries the job's `id`, `queue`, native `state`, `retryCount`, `retryLimit` and `attempt`, the one-based number of its last started attempt (zero for a job that never started). `createdOn` is a UTC `DateTime`; `startedOn` and `completedOn` are `Option`s of UTC `DateTime`s. `output` is `JobFailure | null`, decoded through `JobFailure` from `@shivaedev/jobs/JobFailure.ts`. Handler failures store only `{ _tag: string, message: string }`, with the message redacted through `@shivaedev/errors`; stack traces, cause chains and other error fields are omitted. `null` means pg-boss stored no output. Native pg-boss failures without a tag decode with `_tag: "Error"`; decoding also redacts messages from older stored failures. Stored output that does not match the Schema fails the listing with `PgBossPayloadError`. `data: unknown` is decoded by the queue's JSON codec and masked through the errors package's redactor, including traced payloads; invalid stored data fails the listing with `PgBossPayloadError`, as `getJob` does, and the Effect requires the Schema's decoding services. A dead-letter entry adds `sourceQueue`, the source queue name without the dead-letter suffix, `sourceId`, the original job's ID as an `Option`, and `sourceOutput`, the original's decoded `JobFailure | null`. The copy has not run, so its own `output` stays `null` and its `attempt` is zero.
401
417
 
402
- Pass a failed entry's `id` to `retry(queue, id)` to run that job again under its original ID; once it completes it leaves the failed listing. Dead-letter IDs belong to the `-dlq` queue, so `retry(queue, id)` does not find them and leaves them unchanged.
418
+ Pass a failed entry's `id` to `retry(queue, id)` to run that job again under its original ID; once it completes it leaves the failed listing and its copies leave the dead-letter listing. Dead-letter IDs belong to the `-dlq` queue, so `retry(queue, id)` does not find them and leaves them unchanged.
403
419
 
404
420
  ### Queue settings on startup
405
421
 
@@ -517,20 +533,29 @@ Set `retryPolicy: testRetryPolicy` through the controller to override queue and
517
533
 
518
534
  A kit can also capture `revision` before reading jobs and yield `waitForChange(revision)` when its condition is unmet. The wait resumes after a local send, settlement or worker fetch, and when a local worker returns to idle as `waitForIdle` defines it, including terminal native worker timeouts. It also resumes immediately if a change occurred between the read and the wait. This signal observes the controller's client; external clients, future scheduled work and external database writes need their own wake source. Stories should retain a bounded test timeout.
519
535
 
536
+ `untilJob(queue, id, state)` waits that way for one job: it reads the job, waits for the next change when the job is in another state, and returns the job with `data` decoded through the queue's Schema once it reaches `state`. `fetchesPass(queue, n)` completes once `n` worker fetches on the queue that began after the wait started have finished, whether or not they claimed anything, so a story can show that a job stayed untaken by fetches that could have claimed it. Each fetch also counts as a change for `waitForChange`. Both waits give up after `within` (default 20 seconds) of wall time, which a story's `TestClock` does not move, and fail with `PgBossWaitError`, whose message names what the wait expected and what it last saw:
537
+
538
+ ```ts
539
+ yield* testing.untilJob(SendEmail, id, "completed", { within: "5 seconds" });
540
+ // Gave up after 5s waiting until job <id> in send-email is completed; last seen: retry
541
+ ```
542
+
520
543
  ### API
521
544
 
522
545
  Import the module that defines the name; the package has no root entry.
523
546
 
524
- | Module | Public names |
525
- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
526
- | `@shivaedev/jobs/server/definition.ts` | `defineQueue`, `defineSchedule`, `jobContext`, `RetryAt`; `DefineQueueOptions`, `DefineScheduleOptions`, `JobContext`, `JobPayloadSchema`, `JobRegistration`, `QueueDefinition`, `QueueOptions`, `QueuePolicy`, `QueueWorker`, `RegistrationRequirements`, `ScheduleDefinition`, `ScheduledWorker` |
527
- | `@shivaedev/jobs/server/service.ts` | `makePgBoss`, `pgBossLayer`; `PgBossDefinition`, `PgBossLayerOptions`, `PgBossOptions`, `PgBossService` |
528
- | `@shivaedev/jobs/server/PgBoss.ts` | `PgBoss`: the shared client Context service. |
529
- | `@shivaedev/jobs/server/schema.ts` | `installPgBossSchema`, `pgBossSchema`; `PgBossSchemaOptions` |
530
- | `@shivaedev/jobs/server/health.ts` | `deadLetterQueueName`; `DeadLetteredJob`, `JobPage`, `JobPageOptions`, `JobsHealth`, `ListedJob`, `QueueCounts`, `QueueHealth` |
531
- | `@shivaedev/jobs/server/error.ts` | `PgBossError`, `PgBossPayloadError`, `PgBossQueueNamesError`, `PgBossQueueOptionsError`, `PgBossClientOptionsError`, `PgBossTestingError`, `toPgBossError`; `PgBossOperation` |
532
- | `@shivaedev/jobs/server/client.ts` | `defaultClientFactory`; `PgBossClient`, `PgBossClientFactory` |
533
- | `@shivaedev/jobs/server/testing.ts` | `makePgBossTesting`, `testRetryPolicy`; `PgBossTesting`, `PgBossTestingOptions`, `SnapshotQueue`, `UnfinishedJob` |
547
+ | Module | Public names |
548
+ | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
549
+ | `@shivaedev/jobs/server/definition.ts` | `defineQueue`, `jobContext`, `RetryAt`; `DefineQueueOptions`, `DefineScheduleOptions`, `JobContext`, `JobPayloadSchema`, `JobRegistration`, `QueueDefinition`, `QueueOptions`, `QueuePolicy`, `QueueWorker`, `RegistrationRequirements`, `ScheduleDefinition`, `ScheduledWorker` |
550
+ | `@shivaedev/jobs/server/service.ts` | `makePgBoss`, `pgBossLayer`; `PgBossDefinition`, `PgBossLayerOptions`, `PgBossOptions`, `PgBossService` |
551
+ | `@shivaedev/jobs/server/PgBoss.ts` | `PgBoss`: the shared client Context service. |
552
+ | `@shivaedev/jobs/server/schema.ts` | `installPgBossSchema`, `pgBossSchema`; `PgBossSchemaOptions` |
553
+ | `@shivaedev/jobs/server/health.ts` | `deadLetterQueueName`; `DeadLetteredJob`, `JobPage`, `JobPageOptions`, `JobsHealth`, `ListedJob`, `QueueCounts`, `QueueHealth` |
554
+ | `@shivaedev/jobs/server/error.ts` | `PgBossError`, `PgBossPayloadError`, `PgBossQueueNamesError`, `PgBossQueueOptionsError`, `PgBossClientOptionsError`, `PgBossTestingError`, `PgBossWaitError`, `toPgBossError`; `PgBossOperation` |
555
+ | `@shivaedev/jobs/server/client.ts` | `PgBossClient`, `PgBossClientFactory` |
556
+ | `@shivaedev/jobs/server/testing.ts` | `makePgBossTesting`, `testRetryPolicy`; `PgBossTesting`, `PgBossTestingOptions`, `PgBossTestingWaitOptions`, `SnapshotQueue`, `UnfinishedJob` |
557
+ | `@shivaedev/jobs/server/defineSchedule.ts` | `defineSchedule` |
558
+ | `@shivaedev/jobs/server/defaultClientFactory.ts` | `defaultClientFactory` |
534
559
 
535
560
  The definition options keep the pg-boss names: `queue` uses `QueueOptions` (`Queue` except `name` and `deadLetter`, with literal `QueuePolicy` values and `maxDeferrals`), `worker` uses `WorkOptions`, and a schedule's `schedule` uses `ScheduleOptions`. A queue also requires `name` and `schema`; a schedule requires `name` and `cron`.
536
561
 
@@ -553,3 +578,17 @@ The package requires Node.js 24 or later and PostgreSQL. `effect` and `pg-boss`
553
578
  `connectionString` configures pg-boss's own `pg` Pool, separately from the application's Effect SQL pool, and pg-boss's driver decides how its `sslmode` behaves. Set the TLS mode in that URL; the [framework database connection security guide](https://github.com/ShivaeDev/platform/blob/main/docs/framework/quickstart.md#database-connection-security) compares the drivers and the application's connection paths.
554
579
 
555
580
  Provide the database connection and job registrations at the application runtime boundary. Application services own the domain work and provider calls; pg-boss owns queue execution. When `SqlClient` is provided and a SQL transaction is active, `enqueue` uses pg-boss’s per-call `db` option on that transaction’s connection. The application write and queued jobs commit or roll back together. The jobs client and SQL client must use the same PostgreSQL database. Outside a transaction, enqueueing keeps using the jobs client as usual. To keep enqueueing independent of an application transaction, move it after the transaction returns and handle its failure separately.
581
+
582
+ ### Secret payload fields
583
+
584
+ Use native `Schema.Redacted` or `Schema.RedactedFromValue` for fields such as one-time links. Jobs uses Effect's JSON codec at the durable boundary, so PostgreSQL stores the real value and the worker receives a `Redacted` value it can unwrap with `Redacted.value`. This masks inspection data; it does not encrypt queue storage.
585
+
586
+ ```ts
587
+ const Confirmation = defineQueue({
588
+ name: "confirmation",
589
+ schema: Schema.Struct({ href: Schema.Redacted(Schema.String) }),
590
+ });
591
+ const sendConfirmation = Confirmation.handle(({ href }) => sendMail(Redacted.value(href)));
592
+ ```
593
+
594
+ `getJob`, `failedJobs` and `deadLetteredJobs` expose masked diagnostic data, without recoverable `Redacted` wrappers. Worker log messages and annotations use the errors package's redaction policy too. Keep secrets wrapped when logging or constructing errors; unwrapping a value into arbitrary text removes its sensitivity marker. The existing errors redactor bounds diagnostic depth, collection size and text length.
@@ -0,0 +1,3 @@
1
+ import { Effect } from "effect";
2
+ export declare const clientErrorReporter: <R>(report: (error: Error) => Effect.Effect<unknown, never, R>) => Effect.Effect<(error: Error) => void, never, R>;
3
+ //# sourceMappingURL=clientErrorReporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientErrorReporter.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/clientErrorReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,mBAAmB,GAAgC,CAAC,kBAAkB,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,2BAE7G,KAAK,KAAG,IAAI,WAG1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Effect } from "effect";
2
+ export const clientErrorReporter = Effect.fnUntraced(function* (report) {
3
+ const run = Effect.runPromiseWith(yield* Effect.context());
4
+ return (error) => {
5
+ void run(Effect.exit(report(error)));
6
+ };
7
+ });
8
+ //# sourceMappingURL=clientErrorReporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientErrorReporter.js","sourceRoot":"","sources":["../../../src/server/adapters/clientErrorReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAK,MAA0D;IAC5H,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAY,EAAQ,EAAE;QAC7B,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { SqlClient } from "effect/sql";
3
+ import type { PgBossSchemaOptions } from "#schema.ts";
4
+ export declare const installSchema: (options: PgBossSchemaOptions) => Effect.Effect<void, unknown, import("effect/Scope").Scope | SqlClient.SqlClient>;
5
+ //# sourceMappingURL=installSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installSchema.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/installSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA+CtD,eAAO,MAAM,aAAa,oHAcxB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { SqlClient } from "effect/sql";
3
+ import { getConstructionPlans, getMigrationPlans, PgBoss } from "pg-boss";
4
+ import pgBossPackage from "pg-boss/package.json" with { type: "json" };
5
+ import { jobStorePlans } from "#internal/jobStorePlans.ts";
6
+ import { runSchemaPlan } from "./runSchemaPlan.js";
7
+ import { resumeSchemaIndexes } from "./schemaIndexBuilds.js";
8
+ const Partitions = Schema.Array(Schema.Struct({
9
+ policy: Schema.String,
10
+ tableName: Schema.String,
11
+ }));
12
+ async function installNativeSchema(connection, options, run) {
13
+ const schema = options.schema ?? "pgboss";
14
+ const construction = getConstructionPlans(schema);
15
+ const client = new PgBoss({
16
+ db: { executeSql: async (text, values = []) => ({ rows: Array.from(await run(connection.executeUnprepared(text, values, undefined))) }) },
17
+ schema,
18
+ });
19
+ if (!(await client.isInstalled())) {
20
+ await runSchemaPlan(connection, construction, run);
21
+ return;
22
+ }
23
+ const version = await client.schemaVersion();
24
+ if (version === null) {
25
+ throw new Error("The pg-boss version table is empty");
26
+ }
27
+ if (version > pgBossPackage.pgboss.schema) {
28
+ return;
29
+ }
30
+ if (version >= 27) {
31
+ await resumeSchemaIndexes(client, schema);
32
+ }
33
+ if (version < pgBossPackage.pgboss.schema) {
34
+ const partitionTables = Schema.decodeUnknownSync(Partitions)(await run(connection.executeUnprepared(`SELECT table_name AS "tableName", policy FROM ${schema}.queue WHERE partition = true`, [], undefined)));
35
+ await runSchemaPlan(connection, getMigrationPlans(schema, version, { partitionTables: Array.from(partitionTables) }), run, {
36
+ schema,
37
+ version: pgBossPackage.pgboss.schema,
38
+ });
39
+ await resumeSchemaIndexes(client, schema);
40
+ }
41
+ }
42
+ export const installSchema = Effect.fnUntraced(function* (options) {
43
+ const sql = yield* SqlClient.SqlClient;
44
+ const connection = yield* sql.reserve;
45
+ const run = Effect.runPromiseWith(yield* Effect.context());
46
+ yield* Effect.tryPromise({
47
+ catch: (error) => error,
48
+ try: async (signal) => {
49
+ const execute = (effect) => run(effect, { signal });
50
+ await installNativeSchema(connection, options, execute);
51
+ },
52
+ });
53
+ for (const plan of jobStorePlans(options.schema ?? "pgboss")) {
54
+ yield* connection.executeRaw(plan, []);
55
+ }
56
+ });
57
+ //# sourceMappingURL=installSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installSchema.js","sourceRoot":"","sources":["../../../src/server/adapters/installSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,aAAa,MAAM,sBAAsB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAC9B,MAAM,CAAC,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,SAAS,EAAE,MA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,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;AACF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect, Scope } from "effect";
2
+ import type { Job, WorkOptions } from "pg-boss";
3
+ import type { PgBossClient } from "#client.ts";
4
+ export declare const registerWorker: <R>(client: PgBossClient, name: string, options: WorkOptions, run: (job: Job<unknown>, deadline: number) => Effect.Effect<unknown, unknown, R>, scope: Scope.Scope, schema: string, maxDeferrals: number, graceful: boolean) => Effect.Effect<string, import("#error.ts").PgBossError, R>;
5
+ //# sourceMappingURL=registerWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerWorker.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/registerWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/C,eAAO,MAAM,cAAc,GAAgC,CAAC,uEAIhD,GAAG,CAAC,OAAO,CAAC,YAAY,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,2IAkC/E,CAAC"}
@@ -4,10 +4,11 @@ import { batchHandler } from "#internal/batchHandler.ts";
4
4
  import { deferrableAttempt } from "#internal/deferrableAttempt.ts";
5
5
  import { retryWake } from "#internal/retryWake.ts";
6
6
  import { traceJob } from "#internal/tracing.ts";
7
- export const registerWorker = Effect.fnUntraced(function* (client, name, options, run, scope, schema, maxDeferrals, context, execute, graceful) {
7
+ export const registerWorker = Effect.fnUntraced(function* (client, name, options, run, scope, schema, maxDeferrals, graceful) {
8
+ const execute = Effect.runPromiseWith(yield* Effect.context());
8
9
  const fibers = yield* Scope.fork(scope);
9
10
  function runJob(job, deadline) {
10
- return Effect.provide(traceJob(deferrableAttempt(run(job, deadline), client, schema, job, maxDeferrals), job, name), context);
11
+ return traceJob(deferrableAttempt(run(job, deadline), client, schema, job, maxDeferrals), job, name);
11
12
  }
12
13
  function afterFailure(attempt) {
13
14
  return retryWake(client, name, attempt.id, registration).pipe(Effect.forkIn(fibers), Effect.asVoid);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerWorker.js","sourceRoot":"","sources":["../../../src/server/adapters/registerWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EACxD,MAAoB,EACpB,IAAY,EACZ,OAAoB,EACpB,GAAgF,EAChF,KAAkB,EAClB,MAAc,EACd,YAAoB,EACpB,QAAiB;IAEjB,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAK,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,SAAS,MAAM,CAAC,GAAiB,EAAE,QAAgB;QAClD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACtG,CAAC;IACD,SAAS,YAAY,CAAC,OAAqB;QAC1C,O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xB,KAAK,EACL,MAAM,CAAC,UAAU,CAAC;QACjB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;QACpD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KACvD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CACtC,CAAC;IACF,OAAO,EAAE,CAAC;AACX,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import type { PgBossClient } from "#client.ts";
3
+ import type { JobRegistration } from "#definition.ts";
4
+ export declare const retireJobs: (client: PgBossClient, jobs: readonly JobRegistration[], retired: readonly string[]) => Effect.Effect<void, import("#error.ts").PgBossError, never>;
5
+ //# sourceMappingURL=retireJobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retireJobs.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/retireJobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,eAAO,MAAM,UAAU,qJAsBrB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Effect } from "effect";
2
+ import { toPgBossError } from "#error.ts";
3
+ import { deadLetterQueueName } from "#health.ts";
4
+ import { registrationNames } from "#internal/register.ts";
5
+ export const retireJobs = Effect.fnUntraced(function* (client, jobs, retired) {
6
+ yield* Effect.try({
7
+ catch: (error) => toPgBossError("register", error),
8
+ try: () => {
9
+ const active = registrationNames(jobs).flatMap((name) => [name, deadLetterQueueName(name)]);
10
+ if (retired.some((name) => active.includes(name))) {
11
+ throw new TypeError("Retired queues must not be registered or used as dead-letter queues");
12
+ }
13
+ },
14
+ });
15
+ for (const name of retired) {
16
+ yield* Effect.tryPromise({
17
+ catch: (error) => toPgBossError("register", error, name),
18
+ try: async () => {
19
+ if (client.deleteQueue === undefined) {
20
+ throw new TypeError("This pg-boss client does not support deleteQueue");
21
+ }
22
+ await client.offWork(name);
23
+ await client.deleteQueue(name);
24
+ },
25
+ });
26
+ }
27
+ });
28
+ //# sourceMappingURL=retireJobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retireJobs.js","sourceRoot":"","sources":["../../../src/server/adapters/retireJobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAoB,EAAE,IAAgC,EAAE,OAA0B;IACxI,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;QACjB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC;QAClD,GAAG,EAAE,GAAG,EAAE;YACT,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5F,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACnD,MAAM,IAAI,SAAS,CAAC,qEAAqE,CAAC,CAAC;YAC5F,CAAC;QACF,CAAC;KACD,CAAC,CAAC;IACH,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;YACxB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC;YACxD,GAAG,EAAE,KAAK,IAAI,EAAE;gBACf,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;oBACtC,MAAM,IAAI,SAAS,CAAC,kDAAkD,CAAC,CAAC;gBACzE,CAAC;gBACD,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC3B,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runSchemaPlan.d.ts","sourceRoot":"","sources":["../../../src/server/internal/runSchemaPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,wBAAsB,aAAa,CAClC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC7D,OAAO,CAAC,IAAI,CAAC,CAsBf"}
1
+ {"version":3,"file":"runSchemaPlan.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/runSchemaPlan.ts"],"names":[],"mappings":"A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E,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBvF"}
1
+ {"version":3,"file":"schemaIndexBuilds.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/schemaIndexBuilds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAmBtC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAQzI;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaIndexBuilds.js","sourceRoot":"","sources":["../../../src/server/internal/schemaIndexBuilds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC/F,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAE/E,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C,SAAS,SAAS,CAAC,OAAe;IACjC,MAAM,KAAK,GACV,oIAAoI,CAAC,IAAI,CACxI,OAAO,CACP,CAAC;IACH,MAAM,IAAI,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC;IACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC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,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC9E,MAAM,EAAE,CAAC,UAAU,CAAC,qCAAqC,MAAM,KAAK,IAAI,GAAG,CAAC,CAAC;YAC9E,CAAC;QACF,CAAC;QACD,MAAM,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,EAAE,CAAC,UAAU,CAAC,UAAU,MAAM,+EAA+E,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAChI,CAAC;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"testingExpirations.d.ts","sourceRoot":"","sources":["../../../src/server/internal/testingExpirations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;IAG/C,WAAW,QAAQ,GAAG,CAAC,OAAO,CAAC;IAC/B,IAAI,OAAO,MAAM,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,WAAW,WAAW,YAAY,MAAM,GAAG,SAAS;EAwBvG"}
1
+ {"version":3,"file":"testingExpirations.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/testingExpirations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;IAG/C,WAAW,QAAQ,GAAG,CAAC,OAAO,CAAC;IAC/B,IAAI,OAAO,MAAM,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,WAAW,WAAW,YAAY,MAAM,GAAG,SAAS;EAwBvG"}
@@ -1 +1 @@
1
- {"version":3,"file":"testingExpirations.js","sourceRoot":"","sources":["../../../src/server/internal/testingExpirations.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAA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AAC,KAAK,EAAE,EAAE;gBACf,IAAI,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;oBAC5D,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACvB,CAAC;gBACD,OAAO,KAAK,CAAC;YACd,CAAC,CAAC,CAAC;YACJ,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAC7B,OAAO,OAAO,CAAC;QAChB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transactionDb.d.ts","sourceRoot":"","sources":["../../../src/server/internal/transactionDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAczD,CAAC"}
1
+ {"version":3,"file":"transactionDb.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/transactionDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAczD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transactionDb.js","sourceRoot":"","sources":["../../../src/server/internal/transactionDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,CAAC,MAAM,aAAa,GAAqC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClF,MAAM,GAAG,GAAG,K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,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC9E,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;IACvC,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAS,CAAC,CAAC;IAClE,OAAO;QACN,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;KACjI,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Effect } from "effect";
2
+ export declare function workerDiagnostics<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, Exclude<R, never>>;
3
+ //# sourceMappingURL=workerDiagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerDiagnostics.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/workerDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAsB,MAAM,QAAQ,CAAC;AAuB7D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,0CAIxE"}
@@ -0,0 +1,24 @@
1
+ import { Context, Effect, Logger, References } from "effect";
2
+ import { redact } from "@shivaedev/errors/redact.ts";
3
+ import { redactDiagnosticCause } from "@shivaedev/errors/redactCause.ts";
4
+ import { isSensitiveKey, REDACTED } from "@shivaedev/errors/sensitive.ts";
5
+ function maskedLogger(logger) {
6
+ return Logger.make((options) => {
7
+ const context = options.fiber.context;
8
+ const annotations = Object.fromEntries(Object.entries(options.fiber.getRef(References.CurrentLogAnnotations)).map(([key, value]) => [
9
+ key,
10
+ isSensitiveKey(key) ? REDACTED : redact(value),
11
+ ]));
12
+ options.fiber.setContext(Context.add(context, References.CurrentLogAnnotations, annotations));
13
+ try {
14
+ return logger.log({ ...options, cause: redactDiagnosticCause(options.cause), message: redact(options.message) });
15
+ }
16
+ finally {
17
+ options.fiber.setContext(context);
18
+ }
19
+ });
20
+ }
21
+ export function workerDiagnostics(effect) {
22
+ return Effect.flatMap(Logger.CurrentLoggers, (loggers) => Effect.provideService(effect, Logger.CurrentLoggers, new Set([...loggers].map(maskedLogger))));
23
+ }
24
+ //# sourceMappingURL=workerDiagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workerDiagnostics.js","sourceRoot":"","sources":["../../../src/server/adapters/workerDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,SAAS,YAAY,CAAC,MAAuC;IAC5D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CACrC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YAC5F,GAAG;YACH,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9C,CAAC,CACF,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,CAAC;QAC9F,IAAI,CAAC;YACJ,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAClH,CAAC;gBAAS,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAU,MAA8B;IACxE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,OAAO,EAAE,EAAE,CACxD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAC7F,CAAC;AACH,CAAC"}
@@ -2,6 +2,7 @@ import type { ConstructorOptions, FindJobsOptions, Job, JobWithMetadata, PgBoss,
2
2
  export interface PgBossClient {
3
3
  readonly complete?: PgBoss["complete"];
4
4
  readonly createQueue: (name: string, options?: Omit<Queue, "name">) => Promise<void>;
5
+ readonly deleteQueue?: PgBoss["deleteQueue"];
5
6
  readonly fail?: PgBoss["fail"];
6
7
  readonly findJobs?: (name: string, options?: FindJobsOptions) => Promise<readonly JobWithMetadata<unknown>[]>;
7
8
  readonly getDb?: PgBoss["getDb"];
@@ -16,10 +17,10 @@ export interface PgBossClient {
16
17
  readonly send: (name: string, data?: object | null, options?: SendOptions) => Promise<string | null>;
17
18
  readonly start: () => Promise<unknown>;
18
19
  readonly stop: (options?: StopOptions) => Promise<void>;
20
+ readonly unschedule?: PgBoss["unschedule"];
19
21
  readonly update?: PgBoss["update"];
20
22
  readonly updateQueue?: PgBoss["updateQueue"];
21
23
  readonly work: (name: string, options: WorkOptions, handler: (jobs: readonly Job<unknown>[]) => Promise<unknown>) => Promise<string>;
22
24
  }
23
25
  export type PgBossClientFactory = (options: ConstructorOptions) => PgBossClient;
24
- export declare const defaultClientFactory: PgBossClientFactory;
25
26
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/server/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,GAAG,EACH,eAAe,EACf,MAAM,EACN,KAAK,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,WAAW,EACX,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,SAAS,eAAe,CAAC,OAAO,CAAC,EA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W,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACrI;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,YAAY,CAAC"}
@@ -1,3 +1,2 @@
1
- import { nativeClient } from "#internal/nativeClient.ts";
2
- export const defaultClientFactory = nativeClient;
1
+ export {};
3
2
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/server/client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA0BzD,MAAM,CAAC,MAAM,oBAAoB,GAAwB,YAAY,CAAC"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/server/client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { type ConstructorOptions, PgBoss } from "pg-boss";
2
+ export declare function defaultClientFactory(options: ConstructorOptions): PgBoss;
3
+ //# sourceMappingURL=defaultClientFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultClientFactory.d.ts","sourceRoot":"","sources":["../../src/server/defaultClientFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE1D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,UA0B/D"}
@@ -1,6 +1,6 @@
1
1
  import { Socket } from "node:net";
2
2
  import { PgBoss } from "pg-boss";
3
- export function nativeClient(options) {
3
+ export function defaultClientFactory(options) {
4
4
  const disconnected = new Set();
5
5
  const config = {
6
6
  ...options,
@@ -25,4 +25,4 @@ export function nativeClient(options) {
25
25
  };
26
26
  return client;
27
27
  }
28
- //# sourceMappingURL=nativeClient.js.map
28
+ //# sourceMappingURL=defaultClientFactory.js.map