Skip to content

Commit 66dbc4c

Browse files
committed
Export pipelines: run prettier
1 parent a3d3147 commit 66dbc4c

File tree

2 files changed

+53
-80
lines changed

2 files changed

+53
-80
lines changed

docs/learn/export-pipeline/data-value-extractor.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ More complex configuration example using extraction from two different `source_r
9191

9292
The extract object consists of the following parameters:
9393

94-
| Attribute | Type | Description |
95-
| ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96-
| `format` | str | File format. Currently, only `json` value is supported. |
97-
| `condition` | str | Reference to `annotation.content` `schema_id` that holds evaluated value. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"`|
98-
| `source_reference_key` | str | Relation key into metadata for source document. |
99-
| `extract_rules` | object | Rules to update annotation's content. |
94+
| Attribute | Type | Description |
95+
| ---------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96+
| `format` | str | File format. Currently, only `json` value is supported. |
97+
| `condition` | str | Reference to `annotation.content` `schema_id` that holds evaluated value. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"` |
98+
| `source_reference_key` | str | Relation key into metadata for source document. |
99+
| `extract_rules` | object | Rules to update annotation's content. |
100100

101101
The `extract_rules` object defines how values are extracted and stored:
102102

docs/learn/export-pipeline/rest-api-export.md

Lines changed: 47 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Webhook URL endpoints:
3636
jp="https://shared-jp.rest-api-export.rossum-ext.app/"
3737
/>
3838

39-
4039
## Configuration examples
4140

4241
This extension works as a part of the [Export Pipeline](./index.md) and it expects a payload file to be generated using [Custom format templating extension](./custom-format-templating.md).
@@ -122,41 +121,23 @@ The `response_headers_reference_key` stores the headers of the reply with added
122121

123122
```json
124123
{
125-
"status_code": 200,
126-
"headers": {
127-
"access_control_allow_origin": "*",
128-
"alt_svc": "h3=\":443\"; ma=2592000",
129-
"content_type": "application/json",
130-
"date": "Tue, 25 Jun 2024 08:02:26 GMT",
131-
"vary": "Accept-Encoding",
132-
"transfer_encoding": "chunked"
133-
},
134-
"raw": [
135-
[
136-
"Access-Control-Allow-Origin",
137-
"*"
138-
],
139-
[
140-
"Alt-Svc",
141-
"h3=\":443\"; ma=2592000"
142-
],
143-
[
144-
"Content-Type",
145-
"application/json"
146-
],
147-
[
148-
"Date",
149-
"Tue, 25 Jun 2024 08:02:26 GMT"
150-
],
151-
[
152-
"Vary",
153-
"Accept-Encoding"
154-
],
155-
[
156-
"Transfer-Encoding",
157-
"chunked"
158-
]
159-
]
124+
"status_code": 200,
125+
"headers": {
126+
"access_control_allow_origin": "*",
127+
"alt_svc": "h3=\":443\"; ma=2592000",
128+
"content_type": "application/json",
129+
"date": "Tue, 25 Jun 2024 08:02:26 GMT",
130+
"vary": "Accept-Encoding",
131+
"transfer_encoding": "chunked"
132+
},
133+
"raw": [
134+
["Access-Control-Allow-Origin", "*"],
135+
["Alt-Svc", "h3=\":443\"; ma=2592000"],
136+
["Content-Type", "application/json"],
137+
["Date", "Tue, 25 Jun 2024 08:02:26 GMT"],
138+
["Vary", "Accept-Encoding"],
139+
["Transfer-Encoding", "chunked"]
140+
]
160141
}
161142
```
162143

@@ -244,9 +225,9 @@ Specifically, this example is for Azure API Management:
244225

245226
The `status_code_resolver` is a tool that allows you to define error handling, that means how HTTP status codes from the API response are handled in Rossum.
246227

247-
* **error**: A list of status codes that should be considered as errors. They will cause the export process to fail and will be displayes as errors on the document in Rossum. The content of the error message is the content sent by the API.
248-
* **warning**: A list of status codes that should be considered warnings. They will NOT cause the export process to fail, but will be shown as warning message. The content of the warning message is the content sent by the API.
249-
* All other status codes will be considered successful.
228+
- **error**: A list of status codes that should be considered as errors. They will cause the export process to fail and will be displayes as errors on the document in Rossum. The content of the error message is the content sent by the API.
229+
- **warning**: A list of status codes that should be considered warnings. They will NOT cause the export process to fail, but will be shown as warning message. The content of the warning message is the content sent by the API.
230+
- All other status codes will be considered successful.
250231

251232
By default when no error handling by `status_code_resolver` is defined, all status codes are considered successful.
252233
The resolver only applies to the export request, not the authentication request.
@@ -267,16 +248,8 @@ Example configuration with status code resolver:
267248
},
268249
"export_reference_key": "export_annotation_to_xml_bas64",
269250
"status_code_resolver": {
270-
"error": [
271-
403,
272-
500
273-
],
274-
"warning": [
275-
201,
276-
202,
277-
204,
278-
206
279-
]
251+
"error": [403, 500],
252+
"warning": [201, 202, 204, 206]
280253
},
281254
"response_headers_reference_key": "api_xml_export_reply_headers",
282255
"response_payload_reference_key": "api_xml_export_reply_payload"
@@ -289,43 +262,43 @@ Example configuration with status code resolver:
289262

290263
The export object consists of the following parameters:
291264

292-
| Attribute | Type | Description |
293-
|--------------------------------|--------|------------------------------------------------------------------------------------------------|
294-
| `export_reference_key` | str | A unique key referencing the exported data prepared by the [Custom format templating extension](./custom-format-templating.md). |
295-
| `request` | object | Defines the REST API request (URL, method, headers, and body content). |
296-
| `auth` *(optional)* | object | Configuration for authentication, supporting OAuth2. |
297-
| `condition` *(optional)* | str | Reference to a `schema_id` in `annotation.content` controlling execution. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition definition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"` |
298-
| `response_headers_reference_key` *(optional)* | str | Key to store API response headers (including `status_code`). |
299-
| `response_payload_reference_key` *(optional)* | str | Key to store the full response body from the API. |
300-
| `status_code_resolver` *(optional)* | object | Defines status code handling. |
265+
| Attribute | Type | Description |
266+
| --------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
267+
| `export_reference_key` | str | A unique key referencing the exported data prepared by the [Custom format templating extension](./custom-format-templating.md). |
268+
| `request` | object | Defines the REST API request (URL, method, headers, and body content). |
269+
| `auth` _(optional)_ | object | Configuration for authentication, supporting OAuth2. |
270+
| `condition` _(optional)_ | str | Reference to a `schema_id` in `annotation.content` controlling execution. When it's empty or "false" (case insensitive), this section won't be evaluated. Otherwise, it will proceed. The condition definition follows the [JSON templating](./../json-templating/index.md) syntax e.g. `"condition": "@{api_gate}"` |
271+
| `response_headers_reference_key` _(optional)_ | str | Key to store API response headers (including `status_code`). |
272+
| `response_payload_reference_key` _(optional)_ | str | Key to store the full response body from the API. |
273+
| `status_code_resolver` _(optional)_ | object | Defines status code handling. |
301274

302275
### Request Object
303276

304277
The `request` object contains parameters defining the HTTP request:
305278

306-
| Attribute | Type | Description |
307-
|---------------|--------|-------------------------------------------------------------------|
308-
| `url` | str | The target API endpoint URL. |
309-
| `method` | str | The HTTP method (`POST`, `PUT`, etc.). |
310-
| `headers` | object | HTTP headers for the request. |
311-
| `content` | str | The body of the request (supports placeholders like `#{file_content}`). |
279+
| Attribute | Type | Description |
280+
| --------- | ------ | ----------------------------------------------------------------------- |
281+
| `url` | str | The target API endpoint URL. |
282+
| `method` | str | The HTTP method (`POST`, `PUT`, etc.). |
283+
| `headers` | object | HTTP headers for the request. |
284+
| `content` | str | The body of the request (supports placeholders like `#{file_content}`). |
312285

313286
### Authentication Object (`auth`)
314287

315288
The authentication object defines how credentials are used to obtain an access token.
316289

317-
| Attribute | Type | Description |
318-
|---------------|--------|-------------------------------------------------------------------|
319-
| `url` | str | The authentication endpoint URL. |
320-
| `method` | str | The HTTP method (`POST`, `GET`, etc.). |
321-
| `headers` | object | Headers for authentication request. |
322-
| `data` | object | Credentials and grant type for authentication. |
290+
| Attribute | Type | Description |
291+
| --------- | ------ | ---------------------------------------------- |
292+
| `url` | str | The authentication endpoint URL. |
293+
| `method` | str | The HTTP method (`POST`, `GET`, etc.). |
294+
| `headers` | object | Headers for authentication request. |
295+
| `data` | object | Credentials and grant type for authentication. |
323296

324297
### Status Code Resolver Object
325298

326299
Dictionary defining how to to handle different HTTP status codes in Rossum.
327300

328-
| Attribute | Type | Description |
329-
|---------------|--------|-------------------------------------------------------------------|
330-
| `error` | list of integers | List of error status codes (export fails). |
331-
| `warning` | list of integers | List of warning status codes (export continues with warning). |
301+
| Attribute | Type | Description |
302+
| --------- | ---------------- | ------------------------------------------------------------- |
303+
| `error` | list of integers | List of error status codes (export fails). |
304+
| `warning` | list of integers | List of warning status codes (export continues with warning). |

0 commit comments

Comments
 (0)