@shivaedev/effect-pg-boss 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +36 -5
- package/dist/server/error.d.ts +1 -1
- package/dist/server/error.d.ts.map +1 -1
- package/dist/server/error.js.map +1 -1
- package/dist/server/health.d.ts +27 -0
- package/dist/server/health.d.ts.map +1 -1
- package/dist/server/health.js.map +1 -1
- package/dist/server/internal/countsFor.d.ts.map +1 -1
- package/dist/server/internal/countsFor.js +3 -2
- package/dist/server/internal/countsFor.js.map +1 -1
- package/dist/server/internal/deferralStorePlan.d.ts.map +1 -1
- package/dist/server/internal/deferralStorePlan.js +3 -2
- package/dist/server/internal/deferralStorePlan.js.map +1 -1
- package/dist/server/internal/expireAttempt.d.ts.map +1 -1
- package/dist/server/internal/expireAttempt.js +2 -1
- package/dist/server/internal/expireAttempt.js.map +1 -1
- package/dist/server/internal/jobControl.d.ts.map +1 -1
- package/dist/server/internal/jobControl.js +4 -4
- package/dist/server/internal/jobControl.js.map +1 -1
- package/dist/server/internal/listJobs.d.ts +5 -0
- package/dist/server/internal/listJobs.d.ts.map +1 -0
- package/dist/server/internal/listJobs.js +69 -0
- package/dist/server/internal/listJobs.js.map +1 -0
- package/dist/server/internal/observeTestingSettlements.d.ts +1 -1
- package/dist/server/internal/observeTestingSettlements.d.ts.map +1 -1
- package/dist/server/internal/observeTestingSettlements.js +2 -2
- package/dist/server/internal/observeTestingSettlements.js.map +1 -1
- package/dist/server/internal/service.d.ts.map +1 -1
- package/dist/server/internal/service.js +3 -0
- package/dist/server/internal/service.js.map +1 -1
- package/dist/server/internal/settleDeferral.d.ts.map +1 -1
- package/dist/server/internal/settleDeferral.js +3 -2
- package/dist/server/internal/settleDeferral.js.map +1 -1
- package/dist/server/internal/storedRows.d.ts +6 -0
- package/dist/server/internal/storedRows.d.ts.map +1 -0
- package/dist/server/internal/storedRows.js +10 -0
- package/dist/server/internal/storedRows.js.map +1 -0
- package/dist/server/internal/testingClient.d.ts +2 -0
- package/dist/server/internal/testingClient.d.ts.map +1 -1
- package/dist/server/internal/testingClient.js +12 -1
- package/dist/server/internal/testingClient.js.map +1 -1
- package/dist/server/internal/testingDeferrals.d.ts.map +1 -1
- package/dist/server/internal/testingDeferrals.js +3 -2
- package/dist/server/internal/testingDeferrals.js.map +1 -1
- package/dist/server/internal/testingIdle.d.ts +16 -0
- package/dist/server/internal/testingIdle.d.ts.map +1 -0
- package/dist/server/internal/testingIdle.js +31 -0
- package/dist/server/internal/testingIdle.js.map +1 -0
- package/dist/server/internal/testingReadout.d.ts +2 -2
- package/dist/server/internal/testingReadout.d.ts.map +1 -1
- package/dist/server/internal/testingReadout.js +4 -4
- package/dist/server/internal/testingReadout.js.map +1 -1
- package/dist/server/internal/testingSignal.d.ts.map +1 -1
- package/dist/server/internal/testingSignal.js +4 -2
- package/dist/server/internal/testingSignal.js.map +1 -1
- package/dist/server/internal/testingSnapshot.d.ts +6 -0
- package/dist/server/internal/testingSnapshot.d.ts.map +1 -0
- package/dist/server/internal/testingSnapshot.js +32 -0
- package/dist/server/internal/testingSnapshot.js.map +1 -0
- package/dist/server/service.d.ts +3 -1
- package/dist/server/service.d.ts.map +1 -1
- package/dist/server/service.js.map +1 -1
- package/dist/server/testing.d.ts +14 -4
- package/dist/server/testing.d.ts.map +1 -1
- package/dist/server/testing.js +6 -0
- package/dist/server/testing.js.map +1 -1
- package/package.json +3 -3
- package/src/server/error.ts +12 -1
- package/src/server/health.ts +32 -0
- package/src/server/internal/countsFor.ts +3 -2
- package/src/server/internal/deferralStorePlan.ts +3 -2
- package/src/server/internal/expireAttempt.ts +2 -1
- package/src/server/internal/jobControl.ts +4 -7
- package/src/server/internal/listJobs.ts +98 -0
- package/src/server/internal/observeTestingSettlements.ts +2 -2
- package/src/server/internal/service.ts +3 -0
- package/src/server/internal/settleDeferral.ts +3 -2
- package/src/server/internal/storedRows.ts +17 -0
- package/src/server/internal/testingClient.ts +14 -1
- package/src/server/internal/testingDeferrals.ts +3 -2
- package/src/server/internal/testingIdle.ts +52 -0
- package/src/server/internal/testingReadout.ts +4 -11
- package/src/server/internal/testingSignal.ts +4 -2
- package/src/server/internal/testingSnapshot.ts +53 -0
- package/src/server/service.ts +9 -1
- package/src/server/testing.ts +18 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0 - 2026-10-19
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- The testing controller reads the unfinished jobs of several queues in one consistent snapshot with `snapshot(queues)`: created, retry, active and failed jobs with their queue, state, start-after time and decoded data, leaving completed jobs out and undecoded.
|
|
8
|
+
- The testing controller's `waitForIdle` completes when its local workers hold no job in flight and none of their queues has a job ready to fetch. Jobs that start later do not hold it open, and it reads nothing while a fetched batch is still running, so a story kit settles with one read per idle.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `waitForChange` no longer resumes at once when a waiter that a change resumed waits again in the same step; it waits for the next change.
|
|
13
|
+
|
|
14
|
+
## 0.14.0 - 2026-10-19
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- The jobs service lists a queue's failed jobs with `failedJobs(queue, { limit, cursor })` and the jobs in its dead-letter queue with `deadLetteredJobs(queue, { limit, cursor })`, newest first in pages with an opaque cursor. Each entry carries the job's ID, queue, state, attempt and retry counts, UTC times, the output pg-boss stored, and `data` decoded by the queue's Schema; invalid stored data fails with `PgBossPayloadError`. Dead-letter entries add the original job's ID and error. A failed entry's ID can be passed to `retry`.
|
|
19
|
+
|
|
3
20
|
## 0.13.0 - 2026-10-19
|
|
4
21
|
|
|
5
22
|
### Added
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ A **queue definition** names a pg-boss queue and the Schema of its payload. Appl
|
|
|
31
31
|
|
|
32
32
|
A **schedule definition** describes a queue with a cron trigger. `schedule.run(effect)` pairs it with an Effect that needs no payload. Queue workers and scheduled workers are **registrations**: the values you put in the jobs Layer's `jobs` list.
|
|
33
33
|
|
|
34
|
-
The application creates one jobs service with `makePgBoss(identifier)`. Its Layer starts a client, registers the job list and captures the services those workers need. The Layer's scope owns its client reference and releases it when the scope ends; the final reference closes the client. Callers use the jobs service to enqueue a decoded payload, look up or retry a job,
|
|
34
|
+
The application creates one jobs service with `makePgBoss(identifier)`. Its Layer starts a client, registers the job list and captures the services those workers need. The Layer's scope owns its client reference and releases it when the scope ends; the final reference closes the client. Callers use the jobs service to enqueue a decoded payload, look up or retry a job, read queue health and live counts, or list failed and dead-lettered jobs.
|
|
35
35
|
|
|
36
36
|
Use a distinct literal identifier for each jobs service. The service and its Layer keep that identifier in their types, so providing a Layer for a different identifier leaves the required jobs service unprovided at compile time.
|
|
37
37
|
|
|
@@ -318,6 +318,33 @@ export const inspectEmail = (id: string) => Effect.gen(function* () {
|
|
|
318
318
|
|
|
319
319
|
`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.
|
|
320
320
|
|
|
321
|
+
### List failed and dead-lettered jobs
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
import { Effect, Option } from "effect";
|
|
325
|
+
import { SendEmail } from "./jobs.ts";
|
|
326
|
+
import { Jobs } from "./services.ts";
|
|
327
|
+
|
|
328
|
+
export const failedEmails = (cursor?: string) => Effect.gen(function* () {
|
|
329
|
+
const jobs = yield* Jobs;
|
|
330
|
+
const failed = yield* jobs.failedJobs(SendEmail, { cursor, limit: 20 });
|
|
331
|
+
const deadLettered = yield* jobs.deadLetteredJobs(SendEmail, { limit: 20 });
|
|
332
|
+
return {
|
|
333
|
+
deadLettered: deadLettered.jobs.map((job) => ({ id: job.id, original: Option.getOrNull(job.sourceId), error: job.sourceOutput })),
|
|
334
|
+
failed: failed.jobs.map((job) => ({ id: job.id, attempt: job.attempt, error: job.output, userId: job.data.userId })),
|
|
335
|
+
next: Option.getOrUndefined(failed.next),
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`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.
|
|
341
|
+
|
|
342
|
+
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 `PgBossError` whose `operation` names the listing.
|
|
343
|
+
|
|
344
|
+
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 the job's stored output as pg-boss recorded it: for a failed job, the error its last attempt failed with, and `null` when pg-boss stored none. `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 error the original failed with. The copy has not run, so its own `output` stays `null` and its `attempt` is zero.
|
|
345
|
+
|
|
346
|
+
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.
|
|
347
|
+
|
|
321
348
|
### Queue settings on startup
|
|
322
349
|
|
|
323
350
|
`queue` accepts pg-boss `Queue` options except `name` and `deadLetter`, which the definition and adapter own, plus the adapter’s `maxDeferrals` limit. For prompt delivery, set `queue: { notify: true }` and enable `useListenNotify: true` in the worker Layer's constructor options.
|
|
@@ -430,7 +457,11 @@ Set `retryPolicy: testRetryPolicy` through the controller to override queue and
|
|
|
430
457
|
|
|
431
458
|
`checkBatchWindow(queue, millisecondsPerJob)` checks that the declared sequential batch fits strictly inside the stored queue expiry window. `schemaVersion` reads the installed version, and `checkSchemaVersion(expected)` fails when it differs. Test control, read and check failures use `PgBossTestingError` with `operation`, optional `queue` and a redacted `original`.
|
|
432
459
|
|
|
433
|
-
|
|
460
|
+
`snapshot(queues)` reads the unfinished jobs of several queues in one query, so the result is one consistent PostgreSQL snapshot. It returns jobs in the `created`, `retry`, `active` and `failed` states, never completed ones, oldest first by creation. Each entry has the job's `id`, `queue` (the definition's name), `state`, `startAfter` as a UTC `DateTime` and `data` decoded by that queue's Schema. Only unfinished rows are decoded, so a completed job whose stored data the Schema no longer accepts does not fail the read; invalid unfinished data fails with `PgBossPayloadError`.
|
|
461
|
+
|
|
462
|
+
`waitForIdle` completes when the controller's local workers hold no job in flight and none of their queues has a job ready to fetch. A job is in flight while it is active in a local worker's queue. A terminal native worker timeout still lets the wait complete, because pg-boss fails the job even while its handler promise stays pending. A job whose `startAfter` is in the future does not hold the wait open, and neither do queues without a local worker. While a fetched batch has no settlement yet, the wait reads nothing and waits for the next local change; otherwise it checks with one query per change. A kit settles by yielding `waitForIdle` and then reading jobs once.
|
|
463
|
+
|
|
464
|
+
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 whose handler promises remain pending. 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.
|
|
434
465
|
|
|
435
466
|
### API
|
|
436
467
|
|
|
@@ -441,14 +472,14 @@ Import the module that defines the name; the package has no root entry.
|
|
|
441
472
|
| `@shivaedev/effect-pg-boss/server/definition.ts` | `defineQueue`, `defineSchedule`, `jobContext`, `RetryAt`; `DefineQueueOptions`, `DefineScheduleOptions`, `JobContext`, `JobPayloadSchema`, `JobRegistration`, `QueueDefinition`, `QueueOptions`, `QueuePolicy`, `QueueWorker`, `RegistrationRequirements`, `ScheduleDefinition`, `ScheduledWorker` |
|
|
442
473
|
| `@shivaedev/effect-pg-boss/server/service.ts` | `makePgBoss`; `PgBossDefinition`, `PgBossLayerOptions`, `PgBossService` |
|
|
443
474
|
| `@shivaedev/effect-pg-boss/server/schema.ts` | `installPgBossSchema`; `PgBossSchemaOptions` |
|
|
444
|
-
| `@shivaedev/effect-pg-boss/server/health.ts` | `deadLetterQueueName`; `JobsHealth`, `QueueCounts`, `QueueHealth` |
|
|
475
|
+
| `@shivaedev/effect-pg-boss/server/health.ts` | `deadLetterQueueName`; `DeadLetteredJob`, `JobPage`, `JobPageOptions`, `JobsHealth`, `ListedJob`, `QueueCounts`, `QueueHealth` |
|
|
445
476
|
| `@shivaedev/effect-pg-boss/server/error.ts` | `PgBossError`, `PgBossPayloadError`, `PgBossQueueOptionsError`, `PgBossTestingError`, `toPgBossError`; `PgBossOperation` |
|
|
446
477
|
| `@shivaedev/effect-pg-boss/server/client.ts` | `defaultClientFactory`; `PgBossClient`, `PgBossClientFactory` |
|
|
447
|
-
| `@shivaedev/effect-pg-boss/server/testing.ts` | `makePgBossTesting`, `testRetryPolicy`; `PgBossTesting`, `PgBossTestingOptions` |
|
|
478
|
+
| `@shivaedev/effect-pg-boss/server/testing.ts` | `makePgBossTesting`, `testRetryPolicy`; `PgBossTesting`, `PgBossTestingOptions`, `SnapshotQueue`, `UnfinishedJob` |
|
|
448
479
|
|
|
449
480
|
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`.
|
|
450
481
|
|
|
451
|
-
`Jobs.layer(options)` accepts pg-boss `ConstructorOptions` plus the adapter's own options. Custom clients must supply native `complete` and `fail` capabilities to register queue or schedule workers; missing settlement capabilities fail Layer acquisition with a registration `PgBossError`. Producer-only clients do not need them. Custom clients can also supply the optional native capabilities `findJobs`, `retry`, `update`, `getDb` and `updateQueue` for lookup, retry, live counts, deferral and reconciliation; a requested operation fails with `PgBossError` if its required capability is absent.
|
|
482
|
+
`Jobs.layer(options)` accepts pg-boss `ConstructorOptions` plus the adapter's own options. Custom clients must supply native `complete` and `fail` capabilities to register queue or schedule workers; missing settlement capabilities fail Layer acquisition with a registration `PgBossError`. Producer-only clients do not need them. Custom clients can also supply the optional native capabilities `findJobs`, `retry`, `update`, `getDb` and `updateQueue` for lookup, retry, live counts and listings, deferral and reconciliation; a requested operation fails with `PgBossError` if its required capability is absent.
|
|
452
483
|
|
|
453
484
|
`onError` handles pg-boss client `error` events using the services captured by the Layer. Only the owning jobs service is supplied automatically; a handler using another jobs definition still requires that definition's Layer.
|
|
454
485
|
|
package/dist/server/error.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Redacted } from "effect";
|
|
2
|
-
export type PgBossOperation = "counts" | "enqueue" | "getJob" | "health" | "install" | "register" | "retry" | "start" | "stop";
|
|
2
|
+
export type PgBossOperation = "counts" | "deadLetteredJobs" | "enqueue" | "failedJobs" | "getJob" | "health" | "install" | "register" | "retry" | "start" | "stop";
|
|
3
3
|
declare const PgBossError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
4
4
|
readonly _tag: "PgBossError";
|
|
5
5
|
} & Readonly<A>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/server/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/server/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,eAAe,GACxB,QAAQ,GACR,kBAAkB,GAClB,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,OAAO,GACP,OAAO,GACP,MAAM,CAAC;;;;AAEV,qBAAa,WAAY,SAAQ,iBAAgC;IAChE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC9C,CAAC;IAED,IAAa,OAAO,IAAI,MAAM,CAG7B;CACD;;;;AAUD,qBAAa,uBAAwB,SAAQ,6BAA4C;IACxF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,QAAQ,CAAC,EAAE,CAAC;CACtD,CAAC;IACD,IAAa,OAAO,IAAI,MAAM,CAE7B;CACD;;;;AAED,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC9E,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC9C,CAAC;CAAG;;;;AAEL,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC9E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;CAAG;AAEL,eAAO,MAAM,aAAa,cAAe,eAAe,SAAS,OAAO,UAAU,MAAM,KAAG,WAKxF,CAAC"}
|
package/dist/server/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/server/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/server/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAexC,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAI7D;IACD,yGAAyG;IACzG,IAAa,OAAO;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1E,OAAO,WAAW,IAAI,CAAC,SAAS,GAAG,MAAM,YAAY,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;IACpG,CAAC;CACD;AAED,SAAS,YAAY,CAAC,QAAiB;IACtC,IAAI,CAAC,CAAC,QAAQ,YAAY,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,OAAO,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,IAAI,GAAY,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;AACtG,CAAC;AAED,MAAM,OAAO,uBAAwB,SAAQ,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAGrF;IACD,IAAa,OAAO;QACnB,OAAO,SAAS,IAAI,CAAC,KAAK,0CAA0C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC/F,CAAC;CACD;AAED,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAI3E;CAAG;AAEL,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAI3E;CAAG;AAEL,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAA0B,EAAE,KAAc,EAAE,KAAc,EAAe,EAAE,CACxG,IAAI,WAAW,CAAC;IACf,SAAS;IACT,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC9B,KAAK;CACL,CAAC,CAAC"}
|
package/dist/server/health.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DateTime, Option } from "effect";
|
|
2
|
+
import type { JobWithMetadata } from "pg-boss";
|
|
1
3
|
export interface QueueCounts {
|
|
2
4
|
readonly activeCount: number;
|
|
3
5
|
readonly failedCount: number;
|
|
@@ -21,4 +23,29 @@ export interface JobsHealth {
|
|
|
21
23
|
readonly readyTotal: number;
|
|
22
24
|
}
|
|
23
25
|
export declare const deadLetterQueueName: (queueName: string) => string;
|
|
26
|
+
export interface ListedJob<TData> {
|
|
27
|
+
readonly attempt: number;
|
|
28
|
+
readonly completedOn: Option.Option<DateTime.Utc>;
|
|
29
|
+
readonly createdOn: DateTime.Utc;
|
|
30
|
+
readonly data: TData;
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly output: unknown;
|
|
33
|
+
readonly queue: string;
|
|
34
|
+
readonly retryCount: number;
|
|
35
|
+
readonly retryLimit: number;
|
|
36
|
+
readonly startedOn: Option.Option<DateTime.Utc>;
|
|
37
|
+
readonly state: JobWithMetadata["state"];
|
|
38
|
+
}
|
|
39
|
+
export interface DeadLetteredJob<TData> extends ListedJob<TData> {
|
|
40
|
+
readonly sourceId: Option.Option<string>;
|
|
41
|
+
readonly sourceOutput: unknown;
|
|
42
|
+
}
|
|
43
|
+
export interface JobPageOptions {
|
|
44
|
+
readonly cursor?: string | undefined;
|
|
45
|
+
readonly limit: number;
|
|
46
|
+
}
|
|
47
|
+
export interface JobPage<TJob> {
|
|
48
|
+
readonly jobs: readonly TJob[];
|
|
49
|
+
readonly next: Option.Option<string>;
|
|
50
|
+
}
|
|
24
51
|
//# sourceMappingURL=health.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/server/health.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC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,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/server/health.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/server/health.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,GAAG,SAAS,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countsFor.d.ts","sourceRoot":"","sources":["../../../src/server/internal/countsFor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"countsFor.d.ts","sourceRoot":"","sources":["../../../src/server/internal/countsFor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAU9C,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,WAAW,EAAE,WAAW,CAAC,CAoBzI"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { toPgBossError } from "#error.ts";
|
|
3
|
+
import { quotedSchema } from "#internal/storedRows.ts";
|
|
3
4
|
const Counts = Schema.Struct({
|
|
4
5
|
activeCount: Schema.Number,
|
|
5
6
|
failedCount: Schema.Number,
|
|
@@ -13,13 +14,13 @@ export function countsFor(client, schema, name) {
|
|
|
13
14
|
if (client.getDb === undefined) {
|
|
14
15
|
throw new TypeError("This pg-boss client does not support getDb");
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
+
const quoted = quotedSchema(schema);
|
|
17
18
|
const { rows } = await client.getDb().executeSql(`SELECT
|
|
18
19
|
count(*) FILTER (WHERE state = 'active')::int AS "activeCount",
|
|
19
20
|
count(*) FILTER (WHERE state = 'failed')::int AS "failedCount",
|
|
20
21
|
count(*) FILTER (WHERE state IN ('created', 'retry'))::int AS "queuedCount",
|
|
21
22
|
count(*)::int AS "totalCount"
|
|
22
|
-
FROM ${
|
|
23
|
+
FROM ${quoted}.job WHERE name = $1`, [name]);
|
|
23
24
|
return Schema.decodeUnknownPromise(Counts)(rows[0]);
|
|
24
25
|
},
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countsFor.js","sourceRoot":"","sources":["../../../src/server/internal/countsFor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"countsFor.js","sourceRoot":"","sources":["../../../src/server/internal/countsFor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,SAAS,CAAC,MAAoB,EAAE,MAAc,EAAE,IAAY;IAC3E,OAAO,MAAM,CAAC,UAAU,CAAC;QACxB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC;QACtD,GAAG,EAAE,KAAK,IAAI,EAAE;YACf,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAChC,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;YACnE,CAAC;YACD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,UAAU,CAC/C;;;;;WAKO,MAAM,sBAAsB,EACnC,CAAC,IAAI,CAAC,CACN,CAAC;YACF,OAAO,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralStorePlan.d.ts","sourceRoot":"","sources":["../../../src/server/internal/deferralStorePlan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deferralStorePlan.d.ts","sourceRoot":"","sources":["../../../src/server/internal/deferralStorePlan.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+BxD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { STATELY_DEFERRAL_POLICY } from "
|
|
1
|
+
import { STATELY_DEFERRAL_POLICY } from "#internal/deferral.ts";
|
|
2
|
+
import { quotedSchema } from "#internal/storedRows.ts";
|
|
2
3
|
export function deferralStorePlan(schema) {
|
|
3
|
-
const quoted =
|
|
4
|
+
const quoted = quotedSchema(schema);
|
|
4
5
|
const jobTable = `${quoted}.job`.replaceAll("'", "''");
|
|
5
6
|
const key = `${schema}.effect_job_deferral`.replaceAll("'", "''");
|
|
6
7
|
const body = `BEGIN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralStorePlan.js","sourceRoot":"","sources":["../../../src/server/internal/deferralStorePlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deferralStorePlan.js","sourceRoot":"","sources":["../../../src/server/internal/deferralStorePlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC/C,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvD,MAAM,GAAG,GAAG,GAAG,MAAM,sBAAsB,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG;oDACsC,GAAG;+BACxB,MAAM;;;;;;;;iEAQ4B,MAAM;+BACxC,MAAM;;sBAEf,uBAAuB;;;;;;;+CAOE,QAAQ;;8EAEuB,MAAM;mCACjD,MAAM;;KAEpC,CAAC;IACL,OAAO,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAC7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expireAttempt.d.ts","sourceRoot":"","sources":["../../../src/server/internal/expireAttempt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"expireAttempt.d.ts","sourceRoot":"","sources":["../../../src/server/internal/expireAttempt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAG3C,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,GAAE,QAAQ,GAAG,WAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB9I"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { quotedSchema } from "#internal/storedRows.ts";
|
|
1
2
|
export async function expireAttempt(client, schema, job, cause = "expiry") {
|
|
2
3
|
if ((await client.schemaVersion()) !== 45) {
|
|
3
4
|
throw new Error("Testing expiry requires pg-boss schema version 45");
|
|
4
5
|
}
|
|
5
|
-
const quoted =
|
|
6
|
+
const quoted = quotedSchema(schema);
|
|
6
7
|
const timestamp = cause === "expiry" ? "started_on" : "heartbeat_on";
|
|
7
8
|
const seconds = cause === "expiry" ? "expire_seconds" : "heartbeat_seconds";
|
|
8
9
|
await client.getDb().executeSql(`UPDATE ${quoted}.job SET ${timestamp} = ${quoted}.job_now() - (${seconds} + 1) * interval '1 second'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expireAttempt.js","sourceRoot":"","sources":["../../../src/server/internal/expireAttempt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expireAttempt.js","sourceRoot":"","sources":["../../../src/server/internal/expireAttempt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,MAAc,EAAE,GAAiB,EAAE,KAAK,GAA2B,QAAQ;IAC9H,IAAI,CAAC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,OAAO,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC5E,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,UAAU,CAC9B,UAAU,MAAM,YAAY,SAAS,MAAM,MAAM,iBAAiB,OAAO;wEACH,EACtE,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,UAAU,CAAC,CAClC,CAAC;IACF,0FAA0F;IAC1F,MAAM,MAAM;SACV,KAAK,EAAE;SACP,UAAU,CAAC,UAAU,MAAM,iCAAiC,MAAM,gDAAgD,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAClI,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobControl.d.ts","sourceRoot":"","sources":["../../../src/server/internal/jobControl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"jobControl.d.ts","sourceRoot":"","sources":["../../../src/server/internal/jobControl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAiBvE;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,CAkBrE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Effect, Option
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
|
+
import { toPgBossError } from "#error.ts";
|
|
3
|
+
import { decodeStoredData } from "#internal/storedRows.ts";
|
|
4
4
|
export function getJobFor(client) {
|
|
5
5
|
return (queue, id) => Effect.tryPromise({
|
|
6
6
|
catch: (error) => toPgBossError("getJob", error, queue.name),
|
|
@@ -12,7 +12,7 @@ export function getJobFor(client) {
|
|
|
12
12
|
},
|
|
13
13
|
}).pipe(Effect.flatMap((job) => job === undefined
|
|
14
14
|
? Effect.succeed(Option.none())
|
|
15
|
-
:
|
|
15
|
+
: decodeStoredData(queue, job.data).pipe(Effect.map((data) => Option.some({ ...job, data })))));
|
|
16
16
|
}
|
|
17
17
|
export function retryFor(client) {
|
|
18
18
|
return (queue, id) => Effect.tryPromise({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobControl.js","sourceRoot":"","sources":["../../../src/server/internal/jobControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"jobControl.js","sourceRoot":"","sources":["../../../src/server/internal/jobControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,UAAU,SAAS,CAAC,MAAoB;IAC7C,OAAO,CAAC,KAAK,EAAE,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MAAM,KAAK,SAAS,EAAE,CAAC;gBAChG,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;YACxF,CAAC;YACD,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,GAAG,EAAE,KAAK,KAAK,QAAQ,IAAI,GAAG,EAAE,KAAK,KAAK,OAAO,EAAE,CAAC;gBACvD,OAAO;YACR,CAAC;YACD,IAAI,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC5B,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACpC,CAAC;YACD,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC;KACD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PgBossClient } from "#client.ts";
|
|
2
|
+
import type { PgBossService } from "#service.ts";
|
|
3
|
+
export declare function failedJobsFor(client: PgBossClient, schema: string): PgBossService["failedJobs"];
|
|
4
|
+
export declare function deadLetteredJobsFor(client: PgBossClient, schema: string): PgBossService["deadLetteredJobs"];
|
|
5
|
+
//# sourceMappingURL=listJobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listJobs.d.ts","sourceRoot":"","sources":["../../../src/server/internal/listJobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwBjD,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAK/F;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAE3G"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Effect, Option, Schema } from "effect";
|
|
2
|
+
import { toPgBossError } from "#error.ts";
|
|
3
|
+
import { deadLetterQueueName } from "#health.ts";
|
|
4
|
+
import { decodeStoredData, quotedSchema } from "#internal/storedRows.ts";
|
|
5
|
+
const Cursor = Schema.StringFromBase64Url.pipe(Schema.decodeTo(Schema.fromJsonString(Schema.Tuple([Schema.String, Schema.String]))));
|
|
6
|
+
const Row = Schema.Struct({
|
|
7
|
+
completedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromDate),
|
|
8
|
+
createdOn: Schema.DateTimeUtcFromDate,
|
|
9
|
+
cursorAt: Schema.String,
|
|
10
|
+
data: Schema.Unknown,
|
|
11
|
+
id: Schema.String,
|
|
12
|
+
output: Schema.Unknown,
|
|
13
|
+
queue: Schema.String,
|
|
14
|
+
retryCount: Schema.Number,
|
|
15
|
+
retryLimit: Schema.Number,
|
|
16
|
+
sourceId: Schema.OptionFromNullOr(Schema.String),
|
|
17
|
+
sourceOutput: Schema.Unknown,
|
|
18
|
+
startedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromDate),
|
|
19
|
+
state: Schema.Literals(["created", "retry", "active", "completed", "cancelled", "failed"]),
|
|
20
|
+
});
|
|
21
|
+
const Rows = Schema.Array(Row);
|
|
22
|
+
export function failedJobsFor(client, schema) {
|
|
23
|
+
return (queue, options) => listJobs(client, schema, "failedJobs", queue, options).pipe(Effect.map(({ jobs, next }) => ({ jobs: jobs.map(({ sourceId: _id, sourceOutput: _output, ...job }) => job), next })));
|
|
24
|
+
}
|
|
25
|
+
export function deadLetteredJobsFor(client, schema) {
|
|
26
|
+
return (queue, options) => listJobs(client, schema, "deadLetteredJobs", queue, options);
|
|
27
|
+
}
|
|
28
|
+
function listJobs(client, schema, listing, queue, options) {
|
|
29
|
+
return Effect.tryPromise({
|
|
30
|
+
catch: (error) => toPgBossError(listing, error, queue.name),
|
|
31
|
+
try: async () => {
|
|
32
|
+
if (client.getDb === undefined) {
|
|
33
|
+
throw new TypeError("This pg-boss client does not support getDb");
|
|
34
|
+
}
|
|
35
|
+
if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
|
|
36
|
+
throw new RangeError("The page limit must be a positive integer");
|
|
37
|
+
}
|
|
38
|
+
const after = options.cursor === undefined ? undefined : await Schema.decodeUnknownPromise(Cursor)(options.cursor);
|
|
39
|
+
const quoted = quotedSchema(schema);
|
|
40
|
+
const { rows } = await client.getDb().executeSql(`SELECT
|
|
41
|
+
id,
|
|
42
|
+
name AS queue,
|
|
43
|
+
state,
|
|
44
|
+
retry_count AS "retryCount",
|
|
45
|
+
retry_limit AS "retryLimit",
|
|
46
|
+
created_on AS "createdOn",
|
|
47
|
+
started_on AS "startedOn",
|
|
48
|
+
completed_on AS "completedOn",
|
|
49
|
+
output,
|
|
50
|
+
data,
|
|
51
|
+
source_id AS "sourceId",
|
|
52
|
+
source_output AS "sourceOutput",
|
|
53
|
+
to_json(created_on) #>> '{}' AS "cursorAt"
|
|
54
|
+
FROM ${quoted}.job
|
|
55
|
+
WHERE name = $1
|
|
56
|
+
${listing === "failedJobs" ? "AND state = 'failed'" : ""}
|
|
57
|
+
AND ($2::timestamptz IS NULL OR (created_on, id) < ($2::timestamptz, $3::uuid))
|
|
58
|
+
ORDER BY created_on DESC, id DESC
|
|
59
|
+
LIMIT $4`, [listing === "failedJobs" ? queue.name : deadLetterQueueName(queue.name), after?.[0] ?? null, after?.[1] ?? null, options.limit + 1]);
|
|
60
|
+
return Schema.decodeUnknownPromise(Rows)(rows);
|
|
61
|
+
},
|
|
62
|
+
}).pipe(Effect.flatMap((rows) => {
|
|
63
|
+
const page = rows.slice(0, options.limit);
|
|
64
|
+
const last = page.at(-1);
|
|
65
|
+
const next = rows.length > options.limit && last !== undefined ? Option.some(Schema.encodeSync(Cursor)([last.cursorAt, last.id])) : Option.none();
|
|
66
|
+
return Effect.forEach(page, ({ cursorAt: _, data, ...row }) => decodeStoredData(queue, data).pipe(Effect.map((decoded) => ({ ...row, attempt: Option.isSome(row.startedOn) ? row.retryCount + 1 : 0, data: decoded })))).pipe(Effect.map((jobs) => ({ jobs, next })));
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=listJobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listJobs.js","sourceRoot":"","sources":["../../../src/server/internal/listJobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAA6C,aAAa,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAwB,mBAAmB,EAAqC,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGzE,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAErI,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAChE,SAAS,EAAE,MAAM,CAAC,mBAAmB;IACrC,QAAQ,EAAE,MAAM,CAAC,MAAM;IACvB,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC,MAAM;IACjB,MAAM,EAAE,MAAM,CAAC,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB,U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{ PgBoss } from "pg-boss";
|
|
2
|
-
export declare function observeTestingSettlements(client: PgBoss,
|
|
2
|
+
export declare function observeTestingSettlements(client: PgBoss, settled: (name: string) => void): {
|
|
3
3
|
close(): void;
|
|
4
4
|
watch(name: string): void;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observeTestingSettlements.d.ts","sourceRoot":"","sources":["../../../src/server/internal/observeTestingSettlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"observeTestingSettlements.d.ts","sourceRoot":"","sources":["../../../src/server/internal/observeTestingSettlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;IAGvF,KAAK;IAML,KAAK,OAAO,MAAM;EAwBnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function observeTestingSettlements(client,
|
|
1
|
+
export function observeTestingSettlements(client, settled) {
|
|
2
2
|
const observers = new Map();
|
|
3
3
|
return {
|
|
4
4
|
close() {
|
|
@@ -21,7 +21,7 @@ export function observeTestingSettlements(client, changed) {
|
|
|
21
21
|
}
|
|
22
22
|
// This controller owns the spy; clear history and the losing wait before rearming both outcomes.
|
|
23
23
|
spy.clear();
|
|
24
|
-
|
|
24
|
+
settled(name);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
observers.set(name, () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observeTestingSettlements.js","sourceRoot":"","sources":["../../../src/server/internal/observeTestingSettlements.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"observeTestingSettlements.js","sourceRoot":"","sources":["../../../src/server/internal/observeTestingSettlements.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,OAA+B;IACxF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;IAChD,OAAO;QACN,KAAK;YACJ,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;gBACxC,KAAK,EAAE,CAAC;YACT,CAAC;YACD,SAAS,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;QACD,KAAK,CAAC,IAAY;YACjB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzB,OAAO;YACR,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,IAAI,GAAG,IAAI,CAAC;YAChB,KAAK,UAAU,OAAO;gBACrB,OAAO,IAAI,EAAE,CAAC;oBACb,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACpG,IAAI,CAAC,IAAI,EAAE,CAAC;wBACX,OAAO;oBACR,CAAC;oBACD,iGAAiG;oBACjG,GAAG,CAAC,KAAK,EAAE,CAAC;oBACZ,OAAO,CAAC,IAAI,CAAC,CAAC;gBACf,CAAC;YACF,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE;gBACxB,IAAI,GAAG,KAAK,CAAC;gBACb,GAAG,CAAC,KAAK,EAAE,CAAC;YACb,CAAC,CAAC,CAAC;YACH,KAAK,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3H,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/server/internal/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/server/internal/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,WAAW,WAAY,YAAY,SAAS,SAAS,MAAM,EAAE,sBAAsB,aAsC9F,CAAC"}
|
|
@@ -3,9 +3,11 @@ import { PgBossPayloadError, toPgBossError } from "#error.ts";
|
|
|
3
3
|
import { countsFor } from "#internal/countsFor.ts";
|
|
4
4
|
import { healthFor } from "#internal/health.ts";
|
|
5
5
|
import { getJobFor, retryFor } from "#internal/jobControl.ts";
|
|
6
|
+
import { deadLetteredJobsFor, failedJobsFor } from "#internal/listJobs.ts";
|
|
6
7
|
import { capturePayload } from "#internal/tracing.ts";
|
|
7
8
|
export const makeService = (client, names, schema = "pgboss") => ({
|
|
8
9
|
counts: (queue) => countsFor(client, schema, queue.name),
|
|
10
|
+
deadLetteredJobs: deadLetteredJobsFor(client, schema),
|
|
9
11
|
enqueue: (queue, payload, options) => Schema.encodeUnknownEffect(queue.schema)(payload).pipe(Effect.mapError((error) => new PgBossPayloadError({
|
|
10
12
|
direction: "encode",
|
|
11
13
|
original: Redacted.make(error),
|
|
@@ -23,6 +25,7 @@ export const makeService = (client, names, schema = "pgboss") => ({
|
|
|
23
25
|
try: () => client.send(queue.name, data, queue.key === undefined ? options : { ...options, singletonKey: queue.key(payload) }),
|
|
24
26
|
})), Effect.map(Option.fromNullishOr));
|
|
25
27
|
})),
|
|
28
|
+
failedJobs: failedJobsFor(client, schema),
|
|
26
29
|
getJob: getJobFor(client),
|
|
27
30
|
health: healthFor(client, names),
|
|
28
31
|
retry: retryFor(client),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/server/internal/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAoB,kBAAkB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAoB,EAAE,KAAwB,EAAE,MAAM,GAAG,QAAQ,EAAiB,EAAE,CAAC,CAAC;IACjH,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC;IACxD,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CACpC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CACrD,MAAM,CAAC,QAAQ,CACd,CAAC,KAAK,EAAE,EAAE,CACT,IAAI,kBAAkB,CAAC;QACtB,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,QAAQ,CAAC,IAA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CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"settleDeferral.d.ts","sourceRoot":"","sources":["../../../src/server/internal/settleDeferral.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,wBAAsB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;;;GA6C7I"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { STATELY_DEFERRAL_POLICY } from "
|
|
2
|
+
import { STATELY_DEFERRAL_POLICY } from "#internal/deferral.ts";
|
|
3
|
+
import { quotedSchema } from "#internal/storedRows.ts";
|
|
3
4
|
const Settlement = Schema.Struct({ claimed: Schema.Boolean, deferred: Schema.Boolean });
|
|
4
5
|
export async function settleDeferral(client, schema, job, at, reason, maxDeferrals) {
|
|
5
6
|
if (client.getDb === undefined) {
|
|
6
7
|
throw new TypeError("This pg-boss client does not support getDb for RetryAt");
|
|
7
8
|
}
|
|
8
|
-
const quoted =
|
|
9
|
+
const quoted = quotedSchema(schema);
|
|
9
10
|
// Native failure settlement deletes and reinserts jobs, so a cascading job foreign key would erase the counter.
|
|
10
11
|
const { rows } = await client.getDb().executeSql(`WITH claimed AS MATERIALIZED (
|
|
11
12
|
SELECT name, id, created_on,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settleDeferral.js","sourceRoot":"","sources":["../../../src/server/internal/settleDeferral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,uBAAuB,EAA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0 +1,6 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { JobPayloadSchema, QueueDefinition } from "#definition.ts";
|
|
3
|
+
import { PgBossPayloadError } from "#error.ts";
|
|
4
|
+
export declare function quotedSchema(schema: string): string;
|
|
5
|
+
export declare function decodeStoredData<const TName extends string, const TPayload extends JobPayloadSchema>(queue: Pick<QueueDefinition<TName, TPayload>, "name" | "schema">, data: unknown): Effect.Effect<TPayload["Type"], PgBossPayloadError, TPayload["DecodingServices"]>;
|
|
6
|
+
//# sourceMappingURL=storedRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedRows.d.ts","sourceRoot":"","sources":["../../../src/server/internal/storedRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,KAAK,SAAS,MAAM,EAAE,KAAK,CAAC,QAAQ,SAAS,gBAAgB,EACnG,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,EAChE,IAAI,EAAE,OAAO,GACX,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAInF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Effect, Redacted, Schema } from "effect";
|
|
2
|
+
import { PgBossPayloadError } from "#error.ts";
|
|
3
|
+
import { payloadOf } from "#internal/tracing.ts";
|
|
4
|
+
export function quotedSchema(schema) {
|
|
5
|
+
return `"${schema.replaceAll('"', '""')}"`;
|
|
6
|
+
}
|
|
7
|
+
export function decodeStoredData(queue, data) {
|
|
8
|
+
return Schema.decodeUnknownEffect(queue.schema)(payloadOf(data)).pipe(Effect.mapError((error) => new PgBossPayloadError({ direction: "decode", original: Redacted.make(error), queue: queue.name })));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=storedRows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedRows.js","sourceRoot":"","sources":["../../../src/server/internal/storedRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,MAAc;IAC1C,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC/B,KAAgE,EAChE,IAAa;IAEb,OAAO,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CACpE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAC9H,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { PgBoss, SendOptions } from "pg-boss";
|
|
2
2
|
import type { PgBossClient } from "#client.ts";
|
|
3
|
+
import type { TestingWork } from "#internal/testingIdle.ts";
|
|
3
4
|
export interface TestingControls {
|
|
4
5
|
readonly changed: () => void;
|
|
5
6
|
readonly expirations: Map<string, number>;
|
|
6
7
|
readonly failures: Set<string>;
|
|
7
8
|
readonly retryPolicy: Pick<SendOptions, "retryBackoff" | "retryDelay">;
|
|
9
|
+
readonly work: TestingWork;
|
|
8
10
|
}
|
|
9
11
|
export declare function testingClient(client: PgBoss, schema: string, controls: TestingControls): PgBossClient;
|
|
10
12
|
//# sourceMappingURL=testingClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testingClient.d.ts","sourceRoot":"","sources":["../../../src/server/internal/testingClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"testingClient.d.ts","sourceRoot":"","sources":["../../../src/server/internal/testingClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,WAAW,EAAgD,MAAM,SAAS,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC;IACvE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,YAAY,CAkHrG"}
|