@azure/ai-content-understanding 1.0.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/LICENSE +21 -0
- package/README.md +591 -0
- package/dist/browser/api/contentUnderstandingContext.d.ts +15 -0
- package/dist/browser/api/contentUnderstandingContext.js +27 -0
- package/dist/browser/api/contentUnderstandingContext.js.map +1 -0
- package/dist/browser/api/index.d.ts +4 -0
- package/dist/browser/api/index.js +5 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/operations.d.ts +67 -0
- package/dist/browser/api/operations.js +488 -0
- package/dist/browser/api/operations.js.map +1 -0
- package/dist/browser/api/options.d.ts +94 -0
- package/dist/browser/api/options.js +4 -0
- package/dist/browser/api/options.js.map +1 -0
- package/dist/browser/contentUnderstandingClient.d.ts +65 -0
- package/dist/browser/contentUnderstandingClient.js +161 -0
- package/dist/browser/contentUnderstandingClient.js.map +1 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +846 -0
- package/dist/browser/models/models.js +1005 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/browser/static-helpers/pagingHelpers.js +143 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/browser/static-helpers/pollingHelpers.js +95 -0
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/serialization/get-binary-response-browser.mjs.map +1 -0
- package/dist/browser/static-helpers/serialization/get-binary-response.d.ts +10 -0
- package/dist/browser/static-helpers/serialization/get-binary-response.js +19 -0
- package/dist/browser/static-helpers/serialization/serialize-record.d.ts +2 -0
- package/dist/browser/static-helpers/serialization/serialize-record.js +22 -0
- package/dist/browser/static-helpers/serialization/serialize-record.js.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +200 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/api/contentUnderstandingContext.d.ts +15 -0
- package/dist/commonjs/api/contentUnderstandingContext.js +30 -0
- package/dist/commonjs/api/contentUnderstandingContext.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +4 -0
- package/dist/commonjs/api/index.js +24 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/api/operations.d.ts +67 -0
- package/dist/commonjs/api/operations.js +535 -0
- package/dist/commonjs/api/operations.js.map +1 -0
- package/dist/commonjs/api/options.d.ts +94 -0
- package/dist/commonjs/api/options.js +5 -0
- package/dist/commonjs/api/options.js.map +1 -0
- package/dist/commonjs/contentUnderstandingClient.d.ts +65 -0
- package/dist/commonjs/contentUnderstandingClient.js +160 -0
- package/dist/commonjs/contentUnderstandingClient.js.map +1 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.js +19 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.js +8 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +846 -0
- package/dist/commonjs/models/models.js +1103 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +146 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js +98 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/serialization/get-binary-response.d.ts +10 -0
- package/dist/commonjs/static-helpers/serialization/get-binary-response.js +26 -0
- package/dist/commonjs/static-helpers/serialization/get-binary-response.js.map +1 -0
- package/dist/commonjs/static-helpers/serialization/serialize-record.d.ts +2 -0
- package/dist/commonjs/static-helpers/serialization/serialize-record.js +25 -0
- package/dist/commonjs/static-helpers/serialization/serialize-record.js.map +1 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +203 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/api/contentUnderstandingContext.d.ts +15 -0
- package/dist/esm/api/contentUnderstandingContext.js +27 -0
- package/dist/esm/api/contentUnderstandingContext.js.map +1 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/api/index.js +5 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/operations.d.ts +67 -0
- package/dist/esm/api/operations.js +488 -0
- package/dist/esm/api/operations.js.map +1 -0
- package/dist/esm/api/options.d.ts +94 -0
- package/dist/esm/api/options.js +4 -0
- package/dist/esm/api/options.js.map +1 -0
- package/dist/esm/contentUnderstandingClient.d.ts +65 -0
- package/dist/esm/contentUnderstandingClient.js +161 -0
- package/dist/esm/contentUnderstandingClient.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +846 -0
- package/dist/esm/models/models.js +1005 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/esm/static-helpers/pagingHelpers.js +143 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/esm/static-helpers/pollingHelpers.js +95 -0
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/serialization/get-binary-response.d.ts +10 -0
- package/dist/esm/static-helpers/serialization/get-binary-response.js +23 -0
- package/dist/esm/static-helpers/serialization/get-binary-response.js.map +1 -0
- package/dist/esm/static-helpers/serialization/serialize-record.d.ts +2 -0
- package/dist/esm/static-helpers/serialization/serialize-record.js +22 -0
- package/dist/esm/static-helpers/serialization/serialize-record.js.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +200 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/api/contentUnderstandingContext.d.ts +15 -0
- package/dist/react-native/api/contentUnderstandingContext.js +27 -0
- package/dist/react-native/api/contentUnderstandingContext.js.map +1 -0
- package/dist/react-native/api/index.d.ts +4 -0
- package/dist/react-native/api/index.js +5 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/operations.d.ts +67 -0
- package/dist/react-native/api/operations.js +488 -0
- package/dist/react-native/api/operations.js.map +1 -0
- package/dist/react-native/api/options.d.ts +94 -0
- package/dist/react-native/api/options.js +4 -0
- package/dist/react-native/api/options.js.map +1 -0
- package/dist/react-native/contentUnderstandingClient.d.ts +65 -0
- package/dist/react-native/contentUnderstandingClient.js +161 -0
- package/dist/react-native/contentUnderstandingClient.js.map +1 -0
- package/dist/react-native/index.d.ts +6 -0
- package/dist/react-native/index.js +14 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models/index.d.ts +2 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +846 -0
- package/dist/react-native/models/models.js +1005 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +143 -0
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/react-native/static-helpers/pollingHelpers.js +95 -0
- package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/serialization/get-binary-response.d.ts +10 -0
- package/dist/react-native/static-helpers/serialization/get-binary-response.js +23 -0
- package/dist/react-native/static-helpers/serialization/get-binary-response.js.map +1 -0
- package/dist/react-native/static-helpers/serialization/serialize-record.d.ts +2 -0
- package/dist/react-native/static-helpers/serialization/serialize-record.js +22 -0
- package/dist/react-native/static-helpers/serialization/serialize-record.js.map +1 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.js +200 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/package.json +180 -0
|
@@ -0,0 +1,1005 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { serializeRecord } from "../static-helpers/serialization/serialize-record.js";
|
|
4
|
+
import { uint8ArrayToString } from "@azure/core-util";
|
|
5
|
+
export function analysisInputSerializer(item) {
|
|
6
|
+
return {
|
|
7
|
+
url: item["url"],
|
|
8
|
+
data: !item["data"] ? item["data"] : uint8ArrayToString(item["data"], "base64"),
|
|
9
|
+
name: item["name"],
|
|
10
|
+
mimeType: item["mimeType"],
|
|
11
|
+
range: item["contentRange"],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function analysisInputArraySerializer(result) {
|
|
15
|
+
return result.map((item) => {
|
|
16
|
+
return analysisInputSerializer(item);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function contentAnalyzerAnalyzeOperationStatusDeserializer(item) {
|
|
20
|
+
return {
|
|
21
|
+
id: item["id"],
|
|
22
|
+
status: item["status"],
|
|
23
|
+
error: !item["error"] ? item["error"] : item["error"],
|
|
24
|
+
result: !item["result"] ? item["result"] : analysisResultDeserializer(item["result"]),
|
|
25
|
+
usage: !item["usage"] ? item["usage"] : usageDetailsDeserializer(item["usage"]),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function analysisResultDeserializer(item) {
|
|
29
|
+
return {
|
|
30
|
+
analyzerId: item["analyzerId"],
|
|
31
|
+
apiVersion: item["apiVersion"],
|
|
32
|
+
createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]),
|
|
33
|
+
warnings: !item["warnings"]
|
|
34
|
+
? item["warnings"]
|
|
35
|
+
: item["warnings"].map((p) => {
|
|
36
|
+
return p;
|
|
37
|
+
}),
|
|
38
|
+
stringEncoding: item["stringEncoding"],
|
|
39
|
+
contents: analysisContentUnionArrayDeserializer(item["contents"]),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function analysisContentUnionArrayDeserializer(result) {
|
|
43
|
+
return result.map((item) => {
|
|
44
|
+
return analysisContentUnionDeserializer(item);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function analysisContentDeserializer(item) {
|
|
48
|
+
return {
|
|
49
|
+
kind: item["kind"],
|
|
50
|
+
mimeType: item["mimeType"],
|
|
51
|
+
analyzerId: item["analyzerId"],
|
|
52
|
+
category: item["category"],
|
|
53
|
+
path: item["path"],
|
|
54
|
+
markdown: item["markdown"],
|
|
55
|
+
fields: !item["fields"] ? item["fields"] : contentFieldUnionRecordDeserializer(item["fields"]),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function analysisContentUnionDeserializer(item) {
|
|
59
|
+
switch (item["kind"]) {
|
|
60
|
+
case "document":
|
|
61
|
+
return documentContentDeserializer(item);
|
|
62
|
+
case "audioVisual":
|
|
63
|
+
return audioVisualContentDeserializer(item);
|
|
64
|
+
default:
|
|
65
|
+
return analysisContentDeserializer(item);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function contentFieldUnionRecordDeserializer(item) {
|
|
69
|
+
const result = {};
|
|
70
|
+
Object.keys(item).map((key) => {
|
|
71
|
+
result[key] = !item[key] ? item[key] : contentFieldUnionDeserializer(item[key]);
|
|
72
|
+
});
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
export function contentFieldDeserializer(item) {
|
|
76
|
+
return {
|
|
77
|
+
type: item["type"],
|
|
78
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
79
|
+
confidence: item["confidence"],
|
|
80
|
+
source: item["source"],
|
|
81
|
+
value: undefined,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function contentFieldUnionDeserializer(item) {
|
|
85
|
+
switch (item["type"]) {
|
|
86
|
+
case "string":
|
|
87
|
+
return stringFieldDeserializer(item);
|
|
88
|
+
case "date":
|
|
89
|
+
return dateFieldDeserializer(item);
|
|
90
|
+
case "time":
|
|
91
|
+
return timeFieldDeserializer(item);
|
|
92
|
+
case "number":
|
|
93
|
+
return numberFieldDeserializer(item);
|
|
94
|
+
case "integer":
|
|
95
|
+
return integerFieldDeserializer(item);
|
|
96
|
+
case "boolean":
|
|
97
|
+
return booleanFieldDeserializer(item);
|
|
98
|
+
case "array":
|
|
99
|
+
return arrayFieldDeserializer(item);
|
|
100
|
+
case "object":
|
|
101
|
+
return objectFieldDeserializer(item);
|
|
102
|
+
case "json":
|
|
103
|
+
return jsonFieldDeserializer(item);
|
|
104
|
+
default:
|
|
105
|
+
return contentFieldDeserializer(item);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export function contentSpanArrayDeserializer(result) {
|
|
109
|
+
return result.map((item) => {
|
|
110
|
+
return contentSpanDeserializer(item);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export function contentSpanDeserializer(item) {
|
|
114
|
+
return {
|
|
115
|
+
offset: item["offset"],
|
|
116
|
+
length: item["length"],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export function stringFieldDeserializer(item) {
|
|
120
|
+
return {
|
|
121
|
+
type: item["type"],
|
|
122
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
123
|
+
confidence: item["confidence"],
|
|
124
|
+
source: item["source"],
|
|
125
|
+
fieldType: item["type"],
|
|
126
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueString`
|
|
127
|
+
value: item["valueString"],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export function dateFieldDeserializer(item) {
|
|
131
|
+
return {
|
|
132
|
+
type: item["type"],
|
|
133
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
134
|
+
confidence: item["confidence"],
|
|
135
|
+
source: item["source"],
|
|
136
|
+
fieldType: item["type"],
|
|
137
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueDate`
|
|
138
|
+
value: !item["valueDate"] ? item["valueDate"] : new Date(item["valueDate"]),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export function timeFieldDeserializer(item) {
|
|
142
|
+
return {
|
|
143
|
+
type: item["type"],
|
|
144
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
145
|
+
confidence: item["confidence"],
|
|
146
|
+
source: item["source"],
|
|
147
|
+
fieldType: item["type"],
|
|
148
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueTime`
|
|
149
|
+
value: item["valueTime"],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export function numberFieldDeserializer(item) {
|
|
153
|
+
return {
|
|
154
|
+
type: item["type"],
|
|
155
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
156
|
+
confidence: item["confidence"],
|
|
157
|
+
source: item["source"],
|
|
158
|
+
fieldType: item["type"],
|
|
159
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueNumber`
|
|
160
|
+
value: item["valueNumber"],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export function integerFieldDeserializer(item) {
|
|
164
|
+
return {
|
|
165
|
+
type: item["type"],
|
|
166
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
167
|
+
confidence: item["confidence"],
|
|
168
|
+
source: item["source"],
|
|
169
|
+
fieldType: item["type"],
|
|
170
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueInteger`
|
|
171
|
+
value: item["valueInteger"],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export function booleanFieldDeserializer(item) {
|
|
175
|
+
return {
|
|
176
|
+
type: item["type"],
|
|
177
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
178
|
+
confidence: item["confidence"],
|
|
179
|
+
source: item["source"],
|
|
180
|
+
fieldType: item["type"],
|
|
181
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueBoolean`
|
|
182
|
+
value: item["valueBoolean"],
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function arrayFieldDeserializer(item) {
|
|
186
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueArray`
|
|
187
|
+
const value = !item["valueArray"]
|
|
188
|
+
? item["valueArray"]
|
|
189
|
+
: contentFieldUnionArrayDeserializer(item["valueArray"]);
|
|
190
|
+
return {
|
|
191
|
+
type: item["type"],
|
|
192
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
193
|
+
confidence: item["confidence"],
|
|
194
|
+
source: item["source"],
|
|
195
|
+
fieldType: item["type"],
|
|
196
|
+
value: value,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export function contentFieldUnionArrayDeserializer(result) {
|
|
200
|
+
return result.map((item) => {
|
|
201
|
+
return contentFieldUnionDeserializer(item);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
export function objectFieldDeserializer(item) {
|
|
205
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueObject`
|
|
206
|
+
const value = !item["valueObject"]
|
|
207
|
+
? item["valueObject"]
|
|
208
|
+
: contentFieldUnionRecordDeserializer(item["valueObject"]);
|
|
209
|
+
return {
|
|
210
|
+
type: item["type"],
|
|
211
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
212
|
+
confidence: item["confidence"],
|
|
213
|
+
source: item["source"],
|
|
214
|
+
fieldType: item["type"],
|
|
215
|
+
value: value,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export function jsonFieldDeserializer(item) {
|
|
219
|
+
return {
|
|
220
|
+
type: item["type"],
|
|
221
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
222
|
+
confidence: item["confidence"],
|
|
223
|
+
source: item["source"],
|
|
224
|
+
fieldType: item["type"],
|
|
225
|
+
// CUSTOMIZATION: SDK-IMPROVEMENT: Map `value` from wire-format `valueJson`
|
|
226
|
+
value: item["valueJson"],
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export function documentContentDeserializer(item) {
|
|
230
|
+
return {
|
|
231
|
+
kind: item["kind"],
|
|
232
|
+
mimeType: item["mimeType"],
|
|
233
|
+
analyzerId: item["analyzerId"],
|
|
234
|
+
category: item["category"],
|
|
235
|
+
path: item["path"],
|
|
236
|
+
markdown: item["markdown"],
|
|
237
|
+
fields: !item["fields"] ? item["fields"] : contentFieldUnionRecordDeserializer(item["fields"]),
|
|
238
|
+
startPageNumber: item["startPageNumber"],
|
|
239
|
+
endPageNumber: item["endPageNumber"],
|
|
240
|
+
unit: item["unit"],
|
|
241
|
+
pages: !item["pages"] ? item["pages"] : documentPageArrayDeserializer(item["pages"]),
|
|
242
|
+
paragraphs: !item["paragraphs"]
|
|
243
|
+
? item["paragraphs"]
|
|
244
|
+
: documentParagraphArrayDeserializer(item["paragraphs"]),
|
|
245
|
+
sections: !item["sections"]
|
|
246
|
+
? item["sections"]
|
|
247
|
+
: documentSectionArrayDeserializer(item["sections"]),
|
|
248
|
+
tables: !item["tables"] ? item["tables"] : documentTableArrayDeserializer(item["tables"]),
|
|
249
|
+
figures: !item["figures"]
|
|
250
|
+
? item["figures"]
|
|
251
|
+
: documentFigureUnionArrayDeserializer(item["figures"]),
|
|
252
|
+
annotations: !item["annotations"]
|
|
253
|
+
? item["annotations"]
|
|
254
|
+
: documentAnnotationArrayDeserializer(item["annotations"]),
|
|
255
|
+
hyperlinks: !item["hyperlinks"]
|
|
256
|
+
? item["hyperlinks"]
|
|
257
|
+
: documentHyperlinkArrayDeserializer(item["hyperlinks"]),
|
|
258
|
+
segments: !item["segments"]
|
|
259
|
+
? item["segments"]
|
|
260
|
+
: documentContentSegmentArrayDeserializer(item["segments"]),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
export function documentPageArrayDeserializer(result) {
|
|
264
|
+
return result.map((item) => {
|
|
265
|
+
return documentPageDeserializer(item);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
export function documentPageDeserializer(item) {
|
|
269
|
+
return {
|
|
270
|
+
pageNumber: item["pageNumber"],
|
|
271
|
+
width: item["width"],
|
|
272
|
+
height: item["height"],
|
|
273
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
274
|
+
angle: item["angle"],
|
|
275
|
+
words: !item["words"] ? item["words"] : documentWordArrayDeserializer(item["words"]),
|
|
276
|
+
lines: !item["lines"] ? item["lines"] : documentLineArrayDeserializer(item["lines"]),
|
|
277
|
+
barcodes: !item["barcodes"]
|
|
278
|
+
? item["barcodes"]
|
|
279
|
+
: documentBarcodeArrayDeserializer(item["barcodes"]),
|
|
280
|
+
formulas: !item["formulas"]
|
|
281
|
+
? item["formulas"]
|
|
282
|
+
: documentFormulaArrayDeserializer(item["formulas"]),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
export function documentWordArrayDeserializer(result) {
|
|
286
|
+
return result.map((item) => {
|
|
287
|
+
return documentWordDeserializer(item);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
export function documentWordDeserializer(item) {
|
|
291
|
+
return {
|
|
292
|
+
content: item["content"],
|
|
293
|
+
source: item["source"],
|
|
294
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
295
|
+
confidence: item["confidence"],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
export function documentLineArrayDeserializer(result) {
|
|
299
|
+
return result.map((item) => {
|
|
300
|
+
return documentLineDeserializer(item);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
export function documentLineDeserializer(item) {
|
|
304
|
+
return {
|
|
305
|
+
content: item["content"],
|
|
306
|
+
source: item["source"],
|
|
307
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export function documentBarcodeArrayDeserializer(result) {
|
|
311
|
+
return result.map((item) => {
|
|
312
|
+
return documentBarcodeDeserializer(item);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
export function documentBarcodeDeserializer(item) {
|
|
316
|
+
return {
|
|
317
|
+
kind: item["kind"],
|
|
318
|
+
value: item["value"],
|
|
319
|
+
source: item["source"],
|
|
320
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
321
|
+
confidence: item["confidence"],
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
export function documentFormulaArrayDeserializer(result) {
|
|
325
|
+
return result.map((item) => {
|
|
326
|
+
return documentFormulaDeserializer(item);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
export function documentFormulaDeserializer(item) {
|
|
330
|
+
return {
|
|
331
|
+
kind: item["kind"],
|
|
332
|
+
value: item["value"],
|
|
333
|
+
source: item["source"],
|
|
334
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
335
|
+
confidence: item["confidence"],
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
export function documentParagraphArrayDeserializer(result) {
|
|
339
|
+
return result.map((item) => {
|
|
340
|
+
return documentParagraphDeserializer(item);
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
export function documentParagraphDeserializer(item) {
|
|
344
|
+
return {
|
|
345
|
+
role: item["role"],
|
|
346
|
+
content: item["content"],
|
|
347
|
+
source: item["source"],
|
|
348
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
export function documentSectionArrayDeserializer(result) {
|
|
352
|
+
return result.map((item) => {
|
|
353
|
+
return documentSectionDeserializer(item);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
export function documentSectionDeserializer(item) {
|
|
357
|
+
return {
|
|
358
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
359
|
+
elements: !item["elements"]
|
|
360
|
+
? item["elements"]
|
|
361
|
+
: item["elements"].map((p) => {
|
|
362
|
+
return p;
|
|
363
|
+
}),
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
export function documentTableArrayDeserializer(result) {
|
|
367
|
+
return result.map((item) => {
|
|
368
|
+
return documentTableDeserializer(item);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
export function documentTableDeserializer(item) {
|
|
372
|
+
return {
|
|
373
|
+
rowCount: item["rowCount"],
|
|
374
|
+
columnCount: item["columnCount"],
|
|
375
|
+
cells: documentTableCellArrayDeserializer(item["cells"]),
|
|
376
|
+
source: item["source"],
|
|
377
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
378
|
+
caption: !item["caption"] ? item["caption"] : documentCaptionDeserializer(item["caption"]),
|
|
379
|
+
footnotes: !item["footnotes"]
|
|
380
|
+
? item["footnotes"]
|
|
381
|
+
: documentFootnoteArrayDeserializer(item["footnotes"]),
|
|
382
|
+
role: item["role"],
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
export function documentTableCellArrayDeserializer(result) {
|
|
386
|
+
return result.map((item) => {
|
|
387
|
+
return documentTableCellDeserializer(item);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
export function documentTableCellDeserializer(item) {
|
|
391
|
+
return {
|
|
392
|
+
kind: item["kind"],
|
|
393
|
+
rowIndex: item["rowIndex"],
|
|
394
|
+
columnIndex: item["columnIndex"],
|
|
395
|
+
rowSpan: item["rowSpan"],
|
|
396
|
+
columnSpan: item["columnSpan"],
|
|
397
|
+
content: item["content"],
|
|
398
|
+
source: item["source"],
|
|
399
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
400
|
+
elements: !item["elements"]
|
|
401
|
+
? item["elements"]
|
|
402
|
+
: item["elements"].map((p) => {
|
|
403
|
+
return p;
|
|
404
|
+
}),
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
export function documentCaptionDeserializer(item) {
|
|
408
|
+
return {
|
|
409
|
+
content: item["content"],
|
|
410
|
+
source: item["source"],
|
|
411
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
412
|
+
elements: !item["elements"]
|
|
413
|
+
? item["elements"]
|
|
414
|
+
: item["elements"].map((p) => {
|
|
415
|
+
return p;
|
|
416
|
+
}),
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
export function documentFootnoteArrayDeserializer(result) {
|
|
420
|
+
return result.map((item) => {
|
|
421
|
+
return documentFootnoteDeserializer(item);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
export function documentFootnoteDeserializer(item) {
|
|
425
|
+
return {
|
|
426
|
+
content: item["content"],
|
|
427
|
+
source: item["source"],
|
|
428
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
429
|
+
elements: !item["elements"]
|
|
430
|
+
? item["elements"]
|
|
431
|
+
: item["elements"].map((p) => {
|
|
432
|
+
return p;
|
|
433
|
+
}),
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
export function documentFigureUnionArrayDeserializer(result) {
|
|
437
|
+
return result.map((item) => {
|
|
438
|
+
return documentFigureUnionDeserializer(item);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
export function documentFigureDeserializer(item) {
|
|
442
|
+
return {
|
|
443
|
+
kind: item["kind"],
|
|
444
|
+
id: item["id"],
|
|
445
|
+
source: item["source"],
|
|
446
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
447
|
+
elements: !item["elements"]
|
|
448
|
+
? item["elements"]
|
|
449
|
+
: item["elements"].map((p) => {
|
|
450
|
+
return p;
|
|
451
|
+
}),
|
|
452
|
+
caption: !item["caption"] ? item["caption"] : documentCaptionDeserializer(item["caption"]),
|
|
453
|
+
footnotes: !item["footnotes"]
|
|
454
|
+
? item["footnotes"]
|
|
455
|
+
: documentFootnoteArrayDeserializer(item["footnotes"]),
|
|
456
|
+
description: item["description"],
|
|
457
|
+
role: item["role"],
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
export function documentFigureUnionDeserializer(item) {
|
|
461
|
+
switch (item["kind"]) {
|
|
462
|
+
case "chart":
|
|
463
|
+
return documentChartFigureDeserializer(item);
|
|
464
|
+
case "mermaid":
|
|
465
|
+
return documentMermaidFigureDeserializer(item);
|
|
466
|
+
default:
|
|
467
|
+
return documentFigureDeserializer(item);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
export function documentChartFigureDeserializer(item) {
|
|
471
|
+
return {
|
|
472
|
+
kind: item["kind"],
|
|
473
|
+
id: item["id"],
|
|
474
|
+
source: item["source"],
|
|
475
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
476
|
+
elements: !item["elements"]
|
|
477
|
+
? item["elements"]
|
|
478
|
+
: item["elements"].map((p) => {
|
|
479
|
+
return p;
|
|
480
|
+
}),
|
|
481
|
+
caption: !item["caption"] ? item["caption"] : documentCaptionDeserializer(item["caption"]),
|
|
482
|
+
footnotes: !item["footnotes"]
|
|
483
|
+
? item["footnotes"]
|
|
484
|
+
: documentFootnoteArrayDeserializer(item["footnotes"]),
|
|
485
|
+
description: item["description"],
|
|
486
|
+
role: item["role"],
|
|
487
|
+
content: Object.fromEntries(Object.entries(item["content"]).map(([k, p]) => [k, p])),
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
export function documentMermaidFigureDeserializer(item) {
|
|
491
|
+
return {
|
|
492
|
+
kind: item["kind"],
|
|
493
|
+
id: item["id"],
|
|
494
|
+
source: item["source"],
|
|
495
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
496
|
+
elements: !item["elements"]
|
|
497
|
+
? item["elements"]
|
|
498
|
+
: item["elements"].map((p) => {
|
|
499
|
+
return p;
|
|
500
|
+
}),
|
|
501
|
+
caption: !item["caption"] ? item["caption"] : documentCaptionDeserializer(item["caption"]),
|
|
502
|
+
footnotes: !item["footnotes"]
|
|
503
|
+
? item["footnotes"]
|
|
504
|
+
: documentFootnoteArrayDeserializer(item["footnotes"]),
|
|
505
|
+
description: item["description"],
|
|
506
|
+
role: item["role"],
|
|
507
|
+
content: item["content"],
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
export function documentAnnotationArrayDeserializer(result) {
|
|
511
|
+
return result.map((item) => {
|
|
512
|
+
return documentAnnotationDeserializer(item);
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
export function documentAnnotationDeserializer(item) {
|
|
516
|
+
return {
|
|
517
|
+
id: item["id"],
|
|
518
|
+
kind: item["kind"],
|
|
519
|
+
spans: !item["spans"] ? item["spans"] : contentSpanArrayDeserializer(item["spans"]),
|
|
520
|
+
source: item["source"],
|
|
521
|
+
comments: !item["comments"]
|
|
522
|
+
? item["comments"]
|
|
523
|
+
: documentAnnotationCommentArrayDeserializer(item["comments"]),
|
|
524
|
+
author: item["author"],
|
|
525
|
+
createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]),
|
|
526
|
+
lastModifiedAt: !item["lastModifiedAt"]
|
|
527
|
+
? item["lastModifiedAt"]
|
|
528
|
+
: new Date(item["lastModifiedAt"]),
|
|
529
|
+
tags: !item["tags"]
|
|
530
|
+
? item["tags"]
|
|
531
|
+
: item["tags"].map((p) => {
|
|
532
|
+
return p;
|
|
533
|
+
}),
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
export function documentAnnotationCommentArrayDeserializer(result) {
|
|
537
|
+
return result.map((item) => {
|
|
538
|
+
return documentAnnotationCommentDeserializer(item);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
export function documentAnnotationCommentDeserializer(item) {
|
|
542
|
+
return {
|
|
543
|
+
message: item["message"],
|
|
544
|
+
author: item["author"],
|
|
545
|
+
createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]),
|
|
546
|
+
lastModifiedAt: !item["lastModifiedAt"]
|
|
547
|
+
? item["lastModifiedAt"]
|
|
548
|
+
: new Date(item["lastModifiedAt"]),
|
|
549
|
+
tags: !item["tags"]
|
|
550
|
+
? item["tags"]
|
|
551
|
+
: item["tags"].map((p) => {
|
|
552
|
+
return p;
|
|
553
|
+
}),
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
export function documentHyperlinkArrayDeserializer(result) {
|
|
557
|
+
return result.map((item) => {
|
|
558
|
+
return documentHyperlinkDeserializer(item);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
export function documentHyperlinkDeserializer(item) {
|
|
562
|
+
return {
|
|
563
|
+
content: item["content"],
|
|
564
|
+
url: item["url"],
|
|
565
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
566
|
+
source: item["source"],
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
export function documentContentSegmentArrayDeserializer(result) {
|
|
570
|
+
return result.map((item) => {
|
|
571
|
+
return documentContentSegmentDeserializer(item);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
export function documentContentSegmentDeserializer(item) {
|
|
575
|
+
return {
|
|
576
|
+
segmentId: item["segmentId"],
|
|
577
|
+
category: item["category"],
|
|
578
|
+
span: contentSpanDeserializer(item["span"]),
|
|
579
|
+
startPageNumber: item["startPageNumber"],
|
|
580
|
+
endPageNumber: item["endPageNumber"],
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
export function audioVisualContentDeserializer(item) {
|
|
584
|
+
return {
|
|
585
|
+
kind: item["kind"],
|
|
586
|
+
mimeType: item["mimeType"],
|
|
587
|
+
analyzerId: item["analyzerId"],
|
|
588
|
+
category: item["category"],
|
|
589
|
+
path: item["path"],
|
|
590
|
+
markdown: item["markdown"],
|
|
591
|
+
fields: !item["fields"] ? item["fields"] : contentFieldUnionRecordDeserializer(item["fields"]),
|
|
592
|
+
startTimeMs: item["startTimeMs"],
|
|
593
|
+
endTimeMs: item["endTimeMs"],
|
|
594
|
+
width: item["width"],
|
|
595
|
+
height: item["height"],
|
|
596
|
+
cameraShotTimesMs: !item["cameraShotTimesMs"]
|
|
597
|
+
? item["cameraShotTimesMs"]
|
|
598
|
+
: item["cameraShotTimesMs"].map((p) => {
|
|
599
|
+
return p;
|
|
600
|
+
}),
|
|
601
|
+
// CUSTOMIZATION: SERVICE-FIX: Accept both `keyFrameTimesMs` (camelCase) and `KeyFrameTimesMs` (PascalCase)
|
|
602
|
+
// due to a known service issue returning PascalCase for this property.
|
|
603
|
+
keyFrameTimesMs: (() => {
|
|
604
|
+
const val = item["keyFrameTimesMs"] ?? item["KeyFrameTimesMs"];
|
|
605
|
+
return !val ? val : val.map((p) => p);
|
|
606
|
+
})(),
|
|
607
|
+
transcriptPhrases: !item["transcriptPhrases"]
|
|
608
|
+
? item["transcriptPhrases"]
|
|
609
|
+
: transcriptPhraseArrayDeserializer(item["transcriptPhrases"]),
|
|
610
|
+
segments: !item["segments"]
|
|
611
|
+
? item["segments"]
|
|
612
|
+
: audioVisualContentSegmentArrayDeserializer(item["segments"]),
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
export function transcriptPhraseArrayDeserializer(result) {
|
|
616
|
+
return result.map((item) => {
|
|
617
|
+
return transcriptPhraseDeserializer(item);
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
export function transcriptPhraseDeserializer(item) {
|
|
621
|
+
return {
|
|
622
|
+
speaker: item["speaker"],
|
|
623
|
+
startTimeMs: item["startTimeMs"],
|
|
624
|
+
endTimeMs: item["endTimeMs"],
|
|
625
|
+
locale: item["locale"],
|
|
626
|
+
text: item["text"],
|
|
627
|
+
confidence: item["confidence"],
|
|
628
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
629
|
+
words: transcriptWordArrayDeserializer(item["words"]),
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
export function transcriptWordArrayDeserializer(result) {
|
|
633
|
+
return result.map((item) => {
|
|
634
|
+
return transcriptWordDeserializer(item);
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
export function transcriptWordDeserializer(item) {
|
|
638
|
+
return {
|
|
639
|
+
startTimeMs: item["startTimeMs"],
|
|
640
|
+
endTimeMs: item["endTimeMs"],
|
|
641
|
+
text: item["text"],
|
|
642
|
+
span: !item["span"] ? item["span"] : contentSpanDeserializer(item["span"]),
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
export function audioVisualContentSegmentArrayDeserializer(result) {
|
|
646
|
+
return result.map((item) => {
|
|
647
|
+
return audioVisualContentSegmentDeserializer(item);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
export function audioVisualContentSegmentDeserializer(item) {
|
|
651
|
+
return {
|
|
652
|
+
segmentId: item["segmentId"],
|
|
653
|
+
category: item["category"],
|
|
654
|
+
span: contentSpanDeserializer(item["span"]),
|
|
655
|
+
startTimeMs: item["startTimeMs"],
|
|
656
|
+
endTimeMs: item["endTimeMs"],
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
export function usageDetailsDeserializer(item) {
|
|
660
|
+
return {
|
|
661
|
+
documentPagesMinimal: item["documentPagesMinimal"],
|
|
662
|
+
documentPagesBasic: item["documentPagesBasic"],
|
|
663
|
+
documentPagesStandard: item["documentPagesStandard"],
|
|
664
|
+
audioHours: item["audioHours"],
|
|
665
|
+
videoHours: item["videoHours"],
|
|
666
|
+
contextualizationTokens: item["contextualizationTokens"],
|
|
667
|
+
tokens: !item["tokens"]
|
|
668
|
+
? item["tokens"]
|
|
669
|
+
: Object.fromEntries(Object.entries(item["tokens"]).map(([k, p]) => [k, p])),
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
export function contentAnalyzerSerializer(item) {
|
|
673
|
+
return {
|
|
674
|
+
description: item["description"],
|
|
675
|
+
tags: item["tags"],
|
|
676
|
+
baseAnalyzerId: item["baseAnalyzerId"],
|
|
677
|
+
config: !item["config"] ? item["config"] : contentAnalyzerConfigSerializer(item["config"]),
|
|
678
|
+
fieldSchema: !item["fieldSchema"]
|
|
679
|
+
? item["fieldSchema"]
|
|
680
|
+
: contentFieldSchemaSerializer(item["fieldSchema"]),
|
|
681
|
+
dynamicFieldSchema: item["dynamicFieldSchema"],
|
|
682
|
+
processingLocation: item["processingLocation"],
|
|
683
|
+
knowledgeSources: !item["knowledgeSources"]
|
|
684
|
+
? item["knowledgeSources"]
|
|
685
|
+
: knowledgeSourceUnionArraySerializer(item["knowledgeSources"]),
|
|
686
|
+
models: item["models"],
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
export function contentAnalyzerDeserializer(item) {
|
|
690
|
+
return {
|
|
691
|
+
analyzerId: item["analyzerId"],
|
|
692
|
+
description: item["description"],
|
|
693
|
+
tags: !item["tags"]
|
|
694
|
+
? item["tags"]
|
|
695
|
+
: Object.fromEntries(Object.entries(item["tags"]).map(([k, p]) => [k, p])),
|
|
696
|
+
status: item["status"],
|
|
697
|
+
createdAt: new Date(item["createdAt"]),
|
|
698
|
+
lastModifiedAt: new Date(item["lastModifiedAt"]),
|
|
699
|
+
warnings: !item["warnings"]
|
|
700
|
+
? item["warnings"]
|
|
701
|
+
: item["warnings"].map((p) => {
|
|
702
|
+
return p;
|
|
703
|
+
}),
|
|
704
|
+
baseAnalyzerId: item["baseAnalyzerId"],
|
|
705
|
+
config: !item["config"] ? item["config"] : contentAnalyzerConfigDeserializer(item["config"]),
|
|
706
|
+
fieldSchema: !item["fieldSchema"]
|
|
707
|
+
? item["fieldSchema"]
|
|
708
|
+
: contentFieldSchemaDeserializer(item["fieldSchema"]),
|
|
709
|
+
dynamicFieldSchema: item["dynamicFieldSchema"],
|
|
710
|
+
processingLocation: item["processingLocation"],
|
|
711
|
+
knowledgeSources: !item["knowledgeSources"]
|
|
712
|
+
? item["knowledgeSources"]
|
|
713
|
+
: knowledgeSourceUnionArrayDeserializer(item["knowledgeSources"]),
|
|
714
|
+
models: !item["models"]
|
|
715
|
+
? item["models"]
|
|
716
|
+
: Object.fromEntries(Object.entries(item["models"]).map(([k, p]) => [k, p])),
|
|
717
|
+
supportedModels: !item["supportedModels"]
|
|
718
|
+
? item["supportedModels"]
|
|
719
|
+
: supportedModelsDeserializer(item["supportedModels"]),
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
export function contentAnalyzerConfigSerializer(item) {
|
|
723
|
+
return {
|
|
724
|
+
returnDetails: item["returnDetails"],
|
|
725
|
+
locales: !item["locales"]
|
|
726
|
+
? item["locales"]
|
|
727
|
+
: item["locales"].map((p) => {
|
|
728
|
+
return p;
|
|
729
|
+
}),
|
|
730
|
+
enableOcr: item["enableOcr"],
|
|
731
|
+
enableLayout: item["enableLayout"],
|
|
732
|
+
enableFigureDescription: item["enableFigureDescription"],
|
|
733
|
+
enableFigureAnalysis: item["enableFigureAnalysis"],
|
|
734
|
+
enableFormula: item["enableFormula"],
|
|
735
|
+
tableFormat: item["tableFormat"],
|
|
736
|
+
chartFormat: item["chartFormat"],
|
|
737
|
+
annotationFormat: item["annotationFormat"],
|
|
738
|
+
disableFaceBlurring: item["disableFaceBlurring"],
|
|
739
|
+
estimateFieldSourceAndConfidence: item["estimateFieldSourceAndConfidence"],
|
|
740
|
+
contentCategories: !item["contentCategories"]
|
|
741
|
+
? item["contentCategories"]
|
|
742
|
+
: contentCategoryDefinitionRecordSerializer(item["contentCategories"]),
|
|
743
|
+
enableSegment: item["enableSegment"],
|
|
744
|
+
segmentPerPage: item["segmentPerPage"],
|
|
745
|
+
omitContent: item["omitContent"],
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
export function contentAnalyzerConfigDeserializer(item) {
|
|
749
|
+
return {
|
|
750
|
+
returnDetails: item["returnDetails"],
|
|
751
|
+
locales: !item["locales"]
|
|
752
|
+
? item["locales"]
|
|
753
|
+
: item["locales"].map((p) => {
|
|
754
|
+
return p;
|
|
755
|
+
}),
|
|
756
|
+
enableOcr: item["enableOcr"],
|
|
757
|
+
enableLayout: item["enableLayout"],
|
|
758
|
+
enableFigureDescription: item["enableFigureDescription"],
|
|
759
|
+
enableFigureAnalysis: item["enableFigureAnalysis"],
|
|
760
|
+
enableFormula: item["enableFormula"],
|
|
761
|
+
tableFormat: item["tableFormat"],
|
|
762
|
+
chartFormat: item["chartFormat"],
|
|
763
|
+
annotationFormat: item["annotationFormat"],
|
|
764
|
+
disableFaceBlurring: item["disableFaceBlurring"],
|
|
765
|
+
estimateFieldSourceAndConfidence: item["estimateFieldSourceAndConfidence"],
|
|
766
|
+
contentCategories: !item["contentCategories"]
|
|
767
|
+
? item["contentCategories"]
|
|
768
|
+
: contentCategoryDefinitionRecordDeserializer(item["contentCategories"]),
|
|
769
|
+
enableSegment: item["enableSegment"],
|
|
770
|
+
segmentPerPage: item["segmentPerPage"],
|
|
771
|
+
omitContent: item["omitContent"],
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
export function contentCategoryDefinitionRecordSerializer(item) {
|
|
775
|
+
const result = {};
|
|
776
|
+
Object.keys(item).map((key) => {
|
|
777
|
+
result[key] = !item[key] ? item[key] : contentCategoryDefinitionSerializer(item[key]);
|
|
778
|
+
});
|
|
779
|
+
return result;
|
|
780
|
+
}
|
|
781
|
+
export function contentCategoryDefinitionRecordDeserializer(item) {
|
|
782
|
+
const result = {};
|
|
783
|
+
Object.keys(item).map((key) => {
|
|
784
|
+
result[key] = !item[key] ? item[key] : contentCategoryDefinitionDeserializer(item[key]);
|
|
785
|
+
});
|
|
786
|
+
return result;
|
|
787
|
+
}
|
|
788
|
+
export function contentCategoryDefinitionSerializer(item) {
|
|
789
|
+
return {
|
|
790
|
+
description: item["description"],
|
|
791
|
+
analyzerId: item["analyzerId"],
|
|
792
|
+
analyzer: !item["analyzer"] ? item["analyzer"] : contentAnalyzerSerializer(item["analyzer"]),
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
export function contentCategoryDefinitionDeserializer(item) {
|
|
796
|
+
return {
|
|
797
|
+
description: item["description"],
|
|
798
|
+
analyzerId: item["analyzerId"],
|
|
799
|
+
analyzer: !item["analyzer"] ? item["analyzer"] : contentAnalyzerDeserializer(item["analyzer"]),
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
export function contentFieldSchemaSerializer(item) {
|
|
803
|
+
return {
|
|
804
|
+
name: item["name"],
|
|
805
|
+
description: item["description"],
|
|
806
|
+
fields: contentFieldDefinitionRecordSerializer(item["fields"]),
|
|
807
|
+
definitions: !item["definitions"]
|
|
808
|
+
? item["definitions"]
|
|
809
|
+
: contentFieldDefinitionRecordSerializer(item["definitions"]),
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
export function contentFieldSchemaDeserializer(item) {
|
|
813
|
+
return {
|
|
814
|
+
name: item["name"],
|
|
815
|
+
description: item["description"],
|
|
816
|
+
fields: contentFieldDefinitionRecordDeserializer(item["fields"]),
|
|
817
|
+
definitions: !item["definitions"]
|
|
818
|
+
? item["definitions"]
|
|
819
|
+
: contentFieldDefinitionRecordDeserializer(item["definitions"]),
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
export function contentFieldDefinitionRecordSerializer(item) {
|
|
823
|
+
const result = {};
|
|
824
|
+
Object.keys(item).map((key) => {
|
|
825
|
+
result[key] = !item[key] ? item[key] : contentFieldDefinitionSerializer(item[key]);
|
|
826
|
+
});
|
|
827
|
+
return result;
|
|
828
|
+
}
|
|
829
|
+
export function contentFieldDefinitionRecordDeserializer(item) {
|
|
830
|
+
// CUSTOMIZATION: EMITTER-FIX: Added null/undefined guard to prevent runtime error when
|
|
831
|
+
// `definitions` property in `ContentFieldSchema` is optional and not present.
|
|
832
|
+
if (!item) {
|
|
833
|
+
return item;
|
|
834
|
+
}
|
|
835
|
+
const result = {};
|
|
836
|
+
Object.keys(item).map((key) => {
|
|
837
|
+
result[key] = !item[key] ? item[key] : contentFieldDefinitionDeserializer(item[key]);
|
|
838
|
+
});
|
|
839
|
+
return result;
|
|
840
|
+
}
|
|
841
|
+
export function contentFieldDefinitionSerializer(item) {
|
|
842
|
+
return {
|
|
843
|
+
method: item["method"],
|
|
844
|
+
type: item["type"],
|
|
845
|
+
description: item["description"],
|
|
846
|
+
items: !item["itemDefinition"]
|
|
847
|
+
? item["itemDefinition"]
|
|
848
|
+
: contentFieldDefinitionSerializer(item["itemDefinition"]),
|
|
849
|
+
properties: !item["properties"]
|
|
850
|
+
? item["properties"]
|
|
851
|
+
: contentFieldDefinitionRecordSerializer(item["properties"]),
|
|
852
|
+
examples: !item["examples"]
|
|
853
|
+
? item["examples"]
|
|
854
|
+
: item["examples"].map((p) => {
|
|
855
|
+
return p;
|
|
856
|
+
}),
|
|
857
|
+
enum: !item["enum"]
|
|
858
|
+
? item["enum"]
|
|
859
|
+
: item["enum"].map((p) => {
|
|
860
|
+
return p;
|
|
861
|
+
}),
|
|
862
|
+
enumDescriptions: item["enumDescriptions"],
|
|
863
|
+
$ref: item["ref"],
|
|
864
|
+
estimateSourceAndConfidence: item["estimateSourceAndConfidence"],
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
export function contentFieldDefinitionDeserializer(item) {
|
|
868
|
+
return {
|
|
869
|
+
method: item["method"],
|
|
870
|
+
type: item["type"],
|
|
871
|
+
description: item["description"],
|
|
872
|
+
itemDefinition: !item["items"]
|
|
873
|
+
? item["items"]
|
|
874
|
+
: contentFieldDefinitionDeserializer(item["items"]),
|
|
875
|
+
properties: !item["properties"]
|
|
876
|
+
? item["properties"]
|
|
877
|
+
: contentFieldDefinitionRecordDeserializer(item["properties"]),
|
|
878
|
+
examples: !item["examples"]
|
|
879
|
+
? item["examples"]
|
|
880
|
+
: item["examples"].map((p) => {
|
|
881
|
+
return p;
|
|
882
|
+
}),
|
|
883
|
+
enum: !item["enum"]
|
|
884
|
+
? item["enum"]
|
|
885
|
+
: item["enum"].map((p) => {
|
|
886
|
+
return p;
|
|
887
|
+
}),
|
|
888
|
+
enumDescriptions: !item["enumDescriptions"]
|
|
889
|
+
? item["enumDescriptions"]
|
|
890
|
+
: Object.fromEntries(Object.entries(item["enumDescriptions"]).map(([k, p]) => [k, p])),
|
|
891
|
+
ref: item["$ref"],
|
|
892
|
+
estimateSourceAndConfidence: item["estimateSourceAndConfidence"],
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
export function knowledgeSourceUnionArraySerializer(result) {
|
|
896
|
+
return result.map((item) => {
|
|
897
|
+
return knowledgeSourceUnionSerializer(item);
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
export function knowledgeSourceUnionArrayDeserializer(result) {
|
|
901
|
+
return result.map((item) => {
|
|
902
|
+
return knowledgeSourceUnionDeserializer(item);
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
export function knowledgeSourceSerializer(item) {
|
|
906
|
+
return { kind: item["kind"] };
|
|
907
|
+
}
|
|
908
|
+
export function knowledgeSourceDeserializer(item) {
|
|
909
|
+
return {
|
|
910
|
+
kind: item["kind"],
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
export function knowledgeSourceUnionSerializer(item) {
|
|
914
|
+
switch (item.kind) {
|
|
915
|
+
case "labeledData":
|
|
916
|
+
return labeledDataKnowledgeSourceSerializer(item);
|
|
917
|
+
default:
|
|
918
|
+
return knowledgeSourceSerializer(item);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
export function knowledgeSourceUnionDeserializer(item) {
|
|
922
|
+
switch (item["kind"]) {
|
|
923
|
+
case "labeledData":
|
|
924
|
+
return labeledDataKnowledgeSourceDeserializer(item);
|
|
925
|
+
default:
|
|
926
|
+
return knowledgeSourceDeserializer(item);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
export function labeledDataKnowledgeSourceSerializer(item) {
|
|
930
|
+
return {
|
|
931
|
+
kind: item["kind"],
|
|
932
|
+
containerUrl: item["containerUrl"],
|
|
933
|
+
prefix: item["prefix"],
|
|
934
|
+
fileListPath: item["fileListPath"],
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
export function labeledDataKnowledgeSourceDeserializer(item) {
|
|
938
|
+
return {
|
|
939
|
+
kind: item["kind"],
|
|
940
|
+
containerUrl: item["containerUrl"],
|
|
941
|
+
prefix: item["prefix"],
|
|
942
|
+
fileListPath: item["fileListPath"],
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
export function supportedModelsDeserializer(item) {
|
|
946
|
+
return {
|
|
947
|
+
completion: !item["completion"]
|
|
948
|
+
? item["completion"]
|
|
949
|
+
: item["completion"].map((p) => {
|
|
950
|
+
return p;
|
|
951
|
+
}),
|
|
952
|
+
embedding: !item["embedding"]
|
|
953
|
+
? item["embedding"]
|
|
954
|
+
: item["embedding"].map((p) => {
|
|
955
|
+
return p;
|
|
956
|
+
}),
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
export function contentAnalyzerOperationStatusDeserializer(item) {
|
|
960
|
+
return {
|
|
961
|
+
id: item["id"],
|
|
962
|
+
status: item["status"],
|
|
963
|
+
error: !item["error"] ? item["error"] : item["error"],
|
|
964
|
+
result: !item["result"] ? item["result"] : contentAnalyzerDeserializer(item["result"]),
|
|
965
|
+
usage: !item["usage"] ? item["usage"] : usageDetailsDeserializer(item["usage"]),
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
export function contentUnderstandingDefaultsDeserializer(item) {
|
|
969
|
+
return {
|
|
970
|
+
modelDeployments: Object.fromEntries(Object.entries(item["modelDeployments"]).map(([k, p]) => [k, p])),
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
export function copyAuthorizationDeserializer(item) {
|
|
974
|
+
return {
|
|
975
|
+
source: item["source"],
|
|
976
|
+
targetAzureResourceId: item["targetAzureResourceId"],
|
|
977
|
+
expiresAt: new Date(item["expiresAt"]),
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
export function _pagedContentAnalyzerDeserializer(item) {
|
|
981
|
+
return {
|
|
982
|
+
value: contentAnalyzerArrayDeserializer(item["value"]),
|
|
983
|
+
nextLink: item["nextLink"],
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
export function contentAnalyzerArraySerializer(result) {
|
|
987
|
+
return result.map((item) => {
|
|
988
|
+
return contentAnalyzerSerializer(item);
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
export function contentAnalyzerArrayDeserializer(result) {
|
|
992
|
+
return result.map((item) => {
|
|
993
|
+
return contentAnalyzerDeserializer(item);
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
export function recordMergePatchUpdateSerializer(item) {
|
|
997
|
+
return { ...serializeRecord(item.additionalProperties ?? {}) };
|
|
998
|
+
}
|
|
999
|
+
/** Service API versions. */
|
|
1000
|
+
export var KnownVersions;
|
|
1001
|
+
(function (KnownVersions) {
|
|
1002
|
+
/** The 2025-11-01 version of the Content Understanding service. */
|
|
1003
|
+
KnownVersions["V20251101"] = "2025-11-01";
|
|
1004
|
+
})(KnownVersions || (KnownVersions = {}));
|
|
1005
|
+
//# sourceMappingURL=models.js.map
|