diff --git a/.changeset/long-clowns-open.md b/.changeset/long-clowns-open.md new file mode 100644 index 00000000000..01ea08543b0 --- /dev/null +++ b/.changeset/long-clowns-open.md @@ -0,0 +1,5 @@ +--- +'@clerk/backend': patch +--- + +Add `orderBy` parameter to OAuth Applications list request diff --git a/packages/backend/src/api/endpoints/OAuthApplicationsApi.ts b/packages/backend/src/api/endpoints/OAuthApplicationsApi.ts index cda92e8eaee..641ff786ce1 100644 --- a/packages/backend/src/api/endpoints/OAuthApplicationsApi.ts +++ b/packages/backend/src/api/endpoints/OAuthApplicationsApi.ts @@ -5,6 +5,7 @@ import type { DeletedObject } from '../resources'; import type { PaginatedResourceResponse } from '../resources/Deserializer'; import type { OAuthApplication } from '../resources/OAuthApplication'; import { AbstractAPI } from './AbstractApi'; +import type { WithSign } from './util-types'; const basePath = '/oauth_applications'; @@ -36,8 +37,16 @@ type UpdateOAuthApplicationParams = CreateOAuthApplicationParams & { oauthApplicationId: string; }; +type GetOAuthApplicationListParams = ClerkPaginationRequest<{ + /** + * Sorts OAuth applications by name or created_at. + * By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order. + */ + orderBy?: WithSign<'name' | 'created_at'>; +}>; + export class OAuthApplicationsApi extends AbstractAPI { - public async list(params: ClerkPaginationRequest = {}) { + public async list(params: GetOAuthApplicationListParams = {}) { return this.request>({ method: 'GET', path: basePath,