@mcaptcha/core-glue
Advanced tools
Comparing version 0.1.0-alpha-5 to 0.1.0-rc1
@@ -1,6 +0,6 @@ | ||
export declare type SiteKey = { | ||
export type SiteKey = { | ||
key: string; | ||
instanceUrl?: URL; | ||
}; | ||
export declare type WidgetConfig = { | ||
export type WidgetConfig = { | ||
siteKey?: SiteKey; | ||
@@ -7,0 +7,0 @@ widgetLink?: URL; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mcaptchaGlue=e():t.mcaptchaGlue=e()}(this,(()=>(()=>{"use strict";var t={};return{607:function(t,e){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationError=void 0;var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message="Provide either widget link or site key to display mCaptcha widget",e}return i(e,t),e}(Error);e.ConfigurationError=o;var r=function(){function t(t,e){var n=this;if(this.handle=function(t){console.log("message received from ".concat(t.origin," with data: ").concat(t.data.token)),new URL(t.origin).host==n.widgetLink.host?n.updateState(t.data.token):console.error("expected message from ".concat(n.widgetLink.host," but received message from ").concat(t.origin,". Aborting."))},this.updateState=e,t.widgetLink&&t.siteKey)throw new o;if(t.widgetLink)this.widgetLink=t.widgetLink;else{if(!t.siteKey)throw new o;t.siteKey.instanceUrl?(this.widgetLink=t.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey=".concat(t.siteKey.key)):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey=".concat(t.siteKey.key))}}return t.prototype.listen=function(){window.addEventListener("message",this.handle)},t.prototype.destroy=function(){window.removeEventListener("message",this.handle)},t}();e.default=r}}[607](0,t),t})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mcaptchaGlue=e():t.mcaptchaGlue=e()}(this,(()=>(()=>{"use strict";var t={};return{166:function(t,e){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationError=void 0;var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.message="Provide either widget link or site key to display mCaptcha widget",e}return i(e,t),e}(Error);e.ConfigurationError=o;var r=function(){function t(t,e){var n=this;if(this.handle=function(t){console.log("message received from ".concat(t.origin," with data: ").concat(t.data.token)),new URL(t.origin).host==n.widgetLink.host?n.updateState(t.data.token):console.error("expected message from ".concat(n.widgetLink.host," but received message from ").concat(t.origin,". Aborting."))},this.updateState=e,t.widgetLink&&t.siteKey)throw new o;if(t.widgetLink)this.widgetLink=t.widgetLink;else{if(!t.siteKey)throw new o;t.siteKey.instanceUrl?(this.widgetLink=t.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey=".concat(t.siteKey.key)):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey=".concat(t.siteKey.key))}}return t.prototype.listen=function(){window.addEventListener("message",this.handle)},t.prototype.destroy=function(){window.removeEventListener("message",this.handle)},t}();e.default=r}}[166](0,t),t})())); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"author": "Aravinth Manivannan <realaravinth@batsense.net>", | ||
"name": "@mcaptcha/core-glue", | ||
"description": "internal library containig shared glue code", | ||
"version": "0.1.0-alpha-5", | ||
"description": "internal library containing shared glue code", | ||
"version": "0.1.0-rc1", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -45,31 +45,32 @@ "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-environment-jsdom": "^29.7.0", | ||
"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" | ||
}, | ||
"scripts": { | ||
"build": "webpack --mode production", | ||
"start": "webpack-dev-server --open -d", | ||
"test": "yarn jest", | ||
"lint": "yarn run eslint src", | ||
"doc": "yarn typedoc src/index.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^27.0.2", | ||
"@types/jsdom": "^16.2.10", | ||
"@types/node": "^16.10.4", | ||
"@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", | ||
"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" | ||
"test": "jest", | ||
"lint": "eslint", | ||
"doc": "typedoc src/index.ts" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11298
21