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.
- package/lib/bundle.js +771 -16
- package/lib/bundle.js.map +1 -1
- package/lib/client.d.ts +10 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +16 -0
- package/lib/client.js.map +1 -1
- package/lib/managers/archives.d.ts +4 -0
- package/lib/managers/archives.d.ts.map +1 -1
- package/lib/managers/archives.js +4 -0
- package/lib/managers/archives.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/boxNetworkClient.d.ts.map +1 -1
- package/lib/networking/boxNetworkClient.js +61 -6
- package/lib/networking/boxNetworkClient.js.map +1 -1
- package/lib/networking/network.d.ts +10 -1
- package/lib/networking/network.d.ts.map +1 -1
- package/lib/networking/network.js +29 -0
- package/lib/networking/network.js.map +1 -1
- package/lib/networking/timeoutConfig.d.ts +4 -0
- package/lib/networking/timeoutConfig.d.ts.map +1 -0
- package/lib/networking/timeoutConfig.js +3 -0
- package/lib/networking/timeoutConfig.js.map +1 -0
- 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 +9 -9
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +9 -9
- 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/hubUpdateRequestV2025R0.d.ts +3 -0
- package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.js +11 -0
- package/lib/schemas/v2025R0/hubUpdateRequestV2025R0.js.map +1 -1
- package/lib/schemas/v2025R0/hubV2025R0.d.ts +1 -0
- package/lib/schemas/v2025R0/hubV2025R0.d.ts.map +1 -1
- package/lib/schemas/v2025R0/hubV2025R0.js +14 -0
- package/lib/schemas/v2025R0/hubV2025R0.js.map +1 -1
- 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 +10 -1
- package/lib-esm/client.js +17 -0
- package/lib-esm/client.js.map +1 -1
- package/lib-esm/managers/archives.d.ts +4 -0
- package/lib-esm/managers/archives.js +4 -0
- package/lib-esm/managers/archives.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/boxNetworkClient.js +67 -6
- package/lib-esm/networking/boxNetworkClient.js.map +1 -1
- package/lib-esm/networking/network.d.ts +10 -1
- package/lib-esm/networking/network.js +30 -0
- package/lib-esm/networking/network.js.map +1 -1
- package/lib-esm/networking/timeoutConfig.d.ts +3 -0
- package/lib-esm/networking/timeoutConfig.js +2 -0
- package/lib-esm/networking/timeoutConfig.js.map +1 -0
- 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 +9 -9
- package/lib-esm/schemas/index.js +9 -9
- 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/hubUpdateRequestV2025R0.d.ts +3 -0
- package/lib-esm/schemas/v2025R0/hubUpdateRequestV2025R0.js +11 -0
- package/lib-esm/schemas/v2025R0/hubUpdateRequestV2025R0.js.map +1 -1
- package/lib-esm/schemas/v2025R0/hubV2025R0.d.ts +1 -0
- package/lib-esm/schemas/v2025R0/hubV2025R0.js +15 -0
- package/lib-esm/schemas/v2025R0/hubV2025R0.js.map +1 -1
- 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 +20 -0
- package/src/managers/archives.ts +4 -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/boxNetworkClient.ts +82 -13
- package/src/networking/network.ts +33 -0
- package/src/networking/timeoutConfig.ts +3 -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 +9 -9
- 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/hubUpdateRequestV2025R0.ts +18 -0
- package/src/schemas/v2025R0/hubV2025R0.ts +19 -0
- package/src/schemas/v2025R0/index.ts +10 -0
- package/src/test/archives.test.ts +0 -1
- package/src/test/client.test.ts +17 -0
- package/src/test/hubDocument.test.ts +91 -0
|
@@ -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
|
}
|
package/src/schemas/index.ts
CHANGED
|
@@ -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';
|
|
@@ -180,8 +181,8 @@ export * from './skillCard';
|
|
|
180
181
|
export * from './skillCardsMetadata';
|
|
181
182
|
export * from './uploadPartMini';
|
|
182
183
|
export * from './uploadPart';
|
|
183
|
-
export * from './uploadedPart';
|
|
184
184
|
export * from './uploadParts';
|
|
185
|
+
export * from './uploadedPart';
|
|
185
186
|
export * from './uploadSession';
|
|
186
187
|
export * from './uploadUrl';
|
|
187
188
|
export * from './userBase';
|
|
@@ -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';
|
|
@@ -251,6 +256,9 @@ export * from './aiSingleAgentResponseFull';
|
|
|
251
256
|
export * from './aiMultipleAgentResponse';
|
|
252
257
|
export * from './userAvatar';
|
|
253
258
|
export * from './watermark';
|
|
259
|
+
export * from './webhookMini';
|
|
260
|
+
export * from './webhooks';
|
|
261
|
+
export * from './webhook';
|
|
254
262
|
export * from './webLinkBase';
|
|
255
263
|
export * from './webLinkMini';
|
|
256
264
|
export * from './webLink';
|
|
@@ -258,11 +266,6 @@ export * from './item';
|
|
|
258
266
|
export * from './itemsOffsetPaginated';
|
|
259
267
|
export * from './items';
|
|
260
268
|
export * from './folder';
|
|
261
|
-
export * from './legalHoldPolicyAssignedItem';
|
|
262
|
-
export * from './legalHoldPolicyAssignment';
|
|
263
|
-
export * from './legalHoldPolicyAssignments';
|
|
264
|
-
export * from './fileVersionLegalHold';
|
|
265
|
-
export * from './fileVersionLegalHolds';
|
|
266
269
|
export * from './folderFull';
|
|
267
270
|
export * from './searchResultWithSharedLinkItem';
|
|
268
271
|
export * from './searchResultWithSharedLink';
|
|
@@ -285,9 +288,6 @@ export * from './collaborations';
|
|
|
285
288
|
export * from './appItemAssociatedItem';
|
|
286
289
|
export * from './appItemAssociation';
|
|
287
290
|
export * from './appItemAssociations';
|
|
288
|
-
export * from './webhookMini';
|
|
289
|
-
export * from './webhooks';
|
|
290
|
-
export * from './webhook';
|
|
291
291
|
export * from './workflowMini';
|
|
292
292
|
export * from './workflow';
|
|
293
293
|
export * from './workflows';
|
|
@@ -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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
24
|
-
return
|
|
42
|
+
if (val == 'user') {
|
|
43
|
+
return val;
|
|
25
44
|
}
|
|
26
|
-
if (val
|
|
27
|
-
return
|
|
45
|
+
if (val == 'ownership') {
|
|
46
|
+
return val;
|
|
28
47
|
}
|
|
29
|
-
|
|
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 ==
|
|
40
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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.
|
|
46
|
-
|
|
85
|
+
if (!sdIsString(val.id)) {
|
|
86
|
+
throw new BoxSdkError({
|
|
87
|
+
message:
|
|
88
|
+
'Expecting string for "id" of type "LegalHoldPolicyAssignedItem"',
|
|
89
|
+
});
|
|
47
90
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
91
|
+
const id: string = val.id;
|
|
92
|
+
return { type: type, id: id } satisfies LegalHoldPolicyAssignedItem;
|
|
51
93
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { serializeLegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
|
|
2
2
|
import { deserializeLegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
|
|
3
|
-
import { serializeFile } from './file';
|
|
4
|
-
import { deserializeFile } from './file';
|
|
5
|
-
import { serializeFolder } from './folder';
|
|
6
|
-
import { deserializeFolder } from './folder';
|
|
7
|
-
import { serializeWebLink } from './webLink';
|
|
8
|
-
import { deserializeWebLink } from './webLink';
|
|
9
3
|
import { serializeLegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
|
|
10
4
|
import { deserializeLegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
|
|
11
5
|
import { serializeLegalHoldPolicyMini } from './legalHoldPolicyMini';
|
|
@@ -17,9 +11,6 @@ import { deserializeUserMini } from './userMini';
|
|
|
17
11
|
import { serializeDateTime } from '../internal/utils';
|
|
18
12
|
import { deserializeDateTime } from '../internal/utils';
|
|
19
13
|
import { LegalHoldPolicyAssignmentBaseTypeField } from './legalHoldPolicyAssignmentBase';
|
|
20
|
-
import { File } from './file';
|
|
21
|
-
import { Folder } from './folder';
|
|
22
|
-
import { WebLink } from './webLink';
|
|
23
14
|
import { LegalHoldPolicyAssignmentBase } from './legalHoldPolicyAssignmentBase';
|
|
24
15
|
import { LegalHoldPolicyMini } from './legalHoldPolicyMini';
|
|
25
16
|
import { LegalHoldPolicyAssignedItem } from './legalHoldPolicyAssignedItem';
|
|
@@ -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 HubCalloutBoxTextBlockV2025R0TypeField = 'callout_box';
|
|
13
|
+
export class HubCalloutBoxTextBlockV2025R0 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 `callout_box`. */
|
|
19
|
+
readonly type: HubCalloutBoxTextBlockV2025R0TypeField =
|
|
20
|
+
'callout_box' as HubCalloutBoxTextBlockV2025R0TypeField;
|
|
21
|
+
/**
|
|
22
|
+
* Text content of the block. Includes rich text formatting. */
|
|
23
|
+
readonly fragment!: string;
|
|
24
|
+
constructor(
|
|
25
|
+
fields: Omit<HubCalloutBoxTextBlockV2025R0, 'type'> &
|
|
26
|
+
Partial<Pick<HubCalloutBoxTextBlockV2025R0, '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 serializeHubCalloutBoxTextBlockV2025R0TypeField(
|
|
46
|
+
val: HubCalloutBoxTextBlockV2025R0TypeField,
|
|
47
|
+
): SerializedData {
|
|
48
|
+
return val;
|
|
49
|
+
}
|
|
50
|
+
export function deserializeHubCalloutBoxTextBlockV2025R0TypeField(
|
|
51
|
+
val: SerializedData,
|
|
52
|
+
): HubCalloutBoxTextBlockV2025R0TypeField {
|
|
53
|
+
if (val == 'callout_box') {
|
|
54
|
+
return val;
|
|
55
|
+
}
|
|
56
|
+
throw new BoxSdkError({
|
|
57
|
+
message: "Can't deserialize HubCalloutBoxTextBlockV2025R0TypeField",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function serializeHubCalloutBoxTextBlockV2025R0(
|
|
61
|
+
val: HubCalloutBoxTextBlockV2025R0,
|
|
62
|
+
): SerializedData {
|
|
63
|
+
const base: any = serializeHubDocumentBlockV2025R0(val);
|
|
64
|
+
if (!sdIsMap(base)) {
|
|
65
|
+
throw new BoxSdkError({
|
|
66
|
+
message: 'Expecting a map for "HubCalloutBoxTextBlockV2025R0"',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
...base,
|
|
71
|
+
...{
|
|
72
|
+
['type']: serializeHubCalloutBoxTextBlockV2025R0TypeField(val.type),
|
|
73
|
+
['fragment']: val.fragment,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function deserializeHubCalloutBoxTextBlockV2025R0(
|
|
78
|
+
val: SerializedData,
|
|
79
|
+
): HubCalloutBoxTextBlockV2025R0 {
|
|
80
|
+
if (!sdIsMap(val)) {
|
|
81
|
+
throw new BoxSdkError({
|
|
82
|
+
message: 'Expecting a map for "HubCalloutBoxTextBlockV2025R0"',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (val.type == void 0) {
|
|
86
|
+
throw new BoxSdkError({
|
|
87
|
+
message:
|
|
88
|
+
'Expecting "type" of type "HubCalloutBoxTextBlockV2025R0" to be defined',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const type: HubCalloutBoxTextBlockV2025R0TypeField =
|
|
92
|
+
deserializeHubCalloutBoxTextBlockV2025R0TypeField(val.type);
|
|
93
|
+
if (val.fragment == void 0) {
|
|
94
|
+
throw new BoxSdkError({
|
|
95
|
+
message:
|
|
96
|
+
'Expecting "fragment" of type "HubCalloutBoxTextBlockV2025R0" to be defined',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (!sdIsString(val.fragment)) {
|
|
100
|
+
throw new BoxSdkError({
|
|
101
|
+
message:
|
|
102
|
+
'Expecting string for "fragment" of type "HubCalloutBoxTextBlockV2025R0"',
|
|
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 "HubCalloutBoxTextBlockV2025R0" to be defined',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (!sdIsString(val.id)) {
|
|
113
|
+
throw new BoxSdkError({
|
|
114
|
+
message:
|
|
115
|
+
'Expecting string for "id" of type "HubCalloutBoxTextBlockV2025R0"',
|
|
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 "HubCalloutBoxTextBlockV2025R0"',
|
|
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 HubCalloutBoxTextBlockV2025R0;
|
|
133
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
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 HubDividerBlockV2025R0TypeField = 'divider';
|
|
13
|
+
export class HubDividerBlockV2025R0 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 `divider`. */
|
|
19
|
+
readonly type: HubDividerBlockV2025R0TypeField =
|
|
20
|
+
'divider' as HubDividerBlockV2025R0TypeField;
|
|
21
|
+
constructor(
|
|
22
|
+
fields: Omit<HubDividerBlockV2025R0, 'type'> &
|
|
23
|
+
Partial<Pick<HubDividerBlockV2025R0, 'type'>>,
|
|
24
|
+
) {
|
|
25
|
+
if (fields.id !== undefined) {
|
|
26
|
+
this.id = fields.id;
|
|
27
|
+
}
|
|
28
|
+
if (fields.parentId !== undefined) {
|
|
29
|
+
this.parentId = fields.parentId;
|
|
30
|
+
}
|
|
31
|
+
if (fields.rawData !== undefined) {
|
|
32
|
+
this.rawData = fields.rawData;
|
|
33
|
+
}
|
|
34
|
+
if (fields.type !== undefined) {
|
|
35
|
+
this.type = fields.type;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function serializeHubDividerBlockV2025R0TypeField(
|
|
40
|
+
val: HubDividerBlockV2025R0TypeField,
|
|
41
|
+
): SerializedData {
|
|
42
|
+
return val;
|
|
43
|
+
}
|
|
44
|
+
export function deserializeHubDividerBlockV2025R0TypeField(
|
|
45
|
+
val: SerializedData,
|
|
46
|
+
): HubDividerBlockV2025R0TypeField {
|
|
47
|
+
if (val == 'divider') {
|
|
48
|
+
return val;
|
|
49
|
+
}
|
|
50
|
+
throw new BoxSdkError({
|
|
51
|
+
message: "Can't deserialize HubDividerBlockV2025R0TypeField",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function serializeHubDividerBlockV2025R0(
|
|
55
|
+
val: HubDividerBlockV2025R0,
|
|
56
|
+
): SerializedData {
|
|
57
|
+
const base: any = serializeHubDocumentBlockV2025R0(val);
|
|
58
|
+
if (!sdIsMap(base)) {
|
|
59
|
+
throw new BoxSdkError({
|
|
60
|
+
message: 'Expecting a map for "HubDividerBlockV2025R0"',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
...base,
|
|
65
|
+
...{ ['type']: serializeHubDividerBlockV2025R0TypeField(val.type) },
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function deserializeHubDividerBlockV2025R0(
|
|
69
|
+
val: SerializedData,
|
|
70
|
+
): HubDividerBlockV2025R0 {
|
|
71
|
+
if (!sdIsMap(val)) {
|
|
72
|
+
throw new BoxSdkError({
|
|
73
|
+
message: 'Expecting a map for "HubDividerBlockV2025R0"',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (val.type == void 0) {
|
|
77
|
+
throw new BoxSdkError({
|
|
78
|
+
message:
|
|
79
|
+
'Expecting "type" of type "HubDividerBlockV2025R0" to be defined',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const type: HubDividerBlockV2025R0TypeField =
|
|
83
|
+
deserializeHubDividerBlockV2025R0TypeField(val.type);
|
|
84
|
+
if (val.id == void 0) {
|
|
85
|
+
throw new BoxSdkError({
|
|
86
|
+
message: 'Expecting "id" of type "HubDividerBlockV2025R0" to be defined',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (!sdIsString(val.id)) {
|
|
90
|
+
throw new BoxSdkError({
|
|
91
|
+
message: 'Expecting string for "id" of type "HubDividerBlockV2025R0"',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const id: string = val.id;
|
|
95
|
+
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
|
|
96
|
+
throw new BoxSdkError({
|
|
97
|
+
message:
|
|
98
|
+
'Expecting string for "parent_id" of type "HubDividerBlockV2025R0"',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const parentId: undefined | string =
|
|
102
|
+
val.parent_id == void 0 ? void 0 : val.parent_id;
|
|
103
|
+
return {
|
|
104
|
+
type: type,
|
|
105
|
+
id: id,
|
|
106
|
+
parentId: parentId,
|
|
107
|
+
} satisfies HubDividerBlockV2025R0;
|
|
108
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { serializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
|
|
2
|
+
import { deserializeHubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
|
|
3
|
+
import { serializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
|
|
4
|
+
import { deserializeHubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
|
|
5
|
+
import { serializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
|
|
6
|
+
import { deserializeHubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
|
|
7
|
+
import { serializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
|
|
8
|
+
import { deserializeHubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
|
|
9
|
+
import { serializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
|
|
10
|
+
import { deserializeHubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
|
|
11
|
+
import { HubParagraphTextBlockV2025R0 } from './hubParagraphTextBlockV2025R0';
|
|
12
|
+
import { HubSectionTitleTextBlockV2025R0 } from './hubSectionTitleTextBlockV2025R0';
|
|
13
|
+
import { HubCalloutBoxTextBlockV2025R0 } from './hubCalloutBoxTextBlockV2025R0';
|
|
14
|
+
import { HubItemListBlockV2025R0 } from './hubItemListBlockV2025R0';
|
|
15
|
+
import { HubDividerBlockV2025R0 } from './hubDividerBlockV2025R0';
|
|
16
|
+
import { BoxSdkError } from '../../box/errors';
|
|
17
|
+
import { SerializedData } from '../../serialization/json';
|
|
18
|
+
import { sdIsEmpty } from '../../serialization/json';
|
|
19
|
+
import { sdIsBoolean } from '../../serialization/json';
|
|
20
|
+
import { sdIsNumber } from '../../serialization/json';
|
|
21
|
+
import { sdIsString } from '../../serialization/json';
|
|
22
|
+
import { sdIsList } from '../../serialization/json';
|
|
23
|
+
import { sdIsMap } from '../../serialization/json';
|
|
24
|
+
export type HubDocumentBlockEntryV2025R0 =
|
|
25
|
+
| HubParagraphTextBlockV2025R0
|
|
26
|
+
| HubSectionTitleTextBlockV2025R0
|
|
27
|
+
| HubCalloutBoxTextBlockV2025R0
|
|
28
|
+
| HubItemListBlockV2025R0
|
|
29
|
+
| HubDividerBlockV2025R0;
|
|
30
|
+
export function serializeHubDocumentBlockEntryV2025R0(
|
|
31
|
+
val: any,
|
|
32
|
+
): SerializedData {
|
|
33
|
+
if (val.type == 'paragraph') {
|
|
34
|
+
return serializeHubParagraphTextBlockV2025R0(val);
|
|
35
|
+
}
|
|
36
|
+
if (val.type == 'section_title') {
|
|
37
|
+
return serializeHubSectionTitleTextBlockV2025R0(val);
|
|
38
|
+
}
|
|
39
|
+
if (val.type == 'callout_box') {
|
|
40
|
+
return serializeHubCalloutBoxTextBlockV2025R0(val);
|
|
41
|
+
}
|
|
42
|
+
if (val.type == 'item_list') {
|
|
43
|
+
return serializeHubItemListBlockV2025R0(val);
|
|
44
|
+
}
|
|
45
|
+
if (val.type == 'divider') {
|
|
46
|
+
return serializeHubDividerBlockV2025R0(val);
|
|
47
|
+
}
|
|
48
|
+
throw new BoxSdkError({ message: 'unknown type' });
|
|
49
|
+
}
|
|
50
|
+
export function deserializeHubDocumentBlockEntryV2025R0(
|
|
51
|
+
val: SerializedData,
|
|
52
|
+
): HubDocumentBlockEntryV2025R0 {
|
|
53
|
+
if (!sdIsMap(val)) {
|
|
54
|
+
throw new BoxSdkError({
|
|
55
|
+
message: 'Expecting a map for "HubDocumentBlockEntryV2025R0"',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (val.type == 'paragraph') {
|
|
59
|
+
return deserializeHubParagraphTextBlockV2025R0(val);
|
|
60
|
+
}
|
|
61
|
+
if (val.type == 'section_title') {
|
|
62
|
+
return deserializeHubSectionTitleTextBlockV2025R0(val);
|
|
63
|
+
}
|
|
64
|
+
if (val.type == 'callout_box') {
|
|
65
|
+
return deserializeHubCalloutBoxTextBlockV2025R0(val);
|
|
66
|
+
}
|
|
67
|
+
if (val.type == 'item_list') {
|
|
68
|
+
return deserializeHubItemListBlockV2025R0(val);
|
|
69
|
+
}
|
|
70
|
+
if (val.type == 'divider') {
|
|
71
|
+
return deserializeHubDividerBlockV2025R0(val);
|
|
72
|
+
}
|
|
73
|
+
throw new BoxSdkError({
|
|
74
|
+
message: "Can't deserialize HubDocumentBlockEntryV2025R0",
|
|
75
|
+
});
|
|
76
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BoxSdkError } from '../../box/errors';
|
|
2
|
+
import { SerializedData } from '../../serialization/json';
|
|
3
|
+
import { sdIsEmpty } from '../../serialization/json';
|
|
4
|
+
import { sdIsBoolean } from '../../serialization/json';
|
|
5
|
+
import { sdIsNumber } from '../../serialization/json';
|
|
6
|
+
import { sdIsString } from '../../serialization/json';
|
|
7
|
+
import { sdIsList } from '../../serialization/json';
|
|
8
|
+
import { sdIsMap } from '../../serialization/json';
|
|
9
|
+
export interface HubDocumentBlockV2025R0 {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier for this block. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The unique identifier of the parent block. Null for direct children of the page. */
|
|
15
|
+
readonly parentId?: string | null;
|
|
16
|
+
readonly rawData?: SerializedData;
|
|
17
|
+
}
|
|
18
|
+
export function serializeHubDocumentBlockV2025R0(
|
|
19
|
+
val: HubDocumentBlockV2025R0,
|
|
20
|
+
): SerializedData {
|
|
21
|
+
return { ['id']: val.id, ['parent_id']: val.parentId };
|
|
22
|
+
}
|
|
23
|
+
export function deserializeHubDocumentBlockV2025R0(
|
|
24
|
+
val: SerializedData,
|
|
25
|
+
): HubDocumentBlockV2025R0 {
|
|
26
|
+
if (!sdIsMap(val)) {
|
|
27
|
+
throw new BoxSdkError({
|
|
28
|
+
message: 'Expecting a map for "HubDocumentBlockV2025R0"',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (val.id == void 0) {
|
|
32
|
+
throw new BoxSdkError({
|
|
33
|
+
message: 'Expecting "id" of type "HubDocumentBlockV2025R0" to be defined',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (!sdIsString(val.id)) {
|
|
37
|
+
throw new BoxSdkError({
|
|
38
|
+
message: 'Expecting string for "id" of type "HubDocumentBlockV2025R0"',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const id: string = val.id;
|
|
42
|
+
if (!(val.parent_id == void 0) && !sdIsString(val.parent_id)) {
|
|
43
|
+
throw new BoxSdkError({
|
|
44
|
+
message:
|
|
45
|
+
'Expecting string for "parent_id" of type "HubDocumentBlockV2025R0"',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const parentId: undefined | string =
|
|
49
|
+
val.parent_id == void 0 ? void 0 : val.parent_id;
|
|
50
|
+
return { id: id, parentId: parentId } satisfies HubDocumentBlockV2025R0;
|
|
51
|
+
}
|