@goodgamestudios/cxf-announcements
Advanced tools
Comparing version 0.5.0-qa.0 to 0.5.0-qa.1
@@ -5,11 +5,23 @@ # Change Log | ||
<a name="0.5.0-qa.1"></a> | ||
# [0.5.0-qa.1](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-qa.0...v0.5.0-qa.1) (2019-08-22) | ||
<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-02-08) | ||
# [0.5.0-qa.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.5.0-dev.0...v0.5.0-qa.0) (2019-08-22) | ||
<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)) | ||
@@ -23,2 +35,41 @@ | ||
<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> | ||
## [0.4.1](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.4.1-qa.0...v0.4.1) (2019-07-17) | ||
<a name="0.4.1-qa.0"></a> | ||
## [0.4.1-qa.0](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.3.0-dev.12...v0.4.1-qa.0) (2019-07-16) | ||
### 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)) | ||
<a name="0.3.0-dev.12"></a> | ||
@@ -25,0 +76,0 @@ # [0.3.0-dev.12](https://gitlab.goodgamestudios.com/cxf/announcements/compare/v0.3.0-dev.11...v0.3.0-dev.12) (2019-02-08) |
@@ -9,5 +9,3 @@ 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) { | ||
var r=require("./arrayWithHoles"),e=require("./iterableToArrayLimit"),i=require("./nonIterableRest");function t(t,a){return r(t)||e(t,a)||i()}module.exports=t; | ||
},{"./arrayWithHoles":"OUZ9","./iterableToArrayLimit":"9vK/","./nonIterableRest":"Rom6"}],"BcLt":[function(require,module,exports) { | ||
module.exports=function(n){return{subscribe:function(e,s){n.addListener({message:function(n){var o=n.message;console.log("Got a PubNub message for this channel(network+instance) - display will be defined based on language"),e(o,s)}}),n.subscribe({channels:["community-announcements","community-announcements-".concat(s.network,"-").concat(s.instance)]})}}}; | ||
},{}],"lhxb":[function(require,module,exports) { | ||
},{"./arrayWithHoles":"OUZ9","./iterableToArrayLimit":"9vK/","./nonIterableRest":"Rom6"}],"lhxb":[function(require,module,exports) { | ||
"use strict";var e=r(require("@babel/runtime/helpers/slicedToArray"));function r(e){return e&&e.__esModule?e:{default:e}}module.exports={getPlayerInfo:function(e){var r=JSON.parse(e[1]);return{playername:r.gpi.PN,level:r.gxp.LVL}},getLevel:function(r){var l=(0,e.default)(r,2)[1];return JSON.parse(l).L},lastTutorialLevel:5,loginCmd:"gbd",levelUpCmd:"glu"}; | ||
@@ -33,6 +31,6 @@ },{"@babel/runtime/helpers/slicedToArray":"69HE"}],"5kH1":[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){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var s=r.network,o=r.instance,l=r.lang,u=r.playername;if(n.message&&n.message[l]){var c=i(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:l,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: ",l)}};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,a){var r=l("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e);return{initAnnouncements:function(s){Object.assign(s,t.getPlayerInfo(s.userdata));var i=function(){!function(n){u("https://evf0700w70.execute-api.eu-west-1.amazonaws.com/test/messages/"+e.game,r,n)}(s),a.subscribe(r,s),o()};if(s.level>t.lastTutorialLevel)return i();var l,c,g;console.warn(" still during tutorial, need to wait until tutorial finishes"),e.off(t.levelUpCmd,module.exports.placeholder),e.on(t.levelUpCmd,(c=(l=t).getLevel,g=l.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=c(t),r=g+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"):i())}))},placeholder:function(){return console.log("do nothing")}}},module.exports.tests={loadCurrentMessages:u,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){var t=n.game,a=n.appendHtmlTagFor;return function(n,r){var s=r.network,o=r.instance,l=r.lang,u=r.playername;if(n.message&&n.message[l]){var c=i(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:l,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: ",l)}};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=l("https://s3-eu-west-1.amazonaws.com/com.ggs.client-notification-runtime/test/announcements/templates/",e);return{initAnnouncements:function(r){Object.assign(r,t.getPlayerInfo(r.userdata));var s=function(){!function(n){u("https://evf0700w70.execute-api.eu-west-1.amazonaws.com/test/messages/"+e.game,a,n)}(r),o()};if(r.level>t.lastTutorialLevel)return s();var i,l,c;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,c=i.lastTutorialLevel,function(e){var t=(0,n.default)(e,1)[0],a=l(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: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) { | ||
"use strict";var e=n(require("@babel/runtime/helpers/slicedToArray"));function n(e){return e&&e.__esModule?e:{default:e}}function r(n){console.log("announcements initialized successfully - waiting for player login",n.game);var r=require("./pubnubsubscriber")(n.pubnub),a="empire"===n.game?require("./game-adapters/empire"):require("./game-adapters/bigfarm"),i=require("./announcements-private")(n,a,r),u=function(r){var a=(0,e.default)(r,4),u=a[0],o=a[1],l=a[2],t=a[3];i.initAnnouncements({userdata:u,lang:o,network:l,instance:t,game:n.game})};n.once(a.loginCmd,u),n.once(a.levelUpCmd,i.placeholder),n.once(3,u),n.once(24,i.placeholder)}r(window.CXF); | ||
},{"@babel/runtime/helpers/slicedToArray":"69HE","./pubnubsubscriber":"BcLt","./game-adapters/empire":"lhxb","./game-adapters/bigfarm":"5kH1","./announcements-private":"hRFt"}]},{},["+uO6"], null) | ||
"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.map |
{ | ||
"name": "@goodgamestudios/cxf-announcements", | ||
"version": "0.5.0-qa.0", | ||
"version": "0.5.0-qa.1", | ||
"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\" " | ||
}, | ||
@@ -56,10 +56,9 @@ "repository": { | ||
"husky": "^1.2.0", | ||
"jquery": "^3.3.1", | ||
"jquery": "^3.4.1", | ||
"mock-local-storage": "^1.1.7", | ||
"node-fetch": "^2.3.0", | ||
"nyc": "^13.0.1", | ||
"parcel-bundler": "^1.10.3", | ||
"parcel-bundler": "^1.12.3", | ||
"parcel-plugin-bundle-visualiser": "^1.2.0", | ||
"promise-polyfill": "^8.1.0", | ||
"pubnub": "^4.21.6", | ||
"rimraf": "^2.6.2", | ||
@@ -66,0 +65,0 @@ "setup-browser-env": "0.0.2", |
@@ -1,2 +0,2 @@ | ||
Logic to display announcements received from PubNub or loaded from RestAPI. | ||
Logic to display announcements loaded from RestAPI. | ||
Template html are also used by CXF Admin panel to display preview |
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
33
4
2
7
321572
33
195