@humansecurity/expo-mobile-sdk 1.0.4 → 1.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.
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'expo.modules.humansdk'
4
- version = '1.0.4'
4
+ version = '1.0.5'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -32,7 +32,7 @@ if (useManagedAndroidSdkVersions) {
32
32
  }
33
33
 
34
34
  dependencies {
35
- implementation files('libs/HUMAN-4.0.3.aar')
35
+ implementation files('libs/HUMAN-4.2.0.aar')
36
36
  implementation "androidx.core:core-ktx:1.13.1"
37
37
  implementation "androidx.lifecycle:lifecycle-process:2.8.2"
38
38
  implementation "androidx.datastore:datastore-preferences:1.1.1"
@@ -44,8 +44,8 @@ dependencies {
44
44
  android {
45
45
  namespace "expo.modules.humansdk"
46
46
  defaultConfig {
47
- versionCode 4
48
- versionName "1.0.4"
47
+ versionCode 5
48
+ versionName "1.0.5"
49
49
  }
50
50
  lintOptions {
51
51
  abortOnError false
Binary file
@@ -19,7 +19,7 @@ declare class ExpoHumanSdkModule {
19
19
  [key: string]: string;
20
20
  }, appId?: string): void;
21
21
  }
22
- export declare const addEventListener: (eventName: string, listener: (data: any) => void) => import("expo-modules-core").Subscription;
22
+ export declare const addEventListener: (eventName: string, listener: (data: any) => void) => import("expo-modules-core/build/ts-declarations/EventEmitter").EventSubscription;
23
23
  declare const _default: ExpoHumanSdkModule;
24
24
  export default _default;
25
25
  //# sourceMappingURL=ExpoHumanSdkModule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoHumanSdkModule.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAA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,GACb,IAAI;CACR;AAED,eAAO,MAAM,gBAAgB,GAC3B,WAAW,MAAM,EACjB,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,qFAG9B,CAAC;;AAGF,wBAAwE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoHumanSdkModule.js","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;AAgC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,QAA6B,EAC7B,EAAE;IACF,OAAO,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,eAAe,CAAC,CAAC","sourcesContent":["import { requireNativeModule, EventEmitter } from \"expo-modules-core\";\n\nimport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n\nconst eventEmitter = new EventEmitter(requireNativeModule(\"HumanSecurity\"));\n\ndeclare class ExpoHumanSdkModule {\n sdkVersion(): string;\n\n startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;\n startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;\n vid(appId: string): string | null;\n\n // BD functionality\n headersForURLRequest(appId?: string): { [key: string]: string };\n handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult>;\n canHandleResponse(response: string, code: number, url: string): boolean;\n challengeReferenceId(): string;\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n\n // Adding AD functions\n setUserId(userId: string | null, appId?: string): void;\n registerOutgoingUrlRequest(url: string, appId?: string): void;\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n}\n\nexport const addEventListener = (\n eventName: string,\n listener: (data: any) => void,\n) => {\n return eventEmitter.addListener(eventName, listener);\n};\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoHumanSdkModule>(\"HumanSecurity\");\n"]}
1
+ {"version":3,"file":"ExpoHumanSdkModule.js","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAW,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;AAgCtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,QAA6B,EAC7B,EAAE;IACF,OAAO,YAAY,CAAC,WAAW,CAAC,SAA2B,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,eAAe,CAAC,CAAC","sourcesContent":["import { requireNativeModule, EventEmitter } from \"expo-modules-core\";\nimport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n\ntype EventMap = Record<string, (data: any) => void>;\nconst eventEmitter = new EventEmitter<EventMap>(requireNativeModule(\"HumanSecurity\"));\n\ndeclare class ExpoHumanSdkModule {\n sdkVersion(): string;\n\n startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;\n startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;\n vid(appId: string): string | null;\n\n // BD functionality\n headersForURLRequest(appId?: string): { [key: string]: string };\n handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult>;\n canHandleResponse(response: string, code: number, url: string): boolean;\n challengeReferenceId(): string;\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n\n // Adding AD functions\n setUserId(userId: string | null, appId?: string): void;\n registerOutgoingUrlRequest(url: string, appId?: string): void;\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n}\n\nexport const addEventListener = (\n eventName: string,\n listener: (data: any) => void,\n) => {\n return eventEmitter.addListener(eventName as keyof EventMap, listener);\n};\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoHumanSdkModule>(\"HumanSecurity\");\n"]}
@@ -22,7 +22,7 @@ export declare class HumanSecurity {
22
22
  setCustomParameters(parameters: {
23
23
  [key: string]: string;
24
24
  }, appId?: string): void;
25
- addListener(eventName: string, callback: (data: any) => void): import("expo-modules-core").Subscription;
25
+ addListener(eventName: string, callback: (data: any) => void): import("expo-modules-core/build/ts-declarations/EventEmitter").EventSubscription;
26
26
  };
27
27
  static AD: {
28
28
  setUserId(userId: string | null, appId?: string): void;
package/expo-module ADDED
File without changes
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
19
19
  s.static_framework = true
20
20
 
21
21
  s.dependency 'ExpoModulesCore'
22
- s.dependency 'HUMAN', '4.1.0'
22
+ s.dependency 'HUMAN', '4.2.0'
23
23
 
24
24
  # Swift/Objective-C compatibility
25
25
  s.pod_target_xcconfig = {
@@ -0,0 +1,19 @@
1
+ export type HSPolicy = {
2
+ hybridAppPolicy?: HSHybridAppPolicy;
3
+ detectionPolicy?: HSDetectionPolicy;
4
+ };
5
+ export type HSHybridAppPolicy = {
6
+ webRootDomains: {
7
+ [key: string]: string[];
8
+ };
9
+ };
10
+ export type HSDetectionPolicy = {
11
+ allowTouchDetection: boolean;
12
+ allowDeviceMotionDetection: boolean;
13
+ };
14
+ export declare enum HSBotDefenderChallengeResult {
15
+ SOLVED = 0,// Native ordinal for solved
16
+ CANCELLED = 1,// Native ordinal for cancelled
17
+ FAILED = 2
18
+ }
19
+ //# sourceMappingURL=ExpoHumanSdk.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoHumanSdk.types.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdk.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,eAAe,CAAC,EAAE,iBAAiB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0BAA0B,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,oBAAY,4BAA4B;IACtC,MAAM,IAAI,CAAE,4BAA4B;IACxC,SAAS,IAAI,CAAE,+BAA+B;IAC9C,MAAM,IAAI;CACX"}
@@ -0,0 +1,7 @@
1
+ export var HSBotDefenderChallengeResult;
2
+ (function (HSBotDefenderChallengeResult) {
3
+ HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["SOLVED"] = 0] = "SOLVED";
4
+ HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["CANCELLED"] = 1] = "CANCELLED";
5
+ HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["FAILED"] = 2] = "FAILED";
6
+ })(HSBotDefenderChallengeResult || (HSBotDefenderChallengeResult = {}));
7
+ //# sourceMappingURL=ExpoHumanSdk.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoHumanSdk.types.js","sourceRoot":"","sources":["../src/ExpoHumanSdk.types.ts"],"names":[],"mappings":"AAcA,MAAM,CAAN,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,mFAAU,CAAA;IACV,yFAAa,CAAA;IACb,mFAAU,CAAA;AACZ,CAAC,EAJW,4BAA4B,KAA5B,4BAA4B,QAIvC","sourcesContent":["export type HSPolicy = {\n hybridAppPolicy?: HSHybridAppPolicy;\n detectionPolicy?: HSDetectionPolicy;\n};\n\nexport type HSHybridAppPolicy = {\n webRootDomains: { [key: string]: string[] };\n};\n\nexport type HSDetectionPolicy = {\n allowTouchDetection: boolean;\n allowDeviceMotionDetection: boolean;\n};\n\nexport enum HSBotDefenderChallengeResult {\n SOLVED = 0, // Native ordinal for solved\n CANCELLED = 1, // Native ordinal for cancelled\n FAILED = 2, // Indicates getting false from handle response - failed to handle the challenge.\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
+ declare class ExpoHumanSdkModule {
3
+ sdkVersion(): string;
4
+ startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;
5
+ startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;
6
+ vid(appId: string): string | null;
7
+ headersForURLRequest(appId?: string): {
8
+ [key: string]: string;
9
+ };
10
+ handleResponse(response: string, code: number, url: string): Promise<HSBotDefenderChallengeResult>;
11
+ canHandleResponse(response: string, code: number, url: string): boolean;
12
+ challengeReferenceId(): string;
13
+ setCustomParameters(parameters: {
14
+ [key: string]: string;
15
+ }, appId?: string): void;
16
+ setUserId(userId: string | null, appId?: string): void;
17
+ registerOutgoingUrlRequest(url: string, appId?: string): void;
18
+ setAdditionalData(parameters: {
19
+ [key: string]: string;
20
+ }, appId?: string): void;
21
+ }
22
+ export declare const addEventListener: (eventName: string, listener: (data: any) => void) => import("expo-modules-core").Subscription;
23
+ declare const _default: ExpoHumanSdkModule;
24
+ export default _default;
25
+ //# sourceMappingURL=ExpoHumanSdkModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoHumanSdkModule.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAI9E,OAAO,OAAO,kBAAkB;IAC9B,UAAU,IAAI,MAAM;IAEpB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IACnE,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAGjC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAC/D,cAAc,CACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,4BAA4B,CAAC;IACxC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IACvE,oBAAoB,IAAI,MAAM;IAC9B,mBAAmB,CACjB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACrC,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;IAGP,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IACtD,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAC7D,iBAAiB,CACf,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACrC,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;CACR;AAED,eAAO,MAAM,gBAAgB,GAC3B,WAAW,MAAM,EACjB,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,6CAG9B,CAAC;;AAGF,wBAAwE"}
@@ -0,0 +1,8 @@
1
+ import { requireNativeModule, EventEmitter } from "expo-modules-core";
2
+ const eventEmitter = new EventEmitter(requireNativeModule("HumanSecurity"));
3
+ export const addEventListener = (eventName, listener) => {
4
+ return eventEmitter.addListener(eventName, listener);
5
+ };
6
+ // This call loads the native module object from the JSI.
7
+ export default requireNativeModule("HumanSecurity");
8
+ //# sourceMappingURL=ExpoHumanSdkModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoHumanSdkModule.js","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;AAgC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,QAA6B,EAC7B,EAAE;IACF,OAAO,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,eAAe,CAAC,CAAC","sourcesContent":["import { requireNativeModule, EventEmitter } from \"expo-modules-core\";\n\nimport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n\nconst eventEmitter = new EventEmitter(requireNativeModule(\"HumanSecurity\"));\n\ndeclare class ExpoHumanSdkModule {\n sdkVersion(): string;\n\n startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;\n startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;\n vid(appId: string): string | null;\n\n // BD functionality\n headersForURLRequest(appId?: string): { [key: string]: string };\n handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult>;\n canHandleResponse(response: string, code: number, url: string): boolean;\n challengeReferenceId(): string;\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n\n // Adding AD functions\n setUserId(userId: string | null, appId?: string): void;\n registerOutgoingUrlRequest(url: string, appId?: string): void;\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n}\n\nexport const addEventListener = (\n eventName: string,\n listener: (data: any) => void,\n) => {\n return eventEmitter.addListener(eventName, listener);\n};\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoHumanSdkModule>(\"HumanSecurity\");\n"]}
@@ -0,0 +1,37 @@
1
+ import { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
+ declare const HS_EVENTS: {
3
+ BOT_DEFENDER_REQUEST_BLOCKED: string;
4
+ BOT_DEFENDER_CHALLENGE_SOLVED: string;
5
+ BOT_DEFENDER_CHALLENGE_CANCELLED: string;
6
+ BOT_DEFENDER_CHALLENGE_RENDERED: string;
7
+ BOT_DEFENDER_CHALLENGE_RENDER_FAILED: string;
8
+ BOT_DEFENDER_DID_UPDATE_HEADERS: string;
9
+ };
10
+ export declare class HumanSecurity {
11
+ static sdkVersion(): string;
12
+ static startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;
13
+ static startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;
14
+ static vid(appId: string): string | null;
15
+ static BD: {
16
+ headersForURLRequest(appId?: string): {
17
+ [key: string]: string;
18
+ };
19
+ handleResponse(response: string, code: number, url: string): Promise<HSBotDefenderChallengeResult>;
20
+ canHandleResponse(response: string, code: number, url: string): boolean;
21
+ challengeReferenceId(): string;
22
+ setCustomParameters(parameters: {
23
+ [key: string]: string;
24
+ }, appId?: string): void;
25
+ addListener(eventName: string, callback: (data: any) => void): import("expo-modules-core").Subscription;
26
+ };
27
+ static AD: {
28
+ setUserId(userId: string | null, appId?: string): void;
29
+ registerOutgoingUrlRequest(url: string, appId?: string): void;
30
+ setAdditionalData(parameters: {
31
+ [key: string]: string;
32
+ }, appId?: string): void;
33
+ };
34
+ }
35
+ export { HS_EVENTS };
36
+ export default HumanSecurity;
37
+ //# sourceMappingURL=HumanSecurity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HumanSecurity.d.ts","sourceRoot":"","sources":["../src/HumanSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAG9E,QAAA,MAAM,SAAS;;;;;;;CAOd,CAAC;AAEF,qBAAa,aAAa;IACxB,MAAM,CAAC,UAAU,IAAI,MAAM;WAId,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;WAI/D,eAAe,CAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,CAAC,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC;IAIhB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIxC,MAAM,CAAC,EAAE;qCACsB,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE;iCAInD,MAAM,QACV,MAAM,OACP,MAAM,GACV,OAAO,CAAC,4BAA4B,CAAC;oCAWZ,MAAM,QAAQ,MAAM,OAAO,MAAM,GAAG,OAAO;gCAG/C,MAAM;wCAIhB;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,UAC7B,MAAM,GACb,IAAI;+BAGgB,MAAM,YAAY,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI;MAG5D;IAEF,MAAM,CAAC,EAAE;0BACW,MAAM,GAAG,IAAI,UAAU,MAAM,GAAG,IAAI;wCAGtB,MAAM,UAAU,MAAM,GAAG,IAAI;sCAI/C;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,UAC7B,MAAM,GACb,IAAI;MAGP;CACH;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,eAAe,aAAa,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
+ import ExpoHumanSdkModule, { addEventListener } from "./ExpoHumanSdkModule";
3
+ const HS_EVENTS = {
4
+ BOT_DEFENDER_REQUEST_BLOCKED: "botDefenderRequestBlocked",
5
+ BOT_DEFENDER_CHALLENGE_SOLVED: "botDefenderChallengeSolved",
6
+ BOT_DEFENDER_CHALLENGE_CANCELLED: "botDefenderChallengeCancelled",
7
+ BOT_DEFENDER_CHALLENGE_RENDERED: "botDefenderChallengeRendered",
8
+ BOT_DEFENDER_CHALLENGE_RENDER_FAILED: "botDefenderChallengeRenderFailed",
9
+ BOT_DEFENDER_DID_UPDATE_HEADERS: "botDefenderDidUpdateHeaders",
10
+ };
11
+ export class HumanSecurity {
12
+ static sdkVersion() {
13
+ return ExpoHumanSdkModule.sdkVersion();
14
+ }
15
+ static async startWithAppId(appId, policy) {
16
+ return await ExpoHumanSdkModule.startWithAppId(appId, policy);
17
+ }
18
+ static async startWithAppIds(appIds, policy) {
19
+ return await ExpoHumanSdkModule.startWithAppIds(appIds, policy);
20
+ }
21
+ static vid(appId) {
22
+ return ExpoHumanSdkModule.vid(appId);
23
+ }
24
+ static BD = {
25
+ headersForURLRequest(appId) {
26
+ return ExpoHumanSdkModule.headersForURLRequest(appId);
27
+ },
28
+ async handleResponse(response, code, url) {
29
+ const resultOrdinal = await ExpoHumanSdkModule.handleResponse(response, code, url);
30
+ if (resultOrdinal in HSBotDefenderChallengeResult) {
31
+ return resultOrdinal;
32
+ }
33
+ return HSBotDefenderChallengeResult.FAILED;
34
+ },
35
+ canHandleResponse(response, code, url) {
36
+ return ExpoHumanSdkModule.canHandleResponse(response, code, url);
37
+ },
38
+ challengeReferenceId() {
39
+ return ExpoHumanSdkModule.challengeReferenceId();
40
+ },
41
+ setCustomParameters(parameters, appId) {
42
+ ExpoHumanSdkModule.setCustomParameters(parameters, appId);
43
+ },
44
+ addListener(eventName, callback) {
45
+ return addEventListener(eventName, callback);
46
+ },
47
+ };
48
+ static AD = {
49
+ setUserId(userId, appId) {
50
+ ExpoHumanSdkModule.setUserId(userId, appId);
51
+ },
52
+ registerOutgoingUrlRequest(url, appId) {
53
+ ExpoHumanSdkModule.registerOutgoingUrlRequest(url, appId);
54
+ },
55
+ setAdditionalData(parameters, appId) {
56
+ ExpoHumanSdkModule.setAdditionalData(parameters, appId);
57
+ },
58
+ };
59
+ }
60
+ export { HS_EVENTS };
61
+ export default HumanSecurity;
62
+ //# sourceMappingURL=HumanSecurity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HumanSecurity.js","sourceRoot":"","sources":["../src/HumanSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,kBAAkB,EAAE,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,MAAM,SAAS,GAAG;IAChB,4BAA4B,EAAE,2BAA2B;IACzD,6BAA6B,EAAE,4BAA4B;IAC3D,gCAAgC,EAAE,+BAA+B;IACjE,+BAA+B,EAAE,8BAA8B;IAC/D,oCAAoC,EAAE,kCAAkC;IACxE,+BAA+B,EAAE,6BAA6B;CAC/D,CAAC;AAEF,MAAM,OAAO,aAAa;IACxB,MAAM,CAAC,UAAU;QACf,OAAO,kBAAkB,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAa,EAAE,MAAiB;QAC1D,OAAO,MAAM,kBAAkB,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,eAAe,CAC1B,MAAgB,EAChB,MAAiB;QAEjB,OAAO,MAAM,kBAAkB,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,KAAa;QACtB,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,EAAE,GAAG;QACV,oBAAoB,CAAC,KAAc;YACjC,OAAO,kBAAkB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,IA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, { addEventListener } from \"./ExpoHumanSdkModule\";\n\nconst HS_EVENTS = {\n BOT_DEFENDER_REQUEST_BLOCKED: \"botDefenderRequestBlocked\",\n BOT_DEFENDER_CHALLENGE_SOLVED: \"botDefenderChallengeSolved\",\n BOT_DEFENDER_CHALLENGE_CANCELLED: \"botDefenderChallengeCancelled\",\n BOT_DEFENDER_CHALLENGE_RENDERED: \"botDefenderChallengeRendered\",\n BOT_DEFENDER_CHALLENGE_RENDER_FAILED: \"botDefenderChallengeRenderFailed\",\n BOT_DEFENDER_DID_UPDATE_HEADERS: \"botDefenderDidUpdateHeaders\",\n};\n\nexport class HumanSecurity {\n static sdkVersion(): string {\n return ExpoHumanSdkModule.sdkVersion();\n }\n\n static async startWithAppId(appId: string, policy?: HSPolicy): Promise<void> {\n return await ExpoHumanSdkModule.startWithAppId(appId, policy);\n }\n\n static async startWithAppIds(\n appIds: string[],\n policy?: HSPolicy,\n ): Promise<void> {\n return await ExpoHumanSdkModule.startWithAppIds(appIds, policy);\n }\n\n static vid(appId: string): string | null {\n return ExpoHumanSdkModule.vid(appId);\n }\n\n static BD = {\n headersForURLRequest(appId?: string): { [key: string]: string } {\n return ExpoHumanSdkModule.headersForURLRequest(appId);\n },\n async handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult> {\n const resultOrdinal = await ExpoHumanSdkModule.handleResponse(\n response,\n code,\n url,\n );\n if (resultOrdinal in HSBotDefenderChallengeResult) {\n return resultOrdinal as HSBotDefenderChallengeResult;\n }\n return HSBotDefenderChallengeResult.FAILED;\n },\n canHandleResponse(response: string, code: number, url: string): boolean {\n return ExpoHumanSdkModule.canHandleResponse(response, code, url);\n },\n challengeReferenceId(): string {\n return ExpoHumanSdkModule.challengeReferenceId();\n },\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void {\n ExpoHumanSdkModule.setCustomParameters(parameters, appId);\n },\n addListener(eventName: string, callback: (data: any) => void) {\n return addEventListener(eventName, callback);\n },\n };\n\n static AD = {\n setUserId(userId: string | null, appId?: string): void {\n ExpoHumanSdkModule.setUserId(userId, appId);\n },\n registerOutgoingUrlRequest(url: string, appId?: string): void {\n ExpoHumanSdkModule.registerOutgoingUrlRequest(url, appId);\n },\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void {\n ExpoHumanSdkModule.setAdditionalData(parameters, appId);\n },\n };\n}\n\nexport { HS_EVENTS };\nexport default HumanSecurity;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default as HumanSecurity, HS_EVENTS } from "./HumanSecurity";
2
+ export { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as HumanSecurity, HS_EVENTS } from "./HumanSecurity";
2
+ export { HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAY,4BAA4B,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { default as HumanSecurity, HS_EVENTS } from \"./HumanSecurity\";\nexport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@humansecurity/expo-mobile-sdk",
3
- "version": "1.0.4",
4
- "description": "An Expo module to wrap human native SDK for expo users.",
3
+ "version": "1.0.5",
4
+ "description": "An Expo module to wrap human native SDK for Expo users.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "scripts": {
@@ -24,16 +24,19 @@
24
24
  "author": "",
25
25
  "license": "MIT",
26
26
  "homepage": "https://github.com/PerimeterX/human-security-ios-sdk#readme",
27
- "dependencies": {},
28
27
  "devDependencies": {
29
- "@types/react": "~18.3.1",
28
+ "expo": "^53.0.0",
29
+ "expo-modules-core": "^2.2.3",
30
30
  "expo-module-scripts": "^4.0.0",
31
- "expo": "~51.0.37",
32
- "react-native": "0.74.5"
31
+ "react": "18.2.0",
32
+ "react-native": "0.76.9",
33
+ "@types/react": "~18.2.79",
34
+ "typescript": "^5.4.0"
33
35
  },
34
36
  "peerDependencies": {
35
- "expo": "*",
36
- "react": "*",
37
- "react-native": "*"
37
+ "expo": "^53.0.0",
38
+ "expo-modules-core": "^2.2.0",
39
+ "react": "^18.2.0",
40
+ "react-native": "^0.76.0"
38
41
  }
39
42
  }
Binary file