@absolutejs/voice 0.0.22-beta.261 → 0.0.22-beta.262

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 +4 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12235,8 +12235,7 @@ var createVoiceDeliverySinkRoutes = (options) => {
12235
12235
  };
12236
12236
  // src/opsActionAuditRoutes.ts
12237
12237
  import { Elysia as Elysia12 } from "elysia";
12238
- var readRecord = async (request) => {
12239
- const body = await request.json().catch(() => null);
12238
+ var readRecordBody = (body) => {
12240
12239
  if (!body || typeof body !== "object") {
12241
12240
  throw new Error("Voice ops action audit requires a JSON body.");
12242
12241
  }
@@ -12253,6 +12252,7 @@ var readRecord = async (request) => {
12253
12252
  status: typeof record.status === "number" ? record.status : 0
12254
12253
  };
12255
12254
  };
12255
+ var readRecord = async (request) => readRecordBody(await request.json().catch(() => null));
12256
12256
  var recordVoiceOpsActionAudit = async (record, options) => {
12257
12257
  const traceId = `voice-ops-action:${record.actionId}:${record.ranAt}`;
12258
12258
  const outcome = record.ok ? "success" : "error";
@@ -12311,9 +12311,9 @@ var createVoiceOpsActionAuditRoutes = (options) => {
12311
12311
  const historyHtmlPath = options.historyHtmlPath === undefined ? "/voice/ops-actions" : options.historyHtmlPath;
12312
12312
  const routes = new Elysia12({
12313
12313
  name: options.name ?? "absolutejs-voice-ops-action-audit"
12314
- }).post(path, async ({ request, set }) => {
12314
+ }).post(path, async ({ body, request, set }) => {
12315
12315
  try {
12316
- const record = await readRecord(request);
12316
+ const record = body === undefined ? await readRecord(request) : readRecordBody(body);
12317
12317
  return await recordVoiceOpsActionAudit(record, options);
12318
12318
  } catch (error) {
12319
12319
  set.status = 400;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.261",
3
+ "version": "0.0.22-beta.262",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",