New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mcaptcha/vanilla-glue

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcaptcha/vanilla-glue - npm Package Compare versions

Comparing version 0.1.0-alpha-3 to 0.1.0-rc1

dist/const.d.ts

11

dist/index.d.ts
import { SiteKey, WidgetConfig, ConfigurationError } from "@mcaptcha/core-glue";
import Receiver from "@mcaptcha/core-glue";
export declare const INPUT_NAME = "mcaptcha__token";
export declare const ID = "mcaptcha__widget-container";
export default class Widget {
inputElement: HTMLInputElement;
receiver: Receiver;
constructor(config: WidgetConfig);
setToken: (val: string) => string;
}
import Widget from "./widget";
export default Widget;
export { SiteKey, WidgetConfig, ConfigurationError };

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mcaptchaGlue=t():e.mcaptchaGlue=t()}(self,(()=>{return e={44:function(e){var t;t=()=>(()=>{"use strict";var e={};return{607:function(e,t){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.message="Provide either widget link or site key to display mCaptcha widget",t}return i(t,e),t}(Error);t.ConfigurationError=o;var r=function(){function e(e,t){var n=this;if(this.handle=function(e){console.log("message received from ".concat(e.origin," with data: ").concat(e.data.token)),new URL(e.origin).host==n.widgetLink.host?n.updateState(e.data.token):console.error("expected message from ".concat(n.widgetLink.host," but received message from ").concat(e.origin,". Aborting."))},this.updateState=t,e.widgetLink&&e.siteKey)throw new o;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new o;e.siteKey.instanceUrl?(this.widgetLink=e.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey=".concat(e.siteKey.key)):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey=".concat(e.siteKey.key))}}return e.prototype.listen=function(){window.addEventListener("message",this.handle)},e.prototype.destroy=function(){window.removeEventListener("message",this.handle)},e}();t.default=r}}[607](0,e),e})(),e.exports=t()},607:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=t.ID=t.INPUT_NAME=void 0;var o=n(44);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return o.ConfigurationError}});var r=i(n(44));t.INPUT_NAME="mcaptcha__token",t.ID="mcaptcha__widget-container";t.default=function(e){var n=this;this.setToken=function(e){return n.inputElement.value=e},this.receiver=new r.default(e,this.setToken),this.receiver.listen();var i=document.getElementById(t.ID);if(null==i)throw new Error("Element ".concat(t.ID,"'s parent element is undefined"));this.inputElement=document.createElement("input"),this.inputElement.id=t.INPUT_NAME,this.inputElement.name=t.INPUT_NAME,this.inputElement.hidden=!0,this.inputElement.required=!0,i.appendChild(this.inputElement);var o="mcaptcha-widget__iframe",a=document.createElement("iframe");a.title="mCaptcha",a.src=this.receiver.widgetLink.toString(),a.ariaRoleDescription="presentation",a.name=o,a.id=o,a.scrolling="no";try{a.sandbox="allow-same-origin allow-scripts allow-popups"}catch(e){try{a.sandbox.add("allow-same-origin"),a.sandbox.add("allow-scripts"),a.sandbox.add("allow-popups")}catch(e){a.setAttribute("sandbox","allow-same-origin allow-scripts allow-popups")}}a.width="100%",a.height="100%",a.frameBorder="0",i.appendChild(a)}}},t={},function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}(607);var e,t}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mcaptchaGlue=t():e.mcaptchaGlue=t()}(self,(()=>{return e={545:function(e){var t;t=()=>(()=>{"use strict";var e={};return{166:function(e,t){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=void 0;var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.message="Provide either widget link or site key to display mCaptcha widget",t}return i(t,e),t}(Error);t.ConfigurationError=r;var o=function(){function e(e,t){var n=this;if(this.handle=function(e){console.log("message received from ".concat(e.origin," with data: ").concat(e.data.token)),new URL(e.origin).host==n.widgetLink.host?n.updateState(e.data.token):console.error("expected message from ".concat(n.widgetLink.host," but received message from ").concat(e.origin,". Aborting."))},this.updateState=t,e.widgetLink&&e.siteKey)throw new r;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new r;e.siteKey.instanceUrl?(this.widgetLink=e.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey=".concat(e.siteKey.key)):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey=".concat(e.siteKey.key))}}return e.prototype.listen=function(){window.addEventListener("message",this.handle)},e.prototype.destroy=function(){window.removeEventListener("message",this.handle)},e}();t.default=o}}[166](0,e),e})(),e.exports=t()},942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID=t.INPUT_LABEL_ID=t.INPUT_NAME=void 0,t.INPUT_NAME="mcaptcha__token",t.INPUT_LABEL_ID="mcaptcha__token-label",t.ID="mcaptcha__widget-container"},166:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=void 0;var r=n(545);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return r.ConfigurationError}});var o=i(n(695));(0,n(695).run)(),t.default=o.default},695:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.run=void 0;var r=i(n(545)),o=n(942),a=function(e){var t=this;this.setToken=function(e){return t.inputElement.value=e},this.receiver=new r.default(e,this.setToken),this.receiver.listen();var n=document.getElementById(o.ID);if(null==n)throw new Error("Element ".concat(o.ID,"'s parent element is undefined"));var i=document.getElementById(o.INPUT_LABEL_ID);null!==i&&(i.style.display="none"),this.inputElement=document.getElementById(o.INPUT_NAME),this.inputElement.id=o.INPUT_NAME,this.inputElement.name=o.INPUT_NAME,this.inputElement.hidden=!0,this.inputElement.required=!0,this.inputElement.style.display="none",n.appendChild(this.inputElement);var a="mcaptcha-widget__iframe",s=document.createElement("iframe");s.title="mCaptcha",s.src=this.receiver.widgetLink.toString(),s.ariaRoleDescription="presentation",s.name=a,s.id=a,s.scrolling="no";try{s.sandbox="allow-same-origin allow-scripts allow-popups"}catch(e){try{s.sandbox.add("allow-same-origin"),s.sandbox.add("allow-scripts"),s.sandbox.add("allow-popups")}catch(e){s.setAttribute("sandbox","allow-same-origin allow-scripts allow-popups")}}s.width="100%",s.height="100%",s.frameBorder="0",n.appendChild(s)};t.run=function(){var e=document.getElementById(o.INPUT_LABEL_ID);if(null===e||!e.dataset.mcaptcha_url)throw new Error('Couldn\'t find "mcaptcha_url" dataset in elmement (ID='.concat(o.INPUT_LABEL_ID,")"));var t={widgetLink:new URL(e.dataset.mcaptcha_url)};new a(t)},t.default=a}},t={},function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(166);var e,t}));

@@ -5,3 +5,3 @@ {

"description": "glue code to setup mCaptcha on your website",
"version": "0.1.0-alpha-3",
"version": "0.1.0-rc1",
"license": "(MIT OR Apache-2.0)",

@@ -46,2 +46,29 @@ "keywords": [

},
"devDependencies": {
"@types/jest": "^29.5.6",
"@types/jsdom": "^21.1.4",
"@types/node": "^20.8.9",
"@types/sinon": "^10.0.20",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.52.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^22.1.0",
"rimraf": "^5.0.5",
"sinon": "^17.0.0",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"typedoc": "^0.25.2",
"typescript": "^5.2.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"@mcaptcha/core-glue": "0.1.0-rc1",
"jest-environment-jsdom": "^29.7.0"
},
"scripts": {

@@ -51,31 +78,5 @@ "build": "webpack --mode production",

"test": "jest",
"lint": "eslint src",
"lint": "eslint src/index.ts src/test.ts",
"doc": "typedoc src/index.ts"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/jsdom": "^16.2.10",
"@types/node": "^16.11.12",
"@types/sinon": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"copy-webpack-plugin": "^9.0.1",
"eslint": "^8.4.1",
"jest": "^27.2.5",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^18.0.0",
"rimraf": "^3.0.0",
"sinon": "^11.1.2",
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.6",
"ts-node": "^10.3.0",
"typedoc": "^0.22.5",
"typescript": "^4.1.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^4.3.1"
},
"dependencies": {
"@mcaptcha/core-glue": "^0.1.0-alpha-5"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc