@regulaforensics/face-sdk 6.5.67-beta → 6.5.84-beta

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 (184) hide show
  1. package/RNFaceSDK.podspec +2 -2
  2. package/android/build.gradle +2 -2
  3. package/android/cordova.gradle +2 -2
  4. package/examples/capacitor/README.md +4 -4
  5. package/examples/capacitor/package.json +5 -5
  6. package/examples/capacitor/scripts/android.sh +9 -0
  7. package/examples/capacitor/scripts/ios.sh +8 -0
  8. package/examples/capacitor/scripts/setup.sh +4 -0
  9. package/examples/cordova/README.md +4 -4
  10. package/examples/cordova/package.json +6 -11
  11. package/examples/cordova/scripts/android.sh +8 -0
  12. package/examples/cordova/scripts/ios.sh +8 -0
  13. package/examples/cordova/scripts/setup.sh +5 -0
  14. package/examples/ionic/README.md +4 -4
  15. package/examples/ionic/package.json +5 -5
  16. package/examples/ionic/scripts/android.sh +8 -0
  17. package/examples/ionic/scripts/ios.sh +8 -0
  18. package/examples/ionic/scripts/setup.sh +5 -0
  19. package/examples/ionic/src/app/home/home.page.ts +56 -5
  20. package/examples/react-native/README.md +4 -4
  21. package/examples/react-native/ios/Podfile.lock +319 -303
  22. package/examples/react-native/package.json +5 -6
  23. package/examples/react-native/scripts/android.sh +8 -0
  24. package/examples/react-native/scripts/ios.sh +8 -0
  25. package/examples/react-native/scripts/setup.sh +8 -0
  26. package/package.json +2 -1
  27. package/plugin.xml +2 -2
  28. package/www/capacitor/customization/customization.js +66 -0
  29. package/www/capacitor/customization/customization_colors.js +233 -0
  30. package/www/capacitor/customization/customization_fonts.js +106 -0
  31. package/www/capacitor/customization/customization_images.js +129 -0
  32. package/www/capacitor/customization/font.js +29 -0
  33. package/www/capacitor/detect_faces/detect_face_result.js +38 -0
  34. package/www/capacitor/detect_faces/detect_faces_attribute.js +15 -0
  35. package/www/capacitor/detect_faces/detect_faces_attribute_result.js +20 -0
  36. package/www/capacitor/detect_faces/detect_faces_backend_exception.js +23 -0
  37. package/www/capacitor/detect_faces/detect_faces_config.js +14 -0
  38. package/www/capacitor/detect_faces/detect_faces_exception.js +30 -0
  39. package/www/capacitor/detect_faces/detect_faces_request.js +67 -0
  40. package/www/capacitor/detect_faces/detect_faces_response.js +24 -0
  41. package/www/capacitor/detect_faces/detect_faces_scenario.js +10 -0
  42. package/www/capacitor/face_capture/face_capture_config.js +28 -0
  43. package/www/capacitor/face_capture/face_capture_exception.js +25 -0
  44. package/www/capacitor/face_capture/face_capture_image.js +26 -0
  45. package/www/capacitor/face_capture/face_capture_response.js +17 -0
  46. package/www/capacitor/image_params/output_image_crop.js +21 -0
  47. package/www/capacitor/image_params/output_image_params.js +9 -0
  48. package/www/capacitor/image_params/point.js +14 -0
  49. package/www/capacitor/image_params/rect.js +18 -0
  50. package/www/capacitor/image_params/size.js +9 -0
  51. package/www/capacitor/image_quality/image_quality_characteristic.js +24 -0
  52. package/www/capacitor/image_quality/image_quality_characteristic_name.js +58 -0
  53. package/www/capacitor/image_quality/image_quality_group.js +332 -0
  54. package/www/capacitor/image_quality/image_quality_range.js +26 -0
  55. package/www/capacitor/image_quality/image_quality_result.js +40 -0
  56. package/www/capacitor/index.js +179 -4
  57. package/www/capacitor/init/face_sdk_version.js +16 -0
  58. package/www/capacitor/match_faces/compared_face.js +21 -0
  59. package/www/capacitor/match_faces/compared_faces_pair.js +23 -0
  60. package/www/capacitor/match_faces/compared_faces_split.js +22 -0
  61. package/www/capacitor/match_faces/match_faces_backend_exception.js +14 -0
  62. package/www/capacitor/match_faces/match_faces_config.js +12 -0
  63. package/www/capacitor/match_faces/match_faces_detection.js +25 -0
  64. package/www/capacitor/match_faces/match_faces_detection_face.js +28 -0
  65. package/www/capacitor/match_faces/match_faces_exception.js +30 -0
  66. package/www/capacitor/match_faces/match_faces_image.js +25 -0
  67. package/www/capacitor/match_faces/match_faces_request.js +13 -0
  68. package/www/capacitor/match_faces/match_faces_response.js +28 -0
  69. package/www/capacitor/person_database/edit_group_persons_request.js +9 -0
  70. package/www/capacitor/person_database/image_upload.js +16 -0
  71. package/www/capacitor/person_database/pageable_item_list.js +22 -0
  72. package/www/capacitor/person_database/person.js +22 -0
  73. package/www/capacitor/person_database/person_database.js +145 -0
  74. package/www/capacitor/person_database/person_group.js +18 -0
  75. package/www/capacitor/person_database/person_image.js +22 -0
  76. package/www/capacitor/person_database/search_person.js +31 -0
  77. package/www/capacitor/person_database/search_person_detection.js +22 -0
  78. package/www/capacitor/person_database/search_person_image.js +26 -0
  79. package/www/capacitor/person_database/search_person_request.js +17 -0
  80. package/www/cordova.js +3478 -385
  81. package/www/react-native/customization/customization.js +66 -0
  82. package/www/react-native/customization/customization_colors.js +233 -0
  83. package/www/react-native/customization/customization_fonts.js +106 -0
  84. package/www/react-native/customization/customization_images.js +129 -0
  85. package/www/react-native/customization/font.js +29 -0
  86. package/www/react-native/detect_faces/detect_face_result.js +38 -0
  87. package/www/react-native/detect_faces/detect_faces_attribute.js +15 -0
  88. package/www/react-native/detect_faces/detect_faces_attribute_result.js +20 -0
  89. package/www/react-native/detect_faces/detect_faces_backend_exception.js +23 -0
  90. package/www/react-native/detect_faces/detect_faces_config.js +14 -0
  91. package/www/react-native/detect_faces/detect_faces_exception.js +30 -0
  92. package/www/react-native/detect_faces/detect_faces_request.js +67 -0
  93. package/www/react-native/detect_faces/detect_faces_response.js +24 -0
  94. package/www/react-native/detect_faces/detect_faces_scenario.js +10 -0
  95. package/www/react-native/face_capture/face_capture_config.js +28 -0
  96. package/www/react-native/face_capture/face_capture_exception.js +25 -0
  97. package/www/react-native/face_capture/face_capture_image.js +26 -0
  98. package/www/react-native/face_capture/face_capture_response.js +17 -0
  99. package/www/react-native/image_params/output_image_crop.js +21 -0
  100. package/www/react-native/image_params/output_image_params.js +9 -0
  101. package/www/react-native/image_params/point.js +14 -0
  102. package/www/react-native/image_params/rect.js +18 -0
  103. package/www/react-native/image_params/size.js +9 -0
  104. package/www/react-native/image_quality/image_quality_characteristic.js +24 -0
  105. package/www/react-native/image_quality/image_quality_characteristic_name.js +58 -0
  106. package/www/react-native/image_quality/image_quality_group.js +332 -0
  107. package/www/react-native/image_quality/image_quality_range.js +26 -0
  108. package/www/react-native/image_quality/image_quality_result.js +40 -0
  109. package/www/react-native/index.js +179 -4
  110. package/www/react-native/init/face_sdk_version.js +16 -0
  111. package/www/react-native/match_faces/compared_face.js +21 -0
  112. package/www/react-native/match_faces/compared_faces_pair.js +23 -0
  113. package/www/react-native/match_faces/compared_faces_split.js +22 -0
  114. package/www/react-native/match_faces/match_faces_backend_exception.js +14 -0
  115. package/www/react-native/match_faces/match_faces_config.js +12 -0
  116. package/www/react-native/match_faces/match_faces_detection.js +25 -0
  117. package/www/react-native/match_faces/match_faces_detection_face.js +28 -0
  118. package/www/react-native/match_faces/match_faces_exception.js +30 -0
  119. package/www/react-native/match_faces/match_faces_image.js +25 -0
  120. package/www/react-native/match_faces/match_faces_request.js +13 -0
  121. package/www/react-native/match_faces/match_faces_response.js +28 -0
  122. package/www/react-native/person_database/edit_group_persons_request.js +9 -0
  123. package/www/react-native/person_database/image_upload.js +16 -0
  124. package/www/react-native/person_database/pageable_item_list.js +22 -0
  125. package/www/react-native/person_database/person.js +22 -0
  126. package/www/react-native/person_database/person_database.js +145 -0
  127. package/www/react-native/person_database/person_group.js +18 -0
  128. package/www/react-native/person_database/person_image.js +22 -0
  129. package/www/react-native/person_database/search_person.js +31 -0
  130. package/www/react-native/person_database/search_person_detection.js +22 -0
  131. package/www/react-native/person_database/search_person_image.js +26 -0
  132. package/www/react-native/person_database/search_person_request.js +17 -0
  133. package/www/types/customization/customization.d.ts +46 -0
  134. package/www/types/customization/customization_colors.d.ts +37 -0
  135. package/www/types/customization/customization_fonts.d.ts +23 -0
  136. package/www/types/customization/customization_images.d.ts +24 -0
  137. package/www/types/customization/font.d.ts +41 -0
  138. package/www/types/detect_faces/detect_face_result.d.ts +16 -0
  139. package/www/types/detect_faces/detect_faces_attribute.d.ts +15 -0
  140. package/www/types/detect_faces/detect_faces_attribute_result.d.ts +11 -0
  141. package/www/types/detect_faces/detect_faces_backend_exception.d.ts +15 -0
  142. package/www/types/detect_faces/detect_faces_config.d.ts +37 -0
  143. package/www/types/detect_faces/detect_faces_exception.d.ts +24 -0
  144. package/www/types/detect_faces/detect_faces_request.d.ts +80 -0
  145. package/www/types/detect_faces/detect_faces_response.d.ts +12 -0
  146. package/www/types/detect_faces/detect_faces_scenario.d.ts +10 -0
  147. package/www/types/face_capture/face_capture_config.d.ts +39 -0
  148. package/www/types/face_capture/face_capture_exception.d.ts +17 -0
  149. package/www/types/face_capture/face_capture_image.d.ts +39 -0
  150. package/www/types/face_capture/face_capture_response.d.ts +9 -0
  151. package/www/types/image_params/output_image_crop.d.ts +49 -0
  152. package/www/types/image_params/output_image_params.d.ts +28 -0
  153. package/www/types/image_params/point.d.ts +9 -0
  154. package/www/types/image_params/rect.d.ts +8 -0
  155. package/www/types/image_params/size.d.ts +6 -0
  156. package/www/types/image_quality/image_quality_characteristic.d.ts +7 -0
  157. package/www/types/image_quality/image_quality_characteristic_name.d.ts +61 -0
  158. package/www/types/image_quality/image_quality_group.d.ts +418 -0
  159. package/www/types/image_quality/image_quality_range.d.ts +8 -0
  160. package/www/types/image_quality/image_quality_result.d.ts +30 -0
  161. package/www/types/index.d.ts +140 -4
  162. package/www/types/init/face_sdk_version.d.ts +16 -0
  163. package/www/types/match_faces/compared_face.d.ts +29 -0
  164. package/www/types/match_faces/compared_faces_pair.d.ts +36 -0
  165. package/www/types/match_faces/compared_faces_split.d.ts +8 -0
  166. package/www/types/match_faces/match_faces_backend_exception.d.ts +6 -0
  167. package/www/types/match_faces/match_faces_config.d.ts +14 -0
  168. package/www/types/match_faces/match_faces_detection.d.ts +30 -0
  169. package/www/types/match_faces/match_faces_detection_face.d.ts +43 -0
  170. package/www/types/match_faces/match_faces_exception.d.ts +21 -0
  171. package/www/types/match_faces/match_faces_image.d.ts +34 -0
  172. package/www/types/match_faces/match_faces_request.d.ts +34 -0
  173. package/www/types/match_faces/match_faces_response.d.ts +27 -0
  174. package/www/types/person_database/edit_group_persons_request.d.ts +8 -0
  175. package/www/types/person_database/image_upload.d.ts +20 -0
  176. package/www/types/person_database/pageable_item_list.d.ts +7 -0
  177. package/www/types/person_database/person.d.ts +33 -0
  178. package/www/types/person_database/person_database.d.ts +95 -0
  179. package/www/types/person_database/person_group.d.ts +22 -0
  180. package/www/types/person_database/person_image.d.ts +10 -0
  181. package/www/types/person_database/search_person.d.ts +31 -0
  182. package/www/types/person_database/search_person_detection.d.ts +11 -0
  183. package/www/types/person_database/search_person_image.d.ts +25 -0
  184. package/www/types/person_database/search_person_request.d.ts +39 -0
@@ -0,0 +1,22 @@
1
+ import { ComparedFacesPair } from './compared_faces_pair'
2
+
3
+ export class ComparedFacesSplit {
4
+ matchedFaces
5
+ unmatchedFaces
6
+
7
+ static fromJson(jsonObject) {
8
+ if (jsonObject == null) return null
9
+ const result = new ComparedFacesSplit()
10
+
11
+ result.matchedFaces = []
12
+ if (jsonObject["matchedFaces"] != null)
13
+ for (const item of jsonObject["matchedFaces"])
14
+ result.matchedFaces.push(ComparedFacesPair.fromJson(item))
15
+ result.unmatchedFaces = []
16
+ if (jsonObject["unmatchedFaces"] != null)
17
+ for (const item of jsonObject["unmatchedFaces"])
18
+ result.unmatchedFaces.push(ComparedFacesPair.fromJson(item))
19
+
20
+ return result
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ export class MatchFacesBackendException {
2
+ code
3
+ message
4
+
5
+ static fromJson(jsonObject) {
6
+ if (jsonObject == null) return null
7
+ const result = new MatchFacesBackendException()
8
+
9
+ result.code = jsonObject["code"]
10
+ result.message = jsonObject["message"] ?? ""
11
+
12
+ return result
13
+ }
14
+ }
@@ -0,0 +1,12 @@
1
+ export class MatchFacesConfig {
2
+ processingMode
3
+
4
+ constructor(params) {
5
+ this.processingMode = params?.processingMode ?? ProcessingMode.ONLINE
6
+ }
7
+ }
8
+
9
+ export const ProcessingMode = {
10
+ ONLINE: 0,
11
+ OFFLINE: 1,
12
+ }
@@ -0,0 +1,25 @@
1
+ import { MatchFacesImage } from './match_faces_image'
2
+ import { MatchFacesDetectionFace } from './match_faces_detection_face'
3
+ import { MatchFacesException } from './match_faces_exception'
4
+
5
+ export class MatchFacesDetection {
6
+ imageIndex
7
+ image
8
+ faces
9
+ error
10
+
11
+ static fromJson(jsonObject) {
12
+ if (jsonObject == null) return null
13
+ const result = new MatchFacesDetection()
14
+
15
+ result.imageIndex = jsonObject["imageIndex"]
16
+ result.image = MatchFacesImage.fromJson(jsonObject["image"])
17
+ result.faces = []
18
+ if (jsonObject["faces"] != null)
19
+ for (const item of jsonObject["faces"])
20
+ result.faces.push(MatchFacesDetectionFace.fromJson(item))
21
+ result.error = MatchFacesException.fromJson(jsonObject["error"])
22
+
23
+ return result
24
+ }
25
+ }
@@ -0,0 +1,28 @@
1
+ import { Point } from '../image_params/point'
2
+ import { Rect } from '../image_params/rect'
3
+
4
+ export class MatchFacesDetectionFace {
5
+ faceIndex
6
+ landmarks
7
+ faceRect
8
+ rotationAngle
9
+ originalRect
10
+ crop
11
+
12
+ static fromJson(jsonObject) {
13
+ if (jsonObject == null) return null
14
+ const result = new MatchFacesDetectionFace()
15
+
16
+ result.faceIndex = jsonObject["faceIndex"]
17
+ result.landmarks = []
18
+ if (jsonObject["landmarks"] != null)
19
+ for (const item of jsonObject["landmarks"])
20
+ result.landmarks.push(Point.fromJson(item))
21
+ result.faceRect = Rect.fromJson(jsonObject["faceRect"])
22
+ result.rotationAngle = jsonObject["rotationAngle"]
23
+ result.originalRect = Rect.fromJson(jsonObject["originalRect"])
24
+ result.crop = jsonObject["crop"]
25
+
26
+ return result
27
+ }
28
+ }
@@ -0,0 +1,30 @@
1
+ import { MatchFacesBackendException } from './match_faces_backend_exception'
2
+
3
+ export class MatchFacesException {
4
+ code
5
+ message
6
+ underlyingError
7
+
8
+ static fromJson(jsonObject) {
9
+ if (jsonObject == null) return null
10
+ const result = new MatchFacesException()
11
+
12
+ result.code = jsonObject["code"]
13
+ result.message = jsonObject["message"] ?? ""
14
+ result.underlyingError = MatchFacesBackendException.fromJson(jsonObject["underlyingError"])
15
+
16
+ return result
17
+ }
18
+ }
19
+
20
+ export const MatchFacesErrorCode = {
21
+ IMAGE_EMPTY: 0,
22
+ FACE_NOT_DETECTED: 1,
23
+ LANDMARKS_NOT_DETECTED: 2,
24
+ FACE_ALIGNER_FAILED: 3,
25
+ DESCRIPTOR_EXTRACTOR_ERROR: 4,
26
+ IMAGES_COUNT_LIMIT_EXCEEDED: 5,
27
+ API_CALL_FAILED: 6,
28
+ PROCESSING_FAILED: 7,
29
+ NO_LICENSE: 8,
30
+ }
@@ -0,0 +1,25 @@
1
+ export class MatchFacesImage {
2
+ image
3
+ imageType
4
+ detectAll
5
+ identifier
6
+
7
+ constructor(image, imageType, params) {
8
+ this.image = image
9
+ this.imageType = imageType
10
+ this.detectAll = params?.detectAll ?? false
11
+ this.identifier = ""
12
+ }
13
+
14
+ static fromJson(jsonObject) {
15
+ if (jsonObject == null) return null
16
+ const result = new MatchFacesImage()
17
+
18
+ result.image = jsonObject["image"]
19
+ result.imageType = jsonObject["imageType"]
20
+ result.detectAll = jsonObject["detectAll"]
21
+ result.identifier = jsonObject["identifier"]
22
+
23
+ return result
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ export class MatchFacesRequest {
2
+ images
3
+ outputImageParams
4
+ tag
5
+ metadata
6
+
7
+ constructor(images, params) {
8
+ this.images = images
9
+ this.outputImageParams = params?.outputImageParams
10
+ this.tag = params?.tag
11
+ this.metadata = params?.metadata
12
+ }
13
+ }
@@ -0,0 +1,28 @@
1
+ import { ComparedFacesPair } from './compared_faces_pair'
2
+ import { MatchFacesDetection } from './match_faces_detection'
3
+ import { MatchFacesException } from './match_faces_exception'
4
+
5
+ export class MatchFacesResponse {
6
+ results
7
+ detections
8
+ tag
9
+ error
10
+
11
+ static fromJson(jsonObject) {
12
+ if (jsonObject == null) return null
13
+ const result = new MatchFacesResponse()
14
+
15
+ result.results = []
16
+ if (jsonObject["results"] != null)
17
+ for (const item of jsonObject["results"])
18
+ result.results.push(ComparedFacesPair.fromJson(item))
19
+ result.detections = []
20
+ if (jsonObject["detections"] != null)
21
+ for (const item of jsonObject["detections"])
22
+ result.detections.push(MatchFacesDetection.fromJson(item))
23
+ result.tag = jsonObject["tag"]
24
+ result.error = MatchFacesException.fromJson(jsonObject["error"])
25
+
26
+ return result
27
+ }
28
+ }
@@ -0,0 +1,9 @@
1
+ export class EditGroupPersonsRequest {
2
+ personIdsToAdd
3
+ personIdsToRemove
4
+
5
+ constructor(params) {
6
+ this.personIdsToAdd = params?.personIdsToAdd
7
+ this.personIdsToRemove = params?.personIdsToRemove
8
+ }
9
+ }
@@ -0,0 +1,16 @@
1
+ export class ImageUpload {
2
+ imageData
3
+ imageUrl
4
+
5
+ static withImageData(imageData) {
6
+ var result = new ImageUpload()
7
+ result.imageData = imageData
8
+ return result
9
+ }
10
+
11
+ static withImageUrl(imageUrl) {
12
+ var result = new ImageUpload()
13
+ result.imageUrl = imageUrl
14
+ return result
15
+ }
16
+ }
@@ -0,0 +1,22 @@
1
+ export class PageableItemList {
2
+ items
3
+ page
4
+ totalPages
5
+
6
+ static fromJson(jsonObject, fromJSON) {
7
+ if (jsonObject == null) return null
8
+ var result = new PageableItemList()
9
+
10
+ if (jsonObject["items"] != null) {
11
+ result.items = []
12
+ for (var item of jsonObject["items"]) {
13
+ var temp = fromJSON(item)
14
+ if (temp != null) result.items.push(temp)
15
+ }
16
+ }
17
+ result.page = jsonObject["page"]
18
+ result.totalPages = jsonObject["totalPages"]
19
+
20
+ return result
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ export class Person {
2
+ name
3
+ updatedAt
4
+ groups
5
+ id
6
+ metadata
7
+ createdAt
8
+
9
+ static fromJson(jsonObject) {
10
+ if (jsonObject == null) return null
11
+ var result = new Person()
12
+
13
+ result.name = jsonObject["name"]
14
+ result.updatedAt = new Date(jsonObject["updatedAt"])
15
+ result.groups = jsonObject["groups"]
16
+ result.id = jsonObject["id"]
17
+ result.metadata = jsonObject["metadata"]
18
+ result.createdAt = new Date(jsonObject["createdAt"])
19
+
20
+ return result
21
+ }
22
+ }
@@ -0,0 +1,145 @@
1
+ import { exec } from '../internal/bridge'
2
+ import { Person } from './person'
3
+ import { PersonImage } from './person_image'
4
+ import { PageableItemList } from './pageable_item_list'
5
+ import { PersonGroup } from './person_group'
6
+ import { SearchPerson } from './search_person'
7
+
8
+ export class PersonDatabase {
9
+ async createPerson(name, params) {
10
+ var response = await exec("createPerson", [name, params?.groupIds, params?.metadata])
11
+ return this._itemResponseFromJson(response, Person.fromJson)
12
+ }
13
+
14
+ async updatePerson(person) {
15
+ var response = await exec("updatePerson", [person])
16
+ return this._successResponseFromJson(response)
17
+ }
18
+
19
+ async deletePerson(personId) {
20
+ var response = await exec("deletePerson", [personId])
21
+ return this._successResponseFromJson(response)
22
+ }
23
+
24
+ async getPerson(personId) {
25
+ var response = await exec("getPerson", [personId])
26
+ return this._itemResponseFromJson(response, Person.fromJson)
27
+ }
28
+
29
+ async addPersonImage(personId, image) {
30
+ var response = await exec("addPersonImage", [personId, image])
31
+ return this._itemResponseFromJson(response, PersonImage.fromJson)
32
+ }
33
+
34
+ async deletePersonImage(personId, imageId) {
35
+ var response = await exec("deletePersonImage", [personId, imageId])
36
+ return this._successResponseFromJson(response)
37
+ }
38
+
39
+ async getPersonImage(personId, imageId) {
40
+ var response = await exec("getPersonImage", [personId, imageId])
41
+ return this._itemResponseFromJson(response, PersonImage.fromJson)
42
+ }
43
+
44
+ async getPersonImages(personId) {
45
+ var response = await exec("getPersonImages", [personId])
46
+ return this._listResponseFromJson(response, PersonImage.fromJson)
47
+ }
48
+
49
+ async getPersonImagesForPage(personId, page, size) {
50
+ var response = await exec("getPersonImagesForPage", [personId, page, size])
51
+ return this._listResponseFromJson(response, PersonImage.fromJson)
52
+ }
53
+
54
+ async createGroup(name, params) {
55
+ var response = await exec("createGroup", [name, params?.metadata])
56
+ return this._itemResponseFromJson(response, PersonGroup.fromJson)
57
+ }
58
+
59
+ async updateGroup(group) {
60
+ var response = await exec("updateGroup", [group])
61
+ return this._successResponseFromJson(response)
62
+ }
63
+
64
+ async editPersonsInGroup(groupId, request) {
65
+ var response = await exec("editPersonsInGroup", [groupId, request])
66
+ return this._successResponseFromJson(response)
67
+ }
68
+
69
+ async deleteGroup(groupId) {
70
+ var response = await exec("deleteGroup", [groupId])
71
+ return this._successResponseFromJson(response)
72
+ }
73
+
74
+ async getGroup(groupId) {
75
+ var response = await exec("getGroup", [groupId])
76
+ return this._itemResponseFromJson(response, PersonGroup.fromJson)
77
+ }
78
+
79
+ async getGroups() {
80
+ var response = await exec("getGroups", [])
81
+ return this._listResponseFromJson(response, PersonGroup.fromJson)
82
+ }
83
+
84
+ async getGroupsForPage(page, size) {
85
+ var response = await exec("getGroupsForPage", [page, size])
86
+ return this._listResponseFromJson(response, PersonGroup.fromJson)
87
+ }
88
+
89
+ async getPersonGroups(personId) {
90
+ var response = await exec("getPersonGroups", [personId])
91
+ return this._listResponseFromJson(response, PersonGroup.fromJson)
92
+ }
93
+
94
+ async getPersonGroupsForPage(personId, page, size) {
95
+ var response = await exec("getPersonGroupsForPage", [personId, page, size])
96
+ return this._listResponseFromJson(response, PersonGroup.fromJson)
97
+ }
98
+
99
+ async getPersonsInGroup(groupId) {
100
+ var response = await exec("getPersonsInGroup", [groupId])
101
+ return this._listResponseFromJson(response, Person.fromJson)
102
+ }
103
+
104
+ async getPersonsInGroupForPage(groupId, page, size) {
105
+ var response = await exec("getPersonsInGroupForPage", [groupId, page, size])
106
+ return this._listResponseFromJson(response, Person.fromJson)
107
+ }
108
+
109
+ async searchPerson(request) {
110
+ var response = await exec("searchPerson", [request])
111
+
112
+ var jsonObject = JSON.parse(response)
113
+ var data = null
114
+ if (jsonObject["data"] != null) {
115
+ data = []
116
+ for (var item of jsonObject["data"])
117
+ data.push(SearchPerson.fromJson(item))
118
+ }
119
+ var error = jsonObject["error"]
120
+
121
+ return [data, error]
122
+ }
123
+
124
+ _successResponseFromJson(jsonString) {
125
+ var jsonObject = JSON.parse(jsonString)
126
+ var data = jsonObject["data"]
127
+ var error = jsonObject["error"]
128
+ var success = data ?? false
129
+ return [success, error]
130
+ }
131
+
132
+ _itemResponseFromJson(jsonString, fromJSON) {
133
+ var jsonObject = JSON.parse(jsonString)
134
+ var data = fromJSON(jsonObject["data"])
135
+ var error = jsonObject["error"]
136
+ return [data, error]
137
+ }
138
+
139
+ _listResponseFromJson(jsonString, fromJSON) {
140
+ var jsonObject = JSON.parse(jsonString)
141
+ var data = PageableItemList.fromJson(jsonObject["data"], fromJSON)
142
+ var error = jsonObject["error"]
143
+ return [data, error]
144
+ }
145
+ }
@@ -0,0 +1,18 @@
1
+ export class PersonGroup {
2
+ name
3
+ id
4
+ metadata
5
+ createdAt
6
+
7
+ static fromJson(jsonObject) {
8
+ if (jsonObject == null) return null
9
+ var result = new PersonGroup()
10
+
11
+ result.name = jsonObject["name"]
12
+ result.id = jsonObject["id"]
13
+ result.metadata = jsonObject["metadata"]
14
+ result.createdAt = new Date(jsonObject["createdAt"])
15
+
16
+ return result
17
+ }
18
+ }
@@ -0,0 +1,22 @@
1
+ export class PersonImage {
2
+ path
3
+ url
4
+ contentType
5
+ id
6
+ metadata
7
+ createdAt
8
+
9
+ static fromJson(jsonObject) {
10
+ if (jsonObject == null) return null
11
+ var result = new PersonImage()
12
+
13
+ result.path = jsonObject["path"]
14
+ result.url = jsonObject["url"]
15
+ result.contentType = jsonObject["contentType"]
16
+ result.id = jsonObject["id"]
17
+ result.metadata = jsonObject["metadata"]
18
+ result.createdAt = new Date(jsonObject["createdAt"])
19
+
20
+ return result
21
+ }
22
+ }
@@ -0,0 +1,31 @@
1
+ import { SearchPersonImage } from './search_person_image'
2
+ import { SearchPersonDetection } from './search_person_detection'
3
+
4
+ export class SearchPerson {
5
+ images = []
6
+ detection
7
+ name
8
+ updatedAt
9
+ groups
10
+ id
11
+ metadata
12
+ createdAt
13
+
14
+ static fromJson(jsonObject) {
15
+ if (jsonObject == null) return null
16
+ var result = new SearchPerson()
17
+
18
+ if (jsonObject["images"] != null)
19
+ for (var item of jsonObject["images"])
20
+ result.images.push(SearchPersonImage.fromJson(item))
21
+ result.detection = SearchPersonDetection.fromJson(jsonObject["detection"])
22
+ result.name = jsonObject["name"]
23
+ result.updatedAt = new Date(jsonObject["updatedAt"])
24
+ result.groups = jsonObject["groups"]
25
+ result.id = jsonObject["id"]
26
+ result.metadata = jsonObject["metadata"]
27
+ result.createdAt = new Date(jsonObject["createdAt"])
28
+
29
+ return result
30
+ }
31
+ }
@@ -0,0 +1,22 @@
1
+ import { Point } from "../image_params/point"
2
+ import { Rect } from "../image_params/rect"
3
+
4
+ export class SearchPersonDetection {
5
+ landmarks = []
6
+ rect
7
+ crop
8
+ rotationAngle
9
+
10
+ static fromJson(jsonObject) {
11
+ if (jsonObject == null) return null
12
+ var result = new SearchPersonDetection()
13
+
14
+ for (var item of jsonObject["landmarks"])
15
+ result.landmarks.push(Point.fromJson(item))
16
+ result.rect = Rect.fromJson(jsonObject["rect"])
17
+ result.crop = jsonObject["crop"]
18
+ result.rotationAngle = jsonObject["rotationAngle"]
19
+
20
+ return result
21
+ }
22
+ }
@@ -0,0 +1,26 @@
1
+ export class SearchPersonImage {
2
+ similarity
3
+ distance
4
+ path
5
+ url
6
+ contentType
7
+ id
8
+ metadata
9
+ createdAt
10
+
11
+ static fromJson(jsonObject) {
12
+ if (jsonObject == null) return null
13
+ var result = new SearchPersonImage()
14
+
15
+ result.similarity = jsonObject["similarity"]
16
+ result.distance = jsonObject["distance"]
17
+ result.path = jsonObject["path"]
18
+ result.url = jsonObject["url"]
19
+ result.contentType = jsonObject["contentType"]
20
+ result.id = jsonObject["id"]
21
+ result.metadata = jsonObject["metadata"]
22
+ result.createdAt = new Date(jsonObject["createdAt"])
23
+
24
+ return result
25
+ }
26
+ }
@@ -0,0 +1,17 @@
1
+ export class SearchPersonRequest {
2
+ imageUpload
3
+ groupIdsForSearch
4
+ threshold
5
+ limit
6
+ detectAll
7
+ outputImageParams
8
+
9
+ constructor(image, params) {
10
+ this.imageUpload = image
11
+ this.groupIdsForSearch = params?.groupIdsForSearch
12
+ this.threshold = params?.threshold
13
+ this.limit = params?.limit
14
+ this.detectAll = params?.detectAll ?? false
15
+ this.outputImageParams = params?.outputImageParams
16
+ }
17
+ }