@senticor/hive 1.187.0 → 1.189.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.
- package/hive.cjs +69 -9
- package/package.json +1 -1
package/hive.cjs
CHANGED
|
@@ -10636,22 +10636,22 @@ var artifactName = injectedString(
|
|
|
10636
10636
|
true ? "hive-cli" : void 0
|
|
10637
10637
|
) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
|
|
10638
10638
|
var packageVersion = injectedString(
|
|
10639
|
-
true ? "1.
|
|
10639
|
+
true ? "1.189.2" : void 0
|
|
10640
10640
|
) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
|
|
10641
10641
|
var releaseVersion = injectedString(
|
|
10642
|
-
true ? "1.
|
|
10642
|
+
true ? "1.189.2" : void 0
|
|
10643
10643
|
) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
|
|
10644
10644
|
var releaseChannel = injectedString(
|
|
10645
10645
|
true ? "final" : void 0
|
|
10646
10646
|
) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
|
|
10647
10647
|
var buildCommit = injectedString(
|
|
10648
|
-
true ? "
|
|
10648
|
+
true ? "9ff2f8f886f84e4dbc55fdcccfeb52ffcea8ab36" : void 0
|
|
10649
10649
|
) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
|
|
10650
10650
|
var buildTimestamp = injectedString(
|
|
10651
|
-
true ? "2026-11-
|
|
10651
|
+
true ? "2026-11-26T10:44:40Z" : void 0
|
|
10652
10652
|
) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
|
|
10653
10653
|
var ociRef = injectedString(
|
|
10654
|
-
true ? "registry.onstackit.cloud/senticor/hive-cli:1.
|
|
10654
|
+
true ? "registry.onstackit.cloud/senticor/hive-cli:1.189.2" : void 0
|
|
10655
10655
|
) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
|
|
10656
10656
|
var RELEASE_INFO = Object.freeze({
|
|
10657
10657
|
packageVersion,
|
|
@@ -36118,13 +36118,14 @@ var cells = defineCommand({
|
|
|
36118
36118
|
})
|
|
36119
36119
|
}
|
|
36120
36120
|
});
|
|
36121
|
-
var
|
|
36121
|
+
var templateRevisionArgsDef = {
|
|
36122
36122
|
hash: { type: "string", description: "Content hash of the revision (sha256:\u2026), as publish-revision returned it" },
|
|
36123
36123
|
acknowledge: { type: "string", description: "apply-revision: comma-separated finding codes you accept by name" },
|
|
36124
|
-
reason: { type: "string", description: "apply-revision: why, recorded in the audit row" },
|
|
36125
|
-
yes: { type: "boolean", description: "apply-revision: confirm the
|
|
36124
|
+
reason: { type: "string", description: "apply-revision, revoke-revision: why, recorded in the audit row (revoke: required, at most 500 characters)" },
|
|
36125
|
+
yes: { type: "boolean", description: "apply-revision, revoke-revision: confirm the change" },
|
|
36126
36126
|
dryRun: { type: "boolean", description: "Print the request that would be sent; perform no write" }
|
|
36127
|
-
}
|
|
36127
|
+
};
|
|
36128
|
+
var templateRevisionArgs = withArgs(templateRevisionArgsDef);
|
|
36128
36129
|
var templates = defineCommand({
|
|
36129
36130
|
meta: { name: "templates", description: "Mission templates" },
|
|
36130
36131
|
args: withArgs(),
|
|
@@ -36229,6 +36230,61 @@ var templates = defineCommand({
|
|
|
36229
36230
|
assertTemplateRevisionOk(res.status, res.data, "apply template revision");
|
|
36230
36231
|
return output(res.data, fmt);
|
|
36231
36232
|
}
|
|
36233
|
+
}),
|
|
36234
|
+
// #696: revoke a revision, and list the missions still pinned to it.
|
|
36235
|
+
"revoke-revision": defineCommand({
|
|
36236
|
+
meta: {
|
|
36237
|
+
name: "revoke-revision",
|
|
36238
|
+
description: "Revoke a published revision: no new mission can be pinned to it (--id, --hash, --reason, --yes; tenant admin). Pinned missions keep working; cannot be undone."
|
|
36239
|
+
},
|
|
36240
|
+
args: templateRevisionArgs,
|
|
36241
|
+
async run({ args }) {
|
|
36242
|
+
const { client, fmt } = ctx(args);
|
|
36243
|
+
req(args, "id");
|
|
36244
|
+
req(args, "hash");
|
|
36245
|
+
const reason = String(args.reason ?? "").trim();
|
|
36246
|
+
if (!reason) throw commandError("REASON_REQUIRED", 2, "Revoking a revision needs --reason (at most 500 characters): it is shown to everyone who meets the revoked revision.");
|
|
36247
|
+
const path11 = revisionPath(String(args.id), String(args.hash), "revoke");
|
|
36248
|
+
const body = { reason };
|
|
36249
|
+
if (args.dryRun) return output(dryRunResult("POST", path11, body), fmt);
|
|
36250
|
+
if (!args.yes) {
|
|
36251
|
+
throw commandError(
|
|
36252
|
+
"REVOKE_CONFIRMATION_REQUIRED",
|
|
36253
|
+
2,
|
|
36254
|
+
"Revoking a revision cannot be undone. List the missions pinned to it with `hive templates revision-missions`, then re-run with --yes."
|
|
36255
|
+
);
|
|
36256
|
+
}
|
|
36257
|
+
const res = await client.post(path11, body);
|
|
36258
|
+
assertTemplateRevisionOk(res.status, res.data, "revoke template revision");
|
|
36259
|
+
return output(res.data, fmt);
|
|
36260
|
+
}
|
|
36261
|
+
}),
|
|
36262
|
+
"revision-missions": defineCommand({
|
|
36263
|
+
meta: { name: "revision-missions", description: "List the missions pinned to a revision, to move each with preview-revision and apply-revision (--id, --hash, --limit, --cursor; tenant admin). Follows the pages unless --cursor is given." },
|
|
36264
|
+
args: withArgs({
|
|
36265
|
+
...templateRevisionArgsDef,
|
|
36266
|
+
limit: { type: "string", description: "revision-missions: missions per page (1 to 1000, default 100)" },
|
|
36267
|
+
cursor: { type: "string", description: "revision-missions: nextCursor of a previous page; prints that one page only" }
|
|
36268
|
+
}),
|
|
36269
|
+
async run({ args }) {
|
|
36270
|
+
const { client, fmt } = ctx(args);
|
|
36271
|
+
req(args, "id");
|
|
36272
|
+
req(args, "hash");
|
|
36273
|
+
const base = revisionPath(String(args.id), String(args.hash), "missions");
|
|
36274
|
+
const missions = [];
|
|
36275
|
+
let cursor = args.cursor ? String(args.cursor) : "";
|
|
36276
|
+
let last = {};
|
|
36277
|
+
for (let page = 0; page < 1e3; page++) {
|
|
36278
|
+
const query = [args.limit ? `limit=${encodeURIComponent(String(args.limit))}` : "", cursor ? `cursor=${encodeURIComponent(cursor)}` : ""].filter(Boolean).join("&");
|
|
36279
|
+
const res = await client.get(query ? `${base}?${query}` : base);
|
|
36280
|
+
assertTemplateRevisionOk(res.status, res.data, "list the missions pinned to a template revision");
|
|
36281
|
+
last = recordOf3(res.data);
|
|
36282
|
+
missions.push(...Array.isArray(last.missions) ? last.missions : []);
|
|
36283
|
+
if (args.cursor || last.hasMore !== true || typeof last.nextCursor !== "string") break;
|
|
36284
|
+
cursor = last.nextCursor;
|
|
36285
|
+
}
|
|
36286
|
+
return output(args.cursor ? last : { ...last, missions, nextCursor: last.hasMore === true ? last.nextCursor : null }, fmt);
|
|
36287
|
+
}
|
|
36232
36288
|
})
|
|
36233
36289
|
}
|
|
36234
36290
|
});
|
|
@@ -36240,6 +36296,8 @@ var TEMPLATE_REVISION_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
36240
36296
|
"TEMPLATE_REVISION_INVALID",
|
|
36241
36297
|
"TEMPLATE_REVISION_NOT_FOUND",
|
|
36242
36298
|
"TEMPLATE_REVISION_TEMPLATE_MISMATCH",
|
|
36299
|
+
"TEMPLATE_REVISION_REVOKED",
|
|
36300
|
+
"TEMPLATE_REVISION_REVOKE_REASON_INVALID",
|
|
36243
36301
|
"TEMPLATE_APPLY_MISSION_UNBOUND",
|
|
36244
36302
|
"TEMPLATE_APPLY_REFUSED",
|
|
36245
36303
|
"TEMPLATE_APPLY_ACKNOWLEDGEMENT_REQUIRED",
|
|
@@ -36254,7 +36312,9 @@ function assertTemplateRevisionOk(status2, data, action) {
|
|
|
36254
36312
|
const findings = Array.isArray(body.findings) ? body.findings : [];
|
|
36255
36313
|
const missing = Array.isArray(body.unacknowledged) ? body.unacknowledged.map(String) : [];
|
|
36256
36314
|
const refused = findings.filter((f) => f.class === "refused").map((f) => String(f.code));
|
|
36315
|
+
const revoked = recordOf3(body.details);
|
|
36257
36316
|
const detail = [
|
|
36317
|
+
code === "TEMPLATE_REVISION_REVOKED" ? `Revoked ${String(revoked.revokedAt ?? "")}: ${String(revoked.reason ?? "")}`.trim() + "." : "",
|
|
36258
36318
|
missing.length ? `Acknowledge by name: ${missing.join(", ")}.` : "",
|
|
36259
36319
|
refused.length ? `Refused, no acknowledgement helps: ${[...new Set(refused)].join(", ")}.` : ""
|
|
36260
36320
|
].filter(Boolean).join(" ");
|