@checkstack/integration-webhook-backend 0.0.8 → 0.0.10
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 +26 -0
- package/package.json +1 -1
- package/src/provider.ts +9 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @checkstack/integration-webhook-backend
|
|
2
2
|
|
|
3
|
+
## 0.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8a87cd4]
|
|
8
|
+
- Updated dependencies [8a87cd4]
|
|
9
|
+
- @checkstack/backend-api@0.4.1
|
|
10
|
+
- @checkstack/common@0.5.0
|
|
11
|
+
- @checkstack/integration-backend@0.1.5
|
|
12
|
+
- @checkstack/integration-common@0.2.2
|
|
13
|
+
|
|
14
|
+
## 0.0.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 83557c7: ## Multi-Type Editor Support for Webhooks
|
|
19
|
+
|
|
20
|
+
- Updated webhook provider to use new multi-type editor field for body templates
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [83557c7]
|
|
23
|
+
- Updated dependencies [83557c7]
|
|
24
|
+
- @checkstack/backend-api@0.4.0
|
|
25
|
+
- @checkstack/common@0.4.0
|
|
26
|
+
- @checkstack/integration-backend@0.1.4
|
|
27
|
+
- @checkstack/integration-common@0.2.1
|
|
28
|
+
|
|
3
29
|
## 0.0.8
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/package.json
CHANGED
package/src/provider.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
Versioned,
|
|
4
|
-
configNumber,
|
|
5
|
-
configString,
|
|
6
|
-
} from "@checkstack/backend-api";
|
|
2
|
+
import { Versioned, configNumber, configString } from "@checkstack/backend-api";
|
|
7
3
|
import type {
|
|
8
4
|
IntegrationProvider,
|
|
9
5
|
IntegrationDeliveryContext,
|
|
@@ -20,7 +16,7 @@ import type {
|
|
|
20
16
|
*/
|
|
21
17
|
function expandTemplate(
|
|
22
18
|
template: string,
|
|
23
|
-
context: Record<string, unknown
|
|
19
|
+
context: Record<string, unknown>,
|
|
24
20
|
): string {
|
|
25
21
|
return template.replaceAll(/\{\{([^}]+)\}\}/g, (_match, path: string) => {
|
|
26
22
|
const trimmedPath = path.trim();
|
|
@@ -102,10 +98,12 @@ export const webhookConfigSchemaV1 = z.object({
|
|
|
102
98
|
.describe("Additional custom headers to include"),
|
|
103
99
|
|
|
104
100
|
/** Custom body template. Use {{payload.field}} syntax for templating. */
|
|
105
|
-
bodyTemplate: configString({
|
|
101
|
+
bodyTemplate: configString({
|
|
102
|
+
"x-editor-types": ["raw", "json", "yaml", "xml", "formdata"],
|
|
103
|
+
})
|
|
106
104
|
.optional()
|
|
107
105
|
.describe(
|
|
108
|
-
"Custom request body template. Use {{payload.field}} syntax to include event data. Leave empty for default JSON payload."
|
|
106
|
+
"Custom request body template. Use {{payload.field}} syntax to include event data. Leave empty for default JSON payload.",
|
|
109
107
|
),
|
|
110
108
|
|
|
111
109
|
timeout: configNumber({})
|
|
@@ -164,7 +162,7 @@ Configure your server to:
|
|
|
164
162
|
},
|
|
165
163
|
// eslint-disable-next-line unicorn/no-null
|
|
166
164
|
null,
|
|
167
|
-
2
|
|
165
|
+
2,
|
|
168
166
|
),
|
|
169
167
|
headers: [
|
|
170
168
|
{
|
|
@@ -184,7 +182,7 @@ Configure your server to:
|
|
|
184
182
|
},
|
|
185
183
|
|
|
186
184
|
async deliver(
|
|
187
|
-
context: IntegrationDeliveryContext<WebhookConfig
|
|
185
|
+
context: IntegrationDeliveryContext<WebhookConfig>,
|
|
188
186
|
): Promise<IntegrationDeliveryResult> {
|
|
189
187
|
const { event, subscription, providerConfig, logger } = context;
|
|
190
188
|
|
|
@@ -224,7 +222,7 @@ Configure your server to:
|
|
|
224
222
|
case "basic": {
|
|
225
223
|
if (config.basicUsername && config.basicPassword) {
|
|
226
224
|
const credentials = Buffer.from(
|
|
227
|
-
`${config.basicUsername}:${config.basicPassword}
|
|
225
|
+
`${config.basicUsername}:${config.basicPassword}`,
|
|
228
226
|
).toString("base64");
|
|
229
227
|
headers["Authorization"] = `Basic ${credentials}`;
|
|
230
228
|
}
|