box-node-sdk 10.5.0 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/lib/bundle.js +655 -10
  2. package/lib/bundle.js.map +1 -1
  3. package/lib/client.d.ts +3 -1
  4. package/lib/client.d.ts.map +1 -1
  5. package/lib/client.js +5 -0
  6. package/lib/client.js.map +1 -1
  7. package/lib/managers/hubDocument.d.ts +133 -0
  8. package/lib/managers/hubDocument.d.ts.map +1 -0
  9. package/lib/managers/hubDocument.js +162 -0
  10. package/lib/managers/hubDocument.js.map +1 -0
  11. package/lib/managers/hubItems.d.ts +7 -0
  12. package/lib/managers/hubItems.d.ts.map +1 -1
  13. package/lib/managers/hubItems.js +1 -0
  14. package/lib/managers/hubItems.js.map +1 -1
  15. package/lib/managers/index.d.ts +1 -0
  16. package/lib/managers/index.d.ts.map +1 -1
  17. package/lib/managers/index.js +1 -0
  18. package/lib/managers/index.js.map +1 -1
  19. package/lib/managers/search.d.ts +1 -1
  20. package/lib/managers/search.d.ts.map +1 -1
  21. package/lib/managers/search.js +1 -1
  22. package/lib/managers/search.js.map +1 -1
  23. package/lib/managers/trashedItems.d.ts +2 -0
  24. package/lib/managers/trashedItems.d.ts.map +1 -1
  25. package/lib/managers/trashedItems.js +2 -0
  26. package/lib/managers/trashedItems.js.map +1 -1
  27. package/lib/networking/version.d.ts +1 -1
  28. package/lib/networking/version.js +1 -1
  29. package/lib/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  30. package/lib/schemas/aiAgentBasicTextToolBase.d.ts.map +1 -1
  31. package/lib/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  32. package/lib/schemas/aiAgentSpreadsheetTool.d.ts.map +1 -1
  33. package/lib/schemas/aiExtractStructured.d.ts +3 -0
  34. package/lib/schemas/aiExtractStructured.d.ts.map +1 -1
  35. package/lib/schemas/aiExtractStructured.js +9 -0
  36. package/lib/schemas/aiExtractStructured.js.map +1 -1
  37. package/lib/schemas/aiExtractStructuredResponse.d.ts +5 -0
  38. package/lib/schemas/aiExtractStructuredResponse.d.ts.map +1 -1
  39. package/lib/schemas/aiExtractStructuredResponse.js +24 -0
  40. package/lib/schemas/aiExtractStructuredResponse.js.map +1 -1
  41. package/lib/schemas/index.d.ts +5 -5
  42. package/lib/schemas/index.d.ts.map +1 -1
  43. package/lib/schemas/index.js +5 -5
  44. package/lib/schemas/index.js.map +1 -1
  45. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  46. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts.map +1 -1
  47. package/lib/schemas/legalHoldPolicyAssignedItem.js +47 -24
  48. package/lib/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  49. package/lib/schemas/legalHoldPolicyAssignment.d.ts.map +1 -1
  50. package/lib/schemas/legalHoldPolicyAssignment.js.map +1 -1
  51. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +20 -0
  52. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts.map +1 -0
  53. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +105 -0
  54. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  55. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +17 -0
  56. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts.map +1 -0
  57. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js +87 -0
  58. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  59. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +10 -0
  60. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts.map +1 -0
  61. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +60 -0
  62. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  63. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +13 -0
  64. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts.map +1 -0
  65. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js +36 -0
  66. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  67. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +45 -0
  68. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts.map +1 -0
  69. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js +162 -0
  70. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  71. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +19 -0
  72. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts.map +1 -0
  73. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js +68 -0
  74. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  75. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +45 -0
  76. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts.map +1 -0
  77. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js +162 -0
  78. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  79. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +17 -0
  80. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts.map +1 -0
  81. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js +87 -0
  82. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  83. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  84. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts.map +1 -1
  85. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  86. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  87. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  88. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts.map +1 -1
  89. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  90. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  91. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +20 -0
  92. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts.map +1 -0
  93. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +105 -0
  94. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  95. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +20 -0
  96. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts.map +1 -0
  97. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +105 -0
  98. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  99. package/lib/schemas/v2025R0/index.d.ts +10 -0
  100. package/lib/schemas/v2025R0/index.d.ts.map +1 -1
  101. package/lib/schemas/v2025R0/index.js +10 -0
  102. package/lib/schemas/v2025R0/index.js.map +1 -1
  103. package/lib-esm/client.d.ts +3 -1
  104. package/lib-esm/client.js +6 -0
  105. package/lib-esm/client.js.map +1 -1
  106. package/lib-esm/managers/hubDocument.d.ts +132 -0
  107. package/lib-esm/managers/hubDocument.js +154 -0
  108. package/lib-esm/managers/hubDocument.js.map +1 -0
  109. package/lib-esm/managers/hubItems.d.ts +7 -0
  110. package/lib-esm/managers/hubItems.js +1 -0
  111. package/lib-esm/managers/hubItems.js.map +1 -1
  112. package/lib-esm/managers/index.d.ts +1 -0
  113. package/lib-esm/managers/index.js +1 -0
  114. package/lib-esm/managers/index.js.map +1 -1
  115. package/lib-esm/managers/search.d.ts +1 -1
  116. package/lib-esm/managers/search.js +1 -1
  117. package/lib-esm/managers/search.js.map +1 -1
  118. package/lib-esm/managers/trashedItems.d.ts +2 -0
  119. package/lib-esm/managers/trashedItems.js +2 -0
  120. package/lib-esm/managers/trashedItems.js.map +1 -1
  121. package/lib-esm/networking/version.d.ts +1 -1
  122. package/lib-esm/networking/version.js +1 -1
  123. package/lib-esm/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  124. package/lib-esm/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  125. package/lib-esm/schemas/aiExtractStructured.d.ts +3 -0
  126. package/lib-esm/schemas/aiExtractStructured.js +9 -0
  127. package/lib-esm/schemas/aiExtractStructured.js.map +1 -1
  128. package/lib-esm/schemas/aiExtractStructuredResponse.d.ts +5 -0
  129. package/lib-esm/schemas/aiExtractStructuredResponse.js +24 -0
  130. package/lib-esm/schemas/aiExtractStructuredResponse.js.map +1 -1
  131. package/lib-esm/schemas/index.d.ts +5 -5
  132. package/lib-esm/schemas/index.js +5 -5
  133. package/lib-esm/schemas/index.js.map +1 -1
  134. package/lib-esm/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  135. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js +44 -23
  136. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  137. package/lib-esm/schemas/legalHoldPolicyAssignment.js.map +1 -1
  138. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +19 -0
  139. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +106 -0
  140. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  141. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +16 -0
  142. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js +85 -0
  143. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  144. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +9 -0
  145. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +56 -0
  146. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  147. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +12 -0
  148. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js +32 -0
  149. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  150. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +44 -0
  151. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js +164 -0
  152. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  153. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +18 -0
  154. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js +64 -0
  155. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  156. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +44 -0
  157. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js +164 -0
  158. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  159. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +16 -0
  160. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js +85 -0
  161. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  162. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  163. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  164. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  165. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  166. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  167. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  168. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +19 -0
  169. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +106 -0
  170. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  171. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +19 -0
  172. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +106 -0
  173. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  174. package/lib-esm/schemas/v2025R0/index.d.ts +10 -0
  175. package/lib-esm/schemas/v2025R0/index.js +10 -0
  176. package/lib-esm/schemas/v2025R0/index.js.map +1 -1
  177. package/package.json +1 -1
  178. package/src/client.ts +7 -0
  179. package/src/managers/hubDocument.ts +330 -0
  180. package/src/managers/hubItems.ts +8 -0
  181. package/src/managers/index.ts +1 -0
  182. package/src/managers/search.ts +2 -2
  183. package/src/managers/trashedItems.ts +2 -0
  184. package/src/networking/version.ts +1 -1
  185. package/src/schemas/aiAgentBasicTextToolBase.ts +1 -1
  186. package/src/schemas/aiAgentSpreadsheetTool.ts +1 -1
  187. package/src/schemas/aiExtractStructured.ts +16 -0
  188. package/src/schemas/aiExtractStructuredResponse.ts +44 -0
  189. package/src/schemas/index.ts +5 -5
  190. package/src/schemas/legalHoldPolicyAssignedItem.ts +69 -27
  191. package/src/schemas/legalHoldPolicyAssignment.ts +0 -9
  192. package/src/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.ts +133 -0
  193. package/src/schemas/v2025R0/hubDividerBlockV2025R0.ts +108 -0
  194. package/src/schemas/v2025R0/hubDocumentBlockEntryV2025R0.ts +76 -0
  195. package/src/schemas/v2025R0/hubDocumentBlockV2025R0.ts +51 -0
  196. package/src/schemas/v2025R0/hubDocumentBlocksV2025R0.ts +238 -0
  197. package/src/schemas/v2025R0/hubDocumentPageV2025R0.ts +92 -0
  198. package/src/schemas/v2025R0/hubDocumentPagesV2025R0.ts +218 -0
  199. package/src/schemas/v2025R0/hubItemListBlockV2025R0.ts +108 -0
  200. package/src/schemas/v2025R0/hubItemOperationResultV2025R0.ts +13 -0
  201. package/src/schemas/v2025R0/hubItemOperationV2025R0.ts +17 -1
  202. package/src/schemas/v2025R0/hubParagraphTextBlockV2025R0.ts +133 -0
  203. package/src/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.ts +133 -0
  204. package/src/schemas/v2025R0/index.ts +10 -0
  205. package/src/test/hubDocument.test.ts +91 -0
@@ -0,0 +1,330 @@
1
+ import { serializeHubDocumentPagesV2025R0 } from '../schemas/v2025R0/hubDocumentPagesV2025R0';
2
+ import { deserializeHubDocumentPagesV2025R0 } from '../schemas/v2025R0/hubDocumentPagesV2025R0';
3
+ import { serializeClientErrorV2025R0 } from '../schemas/v2025R0/clientErrorV2025R0';
4
+ import { deserializeClientErrorV2025R0 } from '../schemas/v2025R0/clientErrorV2025R0';
5
+ import { serializeBoxVersionHeaderV2025R0 } from '../parameters/v2025R0/boxVersionHeaderV2025R0';
6
+ import { deserializeBoxVersionHeaderV2025R0 } from '../parameters/v2025R0/boxVersionHeaderV2025R0';
7
+ import { serializeHubDocumentBlocksV2025R0 } from '../schemas/v2025R0/hubDocumentBlocksV2025R0';
8
+ import { deserializeHubDocumentBlocksV2025R0 } from '../schemas/v2025R0/hubDocumentBlocksV2025R0';
9
+ import { ResponseFormat } from '../networking/fetchOptions';
10
+ import { HubDocumentPagesV2025R0 } from '../schemas/v2025R0/hubDocumentPagesV2025R0';
11
+ import { ClientErrorV2025R0 } from '../schemas/v2025R0/clientErrorV2025R0';
12
+ import { BoxVersionHeaderV2025R0 } from '../parameters/v2025R0/boxVersionHeaderV2025R0';
13
+ import { HubDocumentBlocksV2025R0 } from '../schemas/v2025R0/hubDocumentBlocksV2025R0';
14
+ import { BoxSdkError } from '../box/errors';
15
+ import { Authentication } from '../networking/auth';
16
+ import { NetworkSession } from '../networking/network';
17
+ import { FetchOptions } from '../networking/fetchOptions';
18
+ import { FetchResponse } from '../networking/fetchResponse';
19
+ import { prepareParams } from '../internal/utils';
20
+ import { toString } from '../internal/utils';
21
+ import { ByteStream } from '../internal/utils';
22
+ import { CancellationToken } from '../internal/utils';
23
+ import { sdToJson } from '../serialization/json';
24
+ import { SerializedData } from '../serialization/json';
25
+ import { sdIsEmpty } from '../serialization/json';
26
+ import { sdIsBoolean } from '../serialization/json';
27
+ import { sdIsNumber } from '../serialization/json';
28
+ import { sdIsString } from '../serialization/json';
29
+ import { sdIsList } from '../serialization/json';
30
+ import { sdIsMap } from '../serialization/json';
31
+ export class GetHubDocumentPagesV2025R0Optionals {
32
+ readonly headers: GetHubDocumentPagesV2025R0Headers =
33
+ new GetHubDocumentPagesV2025R0Headers({});
34
+ readonly cancellationToken?: CancellationToken = void 0;
35
+ constructor(
36
+ fields: Omit<
37
+ GetHubDocumentPagesV2025R0Optionals,
38
+ 'headers' | 'cancellationToken'
39
+ > &
40
+ Partial<
41
+ Pick<
42
+ GetHubDocumentPagesV2025R0Optionals,
43
+ 'headers' | 'cancellationToken'
44
+ >
45
+ >,
46
+ ) {
47
+ if (fields.headers !== undefined) {
48
+ this.headers = fields.headers;
49
+ }
50
+ if (fields.cancellationToken !== undefined) {
51
+ this.cancellationToken = fields.cancellationToken;
52
+ }
53
+ }
54
+ }
55
+ export interface GetHubDocumentPagesV2025R0OptionalsInput {
56
+ readonly headers?: GetHubDocumentPagesV2025R0Headers;
57
+ readonly cancellationToken?: CancellationToken;
58
+ }
59
+ export class GetHubDocumentBlocksV2025R0Optionals {
60
+ readonly headers: GetHubDocumentBlocksV2025R0Headers =
61
+ new GetHubDocumentBlocksV2025R0Headers({});
62
+ readonly cancellationToken?: CancellationToken = void 0;
63
+ constructor(
64
+ fields: Omit<
65
+ GetHubDocumentBlocksV2025R0Optionals,
66
+ 'headers' | 'cancellationToken'
67
+ > &
68
+ Partial<
69
+ Pick<
70
+ GetHubDocumentBlocksV2025R0Optionals,
71
+ 'headers' | 'cancellationToken'
72
+ >
73
+ >,
74
+ ) {
75
+ if (fields.headers !== undefined) {
76
+ this.headers = fields.headers;
77
+ }
78
+ if (fields.cancellationToken !== undefined) {
79
+ this.cancellationToken = fields.cancellationToken;
80
+ }
81
+ }
82
+ }
83
+ export interface GetHubDocumentBlocksV2025R0OptionalsInput {
84
+ readonly headers?: GetHubDocumentBlocksV2025R0Headers;
85
+ readonly cancellationToken?: CancellationToken;
86
+ }
87
+ export interface GetHubDocumentPagesV2025R0QueryParams {
88
+ /**
89
+ * The unique identifier that represent a hub.
90
+ *
91
+ * The ID for any hub can be determined
92
+ * by visiting this hub in the web application
93
+ * and copying the ID from the URL. For example,
94
+ * for the URL `https://*.app.box.com/hubs/123`
95
+ * the `hub_id` is `123`. */
96
+ readonly hubId: string;
97
+ /**
98
+ * Defines the position marker at which to begin returning results. This is
99
+ * used when paginating using marker-based pagination. */
100
+ readonly marker?: string;
101
+ /**
102
+ * The maximum number of items to return per page. */
103
+ readonly limit?: number;
104
+ }
105
+ export class GetHubDocumentPagesV2025R0Headers {
106
+ /**
107
+ * Version header. */
108
+ readonly boxVersion: BoxVersionHeaderV2025R0 =
109
+ '2025.0' as BoxVersionHeaderV2025R0;
110
+ /**
111
+ * Extra headers that will be included in the HTTP request. */
112
+ readonly extraHeaders?: {
113
+ readonly [key: string]: undefined | string;
114
+ } = {};
115
+ constructor(
116
+ fields: Omit<
117
+ GetHubDocumentPagesV2025R0Headers,
118
+ 'boxVersion' | 'extraHeaders'
119
+ > &
120
+ Partial<
121
+ Pick<GetHubDocumentPagesV2025R0Headers, 'boxVersion' | 'extraHeaders'>
122
+ >,
123
+ ) {
124
+ if (fields.boxVersion !== undefined) {
125
+ this.boxVersion = fields.boxVersion;
126
+ }
127
+ if (fields.extraHeaders !== undefined) {
128
+ this.extraHeaders = fields.extraHeaders;
129
+ }
130
+ }
131
+ }
132
+ export interface GetHubDocumentPagesV2025R0HeadersInput {
133
+ /**
134
+ * Version header. */
135
+ readonly boxVersion?: BoxVersionHeaderV2025R0;
136
+ /**
137
+ * Extra headers that will be included in the HTTP request. */
138
+ readonly extraHeaders?: {
139
+ readonly [key: string]: undefined | string;
140
+ };
141
+ }
142
+ export interface GetHubDocumentBlocksV2025R0QueryParams {
143
+ /**
144
+ * The unique identifier that represent a hub.
145
+ *
146
+ * The ID for any hub can be determined
147
+ * by visiting this hub in the web application
148
+ * and copying the ID from the URL. For example,
149
+ * for the URL `https://*.app.box.com/hubs/123`
150
+ * the `hub_id` is `123`. */
151
+ readonly hubId: string;
152
+ /**
153
+ * The unique identifier of a page within the Box Hub. */
154
+ readonly pageId: string;
155
+ /**
156
+ * Defines the position marker at which to begin returning results. This is
157
+ * used when paginating using marker-based pagination. */
158
+ readonly marker?: string;
159
+ /**
160
+ * The maximum number of items to return per page. */
161
+ readonly limit?: number;
162
+ }
163
+ export class GetHubDocumentBlocksV2025R0Headers {
164
+ /**
165
+ * Version header. */
166
+ readonly boxVersion: BoxVersionHeaderV2025R0 =
167
+ '2025.0' as BoxVersionHeaderV2025R0;
168
+ /**
169
+ * Extra headers that will be included in the HTTP request. */
170
+ readonly extraHeaders?: {
171
+ readonly [key: string]: undefined | string;
172
+ } = {};
173
+ constructor(
174
+ fields: Omit<
175
+ GetHubDocumentBlocksV2025R0Headers,
176
+ 'boxVersion' | 'extraHeaders'
177
+ > &
178
+ Partial<
179
+ Pick<GetHubDocumentBlocksV2025R0Headers, 'boxVersion' | 'extraHeaders'>
180
+ >,
181
+ ) {
182
+ if (fields.boxVersion !== undefined) {
183
+ this.boxVersion = fields.boxVersion;
184
+ }
185
+ if (fields.extraHeaders !== undefined) {
186
+ this.extraHeaders = fields.extraHeaders;
187
+ }
188
+ }
189
+ }
190
+ export interface GetHubDocumentBlocksV2025R0HeadersInput {
191
+ /**
192
+ * Version header. */
193
+ readonly boxVersion?: BoxVersionHeaderV2025R0;
194
+ /**
195
+ * Extra headers that will be included in the HTTP request. */
196
+ readonly extraHeaders?: {
197
+ readonly [key: string]: undefined | string;
198
+ };
199
+ }
200
+ export class HubDocumentManager {
201
+ readonly auth?: Authentication;
202
+ readonly networkSession: NetworkSession = new NetworkSession({});
203
+ constructor(
204
+ fields: Omit<
205
+ HubDocumentManager,
206
+ | 'networkSession'
207
+ | 'getHubDocumentPagesV2025R0'
208
+ | 'getHubDocumentBlocksV2025R0'
209
+ > &
210
+ Partial<Pick<HubDocumentManager, 'networkSession'>>,
211
+ ) {
212
+ if (fields.auth !== undefined) {
213
+ this.auth = fields.auth;
214
+ }
215
+ if (fields.networkSession !== undefined) {
216
+ this.networkSession = fields.networkSession;
217
+ }
218
+ }
219
+ /**
220
+ * Retrieves a list of Hub Document Pages for the specified hub.
221
+ * Includes both root-level pages and sub pages.
222
+ * @param {GetHubDocumentPagesV2025R0QueryParams} queryParams Query parameters of getHubDocumentPagesV2025R0 method
223
+ * @param {GetHubDocumentPagesV2025R0OptionalsInput} optionalsInput
224
+ * @returns {Promise<HubDocumentPagesV2025R0>}
225
+ */
226
+ async getHubDocumentPagesV2025R0(
227
+ queryParams: GetHubDocumentPagesV2025R0QueryParams,
228
+ optionalsInput: GetHubDocumentPagesV2025R0OptionalsInput = {},
229
+ ): Promise<HubDocumentPagesV2025R0> {
230
+ const optionals: GetHubDocumentPagesV2025R0Optionals =
231
+ new GetHubDocumentPagesV2025R0Optionals({
232
+ headers: optionalsInput.headers,
233
+ cancellationToken: optionalsInput.cancellationToken,
234
+ });
235
+ const headers: any = optionals.headers;
236
+ const cancellationToken: any = optionals.cancellationToken;
237
+ const queryParamsMap: {
238
+ readonly [key: string]: string;
239
+ } = prepareParams({
240
+ ['hub_id']: toString(queryParams.hubId) as string,
241
+ ['marker']: toString(queryParams.marker) as string,
242
+ ['limit']: toString(queryParams.limit) as string,
243
+ });
244
+ const headersMap: {
245
+ readonly [key: string]: string;
246
+ } = prepareParams({
247
+ ...{ ['box-version']: toString(headers.boxVersion) as string },
248
+ ...headers.extraHeaders,
249
+ });
250
+ const response: FetchResponse =
251
+ await this.networkSession.networkClient.fetch(
252
+ new FetchOptions({
253
+ url: ''.concat(
254
+ this.networkSession.baseUrls.baseUrl,
255
+ '/2.0/hub_document_pages',
256
+ ) as string,
257
+ method: 'GET',
258
+ params: queryParamsMap,
259
+ headers: headersMap,
260
+ responseFormat: 'json' as ResponseFormat,
261
+ auth: this.auth,
262
+ networkSession: this.networkSession,
263
+ cancellationToken: cancellationToken,
264
+ }),
265
+ );
266
+ return {
267
+ ...deserializeHubDocumentPagesV2025R0(response.data!),
268
+ rawData: response.data!,
269
+ };
270
+ }
271
+ /**
272
+ * Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document, excluding items.
273
+ * Blocks are hierarchically organized by their `parent_id`.
274
+ * Blocks are sorted in order based on user specification in the user interface.
275
+ * The response will only include content blocks that belong to the specified page. This will not include sub pages or sub page content blocks.
276
+ * @param {GetHubDocumentBlocksV2025R0QueryParams} queryParams Query parameters of getHubDocumentBlocksV2025R0 method
277
+ * @param {GetHubDocumentBlocksV2025R0OptionalsInput} optionalsInput
278
+ * @returns {Promise<HubDocumentBlocksV2025R0>}
279
+ */
280
+ async getHubDocumentBlocksV2025R0(
281
+ queryParams: GetHubDocumentBlocksV2025R0QueryParams,
282
+ optionalsInput: GetHubDocumentBlocksV2025R0OptionalsInput = {},
283
+ ): Promise<HubDocumentBlocksV2025R0> {
284
+ const optionals: GetHubDocumentBlocksV2025R0Optionals =
285
+ new GetHubDocumentBlocksV2025R0Optionals({
286
+ headers: optionalsInput.headers,
287
+ cancellationToken: optionalsInput.cancellationToken,
288
+ });
289
+ const headers: any = optionals.headers;
290
+ const cancellationToken: any = optionals.cancellationToken;
291
+ const queryParamsMap: {
292
+ readonly [key: string]: string;
293
+ } = prepareParams({
294
+ ['hub_id']: toString(queryParams.hubId) as string,
295
+ ['page_id']: toString(queryParams.pageId) as string,
296
+ ['marker']: toString(queryParams.marker) as string,
297
+ ['limit']: toString(queryParams.limit) as string,
298
+ });
299
+ const headersMap: {
300
+ readonly [key: string]: string;
301
+ } = prepareParams({
302
+ ...{ ['box-version']: toString(headers.boxVersion) as string },
303
+ ...headers.extraHeaders,
304
+ });
305
+ const response: FetchResponse =
306
+ await this.networkSession.networkClient.fetch(
307
+ new FetchOptions({
308
+ url: ''.concat(
309
+ this.networkSession.baseUrls.baseUrl,
310
+ '/2.0/hub_document_blocks',
311
+ ) as string,
312
+ method: 'GET',
313
+ params: queryParamsMap,
314
+ headers: headersMap,
315
+ responseFormat: 'json' as ResponseFormat,
316
+ auth: this.auth,
317
+ networkSession: this.networkSession,
318
+ cancellationToken: cancellationToken,
319
+ }),
320
+ );
321
+ return {
322
+ ...deserializeHubDocumentBlocksV2025R0(response.data!),
323
+ rawData: response.data!,
324
+ };
325
+ }
326
+ }
327
+ export interface HubDocumentManagerInput {
328
+ readonly auth?: Authentication;
329
+ readonly networkSession?: NetworkSession;
330
+ }
@@ -89,6 +89,13 @@ export interface GetHubItemsV2025R0QueryParams {
89
89
  * for the URL `https://*.app.box.com/hubs/123`
90
90
  * the `hub_id` is `123`. */
91
91
  readonly hubId: string;
92
+ /**
93
+ * The unique identifier of an item list block within the Box Hub.
94
+ *
95
+ * When provided, the response will only include items that belong
96
+ * to the specified item list, allowing you to filter results to
97
+ * items on a specific page or section. */
98
+ readonly parentId?: string;
92
99
  /**
93
100
  * Defines the position marker at which to begin returning results. This is
94
101
  * used when paginating using marker-based pagination.
@@ -203,6 +210,7 @@ export class HubItemsManager {
203
210
  readonly [key: string]: string;
204
211
  } = prepareParams({
205
212
  ['hub_id']: toString(queryParams.hubId) as string,
213
+ ['parent_id']: toString(queryParams.parentId) as string,
206
214
  ['marker']: toString(queryParams.marker) as string,
207
215
  ['limit']: toString(queryParams.limit) as string,
208
216
  });
@@ -77,6 +77,7 @@ export * from './enterpriseConfigurations';
77
77
  export * from './hubs';
78
78
  export * from './hubCollaborations';
79
79
  export * from './hubItems';
80
+ export * from './hubDocument';
80
81
  export * from './shieldLists';
81
82
  export * from './archives';
82
83
  export * from './externalUsers';
@@ -93,7 +93,7 @@ export type SearchForContentQueryParamsContentTypesField =
93
93
  | 'description'
94
94
  | 'file_content'
95
95
  | 'comments'
96
- | 'tag'
96
+ | 'tags'
97
97
  | string;
98
98
  export type SearchForContentQueryParamsTypeField =
99
99
  | 'file'
@@ -595,7 +595,7 @@ export function deserializeSearchForContentQueryParamsContentTypesField(
595
595
  if (val == 'comments') {
596
596
  return val;
597
597
  }
598
- if (val == 'tag') {
598
+ if (val == 'tags') {
599
599
  return val;
600
600
  }
601
601
  if (sdIsString(val)) {
@@ -126,6 +126,8 @@ export class TrashedItemsManager {
126
126
  *
127
127
  * This endpoint defaults to use offset-based pagination, yet also supports
128
128
  * marker-based pagination using the `marker` parameter.
129
+ *
130
+ * The number of entries returned may be less than `total_count`. For example, if a user deletes items from a shared folder and is later removed as a collaborator, those deleted items will no longer appear in this endpoint’s results, even though they are still included in `total_count`.
129
131
  * @param {GetTrashedItemsQueryParams} queryParams Query parameters of getTrashedItems method
130
132
  * @param {GetTrashedItemsHeadersInput} headersInput Headers of getTrashedItems method
131
133
  * @param {CancellationToken} cancellationToken Token used for request cancellation.
@@ -1 +1 @@
1
- export const sdkVersion = '10.5.0';
1
+ export const sdkVersion = '10.6.0';
@@ -23,7 +23,7 @@ import { sdIsList } from '../serialization/json';
23
23
  import { sdIsMap } from '../serialization/json';
24
24
  export interface AiAgentBasicTextToolBase {
25
25
  /**
26
- * The model used for the AI agent for basic text. For specific model values, see the [available models list](https://developer.box.com/guides/box-ai/supported-models). */
26
+ * The model used for the AI agent for basic text. For specific model values, see the [available models list](https://developer.box.com/guides/box-ai/ai-models). */
27
27
  readonly model?: string;
28
28
  /**
29
29
  * The number of tokens for completion. */
@@ -23,7 +23,7 @@ import { sdIsList } from '../serialization/json';
23
23
  import { sdIsMap } from '../serialization/json';
24
24
  export interface AiAgentSpreadsheetTool {
25
25
  /**
26
- * The model used for the AI agent for spreadsheets. For specific model values, see the [available models list](https://developer.box.com/guides/box-ai/supported-models). */
26
+ * The model used for the AI agent for spreadsheets. For specific model values, see the [available models list](https://developer.box.com/guides/box-ai/ai-models). */
27
27
  readonly model?: string;
28
28
  /**
29
29
  * The number of tokens for completion. */
@@ -78,6 +78,9 @@ export interface AiExtractStructured {
78
78
  /**
79
79
  * A flag to indicate whether confidence scores for every extracted field should be returned. */
80
80
  readonly includeConfidenceScore?: boolean;
81
+ /**
82
+ * A flag to indicate whether references for every extracted field should be returned. */
83
+ readonly includeReference?: boolean;
81
84
  readonly aiAgent?: AiExtractStructuredAgent;
82
85
  readonly rawData?: SerializedData;
83
86
  }
@@ -286,6 +289,7 @@ export function serializeAiExtractStructured(
286
289
  return serializeAiExtractStructuredFieldsField(item);
287
290
  }) as readonly any[]),
288
291
  ['include_confidence_score']: val.includeConfidenceScore,
292
+ ['include_reference']: val.includeReference,
289
293
  ['ai_agent']:
290
294
  val.aiAgent == void 0
291
295
  ? val.aiAgent
@@ -349,6 +353,17 @@ export function deserializeAiExtractStructured(
349
353
  val.include_confidence_score == void 0
350
354
  ? void 0
351
355
  : val.include_confidence_score;
356
+ if (
357
+ !(val.include_reference == void 0) &&
358
+ !sdIsBoolean(val.include_reference)
359
+ ) {
360
+ throw new BoxSdkError({
361
+ message:
362
+ 'Expecting boolean for "include_reference" of type "AiExtractStructured"',
363
+ });
364
+ }
365
+ const includeReference: undefined | boolean =
366
+ val.include_reference == void 0 ? void 0 : val.include_reference;
352
367
  const aiAgent: undefined | AiExtractStructuredAgent =
353
368
  val.ai_agent == void 0
354
369
  ? void 0
@@ -358,6 +373,7 @@ export function deserializeAiExtractStructured(
358
373
  metadataTemplate: metadataTemplate,
359
374
  fields: fields,
360
375
  includeConfidenceScore: includeConfidenceScore,
376
+ includeReference: includeReference,
361
377
  aiAgent: aiAgent,
362
378
  } satisfies AiExtractStructured;
363
379
  }
@@ -28,6 +28,11 @@ export interface AiExtractStructuredResponse {
28
28
  readonly confidenceScore?: {
29
29
  readonly [key: string]: any;
30
30
  };
31
+ /**
32
+ * The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted. */
33
+ readonly reference?: {
34
+ readonly [key: string]: any;
35
+ };
31
36
  readonly aiAgentInfo?: AiAgentInfo;
32
37
  readonly rawData?: SerializedData;
33
38
  }
@@ -51,6 +56,19 @@ export function serializeAiExtractStructuredResponse(
51
56
  ) as {
52
57
  readonly [key: string]: any;
53
58
  }),
59
+ ['reference']:
60
+ val.reference == void 0
61
+ ? val.reference
62
+ : (Object.fromEntries(
63
+ Object.entries(val.reference).map(([k, v]: [string, any]) => [
64
+ k,
65
+ (function (v: any): any {
66
+ return v;
67
+ })(v),
68
+ ]),
69
+ ) as {
70
+ readonly [key: string]: any;
71
+ }),
54
72
  ['ai_agent_info']:
55
73
  val.aiAgentInfo == void 0
56
74
  ? val.aiAgentInfo
@@ -123,6 +141,31 @@ export function deserializeAiExtractStructuredResponse(
123
141
  readonly [key: string]: any;
124
142
  })
125
143
  : {};
144
+ if (!(val.reference == void 0) && !sdIsMap(val.reference)) {
145
+ throw new BoxSdkError({
146
+ message:
147
+ 'Expecting object for "reference" of type "AiExtractStructuredResponse"',
148
+ });
149
+ }
150
+ const reference:
151
+ | undefined
152
+ | {
153
+ readonly [key: string]: any;
154
+ } =
155
+ val.reference == void 0
156
+ ? void 0
157
+ : sdIsMap(val.reference)
158
+ ? (Object.fromEntries(
159
+ Object.entries(val.reference).map(([k, v]: [string, any]) => [
160
+ k,
161
+ (function (v: any): any {
162
+ return v;
163
+ })(v),
164
+ ]),
165
+ ) as {
166
+ readonly [key: string]: any;
167
+ })
168
+ : {};
126
169
  const aiAgentInfo: undefined | AiAgentInfo =
127
170
  val.ai_agent_info == void 0
128
171
  ? void 0
@@ -132,6 +175,7 @@ export function deserializeAiExtractStructuredResponse(
132
175
  createdAt: createdAt,
133
176
  completionReason: completionReason,
134
177
  confidenceScore: confidenceScore,
178
+ reference: reference,
135
179
  aiAgentInfo: aiAgentInfo,
136
180
  } satisfies AiExtractStructuredResponse;
137
181
  }
@@ -95,6 +95,7 @@ export * from './integrationMappingSlackOptions';
95
95
  export * from './integrationMappingSlackCreateRequest';
96
96
  export * from './keywordSkillCard';
97
97
  export * from './legalHoldPolicyMini';
98
+ export * from './legalHoldPolicyAssignedItem';
98
99
  export * from './legalHoldPolicyAssignmentBase';
99
100
  export * from './metadataBase';
100
101
  export * from './metadata';
@@ -208,6 +209,10 @@ export * from './retentionPolicyAssignment';
208
209
  export * from './retentionPolicyAssignments';
209
210
  export * from './retentionPolicy';
210
211
  export * from './retentionPolicies';
212
+ export * from './legalHoldPolicyAssignment';
213
+ export * from './legalHoldPolicyAssignments';
214
+ export * from './fileVersionLegalHold';
215
+ export * from './fileVersionLegalHolds';
211
216
  export * from './legalHoldPolicy';
212
217
  export * from './legalHoldPolicies';
213
218
  export * from './invite';
@@ -261,11 +266,6 @@ export * from './item';
261
266
  export * from './itemsOffsetPaginated';
262
267
  export * from './items';
263
268
  export * from './folder';
264
- export * from './legalHoldPolicyAssignedItem';
265
- export * from './legalHoldPolicyAssignment';
266
- export * from './legalHoldPolicyAssignments';
267
- export * from './fileVersionLegalHold';
268
- export * from './fileVersionLegalHolds';
269
269
  export * from './folderFull';
270
270
  export * from './searchResultWithSharedLinkItem';
271
271
  export * from './searchResultWithSharedLink';
@@ -1,12 +1,3 @@
1
- import { serializeFile } from './file';
2
- import { deserializeFile } from './file';
3
- import { serializeFolder } from './folder';
4
- import { deserializeFolder } from './folder';
5
- import { serializeWebLink } from './webLink';
6
- import { deserializeWebLink } from './webLink';
7
- import { File } from './file';
8
- import { Folder } from './folder';
9
- import { WebLink } from './webLink';
10
1
  import { BoxSdkError } from '../box/errors';
11
2
  import { SerializedData } from '../serialization/json';
12
3
  import { sdIsEmpty } from '../serialization/json';
@@ -15,18 +6,59 @@ import { sdIsNumber } from '../serialization/json';
15
6
  import { sdIsString } from '../serialization/json';
16
7
  import { sdIsList } from '../serialization/json';
17
8
  import { sdIsMap } from '../serialization/json';
18
- export type LegalHoldPolicyAssignedItem = File | Folder | WebLink;
19
- export function serializeLegalHoldPolicyAssignedItem(val: any): SerializedData {
20
- if (val.type == 'file') {
21
- return serializeFile(val);
9
+ export type LegalHoldPolicyAssignedItemTypeField =
10
+ | 'file'
11
+ | 'file_version'
12
+ | 'folder'
13
+ | 'user'
14
+ | 'ownership'
15
+ | 'interactions';
16
+ export interface LegalHoldPolicyAssignedItem {
17
+ /**
18
+ * The type of item the policy is assigned to. */
19
+ readonly type: LegalHoldPolicyAssignedItemTypeField;
20
+ /**
21
+ * The ID of the item the policy is assigned to. */
22
+ readonly id: string;
23
+ readonly rawData?: SerializedData;
24
+ }
25
+ export function serializeLegalHoldPolicyAssignedItemTypeField(
26
+ val: LegalHoldPolicyAssignedItemTypeField,
27
+ ): SerializedData {
28
+ return val;
29
+ }
30
+ export function deserializeLegalHoldPolicyAssignedItemTypeField(
31
+ val: SerializedData,
32
+ ): LegalHoldPolicyAssignedItemTypeField {
33
+ if (val == 'file') {
34
+ return val;
35
+ }
36
+ if (val == 'file_version') {
37
+ return val;
38
+ }
39
+ if (val == 'folder') {
40
+ return val;
22
41
  }
23
- if (val.type == 'folder') {
24
- return serializeFolder(val);
42
+ if (val == 'user') {
43
+ return val;
25
44
  }
26
- if (val.type == 'web_link') {
27
- return serializeWebLink(val);
45
+ if (val == 'ownership') {
46
+ return val;
28
47
  }
29
- throw new BoxSdkError({ message: 'unknown type' });
48
+ if (val == 'interactions') {
49
+ return val;
50
+ }
51
+ throw new BoxSdkError({
52
+ message: "Can't deserialize LegalHoldPolicyAssignedItemTypeField",
53
+ });
54
+ }
55
+ export function serializeLegalHoldPolicyAssignedItem(
56
+ val: LegalHoldPolicyAssignedItem,
57
+ ): SerializedData {
58
+ return {
59
+ ['type']: serializeLegalHoldPolicyAssignedItemTypeField(val.type),
60
+ ['id']: val.id,
61
+ };
30
62
  }
31
63
  export function deserializeLegalHoldPolicyAssignedItem(
32
64
  val: SerializedData,
@@ -36,16 +68,26 @@ export function deserializeLegalHoldPolicyAssignedItem(
36
68
  message: 'Expecting a map for "LegalHoldPolicyAssignedItem"',
37
69
  });
38
70
  }
39
- if (val.type == 'file') {
40
- return deserializeFile(val);
71
+ if (val.type == void 0) {
72
+ throw new BoxSdkError({
73
+ message:
74
+ 'Expecting "type" of type "LegalHoldPolicyAssignedItem" to be defined',
75
+ });
41
76
  }
42
- if (val.type == 'folder') {
43
- return deserializeFolder(val);
77
+ const type: LegalHoldPolicyAssignedItemTypeField =
78
+ deserializeLegalHoldPolicyAssignedItemTypeField(val.type);
79
+ if (val.id == void 0) {
80
+ throw new BoxSdkError({
81
+ message:
82
+ 'Expecting "id" of type "LegalHoldPolicyAssignedItem" to be defined',
83
+ });
44
84
  }
45
- if (val.type == 'web_link') {
46
- return deserializeWebLink(val);
85
+ if (!sdIsString(val.id)) {
86
+ throw new BoxSdkError({
87
+ message:
88
+ 'Expecting string for "id" of type "LegalHoldPolicyAssignedItem"',
89
+ });
47
90
  }
48
- throw new BoxSdkError({
49
- message: "Can't deserialize LegalHoldPolicyAssignedItem",
50
- });
91
+ const id: string = val.id;
92
+ return { type: type, id: id } satisfies LegalHoldPolicyAssignedItem;
51
93
  }