@abloatai/cli 0.52.0 → 0.53.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.cjs +17 -20
  2. package/package.json +3 -3
package/dist/cli.cjs CHANGED
@@ -3086,11 +3086,11 @@ var init_dbRole = __esm({
3086
3086
  });
3087
3087
 
3088
3088
  // src/controlPlane.ts
3089
- function apiBaseUrl() {
3090
- return (process.env.ABLO_API_URL ?? DEFAULT_URL).replace(/\/+$/, "");
3089
+ function apiBaseUrl(explicit) {
3090
+ return (0, import_baseUrl.normalizeAbloBaseUrl)(explicit ?? process.env.ABLO_API_URL ?? DEFAULT_URL);
3091
3091
  }
3092
3092
  async function requestControlPlane(req) {
3093
- const base = (req.baseUrl ?? apiBaseUrl()).replace(/\/+$/, "");
3093
+ const base = apiBaseUrl(req.baseUrl);
3094
3094
  const url = `${base}/api${req.path}`;
3095
3095
  const doFetch = req.fetchImpl ?? fetch;
3096
3096
  const ctrl = req.timeoutMs !== void 0 ? new AbortController() : null;
@@ -3139,7 +3139,7 @@ async function tryControlPlane(req) {
3139
3139
  return { ok: false, error: err instanceof import_errors4.AbloError ? err : new import_errors4.AbloError(String(err)) };
3140
3140
  }
3141
3141
  }
3142
- var import_zod, import_errors4, import_hostedEndpoints, DEFAULT_URL;
3142
+ var import_zod, import_errors4, import_hostedEndpoints, import_baseUrl, DEFAULT_URL;
3143
3143
  var init_controlPlane = __esm({
3144
3144
  "src/controlPlane.ts"() {
3145
3145
  "use strict";
@@ -3147,6 +3147,7 @@ var init_controlPlane = __esm({
3147
3147
  import_zod = require("zod");
3148
3148
  import_errors4 = require("@abloatai/transaction/errors");
3149
3149
  import_hostedEndpoints = require("@abloatai/transaction/auth/hostedEndpoints");
3150
+ import_baseUrl = require("@abloatai/transaction/auth/baseUrl");
3150
3151
  DEFAULT_URL = import_hostedEndpoints.ABLO_DEFAULT_BASE_URL;
3151
3152
  }
3152
3153
  });
@@ -3452,9 +3453,6 @@ var init_theme = __esm({
3452
3453
  });
3453
3454
 
3454
3455
  // src/projects.ts
3455
- function apiUrl() {
3456
- return (process.env.ABLO_API_URL ?? import_hostedEndpoints2.ABLO_DEFAULT_BASE_URL).replace(/\/+$/, "");
3457
- }
3458
3456
  function requireKey() {
3459
3457
  const apiKey = resolveOrgManagementKey();
3460
3458
  if (!apiKey) {
@@ -3712,16 +3710,17 @@ async function projects(argv) {
3712
3710
  );
3713
3711
  process.exit(1);
3714
3712
  }
3715
- var import_picocolors3, import_hostedEndpoints2, import_wire, ANSI_ESCAPE, visibleLength, pad;
3713
+ var import_picocolors3, import_wire, apiUrl, ANSI_ESCAPE, visibleLength, pad;
3716
3714
  var init_projects = __esm({
3717
3715
  "src/projects.ts"() {
3718
3716
  "use strict";
3719
3717
  init_cjs_shims();
3720
3718
  import_picocolors3 = __toESM(require_picocolors(), 1);
3721
3719
  init_config();
3722
- import_hostedEndpoints2 = require("@abloatai/transaction/auth/hostedEndpoints");
3720
+ init_controlPlane();
3723
3721
  import_wire = require("@abloatai/transaction/wire");
3724
3722
  init_theme();
3723
+ apiUrl = apiBaseUrl;
3725
3724
  ANSI_ESCAPE = /\u001B\[[0-9;]*m/g;
3726
3725
  visibleLength = (s) => s.replace(ANSI_ESCAPE, "").length;
3727
3726
  pad = (s, width) => s + " ".repeat(Math.max(0, width - visibleLength(s)));
@@ -3971,7 +3970,7 @@ var init_observeCliError = __esm({
3971
3970
  import_errorObservation = require("@abloatai/transaction/errorObservation");
3972
3971
  import_errors5 = require("@abloatai/transaction/errors");
3973
3972
  dsn = process.env.ABLO_CLI_SENTRY_DSN ?? "https://1ac154bff10b06836e1ea9de9e0d92f0@o4510928209772544.ingest.de.sentry.io/4511660691423312" ?? "";
3974
- release = process.env.ABLO_CLI_RELEASE ?? "@abloatai/cli@0.52.0";
3973
+ release = process.env.ABLO_CLI_RELEASE ?? "@abloatai/cli@0.53.0";
3975
3974
  initialized = false;
3976
3975
  nativeProcessExit = process.exit.bind(process);
3977
3976
  exitBoundaryInstalled = false;
@@ -4457,7 +4456,7 @@ function truthyEnvironmentValue(value) {
4457
4456
  return value !== void 0 && value !== "" && value !== "0" && value.toLowerCase() !== "false";
4458
4457
  }
4459
4458
  function cliVersion() {
4460
- return "0.52.0";
4459
+ return "0.53.0";
4461
4460
  }
4462
4461
  function cliOs() {
4463
4462
  const value = (0, import_node_os.platform)();
@@ -4559,7 +4558,7 @@ async function pushSchema(schema, args) {
4559
4558
  function parsePushArgs(argv) {
4560
4559
  let schemaPath = DEFAULT_SCHEMA_PATH;
4561
4560
  let exportName = DEFAULT_EXPORT;
4562
- let url = process.env.ABLO_API_URL ?? DEFAULT_URL;
4561
+ let url;
4563
4562
  let force = false;
4564
4563
  let yes = false;
4565
4564
  let dryRun = false;
@@ -4621,7 +4620,7 @@ function parsePushArgs(argv) {
4621
4620
  throw new import_errors7.AbloValidationError(`unknown flag: ${arg}`, { code: "cli_invalid_arguments" });
4622
4621
  }
4623
4622
  }
4624
- url = url.replace(/\/+$/, "");
4623
+ url = apiBaseUrl(url);
4625
4624
  return {
4626
4625
  schemaPath,
4627
4626
  exportName,
@@ -284090,7 +284089,7 @@ function truncate(text, max) {
284090
284089
  init_cjs_shims();
284091
284090
  var import_picocolors14 = __toESM(require_picocolors(), 1);
284092
284091
  var import_branches = require("@abloatai/transaction/branches");
284093
- var import_hostedEndpoints3 = require("@abloatai/transaction/auth/hostedEndpoints");
284092
+ init_controlPlane();
284094
284093
  init_config();
284095
284094
  var BRANCH_USAGE = `Usage:
284096
284095
  ablo branch list [--json]
@@ -284103,9 +284102,7 @@ var BRANCH_USAGE = `Usage:
284103
284102
 
284104
284103
  Branches are scoped by the active project's management credential. Slugs are display handles;
284105
284104
  automation should retain the immutable branch id returned by create/ensure.`;
284106
- function apiUrl2(baseUrl2) {
284107
- return (baseUrl2 ?? process.env.ABLO_API_URL ?? import_hostedEndpoints3.ABLO_DEFAULT_BASE_URL).replace(/\/+$/, "");
284108
- }
284105
+ var apiUrl2 = apiBaseUrl;
284109
284106
  function requireKey2(explicit) {
284110
284107
  const key = explicit ?? resolveManagementKey();
284111
284108
  if (!key) {
@@ -284374,7 +284371,7 @@ var import_source3 = require("@abloatai/transaction/source");
284374
284371
  function parseDevArgs(argv) {
284375
284372
  let schemaPath = DEFAULT_SCHEMA_PATH;
284376
284373
  let exportName = DEFAULT_EXPORT;
284377
- let url = process.env.ABLO_API_URL ?? DEFAULT_URL;
284374
+ let url;
284378
284375
  let watchEnabled = false;
284379
284376
  let local = false;
284380
284377
  let sourcePath = "ablo/data-source.ts";
@@ -284406,7 +284403,7 @@ function parseDevArgs(argv) {
284406
284403
  throw new import_errors12.AbloValidationError(`unknown flag: ${arg}`, { code: "cli_invalid_arguments" });
284407
284404
  }
284408
284405
  }
284409
- url = url.replace(/\/+$/, "");
284406
+ url = apiBaseUrl(url);
284410
284407
  return {
284411
284408
  schemaPath,
284412
284409
  exportName,
@@ -284870,7 +284867,7 @@ async function runBranchDev(argv, dependencies = {}) {
284870
284867
  { code: "cli_invalid_arguments" }
284871
284868
  );
284872
284869
  }
284873
- const baseUrl2 = valueAfter2(parsed.devArgv, "--url") ?? process.env.ABLO_API_URL ?? DEFAULT_URL;
284870
+ const baseUrl2 = apiBaseUrl(valueAfter2(parsed.devArgv, "--url"));
284874
284871
  const result = await (dependencies.bootstrap ?? ensureBranchCredential)({
284875
284872
  slug,
284876
284873
  apiKey: managementKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abloatai/cli",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "The ablo command line: set up Ablo, connect your database, and push your schema from the terminal.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@sentry/node": "^10.18.0",
38
- "@abloatai/transaction": "^0.52.0",
38
+ "@abloatai/transaction": "^0.53.0",
39
39
  "jiti": "^2.7.0",
40
40
  "zod": "^4.4.3",
41
- "@abloatai/humans": "^0.52.0"
41
+ "@abloatai/humans": "^0.53.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@ablo/product-analytics": "file:../product-analytics",