@crvouga/mockingbird-service-twilio 1.0.0 → 1.0.2

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,15 +1,24 @@
1
1
  # Changelog — @crvouga/mockingbird-service-twilio
2
2
 
3
+ ## 1.0.2 (2026-09-26)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - treat enum [""] branches as unset markers in form coercion ([7177835](https://github.com/crvouga/mockingbird/commit/7177835cc510e14245d6648ad2821daa694bb80c))
8
+
9
+ ## 1.0.1 (2026-09-25)
10
+
11
+ ### Fixes and improvements
12
+
13
+ - take the rejected-request byte count from content-length, never by reading the body ([a0e5fb2](https://github.com/crvouga/mockingbird/commit/a0e5fb2fc80ab725c3552b612f3f091fd6c857fb))
14
+ - reject a present body by media type, and log what a rejected request sent ([12e351a](https://github.com/crvouga/mockingbird/commit/12e351aba53cfb7b41e31a7809419455fc2902eb))
15
+
3
16
  ## 1.0.0 (2026-09-24)
4
17
 
5
18
  ### ⚠️ Breaking changes
6
19
 
7
20
  - vendor branding for every service; purge internal mocks and consumer names ([f689534](https://github.com/crvouga/mockingbird/commit/f6895343543550dafcb7d76b426cae7635e03226))
8
21
 
9
- ### Dependencies
10
-
11
- - `@crvouga/mockingbird-service-sqlite`
12
-
13
22
  ## 0.2.0 (2026-09-23)
14
23
 
15
24
  ### Features
@@ -1253,6 +1253,16 @@ var operationMetadata = (operation) => {
1253
1253
 
1254
1254
  // ../core/dist/service.js
1255
1255
  import { Hono } from "hono";
1256
+
1257
+ // ../core/dist/validation.js
1258
+ var recorded = /* @__PURE__ */ new WeakMap();
1259
+ var recordedIssues = (request) => recorded.get(request);
1260
+
1261
+ // ../core/dist/service.js
1262
+ var withIssues = (request, response) => {
1263
+ const issues = response.status >= 400 ? recordedIssues(request) : void 0;
1264
+ return issues && issues.length > 0 ? annotateResponse(response, { issues }) : response;
1265
+ };
1256
1266
  var defineOperations = (handlers) => handlers;
1257
1267
  var OperationRegistryError = class extends Error {
1258
1268
  problems;
@@ -1338,9 +1348,7 @@ var createService = (options) => {
1338
1348
  now
1339
1349
  };
1340
1350
  const short = await options.before?.(context);
1341
- if (short)
1342
- return short;
1343
- return handler(context);
1351
+ return withIssues(request, short ?? await handler(context));
1344
1352
  };
1345
1353
  app.on(operation.method.toUpperCase(), honoPath(operation.path), route);
1346
1354
  }
@@ -1377,7 +1385,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1377
1385
  };
1378
1386
 
1379
1387
  // ../core/dist/version.js
1380
- var PACKAGE_VERSION = true ? "1.0.0" : UNRELEASED_VERSION;
1388
+ var PACKAGE_VERSION = true ? "1.0.2" : UNRELEASED_VERSION;
1381
1389
 
1382
1390
  // ../core/dist/signing.js
1383
1391
  var encoder = new TextEncoder();
@@ -2135,8 +2143,15 @@ var createRuntime = (options) => {
2135
2143
  const started = monotonicNow();
2136
2144
  const url = new URL(request.url);
2137
2145
  const operationId = operationIdFor(request, url.pathname);
2146
+ const contentLength = request.headers.get("content-length");
2147
+ const received = {
2148
+ contentType: request.headers.get("content-type"),
2149
+ bodyBytes: contentLength !== null && /^\d+$/.test(contentLength) ? Number(contentLength) : null,
2150
+ transferEncoding: request.headers.get("transfer-encoding")
2151
+ };
2138
2152
  const log = (status, faultId, response2) => {
2139
2153
  const noted = response2 ? responseNotes(response2) : void 0;
2154
+ const rejected = status >= 400 && faultId === void 0;
2140
2155
  const entry = {
2141
2156
  service: options.name,
2142
2157
  namespace,
@@ -2148,7 +2163,9 @@ var createRuntime = (options) => {
2148
2163
  unmatched: options.document !== void 0 && operationId === void 0,
2149
2164
  ...faultId !== void 0 ? { faultId } : {},
2150
2165
  ...noted?.ids && Object.keys(noted.ids).length > 0 ? { ids: noted.ids } : {},
2151
- ...noted?.adopted ? { adopted: true } : {}
2166
+ ...noted?.adopted ? { adopted: true } : {},
2167
+ ...rejected ? { request: { ...received } } : {},
2168
+ ...rejected && noted?.issues && noted.issues.length > 0 ? { issues: noted.issues.map((issue) => ({ ...issue })) } : {}
2152
2169
  };
2153
2170
  metrics.record(entry);
2154
2171
  journal.record({ ...entry, at: new Date(clock.now()).toISOString() });
@@ -3639,4 +3656,4 @@ export {
3639
3656
  twilioError,
3640
3657
  TwilioAPI
3641
3658
  };
3642
- //# sourceMappingURL=chunk-VOBVFMYN.js.map
3659
+ //# sourceMappingURL=chunk-KM32VDLC.js.map