@hawcx/react-native-sdk 1.0.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/HawcxReactNative.podspec +25 -0
  3. package/LICENSE +21 -0
  4. package/README.md +109 -0
  5. package/docs/RELEASE.md +119 -0
  6. package/example/README.md +59 -0
  7. package/example/android/app/build.gradle +126 -0
  8. package/example/android/app/debug.keystore +0 -0
  9. package/example/android/app/proguard-rules.pro +10 -0
  10. package/example/android/app/src/debug/AndroidManifest.xml +9 -0
  11. package/example/android/app/src/main/AndroidManifest.xml +27 -0
  12. package/example/android/app/src/main/java/com/hawcx/example/MainActivity.kt +22 -0
  13. package/example/android/app/src/main/java/com/hawcx/example/MainApplication.kt +45 -0
  14. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  15. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  16. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  17. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  18. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  19. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  20. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  21. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  22. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  23. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  24. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  25. package/example/android/app/src/main/res/values/strings.xml +3 -0
  26. package/example/android/app/src/main/res/values/styles.xml +9 -0
  27. package/example/android/build.gradle +23 -0
  28. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  29. package/example/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  30. package/example/android/gradle.properties +41 -0
  31. package/example/android/gradlew +249 -0
  32. package/example/android/gradlew.bat +92 -0
  33. package/example/android/local.properties +2 -0
  34. package/example/android/settings.gradle +4 -0
  35. package/example/app.json +4 -0
  36. package/example/babel.config.js +3 -0
  37. package/example/e2e/README.md +17 -0
  38. package/example/e2e/hawcx-login.yaml +14 -0
  39. package/example/index.js +5 -0
  40. package/example/ios/.xcode.env +11 -0
  41. package/example/ios/HawcxExampleApp/AppDelegate.h +6 -0
  42. package/example/ios/HawcxExampleApp/AppDelegate.mm +31 -0
  43. package/example/ios/HawcxExampleApp/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  44. package/example/ios/HawcxExampleApp/Images.xcassets/Contents.json +6 -0
  45. package/example/ios/HawcxExampleApp/Info.plist +55 -0
  46. package/example/ios/HawcxExampleApp/LaunchScreen.storyboard +47 -0
  47. package/example/ios/HawcxExampleApp/PrivacyInfo.xcprivacy +37 -0
  48. package/example/ios/HawcxExampleApp/main.m +10 -0
  49. package/example/ios/HawcxExampleApp.xcodeproj/project.pbxproj +704 -0
  50. package/example/ios/HawcxExampleApp.xcodeproj/project.xcworkspace/xcuserdata/agambhullar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  51. package/example/ios/HawcxExampleApp.xcodeproj/xcshareddata/xcschemes/HawcxExampleApp.xcscheme +90 -0
  52. package/example/ios/HawcxExampleApp.xcodeproj/xcuserdata/agambhullar.xcuserdatad/xcschemes/xcschememanagement.plist +16 -0
  53. package/example/ios/HawcxExampleApp.xcworkspace/contents.xcworkspacedata +10 -0
  54. package/example/ios/HawcxExampleAppTests/HawcxExampleAppTests.m +66 -0
  55. package/example/ios/HawcxExampleAppTests/Info.plist +24 -0
  56. package/example/ios/Podfile +55 -0
  57. package/example/ios/Podfile.lock +1290 -0
  58. package/example/metro.config.js +16 -0
  59. package/example/package-lock.json +13220 -0
  60. package/example/package.json +30 -0
  61. package/example/src/App.tsx +552 -0
  62. package/example/src/hawcx.config.ts +41 -0
  63. package/example/tsconfig.json +8 -0
  64. package/ios/Frameworks/.keep +0 -0
  65. package/ios/Frameworks/HawcxFramework.xcframework/Info.plist +44 -0
  66. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/HawcxFramework +0 -0
  67. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Headers/HawcxFramework.h +16 -0
  68. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Info.plist +0 -0
  69. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.abi.json +9794 -0
  70. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.private.swiftinterface +302 -0
  71. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  72. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios.swiftinterface +302 -0
  73. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64/HawcxFramework.framework/Modules/module.modulemap +6 -0
  74. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/HawcxFramework +0 -0
  75. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Headers/HawcxFramework.h +16 -0
  76. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Info.plist +0 -0
  77. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.abi.json +9794 -0
  78. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +302 -0
  79. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  80. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/arm64-apple-ios-simulator.swiftinterface +302 -0
  81. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.abi.json +9794 -0
  82. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +302 -0
  83. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  84. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/HawcxFramework.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +302 -0
  85. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/Modules/module.modulemap +6 -0
  86. package/ios/Frameworks/HawcxFramework.xcframework/ios-arm64_x86_64-simulator/HawcxFramework.framework/_CodeSignature/CodeResources +234 -0
  87. package/ios/HawcxReactNative.m +51 -0
  88. package/ios/HawcxReactNative.swift +311 -0
  89. package/lib/commonjs/index.js +404 -0
  90. package/lib/commonjs/index.js.map +1 -0
  91. package/lib/module/index.js +375 -0
  92. package/lib/module/index.js.map +1 -0
  93. package/lib/typescript/__tests__/index.test.d.ts +2 -0
  94. package/lib/typescript/__tests__/index.test.d.ts.map +1 -0
  95. package/lib/typescript/index.d.ts +151 -0
  96. package/lib/typescript/index.d.ts.map +1 -0
  97. package/package.json +72 -0
  98. package/react_mobile_sdk_plan.md +240 -0
  99. package/src/__tests__/index.test.ts +163 -0
  100. package/src/index.ts +518 -0
@@ -0,0 +1,302 @@
1
+ // swift-interface-format-version: 1.0
2
+ // swift-compiler-version: Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
3
+ // swift-module-flags: -target arm64-apple-ios17.5-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-experimental-feature DebugDescriptionMacro -enable-bare-slash-regex -module-name HawcxFramework
4
+ // swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.2
5
+ import CommonCrypto
6
+ import CryptoKit
7
+ import Foundation
8
+ @_exported import HawcxFramework
9
+ import LocalAuthentication
10
+ import Security
11
+ import Swift
12
+ import UIKit
13
+ import UserNotifications
14
+ import _Concurrency
15
+ import _StringProcessing
16
+ import _SwiftConcurrencyShims
17
+ import os
18
+ public struct PushLoginRequestDetails : Swift.Codable {
19
+ public let requestId: Swift.String
20
+ public let ipAddress: Swift.String
21
+ public let location: Swift.String?
22
+ public let deviceInfo: Swift.String
23
+ public let timestamp: Swift.String
24
+ public func encode(to encoder: any Swift.Encoder) throws
25
+ public init(from decoder: any Swift.Decoder) throws
26
+ }
27
+ public struct PlatformDetailsV1 : Swift.Codable {
28
+ public let platform: Swift.String?
29
+ public let platformVersion: Swift.String?
30
+ public let architecture: Swift.String?
31
+ public func encode(to encoder: any Swift.Encoder) throws
32
+ public init(from decoder: any Swift.Decoder) throws
33
+ }
34
+ public struct HardwareInfoV1 : Swift.Codable {
35
+ public let cpuCores: Swift.Int?
36
+ public let memory: Swift.Int?
37
+ public let graphicsVendor: Swift.String?
38
+ public let touchSupport: Swift.Bool?
39
+ public func encode(to encoder: any Swift.Encoder) throws
40
+ public init(from decoder: any Swift.Decoder) throws
41
+ }
42
+ public struct BrowserSignalsV1 : Swift.Codable {
43
+ public let userAgent: Swift.String?
44
+ public let browserName: Swift.String?
45
+ public let browserVersion: Swift.String?
46
+ public let browserMajorVersion: Swift.String?
47
+ public let vendor: Swift.String?
48
+ public let platform: Swift.String?
49
+ public let languages: [Swift.String]?
50
+ public let plugins: [Swift.String]?
51
+ public let mimeTypes: [Swift.String]?
52
+ public let canvasFingerprint: Swift.String?
53
+ public let webglFingerprint: Swift.String?
54
+ public let webglVendor: Swift.String?
55
+ public let webglRenderer: Swift.String?
56
+ public func encode(to encoder: any Swift.Encoder) throws
57
+ public init(from decoder: any Swift.Decoder) throws
58
+ }
59
+ public struct DeviceInfoPayload : Swift.Codable {
60
+ public let fpVersion: Swift.String?
61
+ public let hardwareInfo: HawcxFramework.HardwareInfoV1?
62
+ public let browserSignals: HawcxFramework.BrowserSignalsV1?
63
+ public let platformDetails: HawcxFramework.PlatformDetailsV1?
64
+ public func encode(to encoder: any Swift.Encoder) throws
65
+ public init(from decoder: any Swift.Decoder) throws
66
+ }
67
+ public struct SessionDetails : Swift.Codable {
68
+ public let deviceId: Swift.String?
69
+ public let deviceInfo: HawcxFramework.DeviceInfoPayload?
70
+ public let ipDetails: Swift.String?
71
+ public let isp: Swift.String?
72
+ public let city: Swift.String?
73
+ public let state: Swift.String?
74
+ public let country: Swift.String?
75
+ #if compiler(>=5.3) && $NonescapableTypes
76
+ public var derivedOsDetails: Swift.String? {
77
+ get
78
+ }
79
+ #endif
80
+ #if compiler(>=5.3) && $NonescapableTypes
81
+ public var derivedBrowserWithVersion: Swift.String? {
82
+ get
83
+ }
84
+ #endif
85
+ #if compiler(>=5.3) && $NonescapableTypes
86
+ public var derivedDeviceType: Swift.String? {
87
+ get
88
+ }
89
+ #endif
90
+ #if compiler(>=5.3) && $NonescapableTypes
91
+ public var derivedLocation: Swift.String? {
92
+ get
93
+ }
94
+ #endif
95
+ public func encode(to encoder: any Swift.Encoder) throws
96
+ public init(from decoder: any Swift.Decoder) throws
97
+ }
98
+ public struct Device : Swift.Codable, Swift.Identifiable, Swift.Hashable {
99
+ public var id: Foundation.UUID
100
+ public let devId: Swift.String?
101
+ public let platform: Swift.String?
102
+ public let browserName: Swift.String?
103
+ public let model: Swift.String?
104
+ public let osVersion: Swift.String?
105
+ public let loginTime: Swift.String?
106
+ #if compiler(>=5.3) && $NonescapableTypes
107
+ public var osDetails: Swift.String? {
108
+ get
109
+ }
110
+ #endif
111
+ #if compiler(>=5.3) && $NonescapableTypes
112
+ public var browserWithVersion: Swift.String? {
113
+ get
114
+ }
115
+ #endif
116
+ #if compiler(>=5.3) && $NonescapableTypes
117
+ public var deviceType: Swift.String? {
118
+ get
119
+ }
120
+ #endif
121
+ #if compiler(>=5.3) && $NonescapableTypes
122
+ public var sessionDetails: [HawcxFramework.Session]? {
123
+ get
124
+ }
125
+ #endif
126
+ public static func == (lhs: HawcxFramework.Device, rhs: HawcxFramework.Device) -> Swift.Bool
127
+ public func hash(into hasher: inout Swift.Hasher)
128
+ #if compiler(>=5.3) && $NonescapableTypes
129
+ public init(id: Foundation.UUID = UUID(), devId: Swift.String?, platform: Swift.String? = nil, browserName: Swift.String? = nil, model: Swift.String? = nil, osVersion: Swift.String? = nil, loginTime: Swift.String? = nil)
130
+ #endif
131
+ #if compiler(>=5.3) && $NonescapableTypes
132
+ public init(id: Foundation.UUID = UUID(), devId: Swift.String?, osDetails: Swift.String?, browserWithVersion: Swift.String?, deviceType: Swift.String?, sessionDetails: [HawcxFramework.Session]?)
133
+ #endif
134
+ public typealias ID = Foundation.UUID
135
+ public func encode(to encoder: any Swift.Encoder) throws
136
+ public var hashValue: Swift.Int {
137
+ get
138
+ }
139
+ public init(from decoder: any Swift.Decoder) throws
140
+ }
141
+ public struct Session : Swift.Codable, Swift.Identifiable, Swift.Hashable {
142
+ public var id: Foundation.UUID
143
+ public let country: Swift.String
144
+ public let ipDetails: Swift.String
145
+ public let isp: Swift.String
146
+ public let sessionLoginTime: Swift.String
147
+ public let osDetails: Swift.String
148
+ public init(id: Foundation.UUID = UUID(), country: Swift.String, ipDetails: Swift.String, isp: Swift.String, sessionLoginTime: Swift.String, osDetails: Swift.String)
149
+ public static func == (a: HawcxFramework.Session, b: HawcxFramework.Session) -> Swift.Bool
150
+ public typealias ID = Foundation.UUID
151
+ public func encode(to encoder: any Swift.Encoder) throws
152
+ public func hash(into hasher: inout Swift.Hasher)
153
+ public var hashValue: Swift.Int {
154
+ get
155
+ }
156
+ public init(from decoder: any Swift.Decoder) throws
157
+ }
158
+ public protocol DevSessionCallback {
159
+ func onSuccess()
160
+ func showError()
161
+ }
162
+ @_hasMissingDesignatedInitializers public class SDKLogger {
163
+ public enum LogLevel {
164
+ case debug, info, warning, error
165
+ public static func == (a: HawcxFramework.SDKLogger.LogLevel, b: HawcxFramework.SDKLogger.LogLevel) -> Swift.Bool
166
+ public func hash(into hasher: inout Swift.Hasher)
167
+ public var hashValue: Swift.Int {
168
+ get
169
+ }
170
+ }
171
+ @objc deinit
172
+ }
173
+ public enum AuthV4ErrorCode : Swift.String, Swift.Error {
174
+ case networkError
175
+ case unknownError
176
+ case invalidInput
177
+ case keychainSaveFailed
178
+ case clientCryptoError
179
+ case internalStateError
180
+ case authInitFailed
181
+ case otpVerificationFailed
182
+ case missingDeviceTokenSession
183
+ case deviceVerificationFailed
184
+ case missingEr1r2ForRegistration
185
+ case cipherVerificationFailed
186
+ case missingCryptoForLogin
187
+ case missingPersistentDeviceToken
188
+ case oauthConfigurationMissing
189
+ case oauthExchangeFailed
190
+ case oauthTokenVerificationFailed
191
+ case fingerprintError
192
+ #if compiler(>=5.3) && $NonescapableTypes
193
+ public init?(rawValue: Swift.String)
194
+ #endif
195
+ public typealias RawValue = Swift.String
196
+ public var rawValue: Swift.String {
197
+ get
198
+ }
199
+ }
200
+ public enum WebLoginErrorCode : Swift.String, Swift.Error {
201
+ case unknownError
202
+ case invalidPin
203
+ case failedApprove
204
+ case networkError
205
+ #if compiler(>=5.3) && $NonescapableTypes
206
+ public init?(rawValue: Swift.String)
207
+ #endif
208
+ public typealias RawValue = Swift.String
209
+ public var rawValue: Swift.String {
210
+ get
211
+ }
212
+ }
213
+ public protocol AuthV4Callback : AnyObject {
214
+ func onOtpRequired()
215
+ #if compiler(>=5.3) && $NonescapableTypes
216
+ func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
217
+ #endif
218
+ func onError(errorCode: HawcxFramework.AuthV4ErrorCode, errorMessage: Swift.String)
219
+ }
220
+ public enum AuthV5ErrorCode : Swift.String, Swift.Error {
221
+ case networkError
222
+ case unknownError
223
+ case invalidInput
224
+ case internalStateError
225
+ case authInitFailed
226
+ case otpVerificationFailed
227
+ case deviceVerificationFailed
228
+ case loginIntegrityFailed
229
+ case cryptoError
230
+ case secureStorageError
231
+ case missingRegistrationContext
232
+ case tokenStorageFailed
233
+ case oauthConfigurationMissing
234
+ case oauthExchangeFailed
235
+ case oauthTokenVerificationFailed
236
+ #if compiler(>=5.3) && $NonescapableTypes
237
+ public init?(rawValue: Swift.String)
238
+ #endif
239
+ public typealias RawValue = Swift.String
240
+ public var rawValue: Swift.String {
241
+ get
242
+ }
243
+ }
244
+ public protocol AuthV5Callback : AnyObject {
245
+ func onOtpRequired()
246
+ #if compiler(>=5.3) && $NonescapableTypes
247
+ func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
248
+ #endif
249
+ func onError(errorCode: HawcxFramework.AuthV5ErrorCode, errorMessage: Swift.String)
250
+ }
251
+ public protocol HawcxPushAuthDelegate : AnyObject {
252
+ func hawcx(didReceiveLoginRequest requestId: Swift.String, details: HawcxFramework.PushLoginRequestDetails)
253
+ func hawcx(failedToFetchLoginRequestDetails error: any Swift.Error)
254
+ }
255
+ public class HawcxSDK {
256
+ weak public var pushAuthDelegate: (any HawcxFramework.HawcxPushAuthDelegate)?
257
+ #if compiler(>=5.3) && $NonescapableTypes
258
+ public init(projectApiKey: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
259
+ #endif
260
+ public func authenticateV4(userid: Swift.String, callback: any HawcxFramework.AuthV4Callback)
261
+ public func submitOtpV4(otp: Swift.String)
262
+ public func authenticateV5(userid: Swift.String, callback: any HawcxFramework.AuthV5Callback)
263
+ public func submitOtpV5(otp: Swift.String)
264
+ public func getDeviceDetails(callback: any HawcxFramework.DevSessionCallback)
265
+ public func webLogin(pin: Swift.String, callback: any HawcxFramework.WebLoginCallback)
266
+ public func webApprove(token: Swift.String, callback: any HawcxFramework.WebLoginCallback)
267
+ public func setAPNsDeviceToken(_ tokenData: Foundation.Data)
268
+ public func userDidAuthenticate()
269
+ public func handlePushNotification(userInfo: [Swift.AnyHashable : Any]) -> Swift.Bool
270
+ #if compiler(>=5.3) && $NonescapableTypes
271
+ public func approveLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
272
+ #endif
273
+ #if compiler(>=5.3) && $NonescapableTypes
274
+ public func declineLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
275
+ #endif
276
+ public func getLastLoggedInUser() -> Swift.String
277
+ public func clearSessionTokens(forUser userid: Swift.String)
278
+ public func clearUserKeychainData(forUser userid: Swift.String)
279
+ public func clearLastLoggedInUser()
280
+ @objc deinit
281
+ }
282
+ public struct HawcxOAuthConfig {
283
+ public let tokenEndpoint: Foundation.URL
284
+ public let clientId: Swift.String
285
+ public let publicKeyPem: Swift.String
286
+ public init(tokenEndpoint: Foundation.URL, clientId: Swift.String, publicKeyPem: Swift.String)
287
+ }
288
+ public protocol WebLoginCallback {
289
+ func showError(webLoginErrorCode: HawcxFramework.WebLoginErrorCode, errorMessage: Swift.String)
290
+ func onSuccess()
291
+ }
292
+ extension HawcxFramework.SDKLogger.LogLevel : Swift.Equatable {}
293
+ extension HawcxFramework.SDKLogger.LogLevel : Swift.Hashable {}
294
+ extension HawcxFramework.AuthV4ErrorCode : Swift.Equatable {}
295
+ extension HawcxFramework.AuthV4ErrorCode : Swift.Hashable {}
296
+ extension HawcxFramework.AuthV4ErrorCode : Swift.RawRepresentable {}
297
+ extension HawcxFramework.WebLoginErrorCode : Swift.Equatable {}
298
+ extension HawcxFramework.WebLoginErrorCode : Swift.Hashable {}
299
+ extension HawcxFramework.WebLoginErrorCode : Swift.RawRepresentable {}
300
+ extension HawcxFramework.AuthV5ErrorCode : Swift.Equatable {}
301
+ extension HawcxFramework.AuthV5ErrorCode : Swift.Hashable {}
302
+ extension HawcxFramework.AuthV5ErrorCode : Swift.RawRepresentable {}
@@ -0,0 +1,302 @@
1
+ // swift-interface-format-version: 1.0
2
+ // swift-compiler-version: Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
3
+ // swift-module-flags: -target arm64-apple-ios17.5-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-experimental-feature DebugDescriptionMacro -enable-bare-slash-regex -module-name HawcxFramework
4
+ // swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.2
5
+ import CommonCrypto
6
+ import CryptoKit
7
+ import Foundation
8
+ @_exported import HawcxFramework
9
+ import LocalAuthentication
10
+ import Security
11
+ import Swift
12
+ import UIKit
13
+ import UserNotifications
14
+ import _Concurrency
15
+ import _StringProcessing
16
+ import _SwiftConcurrencyShims
17
+ import os
18
+ public struct PushLoginRequestDetails : Swift.Codable {
19
+ public let requestId: Swift.String
20
+ public let ipAddress: Swift.String
21
+ public let location: Swift.String?
22
+ public let deviceInfo: Swift.String
23
+ public let timestamp: Swift.String
24
+ public func encode(to encoder: any Swift.Encoder) throws
25
+ public init(from decoder: any Swift.Decoder) throws
26
+ }
27
+ public struct PlatformDetailsV1 : Swift.Codable {
28
+ public let platform: Swift.String?
29
+ public let platformVersion: Swift.String?
30
+ public let architecture: Swift.String?
31
+ public func encode(to encoder: any Swift.Encoder) throws
32
+ public init(from decoder: any Swift.Decoder) throws
33
+ }
34
+ public struct HardwareInfoV1 : Swift.Codable {
35
+ public let cpuCores: Swift.Int?
36
+ public let memory: Swift.Int?
37
+ public let graphicsVendor: Swift.String?
38
+ public let touchSupport: Swift.Bool?
39
+ public func encode(to encoder: any Swift.Encoder) throws
40
+ public init(from decoder: any Swift.Decoder) throws
41
+ }
42
+ public struct BrowserSignalsV1 : Swift.Codable {
43
+ public let userAgent: Swift.String?
44
+ public let browserName: Swift.String?
45
+ public let browserVersion: Swift.String?
46
+ public let browserMajorVersion: Swift.String?
47
+ public let vendor: Swift.String?
48
+ public let platform: Swift.String?
49
+ public let languages: [Swift.String]?
50
+ public let plugins: [Swift.String]?
51
+ public let mimeTypes: [Swift.String]?
52
+ public let canvasFingerprint: Swift.String?
53
+ public let webglFingerprint: Swift.String?
54
+ public let webglVendor: Swift.String?
55
+ public let webglRenderer: Swift.String?
56
+ public func encode(to encoder: any Swift.Encoder) throws
57
+ public init(from decoder: any Swift.Decoder) throws
58
+ }
59
+ public struct DeviceInfoPayload : Swift.Codable {
60
+ public let fpVersion: Swift.String?
61
+ public let hardwareInfo: HawcxFramework.HardwareInfoV1?
62
+ public let browserSignals: HawcxFramework.BrowserSignalsV1?
63
+ public let platformDetails: HawcxFramework.PlatformDetailsV1?
64
+ public func encode(to encoder: any Swift.Encoder) throws
65
+ public init(from decoder: any Swift.Decoder) throws
66
+ }
67
+ public struct SessionDetails : Swift.Codable {
68
+ public let deviceId: Swift.String?
69
+ public let deviceInfo: HawcxFramework.DeviceInfoPayload?
70
+ public let ipDetails: Swift.String?
71
+ public let isp: Swift.String?
72
+ public let city: Swift.String?
73
+ public let state: Swift.String?
74
+ public let country: Swift.String?
75
+ #if compiler(>=5.3) && $NonescapableTypes
76
+ public var derivedOsDetails: Swift.String? {
77
+ get
78
+ }
79
+ #endif
80
+ #if compiler(>=5.3) && $NonescapableTypes
81
+ public var derivedBrowserWithVersion: Swift.String? {
82
+ get
83
+ }
84
+ #endif
85
+ #if compiler(>=5.3) && $NonescapableTypes
86
+ public var derivedDeviceType: Swift.String? {
87
+ get
88
+ }
89
+ #endif
90
+ #if compiler(>=5.3) && $NonescapableTypes
91
+ public var derivedLocation: Swift.String? {
92
+ get
93
+ }
94
+ #endif
95
+ public func encode(to encoder: any Swift.Encoder) throws
96
+ public init(from decoder: any Swift.Decoder) throws
97
+ }
98
+ public struct Device : Swift.Codable, Swift.Identifiable, Swift.Hashable {
99
+ public var id: Foundation.UUID
100
+ public let devId: Swift.String?
101
+ public let platform: Swift.String?
102
+ public let browserName: Swift.String?
103
+ public let model: Swift.String?
104
+ public let osVersion: Swift.String?
105
+ public let loginTime: Swift.String?
106
+ #if compiler(>=5.3) && $NonescapableTypes
107
+ public var osDetails: Swift.String? {
108
+ get
109
+ }
110
+ #endif
111
+ #if compiler(>=5.3) && $NonescapableTypes
112
+ public var browserWithVersion: Swift.String? {
113
+ get
114
+ }
115
+ #endif
116
+ #if compiler(>=5.3) && $NonescapableTypes
117
+ public var deviceType: Swift.String? {
118
+ get
119
+ }
120
+ #endif
121
+ #if compiler(>=5.3) && $NonescapableTypes
122
+ public var sessionDetails: [HawcxFramework.Session]? {
123
+ get
124
+ }
125
+ #endif
126
+ public static func == (lhs: HawcxFramework.Device, rhs: HawcxFramework.Device) -> Swift.Bool
127
+ public func hash(into hasher: inout Swift.Hasher)
128
+ #if compiler(>=5.3) && $NonescapableTypes
129
+ public init(id: Foundation.UUID = UUID(), devId: Swift.String?, platform: Swift.String? = nil, browserName: Swift.String? = nil, model: Swift.String? = nil, osVersion: Swift.String? = nil, loginTime: Swift.String? = nil)
130
+ #endif
131
+ #if compiler(>=5.3) && $NonescapableTypes
132
+ public init(id: Foundation.UUID = UUID(), devId: Swift.String?, osDetails: Swift.String?, browserWithVersion: Swift.String?, deviceType: Swift.String?, sessionDetails: [HawcxFramework.Session]?)
133
+ #endif
134
+ public typealias ID = Foundation.UUID
135
+ public func encode(to encoder: any Swift.Encoder) throws
136
+ public var hashValue: Swift.Int {
137
+ get
138
+ }
139
+ public init(from decoder: any Swift.Decoder) throws
140
+ }
141
+ public struct Session : Swift.Codable, Swift.Identifiable, Swift.Hashable {
142
+ public var id: Foundation.UUID
143
+ public let country: Swift.String
144
+ public let ipDetails: Swift.String
145
+ public let isp: Swift.String
146
+ public let sessionLoginTime: Swift.String
147
+ public let osDetails: Swift.String
148
+ public init(id: Foundation.UUID = UUID(), country: Swift.String, ipDetails: Swift.String, isp: Swift.String, sessionLoginTime: Swift.String, osDetails: Swift.String)
149
+ public static func == (a: HawcxFramework.Session, b: HawcxFramework.Session) -> Swift.Bool
150
+ public typealias ID = Foundation.UUID
151
+ public func encode(to encoder: any Swift.Encoder) throws
152
+ public func hash(into hasher: inout Swift.Hasher)
153
+ public var hashValue: Swift.Int {
154
+ get
155
+ }
156
+ public init(from decoder: any Swift.Decoder) throws
157
+ }
158
+ public protocol DevSessionCallback {
159
+ func onSuccess()
160
+ func showError()
161
+ }
162
+ @_hasMissingDesignatedInitializers public class SDKLogger {
163
+ public enum LogLevel {
164
+ case debug, info, warning, error
165
+ public static func == (a: HawcxFramework.SDKLogger.LogLevel, b: HawcxFramework.SDKLogger.LogLevel) -> Swift.Bool
166
+ public func hash(into hasher: inout Swift.Hasher)
167
+ public var hashValue: Swift.Int {
168
+ get
169
+ }
170
+ }
171
+ @objc deinit
172
+ }
173
+ public enum AuthV4ErrorCode : Swift.String, Swift.Error {
174
+ case networkError
175
+ case unknownError
176
+ case invalidInput
177
+ case keychainSaveFailed
178
+ case clientCryptoError
179
+ case internalStateError
180
+ case authInitFailed
181
+ case otpVerificationFailed
182
+ case missingDeviceTokenSession
183
+ case deviceVerificationFailed
184
+ case missingEr1r2ForRegistration
185
+ case cipherVerificationFailed
186
+ case missingCryptoForLogin
187
+ case missingPersistentDeviceToken
188
+ case oauthConfigurationMissing
189
+ case oauthExchangeFailed
190
+ case oauthTokenVerificationFailed
191
+ case fingerprintError
192
+ #if compiler(>=5.3) && $NonescapableTypes
193
+ public init?(rawValue: Swift.String)
194
+ #endif
195
+ public typealias RawValue = Swift.String
196
+ public var rawValue: Swift.String {
197
+ get
198
+ }
199
+ }
200
+ public enum WebLoginErrorCode : Swift.String, Swift.Error {
201
+ case unknownError
202
+ case invalidPin
203
+ case failedApprove
204
+ case networkError
205
+ #if compiler(>=5.3) && $NonescapableTypes
206
+ public init?(rawValue: Swift.String)
207
+ #endif
208
+ public typealias RawValue = Swift.String
209
+ public var rawValue: Swift.String {
210
+ get
211
+ }
212
+ }
213
+ public protocol AuthV4Callback : AnyObject {
214
+ func onOtpRequired()
215
+ #if compiler(>=5.3) && $NonescapableTypes
216
+ func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
217
+ #endif
218
+ func onError(errorCode: HawcxFramework.AuthV4ErrorCode, errorMessage: Swift.String)
219
+ }
220
+ public enum AuthV5ErrorCode : Swift.String, Swift.Error {
221
+ case networkError
222
+ case unknownError
223
+ case invalidInput
224
+ case internalStateError
225
+ case authInitFailed
226
+ case otpVerificationFailed
227
+ case deviceVerificationFailed
228
+ case loginIntegrityFailed
229
+ case cryptoError
230
+ case secureStorageError
231
+ case missingRegistrationContext
232
+ case tokenStorageFailed
233
+ case oauthConfigurationMissing
234
+ case oauthExchangeFailed
235
+ case oauthTokenVerificationFailed
236
+ #if compiler(>=5.3) && $NonescapableTypes
237
+ public init?(rawValue: Swift.String)
238
+ #endif
239
+ public typealias RawValue = Swift.String
240
+ public var rawValue: Swift.String {
241
+ get
242
+ }
243
+ }
244
+ public protocol AuthV5Callback : AnyObject {
245
+ func onOtpRequired()
246
+ #if compiler(>=5.3) && $NonescapableTypes
247
+ func onAuthSuccess(accessToken: Swift.String?, refreshToken: Swift.String?, isLoginFlow: Swift.Bool)
248
+ #endif
249
+ func onError(errorCode: HawcxFramework.AuthV5ErrorCode, errorMessage: Swift.String)
250
+ }
251
+ public protocol HawcxPushAuthDelegate : AnyObject {
252
+ func hawcx(didReceiveLoginRequest requestId: Swift.String, details: HawcxFramework.PushLoginRequestDetails)
253
+ func hawcx(failedToFetchLoginRequestDetails error: any Swift.Error)
254
+ }
255
+ public class HawcxSDK {
256
+ weak public var pushAuthDelegate: (any HawcxFramework.HawcxPushAuthDelegate)?
257
+ #if compiler(>=5.3) && $NonescapableTypes
258
+ public init(projectApiKey: Swift.String, oauthConfig: HawcxFramework.HawcxOAuthConfig? = nil)
259
+ #endif
260
+ public func authenticateV4(userid: Swift.String, callback: any HawcxFramework.AuthV4Callback)
261
+ public func submitOtpV4(otp: Swift.String)
262
+ public func authenticateV5(userid: Swift.String, callback: any HawcxFramework.AuthV5Callback)
263
+ public func submitOtpV5(otp: Swift.String)
264
+ public func getDeviceDetails(callback: any HawcxFramework.DevSessionCallback)
265
+ public func webLogin(pin: Swift.String, callback: any HawcxFramework.WebLoginCallback)
266
+ public func webApprove(token: Swift.String, callback: any HawcxFramework.WebLoginCallback)
267
+ public func setAPNsDeviceToken(_ tokenData: Foundation.Data)
268
+ public func userDidAuthenticate()
269
+ public func handlePushNotification(userInfo: [Swift.AnyHashable : Any]) -> Swift.Bool
270
+ #if compiler(>=5.3) && $NonescapableTypes
271
+ public func approveLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
272
+ #endif
273
+ #if compiler(>=5.3) && $NonescapableTypes
274
+ public func declineLoginRequest(requestId: Swift.String, completion: @escaping ((any Swift.Error)?) -> Swift.Void)
275
+ #endif
276
+ public func getLastLoggedInUser() -> Swift.String
277
+ public func clearSessionTokens(forUser userid: Swift.String)
278
+ public func clearUserKeychainData(forUser userid: Swift.String)
279
+ public func clearLastLoggedInUser()
280
+ @objc deinit
281
+ }
282
+ public struct HawcxOAuthConfig {
283
+ public let tokenEndpoint: Foundation.URL
284
+ public let clientId: Swift.String
285
+ public let publicKeyPem: Swift.String
286
+ public init(tokenEndpoint: Foundation.URL, clientId: Swift.String, publicKeyPem: Swift.String)
287
+ }
288
+ public protocol WebLoginCallback {
289
+ func showError(webLoginErrorCode: HawcxFramework.WebLoginErrorCode, errorMessage: Swift.String)
290
+ func onSuccess()
291
+ }
292
+ extension HawcxFramework.SDKLogger.LogLevel : Swift.Equatable {}
293
+ extension HawcxFramework.SDKLogger.LogLevel : Swift.Hashable {}
294
+ extension HawcxFramework.AuthV4ErrorCode : Swift.Equatable {}
295
+ extension HawcxFramework.AuthV4ErrorCode : Swift.Hashable {}
296
+ extension HawcxFramework.AuthV4ErrorCode : Swift.RawRepresentable {}
297
+ extension HawcxFramework.WebLoginErrorCode : Swift.Equatable {}
298
+ extension HawcxFramework.WebLoginErrorCode : Swift.Hashable {}
299
+ extension HawcxFramework.WebLoginErrorCode : Swift.RawRepresentable {}
300
+ extension HawcxFramework.AuthV5ErrorCode : Swift.Equatable {}
301
+ extension HawcxFramework.AuthV5ErrorCode : Swift.Hashable {}
302
+ extension HawcxFramework.AuthV5ErrorCode : Swift.RawRepresentable {}