@microblink/blinkcard-capacitor
Advanced tools
Comparing version 2.9.0 to 2.9.1
@@ -14,5 +14,7 @@ import { RecognizerCollection } from '../recognizer'; | ||
scanWithCamera(overlaySettings: OverlaySettings, recognizerCollection: RecognizerCollection, license: License): Promise<any>; | ||
scanWithDirectApi(license: License, recognizerCollection: RecognizerCollection, frontImage: string, backImage?: string): Promise<any>; | ||
} | ||
export interface BlinkCardPluginInterface { | ||
scanWithCamera(overlaySettings: OverlaySettings, recognizerCollection: RecognizerCollection, license: License): Promise<any>; | ||
scanWithDirectApi(license: License, recognizerCollection: RecognizerCollection, frontImage: string, backImage?: string): Promise<any>; | ||
} |
@@ -42,3 +42,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
scanWithDirectApi(license, recognizerCollection, frontImage, backImage) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let functions = []; | ||
for (let recognizer of recognizerCollection.recognizerArray) { | ||
let recognizerFunction = recognizer.createResultFromNative; | ||
functions.push(recognizerFunction); | ||
delete recognizer.createResultFromNative; | ||
} | ||
const response = yield BlinkCardCapacitorPlugin.scanWithDirectApi({ 'license': license, 'recognizerCollection': recognizerCollection, 'frontImage': frontImage, 'backImage': backImage }); | ||
const results = response.resultList; | ||
const isCancelled = response.cancelled; | ||
let resultsFromNative = []; | ||
if (!isCancelled && results) { | ||
for (let i = 0; i < results.length; ++i) { | ||
recognizerCollection.recognizerArray[i].createResultFromNative = functions[i]; | ||
let result = recognizerCollection.recognizerArray[i].createResultFromNative(results[i]); | ||
if (result.resultState != 0 /* empty */) { | ||
resultsFromNative.push(result); | ||
} | ||
} | ||
} | ||
return resultsFromNative; | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -44,2 +44,26 @@ var capacitorPlugin = (function (exports, core) { | ||
} | ||
scanWithDirectApi(license, recognizerCollection, frontImage, backImage) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let functions = []; | ||
for (let recognizer of recognizerCollection.recognizerArray) { | ||
let recognizerFunction = recognizer.createResultFromNative; | ||
functions.push(recognizerFunction); | ||
delete recognizer.createResultFromNative; | ||
} | ||
const response = yield BlinkCardCapacitorPlugin.scanWithDirectApi({ 'license': license, 'recognizerCollection': recognizerCollection, 'frontImage': frontImage, 'backImage': backImage }); | ||
const results = response.resultList; | ||
const isCancelled = response.cancelled; | ||
let resultsFromNative = []; | ||
if (!isCancelled && results) { | ||
for (let i = 0; i < results.length; ++i) { | ||
recognizerCollection.recognizerArray[i].createResultFromNative = functions[i]; | ||
let result = recognizerCollection.recognizerArray[i].createResultFromNative(results[i]); | ||
if (result.resultState != 0 /* empty */) { | ||
resultsFromNative.push(result); | ||
} | ||
} | ||
} | ||
return resultsFromNative; | ||
}); | ||
} | ||
} | ||
@@ -46,0 +70,0 @@ |
{ | ||
"name": "@microblink/blinkcard-capacitor", | ||
"version": "2.9.0", | ||
"version": "2.9.1", | ||
"description": "AI-driven credit card scanning for cross-platform apps built with Capacitor.", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1499
0
370870
91