@checkstack/integration-webhook-backend 0.0.8 → 0.0.9

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @checkstack/integration-webhook-backend
2
2
 
3
+ ## 0.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 83557c7: ## Multi-Type Editor Support for Webhooks
8
+
9
+ - Updated webhook provider 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/integration-backend@0.1.4
16
+ - @checkstack/integration-common@0.2.1
17
+
3
18
  ## 0.0.8
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/integration-webhook-backend",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
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
  }