react-native-credentials-manager 0.4.1 → 0.5.1
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/README.md +21 -319
- package/android/generated/java/com/credentialsmanager/NativeCredentialsManagerSpec.java +3 -2
- package/android/generated/jni/RNCredentialsManagerSpec-generated.cpp +6 -6
- package/android/generated/jni/react/renderer/components/RNCredentialsManagerSpec/RNCredentialsManagerSpecJSI-generated.cpp +8 -7
- package/android/generated/jni/react/renderer/components/RNCredentialsManagerSpec/RNCredentialsManagerSpecJSI.h +65 -10
- package/android/src/main/java/com/credentialsmanager/handlers/CredentialHandler.kt +48 -5
- package/android/src/newarch/java/com/credentialsmanager/CredentialsManagerModule.kt +20 -15
- package/android/src/oldarch/java/com/credentialsmanager/CredentialsManagerModule.kt +29 -14
- package/ios/generated/RNCredentialsManagerSpec/RNCredentialsManagerSpec-generated.mm +17 -11
- package/ios/generated/RNCredentialsManagerSpec/RNCredentialsManagerSpec.h +38 -11
- package/ios/generated/RNCredentialsManagerSpecJSI-generated.cpp +8 -7
- package/ios/generated/RNCredentialsManagerSpecJSI.h +65 -10
- package/lib/commonjs/NativeCredentialsManager.js.map +1 -1
- package/lib/commonjs/index.js +13 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeCredentialsManager.js.map +1 -1
- package/lib/module/index.js +11 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeCredentialsManager.d.ts +12 -7
- package/lib/typescript/commonjs/src/NativeCredentialsManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +12 -7
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeCredentialsManager.d.ts +12 -7
- package/lib/typescript/module/src/NativeCredentialsManager.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +12 -7
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeCredentialsManager.ts +20 -7
- package/src/index.tsx +29 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeCredentialsManager.d.ts","sourceRoot":"","sources":["../../../../src/NativeCredentialsManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"NativeCredentialsManager.d.ts","sourceRoot":"","sources":["../../../../src/NativeCredentialsManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;AAErE,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,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|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type { Credential, GoogleCredential } from './NativeCredentialsManager';
|
|
1
|
+
import type { Credential, GoogleCredential, SignInOption } from './NativeCredentialsManager';
|
|
2
|
+
type GoogleSignInParams = {
|
|
3
|
+
nonce?: string;
|
|
4
|
+
serverClientId: string;
|
|
5
|
+
autoSelectEnabled?: boolean;
|
|
6
|
+
};
|
|
2
7
|
export declare function signUpWithPasskeys(requestJson: Object, preferImmediatelyAvailableCredentials?: boolean): Promise<Object>;
|
|
3
8
|
export declare function signUpWithPassword({ username, password, }: {
|
|
4
9
|
username: string;
|
|
5
10
|
password: string;
|
|
6
11
|
}): void;
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}): Promise<GoogleCredential>;
|
|
12
|
+
export declare function signIn(options: SignInOption[], params: {
|
|
13
|
+
passkeys?: Object;
|
|
14
|
+
googleSignIn?: GoogleSignInParams;
|
|
15
|
+
}): Promise<Credential>;
|
|
16
|
+
export declare function signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
|
|
13
17
|
export declare function signOut(): Promise<null>;
|
|
18
|
+
export {};
|
|
14
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,4BAA4B,CAAC;AAEpC,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,qCAAqC,GAAE,OAAe,GACrD,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,QAEA;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAE,YAAY,EAAE,EACvB,MAAM,EAAE;IACN,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC,GACA,OAAO,CAAC,UAAU,CAAC,CASrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-credentials-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A React Native library that implements the Credential Manager API for Android. This library allows you to manage passwords and passkeys in your React Native applications.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
|
+
export type SignInOption = 'passkeys' | 'password' | 'google-signin';
|
|
5
|
+
|
|
4
6
|
type CredObject = {
|
|
5
7
|
username: string;
|
|
6
8
|
password: string;
|
|
@@ -11,6 +13,12 @@ type PasskeyCredential = {
|
|
|
11
13
|
authenticationResponseJson: string;
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
type GoogleSignInParams = {
|
|
17
|
+
nonce: string;
|
|
18
|
+
serverClientId: string;
|
|
19
|
+
autoSelectEnabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
14
22
|
export type GoogleCredential = {
|
|
15
23
|
type: 'google-signin';
|
|
16
24
|
id: string;
|
|
@@ -28,7 +36,10 @@ type PasswordCredential = {
|
|
|
28
36
|
password: string;
|
|
29
37
|
};
|
|
30
38
|
|
|
31
|
-
export type Credential =
|
|
39
|
+
export type Credential =
|
|
40
|
+
| PasskeyCredential
|
|
41
|
+
| PasswordCredential
|
|
42
|
+
| GoogleCredential;
|
|
32
43
|
|
|
33
44
|
export interface Spec extends TurboModule {
|
|
34
45
|
signUpWithPasskeys(
|
|
@@ -37,12 +48,14 @@ export interface Spec extends TurboModule {
|
|
|
37
48
|
): Promise<Object>;
|
|
38
49
|
signUpWithPassword(credObject: CredObject): void;
|
|
39
50
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
signIn(
|
|
52
|
+
options: SignInOption[],
|
|
53
|
+
params: {
|
|
54
|
+
passkeys?: Object;
|
|
55
|
+
googleSignIn?: GoogleSignInParams;
|
|
56
|
+
}
|
|
57
|
+
): Promise<Credential>;
|
|
58
|
+
signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
|
|
46
59
|
signOut(): Promise<null>;
|
|
47
60
|
}
|
|
48
61
|
|
package/src/index.tsx
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import CredentialsManager from './NativeCredentialsManager';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
Credential,
|
|
4
|
+
GoogleCredential,
|
|
5
|
+
SignInOption,
|
|
6
|
+
} from './NativeCredentialsManager';
|
|
7
|
+
|
|
8
|
+
type GoogleSignInParams = {
|
|
9
|
+
nonce?: string;
|
|
10
|
+
serverClientId: string;
|
|
11
|
+
autoSelectEnabled?: boolean;
|
|
12
|
+
};
|
|
3
13
|
|
|
4
14
|
export function signUpWithPasskeys(
|
|
5
15
|
requestJson: Object,
|
|
@@ -21,18 +31,27 @@ export function signUpWithPassword({
|
|
|
21
31
|
CredentialsManager.signUpWithPassword({ password, username });
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
export function
|
|
25
|
-
|
|
34
|
+
export function signIn(
|
|
35
|
+
options: SignInOption[],
|
|
36
|
+
params: {
|
|
37
|
+
passkeys?: Object;
|
|
38
|
+
googleSignIn?: GoogleSignInParams;
|
|
39
|
+
}
|
|
26
40
|
): Promise<Credential> {
|
|
27
|
-
return CredentialsManager.
|
|
41
|
+
return CredentialsManager.signIn(options, {
|
|
42
|
+
...params,
|
|
43
|
+
googleSignIn: {
|
|
44
|
+
serverClientId: params?.googleSignIn?.serverClientId ?? '',
|
|
45
|
+
nonce: params?.googleSignIn?.nonce ?? '',
|
|
46
|
+
autoSelectEnabled: params?.googleSignIn?.autoSelectEnabled ?? true,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
28
49
|
}
|
|
29
50
|
|
|
30
|
-
export function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}): Promise<GoogleCredential> {
|
|
35
|
-
return CredentialsManager.signInWithGoogle({
|
|
51
|
+
export function signUpWithGoogle(
|
|
52
|
+
params: GoogleSignInParams
|
|
53
|
+
): Promise<GoogleCredential> {
|
|
54
|
+
return CredentialsManager.signUpWithGoogle({
|
|
36
55
|
...params,
|
|
37
56
|
nonce: params.nonce ?? '',
|
|
38
57
|
autoSelectEnabled: params.autoSelectEnabled ?? true,
|