pg-boss 10.0.1 → 10.0.2

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 (3) hide show
  1. package/README.md +3 -0
  2. package/package.json +1 -1
  3. package/types.d.ts +8 -8
package/README.md CHANGED
@@ -15,6 +15,8 @@ async function readme() {
15
15
 
16
16
  const queue = 'readme-queue'
17
17
 
18
+ await boss.createQueue(queue)
19
+
18
20
  const id = await boss.send(queue, { arg1: 'read me' })
19
21
 
20
22
  console.log(`created job ${id} in queue ${queue}`)
@@ -34,6 +36,7 @@ This will likely cater the most to teams already familiar with the simplicity of
34
36
 
35
37
  ## Summary
36
38
  * Exactly-once job delivery
39
+ * Create jobs within your existing database transaction
37
40
  * Backpressure-compatible polling workers
38
41
  * Cron scheduling
39
42
  * Queue storage policies to support a variety of rate limiting, debouncing, and concurrency use cases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-boss",
3
- "version": "10.0.1",
3
+ "version": "10.0.2",
4
4
  "description": "Queueing jobs in Postgres from Node.js like a boss",
5
5
  "main": "./src/index.js",
6
6
  "engines": {
package/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter } from 'events'
2
2
 
3
3
  declare namespace PgBoss {
4
-
4
+
5
5
  type JobStates = {
6
6
  created : 'created',
7
7
  retry: 'retry',
@@ -107,13 +107,13 @@ declare namespace PgBoss {
107
107
  interface ConnectionOptions {
108
108
  db?: Db;
109
109
  }
110
-
110
+
111
111
  type InsertOptions = ConnectionOptions;
112
-
112
+
113
113
  type SendOptions = JobOptions & ExpirationOptions & RetentionOptions & RetryOptions & ConnectionOptions;
114
-
114
+
115
115
  type QueuePolicy = 'standard' | 'short' | 'singleton' | 'stately'
116
-
116
+
117
117
  type Queue = RetryOptions & ExpirationOptions & RetentionOptions & { name: string, policy?: QueuePolicy, deadLetter?: string }
118
118
  type QueueResult = Queue & { createdOn: Date, updatedOn: Date }
119
119
  type ScheduleOptions = SendOptions & { tz?: string }
@@ -334,7 +334,7 @@ declare class PgBoss extends EventEmitter {
334
334
 
335
335
  deleteJob(name: string, id: string, options?: PgBoss.ConnectionOptions): Promise<void>;
336
336
  deleteJob(name: string, ids: string[], options?: PgBoss.ConnectionOptions): Promise<void>;
337
-
337
+
338
338
  complete(name: string, id: string, options?: PgBoss.ConnectionOptions): Promise<void>;
339
339
  complete(name: string, id: string, data: object, options?: PgBoss.ConnectionOptions): Promise<void>;
340
340
  complete(name: string, ids: string[], options?: PgBoss.ConnectionOptions): Promise<void>;
@@ -343,8 +343,8 @@ declare class PgBoss extends EventEmitter {
343
343
  fail(name: string, id: string, data: object, options?: PgBoss.ConnectionOptions): Promise<void>;
344
344
  fail(name: string, ids: string[], options?: PgBoss.ConnectionOptions): Promise<void>;
345
345
 
346
- getJobById(name: string, id: string, options?: PgBoss.ConnectionOptions & { includeArchive: bool }): Promise<PgBoss.JobWithMetadata | null>;
347
-
346
+ getJobById<T>(name: string, id: string, options?: PgBoss.ConnectionOptions & { includeArchive: boolean }): Promise<PgBoss.JobWithMetadata<T> | null>;
347
+
348
348
  createQueue(name: string, options?: PgBoss.Queue): Promise<void>;
349
349
  updateQueue(name: string, options?: PgBoss.Queue): Promise<void>;
350
350
  deleteQueue(name: string): Promise<void>;