@cimplify/cli 0.5.4 → 0.6.2

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 (30) hide show
  1. package/dist/{add-FU46PRCJ.mjs → add-2DGJIRBT.mjs} +1 -1
  2. package/dist/cancel-HANLRA6Q.mjs +34 -0
  3. package/dist/{chunk-OPWMPCPM.mjs → chunk-PPU3YTG7.mjs} +16 -16
  4. package/dist/{chunk-A6BBQWTB.mjs → chunk-SAESFNUJ.mjs} +1 -1
  5. package/dist/{chunk-72IHRRLU.mjs → chunk-XYEZPYCO.mjs} +1 -1
  6. package/dist/dispatcher.mjs +14 -11
  7. package/dist/{doctor-FZCJWAPT.mjs → doctor-26CFG2CR.mjs} +2 -2
  8. package/dist/{domains-AHH56CL7.mjs → domains-6GJASWJU.mjs} +20 -2
  9. package/dist/{explain-4I6JLKDW.mjs → explain-AIMUFEME.mjs} +1 -1
  10. package/dist/{introspect-5ODUL6UC.mjs → introspect-5ELLE23M.mjs} +2 -2
  11. package/dist/{list-EKOWQ53I.mjs → list-74VZJRQE.mjs} +1 -1
  12. package/dist/{update-NHGK3AAH.mjs → update-5E646EVY.mjs} +1 -1
  13. package/package.json +1 -1
  14. package/templates/storefront-auto/next.config.ts +6 -0
  15. package/templates/storefront-auto/package.json +1 -1
  16. package/templates/storefront-bakery/next.config.ts +6 -0
  17. package/templates/storefront-bakery/package.json +1 -1
  18. package/templates/storefront-fashion/next.config.ts +6 -0
  19. package/templates/storefront-fashion/package.json +1 -1
  20. package/templates/storefront-grocery/next.config.ts +6 -0
  21. package/templates/storefront-grocery/package.json +1 -1
  22. package/templates/storefront-pharmacy/next.config.ts +6 -0
  23. package/templates/storefront-pharmacy/package.json +1 -1
  24. package/templates/storefront-restaurant/next.config.ts +6 -0
  25. package/templates/storefront-restaurant/package.json +1 -1
  26. package/templates/storefront-retail/next.config.ts +6 -0
  27. package/templates/storefront-retail/package.json +1 -1
  28. package/templates/storefront-services/next.config.ts +6 -0
  29. package/templates/storefront-services/package.json +1 -1
  30. package/dist/{deploy-3IFXUWPM.mjs → deploy-7BPO5BNB.mjs} +1 -1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX, REGISTRY } from './chunk-OPWMPCPM.mjs';
2
+ import { REGISTRY_INDEX, REGISTRY } from './chunk-PPU3YTG7.mjs';
3
3
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
4
4
  import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
5
5
  import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-E2T2SBP5.mjs';
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from './chunk-C4M3DXKC.mjs';
3
+ import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
4
+ import { readAuth, readProjectLink } from './chunk-UBAI443T.mjs';
5
+ import { CliError, CLI_ERROR_CODE, success, result } from './chunk-E2T2SBP5.mjs';
6
+
7
+ // src/commands/cancel.ts
8
+ function cancelEndpoint(businessId, projectId, deploymentId) {
9
+ return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/transitions/cancel`;
10
+ }
11
+ async function run(argv) {
12
+ const args = parseArgs(argv);
13
+ const deploymentId = args.positional[0];
14
+ if (!deploymentId) {
15
+ throw new CliError(
16
+ CLI_ERROR_CODE.INVALID_INPUT,
17
+ "Usage: cimplify cancel <deployment-id>"
18
+ );
19
+ }
20
+ const auth = await readAuth();
21
+ const link = await readProjectLink();
22
+ const client = ApiClient.fromAuth(auth);
23
+ const response = await client.post(
24
+ cancelEndpoint(link.businessId, link.projectId, deploymentId)
25
+ );
26
+ if (response.cancelled) {
27
+ success(`Cancelled deployment ${deploymentId}`);
28
+ } else {
29
+ success(`Deployment ${deploymentId} already terminal; nothing to cancel`);
30
+ }
31
+ result({ deployment_id: deploymentId, cancelled: response.cancelled });
32
+ }
33
+
34
+ export { run as default };