@referalli/cli 0.4.9 → 0.4.10

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/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to `@referalli/cli` are recorded here. The format follows
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Before 1.0, a minor
6
6
  bump may include breaking changes; they are called out under **Changed**.
7
7
 
8
+ ## 0.4.10 - 2026-11-11
9
+
10
+ ### Fixed
11
+ - `doctor --program`: when several org-wide billing connections exist (one per product in a shared org), a broken one is ⚠ as long as another works, with the fix to limit it to its programs. It still fails when it's the only connection the program could use.
12
+
8
13
  ## 0.4.9 - 2026-11-11
9
14
 
10
15
  ### Changed
@@ -90,11 +90,16 @@ function billingChecks(scope, all, tally) {
90
90
  if (conns.length === 0) {
91
91
  return [{ id: 'billing', status: 'warn', message: "no billing connection: payments won't earn commission", fix: 'POST /v1/billing/connections' }];
92
92
  }
93
- // An org-wide connection matters to the scope only when one of its programs has no connection of its own.
94
- const usesOrgWide = !scope || scope.some((p) => !all.some((c) => c.programIds?.includes(p)));
93
+ // Scoped: a failing org-wide connection fails the run only when the program has nothing else that works
94
+ // (several products often share one org, each with its own org-wide connection).
95
+ const working = conns.filter((c) => billingCheck(c).status !== 'fail').length;
95
96
  return conns.map((c) => {
96
97
  const check = billingCheck(c);
97
- return usesOrgWide || c.programIds?.length ? check : unusedOrgWide(check, 'not used by this program: it has its own billing connection');
98
+ if (!scope || c.programIds?.length || working === 0 || check.status !== 'fail')
99
+ return check;
100
+ const own = all.some((o) => scope.some((p) => o.programIds?.includes(p)));
101
+ const why = own ? 'not used by this program: it has its own billing connection' : 'this program has another working connection';
102
+ return { ...unusedOrgWide(check, why), fix: `if it belongs to other programs, limit it: PATCH /v1/billing/connections/${c.id} {"programIds":["prg_…"]}` };
98
103
  });
99
104
  }
100
105
  function billingCheck(c) {
@@ -1,2 +1,2 @@
1
1
  /** Kept in step with package.json by test/version.test.ts. */
2
- export declare const VERSION = "0.4.9";
2
+ export declare const VERSION = "0.4.10";
@@ -1,2 +1,2 @@
1
1
  /** Kept in step with package.json by test/version.test.ts. */
2
- export const VERSION = '0.4.9';
2
+ export const VERSION = '0.4.10';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@referalli/cli",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "The Referalli command line: sign in, forward webhooks to localhost, trigger test events, tail events and API logs.",
5
5
  "license": "MIT",
6
6
  "type": "module",