yakuza0 2.23.15 → 2.23.16-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/inclusive.js +39 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.15",
3
+ "version": "2.23.16-beta.0",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -207,7 +207,7 @@ var render = function () {
207
207
  ykPkg = _ref.pkg,
208
208
  dkyModeDef = _ref.dkyModeDef;
209
209
 
210
- var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, yk0EnvStr, conf, cspLoop, setConfValue, setConfCSP, setConf, envBase, envMerge, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
210
+ var _ykConfig, ykConf, processEnv, imageKeyOrigin, aliasDir, yk0EnvStr, conf, cspLoop, setConfValue, setConfCSP, setConf, cspMerge, envBase, envMerge, client, content, acmConf, hostname, port, ykServer, orbAddr, directives, tip, serverConfStr;
211
211
 
212
212
  return _regenerator2.default.wrap(function _callee2$(_context2) {
213
213
  while (1) {
@@ -788,79 +788,87 @@ var render = function () {
788
788
  }
789
789
  });
790
790
 
791
+ cspMerge = function cspMerge(m1, m2) {
792
+ var envMerge = (0, _extends3.default)({}, m1);
793
+
794
+ _yakuza._.forEach(m2, function (v, key) {
795
+ envMerge[key] = _yakuza._.uniq(_yakuza._.compact(_yakuza._.concat(envMerge[key], v)));
796
+ });
797
+
798
+ return envMerge;
799
+ };
800
+
791
801
  if (conf.server.csp.envType !== "def") {
792
802
  envBase = conf.server.csp.env['base'] || {};
793
803
 
794
804
  delete conf.server.csp.env['base'];
795
- envMerge = (0, _extends3.default)({}, envBase);
805
+ envMerge = cspMerge(conf.server.csp.policies, envBase);
796
806
 
797
807
  _yakuza._.forEach(conf.server.csp.env, function (v, key) {
798
808
  if (key === conf.server.csp.envType) {
799
- _yakuza._.forEach(v, function (ev, ek) {
800
- envMerge[ek] = _yakuza._.uniq(_yakuza._.compact(_yakuza._.concat(ev, envMerge[ek])));
801
- });
809
+ envMerge = cspMerge(envMerge, conf.server.csp.env[key] || {});
802
810
  }
803
811
  });
804
- conf.server.csp.policies = envMerge;
812
+ conf.server.csp.policies = _yakuza._.cloneDeep(envMerge);
805
813
  }
806
814
 
807
815
  if (!conf.server.edas.enabled) {
808
- _context2.next = 29;
816
+ _context2.next = 30;
809
817
  break;
810
818
  }
811
819
 
812
- _context2.prev = 17;
820
+ _context2.prev = 18;
813
821
  client = new _acmSdk2.default(conf.server.edas.options);
814
- _context2.next = 21;
822
+ _context2.next = 22;
815
823
  return client.getConfig(conf.server.edas.dataId, conf.server.edas.group);
816
824
 
817
- case 21:
825
+ case 22:
818
826
  content = _context2.sent;
819
827
  acmConf = JSON.parse(content);
820
828
 
821
829
  setConf(acmConf);
822
- _context2.next = 29;
830
+ _context2.next = 30;
823
831
  break;
824
832
 
825
- case 26:
826
- _context2.prev = 26;
827
- _context2.t0 = _context2['catch'](17);
833
+ case 27:
834
+ _context2.prev = 27;
835
+ _context2.t0 = _context2['catch'](18);
828
836
 
829
837
  console.log(_context2.t0);
830
838
 
831
- case 29:
839
+ case 30:
832
840
  _context2.t1 = conf.dkyMode;
833
- _context2.next = _context2.t1 === "dev" ? 32 : _context2.t1 === "normal" ? 36 : _context2.t1 === "prod" ? 40 : _context2.t1 === "stupid" ? 47 : _context2.t1 === "tire" ? 57 : 64;
841
+ _context2.next = _context2.t1 === "dev" ? 33 : _context2.t1 === "normal" ? 37 : _context2.t1 === "prod" ? 41 : _context2.t1 === "stupid" ? 48 : _context2.t1 === "tire" ? 58 : 65;
834
842
  break;
835
843
 
836
- case 32:
844
+ case 33:
837
845
  // conf.security.encrypt = "none";
838
846
  // conf.security.stupid = false;
839
847
  // conf.security.helmet = true;
840
848
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
841
849
  conf.security.isDev = true;
842
850
  conf.dev = true;
843
- return _context2.abrupt('break', 64);
851
+ return _context2.abrupt('break', 65);
844
852
 
845
- case 36:
853
+ case 37:
846
854
  // conf.security.encrypt = "none";
847
855
  // conf.security.stupid = false;
848
856
  // conf.security.helmet = true;
849
857
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
850
858
  conf.security.isNormal = true;
851
859
  conf.dev = false;
852
- return _context2.abrupt('break', 64);
860
+ return _context2.abrupt('break', 65);
853
861
 
854
- case 40:
862
+ case 41:
855
863
  conf.security.encrypt = "sm";
856
864
  conf.security.stupid = false;
857
865
  conf.security.helmet = true;
858
866
  conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
859
867
  conf.security.isProd = true;
860
868
  conf.dev = false;
861
- return _context2.abrupt('break', 64);
869
+ return _context2.abrupt('break', 65);
862
870
 
863
- case 47:
871
+ case 48:
864
872
  conf.security.encrypt = "sm";
865
873
  conf.security.stupid = true;
866
874
  conf.security.helmet = true;
@@ -871,9 +879,9 @@ var render = function () {
871
879
  conf.server.csp.decoration = checkBoolSingle(conf.server.csp.decoration, true);
872
880
  conf.server.sri.enabled = true;
873
881
  // conf.dev = false;
874
- return _context2.abrupt('break', 64);
882
+ return _context2.abrupt('break', 65);
875
883
 
876
- case 57:
884
+ case 58:
877
885
  conf.security.encrypt = "none";
878
886
  conf.security.stupid = false;
879
887
  conf.security.helmet = false;
@@ -882,9 +890,9 @@ var render = function () {
882
890
  // conf.server.heartbeat.enabled = checkBoolSingle(conf.server.heartbeat.enabled, false);
883
891
  conf.server.heartbeat.enabled = false;
884
892
  // conf.dev = false;
885
- return _context2.abrupt('break', 64);
893
+ return _context2.abrupt('break', 65);
886
894
 
887
- case 64:
895
+ case 65:
888
896
 
889
897
  conf.server.stupid.v23.enabled = conf.server.stupid.standard === 'v23';
890
898
  // conf.router.config['app.examples'].enabled = true;
@@ -987,7 +995,7 @@ var render = function () {
987
995
  conf.server.csp.directives = directives;
988
996
 
989
997
  // const appPortUsed = [];
990
- _context2.next = 86;
998
+ _context2.next = 87;
991
999
  return _yakuza._.asyncMap(conf.router.config, function () {
992
1000
  var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
993
1001
  var name, arr, length, num;
@@ -1174,7 +1182,7 @@ var render = function () {
1174
1182
  };
1175
1183
  }());
1176
1184
 
1177
- case 86:
1185
+ case 87:
1178
1186
  // console.log(conf.router.config);
1179
1187
 
1180
1188
  conf.shareRule.app = conf.shareRule.app.map(function (ap) {
@@ -1296,12 +1304,12 @@ var render = function () {
1296
1304
 
1297
1305
  return _context2.abrupt('return', { conf: conf });
1298
1306
 
1299
- case 97:
1307
+ case 98:
1300
1308
  case 'end':
1301
1309
  return _context2.stop();
1302
1310
  }
1303
1311
  }
1304
- }, _callee2, undefined, [[17, 26]]);
1312
+ }, _callee2, undefined, [[18, 27]]);
1305
1313
  }));
1306
1314
 
1307
1315
  return function render(_x) {