@crvouga/mockingbird-service-junction 3.6.0 → 3.7.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/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  runCli,
5
5
  serveCommand,
6
6
  serveTarget
7
- } from "./chunk-WMJJYHRV.js";
7
+ } from "./chunk-NTGGNJKR.js";
8
8
  import {
9
9
  DEFAULT_JUNCTION_BASE_URL,
10
10
  createRuntime,
@@ -12,7 +12,7 @@ import {
12
12
  isSandboxKey,
13
13
  pullCorpus,
14
14
  verifyAgainstReal
15
- } from "./chunk-ZRF3DDJ4.js";
15
+ } from "./chunk-27N4VA23.js";
16
16
  import {
17
17
  defaultCorpus
18
18
  } from "./chunk-2FZJPMTR.js";
package/dist/index.d.ts CHANGED
@@ -1,77 +1,5 @@
1
1
  import { Hono } from 'hono';
2
2
 
3
- type LabAccountStatus = "active" | "pending" | "suspended" | "ready_to_launch";
4
- type LabAccountDelegatedFlow = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated";
5
- type LabAccountRecord = {
6
- id: string;
7
- lab: string;
8
- org_id: string | null;
9
- status: LabAccountStatus;
10
- delegated_flow: LabAccountDelegatedFlow;
11
- provider_account_id: string;
12
- account_name: string | null;
13
- default_clinical_notes: string | null;
14
- business_units: string[] | null;
15
- allowed_billing: Record<string, readonly string[]>;
16
- team_id_allowlist: readonly string[];
17
- };
18
- /** The 50 `USState` values from the docs, alphabetical by state name. */
19
- declare const US_STATES: readonly string[];
20
- /** `billing_type` values the vendored create-order body accepts. */
21
- declare const BILLING_TYPES: readonly ["client_bill", "commercial_insurance", "patient_bill_passthrough", "patient_bill", "upfront_payment"];
22
- type BillingType = (typeof BILLING_TYPES)[number];
23
- /** A team the mock is not, for fixtures that model another team's account. */
24
- declare const OTHER_TEAM_ID: string;
25
- declare const TEAM_LAB_ACCOUNTS: readonly LabAccountRecord[];
26
- /**
27
- * Whether `teamId` may use an account. An empty `team_id_allowlist` counts as linked:
28
- * a real team's listing returns such accounts (Junction's own Quest, Labcorp and
29
- * BioReference accounts carry `[]`), and the sandbox places an order that names one by id
30
- * (corpus/lab-account-probes.json), so the mock treats them as the team's.
31
- */
32
- declare const isLinkedToTeam: (entry: LabAccountRecord, teamId: string) => boolean;
33
- type LabAccountOmissionPolicy = "platform" | "reject";
34
- /**
35
- * A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
36
- * every field but `id` and `lab` optional, plus a `states` shorthand for the common
37
- * case of an account that client-bills in a fixed set of states.
38
- */
39
- type LabAccountInput = {
40
- id: string;
41
- /** Lab slug, e.g. `"quest"`, `"labcorp"`, `"bioreference"`. */
42
- lab: string;
43
- status?: LabAccountStatus;
44
- delegated_flow?: LabAccountDelegatedFlow;
45
- account_name?: string | null;
46
- provider_account_id?: string;
47
- org_id?: string | null;
48
- business_units?: string[] | null;
49
- default_clinical_notes?: string | null;
50
- /** Billing type → states it is allowed in. Takes precedence over `states`. */
51
- allowed_billing?: Record<string, readonly string[]>;
52
- /** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
53
- states?: readonly string[];
54
- /** Teams the account is linked to. Default: the configured team, so it is selectable. */
55
- team_id_allowlist?: readonly string[];
56
- };
57
- /**
58
- * Normalize a consumer's configuration into the record the ordering rules read.
59
- * `teamId` is the default allowlist, so an account is selectable unless told otherwise.
60
- */
61
- declare const labAccountFromInput: (input: LabAccountInput, teamId?: string) => LabAccountRecord;
62
-
63
- type LabAccountProfile = "native" | "expected-contract" | "sandbox-observed";
64
- type LabAccountSandboxPolicy = {
65
- /** Explicit billing refusals observed for this particular fixture/account. */
66
- rejectBilling?: Partial<Record<BillingType, string>>;
67
- /** Explicit billing/state exceptions observed for this particular fixture/account. */
68
- allowBilling?: Partial<Record<BillingType, readonly string[]>>;
69
- };
70
- type LabAccountBehavior = {
71
- profile: LabAccountProfile;
72
- accounts: Record<string, LabAccountSandboxPolicy>;
73
- };
74
-
75
3
  type MountedAPI = FetchAPI$1 & {
76
4
  readonly prefix: string;
77
5
  GET: FetchHandler;
@@ -204,6 +132,12 @@ interface SqliteClient$1 {
204
132
  transaction<T>(fn: () => T): T;
205
133
  }
206
134
 
135
+ /**
136
+ * What names an id base: a non-negative safe integer (or its decimal string) or `"boot"`,
137
+ * which derives the base from the wall clock when the runtime is created.
138
+ */
139
+ type IdBase = number | string;
140
+
207
141
  /** Options every provider constructor accepts. */
208
142
  type APIOptions = {
209
143
  /** Sync SQLite client. Defaults to `@crvouga/mockingbird-service-sqlite`. */
@@ -299,6 +233,15 @@ type FaultRule = {
299
233
  requestHeaders?: Record<string, string>;
300
234
  /** Fault only requests carrying these query parameters. `"*"` matches any value. */
301
235
  query?: Record<string, string>;
236
+ /**
237
+ * Fault only requests whose JSON body carries these fields. Each key is a dotted path into
238
+ * the parsed body (`"patient_details.email"`; a number steps into an array, `"items.0.sku"`)
239
+ * and each value is what the field must equal: a string, number, boolean or `null`, compared
240
+ * strictly (`3` is not `"3"`). `"*"` matches any value that is present. A request whose body
241
+ * is missing, is not JSON, or is not a JSON object never matches. Not `body`, which is the
242
+ * response a rule injects.
243
+ */
244
+ requestBody?: Record<string, RequestBodyValue>;
302
245
  /**
303
246
  * Fault only this namespace. Omit (or `"*"`) to fault every namespace — which is what
304
247
  * an in-process caller usually wants, and what a parallel worker usually does not:
@@ -365,6 +308,8 @@ type FaultRule = {
365
308
  /** The preset this rule was expanded from, if any. */
366
309
  fromPreset?: string;
367
310
  };
311
+ /** What a field of the request body must equal in {@link FaultRule.requestBody}. */
312
+ type RequestBodyValue = string | number | boolean | null;
368
313
  /** A fault that fired for one request. */
369
314
  type FaultHit = {
370
315
  id: string;
@@ -389,6 +334,11 @@ type FaultCandidate = {
389
334
  /** Request headers and query, for rules that match on them. */
390
335
  headers?: Headers;
391
336
  query?: URLSearchParams;
337
+ /**
338
+ * The request body parsed as JSON, read only when a rule matches on `requestBody`. Resolve
339
+ * `undefined` for a body that is missing or not JSON. It must leave the request readable.
340
+ */
341
+ readJson?: () => Promise<unknown>;
392
342
  /** The namespace clock, for `from` / `until`. Rules with a window are skipped without it. */
393
343
  now?: number;
394
344
  /** How to spend a delay for this request. Default: the registry's own sleep. */
@@ -911,6 +861,12 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
911
861
  mount(prefix: string): MountedAPI;
912
862
  readonly sqlite: SqliteClient$1;
913
863
  readonly clock: Clock;
864
+ /**
865
+ * Change the id base ({@link RuntimeOptions.idBase}) for ids generated from now on, and
866
+ * return the number it resolved to. Set it before the first request so a boot's ids stay
867
+ * one run.
868
+ */
869
+ setIdBase(base: IdBase): number;
914
870
  readonly faults: FaultRegistry;
915
871
  /** Baseline response time per namespace. */
916
872
  readonly latency: LatencyRegistry;
@@ -989,35 +945,6 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
989
945
  state(namespace?: string): StateView;
990
946
  };
991
947
 
992
- /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
993
- type SqliteValue = null | number | bigint | string | Uint8Array | boolean;
994
- /** Mutation counters returned by {@link SqliteStatement.run}. */
995
- type SqliteRunResult = {
996
- changes: number;
997
- lastInsertRowid: number | bigint;
998
- };
999
- /**
1000
- * Prepared statement bound to a {@link SqliteClient}.
1001
- *
1002
- * Pass bind values as rest arguments on each call (no sticky `bind()`).
1003
- */
1004
- interface SqliteStatement {
1005
- run(...params: SqliteValue[]): SqliteRunResult;
1006
- all<T = Record<string, unknown>>(...params: SqliteValue[]): T[];
1007
- get<T = Record<string, unknown>>(...params: SqliteValue[]): T | undefined;
1008
- }
1009
- /**
1010
- * Sync SQLite client port owned by Mockingbird.
1011
- *
1012
- * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
1013
- * `bun:sqlite` instances all work when they expose this surface.
1014
- */
1015
- interface SqliteClient {
1016
- exec(sql: string): void;
1017
- prepare(sql: string): SqliteStatement;
1018
- transaction<T>(fn: () => T): T;
1019
- }
1020
-
1021
948
  /** Lab-test catalog mirrored from the Junction sandbox (`GET /v3/lab_test`). */
1022
949
  type CatalogMarker = {
1023
950
  id: number;
@@ -1070,6 +997,207 @@ type LabTestRecord = {
1070
997
  worst_case_tat_days: number | null;
1071
998
  };
1072
999
 
1000
+ /**
1001
+ * A-la-carte markers and order-set pricing.
1002
+ *
1003
+ * - `GET /v3/lab_tests/markers`: the markers a team can order one by one.
1004
+ * https://docs.junction.com/api-reference/lab-testing/biomarkers
1005
+ * - `POST /v3/lab_test/estimate_order_set_pricing`: what an order set costs.
1006
+ * https://docs.junction.com/api-reference/lab-testing/estimate-order-set-pricing
1007
+ *
1008
+ * Both follow the published contract. Nothing here is checked against the live sandbox (prices
1009
+ * are contract-owned), so the emulator prices from the catalog it holds: a lab test's `price`
1010
+ * and a marker's `price`, or the `pricing` of a configured {@link MarkerCatalogEntry}.
1011
+ */
1012
+
1013
+ /** Pricing the way Junction states it: minor units, or why it is not stated. */
1014
+ type MarkerPricing = {
1015
+ base_amount_minor: number;
1016
+ modifiers?: readonly Record<string, unknown>[] | null;
1017
+ } | {
1018
+ unspecified: "refer_to_contract" | "price_unavailable";
1019
+ };
1020
+ /**
1021
+ * A marker the mock offers on top of (or in place of) the ones embedded in catalog lab tests:
1022
+ * `createRuntime({ markerCatalog: [...] })`. Fields not given take the vendor's defaults.
1023
+ */
1024
+ type MarkerCatalogEntry = {
1025
+ id: number;
1026
+ name: string;
1027
+ slug?: string;
1028
+ description?: string | null;
1029
+ lab_id?: number | null;
1030
+ provider_id?: string | null;
1031
+ type?: "biomarker" | "panel" | null;
1032
+ unit?: string | null;
1033
+ /** Dollars, as the vendor prints them (`"12.50"`); a number is formatted to two decimals. */
1034
+ price?: string | number | null;
1035
+ /** Stated pricing, when `price` cannot say it (modifiers, `refer_to_contract`). */
1036
+ pricing?: MarkerPricing;
1037
+ /** Ask-on-order questions: `{ questions: [...] }`. */
1038
+ aoe?: unknown;
1039
+ /** Default `false`, as at the vendor. */
1040
+ a_la_carte_enabled?: boolean;
1041
+ common_tat_days?: number | null;
1042
+ worst_case_tat_days?: number | null;
1043
+ is_orderable?: boolean | null;
1044
+ /** What the marker reports. Default: none. */
1045
+ expected_results?: readonly ExpectedResult[];
1046
+ components?: readonly MarkerCatalogEntry[] | null;
1047
+ };
1048
+
1049
+ /**
1050
+ * ZIP overlays: aliases and per-ZIP overrides on top of whatever geo mode answers.
1051
+ *
1052
+ * `createRuntime({ zipOverlays: { aliases: { "07105": "85004" }, overrides: { "07105": {
1053
+ * phlebotomy_served: true, no_pscs: true } } } })`. An alias makes one ZIP answer as another
1054
+ * (coverage, recordings and the synthetic model all use the target); an override then edits the
1055
+ * answer for a ZIP: `phlebotomy.is_served` on `area/info`, and an empty PSC list.
1056
+ */
1057
+
1058
+ type ZipOverride = {
1059
+ /** `phlebotomy.is_served` on `GET /v3/order/area/info` (and its `providers`). */
1060
+ phlebotomy_served?: boolean;
1061
+ /** No patient service centers: `psc/info` lists none and `area/info` counts none. */
1062
+ no_pscs?: boolean;
1063
+ };
1064
+ type ZipOverlays = {
1065
+ /** ZIP → the ZIP it answers as. */
1066
+ aliases?: Record<string, string>;
1067
+ /** ZIP → what to change in its answers. Looked up by the requested ZIP, then by its alias. */
1068
+ overrides?: Record<string, ZipOverride>;
1069
+ };
1070
+
1071
+ type LabAccountStatus = "active" | "pending" | "suspended" | "ready_to_launch";
1072
+ type LabAccountDelegatedFlow = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated";
1073
+ type LabAccountRecord = {
1074
+ id: string;
1075
+ lab: string;
1076
+ org_id: string | null;
1077
+ status: LabAccountStatus;
1078
+ delegated_flow: LabAccountDelegatedFlow;
1079
+ provider_account_id: string;
1080
+ account_name: string | null;
1081
+ default_clinical_notes: string | null;
1082
+ business_units: string[] | null;
1083
+ allowed_billing: Record<string, readonly string[]>;
1084
+ team_id_allowlist: readonly string[];
1085
+ };
1086
+ /** The 50 `USState` values from the docs, alphabetical by state name. */
1087
+ declare const US_STATES: readonly string[];
1088
+ /** `billing_type` values the vendored create-order body accepts. */
1089
+ declare const BILLING_TYPES: readonly ["client_bill", "commercial_insurance", "patient_bill_passthrough", "patient_bill", "upfront_payment"];
1090
+ type BillingType = (typeof BILLING_TYPES)[number];
1091
+ /** A team the mock is not, for fixtures that model another team's account. */
1092
+ declare const OTHER_TEAM_ID: string;
1093
+ declare const TEAM_LAB_ACCOUNTS: readonly LabAccountRecord[];
1094
+ /**
1095
+ * Whether `teamId` may use an account. An empty `team_id_allowlist` counts as linked:
1096
+ * a real team's listing returns such accounts (Junction's own Quest, Labcorp and
1097
+ * BioReference accounts carry `[]`), and the sandbox places an order that names one by id
1098
+ * (corpus/lab-account-probes.json), so the mock treats them as the team's.
1099
+ */
1100
+ declare const isLinkedToTeam: (entry: LabAccountRecord, teamId: string) => boolean;
1101
+ type LabAccountOmissionPolicy = "platform" | "reject";
1102
+ /**
1103
+ * A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
1104
+ * every field but `id` and `lab` optional, plus a `states` shorthand for the common
1105
+ * case of an account that client-bills in a fixed set of states.
1106
+ */
1107
+ type LabAccountInput = {
1108
+ id: string;
1109
+ /** Lab slug, e.g. `"quest"`, `"labcorp"`, `"bioreference"`. */
1110
+ lab: string;
1111
+ status?: LabAccountStatus;
1112
+ delegated_flow?: LabAccountDelegatedFlow;
1113
+ account_name?: string | null;
1114
+ provider_account_id?: string;
1115
+ org_id?: string | null;
1116
+ business_units?: string[] | null;
1117
+ default_clinical_notes?: string | null;
1118
+ /** Billing type → states it is allowed in. Takes precedence over `states`. */
1119
+ allowed_billing?: Record<string, readonly string[]>;
1120
+ /** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
1121
+ states?: readonly string[];
1122
+ /** Teams the account is linked to. Default: the configured team, so it is selectable. */
1123
+ team_id_allowlist?: readonly string[];
1124
+ };
1125
+ /**
1126
+ * Normalize a consumer's configuration into the record the ordering rules read.
1127
+ * `teamId` is the default allowlist, so an account is selectable unless told otherwise.
1128
+ */
1129
+ declare const labAccountFromInput: (input: LabAccountInput, teamId?: string) => LabAccountRecord;
1130
+
1131
+ type LabAccountProfile = "native" | "expected-contract" | "sandbox-observed" | "observed";
1132
+ /** Which vendor environment an `observed` configuration reproduces. */
1133
+ type LabAccountOracle = "sandbox" | "production";
1134
+ /**
1135
+ * How an order that omits `lab_account_id` and resolves to a Junction-owned (`org_id: null`)
1136
+ * account treats that account's listed `allowed_billing`: `listed` (default) enforces it,
1137
+ * `unchecked` skips the billing/state check (#467). Explicit account selection is unaffected.
1138
+ */
1139
+ type OmittedAccountBilling = "listed" | "unchecked";
1140
+ type LabAccountSandboxPolicy = {
1141
+ /** Explicit billing refusals observed for this particular fixture/account. */
1142
+ rejectBilling?: Partial<Record<BillingType, string>>;
1143
+ /** Explicit billing/state exceptions observed for this particular fixture/account. */
1144
+ allowBilling?: Partial<Record<BillingType, readonly string[]>>;
1145
+ };
1146
+ type LabAccountBehavior = {
1147
+ profile: LabAccountProfile;
1148
+ /**
1149
+ * The oracle the observations reproduce. `sandbox-observed` is the alias of `observed`
1150
+ * with `oracle: "sandbox"`; `native` and `expected-contract` have none.
1151
+ */
1152
+ oracle?: LabAccountOracle;
1153
+ accounts: Record<string, LabAccountSandboxPolicy>;
1154
+ /** Lab slug → omitted-account billing policy; unlisted labs are `listed`. */
1155
+ omittedAccountBilling?: Record<string, OmittedAccountBilling>;
1156
+ };
1157
+
1158
+ /**
1159
+ * Opt-in sandbox quirks: behaviors the vendor sandbox shows that a well-behaved client must
1160
+ * tolerate. Every quirk is off by default, so no existing suite changes.
1161
+ */
1162
+ type JunctionQuirks = {
1163
+ /**
1164
+ * #474: a `POST /v3/order/{id}/cancel` that lands in the same wall-clock second as the
1165
+ * order's creation records its `cancelled.<method>.cancelled` event, but the order's
1166
+ * `status`, `last_event` and `updated_at` do not move; a second cancel is a no-op. Reported
1167
+ * from the sandbox (production unverified).
1168
+ */
1169
+ sameSecondCancelStatus?: boolean;
1170
+ };
1171
+
1172
+ /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
1173
+ type SqliteValue = null | number | bigint | string | Uint8Array | boolean;
1174
+ /** Mutation counters returned by {@link SqliteStatement.run}. */
1175
+ type SqliteRunResult = {
1176
+ changes: number;
1177
+ lastInsertRowid: number | bigint;
1178
+ };
1179
+ /**
1180
+ * Prepared statement bound to a {@link SqliteClient}.
1181
+ *
1182
+ * Pass bind values as rest arguments on each call (no sticky `bind()`).
1183
+ */
1184
+ interface SqliteStatement {
1185
+ run(...params: SqliteValue[]): SqliteRunResult;
1186
+ all<T = Record<string, unknown>>(...params: SqliteValue[]): T[];
1187
+ get<T = Record<string, unknown>>(...params: SqliteValue[]): T | undefined;
1188
+ }
1189
+ /**
1190
+ * Sync SQLite client port owned by Mockingbird.
1191
+ *
1192
+ * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
1193
+ * `bun:sqlite` instances all work when they expose this surface.
1194
+ */
1195
+ interface SqliteClient {
1196
+ exec(sql: string): void;
1197
+ prepare(sql: string): SqliteStatement;
1198
+ transaction<T>(fn: () => T): T;
1199
+ }
1200
+
1073
1201
  /**
1074
1202
  * The test backdoor: users and orders put straight into a namespace, with ids a suite
1075
1203
  * chooses — the Junction `user_id`s a database fixture already carries, or an order
@@ -1295,8 +1423,10 @@ type ResultFixture = {
1295
1423
  * - `synthetic`: invent plausible coverage. Right for property tests that walk random ZIPs.
1296
1424
  * - `corpus`: refuse with a documented Mockingbird error. Right for a mock standing in for
1297
1425
  * the vendor, where invented coverage would silently disagree with production.
1426
+ * - `corpus+synthetic`: replay the recording for the ZIPs it covers (a read it cannot answer
1427
+ * still refuses), and invent coverage for every other ZIP.
1298
1428
  */
1299
- type GeoMode = "synthetic" | "corpus";
1429
+ type GeoMode = "synthetic" | "corpus" | "corpus+synthetic";
1300
1430
  type WebhookPublisher = (event: JunctionWebhookEvent) => void;
1301
1431
  type JunctionWebhookOptions = {
1302
1432
  seed?: number;
@@ -1314,6 +1444,29 @@ interface FetchAPI {
1314
1444
  fetch(request: Request): Promise<Response>;
1315
1445
  }
1316
1446
 
1447
+ type CatalogOverlay = {
1448
+ /** The lab test to clone, by id or slug. It must be in the catalog the namespace boots with. */
1449
+ from: string;
1450
+ /** Id of the new lab test (a UUID, as `create_order` expects). */
1451
+ id: string;
1452
+ name?: string;
1453
+ slug?: string;
1454
+ /**
1455
+ * Move the clone to a lab: the slug of a lab the catalog lists, or a lab record
1456
+ * (`{ id, slug, name, ... }`), which is added to `GET /v3/lab_tests/labs` when new.
1457
+ * The clone's markers and expected results take that lab's id.
1458
+ */
1459
+ lab?: string | Record<string, unknown>;
1460
+ /** Drop the ask-on-order questions from every marker of the clone. */
1461
+ stripAoe?: boolean;
1462
+ /** Set `auto_generated` on the clone. Default: as the source. */
1463
+ autoGenerated?: boolean;
1464
+ method?: string;
1465
+ /** Dollars. */
1466
+ price?: number;
1467
+ status?: string;
1468
+ };
1469
+
1317
1470
  /**
1318
1471
  * Named lab accounts a suite can add in one call, modelled on a real team's recorded
1319
1472
  * listing (a BioReference-linked team, recorded 2026-09-21 from the Junction sandbox).
@@ -1323,6 +1476,13 @@ interface FetchAPI {
1323
1476
  * NY/NJ client-bill shape a consumer asked for, kept because suites depend on it, and
1324
1477
  * listed in `SYNTHETIC_LAB_ACCOUNT_PRESETS`.
1325
1478
  *
1479
+ * The 2026-09-21 `bioreference_platform` preset lists `client_bill` in 47 states, but the
1480
+ * current house BioReference account lists only `patient_bill_passthrough` in NJ and NY, so
1481
+ * treat it as illustrative (#475). The `bioreference_current_platform`,
1482
+ * `quest_sandbox_platform` and `sonora_quest_production_platform` presets follow the listings
1483
+ * an agent reported from `GET /v3/lab_test/lab_account` on 2026-10-18 (a consumer-audit
1484
+ * report, not a repository probe); they are additions, so no existing preset changes.
1485
+ *
1326
1486
  * `*_platform` presets are Junction's own accounts (`org_id: null`, allowlist `[]`); every
1327
1487
  * other active preset is customer-owned (it belongs to an Org and is linked to the team).
1328
1488
  */
@@ -1773,10 +1933,10 @@ type OpenAPIDocument = {
1773
1933
  };
1774
1934
 
1775
1935
  declare const document: OpenAPIDocument;
1776
- type OperationId = "get_teams_users_v2_user_get" | "create_user_v2_user_post" | "get_user_v2_user__user_id__get" | "delete_user_v2_user__user_id__delete" | "patch_user_v2_user__user_id__patch" | "get_user_by_client_user_id_v2_user_resolve__client_user_id__get" | "patch_user_info_v2_user__user_id__info_patch" | "get_latest_user_info_user_v2_user__user_id__info_latest_get" | "get_paginated_lab_tests_for_team_v3_lab_test_get" | "get_team_lab_accounts_v3_lab_test_lab_account_get" | "get_lab_tests_for_team_v3_lab_tests_get" | "get_lab_test_for_team_v3_lab_tests__lab_test_id__get" | "get_labs_v3_lab_tests_labs_get" | "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get" | "list_order_set_markers_v3_lab_tests_list_order_set_markers_post" | "create_order_v3_order_post" | "get_area_info_v3_order_area_info_get" | "get_psc_info_v3_order_psc_info_get" | "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post" | "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get" | "get_psc_appointment_availability_v3_order_psc_appointment_availability_post" | "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get" | "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get" | "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post" | "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch" | "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch" | "get_psc_appointment_v3_order__order_id__psc_appointment_get" | "book_psc_appointment_v3_order__order_id__psc_appointment_book_post" | "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch" | "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch" | "get_order_v3_order__order_id__get" | "cancel_order_v3_order__order_id__cancel_post" | "simulate_order_v3_order__order_id__test_post" | "get_result_raw_v3_order__order_id__result_get" | "get_result_metadata_v3_order__order_id__result_metadata_get" | "get_result_pdf_v3_order__order_id__result_pdf_get" | "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get" | "get_orders_v3_orders_get" | "get_order_transaction_v3_order_transaction__transaction_id__get" | "get_order_transaction_result_v3_order_transaction__transaction_id__result_get";
1777
- type SupportedOperationId = "get_teams_users_v2_user_get" | "create_user_v2_user_post" | "get_user_v2_user__user_id__get" | "delete_user_v2_user__user_id__delete" | "patch_user_v2_user__user_id__patch" | "get_user_by_client_user_id_v2_user_resolve__client_user_id__get" | "patch_user_info_v2_user__user_id__info_patch" | "get_latest_user_info_user_v2_user__user_id__info_latest_get" | "get_paginated_lab_tests_for_team_v3_lab_test_get" | "get_team_lab_accounts_v3_lab_test_lab_account_get" | "get_lab_tests_for_team_v3_lab_tests_get" | "get_lab_test_for_team_v3_lab_tests__lab_test_id__get" | "get_labs_v3_lab_tests_labs_get" | "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get" | "list_order_set_markers_v3_lab_tests_list_order_set_markers_post" | "create_order_v3_order_post" | "get_area_info_v3_order_area_info_get" | "get_psc_info_v3_order_psc_info_get" | "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post" | "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get" | "get_psc_appointment_availability_v3_order_psc_appointment_availability_post" | "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get" | "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get" | "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post" | "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch" | "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch" | "get_psc_appointment_v3_order__order_id__psc_appointment_get" | "book_psc_appointment_v3_order__order_id__psc_appointment_book_post" | "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch" | "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch" | "get_order_v3_order__order_id__get" | "cancel_order_v3_order__order_id__cancel_post" | "simulate_order_v3_order__order_id__test_post" | "get_result_raw_v3_order__order_id__result_get" | "get_result_metadata_v3_order__order_id__result_metadata_get" | "get_result_pdf_v3_order__order_id__result_pdf_get" | "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get" | "get_orders_v3_orders_get" | "get_order_transaction_v3_order_transaction__transaction_id__get" | "get_order_transaction_result_v3_order_transaction__transaction_id__result_get";
1778
- declare const operationIds: readonly ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
1779
- declare const supportedOperationIds: readonly ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
1936
+ type OperationId = "get_teams_users_v2_user_get" | "create_user_v2_user_post" | "get_user_v2_user__user_id__get" | "delete_user_v2_user__user_id__delete" | "patch_user_v2_user__user_id__patch" | "get_user_by_client_user_id_v2_user_resolve__client_user_id__get" | "patch_user_info_v2_user__user_id__info_patch" | "get_latest_user_info_user_v2_user__user_id__info_latest_get" | "get_paginated_lab_tests_for_team_v3_lab_test_get" | "estimate_order_set_pricing_v3_lab_test_estimate_order_set_pricing_post" | "get_team_lab_accounts_v3_lab_test_lab_account_get" | "get_lab_tests_for_team_v3_lab_tests_get" | "get_lab_test_for_team_v3_lab_tests__lab_test_id__get" | "get_labs_v3_lab_tests_labs_get" | "get_markers_v3_lab_tests_markers_get" | "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get" | "list_order_set_markers_v3_lab_tests_list_order_set_markers_post" | "create_order_v3_order_post" | "get_area_info_v3_order_area_info_get" | "get_psc_info_v3_order_psc_info_get" | "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post" | "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get" | "get_psc_appointment_availability_v3_order_psc_appointment_availability_post" | "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get" | "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get" | "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post" | "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch" | "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch" | "get_psc_appointment_v3_order__order_id__psc_appointment_get" | "book_psc_appointment_v3_order__order_id__psc_appointment_book_post" | "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch" | "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch" | "get_order_v3_order__order_id__get" | "cancel_order_v3_order__order_id__cancel_post" | "simulate_order_v3_order__order_id__test_post" | "get_result_raw_v3_order__order_id__result_get" | "get_result_metadata_v3_order__order_id__result_metadata_get" | "get_result_pdf_v3_order__order_id__result_pdf_get" | "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get" | "get_orders_v3_orders_get" | "get_order_transaction_v3_order_transaction__transaction_id__get" | "get_order_transaction_result_v3_order_transaction__transaction_id__result_get";
1937
+ type SupportedOperationId = "get_teams_users_v2_user_get" | "create_user_v2_user_post" | "get_user_v2_user__user_id__get" | "delete_user_v2_user__user_id__delete" | "patch_user_v2_user__user_id__patch" | "get_user_by_client_user_id_v2_user_resolve__client_user_id__get" | "patch_user_info_v2_user__user_id__info_patch" | "get_latest_user_info_user_v2_user__user_id__info_latest_get" | "get_paginated_lab_tests_for_team_v3_lab_test_get" | "estimate_order_set_pricing_v3_lab_test_estimate_order_set_pricing_post" | "get_team_lab_accounts_v3_lab_test_lab_account_get" | "get_lab_tests_for_team_v3_lab_tests_get" | "get_lab_test_for_team_v3_lab_tests__lab_test_id__get" | "get_labs_v3_lab_tests_labs_get" | "get_markers_v3_lab_tests_markers_get" | "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get" | "list_order_set_markers_v3_lab_tests_list_order_set_markers_post" | "create_order_v3_order_post" | "get_area_info_v3_order_area_info_get" | "get_psc_info_v3_order_psc_info_get" | "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post" | "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get" | "get_psc_appointment_availability_v3_order_psc_appointment_availability_post" | "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get" | "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get" | "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post" | "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch" | "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch" | "get_psc_appointment_v3_order__order_id__psc_appointment_get" | "book_psc_appointment_v3_order__order_id__psc_appointment_book_post" | "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch" | "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch" | "get_order_v3_order__order_id__get" | "cancel_order_v3_order__order_id__cancel_post" | "simulate_order_v3_order__order_id__test_post" | "get_result_raw_v3_order__order_id__result_get" | "get_result_metadata_v3_order__order_id__result_metadata_get" | "get_result_pdf_v3_order__order_id__result_pdf_get" | "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get" | "get_orders_v3_orders_get" | "get_order_transaction_v3_order_transaction__transaction_id__get" | "get_order_transaction_result_v3_order_transaction__transaction_id__result_get";
1938
+ declare const operationIds: readonly ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "estimate_order_set_pricing_v3_lab_test_estimate_order_set_pricing_post", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_v3_lab_tests_markers_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
1939
+ declare const supportedOperationIds: readonly ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "estimate_order_set_pricing_v3_lab_test_estimate_order_set_pricing_post", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_v3_lab_tests_markers_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
1780
1940
 
1781
1941
  /** The `detail` of each order-scoped operation's 404 for an order that does not exist. */
1782
1942
  declare const ORDER_NOT_FOUND: Readonly<Record<string, string>>;
@@ -1863,11 +2023,21 @@ type JunctionRuntimeOptions = {
1863
2023
  corpus?: SealedCorpus;
1864
2024
  /** Default: `corpus` when a corpus is loaded, otherwise `synthetic`. */
1865
2025
  geo?: GeoMode;
2026
+ /** ZIP aliases and per-ZIP overrides on serviceability answers; see {@link JunctionAPIOptions.zipOverlays}. */
2027
+ zipOverlays?: ZipOverlays;
2028
+ /** Lab tests derived from catalog ones at boot; see {@link JunctionAPIOptions.catalogOverlays}. */
2029
+ catalogOverlays?: readonly CatalogOverlay[];
2030
+ /** Markers `GET /v3/lab_tests/markers` offers; see {@link JunctionAPIOptions.markerCatalog}. */
2031
+ markerCatalog?: readonly MarkerCatalogEntry[];
2032
+ /** Name the markers behind add-on result lines; see {@link JunctionAPIOptions.addOnSourceMarkers}. */
2033
+ addOnSourceMarkers?: boolean;
1866
2034
  /** The team's lab accounts, or `{ presets, accounts }`; see {@link JunctionAPIOptions.labAccounts}. */
1867
2035
  labAccounts?: LabAccountLayout;
1868
2036
  /** Per-lab multiple-account omission policy; default platform. */
1869
2037
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
1870
2038
  labAccountBehavior?: Partial<LabAccountBehavior>;
2039
+ /** Opt-in sandbox quirks, every one off by default (#474). */
2040
+ quirks?: JunctionQuirks;
1871
2041
  /** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
1872
2042
  teamId?: string;
1873
2043
  /** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
@@ -2005,6 +2175,27 @@ type JunctionAPIOptions = APIOptions & {
2005
2175
  * when a corpus is given (refuse, loudly), otherwise `synthetic` (invent coverage).
2006
2176
  */
2007
2177
  geo?: GeoMode;
2178
+ /**
2179
+ * ZIP aliases and per-ZIP overrides on serviceability answers, whatever the geo mode: an
2180
+ * alias makes a ZIP answer as another, an override sets `phlebotomy.is_served` or empties the
2181
+ * PSC list. Per namespace via `PUT /__admin/geo`.
2182
+ */
2183
+ zipOverlays?: ZipOverlays;
2184
+ /**
2185
+ * Lab tests derived from catalog ones (new id, name, slug, lab; AOE questions stripped;
2186
+ * `auto_generated`), added to every namespace after the catalog loads and again on `reset()`.
2187
+ */
2188
+ catalogOverlays?: readonly CatalogOverlay[];
2189
+ /**
2190
+ * Markers `GET /v3/lab_tests/markers` offers on top of those in catalog lab tests, with their
2191
+ * pricing, AOE questions and expected results.
2192
+ */
2193
+ markerCatalog?: readonly MarkerCatalogEntry[];
2194
+ /**
2195
+ * Name the markers behind each biomarker result line of an add-on order
2196
+ * (`source_markers[].marker_id`). Default off: the line then carries `source_markers: null`.
2197
+ */
2198
+ addOnSourceMarkers?: boolean;
2008
2199
  /**
2009
2200
  * The team's lab accounts, replacing the built-in fixtures (and any from the corpus):
2010
2201
  * a list of accounts, or `{ presets: [...], accounts: [...] }`. `create_order` routes,
@@ -2030,6 +2221,8 @@ type JunctionAPIOptions = APIOptions & {
2030
2221
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
2031
2222
  /** Named policy; native preserves legacy behavior. Sandbox exceptions are account-owned. */
2032
2223
  labAccountBehavior?: Partial<LabAccountBehavior>;
2224
+ /** Opt-in sandbox quirks (#474), every one off by default; see {@link JunctionQuirks}. */
2225
+ quirks?: JunctionQuirks;
2033
2226
  /** Users and orders to load into every namespace, re-applied on every `reset()`. */
2034
2227
  fixtures?: JunctionFixtures;
2035
2228
  };
@@ -2058,6 +2251,7 @@ declare class JunctionAPI implements FetchAPI {
2058
2251
  private readonly rateWindow;
2059
2252
  private corpus;
2060
2253
  private labAccountConfig;
2254
+ private readonly catalogOverlays;
2061
2255
  constructor(options?: JunctionAPIOptions);
2062
2256
  fetch(request: Request): Promise<Response>;
2063
2257
  reset(): Promise<void>;
@@ -2099,6 +2293,9 @@ declare class JunctionAPI implements FetchAPI {
2099
2293
  /** Effective account policy for this namespace; kept across reset. */
2100
2294
  get labAccountBehavior(): LabAccountBehavior;
2101
2295
  set labAccountBehavior(input: LabAccountBehavior);
2296
+ /** Opt-in sandbox quirks for this namespace; kept across reset. */
2297
+ get quirks(): JunctionQuirks;
2298
+ set quirks(input: JunctionQuirks);
2102
2299
  get defaultBillingTypes(): Record<string, BillingType>;
2103
2300
  /** Replace the per-lab default billing types (`{}` restores `client_bill` everywhere). */
2104
2301
  set defaultBillingTypes(input: Partial<Record<string, BillingType>>);
@@ -2116,6 +2313,9 @@ declare class JunctionAPI implements FetchAPI {
2116
2313
  orders: OrderRecord[];
2117
2314
  };
2118
2315
  corpusInfo(): CorpusInfo | undefined;
2316
+ /** ZIP aliases and overrides for this namespace; kept across reset. */
2317
+ get zipOverlays(): ZipOverlays;
2318
+ set zipOverlays(overlays: ZipOverlays);
2119
2319
  get geoMode(): GeoMode;
2120
2320
  set geoMode(mode: GeoMode);
2121
2321
  order(id: string): OrderRecord | undefined;
@@ -2126,6 +2326,16 @@ declare class JunctionAPI implements FetchAPI {
2126
2326
  * only place the mock reports it.
2127
2327
  */
2128
2328
  orderLabAccount(id: string): string | null | undefined;
2329
+ /**
2330
+ * Where `POST /v3/order` carried a lab account id: `labAccountId` at the root (which
2331
+ * selects the account) and `nestedLabAccountId` inside `order_set` (which Junction
2332
+ * ignores). `null` for an order that was not placed through the API (a fixture), and
2333
+ * `undefined` for an unknown order.
2334
+ */
2335
+ orderLabAccountRequest(id: string): {
2336
+ labAccountId: string | null;
2337
+ nestedLabAccountId: string | null;
2338
+ } | null | undefined;
2129
2339
  /** Frozen provider number used by the synthetic requisition; null means unknown. */
2130
2340
  requisitionFixture(id: string): {
2131
2341
  provider_account_id: string | null;
@@ -2157,4 +2367,4 @@ declare class LabAccountConflict extends Error {
2157
2367
  }
2158
2368
 
2159
2369
  export { AVAILABILITY_ADDRESS, AVAILABILITY_START_DATE, BILLING_TYPES, COVERAGE_ZIPS, DEFAULT_JUNCTION_BASE_URL, DEFAULT_LIMITS, DELEGATED_ACCOUNT_STATES, FAULT_PRESETS, FixtureError, IDENTITY_MODES, JUNCTION_NAMESPACE, JunctionAPI, KNOWN_HEADER, LAB_ACCOUNT_PRESETS, LAB_ACCOUNT_PRESET_ALIASES, LabAccountConflict, MISS_HEADER, MOCK_TEAM_ID, ORDER_NOT_FOUND, ORDER_STATUSES_BY_METHOD, OTHER_TEAM_ID, PHLEBOTOMY_AVAILABILITY_ZIPS, PLATFORM_ACCOUNT_STATES, PSC_AVAILABILITY_ZIPS, PSC_LAB_IDS, RESULT_FIXTURES, SANDBOX_KEY_PREFIXES, SEALED_CORPUS_VERSION, SUPPORTED_SEALED_CORPUS_VERSIONS, SYNTHETIC_LAB_ACCOUNT_PRESETS, TEAM_LAB_ACCOUNTS, TRANSITION_ALIASES, UNKNOWN_ZIP_ERROR_TYPE, UNKNOWN_ZIP_STATUS, US_STATES, corpusLabel, createRuntime, createWebhookDispatcher, diffCorpus, document, fingerprintCorpus, isLinkedToTeam, isSandboxKey, labAccountFromInput, observationCacheKey, operationIds, parseSealedCorpus, prefetchCoverageObservations, presetAccountId, pullCorpus, reshapeCoverageGeoCommand, resolveTransition, sandboxUserQuotaBody, signSvix, supportedOperationIds, verifyAgainstReal, verifySvix };
2160
- export type { BillingType, CorpusDiff, CorpusInfo, Divergence, FetchAPI, GeoMode, GetCacheEntry, IdentityMode, InsertOptions, JunctionAPIOptions, JunctionAdminOptions, JunctionFixtures, JunctionLimits, JunctionLimitsInput, JunctionRuntime, JunctionRuntimeOptions, JunctionWebhookEvent, JunctionWebhookOptions, LabAccountBehavior, LabAccountDelegatedFlow, LabAccountInput, LabAccountLayout, LabAccountOmissionPolicy, LabAccountProfile, LabAccountRecord, LabAccountSandboxPolicy, LabAccountStatus, OperationId, OrderFixture, OrderRecord, PullCorpusOptions, ResultFixture, SealedCorpus, SeedObservations, SeedReport, SeedSource, SetDiff, SqliteClient, StoredLabAccount, SupportedOperationId, UserFixture, UserRecord, VerifyOptions, VerifyReport, WebhookAttempt, WebhookDelivery, WebhookDispatcher, WebhookEndpoint, WebhookPublisher };
2370
+ export type { BillingType, CatalogOverlay, CorpusDiff, CorpusInfo, Divergence, FetchAPI, GeoMode, GetCacheEntry, IdentityMode, InsertOptions, JunctionAPIOptions, JunctionAdminOptions, JunctionFixtures, JunctionLimits, JunctionLimitsInput, JunctionQuirks, JunctionRuntime, JunctionRuntimeOptions, JunctionWebhookEvent, JunctionWebhookOptions, LabAccountBehavior, LabAccountDelegatedFlow, LabAccountInput, LabAccountLayout, LabAccountOmissionPolicy, LabAccountOracle, LabAccountProfile, LabAccountRecord, LabAccountSandboxPolicy, LabAccountStatus, MarkerCatalogEntry, MarkerPricing, OmittedAccountBilling, OperationId, OrderFixture, OrderRecord, PullCorpusOptions, ResultFixture, SealedCorpus, SeedObservations, SeedReport, SeedSource, SetDiff, SqliteClient, StoredLabAccount, SupportedOperationId, UserFixture, UserRecord, VerifyOptions, VerifyReport, WebhookAttempt, WebhookDelivery, WebhookDispatcher, WebhookEndpoint, WebhookPublisher, ZipOverlays, ZipOverride };
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ import {
53
53
  supportedOperationIds,
54
54
  verifyAgainstReal,
55
55
  verifySvix
56
- } from "./chunk-ZRF3DDJ4.js";
56
+ } from "./chunk-27N4VA23.js";
57
57
  import {
58
58
  SEALED_CORPUS_VERSION,
59
59
  SUPPORTED_SEALED_CORPUS_VERSIONS,