@crvouga/mockingbird-service-slack 1.0.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 CHANGED
@@ -1,15 +1,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-slack
2
2
 
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
+
3
10
  ## 1.0.0 (2026-09-24)
4
11
 
5
12
  ### ⚠️ Breaking changes
6
13
 
7
14
  - vendor branding for every service; purge internal mocks and consumer names ([f689534](https://github.com/crvouga/mockingbird/commit/f6895343543550dafcb7d76b426cae7635e03226))
8
15
 
9
- ### Dependencies
10
-
11
- - `@crvouga/mockingbird-service-sqlite`
12
-
13
16
  ## 0.2.0 (2026-09-23)
14
17
 
15
18
  ### Features
@@ -1223,6 +1223,16 @@ var operationMetadata = (operation) => {
1223
1223
 
1224
1224
  // ../core/dist/service.js
1225
1225
  import { Hono } from "hono";
1226
+
1227
+ // ../core/dist/validation.js
1228
+ var recorded = /* @__PURE__ */ new WeakMap();
1229
+ var recordedIssues = (request) => recorded.get(request);
1230
+
1231
+ // ../core/dist/service.js
1232
+ var withIssues = (request, response) => {
1233
+ const issues = response.status >= 400 ? recordedIssues(request) : void 0;
1234
+ return issues && issues.length > 0 ? annotateResponse(response, { issues }) : response;
1235
+ };
1226
1236
  var defineOperations = (handlers) => handlers;
1227
1237
  var OperationRegistryError = class extends Error {
1228
1238
  problems;
@@ -1308,9 +1318,7 @@ var createService = (options) => {
1308
1318
  now
1309
1319
  };
1310
1320
  const short = await options.before?.(context);
1311
- if (short)
1312
- return short;
1313
- return handler(context);
1321
+ return withIssues(request, short ?? await handler(context));
1314
1322
  };
1315
1323
  app.on(operation.method.toUpperCase(), honoPath(operation.path), route);
1316
1324
  }
@@ -1347,7 +1355,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1347
1355
  };
1348
1356
 
1349
1357
  // ../core/dist/version.js
1350
- var PACKAGE_VERSION = true ? "1.0.0" : UNRELEASED_VERSION;
1358
+ var PACKAGE_VERSION = true ? "1.0.1" : UNRELEASED_VERSION;
1351
1359
 
1352
1360
  // ../core/dist/webhooks.js
1353
1361
  var json3 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
@@ -1787,8 +1795,15 @@ var createRuntime = (options) => {
1787
1795
  const started = monotonicNow();
1788
1796
  const url = new URL(request.url);
1789
1797
  const operationId = operationIdFor(request, url.pathname);
1798
+ const contentLength = request.headers.get("content-length");
1799
+ const received = {
1800
+ contentType: request.headers.get("content-type"),
1801
+ bodyBytes: contentLength !== null && /^\d+$/.test(contentLength) ? Number(contentLength) : null,
1802
+ transferEncoding: request.headers.get("transfer-encoding")
1803
+ };
1790
1804
  const log = (status, faultId, response2) => {
1791
1805
  const noted = response2 ? responseNotes(response2) : void 0;
1806
+ const rejected = status >= 400 && faultId === void 0;
1792
1807
  const entry = {
1793
1808
  service: options.name,
1794
1809
  namespace,
@@ -1800,7 +1815,9 @@ var createRuntime = (options) => {
1800
1815
  unmatched: options.document !== void 0 && operationId === void 0,
1801
1816
  ...faultId !== void 0 ? { faultId } : {},
1802
1817
  ...noted?.ids && Object.keys(noted.ids).length > 0 ? { ids: noted.ids } : {},
1803
- ...noted?.adopted ? { adopted: true } : {}
1818
+ ...noted?.adopted ? { adopted: true } : {},
1819
+ ...rejected ? { request: { ...received } } : {},
1820
+ ...rejected && noted?.issues && noted.issues.length > 0 ? { issues: noted.issues.map((issue) => ({ ...issue })) } : {}
1804
1821
  };
1805
1822
  metrics.record(entry);
1806
1823
  journal.record({ ...entry, at: new Date(clock.now()).toISOString() });
@@ -2908,4 +2925,4 @@ export {
2908
2925
  slackCredential,
2909
2926
  SlackAPI
2910
2927
  };
2911
- //# sourceMappingURL=chunk-HYPQOQ27.js.map
2928
+ //# sourceMappingURL=chunk-T6MXK2OA.js.map