@privateid/cryptonets-web-sdk
Advanced tools
Comparing version 4.6.11 to 4.6.12
@@ -23,12 +23,14 @@ import { LOGTYPE } from './types'; | ||
const createCallbackIsValid = ({ callback, returnType }) => (operation, id, response_str) => { | ||
var _a, _b, _c, _d, _e, _f; | ||
const isResponse = response_str.length > 0; | ||
printLogs('================[JS RESPONSE]: response_str', isResponse ? JSON.parse(response_str) : '', LOGTYPE.LOG); | ||
printLogs('[JS RESPONSE]: operation', operation || 'null', LOGTYPE.LOG); | ||
printLogs('[JS RESPONSE]: id', id || 'null', LOGTYPE.LOG); | ||
console.log('================[JS RESPONSE]: response_str', isResponse ? JSON.parse(response_str) : ''); //, LOGTYPE.LOG); | ||
console.log('[JS RESPONSE]: operation', operation || 'null'); //, LOGTYPE.LOG); | ||
console.log('[JS RESPONSE]: id', id || 'null'); //, LOGTYPE.LOG); | ||
if (isResponse) { | ||
const returnValue = JSON.parse(response_str); | ||
const returnData = { | ||
call_status: returnValue.call_status.return_status, | ||
face_validation_status: returnValue.faces.faces[0].face_validation_status, | ||
antispoof_status: returnValue.faces.faces[0].antispoofing_status, | ||
call_status: (_a = returnValue === null || returnValue === void 0 ? void 0 : returnValue.call_status) === null || _a === void 0 ? void 0 : _a.return_status, | ||
face_validation_status: (_c = (_b = returnValue.faces) === null || _b === void 0 ? void 0 : _b.faces[0]) === null || _c === void 0 ? void 0 : _c.face_validation_status, | ||
antispoof_status: (_e = (_d = returnValue.faces) === null || _d === void 0 ? void 0 : _d.faces[0]) === null || _e === void 0 ? void 0 : _e.antispoofing_status, | ||
face_detected: ((_f = returnValue === null || returnValue === void 0 ? void 0 : returnValue.faces) === null || _f === void 0 ? void 0 : _f.faces[0]) ? true : false | ||
}; | ||
@@ -35,0 +37,0 @@ if (operation === 'is_valid') { |
/* eslint-disable default-param-last */ | ||
/* eslint-disable import/no-mutable-exports */ | ||
export let apiUrl = process.env.REACT_APP_API_URL; | ||
export let orchestrationAPIUrl = process.env.REACT_APP_API_ORCHESTRATION; | ||
export let orchestrationApiKey = process.env.REACT_APP_API_ORCHESTRATION_API_KEY; | ||
export let apiKey = process.env.REACT_APP_API_KEY; | ||
export let wasmUrl = process.env.REACT_APP_API_URL_WASM || process.env.REACT_APP_API_URL; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
export let apiUrl = (_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.REACT_APP_API_URL; | ||
export let orchestrationAPIUrl = (_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.REACT_APP_API_ORCHESTRATION; | ||
export let orchestrationApiKey = (_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c.REACT_APP_API_ORCHESTRATION_API_KEY; | ||
export let apiKey = (_d = process === null || process === void 0 ? void 0 : process.env) === null || _d === void 0 ? void 0 : _d.REACT_APP_API_KEY; | ||
export let wasmUrl = ((_e = process === null || process === void 0 ? void 0 : process.env) === null || _e === void 0 ? void 0 : _e.REACT_APP_API_URL_WASM) || ((_f = process === null || process === void 0 ? void 0 : process.env) === null || _f === void 0 ? void 0 : _f.REACT_APP_API_URL); | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
export let cacheConfig = process.env.REACT_APP_SET_CACHE ? JSON.parse(process.env.REACT_APP_SET_CACHE) : true; | ||
export let cacheConfig = ((_g = process === null || process === void 0 ? void 0 : process.env) === null || _g === void 0 ? void 0 : _g.REACT_APP_SET_CACHE) ? JSON.parse((_h = process === null || process === void 0 ? void 0 : process.env) === null || _h === void 0 ? void 0 : _h.REACT_APP_SET_CACHE) : true; | ||
export const setEnvVariables = (api_key, api_url = null, api_orchestration_url = null, wasm_url = null, cache_config, api_orchestration_api_key = null) => { | ||
@@ -12,0 +13,0 @@ if (api_key) { |
@@ -15,3 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { LOGTYPE } from './types'; | ||
// console.log(process.env) | ||
console.log(process.env); | ||
const functions = wrap(new Worker('/workers/wasm.worker.js')); | ||
@@ -18,0 +18,0 @@ export const { isLoad, isValidInternal, prividAgePredict, FHE_enrollOnefa, FHE_predictOnefa, scanDocument, scanDocumentNoFace, deleteUUID, isValidBarCode, prividFaceISO, prividFaceCompareLocal, prividDocumentMugshotFaceCompare, antispoofCheck, } = functions; |
@@ -5,3 +5,3 @@ { | ||
"description": "CryptoNets WebAssembly SDK", | ||
"version": "4.6.11", | ||
"version": "4.6.12", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "Face recognition", |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
43726494
7018
3