@crvouga/mockingbird-service-twilio 0.2.0 → 1.0.1
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 +14 -1
- package/dist/{chunk-VOBVFMYN.js → chunk-KM32VDLC.js} +23 -6
- package/dist/chunk-KM32VDLC.js.map +7 -0
- package/dist/{chunk-37HPXDSK.js → chunk-WUTNNZCH.js} +5 -3
- package/dist/chunk-WUTNNZCH.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +117 -89
- package/dist/index.js +1 -1
- package/dist/server.d.ts +221 -165
- package/dist/server.js +2 -2
- package/package.json +6 -2
- package/dist/chunk-37HPXDSK.js.map +0 -7
- package/dist/chunk-VOBVFMYN.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-twilio
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 1.0.1 (2026-09-26)
|
|
4
|
+
|
|
5
|
+
### Fixes and improvements
|
|
6
|
+
|
|
7
|
+
- take the rejected-request byte count from content-length, never by reading the body ([a0e5fb2](https://github.com/crvouga/mockingbird/commit/a0e5fb2fc80ab725c3552b612f3f091fd6c857fb))
|
|
8
|
+
- reject a present body by media type, and log what a rejected request sent ([12e351a](https://github.com/crvouga/mockingbird/commit/12e351aba53cfb7b41e31a7809419455fc2902eb))
|
|
9
|
+
|
|
10
|
+
## 1.0.0 (2026-09-24)
|
|
11
|
+
|
|
12
|
+
### ⚠️ Breaking changes
|
|
13
|
+
|
|
14
|
+
- vendor branding for every service; purge internal mocks and consumer names ([f689534](https://github.com/crvouga/mockingbird/commit/f6895343543550dafcb7d76b426cae7635e03226))
|
|
15
|
+
|
|
16
|
+
## 0.2.0 (2026-09-23)
|
|
4
17
|
|
|
5
18
|
### Features
|
|
6
19
|
|
|
@@ -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
|
-
|
|
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 ? "0.
|
|
1388
|
+
var PACKAGE_VERSION = true ? "1.0.1" : 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-
|
|
3659
|
+
//# sourceMappingURL=chunk-KM32VDLC.js.map
|