yakuza0 2.22.32 → 2.22.33-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.
- package/package.json +1 -1
- package/template/storage.plugin.js +15 -7
- package/template/yk.plugin.js +1 -0
- package/utils/inclusive.js +11 -10
package/package.json
CHANGED
|
@@ -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
|
}
|
package/template/yk.plugin.js
CHANGED
package/utils/inclusive.js
CHANGED
|
@@ -781,7 +781,7 @@ var render = function () {
|
|
|
781
781
|
|
|
782
782
|
case 28:
|
|
783
783
|
_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 :
|
|
784
|
+
_context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 34 : _context2.t1 === "prod" ? 37 : _context2.t1 === "stupid" ? 43 : _context2.t1 === "tire" ? 53 : 59;
|
|
785
785
|
break;
|
|
786
786
|
|
|
787
787
|
case 31:
|
|
@@ -791,7 +791,7 @@ var render = function () {
|
|
|
791
791
|
// conf.server.f5Offline = false;
|
|
792
792
|
conf.security.isDev = true;
|
|
793
793
|
conf.dev = true;
|
|
794
|
-
return _context2.abrupt('break',
|
|
794
|
+
return _context2.abrupt('break', 59);
|
|
795
795
|
|
|
796
796
|
case 34:
|
|
797
797
|
// conf.security.encrypt = "none";
|
|
@@ -800,7 +800,7 @@ var render = function () {
|
|
|
800
800
|
// conf.server.f5Offline = false;
|
|
801
801
|
conf.security.isNormal = true;
|
|
802
802
|
conf.dev = false;
|
|
803
|
-
return _context2.abrupt('break',
|
|
803
|
+
return _context2.abrupt('break', 59);
|
|
804
804
|
|
|
805
805
|
case 37:
|
|
806
806
|
conf.security.encrypt = "sm";
|
|
@@ -809,7 +809,7 @@ var render = function () {
|
|
|
809
809
|
// conf.server.f5Offline = false;
|
|
810
810
|
conf.security.isProd = true;
|
|
811
811
|
conf.dev = false;
|
|
812
|
-
return _context2.abrupt('break',
|
|
812
|
+
return _context2.abrupt('break', 59);
|
|
813
813
|
|
|
814
814
|
case 43:
|
|
815
815
|
conf.security.encrypt = "sm";
|
|
@@ -823,7 +823,7 @@ var render = function () {
|
|
|
823
823
|
conf.server.csp.decoration = typeof conf.server.csp.decoration === 'boolean' ? conf.server.csp.decoration : true;
|
|
824
824
|
conf.server.sri.enabled = true;
|
|
825
825
|
// conf.dev = false;
|
|
826
|
-
return _context2.abrupt('break',
|
|
826
|
+
return _context2.abrupt('break', 59);
|
|
827
827
|
|
|
828
828
|
case 53:
|
|
829
829
|
conf.security.encrypt = "none";
|
|
@@ -831,10 +831,11 @@ var render = function () {
|
|
|
831
831
|
conf.security.helmet = false;
|
|
832
832
|
// conf.server.f5Offline = false;
|
|
833
833
|
conf.security.isTire = true;
|
|
834
|
+
conf.server.heartbeat.enabled = typeof conf.server.heartbeat.enabled === 'boolean' ? conf.server.heartbeat.enabled : false;
|
|
834
835
|
// conf.dev = false;
|
|
835
|
-
return _context2.abrupt('break',
|
|
836
|
+
return _context2.abrupt('break', 59);
|
|
836
837
|
|
|
837
|
-
case
|
|
838
|
+
case 59:
|
|
838
839
|
|
|
839
840
|
// conf.router.config['app.examples'].enabled = true;
|
|
840
841
|
if (conf.server.yk4Addr) {
|
|
@@ -934,7 +935,7 @@ var render = function () {
|
|
|
934
935
|
conf.server.csp.directives = directives;
|
|
935
936
|
|
|
936
937
|
// const appPortUsed = [];
|
|
937
|
-
_context2.next =
|
|
938
|
+
_context2.next = 80;
|
|
938
939
|
return _yakuza._.asyncMap(conf.router.config, function () {
|
|
939
940
|
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
|
|
940
941
|
var name, arr, length, num;
|
|
@@ -1119,7 +1120,7 @@ var render = function () {
|
|
|
1119
1120
|
};
|
|
1120
1121
|
}());
|
|
1121
1122
|
|
|
1122
|
-
case
|
|
1123
|
+
case 80:
|
|
1123
1124
|
// console.log(conf.router.config);
|
|
1124
1125
|
|
|
1125
1126
|
conf.shareRule.app = conf.shareRule.app.map(function (ap) {
|
|
@@ -1241,7 +1242,7 @@ var render = function () {
|
|
|
1241
1242
|
|
|
1242
1243
|
return _context2.abrupt('return', { conf: conf });
|
|
1243
1244
|
|
|
1244
|
-
case
|
|
1245
|
+
case 91:
|
|
1245
1246
|
case 'end':
|
|
1246
1247
|
return _context2.stop();
|
|
1247
1248
|
}
|