@hawcx/react-native-sdk 1.0.1 → 1.0.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/HawcxReactNative.podspec +2 -2
  3. package/LICENSE +48 -15
  4. package/README.md +155 -88
  5. package/docs/RELEASE.md +15 -4
  6. package/example/README.md +1 -1
  7. package/example/android/build.gradle +12 -0
  8. package/example/android/settings.gradle +34 -0
  9. package/example/ios/HawcxExampleApp.xcodeproj/project.pbxproj +57 -57
  10. package/example/ios/HawcxExampleApp.xcodeproj/project.xcworkspace/xcuserdata/agambhullar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  11. package/example/ios/Podfile +24 -0
  12. package/example/ios/Podfile.lock +3 -3
  13. package/example/package-lock.json +3 -3
  14. package/example/package.json +1 -1
  15. package/example/src/App.tsx +211 -8
  16. package/example/src/hawcx.config.ts +10 -26
  17. package/ios/Frameworks/HawcxFramework.xcframework/Info.plist +5 -5
  18. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/HawcxFramework +0 -0
  19. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.abi.json +185 -300
  20. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.private.swiftinterface +11 -1
  21. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  22. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.swiftinterface +11 -1
  23. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/HawcxFramework +0 -0
  24. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.abi.json +185 -300
  25. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +11 -1
  26. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  27. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.swiftinterface +11 -1
  28. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.abi.json +185 -300
  29. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +11 -1
  30. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  31. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +11 -1
  32. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/_CodeSignature/CodeResources +20 -20
  33. package/ios/HawcxReactNative.swift +87 -1
  34. package/lib/commonjs/index.js +41 -1
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/module/index.js +40 -1
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/typescript/index.d.ts +36 -0
  39. package/lib/typescript/index.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/react_mobile_sdk_plan.md +2 -0
  42. package/src/__tests__/index.test.ts +44 -1
  43. package/src/index.ts +81 -0
@@ -247,6 +247,12 @@ public protocol AuthV5Callback : AnyObject {
247
247
  func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
248
248
  #endif
249
249
  func onError(errorCode: HawcxFramework.AuthV5ErrorCode, errorMessage: Swift.String)
250
+ #if compiler(>=5.3) && $NonescapableTypes
251
+ func onAuthorizationCode(code: Swift.String, expiresIn: Swift.Int?)
252
+ #endif
253
+ #if compiler(>=5.3) && $NonescapableTypes
254
+ func onAdditionalVerificationRequired(sessionId: Swift.String, detail: Swift.String?)
255
+ #endif
250
256
  }
251
257
  public protocol HawcxPushAuthDelegate : AnyObject {
252
258
  func hawcx(didReceiveLoginRequest requestId: Swift.String, details: HawcxFramework.PushLoginRequestDetails)
@@ -255,7 +261,7 @@ public protocol HawcxPushAuthDelegate : AnyObject {
255
261
  public class HawcxSDK {
256
262
  weak public var pushAuthDelegate: (any HawcxFramework.HawcxPushAuthDelegate)?
257
263
  #if compiler(>=5.3) && $NonescapableTypes
258
- public init(projectApiKey: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
264
+ public init(projectApiKey: Swift.String, baseURL: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
259
265
  #endif
260
266
  public func authenticateV4(userid: Swift.String, callback: any HawcxFramework.AuthV4Callback)
261
267
  public func submitOtpV4(otp: Swift.String)
@@ -274,6 +280,10 @@ public class HawcxSDK {
274
280
  public func declineLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
275
281
  #endif
276
282
  public func getLastLoggedInUser() -> Swift.String
283
+ #if compiler(>=5.3) && $NonescapableTypes
284
+ @discardableResult
285
+ public func storeBackendOAuthTokens(accessToken: Swift.String, refreshToken: Swift.String?, forUser userId: Swift.String) -> Swift.Bool
286
+ #endif
277
287
  public func clearSessionTokens(forUser userid: Swift.String)
278
288
  public func clearUserKeychainData(forUser userid: Swift.String)
279
289
  public func clearLastLoggedInUser()
@@ -247,6 +247,12 @@ public protocol AuthV5Callback : AnyObject {
247
247
  func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
248
248
  #endif
249
249
  func onError(errorCode: HawcxFramework.AuthV5ErrorCode, errorMessage: Swift.String)
250
+ #if compiler(>=5.3) && $NonescapableTypes
251
+ func onAuthorizationCode(code: Swift.String, expiresIn: Swift.Int?)
252
+ #endif
253
+ #if compiler(>=5.3) && $NonescapableTypes
254
+ func onAdditionalVerificationRequired(sessionId: Swift.String, detail: Swift.String?)
255
+ #endif
250
256
  }
251
257
  public protocol HawcxPushAuthDelegate : AnyObject {
252
258
  func hawcx(didReceiveLoginRequest requestId: Swift.String, details: HawcxFramework.PushLoginRequestDetails)
@@ -255,7 +261,7 @@ public protocol HawcxPushAuthDelegate : AnyObject {
255
261
  public class HawcxSDK {
256
262
  weak public var pushAuthDelegate: (any HawcxFramework.HawcxPushAuthDelegate)?
257
263
  #if compiler(>=5.3) && $NonescapableTypes
258
- public init(projectApiKey: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
264
+ public init(projectApiKey: Swift.String, baseURL: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
259
265
  #endif
260
266
  public func authenticateV4(userid: Swift.String, callback: any HawcxFramework.AuthV4Callback)
261
267
  public func submitOtpV4(otp: Swift.String)
@@ -274,6 +280,10 @@ public class HawcxSDK {
274
280
  public func declineLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
275
281
  #endif
276
282
  public func getLastLoggedInUser() -> Swift.String
283
+ #if compiler(>=5.3) && $NonescapableTypes
284
+ @discardableResult
285
+ public func storeBackendOAuthTokens(accessToken: Swift.String, refreshToken: Swift.String?, forUser userId: Swift.String) -> Swift.Bool
286
+ #endif
277
287
  public func clearSessionTokens(forUser userid: Swift.String)
278
288
  public func clearUserKeychainData(forUser userid: Swift.String)
279
289
  public func clearLastLoggedInUser()