@drip-apex/apex-cli 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/dist/cli.js +26 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7112,7 +7112,7 @@ var import_node_os3 = __toESM(require("node:os"));
7112
7112
  // package.json
7113
7113
  var package_default = {
7114
7114
  name: "@drip-apex/apex-cli",
7115
- version: "0.8.0",
7115
+ version: "0.8.1",
7116
7116
  license: "MIT",
7117
7117
  description: "Apex CLI for managing experiments, approved roadmap ideas, and draft workspaces.",
7118
7118
  private: false,
@@ -8969,6 +8969,16 @@ function buildQaPreviewUrl2(storeUrl, experimentId, variationId) {
8969
8969
  return url;
8970
8970
  }
8971
8971
 
8972
+ // src/lib/device-label.ts
8973
+ function deviceLabel(targeting) {
8974
+ if (!targeting || typeof targeting !== "object") return void 0;
8975
+ const device = targeting.deviceType;
8976
+ if (device === "desktop") return "Desktop only";
8977
+ if (device === "mobile") return "Mobile only";
8978
+ if (device === "tablet") return "Tablet only";
8979
+ return void 0;
8980
+ }
8981
+
8972
8982
  // src/lib/test-key.ts
8973
8983
  var TEST_KEY_RE = /^([A-Z0-9]{2,8})-(\d+)$/;
8974
8984
  function isTestKeyReference(value) {
@@ -9279,8 +9289,13 @@ function printExperiment(exp, dashboardUrl = null) {
9279
9289
  console.log(` Status: ${statusBadge(exp.status)}`);
9280
9290
  console.log(` Classification: ${exp.counting_type}`);
9281
9291
  console.log(` Traffic: ${(exp.traffic_allocation * 100).toFixed(0)}%`);
9292
+ console.log(` QA approved: ${exp.qa_approved_at ?? "none"}`);
9293
+ console.log(` Scheduled: ${exp.scheduled_start_at ?? "none"}`);
9294
+ console.log(` Started: ${exp.started_at ?? "none"}`);
9282
9295
  if (exp.targeting !== void 0) {
9283
9296
  console.log(` Targeting: ${effectivePageTargetingLabel(exp.targeting)}`);
9297
+ const device = deviceLabel(exp.targeting);
9298
+ if (device) console.log(` Device: ${device}`);
9284
9299
  }
9285
9300
  console.log(` Created: ${formatDate(exp.created_at)}`);
9286
9301
  if (exp.linked_idea) {
@@ -9560,6 +9575,9 @@ function printFilesystemPlan(plan) {
9560
9575
  console.log(source_default.dim(" No changes."));
9561
9576
  } else {
9562
9577
  plan.changes.forEach((change) => {
9578
+ if (change.entity === "experiment.targeting" && Array.isArray(change.detail?.changedKeys)) {
9579
+ console.log(` Changed keys: ${change.detail.changedKeys.join(", ")}`);
9580
+ }
9563
9581
  const pathLabel = change.path ? source_default.dim(` ${change.path}`) : "";
9564
9582
  const qa3 = change.invalidatesQa ? source_default.yellow(" invalidates QA") : "";
9565
9583
  console.log(
@@ -9826,7 +9844,9 @@ var list = new Command("list").alias("ls").description("List experiments (archiv
9826
9844
  }
9827
9845
  });
9828
9846
  });
9829
- var get = new Command("get").description("Get experiment details by ID or slug").argument("<id-or-slug>", EXPERIMENT_REFERENCE_DESCRIPTION).action(async function action4(idOrSlug) {
9847
+ var get = new Command("get").description(
9848
+ "Get experiment details by ID or slug. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft)."
9849
+ ).argument("<id-or-slug>", EXPERIMENT_REFERENCE_DESCRIPTION).action(async function action4(idOrSlug) {
9830
9850
  const spinner = await createSpinner("Fetching experiment...");
9831
9851
  const exp = await resolveExperiment(idOrSlug);
9832
9852
  spinner?.stop();
@@ -10140,7 +10160,9 @@ ${rows.map((row, index) => ` ${index + 1}. ${row.name} (${row.id})`).join("\n")
10140
10160
  `
10141
10161
  );
10142
10162
  }
10143
- var create = new Command("create").description("Create a new experiment").addOption(
10163
+ var create = new Command("create").description(
10164
+ "Create a complete experiment with page targeting, audiences, goals, and an optional QA preview URL. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft)."
10165
+ ).addOption(
10144
10166
  new Option("--counting-type <type>", "Experiment classification").choices(countingTypes).default("standard")
10145
10167
  ).option("--name <name>", "Experiment name").option("--slug <slug>", "URL-safe slug for GitOps").option("--description <desc>", "Description").option("--type <type>", "Experiment type: mutation or redirect", "mutation").option(
10146
10168
  "--source-url <pattern>",
@@ -10963,6 +10985,7 @@ var qaApprove = new Command("approve").description("Approve QA and move the expe
10963
10985
  {
10964
10986
  experimentId: resolved.experimentId,
10965
10987
  qaStatus: "done",
10988
+ experiment: res.data,
10966
10989
  experiment_status_before: before.status,
10967
10990
  experiment_status_after: res.data.status,
10968
10991
  transition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drip-apex/apex-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
5
  "description": "Apex CLI for managing experiments, approved roadmap ideas, and draft workspaces.",
6
6
  "private": false,