File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
packages/backend/src/api/endpoints Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @clerk/backend " : patch
3+ ---
4+
5+ Added missing ` orderBy ` field to machines list method
6+
7+ Example:
8+
9+ ``` ts
10+ clerkClient .machines .list ({
11+ ... params ,
12+ orderBy: ' name'
13+ })
14+ ```
Original file line number Diff line number Diff line change 1+ import type { ClerkPaginationRequest } from '@clerk/types' ;
2+
13import { joinPaths } from '../../util/path' ;
24import type { PaginatedResourceResponse } from '../resources/Deserializer' ;
35import type { Machine } from '../resources/Machine' ;
46import type { MachineScope } from '../resources/MachineScope' ;
57import type { MachineSecretKey } from '../resources/MachineSecretKey' ;
68import { AbstractAPI } from './AbstractApi' ;
9+ import type { WithSign } from './util-types' ;
710
811const basePath = '/machines' ;
912
@@ -37,11 +40,17 @@ type UpdateMachineParams = {
3740 defaultTokenTtl ?: number ;
3841} ;
3942
40- type GetMachineListParams = {
41- limit ?: number ;
42- offset ?: number ;
43+ type GetMachineListParams = ClerkPaginationRequest < {
44+ /**
45+ * Sorts machines by name or created_at.
46+ * By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order.
47+ */
48+ orderBy ?: WithSign < 'name' | 'created_at' > ;
49+ /**
50+ * Returns machines that have a ID or name that matches the given query.
51+ */
4352 query ?: string ;
44- } ;
53+ } > ;
4554
4655type RotateMachineSecretKeyParams = {
4756 /**
You can’t perform that action at this time.
0 commit comments