yakuza0 2.22.32 → 2.22.33-beta.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.32",
3
+ "version": "2.22.33-beta.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,6 +30,10 @@ const shtmlFilterSet = (obj, options) => {
30
30
  return shtml(obj, options);
31
31
  }
32
32
 
33
+ const filterOpt = (options) => {
34
+ return _.omit(options, ['xssOpt'])
35
+ }
36
+
33
37
  export default async (ctx, inject) => {
34
38
  const { $http, $utils, $yk } = ctx;
35
39
  const event = {
@@ -42,8 +46,9 @@ export default async (ctx, inject) => {
42
46
  const on = {};
43
47
 
44
48
  if (!yConf.standAlone) {
45
- if ($utils.checkServer()) {
49
+ if ($utils.checkServer() || !yConf.server.heartbeat.enabled) {
46
50
  event.set = async (...args) => {
51
+ console.log(args);
47
52
  let [key, data, options] = [null, null, {}];
48
53
 
49
54
  switch (args.length) {
@@ -53,13 +58,16 @@ export default async (ctx, inject) => {
53
58
  case 2:
54
59
  [key, data] = args;
55
60
  break;
61
+ case 3:
62
+ [key, data, options] = args;
63
+ break;
56
64
  }
57
65
  data = shtmlFilterSet(data, options);
58
66
 
59
67
  const result = await $http.post('$/feapiv1/storage/set', {
60
68
  key,
61
69
  data,
62
- options,
70
+ options: filterOpt(options),
63
71
  }, {
64
72
  hasHook: [],
65
73
  })
@@ -72,7 +80,7 @@ export default async (ctx, inject) => {
72
80
  hasHook: [],
73
81
  query: {
74
82
  key,
75
- options,
83
+ options: filterOpt(options),
76
84
  }
77
85
  })
78
86
 
@@ -86,7 +94,7 @@ export default async (ctx, inject) => {
86
94
  event.remove = async (key, options = {}) => {
87
95
  const result = await $http.post('$/feapiv1/storage/remove', {
88
96
  key,
89
- options,
97
+ options: filterOpt(options),
90
98
  }, {
91
99
  hasHook: [],
92
100
  })
@@ -120,7 +128,7 @@ export default async (ctx, inject) => {
120
128
  body: {
121
129
  key,
122
130
  data,
123
- options,
131
+ options: filterOpt(options),
124
132
  }
125
133
  })
126
134
  };
@@ -129,7 +137,7 @@ export default async (ctx, inject) => {
129
137
  const data = await req('storage/get', {
130
138
  body: {
131
139
  key,
132
- options,
140
+ options: filterOpt(options),
133
141
  }
134
142
  })
135
143
 
@@ -143,7 +151,7 @@ export default async (ctx, inject) => {
143
151
  event.remove = async (key, options = {}) => await req('storage/remove', {
144
152
  body: {
145
153
  key,
146
- options,
154
+ options: filterOpt(options),
147
155
  }
148
156
  })
149
157
  }
@@ -42,6 +42,7 @@ export default async (ctx, inject) => {
42
42
  env: conf.env,
43
43
  fe: conf.fe,
44
44
  standAlone: appConf.standAlone,
45
+ dkyMode: yConf.dkyMode,
45
46
  // finger: '16',
46
47
  browser: { key: '16' },
47
48
  hostname: {},
@@ -186,6 +186,10 @@ var checkBool = function checkBool(common, persona) {
186
186
  return typeof persona === 'boolean' ? persona : typeof common === 'boolean' && common === true;
187
187
  };
188
188
 
189
+ var checkBoolSingle = function checkBoolSingle(persona, def) {
190
+ return typeof persona === 'boolean' ? persona : def;
191
+ };
192
+
189
193
  var pool = _yakuza._.range(3000, 3100);
190
194
  var appPool = _yakuza._.range(26000, 26100);
191
195
 
@@ -781,7 +785,7 @@ var render = function () {
781
785
 
782
786
  case 28:
783
787
  _context2.t1 = conf.dkyMode;
784
- _context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 34 : _context2.t1 === "prod" ? 37 : _context2.t1 === "stupid" ? 43 : _context2.t1 === "tire" ? 53 : 58;
788
+ _context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 34 : _context2.t1 === "prod" ? 37 : _context2.t1 === "stupid" ? 43 : _context2.t1 === "tire" ? 53 : 59;
785
789
  break;
786
790
 
787
791
  case 31:
@@ -791,7 +795,7 @@ var render = function () {
791
795
  // conf.server.f5Offline = false;
792
796
  conf.security.isDev = true;
793
797
  conf.dev = true;
794
- return _context2.abrupt('break', 58);
798
+ return _context2.abrupt('break', 59);
795
799
 
796
800
  case 34:
797
801
  // conf.security.encrypt = "none";
@@ -800,7 +804,7 @@ var render = function () {
800
804
  // conf.server.f5Offline = false;
801
805
  conf.security.isNormal = true;
802
806
  conf.dev = false;
803
- return _context2.abrupt('break', 58);
807
+ return _context2.abrupt('break', 59);
804
808
 
805
809
  case 37:
806
810
  conf.security.encrypt = "sm";
@@ -809,21 +813,21 @@ var render = function () {
809
813
  // conf.server.f5Offline = false;
810
814
  conf.security.isProd = true;
811
815
  conf.dev = false;
812
- return _context2.abrupt('break', 58);
816
+ return _context2.abrupt('break', 59);
813
817
 
814
818
  case 43:
815
819
  conf.security.encrypt = "sm";
816
820
  conf.security.stupid = true;
817
821
  conf.security.helmet = true;
818
822
  // conf.server.f5Offline = false;
819
- conf.server.f5Offline = typeof conf.server.f5Offline === 'boolean' ? conf.server.f5Offline : true;
823
+ conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, true);
820
824
  conf.security.isStupid = true;
821
825
  conf.server.csp.enabled = true;
822
- conf.server.csp.strict = typeof conf.server.csp.strict === 'boolean' ? conf.server.csp.strict : true;
823
- conf.server.csp.decoration = typeof conf.server.csp.decoration === 'boolean' ? conf.server.csp.decoration : true;
826
+ conf.server.csp.strict = checkBoolSingle(conf.server.csp.strict, true);
827
+ conf.server.csp.decoration = checkBoolSingle(conf.server.csp.decoration, true);
824
828
  conf.server.sri.enabled = true;
825
829
  // conf.dev = false;
826
- return _context2.abrupt('break', 58);
830
+ return _context2.abrupt('break', 59);
827
831
 
828
832
  case 53:
829
833
  conf.security.encrypt = "none";
@@ -831,10 +835,11 @@ var render = function () {
831
835
  conf.security.helmet = false;
832
836
  // conf.server.f5Offline = false;
833
837
  conf.security.isTire = true;
838
+ conf.server.heartbeat.enabled = checkBoolSingle(conf.server.heartbeat.enabled, false);
834
839
  // conf.dev = false;
835
- return _context2.abrupt('break', 58);
840
+ return _context2.abrupt('break', 59);
836
841
 
837
- case 58:
842
+ case 59:
838
843
 
839
844
  // conf.router.config['app.examples'].enabled = true;
840
845
  if (conf.server.yk4Addr) {
@@ -934,7 +939,7 @@ var render = function () {
934
939
  conf.server.csp.directives = directives;
935
940
 
936
941
  // const appPortUsed = [];
937
- _context2.next = 79;
942
+ _context2.next = 80;
938
943
  return _yakuza._.asyncMap(conf.router.config, function () {
939
944
  var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
940
945
  var name, arr, length, num;
@@ -1119,7 +1124,7 @@ var render = function () {
1119
1124
  };
1120
1125
  }());
1121
1126
 
1122
- case 79:
1127
+ case 80:
1123
1128
  // console.log(conf.router.config);
1124
1129
 
1125
1130
  conf.shareRule.app = conf.shareRule.app.map(function (ap) {
@@ -1241,7 +1246,7 @@ var render = function () {
1241
1246
 
1242
1247
  return _context2.abrupt('return', { conf: conf });
1243
1248
 
1244
- case 90:
1249
+ case 91:
1245
1250
  case 'end':
1246
1251
  return _context2.stop();
1247
1252
  }