Repository navigation
Fix/sdk typescript security - #1283
Conversation
- Bump package version to 0.2.3 - Upgrade @hey-api/openapi-ts to ^0.99.0 - Upgrade vitest to ^4.1.9 - Update package-lock.json with new dependencies and versions
- Added read permissions for contents in the CI workflow. - Implemented functions in the UI to handle and display conflict information, including banners and metadata for conflicts in memories.
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe conflicts page now renders through DOM helper functions instead of HTML strings. The CI workflow restricts token permissions, and the TypeScript SDK updates generator settings, compiler DOM typings, package versions, and OpenAPI schema literals. ChangesConflicts Page DOM Refactor
CI and TypeScript SDK Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Removed the 'format' option from openapi-ts.config.ts. - Added 'DOM' to the 'lib' array in tsconfig.json for improved type support.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@memanto/app/ui/static/index.html`:
- Around line 4457-4459: The manual resolution submit handler in
conflictActionBtn currently passes textarea.value directly to resolveConflict,
which allows empty content to reach the backend. Add a client-side non-empty
check in the Submit Manual Resolution callback before calling resolveConflict,
and block submission with a clear prompt or early return when textarea.value is
blank. Use the existing resolveConflict and conflictActionBtn flow to locate the
fix.
In `@sdks/typescript/package.json`:
- Line 35: The package is declaring a Node 18 engine range while the Vitest
dependency in this package now requires Node 20 or newer. Update the
engines.node constraint in sdks/typescript/package.json to match the runtime
required by vitest@4.1.9, or otherwise downgrade Vitest to a major that supports
Node 18; keep the change aligned with the existing vitest/config and test API
usage.
- Line 31: The TypeScript OpenAPI generator config still uses the old plugin
array shape, so update `sdks/typescript/openapi-ts.config.ts` to match the 0.99
API. Keep `output.path` as-is, but change the `plugins` entry from the string
form to a plugin object in the `@hey-api/client-fetch` configuration, using the
generator’s expected `{ name: "`@hey-api/client-fetch`", ... }` shape so the
config works with `@hey-api/openapi-ts` 0.99.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 56a37e6a-dbfd-486d-aed2-606a8a40cc03
⛔ Files ignored due to path filters (1)
sdks/typescript/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
.github/workflows/ci.ymlmemanto/app/ui/static/index.htmlsdks/typescript/package.json
- Changed version from 0.2.4.dev12+g0e7dd4f.d20260623 to 0.0.0.dev0. - Updated descriptions in several API endpoints to replace hyphens with em dashes for consistency. - Adjusted numeric types in schema definitions to use floating-point values for maximum and minimum constraints.
- Added validation to ensure that manual replacement content is not empty before submission. - Display a warning toast and focus on the textarea if the content is blank.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
sdks/typescript/openapi.json (1)
3119-3168: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winFix the
date-timevsYYYY-MM-DDmismatch.
RecallAsOfRequest.as_ofandRecallChangedSinceRequest.sinceare still declared asformat: "date-time", but the descriptions now promiseYYYY-MM-DDis accepted. Either widen the schema to allow date-only input or tighten the descriptions to RFC3339 timestamps only.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdks/typescript/openapi.json` around lines 3119 - 3168, The RecallAsOfRequest.as_of and RecallChangedSinceRequest.since schema entries still declare format: date-time while their descriptions say YYYY-MM-DD is accepted, so align the OpenAPI definition with the actual supported input. Update the relevant properties in openapi.json by either changing the schema to allow date-only strings in addition to full datetimes, or by narrowing the descriptions to RFC3339-only timestamps; keep the documentation and validation behavior consistent for these request models.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@sdks/typescript/openapi.json`:
- Around line 3119-3168: The RecallAsOfRequest.as_of and
RecallChangedSinceRequest.since schema entries still declare format: date-time
while their descriptions say YYYY-MM-DD is accepted, so align the OpenAPI
definition with the actual supported input. Update the relevant properties in
openapi.json by either changing the schema to allow date-only strings in
addition to full datetimes, or by narrowing the descriptions to RFC3339-only
timestamps; keep the documentation and validation behavior consistent for these
request models.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 814198e4-473e-4277-aaf3-b63172f48cc2
📒 Files selected for processing (1)
sdks/typescript/openapi.json
- Introduced a new job in the CI workflow to publish the TypeScript SDK to npm upon release. - Configured steps for checking out code, setting up Node.js, installing dependencies, versioning, generating client code, type checking, testing, building, and publishing. - Ensured the workflow triggers only on versioned releases.
Summary by CodeRabbit
Bug Fixes
Chores
contents.DOM, and refreshed the OpenAPI spec version/contract text and numeric validation constraints.