@crvouga/mockingbird-service-rxvortex 3.13.0 → 3.14.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 +18 -1
- package/dist/chunk-4PYIJTMH.js +120 -0
- package/dist/chunk-4PYIJTMH.js.map +7 -0
- package/dist/chunk-GTPGV2ML.js +836 -0
- package/dist/chunk-GTPGV2ML.js.map +7 -0
- package/dist/cli.js +3 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +114 -106
- package/dist/index.js +1 -2
- package/dist/server.d.ts +45 -37
- package/dist/server.js +2 -3
- package/package.json +3 -2
- package/dist/admin-ui.js +0 -27
- package/dist/admin-ui.js.map +0 -7
- package/dist/chunk-5T5YCIQJ.js +0 -6631
- package/dist/chunk-5T5YCIQJ.js.map +0 -7
- package/dist/chunk-7MPHLPSO.js +0 -7
- package/dist/chunk-7MPHLPSO.js.map +0 -7
- package/dist/chunk-PJSVRZL5.js +0 -5169
- package/dist/chunk-PJSVRZL5.js.map +0 -7
package/dist/server.d.ts
CHANGED
|
@@ -105,41 +105,6 @@ interface FetchAPI {
|
|
|
105
105
|
/** A bare function form of {@link FetchAPI}, compatible with `Bun.serve`, workerd, and Deno. */
|
|
106
106
|
type FetchHandler = (request: Request) => Promise<Response>;
|
|
107
107
|
|
|
108
|
-
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
|
109
|
-
type SqliteValue = null | number | bigint | string | Uint8Array | boolean;
|
|
110
|
-
/** Mutation counters returned by {@link SqliteStatement.run}. */
|
|
111
|
-
type SqliteRunResult = {
|
|
112
|
-
changes: number;
|
|
113
|
-
lastInsertRowid: number | bigint;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Prepared statement bound to a {@link SqliteClient}.
|
|
117
|
-
*
|
|
118
|
-
* Pass bind values as rest arguments on each call (no sticky `bind()`).
|
|
119
|
-
*/
|
|
120
|
-
interface SqliteStatement {
|
|
121
|
-
run(...params: SqliteValue[]): SqliteRunResult;
|
|
122
|
-
all<T = Record<string, unknown>>(...params: SqliteValue[]): T[];
|
|
123
|
-
get<T = Record<string, unknown>>(...params: SqliteValue[]): T | undefined;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Sync SQLite client port owned by Mockingbird.
|
|
127
|
-
*
|
|
128
|
-
* Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
|
|
129
|
-
* `bun:sqlite` instances all work when they expose this surface.
|
|
130
|
-
*/
|
|
131
|
-
interface SqliteClient {
|
|
132
|
-
exec(sql: string): void;
|
|
133
|
-
prepare(sql: string): SqliteStatement;
|
|
134
|
-
transaction<T>(fn: () => T): T;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* What names an id base: a non-negative safe integer (or its decimal string) or `"boot"`,
|
|
139
|
-
* which derives the base from the wall clock when the runtime is created.
|
|
140
|
-
*/
|
|
141
|
-
type IdBase = number | string;
|
|
142
|
-
|
|
143
108
|
/**
|
|
144
109
|
* The single source of time for a service.
|
|
145
110
|
*
|
|
@@ -170,6 +135,11 @@ type Clock = {
|
|
|
170
135
|
state(): ClockState;
|
|
171
136
|
};
|
|
172
137
|
|
|
138
|
+
type UpstreamState = {
|
|
139
|
+
mode: "emulated" | "forward";
|
|
140
|
+
baseUrl: string;
|
|
141
|
+
};
|
|
142
|
+
|
|
173
143
|
/**
|
|
174
144
|
* Seeded pseudo-random numbers, so anything a mock invents — ids, jitter, which
|
|
175
145
|
* request a percentage fault hits — is reproducible from a seed.
|
|
@@ -433,6 +403,7 @@ declare const SNAPSHOT_FORMAT = "mockingbird.snapshot/v1";
|
|
|
433
403
|
* `records` are required, so a hand-written seed file is a valid snapshot.
|
|
434
404
|
*/
|
|
435
405
|
type SnapshotDocument = {
|
|
406
|
+
upstream?: UpstreamState;
|
|
436
407
|
format: typeof SNAPSHOT_FORMAT;
|
|
437
408
|
/** The service that wrote it. A snapshot is rejected by any other service. */
|
|
438
409
|
service?: string;
|
|
@@ -506,6 +477,7 @@ type LatencyState = LatencyRule & {
|
|
|
506
477
|
};
|
|
507
478
|
/** What {@link controlHeaders} turns into request headers. */
|
|
508
479
|
type ControlHeaderInput = {
|
|
480
|
+
upstream?: "emulated" | "forward";
|
|
509
481
|
namespace?: string;
|
|
510
482
|
adminKey?: string;
|
|
511
483
|
branch?: string;
|
|
@@ -523,6 +495,35 @@ type ControlHeaderInput = {
|
|
|
523
495
|
snapshot?: string;
|
|
524
496
|
};
|
|
525
497
|
|
|
498
|
+
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
|
499
|
+
type SqliteValue = null | number | bigint | string | Uint8Array | boolean;
|
|
500
|
+
/** Mutation counters returned by {@link SqliteStatement.run}. */
|
|
501
|
+
type SqliteRunResult = {
|
|
502
|
+
changes: number;
|
|
503
|
+
lastInsertRowid: number | bigint;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Prepared statement bound to a {@link SqliteClient}.
|
|
507
|
+
*
|
|
508
|
+
* Pass bind values as rest arguments on each call (no sticky `bind()`).
|
|
509
|
+
*/
|
|
510
|
+
interface SqliteStatement {
|
|
511
|
+
run(...params: SqliteValue[]): SqliteRunResult;
|
|
512
|
+
all<T = Record<string, unknown>>(...params: SqliteValue[]): T[];
|
|
513
|
+
get<T = Record<string, unknown>>(...params: SqliteValue[]): T | undefined;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Sync SQLite client port owned by Mockingbird.
|
|
517
|
+
*
|
|
518
|
+
* Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
|
|
519
|
+
* `bun:sqlite` instances all work when they expose this surface.
|
|
520
|
+
*/
|
|
521
|
+
interface SqliteClient {
|
|
522
|
+
exec(sql: string): void;
|
|
523
|
+
prepare(sql: string): SqliteStatement;
|
|
524
|
+
transaction<T>(fn: () => T): T;
|
|
525
|
+
}
|
|
526
|
+
|
|
526
527
|
/**
|
|
527
528
|
* One problem with a request body, at a dotted path (`patient.address.city`, `items.0.sku`).
|
|
528
529
|
* `kind` is `media_type` when the body is present but its media type is not one the operation
|
|
@@ -549,6 +550,7 @@ type RejectedRequest = {
|
|
|
549
550
|
};
|
|
550
551
|
/** One handled request, as the structured log sees it. */
|
|
551
552
|
type RequestLog = {
|
|
553
|
+
upstream?: boolean;
|
|
552
554
|
service: string;
|
|
553
555
|
namespace: string;
|
|
554
556
|
operationId: string | undefined;
|
|
@@ -683,8 +685,6 @@ type CredentialRegistry = {
|
|
|
683
685
|
}[];
|
|
684
686
|
};
|
|
685
687
|
|
|
686
|
-
type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
|
|
687
|
-
|
|
688
688
|
/**
|
|
689
689
|
* A point-in-time copy of everything a service namespace holds.
|
|
690
690
|
*
|
|
@@ -737,6 +737,14 @@ type StateView = {
|
|
|
737
737
|
collections: StateCollectionView[];
|
|
738
738
|
};
|
|
739
739
|
|
|
740
|
+
/**
|
|
741
|
+
* What names an id base: a non-negative safe integer (or its decimal string) or `"boot"`,
|
|
742
|
+
* which derives the base from the wall clock when the runtime is created.
|
|
743
|
+
*/
|
|
744
|
+
type IdBase = number | string;
|
|
745
|
+
|
|
746
|
+
type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
|
|
747
|
+
|
|
740
748
|
type WebhookEndpoint = {
|
|
741
749
|
/** Stable id; generated when omitted. */
|
|
742
750
|
id?: string;
|
package/dist/server.js
CHANGED
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
createServer,
|
|
4
4
|
loadCatalogFile,
|
|
5
5
|
serveTarget
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-7MPHLPSO.js";
|
|
6
|
+
} from "./chunk-4PYIJTMH.js";
|
|
7
|
+
import "./chunk-GTPGV2ML.js";
|
|
9
8
|
export {
|
|
10
9
|
DEFAULT_PORT,
|
|
11
10
|
createServer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-rxvortex",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"description": "Stateful emulator of the RxVortex (Strive) pharmacy API: OAuth token, order submit, status, cancel, recovery by sender order id, preset catalog, and signed status webhooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
"pack:check": "bun ../../../scripts/pack-check.ts"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@crvouga/mockingbird-
|
|
101
|
+
"@crvouga/mockingbird-runtime": "0.0.2",
|
|
102
|
+
"@crvouga/mockingbird-service-sqlite": "3.5.1",
|
|
102
103
|
"hono": "4.13.11"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|