diffpx 0.0.4 → 0.0.6

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/runner.js +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffpx",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "bin": {
5
5
  "diffpx": "bin/diffpx.js"
6
6
  },
package/src/runner.js CHANGED
@@ -45,13 +45,15 @@ function getProgress(status) {
45
45
  };
46
46
  }
47
47
 
48
- async function runJob({diffpxKey, payload}) {
48
+ async function runJob({ppKey, payload}) {
49
49
  const multiBar = new cliProgress.MultiBar({
50
50
  clearOnComplete: false,
51
51
  hideCursor: true,
52
52
  barCompleteChar: '█',
53
53
  barIncompleteChar: '░',
54
- format: '{name} [{bar}] {percentage}% | {value}/{total}'
54
+ format: '{name} [{bar}] {percentage}% | {value}/{total}',
55
+ noTTYOutput: true,
56
+ notTTYSchedule: 500
55
57
  }, cliProgress.Presets.shades_classic);
56
58
 
57
59
  const initialSnapshotsTotal = Array.isArray(payload?.snapshots) ? payload.snapshots.length : 1;
@@ -72,15 +74,14 @@ async function runJob({diffpxKey, payload}) {
72
74
  let jobId = null;
73
75
 
74
76
  try {
75
- const diffpxUrl = process.env.DIFFPX_URL || '';
76
- const res = await submitRun(diffpxUrl, diffpxKey, payload);
77
+ const res = await submitRun(ppKey, payload);
77
78
  jobId = res?.jobId || res?.id || res?.job_id || res?.data?.jobId || null;
78
79
  if (!jobId) {
79
80
  throw new Error('Server did not return a job id');
80
81
  }
81
82
 
82
- const finalStatus = await pollRun(diffpxUrl, diffpxKey, jobId, {
83
- intervalMs: Number(process.env.DIFFPX_POLL_INTERVAL_MS || 1000),
83
+ const finalStatus = await pollRun(ppKey, jobId, {
84
+ intervalMs: Number(process.env.PP_POLL_INTERVAL_MS || 1000),
84
85
  onStatus: (status) => {
85
86
  const p = getProgress(status);
86
87