@referalli/cli 0.4.2 → 0.4.3
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 +4 -0
- package/dist/src/doctor.js +13 -0
- 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,10 @@ 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.3 - 2026-11-04
|
|
9
|
+
|
|
10
|
+
- `doctor` fails an auth connection whose last refused call (`lastError`) is newer than its last sign-up, with the error. It also warns when the org's tracking consent mode is `none` (live keys).
|
|
11
|
+
|
|
8
12
|
## 0.4.2 - 2026-11-03
|
|
9
13
|
|
|
10
14
|
- Fixed: `plan`/`apply` with a `billingConnections:` list failed with `conns.filter is not a function` (the connections list now arrives in the list envelope).
|
package/dist/src/doctor.js
CHANGED
|
@@ -100,6 +100,10 @@ async function authChecks(client, now) {
|
|
|
100
100
|
if (c.tokenVerification && c.allowedOrigins.length === 0) {
|
|
101
101
|
return { id, status: 'warn', message: `${label} verifies tokens but has no allowedOrigins: the widget session refuses browsers`, fix: `PATCH /v1/auth/connections/${c.id} {"allowedOrigins":["https://your.app"]}` };
|
|
102
102
|
}
|
|
103
|
+
// A refusal newer than the last sign-up: the platform is calling, and its calls are failing.
|
|
104
|
+
if (c.lastError && (!c.lastSignupAt || new Date(c.lastError.at) > new Date(c.lastSignupAt))) {
|
|
105
|
+
return { id, status: 'fail', message: `${label} refused its last call (${c.lastError.at}): ${c.lastError.code}: ${c.lastError.message}`, fix: `fix the caller's request body, then retry its failed calls (Atlas: POST /v1/instance/referrals/calls/retry_failed)` };
|
|
106
|
+
}
|
|
103
107
|
// Protocol connections (Atlas, custom) can't be pinged with an API key: when it last filed a sign-up says it's wired.
|
|
104
108
|
// undefined: an API from before lastSignupAt, nothing to say.
|
|
105
109
|
if (c.lastSignupAt === null) {
|
|
@@ -130,6 +134,15 @@ async function trackingCheck(client, env) {
|
|
|
130
134
|
throw err;
|
|
131
135
|
out.push({ id: 'tracking', status: 'fail', message: `tracking token ${org.trackingToken} is unknown to /t/…/config.json`, fix: '/settings' });
|
|
132
136
|
}
|
|
137
|
+
// Consent mode `none` (orgs from before consent support start there): aff.js stores the referral before the visitor chooses.
|
|
138
|
+
if (org.livemode !== false) {
|
|
139
|
+
out.push(...(await guard('tracking.consent', '/settings → Install', async () => {
|
|
140
|
+
const c = await client.request('GET', '/v1/org/tracking-consent');
|
|
141
|
+
return c.mode === 'none'
|
|
142
|
+
? [{ id: 'tracking.consent', status: 'warn', message: "tracking consent is 'none': aff.js stores the referral before the visitor chooses", fix: `PUT /v1/org/tracking-consent {"mode":"auto"} (or /settings → Install)` }]
|
|
143
|
+
: [{ id: 'tracking.consent', status: 'ok', message: `tracking consent: ${c.mode}` }];
|
|
144
|
+
})));
|
|
145
|
+
}
|
|
133
146
|
// The token the product is configured with (run doctor with the app's env) must be this mode's.
|
|
134
147
|
const name = env.REFERALLI_TRACKING_TOKEN ? 'REFERALLI_TRACKING_TOKEN' : env.NEXT_PUBLIC_REFERALLI_TRACKING_TOKEN ? 'NEXT_PUBLIC_REFERALLI_TRACKING_TOKEN' : null;
|
|
135
148
|
if (!name)
|
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.3";
|
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.3';
|
package/package.json
CHANGED