@crvouga/mockingbird-service-junction 3.5.0 → 3.6.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/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  runCli,
5
5
  serveCommand,
6
6
  serveTarget
7
- } from "./chunk-Y477MTXC.js";
7
+ } from "./chunk-HJJCEIVH.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-KMCP67GK.js";
15
+ } from "./chunk-VHVGQ3WX.js";
16
16
  import {
17
17
  defaultCorpus
18
18
  } from "./chunk-2FZJPMTR.js";
package/dist/index.d.ts CHANGED
@@ -60,6 +60,18 @@ type LabAccountInput = {
60
60
  */
61
61
  declare const labAccountFromInput: (input: LabAccountInput, teamId?: string) => LabAccountRecord;
62
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
+
63
75
  type MountedAPI = FetchAPI$1 & {
64
76
  readonly prefix: string;
65
77
  GET: FetchHandler;
@@ -1855,6 +1867,7 @@ type JunctionRuntimeOptions = {
1855
1867
  labAccounts?: LabAccountLayout;
1856
1868
  /** Per-lab multiple-account omission policy; default platform. */
1857
1869
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
1870
+ labAccountBehavior?: Partial<LabAccountBehavior>;
1858
1871
  /** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
1859
1872
  teamId?: string;
1860
1873
  /** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
@@ -2015,6 +2028,8 @@ type JunctionAPIOptions = APIOptions & {
2015
2028
  defaultBillingTypes?: Partial<Record<string, BillingType>>;
2016
2029
  /** Per-lab multiple-account routing policy; defaults to platform fallback. */
2017
2030
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
2031
+ /** Named policy; native preserves legacy behavior. Sandbox exceptions are account-owned. */
2032
+ labAccountBehavior?: Partial<LabAccountBehavior>;
2018
2033
  /** Users and orders to load into every namespace, re-applied on every `reset()`. */
2019
2034
  fixtures?: JunctionFixtures;
2020
2035
  };
@@ -2081,7 +2096,9 @@ declare class JunctionAPI implements FetchAPI {
2081
2096
  /** Multiple-account routing policy per lab, kept across reset. */
2082
2097
  get labAccountOmissionPolicies(): Record<string, LabAccountOmissionPolicy>;
2083
2098
  set labAccountOmissionPolicies(input: Record<string, LabAccountOmissionPolicy>);
2084
- /** Lab slug → the billing type an order gets when omitted. Kept across reset. */
2099
+ /** Effective account policy for this namespace; kept across reset. */
2100
+ get labAccountBehavior(): LabAccountBehavior;
2101
+ set labAccountBehavior(input: LabAccountBehavior);
2085
2102
  get defaultBillingTypes(): Record<string, BillingType>;
2086
2103
  /** Replace the per-lab default billing types (`{}` restores `client_bill` everywhere). */
2087
2104
  set defaultBillingTypes(input: Partial<Record<string, BillingType>>);
@@ -2140,4 +2157,4 @@ declare class LabAccountConflict extends Error {
2140
2157
  }
2141
2158
 
2142
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 };
2143
- export type { BillingType, CorpusDiff, CorpusInfo, Divergence, FetchAPI, GeoMode, GetCacheEntry, IdentityMode, InsertOptions, JunctionAPIOptions, JunctionAdminOptions, JunctionFixtures, JunctionLimits, JunctionLimitsInput, JunctionRuntime, JunctionRuntimeOptions, JunctionWebhookEvent, JunctionWebhookOptions, LabAccountDelegatedFlow, LabAccountInput, LabAccountLayout, LabAccountOmissionPolicy, 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
@@ -53,7 +53,7 @@ import {
53
53
  supportedOperationIds,
54
54
  verifyAgainstReal,
55
55
  verifySvix
56
- } from "./chunk-KMCP67GK.js";
56
+ } from "./chunk-VHVGQ3WX.js";
57
57
  import {
58
58
  SEALED_CORPUS_VERSION,
59
59
  SUPPORTED_SEALED_CORPUS_VERSIONS,
package/dist/server.d.ts CHANGED
@@ -1927,6 +1927,18 @@ type LabAccountInput = {
1927
1927
  team_id_allowlist?: readonly string[];
1928
1928
  };
1929
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
+
1930
1942
  /** Lab-test catalog mirrored from the Junction sandbox (`GET /v3/lab_test`). */
1931
1943
  type CatalogMarker = {
1932
1944
  id: number;
@@ -2375,6 +2387,8 @@ type JunctionAPIOptions = APIOptions & {
2375
2387
  defaultBillingTypes?: Partial<Record<string, BillingType>>;
2376
2388
  /** Per-lab multiple-account routing policy; defaults to platform fallback. */
2377
2389
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
2390
+ /** Named policy; native preserves legacy behavior. Sandbox exceptions are account-owned. */
2391
+ labAccountBehavior?: Partial<LabAccountBehavior>;
2378
2392
  /** Users and orders to load into every namespace, re-applied on every `reset()`. */
2379
2393
  fixtures?: JunctionFixtures;
2380
2394
  };
@@ -2439,7 +2453,9 @@ declare class JunctionAPI implements FetchAPI {
2439
2453
  /** Multiple-account routing policy per lab, kept across reset. */
2440
2454
  get labAccountOmissionPolicies(): Record<string, LabAccountOmissionPolicy>;
2441
2455
  set labAccountOmissionPolicies(input: Record<string, LabAccountOmissionPolicy>);
2442
- /** Lab slug → the billing type an order gets when omitted. Kept across reset. */
2456
+ /** Effective account policy for this namespace; kept across reset. */
2457
+ get labAccountBehavior(): LabAccountBehavior;
2458
+ set labAccountBehavior(input: LabAccountBehavior);
2443
2459
  get defaultBillingTypes(): Record<string, BillingType>;
2444
2460
  /** Replace the per-lab default billing types (`{}` restores `client_bill` everywhere). */
2445
2461
  set defaultBillingTypes(input: Partial<Record<string, BillingType>>);
@@ -2504,6 +2520,7 @@ type JunctionRuntimeOptions = {
2504
2520
  labAccounts?: LabAccountLayout;
2505
2521
  /** Per-lab multiple-account omission policy; default platform. */
2506
2522
  labAccountOmissionPolicies?: Record<string, LabAccountOmissionPolicy>;
2523
+ labAccountBehavior?: Partial<LabAccountBehavior>;
2507
2524
  /** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
2508
2525
  teamId?: string;
2509
2526
  /** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
package/dist/server.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  createServer,
4
4
  loadCorpus,
5
5
  serveTarget
6
- } from "./chunk-Y477MTXC.js";
7
- import "./chunk-KMCP67GK.js";
6
+ } from "./chunk-HJJCEIVH.js";
7
+ import "./chunk-VHVGQ3WX.js";
8
8
  import "./chunk-2FZJPMTR.js";
9
9
  import "./chunk-ISDNA2TU.js";
10
10
  export {
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:
@@ -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
- required: [lab_test_ids]
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.5.0",
3
+ "version": "3.6.1",
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",