sonic-widget 2.6.21 → 2.7.0

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/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  Use this script tag to get access to the widget:
13
13
 
14
14
  ```html
15
- <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.6.21/dist/index.min.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.7.0/dist/index.min.js"></script>
16
16
  ```
17
17
 
18
18
  or
@@ -39,7 +39,7 @@ and adding path in `angular.json`
39
39
  2. Use this script tag to get access to the widget at initial html page:
40
40
 
41
41
  ```html
42
- <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.6.21/dist/index.min.js"></script>
42
+ <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.7.0/dist/index.min.js"></script>
43
43
  ```
44
44
 
45
45
  or
@@ -97,8 +97,11 @@ ngOnInit(): void {
97
97
  branchId: string, //used to identify the bank branch
98
98
  sendLogsEmail: boolean, //used to send logs through email
99
99
  blinkThreshold: number, // used for blink threshold
100
+ eyeOpenThreshold: number, // used for eye open threshold
101
+ disableUploadDocs: boolean, // used to show/hide the upload docs option.
100
102
  objectPersonThreshold: number, // used for object Person score threshold
101
103
  objectPhoneThreshold: number, // used for object Phone score threshold
104
+ grayscalePercentageThreshold: number, // used for black&white percentage score threshold
102
105
  onMessage: function (data) {}, // callback function, when api response message or error or any other actions
103
106
  };
104
107
 
@@ -233,7 +236,7 @@ it can be added in `angular.json` by installing the npm package
233
236
  4. Add a Script tag to the head tag or body tag. And use the latest version.
234
237
 
235
238
  ```html
236
- <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.6.21/dist/index.min.js"></script>
239
+ <script src="https://cdn.jsdelivr.net/npm/sonic-widget@2.7.0/dist/index.min.js"></script>
237
240
  ```
238
241
 
239
242
  5. Next, add the script tag at a necessary place. But add below the widget script.
@@ -263,9 +266,12 @@ it can be added in `angular.json` by installing the npm package
263
266
  isMalay: boolean, //used to change the default language english to malay
264
267
  branchId: string, // branch id to identify the branch of the bank
265
268
  sendLogsEmail: boolean, //used to send logs through email
266
- blinkThreshold: number, // threshold used to calculate the user blinked or not, with range limit 0-1(default value is 0.4)
269
+ blinkThreshold: number, // threshold used to calculate the user's eye blinked or not, with range limit 0-1(default value is 0.35)
270
+ eyeOpenThreshold: number, // threshold used to calculate the user's eye open or not, with range limit 0-1(default value is 0.2)
271
+ disableUploadDocs: boolean, // used to pass a boolean value. It is used to disable the upload option the document process
267
272
  objectPersonThreshold: number, // used for object Person score threshold with range limit 0-1(default value is 0.925)
268
273
  objectPhoneThreshold: number, // used for object Phone score threshold with range limit 0-1(default value is 0.5)
274
+ grayscalePercentageThreshold: number, // used for black&white percentage score threshold with range limit 0-100(default value is 80)
269
275
  onMessage: function (data) {}, // callback function, when api response message or error or any other actions
270
276
  };
271
277
  // get the element used in the action button
@@ -315,10 +321,58 @@ Check with **`data.code`**_
315
321
  - _**`phone`** should pass as a string value. It is used to create an application for onboard sonic kyc._
316
322
  - _**`applicationNo`** should pass as a string value. It is used to create an application for onboard sonic kyc._
317
323
  - _**`sendLogsEmail`** is used to pass a boolean value. It is used to send logs to client email address._
318
- - _**`blinkThreshold`** is used to pass a numerical value. It is used to check the user blinks (range 0-1 and default 0.5)._
324
+ - _**`blinkThreshold`** is used to pass a numerical value. It is used to check the user blinking (range 0-1 and default 0.35). Above the threshold consider to be blinking or eye closed._
325
+ - _**`disableUploadDocs`** is used to pass a boolean value. It is used to disable the upload option the document process._
326
+ - _**`eyeOpenThreshold`** is used to pass a numerical value. It is used to check the user eyes are open (range 0-1 and default 0.2). Below the threshold consider to be eyes are open._
319
327
  - _**`objectPersonThreshold`** is used to pass a numerical value. It is used to check the image person as object found with required score as threshold (range 0-1 and default 0.925)._
320
328
  - _**`objectPhoneThreshold`** is used to pass a numerical value. It is used to check the image phone/laptop as object found with required score as threshold (range 0-1 and default 0.5)._
329
+ - _**`grayscalePercentageThreshold`** is used to pass a numerical value for percentage. It is used to check the image color as black&white found with required percentage as threshold (range 0-100 and default 80)._
321
330
  - _**`onMessage`** is a callback function. It is getting called when the API gives a message or at any configuration error. Return data is an object with its API endpoint and result._
322
331
 
323
332
 
333
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEVELOPER info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
334
+
324
335
  <!-- use node 18 and install packages using yarn and do yarn dev -->
336
+
337
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GrayScale info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
338
+
339
+ <!-- GrayScale Suggestions
340
+
341
+ 1. RGB Difference Threshold for Grayscale Detection:
342
+
343
+ Low Threshold: A low threshold (e.g., 5-10) is good if you want to consider any slight variation in color as an indication that the image is colored. This is more sensitive to minor color differences.
344
+
345
+ Moderate Threshold: A threshold of around 10-20 is a more balanced approach. It allows for small variations due to noise or minor imperfections in grayscale images but still classifies them as black and white.
346
+
347
+ High Threshold: A higher threshold (e.g., 20-50) will classify images as grayscale even if there are noticeable color variations, which might be acceptable for images that are predominantly black and white but have some color noise or artifacts.
348
+
349
+ 2. Percentage of Grayscale Pixels:
350
+
351
+ After detecting grayscale pixels, you need to determine the percentage of grayscale pixels required to classify the image as black and white.
352
+
353
+ 80-90% Grayscale Pixels: This threshold means that if 80-90% of the pixels are grayscale, the image will be classified as black and white. This works well for documents and images that are mostly grayscale but may have some minor color elements (e.g., stamps, logos).
354
+
355
+ 90-100% Grayscale Pixels: This is a stricter threshold, ensuring that the image is classified as black and white only if nearly all pixels are grayscale. -->
356
+
357
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Selfie info ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
358
+
359
+ <!--
360
+ 1.blinkThreshold: number
361
+
362
+ Description : The blinkThreshold is used to determine whether the user's eye is considered blinked. It represents the sensitivity to eye closure during a blink.
363
+ Range : 0-1 (default: 0.35)
364
+ Functionality :
365
+ * If either of the user's eyes exceeds the specified threshold (i.e., the eye closure ratio is greater than the blinkThreshold), the eye is detected as "blinked."
366
+ * This helps identify blinks during facial detection or tracking processes.
367
+
368
+ 2.eyeOpenThreshold: number
369
+
370
+ Description : The eyeOpenThreshold is used to detect whether the user's eyes are open or not. It determines the sensitivity to eye openness by checking the openness ratio.
371
+ Range : 0-1 (default: 0.25)
372
+ Functionality :
373
+ * If both eyes fall below the defined threshold, the system interprets that the eyes are open.
374
+ * This value helps differentiate between an open eye and a partially closed
375
+
376
+ Both thresholds work together to archive ekyc selfie process.
377
+ -->
378
+