@revturbine/cli 0.13.0 → 0.13.1
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/dist/cli.js +10 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9032,7 +9032,7 @@ function formatDiff(diff) {
|
|
|
9032
9032
|
const parts = [];
|
|
9033
9033
|
if (d.added.length) parts.push(`+${d.added.length} added`);
|
|
9034
9034
|
if (d.changed.length) parts.push(`~${d.changed.length} changed`);
|
|
9035
|
-
if (d.removed.length) parts.push(`-${d.removed.length} only in tenant (
|
|
9035
|
+
if (d.removed.length) parts.push(`-${d.removed.length} only in tenant (pruned on launch unless --no-prune)`);
|
|
9036
9036
|
lines.push(` ${coll}: ${parts.join(", ")}`);
|
|
9037
9037
|
for (const k of d.added) lines.push(` + ${k}`);
|
|
9038
9038
|
for (const k of d.changed) lines.push(` ~ ${k}`);
|
|
@@ -10414,7 +10414,7 @@ program.command("preview").description("The open draft's Runtime Impact summary
|
|
|
10414
10414
|
].join("\n");
|
|
10415
10415
|
emit(data, Boolean(opts.json), text);
|
|
10416
10416
|
});
|
|
10417
|
-
program.command("evaluate").description("Run placement/entitlement decisions for a user context against a config version. Requires --live, --draft, or --release <id>.").option("--live", "Evaluate the live configuration").option("--draft", "Evaluate the tenant's open draft (clean-room: no suppression/cap history)").option("--release <id>", "Evaluate a past release (from its frozen snapshot)").option("--entitlement <handle>", "Check one entitlement (the checkEntitlement result)").option("--slot <id>", "Evaluate one
|
|
10417
|
+
program.command("evaluate").description("Run placement/entitlement decisions for a user context against a config version. Requires --live, --draft, or --release <id>.").option("--live", "Evaluate the live configuration").option("--draft", "Evaluate the tenant's open draft (clean-room: no suppression/cap history)").option("--release <id>", "Evaluate a past release (from its frozen snapshot)").option("--entitlement <handle>", "Check one entitlement (the checkEntitlement result)").option("--slot <id>", "Evaluate one surface slot (the getPlacement decision for that slot)").option("--surface-type <type>", "Disambiguate a slot that can render more than one surface (with --slot), or resolve by surface type alone").option("--plan-handle <handle>", "Evaluate as if the user were on this plan (overrides the ctx file)").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).requiredOption("--user <file>", "JSON file: { user_id, customer_id?, plan_handle?, traits?, now_iso? }").option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").action(
|
|
10418
10418
|
async (opts) => {
|
|
10419
10419
|
const [sel] = requireSelectors(opts, [], { count: 1, allowed: ["draft", "live", "release"], command: "evaluate" });
|
|
10420
10420
|
const conn = connect(opts.url, opts.tenantId);
|
|
@@ -10427,13 +10427,18 @@ program.command("evaluate").description("Run placement/entitlement decisions for
|
|
|
10427
10427
|
}
|
|
10428
10428
|
const body = { ...ctx };
|
|
10429
10429
|
if (opts.planHandle) body.plan_handle = opts.planHandle;
|
|
10430
|
-
|
|
10430
|
+
const wantsSlot = Boolean(opts.slot || opts.surfaceType);
|
|
10431
|
+
if (opts.entitlement && wantsSlot) {
|
|
10432
|
+
fail(EXIT.USAGE, "pass exactly one of --entitlement or --slot/--surface-type (or neither for the ctx file lists).");
|
|
10433
|
+
}
|
|
10431
10434
|
if (opts.entitlement) {
|
|
10432
10435
|
body.entitlement_handles = [opts.entitlement];
|
|
10433
10436
|
body.placement_ids = [];
|
|
10434
10437
|
}
|
|
10435
|
-
if (
|
|
10436
|
-
body.
|
|
10438
|
+
if (wantsSlot) {
|
|
10439
|
+
if (opts.slot) body.slot_id = opts.slot;
|
|
10440
|
+
if (opts.surfaceType) body.surface_type = opts.surfaceType;
|
|
10441
|
+
body.placement_ids = [];
|
|
10437
10442
|
body.entitlement_handles = [];
|
|
10438
10443
|
}
|
|
10439
10444
|
if (sel.kind === "release") body.playbook_version_id = sel.id;
|
package/package.json
CHANGED