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": "65f6eab", "specHash": "57b3004", "version": "10.5.0" }
{ "engineHash": "7c01dda", "specHash": "ca63e5e", "version": "10.5.0" }
8 changes: 8 additions & 0 deletions src/managers/hubItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export interface GetHubItemsV2025R0QueryParams {
* for the URL `https://*.app.box.com/hubs/123`
* the `hub_id` is `123`. */
readonly hubId: string;
/**
* The unique identifier of an item list block within the Box Hub.
*
* When provided, the response will only include items that belong
* to the specified item list, allowing you to filter results to
* items on a specific page or section. */
readonly parentId?: string;
/**
* Defines the position marker at which to begin returning results. This is
* used when paginating using marker-based pagination.
Expand Down Expand Up @@ -203,6 +210,7 @@ export class HubItemsManager {
readonly [key: string]: string;
} = prepareParams({
['hub_id']: toString(queryParams.hubId) as string,
['parent_id']: toString(queryParams.parentId) as string,
['marker']: toString(queryParams.marker) as string,
['limit']: toString(queryParams.limit) as string,
});
Expand Down
16 changes: 16 additions & 0 deletions src/schemas/aiExtractStructured.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export interface AiExtractStructured {
/**
* A flag to indicate whether confidence scores for every extracted field should be returned. */
readonly includeConfidenceScore?: boolean;
/**
* A flag to indicate whether references for every extracted field should be returned. */
readonly includeReference?: boolean;
readonly aiAgent?: AiExtractStructuredAgent;
readonly rawData?: SerializedData;
}
Expand Down Expand Up @@ -286,6 +289,7 @@ export function serializeAiExtractStructured(
return serializeAiExtractStructuredFieldsField(item);
}) as readonly any[]),
['include_confidence_score']: val.includeConfidenceScore,
['include_reference']: val.includeReference,
['ai_agent']:
val.aiAgent == void 0
? val.aiAgent
Expand Down Expand Up @@ -349,6 +353,17 @@ export function deserializeAiExtractStructured(
val.include_confidence_score == void 0
? void 0
: val.include_confidence_score;
if (
!(val.include_reference == void 0) &&
!sdIsBoolean(val.include_reference)
) {
throw new BoxSdkError({
message:
'Expecting boolean for "include_reference" of type "AiExtractStructured"',
});
}
const includeReference: undefined | boolean =
val.include_reference == void 0 ? void 0 : val.include_reference;
const aiAgent: undefined | AiExtractStructuredAgent =
val.ai_agent == void 0
? void 0
Expand All @@ -358,6 +373,7 @@ export function deserializeAiExtractStructured(
metadataTemplate: metadataTemplate,
fields: fields,
includeConfidenceScore: includeConfidenceScore,
includeReference: includeReference,
aiAgent: aiAgent,
} satisfies AiExtractStructured;
}
44 changes: 44 additions & 0 deletions src/schemas/aiExtractStructuredResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export interface AiExtractStructuredResponse {
readonly confidenceScore?: {
readonly [key: string]: any;
};
/**
* The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted. */
readonly reference?: {
readonly [key: string]: any;
};
readonly aiAgentInfo?: AiAgentInfo;
readonly rawData?: SerializedData;
}
Expand All @@ -51,6 +56,19 @@ export function serializeAiExtractStructuredResponse(
) as {
readonly [key: string]: any;
}),
['reference']:
val.reference == void 0
? val.reference
: (Object.fromEntries(
Object.entries(val.reference).map(([k, v]: [string, any]) => [
k,
(function (v: any): any {
return v;
})(v),
]),
) as {
readonly [key: string]: any;
}),
['ai_agent_info']:
val.aiAgentInfo == void 0
? val.aiAgentInfo
Expand Down Expand Up @@ -123,6 +141,31 @@ export function deserializeAiExtractStructuredResponse(
readonly [key: string]: any;
})
: {};
if (!(val.reference == void 0) && !sdIsMap(val.reference)) {
throw new BoxSdkError({
message:
'Expecting object for "reference" of type "AiExtractStructuredResponse"',
});
}
const reference:
| undefined
| {
readonly [key: string]: any;
} =
val.reference == void 0
? void 0
: sdIsMap(val.reference)
? (Object.fromEntries(
Object.entries(val.reference).map(([k, v]: [string, any]) => [
k,
(function (v: any): any {
return v;
})(v),
]),
) as {
readonly [key: string]: any;
})
: {};
const aiAgentInfo: undefined | AiAgentInfo =
val.ai_agent_info == void 0
? void 0
Expand All @@ -132,6 +175,7 @@ export function deserializeAiExtractStructuredResponse(
createdAt: createdAt,
completionReason: completionReason,
confidenceScore: confidenceScore,
reference: reference,
aiAgentInfo: aiAgentInfo,
} satisfies AiExtractStructuredResponse;
}
18 changes: 17 additions & 1 deletion src/schemas/v2025R0/hubItemOperationV2025R0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export interface HubItemOperationV2025R0 {
* The action to perform on a Box Hub item. */
readonly action: HubItemOperationV2025R0ActionField;
readonly item: HubItemReferenceV2025R0;
/**
* The ID of the parent block to add the item to. Must be an Item List block. If not provided, the item will be added to the first page's first Item List block. */
readonly parentId?: string;
readonly rawData?: SerializedData;
}
export function serializeHubItemOperationV2025R0ActionField(
Expand Down Expand Up @@ -53,6 +56,7 @@ export function serializeHubItemOperationV2025R0(
return {
['action']: serializeHubItemOperationV2025R0ActionField(val.action),
['item']: serializeHubItemReferenceV2025R0(val.item),
['parent_id']: val.parentId,
};
}
export function deserializeHubItemOperationV2025R0(
Expand Down Expand Up @@ -80,5 +84,17 @@ export function deserializeHubItemOperationV2025R0(
const item: HubItemReferenceV2025R0 = deserializeHubItemReferenceV2025R0(
val.item,
);
return { action: action, item: item } satisfies HubItemOperationV2025R0;
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
throw new BoxSdkError({
message:
'Expecting string for "parent_id" of type "HubItemOperationV2025R0"',
});
}
const parentId: undefined | string =
val.parent_id == void 0 ? void 0 : val.parent_id;
return {
action: action,
item: item,
parentId: parentId,
} satisfies HubItemOperationV2025R0;
}
Loading