react-native-credentials-manager 0.5.0 → 0.5.2

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.
@@ -48,7 +48,7 @@ public abstract class NativeCredentialsManagerSpec extends ReactContextBaseJavaM
48
48
 
49
49
  @ReactMethod
50
50
  @DoNotStrip
51
- public abstract void signInWithGoogle(ReadableMap params, Promise promise);
51
+ public abstract void signUpWithGoogle(ReadableMap params, Promise promise);
52
52
 
53
53
  @ReactMethod
54
54
  @DoNotStrip
@@ -27,9 +27,9 @@ static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signI
27
27
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "signIn", "(Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
28
  }
29
29
 
30
- static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signInWithGoogle(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
+ static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithGoogle(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
31
  static jmethodID cachedMethodId = nullptr;
32
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "signInWithGoogle", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "signUpWithGoogle", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
33
33
  }
34
34
 
35
35
  static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signOut(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
@@ -42,7 +42,7 @@ NativeCredentialsManagerSpecJSI::NativeCredentialsManagerSpecJSI(const JavaTurbo
42
42
  methodMap_["signUpWithPasskeys"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithPasskeys};
43
43
  methodMap_["signUpWithPassword"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithPassword};
44
44
  methodMap_["signIn"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerSpecJSI_signIn};
45
- methodMap_["signInWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerSpecJSI_signInWithGoogle};
45
+ methodMap_["signUpWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithGoogle};
46
46
  methodMap_["signOut"] = MethodMetadata {0, __hostFunction_NativeCredentialsManagerSpecJSI_signOut};
47
47
  }
48
48
 
@@ -32,8 +32,8 @@ static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signIn(jsi::
32
32
  count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
33
33
  );
34
34
  }
35
- static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signInWithGoogle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
- return static_cast<NativeCredentialsManagerCxxSpecJSI *>(&turboModule)->signInWithGoogle(
35
+ static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithGoogle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
+ return static_cast<NativeCredentialsManagerCxxSpecJSI *>(&turboModule)->signUpWithGoogle(
37
37
  rt,
38
38
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
39
39
  );
@@ -49,7 +49,7 @@ NativeCredentialsManagerCxxSpecJSI::NativeCredentialsManagerCxxSpecJSI(std::shar
49
49
  methodMap_["signUpWithPasskeys"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithPasskeys};
50
50
  methodMap_["signUpWithPassword"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithPassword};
51
51
  methodMap_["signIn"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signIn};
52
- methodMap_["signInWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signInWithGoogle};
52
+ methodMap_["signUpWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithGoogle};
53
53
  methodMap_["signOut"] = MethodMetadata {0, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signOut};
54
54
  }
55
55
 
@@ -225,7 +225,7 @@ public:
225
225
  virtual jsi::Value signUpWithPasskeys(jsi::Runtime &rt, jsi::Object requestJson, bool preferImmediatelyAvailableCredentials) = 0;
226
226
  virtual void signUpWithPassword(jsi::Runtime &rt, jsi::Object credObject) = 0;
227
227
  virtual jsi::Value signIn(jsi::Runtime &rt, jsi::Array options, jsi::Object params) = 0;
228
- virtual jsi::Value signInWithGoogle(jsi::Runtime &rt, jsi::Object params) = 0;
228
+ virtual jsi::Value signUpWithGoogle(jsi::Runtime &rt, jsi::Object params) = 0;
229
229
  virtual jsi::Value signOut(jsi::Runtime &rt) = 0;
230
230
 
231
231
  };
@@ -281,13 +281,13 @@ private:
281
281
  return bridging::callFromJs<jsi::Value>(
282
282
  rt, &T::signIn, jsInvoker_, instance_, std::move(options), std::move(params));
283
283
  }
284
- jsi::Value signInWithGoogle(jsi::Runtime &rt, jsi::Object params) override {
284
+ jsi::Value signUpWithGoogle(jsi::Runtime &rt, jsi::Object params) override {
285
285
  static_assert(
286
- bridging::getParameterCount(&T::signInWithGoogle) == 2,
287
- "Expected signInWithGoogle(...) to have 2 parameters");
286
+ bridging::getParameterCount(&T::signUpWithGoogle) == 2,
287
+ "Expected signUpWithGoogle(...) to have 2 parameters");
288
288
 
289
289
  return bridging::callFromJs<jsi::Value>(
290
- rt, &T::signInWithGoogle, jsInvoker_, instance_, std::move(params));
290
+ rt, &T::signUpWithGoogle, jsInvoker_, instance_, std::move(params));
291
291
  }
292
292
  jsi::Value signOut(jsi::Runtime &rt) override {
293
293
  static_assert(
@@ -90,7 +90,7 @@ class CredentialsManagerModule(
90
90
  }
91
91
  }
92
92
 
93
- override fun signInWithGoogle(
93
+ override fun signUpWithGoogle(
94
94
  requestObject: ReadableMap,
95
95
  promise: Promise,
96
96
  ) {
@@ -62,17 +62,35 @@ class CredentialsManagerModule(
62
62
  }
63
63
 
64
64
  @ReactMethod
65
- fun signInWithSavedCredentials(
66
- requestJson: ReadableMap,
65
+ fun signIn(
66
+ options: ReadableArray,
67
+ params: ReadableMap,
67
68
  promise: Promise,
68
69
  ) {
69
- val jsonString = requestJson.toString()
70
70
  coroutineScope.launch {
71
- val data = credentialHandler.getSavedCredentials(jsonString)
72
- promise.resolve(data)
71
+ try {
72
+ val data = credentialHandler.signIn(options = options, params = params)
73
+ promise.resolve(data)
74
+ } catch (e: GetCredentialException) {
75
+ Log.e("CredentialManager", "Error during sign out", e)
76
+ promise.reject("ERROR", e.message.toString())
77
+ }
73
78
  }
74
79
  }
75
80
 
81
+
82
+ // @ReactMethod
83
+ // fun signInWithSavedCredentials(
84
+ // requestJson: ReadableMap,
85
+ // promise: Promise,
86
+ // ) {
87
+ // val jsonString = requestJson.toString()
88
+ // coroutineScope.launch {
89
+ // val data = credentialHandler.getSavedCredentials(jsonString)
90
+ // promise.resolve(data)
91
+ // }
92
+ // }
93
+
76
94
  @ReactMethod
77
95
  fun signOut(promise: Promise) {
78
96
  coroutineScope.launch {
@@ -87,7 +105,7 @@ class CredentialsManagerModule(
87
105
  }
88
106
 
89
107
  @ReactMethod
90
- fun signInWithGoogle(
108
+ fun signUpWithGoogle(
91
109
  requestObject: ReadableMap,
92
110
  promise: Promise,
93
111
  ) {
@@ -55,8 +55,8 @@ namespace facebook::react {
55
55
  return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "signIn", @selector(signIn:params:resolve:reject:), args, count);
56
56
  }
57
57
 
58
- static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signInWithGoogle(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
59
- return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "signInWithGoogle", @selector(signInWithGoogle:resolve:reject:), args, count);
58
+ static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithGoogle(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
59
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "signUpWithGoogle", @selector(signUpWithGoogle:resolve:reject:), args, count);
60
60
  }
61
61
 
62
62
  static facebook::jsi::Value __hostFunction_NativeCredentialsManagerSpecJSI_signOut(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
@@ -75,8 +75,8 @@ namespace facebook::react {
75
75
  methodMap_["signIn"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerSpecJSI_signIn};
76
76
  setMethodArgConversionSelector(@"signIn", 1, @"JS_NativeCredentialsManager_SpecSignInParams:");
77
77
 
78
- methodMap_["signInWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerSpecJSI_signInWithGoogle};
79
- setMethodArgConversionSelector(@"signInWithGoogle", 0, @"JS_NativeCredentialsManager_GoogleSignInParams:");
78
+ methodMap_["signUpWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerSpecJSI_signUpWithGoogle};
79
+ setMethodArgConversionSelector(@"signUpWithGoogle", 0, @"JS_NativeCredentialsManager_GoogleSignInParams:");
80
80
 
81
81
  methodMap_["signOut"] = MethodMetadata {0, __hostFunction_NativeCredentialsManagerSpecJSI_signOut};
82
82
 
@@ -92,7 +92,7 @@ preferImmediatelyAvailableCredentials:(BOOL)preferImmediatelyAvailableCredential
92
92
  params:(JS::NativeCredentialsManager::SpecSignInParams &)params
93
93
  resolve:(RCTPromiseResolveBlock)resolve
94
94
  reject:(RCTPromiseRejectBlock)reject;
95
- - (void)signInWithGoogle:(JS::NativeCredentialsManager::GoogleSignInParams &)params
95
+ - (void)signUpWithGoogle:(JS::NativeCredentialsManager::GoogleSignInParams &)params
96
96
  resolve:(RCTPromiseResolveBlock)resolve
97
97
  reject:(RCTPromiseRejectBlock)reject;
98
98
  - (void)signOut:(RCTPromiseResolveBlock)resolve
@@ -32,8 +32,8 @@ static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signIn(jsi::
32
32
  count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
33
33
  );
34
34
  }
35
- static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signInWithGoogle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
- return static_cast<NativeCredentialsManagerCxxSpecJSI *>(&turboModule)->signInWithGoogle(
35
+ static jsi::Value __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithGoogle(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
+ return static_cast<NativeCredentialsManagerCxxSpecJSI *>(&turboModule)->signUpWithGoogle(
37
37
  rt,
38
38
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
39
39
  );
@@ -49,7 +49,7 @@ NativeCredentialsManagerCxxSpecJSI::NativeCredentialsManagerCxxSpecJSI(std::shar
49
49
  methodMap_["signUpWithPasskeys"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithPasskeys};
50
50
  methodMap_["signUpWithPassword"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithPassword};
51
51
  methodMap_["signIn"] = MethodMetadata {2, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signIn};
52
- methodMap_["signInWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signInWithGoogle};
52
+ methodMap_["signUpWithGoogle"] = MethodMetadata {1, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signUpWithGoogle};
53
53
  methodMap_["signOut"] = MethodMetadata {0, __hostFunction_NativeCredentialsManagerCxxSpecJSI_signOut};
54
54
  }
55
55
 
@@ -225,7 +225,7 @@ public:
225
225
  virtual jsi::Value signUpWithPasskeys(jsi::Runtime &rt, jsi::Object requestJson, bool preferImmediatelyAvailableCredentials) = 0;
226
226
  virtual void signUpWithPassword(jsi::Runtime &rt, jsi::Object credObject) = 0;
227
227
  virtual jsi::Value signIn(jsi::Runtime &rt, jsi::Array options, jsi::Object params) = 0;
228
- virtual jsi::Value signInWithGoogle(jsi::Runtime &rt, jsi::Object params) = 0;
228
+ virtual jsi::Value signUpWithGoogle(jsi::Runtime &rt, jsi::Object params) = 0;
229
229
  virtual jsi::Value signOut(jsi::Runtime &rt) = 0;
230
230
 
231
231
  };
@@ -281,13 +281,13 @@ private:
281
281
  return bridging::callFromJs<jsi::Value>(
282
282
  rt, &T::signIn, jsInvoker_, instance_, std::move(options), std::move(params));
283
283
  }
284
- jsi::Value signInWithGoogle(jsi::Runtime &rt, jsi::Object params) override {
284
+ jsi::Value signUpWithGoogle(jsi::Runtime &rt, jsi::Object params) override {
285
285
  static_assert(
286
- bridging::getParameterCount(&T::signInWithGoogle) == 2,
287
- "Expected signInWithGoogle(...) to have 2 parameters");
286
+ bridging::getParameterCount(&T::signUpWithGoogle) == 2,
287
+ "Expected signUpWithGoogle(...) to have 2 parameters");
288
288
 
289
289
  return bridging::callFromJs<jsi::Value>(
290
- rt, &T::signInWithGoogle, jsInvoker_, instance_, std::move(params));
290
+ rt, &T::signUpWithGoogle, jsInvoker_, instance_, std::move(params));
291
291
  }
292
292
  jsi::Value signOut(jsi::Runtime &rt) override {
293
293
  static_assert(
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.signIn = signIn;
7
- exports.signInWithGoogle = signInWithGoogle;
8
7
  exports.signOut = signOut;
8
+ exports.signUpWithGoogle = signUpWithGoogle;
9
9
  exports.signUpWithPasskeys = signUpWithPasskeys;
10
10
  exports.signUpWithPassword = signUpWithPassword;
11
11
  var _NativeCredentialsManager = _interopRequireDefault(require("./NativeCredentialsManager.js"));
@@ -32,8 +32,8 @@ function signIn(options, params) {
32
32
  }
33
33
  });
34
34
  }
35
- function signInWithGoogle(params) {
36
- return _NativeCredentialsManager.default.signInWithGoogle({
35
+ function signUpWithGoogle(params) {
36
+ return _NativeCredentialsManager.default.signUpWithGoogle({
37
37
  ...params,
38
38
  nonce: params.nonce ?? '',
39
39
  autoSelectEnabled: params.autoSelectEnabled ?? true
@@ -1 +1 @@
1
- {"version":3,"names":["_NativeCredentialsManager","_interopRequireDefault","require","e","__esModule","default","signUpWithPasskeys","requestJson","preferImmediatelyAvailableCredentials","CredentialsManager","signUpWithPassword","username","password","signIn","options","params","googleSignIn","serverClientId","nonce","autoSelectEnabled","signInWithGoogle","signOut"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAarD,SAASG,kBAAkBA,CAChCC,WAAmB,EACnBC,qCAA8C,GAAG,KAAK,EACrC;EACjB,OAAOC,iCAAkB,CAACH,kBAAkB,CAC1CC,WAAW,EACXC,qCACF,CAAC;AACH;AAEO,SAASE,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACDH,iCAAkB,CAACC,kBAAkB,CAAC;IAAEE,QAAQ;IAAED;EAAS,CAAC,CAAC;AAC/D;AAEO,SAASE,MAAMA,CACpBC,OAAuB,EACvBC,MAGC,EACoB;EACrB,OAAON,iCAAkB,CAACI,MAAM,CAACC,OAAO,EAAE;IACxC,GAAGC,MAAM;IACTC,YAAY,EAAE;MACZC,cAAc,EAAEF,MAAM,EAAEC,YAAY,EAAEC,cAAc,IAAI,EAAE;MAC1DC,KAAK,EAAEH,MAAM,EAAEC,YAAY,EAAEE,KAAK,IAAI,EAAE;MACxCC,iBAAiB,EAAEJ,MAAM,EAAEC,YAAY,EAAEG,iBAAiB,IAAI;IAChE;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,gBAAgBA,CAC9BL,MAA0B,EACC;EAC3B,OAAON,iCAAkB,CAACW,gBAAgB,CAAC;IACzC,GAAGL,MAAM;IACTG,KAAK,EAAEH,MAAM,CAACG,KAAK,IAAI,EAAE;IACzBC,iBAAiB,EAAEJ,MAAM,CAACI,iBAAiB,IAAI;EACjD,CAAC,CAAC;AACJ;AAEO,SAASE,OAAOA,CAAA,EAAkB;EACvC,OAAOZ,iCAAkB,CAACY,OAAO,CAAC,CAAC;AACrC","ignoreList":[]}
1
+ {"version":3,"names":["_NativeCredentialsManager","_interopRequireDefault","require","e","__esModule","default","signUpWithPasskeys","requestJson","preferImmediatelyAvailableCredentials","CredentialsManager","signUpWithPassword","username","password","signIn","options","params","googleSignIn","serverClientId","nonce","autoSelectEnabled","signUpWithGoogle","signOut"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAarD,SAASG,kBAAkBA,CAChCC,WAAmB,EACnBC,qCAA8C,GAAG,KAAK,EACrC;EACjB,OAAOC,iCAAkB,CAACH,kBAAkB,CAC1CC,WAAW,EACXC,qCACF,CAAC;AACH;AAEO,SAASE,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACDH,iCAAkB,CAACC,kBAAkB,CAAC;IAAEE,QAAQ;IAAED;EAAS,CAAC,CAAC;AAC/D;AAEO,SAASE,MAAMA,CACpBC,OAAuB,EACvBC,MAGC,EACoB;EACrB,OAAON,iCAAkB,CAACI,MAAM,CAACC,OAAO,EAAE;IACxC,GAAGC,MAAM;IACTC,YAAY,EAAE;MACZC,cAAc,EAAEF,MAAM,EAAEC,YAAY,EAAEC,cAAc,IAAI,EAAE;MAC1DC,KAAK,EAAEH,MAAM,EAAEC,YAAY,EAAEE,KAAK,IAAI,EAAE;MACxCC,iBAAiB,EAAEJ,MAAM,EAAEC,YAAY,EAAEG,iBAAiB,IAAI;IAChE;EACF,CAAC,CAAC;AACJ;AAEO,SAASC,gBAAgBA,CAC9BL,MAA0B,EACC;EAC3B,OAAON,iCAAkB,CAACW,gBAAgB,CAAC;IACzC,GAAGL,MAAM;IACTG,KAAK,EAAEH,MAAM,CAACG,KAAK,IAAI,EAAE;IACzBC,iBAAiB,EAAEJ,MAAM,CAACI,iBAAiB,IAAI;EACjD,CAAC,CAAC;AACJ;AAEO,SAASE,OAAOA,CAAA,EAAkB;EACvC,OAAOZ,iCAAkB,CAACY,OAAO,CAAC,CAAC;AACrC","ignoreList":[]}
@@ -23,8 +23,8 @@ export function signIn(options, params) {
23
23
  }
24
24
  });
25
25
  }
26
- export function signInWithGoogle(params) {
27
- return CredentialsManager.signInWithGoogle({
26
+ export function signUpWithGoogle(params) {
27
+ return CredentialsManager.signUpWithGoogle({
28
28
  ...params,
29
29
  nonce: params.nonce ?? '',
30
30
  autoSelectEnabled: params.autoSelectEnabled ?? true
@@ -1 +1 @@
1
- {"version":3,"names":["CredentialsManager","signUpWithPasskeys","requestJson","preferImmediatelyAvailableCredentials","signUpWithPassword","username","password","signIn","options","params","googleSignIn","serverClientId","nonce","autoSelectEnabled","signInWithGoogle","signOut"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,kBAAkB,MAAM,+BAA4B;AAa3D,OAAO,SAASC,kBAAkBA,CAChCC,WAAmB,EACnBC,qCAA8C,GAAG,KAAK,EACrC;EACjB,OAAOH,kBAAkB,CAACC,kBAAkB,CAC1CC,WAAW,EACXC,qCACF,CAAC;AACH;AAEA,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACDN,kBAAkB,CAACI,kBAAkB,CAAC;IAAEE,QAAQ;IAAED;EAAS,CAAC,CAAC;AAC/D;AAEA,OAAO,SAASE,MAAMA,CACpBC,OAAuB,EACvBC,MAGC,EACoB;EACrB,OAAOT,kBAAkB,CAACO,MAAM,CAACC,OAAO,EAAE;IACxC,GAAGC,MAAM;IACTC,YAAY,EAAE;MACZC,cAAc,EAAEF,MAAM,EAAEC,YAAY,EAAEC,cAAc,IAAI,EAAE;MAC1DC,KAAK,EAAEH,MAAM,EAAEC,YAAY,EAAEE,KAAK,IAAI,EAAE;MACxCC,iBAAiB,EAAEJ,MAAM,EAAEC,YAAY,EAAEG,iBAAiB,IAAI;IAChE;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,SAASC,gBAAgBA,CAC9BL,MAA0B,EACC;EAC3B,OAAOT,kBAAkB,CAACc,gBAAgB,CAAC;IACzC,GAAGL,MAAM;IACTG,KAAK,EAAEH,MAAM,CAACG,KAAK,IAAI,EAAE;IACzBC,iBAAiB,EAAEJ,MAAM,CAACI,iBAAiB,IAAI;EACjD,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,OAAOA,CAAA,EAAkB;EACvC,OAAOf,kBAAkB,CAACe,OAAO,CAAC,CAAC;AACrC","ignoreList":[]}
1
+ {"version":3,"names":["CredentialsManager","signUpWithPasskeys","requestJson","preferImmediatelyAvailableCredentials","signUpWithPassword","username","password","signIn","options","params","googleSignIn","serverClientId","nonce","autoSelectEnabled","signUpWithGoogle","signOut"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,kBAAkB,MAAM,+BAA4B;AAa3D,OAAO,SAASC,kBAAkBA,CAChCC,WAAmB,EACnBC,qCAA8C,GAAG,KAAK,EACrC;EACjB,OAAOH,kBAAkB,CAACC,kBAAkB,CAC1CC,WAAW,EACXC,qCACF,CAAC;AACH;AAEA,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,QAAQ;EACRC;AAIF,CAAC,EAAE;EACDN,kBAAkB,CAACI,kBAAkB,CAAC;IAAEE,QAAQ;IAAED;EAAS,CAAC,CAAC;AAC/D;AAEA,OAAO,SAASE,MAAMA,CACpBC,OAAuB,EACvBC,MAGC,EACoB;EACrB,OAAOT,kBAAkB,CAACO,MAAM,CAACC,OAAO,EAAE;IACxC,GAAGC,MAAM;IACTC,YAAY,EAAE;MACZC,cAAc,EAAEF,MAAM,EAAEC,YAAY,EAAEC,cAAc,IAAI,EAAE;MAC1DC,KAAK,EAAEH,MAAM,EAAEC,YAAY,EAAEE,KAAK,IAAI,EAAE;MACxCC,iBAAiB,EAAEJ,MAAM,EAAEC,YAAY,EAAEG,iBAAiB,IAAI;IAChE;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,SAASC,gBAAgBA,CAC9BL,MAA0B,EACC;EAC3B,OAAOT,kBAAkB,CAACc,gBAAgB,CAAC;IACzC,GAAGL,MAAM;IACTG,KAAK,EAAEH,MAAM,CAACG,KAAK,IAAI,EAAE;IACzBC,iBAAiB,EAAEJ,MAAM,CAACI,iBAAiB,IAAI;EACjD,CAAC,CAAC;AACJ;AAEA,OAAO,SAASE,OAAOA,CAAA,EAAkB;EACvC,OAAOf,kBAAkB,CAACe,OAAO,CAAC,CAAC;AACrC","ignoreList":[]}
@@ -36,7 +36,7 @@ export interface Spec extends TurboModule {
36
36
  passkeys?: Object;
37
37
  googleSignIn?: GoogleSignInParams;
38
38
  }): Promise<Credential>;
39
- signInWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
39
+ signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
40
40
  signOut(): Promise<null>;
41
41
  }
42
42
  declare const _default: Spec;
@@ -13,7 +13,7 @@ export declare function signIn(options: SignInOption[], params: {
13
13
  passkeys?: Object;
14
14
  googleSignIn?: GoogleSignInParams;
15
15
  }): Promise<Credential>;
16
- export declare function signInWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
16
+ export declare function signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
17
17
  export declare function signOut(): Promise<null>;
18
18
  export {};
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -36,7 +36,7 @@ export interface Spec extends TurboModule {
36
36
  passkeys?: Object;
37
37
  googleSignIn?: GoogleSignInParams;
38
38
  }): Promise<Credential>;
39
- signInWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
39
+ signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
40
40
  signOut(): Promise<null>;
41
41
  }
42
42
  declare const _default: Spec;
@@ -13,7 +13,7 @@ export declare function signIn(options: SignInOption[], params: {
13
13
  passkeys?: Object;
14
14
  googleSignIn?: GoogleSignInParams;
15
15
  }): Promise<Credential>;
16
- export declare function signInWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
16
+ export declare function signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
17
17
  export declare function signOut(): Promise<null>;
18
18
  export {};
19
19
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "react-native-credentials-manager",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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",
7
7
  "module": "./lib/module/index.js",
8
+ "types": "./lib/typescript/module/src/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
11
  "import": {
@@ -55,7 +55,7 @@ export interface Spec extends TurboModule {
55
55
  googleSignIn?: GoogleSignInParams;
56
56
  }
57
57
  ): Promise<Credential>;
58
- signInWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
58
+ signUpWithGoogle(params: GoogleSignInParams): Promise<GoogleCredential>;
59
59
  signOut(): Promise<null>;
60
60
  }
61
61
 
package/src/index.tsx CHANGED
@@ -48,10 +48,10 @@ export function signIn(
48
48
  });
49
49
  }
50
50
 
51
- export function signInWithGoogle(
51
+ export function signUpWithGoogle(
52
52
  params: GoogleSignInParams
53
53
  ): Promise<GoogleCredential> {
54
- return CredentialsManager.signInWithGoogle({
54
+ return CredentialsManager.signUpWithGoogle({
55
55
  ...params,
56
56
  nonce: params.nonce ?? '',
57
57
  autoSelectEnabled: params.autoSelectEnabled ?? true,