@absolutejs/voice 0.0.22-beta.25 → 0.0.22-beta.26

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 (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9003,11 +9003,11 @@ var verifyVoiceOpsWebhookSignature = async (input) => {
9003
9003
  };
9004
9004
  var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
9005
9005
  const path = options.path ?? "/api/voice-ops/webhook";
9006
- return new Elysia5().post(path, async ({ request, set }) => {
9007
- const body = await request.text();
9006
+ return new Elysia5().post(path, async ({ body, request, set }) => {
9007
+ const bodyText = typeof body === "string" ? body : JSON.stringify(body);
9008
9008
  if (options.signingSecret) {
9009
9009
  const verification = await verifyVoiceOpsWebhookSignature({
9010
- body,
9010
+ body: bodyText,
9011
9011
  secret: options.signingSecret,
9012
9012
  signature: request.headers.get("x-absolutejs-signature"),
9013
9013
  timestamp: request.headers.get("x-absolutejs-timestamp"),
@@ -9021,7 +9021,7 @@ var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
9021
9021
  };
9022
9022
  }
9023
9023
  }
9024
- const envelope = JSON.parse(body);
9024
+ const envelope = JSON.parse(bodyText);
9025
9025
  await options.onEnvelope?.({
9026
9026
  envelope,
9027
9027
  request
@@ -9031,6 +9031,8 @@ var createVoiceOpsWebhookReceiverRoutes = (options = {}) => {
9031
9031
  ok: true,
9032
9032
  type: envelope.event?.type
9033
9033
  };
9034
+ }, {
9035
+ parse: "text"
9034
9036
  });
9035
9037
  };
9036
9038
  // src/queue.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.25",
3
+ "version": "0.0.22-beta.26",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",