@crvouga/mockingbird-service-junction 3.4.0 → 3.6.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 +16 -0
- package/DISCOVERY.md +2 -0
- package/README.md +73 -19
- package/SUPPORT.md +2 -2
- package/dist/{chunk-ZTMQ5RIL.js → chunk-WMJJYHRV.js} +232 -42
- package/dist/chunk-WMJJYHRV.js.map +7 -0
- package/dist/{chunk-SN6QTJKH.js → chunk-ZRF3DDJ4.js} +375 -184
- package/dist/{chunk-SN6QTJKH.js.map → chunk-ZRF3DDJ4.js.map} +4 -4
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +91 -61
- package/dist/index.js +1 -1
- package/dist/server.d.ts +60 -30
- package/dist/server.js +2 -2
- package/openapi.yaml +22 -3
- package/package.json +4 -2
- package/dist/chunk-ZTMQ5RIL.js.map +0 -7
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
runCli,
|
|
5
5
|
serveCommand,
|
|
6
6
|
serveTarget
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WMJJYHRV.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-
|
|
15
|
+
} from "./chunk-ZRF3DDJ4.js";
|
|
16
16
|
import {
|
|
17
17
|
defaultCorpus
|
|
18
18
|
} from "./chunk-2FZJPMTR.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
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
|
+
|
|
3
75
|
type MountedAPI = FetchAPI$1 & {
|
|
4
76
|
readonly prefix: string;
|
|
5
77
|
GET: FetchHandler;
|
|
@@ -1242,65 +1314,6 @@ interface FetchAPI {
|
|
|
1242
1314
|
fetch(request: Request): Promise<Response>;
|
|
1243
1315
|
}
|
|
1244
1316
|
|
|
1245
|
-
type LabAccountStatus = "active" | "pending" | "suspended" | "ready_to_launch";
|
|
1246
|
-
type LabAccountDelegatedFlow = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated";
|
|
1247
|
-
type LabAccountRecord = {
|
|
1248
|
-
id: string;
|
|
1249
|
-
lab: string;
|
|
1250
|
-
org_id: string | null;
|
|
1251
|
-
status: LabAccountStatus;
|
|
1252
|
-
delegated_flow: LabAccountDelegatedFlow;
|
|
1253
|
-
provider_account_id: string;
|
|
1254
|
-
account_name: string | null;
|
|
1255
|
-
default_clinical_notes: string | null;
|
|
1256
|
-
business_units: string[] | null;
|
|
1257
|
-
allowed_billing: Record<string, readonly string[]>;
|
|
1258
|
-
team_id_allowlist: readonly string[];
|
|
1259
|
-
};
|
|
1260
|
-
/** The 50 `USState` values from the docs, alphabetical by state name. */
|
|
1261
|
-
declare const US_STATES: readonly string[];
|
|
1262
|
-
/** `billing_type` values the vendored create-order body accepts. */
|
|
1263
|
-
declare const BILLING_TYPES: readonly ["client_bill", "commercial_insurance", "patient_bill_passthrough", "patient_bill", "upfront_payment"];
|
|
1264
|
-
type BillingType = (typeof BILLING_TYPES)[number];
|
|
1265
|
-
/** A team the mock is not, for fixtures that model another team's account. */
|
|
1266
|
-
declare const OTHER_TEAM_ID: string;
|
|
1267
|
-
declare const TEAM_LAB_ACCOUNTS: readonly LabAccountRecord[];
|
|
1268
|
-
/**
|
|
1269
|
-
* Whether `teamId` may use an account. An empty `team_id_allowlist` counts as linked:
|
|
1270
|
-
* a real team's listing returns such accounts (Junction's own Quest, Labcorp and
|
|
1271
|
-
* BioReference accounts carry `[]`), and the sandbox places an order that names one by id
|
|
1272
|
-
* (corpus/lab-account-probes.json), so the mock treats them as the team's.
|
|
1273
|
-
*/
|
|
1274
|
-
declare const isLinkedToTeam: (entry: LabAccountRecord, teamId: string) => boolean;
|
|
1275
|
-
/**
|
|
1276
|
-
* A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
|
|
1277
|
-
* every field but `id` and `lab` optional, plus a `states` shorthand for the common
|
|
1278
|
-
* case of an account that client-bills in a fixed set of states.
|
|
1279
|
-
*/
|
|
1280
|
-
type LabAccountInput = {
|
|
1281
|
-
id: string;
|
|
1282
|
-
/** Lab slug, e.g. `"quest"`, `"labcorp"`, `"bioreference"`. */
|
|
1283
|
-
lab: string;
|
|
1284
|
-
status?: LabAccountStatus;
|
|
1285
|
-
delegated_flow?: LabAccountDelegatedFlow;
|
|
1286
|
-
account_name?: string | null;
|
|
1287
|
-
provider_account_id?: string;
|
|
1288
|
-
org_id?: string | null;
|
|
1289
|
-
business_units?: string[] | null;
|
|
1290
|
-
default_clinical_notes?: string | null;
|
|
1291
|
-
/** Billing type → states it is allowed in. Takes precedence over `states`. */
|
|
1292
|
-
allowed_billing?: Record<string, readonly string[]>;
|
|
1293
|
-
/** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
|
|
1294
|
-
states?: readonly string[];
|
|
1295
|
-
/** Teams the account is linked to. Default: the configured team, so it is selectable. */
|
|
1296
|
-
team_id_allowlist?: readonly string[];
|
|
1297
|
-
};
|
|
1298
|
-
/**
|
|
1299
|
-
* Normalize a consumer's configuration into the record the ordering rules read.
|
|
1300
|
-
* `teamId` is the default allowlist, so an account is selectable unless told otherwise.
|
|
1301
|
-
*/
|
|
1302
|
-
declare const labAccountFromInput: (input: LabAccountInput, teamId?: string) => LabAccountRecord;
|
|
1303
|
-
|
|
1304
1317
|
/**
|
|
1305
1318
|
* Named lab accounts a suite can add in one call, modelled on a real team's recorded
|
|
1306
1319
|
* listing (a BioReference-linked team, recorded 2026-09-21 from the Junction sandbox).
|
|
@@ -1852,6 +1865,9 @@ type JunctionRuntimeOptions = {
|
|
|
1852
1865
|
geo?: GeoMode;
|
|
1853
1866
|
/** The team's lab accounts, or `{ presets, accounts }`; see {@link JunctionAPIOptions.labAccounts}. */
|
|
1854
1867
|
labAccounts?: LabAccountLayout;
|
|
1868
|
+
/** Per-lab multiple-account omission policy; default platform. */
|
|
1869
|
+
labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
|
|
1870
|
+
labAccountBehavior?: Partial<LabAccountBehavior>;
|
|
1855
1871
|
/** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
|
|
1856
1872
|
teamId?: string;
|
|
1857
1873
|
/** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
|
|
@@ -2010,6 +2026,10 @@ type JunctionAPIOptions = APIOptions & {
|
|
|
2010
2026
|
* default, `client_bill`.
|
|
2011
2027
|
*/
|
|
2012
2028
|
defaultBillingTypes?: Partial<Record<string, BillingType>>;
|
|
2029
|
+
/** Per-lab multiple-account routing policy; defaults to platform fallback. */
|
|
2030
|
+
labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
|
|
2031
|
+
/** Named policy; native preserves legacy behavior. Sandbox exceptions are account-owned. */
|
|
2032
|
+
labAccountBehavior?: Partial<LabAccountBehavior>;
|
|
2013
2033
|
/** Users and orders to load into every namespace, re-applied on every `reset()`. */
|
|
2014
2034
|
fixtures?: JunctionFixtures;
|
|
2015
2035
|
};
|
|
@@ -2073,7 +2093,12 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
2073
2093
|
get limits(): JunctionLimits;
|
|
2074
2094
|
/** Change some limits (`null` lifts a numeric one); kept across `reset()`. */
|
|
2075
2095
|
configureLimits(input: JunctionLimitsInput): JunctionLimits;
|
|
2076
|
-
/**
|
|
2096
|
+
/** Multiple-account routing policy per lab, kept across reset. */
|
|
2097
|
+
get labAccountOmissionPolicies(): Record<string, LabAccountOmissionPolicy>;
|
|
2098
|
+
set labAccountOmissionPolicies(input: Record<string, LabAccountOmissionPolicy>);
|
|
2099
|
+
/** Effective account policy for this namespace; kept across reset. */
|
|
2100
|
+
get labAccountBehavior(): LabAccountBehavior;
|
|
2101
|
+
set labAccountBehavior(input: LabAccountBehavior);
|
|
2077
2102
|
get defaultBillingTypes(): Record<string, BillingType>;
|
|
2078
2103
|
/** Replace the per-lab default billing types (`{}` restores `client_bill` everywhere). */
|
|
2079
2104
|
set defaultBillingTypes(input: Partial<Record<string, BillingType>>);
|
|
@@ -2101,6 +2126,11 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
2101
2126
|
* only place the mock reports it.
|
|
2102
2127
|
*/
|
|
2103
2128
|
orderLabAccount(id: string): string | null | undefined;
|
|
2129
|
+
/** Frozen provider number used by the synthetic requisition; null means unknown. */
|
|
2130
|
+
requisitionFixture(id: string): {
|
|
2131
|
+
provider_account_id: string | null;
|
|
2132
|
+
} | undefined;
|
|
2133
|
+
installRequisitionFixture(id: string, providerAccountId: string | null): boolean;
|
|
2104
2134
|
/**
|
|
2105
2135
|
* Put an order straight into a status (a full `<status>.<method>.<event>` value) and
|
|
2106
2136
|
* publish the webhook a real transition would. `flags` takes the same keys as
|
|
@@ -2127,4 +2157,4 @@ declare class LabAccountConflict extends Error {
|
|
|
2127
2157
|
}
|
|
2128
2158
|
|
|
2129
2159
|
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 };
|
|
2130
|
-
export type { BillingType, CorpusDiff, CorpusInfo, Divergence, FetchAPI, GeoMode, GetCacheEntry, IdentityMode, InsertOptions, JunctionAPIOptions, JunctionAdminOptions, JunctionFixtures, JunctionLimits, JunctionLimitsInput, JunctionRuntime, JunctionRuntimeOptions, JunctionWebhookEvent, JunctionWebhookOptions, LabAccountDelegatedFlow, LabAccountInput, LabAccountLayout, LabAccountRecord, LabAccountStatus, OperationId, OrderFixture, OrderRecord, PullCorpusOptions, ResultFixture, SealedCorpus, SeedObservations, SeedReport, SeedSource, SetDiff, SqliteClient, StoredLabAccount, SupportedOperationId, UserFixture, UserRecord, VerifyOptions, VerifyReport, WebhookAttempt, WebhookDelivery, WebhookDispatcher, WebhookEndpoint, WebhookPublisher };
|
|
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 };
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -1897,6 +1897,48 @@ interface SqliteClient {
|
|
|
1897
1897
|
transaction<T>(fn: () => T): T;
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
|
+
type LabAccountStatus = "active" | "pending" | "suspended" | "ready_to_launch";
|
|
1901
|
+
type LabAccountDelegatedFlow = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated";
|
|
1902
|
+
/** `billing_type` values the vendored create-order body accepts. */
|
|
1903
|
+
declare const BILLING_TYPES: readonly ["client_bill", "commercial_insurance", "patient_bill_passthrough", "patient_bill", "upfront_payment"];
|
|
1904
|
+
type BillingType = (typeof BILLING_TYPES)[number];
|
|
1905
|
+
type LabAccountOmissionPolicy = "platform" | "reject";
|
|
1906
|
+
/**
|
|
1907
|
+
* A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
|
|
1908
|
+
* every field but `id` and `lab` optional, plus a `states` shorthand for the common
|
|
1909
|
+
* case of an account that client-bills in a fixed set of states.
|
|
1910
|
+
*/
|
|
1911
|
+
type LabAccountInput = {
|
|
1912
|
+
id: string;
|
|
1913
|
+
/** Lab slug, e.g. `"quest"`, `"labcorp"`, `"bioreference"`. */
|
|
1914
|
+
lab: string;
|
|
1915
|
+
status?: LabAccountStatus;
|
|
1916
|
+
delegated_flow?: LabAccountDelegatedFlow;
|
|
1917
|
+
account_name?: string | null;
|
|
1918
|
+
provider_account_id?: string;
|
|
1919
|
+
org_id?: string | null;
|
|
1920
|
+
business_units?: string[] | null;
|
|
1921
|
+
default_clinical_notes?: string | null;
|
|
1922
|
+
/** Billing type → states it is allowed in. Takes precedence over `states`. */
|
|
1923
|
+
allowed_billing?: Record<string, readonly string[]>;
|
|
1924
|
+
/** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
|
|
1925
|
+
states?: readonly string[];
|
|
1926
|
+
/** Teams the account is linked to. Default: the configured team, so it is selectable. */
|
|
1927
|
+
team_id_allowlist?: readonly string[];
|
|
1928
|
+
};
|
|
1929
|
+
|
|
1930
|
+
type LabAccountProfile = "native" | "expected-contract" | "sandbox-observed";
|
|
1931
|
+
type LabAccountSandboxPolicy = {
|
|
1932
|
+
/** Explicit billing refusals observed for this particular fixture/account. */
|
|
1933
|
+
rejectBilling?: Partial<Record<BillingType, string>>;
|
|
1934
|
+
/** Explicit billing/state exceptions observed for this particular fixture/account. */
|
|
1935
|
+
allowBilling?: Partial<Record<BillingType, readonly string[]>>;
|
|
1936
|
+
};
|
|
1937
|
+
type LabAccountBehavior = {
|
|
1938
|
+
profile: LabAccountProfile;
|
|
1939
|
+
accounts: Record<string, LabAccountSandboxPolicy>;
|
|
1940
|
+
};
|
|
1941
|
+
|
|
1900
1942
|
/** Lab-test catalog mirrored from the Junction sandbox (`GET /v3/lab_test`). */
|
|
1901
1943
|
type CatalogMarker = {
|
|
1902
1944
|
id: number;
|
|
@@ -2172,35 +2214,6 @@ interface FetchAPI {
|
|
|
2172
2214
|
fetch(request: Request): Promise<Response>;
|
|
2173
2215
|
}
|
|
2174
2216
|
|
|
2175
|
-
type LabAccountStatus = "active" | "pending" | "suspended" | "ready_to_launch";
|
|
2176
|
-
type LabAccountDelegatedFlow = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated";
|
|
2177
|
-
/** `billing_type` values the vendored create-order body accepts. */
|
|
2178
|
-
declare const BILLING_TYPES: readonly ["client_bill", "commercial_insurance", "patient_bill_passthrough", "patient_bill", "upfront_payment"];
|
|
2179
|
-
type BillingType = (typeof BILLING_TYPES)[number];
|
|
2180
|
-
/**
|
|
2181
|
-
* A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
|
|
2182
|
-
* every field but `id` and `lab` optional, plus a `states` shorthand for the common
|
|
2183
|
-
* case of an account that client-bills in a fixed set of states.
|
|
2184
|
-
*/
|
|
2185
|
-
type LabAccountInput = {
|
|
2186
|
-
id: string;
|
|
2187
|
-
/** Lab slug, e.g. `"quest"`, `"labcorp"`, `"bioreference"`. */
|
|
2188
|
-
lab: string;
|
|
2189
|
-
status?: LabAccountStatus;
|
|
2190
|
-
delegated_flow?: LabAccountDelegatedFlow;
|
|
2191
|
-
account_name?: string | null;
|
|
2192
|
-
provider_account_id?: string;
|
|
2193
|
-
org_id?: string | null;
|
|
2194
|
-
business_units?: string[] | null;
|
|
2195
|
-
default_clinical_notes?: string | null;
|
|
2196
|
-
/** Billing type → states it is allowed in. Takes precedence over `states`. */
|
|
2197
|
-
allowed_billing?: Record<string, readonly string[]>;
|
|
2198
|
-
/** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
|
|
2199
|
-
states?: readonly string[];
|
|
2200
|
-
/** Teams the account is linked to. Default: the configured team, so it is selectable. */
|
|
2201
|
-
team_id_allowlist?: readonly string[];
|
|
2202
|
-
};
|
|
2203
|
-
|
|
2204
2217
|
/**
|
|
2205
2218
|
* Named lab accounts a suite can add in one call, modelled on a real team's recorded
|
|
2206
2219
|
* listing (a BioReference-linked team, recorded 2026-09-21 from the Junction sandbox).
|
|
@@ -2372,6 +2385,10 @@ type JunctionAPIOptions = APIOptions & {
|
|
|
2372
2385
|
* default, `client_bill`.
|
|
2373
2386
|
*/
|
|
2374
2387
|
defaultBillingTypes?: Partial<Record<string, BillingType>>;
|
|
2388
|
+
/** Per-lab multiple-account routing policy; defaults to platform fallback. */
|
|
2389
|
+
labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
|
|
2390
|
+
/** Named policy; native preserves legacy behavior. Sandbox exceptions are account-owned. */
|
|
2391
|
+
labAccountBehavior?: Partial<LabAccountBehavior>;
|
|
2375
2392
|
/** Users and orders to load into every namespace, re-applied on every `reset()`. */
|
|
2376
2393
|
fixtures?: JunctionFixtures;
|
|
2377
2394
|
};
|
|
@@ -2433,7 +2450,12 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
2433
2450
|
get limits(): JunctionLimits;
|
|
2434
2451
|
/** Change some limits (`null` lifts a numeric one); kept across `reset()`. */
|
|
2435
2452
|
configureLimits(input: JunctionLimitsInput): JunctionLimits;
|
|
2436
|
-
/**
|
|
2453
|
+
/** Multiple-account routing policy per lab, kept across reset. */
|
|
2454
|
+
get labAccountOmissionPolicies(): Record<string, LabAccountOmissionPolicy>;
|
|
2455
|
+
set labAccountOmissionPolicies(input: Record<string, LabAccountOmissionPolicy>);
|
|
2456
|
+
/** Effective account policy for this namespace; kept across reset. */
|
|
2457
|
+
get labAccountBehavior(): LabAccountBehavior;
|
|
2458
|
+
set labAccountBehavior(input: LabAccountBehavior);
|
|
2437
2459
|
get defaultBillingTypes(): Record<string, BillingType>;
|
|
2438
2460
|
/** Replace the per-lab default billing types (`{}` restores `client_bill` everywhere). */
|
|
2439
2461
|
set defaultBillingTypes(input: Partial<Record<string, BillingType>>);
|
|
@@ -2461,6 +2483,11 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
2461
2483
|
* only place the mock reports it.
|
|
2462
2484
|
*/
|
|
2463
2485
|
orderLabAccount(id: string): string | null | undefined;
|
|
2486
|
+
/** Frozen provider number used by the synthetic requisition; null means unknown. */
|
|
2487
|
+
requisitionFixture(id: string): {
|
|
2488
|
+
provider_account_id: string | null;
|
|
2489
|
+
} | undefined;
|
|
2490
|
+
installRequisitionFixture(id: string, providerAccountId: string | null): boolean;
|
|
2464
2491
|
/**
|
|
2465
2492
|
* Put an order straight into a status (a full `<status>.<method>.<event>` value) and
|
|
2466
2493
|
* publish the webhook a real transition would. `flags` takes the same keys as
|
|
@@ -2491,6 +2518,9 @@ type JunctionRuntimeOptions = {
|
|
|
2491
2518
|
geo?: GeoMode;
|
|
2492
2519
|
/** The team's lab accounts, or `{ presets, accounts }`; see {@link JunctionAPIOptions.labAccounts}. */
|
|
2493
2520
|
labAccounts?: LabAccountLayout;
|
|
2521
|
+
/** Per-lab multiple-account omission policy; default platform. */
|
|
2522
|
+
labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
|
|
2523
|
+
labAccountBehavior?: Partial<LabAccountBehavior>;
|
|
2494
2524
|
/** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
|
|
2495
2525
|
teamId?: string;
|
|
2496
2526
|
/** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
|
package/dist/server.js
CHANGED
package/openapi.yaml
CHANGED
|
@@ -645,6 +645,7 @@ paths:
|
|
|
645
645
|
parity:
|
|
646
646
|
enabled: true
|
|
647
647
|
safe: true
|
|
648
|
+
reason: Native profile parity only; explicit account profiles add fixture-owned billing policies and custom-marker orders, without production parity certification.
|
|
648
649
|
requestBody:
|
|
649
650
|
required: true
|
|
650
651
|
content:
|
|
@@ -1641,8 +1642,8 @@ paths:
|
|
|
1641
1642
|
enabled: false
|
|
1642
1643
|
safe: true
|
|
1643
1644
|
reason: >-
|
|
1644
|
-
PDF
|
|
1645
|
-
|
|
1645
|
+
Synthetic PDF includes persisted selected provider account number or unknown; admin
|
|
1646
|
+
evidence override supported; live comparison remains shape-only
|
|
1646
1647
|
responses:
|
|
1647
1648
|
"200":
|
|
1648
1649
|
description: Successful Response
|
|
@@ -3204,6 +3205,7 @@ components:
|
|
|
3204
3205
|
$ref: "#/components/schemas/OrderSummary"
|
|
3205
3206
|
ClientFacingOrder:
|
|
3206
3207
|
type: object
|
|
3208
|
+
description: Account profiles expose lab_account_id from the persisted selected association; native preserves the legacy response shape.
|
|
3207
3209
|
required:
|
|
3208
3210
|
- user_id
|
|
3209
3211
|
- id
|
|
@@ -3223,6 +3225,9 @@ components:
|
|
|
3223
3225
|
- shipping_details
|
|
3224
3226
|
- has_abn
|
|
3225
3227
|
properties:
|
|
3228
|
+
lab_account_id:
|
|
3229
|
+
type: [string, "null"]
|
|
3230
|
+
format: uuid
|
|
3226
3231
|
user_id:
|
|
3227
3232
|
type: string
|
|
3228
3233
|
format: uuid
|
|
@@ -3364,8 +3369,22 @@ components:
|
|
|
3364
3369
|
- type: "null"
|
|
3365
3370
|
OrderSetRequest:
|
|
3366
3371
|
type: object
|
|
3367
|
-
|
|
3372
|
+
anyOf:
|
|
3373
|
+
- required: [lab_test_ids]
|
|
3374
|
+
- required: [add_on]
|
|
3368
3375
|
properties:
|
|
3376
|
+
add_on:
|
|
3377
|
+
type: object
|
|
3378
|
+
description: Custom marker orders are supported by the explicit expected-contract and sandbox-observed profiles.
|
|
3379
|
+
properties:
|
|
3380
|
+
marker_ids:
|
|
3381
|
+
type: array
|
|
3382
|
+
items:
|
|
3383
|
+
type: integer
|
|
3384
|
+
provider_ids:
|
|
3385
|
+
type: array
|
|
3386
|
+
items:
|
|
3387
|
+
type: string
|
|
3369
3388
|
lab_test_ids:
|
|
3370
3389
|
type: array
|
|
3371
3390
|
minItems: 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-junction",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Stateful emulator of the Junction (Vital) user API driven by its OpenAPI contract and verified by differential property tests against the Junction sandbox.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -86,7 +86,9 @@
|
|
|
86
86
|
"GET /__admin/requests",
|
|
87
87
|
"GET /__admin/metrics",
|
|
88
88
|
"GET /__admin/faults/presets",
|
|
89
|
-
"GET /__admin/ui"
|
|
89
|
+
"GET /__admin/ui",
|
|
90
|
+
"GET/PUT /__admin/lab-account-omission-policies",
|
|
91
|
+
"GET/PUT /__admin/requisitions/:id"
|
|
90
92
|
],
|
|
91
93
|
"reporting": "https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md"
|
|
92
94
|
}
|