@referalli/cli 0.3.0 → 0.3.1

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,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.3.1 - 2026-11-02
9
+
10
+ - 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.
11
+
8
12
  ## 0.3.0 - 2026-11-02
9
13
 
10
14
  - `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', '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,15 @@ export async function buildPlan(client, config, env) {
184
184
  }
185
185
  if (spec.stripeCredits) {
186
186
  const { secretKeyEnv, ...s } = spec.stripeCredits;
187
- const want = { enabled: s.enabled, referrerMatch: s.referrerMatch ?? 'billing_link', metadataKey: s.metadataKey ?? null, refereeRewards: s.refereeRewards ?? false };
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
+ };
188
196
  const curS = cur ? await client.request('GET', `/v1/programs/${cur.id}/stripe-credits`) : null;
189
197
  const fields = Object.keys(want)
190
198
  .filter((k) => !curS || !same(curS[k], want[k]))
@@ -1,2 +1,2 @@
1
1
  /** Kept in step with package.json by test/version.test.ts. */
2
- export declare const VERSION = "0.3.0";
2
+ export declare const VERSION = "0.3.1";
@@ -1,2 +1,2 @@
1
1
  /** Kept in step with package.json by test/version.test.ts. */
2
- export const VERSION = '0.3.0';
2
+ export const VERSION = '0.3.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@referalli/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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",