Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/gentle-lamps-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@clerk/backend": patch
---

Added missing `orderBy` field to machines list method

Example:

```ts
clerkClient.machines.list({
...params,
orderBy: 'name'
})
```
17 changes: 13 additions & 4 deletions packages/backend/src/api/endpoints/MachineApi.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { ClerkPaginationRequest } from '@clerk/types';

import { joinPaths } from '../../util/path';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
import type { Machine } from '../resources/Machine';
import type { MachineScope } from '../resources/MachineScope';
import type { MachineSecretKey } from '../resources/MachineSecretKey';
import { AbstractAPI } from './AbstractApi';
import type { WithSign } from './util-types';

const basePath = '/machines';

Expand Down Expand Up @@ -37,11 +40,17 @@ type UpdateMachineParams = {
defaultTokenTtl?: number;
};

type GetMachineListParams = {
limit?: number;
offset?: number;
type GetMachineListParams = ClerkPaginationRequest<{
/**
* Sorts machines 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'>;
/**
* Returns machines that have a ID or name that matches the given query.
*/
query?: string;
};
}>;

type RotateMachineSecretKeyParams = {
/**
Expand Down
Loading