-
Notifications
You must be signed in to change notification settings - Fork 0
Enable report generation #150
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6d7e558
Enable report generation
nourshoreibah 1d9953d
chore: regenerate lambda READMEs
github-actions[bot] ee4408c
readme generation uses PAT
nourshoreibah 0c25564
chore: auto-format terraform and update documentation
github-actions[bot] b63f953
commbine our documentation workflows
nourshoreibah 3384007
revert
nourshoreibah 2e771f4
pr feedback
nourshoreibah a06ca88
Merge origin/main into add-report-generation
nourshoreibah 0933bed
chore: regenerate lambda READMEs
github-actions[bot] 0869c66
Fix pdfmake 0.3.7 compatibility and handler ordering
nourshoreibah 5f91485
Merge origin/main into add-report-generation, resolve conflicts
Vaibhav978 9114e06
Remove test files (moved to feat/report-generation-tests)
Vaibhav978 12b59f4
chore: reset auth lambda to main (auth changes already merged via fea…
Vaibhav978 ae0ac92
Merge branch 'main' into add-report-generation
Vaibhav978 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Lambda CLI | ||
|
|
||
| When adding new API endpoints or scaffolding new Lambda handlers, use the CLI at `tools/lambda-cli.js`. Run all commands from this directory (`apps/backend/lambdas/`). | ||
|
|
||
| ## Commands | ||
|
|
||
| ### `init-handler <name>` | ||
| Creates a new Lambda handler with boilerplate (handler.ts, dev-server.ts, openapi.yaml, swagger-utils.ts, package.json, tsconfig.json, README.md, test/). | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js init-handler orders | ||
| ``` | ||
|
|
||
| ### `add-route <handler> <METHOD> <path> [options]` | ||
| Adds a route stub to both `handler.ts` (between the ROUTES-START/ROUTES-END markers) and `openapi.yaml`. | ||
|
|
||
| Options: | ||
| - `--body field:type,field:type` — request body fields | ||
| - `--query field:type,field:type` — query parameters | ||
| - `--headers field:type,field:type` — header parameters | ||
| - `--status <code>` — response status code (default: 200) | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route auth POST /reset-password --body email:string,code:string,newPassword:string | ||
| node tools/lambda-cli.js add-route users GET /users/{id} | ||
| node tools/lambda-cli.js add-route users GET /users --query page:number,limit:number | ||
| node tools/lambda-cli.js add-route users POST /users --body name:string --headers authorization:string --status 201 | ||
| ``` | ||
|
|
||
| ### `list-routes <handler>` | ||
| Lists all routes defined in a handler (from both handler.ts and openapi.yaml). | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js list-routes auth | ||
| ``` | ||
|
|
||
| ### `generate-readme [handler]` | ||
| Generates/regenerates README.md for a handler. Omit handler name to regenerate all. | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js generate-readme auth | ||
| node tools/lambda-cli.js generate-readme | ||
| ``` | ||
|
|
||
| ## After using add-route | ||
|
|
||
| The CLI generates stub code with `// TODO: Add your business logic here`. You must: | ||
| 1. Replace the TODO stub with actual implementation | ||
| 2. Update the generated OpenAPI spec in `openapi.yaml` with proper request/response schemas, descriptions, and status codes |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: we should add in a check in case the JSON is malformed.