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.
- package/lib/bundle.js +655 -10
- package/lib/bundle.js.map +1 -1
- package/lib/client.d.ts +3 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +5 -0
- package/lib/client.js.map +1 -1
- package/lib/managers/hubDocument.d.ts +133 -0
- package/lib/managers/hubDocument.d.ts.map +1 -0
- package/lib/managers/hubDocument.js +162 -0
- package/lib/managers/hubDocument.js.map +1 -0
- package/lib/managers/hubItems.d.ts +7 -0
- package/lib/managers/hubItems.d.ts.map +1 -1
- package/lib/managers/hubItems.js +1 -0
- package/lib/managers/hubItems.js.map +1 -1
- package/lib/managers/index.d.ts +1 -0
- package/lib/managers/index.d.ts.map +1 -1
- package/lib/managers/index.js +1 -0
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/search.d.ts +1 -1
- package/lib/managers/search.d.ts.map +1 -1
- package/lib/managers/search.js +1 -1
- package/lib/managers/search.js.map +1 -1
- package/lib/managers/trashedItems.d.ts +2 -0
- package/lib/managers/trashedItems.d.ts.map +1 -1
- package/lib/managers/trashedItems.js +2 -0
- package/lib/managers/trashedItems.js.map +1 -1
- package/lib/networking/version.d.ts +1 -1
- package/lib/networking/version.js +1 -1
- package/lib/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
- package/lib/schemas/aiAgentBasicTextToolBase.d.ts.map +1 -1
- package/lib/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
- package/lib/schemas/aiAgentSpreadsheetTool.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructured.d.ts +3 -0
- package/lib/schemas/aiExtractStructured.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructured.js +9 -0
- package/lib/schemas/aiExtractStructured.js.map +1 -1
- package/lib/schemas/aiExtractStructuredResponse.d.ts +5 -0
- package/lib/schemas/aiExtractStructuredResponse.d.ts.map +1 -1
- package/lib/schemas/aiExtractStructuredResponse.js +24 -0
- package/lib/schemas/aiExtractStructuredResponse.js.map +1 -1
- package/lib/schemas/index.d.ts +5 -5
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +5 -5
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
- package/lib/schemas/legalHoldPolicyAssignedItem.d.ts.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignedItem.js +47 -24
- package/lib/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignment.d.ts.map +1 -1
- package/lib/schemas/legalHoldPolicyAssignment.js.map +1 -1
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +17 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js +87 -0
- package/lib/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +10 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +60 -0
- package/lib/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +13 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js +36 -0
- package/lib/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +45 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js +162 -0
- package/lib/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +19 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js +68 -0
- package/lib/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +45 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js +162 -0
- package/lib/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +17 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js +87 -0
- package/lib/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
- package/lib/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
- package/lib/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +20 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts.map +1 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +105 -0
- package/lib/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
- package/lib/schemas/v2025R0/index.d.ts +10 -0
- package/lib/schemas/v2025R0/index.d.ts.map +1 -1
- package/lib/schemas/v2025R0/index.js +10 -0
- package/lib/schemas/v2025R0/index.js.map +1 -1
- package/lib-esm/client.d.ts +3 -1
- package/lib-esm/client.js +6 -0
- package/lib-esm/client.js.map +1 -1
- package/lib-esm/managers/hubDocument.d.ts +132 -0
- package/lib-esm/managers/hubDocument.js +154 -0
- package/lib-esm/managers/hubDocument.js.map +1 -0
- package/lib-esm/managers/hubItems.d.ts +7 -0
- package/lib-esm/managers/hubItems.js +1 -0
- package/lib-esm/managers/hubItems.js.map +1 -1
- package/lib-esm/managers/index.d.ts +1 -0
- package/lib-esm/managers/index.js +1 -0
- package/lib-esm/managers/index.js.map +1 -1
- package/lib-esm/managers/search.d.ts +1 -1
- package/lib-esm/managers/search.js +1 -1
- package/lib-esm/managers/search.js.map +1 -1
- package/lib-esm/managers/trashedItems.d.ts +2 -0
- package/lib-esm/managers/trashedItems.js +2 -0
- package/lib-esm/managers/trashedItems.js.map +1 -1
- package/lib-esm/networking/version.d.ts +1 -1
- package/lib-esm/networking/version.js +1 -1
- package/lib-esm/schemas/aiAgentBasicTextToolBase.d.ts +1 -1
- package/lib-esm/schemas/aiAgentSpreadsheetTool.d.ts +1 -1
- package/lib-esm/schemas/aiExtractStructured.d.ts +3 -0
- package/lib-esm/schemas/aiExtractStructured.js +9 -0
- package/lib-esm/schemas/aiExtractStructured.js.map +1 -1
- package/lib-esm/schemas/aiExtractStructuredResponse.d.ts +5 -0
- package/lib-esm/schemas/aiExtractStructuredResponse.js +24 -0
- package/lib-esm/schemas/aiExtractStructuredResponse.js.map +1 -1
- package/lib-esm/schemas/index.d.ts +5 -5
- package/lib-esm/schemas/index.js +5 -5
- package/lib-esm/schemas/index.js.map +1 -1
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.d.ts +13 -5
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.js +44 -23
- package/lib-esm/schemas/legalHoldPolicyAssignedItem.js.map +1 -1
- package/lib-esm/schemas/legalHoldPolicyAssignment.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.d.ts +16 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js +85 -0
- package/lib-esm/schemas/v2025R0/hubDividerBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.d.ts +9 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js +56 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockEntryV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.d.ts +12 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js +32 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.d.ts +44 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js +164 -0
- package/lib-esm/schemas/v2025R0/hubDocumentBlocksV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.d.ts +18 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js +64 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPageV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.d.ts +44 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js +164 -0
- package/lib-esm/schemas/v2025R0/hubDocumentPagesV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.d.ts +16 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js +85 -0
- package/lib-esm/schemas/v2025R0/hubItemListBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.d.ts +3 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js +8 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationResultV2025R0.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.d.ts +3 -0
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js +12 -1
- package/lib-esm/schemas/v2025R0/hubItemOperationV2025R0.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubParagraphTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.d.ts +19 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js +106 -0
- package/lib-esm/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.js.map +1 -0
- package/lib-esm/schemas/v2025R0/index.d.ts +10 -0
- package/lib-esm/schemas/v2025R0/index.js +10 -0
- package/lib-esm/schemas/v2025R0/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +7 -0
- package/src/managers/hubDocument.ts +330 -0
- package/src/managers/hubItems.ts +8 -0
- package/src/managers/index.ts +1 -0
- package/src/managers/search.ts +2 -2
- package/src/managers/trashedItems.ts +2 -0
- package/src/networking/version.ts +1 -1
- package/src/schemas/aiAgentBasicTextToolBase.ts +1 -1
- package/src/schemas/aiAgentSpreadsheetTool.ts +1 -1
- package/src/schemas/aiExtractStructured.ts +16 -0
- package/src/schemas/aiExtractStructuredResponse.ts +44 -0
- package/src/schemas/index.ts +5 -5
- package/src/schemas/legalHoldPolicyAssignedItem.ts +69 -27
- package/src/schemas/legalHoldPolicyAssignment.ts +0 -9
- package/src/schemas/v2025R0/hubCalloutBoxTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/hubDividerBlockV2025R0.ts +108 -0
- package/src/schemas/v2025R0/hubDocumentBlockEntryV2025R0.ts +76 -0
- package/src/schemas/v2025R0/hubDocumentBlockV2025R0.ts +51 -0
- package/src/schemas/v2025R0/hubDocumentBlocksV2025R0.ts +238 -0
- package/src/schemas/v2025R0/hubDocumentPageV2025R0.ts +92 -0
- package/src/schemas/v2025R0/hubDocumentPagesV2025R0.ts +218 -0
- package/src/schemas/v2025R0/hubItemListBlockV2025R0.ts +108 -0
- package/src/schemas/v2025R0/hubItemOperationResultV2025R0.ts +13 -0
- package/src/schemas/v2025R0/hubItemOperationV2025R0.ts +17 -1
- package/src/schemas/v2025R0/hubParagraphTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/hubSectionTitleTextBlockV2025R0.ts +133 -0
- package/src/schemas/v2025R0/index.ts +10 -0
- 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 {};
|