@referalli/cli 0.4.7 → 0.4.9
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 +21 -0
- package/dist/src/apply.d.ts +31 -5
- package/dist/src/apply.js +363 -41
- package/dist/src/commands.d.ts +3 -1
- package/dist/src/commands.js +22 -4
- package/dist/src/config.d.ts +4 -0
- package/dist/src/config.js +5 -1
- package/dist/src/doctor.d.ts +6 -2
- package/dist/src/doctor.js +214 -53
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +11 -3
- package/dist/src/scan.js +20 -14
- 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,27 @@ 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.9 - 2026-11-11
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- `doctor --program` only fails on the program's own resources. Other programs' problems become one line (`scope.other`), and an org-wide connection the program doesn't use is a warning.
|
|
12
|
+
- The `tracking.consent` check uses the program's own `trackingConsent`, and never suggests an org-wide change for a program that overrides it.
|
|
13
|
+
- Auth connections show the last refused sign-up call.
|
|
14
|
+
- `keys list` shows each key's programs.
|
|
15
|
+
|
|
16
|
+
## 0.4.8 - 2026-11-11
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- `doctor` runs every `/v1/integration-health` check, plus payouts, email provider, widget setup, unpaid approved commissions and the public join page.
|
|
20
|
+
- `doctor` and `plan --prune` stay inside the key's programs; `REFERALLI_PROGRAM_ID` sets the default `--program`.
|
|
21
|
+
- Webhooks in the yaml can match by `id`, so a URL change updates the endpoint and keeps its secret. `plan`/`apply --prune` delete what the file no longer lists.
|
|
22
|
+
- New yaml sections: `payouts`, `email`, `trackingConsent`, `hostedPages`; program fields `widget`, `refereeReward`, `brand`, `termsUrl`, `faqUrl`, `supportUrl`, `trackingConsent`, `notificationEmails`, `howItWorksMd`; `authConnections[].tokenVerification`.
|
|
23
|
+
- `referalli billing owner set <accountRef> <customerRef>`.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Unknown webhook topics are rejected with a suggestion. Endpoints managed by Atlas (`managedBy`) are not compared on topics.
|
|
27
|
+
- `doctor --scan` warns only on the old names Referalli itself read; other `REFERALLY_*` names are info.
|
|
28
|
+
|
|
8
29
|
## 0.4.7 - 2026-11-07
|
|
9
30
|
|
|
10
31
|
### Added
|
package/dist/src/apply.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Client } from './client.js';
|
|
2
2
|
/**
|
|
3
3
|
* `referalli plan|apply <file>`: make the account match a declarative file.
|
|
4
|
-
* Every resource is matched by a stable key (program slug, webhook url, API key
|
|
5
|
-
* name + owner, billing connection name, auth connection provider + instance + program
|
|
4
|
+
* Every resource is matched by a stable key (program slug, webhook id or url, API key
|
|
5
|
+
* name + owner, billing connection name, auth connection provider + instance + program,
|
|
6
|
+
* payout provider); creates carry an Idempotency-Key derived from that key and the
|
|
6
7
|
* request, so a retried apply never creates twice. Nothing missing from the file
|
|
7
|
-
* is
|
|
8
|
+
* is deleted unless `--prune` asks (never programs, never the calling key).
|
|
8
9
|
*/
|
|
9
10
|
export declare class ConfigError extends Error {
|
|
10
11
|
}
|
|
@@ -15,12 +16,22 @@ interface ProgramSpec extends Obj {
|
|
|
15
16
|
stripeCredits?: Obj & {
|
|
16
17
|
secretKeyEnv?: string;
|
|
17
18
|
};
|
|
19
|
+
refereeReward?: Obj | null;
|
|
18
20
|
}
|
|
19
21
|
interface WebhookSpec extends Obj {
|
|
22
|
+
/** whe_…: matches the endpoint by id, so its url can change (R-10). */
|
|
23
|
+
id?: string;
|
|
20
24
|
url: string;
|
|
21
25
|
topics?: string[];
|
|
22
26
|
programs?: string[];
|
|
23
27
|
status?: 'active' | 'paused';
|
|
28
|
+
managedBy?: string | null;
|
|
29
|
+
}
|
|
30
|
+
interface PayoutSpec extends Obj {
|
|
31
|
+
provider: string;
|
|
32
|
+
env?: string;
|
|
33
|
+
/** Credential field → environment variable holding it. */
|
|
34
|
+
credentialEnv: Record<string, string>;
|
|
24
35
|
}
|
|
25
36
|
interface ApiKeySpec extends Obj {
|
|
26
37
|
name: string;
|
|
@@ -39,6 +50,9 @@ interface AuthConnectionSpec extends Obj {
|
|
|
39
50
|
program: string;
|
|
40
51
|
instanceId?: string;
|
|
41
52
|
appId?: string;
|
|
53
|
+
tokenVerification?: (Obj & {
|
|
54
|
+
sharedSecretEnv?: string;
|
|
55
|
+
}) | null;
|
|
42
56
|
}
|
|
43
57
|
export interface ApplyConfig {
|
|
44
58
|
programs: ProgramSpec[];
|
|
@@ -46,12 +60,21 @@ export interface ApplyConfig {
|
|
|
46
60
|
apiKeys: ApiKeySpec[];
|
|
47
61
|
billingConnections: BillingConnectionSpec[];
|
|
48
62
|
authConnections: AuthConnectionSpec[];
|
|
63
|
+
payouts: PayoutSpec[];
|
|
64
|
+
/** Org singletons: undefined when the file leaves them out. */
|
|
65
|
+
email?: Obj & {
|
|
66
|
+
apiKeyEnv?: string;
|
|
67
|
+
};
|
|
68
|
+
trackingConsent?: Obj;
|
|
69
|
+
hostedPages?: Obj;
|
|
70
|
+
/** The top-level sections the file has (even empty): the kinds `--prune` manages. */
|
|
71
|
+
sections: string[];
|
|
49
72
|
}
|
|
50
73
|
/** Parse and check a referalli.yaml (JSON is YAML too). */
|
|
51
74
|
export declare function parseConfig(text: string, file?: string): ApplyConfig;
|
|
52
75
|
export type Field = [name: string, from: unknown, to: unknown];
|
|
53
76
|
export interface Change {
|
|
54
|
-
action: 'create' | 'update' | 'noop';
|
|
77
|
+
action: 'create' | 'update' | 'delete' | 'noop';
|
|
55
78
|
kind: string;
|
|
56
79
|
label: string;
|
|
57
80
|
fields: Field[];
|
|
@@ -70,7 +93,9 @@ export declare function listAll<T extends {
|
|
|
70
93
|
id: string;
|
|
71
94
|
}>(client: Client, path: string, headers?: Record<string, string>): Promise<T[]>;
|
|
72
95
|
/** Compare the file with the account; nothing is written. */
|
|
73
|
-
export declare function buildPlan(client: Client, config: ApplyConfig, env: NodeJS.ProcessEnv
|
|
96
|
+
export declare function buildPlan(client: Client, config: ApplyConfig, env: NodeJS.ProcessEnv, opts?: {
|
|
97
|
+
prune?: boolean;
|
|
98
|
+
}): Promise<{
|
|
74
99
|
changes: Change[];
|
|
75
100
|
ids: Map<string, string>;
|
|
76
101
|
}>;
|
|
@@ -87,6 +112,7 @@ export interface ApplyIo {
|
|
|
87
112
|
export declare function runApply(io: ApplyIo, client: Client, file: string, opts: {
|
|
88
113
|
apply: boolean;
|
|
89
114
|
check: boolean;
|
|
115
|
+
prune?: boolean;
|
|
90
116
|
secretFile?: string;
|
|
91
117
|
}): Promise<number>;
|
|
92
118
|
export {};
|