@soyio/soyio-widget 2.14.1 → 2.14.2

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
@@ -61,7 +61,6 @@ This doesn't require any previous setup. Given your company and disclosure templ
61
61
  userReference: "<user identifier of company>",
62
62
  userEmail: "<user email>",
63
63
  templateId: "<template id>",
64
- forceError: "<error type>",
65
64
  customColor: "<custom color>",
66
65
  },
67
66
  onEvent: (data) => console.log(data),
@@ -83,7 +82,6 @@ This doesn't require any previous setup. Given your company and disclosure templ
83
82
  Optional props:
84
83
 
85
84
  - `userEmail`
86
- - `forceError`
87
85
  - `customColor`.
88
86
 
89
87
  ### 2. Created Disclosure Request
@@ -105,7 +103,6 @@ To use this option, simply specify the disclosure request ID along with any opti
105
103
  request: "disclosure",
106
104
  configProps: {
107
105
  disclosureRequestId: "<disclosure request id>",
108
- forceError: "<error type>",
109
106
  customColor: "<custom color>",
110
107
  },
111
108
  onEvent: (data) => console.log(data),
@@ -126,7 +123,6 @@ To use this option, simply specify the disclosure request ID along with any opti
126
123
 
127
124
  Optional properties:
128
125
 
129
- - `forceError`
130
126
  - `customColor`
131
127
 
132
128
  Note: User and template properties are not specified here because they must be specified when creating the disclosure request beforehand.
@@ -161,19 +157,9 @@ The `onEvent` callback is designed to handle various events that occur during wi
161
157
  - **`disclosureRequestId`**: If created beforehand, you can target a specific disclosure request that the user must complete. It is useful if you need to match some data between the disclosure process and your database records. It must start with `'dreq_'`
162
158
  - **`identityId`**: This identifier must start with `'id_'` and signifies the user's identity.
163
159
  - **`isSandbox`**: Indicates if the widget should operate in sandbox mode, defaulting to `false`.
164
- - **`forceError`**: Triggers specific errors for testing or debugging. Used to simulate failure scenarios. Only works in `sandbox` mode.
165
160
  - **`onEvent`**: A callback function triggered upon event occurrences, used for capturing and logging event-related data.
166
161
  - **`customColor`**: A hex code string that specifies the base color of the interface.
167
162
 
168
- ### Force Error Types
169
-
170
- The `forceError` parameter can simulate the following error conditions:
171
-
172
- - `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
173
- - `'document_validation_error'`: Indicates an issue with validating the photos of the documents provided by the user.
174
- - `'unknown_error'`: Generates a generic error, representing an unspecified problem.
175
- - `'expiration_error'`: Occurs when there is an issue with the identity provider that prevents the validation of one or both documents provided by the user, due to unspecified problems in the validation process.
176
-
177
163
  ## Signature Attempt
178
164
 
179
165
  The **`signature_attempt`** is a process where, using a previously created `signature_attempt_id`, a request is initiated in which a user can digitally sign a document. To sign the document, the user must be authenticated. This authentication can occur either through an access key or facial video. It's important to note that for this request, the user must have been previously verified with Soyio.
@@ -189,7 +175,6 @@ The **`signature_attempt`** is a process where, using a previously created `sign
189
175
  request: "signature",
190
176
  configProps: {
191
177
  signatureAttemptId: "<signature attempt id>",
192
- forceError: "<error type>",
193
178
  customColor: "<custom color>",
194
179
  },
195
180
  onEvent: (data) => console.log(data),
@@ -210,7 +195,6 @@ The **`signature_attempt`** is a process where, using a previously created `sign
210
195
 
211
196
  Optional props:
212
197
 
213
- - `forceError`
214
198
  - `customColor`.
215
199
 
216
200
  ### Signature Attempt Events
@@ -229,18 +213,9 @@ Optional props:
229
213
 
230
214
  - **`signatureAttemptId`**: Identifier of signature attempt obtained when creating the `SignatureAttempt`. It must start with `'sa_'`.
231
215
  - **`isSandbox`**: Indicates if the widget should operate in sandbox mode, defaulting to `false`.
232
- - **`forceError`**: Triggers specific errors for testing or debugging. Used to simulate failure scenarios. Only works in `sandbox` mode.
233
216
  - **`onEvent`**: A callback function triggered upon event occurrences, used for capturing and logging event-related data.
234
217
  - **`customColor`**: A hex code string that specifies the base color of the interface.
235
218
 
236
- ### Force Error Types
237
-
238
- The `forceError` parameter can simulate the following error conditions:
239
-
240
- - `'facial_validation_error'`: Simulates a failure in the facial video liveness test, indicating the system could not verify the user's live presence.
241
- - `'unknown_error'`: Generates a generic error, representing an unspecified problem.
242
- - `'expiration_error'`: Occurs when there is an issue with the identity provider that prevents the validation of one or both documents provided by the user, due to unspecified problems in the validation process.
243
-
244
219
  ## Auth Request
245
220
 
246
221
  The **`auth_request`** is a process where, using a previously created `auth_request_id`, a request is initiated in which a user can authenticate. This authentication can occur either through an access key or facial video. It's important to note that for this request, the user must have been previously verified with Soyio.
package/dist/index.d.ts CHANGED
@@ -164,12 +164,9 @@ declare type ExistingDisclosureRequestProps = {
164
164
  disclosureRequestId: `dreq_${string}`;
165
165
  userReference?: never;
166
166
  userEmail?: never;
167
- forceError?: ForceErrors;
168
167
  customColor?: string;
169
168
  };
170
169
 
171
- declare type ForceErrors = 'facial_validation_error' | 'document_validation_error' | 'unknown_error' | 'expiration_error' | 'camera_permission_error';
172
-
173
170
  declare interface IBaseEventData {
174
171
  identifier: string;
175
172
  eventName: string;
@@ -200,7 +197,6 @@ declare type NewDisclosureRequestProps = {
200
197
  disclosureRequestId?: never;
201
198
  userReference: string;
202
199
  userEmail?: string;
203
- forceError?: ForceErrors;
204
200
  customColor?: string;
205
201
  };
206
202
 
@@ -231,7 +227,6 @@ declare type RequestConfig = DisclosureRequestConfig | SignatureRequestConfig |
231
227
 
232
228
  declare type SignatureAttemptProps = {
233
229
  signatureAttemptId: `sa_${string}`;
234
- forceError?: ForceErrors;
235
230
  customColor?: string;
236
231
  };
237
232
 
@@ -286,7 +281,6 @@ declare namespace SoyioTypes {
286
281
  ConsentConfig,
287
282
  PrivacyCenterConfig,
288
283
  SoyioAppearance,
289
- ForceErrors,
290
284
  Request_2 as Request,
291
285
  NewDisclosureRequestProps,
292
286
  ExistingDisclosureRequestProps,
@@ -304,7 +298,6 @@ export { SoyioTypes }
304
298
 
305
299
  declare namespace SoyioTypes_2 {
306
300
  export {
307
- ForceErrors,
308
301
  Request_2 as Request,
309
302
  NewDisclosureRequestProps,
310
303
  ExistingDisclosureRequestProps,
package/dist/index.js CHANGED
@@ -432,7 +432,7 @@ class Hn {
432
432
  this.element.style.opacity = "0", setTimeout(() => this.element.remove(), 300);
433
433
  }
434
434
  }
435
- const He = "2.14.1";
435
+ const He = "2.14.2";
436
436
  function _n(c) {
437
437
  var E;
438
438
  const d = [
@@ -121,7 +121,7 @@
121
121
  0% { background-position: 200% 0; }
122
122
  100% { background-position: -200% 0; }
123
123
  }
124
- `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const je="2.14.1";function mn(h){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=h.isSandbox)!=null?E:!1,d=h.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",je),f.forEach(W=>{h[W]&&v.set(W,h[W])});const y=v.toString();return`${d}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class ze extends be{constructor(g){super(g);M(this,"defaultIframePrefix","consent-box");M(this,"defaultIframeCSSConfig",fn);M(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(h){var y,E,W;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",je),h.sessionToken?d.set("sessionToken",h.sessionToken):h.companyId&&d.set("companyId",h.companyId),(E=h.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",h.enabledFeatures.join(",")),(W=h.dataSubjects)!=null&&W.length&&d.set("dataSubjects",h.dataSubjects.join(","));const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends be{constructor(){super(...arguments);M(this,"defaultIframePrefix","privacy-center");M(this,"_uniqueIdentifier","privacy-center");M(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(h){let f="widget/";return"disclosureRequestId"in h.configProps?f+=["disclosures",h.configProps.disclosureRequestId].join("/"):f+=h.request,f}function En(h){var y;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?at:it),d=Object.entries(h.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(h);return`${g}/${v}?sdk=web&sdkVersion=${je}&${d}`}let ee=null,Le=null;function ke(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function xn(h){const f=En(h),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
124
+ `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const je="2.14.2";function mn(h){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=h.isSandbox)!=null?E:!1,d=h.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",je),f.forEach(W=>{h[W]&&v.set(W,h[W])});const y=v.toString();return`${d}/embed/consents/${h.consentTemplateId}${y?`?${y}`:""}`}class ze extends be{constructor(g){super(g);M(this,"defaultIframePrefix","consent-box");M(this,"defaultIframeCSSConfig",fn);M(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(h){var y,E,W;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",je),h.sessionToken?d.set("sessionToken",h.sessionToken):h.companyId&&d.set("companyId",h.companyId),(E=h.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",h.enabledFeatures.join(",")),(W=h.dataSubjects)!=null&&W.length&&d.set("dataSubjects",h.dataSubjects.join(","));const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends be{constructor(){super(...arguments);M(this,"defaultIframePrefix","privacy-center");M(this,"_uniqueIdentifier","privacy-center");M(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(h){let f="widget/";return"disclosureRequestId"in h.configProps?f+=["disclosures",h.configProps.disclosureRequestId].join("/"):f+=h.request,f}function En(h){var y;const f=(y=h.isSandbox)!=null?y:!1,g=h.developmentUrl||(f?at:it),d=Object.entries(h.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(h);return`${g}/${v}?sdk=web&sdkVersion=${je}&${d}`}let ee=null,Le=null;function ke(h=null){ee&&!ee.closed&&ee.focus(),h==null||h.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function xn(h){const f=En(h),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
125
125
  width=${g},
126
126
  height=${d},
127
127
  top=${H},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.14.1",
3
+ "version": "2.14.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",