Skip to content

Commit 0b5fbeb

Browse files
feat: Support Hub Document API (box/box-codegen#930) (#1388)
1 parent 6fd5a8f commit 0b5fbeb

19 files changed

Lines changed: 1926 additions & 128 deletions

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "02fdae4", "specHash": "c8e3a85", "version": "10.5.0" }
1+
{ "engineHash": "e77f966", "specHash": "c8e3a85", "version": "10.5.0" }

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ the SDK are available by topic:
4848
- [Folders](folders.md)
4949
- [Groups](groups.md)
5050
- [Hub collaborations](hubCollaborations.md)
51+
- [Hub document](hubDocument.md)
5152
- [Hub items](hubItems.md)
5253
- [Hubs](hubs.md)
5354
- [Integration mappings](integrationMappings.md)

docs/hubDocument.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# HubDocumentManager
2+
3+
- [List Hub Document Pages](#list-hub-document-pages)
4+
- [List Hub Document blocks for page](#list-hub-document-blocks-for-page)
5+
6+
## List Hub Document Pages
7+
8+
Retrieves a list of Hub Document Pages for the specified hub.
9+
Includes both root-level pages and sub pages.
10+
11+
This operation is performed by calling function `getHubDocumentPagesV2025R0`.
12+
13+
See the endpoint docs at
14+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-document-pages/).
15+
16+
<!-- sample get_hub_document_pages_v2025.0 -->
17+
18+
```ts
19+
await client.hubDocument.getHubDocumentPagesV2025R0({
20+
hubId: hubId,
21+
} satisfies GetHubDocumentPagesV2025R0QueryParams);
22+
```
23+
24+
### Arguments
25+
26+
- queryParams `GetHubDocumentPagesV2025R0QueryParams`
27+
- Query parameters of getHubDocumentPagesV2025R0 method
28+
- optionalsInput `GetHubDocumentPagesV2025R0OptionalsInput`
29+
30+
### Returns
31+
32+
This function returns a value of type `HubDocumentPagesV2025R0`.
33+
34+
Returns a Hub Document Pages response whose `entries` array contains root-level pages and sub pages. Includes pagination when more results are available.
35+
36+
## List Hub Document blocks for page
37+
38+
Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.
39+
Blocks are hierarchically organized by their `parent_id`.
40+
Blocks are sorted in order based on user specification in the user interface.
41+
The response will only include content blocks that belong to the specified page. This will not include sub pages or sub page content blocks.
42+
43+
This operation is performed by calling function `getHubDocumentBlocksV2025R0`.
44+
45+
See the endpoint docs at
46+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-document-blocks/).
47+
48+
<!-- sample get_hub_document_blocks_v2025.0 -->
49+
50+
```ts
51+
await client.hubDocument.getHubDocumentBlocksV2025R0({
52+
hubId: hubId,
53+
pageId: pageId,
54+
} satisfies GetHubDocumentBlocksV2025R0QueryParams);
55+
```
56+
57+
### Arguments
58+
59+
- queryParams `GetHubDocumentBlocksV2025R0QueryParams`
60+
- Query parameters of getHubDocumentBlocksV2025R0 method
61+
- optionalsInput `GetHubDocumentBlocksV2025R0OptionalsInput`
62+
63+
### Returns
64+
65+
This function returns a value of type `HubDocumentBlocksV2025R0`.
66+
67+
Returns a Hub Document Blocks response whose `entries` array contains all content blocks of the specified page, except for items.
68+
To retrieve items, use the `GET /hub_items` endpoint.

package-lock.json

Lines changed: 127 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ import { EnterpriseConfigurationsManager } from './managers/enterpriseConfigurat
8181
import { HubsManager } from './managers/hubs';
8282
import { HubCollaborationsManager } from './managers/hubCollaborations';
8383
import { HubItemsManager } from './managers/hubItems';
84+
import { HubDocumentManager } from './managers/hubDocument';
8485
import { ShieldListsManager } from './managers/shieldLists';
8586
import { ArchivesManager } from './managers/archives';
8687
import { ExternalUsersManager } from './managers/externalUsers';
@@ -185,6 +186,7 @@ export class BoxClient {
185186
readonly hubs: HubsManager;
186187
readonly hubCollaborations: HubCollaborationsManager;
187188
readonly hubItems: HubItemsManager;
189+
readonly hubDocument: HubDocumentManager;
188190
readonly shieldLists: ShieldListsManager;
189191
readonly archives: ArchivesManager;
190192
readonly externalUsers: ExternalUsersManager;
@@ -270,6 +272,7 @@ export class BoxClient {
270272
| 'hubs'
271273
| 'hubCollaborations'
272274
| 'hubItems'
275+
| 'hubDocument'
273276
| 'shieldLists'
274277
| 'archives'
275278
| 'externalUsers'
@@ -614,6 +617,10 @@ export class BoxClient {
614617
auth: this.auth,
615618
networkSession: this.networkSession,
616619
});
620+
this.hubDocument = new HubDocumentManager({
621+
auth: this.auth,
622+
networkSession: this.networkSession,
623+
});
617624
this.shieldLists = new ShieldListsManager({
618625
auth: this.auth,
619626
networkSession: this.networkSession,

0 commit comments

Comments
 (0)