@checkstack/healthcheck-http-backend 0.1.4 → 0.1.6
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 +21 -0
- package/package.json +1 -1
- package/src/request-collector.ts +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @checkstack/healthcheck-http-backend
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 83557c7: ## Multi-Type Editor Support for HTTP Requests
|
|
8
|
+
|
|
9
|
+
- Updated request collector to use new multi-type editor field for body templates
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [83557c7]
|
|
12
|
+
- Updated dependencies [83557c7]
|
|
13
|
+
- @checkstack/backend-api@0.4.0
|
|
14
|
+
- @checkstack/common@0.4.0
|
|
15
|
+
- @checkstack/healthcheck-common@0.4.1
|
|
16
|
+
|
|
17
|
+
## 0.1.5
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [d94121b]
|
|
22
|
+
- @checkstack/backend-api@0.3.3
|
|
23
|
+
|
|
3
24
|
## 0.1.4
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/package.json
CHANGED
package/src/request-collector.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Versioned,
|
|
3
3
|
z,
|
|
4
|
+
configString,
|
|
4
5
|
type HealthCheckRunForAggregation,
|
|
5
6
|
type CollectorResult,
|
|
6
7
|
type CollectorStrategy,
|
|
@@ -29,7 +30,11 @@ const requestConfigSchema = z.object({
|
|
|
29
30
|
.array(z.object({ name: z.string(), value: z.string() }))
|
|
30
31
|
.optional()
|
|
31
32
|
.describe("Request headers"),
|
|
32
|
-
body:
|
|
33
|
+
body: configString({
|
|
34
|
+
"x-editor-types": ["none", "raw", "json", "yaml", "xml", "formdata"],
|
|
35
|
+
})
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Request body"),
|
|
33
38
|
timeout: z
|
|
34
39
|
.number()
|
|
35
40
|
.min(100)
|
|
@@ -94,15 +99,12 @@ export type RequestAggregatedResult = z.infer<typeof requestAggregatedSchema>;
|
|
|
94
99
|
* Built-in HTTP request collector.
|
|
95
100
|
* Allows users to make HTTP requests and check responses.
|
|
96
101
|
*/
|
|
97
|
-
export class RequestCollector
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
RequestAggregatedResult
|
|
104
|
-
>
|
|
105
|
-
{
|
|
102
|
+
export class RequestCollector implements CollectorStrategy<
|
|
103
|
+
HttpTransportClient,
|
|
104
|
+
RequestConfig,
|
|
105
|
+
RequestResult,
|
|
106
|
+
RequestAggregatedResult
|
|
107
|
+
> {
|
|
106
108
|
id = "request";
|
|
107
109
|
displayName = "HTTP Request";
|
|
108
110
|
description = "Make an HTTP request and check the response";
|
|
@@ -161,7 +163,7 @@ export class RequestCollector
|
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
aggregateResult(
|
|
164
|
-
runs: HealthCheckRunForAggregation<RequestResult>[]
|
|
166
|
+
runs: HealthCheckRunForAggregation<RequestResult>[],
|
|
165
167
|
): RequestAggregatedResult {
|
|
166
168
|
const times = runs
|
|
167
169
|
.map((r) => r.metadata?.responseTimeMs)
|