assentify-sdk-react-native 1.0.0-Beta.40 → 1.0.0-Beta.41

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/Package.swift CHANGED
@@ -66,7 +66,7 @@ let package = Package(
66
66
  .package(name: "React-GeneratedCode", path: "../../../../generated/ios"),
67
67
  .package(
68
68
  url: "https://github.com/AssentifyLTD/Assentify.SDK.iOS.SPM.git",
69
- exact: "1.0.0-Beta.37"
69
+ exact: "1.0.0-Beta.38"
70
70
  ),
71
71
  ],
72
72
  targets: [
package/README.md CHANGED
@@ -65,6 +65,10 @@ Xcode project automatically (using React Native's built-in `spm_dependency`/auto
65
65
 
66
66
  ## Versions
67
67
 
68
+ ***1.0.0-Beta.41***
69
+ 1. *ID Liveness Improvements *
70
+ 2. *Passport Liveness Improvements *
71
+
68
72
  ***1.0.0-Beta.40***
69
73
  1. *Flow Improvements*
70
74
 
@@ -96,7 +96,7 @@ dependencies {
96
96
  compileOnly("com.facebook.react:react-android")
97
97
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
98
98
 
99
- implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:1.0.0-Beta.70'
99
+ implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:1.0.0-Beta.71'
100
100
 
101
101
  implementation 'com.google.code.gson:gson:2.13.2'
102
102
  implementation 'androidx.navigation:navigation-fragment-ktx:2.9.7'
@@ -32,6 +32,7 @@ import ImageToBase64Converter
32
32
  import android.content.Intent
33
33
  import android.content.res.ColorStateList
34
34
  import com.assentify.sdk.Core.Constants.BrightnessEvents
35
+ import com.assentify.sdk.Core.Constants.IdLivenessInstruction
35
36
  import com.assentify.sdk.RemoteClient.Models.SubmitRequestModel
36
37
  import com.assentify.sdk.ScanIDCard.ScanIDCardManual
37
38
  import com.assentify.sdk.ScanIDCard.ScanIDCardResult
@@ -40,7 +41,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
40
41
  import com.squareup.picasso.Picasso
41
42
  import com.assentify.sdk.RemoteClient.Models.TemplatesByCountry
42
43
  import androidx.constraintlayout.widget.ConstraintLayout
43
-
44
+ import android.graphics.Bitmap
44
45
  class ScanIDActivity: AppCompatActivity(),
45
46
  IDCardCallback {
46
47
 
@@ -299,9 +300,12 @@ class ScanIDActivity: AppCompatActivity(),
299
300
  triggerEvent("onClipPreparationComplete", dataModel)
300
301
  }
301
302
 
302
- override fun onLivenessUpdate(dataModel: BaseResponseDataModel) {
303
+ override fun onLivenessUpdate(dataModel: BaseResponseDataModel, image: Bitmap?) {
303
304
  triggerEvent("onLivenessUpdate", dataModel)
304
305
  runOnUiThread {
306
+ if(!isManual){
307
+ scanID.retryLiveness();
308
+ }
305
309
  start = false;
306
310
  showPopUpMessage(
307
311
  R.drawable.id_warning,
@@ -390,7 +394,63 @@ class ScanIDActivity: AppCompatActivity(),
390
394
  }
391
395
  }
392
396
 
397
+ // the liveness owns the message while it runs (not after "keep holding" / "barcode read": the result is coming)
398
+ private var livenessActive = false
399
+
400
+ override fun onLivenessInstruction(instruction: IdLivenessInstruction?, progress: Int) {
401
+ if (instruction == null) return
402
+ runOnUiThread {
403
+ livenessActive = instruction != IdLivenessInstruction.KEEP_HOLDING
404
+ && instruction != IdLivenessInstruction.BARCODE_READ
405
+
406
+ var text = when (instruction) {
407
+ // ---------- position ----------
408
+ IdLivenessInstruction.PLACE_CARD -> "Place the card\nin the frame"
409
+ // ---------- flat hold ----------
410
+ IdLivenessInstruction.KEEP_STEADY -> "Keep it steady"
411
+ IdLivenessInstruction.KEEP_FLAT -> "Hold the card flat"
412
+ IdLivenessInstruction.ADJUST_POSITION -> "Tilt slightly\nto avoid glare"
413
+ // ---------- light ----------
414
+ IdLivenessInstruction.DO_NOT_MOVE -> "Keep it steady\nLight is on"
415
+ // ---------- tilt ----------
416
+ IdLivenessInstruction.LIFT_RIGHT -> "Lift the right edge\ntoward you"
417
+ IdLivenessInstruction.LIFT_TOP -> "Lift the top edge\ntoward you"
418
+ IdLivenessInstruction.LIFT_BOTTOM -> "Lift the bottom edge\ntoward you"
419
+ IdLivenessInstruction.A_BIT_MORE -> "A bit more\nand hold"
420
+ IdLivenessInstruction.HOLD_THERE -> "Hold it there"
421
+ IdLivenessInstruction.OTHER_EDGE -> "Lift the other edge"
422
+ IdLivenessInstruction.PICK_UP -> "Hold the card\nin your hand"
423
+ // ---------- done ----------
424
+ IdLivenessInstruction.KEEP_HOLDING -> "Keep holding\nAlmost done"
425
+ // ---------- ID back: the barcode ----------
426
+ IdLivenessInstruction.READING_BARCODE -> "Reading the barcode\nKeep it steady"
427
+ IdLivenessInstruction.BARCODE_READ -> "Barcode read"
428
+ // ---------- pauses (the SDK continues by itself after a few seconds) ----------
429
+ IdLivenessInstruction.HOLD_IN_HAND -> "Hold it in your hand\nnot on the table"
430
+ IdLivenessInstruction.PHONE_TURNED -> "Keep the phone still\nTilt the card"
431
+ IdLivenessInstruction.TOO_BRIGHT -> "Too much light\nMove to the shade"
432
+ }
433
+
434
+ // the tilt progress (0..100), on its own line, only while the card is being tilted
435
+ when (instruction) {
436
+ IdLivenessInstruction.LIFT_RIGHT,
437
+ IdLivenessInstruction.LIFT_TOP,
438
+ IdLivenessInstruction.LIFT_BOTTOM,
439
+ IdLivenessInstruction.A_BIT_MORE,
440
+ IdLivenessInstruction.HOLD_THERE,
441
+ IdLivenessInstruction.OTHER_EDGE,
442
+ IdLivenessInstruction.PICK_UP -> text += "\n$progress%"
443
+ else -> {}
444
+ }
445
+
446
+ infoLayout.visibility = View.VISIBLE
447
+ infoText.text = text
448
+ infoIcon.setImageDrawable(getResources().getDrawable(R.drawable.zoom_in))
449
+
450
+ }
451
+ }
393
452
  override fun onEnvironmentalConditionsChange(brightnessEvents:BrightnessEvents, motion: MotionType,zoom: ZoomType,isCentered: Boolean){
453
+ if (livenessActive) return
394
454
  runOnUiThread {
395
455
  if(start == false){
396
456
  infoLayout.visibility = View.VISIBLE
@@ -38,6 +38,8 @@ import java.text.SimpleDateFormat
38
38
  import com.assentify.sdk.Core.Constants.BrightnessEvents
39
39
  import com.assentify.sdk.ScanPassport.ScanPassportManual
40
40
  import com.assentify.sdk.ScanPassport.ScanPassportResult
41
+ import com.assentify.sdk.Core.Constants.PassportLivenessInstruction
42
+ import android.graphics.Bitmap
41
43
 
42
44
  class ScanPassportActivity : AppCompatActivity(),
43
45
  ScanPassportCallback {
@@ -268,9 +270,12 @@ class ScanPassportActivity : AppCompatActivity(),
268
270
  }
269
271
  }
270
272
 
271
- override fun onLivenessUpdate(dataModel: BaseResponseDataModel) {
273
+ override fun onLivenessUpdate(dataModel: BaseResponseDataModel, image: Bitmap?) {
272
274
  triggerEvent("onLivenessUpdate", dataModel)
273
275
  runOnUiThread {
276
+ if(!isManual){
277
+ scanPassport.retryLiveness();
278
+ }
274
279
  start = false;
275
280
  showPopUpMessage(R.drawable.warning,"Please use your original physical ID card, not a photo or copy.","Let's try again",false)
276
281
  }
@@ -345,9 +350,56 @@ class ScanPassportActivity : AppCompatActivity(),
345
350
 
346
351
 
347
352
 
353
+ }
354
+
355
+ // the liveness owns the message while it runs (not after "keep holding": the result is coming)
356
+ private var livenessActive = false
357
+
358
+ override fun onLivenessInstruction(instruction: PassportLivenessInstruction?, progress: Int) {
359
+ if (instruction == null) return
360
+ runOnUiThread {
361
+ livenessActive = instruction != PassportLivenessInstruction.KEEP_HOLDING
362
+
363
+ var text = when (instruction) {
364
+ // ---------- position / flat hold / light ----------
365
+ PassportLivenessInstruction.PLACE_DOCUMENT -> "Place the photo page\nin the frame"
366
+ PassportLivenessInstruction.KEEP_STEADY,
367
+ PassportLivenessInstruction.KEEP_FLAT,
368
+ PassportLivenessInstruction.ADJUST_POSITION,
369
+ PassportLivenessInstruction.DO_NOT_MOVE -> "Keep it steady"
370
+ // ---------- tilt ----------
371
+ PassportLivenessInstruction.LIFT_BOTTOM -> "Lift the bottom edge\ntoward you"
372
+ PassportLivenessInstruction.MOVE_A_LITTLE_MORE -> "A bit more\nand hold"
373
+ PassportLivenessInstruction.HOLD_THERE -> "Hold it there"
374
+ PassportLivenessInstruction.OTHER_SIDE -> "Lift the bottom edge,\nnot the top"
375
+ PassportLivenessInstruction.HOLD_IT_UP -> "Hold the passport\nin your hand"
376
+ PassportLivenessInstruction.PLACE_FLAT_AGAIN -> "Place it flat again"
377
+ // ---------- done ----------
378
+ PassportLivenessInstruction.KEEP_HOLDING -> "Keep holding\nAlmost done"
379
+ // ---------- pauses (the SDK continues by itself after a few seconds) ----------
380
+ PassportLivenessInstruction.HOLD_IN_HAND -> "Hold it in your hand\nnot on the table"
381
+ PassportLivenessInstruction.PHONE_TURNED -> "Keep the phone still\nTilt the passport"
382
+ PassportLivenessInstruction.TOO_BRIGHT -> "Too much light\nMove to the shade"
383
+ }
384
+
385
+ // the tilt progress (0..100), on its own line, only while the passport is being tilted
386
+ when (instruction) {
387
+ PassportLivenessInstruction.LIFT_BOTTOM,
388
+ PassportLivenessInstruction.MOVE_A_LITTLE_MORE,
389
+ PassportLivenessInstruction.HOLD_THERE,
390
+ PassportLivenessInstruction.OTHER_SIDE,
391
+ PassportLivenessInstruction.HOLD_IT_UP -> text += "\n$progress%"
392
+ else -> {}
393
+ }
394
+
395
+ infoLayout.visibility = View.VISIBLE
396
+ infoText.text = text
397
+ infoIcon.setImageDrawable(getResources().getDrawable(R.drawable.zoom_in))
398
+ }
348
399
  }
349
400
 
350
401
  override fun onEnvironmentalConditionsChange(brightnessEvents:BrightnessEvents, motion: MotionType,zoom: ZoomType, isCentered: Boolean,){
402
+ if (livenessActive) return
351
403
  runOnUiThread {
352
404
  if(start == false){
353
405
  infoLayout.visibility = View.VISIBLE
@@ -170,11 +170,14 @@ public class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewC
170
170
  }
171
171
  }
172
172
 
173
- public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
173
+ public func onLivenessUpdate(dataModel: RemoteProcessingModel, image: UIImage?) {
174
174
  triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
175
175
  DispatchQueue.main.async {
176
+ self.scanID?.retryLiveness();
176
177
  self.start = false;
178
+ if( self.popUpMessage != nil){
177
179
  self.popUpMessage!.removeFromSuperview();
180
+ }
178
181
  self.popUpMessage = showPopUpMessage(view: self.view, title: "Please use your original physical ID card, not a photo or copy.", subTitle: "Please real ID (Not copy)",initialTextColorHex:self.processingColor,initialBackgroundColorHex:self.holdHandColor, iconName: "id_warning", isGif: false,target: self, action: #selector(self.dismissPopUpMessage))
179
182
  }
180
183
  }
@@ -324,6 +327,59 @@ public class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewC
324
327
  public func onUploadFailed(dataModel: RemoteProcessingModel) {
325
328
  triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
326
329
  }
330
+
331
+
332
+ private var livenessActive = false
333
+
334
+
335
+
336
+ public func onLivenessInstruction(instruction: IdLivenessInstruction, progress: Int) {
337
+ DispatchQueue.main.async {
338
+ // the liveness owns the message while it runs (not after "keep holding" / "barcode read": the result is coming)
339
+ self.livenessActive = instruction != .keepHolding && instruction != .barcodeRead
340
+
341
+ var text: String
342
+ switch instruction {
343
+ // ---------- position ----------
344
+ case .placeCard: text = "Place the card\nin the frame"
345
+ // ---------- flat hold ----------
346
+ case .keepSteady: text = "Keep it steady"
347
+ case .keepFlat: text = "Hold the card flat"
348
+ case .adjustPosition: text = "Tilt slightly\nto avoid glare"
349
+ // ---------- light ----------
350
+ case .doNotMove: text = "Keep it steady\nLight is on"
351
+ // ---------- tilt ----------
352
+ case .liftRight: text = "Lift the right edge\ntoward you"
353
+ case .liftTop: text = "Lift the top edge\ntoward you"
354
+ case .liftBottom: text = "Lift the bottom edge\ntoward you"
355
+ case .aBitMore: text = "A bit more\nand hold"
356
+ case .holdThere: text = "Hold it there"
357
+ case .otherEdge: text = "Lift the other edge"
358
+ case .pickUp: text = "Hold the card\nin your hand"
359
+ // ---------- done ----------
360
+ case .keepHolding: text = "Keep holding\nAlmost done"
361
+ // ---------- ID back: the barcode ----------
362
+ case .readingBarcode: text = "Reading the barcode\nKeep it steady"
363
+ case .barcodeRead: text = "Barcode read"
364
+ // ---------- pauses (the SDK continues by itself after a few seconds) ----------
365
+ case .holdInHand: text = "Hold it in your hand\nnot on the table"
366
+ case .phoneTurned: text = "Keep the phone still\nTilt the card"
367
+ case .tooBright: text = "Too much light\nMove to the shade"
368
+ @unknown default: text = ""
369
+ }
370
+
371
+ // the tilt progress (0..100), on its own line, only while the card is being tilted
372
+ switch instruction {
373
+ case .liftRight, .liftTop, .liftBottom, .aBitMore, .holdThere, .otherEdge, .pickUp:
374
+ text += "\n\(progress)%"
375
+ default:
376
+ break
377
+ }
378
+
379
+ self.infoLabel?.text = text
380
+ self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
381
+ }
382
+ }
327
383
 
328
384
  public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
329
385
  motion: MotionType,
@@ -171,11 +171,14 @@ public class PassportController: UIViewController ,ScanPassportDelegate , ChildV
171
171
  }
172
172
  }
173
173
 
174
- public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
174
+ public func onLivenessUpdate(dataModel: RemoteProcessingModel, image: UIImage?) {
175
175
  triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
176
176
  DispatchQueue.main.async {
177
+ self.scanPassport?.retryLiveness();
177
178
  self.start = false;
179
+ if( self.popUpMessage != nil){
178
180
  self.popUpMessage!.removeFromSuperview();
181
+ }
179
182
  self.popUpMessage = showPopUpMessage(view: self.view, title: "Please use your original physical ID card, not a photo or copy.", subTitle: "Please real ID (Not copy)",initialTextColorHex:self.processingColor,initialBackgroundColorHex:self.holdHandColor, iconName: "warning", isGif: false,target: self, action: #selector(self.dismissPopUpMessage))
180
183
  }
181
184
  }
@@ -271,6 +274,51 @@ public class PassportController: UIViewController ,ScanPassportDelegate , ChildV
271
274
  public func onUploadFailed(dataModel: RemoteProcessingModel) {
272
275
  triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
273
276
  }
277
+
278
+
279
+ /// The liveness owns the message while it runs (not after "keep holding": the result is coming).
280
+ private var livenessActive = false
281
+
282
+ /// The liveness owns the message while it runs (not after "keep holding": the result is coming).
283
+
284
+ public func onLivenessInstruction(instruction: PassportLivenessInstruction, progress: Int) {
285
+ DispatchQueue.main.async {
286
+ self.livenessActive = instruction != .keepHolding
287
+
288
+ var text: String
289
+ switch instruction {
290
+ // ---------- position / flat hold / light ----------
291
+ case .placeDocument: text = "Place the photo page\nin the frame"
292
+ case .keepSteady, .keepFlat, .adjustPosition, .doNotMove:
293
+ text = "Keep it steady"
294
+ // ---------- tilt ----------
295
+ case .liftBottom: text = "Lift the bottom edge\ntoward you"
296
+ case .moveALittleMore: text = "A bit more\nand hold"
297
+ case .holdThere: text = "Hold it there"
298
+ case .otherSide: text = "Lift the bottom edge,\nnot the top"
299
+ case .holdItUp: text = "Hold the passport\nin your hand"
300
+ case .placeFlatAgain: text = "Place it flat again"
301
+ // ---------- done ----------
302
+ case .keepHolding: text = "Keep holding\nAlmost done"
303
+ // ---------- pauses (the SDK continues by itself after a few seconds) ----------
304
+ case .holdInHand: text = "Hold it in your hand\nnot on the table"
305
+ case .phoneTurned: text = "Keep the phone still\nTilt the passport"
306
+ case .tooBright: text = "Too much light\nMove to the shade"
307
+ @unknown default: text = ""
308
+ }
309
+
310
+ // the tilt progress (0..100), on its own line, only while the passport is being tilted
311
+ switch instruction {
312
+ case .liftBottom, .moveALittleMore, .holdThere, .otherSide, .holdItUp:
313
+ text += "\n\(progress)%"
314
+ default:
315
+ break
316
+ }
317
+
318
+ self.infoLabel?.text = text
319
+ self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
320
+ }
321
+ }
274
322
 
275
323
  public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
276
324
  motion: MotionType,
@@ -81,8 +81,36 @@ declare const pak: {
81
81
  workspaces: string[];
82
82
  packageManager: string;
83
83
  jest: {
84
- preset: string;
84
+ testEnvironment: string;
85
+ roots: string[];
86
+ testMatch: string[];
87
+ transform: {
88
+ "^.+\\.[jt]sx?$": (string | {
89
+ configFile: boolean;
90
+ babelrc: boolean;
91
+ presets: (string | (string | {
92
+ targets: {
93
+ node: string;
94
+ };
95
+ })[] | (string | {
96
+ runtime: string;
97
+ })[])[];
98
+ })[];
99
+ };
100
+ moduleNameMapper: {
101
+ "^react-native$": string;
102
+ };
85
103
  modulePathIgnorePatterns: string[];
104
+ collectCoverageFrom: string[];
105
+ coverageReporters: string[];
106
+ coverageThreshold: {
107
+ global: {
108
+ lines: number;
109
+ statements: number;
110
+ functions: number;
111
+ branches: number;
112
+ };
113
+ };
86
114
  };
87
115
  "release-it": {
88
116
  git: {
@@ -1 +1 @@
1
- {"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../example/babel.config.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAwC"}
1
+ {"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../example/babel.config.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAwC"}
@@ -81,8 +81,36 @@ declare const pak: {
81
81
  workspaces: string[];
82
82
  packageManager: string;
83
83
  jest: {
84
- preset: string;
84
+ testEnvironment: string;
85
+ roots: string[];
86
+ testMatch: string[];
87
+ transform: {
88
+ "^.+\\.[jt]sx?$": (string | {
89
+ configFile: boolean;
90
+ babelrc: boolean;
91
+ presets: (string | (string | {
92
+ targets: {
93
+ node: string;
94
+ };
95
+ })[] | (string | {
96
+ runtime: string;
97
+ })[])[];
98
+ })[];
99
+ };
100
+ moduleNameMapper: {
101
+ "^react-native$": string;
102
+ };
85
103
  modulePathIgnorePatterns: string[];
104
+ collectCoverageFrom: string[];
105
+ coverageReporters: string[];
106
+ coverageThreshold: {
107
+ global: {
108
+ lines: number;
109
+ statements: number;
110
+ functions: number;
111
+ branches: number;
112
+ };
113
+ };
86
114
  };
87
115
  "release-it": {
88
116
  git: {
@@ -1 +1 @@
1
- {"version":3,"file":"react-native.config.d.ts","sourceRoot":"","sources":["../../../example/react-native.config.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKI,CAAC,GAAG,CAAC,IAAI,CAAC;;MAET"}
1
+ {"version":3,"file":"react-native.config.d.ts","sourceRoot":"","sources":["../../../example/react-native.config.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKI,CAAC,GAAG,CAAC,IAAI,CAAC;;MAET"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assentify-sdk-react-native",
3
- "version": "1.0.0-Beta.40",
3
+ "version": "1.0.0-Beta.41",
4
4
  "description": "This package provides integration with Assentify's services, allowing developers to incorporate Assentify functionalities seamlessly into their applications.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -104,11 +104,63 @@
104
104
  ],
105
105
  "packageManager": "yarn@3.6.1",
106
106
  "jest": {
107
- "preset": "react-native",
107
+ "testEnvironment": "node",
108
+ "roots": [
109
+ "<rootDir>/src"
110
+ ],
111
+ "testMatch": [
112
+ "**/__tests__/**/*.test.ts?(x)"
113
+ ],
114
+ "transform": {
115
+ "^.+\\.[jt]sx?$": [
116
+ "babel-jest",
117
+ {
118
+ "configFile": false,
119
+ "babelrc": false,
120
+ "presets": [
121
+ [
122
+ "@babel/preset-env",
123
+ {
124
+ "targets": {
125
+ "node": "current"
126
+ }
127
+ }
128
+ ],
129
+ [
130
+ "@babel/preset-react",
131
+ {
132
+ "runtime": "automatic"
133
+ }
134
+ ],
135
+ "@babel/preset-typescript"
136
+ ]
137
+ }
138
+ ]
139
+ },
140
+ "moduleNameMapper": {
141
+ "^react-native$": "<rootDir>/src/__tests__/support/react-native.ts"
142
+ },
108
143
  "modulePathIgnorePatterns": [
109
144
  "<rootDir>/example/node_modules",
110
145
  "<rootDir>/lib/"
111
- ]
146
+ ],
147
+ "collectCoverageFrom": [
148
+ "src/**/*.{ts,tsx}",
149
+ "!src/__tests__/**"
150
+ ],
151
+ "coverageReporters": [
152
+ "text-summary",
153
+ "cobertura",
154
+ "lcov"
155
+ ],
156
+ "coverageThreshold": {
157
+ "global": {
158
+ "lines": 98,
159
+ "statements": 98,
160
+ "functions": 95,
161
+ "branches": 90
162
+ }
163
+ }
112
164
  },
113
165
  "release-it": {
114
166
  "git": {