box-node-sdk 10.4.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 (253) hide show
  1. package/lib/bundle.js +771 -16
  2. package/lib/bundle.js.map +1 -1
  3. package/lib/client.d.ts +10 -1
  4. package/lib/client.d.ts.map +1 -1
  5. package/lib/client.js +16 -0
  6. package/lib/client.js.map +1 -1
  7. package/lib/managers/archives.d.ts +4 -0
  8. package/lib/managers/archives.d.ts.map +1 -1
  9. package/lib/managers/archives.js +4 -0
  10. package/lib/managers/archives.js.map +1 -1
  11. package/lib/managers/hubDocument.d.ts +133 -0
  12. package/lib/managers/hubDocument.d.ts.map +1 -0
  13. package/lib/managers/hubDocument.js +162 -0
  14. package/lib/managers/hubDocument.js.map +1 -0
  15. package/lib/managers/hubItems.d.ts +7 -0
  16. package/lib/managers/hubItems.d.ts.map +1 -1
  17. package/lib/managers/hubItems.js +1 -0
  18. package/lib/managers/hubItems.js.map +1 -1
  19. package/lib/managers/index.d.ts +1 -0
  20. package/lib/managers/index.d.ts.map +1 -1
  21. package/lib/managers/index.js +1 -0
  22. package/lib/managers/index.js.map +1 -1
  23. package/lib/managers/search.d.ts +1 -1
  24. package/lib/managers/search.d.ts.map +1 -1
  25. package/lib/managers/search.js +1 -1
  26. package/lib/managers/search.js.map +1 -1
  27. package/lib/managers/trashedItems.d.ts +2 -0
  28. package/lib/managers/trashedItems.d.ts.map +1 -1
  29. package/lib/managers/trashedItems.js +2 -0
  30. package/lib/managers/trashedItems.js.map +1 -1
  31. package/lib/networking/boxNetworkClient.d.ts.map +1 -1
  32. package/lib/networking/boxNetworkClient.js +61 -6
  33. package/lib/networking/boxNetworkClient.js.map +1 -1
  34. package/lib/networking/network.d.ts +10 -1
  35. package/lib/networking/network.d.ts.map +1 -1
  36. package/lib/networking/network.js +29 -0
  37. package/lib/networking/network.js.map +1 -1
  38. package/lib/networking/timeoutConfig.d.ts +4 -0
  39. package/lib/networking/timeoutConfig.d.ts.map +1 -0
  40. package/lib/networking/timeoutConfig.js +3 -0
  41. package/lib/networking/timeoutConfig.js.map +1 -0
  42. package/lib/networking/version.d.ts +1 -1
  43. package/lib/networking/version.js +1 -1
  44. package/lib/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  45. package/lib/schemas/aiAgentBasicTextToolBase.d.ts.map +1 -1
  46. package/lib/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  47. package/lib/schemas/aiAgentSpreadsheetTool.d.ts.map +1 -1
  48. package/lib/schemas/aiExtractStructured.d.ts +3 -0
  49. package/lib/schemas/aiExtractStructured.d.ts.map +1 -1
  50. package/lib/schemas/aiExtractStructured.js +9 -0
  51. package/lib/schemas/aiExtractStructured.js.map +1 -1
  52. package/lib/schemas/aiExtractStructuredResponse.d.ts +5 -0
  53. package/lib/schemas/aiExtractStructuredResponse.d.ts.map +1 -1
  54. package/lib/schemas/aiExtractStructuredResponse.js +24 -0
  55. package/lib/schemas/aiExtractStructuredResponse.js.map +1 -1
  56. package/lib/schemas/index.d.ts +9 -9
  57. package/lib/schemas/index.d.ts.map +1 -1
  58. package/lib/schemas/index.js +9 -9
  59. package/lib/schemas/index.js.map +1 -1
  60. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  61. package/lib/schemas/legalHoldPolicyAssignedItem.d.ts.map +1 -1
  62. package/lib/schemas/legalHoldPolicyAssignedItem.js +47 -24
  63. package/lib/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  64. package/lib/schemas/legalHoldPolicyAssignment.d.ts.map +1 -1
  65. package/lib/schemas/legalHoldPolicyAssignment.js.map +1 -1
  66. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +20 -0
  67. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts.map +1 -0
  68. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +105 -0
  69. package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  70. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +17 -0
  71. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts.map +1 -0
  72. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js +87 -0
  73. package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  74. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +10 -0
  75. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts.map +1 -0
  76. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +60 -0
  77. package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  78. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +13 -0
  79. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts.map +1 -0
  80. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js +36 -0
  81. package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  82. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +45 -0
  83. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts.map +1 -0
  84. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js +162 -0
  85. package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  86. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +19 -0
  87. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts.map +1 -0
  88. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js +68 -0
  89. package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  90. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +45 -0
  91. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts.map +1 -0
  92. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js +162 -0
  93. package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  94. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +17 -0
  95. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts.map +1 -0
  96. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js +87 -0
  97. package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  98. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  99. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts.map +1 -1
  100. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  101. package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  102. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  103. package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts.map +1 -1
  104. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  105. package/lib/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  106. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +20 -0
  107. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts.map +1 -0
  108. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +105 -0
  109. package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  110. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +20 -0
  111. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts.map +1 -0
  112. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +105 -0
  113. package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  114. package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.d.ts +3 -0
  115. package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.d.ts.map +1 -1
  116. package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.js +11 -0
  117. package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.js.map +1 -1
  118. package/lib/schemas/v2025R0/hubV2025R0.d.ts +1 -0
  119. package/lib/schemas/v2025R0/hubV2025R0.d.ts.map +1 -1
  120. package/lib/schemas/v2025R0/hubV2025R0.js +14 -0
  121. package/lib/schemas/v2025R0/hubV2025R0.js.map +1 -1
  122. package/lib/schemas/v2025R0/index.d.ts +10 -0
  123. package/lib/schemas/v2025R0/index.d.ts.map +1 -1
  124. package/lib/schemas/v2025R0/index.js +10 -0
  125. package/lib/schemas/v2025R0/index.js.map +1 -1
  126. package/lib-esm/client.d.ts +10 -1
  127. package/lib-esm/client.js +17 -0
  128. package/lib-esm/client.js.map +1 -1
  129. package/lib-esm/managers/archives.d.ts +4 -0
  130. package/lib-esm/managers/archives.js +4 -0
  131. package/lib-esm/managers/archives.js.map +1 -1
  132. package/lib-esm/managers/hubDocument.d.ts +132 -0
  133. package/lib-esm/managers/hubDocument.js +154 -0
  134. package/lib-esm/managers/hubDocument.js.map +1 -0
  135. package/lib-esm/managers/hubItems.d.ts +7 -0
  136. package/lib-esm/managers/hubItems.js +1 -0
  137. package/lib-esm/managers/hubItems.js.map +1 -1
  138. package/lib-esm/managers/index.d.ts +1 -0
  139. package/lib-esm/managers/index.js +1 -0
  140. package/lib-esm/managers/index.js.map +1 -1
  141. package/lib-esm/managers/search.d.ts +1 -1
  142. package/lib-esm/managers/search.js +1 -1
  143. package/lib-esm/managers/search.js.map +1 -1
  144. package/lib-esm/managers/trashedItems.d.ts +2 -0
  145. package/lib-esm/managers/trashedItems.js +2 -0
  146. package/lib-esm/managers/trashedItems.js.map +1 -1
  147. package/lib-esm/networking/boxNetworkClient.js +67 -6
  148. package/lib-esm/networking/boxNetworkClient.js.map +1 -1
  149. package/lib-esm/networking/network.d.ts +10 -1
  150. package/lib-esm/networking/network.js +30 -0
  151. package/lib-esm/networking/network.js.map +1 -1
  152. package/lib-esm/networking/timeoutConfig.d.ts +3 -0
  153. package/lib-esm/networking/timeoutConfig.js +2 -0
  154. package/lib-esm/networking/timeoutConfig.js.map +1 -0
  155. package/lib-esm/networking/version.d.ts +1 -1
  156. package/lib-esm/networking/version.js +1 -1
  157. package/lib-esm/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
  158. package/lib-esm/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
  159. package/lib-esm/schemas/aiExtractStructured.d.ts +3 -0
  160. package/lib-esm/schemas/aiExtractStructured.js +9 -0
  161. package/lib-esm/schemas/aiExtractStructured.js.map +1 -1
  162. package/lib-esm/schemas/aiExtractStructuredResponse.d.ts +5 -0
  163. package/lib-esm/schemas/aiExtractStructuredResponse.js +24 -0
  164. package/lib-esm/schemas/aiExtractStructuredResponse.js.map +1 -1
  165. package/lib-esm/schemas/index.d.ts +9 -9
  166. package/lib-esm/schemas/index.js +9 -9
  167. package/lib-esm/schemas/index.js.map +1 -1
  168. package/lib-esm/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
  169. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js +44 -23
  170. package/lib-esm/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
  171. package/lib-esm/schemas/legalHoldPolicyAssignment.js.map +1 -1
  172. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +19 -0
  173. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +106 -0
  174. package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
  175. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +16 -0
  176. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js +85 -0
  177. package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
  178. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +9 -0
  179. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +56 -0
  180. package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
  181. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +12 -0
  182. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js +32 -0
  183. package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
  184. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +44 -0
  185. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js +164 -0
  186. package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
  187. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +18 -0
  188. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js +64 -0
  189. package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
  190. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +44 -0
  191. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js +164 -0
  192. package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
  193. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +16 -0
  194. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js +85 -0
  195. package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
  196. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
  197. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
  198. package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
  199. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
  200. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
  201. package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
  202. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +19 -0
  203. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +106 -0
  204. package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
  205. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +19 -0
  206. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +106 -0
  207. package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
  208. package/lib-esm/schemas/v2025R0/hubUpdateRequestV2025R0.d.ts +3 -0
  209. package/lib-esm/schemas/v2025R0/hubUpdateRequestV2025R0.js +11 -0
  210. package/lib-esm/schemas/v2025R0/hubUpdateRequestV2025R0.js.map +1 -1
  211. package/lib-esm/schemas/v2025R0/hubV2025R0.d.ts +1 -0
  212. package/lib-esm/schemas/v2025R0/hubV2025R0.js +15 -0
  213. package/lib-esm/schemas/v2025R0/hubV2025R0.js.map +1 -1
  214. package/lib-esm/schemas/v2025R0/index.d.ts +10 -0
  215. package/lib-esm/schemas/v2025R0/index.js +10 -0
  216. package/lib-esm/schemas/v2025R0/index.js.map +1 -1
  217. package/package.json +1 -1
  218. package/src/client.ts +20 -0
  219. package/src/managers/archives.ts +4 -0
  220. package/src/managers/hubDocument.ts +330 -0
  221. package/src/managers/hubItems.ts +8 -0
  222. package/src/managers/index.ts +1 -0
  223. package/src/managers/search.ts +2 -2
  224. package/src/managers/trashedItems.ts +2 -0
  225. package/src/networking/boxNetworkClient.ts +82 -13
  226. package/src/networking/network.ts +33 -0
  227. package/src/networking/timeoutConfig.ts +3 -0
  228. package/src/networking/version.ts +1 -1
  229. package/src/schemas/aiAgentBasicTextToolBase.ts +1 -1
  230. package/src/schemas/aiAgentSpreadsheetTool.ts +1 -1
  231. package/src/schemas/aiExtractStructured.ts +16 -0
  232. package/src/schemas/aiExtractStructuredResponse.ts +44 -0
  233. package/src/schemas/index.ts +9 -9
  234. package/src/schemas/legalHoldPolicyAssignedItem.ts +69 -27
  235. package/src/schemas/legalHoldPolicyAssignment.ts +0 -9
  236. package/src/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.ts +133 -0
  237. package/src/schemas/v2025R0/hubDividerBlockV2025R0.ts +108 -0
  238. package/src/schemas/v2025R0/hubDocumentBlockEntryV2025R0.ts +76 -0
  239. package/src/schemas/v2025R0/hubDocumentBlockV2025R0.ts +51 -0
  240. package/src/schemas/v2025R0/hubDocumentBlocksV2025R0.ts +238 -0
  241. package/src/schemas/v2025R0/hubDocumentPageV2025R0.ts +92 -0
  242. package/src/schemas/v2025R0/hubDocumentPagesV2025R0.ts +218 -0
  243. package/src/schemas/v2025R0/hubItemListBlockV2025R0.ts +108 -0
  244. package/src/schemas/v2025R0/hubItemOperationResultV2025R0.ts +13 -0
  245. package/src/schemas/v2025R0/hubItemOperationV2025R0.ts +17 -1
  246. package/src/schemas/v2025R0/hubParagraphTextBlockV2025R0.ts +133 -0
  247. package/src/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.ts +133 -0
  248. package/src/schemas/v2025R0/hubUpdateRequestV2025R0.ts +18 -0
  249. package/src/schemas/v2025R0/hubV2025R0.ts +19 -0
  250. package/src/schemas/v2025R0/index.ts +10 -0
  251. package/src/test/archives.test.ts +0 -1
  252. package/src/test/client.test.ts +17 -0
  253. package/src/test/hubDocument.test.ts +91 -0
@@ -24,6 +24,9 @@ export interface HubItemOperationV2025R0 {
24
24
  * The action to perform on a Box Hub item. */
25
25
  readonly action: HubItemOperationV2025R0ActionField;
26
26
  readonly item: HubItemReferenceV2025R0;
27
+ /**
28
+ * 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. */
29
+ readonly parentId?: string;
27
30
  readonly rawData?: SerializedData;
28
31
  }
29
32
  export function serializeHubItemOperationV2025R0ActionField(
@@ -53,6 +56,7 @@ export function serializeHubItemOperationV2025R0(
53
56
  return {
54
57
  ['action']: serializeHubItemOperationV2025R0ActionField(val.action),
55
58
  ['item']: serializeHubItemReferenceV2025R0(val.item),
59
+ ['parent_id']: val.parentId,
56
60
  };
57
61
  }
58
62
  export function deserializeHubItemOperationV2025R0(
@@ -80,5 +84,17 @@ export function deserializeHubItemOperationV2025R0(
80
84
  const item: HubItemReferenceV2025R0 = deserializeHubItemReferenceV2025R0(
81
85
  val.item,
82
86
  );
83
- return { action: action, item: item } satisfies HubItemOperationV2025R0;
87
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
88
+ throw new BoxSdkError({
89
+ message:
90
+ 'Expecting string for "parent_id" of type "HubItemOperationV2025R0"',
91
+ });
92
+ }
93
+ const parentId: undefined | string =
94
+ val.parent_id == void 0 ? void 0 : val.parent_id;
95
+ return {
96
+ action: action,
97
+ item: item,
98
+ parentId: parentId,
99
+ } satisfies HubItemOperationV2025R0;
84
100
  }
@@ -0,0 +1,133 @@
1
+ import { serializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
2
+ import { deserializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
3
+ import { HubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
4
+ import { BoxSdkError } from '../../box/errors';
5
+ import { SerializedData } from '../../serialization/json';
6
+ import { sdIsEmpty } from '../../serialization/json';
7
+ import { sdIsBoolean } from '../../serialization/json';
8
+ import { sdIsNumber } from '../../serialization/json';
9
+ import { sdIsString } from '../../serialization/json';
10
+ import { sdIsList } from '../../serialization/json';
11
+ import { sdIsMap } from '../../serialization/json';
12
+ export type HubParagraphTextBlockV2025R0TypeField = 'paragraph';
13
+ export class HubParagraphTextBlockV2025R0 implements HubDocumentBlockV2025R0 {
14
+ readonly id!: string;
15
+ readonly parentId?: string | null;
16
+ readonly rawData?: SerializedData;
17
+ /**
18
+ * The type of this block. The value is always `paragraph`. */
19
+ readonly type: HubParagraphTextBlockV2025R0TypeField =
20
+ 'paragraph' as HubParagraphTextBlockV2025R0TypeField;
21
+ /**
22
+ * Text content of the block. Includes rich text formatting. */
23
+ readonly fragment!: string;
24
+ constructor(
25
+ fields: Omit<HubParagraphTextBlockV2025R0, 'type'> &
26
+ Partial<Pick<HubParagraphTextBlockV2025R0, 'type'>>,
27
+ ) {
28
+ if (fields.id !== undefined) {
29
+ this.id = fields.id;
30
+ }
31
+ if (fields.parentId !== undefined) {
32
+ this.parentId = fields.parentId;
33
+ }
34
+ if (fields.rawData !== undefined) {
35
+ this.rawData = fields.rawData;
36
+ }
37
+ if (fields.type !== undefined) {
38
+ this.type = fields.type;
39
+ }
40
+ if (fields.fragment !== undefined) {
41
+ this.fragment = fields.fragment;
42
+ }
43
+ }
44
+ }
45
+ export function serializeHubParagraphTextBlockV2025R0TypeField(
46
+ val: HubParagraphTextBlockV2025R0TypeField,
47
+ ): SerializedData {
48
+ return val;
49
+ }
50
+ export function deserializeHubParagraphTextBlockV2025R0TypeField(
51
+ val: SerializedData,
52
+ ): HubParagraphTextBlockV2025R0TypeField {
53
+ if (val == 'paragraph') {
54
+ return val;
55
+ }
56
+ throw new BoxSdkError({
57
+ message: "Can't deserialize HubParagraphTextBlockV2025R0TypeField",
58
+ });
59
+ }
60
+ export function serializeHubParagraphTextBlockV2025R0(
61
+ val: HubParagraphTextBlockV2025R0,
62
+ ): SerializedData {
63
+ const base: any = serializeHubDocumentBlockV2025R0(val);
64
+ if (!sdIsMap(base)) {
65
+ throw new BoxSdkError({
66
+ message: 'Expecting a map for "HubParagraphTextBlockV2025R0"',
67
+ });
68
+ }
69
+ return {
70
+ ...base,
71
+ ...{
72
+ ['type']: serializeHubParagraphTextBlockV2025R0TypeField(val.type),
73
+ ['fragment']: val.fragment,
74
+ },
75
+ };
76
+ }
77
+ export function deserializeHubParagraphTextBlockV2025R0(
78
+ val: SerializedData,
79
+ ): HubParagraphTextBlockV2025R0 {
80
+ if (!sdIsMap(val)) {
81
+ throw new BoxSdkError({
82
+ message: 'Expecting a map for "HubParagraphTextBlockV2025R0"',
83
+ });
84
+ }
85
+ if (val.type == void 0) {
86
+ throw new BoxSdkError({
87
+ message:
88
+ 'Expecting "type" of type "HubParagraphTextBlockV2025R0" to be defined',
89
+ });
90
+ }
91
+ const type: HubParagraphTextBlockV2025R0TypeField =
92
+ deserializeHubParagraphTextBlockV2025R0TypeField(val.type);
93
+ if (val.fragment == void 0) {
94
+ throw new BoxSdkError({
95
+ message:
96
+ 'Expecting "fragment" of type "HubParagraphTextBlockV2025R0" to be defined',
97
+ });
98
+ }
99
+ if (!sdIsString(val.fragment)) {
100
+ throw new BoxSdkError({
101
+ message:
102
+ 'Expecting string for "fragment" of type "HubParagraphTextBlockV2025R0"',
103
+ });
104
+ }
105
+ const fragment: string = val.fragment;
106
+ if (val.id == void 0) {
107
+ throw new BoxSdkError({
108
+ message:
109
+ 'Expecting "id" of type "HubParagraphTextBlockV2025R0" to be defined',
110
+ });
111
+ }
112
+ if (!sdIsString(val.id)) {
113
+ throw new BoxSdkError({
114
+ message:
115
+ 'Expecting string for "id" of type "HubParagraphTextBlockV2025R0"',
116
+ });
117
+ }
118
+ const id: string = val.id;
119
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
120
+ throw new BoxSdkError({
121
+ message:
122
+ 'Expecting string for "parent_id" of type "HubParagraphTextBlockV2025R0"',
123
+ });
124
+ }
125
+ const parentId: undefined | string =
126
+ val.parent_id == void 0 ? void 0 : val.parent_id;
127
+ return {
128
+ type: type,
129
+ fragment: fragment,
130
+ id: id,
131
+ parentId: parentId,
132
+ } satisfies HubParagraphTextBlockV2025R0;
133
+ }
@@ -0,0 +1,133 @@
1
+ import { serializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
2
+ import { deserializeHubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
3
+ import { HubDocumentBlockV2025R0 } from './hubDocumentBlockV2025R0';
4
+ import { BoxSdkError } from '../../box/errors';
5
+ import { SerializedData } from '../../serialization/json';
6
+ import { sdIsEmpty } from '../../serialization/json';
7
+ import { sdIsBoolean } from '../../serialization/json';
8
+ import { sdIsNumber } from '../../serialization/json';
9
+ import { sdIsString } from '../../serialization/json';
10
+ import { sdIsList } from '../../serialization/json';
11
+ import { sdIsMap } from '../../serialization/json';
12
+ export type HubSectionTitleTextBlockV2025R0TypeField = 'section_title';
13
+ export class HubSectionTitleTextBlockV2025R0 implements HubDocumentBlockV2025R0 {
14
+ readonly id!: string;
15
+ readonly parentId?: string | null;
16
+ readonly rawData?: SerializedData;
17
+ /**
18
+ * The type of this block. The value is always `section_title`. */
19
+ readonly type: HubSectionTitleTextBlockV2025R0TypeField =
20
+ 'section_title' as HubSectionTitleTextBlockV2025R0TypeField;
21
+ /**
22
+ * Text content of the block. Includes rich text formatting. */
23
+ readonly fragment!: string;
24
+ constructor(
25
+ fields: Omit<HubSectionTitleTextBlockV2025R0, 'type'> &
26
+ Partial<Pick<HubSectionTitleTextBlockV2025R0, 'type'>>,
27
+ ) {
28
+ if (fields.id !== undefined) {
29
+ this.id = fields.id;
30
+ }
31
+ if (fields.parentId !== undefined) {
32
+ this.parentId = fields.parentId;
33
+ }
34
+ if (fields.rawData !== undefined) {
35
+ this.rawData = fields.rawData;
36
+ }
37
+ if (fields.type !== undefined) {
38
+ this.type = fields.type;
39
+ }
40
+ if (fields.fragment !== undefined) {
41
+ this.fragment = fields.fragment;
42
+ }
43
+ }
44
+ }
45
+ export function serializeHubSectionTitleTextBlockV2025R0TypeField(
46
+ val: HubSectionTitleTextBlockV2025R0TypeField,
47
+ ): SerializedData {
48
+ return val;
49
+ }
50
+ export function deserializeHubSectionTitleTextBlockV2025R0TypeField(
51
+ val: SerializedData,
52
+ ): HubSectionTitleTextBlockV2025R0TypeField {
53
+ if (val == 'section_title') {
54
+ return val;
55
+ }
56
+ throw new BoxSdkError({
57
+ message: "Can't deserialize HubSectionTitleTextBlockV2025R0TypeField",
58
+ });
59
+ }
60
+ export function serializeHubSectionTitleTextBlockV2025R0(
61
+ val: HubSectionTitleTextBlockV2025R0,
62
+ ): SerializedData {
63
+ const base: any = serializeHubDocumentBlockV2025R0(val);
64
+ if (!sdIsMap(base)) {
65
+ throw new BoxSdkError({
66
+ message: 'Expecting a map for "HubSectionTitleTextBlockV2025R0"',
67
+ });
68
+ }
69
+ return {
70
+ ...base,
71
+ ...{
72
+ ['type']: serializeHubSectionTitleTextBlockV2025R0TypeField(val.type),
73
+ ['fragment']: val.fragment,
74
+ },
75
+ };
76
+ }
77
+ export function deserializeHubSectionTitleTextBlockV2025R0(
78
+ val: SerializedData,
79
+ ): HubSectionTitleTextBlockV2025R0 {
80
+ if (!sdIsMap(val)) {
81
+ throw new BoxSdkError({
82
+ message: 'Expecting a map for "HubSectionTitleTextBlockV2025R0"',
83
+ });
84
+ }
85
+ if (val.type == void 0) {
86
+ throw new BoxSdkError({
87
+ message:
88
+ 'Expecting "type" of type "HubSectionTitleTextBlockV2025R0" to be defined',
89
+ });
90
+ }
91
+ const type: HubSectionTitleTextBlockV2025R0TypeField =
92
+ deserializeHubSectionTitleTextBlockV2025R0TypeField(val.type);
93
+ if (val.fragment == void 0) {
94
+ throw new BoxSdkError({
95
+ message:
96
+ 'Expecting "fragment" of type "HubSectionTitleTextBlockV2025R0" to be defined',
97
+ });
98
+ }
99
+ if (!sdIsString(val.fragment)) {
100
+ throw new BoxSdkError({
101
+ message:
102
+ 'Expecting string for "fragment" of type "HubSectionTitleTextBlockV2025R0"',
103
+ });
104
+ }
105
+ const fragment: string = val.fragment;
106
+ if (val.id == void 0) {
107
+ throw new BoxSdkError({
108
+ message:
109
+ 'Expecting "id" of type "HubSectionTitleTextBlockV2025R0" to be defined',
110
+ });
111
+ }
112
+ if (!sdIsString(val.id)) {
113
+ throw new BoxSdkError({
114
+ message:
115
+ 'Expecting string for "id" of type "HubSectionTitleTextBlockV2025R0"',
116
+ });
117
+ }
118
+ const id: string = val.id;
119
+ if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
120
+ throw new BoxSdkError({
121
+ message:
122
+ 'Expecting string for "parent_id" of type "HubSectionTitleTextBlockV2025R0"',
123
+ });
124
+ }
125
+ const parentId: undefined | string =
126
+ val.parent_id == void 0 ? void 0 : val.parent_id;
127
+ return {
128
+ type: type,
129
+ fragment: fragment,
130
+ id: id,
131
+ parentId: parentId,
132
+ } satisfies HubSectionTitleTextBlockV2025R0;
133
+ }
@@ -25,6 +25,9 @@ export interface HubUpdateRequestV2025R0 {
25
25
  /**
26
26
  * Indicates if a shared link can be created for the Box Hub. */
27
27
  readonly canSharedLinkBeCreated?: boolean;
28
+ /**
29
+ * Indicates if a public shared link can be created for the Box Hub. */
30
+ readonly canPublicSharedLinkBeCreated?: boolean;
28
31
  readonly rawData?: SerializedData;
29
32
  }
30
33
  export function serializeHubUpdateRequestV2025R0(
@@ -38,6 +41,7 @@ export function serializeHubUpdateRequestV2025R0(
38
41
  val.isCollaborationRestrictedToEnterprise,
39
42
  ['can_non_owners_invite']: val.canNonOwnersInvite,
40
43
  ['can_shared_link_be_created']: val.canSharedLinkBeCreated,
44
+ ['can_public_shared_link_be_created']: val.canPublicSharedLinkBeCreated,
41
45
  };
42
46
  }
43
47
  export function deserializeHubUpdateRequestV2025R0(
@@ -107,6 +111,19 @@ export function deserializeHubUpdateRequestV2025R0(
107
111
  val.can_shared_link_be_created == void 0
108
112
  ? void 0
109
113
  : val.can_shared_link_be_created;
114
+ if (
115
+ !(val.can_public_shared_link_be_created == void 0) &&
116
+ !sdIsBoolean(val.can_public_shared_link_be_created)
117
+ ) {
118
+ throw new BoxSdkError({
119
+ message:
120
+ 'Expecting boolean for "can_public_shared_link_be_created" of type "HubUpdateRequestV2025R0"',
121
+ });
122
+ }
123
+ const canPublicSharedLinkBeCreated: undefined | boolean =
124
+ val.can_public_shared_link_be_created == void 0
125
+ ? void 0
126
+ : val.can_public_shared_link_be_created;
110
127
  return {
111
128
  title: title,
112
129
  description: description,
@@ -115,5 +132,6 @@ export function deserializeHubUpdateRequestV2025R0(
115
132
  isCollaborationRestrictedToEnterprise,
116
133
  canNonOwnersInvite: canNonOwnersInvite,
117
134
  canSharedLinkBeCreated: canSharedLinkBeCreated,
135
+ canPublicSharedLinkBeCreated: canPublicSharedLinkBeCreated,
118
136
  } satisfies HubUpdateRequestV2025R0;
119
137
  }
@@ -30,6 +30,7 @@ export class HubV2025R0 extends HubBaseV2025R0 {
30
30
  readonly isCollaborationRestrictedToEnterprise?: boolean;
31
31
  readonly canNonOwnersInvite?: boolean;
32
32
  readonly canSharedLinkBeCreated?: boolean;
33
+ readonly canPublicSharedLinkBeCreated?: boolean;
33
34
  constructor(fields: HubV2025R0) {
34
35
  super(fields);
35
36
  if (fields.title !== undefined) {
@@ -66,6 +67,9 @@ export class HubV2025R0 extends HubBaseV2025R0 {
66
67
  if (fields.canSharedLinkBeCreated !== undefined) {
67
68
  this.canSharedLinkBeCreated = fields.canSharedLinkBeCreated;
68
69
  }
70
+ if (fields.canPublicSharedLinkBeCreated !== undefined) {
71
+ this.canPublicSharedLinkBeCreated = fields.canPublicSharedLinkBeCreated;
72
+ }
69
73
  }
70
74
  }
71
75
  export function serializeHubV2025R0(val: HubV2025R0): SerializedData {
@@ -100,6 +104,7 @@ export function serializeHubV2025R0(val: HubV2025R0): SerializedData {
100
104
  val.isCollaborationRestrictedToEnterprise,
101
105
  ['can_non_owners_invite']: val.canNonOwnersInvite,
102
106
  ['can_shared_link_be_created']: val.canSharedLinkBeCreated,
107
+ ['can_public_shared_link_be_created']: val.canPublicSharedLinkBeCreated,
103
108
  },
104
109
  };
105
110
  }
@@ -193,6 +198,19 @@ export function deserializeHubV2025R0(val: SerializedData): HubV2025R0 {
193
198
  val.can_shared_link_be_created == void 0
194
199
  ? void 0
195
200
  : val.can_shared_link_be_created;
201
+ if (
202
+ !(val.can_public_shared_link_be_created == void 0) &&
203
+ !sdIsBoolean(val.can_public_shared_link_be_created)
204
+ ) {
205
+ throw new BoxSdkError({
206
+ message:
207
+ 'Expecting boolean for "can_public_shared_link_be_created" of type "HubV2025R0"',
208
+ });
209
+ }
210
+ const canPublicSharedLinkBeCreated: undefined | boolean =
211
+ val.can_public_shared_link_be_created == void 0
212
+ ? void 0
213
+ : val.can_public_shared_link_be_created;
196
214
  if (val.id == void 0) {
197
215
  throw new BoxSdkError({
198
216
  message: 'Expecting "id" of type "HubV2025R0" to be defined',
@@ -225,6 +243,7 @@ export function deserializeHubV2025R0(val: SerializedData): HubV2025R0 {
225
243
  isCollaborationRestrictedToEnterprise,
226
244
  canNonOwnersInvite: canNonOwnersInvite,
227
245
  canSharedLinkBeCreated: canSharedLinkBeCreated,
246
+ canPublicSharedLinkBeCreated: canPublicSharedLinkBeCreated,
228
247
  id: id,
229
248
  type: type,
230
249
  } satisfies HubV2025R0;
@@ -34,6 +34,16 @@ export * from './hubCollaborationCreateRequestV2025R0';
34
34
  export * from './hubCollaborationUpdateRequestV2025R0';
35
35
  export * from './hubCopyRequestV2025R0';
36
36
  export * from './hubCreateRequestV2025R0';
37
+ export * from './hubDocumentBlockV2025R0';
38
+ export * from './hubSectionTitleTextBlockV2025R0';
39
+ export * from './hubParagraphTextBlockV2025R0';
40
+ export * from './hubItemListBlockV2025R0';
41
+ export * from './hubDividerBlockV2025R0';
42
+ export * from './hubCalloutBoxTextBlockV2025R0';
43
+ export * from './hubDocumentBlockEntryV2025R0';
44
+ export * from './hubDocumentBlocksV2025R0';
45
+ export * from './hubDocumentPageV2025R0';
46
+ export * from './hubDocumentPagesV2025R0';
37
47
  export * from './hubItemV2025R0';
38
48
  export * from './hubItemsV2025R0';
39
49
  export * from './hubUpdateRequestV2025R0';
@@ -65,7 +65,6 @@ test('testArchivesCreateListDelete', async function testArchivesCreateListDelete
65
65
  if (!(archives.entries!.length > 0)) {
66
66
  throw new Error('Assertion failed');
67
67
  }
68
- await client.archives.deleteArchiveByIdV2025R0(archive.id);
69
68
  await expect(async () => {
70
69
  await client.archives.deleteArchiveByIdV2025R0(archive.id);
71
70
  }).rejects.toThrow();
@@ -37,6 +37,7 @@ import { FileFull } from '@/schemas/fileFull';
37
37
  import { ResponseFormat } from '@/networking/fetchOptions';
38
38
  import { UserFull } from '@/schemas/userFull';
39
39
  import { CreateUserRequestBody } from '@/managers/users';
40
+ import { TimeoutConfig } from '@/networking/timeoutConfig';
40
41
  import { getUuid } from '@/internal/utils';
41
42
  import { generateByteStream } from '@/internal/utils';
42
43
  import { bufferEquals } from '@/internal/utils';
@@ -368,6 +369,22 @@ test('testWithCustomBaseUrls', async function testWithCustomBaseUrls(): Promise<
368
369
  await customBaseClient.users.getUserMe();
369
370
  }).rejects.toThrow();
370
371
  });
372
+ test('testWithTimeoutWhenTimeoutOccurs', async function testWithTimeoutWhenTimeoutOccurs(): Promise<any> {
373
+ const timeoutMs: number = 1;
374
+ const clientWithTimeout: BoxClient = client.withTimeouts({
375
+ timeoutMs: timeoutMs,
376
+ } satisfies TimeoutConfig);
377
+ await expect(async () => {
378
+ await clientWithTimeout.users.getUserMe();
379
+ }).rejects.toThrow();
380
+ });
381
+ test('testWithTimeoutWhenTimeoutDoesNotOccur', async function testWithTimeoutWhenTimeoutDoesNotOccur(): Promise<any> {
382
+ const timeoutMs: number = 10000;
383
+ const clientWithTimeout: BoxClient = client.withTimeouts({
384
+ timeoutMs: timeoutMs,
385
+ } satisfies TimeoutConfig);
386
+ await clientWithTimeout.users.getUserMe();
387
+ });
371
388
  test('testWithInterceptors', async function testWithInterceptors(): Promise<any> {
372
389
  const user: UserFull = await client.users.getUserMe();
373
390
  if (!(user.role == void 0)) {
@@ -0,0 +1,91 @@
1
+ import { serializeHubV2025R0 } from '@/schemas/v2025R0/hubV2025R0';
2
+ import { deserializeHubV2025R0 } from '@/schemas/v2025R0/hubV2025R0';
3
+ import { serializeHubCreateRequestV2025R0 } from '@/schemas/v2025R0/hubCreateRequestV2025R0';
4
+ import { deserializeHubCreateRequestV2025R0 } from '@/schemas/v2025R0/hubCreateRequestV2025R0';
5
+ import { serializeHubDocumentPagesV2025R0 } from '@/schemas/v2025R0/hubDocumentPagesV2025R0';
6
+ import { deserializeHubDocumentPagesV2025R0 } from '@/schemas/v2025R0/hubDocumentPagesV2025R0';
7
+ import { serializeHubDocumentPageV2025R0 } from '@/schemas/v2025R0/hubDocumentPageV2025R0';
8
+ import { deserializeHubDocumentPageV2025R0 } from '@/schemas/v2025R0/hubDocumentPageV2025R0';
9
+ import { serializeHubDocumentBlocksV2025R0 } from '@/schemas/v2025R0/hubDocumentBlocksV2025R0';
10
+ import { deserializeHubDocumentBlocksV2025R0 } from '@/schemas/v2025R0/hubDocumentBlocksV2025R0';
11
+ import { serializeHubParagraphTextBlockV2025R0 } from '@/schemas/v2025R0/hubParagraphTextBlockV2025R0';
12
+ import { deserializeHubParagraphTextBlockV2025R0 } from '@/schemas/v2025R0/hubParagraphTextBlockV2025R0';
13
+ import { serializeHubSectionTitleTextBlockV2025R0 } from '@/schemas/v2025R0/hubSectionTitleTextBlockV2025R0';
14
+ import { deserializeHubSectionTitleTextBlockV2025R0 } from '@/schemas/v2025R0/hubSectionTitleTextBlockV2025R0';
15
+ import { serializeHubCalloutBoxTextBlockV2025R0 } from '@/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0';
16
+ import { deserializeHubCalloutBoxTextBlockV2025R0 } from '@/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0';
17
+ import { serializeHubItemListBlockV2025R0 } from '@/schemas/v2025R0/hubItemListBlockV2025R0';
18
+ import { deserializeHubItemListBlockV2025R0 } from '@/schemas/v2025R0/hubItemListBlockV2025R0';
19
+ import { serializeHubDividerBlockV2025R0 } from '@/schemas/v2025R0/hubDividerBlockV2025R0';
20
+ import { deserializeHubDividerBlockV2025R0 } from '@/schemas/v2025R0/hubDividerBlockV2025R0';
21
+ import { serializeHubDocumentBlockEntryV2025R0 } from '@/schemas/v2025R0/hubDocumentBlockEntryV2025R0';
22
+ import { deserializeHubDocumentBlockEntryV2025R0 } from '@/schemas/v2025R0/hubDocumentBlockEntryV2025R0';
23
+ import { BoxClient } from '@/client';
24
+ import { HubV2025R0 } from '@/schemas/v2025R0/hubV2025R0';
25
+ import { HubCreateRequestV2025R0 } from '@/schemas/v2025R0/hubCreateRequestV2025R0';
26
+ import { HubDocumentPagesV2025R0 } from '@/schemas/v2025R0/hubDocumentPagesV2025R0';
27
+ import { GetHubDocumentPagesV2025R0QueryParams } from '@/managers/hubDocument';
28
+ import { HubDocumentPageV2025R0 } from '@/schemas/v2025R0/hubDocumentPageV2025R0';
29
+ import { HubDocumentBlocksV2025R0 } from '@/schemas/v2025R0/hubDocumentBlocksV2025R0';
30
+ import { GetHubDocumentBlocksV2025R0QueryParams } from '@/managers/hubDocument';
31
+ import { HubParagraphTextBlockV2025R0 } from '@/schemas/v2025R0/hubParagraphTextBlockV2025R0';
32
+ import { HubSectionTitleTextBlockV2025R0 } from '@/schemas/v2025R0/hubSectionTitleTextBlockV2025R0';
33
+ import { HubCalloutBoxTextBlockV2025R0 } from '@/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0';
34
+ import { HubItemListBlockV2025R0 } from '@/schemas/v2025R0/hubItemListBlockV2025R0';
35
+ import { HubDividerBlockV2025R0 } from '@/schemas/v2025R0/hubDividerBlockV2025R0';
36
+ import { HubDocumentBlockEntryV2025R0 } from '@/schemas/v2025R0/hubDocumentBlockEntryV2025R0';
37
+ import { getDefaultClientWithUserSubject } from './commons';
38
+ import { getEnvVar } from '@/internal/utils';
39
+ import { getUuid } from '@/internal/utils';
40
+ import { toString } from '@/internal/utils';
41
+ import { sdToJson } from '@/serialization/json';
42
+ import { SerializedData } from '@/serialization/json';
43
+ import { sdIsEmpty } from '@/serialization/json';
44
+ import { sdIsBoolean } from '@/serialization/json';
45
+ import { sdIsNumber } from '@/serialization/json';
46
+ import { sdIsString } from '@/serialization/json';
47
+ import { sdIsList } from '@/serialization/json';
48
+ import { sdIsMap } from '@/serialization/json';
49
+ export const client: BoxClient = getDefaultClientWithUserSubject(
50
+ getEnvVar('USER_ID'),
51
+ );
52
+ test('testGetHubDocumentPagesAndBlocks', async function testGetHubDocumentPagesAndBlocks(): Promise<any> {
53
+ const hubTitle: string = getUuid();
54
+ const createdHub: HubV2025R0 = await client.hubs.createHubV2025R0({
55
+ title: hubTitle,
56
+ } satisfies HubCreateRequestV2025R0);
57
+ const hubId: string = createdHub.id;
58
+ const pages: HubDocumentPagesV2025R0 =
59
+ await client.hubDocument.getHubDocumentPagesV2025R0({
60
+ hubId: hubId,
61
+ } satisfies GetHubDocumentPagesV2025R0QueryParams);
62
+ if (!(pages.entries.length > 0)) {
63
+ throw new Error('Assertion failed');
64
+ }
65
+ if (!((toString(pages.type) as string) == 'document_pages')) {
66
+ throw new Error('Assertion failed');
67
+ }
68
+ const firstPage: HubDocumentPageV2025R0 = pages.entries[0];
69
+ if (!((toString(firstPage.type) as string) == 'page')) {
70
+ throw new Error('Assertion failed');
71
+ }
72
+ const pageId: string = firstPage.id;
73
+ const blocks: HubDocumentBlocksV2025R0 =
74
+ await client.hubDocument.getHubDocumentBlocksV2025R0({
75
+ hubId: hubId,
76
+ pageId: pageId,
77
+ } satisfies GetHubDocumentBlocksV2025R0QueryParams);
78
+ if (!((toString(blocks.type) as string) == 'document_blocks')) {
79
+ throw new Error('Assertion failed');
80
+ }
81
+ if (!(blocks.entries.length > 0)) {
82
+ throw new Error('Assertion failed');
83
+ }
84
+ const firstBlock: HubDocumentBlockEntryV2025R0 = blocks
85
+ .entries![0] as HubDocumentBlockEntryV2025R0;
86
+ if (!((toString(firstBlock.type!) as string) == 'item_list')) {
87
+ throw new Error('Assertion failed');
88
+ }
89
+ await client.hubs.deleteHubByIdV2025R0(hubId);
90
+ });
91
+ export {};