@aomex/access-log 0.0.0-stage → 4.4.1-alpha.c1419fd5.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/CHANGELOG.md +733 -0
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/index.d.ts +43 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/dist/websocket.d.ts +55 -0
- package/dist/websocket.js +98 -0
- package/dist/websocket.js.map +1 -0
- package/package.json +56 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [4.4.0](https://github.com/aomex/aomex/compare/v4.3.0...v4.4.0) (2026-11-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aomex/http-access-log
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [4.3.0](https://github.com/aomex/aomex/compare/v4.2.0...v4.3.0) (2026-11-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aomex/http-access-log
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [4.2.0](https://github.com/aomex/aomex/compare/v4.1.0...v4.2.0) (2026-11-20)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aomex/http-access-log
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [4.1.0](https://github.com/aomex/aomex/compare/v4.0.0...v4.1.0) (2026-11-18)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @aomex/http-access-log
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [4.0.0](https://github.com/aomex/aomex/compare/v3.30.7...v4.0.0) (2026-11-17)
|
|
39
|
+
|
|
40
|
+
* feat(logger)!: 引入 BaseLoggerService ([4c2657a](https://github.com/aomex/aomex/commit/4c2657aae21d3fcbe139d4de3477a6415d901b2c))
|
|
41
|
+
|
|
42
|
+
### BREAKING CHANGES
|
|
43
|
+
|
|
44
|
+
* http-logger 重命名为 http-access-log
|
|
45
|
+
* logger需绑定到service中使用
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## [3.30.7](https://github.com/aomex/aomex/compare/v3.30.6...v3.30.7) (2026-11-01)
|
|
49
|
+
|
|
50
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## [3.30.6](https://github.com/aomex/aomex/compare/v3.30.5...v3.30.6) (2026-10-19)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## [3.30.5](https://github.com/aomex/aomex/compare/v3.30.4...v3.30.5) (2026-06-16)
|
|
65
|
+
|
|
66
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## [3.30.4](https://github.com/aomex/aomex/compare/v3.30.3...v3.30.4) (2026-01-21)
|
|
73
|
+
|
|
74
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## [3.30.3](https://github.com/aomex/aomex/compare/v3.30.2...v3.30.3) (2025-12-01)
|
|
81
|
+
|
|
82
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## [3.30.2](https://github.com/aomex/aomex/compare/v3.30.1...v3.30.2) (2025-12-01)
|
|
89
|
+
|
|
90
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## [3.30.1](https://github.com/aomex/aomex/compare/v3.30.0...v3.30.1) (2025-12-01)
|
|
97
|
+
|
|
98
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# [3.30.0](https://github.com/aomex/aomex/compare/v3.29.2...v3.30.0) (2025-11-30)
|
|
105
|
+
|
|
106
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## [3.29.2](https://github.com/aomex/aomex/compare/v3.29.1...v3.29.2) (2025-08-25)
|
|
113
|
+
|
|
114
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## [3.29.1](https://github.com/aomex/aomex/compare/v3.29.0...v3.29.1) (2025-07-26)
|
|
121
|
+
|
|
122
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# [3.29.0](https://github.com/aomex/aomex/compare/v3.28.3...v3.29.0) (2025-07-17)
|
|
129
|
+
|
|
130
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## [3.28.3](https://github.com/aomex/aomex/compare/v3.28.2...v3.28.3) (2025-07-10)
|
|
137
|
+
|
|
138
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [3.28.2](https://github.com/aomex/aomex/compare/v3.28.1...v3.28.2) (2025-07-09)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## [3.28.1](https://github.com/aomex/aomex/compare/v3.28.0...v3.28.1) (2025-07-08)
|
|
153
|
+
|
|
154
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# [3.28.0](https://github.com/aomex/aomex/compare/v3.27.4...v3.28.0) (2025-07-08)
|
|
161
|
+
|
|
162
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## [3.27.4](https://github.com/aomex/aomex/compare/v3.27.3...v3.27.4) (2025-06-29)
|
|
169
|
+
|
|
170
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
## [3.27.3](https://github.com/aomex/aomex/compare/v3.27.2...v3.27.3) (2025-06-29)
|
|
177
|
+
|
|
178
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
## [3.27.2](https://github.com/aomex/aomex/compare/v3.27.1...v3.27.2) (2025-06-04)
|
|
185
|
+
|
|
186
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
## [3.27.1](https://github.com/aomex/aomex/compare/v3.27.0...v3.27.1) (2025-05-22)
|
|
193
|
+
|
|
194
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# [3.27.0](https://github.com/aomex/aomex/compare/v3.26.0...v3.27.0) (2025-05-03)
|
|
201
|
+
|
|
202
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
# [3.26.0](https://github.com/aomex/aomex/compare/v3.25.0...v3.26.0) (2025-05-03)
|
|
209
|
+
|
|
210
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# [3.25.0](https://github.com/aomex/aomex/compare/v3.24.0...v3.25.0) (2025-04-22)
|
|
217
|
+
|
|
218
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
# [3.24.0](https://github.com/aomex/aomex/compare/v3.23.3...v3.24.0) (2025-04-20)
|
|
225
|
+
|
|
226
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
## [3.23.3](https://github.com/aomex/aomex/compare/v3.23.2...v3.23.3) (2025-04-18)
|
|
233
|
+
|
|
234
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
## [3.23.2](https://github.com/aomex/aomex/compare/v3.23.1...v3.23.2) (2025-04-18)
|
|
241
|
+
|
|
242
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
## [3.23.1](https://github.com/aomex/aomex/compare/v3.23.0...v3.23.1) (2025-04-18)
|
|
249
|
+
|
|
250
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# [3.23.0](https://github.com/aomex/aomex/compare/v3.22.0...v3.23.0) (2025-04-16)
|
|
257
|
+
|
|
258
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
# [3.22.0](https://github.com/aomex/aomex/compare/v3.21.1...v3.22.0) (2025-04-07)
|
|
265
|
+
|
|
266
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
## [3.21.1](https://github.com/aomex/aomex/compare/v3.21.0...v3.21.1) (2025-04-06)
|
|
273
|
+
|
|
274
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
# [3.21.0](https://github.com/aomex/aomex/compare/v3.20.0...v3.21.0) (2025-04-06)
|
|
281
|
+
|
|
282
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
# [3.20.0](https://github.com/aomex/aomex/compare/v3.19.2...v3.20.0) (2025-04-05)
|
|
289
|
+
|
|
290
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
## [3.19.2](https://github.com/aomex/aomex/compare/v3.19.1...v3.19.2) (2025-04-05)
|
|
297
|
+
|
|
298
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
## [3.19.1](https://github.com/aomex/aomex/compare/v3.19.0...v3.19.1) (2025-04-05)
|
|
305
|
+
|
|
306
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
# [3.19.0](https://github.com/aomex/aomex/compare/v3.18.0...v3.19.0) (2025-04-05)
|
|
313
|
+
|
|
314
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
# [3.18.0](https://github.com/aomex/aomex/compare/v3.17.3...v3.18.0) (2025-04-03)
|
|
321
|
+
|
|
322
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
## [3.17.3](https://github.com/aomex/aomex/compare/v3.17.2...v3.17.3) (2025-03-26)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
### Bug Fixes
|
|
332
|
+
|
|
333
|
+
* 内部依赖使用固定版本号 ([aa70c2a](https://github.com/aomex/aomex/commit/aa70c2ad444414ec6619b9579ad8037a7191a86f))
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
## [3.17.2](https://github.com/aomex/aomex/compare/v3.17.1...v3.17.2) (2025-03-26)
|
|
340
|
+
|
|
341
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
## [3.17.1](https://github.com/aomex/aomex/compare/v3.17.0...v3.17.1) (2025-03-09)
|
|
348
|
+
|
|
349
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
# [3.17.0](https://github.com/aomex/aomex/compare/v3.16.0...v3.17.0) (2025-03-09)
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
### Features
|
|
359
|
+
|
|
360
|
+
* **http-logger:** 增加disable属性禁用日志 ([8d43283](https://github.com/aomex/aomex/commit/8d43283b00e5df9e398655b5e5b78049cd20083a))
|
|
361
|
+
* **logger:** 独立安装 ([9a3f444](https://github.com/aomex/aomex/commit/9a3f4446ba7dd2da9a7f52eec8891624e9208435))
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
# [3.16.0](https://github.com/aomex/aomex/compare/v3.15.1...v3.16.0) (2025-03-09)
|
|
368
|
+
|
|
369
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
## [3.15.1](https://github.com/aomex/aomex/compare/v3.15.0...v3.15.1) (2025-02-09)
|
|
376
|
+
|
|
377
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
# [3.15.0](https://github.com/aomex/aomex/compare/v3.14.2...v3.15.0) (2025-02-09)
|
|
384
|
+
|
|
385
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
## [3.14.2](https://github.com/aomex/aomex/compare/v3.14.1...v3.14.2) (2025-01-14)
|
|
392
|
+
|
|
393
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
## [3.14.1](https://github.com/aomex/aomex/compare/v3.14.0...v3.14.1) (2025-01-09)
|
|
400
|
+
|
|
401
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
# [3.14.0](https://github.com/aomex/aomex/compare/v3.13.1...v3.14.0) (2025-01-02)
|
|
408
|
+
|
|
409
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
## [3.13.1](https://github.com/aomex/aomex/compare/v3.13.0...v3.13.1) (2024-12-29)
|
|
416
|
+
|
|
417
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
# [3.13.0](https://github.com/aomex/aomex/compare/v3.12.1...v3.13.0) (2024-12-27)
|
|
424
|
+
|
|
425
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
## [3.12.1](https://github.com/aomex/aomex/compare/v3.12.0...v3.12.1) (2024-12-19)
|
|
432
|
+
|
|
433
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
# [3.12.0](https://github.com/aomex/aomex/compare/v3.11.0...v3.12.0) (2024-11-07)
|
|
440
|
+
|
|
441
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
# [3.11.0](https://github.com/aomex/aomex/compare/v3.10.0...v3.11.0) (2024-11-07)
|
|
448
|
+
|
|
449
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
# [3.10.0](https://github.com/aomex/aomex/compare/v3.9.0...v3.10.0) (2024-11-02)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
### Features
|
|
459
|
+
|
|
460
|
+
* **logger:** timestamp使用日期类型 ([26a5931](https://github.com/aomex/aomex/commit/26a5931ca0a9dfdb5a7abcdfd967092e5334aa04))
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
# [3.9.0](https://github.com/aomex/aomex/compare/v3.8.1...v3.9.0) (2024-10-30)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
### Features
|
|
470
|
+
|
|
471
|
+
* **http-logger:** 请求日志简化为一条 ([71a9c91](https://github.com/aomex/aomex/commit/71a9c91df80adbfb87ca07b25b52c3b430ad1b12))
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
## [3.8.1](https://github.com/aomex/aomex/compare/v3.8.0...v3.8.1) (2024-10-26)
|
|
478
|
+
|
|
479
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
# [3.8.0](https://github.com/aomex/aomex/compare/v3.7.2...v3.8.0) (2024-10-26)
|
|
486
|
+
|
|
487
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
## [3.7.2](https://github.com/aomex/aomex/compare/v3.7.1...v3.7.2) (2024-10-22)
|
|
494
|
+
|
|
495
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
## [3.7.1](https://github.com/aomex/aomex/compare/v3.7.0...v3.7.1) (2024-10-22)
|
|
502
|
+
|
|
503
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
# [3.7.0](https://github.com/aomex/aomex/compare/v3.6.0...v3.7.0) (2024-10-19)
|
|
510
|
+
|
|
511
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
# [3.6.0](https://github.com/aomex/aomex/compare/v3.5.0...v3.6.0) (2024-10-17)
|
|
518
|
+
|
|
519
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
# [3.5.0](https://github.com/aomex/aomex/compare/v3.4.2...v3.5.0) (2024-10-16)
|
|
526
|
+
|
|
527
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
## [3.4.2](https://github.com/aomex/aomex/compare/v3.4.1...v3.4.2) (2024-10-07)
|
|
534
|
+
|
|
535
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
## [3.4.1](https://github.com/aomex/aomex/compare/v3.4.0...v3.4.1) (2024-10-06)
|
|
542
|
+
|
|
543
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
# [3.4.0](https://github.com/aomex/aomex/compare/v3.3.0...v3.4.0) (2024-10-04)
|
|
550
|
+
|
|
551
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
# [3.3.0](https://github.com/aomex/aomex/compare/v3.2.4...v3.3.0) (2024-09-26)
|
|
558
|
+
|
|
559
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
## [3.2.4](https://github.com/aomex/aomex/compare/v3.2.3...v3.2.4) (2024-09-25)
|
|
566
|
+
|
|
567
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
## [3.2.3](https://github.com/aomex/aomex/compare/v3.2.2...v3.2.3) (2024-09-25)
|
|
574
|
+
|
|
575
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
## [3.2.2](https://github.com/aomex/aomex/compare/v3.2.1...v3.2.2) (2024-09-19)
|
|
582
|
+
|
|
583
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
## [3.2.1](https://github.com/aomex/aomex/compare/v3.2.0...v3.2.1) (2024-09-17)
|
|
590
|
+
|
|
591
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
# [3.2.0](https://github.com/aomex/aomex/compare/v3.1.1...v3.2.0) (2024-09-17)
|
|
598
|
+
|
|
599
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
## [3.1.1](https://github.com/aomex/aomex/compare/v3.1.0...v3.1.1) (2024-09-13)
|
|
606
|
+
|
|
607
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
# [3.1.0](https://github.com/aomex/aomex/compare/v3.0.0...v3.1.0) (2024-09-13)
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
### Bug Fixes
|
|
617
|
+
|
|
618
|
+
* update peer deps ([98b7c10](https://github.com/aomex/aomex/commit/98b7c10068a3c62a0361b1b43a86728a7d445ab5))
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
# [2.2.0](https://github.com/aomex/aomex/compare/v2.1.0...v2.2.0) (2024-08-05)
|
|
627
|
+
|
|
628
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
# [2.1.0](https://github.com/aomex/aomex/compare/v2.0.2...v2.1.0) (2024-07-28)
|
|
635
|
+
|
|
636
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
## [2.0.2](https://github.com/aomex/aomex/compare/v2.0.1...v2.0.2) (2024-07-27)
|
|
643
|
+
|
|
644
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
## [2.0.1](https://github.com/aomex/aomex/compare/v2.0.0...v2.0.1) (2024-07-26)
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
### Bug Fixes
|
|
654
|
+
|
|
655
|
+
* 未更新peerDependencies ([0492453](https://github.com/aomex/aomex/commit/0492453d5a748aa6dd2047622a19a86dc7b6036e))
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
# [2.0.0](https://github.com/aomex/aomex/compare/v1.7.0...v2.0.0) (2024-07-26)
|
|
662
|
+
|
|
663
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
# [1.7.0](https://github.com/aomex/aomex/compare/v1.6.0...v1.7.0) (2024-07-13)
|
|
670
|
+
|
|
671
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
# [1.6.0](https://github.com/aomex/aomex/compare/v1.5.1...v1.6.0) (2024-07-05)
|
|
678
|
+
|
|
679
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
## [1.5.1](https://github.com/aomex/aomex/compare/v1.5.0...v1.5.1) (2024-07-04)
|
|
686
|
+
|
|
687
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
# [1.5.0](https://github.com/aomex/aomex/compare/v1.4.0...v1.5.0) (2024-07-04)
|
|
694
|
+
|
|
695
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
# [1.4.0](https://github.com/aomex/aomex/compare/v1.3.0...v1.4.0) (2024-06-29)
|
|
702
|
+
|
|
703
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
# [1.3.0](https://github.com/aomex/aomex/compare/v1.2.0...v1.3.0) (2024-06-28)
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
### Features
|
|
713
|
+
|
|
714
|
+
* **core:** 删除中间件链条概念 ([12f42e6](https://github.com/aomex/aomex/commit/12f42e6ba15f3118b98f5ff31832121b1b2b9896))
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
# [1.2.0](https://github.com/aomex/aomex/compare/v1.1.0...v1.2.0) (2024-06-27)
|
|
721
|
+
|
|
722
|
+
**Note:** Version bump only for package @aomex/http-logger
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
# 1.1.0 (2024-06-27)
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
### Features
|
|
732
|
+
|
|
733
|
+
* 初始化 ([3350159](https://github.com/aomex/aomex/commit/3350159454ad230e6d910405f907293b059b1f49))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 geekact
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aomex/access-log
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
文档:https://aomex.js.org
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Transport } from "@aomex/logger";
|
|
2
|
+
import { WebContext, WebMiddleware } from "@aomex/web";
|
|
3
|
+
export interface HttpAccessLogOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 是否禁用请求日志。默认:`false`
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 响应输出格式,建议使用 **HttpAccessLogToken** 拼接。默认值:`[ip] [method] [url] [statusCode] [duration] [contentLength]`
|
|
10
|
+
*/
|
|
11
|
+
format?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 日志输出端口。默认使用 `ConsoleTransport`;传空数组相当于禁用。
|
|
14
|
+
*/
|
|
15
|
+
transports?: Transport[];
|
|
16
|
+
/**
|
|
17
|
+
* 自定义关键词
|
|
18
|
+
* ```
|
|
19
|
+
* httpAccessLog({
|
|
20
|
+
* format: ' [request] [time] [href]',
|
|
21
|
+
* customTokens: {
|
|
22
|
+
* href: (ctx) => ctx.request.href,
|
|
23
|
+
* },
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
customTokens?: {
|
|
28
|
+
[key: string]: (ctx: WebContext) => string | Promise<string>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* HTTP 访问日志。挂在 `WebApp.mount` 里。
|
|
33
|
+
*/
|
|
34
|
+
export declare const httpAccessLog: (options?: HttpAccessLogOptions) => WebMiddleware;
|
|
35
|
+
export declare enum HttpAccessLogToken {
|
|
36
|
+
method = "[method]",
|
|
37
|
+
url = "[url]",
|
|
38
|
+
statusCode = "[statusCode]",
|
|
39
|
+
contentLength = "[contentLength]",
|
|
40
|
+
contentType = "[contentType]",
|
|
41
|
+
duration = "[duration]",
|
|
42
|
+
ip = "[ip]"
|
|
43
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { middleware } from "@aomex/common";
|
|
2
|
+
import { BaseLoggerService, ConsoleTransport } from "@aomex/logger";
|
|
3
|
+
import stream from "node:stream";
|
|
4
|
+
import prettyTime from "pretty-time";
|
|
5
|
+
import { bytes } from "@aomex/internal-tools";
|
|
6
|
+
import { statuses } from "@aomex/web";
|
|
7
|
+
import { styleText } from "node:util";
|
|
8
|
+
// src/http-access-log-token.ts
|
|
9
|
+
let HttpAccessLogToken = /* @__PURE__ */ function(HttpAccessLogToken) {
|
|
10
|
+
HttpAccessLogToken["method"] = "[method]";
|
|
11
|
+
HttpAccessLogToken["url"] = "[url]";
|
|
12
|
+
HttpAccessLogToken["statusCode"] = "[statusCode]";
|
|
13
|
+
HttpAccessLogToken["contentLength"] = "[contentLength]";
|
|
14
|
+
HttpAccessLogToken["contentType"] = "[contentType]";
|
|
15
|
+
HttpAccessLogToken["duration"] = "[duration]";
|
|
16
|
+
HttpAccessLogToken["ip"] = "[ip]";
|
|
17
|
+
return HttpAccessLogToken;
|
|
18
|
+
}({});
|
|
19
|
+
// src/counter.ts
|
|
20
|
+
var Counter = class extends stream.Transform {
|
|
21
|
+
length = 0;
|
|
22
|
+
_transform(chunk, _encoding, callback) {
|
|
23
|
+
this.length += chunk.length;
|
|
24
|
+
this.push(chunk);
|
|
25
|
+
callback();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
// src/replace-token.ts
|
|
29
|
+
const colorCodes = {
|
|
30
|
+
7: "magenta",
|
|
31
|
+
5: "red",
|
|
32
|
+
4: "yellow",
|
|
33
|
+
3: "cyan",
|
|
34
|
+
2: "green",
|
|
35
|
+
1: "green",
|
|
36
|
+
0: "yellow"
|
|
37
|
+
};
|
|
38
|
+
const pattern = /\[[^\[\]]+\]/g;
|
|
39
|
+
const replaceToken = async (opts) => {
|
|
40
|
+
const { message, startTime, request, response = {}, tokens = {} } = opts;
|
|
41
|
+
const { method, url } = request;
|
|
42
|
+
const { contentLength, contentType = "-", statusCode = 404 } = response;
|
|
43
|
+
let formatted = message;
|
|
44
|
+
for (let match of message.matchAll(pattern)) {
|
|
45
|
+
const tokenWithBrackets = match[0];
|
|
46
|
+
const token = tokenWithBrackets.slice(1, -1);
|
|
47
|
+
const replace = (data) => {
|
|
48
|
+
formatted = formatted.replaceAll(tokenWithBrackets, data);
|
|
49
|
+
};
|
|
50
|
+
if (tokens[token]) replace(await tokens[token]());
|
|
51
|
+
switch (`[${token}]`) {
|
|
52
|
+
case "[method]":
|
|
53
|
+
replace(styleText("bold", method));
|
|
54
|
+
break;
|
|
55
|
+
case "[url]":
|
|
56
|
+
replace(styleText("gray", url));
|
|
57
|
+
break;
|
|
58
|
+
case "[statusCode]":
|
|
59
|
+
const c = colorCodes[statusCode / 100 | 0] || colorCodes[0];
|
|
60
|
+
replace(styleText(c, statusCode.toString()));
|
|
61
|
+
break;
|
|
62
|
+
case "[contentLength]":
|
|
63
|
+
replace(styleText("gray", statuses.empty[statusCode] || contentLength === 0 ? "0" : contentLength == null ? "-" : bytes(contentLength).toLowerCase()));
|
|
64
|
+
break;
|
|
65
|
+
case "[contentType]":
|
|
66
|
+
replace(styleText("gray", contentType));
|
|
67
|
+
break;
|
|
68
|
+
case "[duration]":
|
|
69
|
+
replace(styleText("gray", prettyTime(process.hrtime(startTime))));
|
|
70
|
+
break;
|
|
71
|
+
case "[ip]": replace(styleText("gray", request.ip));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return formatted;
|
|
75
|
+
};
|
|
76
|
+
// src/http-access-log.ts
|
|
77
|
+
var HttpAccessLogService = class extends BaseLoggerService {
|
|
78
|
+
entries;
|
|
79
|
+
constructor(entries) {
|
|
80
|
+
super();
|
|
81
|
+
this.entries = entries;
|
|
82
|
+
}
|
|
83
|
+
createTransports() {
|
|
84
|
+
return this.entries;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* HTTP 访问日志。挂在 `WebApp.mount` 里。
|
|
89
|
+
*/
|
|
90
|
+
const httpAccessLog = (options = {}) => {
|
|
91
|
+
const { disabled = false, customTokens } = options;
|
|
92
|
+
const format = options.format || `[ip] [method] [url] [statusCode] [duration] [contentLength]`;
|
|
93
|
+
const transportList = options.transports ?? [new ConsoleTransport()];
|
|
94
|
+
const logger = new HttpAccessLogService(transportList.map((transport) => ({ transport })));
|
|
95
|
+
return middleware.web(async (ctx, next) => {
|
|
96
|
+
if (disabled || transportList.length === 0) return next();
|
|
97
|
+
const start = process.hrtime();
|
|
98
|
+
const tokens = customTokens ? Object.fromEntries(Object.entries(customTokens).map(([key, value]) => {
|
|
99
|
+
return [key, value.bind(null, ctx)];
|
|
100
|
+
})) : {};
|
|
101
|
+
try {
|
|
102
|
+
await next();
|
|
103
|
+
} finally {
|
|
104
|
+
const { response, response: { body } } = ctx;
|
|
105
|
+
let counter;
|
|
106
|
+
if (body instanceof stream.Readable && body.readable) ctx.send(body.pipe(counter = new Counter()));
|
|
107
|
+
response.once("close", async () => {
|
|
108
|
+
logger.info(await replaceToken({
|
|
109
|
+
message: format,
|
|
110
|
+
tokens,
|
|
111
|
+
startTime: start,
|
|
112
|
+
request: ctx.request,
|
|
113
|
+
response: {
|
|
114
|
+
statusCode: response.statusCode,
|
|
115
|
+
contentType: response.contentType,
|
|
116
|
+
contentLength: counter ? counter.length : response.contentLength
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
export { HttpAccessLogToken, httpAccessLog };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/http-access-log-token.ts","../src/counter.ts","../src/replace-token.ts","../src/http-access-log.ts"],"sourcesContent":["export enum HttpAccessLogToken {\n method = '[method]',\n url = '[url]',\n statusCode = '[statusCode]',\n contentLength = '[contentLength]',\n contentType = '[contentType]',\n duration = '[duration]',\n ip = '[ip]',\n}\n","import stream, { type TransformCallback } from 'node:stream';\n\nexport class Counter extends stream.Transform {\n public length: number = 0;\n\n override _transform(\n chunk: any,\n _encoding: BufferEncoding,\n callback: TransformCallback,\n ): void {\n this.length += chunk.length;\n this.push(chunk);\n callback();\n }\n}\n","import prettyTime from 'pretty-time';\nimport { bytes } from '@aomex/internal-tools';\nimport { statuses } from '@aomex/web';\nimport { HttpAccessLogToken } from './http-access-log-token';\nimport { styleText } from 'node:util';\n\nexport const colorCodes = <const>{\n 7: 'magenta',\n 5: 'red',\n 4: 'yellow',\n 3: 'cyan',\n 2: 'green',\n 1: 'green',\n 0: 'yellow',\n};\n\nconst pattern = /\\[[^\\[\\]]+\\]/g;\n\nexport const replaceToken = async (opts: {\n message: string;\n startTime: [number, number];\n tokens?: { [key: string]: () => string | Promise<string> };\n request: {\n method: string;\n url: string;\n ip: string;\n };\n response?: {\n statusCode?: number;\n contentType?: string;\n contentLength?: number;\n };\n}): Promise<string> => {\n const { message, startTime, request, response = {}, tokens = {} } = opts;\n const { method, url } = request;\n const { contentLength, contentType = '-', statusCode = 404 } = response;\n let formatted = message;\n\n for (let match of message.matchAll(pattern)) {\n const tokenWithBrackets = match[0];\n const token = tokenWithBrackets.slice(1, -1);\n\n const replace = (data: string) => {\n formatted = formatted.replaceAll(tokenWithBrackets, data);\n };\n\n if (tokens[token]) {\n replace(await tokens[token]!());\n }\n\n switch (`[${token}]`) {\n case HttpAccessLogToken.method:\n replace(styleText('bold', method));\n break;\n case HttpAccessLogToken.url:\n replace(styleText('gray', url));\n break;\n case HttpAccessLogToken.statusCode:\n const c =\n colorCodes[((statusCode / 100) | 0) as keyof typeof colorCodes] ||\n colorCodes[0]!;\n replace(styleText(c, statusCode.toString()));\n break;\n case HttpAccessLogToken.contentLength:\n replace(\n styleText(\n 'gray',\n statuses.empty[statusCode] || contentLength === 0\n ? '0'\n : contentLength == null\n ? '-'\n : bytes(contentLength).toLowerCase(),\n ),\n );\n break;\n case HttpAccessLogToken.contentType:\n replace(styleText('gray', contentType));\n break;\n case HttpAccessLogToken.duration:\n replace(styleText('gray', prettyTime(process.hrtime(startTime))));\n break;\n case HttpAccessLogToken.ip:\n replace(styleText('gray', request.ip));\n break;\n }\n }\n\n return formatted;\n};\n","import { middleware } from '@aomex/common';\nimport { BaseLoggerService, ConsoleTransport, type Transport } from '@aomex/logger';\nimport type { WebContext, WebMiddleware } from '@aomex/web';\nimport { HttpAccessLogToken } from './http-access-log-token';\nimport { Counter } from './counter';\nimport stream from 'node:stream';\nimport { replaceToken } from './replace-token';\n\nexport interface HttpAccessLogOptions {\n /**\n * 是否禁用请求日志。默认:`false`\n */\n disabled?: boolean;\n /**\n * 响应输出格式,建议使用 **HttpAccessLogToken** 拼接。默认值:`[ip] [method] [url] [statusCode] [duration] [contentLength]`\n */\n format?: string;\n /**\n * 日志输出端口。默认使用 `ConsoleTransport`;传空数组相当于禁用。\n */\n transports?: Transport[];\n /**\n * 自定义关键词\n * ```\n * httpAccessLog({\n * format: ' [request] [time] [href]',\n * customTokens: {\n * href: (ctx) => ctx.request.href,\n * },\n * })\n * ```\n */\n customTokens?: { [key: string]: (ctx: WebContext) => string | Promise<string> };\n}\n\nclass HttpAccessLogService extends BaseLoggerService {\n constructor(private readonly entries: BaseLoggerService.TransportEntry[]) {\n super();\n }\n\n protected createTransports(): BaseLoggerService.TransportEntry[] {\n return this.entries;\n }\n}\n\n/**\n * HTTP 访问日志。挂在 `WebApp.mount` 里。\n */\nexport const httpAccessLog = (options: HttpAccessLogOptions = {}): WebMiddleware => {\n const { disabled = false, customTokens } = options;\n const format =\n options.format ||\n `${HttpAccessLogToken.ip} ${HttpAccessLogToken.method} ${HttpAccessLogToken.url} ${HttpAccessLogToken.statusCode} ${HttpAccessLogToken.duration} ${HttpAccessLogToken.contentLength}`;\n\n const transportList = options.transports ?? [new ConsoleTransport()];\n\n const logger = new HttpAccessLogService(\n transportList.map((transport) => ({ transport })),\n );\n\n return middleware.web(async (ctx, next) => {\n if (disabled || transportList.length === 0) return next();\n\n const start = process.hrtime();\n const tokens = customTokens\n ? Object.fromEntries(\n Object.entries(customTokens).map(([key, value]) => {\n return [key, value.bind(null, ctx)];\n }),\n )\n : {};\n\n try {\n await next();\n } finally {\n const {\n response,\n response: { body },\n } = ctx;\n let counter: Counter | undefined;\n if (body instanceof stream.Readable && body.readable) {\n ctx.send(body.pipe((counter = new Counter())));\n }\n\n response.once('close', async () => {\n logger.info(\n await replaceToken({\n message: format,\n tokens,\n startTime: start,\n request: ctx.request,\n response: {\n statusCode: response.statusCode,\n contentType: response.contentType,\n contentLength: counter ? counter.length : response.contentLength,\n },\n }),\n );\n });\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,YAAA;CACA,mBAAA,SAAA;CACA,mBAAA,gBAAA;CACA,mBAAA,mBAAA;CACA,mBAAA,iBAAA;CACA,mBAAA,cAAA;CACA,mBAAA,QAAA;;AACF,EAAA,CAAA,CAAA;;ACNA,IAAa,UAAb,cAA6B,OAAO,UAAU;CAC5C,SAAwB;CAExB,WACE,OACA,WACA,UACM;EACN,KAAK,UAAU,MAAM;EACrB,KAAK,KAAK,KAAK;EACf,SAAS;CACX;AACF;;ACRA,MAAa,aAAoB;CAC/B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,UAAU;AAEhB,MAAa,eAAe,OAAO,SAcZ;CACrB,MAAM,EAAE,SAAS,WAAW,SAAS,WAAW,CAAC,GAAG,SAAS,CAAC,MAAM;CACpE,MAAM,EAAE,QAAQ,QAAQ;CACxB,MAAM,EAAE,eAAe,cAAc,KAAK,aAAa,QAAQ;CAC/D,IAAI,YAAY;CAEhB,KAAK,IAAI,SAAS,QAAQ,SAAS,OAAO,GAAG;EAC3C,MAAM,oBAAoB,MAAM;EAChC,MAAM,QAAQ,kBAAkB,MAAM,GAAG,EAAE;EAE3C,MAAM,WAAW,SAAiB;GAChC,YAAY,UAAU,WAAW,mBAAmB,IAAI;EAC1D;EAEA,IAAI,OAAO,QACT,QAAQ,MAAM,OAAO,MAAM,CAAE,CAAC;EAGhC,QAAQ,IAAI,MAAM,IAAlB;GACE,KAAA;IACE,QAAQ,UAAU,QAAQ,MAAM,CAAC;IACjC;GACF,KAAA;IACE,QAAQ,UAAU,QAAQ,GAAG,CAAC;IAC9B;GACF,KAAA;IACE,MAAM,IACJ,WAAa,aAAa,MAAO,MACjC,WAAW;IACb,QAAQ,UAAU,GAAG,WAAW,SAAS,CAAC,CAAC;IAC3C;GACF,KAAA;IACE,QACE,UACE,QACA,SAAS,MAAM,eAAe,kBAAkB,IAC5C,MACA,iBAAiB,OACf,MACA,MAAM,aAAa,CAAC,CAAC,YAAY,CACzC,CACF;IACA;GACF,KAAA;IACE,QAAQ,UAAU,QAAQ,WAAW,CAAC;IACtC;GACF,KAAA;IACE,QAAQ,UAAU,QAAQ,WAAW,QAAQ,OAAO,SAAS,CAAC,CAAC,CAAC;IAChE;GACF,KAAA,QACE,QAAQ,UAAU,QAAQ,QAAQ,EAAE,CAAC;EAEzC;CACF;CAEA,OAAO;AACT;;ACrDA,IAAM,uBAAN,cAAmC,kBAAkB;CACtB;CAA7B,YAAY,SAA8D;EACxE,MAAM;EADqB,KAAA,UAAA;CAE7B;CAEA,mBAAiE;EAC/D,OAAO,KAAK;CACd;AACF;;;;AAKA,MAAa,iBAAiB,UAAgC,CAAC,MAAqB;CAClF,MAAM,EAAE,WAAW,OAAO,iBAAiB;CAC3C,MAAM,SACJ,QAAQ,UACR;CAEF,MAAM,gBAAgB,QAAQ,cAAc,CAAC,IAAI,iBAAiB,CAAC;CAEnE,MAAM,SAAS,IAAI,qBACjB,cAAc,KAAK,eAAe,EAAE,UAAU,EAAE,CAClD;CAEA,OAAO,WAAW,IAAI,OAAO,KAAK,SAAS;EACzC,IAAI,YAAY,cAAc,WAAW,GAAG,OAAO,KAAK;EAExD,MAAM,QAAQ,QAAQ,OAAO;EAC7B,MAAM,SAAS,eACX,OAAO,YACL,OAAO,QAAQ,YAAY,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW;GACjD,OAAO,CAAC,KAAK,MAAM,KAAK,MAAM,GAAG,CAAC;EACpC,CAAC,CACH,IACA,CAAC;EAEL,IAAI;GACF,MAAM,KAAK;EACb,UAAU;GACR,MAAM,EACJ,UACA,UAAU,EAAE,WACV;GACJ,IAAI;GACJ,IAAI,gBAAgB,OAAO,YAAY,KAAK,UAC1C,IAAI,KAAK,KAAK,KAAM,UAAU,IAAI,QAAQ,CAAE,CAAC;GAG/C,SAAS,KAAK,SAAS,YAAY;IACjC,OAAO,KACL,MAAM,aAAa;KACjB,SAAS;KACT;KACA,WAAW;KACX,SAAS,IAAI;KACb,UAAU;MACR,YAAY,SAAS;MACrB,aAAa,SAAS;MACtB,eAAe,UAAU,QAAQ,SAAS,SAAS;KACrD;IACF,CAAC,CACH;GACF,CAAC;EACH;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Transport } from "@aomex/logger";
|
|
2
|
+
import { WebsocketContext } from "@aomex/websocket";
|
|
3
|
+
/** WebSocket 入站访问日志令牌 */
|
|
4
|
+
export declare enum WebsocketAccessLogToken {
|
|
5
|
+
ip = "[ip]",
|
|
6
|
+
clientId = "[clientId]",
|
|
7
|
+
event = "[event]",
|
|
8
|
+
duration = "[duration]"
|
|
9
|
+
}
|
|
10
|
+
export interface WebsocketAccessLogOptions {
|
|
11
|
+
/**
|
|
12
|
+
* 是否禁用入站日志。默认:`false`
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 输出格式,建议使用 **WebsocketAccessLogToken** 拼接。
|
|
17
|
+
* 默认:`[ip] [clientId] [event] [duration]`
|
|
18
|
+
*/
|
|
19
|
+
format?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 日志输出端口。默认使用 `ConsoleTransport`;传空数组相当于禁用。
|
|
22
|
+
*/
|
|
23
|
+
transports?: Transport[];
|
|
24
|
+
/**
|
|
25
|
+
* 自定义关键词
|
|
26
|
+
* ```
|
|
27
|
+
* websocketAccessLog({
|
|
28
|
+
* format: '[event] [room]',
|
|
29
|
+
* customTokens: {
|
|
30
|
+
* room: (ctx) => String(ctx.client.data['room'] ?? '-'),
|
|
31
|
+
* },
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
customTokens?: {
|
|
36
|
+
[key: string]: (ctx: WebsocketContext) => string | Promise<string>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 入站消息访问日志。挂在 `WebsocketApp.mount` 里、`channels()` 前面。
|
|
41
|
+
* 每条入站消息在中间件链结束后打一条日志(含抛错路径)。
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { websocketAccessLog } from '@aomex/access-log/websocket';
|
|
45
|
+
* import { WebsocketApp, channels } from '@aomex/websocket';
|
|
46
|
+
*
|
|
47
|
+
* new WebsocketApp({
|
|
48
|
+
* logger,
|
|
49
|
+
* language,
|
|
50
|
+
* transport,
|
|
51
|
+
* mount: [websocketAccessLog(), channels('./src/channels')],
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const websocketAccessLog: (options?: WebsocketAccessLogOptions) => import("@aomex/websocket").SocketMiddleware<object>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { middleware } from "@aomex/common";
|
|
2
|
+
import { BaseLoggerService, ConsoleTransport } from "@aomex/logger";
|
|
3
|
+
import prettyTime from "pretty-time";
|
|
4
|
+
import { styleText } from "node:util";
|
|
5
|
+
import "@aomex/websocket";
|
|
6
|
+
// src/websocket-token.ts
|
|
7
|
+
/** WebSocket 入站访问日志令牌 */
|
|
8
|
+
let WebsocketAccessLogToken = /* @__PURE__ */ function(WebsocketAccessLogToken) {
|
|
9
|
+
WebsocketAccessLogToken["ip"] = "[ip]";
|
|
10
|
+
WebsocketAccessLogToken["clientId"] = "[clientId]";
|
|
11
|
+
WebsocketAccessLogToken["event"] = "[event]";
|
|
12
|
+
WebsocketAccessLogToken["duration"] = "[duration]";
|
|
13
|
+
return WebsocketAccessLogToken;
|
|
14
|
+
}({});
|
|
15
|
+
// src/replace-websocket-token.ts
|
|
16
|
+
const pattern = /\[[^\[\]]+\]/g;
|
|
17
|
+
const replaceWebsocketToken = async (opts) => {
|
|
18
|
+
const { message, startTime, tokens = {}, ip, clientId, event } = opts;
|
|
19
|
+
let formatted = message;
|
|
20
|
+
for (const match of message.matchAll(pattern)) {
|
|
21
|
+
const tokenWithBrackets = match[0];
|
|
22
|
+
const token = tokenWithBrackets.slice(1, -1);
|
|
23
|
+
const replace = (data) => {
|
|
24
|
+
formatted = formatted.replaceAll(tokenWithBrackets, data);
|
|
25
|
+
};
|
|
26
|
+
if (tokens[token]) replace(await tokens[token]());
|
|
27
|
+
switch (`[${token}]`) {
|
|
28
|
+
case "[ip]":
|
|
29
|
+
replace(styleText("gray", ip || "-"));
|
|
30
|
+
break;
|
|
31
|
+
case "[clientId]":
|
|
32
|
+
replace(styleText("gray", clientId));
|
|
33
|
+
break;
|
|
34
|
+
case "[event]":
|
|
35
|
+
replace(styleText("bold", event));
|
|
36
|
+
break;
|
|
37
|
+
case "[duration]": replace(styleText("gray", prettyTime(process.hrtime(startTime))));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return formatted;
|
|
41
|
+
};
|
|
42
|
+
// src/websocket.ts
|
|
43
|
+
var WebsocketAccessLogService = class extends BaseLoggerService {
|
|
44
|
+
entries;
|
|
45
|
+
constructor(entries) {
|
|
46
|
+
super();
|
|
47
|
+
this.entries = entries;
|
|
48
|
+
}
|
|
49
|
+
createTransports() {
|
|
50
|
+
return this.entries;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 入站消息访问日志。挂在 `WebsocketApp.mount` 里、`channels()` 前面。
|
|
55
|
+
* 每条入站消息在中间件链结束后打一条日志(含抛错路径)。
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { websocketAccessLog } from '@aomex/access-log/websocket';
|
|
59
|
+
* import { WebsocketApp, channels } from '@aomex/websocket';
|
|
60
|
+
*
|
|
61
|
+
* new WebsocketApp({
|
|
62
|
+
* logger,
|
|
63
|
+
* language,
|
|
64
|
+
* transport,
|
|
65
|
+
* mount: [websocketAccessLog(), channels('./src/channels')],
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
const websocketAccessLog = (options = {}) => {
|
|
70
|
+
const { disabled = false, customTokens } = options;
|
|
71
|
+
const format = options.format || `[ip] [clientId] [event] [duration]`;
|
|
72
|
+
const transportList = options.transports ?? [new ConsoleTransport()];
|
|
73
|
+
const logger = new WebsocketAccessLogService(transportList.map((transport) => ({ transport })));
|
|
74
|
+
return middleware.socket(async (ctx, next) => {
|
|
75
|
+
if (disabled || transportList.length === 0) return next();
|
|
76
|
+
const start = process.hrtime();
|
|
77
|
+
const tokens = customTokens ? Object.fromEntries(Object.entries(customTokens).map(([key, value]) => {
|
|
78
|
+
return [key, value.bind(null, ctx)];
|
|
79
|
+
})) : {};
|
|
80
|
+
try {
|
|
81
|
+
await next();
|
|
82
|
+
} finally {
|
|
83
|
+
try {
|
|
84
|
+
logger.info(await replaceWebsocketToken({
|
|
85
|
+
message: format,
|
|
86
|
+
tokens,
|
|
87
|
+
startTime: start,
|
|
88
|
+
ip: ctx.client.request.ip,
|
|
89
|
+
clientId: ctx.client.id,
|
|
90
|
+
event: ctx.event
|
|
91
|
+
}));
|
|
92
|
+
} catch {}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
export { WebsocketAccessLogToken, websocketAccessLog };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=websocket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket.js","names":[],"sources":["../src/websocket-token.ts","../src/replace-websocket-token.ts","../src/websocket.ts"],"sourcesContent":["/** WebSocket 入站访问日志令牌 */\nexport enum WebsocketAccessLogToken {\n ip = '[ip]',\n clientId = '[clientId]',\n event = '[event]',\n duration = '[duration]',\n}\n","import prettyTime from 'pretty-time';\nimport { styleText } from 'node:util';\nimport { WebsocketAccessLogToken } from './websocket-token';\n\nconst pattern = /\\[[^\\[\\]]+\\]/g;\n\nexport const replaceWebsocketToken = async (opts: {\n message: string;\n startTime: [number, number];\n tokens?: { [key: string]: () => string | Promise<string> };\n ip: string;\n clientId: string;\n event: string;\n}): Promise<string> => {\n const { message, startTime, tokens = {}, ip, clientId, event } = opts;\n let formatted = message;\n\n for (const match of message.matchAll(pattern)) {\n const tokenWithBrackets = match[0]!;\n const token = tokenWithBrackets.slice(1, -1);\n\n const replace = (data: string) => {\n formatted = formatted.replaceAll(tokenWithBrackets, data);\n };\n\n if (tokens[token]) {\n replace(await tokens[token]!());\n }\n\n switch (`[${token}]`) {\n case WebsocketAccessLogToken.ip:\n replace(styleText('gray', ip || '-'));\n break;\n case WebsocketAccessLogToken.clientId:\n replace(styleText('gray', clientId));\n break;\n case WebsocketAccessLogToken.event:\n replace(styleText('bold', event));\n break;\n case WebsocketAccessLogToken.duration:\n replace(styleText('gray', prettyTime(process.hrtime(startTime))));\n break;\n }\n }\n\n return formatted;\n};\n","import '@aomex/websocket';\nimport type { WebsocketContext } from '@aomex/websocket';\nimport { middleware } from '@aomex/common';\nimport { BaseLoggerService, ConsoleTransport, type Transport } from '@aomex/logger';\nimport { replaceWebsocketToken } from './replace-websocket-token';\nimport { WebsocketAccessLogToken } from './websocket-token';\n\nexport interface WebsocketAccessLogOptions {\n /**\n * 是否禁用入站日志。默认:`false`\n */\n disabled?: boolean;\n /**\n * 输出格式,建议使用 **WebsocketAccessLogToken** 拼接。\n * 默认:`[ip] [clientId] [event] [duration]`\n */\n format?: string;\n /**\n * 日志输出端口。默认使用 `ConsoleTransport`;传空数组相当于禁用。\n */\n transports?: Transport[];\n /**\n * 自定义关键词\n * ```\n * websocketAccessLog({\n * format: '[event] [room]',\n * customTokens: {\n * room: (ctx) => String(ctx.client.data['room'] ?? '-'),\n * },\n * })\n * ```\n */\n customTokens?: {\n [key: string]: (ctx: WebsocketContext) => string | Promise<string>;\n };\n}\n\nclass WebsocketAccessLogService extends BaseLoggerService {\n constructor(private readonly entries: BaseLoggerService.TransportEntry[]) {\n super();\n }\n\n protected createTransports(): BaseLoggerService.TransportEntry[] {\n return this.entries;\n }\n}\n\n/**\n * 入站消息访问日志。挂在 `WebsocketApp.mount` 里、`channels()` 前面。\n * 每条入站消息在中间件链结束后打一条日志(含抛错路径)。\n *\n * ```ts\n * import { websocketAccessLog } from '@aomex/access-log/websocket';\n * import { WebsocketApp, channels } from '@aomex/websocket';\n *\n * new WebsocketApp({\n * logger,\n * language,\n * transport,\n * mount: [websocketAccessLog(), channels('./src/channels')],\n * });\n * ```\n */\nexport const websocketAccessLog = (options: WebsocketAccessLogOptions = {}) => {\n const { disabled = false, customTokens } = options;\n const format =\n options.format ||\n `${WebsocketAccessLogToken.ip} ${WebsocketAccessLogToken.clientId} ${WebsocketAccessLogToken.event} ${WebsocketAccessLogToken.duration}`;\n\n const transportList = options.transports ?? [new ConsoleTransport()];\n\n const logger = new WebsocketAccessLogService(\n transportList.map((transport) => ({ transport })),\n );\n\n return middleware.socket(async (ctx, next) => {\n if (disabled || transportList.length === 0) return next();\n\n const start = process.hrtime();\n const tokens = customTokens\n ? Object.fromEntries(\n Object.entries(customTokens).map(([key, value]) => {\n return [key, value.bind(null, ctx)];\n }),\n )\n : {};\n\n try {\n await next();\n } finally {\n // 打日志失败不得掩盖 next() 的业务异常\n try {\n logger.info(\n await replaceWebsocketToken({\n message: format,\n tokens,\n startTime: start,\n ip: ctx.client.request.ip,\n clientId: ctx.client.id,\n event: ctx.event,\n }),\n );\n } catch {\n // 访问日志失败静默忽略\n }\n }\n });\n};\n\nexport { WebsocketAccessLogToken } from './websocket-token';\n"],"mappings":";;;;;;;AACA,IAAY,0BAAL,yBAAA,yBAAA;CACL,wBAAA,QAAA;CACA,wBAAA,cAAA;CACA,wBAAA,WAAA;CACA,wBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;;ACFA,MAAM,UAAU;AAEhB,MAAa,wBAAwB,OAAO,SAOrB;CACrB,MAAM,EAAE,SAAS,WAAW,SAAS,CAAC,GAAG,IAAI,UAAU,UAAU;CACjE,IAAI,YAAY;CAEhB,KAAK,MAAM,SAAS,QAAQ,SAAS,OAAO,GAAG;EAC7C,MAAM,oBAAoB,MAAM;EAChC,MAAM,QAAQ,kBAAkB,MAAM,GAAG,EAAE;EAE3C,MAAM,WAAW,SAAiB;GAChC,YAAY,UAAU,WAAW,mBAAmB,IAAI;EAC1D;EAEA,IAAI,OAAO,QACT,QAAQ,MAAM,OAAO,MAAM,CAAE,CAAC;EAGhC,QAAQ,IAAI,MAAM,IAAlB;GACE,KAAA;IACE,QAAQ,UAAU,QAAQ,MAAM,GAAG,CAAC;IACpC;GACF,KAAA;IACE,QAAQ,UAAU,QAAQ,QAAQ,CAAC;IACnC;GACF,KAAA;IACE,QAAQ,UAAU,QAAQ,KAAK,CAAC;IAChC;GACF,KAAA,cACE,QAAQ,UAAU,QAAQ,WAAW,QAAQ,OAAO,SAAS,CAAC,CAAC,CAAC;EAEpE;CACF;CAEA,OAAO;AACT;;ACTA,IAAM,4BAAN,cAAwC,kBAAkB;CAC3B;CAA7B,YAAY,SAA8D;EACxE,MAAM;EADqB,KAAA,UAAA;CAE7B;CAEA,mBAAiE;EAC/D,OAAO,KAAK;CACd;AACF;;;;;;;;;;;;;;;;;AAkBA,MAAa,sBAAsB,UAAqC,CAAC,MAAM;CAC7E,MAAM,EAAE,WAAW,OAAO,iBAAiB;CAC3C,MAAM,SACJ,QAAQ,UACR;CAEF,MAAM,gBAAgB,QAAQ,cAAc,CAAC,IAAI,iBAAiB,CAAC;CAEnE,MAAM,SAAS,IAAI,0BACjB,cAAc,KAAK,eAAe,EAAE,UAAU,EAAE,CAClD;CAEA,OAAO,WAAW,OAAO,OAAO,KAAK,SAAS;EAC5C,IAAI,YAAY,cAAc,WAAW,GAAG,OAAO,KAAK;EAExD,MAAM,QAAQ,QAAQ,OAAO;EAC7B,MAAM,SAAS,eACX,OAAO,YACL,OAAO,QAAQ,YAAY,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW;GACjD,OAAO,CAAC,KAAK,MAAM,KAAK,MAAM,GAAG,CAAC;EACpC,CAAC,CACH,IACA,CAAC;EAEL,IAAI;GACF,MAAM,KAAK;EACb,UAAU;GAER,IAAI;IACF,OAAO,KACL,MAAM,sBAAsB;KAC1B,SAAS;KACT;KACA,WAAW;KACX,IAAI,IAAI,OAAO,QAAQ;KACvB,UAAU,IAAI,OAAO;KACrB,OAAO,IAAI;IACb,CAAC,CACH;GACF,QAAQ,CAER;EACF;CACF,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aomex/access-log",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "4.4.1-alpha.c1419fd5.0",
|
|
4
|
+
"description": "访问日志",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git@github.com:aomex/aomex.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://aomex.js.org",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./dist/websocket.js"
|
|
14
|
+
],
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./websocket": {
|
|
22
|
+
"types": "./dist/websocket.d.ts",
|
|
23
|
+
"import": "./dist/websocket.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"package.json",
|
|
31
|
+
"README.md",
|
|
32
|
+
"CHANGELOG.md"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@aomex/common": "^4.0.0",
|
|
39
|
+
"@aomex/web": "^4.0.0",
|
|
40
|
+
"@aomex/websocket": "^4.0.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"@aomex/websocket": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@aomex/internal-tools": "4.4.1-alpha.c1419fd5.0",
|
|
49
|
+
"@aomex/logger": "4.4.1-alpha.c1419fd5.0",
|
|
50
|
+
"pretty-time": "^1.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@aomex/common": "4.4.1-alpha.c1419fd5.0",
|
|
54
|
+
"@aomex/web": "4.4.1-alpha.c1419fd5.0",
|
|
55
|
+
"@aomex/websocket": "4.4.1-alpha.c1419fd5.0",
|
|
56
|
+
"@types/pretty-time": "^1.1.5"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {}
|
|
6
59
|
}
|