unstructured-transform-client 0.18.103 → 0.18.105

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.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Unstructured Transform API
3
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface DegradedPage
16
+ */
17
+ export interface DegradedPage {
18
+ /**
19
+ * The 1-based page number.
20
+ */
21
+ page: number;
22
+ /**
23
+ * Detected regions on the page whose content could not be recognized.
24
+ */
25
+ failedRegions: number;
26
+ /**
27
+ * Detected regions on the page.
28
+ */
29
+ totalRegions: number;
30
+ }
31
+ /**
32
+ * Check if a given object implements the DegradedPage interface.
33
+ */
34
+ export declare function instanceOfDegradedPage(value: object): value is DegradedPage;
35
+ export declare function DegradedPageFromJSON(json: any): DegradedPage;
36
+ export declare function DegradedPageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DegradedPage;
37
+ export declare function DegradedPageToJSON(json: any): DegradedPage;
38
+ export declare function DegradedPageToJSONTyped(value?: DegradedPage | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Unstructured Transform API
5
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the DegradedPage interface.
16
+ */
17
+ export function instanceOfDegradedPage(value) {
18
+ if (!('page' in value) || value['page'] === undefined)
19
+ return false;
20
+ if ((!('failedRegions' in value) && !('failed_regions' in value)) || (value['failedRegions'] === undefined && value['failed_regions'] === undefined))
21
+ return false;
22
+ if ((!('totalRegions' in value) && !('total_regions' in value)) || (value['totalRegions'] === undefined && value['total_regions'] === undefined))
23
+ return false;
24
+ return true;
25
+ }
26
+ export function DegradedPageFromJSON(json) {
27
+ return DegradedPageFromJSONTyped(json, false);
28
+ }
29
+ export function DegradedPageFromJSONTyped(json, ignoreDiscriminator) {
30
+ if (json == null) {
31
+ return json;
32
+ }
33
+ return {
34
+ 'page': json['page'],
35
+ 'failedRegions': json['failed_regions'],
36
+ 'totalRegions': json['total_regions'],
37
+ };
38
+ }
39
+ export function DegradedPageToJSON(json) {
40
+ return DegradedPageToJSONTyped(json, false);
41
+ }
42
+ export function DegradedPageToJSONTyped(value, ignoreDiscriminator = false) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'page': value['page'],
48
+ 'failed_regions': value['failedRegions'],
49
+ 'total_regions': value['totalRegions'],
50
+ };
51
+ }
@@ -20,11 +20,9 @@ export interface ElementMetadata {
20
20
  */
21
21
  pageNumber: number | null;
22
22
  /**
23
- * Coordinate projection when requested.
23
+ * One box for an element on one page, or an array with one box and its page_number per page for an element that spans pages.
24
24
  */
25
- coordinates: {
26
- [key: string]: any;
27
- } | null;
25
+ coordinates: any | null;
28
26
  /**
29
27
  * Table HTML projection when requested.
30
28
  */
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Unstructured Transform API
3
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface FailedPage
16
+ */
17
+ export interface FailedPage {
18
+ /**
19
+ * The 1-based page number.
20
+ */
21
+ page: number;
22
+ /**
23
+ * Stable identifier, safe to branch on.
24
+ */
25
+ code: string;
26
+ /**
27
+ * Human-readable reason.
28
+ */
29
+ message: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the FailedPage interface.
33
+ */
34
+ export declare function instanceOfFailedPage(value: object): value is FailedPage;
35
+ export declare function FailedPageFromJSON(json: any): FailedPage;
36
+ export declare function FailedPageFromJSONTyped(json: any, ignoreDiscriminator: boolean): FailedPage;
37
+ export declare function FailedPageToJSON(json: any): FailedPage;
38
+ export declare function FailedPageToJSONTyped(value?: FailedPage | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Unstructured Transform API
5
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the FailedPage interface.
16
+ */
17
+ export function instanceOfFailedPage(value) {
18
+ if (!('page' in value) || value['page'] === undefined)
19
+ return false;
20
+ if (!('code' in value) || value['code'] === undefined)
21
+ return false;
22
+ if (!('message' in value) || value['message'] === undefined)
23
+ return false;
24
+ return true;
25
+ }
26
+ export function FailedPageFromJSON(json) {
27
+ return FailedPageFromJSONTyped(json, false);
28
+ }
29
+ export function FailedPageFromJSONTyped(json, ignoreDiscriminator) {
30
+ if (json == null) {
31
+ return json;
32
+ }
33
+ return {
34
+ 'page': json['page'],
35
+ 'code': json['code'],
36
+ 'message': json['message'],
37
+ };
38
+ }
39
+ export function FailedPageToJSON(json) {
40
+ return FailedPageToJSONTyped(json, false);
41
+ }
42
+ export function FailedPageToJSONTyped(value, ignoreDiscriminator = false) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'page': value['page'],
48
+ 'code': value['code'],
49
+ 'message': value['message'],
50
+ };
51
+ }
@@ -9,12 +9,14 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { FailedPage } from './FailedPage.js';
12
13
  import type { TransformWarning } from './TransformWarning.js';
13
14
  import type { DocumentMetadata } from './DocumentMetadata.js';
14
15
  import type { TransformStatus } from './TransformStatus.js';
15
16
  import type { Element } from './Element.js';
16
17
  import type { ExtractionResult } from './ExtractionResult.js';
17
18
  import type { SourceFile } from './SourceFile.js';
19
+ import type { DegradedPage } from './DegradedPage.js';
18
20
  /**
19
21
  * Parse operation metadata plus the canonical document, possibly before extraction has finished.
20
22
  * @export
@@ -53,6 +55,14 @@ export interface ParseResult {
53
55
  * Notes about a result that still succeeded.
54
56
  */
55
57
  warnings?: Array<TransformWarning>;
58
+ /**
59
+ * Pages that could not be processed and have no elements in this result.
60
+ */
61
+ failedPages?: Array<FailedPage>;
62
+ /**
63
+ * Pages that are in this result although some of their content could not be recognized.
64
+ */
65
+ degradedPages?: Array<DegradedPage>;
56
66
  /**
57
67
  * Public document elements.
58
68
  */
@@ -11,12 +11,14 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { FailedPageFromJSON, FailedPageToJSON, } from './FailedPage.js';
14
15
  import { TransformWarningFromJSON, TransformWarningToJSON, } from './TransformWarning.js';
15
16
  import { DocumentMetadataFromJSON, DocumentMetadataToJSON, } from './DocumentMetadata.js';
16
17
  import { TransformStatusFromJSON, TransformStatusToJSON, } from './TransformStatus.js';
17
18
  import { ElementFromJSON, ElementToJSON, } from './Element.js';
18
19
  import { ExtractionResultFromJSON, ExtractionResultToJSON, } from './ExtractionResult.js';
19
20
  import { SourceFileFromJSON, SourceFileToJSON, } from './SourceFile.js';
21
+ import { DegradedPageFromJSON, DegradedPageToJSON, } from './DegradedPage.js';
20
22
  /**
21
23
  * @export
22
24
  */
@@ -73,6 +75,8 @@ export function ParseResultFromJSONTyped(json, ignoreDiscriminator) {
73
75
  'metadata': DocumentMetadataFromJSON(json['metadata']),
74
76
  'extractedData': (json['extracted_data'] == null ? null : json['extracted_data'].map(ExtractionResultFromJSON)),
75
77
  'warnings': json['warnings'] == null ? undefined : (json['warnings'].map(TransformWarningFromJSON)),
78
+ 'failedPages': json['failed_pages'] == null ? undefined : (json['failed_pages'].map(FailedPageFromJSON)),
79
+ 'degradedPages': json['degraded_pages'] == null ? undefined : (json['degraded_pages'].map(DegradedPageFromJSON)),
76
80
  'elements': (json['elements'].map(ElementFromJSON)),
77
81
  'source': SourceFileFromJSON(json['source']),
78
82
  };
@@ -93,6 +97,8 @@ export function ParseResultToJSONTyped(value, ignoreDiscriminator = false) {
93
97
  'metadata': DocumentMetadataToJSON(value['metadata']),
94
98
  'extracted_data': (value['extractedData'] == null ? null : value['extractedData'].map(ExtractionResultToJSON)),
95
99
  'warnings': value['warnings'] == null ? undefined : (value['warnings'].map(TransformWarningToJSON)),
100
+ 'failed_pages': value['failedPages'] == null ? undefined : (value['failedPages'].map(FailedPageToJSON)),
101
+ 'degraded_pages': value['degradedPages'] == null ? undefined : (value['degradedPages'].map(DegradedPageToJSON)),
96
102
  'elements': (value['elements'].map(ElementToJSON)),
97
103
  'source': SourceFileToJSON(value['source']),
98
104
  };
@@ -1,5 +1,6 @@
1
1
  export * from './AdvancedOptions.js';
2
2
  export * from './Citation.js';
3
+ export * from './DegradedPage.js';
3
4
  export * from './DocumentMetadata.js';
4
5
  export * from './Element.js';
5
6
  export * from './ElementMetadata.js';
@@ -7,6 +8,7 @@ export * from './Enrichments.js';
7
8
  export * from './ErrorCode.js';
8
9
  export * from './ExtractRequest.js';
9
10
  export * from './ExtractionResult.js';
11
+ export * from './FailedPage.js';
10
12
  export * from './FieldMetadata.js';
11
13
  export * from './JobAccepted.js';
12
14
  export * from './JobConfiguration.js';
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export * from './AdvancedOptions.js';
4
4
  export * from './Citation.js';
5
+ export * from './DegradedPage.js';
5
6
  export * from './DocumentMetadata.js';
6
7
  export * from './Element.js';
7
8
  export * from './ElementMetadata.js';
@@ -9,6 +10,7 @@ export * from './Enrichments.js';
9
10
  export * from './ErrorCode.js';
10
11
  export * from './ExtractRequest.js';
11
12
  export * from './ExtractionResult.js';
13
+ export * from './FailedPage.js';
12
14
  export * from './FieldMetadata.js';
13
15
  export * from './JobAccepted.js';
14
16
  export * from './JobConfiguration.js';
package/dist/version.d.ts CHANGED
@@ -12,4 +12,4 @@
12
12
  * (tools/release/derived_versions.py); change the series only for a
13
13
  * deliberate minor or major release.
14
14
  */
15
- export declare const VERSION = "0.18.103";
15
+ export declare const VERSION = "0.18.105";
package/dist/version.js CHANGED
@@ -12,4 +12,4 @@
12
12
  * (tools/release/derived_versions.py); change the series only for a
13
13
  * deliberate minor or major release.
14
14
  */
15
- export const VERSION = "0.18.103";
15
+ export const VERSION = "0.18.105";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unstructured-transform-client",
3
- "version": "0.18.103",
3
+ "version": "0.18.105",
4
4
  "description": "TypeScript client for the Unstructured Transform v2 API — one document in, structured output back.",
5
5
  "license": "MIT",
6
6
  "author": "Unstructured",