@regulaforensics/face-sdk 8.3.1105-nightly → 8.3.1107-rc
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/RNFaceSDK.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +91 -0
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +106 -3
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +39 -1
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +0 -1
- package/examples/capacitor/package-lock.json +227 -221
- package/examples/capacitor/package.json +5 -2
- package/examples/ionic/package-lock.json +1579 -2369
- package/examples/ionic/package.json +16 -13
- package/examples/react_native/package-lock.json +138 -169
- package/examples/react_native/package.json +4 -3
- package/ios/Config.swift +109 -1
- package/ios/Decoder.swift +71 -3
- package/ios/Main.swift +24 -4
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +134 -57
- package/test/package-lock.json +1 -1
- package/test/test.tsx +68 -60
- package/www/capacitor/customization/customization_images.js +40 -0
- package/www/capacitor/index.js +33 -12
- package/www/capacitor/liveness/enrollment_config.js +102 -0
- package/www/capacitor/liveness/enrollment_request.js +34 -0
- package/www/capacitor/liveness/enrollment_response.js +26 -0
- package/www/capacitor/liveness/error_response.js +21 -0
- package/www/capacitor/liveness/liveness_config.js +1 -0
- package/www/capacitor/liveness/liveness_exception.js +6 -5
- package/www/capacitor/liveness/liveness_notification.js +2 -0
- package/www/capacitor/liveness/verification_config.js +98 -0
- package/www/capacitor/liveness/verification_response.js +27 -0
- package/www/capacitor/liveness/verify_match_response.js +21 -0
- package/www/cordova.js +595 -80
- package/www/react-native/customization/customization_images.js +40 -0
- package/www/react-native/index.js +33 -12
- package/www/react-native/liveness/enrollment_config.js +102 -0
- package/www/react-native/liveness/enrollment_request.js +34 -0
- package/www/react-native/liveness/enrollment_response.js +26 -0
- package/www/react-native/liveness/error_response.js +21 -0
- package/www/react-native/liveness/liveness_config.js +1 -0
- package/www/react-native/liveness/liveness_exception.js +6 -5
- package/www/react-native/liveness/liveness_notification.js +2 -0
- package/www/react-native/liveness/verification_config.js +98 -0
- package/www/react-native/liveness/verification_response.js +27 -0
- package/www/react-native/liveness/verify_match_response.js +21 -0
- package/www/types/customization/customization_images.d.ts +5 -0
- package/www/types/index.d.ts +28 -3
- package/www/types/liveness/enrollment_config.d.ts +97 -0
- package/www/types/liveness/enrollment_request.d.ts +6 -0
- package/www/types/liveness/enrollment_response.d.ts +9 -0
- package/www/types/liveness/error_response.d.ts +6 -0
- package/www/types/liveness/liveness_config.d.ts +1 -0
- package/www/types/liveness/liveness_exception.d.ts +1 -0
- package/www/types/liveness/liveness_notification.d.ts +2 -0
- package/www/types/liveness/verification_config.d.ts +95 -0
- package/www/types/liveness/verification_response.d.ts +10 -0
- package/www/types/liveness/verify_match_response.d.ts +6 -0
package/ios/Config.swift
CHANGED
|
@@ -63,7 +63,7 @@ public extension FaceCaptureConfiguration {
|
|
|
63
63
|
public extension LivenessConfiguration {
|
|
64
64
|
static func decode(_ it: Any?) -> Self? {
|
|
65
65
|
guard let it = it as? [String: Any] else { return nil }
|
|
66
|
-
return Self(
|
|
66
|
+
return Self.init(builderBlock: { builder in
|
|
67
67
|
for (k, v) in it {
|
|
68
68
|
switch k {
|
|
69
69
|
case("copyright"): builder.isCopyright = v as! Bool
|
|
@@ -107,6 +107,114 @@ public extension LivenessConfiguration {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
public extension EnrollmentConfiguration {
|
|
111
|
+
static func decode2(_ it: Any?) -> Self? {
|
|
112
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
113
|
+
return Self.init(builderBlock: { builder in
|
|
114
|
+
for (k, v) in it {
|
|
115
|
+
switch k {
|
|
116
|
+
case("copyright"): builder.isCopyright = v as! Bool
|
|
117
|
+
case("cameraSwitchEnabled"): builder.isCameraSwitchButtonEnabled = v as! Bool
|
|
118
|
+
case("closeButtonEnabled"): builder.isCloseButtonEnabled = v as! Bool
|
|
119
|
+
case("torchButtonEnabled"): builder.isTorchButtonEnabled = v as! Bool
|
|
120
|
+
case("vibrateOnSteps"): builder.vibrateOnSteps = v as! Bool
|
|
121
|
+
case("cameraPositionIOS"): builder.cameraPosition = CameraPosition(rawValue: v as! Int)!
|
|
122
|
+
case("attemptsCount"): builder.attemptsCount = v as! Int
|
|
123
|
+
case("locationTrackingEnabled"): builder.isLocationTrackingEnabled = v as! Bool
|
|
124
|
+
case("preventScreenRecording"): builder.isPreventScreenRecordingEnable = v as! Bool
|
|
125
|
+
case("recordingProcess"): builder.recordingProcess = RecordingProcess(rawValue: v as! Int)!
|
|
126
|
+
case("livenessType"): builder.livenessType = LivenessType(rawValue: v as! Int)!
|
|
127
|
+
case("screenOrientation"): builder.screenOrientation = RFSScreenOrientation.decode(v)
|
|
128
|
+
case("tag"): builder.tag = v as? String
|
|
129
|
+
case("externalId"): builder.externalId = v as! String
|
|
130
|
+
case("groupId"): builder.groupId = v as? String
|
|
131
|
+
case("checkDuplicatesEnabled"): builder.checkDuplicatesEnabled = v as! NSNumber
|
|
132
|
+
case("duplicatesThreshold"): builder.duplicatesThreshold = v as? NSNumber
|
|
133
|
+
case("skipStep"): builder.stepSkippingMask = RFSLivenessStepSkip.decode(v)
|
|
134
|
+
case("metadata"): builder.metadata = v as! [String: Any]
|
|
135
|
+
default: break
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
func encode2() -> [String: Any?] {
|
|
141
|
+
return [
|
|
142
|
+
"copyright": self.isCopyright,
|
|
143
|
+
"cameraSwitchEnabled": self.isCameraSwitchButtonEnabled,
|
|
144
|
+
"closeButtonEnabled": self.isCloseButtonEnabled,
|
|
145
|
+
"torchButtonEnabled": self.isTorchButtonEnabled,
|
|
146
|
+
"vibrateOnSteps": self.vibrateOnSteps,
|
|
147
|
+
"cameraPositionIOS": self.cameraPosition.rawValue,
|
|
148
|
+
"attemptsCount": self.attemptsCount,
|
|
149
|
+
"locationTrackingEnabled": self.isLocationTrackingEnabled,
|
|
150
|
+
"preventScreenRecording": self.isPreventScreenRecordingEnable,
|
|
151
|
+
"recordingProcess": self.recordingProcess.rawValue,
|
|
152
|
+
"livenessType": self.livenessType.rawValue,
|
|
153
|
+
"screenOrientation": self.screenOrientation.encode(),
|
|
154
|
+
"tag": self.tag,
|
|
155
|
+
"externalId": self.externalId,
|
|
156
|
+
"groupId": self.groupId,
|
|
157
|
+
"checkDuplicatesEnabled": self.checkDuplicatesEnabled,
|
|
158
|
+
"duplicatesThreshold": self.duplicatesThreshold,
|
|
159
|
+
"skipStep": self.stepSkippingMask.encode(),
|
|
160
|
+
"metadata": self.metadata,
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public extension VerificationConfiguration {
|
|
166
|
+
static func decode2(_ it: Any?) -> Self? {
|
|
167
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
168
|
+
return Self.init(builderBlock: { builder in
|
|
169
|
+
for (k, v) in it {
|
|
170
|
+
switch k {
|
|
171
|
+
case("copyright"): builder.isCopyright = v as! Bool
|
|
172
|
+
case("cameraSwitchEnabled"): builder.isCameraSwitchButtonEnabled = v as! Bool
|
|
173
|
+
case("closeButtonEnabled"): builder.isCloseButtonEnabled = v as! Bool
|
|
174
|
+
case("torchButtonEnabled"): builder.isTorchButtonEnabled = v as! Bool
|
|
175
|
+
case("vibrateOnSteps"): builder.vibrateOnSteps = v as! Bool
|
|
176
|
+
case("cameraPositionIOS"): builder.cameraPosition = CameraPosition(rawValue: v as! Int)!
|
|
177
|
+
case("attemptsCount"): builder.attemptsCount = v as! Int
|
|
178
|
+
case("locationTrackingEnabled"): builder.isLocationTrackingEnabled = v as! Bool
|
|
179
|
+
case("preventScreenRecording"): builder.isPreventScreenRecordingEnable = v as! Bool
|
|
180
|
+
case("recordingProcess"): builder.recordingProcess = RecordingProcess(rawValue: v as! Int)!
|
|
181
|
+
case("livenessType"): builder.livenessType = LivenessType(rawValue: v as! Int)!
|
|
182
|
+
case("screenOrientation"): builder.screenOrientation = RFSScreenOrientation.decode(v)
|
|
183
|
+
case("tag"): builder.tag = v as? String
|
|
184
|
+
case("personId"): builder.personId = v as! String
|
|
185
|
+
case("groupId"): builder.groupId = v as? String
|
|
186
|
+
case("threshold"): builder.threshold = v as? NSNumber
|
|
187
|
+
case("skipStep"): builder.stepSkippingMask = RFSLivenessStepSkip.decode(v)
|
|
188
|
+
case("metadata"): builder.metadata = v as! [String: Any]
|
|
189
|
+
default: break
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
func encode2() -> [String: Any?] {
|
|
195
|
+
return [
|
|
196
|
+
"copyright": self.isCopyright,
|
|
197
|
+
"cameraSwitchEnabled": self.isCameraSwitchButtonEnabled,
|
|
198
|
+
"closeButtonEnabled": self.isCloseButtonEnabled,
|
|
199
|
+
"torchButtonEnabled": self.isTorchButtonEnabled,
|
|
200
|
+
"vibrateOnSteps": self.vibrateOnSteps,
|
|
201
|
+
"cameraPositionIOS": self.cameraPosition.rawValue,
|
|
202
|
+
"attemptsCount": self.attemptsCount,
|
|
203
|
+
"locationTrackingEnabled": self.isLocationTrackingEnabled,
|
|
204
|
+
"preventScreenRecording": self.isPreventScreenRecordingEnable,
|
|
205
|
+
"recordingProcess": self.recordingProcess.rawValue,
|
|
206
|
+
"livenessType": self.livenessType.rawValue,
|
|
207
|
+
"screenOrientation": self.screenOrientation.encode(),
|
|
208
|
+
"tag": self.tag,
|
|
209
|
+
"personId": self.personId,
|
|
210
|
+
"groupId": self.groupId,
|
|
211
|
+
"threshold": self.threshold,
|
|
212
|
+
"skipStep": self.stepSkippingMask.encode(),
|
|
213
|
+
"metadata": self.metadata,
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
110
218
|
public extension MatchFacesConfiguration {
|
|
111
219
|
static func decode(_ it: Any?) -> Self? {
|
|
112
220
|
guard let it = it as? [String: Any] else { return nil }
|
package/ios/Decoder.swift
CHANGED
|
@@ -112,17 +112,17 @@ public extension LivenessResponse {
|
|
|
112
112
|
static func decode(_ it: Any?) -> Self {
|
|
113
113
|
let it = it as! [String: Any]
|
|
114
114
|
let alloc = LivenessResponse.allocate()
|
|
115
|
-
let sel = "initWithTag:transactionId:estimatedAge:status:image:error:".selector()
|
|
115
|
+
let sel = "initWithTag:transactionId:estimatedAge:status:image:error:enrollResponse:verifyResponse:".selector()
|
|
116
116
|
return privateInit(alloc, sel, (@convention(c)(
|
|
117
117
|
AnyObject, Selector,
|
|
118
|
-
Any?, Any?, Any?, Int, Any?, Any?) -> Unmanaged<AnyObject>?).self, { f in f(
|
|
118
|
+
Any?, Any?, Any?, Int, Any?, Any?, Any?, Any?) -> Unmanaged<AnyObject>?).self, { f in f(
|
|
119
119
|
alloc, sel,
|
|
120
120
|
it["tag"],
|
|
121
121
|
it["transactionId"],
|
|
122
122
|
it["estimatedAge"],
|
|
123
123
|
it["liveness"] as! Int,
|
|
124
124
|
UIImage.decode(it["image"]),
|
|
125
|
-
nil
|
|
125
|
+
nil, nil, nil
|
|
126
126
|
)})
|
|
127
127
|
}
|
|
128
128
|
func encode() -> [String: Any?] {
|
|
@@ -144,6 +144,74 @@ func generateLivenessNotification(_ status: LivenessProcessStatus, _ result: Liv
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
public extension ErrorResponse {
|
|
148
|
+
static func decode(_ it: Any?) -> ErrorResponse? {
|
|
149
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
150
|
+
let result = ErrorResponse.emptyInit() as ErrorResponse
|
|
151
|
+
result.setValue(it["code"] as Any?, forKey: "code")
|
|
152
|
+
result.setValue(it["message"] as Any?, forKey: "message")
|
|
153
|
+
return result
|
|
154
|
+
}
|
|
155
|
+
func encode() -> [String: Any?] {
|
|
156
|
+
return [
|
|
157
|
+
"code": self.code,
|
|
158
|
+
"message": self.message,
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public extension EnrollmentResponse {
|
|
164
|
+
static func decode(_ it: Any?) -> EnrollmentResponse? {
|
|
165
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
166
|
+
let result = EnrollmentResponse.emptyInit() as EnrollmentResponse
|
|
167
|
+
result.setValue(ErrorResponse.decode(it["error"]), forKey: "error")
|
|
168
|
+
result.setValue(it["personId"] as Any?, forKey: "personId")
|
|
169
|
+
result.setValue(it["externalId"] as Any?, forKey: "externalId")
|
|
170
|
+
return result
|
|
171
|
+
}
|
|
172
|
+
func encode() -> [String: Any?] {
|
|
173
|
+
return [
|
|
174
|
+
"error": self.error?.encode(),
|
|
175
|
+
"personId": self.personId,
|
|
176
|
+
"externalId": self.externalId,
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public extension VerificationMatchResponse {
|
|
182
|
+
static func decode(_ it: Any?) -> VerificationMatchResponse? {
|
|
183
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
184
|
+
let result = VerificationMatchResponse.emptyInit() as VerificationMatchResponse
|
|
185
|
+
result.setValue(it["passed"] as Any?, forKey: "passed")
|
|
186
|
+
result.setValue(it["similarity"] as Any?, forKey: "similarity")
|
|
187
|
+
return result
|
|
188
|
+
}
|
|
189
|
+
func encode() -> [String: Any?] {
|
|
190
|
+
return [
|
|
191
|
+
"passed": self.passed,
|
|
192
|
+
"similarity": self.similarity,
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public extension VerificationResponse {
|
|
198
|
+
static func decode(_ it: Any?) -> VerificationResponse? {
|
|
199
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
200
|
+
let result = VerificationResponse.emptyInit() as VerificationResponse
|
|
201
|
+
result.setValue(VerificationMatchResponse.decode(it["match"]), forKey: "match")
|
|
202
|
+
result.setValue(ErrorResponse.decode(it["error"]), forKey: "error")
|
|
203
|
+
result.setValue(it["passed"] as Any?, forKey: "passed")
|
|
204
|
+
return result
|
|
205
|
+
}
|
|
206
|
+
func encode() -> [String: Any?] {
|
|
207
|
+
return [
|
|
208
|
+
"match": self.match?.encode(),
|
|
209
|
+
"error": self.error?.encode(),
|
|
210
|
+
"passed": self.passed,
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
147
215
|
// MARK: - MatchFacesRequest
|
|
148
216
|
|
|
149
217
|
public extension MatchFacesImage {
|
package/ios/Main.swift
CHANGED
|
@@ -44,8 +44,7 @@ func methodCall(_ method: String, _ callback: @escaping Callback) {
|
|
|
44
44
|
from: rootViewController()!,
|
|
45
45
|
animated: true,
|
|
46
46
|
configuration: config,
|
|
47
|
-
onCapture: { callback($0.encode()) }
|
|
48
|
-
completion: nil)
|
|
47
|
+
onCapture: { callback($0.encode()) })
|
|
49
48
|
}
|
|
50
49
|
case("stopFaceCapture"): face.stopFaceCaptureViewController()
|
|
51
50
|
case("startLiveness"): let config = LivenessConfiguration.decode(argsNullable(0))
|
|
@@ -54,8 +53,29 @@ func methodCall(_ method: String, _ callback: @escaping Callback) {
|
|
|
54
53
|
from: rootViewController()!,
|
|
55
54
|
animated: true,
|
|
56
55
|
configuration: config,
|
|
57
|
-
onLiveness: { callback($0.encode()) }
|
|
58
|
-
|
|
56
|
+
onLiveness: { callback($0.encode()) })
|
|
57
|
+
}
|
|
58
|
+
case("startEnrollment"): let config = EnrollmentConfiguration.decode(argsNullable(0))
|
|
59
|
+
DispatchQueue.main.async {
|
|
60
|
+
face.startEnrollment(
|
|
61
|
+
from: rootViewController()!,
|
|
62
|
+
animated: true,
|
|
63
|
+
configuration: config,
|
|
64
|
+
onEnrollment: { callback([
|
|
65
|
+
"livenessResponse": $0.encode(),
|
|
66
|
+
"enrollmentResponse": $1?.encode()
|
|
67
|
+
]) })
|
|
68
|
+
}
|
|
69
|
+
case("startVerification"): let config = VerificationConfiguration.decode(argsNullable(0))
|
|
70
|
+
DispatchQueue.main.async {
|
|
71
|
+
face.startVerification(
|
|
72
|
+
from: rootViewController()!,
|
|
73
|
+
animated: true,
|
|
74
|
+
configuration: config,
|
|
75
|
+
onVerification: { callback([
|
|
76
|
+
"livenessResponse": $0.encode(),
|
|
77
|
+
"verificationResponse": $1?.encode()
|
|
78
|
+
]) })
|
|
59
79
|
}
|
|
60
80
|
case("stopLiveness"): face.stopLivenessProcessing()
|
|
61
81
|
case("matchFaces"): face.matchFaces(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/face-sdk",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.1107-rc",
|
|
4
4
|
"description": "This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/face-sdk" version="8.3.
|
|
2
|
+
<plugin id="@regulaforensics/face-sdk" version="8.3.1107-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>FaceSDK</name>
|
|
4
4
|
<description>Cordova plugin for Regula Face SDK</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<source url="https://github.com/CocoaPods/Specs.git" />
|
|
28
28
|
</config>
|
|
29
29
|
<pods>
|
|
30
|
-
<pod name="
|
|
30
|
+
<pod name="FaceSDKStage" spec="8.3.4494" />
|
|
31
31
|
</pods>
|
|
32
32
|
</podspec>
|
|
33
33
|
</platform>
|