@socure-inc/docv-react-native 5.2.7 → 5.2.8

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.
@@ -1 +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":[]}
1
+ {"version":3,"names":["_reactNative","require","_NativeSocureDocVReactNative","_interopRequireDefault","e","__esModule","default","LINKING_ERROR","SocureDocVReactNative","NativeModules","Proxy","get","Error","launchSocureDocV","docVTransactionToken","publicKey","useSocureGov","onSuccess","onError","NativeSocureDocVReactNative","launchSocureDocVWithPromise","then","result","catch","err","code","error","message"],"sources":["index.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport NativeSocureDocVReactNative from './NativeSocureDocVReactNative';\n\nexport type { DocVResult } from './NativeSocureDocVReactNative';\n\n// ── Callback-based API (legacy, preserved for easy migration) ────────────────\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 // Under New Architecture, NativeModules may not expose the callback method.\n // Fall back to the TurboModule promise API so callbacks still work.\n if (typeof SocureDocVReactNative.launchSocureDocV === 'function') {\n return SocureDocVReactNative.launchSocureDocV(\n docVTransactionToken,\n publicKey,\n useSocureGov,\n onSuccess,\n onError\n );\n }\n NativeSocureDocVReactNative.launchSocureDocVWithPromise(\n docVTransactionToken,\n publicKey,\n useSocureGov\n )\n .then((result: { deviceSessionToken: string }) => onSuccess(result))\n .catch((err: any) => onError({ code: err.code, error: err.message }));\n}\n\n// ── Promise-based API (new) ──────────────────────────────────────────────────\n\nexport function launchSocureDocVWithPromise(\n docVTransactionToken: string,\n publicKey: string,\n useSocureGov: boolean\n): Promise<{ deviceSessionToken: string }> {\n return NativeSocureDocVReactNative.launchSocureDocVWithPromise(\n docVTransactionToken,\n publicKey,\n useSocureGov\n );\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAwE,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIxE;;AAEA,MAAMG,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;EACA;EACA,IAAI,OAAOV,qBAAqB,CAACK,gBAAgB,KAAK,UAAU,EAAE;IAChE,OAAOL,qBAAqB,CAACK,gBAAgB,CAC3CC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,OACF,CAAC;EACH;EACAC,oCAA2B,CAACC,2BAA2B,CACrDN,oBAAoB,EACpBC,SAAS,EACTC,YACF,CAAC,CACEK,IAAI,CAAEC,MAAsC,IAAKL,SAAS,CAACK,MAAM,CAAC,CAAC,CACnEC,KAAK,CAAEC,GAAQ,IAAKN,OAAO,CAAC;IAAEO,IAAI,EAAED,GAAG,CAACC,IAAI;IAAEC,KAAK,EAAEF,GAAG,CAACG;EAAQ,CAAC,CAAC,CAAC;AACzE;;AAEA;;AAEO,SAASP,2BAA2BA,CACzCN,oBAA4B,EAC5BC,SAAiB,EACjBC,YAAqB,EACoB;EACzC,OAAOG,oCAA2B,CAACC,2BAA2B,CAC5DN,oBAAoB,EACpBC,SAAS,EACTC,YACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { TurboModuleRegistry } from 'react-native';
2
+ export default TurboModuleRegistry.getEnforcing('SocureDocVReactNative');
3
+ //# sourceMappingURL=NativeSocureDocVReactNative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sources":["NativeSocureDocVReactNative.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport type DocVResult = {\n deviceSessionToken: string;\n};\n\nexport interface Spec extends TurboModule {\n launchSocureDocVWithPromise(\n docVTransactionToken: string,\n publicKey: string,\n useSocureGov: boolean\n ): Promise<DocVResult>;\n}\n\nexport default TurboModuleRegistry.getEnforcing<Spec>('SocureDocVReactNative');\n"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAclD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
@@ -1,4 +1,7 @@
1
1
  import { NativeModules } from 'react-native';
2
+ import NativeSocureDocVReactNative from './NativeSocureDocVReactNative';
3
+ // ── Callback-based API (legacy, preserved for easy migration) ────────────────
4
+
2
5
  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
6
  const SocureDocVReactNative = NativeModules.SocureDocVReactNative ? NativeModules.SocureDocVReactNative : new Proxy({}, {
4
7
  get() {
@@ -6,6 +9,20 @@ const SocureDocVReactNative = NativeModules.SocureDocVReactNative ? NativeModule
6
9
  }
7
10
  });
8
11
  export function launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError) {
9
- return SocureDocVReactNative.launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError);
12
+ // Under New Architecture, NativeModules may not expose the callback method.
13
+ // Fall back to the TurboModule promise API so callbacks still work.
14
+ if (typeof SocureDocVReactNative.launchSocureDocV === 'function') {
15
+ return SocureDocVReactNative.launchSocureDocV(docVTransactionToken, publicKey, useSocureGov, onSuccess, onError);
16
+ }
17
+ NativeSocureDocVReactNative.launchSocureDocVWithPromise(docVTransactionToken, publicKey, useSocureGov).then(result => onSuccess(result)).catch(err => onError({
18
+ code: err.code,
19
+ error: err.message
20
+ }));
21
+ }
22
+
23
+ // ── Promise-based API (new) ──────────────────────────────────────────────────
24
+
25
+ export function launchSocureDocVWithPromise(docVTransactionToken, publicKey, useSocureGov) {
26
+ return NativeSocureDocVReactNative.launchSocureDocVWithPromise(docVTransactionToken, publicKey, useSocureGov);
10
27
  }
11
28
  //# sourceMappingURL=index.js.map
@@ -1 +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":[]}
1
+ {"version":3,"names":["NativeModules","NativeSocureDocVReactNative","LINKING_ERROR","SocureDocVReactNative","Proxy","get","Error","launchSocureDocV","docVTransactionToken","publicKey","useSocureGov","onSuccess","onError","launchSocureDocVWithPromise","then","result","catch","err","code","error","message"],"sources":["index.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport NativeSocureDocVReactNative from './NativeSocureDocVReactNative';\n\nexport type { DocVResult } from './NativeSocureDocVReactNative';\n\n// ── Callback-based API (legacy, preserved for easy migration) ────────────────\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 // Under New Architecture, NativeModules may not expose the callback method.\n // Fall back to the TurboModule promise API so callbacks still work.\n if (typeof SocureDocVReactNative.launchSocureDocV === 'function') {\n return SocureDocVReactNative.launchSocureDocV(\n docVTransactionToken,\n publicKey,\n useSocureGov,\n onSuccess,\n onError\n );\n }\n NativeSocureDocVReactNative.launchSocureDocVWithPromise(\n docVTransactionToken,\n publicKey,\n useSocureGov\n )\n .then((result: { deviceSessionToken: string }) => onSuccess(result))\n .catch((err: any) => onError({ code: err.code, error: err.message }));\n}\n\n// ── Promise-based API (new) ──────────────────────────────────────────────────\n\nexport function launchSocureDocVWithPromise(\n docVTransactionToken: string,\n publicKey: string,\n useSocureGov: boolean\n): Promise<{ deviceSessionToken: string }> {\n return NativeSocureDocVReactNative.launchSocureDocVWithPromise(\n docVTransactionToken,\n publicKey,\n useSocureGov\n );\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAC5C,OAAOC,2BAA2B,MAAM,+BAA+B;AAIvE;;AAEA,MAAMC,aAAa,GACjB,4EAA4E,GAC5E,gDAAgD;AAElD,MAAMC,qBAAqB,GAAGH,aAAa,CAACG,qBAAqB,GAC7DH,aAAa,CAACG,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;EACA;EACA,IAAI,OAAOT,qBAAqB,CAACI,gBAAgB,KAAK,UAAU,EAAE;IAChE,OAAOJ,qBAAqB,CAACI,gBAAgB,CAC3CC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,OACF,CAAC;EACH;EACAX,2BAA2B,CAACY,2BAA2B,CACrDL,oBAAoB,EACpBC,SAAS,EACTC,YACF,CAAC,CACEI,IAAI,CAAEC,MAAsC,IAAKJ,SAAS,CAACI,MAAM,CAAC,CAAC,CACnEC,KAAK,CAAEC,GAAQ,IAAKL,OAAO,CAAC;IAAEM,IAAI,EAAED,GAAG,CAACC,IAAI;IAAEC,KAAK,EAAEF,GAAG,CAACG;EAAQ,CAAC,CAAC,CAAC;AACzE;;AAEA;;AAEA,OAAO,SAASP,2BAA2BA,CACzCL,oBAA4B,EAC5BC,SAAiB,EACjBC,YAAqB,EACoB;EACzC,OAAOT,2BAA2B,CAACY,2BAA2B,CAC5DL,oBAAoB,EACpBC,SAAS,EACTC,YACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export type DocVResult = {
3
+ deviceSessionToken: string;
4
+ };
5
+ export interface Spec extends TurboModule {
6
+ launchSocureDocVWithPromise(docVTransactionToken: string, publicKey: string, useSocureGov: boolean): Promise<DocVResult>;
7
+ }
8
+ declare const _default: Spec;
9
+ export default _default;
@@ -1 +1,5 @@
1
+ export type { DocVResult } from './NativeSocureDocVReactNative';
1
2
  export declare function launchSocureDocV(docVTransactionToken: string, publicKey: string, useSocureGov: boolean, onSuccess: Function, onError: Function): any;
3
+ export declare function launchSocureDocVWithPromise(docVTransactionToken: string, publicKey: string, useSocureGov: boolean): Promise<{
4
+ deviceSessionToken: string;
5
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socure-inc/docv-react-native",
3
- "version": "5.2.7",
3
+ "version": "5.2.8",
4
4
  "description": "The Predictive Document Verification (DocV) SDK React Native bridge allows you to use the DocV SDK v5 for Android and iOS in your React Native application.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -46,8 +46,8 @@
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
48
  "peerDependencies": {
49
- "react": ">=16.13.1",
50
- "react-native": ">=0.66.0"
49
+ "react": ">=19.0.0",
50
+ "react-native": ">=0.79.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@commitlint/config-conventional": "^11.0.0",
@@ -120,12 +120,21 @@
120
120
  "trailingComma": "es5",
121
121
  "useTabs": false
122
122
  },
123
+ "codegenConfig": {
124
+ "name": "SocureDocVReactNative",
125
+ "type": "modules",
126
+ "jsSrcsDir": "src",
127
+ "android": {
128
+ "javaPackageName": "com.socure.docv.reactnative"
129
+ }
130
+ },
123
131
  "react-native-builder-bob": {
124
132
  "source": "src",
125
133
  "output": "lib",
126
134
  "targets": [
127
135
  "commonjs",
128
- "module"
136
+ "module",
137
+ "typescript"
129
138
  ]
130
139
  }
131
140
  }
@@ -1,8 +1,6 @@
1
1
  require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_version = '2021.06.28.00-v2'
5
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
6
4
 
7
5
  Pod::Spec.new do |s|
8
6
  s.name = "socure-docv-react-native"
@@ -17,7 +15,8 @@ Pod::Spec.new do |s|
17
15
 
18
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
19
17
 
20
- s.dependency "React"
18
+ install_modules_dependencies(s)
19
+
21
20
  s.dependency "SocureDocV", "5.4.2"
22
21
  s.dependency "SocureDeviceRisk", "4.8.1"
23
22
 
@@ -0,0 +1,16 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export type DocVResult = {
5
+ deviceSessionToken: string;
6
+ };
7
+
8
+ export interface Spec extends TurboModule {
9
+ launchSocureDocVWithPromise(
10
+ docVTransactionToken: string,
11
+ publicKey: string,
12
+ useSocureGov: boolean
13
+ ): Promise<DocVResult>;
14
+ }
15
+
16
+ export default TurboModuleRegistry.getEnforcing<Spec>('SocureDocVReactNative');
package/src/index.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  import { NativeModules } from 'react-native';
2
+ import NativeSocureDocVReactNative from './NativeSocureDocVReactNative';
3
+
4
+ export type { DocVResult } from './NativeSocureDocVReactNative';
5
+
6
+ // ── Callback-based API (legacy, preserved for easy migration) ────────────────
2
7
 
3
8
  const LINKING_ERROR =
4
9
  `The package '@socure-inc/docv-react-native' doesn't seem to be linked.\n\n` +
@@ -22,11 +27,36 @@ export function launchSocureDocV(
22
27
  onSuccess: Function,
23
28
  onError: Function
24
29
  ) {
25
- return SocureDocVReactNative.launchSocureDocV(
30
+ // Under New Architecture, NativeModules may not expose the callback method.
31
+ // Fall back to the TurboModule promise API so callbacks still work.
32
+ if (typeof SocureDocVReactNative.launchSocureDocV === 'function') {
33
+ return SocureDocVReactNative.launchSocureDocV(
34
+ docVTransactionToken,
35
+ publicKey,
36
+ useSocureGov,
37
+ onSuccess,
38
+ onError
39
+ );
40
+ }
41
+ NativeSocureDocVReactNative.launchSocureDocVWithPromise(
42
+ docVTransactionToken,
43
+ publicKey,
44
+ useSocureGov
45
+ )
46
+ .then((result: { deviceSessionToken: string }) => onSuccess(result))
47
+ .catch((err: any) => onError({ code: err.code, error: err.message }));
48
+ }
49
+
50
+ // ── Promise-based API (new) ──────────────────────────────────────────────────
51
+
52
+ export function launchSocureDocVWithPromise(
53
+ docVTransactionToken: string,
54
+ publicKey: string,
55
+ useSocureGov: boolean
56
+ ): Promise<{ deviceSessionToken: string }> {
57
+ return NativeSocureDocVReactNative.launchSocureDocVWithPromise(
26
58
  docVTransactionToken,
27
59
  publicKey,
28
- useSocureGov,
29
- onSuccess,
30
- onError
60
+ useSocureGov
31
61
  );
32
62
  }
@@ -1,10 +0,0 @@
1
- #import <React/RCTBridgeModule.h>
2
-
3
- @interface RCT_EXTERN_MODULE(SocureDocVReactNative, NSObject)
4
-
5
- RCT_EXTERN_METHOD(launchSocureDocV:(NSString)docVTransactionToken socureApiKey:(NSString)socureApiKey useSocureGov:(BOOL)useSocureGov
6
- onSuccess:(RCTResponseSenderBlock)success
7
- onError:(RCTResponseSenderBlock)error)
8
-
9
-
10
- @end