@eide/foir-cli 0.25.1 → 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 +35 -7
  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;
@@ -1282,6 +1283,8 @@ import {
1282
1283
  SharingConfigSchema as ProtoSharingConfigSchema,
1283
1284
  ModelConfigSchema as ProtoModelConfigSchema,
1284
1285
  LookupDefinitionSchema as ProtoLookupDefinitionSchema,
1286
+ CacheControlConfigSchema as ProtoCacheControlConfigSchema,
1287
+ CacheControlScope as ProtoCacheControlScope,
1285
1288
  CreateModelRequestSchema,
1286
1289
  GetModelRequestSchema,
1287
1290
  GetModelByKeyRequestSchema,
@@ -1335,9 +1338,26 @@ function jsConfigToProto(c) {
1335
1338
  keyBy: l.keyBy ?? [],
1336
1339
  name: l.name
1337
1340
  })
1338
- ) : []
1341
+ ) : [],
1342
+ cacheControl: c.cacheControl ? create3(ProtoCacheControlConfigSchema, {
1343
+ maxAge: c.cacheControl.maxAge ?? 0,
1344
+ scope: cacheControlScopeFromJs(c.cacheControl.scope)
1345
+ }) : void 0
1339
1346
  });
1340
1347
  }
1348
+ function cacheControlScopeFromJs(scope) {
1349
+ if (typeof scope === "number") return scope;
1350
+ switch (scope) {
1351
+ case "PUBLIC":
1352
+ return ProtoCacheControlScope.PUBLIC;
1353
+ case "PRIVATE":
1354
+ return ProtoCacheControlScope.PRIVATE;
1355
+ case "NO_CACHE":
1356
+ return ProtoCacheControlScope.NO_CACHE;
1357
+ default:
1358
+ return ProtoCacheControlScope.UNSPECIFIED;
1359
+ }
1360
+ }
1341
1361
  function createModelsMethods(client) {
1342
1362
  return {
1343
1363
  // ── Queries ──────────────────────────────────────────────
@@ -9460,7 +9480,10 @@ function registerAppsCommands(program2, globalOpts) {
9460
9480
  }
9461
9481
  )
9462
9482
  );
9463
- 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(
9464
9487
  withErrorHandler(
9465
9488
  globalOpts,
9466
9489
  async (name, cmdOpts) => {
@@ -9482,18 +9505,23 @@ function registerAppsCommands(program2, globalOpts) {
9482
9505
  console.error(`[${classLabel}] ${change.path}: ${change.description}`);
9483
9506
  }
9484
9507
  }
9508
+ const force = !!cmdOpts.force;
9485
9509
  const hasRejected = updateResp.changes.some((c) => c.class === 3);
9486
- if (hasRejected) {
9510
+ if (hasRejected && !force) {
9487
9511
  throw new Error(
9488
- "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"
9489
9513
  );
9490
9514
  }
9515
+ if (hasRejected && !opts.quiet) {
9516
+ warn("forcing through REJECTED changes \u2014 admin override");
9517
+ }
9491
9518
  if (cmdOpts.dryRun) return;
9492
9519
  const app = await client.apps.confirmUpdateApp(
9493
9520
  resolved.project.tenantId,
9494
9521
  resolved.project.id,
9495
9522
  name,
9496
- updateResp.newManifestHash
9523
+ updateResp.newManifestHash,
9524
+ force
9497
9525
  );
9498
9526
  if (opts.json) {
9499
9527
  formatOutputProto(AppSchema, app, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.25.1",
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.66.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",