Skip to content

Commit a141c35

Browse files
Merge pull request #215 from regulaforensics/feature/SP-21988
SP-21988 - add health()
2 parents 90eaca6 + bc92b43 commit a141c35

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

examples/auth/client/encrypted-rcl-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const { DOCUMENT_NUMBER } = TextFieldType;
2222

2323
api.setLicense(license);
2424

25-
const serverInfo = await api.ping();
25+
const serverInfo = await api.health();
2626

2727
const license_file = fs.readFileSync('license.txt', 'utf8');
2828
const encrypted_rcl = fs.readFileSync('encrypted-rcl.txt', 'utf8');

examples/auth/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const api = new DocumentReaderApi({
5555
// Uncomment the line below if you want to transfer the license with each request
5656
// api.setLicense(license);
5757

58-
const serverInfo = await api.ping();
58+
const serverInfo = await api.health();
5959

6060
const white_page_0 = fs.readFileSync('WHITE.jpg').buffer;
6161

examples/basic/encrypted-rcl-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const { DOCUMENT_NUMBER } = TextFieldType;
2222

2323
api.setLicense(license);
2424

25-
const serverInfo = await api.ping();
25+
const serverInfo = await api.health();
2626

2727
const license_file = fs.readFileSync('license.txt', 'utf8');
2828
const encrypted_rcl = fs.readFileSync('encrypted-rcl.txt', 'utf8');

examples/basic/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const api = new DocumentReaderApi({ basePath: apiBasePath });
1919
// Uncomment the line below if you want to transfer the license with each request
2020
// api.setLicense(license);
2121

22-
const serverInfo = await api.ping();
22+
const serverInfo = await api.health();
2323

2424
const white_page_0 = fs.readFileSync('WHITE.jpg').buffer;
2525

src/ext/document-reader.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { DefaultApi } from '../api/default-api';
22
import { ProcessApi } from '../api/process-api';
3+
import { HealthcheckApi } from '../api/healthcheck-api';
34
import { TransactionApi } from '../api/transaction-api';
45
import { Response } from './process-response';
56
import { Configuration, ConfigurationParameters } from '../configuration';
@@ -16,13 +17,15 @@ import {
1617
InlineResponse200,
1718
ListTransactionsByTagResponse,
1819
TransactionProcessGetResponse,
20+
Healthcheck,
1921
} from '../models';
2022
import { Base64String, instanceOfProcessRequest, ProcessRequestExt } from './process-request-ext';
2123
import { ProcessRequestImageWrapper } from './process-request-image-wrapper';
2224
import * as converter from 'base64-arraybuffer';
2325

2426
export class DocumentReaderApi {
2527
private readonly defaultApi: DefaultApi;
28+
private readonly healthcheckApi: HealthcheckApi;
2629
private readonly processApi: ProcessApi;
2730
private readonly transactionApi: TransactionApi;
2831

@@ -34,6 +37,7 @@ export class DocumentReaderApi {
3437
axios: AxiosInstance = globalAxios,
3538
) {
3639
this.defaultApi = new DefaultApi(new Configuration(configuration), basePath, axios);
40+
this.healthcheckApi = new HealthcheckApi(new Configuration(configuration), basePath, axios);
3741
this.processApi = new ProcessApi(new Configuration(configuration), basePath, axios);
3842
this.transactionApi = new TransactionApi(new Configuration(configuration), basePath, axios);
3943
}
@@ -43,6 +47,11 @@ export class DocumentReaderApi {
4347
return axiosResult.data;
4448
}
4549

50+
async health(xRequestID?: string): Promise<Healthcheck> {
51+
const axiosResult = await this.healthcheckApi.healthz(xRequestID);
52+
return axiosResult.data;
53+
}
54+
4655
/**
4756
*
4857
* @summary Process list of documents images and return extracted data

0 commit comments

Comments
 (0)