@referalli/cli 0.4.4 → 0.4.6
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 +9 -0
- package/dist/src/commands.js +9 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +3 -1
- 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,15 @@ 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.6 - 2026-11-05
|
|
9
|
+
|
|
10
|
+
- `keys create --programs ''` explains itself rather than printing the server's bare 400.
|
|
11
|
+
|
|
12
|
+
## 0.4.5 - 2026-11-05
|
|
13
|
+
|
|
14
|
+
- `keys create` takes `--programs ID,…` and `--expires-at ISO`.
|
|
15
|
+
- `partners list --program` with an unknown id now fails with a 404 and a non-zero exit, rather than "0 enrolled partner(s)". Needs the API from 2026-11-05.
|
|
16
|
+
|
|
8
17
|
## 0.4.4 - 2026-11-05
|
|
9
18
|
|
|
10
19
|
- `doctor --scan <dir> [--strict]`: finds the old names `REFERALLY_*`, `referally-version`, `referally_ctx`, `x-referally-*` and `@referally/*` in a source tree, each with file:line, replacement and removal date (or "no removal date set"). Warnings exit 0; `--strict` exits 1 on any. Needs no key.
|
package/dist/src/commands.js
CHANGED
|
@@ -339,7 +339,7 @@ export async function keys(io, sub, arg, flags) {
|
|
|
339
339
|
const { client } = signedIn(io);
|
|
340
340
|
if (sub === 'create') {
|
|
341
341
|
if (typeof flags.name !== 'string')
|
|
342
|
-
throw new CliError('Usage: referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,…] [--expires-days N]');
|
|
342
|
+
throw new CliError('Usage: referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,…] [--programs ID,…] [--expires-days N | --expires-at ISO]');
|
|
343
343
|
const mode = typeof flags.mode === 'string' ? flags.mode : 'both';
|
|
344
344
|
if (!['both', 'live', 'test'].includes(mode))
|
|
345
345
|
throw new CliError('--mode is both, live or test');
|
|
@@ -350,6 +350,14 @@ export async function keys(io, sub, arg, flags) {
|
|
|
350
350
|
body.scopes = flags.scopes.split(',').map((x) => x.trim()).filter(Boolean);
|
|
351
351
|
if (typeof flags['expires-days'] === 'string')
|
|
352
352
|
body.expiresInDays = Number(flags['expires-days']);
|
|
353
|
+
if (typeof flags['expires-at'] === 'string')
|
|
354
|
+
body.expiresAt = flags['expires-at'];
|
|
355
|
+
if (flags.programs !== undefined) {
|
|
356
|
+
const programIds = String(flags.programs).split(',').map((x) => x.trim()).filter(Boolean);
|
|
357
|
+
if (programIds.length === 0)
|
|
358
|
+
throw new CliError('--programs needs at least one program id');
|
|
359
|
+
body.programIds = programIds;
|
|
360
|
+
}
|
|
353
361
|
const res = await client.request('POST', '/v1/api-keys', body);
|
|
354
362
|
const issued = 'live' in res ? [res.live, res.test] : [res];
|
|
355
363
|
io.out('Each key is shown once. Store it now (a password manager or your secrets store):');
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { readConfig, writeConfig, configPath, type CliConfig } from './config.js
|
|
|
3
3
|
export { createClient, ApiError } from './client.js';
|
|
4
4
|
export type { Io } from './commands.js';
|
|
5
5
|
export { VERSION } from './version.js';
|
|
6
|
-
export declare const HELP = "referalli: the Referalli command line\n\nUsage:\n referalli login [--key rk_\u2026] [--base-url URL] [--no-browser]\n referalli logout\n referalli whoami\n referalli listen [--forward-to URL] [--events topic,topic] [--max-events N]\n referalli trigger <topic> [--data JSON]\n referalli trigger --billing <event> --connection <id> [--data JSON] (test mode; e.g. payment.paid)\n referalli trigger --stripe <event> --connection <id> [--data JSON] (test mode)\n referalli events tail [--events topic,topic] [--since 1h|ISO] [--json] [--max N]\n referalli logs tail [--max N]\n referalli open [docs|dashboard|keys|webhooks|spec|status]\n referalli api <METHOD> <path> [--data JSON] [--secret-file PATH]\n referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,\u2026] [--expires-days N]\n referalli keys list [--owner WHO] [--mode live|test]\n referalli keys revoke <key id> [--pair] [--cascade]\n referalli plan <referalli.yaml> [--check]\n referalli apply <referalli.yaml> [--plan] [--check] [--secret-file PATH]\n referalli doctor [--program <id>] [--json]\n referalli doctor --scan <dir> [--strict] [--json] (old Referally names in a source tree; no key needed)\n referalli partners list --program <id> [--since 7d|ISO] [--json]\n referalli env pull [--mode live|test] (.env lines on stdout; default: the key's mode)\n\nEnvironment:\n REFERALLI_API_KEY use this key instead of the saved login\n REFERALLI_API_URL API base URL (default: the hosted API)\n REFERALLI_CONFIG_DIR where the login is saved (default ~/.config/referalli)\n REFERALLI_TRACKING_TOKEN doctor checks it is this mode's token (or NEXT_PUBLIC_REFERALLI_TRACKING_TOKEN)\n REFERALLY_* spellings of these still work, with a notice";
|
|
6
|
+
export declare const HELP = "referalli: the Referalli command line\n\nUsage:\n referalli login [--key rk_\u2026] [--base-url URL] [--no-browser]\n referalli logout\n referalli whoami\n referalli listen [--forward-to URL] [--events topic,topic] [--max-events N]\n referalli trigger <topic> [--data JSON]\n referalli trigger --billing <event> --connection <id> [--data JSON] (test mode; e.g. payment.paid)\n referalli trigger --stripe <event> --connection <id> [--data JSON] (test mode)\n referalli events tail [--events topic,topic] [--since 1h|ISO] [--json] [--max N]\n referalli logs tail [--max N]\n referalli open [docs|dashboard|keys|webhooks|spec|status]\n referalli api <METHOD> <path> [--data JSON] [--secret-file PATH]\n referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,\u2026] [--programs ID,\u2026] [--expires-days N | --expires-at ISO]\n referalli keys list [--owner WHO] [--mode live|test]\n referalli keys revoke <key id> [--pair] [--cascade]\n referalli plan <referalli.yaml> [--check]\n referalli apply <referalli.yaml> [--plan] [--check] [--secret-file PATH]\n referalli doctor [--program <id>] [--json]\n referalli doctor --scan <dir> [--strict] [--json] (old Referally names in a source tree; no key needed)\n referalli partners list --program <id> [--since 7d|ISO] [--json]\n referalli env pull [--mode live|test] (.env lines on stdout; default: the key's mode)\n\nEnvironment:\n REFERALLI_API_KEY use this key instead of the saved login\n REFERALLI_API_URL API base URL (default: the hosted API)\n REFERALLI_CONFIG_DIR where the login is saved (default ~/.config/referalli)\n REFERALLI_TRACKING_TOKEN doctor checks it is this mode's token (or NEXT_PUBLIC_REFERALLI_TRACKING_TOKEN)\n REFERALLY_* spellings of these still work, with a notice";
|
|
7
7
|
/** Run one command; returns the process exit code. */
|
|
8
8
|
export declare function runCli(argv: string[], baseIo: Io): Promise<number>;
|
package/dist/src/index.js
CHANGED
|
@@ -20,7 +20,7 @@ Usage:
|
|
|
20
20
|
referalli logs tail [--max N]
|
|
21
21
|
referalli open [docs|dashboard|keys|webhooks|spec|status]
|
|
22
22
|
referalli api <METHOD> <path> [--data JSON] [--secret-file PATH]
|
|
23
|
-
referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,…] [--expires-days N]
|
|
23
|
+
referalli keys create --name NAME [--owner WHO] [--mode both|live|test] [--scopes full,…] [--programs ID,…] [--expires-days N | --expires-at ISO]
|
|
24
24
|
referalli keys list [--owner WHO] [--mode live|test]
|
|
25
25
|
referalli keys revoke <key id> [--pair] [--cascade]
|
|
26
26
|
referalli plan <referalli.yaml> [--check]
|
|
@@ -67,6 +67,8 @@ export async function runCli(argv, baseIo) {
|
|
|
67
67
|
mode: { type: 'string' },
|
|
68
68
|
scopes: { type: 'string' },
|
|
69
69
|
'expires-days': { type: 'string' },
|
|
70
|
+
'expires-at': { type: 'string' },
|
|
71
|
+
programs: { type: 'string' },
|
|
70
72
|
pair: { type: 'boolean' },
|
|
71
73
|
cascade: { type: 'boolean' },
|
|
72
74
|
plan: { type: 'boolean' },
|
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.6";
|
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.6';
|
package/package.json
CHANGED