## Summary
- add packages/twenty-apps/rollup-engine: a parameterised rollup engine
that ships a default Opportunity → Company
aggregation.
- declare runtime config in package.json (TWENTY_API_KEY, optional
TWENTY_API_BASE_URL, and ROLLUP_ENGINE_CONFIG) so
app configuration lives entirely in Settings → Apps → [App] →
Configuration.
- document the workflow in README.md: deploy via twenty app sync,
populate env vars in the UI, use the Test panel with
a ready JSON payload, and reference troubleshooting tips.
- adjust the function entry point to a named async export and add
fallback logic for blank base URLs, matching the
UI’s env behaviour.
- prune legacy templates and examples so
config/templates/opportunity-to-company.json is the single copy/paste
starting point.
## UI / UX impact
After syncing the app:
- the Configuration screen shows the three env keys with helpful
descriptions (API key, optional base URL, JSON
override),
- the built-in Test your function panel works immediately
- and the default JSON config is available from
config/templates/opportunity-to-company.json for users who need to
customise rollups.
## Testing
- Out-of-the-box deploy to the hosted workspace (Opportunity update) ✓
- “Test your function” with the default config ✓
- Override example: point debugOpportunityCount at a scratch field via
ROLLUP_ENGINE_CONFIG ✓
- Optional: local smoke test (yarn install && yarn smoke) still passes
40 lines
1.2 KiB
JSON
40 lines
1.2 KiB
JSON
{
|
|
"version": "0.0.1",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": "^24.5.0",
|
|
"npm": "please-use-yarn",
|
|
"yarn": ">=4.0.2"
|
|
},
|
|
"packageManager": "yarn@4.9.2",
|
|
"$schema": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/appManifest.schema.json",
|
|
"universalIdentifier": "2b308f8c-6ff8-4838-9880-aa0271dfd8d8",
|
|
"name": "Rollup engine",
|
|
"description": "Rollup engine",
|
|
"env": {
|
|
"TWENTY_API_KEY": {
|
|
"isSecret": true,
|
|
"value": "",
|
|
"description": "Workspace API key used by the rollup engine to call the Twenty REST API."
|
|
},
|
|
"TWENTY_API_BASE_URL": {
|
|
"isSecret": false,
|
|
"value": "",
|
|
"description": "Optional override for the REST base URL (defaults to https://app.twenty.com/rest)."
|
|
},
|
|
"ROLLUP_ENGINE_CONFIG": {
|
|
"isSecret": false,
|
|
"value": "",
|
|
"description": "Optional JSON override for rollup definitions. Leave blank to use the baked-in defaults."
|
|
}
|
|
},
|
|
"scripts": {
|
|
"smoke": "node --import tsx scripts/run-rollup-smoke.ts",
|
|
"setup:metadata": "node scripts/setup-company-rollup-fields.mjs"
|
|
},
|
|
"devDependencies": {
|
|
"dotenv": "^16.4.5",
|
|
"tsx": "^4.20.6"
|
|
}
|
|
}
|