Skip to content

Add integration tests and update SDK documentation and ESLint config#4

Merged
gjovanovicst merged 4 commits into
permissio:mainfrom
gjovanovicst:main
Mar 16, 2026
Merged

Add integration tests and update SDK documentation and ESLint config#4
gjovanovicst merged 4 commits into
permissio:mainfrom
gjovanovicst:main

Conversation

@gjovanovicst

Copy link
Copy Markdown
Member

No description provided.

* 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.
@gjovanovicst gjovanovicst self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 00:00
@codecov-commenter

Copy link
Copy Markdown

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 ☂️

@gjovanovicst gjovanovicst merged commit 37f47ce into permissio:main Mar 16, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_KEY is 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,
Comment thread src/types/resource.ts
Comment on lines +48 to +50
// Convenience aliases
createdAt?: string;
updatedAt?: string;
Comment thread src/types/resource.ts
Comment on lines 56 to +64
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants