feat: add custom role endpoints - #98
Merged
Merged
Conversation
GetCustomUserRoles accepted only limit and offset, so a caller listing roles could not narrow by name and had to page through everything and match locally. The endpoint supports eq on name, and buildQueryParams already serialises a filter, so this just accepts one and passes it through. The filter type exposes eq on name alone. The endpoint also accepts eq over created_at, id and updated_at, but nothing calls for those yet and a narrower type is easier to widen later than to correct. Note for callers: filter values are not URI encoded, which is how every other filter in this SDK behaves. A space survives URL normalisation as %20, but an ampersand in a role name terminates the parameter, so "Ops & Fulfilment" reaches the API as eq(name,Ops . Encoding belongs in the shared query serialiser rather than in this endpoint.
ellanan
force-pushed
the
feat/add-custom-role-endpoints
branch
from
September 1, 2026 15:17
29e51e7 to
77c8d1e
Compare
…in name filter GetCustomUserRoles now passes the endpoint instance to request.send so resetProps clears Filter()/Limit()/Offset() state after each request, preventing a stale filter from leaking into later calls. withQuotedName escapes backslashes before quotes so names containing backslashes produce well-formed filter literals.
wberry22
previously approved these changes
Sep 1, 2026
Accepts an explicit sort argument (typed on the endpoint interface) and falls back to builder Sort() state, matching the limit/offset/filter handling.
wberry22
previously approved these changes
Sep 1, 2026
GetCustomUserRole/Create/Update/Delete now pass the endpoint instance to request.send so resetProps clears builder state after every call, preventing a stray Filter() from surviving a non-list call and leaking into a later GetCustomUserRoles.
wberry22
previously approved these changes
Sep 1, 2026
Replaces Record<string, string> with an exact set of the 28 permission groups the API validates, each typed to the levels it accepts. Composer and Legacy Catalogs take none/manage, Metrics none/view, and Custom Actions and Team only none. Create requires every group, matching the API's required validation; update takes Partial<AccessLevels> since the service merges the body into the stored role.
The filter grammar's double-quoted literal accepts a backslash only immediately before a quote, so \\ is not a valid escape and a name containing a backslash cannot be expressed at all. Escaping it produced a filter the platform lexer rejects, and the test asserting that behaviour was validating a request the platform would refuse. Quote escaping is unchanged; \" is the grammar's one supported escape.
ellanan
force-pushed
the
feat/add-custom-role-endpoints
branch
from
September 1, 2026 20:59
7086f50 to
792db2a
Compare
wberry22
approved these changes
Sep 1, 2026
|
🎉 This PR is included in version 35.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Type
Feature
Implements a new featureDescription
Dependencies