@crvouga/mockingbird-service-slack 3.3.0 → 3.5.0

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,14 +1,28 @@
1
1
  # Changelog — @crvouga/mockingbird-service-slack
2
2
 
3
- ## 3.3.0 (2026-10-12)
3
+ ## 3.5.0 (2026-10-16)
4
4
 
5
5
  ### Features
6
6
 
7
- - unify the emulator control plane ([2068547](https://github.com/crvouga/mockingbird/commit/2068547bedde4e2e2331c1657c1a78120e84428b))
7
+ - resolve SQL, routing and writer gaps ([73f97d0](https://github.com/crvouga/mockingbird/commit/73f97d0d2379f44b9131180498f4fab76648fed9))
8
8
 
9
- ### Dependencies
9
+ ## 3.4.0 (2026-10-15)
10
+
11
+ ### Features
12
+
13
+ - finish durable run lifecycle ([725ea1a](https://github.com/crvouga/mockingbird/commit/725ea1a966dac65434e98f06a9c33aca0d6f32d7))
14
+ - add management and portable archives ([0d2a6dd](https://github.com/crvouga/mockingbird/commit/0d2a6dd0f9fecb3a1ea7c1638f6639787395c2f4))
15
+
16
+ ### Fixes and improvements
10
17
 
11
- - `@crvouga/mockingbird-service-sqlite`
18
+ - correlate cross-namespace operations ([3457a4b](https://github.com/crvouga/mockingbird/commit/3457a4b7dbfd9ad9c8a10671a5744b7c8425d000))
19
+ - harden HTTP stream handling ([674307a](https://github.com/crvouga/mockingbird/commit/674307a869f57907567d462c4f506c3b0a237e13))
20
+
21
+ ## 3.3.0 (2026-10-12)
22
+
23
+ ### Features
24
+
25
+ - unify the emulator control plane ([2068547](https://github.com/crvouga/mockingbird/commit/2068547bedde4e2e2331c1657c1a78120e84428b))
12
26
 
13
27
  ## 3.2.0 (2026-10-08)
14
28
 
@@ -1156,7 +1156,7 @@ var assertSnapshotDocument = (value, label = "snapshot") => {
1156
1156
  });
1157
1157
  }
1158
1158
  if (value.clock !== void 0) {
1159
- if (!isRecord2(value.clock) || typeof value.clock.now !== "number" || typeof value.clock.frozen !== "boolean")
1159
+ if (!isRecord2(value.clock) || typeof value.clock.now !== "number" || !Number.isFinite(value.clock.now) || typeof value.clock.frozen !== "boolean")
1160
1160
  throw new ControlError(`${label}.clock: expected {now, frozen}`);
1161
1161
  }
1162
1162
  return value;
@@ -3036,6 +3036,91 @@ var createMetrics = (partition = true) => {
3036
3036
  };
3037
3037
  };
3038
3038
 
3039
+ // ../core/dist/outbound.js
3040
+ function ownedTransport(policy) {
3041
+ if (!["offline", "allowlist"].includes(policy.mode) || policy.origins?.some((origin) => {
3042
+ try {
3043
+ return new URL(origin).origin !== origin;
3044
+ } catch {
3045
+ return true;
3046
+ }
3047
+ }))
3048
+ throw new Error("invalid outbound transport policy");
3049
+ const reject = (namespace, reason) => {
3050
+ try {
3051
+ policy.onReject?.({ namespace, policy: policy.mode, reason });
3052
+ } catch {
3053
+ }
3054
+ throw new Error(`outbound policy ${policy.mode}: ${reason}`);
3055
+ };
3056
+ return async (request, namespace, send) => {
3057
+ if (policy.mode === "offline")
3058
+ return reject(namespace, "delivery disabled");
3059
+ const allowed = (url2) => ["http:", "https:"].includes(url2.protocol) && !url2.username && !url2.password && (policy.origins ?? []).includes(url2.origin);
3060
+ let url = new URL(request.url);
3061
+ if (!allowed(url))
3062
+ return reject(namespace, "destination not allowed");
3063
+ const max = policy.maxBodyBytes ?? 1024 * 1024;
3064
+ const chunks = [];
3065
+ let size = 0;
3066
+ const reader = request.body?.getReader();
3067
+ if (reader)
3068
+ try {
3069
+ for (; ; ) {
3070
+ const item = await reader.read();
3071
+ if (item.done)
3072
+ break;
3073
+ size += item.value.length;
3074
+ if (size > max)
3075
+ return reject(namespace, "body limit exceeded");
3076
+ chunks.push(item.value);
3077
+ }
3078
+ } finally {
3079
+ void reader.cancel().catch(() => {
3080
+ });
3081
+ reader.releaseLock();
3082
+ }
3083
+ const body = new Uint8Array(size);
3084
+ let offset = 0;
3085
+ for (const chunk of chunks) {
3086
+ body.set(chunk, offset);
3087
+ offset += chunk.length;
3088
+ }
3089
+ let method = request.method, headers = new Headers(request.headers);
3090
+ for (let redirects = 0; ; redirects++) {
3091
+ if (!allowed(url))
3092
+ return reject(namespace, "redirect destination not allowed");
3093
+ const response = await send(new Request(url, {
3094
+ method,
3095
+ headers,
3096
+ ...method !== "GET" && method !== "HEAD" ? { body } : {},
3097
+ redirect: "manual",
3098
+ signal: request.signal
3099
+ }));
3100
+ if (![301, 302, 303, 307, 308].includes(response.status))
3101
+ return response;
3102
+ const location = response.headers.get("location");
3103
+ if (!location)
3104
+ return response;
3105
+ await response.body?.cancel();
3106
+ if (redirects >= (policy.maxRedirects ?? 5))
3107
+ return reject(namespace, "redirect limit exceeded");
3108
+ const next = new URL(location, url);
3109
+ if (next.origin !== url.origin) {
3110
+ headers = new Headers(headers);
3111
+ for (const key of ["authorization", "cookie", "proxy-authorization"])
3112
+ headers.delete(key);
3113
+ }
3114
+ if (response.status === 303 || (response.status === 301 || response.status === 302) && method === "POST") {
3115
+ method = "GET";
3116
+ headers.delete("content-length");
3117
+ headers.delete("content-type");
3118
+ }
3119
+ url = next;
3120
+ }
3121
+ };
3122
+ }
3123
+
3039
3124
  // ../core/dist/outbox.js
3040
3125
  var OutboxStore = class {
3041
3126
  items;
@@ -3671,7 +3756,7 @@ var stateAdminRoutes = (routes) => {
3671
3756
  };
3672
3757
 
3673
3758
  // ../core/dist/version.js
3674
- var PACKAGE_VERSION = true ? "3.3.0" : UNRELEASED_VERSION;
3759
+ var PACKAGE_VERSION = true ? "3.5.0" : UNRELEASED_VERSION;
3675
3760
 
3676
3761
  // ../core/dist/webhooks.js
3677
3762
  var json5 = (status, body) => new Response(JSON.stringify(body), {
@@ -4251,7 +4336,8 @@ var createRuntime = (options) => {
4251
4336
  ...point.rngState !== void 0 ? { rng: { state: point.rngState, ...streams } } : {},
4252
4337
  ...rules ? { faults: rules } : {},
4253
4338
  ...waits ? { latency: waits } : {},
4254
- ...settings?.virtualTime !== void 0 ? { virtualTime: settings.virtualTime } : {}
4339
+ ...settings?.virtualTime !== void 0 ? { virtualTime: settings.virtualTime } : {},
4340
+ ...point.webhooks !== void 0 ? { webhooks: options.webhooks?.exportSnapshot(point.webhooks) } : {}
4255
4341
  };
4256
4342
  };
4257
4343
  const position = (value, label) => {
@@ -4336,7 +4422,8 @@ var createRuntime = (options) => {
4336
4422
  records: stored,
4337
4423
  ...document2.clock ? { clock: { now: document2.clock.now, frozen: document2.clock.frozen } } : {},
4338
4424
  ...document2.rng?.state !== void 0 ? { rngState: position(document2.rng.state, "snapshot.rng.state") } : {},
4339
- controls: held
4425
+ controls: held,
4426
+ ...document2.webhooks !== void 0 ? { webhooks: options.webhooks?.importSnapshot(namespace, document2.webhooks) } : {}
4340
4427
  };
4341
4428
  };
4342
4429
  const kept = /* @__PURE__ */ new Map();
@@ -4470,6 +4557,20 @@ var createRuntime = (options) => {
4470
4557
  restoreAll(namespace, point);
4471
4558
  timelines.delete(namespace);
4472
4559
  },
4560
+ fleetExport(handle) {
4561
+ const point = typeof handle === "object" && handle !== null ? fleetPoints.get(handle) : void 0;
4562
+ if (!point)
4563
+ throw new Error("invalid fleet checkpoint");
4564
+ return toDocument(point);
4565
+ },
4566
+ fleetImport(namespace, document2) {
4567
+ const handle = {};
4568
+ fleetPoints.set(handle, {
4569
+ namespace,
4570
+ ...fromDocument(namespace, assertSnapshotDocument(document2))
4571
+ });
4572
+ return handle;
4573
+ },
4473
4574
  applyPreset: (name2, namespace = DEFAULT_NAMESPACE, overrides = {}) => controls.addFault(namespace, { ...overrides, preset: name2 }),
4474
4575
  instance,
4475
4576
  namespaces: () => [...publicNamespaces].sort(),
@@ -12606,9 +12707,11 @@ export {
12606
12707
  createClock,
12607
12708
  restoreClock,
12608
12709
  parseDuration,
12710
+ normalizeControls,
12609
12711
  normalizeBootControls,
12610
12712
  parseFaultHeader,
12611
12713
  resolveAdminPrefix,
12714
+ ownedTransport,
12612
12715
  document,
12613
12716
  operationIds,
12614
12717
  supportedOperationIds,
@@ -12634,4 +12737,4 @@ export {
12634
12737
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
12635
12738
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
12636
12739
  */
12637
- //# sourceMappingURL=chunk-6MIIKZZB.js.map
12740
+ //# sourceMappingURL=chunk-4JPRLFNZ.js.map