@crvouga/mockingbird-service-aha 3.10.7 → 3.10.8

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/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-73ZN7WML.js";
7
- import "./chunk-DEBGYVU4.js";
6
+ } from "./chunk-RQ2KJQK2.js";
7
+ import "./chunk-UC4EBAJC.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -773,6 +773,15 @@ type CredentialRegistry = {
773
773
  }[];
774
774
  };
775
775
 
776
+ type IdempotencyStoreOptions = {
777
+ /** The clock key ages are measured on; pass the runtime's so a test can advance it. */
778
+ now?: () => number;
779
+ /**
780
+ * How long a key is kept, in ms. A reuse at or after this age runs as a new request, as
781
+ * Stripe does once it prunes a key ("at least 24 hours old"). Default: keys never expire.
782
+ */
783
+ ttlMs?: number;
784
+ };
776
785
  type IdempotencyErrors = {
777
786
  /** Same key, different parameters. */
778
787
  mismatch: () => Response;
@@ -781,8 +790,9 @@ type IdempotencyErrors = {
781
790
  };
782
791
  declare class IdempotencyStore {
783
792
  private readonly namespace;
793
+ private readonly options;
784
794
  private readonly responses;
785
- constructor(sqlite: SqliteClient$1, namespace: string, name?: string);
795
+ constructor(sqlite: SqliteClient$1, namespace: string, name?: string, options?: IdempotencyStoreOptions);
786
796
  /**
787
797
  * Run `handler` once per `key`. `fingerprint` identifies the request's parameters (e.g.
788
798
  * the method, path and canonical body). Only `replayable` responses are stored (default:
@@ -791,6 +801,7 @@ declare class IdempotencyStore {
791
801
  * Stripe also saves endpoint-produced 500 responses.
792
802
  */
793
803
  run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number, response: Response) => boolean): Promise<Response>;
804
+ private expired;
794
805
  }
795
806
 
796
807
  type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  verifyAuth,
15
15
  zonedParts,
16
16
  zonedToEpoch
17
- } from "./chunk-DEBGYVU4.js";
17
+ } from "./chunk-UC4EBAJC.js";
18
18
  export {
19
19
  AHA_NAMESPACE,
20
20
  AHA_PRESETS,
package/dist/server.d.ts CHANGED
@@ -1744,6 +1744,15 @@ type CredentialRegistry = {
1744
1744
  }[];
1745
1745
  };
1746
1746
 
1747
+ type IdempotencyStoreOptions = {
1748
+ /** The clock key ages are measured on; pass the runtime's so a test can advance it. */
1749
+ now?: () => number;
1750
+ /**
1751
+ * How long a key is kept, in ms. A reuse at or after this age runs as a new request, as
1752
+ * Stripe does once it prunes a key ("at least 24 hours old"). Default: keys never expire.
1753
+ */
1754
+ ttlMs?: number;
1755
+ };
1747
1756
  type IdempotencyErrors = {
1748
1757
  /** Same key, different parameters. */
1749
1758
  mismatch: () => Response;
@@ -1752,8 +1761,9 @@ type IdempotencyErrors = {
1752
1761
  };
1753
1762
  declare class IdempotencyStore {
1754
1763
  private readonly namespace;
1764
+ private readonly options;
1755
1765
  private readonly responses;
1756
- constructor(sqlite: SqliteClient$1, namespace: string, name?: string);
1766
+ constructor(sqlite: SqliteClient$1, namespace: string, name?: string, options?: IdempotencyStoreOptions);
1757
1767
  /**
1758
1768
  * Run `handler` once per `key`. `fingerprint` identifies the request's parameters (e.g.
1759
1769
  * the method, path and canonical body). Only `replayable` responses are stored (default:
@@ -1762,6 +1772,7 @@ declare class IdempotencyStore {
1762
1772
  * Stripe also saves endpoint-produced 500 responses.
1763
1773
  */
1764
1774
  run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number, response: Response) => boolean): Promise<Response>;
1775
+ private expired;
1765
1776
  }
1766
1777
 
1767
1778
  type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  createServer,
4
4
  serveTarget
5
- } from "./chunk-73ZN7WML.js";
6
- import "./chunk-DEBGYVU4.js";
5
+ } from "./chunk-RQ2KJQK2.js";
6
+ import "./chunk-UC4EBAJC.js";
7
7
  export {
8
8
  DEFAULT_PORT,
9
9
  createServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-aha",
3
- "version": "3.10.7",
3
+ "version": "3.10.8",
4
4
  "description": "Stateful AHA phlebotomy emulator with signed HTTP orders, status webhooks, and a real deterministic SSH/SFTP result server.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -106,8 +106,8 @@
106
106
  "pack:check": "bun ../../../scripts/pack-check.ts"
107
107
  },
108
108
  "dependencies": {
109
- "@crvouga/mockingbird-service-sqlite": "3.4.1",
110
- "hono": "4.11.9",
109
+ "@crvouga/mockingbird-service-sqlite": "3.4.2",
110
+ "hono": "4.13.11",
111
111
  "ssh2": "1.17.0"
112
112
  },
113
113
  "devDependencies": {