@jacebenson/jsn 4.3.7-dev.31 → 4.3.7-dev.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacebenson/jsn",
3
- "version": "4.3.7-dev.31",
3
+ "version": "4.3.7-dev.32",
4
4
  "description": "A command-line interface for ServiceNow that follows the Unix philosophy: simple, composable, and scriptable.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -457,12 +457,21 @@ export function midserversCmd(wrap) {
457
457
  const responseError = getStringField(response, 'error');
458
458
  if (responseError) throw new Error(`MID Server command failed: ${responseError}`);
459
459
  const result = parseCommandResult(queueValue(response.payload));
460
+ const responseSysId = unwrapSysId(response);
461
+ const responseURL = responseSysId
462
+ ? new URL(`/ecc_queue.do?sys_id=${encodeURIComponent(responseSysId)}`, app.getEffectiveInstance()).href
463
+ : '';
464
+ const summary = `Executed command on MID Server '${getStringField(record, 'name')}'`;
465
+ const lines = [summary, '', result.stdout || '(no stdout)'];
466
+ if (result.stderr) lines.push('', 'stderr:', result.stderr);
467
+ if (responseURL) lines.push('', `ECC input: ${responseURL}`);
460
468
  app.ok({
461
469
  mid_server: getStringField(record, 'name'),
462
470
  command,
463
471
  output: { sys_id: outputSysId, ...output },
464
- response: { ...response, ...result },
465
- }, { summary: `Executed command on MID Server '${getStringField(record, 'name')}'` });
472
+ response: { ...response, ...result, url: responseURL },
473
+ _formatted: `${lines.join('\n')}\n`,
474
+ }, { summary });
466
475
  }),
467
476
  }),
468
477
  handler: () => {