@inversifyjs/http-instrumentation-core 5.8.0 → 5.9.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 (90) hide show
  1. package/.npmignore +26 -0
  2. package/lib/actions/emitHttpInstrumentationEvent.d.ts +4 -0
  3. package/lib/actions/emitHttpInstrumentationEvent.d.ts.map +1 -0
  4. package/lib/actions/emitHttpInstrumentationEvent.js +20 -0
  5. package/lib/actions/emitHttpInstrumentationEvent.js.map +1 -0
  6. package/lib/actions/httpInstrumentationState.d.ts +5 -0
  7. package/lib/actions/httpInstrumentationState.d.ts.map +1 -0
  8. package/lib/actions/httpInstrumentationState.js +50 -0
  9. package/lib/actions/httpInstrumentationState.js.map +1 -0
  10. package/lib/actions/markHttpInstrumentedHandler.d.ts +3 -0
  11. package/lib/actions/markHttpInstrumentedHandler.d.ts.map +1 -0
  12. package/lib/actions/markHttpInstrumentedHandler.js +14 -0
  13. package/lib/actions/markHttpInstrumentedHandler.js.map +1 -0
  14. package/lib/actions/runInstrumentedHttpStage.d.ts +11 -0
  15. package/lib/actions/runInstrumentedHttpStage.d.ts.map +1 -0
  16. package/lib/actions/runInstrumentedHttpStage.js +28 -0
  17. package/lib/actions/runInstrumentedHttpStage.js.map +1 -0
  18. package/lib/calculations/buildHttpInstrumentationContext.d.ts +5 -0
  19. package/lib/calculations/buildHttpInstrumentationContext.d.ts.map +1 -0
  20. package/lib/calculations/buildHttpInstrumentationContext.js +10 -0
  21. package/lib/calculations/buildHttpInstrumentationContext.js.map +1 -0
  22. package/lib/calculations/redactHttpHeaders.d.ts +2 -0
  23. package/lib/calculations/redactHttpHeaders.d.ts.map +1 -0
  24. package/lib/calculations/redactHttpHeaders.js +28 -0
  25. package/lib/calculations/redactHttpHeaders.js.map +1 -0
  26. package/lib/calculations/startHttpStage.d.ts +4 -0
  27. package/lib/calculations/startHttpStage.d.ts.map +1 -0
  28. package/lib/calculations/startHttpStage.js +10 -0
  29. package/lib/calculations/startHttpStage.js.map +1 -0
  30. package/lib/index.d.ts +14 -0
  31. package/lib/index.d.ts.map +1 -0
  32. package/lib/index.js +9 -0
  33. package/lib/index.js.map +1 -0
  34. package/lib/models/EventSink.d.ts +4 -0
  35. package/lib/models/EventSink.d.ts.map +1 -0
  36. package/lib/models/EventSink.js +2 -0
  37. package/lib/models/EventSink.js.map +1 -0
  38. package/lib/models/HttpInstrumentationContext.d.ts +7 -0
  39. package/lib/models/HttpInstrumentationContext.d.ts.map +1 -0
  40. package/lib/models/HttpInstrumentationContext.js +2 -0
  41. package/lib/models/HttpInstrumentationContext.js.map +1 -0
  42. package/lib/models/HttpInstrumentationEvent.d.ts +91 -0
  43. package/lib/models/HttpInstrumentationEvent.d.ts.map +1 -0
  44. package/lib/models/HttpInstrumentationEvent.js +2 -0
  45. package/lib/models/HttpInstrumentationEvent.js.map +1 -0
  46. package/lib/models/HttpInstrumentationScope.d.ts +6 -0
  47. package/lib/models/HttpInstrumentationScope.d.ts.map +1 -0
  48. package/lib/models/HttpInstrumentationScope.js +2 -0
  49. package/lib/models/HttpInstrumentationScope.js.map +1 -0
  50. package/lib/models/HttpStageClock.d.ts +5 -0
  51. package/lib/models/HttpStageClock.d.ts.map +1 -0
  52. package/lib/models/HttpStageClock.js +2 -0
  53. package/lib/models/HttpStageClock.js.map +1 -0
  54. package/lib/models/httpInstrumentationStateSymbol.d.ts +6 -0
  55. package/lib/models/httpInstrumentationStateSymbol.d.ts.map +1 -0
  56. package/lib/models/httpInstrumentationStateSymbol.js +2 -0
  57. package/lib/models/httpInstrumentationStateSymbol.js.map +1 -0
  58. package/lib/models/httpInstrumentedHandlerSymbol.d.ts +2 -0
  59. package/lib/models/httpInstrumentedHandlerSymbol.d.ts.map +1 -0
  60. package/lib/models/httpInstrumentedHandlerSymbol.js +2 -0
  61. package/lib/models/httpInstrumentedHandlerSymbol.js.map +1 -0
  62. package/package.json +1 -1
  63. package/.lintstagedrc.json +0 -4
  64. package/CHANGELOG.md +0 -11
  65. package/eslint.config.mjs +0 -23
  66. package/prettier.config.mjs +0 -3
  67. package/src/actions/emitHttpInstrumentationEvent.spec.ts +0 -130
  68. package/src/actions/emitHttpInstrumentationEvent.ts +0 -28
  69. package/src/actions/httpInstrumentationState.spec.ts +0 -49
  70. package/src/actions/httpInstrumentationState.ts +0 -93
  71. package/src/actions/markHttpInstrumentedHandler.ts +0 -16
  72. package/src/actions/runInstrumentedHttpStage.ts +0 -76
  73. package/src/calculations/buildHttpInstrumentationContext.spec.ts +0 -37
  74. package/src/calculations/buildHttpInstrumentationContext.ts +0 -17
  75. package/src/calculations/redactHttpHeaders.spec.ts +0 -36
  76. package/src/calculations/redactHttpHeaders.ts +0 -38
  77. package/src/calculations/startHttpStage.ts +0 -12
  78. package/src/index.ts +0 -26
  79. package/src/models/EventSink.ts +0 -3
  80. package/src/models/HttpInstrumentationContext.ts +0 -7
  81. package/src/models/HttpInstrumentationEvent.ts +0 -187
  82. package/src/models/HttpInstrumentationScope.ts +0 -5
  83. package/src/models/HttpStageClock.ts +0 -4
  84. package/src/models/httpInstrumentationStateSymbol.ts +0 -8
  85. package/src/models/httpInstrumentedHandlerSymbol.ts +0 -3
  86. package/stryker.config.mjs +0 -3
  87. package/tsconfig.esm.json +0 -11
  88. package/tsconfig.json +0 -4
  89. package/vitest.config.mjs +0 -3
  90. package/vitest.config.stryker.mjs +0 -3
@@ -1,187 +0,0 @@
1
- import { type MiddlewarePhase } from '@inversifyjs/framework-core';
2
-
3
- interface HttpControllerExecutedEvent {
4
- readonly controller: string;
5
- readonly duration: number;
6
- readonly error?: unknown;
7
- readonly executionId: string;
8
- readonly method: string;
9
- readonly parentExecutionId?: string;
10
- readonly requestId: string;
11
- readonly startedAt: number;
12
- readonly timestamp: number;
13
- readonly type: 'http.controller.executed';
14
- }
15
-
16
- interface HttpControllerStartedEvent {
17
- readonly controller: string;
18
- readonly executionId: string;
19
- readonly method: string;
20
- readonly parentExecutionId?: string;
21
- readonly requestId: string;
22
- readonly timestamp: number;
23
- readonly type: 'http.controller.started';
24
- }
25
-
26
- interface HttpErrorEvent {
27
- readonly duration: number;
28
- readonly error: unknown;
29
- readonly executionId: string;
30
- readonly filter?: string;
31
- readonly parentExecutionId?: string;
32
- readonly requestId: string;
33
- readonly startedAt: number;
34
- readonly timestamp: number;
35
- readonly type: 'http.error';
36
- }
37
-
38
- interface HttpGuardExecutedEvent {
39
- readonly allowed?: boolean;
40
- readonly duration: number;
41
- readonly error?: unknown;
42
- readonly executionId: string;
43
- readonly guard: string;
44
- readonly parentExecutionId?: string;
45
- readonly requestId: string;
46
- readonly startedAt: number;
47
- readonly timestamp: number;
48
- readonly type: 'http.guard.executed';
49
- }
50
-
51
- interface HttpGuardStartedEvent {
52
- readonly executionId: string;
53
- readonly guard: string;
54
- readonly parentExecutionId?: string;
55
- readonly requestId: string;
56
- readonly timestamp: number;
57
- readonly type: 'http.guard.started';
58
- }
59
-
60
- interface HttpInterceptorExecutedEvent {
61
- readonly duration: number;
62
- readonly error?: unknown;
63
- readonly executionId: string;
64
- readonly interceptor: string;
65
- readonly parentExecutionId?: string;
66
- readonly requestId: string;
67
- readonly startedAt: number;
68
- readonly timestamp: number;
69
- readonly type: 'http.interceptor.executed';
70
- }
71
-
72
- interface HttpInterceptorStartedEvent {
73
- readonly executionId: string;
74
- readonly interceptor: string;
75
- readonly parentExecutionId?: string;
76
- readonly requestId: string;
77
- readonly timestamp: number;
78
- readonly type: 'http.interceptor.started';
79
- }
80
-
81
- interface HttpMiddlewareExecutedEvent {
82
- readonly duration: number;
83
- readonly error?: unknown;
84
- readonly executionId: string;
85
- readonly middleware: string;
86
- readonly parentExecutionId?: string;
87
- readonly phase: MiddlewarePhase;
88
- readonly requestId: string;
89
- readonly startedAt: number;
90
- readonly timestamp: number;
91
- readonly type: 'http.middleware.executed';
92
- }
93
-
94
- interface HttpMiddlewareStartedEvent {
95
- readonly executionId: string;
96
- readonly middleware: string;
97
- readonly parentExecutionId?: string;
98
- readonly phase: MiddlewarePhase;
99
- readonly requestId: string;
100
- readonly timestamp: number;
101
- readonly type: 'http.middleware.started';
102
- }
103
-
104
- interface HttpNativeMiddlewareExecutedEvent {
105
- readonly duration: number;
106
- readonly error?: unknown;
107
- readonly executionId: string;
108
- readonly name: string;
109
- readonly parentExecutionId?: string;
110
- readonly requestId: string;
111
- readonly startedAt: number;
112
- readonly timestamp: number;
113
- readonly type: 'http.nativeMiddleware.executed';
114
- }
115
-
116
- interface HttpNativeMiddlewareStartedEvent {
117
- readonly executionId: string;
118
- readonly name: string;
119
- readonly parentExecutionId?: string;
120
- readonly requestId: string;
121
- readonly timestamp: number;
122
- readonly type: 'http.nativeMiddleware.started';
123
- }
124
-
125
- interface HttpPipeExecutedEvent {
126
- readonly duration: number;
127
- readonly error?: unknown;
128
- readonly executionId: string;
129
- readonly method: string;
130
- readonly parameterIndex: number;
131
- readonly parentExecutionId?: string;
132
- readonly pipe: string;
133
- readonly requestId: string;
134
- readonly startedAt: number;
135
- readonly timestamp: number;
136
- readonly type: 'http.pipe.executed';
137
- }
138
-
139
- interface HttpPipeStartedEvent {
140
- readonly executionId: string;
141
- readonly method: string;
142
- readonly parameterIndex: number;
143
- readonly parentExecutionId?: string;
144
- readonly pipe: string;
145
- readonly requestId: string;
146
- readonly timestamp: number;
147
- readonly type: 'http.pipe.started';
148
- }
149
-
150
- interface HttpRequestStartedEvent {
151
- readonly executionId: string;
152
- readonly headers: Readonly<Record<string, string | readonly string[]>>;
153
- readonly method: string;
154
- readonly requestId: string;
155
- readonly timestamp: number;
156
- readonly type: 'http.request.started';
157
- readonly url: string;
158
- }
159
-
160
- interface HttpResponseSentEvent {
161
- readonly aborted: boolean;
162
- readonly duration: number;
163
- readonly executionId: string;
164
- readonly headers: Readonly<Record<string, string | readonly string[]>>;
165
- readonly requestId: string;
166
- readonly startedAt: number;
167
- readonly statusCode: number;
168
- readonly timestamp: number;
169
- readonly type: 'http.response.sent';
170
- }
171
-
172
- export type HttpInstrumentationEvent =
173
- | HttpControllerExecutedEvent
174
- | HttpControllerStartedEvent
175
- | HttpErrorEvent
176
- | HttpGuardExecutedEvent
177
- | HttpGuardStartedEvent
178
- | HttpInterceptorExecutedEvent
179
- | HttpInterceptorStartedEvent
180
- | HttpMiddlewareExecutedEvent
181
- | HttpMiddlewareStartedEvent
182
- | HttpNativeMiddlewareExecutedEvent
183
- | HttpNativeMiddlewareStartedEvent
184
- | HttpPipeExecutedEvent
185
- | HttpPipeStartedEvent
186
- | HttpRequestStartedEvent
187
- | HttpResponseSentEvent;
@@ -1,5 +0,0 @@
1
- export interface HttpInstrumentationScope {
2
- readonly executionId: string;
3
- readonly parentExecutionId: string | undefined;
4
- readonly requestId: string;
5
- }
@@ -1,4 +0,0 @@
1
- export interface HttpStageClock {
2
- readonly startedAt: number;
3
- readonly startTick: number;
4
- }
@@ -1,8 +0,0 @@
1
- export const httpInstrumentationStateSymbol: unique symbol = Symbol.for(
2
- '@inversifyjs/http-instrumentation-core/httpInstrumentationState',
3
- );
4
-
5
- export interface HttpInstrumentationState {
6
- executionStack: string[];
7
- requestId: string;
8
- }
@@ -1,3 +0,0 @@
1
- export const httpInstrumentedHandlerSymbol: unique symbol = Symbol.for(
2
- '@inversifyjs/http-instrumentation-core/httpInstrumentedHandler',
3
- );
@@ -1,3 +0,0 @@
1
- import config from '@inversifyjs/foundation-stryker-config';
2
-
3
- export default config;
package/tsconfig.esm.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "http://json.schemastore.org/tsconfig",
3
- "extends": "@inversifyjs/foundation-typescript-config/tsconfig.base.esm.json",
4
- "compilerOptions": {
5
- "outDir": "./lib",
6
- "rootDir": "./src",
7
- "tsBuildInfoFile": "tsconfig.esm.tsbuildinfo",
8
- "types": ["node"]
9
- },
10
- "include": ["src"]
11
- }
package/tsconfig.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "http://json.schemastore.org/tsconfig",
3
- "extends": "./tsconfig.esm.json"
4
- }
package/vitest.config.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { defaultConfig } from '@inversifyjs/foundation-vitest-config';
2
-
3
- export default defaultConfig;
@@ -1,3 +0,0 @@
1
- import { strykerConfig } from '@inversifyjs/foundation-vitest-config';
2
-
3
- export default strykerConfig;