pg-boss 12.5.4 → 12.7.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/README.md +102 -0
- package/dist/attorney.d.ts.map +1 -1
- package/dist/attorney.js +58 -1
- package/dist/bam.d.ts +14 -0
- package/dist/bam.d.ts.map +1 -0
- package/dist/bam.js +114 -0
- package/dist/boss.d.ts.map +1 -1
- package/dist/boss.js +18 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +333 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -1
- package/dist/manager.d.ts +6 -2
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +244 -51
- package/dist/migrationStore.d.ts.map +1 -1
- package/dist/migrationStore.js +302 -3
- package/dist/plans.d.ts +22 -2
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +377 -64
- package/dist/types.d.ts +74 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +2 -0
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +6 -0
- package/package.json +17 -15
package/dist/cli.js
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
import Db from "./db.js";
|
|
6
|
+
import * as plans from "./plans.js";
|
|
7
|
+
import * as migrationStore from "./migrationStore.js";
|
|
8
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
9
|
+
const schemaVersion = packageJson.pgboss.schema;
|
|
10
|
+
function printHelp() {
|
|
11
|
+
console.log(`
|
|
12
|
+
pg-boss CLI v${packageJson.version}
|
|
13
|
+
|
|
14
|
+
Usage: pg-boss <command> [options]
|
|
15
|
+
|
|
16
|
+
Commands:
|
|
17
|
+
migrate Run pending migrations (creates schema if not exists)
|
|
18
|
+
create Create the pg-boss schema (initial installation)
|
|
19
|
+
version Show current schema version
|
|
20
|
+
plans Output SQL plans without executing
|
|
21
|
+
rollback Rollback the last migration
|
|
22
|
+
|
|
23
|
+
Options:
|
|
24
|
+
--help, -h Show this help message
|
|
25
|
+
--config, -c <file> Path to config file (default: pgboss.json)
|
|
26
|
+
--schema, -s <name> Schema name (default: pgboss)
|
|
27
|
+
--host <host> Database host
|
|
28
|
+
--port <port> Database port
|
|
29
|
+
--database, -d <name> Database name
|
|
30
|
+
--user, -u <user> Database user
|
|
31
|
+
--password, -p <pass> Database password
|
|
32
|
+
--connection-string Full connection string (overrides other connection options)
|
|
33
|
+
--ssl Enable SSL connection
|
|
34
|
+
--dry-run Output SQL without executing (for plans command)
|
|
35
|
+
|
|
36
|
+
Environment Variables:
|
|
37
|
+
PGBOSS_DATABASE_URL Full connection string
|
|
38
|
+
PGBOSS_HOST Database host
|
|
39
|
+
PGBOSS_PORT Database port
|
|
40
|
+
PGBOSS_DATABASE Database name
|
|
41
|
+
PGBOSS_USER Database user
|
|
42
|
+
PGBOSS_PASSWORD Database password
|
|
43
|
+
PGBOSS_SCHEMA Schema name (default: pgboss)
|
|
44
|
+
|
|
45
|
+
Config File (pgboss.json):
|
|
46
|
+
{
|
|
47
|
+
"host": "localhost",
|
|
48
|
+
"port": 5432,
|
|
49
|
+
"database": "mydb",
|
|
50
|
+
"user": "postgres",
|
|
51
|
+
"password": "secret",
|
|
52
|
+
"schema": "pgboss",
|
|
53
|
+
"ssl": false
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Examples:
|
|
57
|
+
pg-boss migrate
|
|
58
|
+
pg-boss migrate --schema my_schema
|
|
59
|
+
pg-boss create --connection-string postgres://user:pass@localhost/db
|
|
60
|
+
pg-boss plans migrate --dry-run
|
|
61
|
+
pg-boss version
|
|
62
|
+
PGBOSS_DATABASE_URL=postgres://localhost/mydb pg-boss migrate
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
function loadConfigFile(configPath) {
|
|
66
|
+
const paths = configPath
|
|
67
|
+
? [resolve(configPath)]
|
|
68
|
+
: [
|
|
69
|
+
resolve('pgboss.json'),
|
|
70
|
+
resolve('.pgbossrc'),
|
|
71
|
+
resolve('.pgbossrc.json')
|
|
72
|
+
];
|
|
73
|
+
for (const filePath of paths) {
|
|
74
|
+
if (existsSync(filePath)) {
|
|
75
|
+
try {
|
|
76
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
77
|
+
const config = JSON.parse(content);
|
|
78
|
+
console.log(`Loaded config from ${filePath}`);
|
|
79
|
+
return config;
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
console.error(`Error reading config file ${filePath}: ${err.message}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return {};
|
|
88
|
+
}
|
|
89
|
+
function getConnectionConfig(args) {
|
|
90
|
+
const fileConfig = loadConfigFile(args.config);
|
|
91
|
+
const config = {
|
|
92
|
+
connectionString: args.connectionString || process.env.PGBOSS_DATABASE_URL || fileConfig.connectionString,
|
|
93
|
+
host: args.host || process.env.PGBOSS_HOST || fileConfig.host,
|
|
94
|
+
port: args.port ? parseInt(args.port, 10) : (process.env.PGBOSS_PORT ? parseInt(process.env.PGBOSS_PORT, 10) : fileConfig.port),
|
|
95
|
+
database: args.database || process.env.PGBOSS_DATABASE || fileConfig.database,
|
|
96
|
+
user: args.user || process.env.PGBOSS_USER || fileConfig.user,
|
|
97
|
+
password: args.password || process.env.PGBOSS_PASSWORD || fileConfig.password,
|
|
98
|
+
schema: args.schema || process.env.PGBOSS_SCHEMA || fileConfig.schema || plans.DEFAULT_SCHEMA
|
|
99
|
+
};
|
|
100
|
+
if (args.ssl || fileConfig.ssl) {
|
|
101
|
+
config.ssl = args.ssl ? { rejectUnauthorized: false } : fileConfig.ssl;
|
|
102
|
+
}
|
|
103
|
+
if (!config.connectionString && !config.host && !config.database) {
|
|
104
|
+
console.error('Error: No database connection configured.');
|
|
105
|
+
console.error('Provide connection via --connection-string, environment variables, or config file.');
|
|
106
|
+
console.error('Run "pg-boss --help" for more information.');
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
return config;
|
|
110
|
+
}
|
|
111
|
+
function parseCliArgs() {
|
|
112
|
+
const { values, positionals } = parseArgs({
|
|
113
|
+
options: {
|
|
114
|
+
help: { type: 'boolean', short: 'h' },
|
|
115
|
+
config: { type: 'string', short: 'c' },
|
|
116
|
+
schema: { type: 'string', short: 's' },
|
|
117
|
+
host: { type: 'string' },
|
|
118
|
+
port: { type: 'string' },
|
|
119
|
+
database: { type: 'string', short: 'd' },
|
|
120
|
+
user: { type: 'string', short: 'u' },
|
|
121
|
+
password: { type: 'string', short: 'p' },
|
|
122
|
+
'connection-string': { type: 'string' },
|
|
123
|
+
ssl: { type: 'boolean' },
|
|
124
|
+
'dry-run': { type: 'boolean' }
|
|
125
|
+
},
|
|
126
|
+
allowPositionals: true
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
help: values.help,
|
|
130
|
+
config: values.config,
|
|
131
|
+
schema: values.schema,
|
|
132
|
+
host: values.host,
|
|
133
|
+
port: values.port,
|
|
134
|
+
database: values.database,
|
|
135
|
+
user: values.user,
|
|
136
|
+
password: values.password,
|
|
137
|
+
connectionString: values['connection-string'],
|
|
138
|
+
ssl: values.ssl,
|
|
139
|
+
dryRun: values['dry-run'],
|
|
140
|
+
command: positionals[0],
|
|
141
|
+
subCommand: positionals[1]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async function createDb(config) {
|
|
145
|
+
const db = new Db(config);
|
|
146
|
+
await db.open();
|
|
147
|
+
return db;
|
|
148
|
+
}
|
|
149
|
+
async function getSchemaVersion(db, schema) {
|
|
150
|
+
try {
|
|
151
|
+
const result = await db.executeSql(plans.versionTableExists(schema));
|
|
152
|
+
if (!result.rows[0].name) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const versionResult = await db.executeSql(plans.getVersion(schema));
|
|
156
|
+
return versionResult.rows.length ? parseInt(versionResult.rows[0].version) : null;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function cmdVersion(args) {
|
|
163
|
+
const config = getConnectionConfig(args);
|
|
164
|
+
const schema = config.schema || plans.DEFAULT_SCHEMA;
|
|
165
|
+
const db = await createDb(config);
|
|
166
|
+
try {
|
|
167
|
+
const version = await getSchemaVersion(db, schema);
|
|
168
|
+
if (version === null) {
|
|
169
|
+
console.log(`pg-boss is not installed in schema "${schema}"`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
console.log(`Current schema version: ${version}`);
|
|
173
|
+
console.log(`Latest schema version: ${schemaVersion}`);
|
|
174
|
+
if (version < schemaVersion) {
|
|
175
|
+
console.log(`Migrations pending: ${schemaVersion - version}`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
console.log('Schema is up to date');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
await db.close();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async function cmdCreate(args) {
|
|
187
|
+
const config = getConnectionConfig(args);
|
|
188
|
+
const schema = config.schema || plans.DEFAULT_SCHEMA;
|
|
189
|
+
if (args.dryRun) {
|
|
190
|
+
const sql = plans.create(schema, schemaVersion, { createSchema: true });
|
|
191
|
+
console.log('-- SQL to create pg-boss schema:');
|
|
192
|
+
console.log(sql);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const db = await createDb(config);
|
|
196
|
+
try {
|
|
197
|
+
const version = await getSchemaVersion(db, schema);
|
|
198
|
+
if (version !== null) {
|
|
199
|
+
console.log(`pg-boss is already installed in schema "${schema}" at version ${version}`);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
console.log(`Creating pg-boss schema "${schema}"...`);
|
|
203
|
+
const sql = plans.create(schema, schemaVersion, { createSchema: true });
|
|
204
|
+
await db.executeSql(sql);
|
|
205
|
+
console.log(`Successfully created pg-boss schema "${schema}" at version ${schemaVersion}`);
|
|
206
|
+
}
|
|
207
|
+
finally {
|
|
208
|
+
await db.close();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function cmdMigrate(args) {
|
|
212
|
+
const config = getConnectionConfig(args);
|
|
213
|
+
const schema = config.schema || plans.DEFAULT_SCHEMA;
|
|
214
|
+
if (args.dryRun) {
|
|
215
|
+
const sql = migrationStore.migrate(schema, 0);
|
|
216
|
+
console.log('-- SQL to migrate pg-boss from version 0 to latest:');
|
|
217
|
+
console.log(sql);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const db = await createDb(config);
|
|
221
|
+
try {
|
|
222
|
+
const version = await getSchemaVersion(db, schema);
|
|
223
|
+
if (version === null) {
|
|
224
|
+
console.log(`pg-boss is not installed. Creating schema "${schema}"...`);
|
|
225
|
+
const sql = plans.create(schema, schemaVersion, { createSchema: true });
|
|
226
|
+
await db.executeSql(sql);
|
|
227
|
+
console.log(`Successfully created pg-boss schema "${schema}" at version ${schemaVersion}`);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (version >= schemaVersion) {
|
|
231
|
+
console.log(`pg-boss schema "${schema}" is already at version ${version} (latest: ${schemaVersion})`);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
console.log(`Migrating pg-boss schema "${schema}" from version ${version} to ${schemaVersion}...`);
|
|
235
|
+
const sql = migrationStore.migrate(schema, version);
|
|
236
|
+
await db.executeSql(sql);
|
|
237
|
+
console.log(`Successfully migrated pg-boss schema "${schema}" to version ${schemaVersion}`);
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
await db.close();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async function cmdRollback(args) {
|
|
244
|
+
const config = getConnectionConfig(args);
|
|
245
|
+
const schema = config.schema || plans.DEFAULT_SCHEMA;
|
|
246
|
+
const db = await createDb(config);
|
|
247
|
+
try {
|
|
248
|
+
const version = await getSchemaVersion(db, schema);
|
|
249
|
+
if (version === null) {
|
|
250
|
+
console.log(`pg-boss is not installed in schema "${schema}"`);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (version <= 1) {
|
|
254
|
+
console.log('Cannot rollback: already at minimum version');
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (args.dryRun) {
|
|
258
|
+
const sql = migrationStore.rollback(schema, version);
|
|
259
|
+
console.log(`-- SQL to rollback pg-boss from version ${version} to ${version - 1}:`);
|
|
260
|
+
console.log(sql);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
console.log(`Rolling back pg-boss schema "${schema}" from version ${version} to ${version - 1}...`);
|
|
264
|
+
const sql = migrationStore.rollback(schema, version);
|
|
265
|
+
await db.executeSql(sql);
|
|
266
|
+
console.log(`Successfully rolled back pg-boss schema "${schema}" to version ${version - 1}`);
|
|
267
|
+
}
|
|
268
|
+
finally {
|
|
269
|
+
await db.close();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async function cmdPlans(args) {
|
|
273
|
+
const fileConfig = loadConfigFile(args.config);
|
|
274
|
+
const schema = args.schema || process.env.PGBOSS_SCHEMA || fileConfig.schema || plans.DEFAULT_SCHEMA;
|
|
275
|
+
const subCommand = args.subCommand || 'migrate';
|
|
276
|
+
switch (subCommand) {
|
|
277
|
+
case 'create':
|
|
278
|
+
case 'construct':
|
|
279
|
+
console.log('-- SQL to create pg-boss schema:');
|
|
280
|
+
console.log(plans.create(schema, schemaVersion, { createSchema: true }));
|
|
281
|
+
break;
|
|
282
|
+
case 'migrate':
|
|
283
|
+
console.log('-- SQL to migrate pg-boss (from version 0 to latest):');
|
|
284
|
+
console.log(migrationStore.migrate(schema, 0));
|
|
285
|
+
break;
|
|
286
|
+
case 'rollback':
|
|
287
|
+
console.log(`-- SQL to rollback pg-boss from version ${schemaVersion} to ${schemaVersion - 1}:`);
|
|
288
|
+
console.log(migrationStore.rollback(schema, schemaVersion));
|
|
289
|
+
break;
|
|
290
|
+
default:
|
|
291
|
+
console.error(`Unknown plans subcommand: ${subCommand}`);
|
|
292
|
+
console.error('Available: create, migrate, rollback');
|
|
293
|
+
process.exit(1);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
async function main() {
|
|
297
|
+
const args = parseCliArgs();
|
|
298
|
+
if (args.help || !args.command) {
|
|
299
|
+
printHelp();
|
|
300
|
+
process.exit(0);
|
|
301
|
+
}
|
|
302
|
+
try {
|
|
303
|
+
switch (args.command) {
|
|
304
|
+
case 'version':
|
|
305
|
+
await cmdVersion(args);
|
|
306
|
+
break;
|
|
307
|
+
case 'create':
|
|
308
|
+
await cmdCreate(args);
|
|
309
|
+
break;
|
|
310
|
+
case 'migrate':
|
|
311
|
+
await cmdMigrate(args);
|
|
312
|
+
break;
|
|
313
|
+
case 'rollback':
|
|
314
|
+
await cmdRollback(args);
|
|
315
|
+
break;
|
|
316
|
+
case 'plans':
|
|
317
|
+
await cmdPlans(args);
|
|
318
|
+
break;
|
|
319
|
+
default:
|
|
320
|
+
console.error(`Unknown command: ${args.command}`);
|
|
321
|
+
console.error('Run "pg-boss --help" for available commands.');
|
|
322
|
+
process.exit(1);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
console.error(`Error: ${err.message}`);
|
|
327
|
+
if (process.env.DEBUG) {
|
|
328
|
+
console.error(err.stack);
|
|
329
|
+
}
|
|
330
|
+
process.exit(1);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
main();
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,11 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
44
44
|
deleteAllJobs(name?: string): Promise<void>;
|
|
45
45
|
complete(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
46
46
|
fail(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use findJobs() instead
|
|
49
|
+
*/
|
|
47
50
|
getJobById<T>(name: string, id: string, options?: types.ConnectionOptions): Promise<types.JobWithMetadata<T> | null>;
|
|
51
|
+
findJobs<T>(name: string, options?: types.FindJobsOptions): Promise<types.JobWithMetadata<T>[]>;
|
|
48
52
|
createQueue(name: string, options?: Omit<types.Queue, 'name'>): Promise<void>;
|
|
49
53
|
updateQueue(name: string, options?: types.UpdateQueueOptions): Promise<void>;
|
|
50
54
|
deleteQueue(name: string): Promise<void>;
|
|
@@ -59,8 +63,10 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
59
63
|
schedule(name: string, cron: string, data?: object | null, options?: types.ScheduleOptions): Promise<void>;
|
|
60
64
|
unschedule(name: string, key?: string): Promise<void>;
|
|
61
65
|
getSchedules(name?: string, key?: string): Promise<types.Schedule[]>;
|
|
66
|
+
getBamStatus(): Promise<types.BamStatusSummary[]>;
|
|
67
|
+
getBamEntries(): Promise<types.BamEntry[]>;
|
|
62
68
|
getDb(): types.IDatabase;
|
|
63
69
|
}
|
|
64
|
-
export type { ConnectionOptions, ConstructorOptions, FetchOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobPollingOptions, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, Queue, QueueOptions, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, WipData, WorkHandler, WorkOptions, WorkWithMetadataHandler, } from './types.ts';
|
|
70
|
+
export type { BamEntry, BamEvent, BamStatusSummary, ConnectionOptions, ConstructorOptions, FetchOptions, FindJobsOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobPollingOptions, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, Queue, QueueOptions, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, WipData, WorkHandler, WorkOptions, WorkWithMetadataHandler, } from './types.ts';
|
|
65
71
|
export type { JobSpyInterface, JobSpyState, JobDataSelector, JobSelector, SpyJob, } from './spy.ts';
|
|
66
72
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAQtC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AACvD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,MAMzB,CAAA;AAEF,wBAAgB,oBAAoB,CAAE,MAAM,CAAC,EAAE,MAAM,UAEpD;AAED,wBAAgB,iBAAiB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAEnE;AAED,wBAAgB,gBAAgB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAElE;AAED,qBAAa,MAAO,SAAQ,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC;;gBAa/C,gBAAgB,EAAE,MAAM;gBACxB,OAAO,EAAE,KAAK,CAAC,kBAAkB;IA6CxC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAsCvB,IAAI,CAAE,OAAO,GAA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,EACb,GAAG,EACH,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,KAAK,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,OAAO,EACP,WAAW,EACX,WAAW,EACX,uBAAuB,GACxB,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,WAAW,EACX,MAAM,GACP,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,9 @@ import Contractor from "./contractor.js";
|
|
|
4
4
|
import Manager from "./manager.js";
|
|
5
5
|
import Timekeeper from "./timekeeper.js";
|
|
6
6
|
import Boss from "./boss.js";
|
|
7
|
+
import Bam from "./bam.js";
|
|
7
8
|
import { delay } from "./tools.js";
|
|
9
|
+
import * as plans from "./plans.js";
|
|
8
10
|
import DbDefault from "./db.js";
|
|
9
11
|
export { JOB_STATES as states } from "./plans.js";
|
|
10
12
|
export { QUEUE_POLICIES as policies } from "./plans.js";
|
|
@@ -12,7 +14,8 @@ export const events = Object.freeze({
|
|
|
12
14
|
error: 'error',
|
|
13
15
|
warning: 'warning',
|
|
14
16
|
wip: 'wip',
|
|
15
|
-
stopped: 'stopped'
|
|
17
|
+
stopped: 'stopped',
|
|
18
|
+
bam: 'bam'
|
|
16
19
|
});
|
|
17
20
|
export function getConstructionPlans(schema) {
|
|
18
21
|
return Contractor.constructionPlans(schema);
|
|
@@ -34,6 +37,7 @@ export class PgBoss extends EventEmitter {
|
|
|
34
37
|
#contractor;
|
|
35
38
|
#manager;
|
|
36
39
|
#timekeeper;
|
|
40
|
+
#bam;
|
|
37
41
|
constructor(value) {
|
|
38
42
|
super();
|
|
39
43
|
this.#stoppingOn = null;
|
|
@@ -50,13 +54,16 @@ export class PgBoss extends EventEmitter {
|
|
|
50
54
|
const boss = new Boss(db, manager, config);
|
|
51
55
|
const timekeeper = new Timekeeper(db, manager, config);
|
|
52
56
|
manager.timekeeper = timekeeper;
|
|
57
|
+
const bam = new Bam(db, config);
|
|
53
58
|
this.#promoteEvents(manager);
|
|
54
59
|
this.#promoteEvents(boss);
|
|
55
60
|
this.#promoteEvents(timekeeper);
|
|
61
|
+
this.#promoteEvents(bam);
|
|
56
62
|
this.#boss = boss;
|
|
57
63
|
this.#contractor = contractor;
|
|
58
64
|
this.#manager = manager;
|
|
59
65
|
this.#timekeeper = timekeeper;
|
|
66
|
+
this.#bam = bam;
|
|
60
67
|
}
|
|
61
68
|
#promoteEvents(emitter) {
|
|
62
69
|
for (const event of Object.values(emitter?.events)) {
|
|
@@ -84,6 +91,9 @@ export class PgBoss extends EventEmitter {
|
|
|
84
91
|
if (this.#config.schedule) {
|
|
85
92
|
await this.#timekeeper.start();
|
|
86
93
|
}
|
|
94
|
+
if (this.#config.migrate) {
|
|
95
|
+
await this.#bam.start();
|
|
96
|
+
}
|
|
87
97
|
this.#starting = false;
|
|
88
98
|
this.#started = true;
|
|
89
99
|
this.#stopped = false;
|
|
@@ -99,6 +109,7 @@ export class PgBoss extends EventEmitter {
|
|
|
99
109
|
await this.#manager.stop();
|
|
100
110
|
await this.#timekeeper.stop();
|
|
101
111
|
await this.#boss.stop();
|
|
112
|
+
await this.#bam.stop();
|
|
102
113
|
const shutdown = async () => {
|
|
103
114
|
await this.#manager.failWip();
|
|
104
115
|
if (this.#db._pgbdb && this.#db.opened && close) {
|
|
@@ -182,9 +193,15 @@ export class PgBoss extends EventEmitter {
|
|
|
182
193
|
fail(name, id, data, options) {
|
|
183
194
|
return this.#manager.fail(name, id, data, options);
|
|
184
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated Use findJobs() instead
|
|
198
|
+
*/
|
|
185
199
|
getJobById(name, id, options) {
|
|
186
200
|
return this.#manager.getJobById(name, id, options);
|
|
187
201
|
}
|
|
202
|
+
findJobs(name, options) {
|
|
203
|
+
return this.#manager.findJobs(name, options);
|
|
204
|
+
}
|
|
188
205
|
createQueue(name, options) {
|
|
189
206
|
return this.#manager.createQueue(name, options);
|
|
190
207
|
}
|
|
@@ -227,6 +244,16 @@ export class PgBoss extends EventEmitter {
|
|
|
227
244
|
getSchedules(name, key) {
|
|
228
245
|
return this.#timekeeper.getSchedules(name, key);
|
|
229
246
|
}
|
|
247
|
+
async getBamStatus() {
|
|
248
|
+
const sql = plans.getBamStatus(this.#config.schema);
|
|
249
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
250
|
+
return rows;
|
|
251
|
+
}
|
|
252
|
+
async getBamEntries() {
|
|
253
|
+
const sql = plans.getBamEntries(this.#config.schema);
|
|
254
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
255
|
+
return rows;
|
|
256
|
+
}
|
|
230
257
|
getDb() {
|
|
231
258
|
if (this.#db) {
|
|
232
259
|
return this.#db;
|
package/dist/manager.d.ts
CHANGED
|
@@ -55,7 +55,9 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
55
55
|
sendThrottled(name: string, data: object | null, options: types.SendOptions | null, seconds: number, key?: string): Promise<string | null>;
|
|
56
56
|
sendDebounced(name: string, data: object | null, options: types.SendOptions | null, seconds: number, key?: string): Promise<string | null>;
|
|
57
57
|
createJob(request: types.Request): Promise<string | null>;
|
|
58
|
-
insert(name: string, jobs: types.JobInsert[], options?: types.InsertOptions
|
|
58
|
+
insert(name: string, jobs: types.JobInsert[], options?: types.InsertOptions & {
|
|
59
|
+
returnId?: boolean;
|
|
60
|
+
}): Promise<string[] | null>;
|
|
59
61
|
getDebounceStartAfter(singletonSeconds: number, clockOffset: number): number;
|
|
60
62
|
fetch<T>(name: string): Promise<types.Job<T>[]>;
|
|
61
63
|
fetch<T>(name: string, options: types.FetchOptions & {
|
|
@@ -67,9 +69,10 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
67
69
|
private mapCommandResponse;
|
|
68
70
|
complete(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
69
71
|
fail(name: string, id: string | string[], data?: any, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
70
|
-
cancel(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
71
72
|
deleteJob(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
73
|
+
cancel(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
72
74
|
resume(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
75
|
+
restore(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<void>;
|
|
73
76
|
retry(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
74
77
|
createQueue(name: string, options?: Omit<types.Queue, 'name'> & {
|
|
75
78
|
name?: string;
|
|
@@ -83,6 +86,7 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
83
86
|
deleteAllJobs(name?: string): Promise<void>;
|
|
84
87
|
getQueueStats(name: string): Promise<any>;
|
|
85
88
|
getJobById<T>(name: string, id: string, options?: types.ConnectionOptions): Promise<types.JobWithMetadata<T> | null>;
|
|
89
|
+
findJobs<T>(name: string, options?: types.FindJobsOptions): Promise<types.JobWithMetadata<T>[]>;
|
|
86
90
|
private assertDb;
|
|
87
91
|
}
|
|
88
92
|
export default Manager;
|
package/dist/manager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,aAAa,CAAA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