@referalli/cli 0.4.10 → 0.4.12
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 +5 -0
- package/dist/src/doctor.js +14 -3
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
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.11 - 2026-11-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `doctor --program`: integration-health findings about org-wide connections follow the billing section's scope, and go into the other-programs line once the program has a connection of its own. Findings with `severity: "info"` show as ℹ.
|
|
12
|
+
|
|
8
13
|
## 0.4.10 - 2026-11-11
|
|
9
14
|
|
|
10
15
|
### Fixed
|
package/dist/src/doctor.js
CHANGED
|
@@ -191,6 +191,13 @@ function consentCheck(c, programs, scope) {
|
|
|
191
191
|
? [{ id, status: 'warn', message: `tracking consent is 'none': ${why}${listed}`, fix: `PUT /v1/org/tracking-consent {"mode":"auto"} (or /settings → Install)` }]
|
|
192
192
|
: [{ id, status: 'ok', message: `tracking consent: ${c.mode}${listed}` }];
|
|
193
193
|
}
|
|
194
|
+
/** RF-2 for program-scoped keys (no org read): the same check from each program's effectiveTrackingConsent. */
|
|
195
|
+
function programConsentCheck(programs, scope) {
|
|
196
|
+
if (programs.length === 0 || programs.some((p) => !p.effectiveTrackingConsent))
|
|
197
|
+
return []; // older API
|
|
198
|
+
const orgMode = programs.find((p) => !p.trackingConsent)?.effectiveTrackingConsent ?? 'none';
|
|
199
|
+
return consentCheck({ mode: orgMode }, programs, scope);
|
|
200
|
+
}
|
|
194
201
|
async function trackingCheck(client, env, programs, scope) {
|
|
195
202
|
const org = await client.request('GET', '/v1/org');
|
|
196
203
|
const out = [];
|
|
@@ -236,7 +243,9 @@ async function trackingCheck(client, env, programs, scope) {
|
|
|
236
243
|
async function healthChecks(client, scope, billing, tally) {
|
|
237
244
|
const res = await client.request('GET', '/v1/integration-health');
|
|
238
245
|
// RF-1: a check about another program's billing connection (billing.<provider>.<id>) goes into the tally.
|
|
239
|
-
|
|
246
|
+
// Also org-wide connections, once the scoped programs have connections of their own (as in billingChecks).
|
|
247
|
+
const hasOwn = !!scope && billing.some((c) => scope.some((p) => c.programIds?.includes(p)));
|
|
248
|
+
const others = new Set(billing.filter((c) => outside(scope, c.programIds) || (hasOwn && !c.programIds?.length)).map((c) => c.id));
|
|
240
249
|
const theirs = (h) => h.id.split('.').some((part) => others.has(part));
|
|
241
250
|
tally.other += res.checks.filter((h) => !h.ok && theirs(h)).length;
|
|
242
251
|
return res.checks.filter((h) => !theirs(h)).map((h) => {
|
|
@@ -245,7 +254,8 @@ async function healthChecks(client, scope, billing, tally) {
|
|
|
245
254
|
return { id, status: 'ok', message: h.detail };
|
|
246
255
|
const severe = !scope && (h.severity === 'error' || h.severity === 'critical');
|
|
247
256
|
const fix = [h.fix, h.docs].filter(Boolean).join(' ');
|
|
248
|
-
|
|
257
|
+
const status = severe ? 'fail' : h.severity === 'info' ? 'info' : 'warn';
|
|
258
|
+
return { id, status, message: h.detail, ...(fix ? { fix } : {}) };
|
|
249
259
|
});
|
|
250
260
|
}
|
|
251
261
|
/** A program settling by payout with no payout connection: partners can only be paid by hand. Test mode pays through the test rail. */
|
|
@@ -321,7 +331,7 @@ export function printChecks(out, checks, json) {
|
|
|
321
331
|
// What a program-scoped key is refused (the API's programScopedAllows), and the scope an org-wide key needs instead.
|
|
322
332
|
const ORG_WIDE = {
|
|
323
333
|
auth: { what: 'auth connections, Atlas sign-ups', scope: 'integrations:read or connections:read' },
|
|
324
|
-
tracking: { what: 'tracking token,
|
|
334
|
+
tracking: { what: 'tracking token, configured token', scope: 'org:read' },
|
|
325
335
|
health: { what: 'GET /v1/integration-health', scope: 'integrations:read' },
|
|
326
336
|
payouts: { what: 'payout connections', scope: 'payouts:read' },
|
|
327
337
|
email: { what: 'email settings', scope: 'org:read' },
|
|
@@ -439,6 +449,7 @@ export async function runDoctor(io, client, flags, now = new Date()) {
|
|
|
439
449
|
guard('billing', undefined, async () => billingChecks(scope, await billingList, tally)),
|
|
440
450
|
orgWide('auth', () => authChecks(client, now, programs, scope, tally)),
|
|
441
451
|
orgWide('tracking', () => trackingCheck(client, io.env, programs, scope)),
|
|
452
|
+
...(scoped && scope ? [guard('tracking.consent', undefined, async () => programConsentCheck(programs, scope))] : []),
|
|
442
453
|
orgWide('health', async () => healthChecks(client, scope, await billingList.catch(() => []), tally)),
|
|
443
454
|
orgWide('payouts', () => payoutChecks(client, programs, apiKey?.livemode !== false)),
|
|
444
455
|
orgWide('email', () => emailChecks(client, programs)),
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Kept in step with package.json by test/version.test.ts. */
|
|
2
|
-
export declare const VERSION = "0.4.
|
|
2
|
+
export declare const VERSION = "0.4.12";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Kept in step with package.json by test/version.test.ts. */
|
|
2
|
-
export const VERSION = '0.4.
|
|
2
|
+
export const VERSION = '0.4.12';
|
package/package.json
CHANGED