react-native-zyprotectabio-module 0.1.0 → 0.1.5

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.
Files changed (56) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +7 -158
  3. package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
  4. package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  7. package/android/.gradle/config.properties +1 -1
  8. package/android/.idea/caches/deviceStreaming.xml +1 -1
  9. package/android/.idea/gradle.xml +0 -1
  10. package/android/.idea/misc.xml +1 -0
  11. package/android/.project +17 -0
  12. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  13. package/android/build.gradle +111 -32
  14. package/android/gradle.properties +4 -5
  15. package/android/local.properties +1 -1
  16. package/android/src/main/AndroidManifest.xml +1 -4
  17. package/android/src/main/java/com/{zyprotectabiomodule/ZyBioProtectaReactNativeModuleModule.kt → reactnativezybanbifbiomodule/ZybanbifbioModuleModule.kt} +30 -15
  18. package/android/src/main/java/com/reactnativezybanbifbiomodule/ZybanbifbioModulePackage.kt +17 -0
  19. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/ErroresPantallaRN.kt +1 -1
  20. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/Opcional.kt +1 -1
  21. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/ScreenText.kt +1 -1
  22. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/StepperRN.kt +1 -1
  23. package/ios/ZybanbifbioModule-Bridging-Header.h +2 -0
  24. package/ios/ZybanbifbioModule.m +9 -0
  25. package/ios/ZybanbifbioModule.swift +8 -0
  26. package/ios/ZybanbifbioModule.xcodeproj/project.pbxproj +293 -0
  27. package/ios/ZybanbifbioModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  28. package/lib/commonjs/index.js +12 -0
  29. package/lib/commonjs/index.js.map +1 -0
  30. package/lib/module/index.js +6 -0
  31. package/lib/module/index.js.map +1 -0
  32. package/lib/typescript/index.d.ts +5 -0
  33. package/package.json +122 -29
  34. package/src/index.tsx +6 -19
  35. package/.gitattributes +0 -2
  36. package/CODE_OF_CONDUCT.md +0 -133
  37. package/CONTRIBUTING.md +0 -122
  38. package/android/.gradle/8.8/checksums/checksums.lock +0 -0
  39. package/android/.gradle/8.8/dependencies-accessors/gc.properties +0 -0
  40. package/android/.gradle/8.8/fileChanges/last-build.bin +0 -0
  41. package/android/.gradle/8.8/fileHashes/fileHashes.lock +0 -0
  42. package/android/.gradle/8.8/gc.properties +0 -0
  43. package/android/.idea/android.iml +0 -9
  44. package/android/.idea/modules.xml +0 -8
  45. package/android/src/main/AndroidManifestNew.xml +0 -2
  46. package/android/src/main/java/com/zyprotectabiomodule/ZyBioProtectaReactNativeModulePackage.kt +0 -26
  47. package/babel.config.js +0 -5
  48. package/ios/ZyBanbifBioRn.h +0 -12
  49. package/ios/ZyBanbifBioRn.m +0 -90
  50. package/lefthook.yml +0 -14
  51. package/react-native-zyprotectabio-module.podspec +0 -23
  52. package/scripts/postinstall.js +0 -50
  53. package/src/__tests__/index.test.tsx +0 -1
  54. package/tsconfig.build.json +0 -4
  55. package/tsconfig.json +0 -29
  56. package/turbo.json +0 -36
package/CONTRIBUTING.md DELETED
@@ -1,122 +0,0 @@
1
- # Contributing
2
-
3
- Contributions are always welcome, no matter how large or small!
4
-
5
- We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
6
-
7
- ## Development workflow
8
-
9
- This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
10
-
11
- - The library package in the root directory.
12
- - An example app in the `example/` directory.
13
-
14
- To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
15
-
16
- ```sh
17
- yarn
18
- ```
19
-
20
- > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
21
-
22
- The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
23
-
24
- It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
25
-
26
- If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ZyprotectabioModuleExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-zyprotectabio-module`.
27
-
28
- To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-zyprotectabio-module` under `Android`.
29
-
30
- You can use various commands from the root directory to work with the project.
31
-
32
- To start the packager:
33
-
34
- ```sh
35
- yarn example start
36
- ```
37
-
38
- To run the example app on Android:
39
-
40
- ```sh
41
- yarn example android
42
- ```
43
-
44
- To run the example app on iOS:
45
-
46
- ```sh
47
- yarn example ios
48
- ```
49
-
50
- Make sure your code passes TypeScript and ESLint. Run the following to verify:
51
-
52
- ```sh
53
- yarn typecheck
54
- yarn lint
55
- ```
56
-
57
- To fix formatting errors, run the following:
58
-
59
- ```sh
60
- yarn lint --fix
61
- ```
62
-
63
- Remember to add tests for your change if possible. Run the unit tests by:
64
-
65
- ```sh
66
- yarn test
67
- ```
68
-
69
- ### Commit message convention
70
-
71
- We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
72
-
73
- - `fix`: bug fixes, e.g. fix crash due to deprecated method.
74
- - `feat`: new features, e.g. add new method to the module.
75
- - `refactor`: code refactor, e.g. migrate from class components to hooks.
76
- - `docs`: changes into documentation, e.g. add usage example for the module..
77
- - `test`: adding or updating tests, e.g. add integration tests using detox.
78
- - `chore`: tooling changes, e.g. change CI config.
79
-
80
- Our pre-commit hooks verify that your commit message matches this format when committing.
81
-
82
- ### Linting and tests
83
-
84
- [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
85
-
86
- We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
87
-
88
- Our pre-commit hooks verify that the linter and tests pass when committing.
89
-
90
- ### Publishing to npm
91
-
92
- We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
93
-
94
- To publish new versions, run the following:
95
-
96
- ```sh
97
- yarn release
98
- ```
99
-
100
- ### Scripts
101
-
102
- The `package.json` file contains various scripts for common tasks:
103
-
104
- - `yarn`: setup project by installing dependencies.
105
- - `yarn typecheck`: type-check files with TypeScript.
106
- - `yarn lint`: lint files with ESLint.
107
- - `yarn test`: run unit tests with Jest.
108
- - `yarn example start`: start the Metro server for the example app.
109
- - `yarn example android`: run the example app on Android.
110
- - `yarn example ios`: run the example app on iOS.
111
-
112
- ### Sending a pull request
113
-
114
- > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
115
-
116
- When you're sending a pull request:
117
-
118
- - Prefer small pull requests focused on one change.
119
- - Verify that linters and tests are passing.
120
- - Review the documentation to make sure it looks good.
121
- - Follow the pull request template when opening a pull request.
122
- - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
File without changes
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/android.iml" filepath="$PROJECT_DIR$/.idea/android.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,2 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>
@@ -1,26 +0,0 @@
1
- package com.zyprotectabiomodule
2
-
3
-
4
- import com.facebook.react.ReactPackage
5
- import com.facebook.react.bridge.NativeModule
6
- import com.facebook.react.bridge.ReactApplicationContext
7
- import com.facebook.react.uimanager.ViewManager
8
-
9
-
10
- class ZyBioProtectaReactNativeModulePackage : ReactPackage {
11
- /**
12
- * @param reactContext react application context that can be used to create modules
13
- * @return list of native modules to register with the newly created catalyst instance
14
- */
15
- override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
16
- return listOf(ZyBioProtectaReactNativeModuleModule(reactContext))
17
- }
18
-
19
- /**
20
- * @param reactContext
21
- * @return a list of view managers that should be registered with [UIManagerModule]
22
- */
23
- override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
24
- return emptyList()
25
- }
26
- }
package/babel.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- ['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }],
4
- ],
5
- };
@@ -1,12 +0,0 @@
1
- //
2
- // ZyProtectaBioRn.h
3
- // Protecta
4
- //
5
- // Created by Developer on 9/08/24.
6
- //
7
-
8
- #import "React/RCTBridgeModule.h"
9
-
10
- // Instead of LoadingOverlay put the name of your module
11
- @interface ZyProtectaBioRn : NSObject <RCTBridgeModule>
12
- @end
@@ -1,90 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <React/RCTBridgeModule.h>
3
- #import <zy_protecta_bio_lib_ios/zy_protecta_bio_lib_ios-Swift.h>
4
-
5
- #import "ZyProtectaBioRn.h" // Here put the name of your module
6
-
7
- @implementation ZyProtectaBioRn
8
-
9
- RCT_EXPORT_MODULE();
10
-
11
-
12
- RCT_EXPORT_METHOD(validacionFacialOcr:(NSDictionary *)opcional
13
- resolver:(RCTPromiseResolveBlock)resolve
14
- rejecter:(RCTPromiseRejectBlock)reject)
15
- {
16
-
17
- dispatch_async(dispatch_get_main_queue(), ^{
18
- @try{
19
- UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
20
-
21
- ReactRequest *request = [ReactRequest new];
22
- request.token = opcional[@"accessToken"] ;
23
- request.bioTiDoc = opcional[@"tiDocumento"];
24
- request.bioNuDoc = opcional[@"nuDocumento"];
25
- request.bioPais = opcional[@"bioPais"];
26
- request.bioOperacion = opcional[@"tiOperacion"];
27
- request.url = opcional[@"urlSource"];
28
- request.flujoExterno = opcional[@"flujoExterno"];
29
-
30
-
31
- NSDictionary *stepperDict = opcional[@"stepper"];
32
- if (stepperDict && [stepperDict isKindOfClass:[NSDictionary class]]) {
33
- Stepper *st = [Stepper new];
34
- st.nuPasos = [stepperDict[@"nuPasos"] intValue];
35
- st.pasoActual = [stepperDict[@"pasoActual"] intValue];
36
- request.stepper = st;
37
- }
38
-
39
- NSDictionary *erroresDict = opcional[@"errores"];
40
- NSDictionary *reintentarDict = erroresDict[@"reintentar"];
41
- NSDictionary *limite_tiempo_alcanzadoDict = erroresDict[@"limite_tiempo_alcanzado"];
42
- NSDictionary *limite_intentos_alcanzadoDict = erroresDict[@"limite_intentos_alcanzado"];
43
-
44
- VisualScreenError *error1 = [[VisualScreenError alloc] initWithTitulo:reintentarDict[@"titulo"]
45
- descripcion:reintentarDict[@"descripcion"]
46
- textBoton:reintentarDict[@"textoBoton"]
47
- screenEnum:ScreenEnumREINTENTAR];
48
-
49
- VisualScreenError *error2 = [[VisualScreenError alloc] initWithTitulo:limite_tiempo_alcanzadoDict[@"titulo"]
50
- descripcion:limite_tiempo_alcanzadoDict[@"descripcion"]
51
- textBoton:limite_tiempo_alcanzadoDict[@"textoBoton"]
52
- screenEnum:ScreenEnumLIMITE_TIEMPO_ALZANZADO];
53
-
54
- VisualScreenError *error3 = [[VisualScreenError alloc] initWithTitulo:limite_intentos_alcanzadoDict[@"titulo"]
55
- descripcion:limite_intentos_alcanzadoDict[@"descripcion"]
56
- textBoton:limite_intentos_alcanzadoDict[@"textoBoton"]
57
- screenEnum:ScreenEnumLIMITE_INTENTOS_ALCANZADO];
58
-
59
- NSArray<VisualScreenError *> *errores = @[error1, error2, error3];
60
- request.errores = errores;
61
-
62
- ZyReactComp *biomatch = [[ZyReactComp alloc] initOnView:ctrl];
63
-
64
- [biomatch reactValidacionFacial:request
65
- completion:^(ReactResponse * _Nonnull response) {
66
-
67
- dispatch_async(dispatch_get_main_queue(), ^{
68
- resolve(@{ @"coError": [NSString stringWithString:(response.coError.length != 0) ? response.coError : @""],
69
- @"deError": [NSString stringWithString:(response.deError.length != 0) ? response.deError : @"" ],
70
- @"coErrorButton": [NSString stringWithString:(response.coErrorButton.length != 0) ? response.coErrorButton : @"" ],
71
- @"deErrorButton": [NSString stringWithString:(response.deErrorButton.length != 0) ? response.deErrorButton : @"" ],
72
- @"idSolicitud": [NSString stringWithString:(response.bmoNuSolicitud.length != 0) ? response.bmoNuSolicitud : @"" ]
73
-
74
- });
75
-
76
- });
77
-
78
- }];
79
-
80
- }
81
- @catch(NSException *exception){
82
- reject(@"get_error",exception.reason, nil);
83
- }
84
- });
85
- }
86
-
87
-
88
- @end
89
-
90
-
package/lefthook.yml DELETED
@@ -1,14 +0,0 @@
1
- pre-commit:
2
- parallel: true
3
- commands:
4
- lint:
5
- glob: "*.{js,ts,jsx,tsx}"
6
- run: npx eslint {staged_files}
7
- types:
8
- glob: "*.{js,ts, jsx, tsx}"
9
- run: npx tsc
10
- commit-msg:
11
- parallel: true
12
- commands:
13
- commitlint:
14
- run: npx commitlint --edit
@@ -1,23 +0,0 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = "react-native-zyprotectabio-module"
7
- s.version = package["version"]
8
- s.summary = package["description"]
9
-
10
- s.license = package["license"]
11
- s.authors = { 'Iván Cáceres' => 'ztmobile@zytrust.com' }
12
- s.homepage = 'https://www.zytrust.com'
13
- s.ios.deployment_target = '13.0'
14
-
15
- s.source = { :git => "https://github.com/ZYTRUST/react-native-zyprotectabio-module.git", :tag => "#{s.version}" }
16
- s.source_files = "ios/*.{h,m,mm}"
17
-
18
- s.dependency 'zy_protecta_bio_lib_ios', '3.5.3'
19
- s.dependency 'React'
20
-
21
- end
22
-
23
-
@@ -1,50 +0,0 @@
1
- // scripts/postinstall.js
2
-
3
- const { execSync } = require('child_process');
4
-
5
- const repos = [
6
- {
7
- name: 'zy_protecta_bio_lib_ios',
8
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/zy_protecta_bio_lib_ios.git'
9
- },
10
- {
11
- name: 'zy_protecta_lib_ui_ios',
12
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/zy_protecta_lib_ui_ios.git'
13
- },
14
- {
15
- name: 'zy_lib_regula_ocr_ios',
16
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/zy_lib_regula_ocr_ios.git'
17
- },
18
- {
19
- name: 'zy_lib_zytrust_pdv_ios',
20
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/zy_lib_zytrust_pdv_ios.git'
21
- }
22
- ,
23
- {
24
- name: 'zy_lib_face_ios',
25
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/zy_lib_face_ios.git'
26
- }
27
- ,
28
- {
29
- name: 'zyIdentyFace',
30
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/IdentyFace.git'
31
- }
32
- ,
33
- {
34
- name: 'zyFaceLiveness',
35
- url: 'https://ZYTRUST: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@github.com/ZYTRUST/FaceLiveness.git'
36
- }
37
- ];
38
-
39
- console.log('📦 Ejecutando postinstall: Añadiendo repositorios CocoaPods...');
40
-
41
- repos.forEach(repo => {
42
- try {
43
- console.log(`🔗 Añadiendo ${repo.name}...`);
44
- execSync(`pod repo add ${repo.name} ${repo.url}`, { stdio: 'inherit' });
45
- } catch (err) {
46
- console.warn(`⚠️ Ya existe o error añadiendo ${repo.name}: ${err.message}`);
47
- }
48
- });
49
-
50
- console.log('✅ Repositorios añadidos.');
@@ -1 +0,0 @@
1
- it.todo('write a test');
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "exclude": ["example", "lib"]
4
- }
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": ".",
4
- "paths": {
5
- "react-native-zyprotectabio-module": ["./src/index"]
6
- },
7
- "allowUnreachableCode": false,
8
- "allowUnusedLabels": false,
9
- "esModuleInterop": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "jsx": "react-jsx",
12
- "lib": ["ESNext"],
13
- "module": "ESNext",
14
- "moduleResolution": "Bundler",
15
- "noEmit": true,
16
- "noFallthroughCasesInSwitch": true,
17
- "noImplicitReturns": true,
18
- "noImplicitUseStrict": false,
19
- "noStrictGenericChecks": false,
20
- "noUncheckedIndexedAccess": true,
21
- "noUnusedLocals": true,
22
- "noUnusedParameters": true,
23
- "resolveJsonModule": true,
24
- "skipLibCheck": true,
25
- "strict": true,
26
- "target": "ESNext",
27
- "verbatimModuleSyntax": true
28
- }
29
- }
package/turbo.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "$schema": "https://turbo.build/schema.json",
3
- "pipeline": {
4
- "build:android": {
5
- "env": ["ORG_GRADLE_PROJECT_newArchEnabled"],
6
- "inputs": [
7
- "package.json",
8
- "android",
9
- "!android/build",
10
- "src/*.ts",
11
- "src/*.tsx",
12
- "example/package.json",
13
- "example/android",
14
- "!example/android/.gradle",
15
- "!example/android/build",
16
- "!example/android/app/build"
17
- ],
18
- "outputs": []
19
- },
20
- "build:ios": {
21
- "env": ["RCT_NEW_ARCH_ENABLED"],
22
- "inputs": [
23
- "package.json",
24
- "*.podspec",
25
- "ios",
26
- "src/*.ts",
27
- "src/*.tsx",
28
- "example/package.json",
29
- "example/ios",
30
- "!example/ios/build",
31
- "!example/ios/Pods"
32
- ],
33
- "outputs": []
34
- }
35
- }
36
- }