Skip to content

feat: add custom role endpoints - #98

Merged
ellanan merged 7 commits into
mainfrom
feat/add-custom-role-endpoints
Sep 1, 2026
Merged

ellanan merged 7 commits into
mainfrom
feat/add-custom-role-endpoints

Conversation

@ellanan

@ellanan ellanan commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Type

  • Feature

    Implements a new feature

Description

  • add custom role endpoints

Dependencies

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
ellanan force-pushed the feat/add-custom-role-endpoints branch from 29e51e7 to 77c8d1e Compare September 1, 2026 15:17
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Test Results

  1 files  ± 0   61 suites  +1   2s ⏱️ ±0s
379 tests +12  379 ✅ +12  0 💤 ±0  0 ❌ ±0 
384 runs  +12  384 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit 792db2a. ± Comparison against base commit fe9ff04.

♻️ This comment has been updated with latest results.

@ellanan ellanan changed the title Feat/add custom role endpoints feat: add custom role endpoints Sep 1, 2026
…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
wberry22 previously approved these changes Sep 1, 2026
Comment thread src/endpoints/custom-user-roles.js Outdated
Accepts an explicit sort argument (typed on the endpoint interface) and
falls back to builder Sort() state, matching the limit/offset/filter
handling.
wberry22
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
wberry22 previously approved these changes Sep 1, 2026
Comment thread src/types/custom-user-roles.ts Outdated
Comment thread src/endpoints/custom-user-roles.js Outdated
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
ellanan force-pushed the feat/add-custom-role-endpoints branch from 7086f50 to 792db2a Compare September 1, 2026 20:59
@ellanan
ellanan requested a review from wberry22 September 1, 2026 21:01
@ellanan
ellanan merged commit 3504732 into main Sep 1, 2026
11 checks passed
@ellanan
ellanan deleted the feat/add-custom-role-endpoints branch September 1, 2026 22:44
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 35.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants