@ivotoby/postgram-cli 1.1.0 → 1.3.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 +3 -0
- package/dist/client.js +3 -0
- package/dist/pgm.js +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/client.js
CHANGED
|
@@ -159,6 +159,9 @@ export function createPgmClient(options) {
|
|
|
159
159
|
const query = qs.toString();
|
|
160
160
|
return request(options, `/api/entities/${entityId}/edges${query ? `?${query}` : ''}`);
|
|
161
161
|
},
|
|
162
|
+
getQueueStatus() {
|
|
163
|
+
return request(options, '/api/queue');
|
|
164
|
+
},
|
|
162
165
|
expandGraph(entityId, params = {}) {
|
|
163
166
|
const qs = new URLSearchParams();
|
|
164
167
|
if (params.depth !== undefined)
|
package/dist/pgm.js
CHANGED
|
@@ -476,6 +476,29 @@ taskCommand
|
|
|
476
476
|
});
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
|
+
program
|
|
480
|
+
.command('queue')
|
|
481
|
+
.description('Show enrichment and extraction queue status')
|
|
482
|
+
.action(async (_options, command) => {
|
|
483
|
+
await runWithClient(command, async (client, json) => {
|
|
484
|
+
const body = await client.getQueueStatus();
|
|
485
|
+
if (json)
|
|
486
|
+
return body;
|
|
487
|
+
const e = body.embedding;
|
|
488
|
+
const age = e.oldest_pending_secs !== null ? ` oldest_pending=${e.oldest_pending_secs}s` : '';
|
|
489
|
+
const lines = [
|
|
490
|
+
`embedding: pending=${e.pending} completed=${e.completed} failed=${e.failed} retry_eligible=${e.retry_eligible}${age}`
|
|
491
|
+
];
|
|
492
|
+
if (body.extraction) {
|
|
493
|
+
const x = body.extraction;
|
|
494
|
+
lines.push(`extraction: pending=${x.pending} completed=${x.completed} failed=${x.failed}`);
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
lines.push('extraction: disabled');
|
|
498
|
+
}
|
|
499
|
+
return lines;
|
|
500
|
+
});
|
|
501
|
+
});
|
|
479
502
|
program
|
|
480
503
|
.command('backup')
|
|
481
504
|
.description('Create a database backup')
|