Socket
Socket
Sign inDemoInstall

@regulaforensics/document-reader-webclient

Package Overview
Dependencies
13
Maintainers
4
Versions
76
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.6.0 to 6.6.1-beta.0

dist/main/index.cjs

69

package.json
{
"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))
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc