yakuza0 2.23.37 → 2.23.40

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.
@@ -20,46 +20,96 @@ var _yakuza = require('yakuza1');
20
20
 
21
21
  var _secret = require('../../utils/secret');
22
22
 
23
+ var _httpDebug = require('../../utils/httpDebug');
24
+
23
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
26
 
25
27
  exports.default = function () {
26
28
  var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
27
- var store, app, keys;
29
+ var store, app, trace, startedAt, keys;
28
30
  return _regenerator2.default.wrap(function _callee2$(_context2) {
29
31
  while (1) {
30
32
  switch (_context2.prev = _context2.next) {
31
33
  case 0:
32
34
  store = ctx.store, app = ctx.app;
35
+ trace = (0, _httpDebug.getHttpDebugTrace)({ req: ctx.req });
36
+ startedAt = Date.now();
37
+
38
+ (0, _httpDebug.httpDebugLog)({
39
+ req: ctx.req,
40
+ trace: trace,
41
+ stage: 'NUXT_SERVER_INIT_SCAN',
42
+ data: {
43
+ route: ctx.route && ctx.route.fullPath,
44
+ actionCount: store && store._actions ? (0, _keys2.default)(store._actions).length : 0
45
+ }
46
+ });
33
47
 
34
48
  // await set(ctx);
35
49
 
36
50
  if (!(store && store._actions)) {
37
- _context2.next = 5;
51
+ _context2.next = 8;
38
52
  break;
39
53
  }
40
54
 
41
55
  keys = (0, _keys2.default)(store._actions);
42
- _context2.next = 5;
56
+ _context2.next = 8;
43
57
  return _yakuza._.asyncMap(keys, function () {
44
58
  var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(key, v) {
59
+ var actionStartedAt;
45
60
  return _regenerator2.default.wrap(function _callee$(_context) {
46
61
  while (1) {
47
62
  switch (_context.prev = _context.next) {
48
63
  case 0:
49
64
  if (!(key.indexOf('nuxtServerInit') !== -1)) {
50
- _context.next = 3;
65
+ _context.next = 13;
51
66
  break;
52
67
  }
53
68
 
54
- _context.next = 3;
69
+ actionStartedAt = Date.now();
70
+
71
+ (0, _httpDebug.httpDebugLog)({
72
+ trace: trace,
73
+ stage: 'NUXT_SERVER_INIT_ACTION_START',
74
+ data: { action: key }
75
+ });
76
+ _context.prev = 3;
77
+ _context.next = 6;
55
78
  return store.dispatch(key, ctx);
56
79
 
57
- case 3:
80
+ case 6:
81
+ (0, _httpDebug.httpDebugLog)({
82
+ trace: trace,
83
+ stage: 'NUXT_SERVER_INIT_ACTION_DONE',
84
+ data: {
85
+ action: key,
86
+ elapsedMs: Date.now() - actionStartedAt
87
+ }
88
+ });
89
+ _context.next = 13;
90
+ break;
91
+
92
+ case 9:
93
+ _context.prev = 9;
94
+ _context.t0 = _context['catch'](3);
95
+
96
+ (0, _httpDebug.httpDebugLog)({
97
+ trace: trace,
98
+ stage: 'NUXT_SERVER_INIT_ACTION_ERROR',
99
+ data: {
100
+ action: key,
101
+ elapsedMs: Date.now() - actionStartedAt
102
+ },
103
+ error: _context.t0
104
+ });
105
+ throw _context.t0;
106
+
107
+ case 13:
58
108
  case 'end':
59
109
  return _context.stop();
60
110
  }
61
111
  }
62
- }, _callee, undefined);
112
+ }, _callee, undefined, [[3, 9]]);
63
113
  }));
64
114
 
65
115
  return function (_x2, _x3) {
@@ -67,7 +117,16 @@ exports.default = function () {
67
117
  };
68
118
  }());
69
119
 
70
- case 5:
120
+ case 8:
121
+ (0, _httpDebug.httpDebugLog)({
122
+ trace: trace,
123
+ stage: 'NUXT_SERVER_INIT_DONE',
124
+ data: {
125
+ elapsedMs: Date.now() - startedAt
126
+ }
127
+ });
128
+
129
+ case 9:
71
130
  case 'end':
72
131
  return _context2.stop();
73
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.37",
3
+ "version": "2.23.40",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -115,13 +115,13 @@
115
115
  "ua-parser-js": "^0.7.40",
116
116
  "uglify-js": "^3.17.4",
117
117
  "v8-compile-cache": "^2.0.2",
118
- "yakuza1": "^2.6.21"
118
+ "yakuza1": "^2.6.25"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@evolvere/nuxt": "2.15.9",
122
122
  "core-js": "3.10.1",
123
123
  "eslint": "7.2.0",
124
- "yakuza1": "^2.6.21"
124
+ "yakuza1": "^2.6.25"
125
125
  },
126
126
  "__npminstall_done": false
127
127
  }