@eide/foir-cli 0.26.0 → 0.27.0

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/dist/cli.js +15 -6
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1215,13 +1215,14 @@ function createAppsMethods(client) {
1215
1215
  create2(UpdateAppRequestSchema, { tenantId, projectId, name })
1216
1216
  );
1217
1217
  },
1218
- async confirmUpdateApp(tenantId, projectId, name, newManifestHash) {
1218
+ async confirmUpdateApp(tenantId, projectId, name, newManifestHash, force = false) {
1219
1219
  const resp = await client.confirmUpdateApp(
1220
1220
  create2(ConfirmUpdateAppRequestSchema, {
1221
1221
  tenantId,
1222
1222
  projectId,
1223
1223
  name,
1224
- newManifestHash
1224
+ newManifestHash,
1225
+ force
1225
1226
  })
1226
1227
  );
1227
1228
  return resp.app;
@@ -9479,7 +9480,10 @@ function registerAppsCommands(program2, globalOpts) {
9479
9480
  }
9480
9481
  )
9481
9482
  );
9482
- apps.command("update <name>").description("Check for updates and apply if no rejected changes").option("--dry-run", "Show the diff without applying").action(
9483
+ apps.command("update <name>").description("Check for updates and apply if no rejected changes").option("--dry-run", "Show the diff without applying").option(
9484
+ "--force",
9485
+ "Apply even when the diff contains REJECTED changes (admin override; printed warning lists what got bypassed)"
9486
+ ).action(
9483
9487
  withErrorHandler(
9484
9488
  globalOpts,
9485
9489
  async (name, cmdOpts) => {
@@ -9501,18 +9505,23 @@ function registerAppsCommands(program2, globalOpts) {
9501
9505
  console.error(`[${classLabel}] ${change.path}: ${change.description}`);
9502
9506
  }
9503
9507
  }
9508
+ const force = !!cmdOpts.force;
9504
9509
  const hasRejected = updateResp.changes.some((c) => c.class === 3);
9505
- if (hasRejected) {
9510
+ if (hasRejected && !force) {
9506
9511
  throw new Error(
9507
- "update rejected: one or more changes require admin resolution; see diff above"
9512
+ "update rejected: one or more changes require admin resolution; rerun with --force to override"
9508
9513
  );
9509
9514
  }
9515
+ if (hasRejected && !opts.quiet) {
9516
+ warn("forcing through REJECTED changes \u2014 admin override");
9517
+ }
9510
9518
  if (cmdOpts.dryRun) return;
9511
9519
  const app = await client.apps.confirmUpdateApp(
9512
9520
  resolved.project.tenantId,
9513
9521
  resolved.project.id,
9514
9522
  name,
9515
- updateResp.newManifestHash
9523
+ updateResp.newManifestHash,
9524
+ force
9516
9525
  );
9517
9526
  if (opts.json) {
9518
9527
  formatOutputProto(AppSchema, app, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -50,7 +50,7 @@
50
50
  "@bufbuild/protovalidate": "^1.1.1",
51
51
  "@connectrpc/connect": "^2.0.0",
52
52
  "@connectrpc/connect-node": "^2.0.0",
53
- "@eide/foir-proto-ts": "^0.70.0",
53
+ "@eide/foir-proto-ts": "^0.71.0",
54
54
  "chalk": "^5.3.0",
55
55
  "commander": "^12.1.0",
56
56
  "dotenv": "^16.4.5",