@kolatts/pncli 6.1.0 → 6.2.1

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.
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  HttpClient,
4
4
  createHttpClient
5
- } from "./chunk-Y3PO2RTO.js";
6
- import "./chunk-BOFSNQQ2.js";
5
+ } from "./chunk-RZV64BWP.js";
6
+ import "./chunk-MBJ4ZYL7.js";
7
7
  import "./chunk-HRNOAQDN.js";
8
8
  export {
9
9
  HttpClient,
10
10
  createHttpClient
11
11
  };
12
- //# sourceMappingURL=http-3FAKF3X4.js.map
12
+ //# sourceMappingURL=http-F24ORY6C.js.map
@@ -9,7 +9,7 @@ import {
9
9
  success,
10
10
  warn,
11
11
  writeRawOutput
12
- } from "./chunk-BOFSNQQ2.js";
12
+ } from "./chunk-MBJ4ZYL7.js";
13
13
  import "./chunk-HRNOAQDN.js";
14
14
  export {
15
15
  debug,
@@ -22,4 +22,4 @@ export {
22
22
  warn,
23
23
  writeRawOutput
24
24
  };
25
- //# sourceMappingURL=output-HDUIIXUI.js.map
25
+ //# sourceMappingURL=output-XE6XDAAR.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolatts/pncli",
3
- "version": "6.1.0",
3
+ "version": "6.2.1",
4
4
  "description": "The Paperwork Nightmare CLI — structured JSON access to Jira, Bitbucket, GitHub, Confluence, Azure DevOps, SonarQube, Jenkins, and more, built for AI coding agents. Connectivity without MCP.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@ The JWT decode command is self-contained and does not require any configuration
12
12
  pncli jwt decode <token>
13
13
  ```
14
14
 
15
- Returns structured JSON with the decoded header, payload, and raw signature:
15
+ Returns structured JSON with the decoded header, payload, and raw signature (shown here as `<signature>` so secret scanners don't flag the docs; the real command returns the token's base64url signature segment):
16
16
 
17
17
  ```json
18
18
  {
@@ -29,7 +29,7 @@ Returns structured JSON with the decoded header, payload, and raw signature:
29
29
  "name": "John Doe",
30
30
  "iat": 1516239022
31
31
  },
32
- "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
32
+ "signature": "<signature>"
33
33
  }
34
34
  }
35
35
  ```
@@ -27,11 +27,11 @@ Example:
27
27
 
28
28
  ```bash
29
29
  pncli config set openshift.environments.non-prod.instances.us-east.baseUrl https://api.np-us-east.imagile.dev:6443
30
- pncli config set openshift.environments.non-prod.instances.us-east.token eyJhbGciOiJSUzI1NiI...
30
+ pncli config set openshift.environments.non-prod.instances.us-east.token <token>
31
31
  pncli config set openshift.environments.non-prod.instances.eu-west.baseUrl https://api.np-eu-west.imagile.dev:6443
32
- pncli config set openshift.environments.non-prod.instances.eu-west.token eyJhbGciOiJSUzI1NiI...
32
+ pncli config set openshift.environments.non-prod.instances.eu-west.token <token>
33
33
  pncli config set openshift.environments.prod-us.instances.primary.baseUrl https://api.prod-us.imagile.dev:6443
34
- pncli config set openshift.environments.prod-us.instances.primary.token eyJhbGciOiJSUzI1NiI...
34
+ pncli config set openshift.environments.prod-us.instances.primary.token <token>
35
35
 
36
36
  # Set defaults so --env / --instance can be omitted
37
37
  pncli config set openshift.defaultEnvironment non-prod
@@ -70,14 +70,14 @@ curl -H "Authorization: Bearer $EXISTING_TOKEN" \
70
70
 
71
71
  ```bash
72
72
  export PNCLI_OPENSHIFT_BASE_URL=https://api.cluster.imagile.dev:6443
73
- export PNCLI_OPENSHIFT_TOKEN=eyJhbGciOiJSUzI1NiI...
73
+ export PNCLI_OPENSHIFT_TOKEN=<token>
74
74
  ```
75
75
 
76
76
  ## Set via config file (persistent)
77
77
 
78
78
  ```bash
79
79
  pncli config set openshift.baseUrl https://api.cluster.imagile.dev:6443
80
- pncli config set openshift.token eyJhbGciOiJSUzI1NiI...
80
+ pncli config set openshift.token <token>
81
81
  ```
82
82
 
83
83
  Or run the interactive wizard:
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/output.ts","../src/lib/exitCodes.ts"],"sourcesContent":["import fs from 'fs';\nimport chalk from 'chalk';\nimport type { Meta, SuccessEnvelope, ErrorEnvelope, ErrorDetail } from '../types/common.js';\nimport { PncliError } from './errors.js';\nimport { ExitCode, exitCodeFromStatus } from './exitCodes.js';\n\nlet globalOptions = { pretty: false, verbose: false, debug: false };\nlet globalUser: { email: string | undefined; userId: string | undefined } = { email: undefined, userId: undefined };\nlet outputFile: string | undefined;\n\nexport function setGlobalOptions(opts: { pretty: boolean; verbose: boolean; debug?: boolean; outputFile?: string }): void {\n globalOptions = { pretty: opts.pretty, verbose: opts.verbose, debug: opts.debug ?? false };\n outputFile = opts.outputFile;\n}\n\nexport function isDebugEnabled(): boolean {\n return globalOptions.debug;\n}\n\nexport function setGlobalUser(user: { email: string | undefined; userId: string | undefined }): void {\n globalUser = user;\n}\n\nfunction buildMeta(service: string, action: string, startTime: number, overrides?: string[]): Meta {\n return {\n service,\n action,\n timestamp: new Date().toISOString(),\n duration_ms: Date.now() - startTime,\n user: (globalUser.email ?? globalUser.userId) ? globalUser : undefined,\n overrides: overrides && overrides.length > 0 ? overrides : undefined\n };\n}\n\nfunction writeToFile(filePath: string, content: string): void {\n try {\n fs.writeFileSync(filePath, content, 'utf8');\n } catch (writeErr) {\n process.stderr.write(\n `Warning: could not write to output file \"${filePath}\": ${(writeErr as NodeJS.ErrnoException).message}\\n`\n );\n process.exitCode = ExitCode.GENERAL_ERROR;\n }\n}\n\nexport function success<T>(data: T, service: string, action: string, startTime: number, overrides?: string[]): void {\n const envelope: SuccessEnvelope<T> = {\n ok: true,\n data,\n meta: buildMeta(service, action, startTime, overrides)\n };\n const out = (globalOptions.pretty ? JSON.stringify(envelope, null, 2) : JSON.stringify(envelope)) + '\\n';\n if (outputFile) {\n writeToFile(outputFile, out);\n } else {\n process.stdout.write(out);\n }\n}\n\nexport function fail(\n err: unknown,\n service: string,\n action: string,\n startTime: number\n): never {\n const errorDetail: ErrorDetail = {\n status: err instanceof PncliError ? err.status : 1,\n message: err instanceof Error ? err.message : String(err),\n url: err instanceof PncliError ? (err.url ?? null) : null,\n retryAfterSeconds: err instanceof PncliError ? err.retryAfterSeconds : undefined\n };\n\n const envelope: ErrorEnvelope = {\n ok: false,\n error: errorDetail,\n meta: buildMeta(service, action, startTime)\n };\n\n const msg = globalOptions.pretty\n ? chalk.red('✗ Error: ') + errorDetail.message\n : null;\n\n if (msg) process.stderr.write(msg + '\\n');\n\n const output = (globalOptions.pretty ? JSON.stringify(envelope, null, 2) : JSON.stringify(envelope)) + '\\n';\n const exitCode = err instanceof PncliError ? exitCodeFromStatus(err.status) : ExitCode.GENERAL_ERROR;\n if (outputFile) {\n writeToFile(outputFile, output);\n } else {\n try {\n fs.writeSync(process.stdout.fd, output);\n } catch (writeErr) {\n if ((writeErr as NodeJS.ErrnoException).code !== 'EPIPE') throw writeErr;\n }\n }\n process.exitCode = exitCode;\n throw new PncliError(errorDetail.message, errorDetail.status);\n}\n\nexport function writeRawOutput(content: string): void {\n if (outputFile) {\n writeToFile(outputFile, content);\n } else {\n process.stdout.write(content);\n }\n}\n\nexport function log(message: string): void {\n if (globalOptions.verbose) {\n process.stderr.write(\n (globalOptions.pretty ? chalk.gray('▸ ') : '') + message + '\\n'\n );\n }\n}\n\nexport function debug(message: string): void {\n if (globalOptions.debug) {\n process.stderr.write(\n (globalOptions.pretty ? chalk.cyan('⬡ ') : '') + message + '\\n'\n );\n }\n}\n\nexport function warn(message: string): void {\n process.stderr.write(\n (globalOptions.pretty ? chalk.yellow('⚠ ') : '') + message + '\\n'\n );\n}\n","export const ExitCode = {\n SUCCESS: 0,\n GENERAL_ERROR: 1,\n USAGE_ERROR: 2,\n NETWORK_ERROR: 69, // EX_UNAVAILABLE from sysexits.h\n AUTH_ERROR: 77, // EX_NOPERM from sysexits.h\n CONFIG_ERROR: 78, // EX_CONFIG from sysexits.h\n} as const;\n\nexport type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];\n\nexport function exitCodeFromStatus(httpStatus: number): ExitCode {\n if (httpStatus === 401 || httpStatus === 403) return ExitCode.AUTH_ERROR;\n if (httpStatus === 0) return ExitCode.NETWORK_ERROR;\n return ExitCode.GENERAL_ERROR;\n}\n"],"mappings":";;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,WAAW;;;ACDX,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA;AAAA,EACf,YAAY;AAAA;AAAA,EACZ,cAAc;AAAA;AAChB;AAIO,SAAS,mBAAmB,YAA8B;AAC/D,MAAI,eAAe,OAAO,eAAe,IAAK,QAAO,SAAS;AAC9D,MAAI,eAAe,EAAG,QAAO,SAAS;AACtC,SAAO,SAAS;AAClB;;;ADTA,IAAI,gBAAgB,EAAE,QAAQ,OAAO,SAAS,OAAO,OAAO,MAAM;AAClE,IAAI,aAAwE,EAAE,OAAO,QAAW,QAAQ,OAAU;AAClH,IAAI;AAEG,SAAS,iBAAiB,MAAyF;AACxH,kBAAgB,EAAE,QAAQ,KAAK,QAAQ,SAAS,KAAK,SAAS,OAAO,KAAK,SAAS,MAAM;AACzF,eAAa,KAAK;AACpB;AAEO,SAAS,iBAA0B;AACxC,SAAO,cAAc;AACvB;AAEO,SAAS,cAAc,MAAuE;AACnG,eAAa;AACf;AAEA,SAAS,UAAU,SAAiB,QAAgB,WAAmB,WAA4B;AACjG,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,IAClC,aAAa,KAAK,IAAI,IAAI;AAAA,IAC1B,MAAO,WAAW,SAAS,WAAW,SAAU,aAAa;AAAA,IAC7D,WAAW,aAAa,UAAU,SAAS,IAAI,YAAY;AAAA,EAC7D;AACF;AAEA,SAAS,YAAY,UAAkB,SAAuB;AAC5D,MAAI;AACF,OAAG,cAAc,UAAU,SAAS,MAAM;AAAA,EAC5C,SAAS,UAAU;AACjB,YAAQ,OAAO;AAAA,MACb,4CAA4C,QAA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