@prosopo/client-bundle-example 2.8.1 → 2.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @prosopo/client-bundle-example
2
2
 
3
+ ## 2.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bc892fa: lint
8
+
3
9
  ## 2.8.1
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- import"./captcha-ByKnSsbG.js";import{render as d}from"http://localhost:9269/procaptcha.bundle.js";window.onCaptchaFailed=function(){console.log("Challenge failed"),updateCaptchaStatus("Challenge failed - CAPTCHA verification could not be completed","error")};window.addEventListener("load",()=>{updateCaptchaStatus("Page loaded - Initializing CAPTCHA system","info"),window.setIsError=s=>{const t=document.getElementById("messageContainer");t.style.color=s?"red":"black",t.style.display="block"},window.setMessage=s=>{document.getElementById("message").innerText=s},window.onLoggedIn=s=>{updateCaptchaStatus("Logged in, fetching private resource","info");const t=new URL("/private",config.serverUrl).href;console.log("getting private resource with token ",s,"at",t),fetch(t,{method:"GET",headers:{Origin:"http://localhost:9232","Content-Type":"application/json",Authorization:`Bearer ${s}`}}).then(async e=>{try{const a=await e.json();e.status===200?(updateCaptchaStatus("Successfully accessed private resource","success"),setMessage(a.message)):updateCaptchaStatus(`Failed to access private resource: ${e.status}`,"error")}catch(a){console.log(a),updateCaptchaStatus(`Error parsing response: ${a}`,"error")}}).catch(e=>{console.log(e),updateCaptchaStatus(`Fetch error: ${e}`,"error")})},window.onActionHandler=()=>{updateCaptchaStatus("Form submission initiated","info");const s=document.getElementsByName("procaptcha-response");if(!s.length){updateCaptchaStatus("Error: No CAPTCHA response found","error"),alert("Must complete captcha");return}const t=s[0].value;updateCaptchaStatus(`Token received: ${t.substring(0,15)}...`,"success");const e={email:document.getElementById("email").value,name:document.getElementById("name").value,password:document.getElementById("password").value,"procaptcha-response":t},a=new URL("signup",void 0).href;console.log("posting to",a,"with payload",e),fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),contentType:"application/json"}).then(o=>new Promise(n=>o.json().then(r=>n({status:o.status,ok:o.ok,json:r})))).then(async({status:o,json:n,ok:r})=>{console.log("status",o,"json",n.message,"ok",r),console.log("json",n);try{o!==200?(updateCaptchaStatus(`API Error: ${n.message}`,"error"),setIsError(!0),setMessage(n.message)):(updateCaptchaStatus(`API Success: ${n.message}`,"success"),setIsError(!1),setMessage(n.message))}catch(i){console.log(i),updateCaptchaStatus(`Error processing response: ${i}`,"error")}}).catch(o=>{console.log(o),updateCaptchaStatus(`Fetch error: ${o}`,"error"),setIsError(!0),setMessage("Error: "+o)})};const c=new MutationObserver(s=>{s.forEach(t=>{if(t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){const a=t.addedNodes[e];if(a.classList&&(a.classList.contains("procaptcha")||a.querySelector&&a.querySelector(".procaptcha"))){updateCaptchaStatus("CAPTCHA DOM elements initialized","info"),c.disconnect();break}}})});c.observe(document.body,{childList:!0,subtree:!0})});function l(c){console.log("Challenge passed"),window.updateCaptchaStatus("Challenge passed successfully!","success"),window.updateCaptchaStatus(`Token generated: ${c.substring(0,15)}...`,"success")}const p=document.getElementById("procaptcha-container");window.updateCaptchaStatus("Initializing CAPTCHA with explicit render call","info");const u=d(p,{siteKey:"undefined",captchaType:"frictionless",callback:l,"failed-callback":function(){console.log("Challenge failed"),window.updateCaptchaStatus("Challenge failed - CAPTCHA verification could not be completed","error")}});window.updateCaptchaStatus("CAPTCHA render function called with widget ID: "+u,"info");
1
+ import"./captcha-ByKnSsbG.js";import{render as l}from"http://localhost:9269/procaptcha.bundle.js";window.onCaptchaFailed=function(){console.log("Challenge failed"),updateCaptchaStatus("Challenge failed - CAPTCHA verification could not be completed","error")};window.addEventListener("load",()=>{updateCaptchaStatus("Page loaded - Initializing CAPTCHA system","info"),window.setIsError=s=>{const t=document.getElementById("messageContainer");t.style.color=s?"red":"black",t.style.display="block"},window.setMessage=s=>{document.getElementById("message").innerText=s},window.onLoggedIn=s=>{updateCaptchaStatus("Logged in, fetching private resource","info");const t=new URL("/private",config.serverUrl).href;console.log("getting private resource with token ",s,"at",t),fetch(t,{method:"GET",headers:{Origin:"http://localhost:9232","Content-Type":"application/json",Authorization:`Bearer ${s}`}}).then(async e=>{try{const a=await e.json();e.status===200?(updateCaptchaStatus("Successfully accessed private resource","success"),setMessage(a.message)):updateCaptchaStatus(`Failed to access private resource: ${e.status}`,"error")}catch(a){console.log(a),updateCaptchaStatus(`Error parsing response: ${a}`,"error")}}).catch(e=>{console.log(e),updateCaptchaStatus(`Fetch error: ${e}`,"error")})},window.onActionHandler=()=>{updateCaptchaStatus("Form submission initiated","info");const s=document.getElementsByName("procaptcha-response");if(!s.length){updateCaptchaStatus("Error: No CAPTCHA response found","error"),alert("Must complete captcha");return}const t=s[0].value;updateCaptchaStatus(`Token received: ${t.substring(0,15)}...`,"success");const e={email:document.getElementById("email").value,name:document.getElementById("name").value,password:document.getElementById("password").value,"procaptcha-response":t},a=new URL("signup",void 0).href;console.log("posting to",a,"with payload",e),fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),contentType:"application/json"}).then(o=>new Promise(n=>o.json().then(r=>n({status:o.status,ok:o.ok,json:r})))).then(async({status:o,json:n,ok:r})=>{console.log("status",o,"json",n.message,"ok",r),console.log("json",n);try{o!==200?(updateCaptchaStatus(`API Error: ${n.message}`,"error"),setIsError(!0),setMessage(n.message)):(updateCaptchaStatus(`API Success: ${n.message}`,"success"),setIsError(!1),setMessage(n.message))}catch(i){console.log(i),updateCaptchaStatus(`Error processing response: ${i}`,"error")}}).catch(o=>{console.log(o),updateCaptchaStatus(`Fetch error: ${o}`,"error"),setIsError(!0),setMessage("Error: "+o)})};const c=new MutationObserver(s=>{s.forEach(t=>{if(t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){const a=t.addedNodes[e];if(a.classList&&(a.classList.contains("procaptcha")||a.querySelector&&a.querySelector(".procaptcha"))){updateCaptchaStatus("CAPTCHA DOM elements initialized","info"),c.disconnect();break}}})});c.observe(document.body,{childList:!0,subtree:!0})});function d(c){console.log("Challenge passed"),window.updateCaptchaStatus("Challenge passed successfully!","success"),window.updateCaptchaStatus(`Token generated: ${c.substring(0,15)}...`,"success")}const p=document.getElementById("procaptcha-container");l(p,{siteKey:"undefined",captchaType:"frictionless",callback:d,"failed-callback":function(){console.log("Challenge failed"),window.updateCaptchaStatus("Challenge failed - CAPTCHA verification could not be completed","error")}});
@@ -284,7 +284,7 @@
284
284
  }
285
285
  }
286
286
  </style>
287
- <script type="module" crossorigin src="/assets/frictionless-explicit-C_AXK63E.js"></script>
287
+ <script type="module" crossorigin src="/assets/frictionless-explicit-CNjy6JJ4.js"></script>
288
288
  <link rel="modulepreload" crossorigin href="/assets/captcha-ByKnSsbG.js">
289
289
  <link rel="stylesheet" crossorigin href="/assets/captcha-BhkVCEXM.css">
290
290
 
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "start": "vite serve ./src --port 9232 --config vite.config.ts",
14
14
  "clean": "echo 'nothing to clean'"
15
15
  },
16
- "version": "2.8.1",
16
+ "version": "2.8.2",
17
17
  "devDependencies": {
18
18
  "@prosopo/dotenv": "2.6.0",
19
19
  "@types/node": "22.5.5",