Skip to content

Commit 82be350

Browse files
sybohyclaude
andcommitted
feat: pin granting resources to top of API reference nav
The API reference resource list was purely alphabetical, which put the legacy Access Codes and ACS resources first and buried Access Grants. Pin the recommended access-granting resources (access_grants, access_methods, spaces, user_identities, instant_keys) to the top and sink the low-level legacy granting resources (access_codes, acs) to the bottom. Everything else stays alphabetical in between. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 19315bb commit 82be350

2 files changed

Lines changed: 131 additions & 105 deletions

File tree

codegen/lib/layout/summary.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,38 @@ interface Context {
1919
pathMetadata: PathMetadata
2020
}
2121

22+
// Access Grants are the default and recommended way to grant access, so the
23+
// granting resources are pinned to the top of the API reference nav. The
24+
// low-level legacy granting resources sink to the bottom. Everything else
25+
// stays alphabetical in between.
26+
const firstResourcePaths = [
27+
'/access_grants',
28+
'/access_methods',
29+
'/spaces',
30+
'/user_identities',
31+
'/instant_keys',
32+
]
33+
const lastResourcePaths = ['/access_codes', '/acs']
34+
35+
const topLevelRank = (path: string): number => {
36+
const firstIdx = firstResourcePaths.indexOf(path)
37+
if (firstIdx !== -1) return firstIdx
38+
const lastIdx = lastResourcePaths.indexOf(path)
39+
if (lastIdx !== -1) return firstResourcePaths.length + 1 + lastIdx
40+
return firstResourcePaths.length
41+
}
42+
2243
export function setSummaryLayoutContext(
2344
file: Partial<ApiSummaryLayoutContext>,
2445
context: Context,
2546
): void {
2647
const paths = getPaths(null, context)
27-
file.nodes = getNodes(paths, context)
48+
const nodes = getNodes(paths, context)
49+
file.nodes = nodes.sort(
50+
(n1, n2) =>
51+
topLevelRank(`/${n1.path.replace(/\/README\.md$/, '')}`) -
52+
topLevelRank(`/${n2.path.replace(/\/README\.md$/, '')}`),
53+
)
2854
}
2955

3056
const getNodes = (paths: string[], context: Context): Node[] => {

docs/api-reference/SUMMARY.md

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,6 @@
66
* [Authentication](authentication.md)
77
* [Pagination](pagination.md)
88
* [Rate Limits and Guardrails](rate-limits-and-guardrails.md)
9-
* [Access Codes](access_codes/README.md)
10-
* [Create an Access Code](access_codes/create.md)
11-
* [Create Multiple Linked Access Codes](access_codes/create_multiple.md)
12-
* [Delete an Access Code](access_codes/delete.md)
13-
* [Generate a Code](access_codes/generate_code.md)
14-
* [Get an Access Code](access_codes/get.md)
15-
* [List Access Codes](access_codes/list.md)
16-
* [Pull a Backup Access Code](access_codes/pull_backup_access_code.md)
17-
* [Report Device Access Code Constraints](access_codes/report_device_constraints.md)
18-
* [Update an Access Code](access_codes/update.md)
19-
* [Update Multiple Linked Access Codes](access_codes/update_multiple.md)
20-
* [Access Code Simulations](access_codes/simulate/README.md)
21-
* [Simulate Creating an Unmanaged Access Code](access_codes/simulate/create_unmanaged_access_code.md)
22-
* [Unmanaged Access Codes](access_codes/unmanaged/README.md)
23-
* [Convert an Unmanaged Access Code](access_codes/unmanaged/convert_to_managed.md)
24-
* [Delete an Unmanaged Access Code](access_codes/unmanaged/delete.md)
25-
* [Get an Unmanaged Access Code](access_codes/unmanaged/get.md)
26-
* [List Unmanaged Access Codes](access_codes/unmanaged/list.md)
27-
* [Update an Unmanaged Access Code](access_codes/unmanaged/update.md)
28-
* [Access Control Systems (ACS)](acs/README.md)
29-
* [Access Groups](acs/access_groups/README.md)
30-
* [Add an ACS User to an Access Group](acs/access_groups/add_user.md)
31-
* [Delete an Access Group](acs/access_groups/delete.md)
32-
* [Get an Access Group](acs/access_groups/get.md)
33-
* [List Access Groups](acs/access_groups/list.md)
34-
* [List ACS Users in an Access Group](acs/access_groups/list_users.md)
35-
* [List Entrances Accessible to an Access Group](acs/access_groups/list_accessible_entrances.md)
36-
* [Remove an ACS User from an Access Group](acs/access_groups/remove_user.md)
37-
* [ACS Users](acs/users/README.md)
38-
* [Add an ACS User to an Access Group](acs/users/add_to_access_group.md)
39-
* [Create an ACS User](acs/users/create.md)
40-
* [Delete an ACS User](acs/users/delete.md)
41-
* [Get an ACS User](acs/users/get.md)
42-
* [List ACS User-Accessible Entrances](acs/users/list_accessible_entrances.md)
43-
* [List ACS Users](acs/users/list.md)
44-
* [Remove an ACS User from an Access Group](acs/users/remove_from_access_group.md)
45-
* [Revoke ACS User Access to All Entrances](acs/users/revoke_access_to_all_entrances.md)
46-
* [Suspend an ACS User](acs/users/suspend.md)
47-
* [Unsuspend an ACS User](acs/users/unsuspend.md)
48-
* [Update an ACS User](acs/users/update.md)
49-
* [Credentials](acs/credentials/README.md)
50-
* [Assign a Credential to an ACS User](acs/credentials/assign.md)
51-
* [Create a Credential for an ACS User](acs/credentials/create.md)
52-
* [Delete a Credential](acs/credentials/delete.md)
53-
* [Get a Credential](acs/credentials/get.md)
54-
* [List Accessible Entrances](acs/credentials/list_accessible_entrances.md)
55-
* [List Credentials](acs/credentials/list.md)
56-
* [Unassign a Credential from an ACS User](acs/credentials/unassign.md)
57-
* [Update a Credential](acs/credentials/update.md)
58-
* [Encoders](acs/encoders/README.md)
59-
* [Encode a Credential](acs/encoders/encode_credential.md)
60-
* [Get an Encoder](acs/encoders/get.md)
61-
* [List Encoders](acs/encoders/list.md)
62-
* [Scan a Credential](acs/encoders/scan_credential.md)
63-
* [Encoder Simulations](acs/encoders/simulate/README.md)
64-
* [Simulate that the Next Credential Encoding Will Fail](acs/encoders/simulate/next_credential_encode_will_fail.md)
65-
* [Simulate that the Next Credential Encoding Will Succeed](acs/encoders/simulate/next_credential_encode_will_succeed.md)
66-
* [Simulate that the Next Credential Scan Will Fail](acs/encoders/simulate/next_credential_scan_will_fail.md)
67-
* [Simulate that the Next Credential Scan Will Succeed](acs/encoders/simulate/next_credential_scan_will_succeed.md)
68-
* [Entrances](acs/entrances/README.md)
69-
* [Get an Entrance](acs/entrances/get.md)
70-
* [Grant an ACS User Access to an Entrance](acs/entrances/grant_access.md)
71-
* [List Credentials with Access to an Entrance](acs/entrances/list_credentials_with_access.md)
72-
* [List Entrances](acs/entrances/list.md)
73-
* [Unlock an Entrance](acs/entrances/unlock.md)
74-
* [Systems](acs/systems/README.md)
75-
* [Get an ACS System](acs/systems/get.md)
76-
* [List ACS Systems](acs/systems/list.md)
77-
* [List Compatible Credential Manager ACS Systems](acs/systems/list_compatible_credential_manager_acs_systems.md)
78-
* [Report Devices](acs/systems/report_devices.md)
799
* [Access Grants](access_grants/README.md)
8010
* [Add Requested Access Methods to Access Grant](access_grants/request_access_methods.md)
8111
* [Create an Access Grant](access_grants/create.md)
@@ -97,6 +27,40 @@
9727
* [Unmanaged](access_methods/unmanaged/README.md)
9828
* [Get an Unmanaged Access Method](access_methods/unmanaged/get.md)
9929
* [List Unmanaged Access Methods](access_methods/unmanaged/list.md)
30+
* [Spaces](spaces/README.md)
31+
* [Add Devices to a Space](spaces/add_devices.md)
32+
* [Add Entrances to a Space](spaces/add_acs_entrances.md)
33+
* [Create a Space](spaces/create.md)
34+
* [Delete a Space](spaces/delete.md)
35+
* [Get a Space](spaces/get.md)
36+
* [Get related Space resources](spaces/get_related.md)
37+
* [List Spaces](spaces/list.md)
38+
* [Remove Devices from a Space](spaces/remove_devices.md)
39+
* [Remove Entrances from a Space](spaces/remove_acs_entrances.md)
40+
* [Update a Space](spaces/update.md)
41+
* [User Identities](user_identities/README.md)
42+
* [Add an ACS User to a User Identity](user_identities/add_acs_user.md)
43+
* [Create a User Identity](user_identities/create.md)
44+
* [Delete a User Identity](user_identities/delete.md)
45+
* [Generate an Instant Key](user_identities/generate_instant_key.md)
46+
* [Get a User Identity](user_identities/get.md)
47+
* [Grant a User Identity Access to a Device](user_identities/grant_access_to_device.md)
48+
* [List Accessible Devices for a User Identity](user_identities/list_accessible_devices.md)
49+
* [List Accessible Entrances for a User Identity](user_identities/list_accessible_entrances.md)
50+
* [List ACS Systems Associated with a User Identity](user_identities/list_acs_systems.md)
51+
* [List ACS Users Associated with a User Identity](user_identities/list_acs_users.md)
52+
* [List User Identities](user_identities/list.md)
53+
* [Remove an ACS User from a User Identity](user_identities/remove_acs_user.md)
54+
* [Revoke Access to a Device from a User Identity](user_identities/revoke_access_to_device.md)
55+
* [Update a User Identity](user_identities/update.md)
56+
* [Unmanaged](user_identities/unmanaged/README.md)
57+
* [Get an Unmanaged User Identity](user_identities/unmanaged/get.md)
58+
* [List Unmanaged User Identities](user_identities/unmanaged/list.md)
59+
* [Update an Unmanaged User Identity](user_identities/unmanaged/update.md)
60+
* [Instant Keys](instant_keys/README.md)
61+
* [Delete an Instant Key](instant_keys/delete.md)
62+
* [Get an Instant Key](instant_keys/get.md)
63+
* [List Instant Keys](instant_keys/list.md)
10064
* [Action Attempts](action_attempts/README.md)
10165
* [Get an Action Attempt](action_attempts/get.md)
10266
* [List Action Attempts](action_attempts/list.md)
@@ -145,10 +109,6 @@
145109
* [Events](events/README.md)
146110
* [Get an Event](events/get.md)
147111
* [List Events](events/list.md)
148-
* [Instant Keys](instant_keys/README.md)
149-
* [Delete an Instant Key](instant_keys/delete.md)
150-
* [Get an Instant Key](instant_keys/get.md)
151-
* [List Instant Keys](instant_keys/list.md)
152112
* [Locks](locks/README.md)
153113
* [Configure Auto-Lock](locks/configure_auto_lock.md)
154114
* [Get a Lock](locks/get.md)
@@ -174,17 +134,6 @@
174134
* [List Phones](phones/list.md)
175135
* [Phone Simulations](phones/simulate/README.md)
176136
* [Create a Sandbox Phone](phones/simulate/create_sandbox_phone.md)
177-
* [Spaces](spaces/README.md)
178-
* [Add Devices to a Space](spaces/add_devices.md)
179-
* [Add Entrances to a Space](spaces/add_acs_entrances.md)
180-
* [Create a Space](spaces/create.md)
181-
* [Delete a Space](spaces/delete.md)
182-
* [Get a Space](spaces/get.md)
183-
* [Get related Space resources](spaces/get_related.md)
184-
* [List Spaces](spaces/list.md)
185-
* [Remove Devices from a Space](spaces/remove_devices.md)
186-
* [Remove Entrances from a Space](spaces/remove_acs_entrances.md)
187-
* [Update a Space](spaces/update.md)
188137
* [Thermostats](thermostats/README.md)
189138
* [Activate a Climate Preset](thermostats/activate_climate_preset.md)
190139
* [Create a Climate Preset](thermostats/create_climate_preset.md)
@@ -213,25 +162,6 @@
213162
* [Thermostat Simulations](thermostats/simulate/README.md)
214163
* [HVAC Mode Adjusted](thermostats/simulate/hvac_mode_adjusted.md)
215164
* [Temperature Reached](thermostats/simulate/temperature_reached.md)
216-
* [User Identities](user_identities/README.md)
217-
* [Add an ACS User to a User Identity](user_identities/add_acs_user.md)
218-
* [Create a User Identity](user_identities/create.md)
219-
* [Delete a User Identity](user_identities/delete.md)
220-
* [Generate an Instant Key](user_identities/generate_instant_key.md)
221-
* [Get a User Identity](user_identities/get.md)
222-
* [Grant a User Identity Access to a Device](user_identities/grant_access_to_device.md)
223-
* [List Accessible Devices for a User Identity](user_identities/list_accessible_devices.md)
224-
* [List Accessible Entrances for a User Identity](user_identities/list_accessible_entrances.md)
225-
* [List ACS Systems Associated with a User Identity](user_identities/list_acs_systems.md)
226-
* [List ACS Users Associated with a User Identity](user_identities/list_acs_users.md)
227-
* [List User Identities](user_identities/list.md)
228-
* [Remove an ACS User from a User Identity](user_identities/remove_acs_user.md)
229-
* [Revoke Access to a Device from a User Identity](user_identities/revoke_access_to_device.md)
230-
* [Update a User Identity](user_identities/update.md)
231-
* [Unmanaged](user_identities/unmanaged/README.md)
232-
* [Get an Unmanaged User Identity](user_identities/unmanaged/get.md)
233-
* [List Unmanaged User Identities](user_identities/unmanaged/list.md)
234-
* [Update an Unmanaged User Identity](user_identities/unmanaged/update.md)
235165
* [Webhooks](webhooks/README.md)
236166
* [Create a Webhook](webhooks/create.md)
237167
* [Delete a Webhook](webhooks/delete.md)
@@ -244,3 +174,73 @@
244174
* [List Workspaces](workspaces/list.md)
245175
* [Reset a Sandbox Workspace](workspaces/reset_sandbox.md)
246176
* [Update a Workspace](workspaces/update.md)
177+
* [Access Codes](access_codes/README.md)
178+
* [Create an Access Code](access_codes/create.md)
179+
* [Create Multiple Linked Access Codes](access_codes/create_multiple.md)
180+
* [Delete an Access Code](access_codes/delete.md)
181+
* [Generate a Code](access_codes/generate_code.md)
182+
* [Get an Access Code](access_codes/get.md)
183+
* [List Access Codes](access_codes/list.md)
184+
* [Pull a Backup Access Code](access_codes/pull_backup_access_code.md)
185+
* [Report Device Access Code Constraints](access_codes/report_device_constraints.md)
186+
* [Update an Access Code](access_codes/update.md)
187+
* [Update Multiple Linked Access Codes](access_codes/update_multiple.md)
188+
* [Access Code Simulations](access_codes/simulate/README.md)
189+
* [Simulate Creating an Unmanaged Access Code](access_codes/simulate/create_unmanaged_access_code.md)
190+
* [Unmanaged Access Codes](access_codes/unmanaged/README.md)
191+
* [Convert an Unmanaged Access Code](access_codes/unmanaged/convert_to_managed.md)
192+
* [Delete an Unmanaged Access Code](access_codes/unmanaged/delete.md)
193+
* [Get an Unmanaged Access Code](access_codes/unmanaged/get.md)
194+
* [List Unmanaged Access Codes](access_codes/unmanaged/list.md)
195+
* [Update an Unmanaged Access Code](access_codes/unmanaged/update.md)
196+
* [Access Control Systems (ACS)](acs/README.md)
197+
* [Access Groups](acs/access_groups/README.md)
198+
* [Add an ACS User to an Access Group](acs/access_groups/add_user.md)
199+
* [Delete an Access Group](acs/access_groups/delete.md)
200+
* [Get an Access Group](acs/access_groups/get.md)
201+
* [List Access Groups](acs/access_groups/list.md)
202+
* [List ACS Users in an Access Group](acs/access_groups/list_users.md)
203+
* [List Entrances Accessible to an Access Group](acs/access_groups/list_accessible_entrances.md)
204+
* [Remove an ACS User from an Access Group](acs/access_groups/remove_user.md)
205+
* [ACS Users](acs/users/README.md)
206+
* [Add an ACS User to an Access Group](acs/users/add_to_access_group.md)
207+
* [Create an ACS User](acs/users/create.md)
208+
* [Delete an ACS User](acs/users/delete.md)
209+
* [Get an ACS User](acs/users/get.md)
210+
* [List ACS User-Accessible Entrances](acs/users/list_accessible_entrances.md)
211+
* [List ACS Users](acs/users/list.md)
212+
* [Remove an ACS User from an Access Group](acs/users/remove_from_access_group.md)
213+
* [Revoke ACS User Access to All Entrances](acs/users/revoke_access_to_all_entrances.md)
214+
* [Suspend an ACS User](acs/users/suspend.md)
215+
* [Unsuspend an ACS User](acs/users/unsuspend.md)
216+
* [Update an ACS User](acs/users/update.md)
217+
* [Credentials](acs/credentials/README.md)
218+
* [Assign a Credential to an ACS User](acs/credentials/assign.md)
219+
* [Create a Credential for an ACS User](acs/credentials/create.md)
220+
* [Delete a Credential](acs/credentials/delete.md)
221+
* [Get a Credential](acs/credentials/get.md)
222+
* [List Accessible Entrances](acs/credentials/list_accessible_entrances.md)
223+
* [List Credentials](acs/credentials/list.md)
224+
* [Unassign a Credential from an ACS User](acs/credentials/unassign.md)
225+
* [Update a Credential](acs/credentials/update.md)
226+
* [Encoders](acs/encoders/README.md)
227+
* [Encode a Credential](acs/encoders/encode_credential.md)
228+
* [Get an Encoder](acs/encoders/get.md)
229+
* [List Encoders](acs/encoders/list.md)
230+
* [Scan a Credential](acs/encoders/scan_credential.md)
231+
* [Encoder Simulations](acs/encoders/simulate/README.md)
232+
* [Simulate that the Next Credential Encoding Will Fail](acs/encoders/simulate/next_credential_encode_will_fail.md)
233+
* [Simulate that the Next Credential Encoding Will Succeed](acs/encoders/simulate/next_credential_encode_will_succeed.md)
234+
* [Simulate that the Next Credential Scan Will Fail](acs/encoders/simulate/next_credential_scan_will_fail.md)
235+
* [Simulate that the Next Credential Scan Will Succeed](acs/encoders/simulate/next_credential_scan_will_succeed.md)
236+
* [Entrances](acs/entrances/README.md)
237+
* [Get an Entrance](acs/entrances/get.md)
238+
* [Grant an ACS User Access to an Entrance](acs/entrances/grant_access.md)
239+
* [List Credentials with Access to an Entrance](acs/entrances/list_credentials_with_access.md)
240+
* [List Entrances](acs/entrances/list.md)
241+
* [Unlock an Entrance](acs/entrances/unlock.md)
242+
* [Systems](acs/systems/README.md)
243+
* [Get an ACS System](acs/systems/get.md)
244+
* [List ACS Systems](acs/systems/list.md)
245+
* [List Compatible Credential Manager ACS Systems](acs/systems/list_compatible_credential_manager_acs_systems.md)
246+
* [Report Devices](acs/systems/report_devices.md)

0 commit comments

Comments
 (0)