@socure-inc/docv-react-native 5.0.4 → 5.0.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.
- package/android/build.gradle +6 -2
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +3 -3
- package/android/src/main/java/com/socure/docv/reactnative/SocureDocVReactNativeModule.kt +2 -2
- package/ios/SocureDocVReactNative.swift +2 -2
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -0
- package/package.json +102 -11
- package/socure-docv-react-native.podspec +1 -1
- package/src/index.ts +32 -0
- package/src/index.tsx +0 -18
- package/tsconfig.json +0 -12
- /package/{dist → lib/typescript}/index.d.ts +0 -0
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,7 @@ buildscript {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
dependencies {
|
|
11
|
-
classpath 'com.android.tools.build:gradle:7.
|
|
11
|
+
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
12
12
|
// noinspection DifferentKotlinGradleVersion
|
|
13
13
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
14
|
}
|
|
@@ -56,6 +56,10 @@ android {
|
|
|
56
56
|
sourceCompatibility JavaVersion.VERSION_11
|
|
57
57
|
targetCompatibility JavaVersion.VERSION_11
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
kotlinOptions {
|
|
61
|
+
jvmTarget = '11'
|
|
62
|
+
}
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
repositories {
|
|
@@ -135,7 +139,7 @@ dependencies {
|
|
|
135
139
|
//noinspection GradleDynamicVersion
|
|
136
140
|
implementation "com.facebook.react:react-native:+"
|
|
137
141
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
138
|
-
implementation "com.socure.android:docv-capture:5.
|
|
142
|
+
implementation "com.socure.android:docv-capture:5.1.1"
|
|
139
143
|
|
|
140
144
|
def retrofit_version = "2.9.0"
|
|
141
145
|
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#Mon Aug 26 11:49:30 EDT 2024
|
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
|
3
3
|
distributionPath=wrapper/dists
|
|
4
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.
|
|
4
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
|
5
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
6
|
zipStorePath=wrapper/dists
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
SocureDocVReactNative_kotlinVersion=1.
|
|
1
|
+
SocureDocVReactNative_kotlinVersion=1.8.10
|
|
2
2
|
SocureDocVReactNative_minSdkVersion=22
|
|
3
|
-
SocureDocVReactNative_targetSdkVersion=
|
|
4
|
-
SocureDocVReactNative_compileSdkVersion=
|
|
3
|
+
SocureDocVReactNative_targetSdkVersion=34
|
|
4
|
+
SocureDocVReactNative_compileSdkVersion=34
|
|
5
5
|
SocureDocVReactNative_ndkversion=21.4.7075529
|
|
@@ -84,7 +84,7 @@ class SocureDocVReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
override fun onActivityResult(
|
|
87
|
-
activity: Activity
|
|
87
|
+
activity: Activity,
|
|
88
88
|
requestCode: Int,
|
|
89
89
|
resultCode: Int,
|
|
90
90
|
data: Intent?
|
|
@@ -110,7 +110,7 @@ class SocureDocVReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
override fun onNewIntent(intent: Intent
|
|
113
|
+
override fun onNewIntent(intent: Intent) {}
|
|
114
114
|
|
|
115
115
|
private fun convertResultToReadbleMap(result: SocureResult): ReadableMap {
|
|
116
116
|
val docVResponse: WritableMap = Arguments.createMap()
|
|
@@ -17,7 +17,7 @@ import SocureDocV
|
|
|
17
17
|
}
|
|
18
18
|
let options = SocureDocVOptions(
|
|
19
19
|
publicKey: socureApiKey,
|
|
20
|
-
|
|
20
|
+
docvTransactionToken: docVTransactionToken,
|
|
21
21
|
presentingViewController: root,
|
|
22
22
|
useSocureGov: useSocureGov
|
|
23
23
|
)
|
|
@@ -51,7 +51,7 @@ import SocureDocV
|
|
|
51
51
|
return "Consent declined by the user"
|
|
52
52
|
case .documentUploadFailure:
|
|
53
53
|
return "Failed to upload the documents"
|
|
54
|
-
case .
|
|
54
|
+
case .invalidDocvTransactionToken:
|
|
55
55
|
return "Invalid transaction token"
|
|
56
56
|
case .invalidPublicKey:
|
|
57
57
|
return "Invalid or missing SDK key"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.launchSocureDocV = launchSocureDocV;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const LINKING_ERROR = `The package '@socure-inc/docv-react-native' doesn't seem to be linked.\n\n` + '- Rebuilt the app after installing the package';
|
|
9
|
+
const SocureDocVReactNative = _reactNative.NativeModules.SocureDocVReactNative ? _reactNative.NativeModules.SocureDocVReactNative : new Proxy({}, {
|
|
10
|
+
get() {
|
|
11
|
+
throw new Error(LINKING_ERROR);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError) {
|
|
15
|
+
return SocureDocVReactNative.launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","SocureDocVReactNative","NativeModules","Proxy","get","Error","launchSocureDocV","docVTransactionToken","publicKey","useSocureGov","onSuccess","onError"],"sources":["index.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@socure-inc/docv-react-native' doesn't seem to be linked.\\n\\n` +\n '- Rebuilt the app after installing the package';\n\nconst SocureDocVReactNative = NativeModules.SocureDocVReactNative\n ? NativeModules.SocureDocVReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function launchSocureDocV(\n docVTransactionToken: string,\n publicKey: string,\n useSocureGov: boolean,\n onSuccess: Function,\n onError: Function\n) {\n return SocureDocVReactNative.launchSocureDocV(\n docVTransactionToken,\n publicKey,\n useSocureGov,\n onSuccess,\n onError\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,4EAA4E,GAC5E,gDAAgD;AAElD,MAAMC,qBAAqB,GAAGC,0BAAa,CAACD,qBAAqB,GAC7DC,0BAAa,CAACD,qBAAqB,GACnC,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACL,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,SAASM,gBAAgBA,CAC9BC,oBAA4B,EAC5BC,SAAiB,EACjBC,YAAqB,EACrBC,SAAmB,EACnBC,OAAiB,EACjB;EACA,OAAOV,qBAAqB,CAACK,gBAAgB,CAC3CC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,OACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package '@socure-inc/docv-react-native' doesn't seem to be linked.\n\n` + '- Rebuilt the app after installing the package';
|
|
3
|
+
const SocureDocVReactNative = NativeModules.SocureDocVReactNative ? NativeModules.SocureDocVReactNative : new Proxy({}, {
|
|
4
|
+
get() {
|
|
5
|
+
throw new Error(LINKING_ERROR);
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
export function launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError) {
|
|
9
|
+
return SocureDocVReactNative.launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","LINKING_ERROR","SocureDocVReactNative","Proxy","get","Error","launchSocureDocV","docVTransactionToken","publicKey","useSocureGov","onSuccess","onError"],"sources":["index.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@socure-inc/docv-react-native' doesn't seem to be linked.\\n\\n` +\n '- Rebuilt the app after installing the package';\n\nconst SocureDocVReactNative = NativeModules.SocureDocVReactNative\n ? NativeModules.SocureDocVReactNative\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function launchSocureDocV(\n docVTransactionToken: string,\n publicKey: string,\n useSocureGov: boolean,\n onSuccess: Function,\n onError: Function\n) {\n return SocureDocVReactNative.launchSocureDocV(\n docVTransactionToken,\n publicKey,\n useSocureGov,\n onSuccess,\n onError\n );\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAMC,aAAa,GACjB,4EAA4E,GAC5E,gDAAgD;AAElD,MAAMC,qBAAqB,GAAGF,aAAa,CAACE,qBAAqB,GAC7DF,aAAa,CAACE,qBAAqB,GACnC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACJ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,SAASK,gBAAgBA,CAC9BC,oBAA4B,EAC5BC,SAAiB,EACjBC,YAAqB,EACrBC,SAAmB,EACnBC,OAAiB,EACjB;EACA,OAAOT,qBAAqB,CAACI,gBAAgB,CAC3CC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,OACF,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socure-inc/docv-react-native",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "The Predictive Document Verification (DocV) SDK React Native bridge allows you to use the DocV SDK v4 for Android and iOS in your React Native application.",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"android",
|
|
14
|
+
"ios",
|
|
15
|
+
"cpp",
|
|
16
|
+
"socure-docv-react-native.podspec",
|
|
17
|
+
"!lib/typescript/example",
|
|
18
|
+
"!android/build",
|
|
19
|
+
"!android/.gradle",
|
|
20
|
+
"!android/.settings",
|
|
21
|
+
"!android/local.properties",
|
|
22
|
+
"!ios/build",
|
|
23
|
+
"!ios/**/xcuserdata",
|
|
24
|
+
"!ios/**/xcshareddata",
|
|
25
|
+
"!**/__tests__",
|
|
26
|
+
"!**/__fixtures__",
|
|
27
|
+
"!**/__mocks__",
|
|
28
|
+
"!**/.dccache"
|
|
29
|
+
],
|
|
7
30
|
"keywords": [
|
|
8
31
|
"react-native",
|
|
9
32
|
"ios",
|
|
@@ -14,7 +37,7 @@
|
|
|
14
37
|
],
|
|
15
38
|
"repository": {
|
|
16
39
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/socure-inc/socure-docv-demo-app-react-native.git"
|
|
40
|
+
"url": "git+https://github.com/socure-inc/socure-docv-demo-app-react-native.git"
|
|
18
41
|
},
|
|
19
42
|
"author": "Socure <support@socure.com>",
|
|
20
43
|
"license": "SEE LICENSE IN License.txt",
|
|
@@ -27,14 +50,82 @@
|
|
|
27
50
|
"react-native": ">=0.66.0"
|
|
28
51
|
},
|
|
29
52
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"react": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
53
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
54
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
55
|
+
"@tsconfig/react-native": "^3.0.5",
|
|
56
|
+
"@types/jest": "^29.5.12",
|
|
57
|
+
"@types/react": "^18.3.3",
|
|
58
|
+
"@types/react-native": "0.62.13",
|
|
59
|
+
"@types/react-test-renderer": "^18.3.0",
|
|
60
|
+
"commitlint": "^19.0.0",
|
|
61
|
+
"eslint": "^7.2.0",
|
|
62
|
+
"eslint-config-prettier": "^7.0.0",
|
|
63
|
+
"eslint-plugin-prettier": "^3.1.3",
|
|
64
|
+
"husky": "^4.2.5",
|
|
65
|
+
"jest": "^26.0.1",
|
|
66
|
+
"pod-install": "^0.1.0",
|
|
67
|
+
"prettier": "^2.0.5",
|
|
68
|
+
"react": "18.2.0",
|
|
69
|
+
"react-native": "0.72.8",
|
|
70
|
+
"react-native-builder-bob": "^0.18.3",
|
|
71
|
+
"typescript": "^5.5.3"
|
|
35
72
|
},
|
|
36
73
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
74
|
+
"test": "jest",
|
|
75
|
+
"typescript": "tsc",
|
|
76
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
77
|
+
"lint:fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
|
78
|
+
"prepare": "yarn typescript && bob build",
|
|
79
|
+
"bootstrap": "yarn install"
|
|
80
|
+
},
|
|
81
|
+
"jest": {
|
|
82
|
+
"preset": "react-native",
|
|
83
|
+
"modulePathIgnorePatterns": [
|
|
84
|
+
"<rootDir>/example/node_modules",
|
|
85
|
+
"<rootDir>/lib/"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"commitlint": {
|
|
89
|
+
"extends": [
|
|
90
|
+
"@commitlint/config-conventional"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"eslintConfig": {
|
|
94
|
+
"root": true,
|
|
95
|
+
"extends": [
|
|
96
|
+
"@react-native-community",
|
|
97
|
+
"prettier"
|
|
98
|
+
],
|
|
99
|
+
"rules": {
|
|
100
|
+
"prettier/prettier": [
|
|
101
|
+
"error",
|
|
102
|
+
{
|
|
103
|
+
"quoteProps": "consistent",
|
|
104
|
+
"singleQuote": true,
|
|
105
|
+
"tabWidth": 2,
|
|
106
|
+
"trailingComma": "es5",
|
|
107
|
+
"useTabs": false
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"eslintIgnore": [
|
|
113
|
+
"node_modules/",
|
|
114
|
+
"lib/"
|
|
115
|
+
],
|
|
116
|
+
"prettier": {
|
|
117
|
+
"quoteProps": "consistent",
|
|
118
|
+
"singleQuote": true,
|
|
119
|
+
"tabWidth": 2,
|
|
120
|
+
"trailingComma": "es5",
|
|
121
|
+
"useTabs": false
|
|
122
|
+
},
|
|
123
|
+
"react-native-builder-bob": {
|
|
124
|
+
"source": "src",
|
|
125
|
+
"output": "lib",
|
|
126
|
+
"targets": [
|
|
127
|
+
"commonjs",
|
|
128
|
+
"module"
|
|
129
|
+
]
|
|
39
130
|
}
|
|
40
131
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package '@socure-inc/docv-react-native' doesn't seem to be linked.\n\n` +
|
|
5
|
+
'- Rebuilt the app after installing the package';
|
|
6
|
+
|
|
7
|
+
const SocureDocVReactNative = NativeModules.SocureDocVReactNative
|
|
8
|
+
? NativeModules.SocureDocVReactNative
|
|
9
|
+
: new Proxy(
|
|
10
|
+
{},
|
|
11
|
+
{
|
|
12
|
+
get() {
|
|
13
|
+
throw new Error(LINKING_ERROR);
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export function launchSocureDocV(
|
|
19
|
+
docVTransactionToken: string,
|
|
20
|
+
publicKey: string,
|
|
21
|
+
useSocureGov: boolean,
|
|
22
|
+
onSuccess: Function,
|
|
23
|
+
onError: Function
|
|
24
|
+
) {
|
|
25
|
+
return SocureDocVReactNative.launchSocureDocV(
|
|
26
|
+
docVTransactionToken,
|
|
27
|
+
publicKey,
|
|
28
|
+
useSocureGov,
|
|
29
|
+
onSuccess,
|
|
30
|
+
onError
|
|
31
|
+
);
|
|
32
|
+
}
|
package/src/index.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NativeModules } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const LINKING_ERROR =
|
|
4
|
-
`The package '@socure-inc/docv-react-native' doesn't seem to be linked.\n\n` +
|
|
5
|
-
'- Rebuilt the app after installing the package';
|
|
6
|
-
|
|
7
|
-
const SocureDocVReactNative = NativeModules.SocureDocVReactNative ? NativeModules.SocureDocVReactNative : new Proxy(
|
|
8
|
-
{},
|
|
9
|
-
{
|
|
10
|
-
get() {
|
|
11
|
-
throw new Error(LINKING_ERROR);
|
|
12
|
-
},
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export function launchSocureDocV(docVTransactionToken: string, publicKey: string, useSocureGov: boolean, onSuccess: Function, onError: Function) {
|
|
17
|
-
return SocureDocVReactNative.launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError);
|
|
18
|
-
}
|
package/tsconfig.json
DELETED
|
File without changes
|