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,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
+ }
@@ -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';
@@ -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 {};