Skip to content

Commit 0e438ba

Browse files
authored
rl-6/master-smoke-test MasterSmokeTest: (#6)
1 parent 86d0191 commit 0e438ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+335
-135
lines changed

.github/workflows/npm-publish.yml

100644100755
File mode changed.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: run smoke test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
run_smoke_test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v1
17+
with:
18+
node-version: 14
19+
registry-url: https://registry.npmjs.org/
20+
- run: npm install
21+
- run: npm run build
22+
- run: npm install
23+
working-directory: ./example
24+
- run: node index.js
25+
working-directory: ./example
26+
env:
27+
API_BASE_PATH: "http://test-api.regulaforensics.com"
28+
TEST_LICENSE: ${{secrets.TEST_LICENSE}}

example/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ const {DOCUMENT_NUMBER} = TextFieldType;
55

66

77
(async () => {
8+
let apiBasePath = process.env.API_BASE_PATH || "http://localhost:8080"
9+
const license = process.env.TEST_LICENSE // optional, used here only for smoke test purposes
10+
11+
const api = new DocumentReaderApi({basePath: apiBasePath});
12+
api.setLicense(license) // used here only for smoke test purposes, most of clients will attach license on server side
13+
814
const raw_image = fs.readFileSync('australia_passport.jpg').buffer
9-
const api = new DocumentReaderApi({basePath: "http://localhost:8080"});
1015

1116
const response = await api.process({
1217
images: [raw_image],

example/package-lock.json

100644100755
File mode changed.

generator-templates/modelIndex.mustache

100644100755
File mode changed.

src/.openapi-generator/FILES

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
base.ts
22
configuration.ts
33
models/available-source.ts
4-
models/barcode-text-data-result.ts
54
models/check-result.ts
65
models/chosen-document-type-result-all-of.ts
76
models/chosen-document-type-result.ts
87
models/container-list.ts
98
models/cross-source-value-comparison.ts
109
models/details-optical.ts
1110
models/details-rfid.ts
11+
models/doc-visual-extended-field.ts
1212
models/doc-visual-extended-info.ts
1313
models/document-format.ts
1414
models/document-type-recognition-result.ts
1515
models/document-type.ts
1616
models/document-types-candidates-list.ts
1717
models/document-types-candidates-result-all-of.ts
1818
models/document-types-candidates-result.ts
19-
models/extended-rfid-text-field-all-of.ts
20-
models/extended-rfid-text-field.ts
21-
models/extended-text-field.ts
22-
models/extended-visual-text-field-all-of.ts
23-
models/extended-visual-text-field.ts
2419
models/graphic-field-type.ts
2520
models/graphic-field.ts
2621
models/graphic-fields-list.ts
@@ -33,22 +28,19 @@ models/lexical-analysis-result-all-of.ts
3328
models/lexical-analysis-result.ts
3429
models/light.ts
3530
models/list-verified-fields.ts
36-
models/mrz-ocr-extended-result-all-of.ts
37-
models/mrz-ocr-extended-result.ts
3831
models/one-candidate.ts
3932
models/process-params.ts
4033
models/process-request-image.ts
4134
models/process-request.ts
4235
models/process-response.ts
36+
models/process-system-info.ts
4337
models/processing-status.ts
44-
models/raw-image-container.ts
4538
models/raw-image-result-all-of.ts
4639
models/raw-image-result.ts
4740
models/rectangle-coordinates.ts
4841
models/result-item.ts
4942
models/result.ts
5043
models/rfid-location.ts
51-
models/rfid-text-data-result.ts
5244
models/scenario.ts
5345
models/source-validity.ts
5446
models/source.ts
@@ -58,6 +50,8 @@ models/status.ts
5850
models/string-recognition-result.ts
5951
models/symbol-candidate.ts
6052
models/symbol-recognition-result.ts
53+
models/text-data-result-all-of.ts
54+
models/text-data-result.ts
6155
models/text-field-type.ts
6256
models/text-field-value.ts
6357
models/text-field.ts
@@ -68,4 +62,3 @@ models/tfdsidlist.ts
6862
models/transaction-info.ts
6963
models/verification-result.ts
7064
models/verified-field-map.ts
71-
models/visual-ocr-extended-result.ts

src/ext/document-reader.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import converter from "base64-arraybuffer";
1313

1414
export class DocumentReaderApi extends DefaultApi {
1515

16+
private license: string | undefined
17+
1618
constructor(configuration?: Configuration, basePath: string = BASE_PATH, axios: AxiosInstance = globalAxios) {
1719
super(configuration, basePath, axios)
1820
}
@@ -32,10 +34,22 @@ export class DocumentReaderApi extends DefaultApi {
3234
resultTypeOutput: [Result.TEXT]
3335
}
3436
}
37+
if (!processRequest.systemInfo) {
38+
processRequest.systemInfo = {}
39+
}
40+
processRequest.systemInfo.license = this.license
3541

3642
return super.apiProcess(requestToBaseRequest(processRequest), options)
3743
.then((axiosResult) => new Response(axiosResult.data));
3844
}
45+
46+
public getLicense(): string | undefined {
47+
return this.license
48+
}
49+
50+
public setLicense(license: string): void {
51+
this.license = license
52+
}
3953
}
4054

4155

src/ext/graphics.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/ext/index.ts

100644100755
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './document-reader.js';
2-
export * from './graphics.js';
32
export * from './process-request.js';
43
export * from './process-request-image.js';
54
export * from './process-response.js';

src/ext/process-request.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ProcessParams} from "../models/index.js";
1+
import {ProcessParams, ProcessSystemInfo} from "../models/index.js";
22
import {ProcessRequestImage} from "./process-request-image.js";
33

44
export type Base64String = string;
@@ -18,6 +18,13 @@ export interface ProcessRequest {
1818
* @memberof ProcessRequest
1919
*/
2020
images: Array<ProcessRequestImage | ArrayBuffer | Base64String>;
21+
22+
/**
23+
*
24+
* @type {ProcessParams}
25+
* @memberof ProcessRequest
26+
*/
27+
systemInfo?: ProcessSystemInfo;
2128
}
2229

2330

0 commit comments

Comments
 (0)