@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.5.2 to 0.6.1-dev.0
@@ -5,32 +5,7 @@ # Change Log | ||
<a name="0.5.2"></a> | ||
## [0.5.2](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0...v0.5.2) (2019-08-29) | ||
<a name="0.6.1-dev.0"></a> | ||
## [0.6.1-dev.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.2...v0.6.1-dev.0) (2019-09-25) | ||
<a name="0.5.0"></a> | ||
# [0.5.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.9...v0.5.0) (2019-08-29) | ||
<a name="0.5.0-qa.9"></a> | ||
# [0.5.0-qa.9](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.7...v0.5.0-qa.9) (2019-08-29) | ||
<a name="0.5.0-qa.7"></a> | ||
# [0.5.0-qa.7](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.5...v0.5.0-qa.7) (2019-08-29) | ||
<a name="0.5.0-qa.5"></a> | ||
# [0.5.0-qa.5](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.4...v0.5.0-qa.5) (2019-08-29) | ||
<a name="0.5.0-qa.4"></a> | ||
# [0.5.0-qa.4](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.2...v0.5.0-qa.4) (2019-08-29) | ||
<a name="0.5.0-qa.3"></a> | ||
@@ -37,0 +12,0 @@ # [0.5.0-qa.3](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.2...v0.5.0-qa.3) (2019-08-28) |
@@ -30,3 +30,3 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"OUZ9":[function(require,module,exports) { | ||
},{"./utils":"FO+Z"}],"hRFt":[function(require,module,exports) { | ||
"use strict";var e=a(require("@babel/runtime/regenerator")),n=a(require("@babel/runtime/helpers/slicedToArray")),t=a(require("@babel/runtime/helpers/asyncToGenerator"));function a(e){return e&&e.__esModule?e:{default:e}}require("url-search-params-polyfill");var r=require("./utils"),s=r.appendLoginParams,o=require("./window-handlers"),i=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},l=function(e,n,t){var a=n.game,r=n.appendHtmlTagFor;return function(n,s){var o=s.network,l=s.instance,c=s.lang,u=s.playername;if(n.message&&n.message[c]){var g=n.announcementStartDate,m=n.announcementEndDate;if(!g||g<=t&&m>=t)if(m&&m<t)console.warn("ignoring message since its expired already");else{var d=i(a,u,o,l),f=n.message_hash;if(f!==localStorage.getItem(d)){var h=JSON.stringify({key:d,currentMessageHash:f}),p=new URLSearchParams({game:a,lang:c,network:o,instance:l,hash:h}),w="".concat(e).concat(a,"_announcement.html?").concat(p.toString()),v=r(w);return console.log("shown message ",v),v}console.warn("ignoring message since it was already displayed once. to re-enable it, please delete ggs.cxf.announcements local storage")}else console.warn("ignoring message since start and end times are not valid")}else console.warn("ignoring message since there is no translation for the current language: ",c)}};function c(e,n,t){return u.apply(this,arguments)}function u(){return(u=(0,t.default)(e.default.mark(function n(t,a,r){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=s(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){e.message&&0!==Object.keys(e.message).length&&(console.log("Loaded and found a message for this lang | channel(network+instance)"),a(e,r))}).catch(function(e){return console.log("failed loading ".concat(t,": ").concat(e))}));case 2:case"end":return e.stop()}},n,this)}))).apply(this,arguments)}module.exports=function(e,t){var a=l("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/prod/announcements/templates/",e,Date.now());return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var s=function(){!function(n){c("https://nloswl688h.execute-api.eu-west-1.amazonaws.com/prod/messages/"+e.game,a,n)}(r),o()};if(r.level>t.lastTutorialLevel)return s();var i,l,u;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(l=(i=t).getLevel,u=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=l(t),r=u+1;console.log("NEW LEVEL ",a," minimum required is ",r),a>r||(a!==r?console.warn(" still during tutorial, need to wait until tutorial finishes"):s())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,handleAnnouncementMessage:l,getHashKey:i}; | ||
"use strict";var e=a(require("@babel/runtime/regenerator")),n=a(require("@babel/runtime/helpers/slicedToArray")),t=a(require("@babel/runtime/helpers/asyncToGenerator"));function a(e){return e&&e.__esModule?e:{default:e}}require("url-search-params-polyfill");var r=require("./utils"),s=r.appendLoginParams,o=require("./window-handlers"),i=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},l=function(e,n,t){var a=n.game,r=n.appendHtmlTagFor;return function(n,s){var o=s.network,l=s.instance,c=s.lang,u=s.playername;if(n.message&&n.message[c]){var g=n.announcementStartDate,m=n.announcementEndDate;if(!g||g<=t&&m>=t)if(m&&m<t)console.warn("ignoring message since its expired already");else{var d=i(a,u,o,l),f=n.message_hash;if(f!==localStorage.getItem(d)){var h=JSON.stringify({key:d,currentMessageHash:f}),p=new URLSearchParams({game:a,lang:c,network:o,instance:l,hash:h}),w="".concat(e).concat(a,"_announcement.html?").concat(p.toString()),v=r(w);return console.log("shown message ",v),v}console.warn("ignoring message since it was already displayed once. to re-enable it, please delete ggs.cxf.announcements local storage")}else console.warn("ignoring message since start and end times are not valid")}else console.warn("ignoring message since there is no translation for the current language: ",c)}};function c(e,n,t){return u.apply(this,arguments)}function u(){return(u=(0,t.default)(e.default.mark(function n(t,a,r){return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=s(t,r),e.abrupt("return",fetch(t).then(function(e){return e.json()}).then(function(e){e.message&&0!==Object.keys(e.message).length&&(console.log("Loaded and found a message for this lang | channel(network+instance)"),a(e,r))}).catch(function(e){return console.log("failed loading ".concat(t,": ").concat(e))}));case 2:case"end":return e.stop()}},n,this)}))).apply(this,arguments)}module.exports=function(e,t){var a=l("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/dev/announcements/templates/",e,Date.now());return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var s=function(){!function(n){c("https://jsffll6u27.execute-api.eu-west-1.amazonaws.com/dev/messages/"+e.game,a,n)}(r),o()};if(r.level>t.lastTutorialLevel)return s();var i,l,u;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(l=(i=t).getLevel,u=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=l(t),r=u+1;console.log("NEW LEVEL ",a," minimum required is ",r),a>r||(a!==r?console.warn(" still during tutorial, need to wait until tutorial finishes"):s())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:c,handleAnnouncementMessage:l,getHashKey:i}; | ||
},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/slicedToArray":"69HE","@babel/runtime/helpers/asyncToGenerator":"agGE","url-search-params-polyfill":"L8PX","./utils":"FO+Z","./window-handlers":"T61a"}],"+uO6":[function(require,module,exports) { | ||
@@ -33,0 +33,0 @@ "use strict";var e=n(require("@babel/runtime/helpers/slicedToArray"));function n(e){return e&&e.__esModule?e:{default:e}}function a(n){console.log("announcements initialized successfully - waiting for player login",n.game);var a="empire"===n.game?require("./game-adapters/empire"):require("./game-adapters/bigfarm"),r=require("./announcements-private")(n,a),i=function(a){var i=(0,e.default)(a,4),o=i[0],l=i[1],t=i[2],u=i[3];r.initAnnouncements({userdata:o,lang:l,network:t,instance:u,game:n.game})};n.once(a.loginCmd,i),n.once(a.levelUpCmd,r.placeholder),n.once(3,i),n.once(24,r.placeholder)}a(window.CXF); |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.5.2", | ||
"version": "0.6.1-dev.0", | ||
"main": "dist/announcements.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
335639
33
7