@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.4.1 to 0.5.0-dev.0
@@ -5,2 +5,41 @@ # Change Log | ||
<a name="0.5.0-dev.0"></a> | ||
# [0.5.0-dev.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.2.0-qa.0...v0.5.0-dev.0) (2019-08-22) | ||
### Bug Fixes | ||
* added rejection of Promise by throwing Error ([7947fd0](https://gitlab.goodgamestudios.com/cxf/announcements/commit/7947fd0)) | ||
* fixed the package version ([c7ef350](https://gitlab.goodgamestudios.com/cxf/announcements/commit/c7ef350)) | ||
* package.version is below version num already published ([af8bada](https://gitlab.goodgamestudios.com/cxf/announcements/commit/af8bada)) | ||
* remove the commented code ([aad61c8](https://gitlab.goodgamestudios.com/cxf/announcements/commit/aad61c8)) | ||
* removed pubnub ([c935782](https://gitlab.goodgamestudios.com/cxf/announcements/commit/c935782)) | ||
### Features | ||
* adjusted behaviour of the announcement during message preview ([22430ec](https://gitlab.goodgamestudios.com/cxf/announcements/commit/22430ec)) | ||
<a name="0.5.0-qa.0"></a> | ||
# [0.5.0-qa.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.2.0-qa.0...v0.5.0-qa.0) (2019-08-22) | ||
### Bug Fixes | ||
* added rejection of Promise by throwing Error ([7947fd0](https://gitlab.goodgamestudios.com/cxf/announcements/commit/7947fd0)) | ||
* clear timeout on fetch messages ([f6a8597](https://gitlab.goodgamestudios.com/cxf/announcements/commit/f6a8597)) | ||
* fixed the package version ([c7ef350](https://gitlab.goodgamestudios.com/cxf/announcements/commit/c7ef350)) | ||
* package.version is below version num already published ([af8bada](https://gitlab.goodgamestudios.com/cxf/announcements/commit/af8bada)) | ||
* remove the commented code ([aad61c8](https://gitlab.goodgamestudios.com/cxf/announcements/commit/aad61c8)) | ||
* removed pubnub ([c935782](https://gitlab.goodgamestudios.com/cxf/announcements/commit/c935782)) | ||
### Features | ||
* adjusted behaviour of the announcement during message preview ([22430ec](https://gitlab.goodgamestudios.com/cxf/announcements/commit/22430ec)) | ||
<a name="0.4.1"></a> | ||
@@ -7,0 +46,0 @@ ## [0.4.1](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.4.1-qa.0...v0.4.1) (2019-07-17) |
@@ -1,2 +0,2 @@ | ||
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) { | ||
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r},p.cache={};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"OUZ9":[function(require,module,exports) { | ||
function r(r){if(Array.isArray(r))return r}module.exports=r; | ||
@@ -30,6 +30,6 @@ },{}],"9vK/":[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"),o=r.appendLoginParams,s=require("./window-handlers"),l=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},i=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var o=r.network,s=r.instance,i=r.lang,u=r.playername;if(n.message&&n.message[i]){var c=l(t,u,o,s),g=n.message_hash;if(g!==localStorage.getItem(c)){var m=JSON.stringify({key:c,currentMessageHash:g}),f=new URLSearchParams({game:t,lang:i,network:o,instance:s,hash:m}),d="".concat(e).concat(t,"_announcement.html?").concat(f.toString()),h=a(d);return console.log("shown message ",h),h}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 there is no translation for the current language: ",i)}};function u(e,n,t){return c.apply(this,arguments)}function c(){return(c=(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=o(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=i("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/prod/announcements/templates/",e);return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var o=function(){!function(n){u("https://nloswl688h.execute-api.eu-west-1.amazonaws.com/prod/messages/"+e.game,a,n)}(r),s()};if(r.level>t.lastTutorialLevel)return o();var l,i,c;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(i=(l=t).getLevel,c=l.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=i(t),r=c+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"):o())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:u,handleAnnouncementMessage:i,getHashKey:l}; | ||
"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"),l=function(e,n,t,a){var r=[e,n,t,a].join("_");return"ggs.cxf.announcements.".concat(r,".lastMessageHash")},i=function(e,n){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var s=r.network,o=r.instance,i=r.lang,u=r.playername;if(n.message&&n.message[i]){var c=l(t,u,s,o),g=n.message_hash;if(g!==localStorage.getItem(c)){var m=JSON.stringify({key:c,currentMessageHash:g}),f=new URLSearchParams({game:t,lang:i,network:s,instance:o,hash:m}),d="".concat(e).concat(t,"_announcement.html?").concat(f.toString()),h=a(d);return console.log("shown message ",h),h}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 there is no translation for the current language: ",i)}};function u(e,n,t){return c.apply(this,arguments)}function c(){return(c=(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=i("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/dev/announcements/templates/",e);return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var s=function(){!function(n){u("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 l,i,c;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(i=(l=t).getLevel,c=l.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=i(t),r=c+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:u,handleAnnouncementMessage:i,getHashKey:l}; | ||
},{"@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) { | ||
"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); | ||
},{"@babel/runtime/helpers/slicedToArray":"69HE","./game-adapters/empire":"lhxb","./game-adapters/bigfarm":"5kH1","./announcements-private":"hRFt"}]},{},["+uO6"], null) | ||
//# sourceMappingURL=announcements.js.map | ||
//# sourceMappingURL=announcements.map |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.4.1", | ||
"version": "0.5.0-dev.0", | ||
"main": "dist/announcements.js", | ||
@@ -22,4 +22,4 @@ "scripts": { | ||
"build-popup": "rimraf dist/templates && cross-env parcel build --out-dir dist/templates --public-url . src/*.html", | ||
"s3:upload": "cp CHANGELOG.md dist/CHANGELOG.md && cross-env aws s3 cp dist/ s3://com.ggs.client-notification-runtime/$ENV/announcements --recursive --acl public-read --exclude \"*.html\" && npm run s3:upload:popup ", | ||
"s3:upload:popup": "cross-env aws s3 cp dist/templates/ s3://com.ggs.client-notification-runtime/$ENV/announcements/templates --recursive --acl public-read --exclude \\\"*.html\\\" && cross-env aws s3 cp dist/templates/ s3://com.ggs.client-notification-runtime/$ENV/announcements/templates --recursive --acl public-read --exclude \"*\" --include \"*.html\" --content-type \"text/html; charset=utf-8\" " | ||
"s3:upload": "cp CHANGELOG.md dist/CHANGELOG.md && cross-env aws s3 cp dist/ s3://com.ggs.client-notification-runtime/$ENV/announcements --profile epAccount --recursive --acl public-read --exclude \"*.html\" && npm run s3:upload:popup ", | ||
"s3:upload:popup": "cross-env aws s3 cp dist/templates/ s3://com.ggs.client-notification-runtime/$ENV/announcements/templates --recursive --profile epAccount --acl public-read --exclude \\\"*.html\\\" && cross-env aws s3 cp dist/templates/ s3://com.ggs.client-notification-runtime/$ENV/announcements/templates --recursive --acl public-read --exclude \"*\" --include \"*.html\" --content-type \"text/html; charset=utf-8\" " | ||
}, | ||
@@ -26,0 +26,0 @@ "repository": { |
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
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
321279
33
195