@zuplo/cli 6.70.14 → 6.70.16

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 (67) hide show
  1. package/dist/ca-certificate/create/handler.d.ts +3 -0
  2. package/dist/ca-certificate/create/handler.d.ts.map +1 -0
  3. package/dist/ca-certificate/create/handler.js +46 -0
  4. package/dist/ca-certificate/create/handler.js.map +1 -0
  5. package/dist/ca-certificate/delete/handler.d.ts +3 -0
  6. package/dist/ca-certificate/delete/handler.d.ts.map +1 -0
  7. package/dist/ca-certificate/delete/handler.js +18 -0
  8. package/dist/ca-certificate/delete/handler.js.map +1 -0
  9. package/dist/ca-certificate/describe/handler.d.ts +3 -0
  10. package/dist/ca-certificate/describe/handler.d.ts.map +1 -0
  11. package/dist/ca-certificate/describe/handler.js +32 -0
  12. package/dist/ca-certificate/describe/handler.js.map +1 -0
  13. package/dist/ca-certificate/list/handler.d.ts +3 -0
  14. package/dist/ca-certificate/list/handler.d.ts.map +1 -0
  15. package/dist/ca-certificate/list/handler.js +28 -0
  16. package/dist/ca-certificate/list/handler.js.map +1 -0
  17. package/dist/ca-certificate/models.d.ts +51 -0
  18. package/dist/ca-certificate/models.d.ts.map +1 -0
  19. package/dist/ca-certificate/models.js +2 -0
  20. package/dist/ca-certificate/models.js.map +1 -0
  21. package/dist/ca-certificate/update/handler.d.ts +3 -0
  22. package/dist/ca-certificate/update/handler.d.ts.map +1 -0
  23. package/dist/ca-certificate/update/handler.js +26 -0
  24. package/dist/ca-certificate/update/handler.js.map +1 -0
  25. package/dist/ca-certificate/validation.d.ts +21 -0
  26. package/dist/ca-certificate/validation.d.ts.map +1 -0
  27. package/dist/ca-certificate/validation.js +135 -0
  28. package/dist/ca-certificate/validation.js.map +1 -0
  29. package/dist/ca-certificate/validation.test.d.ts +2 -0
  30. package/dist/ca-certificate/validation.test.d.ts.map +1 -0
  31. package/dist/ca-certificate/validation.test.js +131 -0
  32. package/dist/ca-certificate/validation.test.js.map +1 -0
  33. package/dist/cli.js +2 -0
  34. package/dist/cli.js.map +1 -1
  35. package/dist/cmds/ca-certificate/create.d.ts +9 -0
  36. package/dist/cmds/ca-certificate/create.d.ts.map +1 -0
  37. package/dist/cmds/ca-certificate/create.js +66 -0
  38. package/dist/cmds/ca-certificate/create.js.map +1 -0
  39. package/dist/cmds/ca-certificate/delete.d.ts +9 -0
  40. package/dist/cmds/ca-certificate/delete.d.ts.map +1 -0
  41. package/dist/cmds/ca-certificate/delete.js +56 -0
  42. package/dist/cmds/ca-certificate/delete.js.map +1 -0
  43. package/dist/cmds/ca-certificate/describe.d.ts +9 -0
  44. package/dist/cmds/ca-certificate/describe.d.ts.map +1 -0
  45. package/dist/cmds/ca-certificate/describe.js +56 -0
  46. package/dist/cmds/ca-certificate/describe.js.map +1 -0
  47. package/dist/cmds/ca-certificate/index.d.ts +4 -0
  48. package/dist/cmds/ca-certificate/index.d.ts.map +1 -0
  49. package/dist/cmds/ca-certificate/index.js +18 -0
  50. package/dist/cmds/ca-certificate/index.js.map +1 -0
  51. package/dist/cmds/ca-certificate/list.d.ts +9 -0
  52. package/dist/cmds/ca-certificate/list.d.ts.map +1 -0
  53. package/dist/cmds/ca-certificate/list.js +48 -0
  54. package/dist/cmds/ca-certificate/list.js.map +1 -0
  55. package/dist/cmds/ca-certificate/update.d.ts +9 -0
  56. package/dist/cmds/ca-certificate/update.d.ts.map +1 -0
  57. package/dist/cmds/ca-certificate/update.js +56 -0
  58. package/dist/cmds/ca-certificate/update.js.map +1 -0
  59. package/dist/cmds/mtls-certificates/index.js +1 -1
  60. package/dist/cmds/mtls-certificates/index.js.map +1 -1
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/node_modules/@zuplo/core/package.json +1 -1
  63. package/node_modules/@zuplo/graphql/package.json +1 -1
  64. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  65. package/node_modules/@zuplo/otel/package.json +1 -1
  66. package/node_modules/@zuplo/runtime/package.json +1 -1
  67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MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,6BAA6B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAChE,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import assert from \"node:assert\";\nimport { describe, it } from \"node:test\";\nimport {\n isValidationError,\n parseAndValidateCaCertificate,\n validateName,\n} from \"./validation.js\";\n\n// Hard-coded test fixtures generated with openssl req -x509 (RSA 2048, 100y\n// validity, CN=\"Test ca\" / CN=\"Test leaf\"). Checked in so the test suite has no\n// external dependency on the openssl binary. To regenerate, see\n// `regenerate-fixtures.md` next to this file (or use the helper in the PR).\nconst CA_PEM = `-----BEGIN CERTIFICATE-----\nMIIC5jCCAc6gAwIBAgIUB4s5BPjuGshWHSZKkNIJJ7W7alkwDQYJKoZIhvcNAQEL\nBQAwEjEQMA4GA1UEAwwHVGVzdCBjYTAgFw0yNjA1MTMwMDA1NDFaGA8yMTI2MDQx\nOTAwMDU0MVowEjEQMA4GA1UEAwwHVGVzdCBjYTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAK+8kcIOYXC5SKCnnEmddLKiVSon8NoLn8RABel0op+5i3J2\npnDBBWOy2nT5qWRI2N0tTK4tQn/jaGeiBP0BUu4z+Y/pcglveexyFWhtFstHyyUr\nyiwhBhX3NEWHZGr/VShriKxojnTwWONpgQwq7On7k+We3JK7IEASvKLxhC1+hcch\nCwP67zGDF6qJrfjBfdPSRoW8OomioTRyb7MyrWvRpKm/0rj9NYc7MxMYbgVffE6y\nIVQ4UCsVw74DdebfdzBSJOwNa+2Fe8AwQ3QMVbzfE3qs6+nviQ1EJA/h0kWgIrCI\n3JvGpJinI0kD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+\nuQ4NGgWINtG23OtELLtUIuNiZxEFEO0mxf+0pIYa/1VTAgMBAAGjLzAtMAwGA1Ud\nEwEB/wQCMAAwHQYDVR0OBBYEFP5YdepOBrpmYPdem5awTb3ByLZ7MA0GCSqGSIb3\nDQEBCwUAA4IBAQBZ9Bl8IcQ9VYxTQgO1U9wB+LcHJ2WXqVSQTlz+qwd+tyfnv0PM\nO5/ouSYiCj3IBQ42N3z+QhLgZgvfGcC6qFvG67A1WV7n7ZV5D7Yb9CqE+NPUbx3V\n3GFBkIAv7U+4TKYPSK2YPXCb/D3rtel2j31tcMtODoT0LrHbwaOCGd8G+15rxBjP\ndfHuC/nYYeKsplDhcdfemel73WbNzuqGNliQhEqhtlpGOhciHpd1Zlm7OgUINmCr\nrfRfSGvBGDkuNRQIEhnFZXYhD0iCM/6D56/VykaqaQz+bPr04d0e0KvusFGsmapN\nzC0Ztm1aNp0wB0vPNoEJrpQEmkB80cR1DXVR\n-----END CERTIFICATE-----\n`;\n\ndescribe(\"validateName\", () => {\n it(\"accepts valid names\", () => {\n assert.strictEqual(validateName(\"my_ca\"), null);\n assert.strictEqual(validateName(\"CA1\"), null);\n assert.strictEqual(validateName(\"$abc\"), null);\n assert.strictEqual(validateName(\"_underscore\"), null);\n });\n\n it(\"rejects empty names\", () => {\n const result = validateName(\"\");\n assert.ok(result);\n assert.match(result.message, /empty/i);\n });\n\n it(\"rejects names over 120 characters\", () => {\n const result = validateName(\"a\".repeat(121));\n assert.ok(result);\n assert.match(result.message, /120 characters/);\n });\n\n it(\"rejects names starting with a digit\", () => {\n const result = validateName(\"1ca\");\n assert.ok(result);\n assert.match(result.message, /JavaScript variable name/);\n });\n\n it(\"rejects names with hyphens or spaces\", () => {\n assert.ok(validateName(\"my-ca\"));\n assert.ok(validateName(\"my ca\"));\n assert.ok(validateName(\"ca.example\"));\n });\n\n it(\"rejects JavaScript reserved keywords\", () => {\n for (const keyword of [\"class\", \"delete\", \"import\", \"return\", \"await\"]) {\n const result = validateName(keyword);\n assert.ok(result, `expected ${keyword} to be rejected`);\n assert.match(result.message, /reserved keyword/);\n }\n });\n\n it(\"rejects reserved keywords case-insensitively\", () => {\n assert.ok(validateName(\"CLASS\"));\n assert.ok(validateName(\"Delete\"));\n });\n});\n\ndescribe(\"parseAndValidateCaCertificate\", () => {\n it(\"rejects garbage input\", () => {\n const result = parseAndValidateCaCertificate(\"not a certificate\");\n assert.ok(isValidationError(result));\n assert.match(result.message, /PEM-encoded/);\n assert.match(result.hint ?? \"\", /openssl x509.*-inform der/);\n });\n\n it(\"rejects a PKCS#8 private key with a key-specific hint\", () => {\n const pem = `-----BEGIN PRIVATE KEY-----\\nfoo\\n-----END PRIVATE KEY-----`;\n const result = parseAndValidateCaCertificate(pem);\n assert.ok(isValidationError(result));\n assert.match(result.message, /private key/i);\n assert.match(result.hint ?? \"\", /public CA certificate/);\n });\n\n it(\"rejects an RSA private key with a key-specific hint\", () => {\n const pem = `-----BEGIN RSA PRIVATE KEY-----\\nfoo\\n-----END RSA PRIVATE KEY-----`;\n const result = parseAndValidateCaCertificate(pem);\n assert.ok(isValidationError(result));\n assert.match(result.message, /private key/i);\n });\n\n it(\"rejects a CSR with a CSR-specific hint\", () => {\n const pem = `-----BEGIN CERTIFICATE REQUEST-----\\nfoo\\n-----END CERTIFICATE REQUEST-----`;\n const result = parseAndValidateCaCertificate(pem);\n assert.ok(isValidationError(result));\n assert.match(result.message, /CSR|signing request/i);\n });\n\n it(\"rejects a PEM-shaped but corrupt certificate\", () => {\n const pem = `-----BEGIN CERTIFICATE-----\\nnot-real-base64\\n-----END CERTIFICATE-----`;\n const result = parseAndValidateCaCertificate(pem);\n assert.ok(isValidationError(result));\n assert.match(result.message, /Failed to parse/);\n });\n\n it(\"accepts a valid CA certificate\", () => {\n const result = parseAndValidateCaCertificate(CA_PEM);\n assert.ok(!isValidationError(result), JSON.stringify(result));\n assert.strictEqual(result.isCa, true);\n assert.match(result.subject, /Test ca/i);\n });\n\n it(\"rejects a leaf (non-CA) certificate\", () => {\n const result = parseAndValidateCaCertificate(LEAF_PEM);\n assert.ok(isValidationError(result));\n assert.match(result.message, /not a CA certificate/);\n });\n\n it(\"rejects a CA certificate that is expired relative to `now`\", () => {\n // The CA fixture is valid for 100 years from generation. Pass a `now` far\n // in the future to exercise the expiry branch without backdating the cert.\n const farFuture = new Date(\"2200-01-01T00:00:00Z\");\n const result = parseAndValidateCaCertificate(CA_PEM, farFuture);\n assert.ok(isValidationError(result));\n assert.match(result.message, /expired/);\n });\n});\n"]}
package/dist/cli.js CHANGED
@@ -10,6 +10,7 @@ import { hideBin } from "yargs/helpers";
10
10
  import yargs from "yargs/yargs";
11
11
  import bucket from "./cmds/bucket/index.js";
12
12
  import build from "./cmds/build.js";
13
+ import caCertificate from "./cmds/ca-certificate/index.js";
13
14
  import compile from "./cmds/compile.js";
14
15
  import customDomain from "./cmds/custom-domain/index.js";
15
16
  import deleteZup from "./cmds/delete.js";
@@ -92,6 +93,7 @@ if (gte(process.versions.node, MIN_NODE_VERSION)) {
92
93
  .middleware((argv) => {
93
94
  void captureCliInvocationEvent(argv, cliVersion);
94
95
  })
96
+ .command(caCertificate)
95
97
  .command(compile)
96
98
  .command(customDomain)
97
99
  .command(deleteZup)
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO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,GAAG,CAAC,CAAC;YAClD,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,iBAAiB,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;KAAM,CAAC;IACN,MAAM,oCAAoC,CACxC,4CAA4C,gBAAgB,oBAAoB,OAAO,CAAC,QAAQ,CAAC,IAAI;;oFAErB,CACjF,CAAC;AACJ,CAAC","sourcesContent":["import * as dotenv from \"dotenv\";\n\ndotenv.config();\n\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { confirm } from \"@inquirer/prompts\";\nimport * as Sentry from \"@sentry/node\";\nimport { gte } from \"semver\";\n// Undici must be imported first to set the global dispatcher\n// If fetch is used before undici, the process will crash\nimport undici from \"undici\";\nimport { hideBin } from \"yargs/helpers\";\nimport yargs from \"yargs/yargs\";\nimport bucket from \"./cmds/bucket/index.js\";\nimport build from \"./cmds/build.js\";\nimport compile from \"./cmds/compile.js\";\nimport customDomain from \"./cmds/custom-domain/index.js\";\nimport deleteZup from \"./cmds/delete.js\";\nimport deploy from \"./cmds/deploy.js\";\nimport dev from \"./cmds/dev.js\";\nimport docs from \"./cmds/docs.js\";\nimport editor from \"./cmds/editor.js\";\nimport info from \"./cmds/info.js\";\nimport init from \"./cmds/init.js\";\nimport link from \"./cmds/link.js\";\nimport list from \"./cmds/list.js\";\nimport login from \"./cmds/login.js\";\nimport logout from \"./cmds/logout.js\";\nimport mtlsCertificates from \"./cmds/mtls-certificates/index.js\";\nimport oas from \"./cmds/open-api/index.js\";\nimport project from \"./cmds/project/index.js\";\nimport proxies from \"./cmds/proxies/index.js\";\nimport source from \"./cmds/source/index.js\";\nimport test from \"./cmds/test.js\";\nimport tunnel from \"./cmds/tunnel/index.js\";\nimport variable from \"./cmds/variable/index.js\";\nimport whoami from \"./cmds/whoami.js\";\nimport { captureCliInvocationEvent } from \"./common/analytics/cli-invocation.js\";\nimport { shutdownAnalytics } from \"./common/analytics/lib.js\";\nimport { ApiError } from \"./common/api/client.js\";\nimport { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from \"./common/constants.js\";\nimport { logger } from \"./common/logger.js\";\nimport { checkPnpmLifecycle } from \"./common/middleware/check-pnpm-lifecycle.js\";\nimport { logLevel } from \"./common/middleware/logging.js\";\nimport { warnIfOutdatedVersion, warnNodeVersion } from \"./common/outdated.js\";\nimport setBlocking, {\n printCriticalFailureToConsole,\n printCriticalFailureToConsoleAndExit,\n} from \"./common/output.js\";\n\n// This allows us to stop the CLI from executing so we can connect the profiler\n\n// biome-ignore lint/style/noProcessEnv: Migrated from ESLint\nif (process.env.ZUPLO_CLI_PROFILING) {\n await confirm({ message: \"Continue executing CLI?\", default: true });\n}\n\n// Note: We cannot set this to be higher than 18.0.0 because of the way\n// our documentation works -- we tell them to use npx @zuplo/cli@latest (even in CI/CD jobs)\n// If we set this to be higher than 18.0.0, then we will break them.\n// Instead we set the value in package.json to be engine.node >= 20.0.0, so it will warn\nconst MIN_NODE_VERSION = \"18.0.0\";\nconst RECOMMENDED_NODE_VERSION = \"20.0.0\";\n\nif (gte(process.versions.node, MIN_NODE_VERSION)) {\n let cliVersion: string;\n try {\n const packageJson = JSON.parse(\n readFileSync(\n fileURLToPath(new URL(\"../package.json\", import.meta.url)),\n \"utf-8\"\n )\n );\n cliVersion = packageJson.version;\n } catch (e) {\n cliVersion = \"0.0.0\";\n logger.error(e);\n await printCriticalFailureToConsoleAndExit(\n `Unable to load @zuplo/cli. The package.json is missing or malformed.`\n );\n }\n\n await warnNodeVersion(cliVersion, RECOMMENDED_NODE_VERSION);\n\n undici.setGlobalDispatcher(\n undici.getGlobalDispatcher().compose((dispatch) => {\n return (opts, handler) => {\n opts.headers = {\n ...opts.headers,\n \"user-agent\": `ZuploCLI/${cliVersion}`,\n\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n ...(process.env.ZUPLO_CANARY ? { \"zp-canary\": \"true\" } : {}),\n };\n return dispatch(opts, handler);\n };\n })\n );\n\n Sentry.init({\n dsn: SENTRY_DSN,\n release: cliVersion,\n });\n\n const cli = yargs(hideBin(process.argv))\n // This means that all env vars will have to be prefixed with ZUPLO_\n .env(\"ZUPLO\")\n .option(\"prompt\", {\n type: \"boolean\",\n describe: \"Bypass confirmation prompts\",\n default: true,\n hidden: true,\n })\n .option(\"verbose\", {\n alias: \"v\",\n type: \"count\",\n describe: \"Increase verbosity level (-v, -vv, -vvv)\",\n default: 0,\n })\n // setBlocking forces synchronous TTY writes so error messages flush before\n // process.exit. Runs first so subsequent middleware (including the\n // preflight, which can exit) benefit from it.\n .middleware(setBlocking)\n .middleware(logLevel)\n .middleware(checkPnpmLifecycle)\n .middleware((argv) => {\n void captureCliInvocationEvent(argv, cliVersion);\n })\n .command(compile)\n .command(customDomain)\n .command(deleteZup) // delete is a reserved keyword in JavaScript, so we call this function deleteZup\n .command(deploy)\n .command(dev)\n .command(docs)\n .command(editor)\n .command(info)\n .command(init)\n .command(list)\n .command(link)\n .command(login)\n .command(logout)\n .command(test)\n .command(oas)\n .command(mtlsCertificates)\n .command(project)\n .command(source)\n .command(tunnel)\n .command(variable)\n .command(build)\n .command(bucket)\n .command(proxies)\n .command(whoami)\n .command({\n command: \"hello\",\n handler: async () => {\n await fetch(\"https://393b4699ced44cc2ae87e4ad86184a29.api.mockbin.io/\");\n },\n })\n .demandCommand()\n .strictCommands()\n .version(cliVersion)\n .fail(false)\n .help();\n\n let exitCode = 0;\n try {\n await cli.argv;\n\n // Don't block\n void warnIfOutdatedVersion(cliVersion);\n } catch (err) {\n exitCode = 1;\n if (err instanceof Error) {\n Sentry.captureException(err);\n }\n if (err instanceof ApiError) {\n // The API client has already logged the structured error and printed\n // a user-facing diagnostic. Nothing more to display here.\n } else {\n printCriticalFailureToConsole(err.message ?? err);\n cli.showHelp();\n }\n } finally {\n await shutdownAnalytics();\n await Sentry.close(MAX_WAIT_PENDING_TIME_MS);\n process.exit(exitCode);\n }\n} else {\n await printCriticalFailureToConsoleAndExit(\n `The Zuplo CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.\n\n Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`\n );\n}\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAA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AC,MAAM,CAAC;SACf,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC;QACP,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC1E,CAAC;KACF,CAAC;SACD,aAAa,EAAE;SACf,cAAc,EAAE;SAChB,OAAO,CAAC,UAAU,CAAC;SACnB,IAAI,CAAC,KAAK,CAAC;SACX,IAAI,EAAE,CAAC;IAEV,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,CAAC;QAGf,KAAK,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,QAAQ,GAAG,CAAC,CAAC;QACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAG9B,CAAC;aAAM,CAAC;YACN,6BAA6B,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;YAClD,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,iBAAiB,EAAE,CAAC;QAC1B,MAAM,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;KAAM,CAAC;IACN,MAAM,oCAAoC,CACxC,4CAA4C,gBAAgB,oBAAoB,OAAO,CAAC,QAAQ,CAAC,IAAI;;oFAErB,CACjF,CAAC;AACJ,CAAC","sourcesContent":["import * as dotenv from \"dotenv\";\n\ndotenv.config();\n\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { confirm } from \"@inquirer/prompts\";\nimport * as Sentry from \"@sentry/node\";\nimport { gte } from \"semver\";\n// Undici must be imported first to set the global dispatcher\n// If fetch is used before undici, the process will crash\nimport undici from \"undici\";\nimport { hideBin } from \"yargs/helpers\";\nimport yargs from \"yargs/yargs\";\nimport bucket from \"./cmds/bucket/index.js\";\nimport build from \"./cmds/build.js\";\nimport caCertificate from \"./cmds/ca-certificate/index.js\";\nimport compile from \"./cmds/compile.js\";\nimport customDomain from \"./cmds/custom-domain/index.js\";\nimport deleteZup from \"./cmds/delete.js\";\nimport deploy from \"./cmds/deploy.js\";\nimport dev from \"./cmds/dev.js\";\nimport docs from \"./cmds/docs.js\";\nimport editor from \"./cmds/editor.js\";\nimport info from \"./cmds/info.js\";\nimport init from \"./cmds/init.js\";\nimport link from \"./cmds/link.js\";\nimport list from \"./cmds/list.js\";\nimport login from \"./cmds/login.js\";\nimport logout from \"./cmds/logout.js\";\nimport mtlsCertificates from \"./cmds/mtls-certificates/index.js\";\nimport oas from \"./cmds/open-api/index.js\";\nimport project from \"./cmds/project/index.js\";\nimport proxies from \"./cmds/proxies/index.js\";\nimport source from \"./cmds/source/index.js\";\nimport test from \"./cmds/test.js\";\nimport tunnel from \"./cmds/tunnel/index.js\";\nimport variable from \"./cmds/variable/index.js\";\nimport whoami from \"./cmds/whoami.js\";\nimport { captureCliInvocationEvent } from \"./common/analytics/cli-invocation.js\";\nimport { shutdownAnalytics } from \"./common/analytics/lib.js\";\nimport { ApiError } from \"./common/api/client.js\";\nimport { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from \"./common/constants.js\";\nimport { logger } from \"./common/logger.js\";\nimport { checkPnpmLifecycle } from \"./common/middleware/check-pnpm-lifecycle.js\";\nimport { logLevel } from \"./common/middleware/logging.js\";\nimport { warnIfOutdatedVersion, warnNodeVersion } from \"./common/outdated.js\";\nimport setBlocking, {\n printCriticalFailureToConsole,\n printCriticalFailureToConsoleAndExit,\n} from \"./common/output.js\";\n\n// This allows us to stop the CLI from executing so we can connect the profiler\n\n// biome-ignore lint/style/noProcessEnv: Migrated from ESLint\nif (process.env.ZUPLO_CLI_PROFILING) {\n await confirm({ message: \"Continue executing CLI?\", default: true });\n}\n\n// Note: We cannot set this to be higher than 18.0.0 because of the way\n// our documentation works -- we tell them to use npx @zuplo/cli@latest (even in CI/CD jobs)\n// If we set this to be higher than 18.0.0, then we will break them.\n// Instead we set the value in package.json to be engine.node >= 20.0.0, so it will warn\nconst MIN_NODE_VERSION = \"18.0.0\";\nconst RECOMMENDED_NODE_VERSION = \"20.0.0\";\n\nif (gte(process.versions.node, MIN_NODE_VERSION)) {\n let cliVersion: string;\n try {\n const packageJson = JSON.parse(\n readFileSync(\n fileURLToPath(new URL(\"../package.json\", import.meta.url)),\n \"utf-8\"\n )\n );\n cliVersion = packageJson.version;\n } catch (e) {\n cliVersion = \"0.0.0\";\n logger.error(e);\n await printCriticalFailureToConsoleAndExit(\n `Unable to load @zuplo/cli. The package.json is missing or malformed.`\n );\n }\n\n await warnNodeVersion(cliVersion, RECOMMENDED_NODE_VERSION);\n\n undici.setGlobalDispatcher(\n undici.getGlobalDispatcher().compose((dispatch) => {\n return (opts, handler) => {\n opts.headers = {\n ...opts.headers,\n \"user-agent\": `ZuploCLI/${cliVersion}`,\n\n // biome-ignore lint/style/noProcessEnv: Migrated from ESLint\n ...(process.env.ZUPLO_CANARY ? { \"zp-canary\": \"true\" } : {}),\n };\n return dispatch(opts, handler);\n };\n })\n );\n\n Sentry.init({\n dsn: SENTRY_DSN,\n release: cliVersion,\n });\n\n const cli = yargs(hideBin(process.argv))\n // This means that all env vars will have to be prefixed with ZUPLO_\n .env(\"ZUPLO\")\n .option(\"prompt\", {\n type: \"boolean\",\n describe: \"Bypass confirmation prompts\",\n default: true,\n hidden: true,\n })\n .option(\"verbose\", {\n alias: \"v\",\n type: \"count\",\n describe: \"Increase verbosity level (-v, -vv, -vvv)\",\n default: 0,\n })\n // setBlocking forces synchronous TTY writes so error messages flush before\n // process.exit. Runs first so subsequent middleware (including the\n // preflight, which can exit) benefit from it.\n .middleware(setBlocking)\n .middleware(logLevel)\n .middleware(checkPnpmLifecycle)\n .middleware((argv) => {\n void captureCliInvocationEvent(argv, cliVersion);\n })\n .command(caCertificate)\n .command(compile)\n .command(customDomain)\n .command(deleteZup) // delete is a reserved keyword in JavaScript, so we call this function deleteZup\n .command(deploy)\n .command(dev)\n .command(docs)\n .command(editor)\n .command(info)\n .command(init)\n .command(list)\n .command(link)\n .command(login)\n .command(logout)\n .command(test)\n .command(oas)\n .command(mtlsCertificates)\n .command(project)\n .command(source)\n .command(tunnel)\n .command(variable)\n .command(build)\n .command(bucket)\n .command(proxies)\n .command(whoami)\n .command({\n command: \"hello\",\n handler: async () => {\n await fetch(\"https://393b4699ced44cc2ae87e4ad86184a29.api.mockbin.io/\");\n },\n })\n .demandCommand()\n .strictCommands()\n .version(cliVersion)\n .fail(false)\n .help();\n\n let exitCode = 0;\n try {\n await cli.argv;\n\n // Don't block\n void warnIfOutdatedVersion(cliVersion);\n } catch (err) {\n exitCode = 1;\n if (err instanceof Error) {\n Sentry.captureException(err);\n }\n if (err instanceof ApiError) {\n // The API client has already logged the structured error and printed\n // a user-facing diagnostic. Nothing more to display here.\n } else {\n printCriticalFailureToConsole(err.message ?? err);\n cli.showHelp();\n }\n } finally {\n await shutdownAnalytics();\n await Sentry.close(MAX_WAIT_PENDING_TIME_MS);\n process.exit(exitCode);\n }\n} else {\n await printCriticalFailureToConsoleAndExit(\n `The Zuplo CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.\n\n Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { Argv } from "yargs";
2
+ declare const _default: {
3
+ desc: string;
4
+ command: string;
5
+ builder: (yargs: Argv) => Argv<unknown>;
6
+ handler: (argv: unknown) => Promise<void>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAoDf,OAAO;;AAvD/B,wBA2DE"}
@@ -0,0 +1,66 @@
1
+ import { create } from "../../ca-certificate/create/handler.js";
2
+ import { captureEvent } from "../../common/analytics/lib.js";
3
+ import { authenticate } from "../../common/middleware/authentication.js";
4
+ import { fetchAccount } from "../../common/middleware/get-account-param.js";
5
+ import { configure } from "../../common/middleware/user-configuration.js";
6
+ import { identify } from "../../common/middleware/user-identification.js";
7
+ import { validateFileExists } from "../../common/validators/argument-validators.js";
8
+ export default {
9
+ desc: "Creates a new CA certificate for client mTLS verification",
10
+ command: "create",
11
+ builder: (yargs) => {
12
+ return yargs
13
+ .usage("$0 ca-certificate create --name <name> --cert <file> [options]")
14
+ .option("name", {
15
+ type: "string",
16
+ describe: "The name of the CA certificate (must be a valid JavaScript identifier: starts with a letter, _, or $; contains only letters, digits, _, or $)",
17
+ })
18
+ .option("cert", {
19
+ type: "string",
20
+ describe: "Path to a PEM-encoded CA certificate file (.pem, .crt, or .cer with a -----BEGIN CERTIFICATE----- header). DER inputs are not accepted",
21
+ normalize: true,
22
+ })
23
+ .option("api-key", {
24
+ type: "string",
25
+ describe: "The API Key from Zuplo",
26
+ envVar: "API_KEY",
27
+ alias: "apikey",
28
+ })
29
+ .option("account", {
30
+ type: "string",
31
+ describe: "The account name",
32
+ })
33
+ .option("output", {
34
+ type: "string",
35
+ alias: "o",
36
+ describe: "Output format",
37
+ choices: ["default", "json"],
38
+ default: "default",
39
+ })
40
+ .demandOption(["name", "cert"])
41
+ .check((argv) => {
42
+ validateFileExists(argv.cert, "--cert");
43
+ return true;
44
+ })
45
+ .example([
46
+ [
47
+ "$0 ca-certificate create --name my_ca --cert ./ca.pem",
48
+ "Create a CA certificate for client mTLS verification",
49
+ ],
50
+ [
51
+ "$0 ca-certificate create --name my_ca --cert ./ca.pem --output json",
52
+ "Create a CA certificate and output the result as JSON",
53
+ ],
54
+ [
55
+ "$0 ca-certificate create --name my_ca --cert ./ca.pem --account my-account",
56
+ "Explicitly specify the account",
57
+ ],
58
+ ])
59
+ .middleware([authenticate, configure, fetchAccount, identify]);
60
+ },
61
+ handler: async (argv) => {
62
+ await captureEvent({ argv, event: "zuplo ca-certificate create" });
63
+ await create(argv);
64
+ },
65
+ };
66
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,eAAe;IACb,IAAI,EAAE,2DAA2D;IACjE,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,gEAAgE,CAAC;aACvE,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,+IAA+I;SAClJ,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,wIAAwI;YAC1I,SAAS,EAAE,IAAI;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;YAC5B,OAAO,EAAE,SAAS;SACnB,CAAC;aACD,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aAC9B,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;YACd,kBAAkB,CAAC,IAAI,CAAC,IAAc,EAAE,QAAQ,CAAC,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,OAAO,CAAC;YACP;gBACE,uDAAuD;gBACvD,sDAAsD;aACvD;YACD;gBACE,qEAAqE;gBACrE,uDAAuD;aACxD;YACD;gBACE,4EAA4E;gBAC5E,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;QACnE,MAAM,MAAM,CAAC,IAAuB,CAAC,CAAC;IACxC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { create } from \"../../ca-certificate/create/handler.js\";\nimport { CreateArguments } from \"../../ca-certificate/models.js\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\nimport { validateFileExists } from \"../../common/validators/argument-validators.js\";\n\nexport default {\n desc: \"Creates a new CA certificate for client mTLS verification\",\n command: \"create\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 ca-certificate create --name <name> --cert <file> [options]\")\n .option(\"name\", {\n type: \"string\",\n describe:\n \"The name of the CA certificate (must be a valid JavaScript identifier: starts with a letter, _, or $; contains only letters, digits, _, or $)\",\n })\n .option(\"cert\", {\n type: \"string\",\n describe:\n \"Path to a PEM-encoded CA certificate file (.pem, .crt, or .cer with a -----BEGIN CERTIFICATE----- header). DER inputs are not accepted\",\n normalize: true,\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .option(\"output\", {\n type: \"string\",\n alias: \"o\",\n describe: \"Output format\",\n choices: [\"default\", \"json\"],\n default: \"default\",\n })\n .demandOption([\"name\", \"cert\"])\n .check((argv) => {\n validateFileExists(argv.cert as string, \"--cert\");\n return true;\n })\n .example([\n [\n \"$0 ca-certificate create --name my_ca --cert ./ca.pem\",\n \"Create a CA certificate for client mTLS verification\",\n ],\n [\n \"$0 ca-certificate create --name my_ca --cert ./ca.pem --output json\",\n \"Create a CA certificate and output the result as JSON\",\n ],\n [\n \"$0 ca-certificate create --name my_ca --cert ./ca.pem --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([authenticate, configure, fetchAccount, identify]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zuplo ca-certificate create\" });\n await create(argv as CreateArguments);\n },\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Argv } from "yargs";
2
+ declare const _default: {
3
+ desc: string;
4
+ command: string;
5
+ builder: (yargs: Argv) => Argv<unknown>;
6
+ handler: (argv: unknown) => Promise<void>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAYV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAyCf,OAAO;;AA5C/B,wBAgDE"}
@@ -0,0 +1,56 @@
1
+ import { deleteCommand } from "../../ca-certificate/delete/handler.js";
2
+ import { captureEvent } from "../../common/analytics/lib.js";
3
+ import { authenticate } from "../../common/middleware/authentication.js";
4
+ import { fetchAccount } from "../../common/middleware/get-account-param.js";
5
+ import { configure } from "../../common/middleware/user-configuration.js";
6
+ import { identify } from "../../common/middleware/user-identification.js";
7
+ export default {
8
+ desc: "Deletes a CA certificate by ID",
9
+ command: "delete",
10
+ builder: (yargs) => {
11
+ return yargs
12
+ .usage("$0 ca-certificate delete --cert-id <id> [options]")
13
+ .option("cert-id", {
14
+ type: "string",
15
+ describe: "The ID of the CA certificate to delete",
16
+ })
17
+ .option("api-key", {
18
+ type: "string",
19
+ describe: "The API Key from Zuplo",
20
+ envVar: "API_KEY",
21
+ alias: "apikey",
22
+ })
23
+ .option("account", {
24
+ type: "string",
25
+ describe: "The account name",
26
+ })
27
+ .option("output", {
28
+ type: "string",
29
+ alias: "o",
30
+ describe: "Output format",
31
+ choices: ["default", "json"],
32
+ default: "default",
33
+ })
34
+ .demandOption(["cert-id"])
35
+ .example([
36
+ [
37
+ "$0 ca-certificate delete --cert-id mtlsca_abc123",
38
+ "Delete a CA certificate",
39
+ ],
40
+ [
41
+ "$0 ca-certificate delete --cert-id mtlsca_abc123 --output json",
42
+ "Delete a CA certificate and output the result as JSON",
43
+ ],
44
+ [
45
+ "$0 ca-certificate delete --cert-id mtlsca_abc123 --account my-account",
46
+ "Explicitly specify the account",
47
+ ],
48
+ ])
49
+ .middleware([authenticate, configure, fetchAccount, identify]);
50
+ },
51
+ handler: async (argv) => {
52
+ await captureEvent({ argv, event: "zuplo ca-certificate delete" });
53
+ await deleteCommand(argv);
54
+ },
55
+ };
56
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,eAAe;IACb,IAAI,EAAE,gCAAgC;IACtC,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,mDAAmD,CAAC;aAC1D,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wCAAwC;SACnD,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;YAC5B,OAAO,EAAE,SAAS;SACnB,CAAC;aACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;aACzB,OAAO,CAAC;YACP;gBACE,kDAAkD;gBAClD,yBAAyB;aAC1B;YACD;gBACE,gEAAgE;gBAChE,uDAAuD;aACxD;YACD;gBACE,uEAAuE;gBACvE,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;QACnE,MAAM,aAAa,CAAC,IAAuB,CAAC,CAAC;IAC/C,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { deleteCommand } from \"../../ca-certificate/delete/handler.js\";\nimport { DeleteArguments } from \"../../ca-certificate/models.js\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\n\nexport default {\n desc: \"Deletes a CA certificate by ID\",\n command: \"delete\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 ca-certificate delete --cert-id <id> [options]\")\n .option(\"cert-id\", {\n type: \"string\",\n describe: \"The ID of the CA certificate to delete\",\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .option(\"output\", {\n type: \"string\",\n alias: \"o\",\n describe: \"Output format\",\n choices: [\"default\", \"json\"],\n default: \"default\",\n })\n .demandOption([\"cert-id\"])\n .example([\n [\n \"$0 ca-certificate delete --cert-id mtlsca_abc123\",\n \"Delete a CA certificate\",\n ],\n [\n \"$0 ca-certificate delete --cert-id mtlsca_abc123 --output json\",\n \"Delete a CA certificate and output the result as JSON\",\n ],\n [\n \"$0 ca-certificate delete --cert-id mtlsca_abc123 --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([authenticate, configure, fetchAccount, identify]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zuplo ca-certificate delete\" });\n await deleteCommand(argv as DeleteArguments);\n },\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Argv } from "yargs";
2
+ declare const _default: {
3
+ desc: string;
4
+ command: string;
5
+ builder: (yargs: Argv) => Argv<unknown>;
6
+ handler: (argv: unknown) => Promise<void>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=describe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/describe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAYV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAyCf,OAAO;;AA5C/B,wBAgDE"}
@@ -0,0 +1,56 @@
1
+ import { describe } from "../../ca-certificate/describe/handler.js";
2
+ import { captureEvent } from "../../common/analytics/lib.js";
3
+ import { authenticate } from "../../common/middleware/authentication.js";
4
+ import { fetchAccount } from "../../common/middleware/get-account-param.js";
5
+ import { configure } from "../../common/middleware/user-configuration.js";
6
+ import { identify } from "../../common/middleware/user-identification.js";
7
+ export default {
8
+ desc: "Describes a CA certificate",
9
+ command: "describe",
10
+ builder: (yargs) => {
11
+ return yargs
12
+ .usage("$0 ca-certificate describe --cert-id <id> [options]")
13
+ .option("cert-id", {
14
+ type: "string",
15
+ describe: "The ID of the CA certificate to describe",
16
+ })
17
+ .option("api-key", {
18
+ type: "string",
19
+ describe: "The API Key from Zuplo",
20
+ envVar: "API_KEY",
21
+ alias: "apikey",
22
+ })
23
+ .option("account", {
24
+ type: "string",
25
+ describe: "The account name",
26
+ })
27
+ .option("output", {
28
+ type: "string",
29
+ alias: "o",
30
+ describe: "Output format",
31
+ choices: ["default", "json"],
32
+ default: "default",
33
+ })
34
+ .demandOption(["cert-id"])
35
+ .example([
36
+ [
37
+ "$0 ca-certificate describe --cert-id mtlsca_abc123",
38
+ "Get details about a CA certificate",
39
+ ],
40
+ [
41
+ "$0 ca-certificate describe --cert-id mtlsca_abc123 --output json",
42
+ "Get details as JSON",
43
+ ],
44
+ [
45
+ "$0 ca-certificate describe --cert-id mtlsca_abc123 --account my-account",
46
+ "Explicitly specify the account",
47
+ ],
48
+ ])
49
+ .middleware([authenticate, configure, fetchAccount, identify]);
50
+ },
51
+ handler: async (argv) => {
52
+ await captureEvent({ argv, event: "zuplo ca-certificate describe" });
53
+ await describe(argv);
54
+ },
55
+ };
56
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/describe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,eAAe;IACb,IAAI,EAAE,4BAA4B;IAClC,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,qDAAqD,CAAC;aAC5D,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,0CAA0C;SACrD,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;YAC5B,OAAO,EAAE,SAAS;SACnB,CAAC;aACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;aACzB,OAAO,CAAC;YACP;gBACE,oDAAoD;gBACpD,oCAAoC;aACrC;YACD;gBACE,kEAAkE;gBAClE,qBAAqB;aACtB;YACD;gBACE,yEAAyE;gBACzE,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAE,CAAC,CAAC;QACrE,MAAM,QAAQ,CAAC,IAAyB,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { describe } from \"../../ca-certificate/describe/handler.js\";\nimport { DescribeArguments } from \"../../ca-certificate/models.js\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\n\nexport default {\n desc: \"Describes a CA certificate\",\n command: \"describe\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 ca-certificate describe --cert-id <id> [options]\")\n .option(\"cert-id\", {\n type: \"string\",\n describe: \"The ID of the CA certificate to describe\",\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .option(\"output\", {\n type: \"string\",\n alias: \"o\",\n describe: \"Output format\",\n choices: [\"default\", \"json\"],\n default: \"default\",\n })\n .demandOption([\"cert-id\"])\n .example([\n [\n \"$0 ca-certificate describe --cert-id mtlsca_abc123\",\n \"Get details about a CA certificate\",\n ],\n [\n \"$0 ca-certificate describe --cert-id mtlsca_abc123 --output json\",\n \"Get details as JSON\",\n ],\n [\n \"$0 ca-certificate describe --cert-id mtlsca_abc123 --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([authenticate, configure, fetchAccount, identify]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zuplo ca-certificate describe\" });\n await describe(argv as DescribeArguments);\n },\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import { CommandModule } from "yargs";
2
+ declare const commands: CommandModule;
3
+ export default commands;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,QAAA,MAAM,QAAQ,EAAE,aAWf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { showHelpOnNoSubcommand } from "../../common/handler.js";
2
+ import create from "./create.js";
3
+ import deleteCommand from "./delete.js";
4
+ import describe from "./describe.js";
5
+ import list from "./list.js";
6
+ import update from "./update.js";
7
+ const commands = {
8
+ describe: "CA certs for verifying inbound clients (mTLS)",
9
+ command: "ca-certificate",
10
+ ...showHelpOnNoSubcommand((yargs) => yargs
11
+ .command(create)
12
+ .command(list)
13
+ .command(describe)
14
+ .command(update)
15
+ .command(deleteCommand)),
16
+ };
17
+ export default commands;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAkB;IAC9B,QAAQ,EAAE,+CAA+C;IACzD,OAAO,EAAE,gBAAgB;IACzB,GAAG,sBAAsB,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,IAAI,CAAC;SACb,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,aAAa,CAAC,CAC1B;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { CommandModule } from \"yargs\";\nimport { showHelpOnNoSubcommand } from \"../../common/handler.js\";\nimport create from \"./create.js\";\nimport deleteCommand from \"./delete.js\";\nimport describe from \"./describe.js\";\nimport list from \"./list.js\";\nimport update from \"./update.js\";\n\nconst commands: CommandModule = {\n describe: \"CA certs for verifying inbound clients (mTLS)\",\n command: \"ca-certificate\",\n ...showHelpOnNoSubcommand((yargs) =>\n yargs\n .command(create)\n .command(list)\n .command(describe)\n .command(update)\n .command(deleteCommand)\n ),\n};\n\nexport default commands;\n"]}
@@ -0,0 +1,9 @@
1
+ import { Argv } from "yargs";
2
+ declare const _default: {
3
+ desc: string;
4
+ command: string;
5
+ builder: (yargs: Argv) => Argv<unknown>;
6
+ handler: (argv: unknown) => Promise<void>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAYV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAiCf,OAAO;;AApC/B,wBAwCE"}
@@ -0,0 +1,48 @@
1
+ import { list } from "../../ca-certificate/list/handler.js";
2
+ import { captureEvent } from "../../common/analytics/lib.js";
3
+ import { authenticate } from "../../common/middleware/authentication.js";
4
+ import { fetchAccount } from "../../common/middleware/get-account-param.js";
5
+ import { configure } from "../../common/middleware/user-configuration.js";
6
+ import { identify } from "../../common/middleware/user-identification.js";
7
+ export default {
8
+ desc: "Lists all CA certificates for an account",
9
+ command: "list",
10
+ builder: (yargs) => {
11
+ return yargs
12
+ .usage("$0 ca-certificate list [options]")
13
+ .option("api-key", {
14
+ type: "string",
15
+ describe: "The API Key from Zuplo",
16
+ envVar: "API_KEY",
17
+ alias: "apikey",
18
+ })
19
+ .option("account", {
20
+ type: "string",
21
+ describe: "The account name",
22
+ })
23
+ .option("output", {
24
+ type: "string",
25
+ alias: "o",
26
+ describe: "Output format",
27
+ choices: ["default", "json"],
28
+ default: "default",
29
+ })
30
+ .example([
31
+ ["$0 ca-certificate list", "List all CA certificates for your account"],
32
+ [
33
+ "$0 ca-certificate list --account my-account",
34
+ "Explicitly specify the account",
35
+ ],
36
+ [
37
+ "$0 ca-certificate list --output json",
38
+ "List CA certificates as JSON",
39
+ ],
40
+ ])
41
+ .middleware([authenticate, configure, fetchAccount, identify]);
42
+ },
43
+ handler: async (argv) => {
44
+ await captureEvent({ argv, event: "zuplo ca-certificate list" });
45
+ await list(argv);
46
+ },
47
+ };
48
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","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B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACjE,MAAM,IAAI,CAAC,IAAqB,CAAC,CAAC;IACpC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { list } from \"../../ca-certificate/list/handler.js\";\nimport { ListArguments } from \"../../ca-certificate/models.js\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\n\nexport default {\n desc: \"Lists all CA certificates for an account\",\n command: \"list\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 ca-certificate list [options]\")\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .option(\"output\", {\n type: \"string\",\n alias: \"o\",\n describe: \"Output format\",\n choices: [\"default\", \"json\"],\n default: \"default\",\n })\n .example([\n [\"$0 ca-certificate list\", \"List all CA certificates for your account\"],\n [\n \"$0 ca-certificate list --account my-account\",\n \"Explicitly specify the account\",\n ],\n [\n \"$0 ca-certificate list --output json\",\n \"List CA certificates as JSON\",\n ],\n ])\n .middleware([authenticate, configure, fetchAccount, identify]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zuplo ca-certificate list\" });\n await list(argv as ListArguments);\n },\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Argv } from "yargs";
2
+ declare const _default: {
3
+ desc: string;
4
+ command: string;
5
+ builder: (yargs: Argv) => Argv<unknown>;
6
+ handler: (argv: unknown) => Promise<void>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAYV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBA0Cf,OAAO;;AA7C/B,wBAiDE"}
@@ -0,0 +1,56 @@
1
+ import { update } from "../../ca-certificate/update/handler.js";
2
+ import { captureEvent } from "../../common/analytics/lib.js";
3
+ import { authenticate } from "../../common/middleware/authentication.js";
4
+ import { fetchAccount } from "../../common/middleware/get-account-param.js";
5
+ import { configure } from "../../common/middleware/user-configuration.js";
6
+ import { identify } from "../../common/middleware/user-identification.js";
7
+ export default {
8
+ desc: "Updates the name of a CA certificate",
9
+ command: "update",
10
+ builder: (yargs) => {
11
+ return yargs
12
+ .usage("$0 ca-certificate update --cert-id <id> --name <name> [options]")
13
+ .option("cert-id", {
14
+ type: "string",
15
+ describe: "The ID of the CA certificate to update",
16
+ })
17
+ .option("name", {
18
+ type: "string",
19
+ describe: "The new name for the CA certificate (must be a valid JavaScript identifier: starts with a letter, _, or $; contains only letters, digits, _, or $)",
20
+ })
21
+ .option("api-key", {
22
+ type: "string",
23
+ describe: "The API Key from Zuplo",
24
+ envVar: "API_KEY",
25
+ alias: "apikey",
26
+ })
27
+ .option("account", {
28
+ type: "string",
29
+ describe: "The account name",
30
+ })
31
+ .option("output", {
32
+ type: "string",
33
+ alias: "o",
34
+ describe: "Output format",
35
+ choices: ["default", "json"],
36
+ default: "default",
37
+ })
38
+ .demandOption(["cert-id", "name"])
39
+ .example([
40
+ [
41
+ "$0 ca-certificate update --cert-id mtlsca_abc123 --name renamed_ca",
42
+ "Rename a CA certificate",
43
+ ],
44
+ [
45
+ "$0 ca-certificate update --cert-id mtlsca_abc123 --name renamed_ca --account my-account",
46
+ "Explicitly specify the account",
47
+ ],
48
+ ])
49
+ .middleware([authenticate, configure, fetchAccount, identify]);
50
+ },
51
+ handler: async (argv) => {
52
+ await captureEvent({ argv, event: "zuplo ca-certificate update" });
53
+ await update(argv);
54
+ },
55
+ };
56
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cmds/ca-certificate/update.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,eAAe;IACb,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,KAAK,CAAC,iEAAiE,CAAC;aACxE,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wCAAwC;SACnD,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,oJAAoJ;SACvJ,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;YAC5B,OAAO,EAAE,SAAS;SACnB,CAAC;aACD,YAAY,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aACjC,OAAO,CAAC;YACP;gBACE,oEAAoE;gBACpE,yBAAyB;aAC1B;YACD;gBACE,yFAAyF;gBACzF,gCAAgC;aACjC;SACF,CAAC;aACD,UAAU,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;QACnE,MAAM,MAAM,CAAC,IAAuB,CAAC,CAAC;IACxC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { UpdateArguments } from \"../../ca-certificate/models.js\";\nimport { update } from \"../../ca-certificate/update/handler.js\";\nimport { captureEvent } from \"../../common/analytics/lib.js\";\nimport { authenticate } from \"../../common/middleware/authentication.js\";\nimport { fetchAccount } from \"../../common/middleware/get-account-param.js\";\nimport { configure } from \"../../common/middleware/user-configuration.js\";\nimport { identify } from \"../../common/middleware/user-identification.js\";\n\nexport default {\n desc: \"Updates the name of a CA certificate\",\n command: \"update\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .usage(\"$0 ca-certificate update --cert-id <id> --name <name> [options]\")\n .option(\"cert-id\", {\n type: \"string\",\n describe: \"The ID of the CA certificate to update\",\n })\n .option(\"name\", {\n type: \"string\",\n describe:\n \"The new name for the CA certificate (must be a valid JavaScript identifier: starts with a letter, _, or $; contains only letters, digits, _, or $)\",\n })\n .option(\"api-key\", {\n type: \"string\",\n describe: \"The API Key from Zuplo\",\n envVar: \"API_KEY\",\n alias: \"apikey\",\n })\n .option(\"account\", {\n type: \"string\",\n describe: \"The account name\",\n })\n .option(\"output\", {\n type: \"string\",\n alias: \"o\",\n describe: \"Output format\",\n choices: [\"default\", \"json\"],\n default: \"default\",\n })\n .demandOption([\"cert-id\", \"name\"])\n .example([\n [\n \"$0 ca-certificate update --cert-id mtlsca_abc123 --name renamed_ca\",\n \"Rename a CA certificate\",\n ],\n [\n \"$0 ca-certificate update --cert-id mtlsca_abc123 --name renamed_ca --account my-account\",\n \"Explicitly specify the account\",\n ],\n ])\n .middleware([authenticate, configure, fetchAccount, identify]);\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zuplo ca-certificate update\" });\n await update(argv as UpdateArguments);\n },\n};\n"]}
@@ -6,7 +6,7 @@ import disable from "./disable.js";
6
6
  import list from "./list.js";
7
7
  import update from "./update.js";
8
8
  const commands = {
9
- describe: "mTLS certificate commands",
9
+ describe: "Certs for outbound calls to upstreams (mTLS)",
10
10
  command: "mtls-certificate",
11
11
  ...showHelpOnNoSubcommand((yargs) => yargs
12
12
  .command(create)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cmds/mtls-certificates/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAkB;IAC9B,QAAQ,EAAE,2BAA2B;IACrC,OAAO,EAAE,kBAAkB;IAC3B,GAAG,sBAAsB,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,IAAI,CAAC;SACb,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,aAAa,CAAC,CAC1B;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { CommandModule } from \"yargs\";\nimport { showHelpOnNoSubcommand } from \"../../common/handler.js\";\nimport create from \"./create.js\";\nimport deleteCommand from \"./delete.js\";\nimport describe from \"./describe.js\";\nimport disable from \"./disable.js\";\nimport list from \"./list.js\";\nimport update from \"./update.js\";\n\nconst commands: CommandModule = {\n describe: \"mTLS certificate commands\",\n command: \"mtls-certificate\",\n ...showHelpOnNoSubcommand((yargs) =>\n yargs\n .command(create)\n .command(list)\n .command(describe)\n .command(update)\n .command(disable)\n .command(deleteCommand)\n ),\n};\n\nexport default commands;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cmds/mtls-certificates/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAkB;IAC9B,QAAQ,EAAE,8CAA8C;IACxD,OAAO,EAAE,kBAAkB;IAC3B,GAAG,sBAAsB,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,IAAI,CAAC;SACb,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,aAAa,CAAC,CAC1B;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { CommandModule } from \"yargs\";\nimport { showHelpOnNoSubcommand } from \"../../common/handler.js\";\nimport create from \"./create.js\";\nimport deleteCommand from \"./delete.js\";\nimport describe from \"./describe.js\";\nimport disable from \"./disable.js\";\nimport list from \"./list.js\";\nimport update from \"./update.js\";\n\nconst commands: CommandModule = {\n describe: \"Certs for outbound calls to upstreams (mTLS)\",\n command: \"mtls-certificate\",\n ...showHelpOnNoSubcommand((yargs) =>\n yargs\n .command(create)\n .command(list)\n .command(describe)\n .command(update)\n .command(disable)\n .command(deleteCommand)\n ),\n};\n\nexport default commands;\n"]}