@referalli/cli 0.3.0 → 0.3.2
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 +8 -0
- package/dist/src/apply.js +11 -2
- 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,14 @@ 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.3.2 - 2026-11-02
|
|
9
|
+
|
|
10
|
+
- `apply` sends `waitForCustomer` under `stripeCredits` (the API replaces all credit settings on save, so leaving it out turns it off; the plan shows it).
|
|
11
|
+
|
|
12
|
+
## 0.3.1 - 2026-11-02
|
|
13
|
+
|
|
14
|
+
- Fixed: `apply` accepts `balanceCurrency` and `createCustomerIfMissing` under `stripeCredits`. Before, it refused them, and applying a file to a program that had them set turned them off without showing it in the plan.
|
|
15
|
+
|
|
8
16
|
## 0.3.0 - 2026-11-02
|
|
9
17
|
|
|
10
18
|
- `trigger --stripe <event> --connection <id> [--data JSON]`: send a Stripe event fixture into a test-mode billing connection (`POST /v1/sandbox/stripe-fixtures`) and print the commissions it created.
|
package/dist/src/apply.js
CHANGED
|
@@ -15,7 +15,7 @@ const PROGRAM_TOP = ['name', 'attributionModel', 'cookieWindowDays', 'signupToCo
|
|
|
15
15
|
// Program settings: PATCH takes them top-level, GET returns them under `settings`.
|
|
16
16
|
const PROGRAM_SETTINGS = ['probabilisticPolicy', 'selfReferralPolicy', 'splitCommissions', 'allowPaidSearch', 'challengeLinks', 'settlement'];
|
|
17
17
|
const PROGRAM_KEYS = ['slug', ...PROGRAM_TOP, ...PROGRAM_SETTINGS, 'destinationUrl', 'commissionRule', 'stripeCredits'];
|
|
18
|
-
const STRIPE_KEYS = ['enabled', 'referrerMatch', 'metadataKey', 'refereeRewards', 'secretKeyEnv'];
|
|
18
|
+
const STRIPE_KEYS = ['enabled', 'referrerMatch', 'metadataKey', 'refereeRewards', 'balanceCurrency', 'createCustomerIfMissing', 'waitForCustomer', 'secretKeyEnv'];
|
|
19
19
|
const WEBHOOK_KEYS = ['url', 'topics', 'programs', 'status', 'alertContacts'];
|
|
20
20
|
const API_KEY_KEYS = ['name', 'owner', 'mode', 'scopes', 'expiresInDays', 'programs', 'apiVersion'];
|
|
21
21
|
// What the API stores when a rule leaves these out (packages/commissions ruleConfigSchema).
|
|
@@ -184,7 +184,16 @@ export async function buildPlan(client, config, env) {
|
|
|
184
184
|
}
|
|
185
185
|
if (spec.stripeCredits) {
|
|
186
186
|
const { secretKeyEnv, ...s } = spec.stripeCredits;
|
|
187
|
-
|
|
187
|
+
// Every field, defaults included: the PUT replaces the settings, so one left out would be switched off.
|
|
188
|
+
const want = {
|
|
189
|
+
enabled: s.enabled,
|
|
190
|
+
referrerMatch: s.referrerMatch ?? 'billing_link',
|
|
191
|
+
metadataKey: s.metadataKey ?? null,
|
|
192
|
+
refereeRewards: s.refereeRewards ?? false,
|
|
193
|
+
balanceCurrency: typeof s.balanceCurrency === 'string' ? s.balanceCurrency.toLowerCase() : null,
|
|
194
|
+
createCustomerIfMissing: s.createCustomerIfMissing ?? null,
|
|
195
|
+
waitForCustomer: s.waitForCustomer ?? false,
|
|
196
|
+
};
|
|
188
197
|
const curS = cur ? await client.request('GET', `/v1/programs/${cur.id}/stripe-credits`) : null;
|
|
189
198
|
const fields = Object.keys(want)
|
|
190
199
|
.filter((k) => !curS || !same(curS[k], want[k]))
|
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.3.
|
|
2
|
+
export declare const VERSION = "0.3.2";
|
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.3.
|
|
2
|
+
export const VERSION = '0.3.2';
|
package/package.json
CHANGED