react-native-authsignal 1.8.1 → 2.0.0-alpha2
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 +1 -1
- package/android/src/main/java/com/authsignal/react/AuthsignalInAppModule.kt +135 -0
- package/android/src/main/java/com/authsignal/react/AuthsignalPackage.kt +2 -1
- package/android/src/main/java/com/authsignal/react/AuthsignalPushModule.kt +8 -1
- package/android/src/main/java/com/authsignal/react/{AuthsignalDeviceModule.kt → AuthsignalQRCodeModule.kt} +6 -55
- package/ios/AuthsignalInAppModule.m +26 -0
- package/ios/AuthsignalInAppModule.swift +163 -0
- package/ios/AuthsignalPushModule.swift +9 -1
- package/ios/{AuthsignalDeviceModule.m → AuthsignalQRModule.m} +1 -7
- package/ios/{AuthsignalDeviceModule.swift → AuthsignalQRModule.swift} +4 -64
- package/lib/commonjs/inapp.js +100 -0
- package/lib/commonjs/inapp.js.map +1 -0
- package/lib/commonjs/index.js +14 -34
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/push.js.map +1 -1
- package/lib/commonjs/{device.js → qr.js} +11 -39
- package/lib/commonjs/qr.js.map +1 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/inapp.js +93 -0
- package/lib/module/inapp.js.map +1 -0
- package/lib/module/index.js +14 -34
- package/lib/module/index.js.map +1 -1
- package/lib/module/push.js.map +1 -1
- package/lib/module/{device.js → qr.js} +9 -37
- package/lib/module/qr.js.map +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/inapp.d.ts +19 -0
- package/lib/typescript/inapp.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/push.d.ts +4 -14
- package/lib/typescript/push.d.ts.map +1 -1
- package/lib/typescript/qr.d.ts +20 -0
- package/lib/typescript/qr.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +13 -13
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-authsignal.podspec +1 -1
- package/src/inapp.ts +122 -0
- package/src/index.tsx +13 -18
- package/src/push.ts +7 -18
- package/src/{device.ts → qr.ts} +16 -66
- package/src/types.ts +14 -13
- package/lib/commonjs/device.js.map +0 -1
- package/lib/module/device.js.map +0 -1
- package/lib/typescript/device.d.ts +0 -35
- package/lib/typescript/device.d.ts.map +0 -1
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeychainAccess","UserActionState"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["KeychainAccess","UserActionState"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AA4FA,WAAYA,cAAc;AAMzB,WANWA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc;AAQ1B,WAAYC,eAAe;AAS1B,WATWA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;AAAA,GAAfA,eAAe,KAAfA,eAAe"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AuthsignalResponse, AppCredential, InAppVerifyResponse, AddCredentialInput } from './types';
|
|
2
|
+
interface ConstructorArgs {
|
|
3
|
+
tenantID: string;
|
|
4
|
+
baseURL: string;
|
|
5
|
+
enableLogging: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class AuthsignalInApp {
|
|
8
|
+
tenantID: string;
|
|
9
|
+
baseURL: string;
|
|
10
|
+
enableLogging: boolean;
|
|
11
|
+
constructor({ tenantID, baseURL, enableLogging }: ConstructorArgs);
|
|
12
|
+
getCredential(): Promise<AuthsignalResponse<AppCredential>>;
|
|
13
|
+
addCredential({ token, requireUserAuthentication, keychainAccess, }?: AddCredentialInput): Promise<AuthsignalResponse<AppCredential>>;
|
|
14
|
+
removeCredential(): Promise<AuthsignalResponse<boolean>>;
|
|
15
|
+
verify(): Promise<AuthsignalResponse<InAppVerifyResponse>>;
|
|
16
|
+
private ensureModuleIsInitialized;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=inapp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inapp.d.ts","sourceRoot":"","sources":["../../src/inapp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAeD,qBAAa,eAAe;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;gBAEX,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,eAAe;IAM3D,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAgB3D,aAAa,CAAC,EAClB,KAAK,EACL,yBAAiC,EACjC,cAAc,GACf,GAAE,kBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAuBjE,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAcxD,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;YAgBlD,yBAAyB;CASxC"}
|
|
@@ -3,8 +3,9 @@ import { AuthsignalPasskey } from './passkey';
|
|
|
3
3
|
import { AuthsignalPush } from './push';
|
|
4
4
|
import { AuthsignalSms } from './sms';
|
|
5
5
|
import { AuthsignalTotp } from './totp';
|
|
6
|
-
import {
|
|
6
|
+
import { AuthsignalQrCode } from './qr';
|
|
7
7
|
import { AuthsignalWhatsapp } from './whatsapp';
|
|
8
|
+
import { AuthsignalInApp } from './inapp';
|
|
8
9
|
export * from './types';
|
|
9
10
|
export { ErrorCode } from './error';
|
|
10
11
|
interface ConstructorArgs {
|
|
@@ -20,7 +21,8 @@ export declare class Authsignal {
|
|
|
20
21
|
email: AuthsignalEmail;
|
|
21
22
|
passkey: AuthsignalPasskey;
|
|
22
23
|
push: AuthsignalPush;
|
|
23
|
-
|
|
24
|
+
qr: AuthsignalQrCode;
|
|
25
|
+
inapp: AuthsignalInApp;
|
|
24
26
|
sms: AuthsignalSms;
|
|
25
27
|
totp: AuthsignalTotp;
|
|
26
28
|
whatsapp: AuthsignalWhatsapp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAapC,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,UAAU;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IAEvB,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,gBAAgB,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB,GAAG,EAAE,aAAa,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,kBAAkB,CAAC;gBAEjB,EACV,QAAQ,EACR,OAAyC,EACzC,QAAQ,EACR,aAAuB,GACxB,EAAE,eAAe;IAiBZ,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAGlD;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsB1D"}
|
package/lib/typescript/push.d.ts
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AddCredentialInput, AppChallenge, AppCredential, AuthsignalResponse, UpdateChallengeInput } from './types';
|
|
2
2
|
interface ConstructorArgs {
|
|
3
3
|
tenantID: string;
|
|
4
4
|
baseURL: string;
|
|
5
5
|
enableLogging: boolean;
|
|
6
6
|
}
|
|
7
|
-
interface AddCredentialInput {
|
|
8
|
-
token?: string;
|
|
9
|
-
requireUserAuthentication?: boolean;
|
|
10
|
-
keychainAccess?: KeychainAccess;
|
|
11
|
-
}
|
|
12
|
-
interface UpdateChallengeInput {
|
|
13
|
-
challengeId: string;
|
|
14
|
-
approved: boolean;
|
|
15
|
-
verificationCode?: string | null;
|
|
16
|
-
}
|
|
17
7
|
export declare class AuthsignalPush {
|
|
18
8
|
tenantID: string;
|
|
19
9
|
baseURL: string;
|
|
20
10
|
enableLogging: boolean;
|
|
21
11
|
constructor({ tenantID, baseURL, enableLogging }: ConstructorArgs);
|
|
22
|
-
getCredential(): Promise<AuthsignalResponse<
|
|
23
|
-
addCredential({ token, requireUserAuthentication, keychainAccess, }?: AddCredentialInput): Promise<AuthsignalResponse<
|
|
12
|
+
getCredential(): Promise<AuthsignalResponse<AppCredential>>;
|
|
13
|
+
addCredential({ token, requireUserAuthentication, keychainAccess, }?: AddCredentialInput): Promise<AuthsignalResponse<AppCredential>>;
|
|
24
14
|
removeCredential(): Promise<AuthsignalResponse<boolean>>;
|
|
25
|
-
getChallenge(): Promise<AuthsignalResponse<
|
|
15
|
+
getChallenge(): Promise<AuthsignalResponse<AppChallenge | undefined>>;
|
|
26
16
|
updateChallenge({ challengeId, approved, verificationCode, }: UpdateChallengeInput): Promise<AuthsignalResponse<boolean>>;
|
|
27
17
|
private ensureModuleIsInitialized;
|
|
28
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAeD,qBAAa,cAAc;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;gBAEX,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,eAAe;IAM3D,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAgB3D,aAAa,CAAC,EAClB,KAAK,EACL,yBAAiC,EACjC,cAAc,GACf,GAAE,kBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAuBjE,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAexD,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAgBrE,eAAe,CAAC,EACpB,WAAW,EACX,QAAQ,EACR,gBAAuB,GACxB,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAoBhD,yBAAyB;CASxC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AddCredentialInput, AppCredential, AuthsignalResponse, ClaimChallengeInput, ClaimChallengeResponse, UpdateChallengeInput } from './types';
|
|
2
|
+
interface ConstructorArgs {
|
|
3
|
+
tenantID: string;
|
|
4
|
+
baseURL: string;
|
|
5
|
+
enableLogging: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class AuthsignalQrCode {
|
|
8
|
+
tenantID: string;
|
|
9
|
+
baseURL: string;
|
|
10
|
+
enableLogging: boolean;
|
|
11
|
+
constructor({ tenantID, baseURL, enableLogging }: ConstructorArgs);
|
|
12
|
+
getCredential(): Promise<AuthsignalResponse<AppCredential>>;
|
|
13
|
+
addCredential({ token, requireUserAuthentication, keychainAccess, }?: AddCredentialInput): Promise<AuthsignalResponse<AppCredential>>;
|
|
14
|
+
removeCredential(): Promise<AuthsignalResponse<boolean>>;
|
|
15
|
+
claimChallenge({ challengeId, }: ClaimChallengeInput): Promise<AuthsignalResponse<ClaimChallengeResponse>>;
|
|
16
|
+
updateChallenge({ challengeId, approved, verificationCode, }: UpdateChallengeInput): Promise<AuthsignalResponse<boolean>>;
|
|
17
|
+
private ensureModuleIsInitialized;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=qr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr.d.ts","sourceRoot":"","sources":["../../src/qr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAeD,qBAAa,gBAAgB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;gBAEX,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,eAAe;IAM3D,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAgB3D,aAAa,CAAC,EAClB,KAAK,EACL,yBAAiC,EACjC,cAAc,GACf,GAAE,kBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAuBjE,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAexD,cAAc,CAAC,EACnB,WAAW,GACZ,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAgBtE,eAAe,CAAC,EACpB,WAAW,EACX,QAAQ,EACR,gBAAuB,GACxB,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAoBhD,yBAAyB;CASxC"}
|
|
@@ -38,12 +38,12 @@ export interface VerifyResponse {
|
|
|
38
38
|
token?: string;
|
|
39
39
|
failureReason?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
export interface AddCredentialInput {
|
|
42
|
+
token?: string;
|
|
43
|
+
requireUserAuthentication?: boolean;
|
|
44
|
+
keychainAccess?: KeychainAccess;
|
|
45
45
|
}
|
|
46
|
-
export interface
|
|
46
|
+
export interface AppChallenge {
|
|
47
47
|
challengeId: string;
|
|
48
48
|
actionCode?: string;
|
|
49
49
|
idempotencyKey?: string;
|
|
@@ -51,26 +51,26 @@ export interface PushChallenge {
|
|
|
51
51
|
deviceId?: string;
|
|
52
52
|
ipAddress?: string;
|
|
53
53
|
}
|
|
54
|
-
export interface
|
|
54
|
+
export interface AppCredential {
|
|
55
55
|
credentialId: string;
|
|
56
56
|
createdAt: string;
|
|
57
57
|
userId: string;
|
|
58
58
|
lastAuthenticatedAt?: string;
|
|
59
59
|
}
|
|
60
|
-
export interface
|
|
60
|
+
export interface ClaimChallengeInput {
|
|
61
61
|
challengeId: string;
|
|
62
|
-
actionCode?: string;
|
|
63
|
-
idempotencyKey?: string;
|
|
64
|
-
userAgent?: string;
|
|
65
|
-
deviceId?: string;
|
|
66
|
-
ipAddress?: string;
|
|
67
62
|
}
|
|
68
63
|
export interface ClaimChallengeResponse {
|
|
69
64
|
success: boolean;
|
|
70
65
|
userAgent?: string;
|
|
71
66
|
ipAddress?: string;
|
|
72
67
|
}
|
|
73
|
-
export interface
|
|
68
|
+
export interface UpdateChallengeInput {
|
|
69
|
+
challengeId: string;
|
|
70
|
+
approved: boolean;
|
|
71
|
+
verificationCode?: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface InAppVerifyResponse {
|
|
74
74
|
token: string;
|
|
75
75
|
userId: string;
|
|
76
76
|
userAuthenticatorId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency 'Authsignal', '
|
|
20
|
+
s.dependency 'Authsignal', '2.0.0-alpha'
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
package/src/inapp.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
import { handleErrorCodes, LINKING_ERROR } from './error';
|
|
3
|
+
import type {
|
|
4
|
+
AuthsignalResponse,
|
|
5
|
+
AppCredential,
|
|
6
|
+
InAppVerifyResponse,
|
|
7
|
+
AddCredentialInput,
|
|
8
|
+
} from './types';
|
|
9
|
+
|
|
10
|
+
interface ConstructorArgs {
|
|
11
|
+
tenantID: string;
|
|
12
|
+
baseURL: string;
|
|
13
|
+
enableLogging: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let initialized = false;
|
|
17
|
+
|
|
18
|
+
const AuthsignalInAppModule = NativeModules.AuthsignalInAppModule
|
|
19
|
+
? NativeModules.AuthsignalInAppModule
|
|
20
|
+
: new Proxy(
|
|
21
|
+
{},
|
|
22
|
+
{
|
|
23
|
+
get() {
|
|
24
|
+
throw new Error(LINKING_ERROR);
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export class AuthsignalInApp {
|
|
30
|
+
tenantID: string;
|
|
31
|
+
baseURL: string;
|
|
32
|
+
enableLogging: boolean;
|
|
33
|
+
|
|
34
|
+
constructor({ tenantID, baseURL, enableLogging }: ConstructorArgs) {
|
|
35
|
+
this.tenantID = tenantID;
|
|
36
|
+
this.baseURL = baseURL;
|
|
37
|
+
this.enableLogging = enableLogging;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async getCredential(): Promise<AuthsignalResponse<AppCredential>> {
|
|
41
|
+
await this.ensureModuleIsInitialized();
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const data = await AuthsignalInAppModule.getCredential();
|
|
45
|
+
|
|
46
|
+
return { data };
|
|
47
|
+
} catch (ex) {
|
|
48
|
+
if (this.enableLogging) {
|
|
49
|
+
console.log(ex);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return handleErrorCodes(ex);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async addCredential({
|
|
57
|
+
token,
|
|
58
|
+
requireUserAuthentication = false,
|
|
59
|
+
keychainAccess,
|
|
60
|
+
}: AddCredentialInput = {}): Promise<AuthsignalResponse<AppCredential>> {
|
|
61
|
+
await this.ensureModuleIsInitialized();
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
const data =
|
|
65
|
+
Platform.OS === 'ios'
|
|
66
|
+
? await AuthsignalInAppModule.addCredential(
|
|
67
|
+
token,
|
|
68
|
+
requireUserAuthentication,
|
|
69
|
+
keychainAccess
|
|
70
|
+
)
|
|
71
|
+
: await AuthsignalInAppModule.addCredential(token);
|
|
72
|
+
|
|
73
|
+
return { data };
|
|
74
|
+
} catch (ex) {
|
|
75
|
+
if (this.enableLogging) {
|
|
76
|
+
console.log(ex);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return handleErrorCodes(ex);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async removeCredential(): Promise<AuthsignalResponse<boolean>> {
|
|
84
|
+
await this.ensureModuleIsInitialized();
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const data = await AuthsignalInAppModule.removeCredential();
|
|
88
|
+
return { data };
|
|
89
|
+
} catch (ex) {
|
|
90
|
+
if (this.enableLogging) {
|
|
91
|
+
console.log(ex);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return handleErrorCodes(ex);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async verify(): Promise<AuthsignalResponse<InAppVerifyResponse>> {
|
|
98
|
+
await this.ensureModuleIsInitialized();
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
const data = await AuthsignalInAppModule.verify();
|
|
102
|
+
|
|
103
|
+
return { data };
|
|
104
|
+
} catch (ex) {
|
|
105
|
+
if (this.enableLogging) {
|
|
106
|
+
console.log(ex);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return handleErrorCodes(ex);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private async ensureModuleIsInitialized() {
|
|
114
|
+
if (initialized) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
await AuthsignalInAppModule.initialize(this.tenantID, this.baseURL);
|
|
119
|
+
|
|
120
|
+
initialized = true;
|
|
121
|
+
}
|
|
122
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -5,8 +5,9 @@ import { AuthsignalPasskey } from './passkey';
|
|
|
5
5
|
import { AuthsignalPush } from './push';
|
|
6
6
|
import { AuthsignalSms } from './sms';
|
|
7
7
|
import { AuthsignalTotp } from './totp';
|
|
8
|
-
import {
|
|
8
|
+
import { AuthsignalQrCode } from './qr';
|
|
9
9
|
import { AuthsignalWhatsapp } from './whatsapp';
|
|
10
|
+
import { AuthsignalInApp } from './inapp';
|
|
10
11
|
|
|
11
12
|
export * from './types';
|
|
12
13
|
export { ErrorCode } from './error';
|
|
@@ -37,7 +38,8 @@ export class Authsignal {
|
|
|
37
38
|
email: AuthsignalEmail;
|
|
38
39
|
passkey: AuthsignalPasskey;
|
|
39
40
|
push: AuthsignalPush;
|
|
40
|
-
|
|
41
|
+
qr: AuthsignalQrCode;
|
|
42
|
+
inapp: AuthsignalInApp;
|
|
41
43
|
sms: AuthsignalSms;
|
|
42
44
|
totp: AuthsignalTotp;
|
|
43
45
|
whatsapp: AuthsignalWhatsapp;
|
|
@@ -52,23 +54,16 @@ export class Authsignal {
|
|
|
52
54
|
this.baseURL = baseURL;
|
|
53
55
|
this.enableLogging = enableLogging;
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
tenantID,
|
|
57
|
-
baseURL,
|
|
58
|
-
deviceID,
|
|
59
|
-
enableLogging,
|
|
60
|
-
});
|
|
57
|
+
const input = { tenantID, baseURL, deviceID, enableLogging };
|
|
61
58
|
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
enableLogging,
|
|
71
|
-
});
|
|
59
|
+
this.passkey = new AuthsignalPasskey(input);
|
|
60
|
+
this.email = new AuthsignalEmail(input);
|
|
61
|
+
this.push = new AuthsignalPush(input);
|
|
62
|
+
this.qr = new AuthsignalQrCode(input);
|
|
63
|
+
this.inapp = new AuthsignalInApp(input);
|
|
64
|
+
this.sms = new AuthsignalSms(input);
|
|
65
|
+
this.totp = new AuthsignalTotp(input);
|
|
66
|
+
this.whatsapp = new AuthsignalWhatsapp(input);
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
async setToken(token: string): Promise<void> {
|
package/src/push.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
|
2
2
|
import { handleErrorCodes, LINKING_ERROR } from './error';
|
|
3
3
|
import type {
|
|
4
|
+
AddCredentialInput,
|
|
5
|
+
AppChallenge,
|
|
6
|
+
AppCredential,
|
|
4
7
|
AuthsignalResponse,
|
|
5
|
-
|
|
6
|
-
PushChallenge,
|
|
7
|
-
PushCredential,
|
|
8
|
+
UpdateChallengeInput,
|
|
8
9
|
} from './types';
|
|
9
10
|
|
|
10
11
|
interface ConstructorArgs {
|
|
@@ -26,18 +27,6 @@ const AuthsignalPushModule = NativeModules.AuthsignalPushModule
|
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
29
|
|
|
29
|
-
interface AddCredentialInput {
|
|
30
|
-
token?: string;
|
|
31
|
-
requireUserAuthentication?: boolean;
|
|
32
|
-
keychainAccess?: KeychainAccess;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface UpdateChallengeInput {
|
|
36
|
-
challengeId: string;
|
|
37
|
-
approved: boolean;
|
|
38
|
-
verificationCode?: string | null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
30
|
export class AuthsignalPush {
|
|
42
31
|
tenantID: string;
|
|
43
32
|
baseURL: string;
|
|
@@ -49,7 +38,7 @@ export class AuthsignalPush {
|
|
|
49
38
|
this.enableLogging = enableLogging;
|
|
50
39
|
}
|
|
51
40
|
|
|
52
|
-
async getCredential(): Promise<AuthsignalResponse<
|
|
41
|
+
async getCredential(): Promise<AuthsignalResponse<AppCredential>> {
|
|
53
42
|
await this.ensureModuleIsInitialized();
|
|
54
43
|
|
|
55
44
|
try {
|
|
@@ -69,7 +58,7 @@ export class AuthsignalPush {
|
|
|
69
58
|
token,
|
|
70
59
|
requireUserAuthentication = false,
|
|
71
60
|
keychainAccess,
|
|
72
|
-
}: AddCredentialInput = {}): Promise<AuthsignalResponse<
|
|
61
|
+
}: AddCredentialInput = {}): Promise<AuthsignalResponse<AppCredential>> {
|
|
73
62
|
await this.ensureModuleIsInitialized();
|
|
74
63
|
|
|
75
64
|
try {
|
|
@@ -107,7 +96,7 @@ export class AuthsignalPush {
|
|
|
107
96
|
}
|
|
108
97
|
}
|
|
109
98
|
|
|
110
|
-
async getChallenge(): Promise<AuthsignalResponse<
|
|
99
|
+
async getChallenge(): Promise<AuthsignalResponse<AppChallenge | undefined>> {
|
|
111
100
|
await this.ensureModuleIsInitialized();
|
|
112
101
|
|
|
113
102
|
try {
|
package/src/{device.ts → qr.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
|
2
2
|
import { handleErrorCodes, LINKING_ERROR } from './error';
|
|
3
3
|
import type {
|
|
4
|
+
AddCredentialInput,
|
|
5
|
+
AppCredential,
|
|
4
6
|
AuthsignalResponse,
|
|
7
|
+
ClaimChallengeInput,
|
|
5
8
|
ClaimChallengeResponse,
|
|
6
|
-
|
|
7
|
-
DeviceCredential,
|
|
8
|
-
KeychainAccess,
|
|
9
|
-
VerifyDeviceResponse,
|
|
9
|
+
UpdateChallengeInput,
|
|
10
10
|
} from './types';
|
|
11
11
|
|
|
12
12
|
interface ConstructorArgs {
|
|
@@ -17,8 +17,8 @@ interface ConstructorArgs {
|
|
|
17
17
|
|
|
18
18
|
let initialized = false;
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
? NativeModules.
|
|
20
|
+
const AuthsignalQrCodeModule = NativeModules.AuthsignalQrCodeModule
|
|
21
|
+
? NativeModules.AuthsignalQrCodeModule
|
|
22
22
|
: new Proxy(
|
|
23
23
|
{},
|
|
24
24
|
{
|
|
@@ -28,23 +28,7 @@ const AuthsignalDeviceModule = NativeModules.AuthsignalDeviceModule
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
token?: string;
|
|
33
|
-
requireUserAuthentication?: boolean;
|
|
34
|
-
keychainAccess?: KeychainAccess;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface ClaimChallengeInput {
|
|
38
|
-
challengeId: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface UpdateChallengeInput {
|
|
42
|
-
challengeId: string;
|
|
43
|
-
approved: boolean;
|
|
44
|
-
verificationCode?: string | null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export class AuthsignalDevice {
|
|
31
|
+
export class AuthsignalQrCode {
|
|
48
32
|
tenantID: string;
|
|
49
33
|
baseURL: string;
|
|
50
34
|
enableLogging: boolean;
|
|
@@ -55,11 +39,11 @@ export class AuthsignalDevice {
|
|
|
55
39
|
this.enableLogging = enableLogging;
|
|
56
40
|
}
|
|
57
41
|
|
|
58
|
-
async getCredential(): Promise<AuthsignalResponse<
|
|
42
|
+
async getCredential(): Promise<AuthsignalResponse<AppCredential>> {
|
|
59
43
|
await this.ensureModuleIsInitialized();
|
|
60
44
|
|
|
61
45
|
try {
|
|
62
|
-
const data = await
|
|
46
|
+
const data = await AuthsignalQrCodeModule.getCredential();
|
|
63
47
|
|
|
64
48
|
return { data };
|
|
65
49
|
} catch (ex) {
|
|
@@ -75,18 +59,18 @@ export class AuthsignalDevice {
|
|
|
75
59
|
token,
|
|
76
60
|
requireUserAuthentication = false,
|
|
77
61
|
keychainAccess,
|
|
78
|
-
}: AddCredentialInput = {}): Promise<AuthsignalResponse<
|
|
62
|
+
}: AddCredentialInput = {}): Promise<AuthsignalResponse<AppCredential>> {
|
|
79
63
|
await this.ensureModuleIsInitialized();
|
|
80
64
|
|
|
81
65
|
try {
|
|
82
66
|
const data =
|
|
83
67
|
Platform.OS === 'ios'
|
|
84
|
-
? await
|
|
68
|
+
? await AuthsignalQrCodeModule.addCredential(
|
|
85
69
|
token,
|
|
86
70
|
requireUserAuthentication,
|
|
87
71
|
keychainAccess
|
|
88
72
|
)
|
|
89
|
-
: await
|
|
73
|
+
: await AuthsignalQrCodeModule.addCredential(token);
|
|
90
74
|
|
|
91
75
|
return { data };
|
|
92
76
|
} catch (ex) {
|
|
@@ -102,25 +86,7 @@ export class AuthsignalDevice {
|
|
|
102
86
|
await this.ensureModuleIsInitialized();
|
|
103
87
|
|
|
104
88
|
try {
|
|
105
|
-
const data = await
|
|
106
|
-
return { data };
|
|
107
|
-
} catch (ex) {
|
|
108
|
-
if (this.enableLogging) {
|
|
109
|
-
console.log(ex);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return handleErrorCodes(ex);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async getChallenge(): Promise<
|
|
117
|
-
AuthsignalResponse<DeviceChallenge | undefined>
|
|
118
|
-
> {
|
|
119
|
-
await this.ensureModuleIsInitialized();
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
const data = await AuthsignalDeviceModule.getChallenge();
|
|
123
|
-
|
|
89
|
+
const data = await AuthsignalQrCodeModule.removeCredential();
|
|
124
90
|
return { data };
|
|
125
91
|
} catch (ex) {
|
|
126
92
|
if (this.enableLogging) {
|
|
@@ -137,7 +103,7 @@ export class AuthsignalDevice {
|
|
|
137
103
|
await this.ensureModuleIsInitialized();
|
|
138
104
|
|
|
139
105
|
try {
|
|
140
|
-
const data = await
|
|
106
|
+
const data = await AuthsignalQrCodeModule.claimChallenge(challengeId);
|
|
141
107
|
|
|
142
108
|
return { data };
|
|
143
109
|
} catch (ex) {
|
|
@@ -157,7 +123,7 @@ export class AuthsignalDevice {
|
|
|
157
123
|
await this.ensureModuleIsInitialized();
|
|
158
124
|
|
|
159
125
|
try {
|
|
160
|
-
const data = await
|
|
126
|
+
const data = await AuthsignalQrCodeModule.updateChallenge(
|
|
161
127
|
challengeId,
|
|
162
128
|
approved,
|
|
163
129
|
verificationCode
|
|
@@ -173,28 +139,12 @@ export class AuthsignalDevice {
|
|
|
173
139
|
}
|
|
174
140
|
}
|
|
175
141
|
|
|
176
|
-
async verify(): Promise<AuthsignalResponse<VerifyDeviceResponse>> {
|
|
177
|
-
await this.ensureModuleIsInitialized();
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
const data = await AuthsignalDeviceModule.verify();
|
|
181
|
-
|
|
182
|
-
return { data };
|
|
183
|
-
} catch (ex) {
|
|
184
|
-
if (this.enableLogging) {
|
|
185
|
-
console.log(ex);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return handleErrorCodes(ex);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
142
|
private async ensureModuleIsInitialized() {
|
|
193
143
|
if (initialized) {
|
|
194
144
|
return;
|
|
195
145
|
}
|
|
196
146
|
|
|
197
|
-
await
|
|
147
|
+
await AuthsignalQrCodeModule.initialize(this.tenantID, this.baseURL);
|
|
198
148
|
|
|
199
149
|
initialized = true;
|
|
200
150
|
}
|
package/src/types.ts
CHANGED
|
@@ -45,13 +45,13 @@ export interface VerifyResponse {
|
|
|
45
45
|
failureReason?: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
export interface AddCredentialInput {
|
|
49
|
+
token?: string;
|
|
50
|
+
requireUserAuthentication?: boolean;
|
|
51
|
+
keychainAccess?: KeychainAccess;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export interface
|
|
54
|
+
export interface AppChallenge {
|
|
55
55
|
challengeId: string;
|
|
56
56
|
actionCode?: string;
|
|
57
57
|
idempotencyKey?: string;
|
|
@@ -60,20 +60,15 @@ export interface PushChallenge {
|
|
|
60
60
|
ipAddress?: string;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export interface
|
|
63
|
+
export interface AppCredential {
|
|
64
64
|
credentialId: string;
|
|
65
65
|
createdAt: string;
|
|
66
66
|
userId: string;
|
|
67
67
|
lastAuthenticatedAt?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export interface
|
|
70
|
+
export interface ClaimChallengeInput {
|
|
71
71
|
challengeId: string;
|
|
72
|
-
actionCode?: string;
|
|
73
|
-
idempotencyKey?: string;
|
|
74
|
-
userAgent?: string;
|
|
75
|
-
deviceId?: string;
|
|
76
|
-
ipAddress?: string;
|
|
77
72
|
}
|
|
78
73
|
|
|
79
74
|
export interface ClaimChallengeResponse {
|
|
@@ -82,7 +77,13 @@ export interface ClaimChallengeResponse {
|
|
|
82
77
|
ipAddress?: string;
|
|
83
78
|
}
|
|
84
79
|
|
|
85
|
-
export interface
|
|
80
|
+
export interface UpdateChallengeInput {
|
|
81
|
+
challengeId: string;
|
|
82
|
+
approved: boolean;
|
|
83
|
+
verificationCode?: string | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface InAppVerifyResponse {
|
|
86
87
|
token: string;
|
|
87
88
|
userId: string;
|
|
88
89
|
userAuthenticatorId: string;
|