Add integration tests and update SDK documentation and ESLint config#4
Conversation
* Implement integration tests for various SDK functionalities * Include tests for user, tenant, role, and resource management * Ensure proper cleanup of test data after execution * Add Jest configuration for TypeScript support
- Revise changelog to include detailed features for version 1.0.0-alpha.1 - Enhance README with clearer usage examples and configuration details - Add new methods and APIs for user, role, and resource management - Improve clarity on permission checks and error handling
- Clarified prerequisites in the test documentation. - Updated API key handling to skip tests if the key is absent. - Ensured client initialization only occurs if API key is provided.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK to better match backend payload/response shapes (notably around resources and role assignment deletion), adds Jest + an opt-in integration test suite, and refreshes developer/docs configuration.
Changes:
- Add Jest configuration and a live-backend integration test suite (skipped unless
PERMIS_API_KEYis set). - Adjust resource typing and add request-side normalization for resource
actions(string array → backend map format). - Update the HTTP DELETE helper to support JSON bodies and switch role-assignment
unassign()away from query params; refresh ESLint TS project config, README, and changelog.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.eslint.json | Adds a dedicated TS project config for ESLint parsing. |
| .eslintrc.json | Points ESLint at the new tsconfig and tweaks test-file linting. |
| src/types/resource.ts | Updates resource-related types (actions map, casing variants, pagination fields). |
| src/types/index.ts | Removes re-export of the removed/renamed resource interface. |
| src/index.ts | Removes re-export of the removed/renamed resource interface from package surface. |
| src/api/base.ts | Extends httpDelete to optionally send a JSON body. |
| src/api/role-assignments.ts | Changes unassign() to send DELETE body instead of query params. |
| src/api/resources.ts | Normalizes actions when creating/updating/syncing resources. |
| jest.config.js | Introduces Jest + ts-jest configuration. |
| src/tests/integration.test.ts | Adds opt-in integration coverage against a real backend. |
| README.md | Updates usage/docs to reflect current SDK behavior and API surface. |
| CHANGELOG.md | Rewrites changelog into a Keep-a-Changelog style release entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| user: assignment.user, | ||
| role: assignment.role, | ||
| tenant: assignment.tenant, | ||
| resource_instance: assignment.resourceInstance, |
| // Convenience aliases | ||
| createdAt?: string; | ||
| updatedAt?: string; |
| export interface IResourceList { | ||
| data: IResourceRead[]; | ||
| page: number; | ||
| perPage: number; | ||
| total: number; | ||
| totalPages: number; | ||
| total_count?: number; | ||
| page_count?: number; | ||
| // Legacy aliases | ||
| page?: number; | ||
| perPage?: number; | ||
| total?: number; | ||
| totalPages?: number; |
No description provided.