Skip to content
Open
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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "2cee311", "specHash": "54953fe", "version": "10.13.0" }
{ "engineHash": "2cee311", "specHash": "cc375ad", "version": "10.13.0" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ the SDK are available by topic:
- [Metadata taxonomies](metadataTaxonomies.md)
- [Metadata templates](metadataTemplates.md)
- [Notes](notes.md)
- [Query](query.md)
- [Recent items](recentItems.md)
- [Retention policies](retentionPolicies.md)
- [Retention policy assignments](retentionPolicyAssignments.md)
Expand Down
55 changes: 55 additions & 0 deletions docs/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# QueryManager

- [Query for Box items](#query-for-box-items)
- [Create insights for Box items](#create-insights-for-box-items)

## Query for Box items

Runs a query to discover Box items using a logical predicate that can filter
across item fields and metadata templates. Results can be sorted, paginated,
and shaped to include additional item or metadata fields.

This operation is performed by calling function `createQueryV2026R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-query/).

_Currently we don't have an example for calling `createQueryV2026R0` in integration tests_

### Arguments

- requestBody `QueryRequestBodyV2026R0`
- Request body of createQueryV2026R0 method
- optionalsInput `CreateQueryV2026R0OptionalsInput`

### Returns

This function returns a value of type `QueryResultsV2026R0`.

Returns a paginated list of items matching the query.

## Create insights for Box items

Computes aggregated metrics over Box items matching a query predicate.
Filters are applied first, followed by optional grouping, after which the
requested metrics (such as `sum`, `avg`, `min`, `max`, and `count`) are
computed for each resulting group or over the entire filtered dataset.

This operation is performed by calling function `createQueryInsightV2026R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-query-insights/).

_Currently we don't have an example for calling `createQueryInsightV2026R0` in integration tests_

### Arguments

- requestBody `QueryInsightsRequestBodyV2026R0`
- Request body of createQueryInsightV2026R0 method
- optionalsInput `CreateQueryInsightV2026R0OptionalsInput`

### Returns

This function returns a value of type `QueryInsightsV2026R0`.

Returns the computed insight entries.
85 changes: 27 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import { ArchivesManager } from './managers/archives';
import { ExternalUsersManager } from './managers/externalUsers';
import { AutomateWorkflowsManager } from './managers/automateWorkflows';
import { NotesManager } from './managers/notes';
import { QueryManager } from './managers/query';
import { Authentication } from './networking/auth';
import { NetworkSession } from './networking/network';
import { BoxSdkError } from './box/errors';
Expand Down Expand Up @@ -194,6 +195,7 @@ export class BoxClient {
readonly externalUsers: ExternalUsersManager;
readonly automateWorkflows: AutomateWorkflowsManager;
readonly notes: NotesManager;
readonly query: QueryManager;
constructor(
fields: Omit<
BoxClient,
Expand Down Expand Up @@ -282,6 +284,7 @@ export class BoxClient {
| 'externalUsers'
| 'automateWorkflows'
| 'notes'
| 'query'
| 'networkSession'
| 'makeRequest'
| 'withAsUserHeader'
Expand Down Expand Up @@ -647,6 +650,10 @@ export class BoxClient {
auth: this.auth,
networkSession: this.networkSession,
});
this.query = new QueryManager({
auth: this.auth,
networkSession: this.networkSession,
});
}
/**
* Make a custom http request using the client authentication and network session.
Expand Down
1 change: 1 addition & 0 deletions src/managers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ export * from './archives';
export * from './externalUsers';
export * from './automateWorkflows';
export * from './notes';
export * from './query';
Loading
Loading