Skip to content

Improvements and fixes#3

Closed
gjovanovicst wants to merge 2 commits into
permissio:mainfrom
gjovanovicst:main
Closed

Improvements and fixes#3
gjovanovicst wants to merge 2 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
@gjovanovicst gjovanovicst self-assigned this Mar 15, 2026
Copilot AI review requested due to automatic review settings March 15, 2026 23:38

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 align with backend payload/response shapes (notably resource actions and role assignment deletion), adds Jest-based integration testing scaffolding, and refreshes documentation/changelog to reflect current SDK usage.

Changes:

  • Update resource types to support backend-style action maps and add legacy/snake_case field aliases.
  • Change role-assignment unassign to send a JSON body and extend httpDelete to accept an optional body.
  • Add Jest config and a new end-to-end integration test suite; update README and CHANGELOG accordingly.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types/resource.ts Adjusts resource typings (actions map + timestamp/pagination aliases) to match backend formats.
src/types/index.ts Removes IResource export from the types barrel.
src/index.ts Removes IResource export from package-level type exports.
src/api/role-assignments.ts Switches unassign to DELETE-with-body semantics.
src/api/resources.ts Normalizes actions from string[] to backend map format on create/update/sync.
src/api/base.ts Extends httpDelete to accept an optional JSON body (axios data).
src/tests/integration.test.ts Adds integration tests that exercise major SDK flows end-to-end.
jest.config.js Introduces Jest + ts-jest configuration for running TS tests.
README.md Updates docs/examples to match current SDK behavior and features.
CHANGELOG.md Rewrites changelog entries and adds an alpha release entry.
Comments suppressed due to low confidence (2)

src/types/index.ts:33

  • Removing the exported IResource type is a breaking change for SDK consumers. If this is intentional, consider keeping an alias/deprecated export for one release cycle and/or documenting the migration (and exporting IResourceAction since it is now part of the public resource type surface).
// Resource types
export type {
  IResourceCreate,
  IResourceUpdate,
  IResourceRead,
  IResourceList,

src/index.ts:84

  • Package-level exports also drop IResource, which is a breaking API change for downstream TypeScript users. If the intent is to replace it, consider exporting a backwards-compatible alias and/or explicitly exporting IResourceAction so consumers can type the new actions map format.
  IRoleRead,
  IRoleList,
  // Resource types
  IResourceCreate,
  IResourceUpdate,
  IResourceRead,
  IResourceList,
  IResourceInstance,
  IResourceInstanceCreate,
  IResourceInstanceRead,

💡 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.

Comment on lines +15 to +18
const DEFAULT_ENV_KEY =
"permis_key_d39064912cd9d1f0052a98430e3eb7d689a350d84f2d0a018843541b5da3e5ef";
const API_KEY = process.env.PERMIS_API_KEY ?? DEFAULT_ENV_KEY;
const API_URL = process.env.PERMIS_API_URL ?? "http://localhost:3001";
Comment on lines +27 to +30
// Always run — we have a fallback key embedded above
const itIntegration = it;

describe("Permissio Node.js SDK — Integration", () => {
user: assignment.user,
role: assignment.role,
tenant: assignment.tenant,
resource_instance: assignment.resourceInstance,
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.

2 participants