@getbrevo/cli 1.1.0 → 2.0.0

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +19 -2
  3. package/agent-context/AGENTS.md +16 -5
  4. package/agent-context/SKILL.md +17 -3
  5. package/dist/api/client.d.ts +2 -0
  6. package/dist/api/client.d.ts.map +1 -1
  7. package/dist/api/client.js +50 -36
  8. package/dist/api/client.js.map +1 -1
  9. package/dist/bin/index.js +19 -4
  10. package/dist/bin/index.js.map +1 -1
  11. package/dist/commands/app/create.d.ts.map +1 -1
  12. package/dist/commands/app/create.js +240 -221
  13. package/dist/commands/app/create.js.map +1 -1
  14. package/dist/commands/app/delete.d.ts.map +1 -1
  15. package/dist/commands/app/delete.js +81 -62
  16. package/dist/commands/app/delete.js.map +1 -1
  17. package/dist/commands/app/list.d.ts.map +1 -1
  18. package/dist/commands/app/list.js +10 -3
  19. package/dist/commands/app/list.js.map +1 -1
  20. package/dist/commands/app/scaffold.d.ts.map +1 -1
  21. package/dist/commands/app/scaffold.js +12 -2
  22. package/dist/commands/app/scaffold.js.map +1 -1
  23. package/dist/commands/app/scopes.d.ts.map +1 -1
  24. package/dist/commands/app/scopes.js +2 -0
  25. package/dist/commands/app/scopes.js.map +1 -1
  26. package/dist/commands/app/start.d.ts.map +1 -1
  27. package/dist/commands/app/start.js +7 -0
  28. package/dist/commands/app/start.js.map +1 -1
  29. package/dist/commands/app/update.d.ts.map +1 -1
  30. package/dist/commands/app/update.js +297 -266
  31. package/dist/commands/app/update.js.map +1 -1
  32. package/dist/commands/login.d.ts.map +1 -1
  33. package/dist/commands/login.js +154 -138
  34. package/dist/commands/login.js.map +1 -1
  35. package/dist/commands/whoami.d.ts.map +1 -1
  36. package/dist/commands/whoami.js +27 -20
  37. package/dist/commands/whoami.js.map +1 -1
  38. package/dist/lang/en.d.ts +23 -1
  39. package/dist/lang/en.d.ts.map +1 -1
  40. package/dist/lang/en.js +25 -1
  41. package/dist/lang/en.js.map +1 -1
  42. package/dist/lib/auth-guard.d.ts.map +1 -1
  43. package/dist/lib/auth-guard.js +10 -1
  44. package/dist/lib/auth-guard.js.map +1 -1
  45. package/dist/lib/constants.d.ts +10 -3
  46. package/dist/lib/constants.d.ts.map +1 -1
  47. package/dist/lib/constants.js +19 -4
  48. package/dist/lib/constants.js.map +1 -1
  49. package/dist/lib/logger.d.ts.map +1 -1
  50. package/dist/lib/logger.js +16 -3
  51. package/dist/lib/logger.js.map +1 -1
  52. package/dist/lib/telemetry.d.ts +9 -0
  53. package/dist/lib/telemetry.d.ts.map +1 -0
  54. package/dist/lib/telemetry.js +57 -0
  55. package/dist/lib/telemetry.js.map +1 -0
  56. package/dist/lib/update-notifier.d.ts +3 -0
  57. package/dist/lib/update-notifier.d.ts.map +1 -1
  58. package/dist/lib/update-notifier.js +77 -34
  59. package/dist/lib/update-notifier.js.map +1 -1
  60. package/dist/lib/validators.d.ts +6 -0
  61. package/dist/lib/validators.d.ts.map +1 -1
  62. package/dist/lib/validators.js +10 -0
  63. package/dist/lib/validators.js.map +1 -1
  64. package/dist/services/app.d.ts +1 -1
  65. package/dist/services/app.d.ts.map +1 -1
  66. package/dist/services/app.js +6 -6
  67. package/dist/services/app.js.map +1 -1
  68. package/dist/services/scopes-html.d.ts.map +1 -1
  69. package/dist/services/scopes-html.js +208 -29
  70. package/dist/services/scopes-html.js.map +1 -1
  71. package/dist/services/skill.js +1 -1
  72. package/dist/services/skill.js.map +1 -1
  73. package/dist/types.d.ts +2 -2
  74. package/dist/types.d.ts.map +1 -1
  75. package/package.json +1 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @getbrevo/cli
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 26ac404: Migrate app management onto the public App Store APIs (BEX-249).
8
+
9
+ **Breaking changes**
10
+ - App create/list/get/update/delete now target `/v3/app-store/apps` instead of the legacy `/v3/oauth/apps` endpoints.
11
+ - App update uses `PATCH` instead of `PUT`.
12
+ - The distribution field is sent and read as `distribution_type: "public" | "private"` instead of the boolean `public`. `--distribution public` is still rejected ("coming soon").
13
+
14
+ **New features**
15
+ - Add a blocking force-update banner: when the installed CLI is a full major version behind the latest npm release, commands (except `--help`/`--version`) print an update banner and exit non-zero until the user upgrades. Honors the existing update-notifier opt-outs (`BREVO_NO_UPDATE_NOTIFIER`, `--no-update-notifier`, CI, non-TTY).
16
+
17
+ ## 1.1.1
18
+
19
+ ### Patch Changes
20
+
21
+ - e7ffaa6: Deprecate the legacy `'all'` OAuth scope and improve scope tooling:
22
+ - `brevo app update` and `brevo app start oauth` now block when scopes contain `'all'`. Pass `--scope` on `brevo app update` to migrate (drops `'all'`, applies the new granular scopes). `brevo app list` flags legacy apps (text tag + `legacy_all_scope: true` in `--json`); `brevo app scaffold` drops `'all'` when scaffolding from a legacy app, keeping its granular scopes (or the default scopes when `'all'` was the only one).
23
+ - `brevo app available-scopes` no longer requires authentication — it only reads the public IdP scope catalog, so it now works before `brevo login` (previously exited with "Not authenticated").
24
+ - `brevo app available-scopes --web` page improvements: per-category "Copy" CTA, per-scope checkboxes that build a copyable selection list, a `deprecated` badge on the legacy `'all'` scope (excluded from copy/selection), a hero CTA linking the scope catalog docs (https://developers.brevo.com/docs/oauth-scopes#scope-catalog), and a footer link to the CLI reference docs. The terminal output also prints the scope catalog docs URL. Copied scope lists are double-quoted and comma-separated (`"contacts:read","contacts:write"`) — ready to paste into `app-config.json`'s `auth.scopes` array or `brevo app update --scope`.
25
+ - added user-agent for cli-version, os and auth type
26
+
27
+ - ab05546: Add Homebrew as an install channel: `brew install getbrevo/tap/brevo`. The
28
+ formula in `getbrevo/homebrew-tap` is auto-bumped on every npm release. No CLI
29
+ behavior, command, flag, or env var changed.
30
+
31
+ - a4533d9: The CLI now identifies itself to the Brevo API on every request via a single `User-Agent` header: `brevo-cli/<version> (<os>)`, extended with `; auth=api_key` or `; auth=oauth` when the request carries credentials. No personal data is sent — only the CLI version, operating system family, and authentication method already in use.
32
+
3
33
  ## 1.1.0
4
34
 
5
35
  ### Minor Changes
package/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Command-line tool to create, manage, and test [Brevo](https://www.brevo.com/) OAuth integrations from your terminal.
4
4
 
5
+ > 📖 Full command and option documentation: **[Brevo CLI reference](https://developers.brevo.com/docs/cli-reference)**
6
+
7
+ > [!WARNING]
8
+ > **Upgrade to v2.0.0.** All versions from **1.1.1** up to (but not including) **2.0.0** should be migrated to **2.0.0**. The `2.0.0` release introduces **breaking changes**, so some CLI commands may not work as expected on older versions.
9
+ >
10
+ > Upgrade with `npm install -g @getbrevo/cli@latest` (or `yarn global add @getbrevo/cli@latest`, or `brew upgrade brevo`), then confirm with `brevo --version`.
11
+
5
12
  ## Requirements
6
13
 
7
14
  - **Node.js** 20.15.0 or newer (required to run the CLI)
@@ -9,7 +16,17 @@ Command-line tool to create, manage, and test [Brevo](https://www.brevo.com/) OA
9
16
 
10
17
  ## Installation
11
18
 
12
- Install globally from the public npm registry:
19
+ ### Homebrew (macOS/Linux)
20
+
21
+ ```bash
22
+ brew tap getbrevo/tap
23
+ brew install getbrevo/tap/brevo
24
+ brevo --version
25
+ ```
26
+
27
+ (`brew install getbrevo/tap/brevo` adds the tap automatically if you skip the first command — the formula lives in [`getbrevo/homebrew-tap`](https://github.com/getbrevo/homebrew-tap).)
28
+
29
+ ### npm
13
30
 
14
31
  ```bash
15
32
  npm install -g @getbrevo/cli
@@ -23,7 +40,7 @@ This puts the `brevo` binary on your PATH. Verify:
23
40
  brevo --version
24
41
  ```
25
42
 
26
- To upgrade later: `npm install -g @getbrevo/cli@latest`.
43
+ To upgrade later: `brew update && brew upgrade brevo` (Homebrew) or `npm install -g @getbrevo/cli@latest` (npm).
27
44
 
28
45
  > Building from source? See [Development](#development) below.
29
46
 
@@ -7,13 +7,13 @@ This project uses the [Brevo Developer CLI](https://www.npmjs.com/package/@getbr
7
7
 
8
8
  Pick the path that matches your tooling:
9
9
 
10
- - **You are Claude** (Claude Code, Claude Desktop, or any agent that reads `~/.claude/skills/`) — install the brevo-cli skill before doing other work, if it isn't already at `~/.claude/skills/brevo-cli/`:
10
+ - **You are Claude Code** (CLI or desktop app any agent that reads `~/.claude/skills/`) — install the brevo-cli skill before doing other work, if it isn't already at `~/.claude/skills/brevo-cli/`:
11
11
 
12
12
  ```bash
13
13
  brevo skill:cli install
14
14
  ```
15
15
 
16
- The skill loads the canonical decision tree, hard rules, and exit codes in the format Claude consumes directly. Once installed it auto-refreshes on every `brevo` invocation so it stays in sync with the running CLI version (opt out with `BREVO_NO_SKILL_AUTOREFRESH=1`).
16
+ The skill loads the canonical decision tree, hard rules, and exit codes in the format Claude consumes directly. Once installed it auto-refreshes on every `brevo` invocation so it stays in sync with the running CLI version (opt out with `BREVO_NO_SKILL_AUTOREFRESH=1`). Note: the install targets `~/.claude/skills/`, which only Claude Code surfaces read — the Claude Desktop **chat** app does not load skills from this directory.
17
17
 
18
18
  - **You are any other AI agent** (Cursor, Copilot CLI, Gemini CLI, Codex, etc.) — **do not run `brevo skill:cli install`**. The skill format is Claude-specific and the install would land in a directory your tooling doesn't read. Use this `AGENTS.md` as your reference instead — it covers the same surface in less depth.
19
19
 
@@ -64,7 +64,7 @@ Don't fall back to raw HTTP against `api.brevo.com` — the `brevo` binary is th
64
64
  | `brevo whoami` | Show the authenticated account (`--json`) |
65
65
  | `brevo app init` | Guided setup (login, create, scaffold) |
66
66
  | `brevo app list` | List OAuth apps (`--json`) |
67
- | `brevo app create` | Create an app (`--name`, `--distribution`, `--redirect-uri`, `--logo-uri`, `--json`). Defaults to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. |
67
+ | `brevo app create` | Create an app (`--name`, `--distribution`, `--redirect-uri`, `--logo-uri`, `--json`). Only `--distribution private` is available today — `public` is rejected with a "coming soon" error. Defaults to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. |
68
68
  | `brevo app update` | Update name / redirect URLs / scopes / logo (`--app-id`, `--name`, `--redirect-uri`, `--scope` repeatable appends, `--logo-uri`, `--yes`, `--json`) |
69
69
  | `brevo app credentials` | Show client ID / secret (`--app-id`, `--reveal-secret`, `--json`) |
70
70
  | `brevo app delete` | Delete an app (`--app-id`, `--force`, `--json`) |
@@ -83,15 +83,26 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
83
83
  - **Credentials** live at `~/.brevo/credentials.json`. Never commit this file or any `.env.local`.
84
84
  - **Non-interactive auth:** `BREVO_API_KEY=xkeysib-... brevo login`. The legacy `--api-key` flag was removed because it leaks into shell history.
85
85
  - **Skip prompts:** `--force` for delete/logout; `--yes` for `app update`.
86
+ - **Forced update:** when the installed CLI is a full **major** version behind the latest npm release, every command except `--help`/`--version` prints a blocking update banner to stderr and exits `1` without running. Update with `npm install -g @getbrevo/cli` (or `yarn global add`). The gate honors the same opt-outs as the soft update notice (`BREVO_NO_UPDATE_NOTIFIER=1`, `--no-update-notifier`, CI, non-TTY), so it never fires in those contexts.
86
87
  - **Exit codes:** `0` success · `1` general error · `2` aborted · `3` auth · `4` network · `5` not found.
87
88
 
88
89
  ## Scopes
89
90
 
90
91
  - New apps created via `brevo app create` default to `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. The CLI prints these on success.
91
92
  - `brevo app update --scope <scope>` is repeatable and appends, mirroring `--redirect-uri`. De-duped, order-preserving. Writes back to `app-config.json` when that file describes the target app. A single flag value may contain multiple comma- or whitespace-separated tokens (`--scope "crm:read, crm:write"` is equivalent to `--scope crm:read --scope crm:write`). Same normalization is applied to `auth.scopes` when read from `app-config.json`.
92
- - `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — server returns 400 on unknown scopes.
93
+ - `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. It reads a **public** catalog and works **without `brevo login`** (no API key needed). Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — server returns 400 on unknown scopes.
93
94
  - Passing `--web` to `brevo app available-scopes` additionally starts a short-lived loopback HTTP server on `127.0.0.1:<ephemeral>` rendering the same catalog as a styled HTML page and opens the user's browser. It stays in the foreground until Ctrl+C. Without `--web` the command exits after printing the list — TTY detection no longer triggers the browser. `--json` always suppresses the browser (`--json` returns before `--web` is evaluated).
94
95
 
96
+ ### Legacy `'all'` scope deprecation
97
+
98
+ The legacy catch-all `'all'` OAuth scope is deprecated. The CLI **blocks** `brevo app update` and `brevo app start oauth` when scopes still contain `'all'` (no escape hatch, no silent rewrite); the only mutating path that proceeds is an explicit `--scope` migration. To handle a legacy app:
99
+
100
+ 1. **Detect** `'all'` in `auth.scopes` of a local `app-config.json`, or on a remote app via `brevo app list --json` — affected apps carry `"legacy_all_scope": true` (text output appends `(legacy 'all' — deprecated)` to the scopes line).
101
+ 2. **Prompt the user to pick granular scopes** — use `brevo app available-scopes --json` for the catalog, or fall back to the four defaults (`contacts:read`, `contacts:write`, `crm:read`, `crm:write`).
102
+ 3. **Migrate** with `brevo app update --scope <scope> --scope <scope> ...` — passing `--scope` drops `'all'` from the outgoing scope set and applies the new granular scopes (the summary shows a "Migrating from legacy 'all' scope" line and `all (removed)`).
103
+
104
+ `brevo app scaffold` against an app whose remote scopes contain `'all'` never propagates it: the new `app-config.json` keeps the app's remaining granular scopes (or the four default scopes when `'all'` was the only scope), with a one-line substitution notice (suppressed under `--json`). Note the substitution is local-only — the remote app still needs the `--scope` migration above.
105
+
95
106
  ## Environment variables
96
107
 
97
108
  | Variable | Purpose |
@@ -102,7 +113,7 @@ Run `brevo --help` or `brevo <command> --help` for the full set.
102
113
  | `BREVO_CONFIG_HOME` | Override credentials directory (default `~/.brevo/`) |
103
114
  | `BREVO_CLAUDE_HOME` | Override Claude Code home used by `skill:cli` (default `~/.claude/`) |
104
115
  | `BREVO_NO_SKILL_AUTOREFRESH` | Set to `1` to suppress automatic skill refresh on `brevo` runs |
105
- | `BREVO_NO_UPDATE_NOTIFIER` | Set to `1` to suppress the npm update-available notice |
116
+ | `BREVO_NO_UPDATE_NOTIFIER` | Set to `1` to suppress the npm update-available notice **and** the blocking major-version force-update gate |
106
117
  | `BREVO_DEBUG=1` or `--debug` | Verbose HTTP and error logging |
107
118
 
108
119
  ## Safety
@@ -9,7 +9,7 @@ This project uses the Brevo Developer CLI to create and manage Brevo OAuth appli
9
9
 
10
10
  > **Reading this from the repo rather than `~/.claude/skills/brevo-cli/`?**
11
11
  >
12
- > - **If you're Claude** (Claude Code, Claude Desktop, or any agent that reads `~/.claude/skills/`): install it as a skill with `brevo skill:cli install` so your tooling loads it natively and keeps it auto-refreshed. The repo copy is bundled with the npm package; the installed copy is what Claude actually consumes.
12
+ > - **If you're Claude Code** (CLI or desktop app any agent that reads `~/.claude/skills/`): install it as a skill with `brevo skill:cli install` so your tooling loads it natively and keeps it auto-refreshed. The repo copy is bundled with the npm package; the installed copy is what Claude actually consumes. Note: the Claude Desktop **chat** app does not read `~/.claude/skills/`, so the installed skill won't load there — only Claude Code surfaces pick it up.
13
13
  > - **If you're any other AI agent** (Cursor, Copilot CLI, Gemini, Codex, etc.): **don't run `brevo skill:cli install`** — the skill format is Claude-specific and would land in a directory your tooling doesn't read. Use `agent-context/AGENTS.md` as your reference instead; it covers the same surface in less depth.
14
14
 
15
15
  ## Before starting a new session
@@ -40,7 +40,7 @@ Don't fall back to raw HTTP against `api.brevo.com` — the `brevo` binary is th
40
40
  - "Authenticate" → `brevo login` (or `BREVO_API_KEY=xkeysib-... brevo login` for CI)
41
41
  - "Who am I logged in as?" → `brevo whoami --json`
42
42
  - "Show / pick an app" → `brevo app list --json`
43
- - "Create an app" → `brevo app create --name "<name>" --distribution private --redirect-uri <url> --json` (add `--logo-uri <https://…>` to set the app logo at creation time; new apps default to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`)
43
+ - "Create an app" → `brevo app create --name "<name>" --distribution private --redirect-uri <url> --json` (add `--logo-uri <https://…>` to set the app logo at creation time; new apps default to scopes `contacts:read`, `contacts:write`, `crm:read`, `crm:write`). Only `private` distribution is available today — the CLI rejects `--distribution public` with a "coming soon" error, so never suggest it.
44
44
  - "Update app metadata" → `brevo app update --app-id <id> --name "<name>"` and/or `--redirect-uri <url>` (repeatable) and/or `--scope <scope>` (repeatable, appends) and/or `--logo-uri <https://…>`
45
45
  - "Get client credentials" → `brevo app credentials --app-id <id> --json` (add `--reveal-secret` to print the secret)
46
46
  - "Generate starter OAuth code" → `brevo app scaffold --app-id <id>`
@@ -67,13 +67,27 @@ If `app-config.json` exists in the working directory, it pins the app — `brevo
67
67
 
68
68
  - New apps created via `brevo app create` default to `contacts:read`, `contacts:write`, `crm:read`, `crm:write`. The CLI prints the default set on success and points to `brevo app update --scope` for changes.
69
69
  - `brevo app update --scope <scope>` is **repeatable and appends** — passing `--scope X --scope Y` adds both to the app's existing scope set, de-duped, order-preserving. A single flag value may also contain multiple comma- or whitespace-separated tokens (`--scope "crm:read, crm:write"` ≡ `--scope crm:read --scope crm:write`); the same normalization is applied to `auth.scopes` when read from `app-config.json`, so a malformed entry like `"crm:write, campaigns:read"` is split into two scopes on read. To see what's currently set, run `brevo app credentials --app-id <id> --json`. To remove a scope, edit `app-config.json` and run `brevo app update` without `--scope`.
70
- - `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — use `app available-scopes` to confirm spelling before passing an unfamiliar scope.
70
+ - `brevo app available-scopes [--json] [--web]` lists the OAuth scopes the IdP currently supports. It reads a **public** catalog and works **without `brevo login`** (no API key needed). Text output groups names by category (e.g. `account`, `data_crm`, `messaging`); `--json` returns a flat `{ scopes: string[] }` of names. OIDC-reserved scopes (`openid`, `profile`, `email`, `offline_access`) and magic wildcards are excluded. The CLI validates scope **format** locally (must match `[A-Za-z0-9][A-Za-z0-9:_.-]*`) but does **not** validate that a scope is recognized by the IdP — use `app available-scopes` to confirm spelling before passing an unfamiliar scope.
71
71
  - Passing `--web` to `brevo app available-scopes` **also opens a browser** to a styled local page (loopback `http://127.0.0.1:<port>/`) and stays running until Ctrl+C. Without `--web` the command exits after printing the list — TTY detection no longer triggers the browser. `--json` always suppresses the browser, so agent invocations using `--json` behave the same regardless of `--web`.
72
72
 
73
+ ### Legacy `'all'` scope deprecation
74
+
75
+ The legacy catch-all `'all'` OAuth scope is deprecated. The CLI **blocks** `brevo app update` and `brevo app start oauth` when scopes still contain `'all'` (no escape hatch, no silent rewrite); the only mutating path that proceeds is an explicit `--scope` migration. To handle a legacy app:
76
+
77
+ 1. **Detect** `'all'` in `auth.scopes` of a local `app-config.json`, or on a remote app via `brevo app list --json` — affected apps carry `"legacy_all_scope": true` (text output appends `(legacy 'all' — deprecated)` to the scopes line).
78
+ 2. **Prompt the user to pick granular scopes** — use `brevo app available-scopes --json` for the catalog, or fall back to the four defaults (`contacts:read`, `contacts:write`, `crm:read`, `crm:write`).
79
+ 3. **Migrate** with `brevo app update --scope <scope> --scope <scope> ...` — passing `--scope` drops `'all'` from the outgoing scope set and applies the new granular scopes (the summary shows a "Migrating from legacy 'all' scope" line and `all (removed)`).
80
+
81
+ `brevo app scaffold` against an app whose remote scopes contain `'all'` never propagates it: the new `app-config.json` keeps the app's remaining granular scopes (or the four default scopes when `'all'` was the only scope), with a one-line substitution notice (suppressed under `--json`). Note the substitution is local-only — the remote app still needs the `--scope` migration above.
82
+
73
83
  ## Exit codes
74
84
 
75
85
  `0` success · `1` general error · `2` aborted · `3` auth failure · `4` network · `5` not found.
76
86
 
87
+ ## Forced update
88
+
89
+ When the installed CLI is a full **major** version behind the latest npm release, every command except `--help` / `--version` prints a blocking update banner to stderr and exits `1` **without running** — so a `brevo` call that suddenly exits `1` with an update banner means the CLI must be upgraded (`npm install -g @getbrevo/cli` or `yarn global add @getbrevo/cli`) before it will work. The gate honors the same opt-outs as the soft update notice (`BREVO_NO_UPDATE_NOTIFIER=1`, `--no-update-notifier`, CI, non-TTY), so it never fires in those contexts.
90
+
77
91
  ## Before sharing or committing output
78
92
 
79
93
  * [ ] No `xkeysib-…` API keys, client secrets, refresh tokens, or contents of `~/.brevo/credentials.json` / `.env.local` in messages, logs, or diffs.
@@ -17,6 +17,8 @@ export declare class ApiClient {
17
17
  delete<T>(path: string): Promise<T>;
18
18
  getWithKey<T>(path: string, apiKey: string): Promise<T>;
19
19
  getWithBearer<T>(path: string, accessToken: string, tokenType?: string): Promise<T>;
20
+ private buildHeaders;
21
+ private performFetch;
20
22
  private request;
21
23
  }
22
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAaA,KAAK,kBAAkB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACzD;AAqBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK7D;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,M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AAM,GAAG,IAAI,GAAG,MAAM,CAK7D;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAcxD;AA2DD,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,aAAa,CAAC,CAAqB;gBAEd,IAAI,EAAE,aAAa;IAEhD,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAInD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIlD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAInC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IASvD,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,SAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IASrF,OAAO,CAAC,YAAY;YAaN,YAAY;YAmBZ,OAAO;CA0CtB"}
@@ -5,6 +5,7 @@ exports.parseRetryAfter = parseRetryAfter;
5
5
  exports.sanitizeErrorMessage = sanitizeErrorMessage;
6
6
  const errors_1 = require("../lib/errors");
7
7
  const logger_1 = require("../lib/logger");
8
+ const telemetry_1 = require("../lib/telemetry");
8
9
  const en_1 = require("../lang/en");
9
10
  const MAX_RETRIES = 3;
10
11
  const DEFAULT_RETRY_AFTER_SECONDS = 5;
@@ -46,6 +47,41 @@ function sanitizeErrorMessage(msg) {
46
47
  // eslint-disable-next-line no-control-regex
47
48
  .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ''));
48
49
  }
50
+ // Detect HTML bodies returned by auth gateways (Cloudflare Access, SSO proxies).
51
+ // Matches case-insensitively and runs regardless of response status, since
52
+ // gateways frequently return HTML on 401/403 as well as 2xx.
53
+ function looksLikeHtml(s) {
54
+ const lower = s.toLowerCase();
55
+ return lower.includes('<!doctype html') || lower.includes('<html');
56
+ }
57
+ function parseResponseData(text, status) {
58
+ let data = {};
59
+ try {
60
+ const parsed = text ? JSON.parse(text) : {};
61
+ if (parsed !== null && typeof parsed === 'object') {
62
+ data = parsed;
63
+ }
64
+ }
65
+ catch {
66
+ if (looksLikeHtml(text)) {
67
+ throw new errors_1.ApiError(en_1.messages.ERR_AUTH_GATEWAY, status, errors_1.ErrorCode.AUTH_GATEWAY);
68
+ }
69
+ data = { message: text };
70
+ }
71
+ if (typeof data.message === 'string' && looksLikeHtml(data.message)) {
72
+ throw new errors_1.ApiError(en_1.messages.ERR_AUTH_GATEWAY, status, errors_1.ErrorCode.AUTH_GATEWAY);
73
+ }
74
+ return data;
75
+ }
76
+ function throwResponseError(data, status) {
77
+ const apiCode = typeof data.code === 'string' ? data.code : undefined;
78
+ const rawFallback = typeof data.message === 'string' && data.message
79
+ ? data.message
80
+ : `Request failed with status ${status}`;
81
+ const fallback = sanitizeErrorMessage(rawFallback);
82
+ const message = resolveErrorMessage(apiCode, fallback);
83
+ throw new errors_1.ApiError(message, status, mapErrorCode(status, apiCode), apiCode);
84
+ }
49
85
  function mapErrorCode(status, apiCode) {
50
86
  if (apiCode === 'APP_LIMIT_REACHED')
51
87
  return errors_1.ErrorCode.APP_LIMIT_REACHED;
@@ -104,20 +140,20 @@ class ApiClient {
104
140
  authHeader: { Authorization: `${tokenType} ${accessToken}` },
105
141
  });
106
142
  }
107
- async request(opts, isRetry = false, retryCount = 0) {
108
- const url = `${this.deps.baseUrl}${opts.path}`;
143
+ buildHeaders(opts) {
109
144
  const explicitAuth = opts.authHeader;
110
145
  const authHeader = explicitAuth ?? (opts.skipAuth ? undefined : this.deps.getAuthHeader());
111
- const headers = {
146
+ return {
112
147
  'Content-Type': 'application/json',
113
148
  Accept: 'application/json',
149
+ ...(0, telemetry_1.buildCliHeaders)(authHeader),
114
150
  ...opts.headers,
115
151
  ...authHeader,
116
152
  };
117
- (0, logger_1.logHttp)(opts.method, opts.path);
118
- let response;
153
+ }
154
+ async performFetch(url, opts, headers) {
119
155
  try {
120
- response = await fetch(url, {
156
+ return await fetch(url, {
121
157
  method: opts.method,
122
158
  headers,
123
159
  body: opts.body ? JSON.stringify(opts.body) : undefined,
@@ -129,6 +165,12 @@ class ApiClient {
129
165
  apiErr.cause = err;
130
166
  throw apiErr;
131
167
  }
168
+ }
169
+ async request(opts, isRetry = false, retryCount = 0) {
170
+ const url = `${this.deps.baseUrl}${opts.path}`;
171
+ const headers = this.buildHeaders(opts);
172
+ (0, logger_1.logHttp)(opts.method, opts.path);
173
+ const response = await this.performFetch(url, opts, headers);
132
174
  (0, logger_1.logHttpResponse)(response.status, opts.path);
133
175
  if (response.status === 401 && !isRetry && !opts.skipAuth) {
134
176
  if (this.onAuthFailure) {
@@ -151,38 +193,10 @@ class ApiClient {
151
193
  return this.request(opts, isRetry, retryCount + 1);
152
194
  }
153
195
  const text = await response.text();
154
- // Detect HTML bodies returned by auth gateways (Cloudflare Access, SSO proxies).
155
- // Matches case-insensitively and runs regardless of response status, since
156
- // gateways frequently return HTML on 401/403 as well as 2xx.
157
- const looksLikeHtml = (s) => {
158
- const lower = s.toLowerCase();
159
- return lower.includes('<!doctype html') || lower.includes('<html');
160
- };
161
- let data = {};
162
- try {
163
- const parsed = text ? JSON.parse(text) : {};
164
- if (parsed !== null && typeof parsed === 'object') {
165
- data = parsed;
166
- }
167
- }
168
- catch {
169
- if (looksLikeHtml(text)) {
170
- throw new errors_1.ApiError(en_1.messages.ERR_AUTH_GATEWAY, response.status, errors_1.ErrorCode.AUTH_GATEWAY);
171
- }
172
- data = { message: text };
173
- }
174
- if (typeof data.message === 'string' && looksLikeHtml(data.message)) {
175
- throw new errors_1.ApiError(en_1.messages.ERR_AUTH_GATEWAY, response.status, errors_1.ErrorCode.AUTH_GATEWAY);
176
- }
196
+ const data = parseResponseData(text, response.status);
177
197
  (0, logger_1.logDebug)(`response ${opts.path}`, data);
178
198
  if (!response.ok) {
179
- const apiCode = typeof data.code === 'string' ? data.code : undefined;
180
- const rawFallback = typeof data.message === 'string' && data.message
181
- ? data.message
182
- : `Request failed with status ${response.status}`;
183
- const fallback = sanitizeErrorMessage(rawFallback);
184
- const message = resolveErrorMessage(apiCode, fallback);
185
- throw new errors_1.ApiError(message, response.status, mapErrorCode(response.status, apiCode), apiCode);
199
+ throwResponseError(data, response.status);
186
200
  }
187
201
  return data;
188
202
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";;;AAuCA,0CAKC;AAKD,oDAcC;AA/DD,0CAAoD;AACpD,0CAAmE;AACnE,mCAAsC;AAkBtC,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,eAAe,GAA2B;IAC9C,iBAAiB,EAAE,aAAQ,CAAC,wBAAwB;IACpD,cAAc,EAAE,aAAQ,CAAC,YAAY;CACtC,CAAC;AAEF,SAAS,mBAAmB,CAAC,OAA2B,EAAE,QAAgB;IACxE,IAAI,OAAO,IAAI,OAAO,IAAI,eAAe,EAAE,CAAC;QAC1C,OAAO,eAAe,CAAC,OAAO,CAAE,CAAC;IACnC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+EAA+E;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AM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEtD,IAAA,iBAAQ,EAAC,YAAY,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,IAAS,CAAC;IACnB,CAAC;CACF;AAzHD,8BAyHC"}
package/dist/bin/index.js CHANGED
@@ -116,6 +116,8 @@ program
116
116
  ` $ brevo app start oauth --port 3000 # start OAuth test server`,
117
117
  ` $ brevo app available-scopes --web # browse OAuth scope catalog`,
118
118
  ``,
119
+ `Docs: ${constants_1.BREVO_CLI_REFERENCE_URL}`,
120
+ ``,
119
121
  ].join('\n');
120
122
  },
121
123
  })
@@ -181,10 +183,23 @@ for (const signal of ['SIGINT', 'SIGTERM']) {
181
183
  // ──────────────── Error handling ────────────────
182
184
  // Emit deferred warning if BREVO_API_URL had a path stripped
183
185
  (0, constants_1.warnIfPathStripped)();
184
- const earlyNotify = showBannerEarly
185
- ? (0, update_notifier_1.notifyUpdate)(updateCheck, { name: pkg.name, version })
186
- : Promise.resolve();
187
- earlyNotify
186
+ // Force-update gate — if the installed CLI is a full major version behind the
187
+ // latest npm release, block the command (non-zero exit) so the user upgrades.
188
+ // Skipped for --help/--version (so help stays reachable) and whenever the
189
+ // update check itself is skipped (CI / non-TTY / opt-out). Fails open.
190
+ const args = process.argv.slice(2);
191
+ const isHelpOrVersion = args.includes('--help') ||
192
+ args.includes('-h') ||
193
+ args.includes('--version') ||
194
+ args.includes('-V');
195
+ const forceGate = isHelpOrVersion
196
+ ? Promise.resolve()
197
+ : (0, update_notifier_1.enforceMinVersion)(updateCheck, { name: pkg.name, version }).then((mustUpdate) => {
198
+ if (mustUpdate)
199
+ process.exit(exit_codes_1.EXIT_CODES.ERROR);
200
+ });
201
+ forceGate
202
+ .then(() => showBannerEarly ? (0, update_notifier_1.notifyUpdate)(updateCheck, { name: pkg.name, version }) : undefined)
188
203
  .then(() => program.parseAsync(process.argv))
189
204
  .then(async () => {
190
205
  if (!showBannerEarly) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,4CAA8B;AAC9B,gDAAkC;AAClC,yCAAoC;AACpC,kDAAqD;AACrD,0CAAuE;AACvE,kDAA+C;AAC/C,0CAAuE;AACvE,mCAAsC;AACtC,sDAAsD;AACtD,0CAAkG;AAClG,gDAAkF;AAClF,6DAA6E;AAC7E,kCAA8C;AAE9C,4CAAsC;AACtC,8DAAsD;AACtD,yDAA+F;AAC/F,4DAAgG;AAChG,6CAAiD;AAEjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC;AAEpC,8FAA8F;AAC9F,4FAA4F;AAC5F,MAAM,WAAW,GAAG,IAAA,kCAAgB,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAClE,4EAA4E;AAC5E,0EAA0E;AAC1E,yBAAyB;AACzB,MAAM,eAAe,GAAG,IAAA,wCAAsB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE7D,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,KAAK,GAAG,EAAE,CAAC;IACrD,IAAA,gBAAO,EAAC,aAAQ,CAAC,yBAAyB,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,OAAO,GAAG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,CAAC,KAAK,IAAI,EAAE;IACf,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAA,8BAAY,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,uEAAuE;IACvE,0EAA0E;IAC1E,qEAAqE;IACrE,oBAAY,CAAC,mBAAmB,EAAE,CAAC;IACnC,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACb,IAAI,GAAG,YAAY,mBAAU,EAAE,CAAC;QAC9B,IAAA,gBAAO,EAAC,OAAO,aAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,uBAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,GAAG,YAAY,iBAAQ,EAAE,CAAC;QAC5B,IAAA,iBAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACD,IAAA,iBAAQ,EAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,uBAAU,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/app/create.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;WAEf,MAAM;mBACE,MAAM;kBACP,MAAM,EAAE;cACZ,MAAM;WACT,OAAO;mBAoSjB,CAAC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/app/create.ts"],"names":[],"mappings":"AAkUA,eAAO,MAAM,aAAa;WAEf,MAAM;mBACE,MAAM;kBACP,MAAM,EAAE;cACZ,MAAM;WACT,OAAO;mBAuCjB,CAAC"}