@ha_tecno/live-id-sdk 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js +5 -4
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -1
- package/lib/commonjs/screens/FingerRegister/FingerRegister.js +6 -5
- package/lib/commonjs/screens/FingerRegister/FingerRegister.js.map +1 -1
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js +7 -4
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/commonjs/store/modules/fingerAuth/slice.js +9 -1
- package/lib/commonjs/store/modules/fingerAuth/slice.js.map +1 -1
- package/lib/commonjs/store/modules/fingerRegister/slice.js +9 -1
- package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -1
- package/lib/commonjs/store/modules/lifeCertificate/slice.js +11 -1
- package/lib/commonjs/store/modules/lifeCertificate/slice.js.map +1 -1
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/utils.js +11 -0
- package/lib/commonjs/utils/utils.js.map +1 -0
- package/lib/module/screens/FingerAuth/FingerAuth.js +5 -4
- package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -1
- package/lib/module/screens/FingerRegister/FingerRegister.js +6 -5
- package/lib/module/screens/FingerRegister/FingerRegister.js.map +1 -1
- package/lib/module/screens/LifeCertificate/LifeCertificate.js +7 -4
- package/lib/module/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/module/store/modules/fingerAuth/slice.js +9 -1
- package/lib/module/store/modules/fingerAuth/slice.js.map +1 -1
- package/lib/module/store/modules/fingerRegister/slice.js +9 -1
- package/lib/module/store/modules/fingerRegister/slice.js.map +1 -1
- package/lib/module/store/modules/lifeCertificate/slice.js +12 -2
- package/lib/module/store/modules/lifeCertificate/slice.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/utils.js +5 -0
- package/lib/module/utils/utils.js.map +1 -0
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts +2 -1
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -1
- package/lib/typescript/src/screens/FingerRegister/FingerRegister.d.ts +2 -1
- package/lib/typescript/src/screens/FingerRegister/FingerRegister.d.ts.map +1 -1
- package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts +2 -1
- package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts +1 -1
- package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts +1 -1
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/utils.d.ts +3 -0
- package/lib/typescript/src/utils/utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/screens/FingerAuth/FingerAuth.tsx +5 -4
- package/src/screens/FingerRegister/FingerRegister.tsx +6 -5
- package/src/screens/LifeCertificate/LifeCertificate.tsx +8 -4
- package/src/store/modules/fingerAuth/slice.ts +9 -1
- package/src/store/modules/fingerAuth/type.ts +1 -1
- package/src/store/modules/fingerRegister/slice.ts +9 -1
- package/src/store/modules/fingerRegister/types.ts +1 -1
- package/src/store/modules/lifeCertificate/slice.ts +11 -2
- package/src/store/modules/lifeCertificate/types.ts +1 -0
- package/src/utils/index.ts +2 -1
- package/src/utils/utils.ts +5 -0
- package/lib/commonjs/utils/file.js +0 -38
- package/lib/commonjs/utils/file.js.map +0 -1
- package/lib/module/utils/file.js +0 -29
- package/lib/module/utils/file.js.map +0 -1
- package/lib/typescript/src/utils/file.d.ts +0 -3
- package/lib/typescript/src/utils/file.d.ts.map +0 -1
- package/src/utils/file.ts +0 -30
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.validarBase64 = exports.encodeImageToBase64 = void 0;
|
|
7
|
-
var _reactNativeFs = _interopRequireDefault(require("react-native-fs"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
const encodeImageToBase64 = async imagePath => {
|
|
10
|
-
try {
|
|
11
|
-
const imageData = await _reactNativeFs.default.readFile(imagePath, "base64");
|
|
12
|
-
return imageData;
|
|
13
|
-
} catch (error) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
exports.encodeImageToBase64 = encodeImageToBase64;
|
|
18
|
-
const validarBase64 = array => {
|
|
19
|
-
// Verifica se o argumento é um array e tem exatamente 3 elementos
|
|
20
|
-
if (!Array.isArray(array) || array.length !== 3) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Regex para validar base64
|
|
25
|
-
const base64Regex = /^[a-zA-Z0-9+/]*={0,2}$/;
|
|
26
|
-
|
|
27
|
-
// Verifica se cada elemento do array é uma string válida em base64
|
|
28
|
-
for (let i = 0; i < array.length; i++) {
|
|
29
|
-
if (typeof array[i] !== "string" || !base64Regex.test(array[i])) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Se chegou até aqui, o array é válido
|
|
35
|
-
return true;
|
|
36
|
-
};
|
|
37
|
-
exports.validarBase64 = validarBase64;
|
|
38
|
-
//# sourceMappingURL=file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeFs","_interopRequireDefault","require","obj","__esModule","default","encodeImageToBase64","imagePath","imageData","RNFS","readFile","error","exports","validarBase64","array","Array","isArray","length","base64Regex","i","test"],"sourceRoot":"../../../src","sources":["utils/file.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE5B,MAAMG,mBAAmB,GAAG,MAAOC,SAAiB,IAAK;EAC9D,IAAI;IACF,MAAMC,SAAS,GAAG,MAAMC,sBAAI,CAACC,QAAQ,CAACH,SAAS,EAAE,QAAQ,CAAC;IAC1D,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOG,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF,CAAC;AAACC,OAAA,CAAAN,mBAAA,GAAAA,mBAAA;AAEK,MAAMO,aAAa,GAAIC,KAAqB,IAAK;EACtD;EACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAIA,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IAC/C,OAAO,KAAK;EACd;;EAEA;EACA,MAAMC,WAAW,GAAG,wBAAwB;;EAE5C;EACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,KAAK,CAACG,MAAM,EAAEE,CAAC,EAAE,EAAE;IACrC,IAAI,OAAOL,KAAK,CAACK,CAAC,CAAC,KAAK,QAAQ,IAAI,CAACD,WAAW,CAACE,IAAI,CAACN,KAAK,CAACK,CAAC,CAAC,CAAC,EAAE;MAC/D,OAAO,KAAK;IACd;EACF;;EAEA;EACA,OAAO,IAAI;AACb,CAAC;AAACP,OAAA,CAAAC,aAAA,GAAAA,aAAA"}
|
package/lib/module/utils/file.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import RNFS from "react-native-fs";
|
|
2
|
-
export const encodeImageToBase64 = async imagePath => {
|
|
3
|
-
try {
|
|
4
|
-
const imageData = await RNFS.readFile(imagePath, "base64");
|
|
5
|
-
return imageData;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
export const validarBase64 = array => {
|
|
11
|
-
// Verifica se o argumento é um array e tem exatamente 3 elementos
|
|
12
|
-
if (!Array.isArray(array) || array.length !== 3) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Regex para validar base64
|
|
17
|
-
const base64Regex = /^[a-zA-Z0-9+/]*={0,2}$/;
|
|
18
|
-
|
|
19
|
-
// Verifica se cada elemento do array é uma string válida em base64
|
|
20
|
-
for (let i = 0; i < array.length; i++) {
|
|
21
|
-
if (typeof array[i] !== "string" || !base64Regex.test(array[i])) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Se chegou até aqui, o array é válido
|
|
27
|
-
return true;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["RNFS","encodeImageToBase64","imagePath","imageData","readFile","error","validarBase64","array","Array","isArray","length","base64Regex","i","test"],"sourceRoot":"../../../src","sources":["utils/file.ts"],"mappings":"AAAA,OAAOA,IAAI,MAAM,iBAAiB;AAElC,OAAO,MAAMC,mBAAmB,GAAG,MAAOC,SAAiB,IAAK;EAC9D,IAAI;IACF,MAAMC,SAAS,GAAG,MAAMH,IAAI,CAACI,QAAQ,CAACF,SAAS,EAAE,QAAQ,CAAC;IAC1D,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAIC,KAAqB,IAAK;EACtD;EACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IAAIA,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IAC/C,OAAO,KAAK;EACd;;EAEA;EACA,MAAMC,WAAW,GAAG,wBAAwB;;EAE5C;EACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,KAAK,CAACG,MAAM,EAAEE,CAAC,EAAE,EAAE;IACrC,IAAI,OAAOL,KAAK,CAACK,CAAC,CAAC,KAAK,QAAQ,IAAI,CAACD,WAAW,CAACE,IAAI,CAACN,KAAK,CAACK,CAAC,CAAC,CAAC,EAAE;MAC/D,OAAO,KAAK;IACd;EACF;;EAEA;EACA,OAAO,IAAI;AACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/utils/file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,cAAqB,MAAM,2BAO1D,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,MAAM,GAAG,GAAG,EAAE,YAkBlD,CAAC"}
|
package/src/utils/file.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import RNFS from "react-native-fs";
|
|
2
|
-
|
|
3
|
-
export const encodeImageToBase64 = async (imagePath: string) => {
|
|
4
|
-
try {
|
|
5
|
-
const imageData = await RNFS.readFile(imagePath, "base64");
|
|
6
|
-
return imageData;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const validarBase64 = (array: string | any[]) => {
|
|
13
|
-
// Verifica se o argumento é um array e tem exatamente 3 elementos
|
|
14
|
-
if (!Array.isArray(array) || array.length !== 3) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Regex para validar base64
|
|
19
|
-
const base64Regex = /^[a-zA-Z0-9+/]*={0,2}$/;
|
|
20
|
-
|
|
21
|
-
// Verifica se cada elemento do array é uma string válida em base64
|
|
22
|
-
for (let i = 0; i < array.length; i++) {
|
|
23
|
-
if (typeof array[i] !== "string" || !base64Regex.test(array[i])) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Se chegou até aqui, o array é válido
|
|
29
|
-
return true;
|
|
30
|
-
};
|