@quantidia/sdk 1.1.0 → 1.1.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Quantidia
3
+ Copyright (c) 2026 Quantidia
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -125,7 +125,7 @@ await SDK.openSigningWithLogin({
125
125
  environmentId: "your-environment-id",
126
126
  },
127
127
  authLogin: {
128
- accessToken: "eyJhbGci...",
128
+ access_token: "eyJhbGci...",
129
129
  },
130
130
  },
131
131
  headersOverride: {
@@ -153,7 +153,7 @@ The package ships two entry points:
153
153
  | Entry point | Contents |
154
154
  |---|---|
155
155
  | `@quantidia/sdk` | OpenAPI REST client (generated) |
156
- | `@quantidia/sdk/ui` | Signing UI — `init`, `openSigningWithLogin`, `addDocuments`, `clearDocuments`, `close`, `listSignedDocuments`, `getSignedDocumentBytes` |
156
+ | `@quantidia/sdk/ui` | Signing UI — `init`, `openSigningWithLogin`, `openSigning`, `addDocument(s)`, `removeDocument`, `clearDocuments`, `close`, `listSignedDocuments`, `getSignedDocumentBytes`, `removeSignedDocument`, `clearSignedDocuments` |
157
157
 
158
158
  ```js
159
159
  import {
@@ -270,7 +270,7 @@ const result = await openSigningWithLogin({
270
270
  environmentId: "your-environment-id",
271
271
  },
272
272
  authLogin: {
273
- accessToken: "eyJhbGci...",
273
+ access_token: "eyJhbGci...",
274
274
  },
275
275
  },
276
276
  headersOverride: {
@@ -285,6 +285,65 @@ const result = await openSigningWithLogin({
285
285
 
286
286
  ---
287
287
 
288
+ ### 4. Retrieve signed documents
289
+
290
+ Signed PDFs never leave the browser automatically — they're kept in an in-memory store so the integrator decides when and how to pick them up. There are two ways to get them:
291
+
292
+ **a) From the resolved promise.** The `signed` field on the result already lists the signed documents (metadata only, no bytes):
293
+
294
+ ```js
295
+ const result = await SDK.openSigningWithLogin({ /* ... */ });
296
+ console.log(result.signed);
297
+ // [{ id, name, mime, size, createdAt, sourceDocId }, ...]
298
+ ```
299
+
300
+ **b) On demand, via the store API.** These are plain functions on `SDK` — same names whether you're using the CDN build (`window.Quantidia`) or the npm/ESM `@quantidia/sdk/ui` import:
301
+
302
+ ```js
303
+ // List everything currently stored (metadata only)
304
+ const docs = SDK.listSignedDocuments();
305
+ // [{ id, name, mime, size, createdAt, sourceDocId }, ...]
306
+
307
+ // Get the raw bytes for one signed document
308
+ const bytes = SDK.getSignedDocumentBytes(docs[0].id); // Uint8Array | null
309
+
310
+ // Remove one signed document from memory once you're done with it
311
+ SDK.removeSignedDocument(docs[0].id);
312
+
313
+ // Or clear everything at once
314
+ SDK.clearSignedDocuments();
315
+ ```
316
+
317
+ **Triggering a browser download** (CDN example — no build tooling needed) — wrap the bytes in a `Blob`, turn that into an object URL, and click a hidden `<a download>`:
318
+
319
+ ```js
320
+ function downloadSignedDocument(meta) {
321
+ const bytes = SDK.getSignedDocumentBytes(meta.id);
322
+ if (!bytes) return;
323
+
324
+ const blob = new Blob([bytes], { type: meta.mime || "application/pdf" });
325
+ const url = URL.createObjectURL(blob);
326
+
327
+ const a = document.createElement("a");
328
+ a.href = url;
329
+ a.download = meta.name || "signed.pdf";
330
+ a.click();
331
+
332
+ URL.revokeObjectURL(url); // safe to revoke right after click() has fired
333
+ }
334
+
335
+ // Call this once the modal has closed, e.g. after openSigningWithLogin resolves/rejects:
336
+ SDK.listSignedDocuments().forEach(downloadSignedDocument);
337
+ ```
338
+
339
+ To instead **upload the signed PDF to your own backend** rather than downloading it, skip the `<a>` and just `fetch()` the `Blob` (or the raw `Uint8Array`) to your endpoint — see [`examples/html-cdn/index.html`](./examples/html-cdn/index.html) for a full working page that renders a download link per signed document as soon as the modal closes.
340
+
341
+ `getSignedDocumentBytes` returns a **copy** of the bytes each time — the original stays in the store until you explicitly remove it. The store is also cleared automatically every time a new signing session is opened (`openSigning` / `openSigningWithLogin`), so make sure you've picked up any bytes you need before starting a new one.
342
+
343
+ For source documents loaded via `addDocuments`, the equivalent cleanup helpers are `removeDocument(docId)` and `clearDocuments()`.
344
+
345
+ ---
346
+
288
347
  ### Bundler notes
289
348
 
290
349
  **Vite / webpack / Rollup** — no special configuration needed from `@quantidia/sdk ≥ 1.0.8`.
@@ -26,7 +26,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
26
26
  \********************/
27
27
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
28
28
 
29
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addDocuments: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.addDocuments),\n/* harmony export */ close: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.close),\n/* harmony export */ init: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.init),\n/* harmony export */ openSigning: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.openSigning),\n/* harmony export */ openSigningWithLogin: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.openSigningWithLogin)\n/* harmony export */ });\n/* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui */ \"./src/ui.ts\");\n// sdk/src/umd.ts\n\n\n\n//# sourceURL=webpack://Quantidia/./src/umd.ts?\n}");
29
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addDocument: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.addDocument),\n/* harmony export */ addDocuments: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.addDocuments),\n/* harmony export */ clearDocuments: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.clearDocuments),\n/* harmony export */ clearSignedDocuments: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.clearSignedDocuments),\n/* harmony export */ close: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.close),\n/* harmony export */ getSignedDocumentBytes: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.getSignedDocumentBytes),\n/* harmony export */ init: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.init),\n/* harmony export */ listSignedDocuments: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.listSignedDocuments),\n/* harmony export */ openSigning: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.openSigning),\n/* harmony export */ openSigningWithLogin: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.openSigningWithLogin),\n/* harmony export */ removeDocument: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.removeDocument),\n/* harmony export */ removeSignedDocument: () => (/* reexport safe */ _ui__WEBPACK_IMPORTED_MODULE_0__.removeSignedDocument)\n/* harmony export */ });\n/* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui */ \"./src/ui.ts\");\n// sdk/src/umd.ts\n\n\n\n//# sourceURL=webpack://Quantidia/./src/umd.ts?\n}");
30
30
 
31
31
  /***/ })
32
32
 
@@ -1 +1 @@
1
- (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{addDocuments:()=>v,close:()=>D,init:()=>N,openSigning:()=>$,openSigningWithLogin:()=>Y});let n=null,r=null,o=null;function i(){n&&(n.style.display="flex")}function s(){n&&(n.style.display="none",r&&window.clearTimeout(r),o&&window.clearTimeout(o),r=null,o=null)}let a=null,c=null,d=null,u=null;function l(e){e&&(u={...u||{},...e||{}})}function p(e,t){if(!e||!t)return;const n={...u||{},view:a?.view??"full"};e.postMessage({source:"trusthub_sdk",type:"INIT",...n},t)}const f=new Map;function g(){return crypto.randomUUID()}const h=new Map;let y=null,m=null,w=null,b=!1;function I(){try{w&&(w.style.opacity="1")}catch{}}async function _(e){if(!e)throw new Error("file requerido");const t=crypto.randomUUID(),n=await async function(e){const t=await e.arrayBuffer();return new Uint8Array(t)}(e);return h.set(t,{id:t,name:e.name||"document.pdf",mime:e.type||"application/pdf",bytes:n,size:n.byteLength,createdAt:Date.now()}),t}async function v(e){const t=Array.from((FileList,e)),n=[];for(const e of t)n.push(await _(e));return n}const S=(...e)=>console.log("[Quantidia SDK]",...e);let E=0,k=null;function R(e,t){try{const n=`th-sdk-${e}-${t}`;if(document.getElementById(n))return;const r=document.createElement("link");r.id=n,r.rel=e,r.href=t,"preconnect"===e&&(r.crossOrigin="anonymous"),document.head.appendChild(r)}catch{}}function T(e){const t=function(e){try{return new URL(e,window.location.origin).origin}catch{return""}}(e);t&&(R("dns-prefetch",t),R("preconnect",t))}const O="es=s:1";function U(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function N(e){a={...e},Q(),T(e.baseUrl),S("init",e)}function x(e,t){Object.assign(e.style,t)}function A(){!function(){if(document.getElementById("th-sdk-loader-style"))return;const e=document.createElement("style");e.id="th-sdk-loader-style",e.textContent="\n .th-sdk-loader {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n background: rgba(255,255,255,.92);\n z-index: 1; /* debajo del botón close (zIndex 2) */\n pointer-events: auto;\n font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;\n }\n .th-sdk-spinner {\n width: 28px;\n height: 28px;\n border-radius: 999px;\n border: 3px solid rgba(0,0,0,.15);\n border-top-color: rgba(0,0,0,.75);\n animation: thsdkspin .9s linear infinite;\n }\n @keyframes thsdkspin { to { transform: rotate(360deg); } }\n .th-sdk-loader-text {\n font-size: 14px;\n color: rgba(0,0,0,.75);\n font-weight: 600;\n }\n ",document.head.appendChild(e)}();const e=document.createElement("div");x(e,{position:"fixed",inset:"0",background:"rgba(0,0,0,.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"2147483646"});const t=document.createElement("div");x(t,{position:"relative",width:"90%",height:"80%",maxWidth:"1000px",borderRadius:"12px",overflow:"hidden",background:"#fff",boxShadow:"0 10px 30px rgba(0,0,0,.3)"});const n=document.createElement("div");n.className="th-sdk-loader",n.innerHTML='<div class="th-sdk-spinner"></div><div class="th-sdk-loader-text">Loading Quantidia SDK…</div>';const r=document.createElement("button");r.type="button",r.setAttribute("aria-label","Close"),x(r,{position:"absolute",top:"20px",right:"18px",margin:"0",border:"0",cursor:"pointer",zIndex:"2",backgroundColor:"transparent",backgroundImage:"url('https://dev.trusthub.cloud/images/icons/Close.svg')",backgroundRepeat:"no-repeat",backgroundPosition:"center",width:"22px",height:"22px"}),r.innerHTML="",r.onclick=D;const o=document.createElement("iframe");return o.allow="hid; usb; serial; clipboard-read; clipboard-write; fullscreen",o.allowFullscreen=!0,o.referrerPolicy="strict-origin-when-cross-origin",x(o,{width:"100%",height:"100%",border:"0",opacity:"0",transition:"opacity .18s ease",background:"#fff"}),t.appendChild(o),t.appendChild(n),t.appendChild(r),e.appendChild(t),{bg:e,f:o,loader:n}}function D(){try{c?.remove()}catch{}c=null,d=null,n=null,w=null,b=!1,y=null,m=null,r&&window.clearTimeout(r),o&&window.clearTimeout(o),r=null,o=null,E=0,k=null}let L=null,P=0;const C=new Map;let M=null,j=null;function W(){return new Promise((e,t)=>{!function n(r,o){const i=new WebSocket(r),s=setTimeout(()=>{i.close(),o?n(o,null):t(new Error("Quantidia not available"))},3e3);i.onopen=()=>{clearTimeout(s),L=i,i.onclose=()=>{L=null},i.onmessage=e=>{try{const t=JSON.parse(e.data);if("pairing:challenge"===t.type)return void M?.postMessage({source:"trusthub",type:"QUANTIDIA_PAIRING",code:t.code},j);if("pairing:approved"===t.type)return void M?.postMessage({source:"trusthub",type:"QUANTIDIA_PAIRING",code:null},j);if("pairing:denied"===t.type)return C.forEach(e=>e.rej(new Error(t.error||"Pairing denied"))),C.clear(),L=null,void i.close();const n=C.get(t.id);if(!n)return;C.delete(t.id),t.ok?n.res(t.data):n.rej(new Error(t.error||"QC error"))}catch{}},e(i)},i.onerror=()=>{clearTimeout(s)}}("wss://127.0.0.1:8847","ws://127.0.0.1:8847")})}async function F(e){const t=e.data||{},{reqId:n,action:r,params:o}=t;function i(t,r,o){e.source?.postMessage({source:"trusthub",type:"QUANTIDIA_RESPONSE",reqId:n,ok:t,data:r,error:o},e.origin)}M=e.source,j=e.origin;try{let e;if("isAvailable"===r)try{await W(),e=!0}catch{e=!1}else e=await async function(e,t){L&&L.readyState===WebSocket.OPEN||(L=await W());const n="sdk-qc-"+ ++P;return new Promise((r,o)=>{C.set(n,{res:r,rej:o}),L.send(JSON.stringify({id:n,action:e,...t}))})}(r,o||{});i(!0,e)}catch(e){i(!1,void 0,e?.message||String(e))}}const q=new Map;function Q(){Q._bound||(Q._bound=!0,window.addEventListener("message",e=>{const t=e.data||{};if("trusthub_iframe"!==t.source||"INIT_REQUEST"!==t.type){if("trusthub_iframe"===t.source&&"TOKENS_UPDATED"===t.type){if(y&&e.source!==y)return;if(m&&e.origin!==m)return;return void l({t:"string"==typeof t?.t?t.t:void 0,rt:"string"==typeof t?.rt?t.rt:void 0,id:"string"==typeof t?.id?t.id:void 0,un:"string"==typeof t?.un?t.un:void 0})}if("trusthub_iframe"===t.source&&"UI_READY"===t.type){if(y&&e.source!==y)return;if(m&&e.origin!==m)return;return b=!1,I(),s(),void(E&&S("UI_READY in",Math.round(performance.now()-E),"ms","|",k||""))}if("trusthub_iframe"===t.source&&"DOC_REQUEST"===t.type){if(y&&e.source!==y)return;if(m&&e.origin!==m)return;const n=String(t.docId||""),r=h.get(n);if(!r)return void e.source?.postMessage({source:"trusthub_sdk",type:"DOC_ERROR",docId:n,error:"DOC_NOT_FOUND"},e.origin);const o=new Uint8Array(r.bytes).buffer;return void e.source?.postMessage({source:"trusthub_sdk",type:"DOC_DATA",docId:n,name:r.name,mime:r.mime,buffer:o},e.origin,[o])}if("trusthub_iframe"!==t.source||"NEXU_REQUEST"!==t.type)if("trusthub_iframe"!==t.source||"QUANTIDIA_REQUEST"!==t.type)if("trusthub_iframe"!==t.source||"FORTIFY_WS_OPEN"!==t.type){if("trusthub_iframe"===t.source&&"FORTIFY_WS_SEND"===t.type){const e=q.get(t.sessionId);if(e?.ws.readyState===WebSocket.OPEN)try{e.ws.send(t.data)}catch{}return}if("trusthub_iframe"===t.source&&"FORTIFY_WS_CLOSE"===t.type){const e=q.get(t.sessionId);if(e)try{e.ws.close()}catch{}return}if("trusthub_iframe"===t.source&&"SIGNED_DOCS"===t.type){if(y&&e.source!==y)return;if(m&&e.origin!==m)return;const n=Array.isArray(t.docs)?t.docs:[],r=[];for(const e of n){const t=e?.buffer instanceof ArrayBuffer?e.buffer:null;if(!t)continue;const n=g(),o=new Uint8Array(t),i={id:n,name:String(e.name||"signed.pdf"),mime:String(e.mime||"application/pdf"),size:o.byteLength,createdAt:Date.now(),sourceDocId:"string"==typeof e.sourceDocId?e.sourceDocId:void 0};f.set(n,{...i,bytes:o}),r.push(i)}return S("SIGNED_DOCS stored:",r),void(u={...u||{},_signed:r})}if("trusthub"===t.source)if(S("message from iframe:",t),"TRUSTHUB_DONE"===t.type){const e=Array.from(f.values()).map(({bytes:e,...t})=>t),n=d;D(),n?.resolve({status:"signed",...t.data,signed:e})}else if("TRUSTHUB_CANCELLED"===t.type){const e=d,n=t?.data?.reason;D(),e?.reject({status:"expired"===n?"expired":"cancelled"})}else if("TRUSTHUB_ERROR"===t.type){const e=d;D(),e?.reject({status:"error",...t.data})}}else!function(e){const t=e.data||{},n=t.sessionId,r=t.url||"wss://127.0.0.1:1337",o=e.source,i=e.origin;!function e(t){try{const r=new WebSocket(t);q.set(n,{ws:r,src:o,origin:i}),r.onopen=()=>o.postMessage({source:"trusthub",type:"FORTIFY_WS_OPENED",sessionId:n},i),r.onmessage=e=>{const t=e.data;t instanceof ArrayBuffer?o.postMessage({source:"trusthub",type:"FORTIFY_WS_MESSAGE",sessionId:n,binary:!0,data:t},i,[t]):o.postMessage({source:"trusthub",type:"FORTIFY_WS_MESSAGE",sessionId:n,binary:!1,data:t},i)},r.onclose=e=>{q.delete(n),o.postMessage({source:"trusthub",type:"FORTIFY_WS_CLOSED",sessionId:n,code:e.code,reason:e.reason},i)},r.onerror=()=>{q.delete(n),t.startsWith("wss://")?e(t.replace("wss://","ws://")):o.postMessage({source:"trusthub",type:"FORTIFY_WS_ERROR",sessionId:n,error:"connection failed"},i)}}catch(e){o.postMessage({source:"trusthub",type:"FORTIFY_WS_ERROR",sessionId:n,error:e?.message||"error"},i)}}(r)}(e);else F(e);else!async function(e){const t=e.data||{},n=t.kind;try{if(!a)throw new Error("SDK no inicializado");let r=null;if(n&&"cert"!==n){if("sign"===n){const e=a.quantidiaJava?.sign||a.quantidiaJava?.certificates;if(!e)throw new Error("quantidiaJava.sign no configurado en SDK");r=await fetch(e,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t.body||{})})}}else{const e=a.quantidiaJava?.certificates;if(!e)throw new Error("quantidiaJava.certificates no configurado en SDK");r=await fetch(e,{method:"GET",mode:"cors"})}if(!r)throw new Error(`Nexu kind desconocido: ${n??"undefined"}`);if(!r.ok)throw new Error(`HTTP ${r.status}`);const o=r.headers.get("content-type")||"",i=await r.text(),s=o.includes("application/json")&&i?JSON.parse(i):i;e.source?.postMessage({source:"trusthub",type:"NEXU_RESPONSE",kind:n||"cert",data:s},e.origin)}catch(t){e.source?.postMessage({source:"trusthub",type:"NEXU_ERROR",kind:n||"cert",error:t?.message||String(t)},e.origin)}}(e)}else{if(y&&e.source!==y)return;if(m&&e.origin!==m)return;p(e.source,e.origin)}}),window.addEventListener("keydown",e=>{"Escape"===e.key&&D()}))}function B({path:e,qs:t,initMsg:r}){if(!a)throw new Error("init() primero");f.clear();const d=a.view??"full";t.view=t.view??d;const u={...r||{},view:d};l(u);const{baseUrl:g}=a,h=a.quantidiaJava?.force;T(g);const{bg:_,f:v,loader:S}=A();n=S,i(),c=_,document.body.appendChild(_),y=v.contentWindow,m=new URL(g).origin;!(!h&&function(){try{const e=document?.permissionsPolicy?.allowsFeature?.("usb");if("boolean"==typeof e)return e}catch{}return!0}()&&function(){try{const e=document?.permissionsPolicy?.allowsFeature?.("hid");if("boolean"==typeof e)return e}catch{}return!0}()&&function(){try{return!0===window.isSecureContext}catch{return!1}}())&&(t.forceNexu="1"),t.embed="1",t.parent=location.origin;let R=function(e,t,n){const r=new URL(e);return t&&(r.pathname=t),r.searchParams.set("integration","true"),r.searchParams.set("sdk","1"),Object.entries(n).forEach(([e,t])=>{null!=t&&""!==t&&r.searchParams.set(e,String(t))}),r.toString()}(g,e,t);u?.t&&(R+=`#t=${encodeURIComponent(u.t)}`),E=performance.now(),k=R,async function(e){try{await fetch(e,{mode:"no-cors",cache:"force-cache"})}catch{}}(R.split("#")[0]),w=v,b=!1;const O=(e||"").includes("/sign"),U=!!t.docId||!!t.docIds;(O||U)&&(b=!0),function(){try{w&&(w.style.opacity="0")}catch{}}(),i(),v.src=R;try{v.contentWindow?.postMessage({source:"trusthub_sdk",type:"SIGN_START",docId:t.docId||null,docIds:t.docIds?String(t.docIds).split(",").filter(Boolean):null,rect:t.page&&t.x&&t.y?{page:Number(t.page),x:Number(t.x),y:Number(t.y),w:t.w?Number(t.w):void 0,h:t.h?Number(t.h):void 0}:null},m||new URL(g).origin)}catch{}v.addEventListener("load",()=>{y=v.contentWindow,m=new URL(g).origin;try{v.contentWindow?.postMessage({source:"trusthub_sdk",type:"SIGN_START",docId:t.docId||null,docIds:t.docIds?String(t.docIds).split(",").filter(Boolean):null,rect:t.page&&t.x&&t.y?{page:Number(t.page),x:Number(t.x),y:Number(t.y),w:t.w?Number(t.w):void 0,h:t.h?Number(t.h):void 0}:null},m||new URL(g).origin)}catch{}},{once:!0}),o=window.setTimeout(()=>{I(),s(),b=!1},15e3);const N=new URL(g).origin;v.addEventListener("load",()=>{let e=!1;const t=n=>{const r=n.data||{};n.origin===N&&"trusthub_iframe"===r?.source&&"INIT_ACK"===r?.type&&(e=!0,window.removeEventListener("message",t))};window.addEventListener("message",t);let n=0;const r=window.setInterval(()=>{if(e||n>20)return window.clearInterval(r),void window.removeEventListener("message",t);n++,p(v.contentWindow,N)},250)})}async function J(e,t){S("POST",e,t);const n=new Headers;var r,o;n.set("Content-Type","application/json"),n.set("tracestate",O),n.set("baggage",(r="sdk",o=function(e){try{const t=new URL(e,window.location.origin).pathname;return t.includes("/auth/")?"auth":t.includes("/sign/")?"sign":t.includes("/verify/")?"verify":t.includes("/timestamp/")?"timestamp":"sdk"}catch{return"sdk"}}(e),`tenant=trusthub,channel=${r},operation=${o}`)),n.set("traceparent",`00-${U(16)}-${U(8)}-01`);const i=await fetch(e,{method:"POST",mode:"cors",credentials:"include",headers:n,body:JSON.stringify(t)}),s=i.headers.get("content-type")||"";let a=null;try{s.includes("application/json")&&(a=await i.clone().json())}catch{}if(S("POST result",i.status,a||"(no-json)"),!i.ok)throw new Error(`HTTP ${i.status}`);return a||{}}async function Y(e){if(!a)throw new Error("init() primero");const t="headersOverride"in e?function(e){if(!e)return null;const t=String(e).split(",")[0]?.trim();if(!t)return null;const n=t.replace(/_/g,"-").toLowerCase();return n.startsWith("es")?"es-AR":n.startsWith("it")?"it-IT":n.startsWith("en")?"en-US":null}(e.headersOverride?.acceptLanguage):null,n=`${a.apiBase||new URL(a.baseUrl).origin}/api/rest/core/auth/login`,r={};if("authLogin"in e&&e.authLogin)r.authLogin=e.authLogin;else{const{username:t,password:n,environmentId:o,companyId:i,agencyId:s}=e;r.username=t,r.password=n,o&&(r.environmentId=o),i&&(r.companyId=i),s&&(r.agencyId=s)}"headersOverride"in e&&e.headersOverride&&(r.headersOverride=e.headersOverride);const o=await J(n,r).catch(e=>(S("login error:",e),null)),i=o?.ok||o?.success||o?.data?.success||o?.data?.data?.success,s=o?.data?.data?.oidc?.access_token||o?.data?.oidc?.access_token||o?.oidc?.access_token||o?.access_token,c=o?.data?.data?.oidc?.refresh_token||o?.data?.oidc?.refresh_token||o?.oidc?.refresh_token||o?.refresh_token,u=o?.data?.data?.oidc?.id_token||o?.data?.oidc?.id_token||o?.oidc?.id_token||o?.id_token,l=o?.user?.name||o?.id_tokenDecoded?.name||o?.id_tokenDecoded?.preferred_username||void 0;S("login ok?",i,"| access_token?",!!s,"| displayName?",l);const p={sdk:"1",integration:"true"};t&&(p.lng=t),"docId"in e&&e.docId&&(p.docId=e.docId),"docIds"in e&&e.docIds?.length&&(p.docIds=e.docIds.join(",")),"pdfUrl"in e&&e.pdfUrl&&(p.pdfUrl=e.pdfUrl),"signatureRect"in e&&e.signatureRect&&Object.assign(p,e.signatureRect),l&&(p.un=l);B({path:i?"/integration/dashboard/sign":"/integration/login",qs:p,initMsg:s?{t:s,rt:c,id:u,un:l}:void 0});return new Promise((e,t)=>d={resolve:e,reject:t})}function $(e){if(!a)throw new Error("init() primero");const t={};e.pdfUrl&&(t.pdfUrl=e.pdfUrl),e.signatureRect&&Object.assign(t,e.signatureRect);const n=new Promise((e,t)=>d={resolve:e,reject:t});return B({path:null,qs:t}),n}window.Quantidia=t})();
1
+ (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{addDocument:()=>k,addDocuments:()=>R,clearDocuments:()=>O,clearSignedDocuments:()=>w,close:()=>W,getSignedDocumentBytes:()=>m,init:()=>C,listSignedDocuments:()=>h,openSigning:()=>V,openSigningWithLogin:()=>X,removeDocument:()=>T,removeSignedDocument:()=>y});let n=null,r=null,o=null;function i(){n&&(n.style.display="flex")}function s(){n&&(n.style.display="none",r&&window.clearTimeout(r),o&&window.clearTimeout(o),r=null,o=null)}let a=null,c=null,d=null,u=null;function l(e){e&&(u={...u||{},...e||{}})}function f(e,t){if(!e||!t)return;const n={...u||{},view:a?.view??"full"};e.postMessage({source:"trusthub_sdk",type:"INIT",...n},t)}const p=new Map;function g(){return crypto.randomUUID()}function h(){return Array.from(p.values()).map(({bytes:e,...t})=>t)}function m(e){const t=p.get(e);return t?new Uint8Array(t.bytes):null}function y(e){p.delete(e)}function w(){p.clear()}const b=new Map;let I=null,S=null,v=null,_=!1;function E(){try{v&&(v.style.opacity="1")}catch{}}async function k(e){if(!e)throw new Error("file requerido");const t=crypto.randomUUID(),n=await async function(e){const t=await e.arrayBuffer();return new Uint8Array(t)}(e);return b.set(t,{id:t,name:e.name||"document.pdf",mime:e.type||"application/pdf",bytes:n,size:n.byteLength,createdAt:Date.now()}),t}async function R(e){const t=Array.from((FileList,e)),n=[];for(const e of t)n.push(await k(e));return n}function T(e){b.delete(e)}function O(){b.clear()}const U=(...e)=>console.log("[Quantidia SDK]",...e);let N=0,D=null;function x(e,t){try{const n=`th-sdk-${e}-${t}`;if(document.getElementById(n))return;const r=document.createElement("link");r.id=n,r.rel=e,r.href=t,"preconnect"===e&&(r.crossOrigin="anonymous"),document.head.appendChild(r)}catch{}}function A(e){const t=function(e){try{return new URL(e,window.location.origin).origin}catch{return""}}(e);t&&(x("dns-prefetch",t),x("preconnect",t))}const L="es=s:1";function P(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function C(e){a={...e},z(),A(e.baseUrl),U("init",e)}function M(e,t){Object.assign(e.style,t)}function j(){!function(){if(document.getElementById("th-sdk-loader-style"))return;const e=document.createElement("style");e.id="th-sdk-loader-style",e.textContent="\n .th-sdk-loader {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n background: rgba(255,255,255,.92);\n z-index: 1; /* debajo del botón close (zIndex 2) */\n pointer-events: auto;\n font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;\n }\n .th-sdk-spinner {\n width: 28px;\n height: 28px;\n border-radius: 999px;\n border: 3px solid rgba(0,0,0,.15);\n border-top-color: rgba(0,0,0,.75);\n animation: thsdkspin .9s linear infinite;\n }\n @keyframes thsdkspin { to { transform: rotate(360deg); } }\n .th-sdk-loader-text {\n font-size: 14px;\n color: rgba(0,0,0,.75);\n font-weight: 600;\n }\n ",document.head.appendChild(e)}();const e=document.createElement("div");M(e,{position:"fixed",inset:"0",background:"rgba(0,0,0,.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"2147483646"});const t=document.createElement("div");M(t,{position:"relative",width:"90%",height:"80%",maxWidth:"1000px",borderRadius:"12px",overflow:"hidden",background:"#fff",boxShadow:"0 10px 30px rgba(0,0,0,.3)"});const n=document.createElement("div");n.className="th-sdk-loader",n.innerHTML='<div class="th-sdk-spinner"></div><div class="th-sdk-loader-text">Loading Quantidia SDK…</div>';const r=document.createElement("button");r.type="button",r.setAttribute("aria-label","Close"),M(r,{position:"absolute",top:"20px",right:"18px",margin:"0",border:"0",cursor:"pointer",zIndex:"2",backgroundColor:"transparent",backgroundImage:"url('https://dev.trusthub.cloud/images/icons/Close.svg')",backgroundRepeat:"no-repeat",backgroundPosition:"center",width:"22px",height:"22px"}),r.innerHTML="",r.onclick=W;const o=document.createElement("iframe");return o.allow="hid; usb; serial; clipboard-read; clipboard-write; fullscreen",o.allowFullscreen=!0,o.referrerPolicy="strict-origin-when-cross-origin",M(o,{width:"100%",height:"100%",border:"0",opacity:"0",transition:"opacity .18s ease",background:"#fff"}),t.appendChild(o),t.appendChild(n),t.appendChild(r),e.appendChild(t),{bg:e,f:o,loader:n}}function W(){try{c?.remove()}catch{}c=null,d=null,n=null,v=null,_=!1,I=null,S=null,r&&window.clearTimeout(r),o&&window.clearTimeout(o),r=null,o=null,N=0,D=null}let F=null,q=0;const Q=new Map;let B=null,J=null;function Y(){return new Promise((e,t)=>{!function n(r,o){const i=new WebSocket(r),s=setTimeout(()=>{i.close(),o?n(o,null):t(new Error("Quantidia not available"))},3e3);i.onopen=()=>{clearTimeout(s),F=i,i.onclose=()=>{F=null},i.onmessage=e=>{try{const t=JSON.parse(e.data);if("pairing:challenge"===t.type)return void B?.postMessage({source:"trusthub",type:"QUANTIDIA_PAIRING",code:t.code},J);if("pairing:approved"===t.type)return void B?.postMessage({source:"trusthub",type:"QUANTIDIA_PAIRING",code:null},J);if("pairing:denied"===t.type)return Q.forEach(e=>e.rej(new Error(t.error||"Pairing denied"))),Q.clear(),F=null,void i.close();const n=Q.get(t.id);if(!n)return;Q.delete(t.id),t.ok?n.res(t.data):n.rej(new Error(t.error||"QC error"))}catch{}},e(i)},i.onerror=()=>{clearTimeout(s)}}("wss://127.0.0.1:8847","ws://127.0.0.1:8847")})}async function $(e){const t=e.data||{},{reqId:n,action:r,params:o}=t;function i(t,r,o){e.source?.postMessage({source:"trusthub",type:"QUANTIDIA_RESPONSE",reqId:n,ok:t,data:r,error:o},e.origin)}B=e.source,J=e.origin;try{let e;if("isAvailable"===r)try{await Y(),e=!0}catch{e=!1}else e=await async function(e,t){F&&F.readyState===WebSocket.OPEN||(F=await Y());const n="sdk-qc-"+ ++q;return new Promise((r,o)=>{Q.set(n,{res:r,rej:o}),F.send(JSON.stringify({id:n,action:e,...t}))})}(r,o||{});i(!0,e)}catch(e){i(!1,void 0,e?.message||String(e))}}const G=new Map;function z(){z._bound||(z._bound=!0,window.addEventListener("message",e=>{const t=e.data||{};if("trusthub_iframe"!==t.source||"INIT_REQUEST"!==t.type){if("trusthub_iframe"===t.source&&"TOKENS_UPDATED"===t.type){if(I&&e.source!==I)return;if(S&&e.origin!==S)return;return void l({t:"string"==typeof t?.t?t.t:void 0,rt:"string"==typeof t?.rt?t.rt:void 0,id:"string"==typeof t?.id?t.id:void 0,un:"string"==typeof t?.un?t.un:void 0})}if("trusthub_iframe"===t.source&&"UI_READY"===t.type){if(I&&e.source!==I)return;if(S&&e.origin!==S)return;return _=!1,E(),s(),void(N&&U("UI_READY in",Math.round(performance.now()-N),"ms","|",D||""))}if("trusthub_iframe"===t.source&&"DOC_REQUEST"===t.type){if(I&&e.source!==I)return;if(S&&e.origin!==S)return;const n=String(t.docId||""),r=b.get(n);if(!r)return void e.source?.postMessage({source:"trusthub_sdk",type:"DOC_ERROR",docId:n,error:"DOC_NOT_FOUND"},e.origin);const o=new Uint8Array(r.bytes).buffer;return void e.source?.postMessage({source:"trusthub_sdk",type:"DOC_DATA",docId:n,name:r.name,mime:r.mime,buffer:o},e.origin,[o])}if("trusthub_iframe"!==t.source||"NEXU_REQUEST"!==t.type)if("trusthub_iframe"!==t.source||"QUANTIDIA_REQUEST"!==t.type)if("trusthub_iframe"!==t.source||"FORTIFY_WS_OPEN"!==t.type){if("trusthub_iframe"===t.source&&"FORTIFY_WS_SEND"===t.type){const e=G.get(t.sessionId);if(e?.ws.readyState===WebSocket.OPEN)try{e.ws.send(t.data)}catch{}return}if("trusthub_iframe"===t.source&&"FORTIFY_WS_CLOSE"===t.type){const e=G.get(t.sessionId);if(e)try{e.ws.close()}catch{}return}if("trusthub_iframe"===t.source&&"SIGNED_DOCS"===t.type){if(I&&e.source!==I)return;if(S&&e.origin!==S)return;const n=Array.isArray(t.docs)?t.docs:[],r=[];for(const e of n){const t=e?.buffer instanceof ArrayBuffer?e.buffer:null;if(!t)continue;const n=g(),o=new Uint8Array(t),i={id:n,name:String(e.name||"signed.pdf"),mime:String(e.mime||"application/pdf"),size:o.byteLength,createdAt:Date.now(),sourceDocId:"string"==typeof e.sourceDocId?e.sourceDocId:void 0};p.set(n,{...i,bytes:o}),r.push(i)}return U("SIGNED_DOCS stored:",r),void(u={...u||{},_signed:r})}if("trusthub"===t.source)if(U("message from iframe:",t),"TRUSTHUB_DONE"===t.type){const e=h(),n=d;W(),n?.resolve({status:"signed",...t.data,signed:e})}else if("TRUSTHUB_CANCELLED"===t.type){const e=d,n=t?.data?.reason;W(),e?.reject({status:"expired"===n?"expired":"cancelled"})}else if("TRUSTHUB_ERROR"===t.type){const e=d;W(),e?.reject({status:"error",...t.data})}}else!function(e){const t=e.data||{},n=t.sessionId,r=t.url||"wss://127.0.0.1:1337",o=e.source,i=e.origin;!function e(t){try{const r=new WebSocket(t);G.set(n,{ws:r,src:o,origin:i}),r.onopen=()=>o.postMessage({source:"trusthub",type:"FORTIFY_WS_OPENED",sessionId:n},i),r.onmessage=e=>{const t=e.data;t instanceof ArrayBuffer?o.postMessage({source:"trusthub",type:"FORTIFY_WS_MESSAGE",sessionId:n,binary:!0,data:t},i,[t]):o.postMessage({source:"trusthub",type:"FORTIFY_WS_MESSAGE",sessionId:n,binary:!1,data:t},i)},r.onclose=e=>{G.delete(n),o.postMessage({source:"trusthub",type:"FORTIFY_WS_CLOSED",sessionId:n,code:e.code,reason:e.reason},i)},r.onerror=()=>{G.delete(n),t.startsWith("wss://")?e(t.replace("wss://","ws://")):o.postMessage({source:"trusthub",type:"FORTIFY_WS_ERROR",sessionId:n,error:"connection failed"},i)}}catch(e){o.postMessage({source:"trusthub",type:"FORTIFY_WS_ERROR",sessionId:n,error:e?.message||"error"},i)}}(r)}(e);else $(e);else!async function(e){const t=e.data||{},n=t.kind;try{if(!a)throw new Error("SDK no inicializado");let r=null;if(n&&"cert"!==n){if("sign"===n){const e=a.quantidiaJava?.sign||a.quantidiaJava?.certificates;if(!e)throw new Error("quantidiaJava.sign no configurado en SDK");r=await fetch(e,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t.body||{})})}}else{const e=a.quantidiaJava?.certificates;if(!e)throw new Error("quantidiaJava.certificates no configurado en SDK");r=await fetch(e,{method:"GET",mode:"cors"})}if(!r)throw new Error(`Nexu kind desconocido: ${n??"undefined"}`);if(!r.ok)throw new Error(`HTTP ${r.status}`);const o=r.headers.get("content-type")||"",i=await r.text(),s=o.includes("application/json")&&i?JSON.parse(i):i;e.source?.postMessage({source:"trusthub",type:"NEXU_RESPONSE",kind:n||"cert",data:s},e.origin)}catch(t){e.source?.postMessage({source:"trusthub",type:"NEXU_ERROR",kind:n||"cert",error:t?.message||String(t)},e.origin)}}(e)}else{if(I&&e.source!==I)return;if(S&&e.origin!==S)return;f(e.source,e.origin)}}),window.addEventListener("keydown",e=>{"Escape"===e.key&&W()}))}function H({path:e,qs:t,initMsg:r}){if(!a)throw new Error("init() primero");w();const d=a.view??"full";t.view=t.view??d;const u={...r||{},view:d};l(u);const{baseUrl:p}=a,g=a.quantidiaJava?.force;A(p);const{bg:h,f:m,loader:y}=j();n=y,i(),c=h,document.body.appendChild(h),I=m.contentWindow,S=new URL(p).origin;!(!g&&function(){try{const e=document?.permissionsPolicy?.allowsFeature?.("usb");if("boolean"==typeof e)return e}catch{}return!0}()&&function(){try{const e=document?.permissionsPolicy?.allowsFeature?.("hid");if("boolean"==typeof e)return e}catch{}return!0}()&&function(){try{return!0===window.isSecureContext}catch{return!1}}())&&(t.forceNexu="1"),t.embed="1",t.parent=location.origin;let b=function(e,t,n){const r=new URL(e);return t&&(r.pathname=t),r.searchParams.set("integration","true"),r.searchParams.set("sdk","1"),Object.entries(n).forEach(([e,t])=>{null!=t&&""!==t&&r.searchParams.set(e,String(t))}),r.toString()}(p,e,t);u?.t&&(b+=`#t=${encodeURIComponent(u.t)}`),N=performance.now(),D=b,async function(e){try{await fetch(e,{mode:"no-cors",cache:"force-cache"})}catch{}}(b.split("#")[0]),v=m,_=!1;const k=(e||"").includes("/sign"),R=!!t.docId||!!t.docIds;(k||R)&&(_=!0),function(){try{v&&(v.style.opacity="0")}catch{}}(),i(),m.src=b;try{m.contentWindow?.postMessage({source:"trusthub_sdk",type:"SIGN_START",docId:t.docId||null,docIds:t.docIds?String(t.docIds).split(",").filter(Boolean):null,rect:t.page&&t.x&&t.y?{page:Number(t.page),x:Number(t.x),y:Number(t.y),w:t.w?Number(t.w):void 0,h:t.h?Number(t.h):void 0}:null},S||new URL(p).origin)}catch{}m.addEventListener("load",()=>{I=m.contentWindow,S=new URL(p).origin;try{m.contentWindow?.postMessage({source:"trusthub_sdk",type:"SIGN_START",docId:t.docId||null,docIds:t.docIds?String(t.docIds).split(",").filter(Boolean):null,rect:t.page&&t.x&&t.y?{page:Number(t.page),x:Number(t.x),y:Number(t.y),w:t.w?Number(t.w):void 0,h:t.h?Number(t.h):void 0}:null},S||new URL(p).origin)}catch{}},{once:!0}),o=window.setTimeout(()=>{E(),s(),_=!1},15e3);const T=new URL(p).origin;m.addEventListener("load",()=>{let e=!1;const t=n=>{const r=n.data||{};n.origin===T&&"trusthub_iframe"===r?.source&&"INIT_ACK"===r?.type&&(e=!0,window.removeEventListener("message",t))};window.addEventListener("message",t);let n=0;const r=window.setInterval(()=>{if(e||n>20)return window.clearInterval(r),void window.removeEventListener("message",t);n++,f(m.contentWindow,T)},250)})}async function K(e,t){U("POST",e,t);const n=new Headers;var r,o;n.set("Content-Type","application/json"),n.set("tracestate",L),n.set("baggage",(r="sdk",o=function(e){try{const t=new URL(e,window.location.origin).pathname;return t.includes("/auth/")?"auth":t.includes("/sign/")?"sign":t.includes("/verify/")?"verify":t.includes("/timestamp/")?"timestamp":"sdk"}catch{return"sdk"}}(e),`tenant=trusthub,channel=${r},operation=${o}`)),n.set("traceparent",`00-${P(16)}-${P(8)}-01`);const i=await fetch(e,{method:"POST",mode:"cors",credentials:"include",headers:n,body:JSON.stringify(t)}),s=i.headers.get("content-type")||"";let a=null;try{s.includes("application/json")&&(a=await i.clone().json())}catch{}if(U("POST result",i.status,a||"(no-json)"),!i.ok)throw new Error(`HTTP ${i.status}`);return a||{}}async function X(e){if(!a)throw new Error("init() primero");const t="headersOverride"in e?function(e){if(!e)return null;const t=String(e).split(",")[0]?.trim();if(!t)return null;const n=t.replace(/_/g,"-").toLowerCase();return n.startsWith("es")?"es-AR":n.startsWith("it")?"it-IT":n.startsWith("en")?"en-US":null}(e.headersOverride?.acceptLanguage):null,n=`${a.apiBase||new URL(a.baseUrl).origin}/api/rest/core/auth/login`,r={};if("authLogin"in e&&e.authLogin)r.authLogin=e.authLogin;else{const{username:t,password:n,environmentId:o,companyId:i,agencyId:s}=e;r.username=t,r.password=n,o&&(r.environmentId=o),i&&(r.companyId=i),s&&(r.agencyId=s)}"headersOverride"in e&&e.headersOverride&&(r.headersOverride=e.headersOverride);const o=await K(n,r).catch(e=>(U("login error:",e),null)),i=o?.ok||o?.success||o?.data?.success||o?.data?.data?.success,s=o?.data?.data?.oidc?.access_token||o?.data?.oidc?.access_token||o?.oidc?.access_token||o?.access_token,c=o?.data?.data?.oidc?.refresh_token||o?.data?.oidc?.refresh_token||o?.oidc?.refresh_token||o?.refresh_token,u=o?.data?.data?.oidc?.id_token||o?.data?.oidc?.id_token||o?.oidc?.id_token||o?.id_token,l=o?.user?.name||o?.id_tokenDecoded?.name||o?.id_tokenDecoded?.preferred_username||void 0;U("login ok?",i,"| access_token?",!!s,"| displayName?",l);const f={sdk:"1",integration:"true"};t&&(f.lng=t),"docId"in e&&e.docId&&(f.docId=e.docId),"docIds"in e&&e.docIds?.length&&(f.docIds=e.docIds.join(",")),"pdfUrl"in e&&e.pdfUrl&&(f.pdfUrl=e.pdfUrl),"signatureRect"in e&&e.signatureRect&&Object.assign(f,e.signatureRect),l&&(f.un=l);H({path:i?"/integration/dashboard/sign":"/integration/login",qs:f,initMsg:s?{t:s,rt:c,id:u,un:l}:void 0});return new Promise((e,t)=>d={resolve:e,reject:t})}function V(e){if(!a)throw new Error("init() primero");const t={};e.pdfUrl&&(t.pdfUrl=e.pdfUrl),e.signatureRect&&Object.assign(t,e.signatureRect);const n=new Promise((e,t)=>d={resolve:e,reject:t});return H({path:null,qs:t}),n}window.Quantidia=t})();
package/dist/src/umd.d.ts CHANGED
@@ -1 +1 @@
1
- export { init, openSigningWithLogin, openSigning, addDocuments, close } from "./ui";
1
+ export { init, openSigningWithLogin, openSigning, addDocument, addDocuments, removeDocument, clearDocuments, listSignedDocuments, getSignedDocumentBytes, removeSignedDocument, clearSignedDocuments, close, } from "./ui";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantidia/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.3",
4
4
  "description": "Quantidia SDK for digital signature integrations (Fortify, Nexu, cloud signing)",
5
5
  "type": "module",
6
6
  "main": "./dist/quantidia-sdk.cjs",