-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Brevo function #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat:Brevo function #100
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
078dcb2
feat: add Brevo Function commands with smoke tests
satyamdev10 6322f3c
feat: gate Brevo Function behind __BREVO_PREVIEW__ and add fn alias
satyamdev10 255350a
feat: add brevo function activate, deactivate and delete commands
satyamdev10 0500fe4
Merge pull request #60 from getbrevo/features_fn-manage-commands
satyamdev10 a88d524
Merge branch 'features_set-dp-function' into review_dp_function
satyamdev10 a9bf6c3
Merge pull request #62 from getbrevo/review_dp_function
satyamdev10 2432ea1
feat: add brevo fn init command with AI generation, template flow, an…
satyamdev10 ec17251
fix: use draft_id instead of code for post-iterate execute preview
satyamdev10 1c9e410
feat: show friendly message when Brevo Functions is not enabled (403)
satyamdev10 c0d04c6
refactor: address SonarCloud issues — reduce complexity, fix nested t…
satyamdev10 e10f859
refactor: address remaining SonarCloud warnings
satyamdev10 b5ea13e
refactor: fix last S6551 warning in formatCellValue (init.ts)
satyamdev10 1fdd35b
fix: hide attribute_id from predefined template preview table
satyamdev10 4b2bf1f
fix: remove Attribute ID line from template preview output
satyamdev10 7a820d1
fix: address PR #69 review comments
satyamdev10 1b1dafc
fix: resolve SonarCloud issues — cognitive complexity and boolean param
satyamdev10 c0feef8
Merge pull request #69 from getbrevo/features/dp-function-init-and-im…
satyamdev10 ace5c39
feat: add `brevo fn deploy` command for deploying draft functions
satyamdev10 4b99091
fix: resolve SonarCloud issues in deploy.ts — cognitive complexity an…
satyamdev10 8f0a64f
fix: replace backtracking regex with lastIndexOf in deriveNameFromDes…
satyamdev10 9e1d28a
Merge pull request #78 from getbrevo/features/dp-function-deploy
satyamdev10 78e383f
chore: sync main into features_set-dp-function
satyamdev10 8a1b102
Merge pull request #86 from getbrevo/sync/main-into-features_set-dp-f…
satyamdev10 08f20a0
feat: link deployed function to app after creation
satyamdev10 7113be3
fix: address PR #85 review — shared module, JSON safety, tests
satyamdev10 0830310
refactor: extract shared deploy helpers to reduce code duplication
satyamdev10 3732bb5
chore: remove changeset file
satyamdev10 0f6ca0c
fix: resolve SonarCloud duplication and nested template literal
satyamdev10 f2115a9
Merge pull request #85 from getbrevo/features/dp-function-link-to-app
satyamdev10 f8bfc6a
feat: remove preview gate from brevo function commands (GA)
satyamdev10 aeb137b
feat: add function suite to smoke test live surfaces
satyamdev10 ac3df08
feat: expand function smoke suite with mutation steps, init flow, and…
satyamdev10 3977db5
fix: resolve SonarCloud duplication in function smoke not-found probes
satyamdev10 f94d73e
Merge pull request #90 from getbrevo/feat/ga-brevo-function-commands
satyamdev10 e58fd7c
Merge branch 'main' into features_set-dp-function
piyushsarin-sib 2eea156
Merge branch 'main' into features_set-dp-function
piyushsarin-sib b6d3bc0
fix: resolve SonarCloud duplication in function action commands
satyamdev10 fcc349c
Merge pull request #101 from getbrevo/fix/sonar-function-duplication
satyamdev10 8cf295b
fix: reduce SonarCloud duplication across function commands and smoke…
satyamdev10 12f4373
Merge pull request #102 from getbrevo/fix/sonar-function-duplication-v2
satyamdev10 6b8bcfe
feat: add app_type field to app-config.json template
satyamdev10 3d11d14
Merge branch 'features_set-dp-function' into fix/pr100-review-comments
satyamdev10 bf9b7e2
feat: address PR #100 review comments
satyamdev10 53810ea
test: add backward compatibility and smoke tests for app_type field
satyamdev10 53550a1
chore: add changeset for function app-type registry
satyamdev10 b37eb29
refactor: rename app_type to appType in config for camelCase consistency
satyamdev10 dae10cf
fix: update stale doc comments for appType and add app_type migration
satyamdev10 1d90504
refactor: revert appType back to app_type in config
satyamdev10 943781b
Merge pull request #103 from getbrevo/fix/pr100-review-comments
satyamdev10 be7d9cf
BEX-470 refactor(config): normalize app-config.json keys to snake_cas…
piyushsarin-sib ec681f7
fix: address PR #100 review comments for brevo function
satyamdev10 96577b2
fix: resolve merge conflicts with features_set-dp-function
satyamdev10 fad4501
Merge pull request #105 from getbrevo/fix/pr100-review-comments
satyamdev10 032828a
BEX-471 feat(json): emit snake_case twins for every camelCase --json …
piyushsarin-sib File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| '@getbrevo/cli': minor | ||
| --- | ||
|
|
||
| Add `function` as a first-class app type in the CLI's app-type registry. A Brevo Function app is now detected by the presence of `brevo_function` in both the local config and the server record, and participates in the same resolution, capability, and recoverability checks as `oauth` and `ui` apps. The capability matrix grants a private Function app no OAuth or UI capabilities (it ships its own `brevo function deploy` flow); public distribution adds `review-lifecycle`. A new `app_type` field is written to `app-config.json` on `brevo app create` and `brevo app scaffold` as informational metadata (`"oauth"`, `"ui"`, or `"function"`); it is never sent to the server and legacy configs without it continue to work unchanged. Additional fixes: `fetchFunctionList` now paginates past 50 functions, `sseStream` refreshes the OAuth token before connecting, `brevo function deploy` appears in help output, and `resolveFunctionId` replaces a duplicated IIFE in the shared action runner. | ||
|
|
||
| Refuse a `brevo app upload` whose `app_type` contradicts the blocks it sits next to. `app_type` stays informational — the presence of `ui_app` / `brevo_function` / `auth` is still the only discriminator, and `isUiAppConfig()` is still the only place it is read — but a file labelled `"oauth"` that carries a `ui_app` block is a hand-edit that half-landed, and `upload` now says so before any round trip, naming both the declared and the detected type and how to reconcile them. A config that omits `app_type` (every file written by an earlier release) is unaffected: the check is skipped entirely rather than defaulted. The label is never sent to Brevo. | ||
|
|
||
| Normalize every key in `app-config.json` to snake_case, matching the wire contract. The file was meant to be snake_case throughout but several keys were camelCase; they are renamed as follows: | ||
|
|
||
| - `appId` → `app_id` | ||
| - `appName` → `app_name` | ||
| - `logoUri` → `logo_uri` | ||
| - `appType` → `app_type` | ||
| - `auth.redirectUris` → `auth.redirect_uris` | ||
|
|
||
| `version`, `distribution_type`, `auth.scopes`, `ui_app` and `brevo_function` are unchanged, and nothing sent to or received from the Brevo API changes. | ||
|
|
||
| **Backward compatibility is preserved.** Every command still reads the camelCase spellings written by earlier releases (and the older `auth.redirectUrls`), through one shared normalizer in the config reader. When a file carries both spellings of a key with different values the snake_case one wins and a one-line notice is printed to stderr. | ||
|
|
||
| **Legacy files are migrated on write.** `brevo app create`, `brevo app upload`, `brevo app scaffold` and `brevo app start` now write snake_case keys only, and the camelCase copies are dropped. `brevo app upload` and `brevo app scaffold` also rewrite an in-sync legacy file on their "nothing to change" paths, so running either once is enough to migrate a project. Values are never changed by the migration. | ||
|
|
||
| The only `--json` output that echoes config key names is `brevo app scaffold`'s `diffs[].field`, which now reports `app_name`, `redirect_uris` and `logo_uri` instead of `appName`, `redirectUris` and `logoUri`. The `appId` / `appName` / `logoUri` keys in other commands' `--json` output are unchanged. | ||
|
|
||
| Every `--json` document now carries each camelCase key together with its snake_case twin: `appId` and `app_id`, `clientId` and `client_id`, `upToDate` and `up_to_date`, and in the error envelope `exitCode` / `exit_code` and `statusCode` / `status_code`. `brevo app create --json`'s `redirectUri` and `brevo app credentials --json`'s `redirectUris` are twinned as `redirect_uris`, the wire name. Array documents (`brevo app list --json`) alias each element. Nested objects are left as they are — `ui_app`, the upload diff's `current` / `next`, Function records — since they were already snake_case or are the user's own data. Nothing is removed: every existing `jq .appId` keeps working. This is the deprecation step toward one spelling for machine-readable output, matching `app-config.json` and the API; the camelCase keys will be removed in the next major release, and new scripts should read the snake_case ones. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.