@regulaforensics/face-sdk 7.1.432-nightly → 7.1.439-nightly

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 (164) hide show
  1. package/README.md +2 -3
  2. package/RNFaceSDK.podspec +2 -2
  3. package/android/build.gradle +1 -1
  4. package/android/cordova.gradle +1 -1
  5. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +2 -2
  6. package/examples/capacitor/index.html +2 -7
  7. package/examples/capacitor/index.tsx +53 -0
  8. package/examples/capacitor/package-lock.json +12 -162
  9. package/examples/capacitor/package.json +4 -4
  10. package/examples/capacitor/scripts/setup.sh +4 -2
  11. package/examples/capacitor/src/main.css +60 -6
  12. package/examples/capacitor/src/main.html +1 -1
  13. package/examples/capacitor/src/main.tsx +51 -87
  14. package/examples/ionic/README.md +1 -1
  15. package/examples/ionic/angular.json +3 -3
  16. package/examples/ionic/config.xml +4 -2
  17. package/examples/ionic/index.tsx +68 -0
  18. package/examples/ionic/package-lock.json +42 -68
  19. package/examples/ionic/package.json +2 -2
  20. package/examples/ionic/src/main.css +60 -6
  21. package/examples/ionic/src/main.html +1 -1
  22. package/examples/ionic/src/{main.ts → main.tsx} +52 -97
  23. package/examples/ionic/tsconfig.json +3 -2
  24. package/examples/react_native/README.md +1 -0
  25. package/examples/react_native/app.config.ts +1 -1
  26. package/examples/react_native/index.tsx +49 -7
  27. package/examples/react_native/package-lock.json +594 -597
  28. package/examples/react_native/package.json +9 -9
  29. package/examples/react_native/src/main.css +60 -6
  30. package/examples/react_native/src/main.html +1 -1
  31. package/examples/react_native/src/main.tsx +54 -77
  32. package/package.json +1 -1
  33. package/plugin.xml +2 -2
  34. package/test/json.tsx +375 -0
  35. package/test/package-lock.json +584 -0
  36. package/test/package.json +9 -0
  37. package/test/test.tsx +61 -0
  38. package/test/utils.tsx +38 -0
  39. package/www/capacitor/customization/customization_fonts.js +1 -1
  40. package/www/capacitor/customization/customization_images.js +1 -1
  41. package/www/capacitor/customization/font.js +8 -0
  42. package/www/capacitor/detect_faces/detect_face_result.js +12 -0
  43. package/www/capacitor/detect_faces/detect_faces_attribute_result.js +9 -0
  44. package/www/capacitor/detect_faces/detect_faces_backend_exception.js +7 -0
  45. package/www/capacitor/detect_faces/detect_faces_config.js +34 -0
  46. package/www/capacitor/detect_faces/detect_faces_exception.js +8 -0
  47. package/www/capacitor/detect_faces/detect_faces_request.js +22 -0
  48. package/www/capacitor/detect_faces/detect_faces_response.js +9 -0
  49. package/www/capacitor/face_capture/face_capture_config.js +37 -0
  50. package/www/capacitor/face_capture/face_capture_exception.js +7 -0
  51. package/www/capacitor/face_capture/face_capture_image.js +8 -0
  52. package/www/capacitor/face_capture/face_capture_response.js +7 -0
  53. package/www/capacitor/image_params/output_image_crop.js +23 -0
  54. package/www/capacitor/image_params/output_image_params.js +19 -0
  55. package/www/capacitor/image_params/point.js +7 -0
  56. package/www/capacitor/image_params/rect.js +9 -0
  57. package/www/capacitor/image_params/size.js +12 -0
  58. package/www/capacitor/image_quality/image_quality_characteristic.js +22 -0
  59. package/www/capacitor/image_quality/image_quality_range.js +7 -0
  60. package/www/capacitor/image_quality/image_quality_result.js +10 -0
  61. package/www/capacitor/init/face_sdk_version.js +8 -0
  62. package/www/capacitor/init/init_config.js +19 -0
  63. package/www/capacitor/init/init_exception.js +8 -0
  64. package/www/capacitor/init/license_exception.js +7 -0
  65. package/www/capacitor/internal/bridge.js +20 -1
  66. package/www/capacitor/liveness/liveness_backend_exception.js +7 -0
  67. package/www/capacitor/liveness/liveness_config.js +43 -0
  68. package/www/capacitor/liveness/liveness_exception.js +8 -0
  69. package/www/capacitor/liveness/liveness_notification.js +7 -0
  70. package/www/capacitor/liveness/liveness_response.js +11 -0
  71. package/www/capacitor/match_faces/compared_face.js +9 -0
  72. package/www/capacitor/match_faces/compared_faces_pair.js +10 -0
  73. package/www/capacitor/match_faces/compared_faces_split.js +7 -0
  74. package/www/capacitor/match_faces/match_faces_backend_exception.js +7 -0
  75. package/www/capacitor/match_faces/match_faces_config.js +19 -0
  76. package/www/capacitor/match_faces/match_faces_detection.js +9 -0
  77. package/www/capacitor/match_faces/match_faces_detection_face.js +11 -0
  78. package/www/capacitor/match_faces/match_faces_exception.js +8 -0
  79. package/www/capacitor/match_faces/match_faces_image.js +9 -0
  80. package/www/capacitor/match_faces/match_faces_request.js +27 -0
  81. package/www/capacitor/match_faces/match_faces_response.js +9 -0
  82. package/www/capacitor/person_database/edit_group_persons_request.js +15 -0
  83. package/www/capacitor/person_database/image_upload.js +17 -0
  84. package/www/capacitor/person_database/pageable_item_list.js +8 -0
  85. package/www/capacitor/person_database/person.js +13 -0
  86. package/www/capacitor/person_database/person_group.js +11 -0
  87. package/www/capacitor/person_database/person_image.js +13 -0
  88. package/www/capacitor/person_database/search_person.js +14 -0
  89. package/www/capacitor/person_database/search_person_detection.js +9 -0
  90. package/www/capacitor/person_database/search_person_image.js +15 -0
  91. package/www/capacitor/person_database/search_person_request.js +27 -0
  92. package/www/cordova.js +703 -6
  93. package/www/react-native/customization/customization_fonts.js +1 -1
  94. package/www/react-native/customization/customization_images.js +1 -1
  95. package/www/react-native/customization/font.js +8 -0
  96. package/www/react-native/detect_faces/detect_face_result.js +12 -0
  97. package/www/react-native/detect_faces/detect_faces_attribute_result.js +9 -0
  98. package/www/react-native/detect_faces/detect_faces_backend_exception.js +7 -0
  99. package/www/react-native/detect_faces/detect_faces_config.js +34 -0
  100. package/www/react-native/detect_faces/detect_faces_exception.js +8 -0
  101. package/www/react-native/detect_faces/detect_faces_request.js +22 -0
  102. package/www/react-native/detect_faces/detect_faces_response.js +9 -0
  103. package/www/react-native/face_capture/face_capture_config.js +37 -0
  104. package/www/react-native/face_capture/face_capture_exception.js +7 -0
  105. package/www/react-native/face_capture/face_capture_image.js +8 -0
  106. package/www/react-native/face_capture/face_capture_response.js +7 -0
  107. package/www/react-native/image_params/output_image_crop.js +23 -0
  108. package/www/react-native/image_params/output_image_params.js +19 -0
  109. package/www/react-native/image_params/point.js +7 -0
  110. package/www/react-native/image_params/rect.js +9 -0
  111. package/www/react-native/image_params/size.js +12 -0
  112. package/www/react-native/image_quality/image_quality_characteristic.js +22 -0
  113. package/www/react-native/image_quality/image_quality_range.js +7 -0
  114. package/www/react-native/image_quality/image_quality_result.js +10 -0
  115. package/www/react-native/init/face_sdk_version.js +8 -0
  116. package/www/react-native/init/init_config.js +19 -0
  117. package/www/react-native/init/init_exception.js +8 -0
  118. package/www/react-native/init/license_exception.js +7 -0
  119. package/www/react-native/internal/bridge.js +20 -1
  120. package/www/react-native/liveness/liveness_backend_exception.js +7 -0
  121. package/www/react-native/liveness/liveness_config.js +43 -0
  122. package/www/react-native/liveness/liveness_exception.js +8 -0
  123. package/www/react-native/liveness/liveness_notification.js +7 -0
  124. package/www/react-native/liveness/liveness_response.js +11 -0
  125. package/www/react-native/match_faces/compared_face.js +9 -0
  126. package/www/react-native/match_faces/compared_faces_pair.js +10 -0
  127. package/www/react-native/match_faces/compared_faces_split.js +7 -0
  128. package/www/react-native/match_faces/match_faces_backend_exception.js +7 -0
  129. package/www/react-native/match_faces/match_faces_config.js +19 -0
  130. package/www/react-native/match_faces/match_faces_detection.js +9 -0
  131. package/www/react-native/match_faces/match_faces_detection_face.js +11 -0
  132. package/www/react-native/match_faces/match_faces_exception.js +8 -0
  133. package/www/react-native/match_faces/match_faces_image.js +9 -0
  134. package/www/react-native/match_faces/match_faces_request.js +27 -0
  135. package/www/react-native/match_faces/match_faces_response.js +9 -0
  136. package/www/react-native/person_database/edit_group_persons_request.js +15 -0
  137. package/www/react-native/person_database/image_upload.js +17 -0
  138. package/www/react-native/person_database/pageable_item_list.js +8 -0
  139. package/www/react-native/person_database/person.js +13 -0
  140. package/www/react-native/person_database/person_group.js +11 -0
  141. package/www/react-native/person_database/person_image.js +13 -0
  142. package/www/react-native/person_database/search_person.js +14 -0
  143. package/www/react-native/person_database/search_person_detection.js +9 -0
  144. package/www/react-native/person_database/search_person_image.js +15 -0
  145. package/www/react-native/person_database/search_person_request.js +27 -0
  146. package/www/types/match_faces/match_faces_config.d.ts +2 -0
  147. package/examples/cordova/.vscode/launch.json +0 -28
  148. package/examples/cordova/README.md +0 -25
  149. package/examples/cordova/config.xml +0 -26
  150. package/examples/cordova/package-lock.json +0 -1327
  151. package/examples/cordova/package.json +0 -30
  152. package/examples/cordova/scripts/android.sh +0 -8
  153. package/examples/cordova/scripts/ios.sh +0 -8
  154. package/examples/cordova/scripts/setup.sh +0 -8
  155. package/examples/cordova/www/images/logo.png +0 -0
  156. package/examples/cordova/www/index.html +0 -21
  157. package/examples/cordova/www/src/main.css +0 -83
  158. package/examples/cordova/www/src/main.html +0 -25
  159. package/examples/cordova/www/src/main.js +0 -152
  160. package/examples/ionic/index.ts +0 -17
  161. package/examples/ionic/src/images/portrait.png +0 -0
  162. /package/examples/ionic/{src/assets → assets}/.gitkeep +0 -0
  163. /package/examples/ionic/{src/images → images}/icon.png +0 -0
  164. /package/examples/{cordova/www → ionic}/images/portrait.png +0 -0
@@ -22,6 +22,17 @@ export class LivenessResponse {
22
22
 
23
23
  return result
24
24
  }
25
+
26
+ toJson() {
27
+ return {
28
+ "image": this.image,
29
+ "liveness": this.liveness,
30
+ "tag": this.tag,
31
+ "transactionId": this.transactionId,
32
+ "estimatedAge": this.estimatedAge,
33
+ "error": this.error?.toJson(),
34
+ }
35
+ }
25
36
  }
26
37
 
27
38
  export const LivenessStatus = {
@@ -18,4 +18,13 @@ export class ComparedFace {
18
18
 
19
19
  return result
20
20
  }
21
+
22
+ toJson() {
23
+ return {
24
+ "imageIndex": this.imageIndex,
25
+ "image": this.image?.toJson(),
26
+ "faceIndex": this.faceIndex,
27
+ "face": this.face?.toJson(),
28
+ }
29
+ }
21
30
  }
@@ -20,4 +20,14 @@ export class ComparedFacesPair {
20
20
 
21
21
  return result
22
22
  }
23
+
24
+ toJson() {
25
+ return {
26
+ "first": this.first?.toJson(),
27
+ "second": this.second?.toJson(),
28
+ "similarity": this.similarity,
29
+ "score": this.score,
30
+ "error": this.error?.toJson(),
31
+ }
32
+ }
23
33
  }
@@ -19,4 +19,11 @@ export class ComparedFacesSplit {
19
19
 
20
20
  return result
21
21
  }
22
+
23
+ toJson() {
24
+ return {
25
+ "matchedFaces": this.matchedFaces?.map(e => e.toJson()),
26
+ "unmatchedFaces": this.unmatchedFaces?.map(e => e.toJson()),
27
+ }
28
+ }
22
29
  }
@@ -11,4 +11,11 @@ export class MatchFacesBackendException {
11
11
 
12
12
  return result
13
13
  }
14
+
15
+ toJson() {
16
+ return {
17
+ "code": this.code,
18
+ "message": this.message,
19
+ }
20
+ }
14
21
  }
@@ -1,8 +1,27 @@
1
1
  export class MatchFacesConfig {
2
2
  processingMode
3
+ locationTrackingEnabled
3
4
 
4
5
  constructor(params) {
5
6
  this.processingMode = params?.processingMode ?? ProcessingMode.ONLINE
7
+ this.locationTrackingEnabled = params?.locationTrackingEnabled ?? true
8
+ }
9
+
10
+ static fromJson(jsonObject) {
11
+ if (jsonObject == null) return null
12
+ const result = new MatchFacesConfig()
13
+
14
+ result.processingMode = jsonObject["processingMode"]
15
+ result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"]
16
+
17
+ return result
18
+ }
19
+
20
+ toJson() {
21
+ return {
22
+ "processingMode": this.processingMode,
23
+ "locationTrackingEnabled": this.locationTrackingEnabled,
24
+ }
6
25
  }
7
26
  }
8
27
 
@@ -22,4 +22,13 @@ export class MatchFacesDetection {
22
22
 
23
23
  return result
24
24
  }
25
+
26
+ toJson() {
27
+ return {
28
+ "imageIndex": this.imageIndex,
29
+ "image": this.image?.toJson(),
30
+ "faces": this.faces?.map(e => e.toJson()),
31
+ "error": this.error?.toJson(),
32
+ }
33
+ }
25
34
  }
@@ -25,4 +25,15 @@ export class MatchFacesDetectionFace {
25
25
 
26
26
  return result
27
27
  }
28
+
29
+ toJson() {
30
+ return {
31
+ "faceIndex": this.faceIndex,
32
+ "landmarks": this.landmarks?.map(e => e.toJson()),
33
+ "faceRect": this.faceRect?.toJson(),
34
+ "rotationAngle": this.rotationAngle,
35
+ "originalRect": this.originalRect?.toJson(),
36
+ "crop": this.crop,
37
+ }
38
+ }
28
39
  }
@@ -15,6 +15,14 @@ export class MatchFacesException {
15
15
 
16
16
  return result
17
17
  }
18
+
19
+ toJson() {
20
+ return {
21
+ "code": this.code,
22
+ "message": this.message,
23
+ "underlyingError": this.underlyingError?.toJson(),
24
+ }
25
+ }
18
26
  }
19
27
 
20
28
  export const MatchFacesErrorCode = {
@@ -22,4 +22,13 @@ export class MatchFacesImage {
22
22
 
23
23
  return result
24
24
  }
25
+
26
+ toJson() {
27
+ return {
28
+ "image": this.image,
29
+ "imageType": this.imageType,
30
+ "detectAll": this.detectAll,
31
+ "identifier": this.identifier,
32
+ }
33
+ }
25
34
  }
@@ -1,3 +1,6 @@
1
+ import { OutputImageParams } from '../image_params/output_image_params'
2
+ import { MatchFacesImage } from './match_faces_image'
3
+
1
4
  export class MatchFacesRequest {
2
5
  images
3
6
  outputImageParams
@@ -10,4 +13,28 @@ export class MatchFacesRequest {
10
13
  this.tag = params?.tag
11
14
  this.metadata = params?.metadata
12
15
  }
16
+
17
+ static fromJson(jsonObject) {
18
+ if (jsonObject == null) return null
19
+
20
+ const images = []
21
+ for (const item of jsonObject["images"]) {
22
+ images.push(MatchFacesImage.fromJson(item))
23
+ }
24
+
25
+ return new MatchFacesRequest(images, {
26
+ outputImageParams: OutputImageParams.fromJson(jsonObject["outputImageParams"]),
27
+ tag: jsonObject["tag"],
28
+ metadata: jsonObject["metadata"],
29
+ })
30
+ }
31
+
32
+ toJson() {
33
+ return {
34
+ "images": this.images?.map(e => e.toJson()),
35
+ "outputImageParams": this.outputImageParams?.toJson(),
36
+ "tag": this.tag,
37
+ "metadata": this.metadata,
38
+ }
39
+ }
13
40
  }
@@ -25,4 +25,13 @@ export class MatchFacesResponse {
25
25
 
26
26
  return result
27
27
  }
28
+
29
+ toJson() {
30
+ return {
31
+ "results": this.results?.map(e => e.toJson()),
32
+ "detections": this.detections?.map(e => e.toJson()),
33
+ "tag": this.tag,
34
+ "error": this.error?.toJson(),
35
+ }
36
+ }
28
37
  }
@@ -6,4 +6,19 @@ export class EditGroupPersonsRequest {
6
6
  this.personIdsToAdd = params?.personIdsToAdd
7
7
  this.personIdsToRemove = params?.personIdsToRemove
8
8
  }
9
+
10
+ static fromJson(jsonObject) {
11
+ if (jsonObject == null) return null
12
+ return new EditGroupPersonsRequest({
13
+ personIdsToAdd: jsonObject["personIdsToAdd"],
14
+ personIdsToRemove: jsonObject["personIdsToRemove"],
15
+ })
16
+ }
17
+
18
+ toJson() {
19
+ return {
20
+ "personIdsToAdd": this.personIdsToAdd,
21
+ "personIdsToRemove": this.personIdsToRemove,
22
+ }
23
+ }
9
24
  }
@@ -13,4 +13,21 @@ export class ImageUpload {
13
13
  result.imageUrl = imageUrl
14
14
  return result
15
15
  }
16
+
17
+ static fromJson(jsonObject) {
18
+ if (jsonObject == null) return null
19
+ var result = new ImageUpload()
20
+
21
+ result.imageData = jsonObject["imageData"]
22
+ result.imageUrl = jsonObject["imageUrl"]
23
+
24
+ return result
25
+ }
26
+
27
+ toJson() {
28
+ return {
29
+ "imageData": this.imageData,
30
+ "imageUrl": this.imageUrl,
31
+ }
32
+ }
16
33
  }
@@ -19,4 +19,12 @@ export class PageableItemList {
19
19
 
20
20
  return result
21
21
  }
22
+
23
+ toJson() {
24
+ return {
25
+ "items": this.items?.map(e => e.toJson()),
26
+ "page": this.page,
27
+ "totalPages": this.totalPages,
28
+ }
29
+ }
22
30
  }
@@ -1,3 +1,5 @@
1
+ import { dateToString } from '../internal/bridge'
2
+
1
3
  export class Person {
2
4
  name
3
5
  updatedAt
@@ -19,4 +21,15 @@ export class Person {
19
21
 
20
22
  return result
21
23
  }
24
+
25
+ toJson() {
26
+ return {
27
+ "name": this.name,
28
+ "updatedAt": dateToString(this.updatedAt),
29
+ "groups": this.groups,
30
+ "id": this.id,
31
+ "metadata": this.metadata,
32
+ "createdAt": dateToString(this.createdAt),
33
+ }
34
+ }
22
35
  }
@@ -1,3 +1,5 @@
1
+ import { dateToString } from '../internal/bridge'
2
+
1
3
  export class PersonGroup {
2
4
  name
3
5
  id
@@ -15,4 +17,13 @@ export class PersonGroup {
15
17
 
16
18
  return result
17
19
  }
20
+
21
+ toJson() {
22
+ return {
23
+ "name": this.name,
24
+ "id": this.id,
25
+ "metadata": this.metadata,
26
+ "createdAt": dateToString(this.createdAt),
27
+ }
28
+ }
18
29
  }
@@ -1,3 +1,5 @@
1
+ import { dateToString } from '../internal/bridge'
2
+
1
3
  export class PersonImage {
2
4
  path
3
5
  url
@@ -19,4 +21,15 @@ export class PersonImage {
19
21
 
20
22
  return result
21
23
  }
24
+
25
+ toJson() {
26
+ return {
27
+ "path": this.path,
28
+ "url": this.url,
29
+ "contentType": this.contentType,
30
+ "id": this.id,
31
+ "metadata": this.metadata,
32
+ "createdAt": dateToString(this.createdAt),
33
+ }
34
+ }
22
35
  }
@@ -1,3 +1,4 @@
1
+ import { dateToString } from '../internal/bridge'
1
2
  import { SearchPersonImage } from './search_person_image'
2
3
  import { SearchPersonDetection } from './search_person_detection'
3
4
 
@@ -28,4 +29,17 @@ export class SearchPerson {
28
29
 
29
30
  return result
30
31
  }
32
+
33
+ toJson() {
34
+ return {
35
+ "images": this.images?.map(e => e.toJson()),
36
+ "detection": this.detection?.toJson(),
37
+ "name": this.name,
38
+ "updatedAt": dateToString(this.updatedAt),
39
+ "groups": this.groups,
40
+ "id": this.id,
41
+ "metadata": this.metadata,
42
+ "createdAt": dateToString(this.createdAt),
43
+ }
44
+ }
31
45
  }
@@ -19,4 +19,13 @@ export class SearchPersonDetection {
19
19
 
20
20
  return result
21
21
  }
22
+
23
+ toJson() {
24
+ return {
25
+ "landmarks": this.landmarks?.map(e => e.toJson()),
26
+ "rect": this.rect?.toJson(),
27
+ "crop": this.crop,
28
+ "rotationAngle": this.rotationAngle,
29
+ }
30
+ }
22
31
  }
@@ -1,3 +1,5 @@
1
+ import { dateToString } from '../internal/bridge'
2
+
1
3
  export class SearchPersonImage {
2
4
  similarity
3
5
  distance
@@ -23,4 +25,17 @@ export class SearchPersonImage {
23
25
 
24
26
  return result
25
27
  }
28
+
29
+ toJson() {
30
+ return {
31
+ "similarity": this.similarity,
32
+ "distance": this.distance,
33
+ "path": this.path,
34
+ "url": this.url,
35
+ "contentType": this.contentType,
36
+ "id": this.id,
37
+ "metadata": this.metadata,
38
+ "createdAt": dateToString(this.createdAt),
39
+ }
40
+ }
26
41
  }
@@ -1,3 +1,6 @@
1
+ import { OutputImageParams } from '../image_params/output_image_params'
2
+ import { ImageUpload } from './image_upload'
3
+
1
4
  export class SearchPersonRequest {
2
5
  imageUpload
3
6
  groupIdsForSearch
@@ -16,4 +19,28 @@ export class SearchPersonRequest {
16
19
  this.detectAll = params?.detectAll ?? false
17
20
  this.outputImageParams = params?.outputImageParams
18
21
  }
22
+
23
+ static fromJson(jsonObject) {
24
+ if (jsonObject == null) return null
25
+ return new SearchPersonRequest(ImageUpload.fromJson(jsonObject["imageUpload"]), {
26
+ groupIdsForSearch: jsonObject["groupIdsForSearch"],
27
+ threshold: jsonObject["threshold"],
28
+ limit: jsonObject["limit"],
29
+ tag: jsonObject["tag"],
30
+ detectAll: jsonObject["detectAll"],
31
+ outputImageParams: OutputImageParams.fromJson(jsonObject["outputImageParams"]),
32
+ })
33
+ }
34
+
35
+ toJson() {
36
+ return {
37
+ "imageUpload": this.imageUpload?.toJson(),
38
+ "groupIdsForSearch": this.groupIdsForSearch,
39
+ "threshold": this.threshold,
40
+ "limit": this.limit,
41
+ "tag": this.tag,
42
+ "detectAll": this.detectAll,
43
+ "outputImageParams": this.outputImageParams?.toJson(),
44
+ }
45
+ }
19
46
  }