@regulaforensics/document-reader-webclient
Advanced tools
Comparing version 6.6.0 to 6.6.1-beta.0
{ | ||
"name": "@regulaforensics/document-reader-webclient", | ||
"version": "6.6.0", | ||
"source": "src/index.ts", | ||
"browserslist": [ | ||
"> 0.2%", | ||
"not dead" | ||
], | ||
"version": "6.6.1-beta.0", | ||
"description": "Regula Document Reader js client for the browser and node.js based on axios", | ||
@@ -18,30 +23,52 @@ "author": "Regula Forensics, Inc.", | ||
}, | ||
"type": "module", | ||
"main": "./dist/cjs-es5/index.js", | ||
"module": "./dist/esm-es5/index.js", | ||
"exports": { | ||
"./esm": "./dist/esm-es5/index.js", | ||
".": "./dist/cjs-es5/index.js" | ||
"import": "./dist/module/index.js", | ||
"require": "./dist/main/index.cjs" | ||
}, | ||
"typings": "./src/index.ts", | ||
"main": "dist/main/index.cjs", | ||
"module": "dist/module/index.js", | ||
"type": "module", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"lib" | ||
], | ||
"targets": { | ||
"main": { | ||
"optimize": true | ||
}, | ||
"module": { | ||
"optimize": true | ||
} | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf ./dist", | ||
"build-cjs": "tsc --project tsconfig.commonjs.json", | ||
"build-esm": "tsc --project tsconfig.esm.json", | ||
"format": "eslint --fix ./src --ext .ts", | ||
"build": "npm run clean && npm run format && npm run build-cjs && npm run build-esm && echo '{\"type\": \"commonjs\"}' > ./dist/cjs-es5/package.json" | ||
"check-types": "tsc --noEmit", | ||
"format": "eslint --fix", | ||
"build": "parcel build --no-source-maps --no-cache", | ||
"prepare": "husky install" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts}": "eslint --fix" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.4", | ||
"base64-arraybuffer": "^0.2.0", | ||
"pako": "^2.0.3" | ||
"@swc/helpers": "^0.5.3", | ||
"axios": "^1.6.1", | ||
"base64-arraybuffer": "^1.0.2", | ||
"pako": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/pako": "^1.0.1", | ||
"@typescript-eslint/eslint-plugin": "^3.5.0", | ||
"@typescript-eslint/parser": "^3.5.0", | ||
"eslint": "^7.4.0", | ||
"eslint-plugin-unused-imports": "^0.1.3", | ||
"typescript": "^3.9.6" | ||
"@parcel/packager-ts": "^2.10.3", | ||
"@parcel/transformer-typescript-types": "^2.10.3", | ||
"@types/pako": "^2.0.1", | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
"@typescript-eslint/parser": "^6.8.0", | ||
"eslint": "^8.51.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^15.0.1", | ||
"parcel": "^2.10.3", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.3.2" | ||
} | ||
} |
@@ -13,5 +13,5 @@ # Regula Document Reader js client for the browser and node.js based on axios | ||
through a [GitHub issue](https://github.com/regulaforensics/DocumentReader-api-js-client/issues). | ||
You are invited to contribute [new features, fixes, or updates](https://github.com/regulaforensics/DocumentReader-api-js-clien/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), large or small; | ||
You are invited to contribute new features, fixes, or updates, large or small. | ||
We are always thrilled to receive pull requests, and do our best to process them as fast as we can. | ||
See [dev guide](./dev.md) | ||
See [dev guide](https://github.com/regulaforensics/DocumentReader-web-js-client/blob/master/dev.md) | ||
@@ -23,13 +23,13 @@ ## Install package | ||
``` | ||
## Example | ||
## Basic Example | ||
Performing request: | ||
```js | ||
import {DocumentReaderApi, TextFieldType, GraphicFieldType} from '@regulaforensics/document-reader-webclient' | ||
const {DOCUMENT_NUMBER, SURNAME_AND_GIVEN_NAMES, DATE_OF_BIRTH} = TextFieldType | ||
const {PORTRAIT, SIGNATURE} = GraphicFieldType | ||
import { DocumentReaderApi, Scenario, TextFieldType, GraphicFieldType } from '@regulaforensics/document-reader-webclient'; | ||
const { DOCUMENT_NUMBER, SURNAME_AND_GIVEN_NAMES, DATE_OF_BIRTH } = TextFieldType; | ||
const { PORTRAIT, SIGNATURE } = GraphicFieldType; | ||
const imageAsBase64String = getDocImageAsBase64String() | ||
const api = new DocumentReaderApi({basePath: "http://localhost:8080"}) | ||
const result = await api.process({images: [imageAsBase64String]}) | ||
const imageAsBase64String = getDocImageAsBase64String(); | ||
const api = new DocumentReaderApi({ basePath: 'http://localhost:8080' }); | ||
const result = await api.process({ images: [documentImage], processParam: { scenario: Scenario.FULL_PROCESS} }); | ||
``` | ||
@@ -40,11 +40,12 @@ | ||
// text fields | ||
const docNumber = result.text.getField(DOCUMENT_NUMBER) | ||
const fullName = result.text.getField(SURNAME_AND_GIVEN_NAMES) | ||
const dateOfBirth = result.text.getField(DATE_OF_BIRTH) | ||
const docNumber = result.text?.getField(DOCUMENT_NUMBER); | ||
const fullName = result.text?.getField(SURNAME_AND_GIVEN_NAMES); | ||
const dateOfBirth = result.text?.getField(DATE_OF_BIRTH); | ||
// graphics fields | ||
const portraitAsBase64 = result.images.getField(PORTRAIT) | ||
const signatureAsBase64 = result.images.getField(SIGNATURE) | ||
const portraitAsBase64 = result.images?.getField(PORTRAIT); | ||
const signatureAsBase64 = result.images?.getField(SIGNATURE); | ||
``` | ||
## Compatibility | ||
@@ -54,3 +55,3 @@ | ||
* ES5 with some ES6 features [Promise] and whatwg **URL**. If your environment doesn't support ES6 required features, you can polyfill. | ||
* nodejs 10+ | ||
* nodejs 18+ | ||
@@ -62,2 +63,2 @@ Module system | ||
Definitions | ||
* TypeScript's definitions should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) | ||
* TypeScript's definitions should be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package)) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 2 instances in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 3 instances in 1 package
0
100
60
477195
4
13
5
10313
2
1
+ Added@swc/helpers@^0.5.3
+ Added@swc/helpers@0.5.11(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.6.8(transitive)
+ Addedbase64-arraybuffer@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedtslib@2.6.2(transitive)
- Removedaxios@0.21.4(transitive)
- Removedbase64-arraybuffer@0.2.0(transitive)
Updatedaxios@^1.6.1
Updatedbase64-arraybuffer@^1.0.2
Updatedpako@^2.1.0