@crvouga/mockingbird-service-junction 0.2.0 → 0.3.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 +7 -5
- package/README.md +222 -21
- package/dist/{chunk-MD4KYEIM.js → chunk-C2UGIPPM.js} +2 -2
- package/dist/{chunk-4C6VYRJN.js → chunk-ISDNA2TU.js} +8 -3
- package/dist/chunk-ISDNA2TU.js.map +7 -0
- package/dist/{chunk-KKNULV7X.js → chunk-KLBGX23P.js} +76 -8
- package/dist/chunk-KLBGX23P.js.map +7 -0
- package/dist/{chunk-MA3HSUVD.js → chunk-NFWUEPW4.js} +1856 -778
- package/dist/chunk-NFWUEPW4.js.map +7 -0
- package/dist/cli.js +4 -4
- package/dist/corpus.d.ts +10 -2
- package/dist/corpus.js +2 -2
- package/dist/index.d.ts +322 -49
- package/dist/index.js +34 -2
- package/dist/server.d.ts +242 -10
- package/dist/server.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-4C6VYRJN.js.map +0 -7
- package/dist/chunk-KKNULV7X.js.map +0 -7
- package/dist/chunk-MA3HSUVD.js.map +0 -7
- /package/dist/{chunk-MD4KYEIM.js.map → chunk-C2UGIPPM.js.map} +0 -0
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-KLBGX23P.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_JUNCTION_BASE_URL,
|
|
10
10
|
createRuntime,
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
isSandboxKey,
|
|
13
13
|
pullCorpus,
|
|
14
14
|
verifyAgainstReal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NFWUEPW4.js";
|
|
16
16
|
import {
|
|
17
17
|
defaultCorpus
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-C2UGIPPM.js";
|
|
19
19
|
import {
|
|
20
20
|
parseSealedCorpus
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ISDNA2TU.js";
|
|
22
22
|
|
|
23
23
|
// src/cli.ts
|
|
24
24
|
import { readFile, writeFile } from "node:fs/promises";
|
package/dist/corpus.d.ts
CHANGED
|
@@ -59,8 +59,11 @@ type GetCacheEntry = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Version of the sealed-corpus on-disk format. Bumped whenever the shape changes so a
|
|
61
61
|
* stale recording is rejected instead of half-applied.
|
|
62
|
+
*
|
|
63
|
+
* - 1: observations, catalog and lab accounts.
|
|
64
|
+
* - 2: adds `teamId`, the recording team, so lab-account allowlists load verbatim.
|
|
62
65
|
*/
|
|
63
|
-
declare const SEALED_CORPUS_VERSION =
|
|
66
|
+
declare const SEALED_CORPUS_VERSION = 2;
|
|
64
67
|
/**
|
|
65
68
|
* Exact sandbox recording of the provider-owned reads a drop-in consumer depends on:
|
|
66
69
|
* parameter-stable GET observations (area/PSC inventory), the lab catalog, team labs, and
|
|
@@ -68,9 +71,14 @@ declare const SEALED_CORPUS_VERSION = 1;
|
|
|
68
71
|
* `booking_key`s can never match a live cache key, so it stays with the generator.
|
|
69
72
|
*/
|
|
70
73
|
type SealedCorpus = {
|
|
71
|
-
version: typeof SEALED_CORPUS_VERSION;
|
|
74
|
+
version: 1 | typeof SEALED_CORPUS_VERSION;
|
|
72
75
|
recordedAt: string;
|
|
73
76
|
source: string;
|
|
77
|
+
/**
|
|
78
|
+
* The recording team's id (version 2+). When present it is the mock's default team,
|
|
79
|
+
* and each lab account's `team_id_allowlist` is kept exactly as recorded.
|
|
80
|
+
*/
|
|
81
|
+
teamId?: string;
|
|
74
82
|
/** SHA-256 of the recording's content, written by `corpus pull`. Identifies it in logs. */
|
|
75
83
|
fingerprint?: string;
|
|
76
84
|
observations: Record<string, GetCacheEntry>;
|
package/dist/corpus.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,10 @@ type RequestLog = {
|
|
|
147
147
|
unmatched: boolean;
|
|
148
148
|
/** Set when a fault rule produced the response. */
|
|
149
149
|
faultId?: string;
|
|
150
|
+
/** Resource ids the handler touched (`userId`, `orderId`, …), when the service reports them. */
|
|
151
|
+
ids?: Record<string, string>;
|
|
152
|
+
/** Set when the service created a resource the request referred to but that did not exist. */
|
|
153
|
+
adopted?: boolean;
|
|
150
154
|
};
|
|
151
155
|
type MetricsReport = {
|
|
152
156
|
requests: number;
|
|
@@ -172,6 +176,28 @@ type Metrics = {
|
|
|
172
176
|
reset(): void;
|
|
173
177
|
};
|
|
174
178
|
|
|
179
|
+
/** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
|
|
180
|
+
type JournalEntry = RequestLog & {
|
|
181
|
+
at: string;
|
|
182
|
+
};
|
|
183
|
+
type JournalQuery = {
|
|
184
|
+
/** Only this namespace. Omit for every namespace, oldest first across all of them. */
|
|
185
|
+
namespace?: string;
|
|
186
|
+
operationId?: string;
|
|
187
|
+
status?: number;
|
|
188
|
+
/** Only entries at or after this instant (epoch ms). */
|
|
189
|
+
since?: number;
|
|
190
|
+
/** At most this many, the most recent kept. */
|
|
191
|
+
limit?: number;
|
|
192
|
+
};
|
|
193
|
+
type Journal = {
|
|
194
|
+
readonly size: number;
|
|
195
|
+
record(entry: JournalEntry): void;
|
|
196
|
+
list(query?: JournalQuery): JournalEntry[];
|
|
197
|
+
/** Forget one namespace's entries, or every namespace's. */
|
|
198
|
+
clear(namespace?: string): void;
|
|
199
|
+
};
|
|
200
|
+
|
|
175
201
|
/**
|
|
176
202
|
* A point-in-time copy of everything a service namespace holds.
|
|
177
203
|
*
|
|
@@ -214,6 +240,7 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
|
|
|
214
240
|
readonly clock: Clock;
|
|
215
241
|
readonly faults: FaultRegistry;
|
|
216
242
|
readonly metrics: Metrics;
|
|
243
|
+
readonly journal: Journal;
|
|
217
244
|
readonly rng: Rng;
|
|
218
245
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
|
219
246
|
instance(namespace?: string): T;
|
|
@@ -319,6 +346,95 @@ type LabTestRecord = {
|
|
|
319
346
|
worst_case_tat_days: number | null;
|
|
320
347
|
};
|
|
321
348
|
|
|
349
|
+
/**
|
|
350
|
+
* The test backdoor: users and orders put straight into a namespace, with ids a suite
|
|
351
|
+
* chooses — the Junction `user_id`s a database fixture already carries, or an order
|
|
352
|
+
* already in some status — plus the lenient identity mode that adopts unknown users.
|
|
353
|
+
*
|
|
354
|
+
* Everything inserted here goes through the records `create_user` and `create_order`
|
|
355
|
+
* build, so no read path can tell a fixture from an API-created resource.
|
|
356
|
+
*/
|
|
357
|
+
|
|
358
|
+
/** How requests referring to a user the namespace does not hold are answered. */
|
|
359
|
+
type IdentityMode = "strict" | "adopt-users";
|
|
360
|
+
declare const IDENTITY_MODES: readonly IdentityMode[];
|
|
361
|
+
type UserFixture = {
|
|
362
|
+
/** Default: a fresh id, as `create_user` would mint. */
|
|
363
|
+
user_id?: string;
|
|
364
|
+
client_user_id: string;
|
|
365
|
+
/** ISO-8601. Default: the mock clock's now. */
|
|
366
|
+
created_on?: string;
|
|
367
|
+
/** An IANA zone, or the full `{ id, source_slug, updated_at }` object. */
|
|
368
|
+
fallback_time_zone?: string | UserRecord["fallback_time_zone"];
|
|
369
|
+
/** `YYYY-MM-DD`, or the full `{ value, source_slug, updated_at }` object. */
|
|
370
|
+
fallback_birth_date?: string | UserRecord["fallback_birth_date"];
|
|
371
|
+
ingestion_start?: string | null;
|
|
372
|
+
ingestion_end?: string | null;
|
|
373
|
+
};
|
|
374
|
+
type OrderFixture = {
|
|
375
|
+
/** Default: a fresh id, as `create_order` would mint. */
|
|
376
|
+
order_id?: string;
|
|
377
|
+
user_id: string;
|
|
378
|
+
lab_test_id: string;
|
|
379
|
+
lab_account_id?: string;
|
|
380
|
+
/** A transition target (`completed`, `at_lab`, or a full status). Default: just ordered. */
|
|
381
|
+
status?: string;
|
|
382
|
+
/** Default: the lab test's own method. */
|
|
383
|
+
collection_method?: string;
|
|
384
|
+
patient_details?: Record<string, unknown>;
|
|
385
|
+
patient_address?: Record<string, unknown>;
|
|
386
|
+
billing_type?: string;
|
|
387
|
+
icd_codes?: string[] | null;
|
|
388
|
+
passthrough?: string | null;
|
|
389
|
+
clinical_notes?: string | null;
|
|
390
|
+
/** ISO-8601. Default: the mock clock's now. */
|
|
391
|
+
created_at?: string;
|
|
392
|
+
/** Results served for the order, as `PUT /__admin/results/{id}` takes them. */
|
|
393
|
+
result_fixture?: Omit<ResultFixture, "name"> & {
|
|
394
|
+
name?: string;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
type JunctionFixtures = {
|
|
398
|
+
users?: readonly UserFixture[];
|
|
399
|
+
orders?: readonly OrderFixture[];
|
|
400
|
+
};
|
|
401
|
+
type InsertOptions = {
|
|
402
|
+
/** Publish the webhooks the equivalent API calls would. Default `false`. */
|
|
403
|
+
emitWebhooks?: boolean;
|
|
404
|
+
};
|
|
405
|
+
/** A backdoor failure: `status` 400 for a bad fixture, 404 for a missing reference, 409 for a clash. */
|
|
406
|
+
declare class FixtureError extends Error {
|
|
407
|
+
readonly status: 400 | 404 | 409;
|
|
408
|
+
constructor(status: 400 | 404 | 409, message: string);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** Key prefixes of sandbox team keys. `corpus pull` and `verify` refuse any other key. */
|
|
412
|
+
declare const SANDBOX_KEY_PREFIXES: readonly ["sk_us_", "sk_eu_"];
|
|
413
|
+
declare const isSandboxKey: (key: string) => boolean;
|
|
414
|
+
type JunctionLimits = {
|
|
415
|
+
/**
|
|
416
|
+
* Live users a team may hold; creating one more answers the sandbox's
|
|
417
|
+
* "maximum of 50 Sandbox users" 400. Deleted users free their slot. `null`: unlimited.
|
|
418
|
+
*/
|
|
419
|
+
maxUsers: number | null;
|
|
420
|
+
/** Refuse `POST /v3/order/{id}/test` unless the API key is a sandbox key (`sk_us_…`/`sk_eu_…`). */
|
|
421
|
+
simulateRequiresSandbox: boolean;
|
|
422
|
+
/** Vendor requests per second per namespace before a 429. `null`: unlimited. */
|
|
423
|
+
rateLimitPerSecond: number | null;
|
|
424
|
+
};
|
|
425
|
+
type JunctionLimitsInput = {
|
|
426
|
+
[K in keyof JunctionLimits]?: JunctionLimits[K] | undefined;
|
|
427
|
+
};
|
|
428
|
+
/** Every limit off: what a default instance enforces. */
|
|
429
|
+
declare const DEFAULT_LIMITS: Readonly<JunctionLimits>;
|
|
430
|
+
/** The 400 the sandbox answers once a team holds its 50th user, byte for byte. */
|
|
431
|
+
declare const sandboxUserQuotaBody: (max: number) => {
|
|
432
|
+
detail: {
|
|
433
|
+
error_type: string;
|
|
434
|
+
error_message: string;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
|
|
322
438
|
type GetCacheEntry = {
|
|
323
439
|
status: number;
|
|
324
440
|
headers: Record<string, string>;
|
|
@@ -340,6 +456,27 @@ type WebhookDeliveryAttempt = {
|
|
|
340
456
|
timeout_ms: number;
|
|
341
457
|
acknowledged: boolean;
|
|
342
458
|
};
|
|
459
|
+
type UserRecord = {
|
|
460
|
+
user_id: string;
|
|
461
|
+
team_id: string;
|
|
462
|
+
client_user_id: string;
|
|
463
|
+
created_on: string;
|
|
464
|
+
connected_sources: unknown[];
|
|
465
|
+
fallback_time_zone: {
|
|
466
|
+
id: string;
|
|
467
|
+
source_slug: string;
|
|
468
|
+
updated_at: string;
|
|
469
|
+
} | null;
|
|
470
|
+
fallback_birth_date: {
|
|
471
|
+
value: string;
|
|
472
|
+
source_slug: string;
|
|
473
|
+
updated_at: string;
|
|
474
|
+
} | null;
|
|
475
|
+
ingestion_start: string | null;
|
|
476
|
+
ingestion_end: string | null;
|
|
477
|
+
};
|
|
478
|
+
/** Fixed mock team id — volatile on the real side, stable in the mock. */
|
|
479
|
+
declare const MOCK_TEAM_ID = "11111111-1111-4111-8111-111111111111";
|
|
343
480
|
type OrderEventRecord = {
|
|
344
481
|
id: number;
|
|
345
482
|
created_at: string;
|
|
@@ -472,7 +609,16 @@ type LabAccountRecord = {
|
|
|
472
609
|
};
|
|
473
610
|
/** The 50 `USState` values from the docs, alphabetical by state name. */
|
|
474
611
|
declare const US_STATES: readonly string[];
|
|
612
|
+
/** A team the mock is not, for fixtures that model another team's account. */
|
|
613
|
+
declare const OTHER_TEAM_ID: string;
|
|
475
614
|
declare const TEAM_LAB_ACCOUNTS: readonly LabAccountRecord[];
|
|
615
|
+
/**
|
|
616
|
+
* Whether `teamId` may use an account. An empty `team_id_allowlist` counts as linked:
|
|
617
|
+
* a real team's listing returns such accounts (observed — Junction's own Quest, Labcorp
|
|
618
|
+
* and BioReference accounts carry `[]`), so the mock treats them as the team's. Whether
|
|
619
|
+
* ordering through one by explicit id behaves the same is unverified; SUPPORT.md tracks it.
|
|
620
|
+
*/
|
|
621
|
+
declare const isLinkedToTeam: (entry: LabAccountRecord, teamId: string) => boolean;
|
|
476
622
|
/**
|
|
477
623
|
* A lab account as a consumer configures it. Mirrors `ClientFacingLabAccount`, with
|
|
478
624
|
* every field but `id` and `lab` optional, plus a `states` shorthand for the common
|
|
@@ -493,17 +639,58 @@ type LabAccountInput = {
|
|
|
493
639
|
allowed_billing?: Record<string, readonly string[]>;
|
|
494
640
|
/** Shorthand for `allowed_billing: { client_bill: states }`. Default: every state. */
|
|
495
641
|
states?: readonly string[];
|
|
496
|
-
/** Teams the account is linked to. Default: the
|
|
642
|
+
/** Teams the account is linked to. Default: the configured team, so it is selectable. */
|
|
497
643
|
team_id_allowlist?: readonly string[];
|
|
498
644
|
};
|
|
499
|
-
/**
|
|
500
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Normalize a consumer's configuration into the record the ordering rules read.
|
|
647
|
+
* `teamId` is the default allowlist, so an account is selectable unless told otherwise.
|
|
648
|
+
*/
|
|
649
|
+
declare const labAccountFromInput: (input: LabAccountInput, teamId?: string) => LabAccountRecord;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Named lab accounts a suite can add in one call, modelled on a real team's recorded
|
|
653
|
+
* listing (a BioReference-linked team, recorded 2026-09-21 from the Junction sandbox).
|
|
654
|
+
*
|
|
655
|
+
* Where a preset copies a recorded account, its states and billing types are the
|
|
656
|
+
* recording's. `bioreference_ny_nj_delegated` is not a recorded account: it is the
|
|
657
|
+
* NY/NJ client-bill shape a consumer asked for, kept because suites depend on it.
|
|
658
|
+
*/
|
|
659
|
+
|
|
660
|
+
/** Junction's own Quest, Labcorp and BioReference accounts client-bill in these 47 states. */
|
|
661
|
+
declare const PLATFORM_ACCOUNT_STATES: readonly string[];
|
|
662
|
+
/** The recorded order-delegated BioReference account: every state but New York and New Jersey. */
|
|
663
|
+
declare const DELEGATED_ACCOUNT_STATES: readonly string[];
|
|
664
|
+
type Preset = Omit<LabAccountInput, "id">;
|
|
665
|
+
/**
|
|
666
|
+
* Every preset, without its id. A preset with no `team_id_allowlist` is linked to the
|
|
667
|
+
* configured team; the platform presets carry `[]`, as Junction's own accounts do.
|
|
668
|
+
*/
|
|
669
|
+
declare const LAB_ACCOUNT_PRESETS: Readonly<Record<string, Preset>>;
|
|
670
|
+
/** A preset's id when none is given: stable across runs and namespaces. */
|
|
671
|
+
declare const presetAccountId: (name: string) => string;
|
|
672
|
+
/**
|
|
673
|
+
* A lab-account layout as a file or option declares it: a bare list of accounts, or
|
|
674
|
+
* presets (by name, or `{ name, id }`) plus accounts, added in that order.
|
|
675
|
+
*/
|
|
676
|
+
type LabAccountLayout = readonly LabAccountInput[] | {
|
|
677
|
+
presets?: readonly (string | {
|
|
678
|
+
name: string;
|
|
679
|
+
id?: string;
|
|
680
|
+
})[];
|
|
681
|
+
accounts?: readonly LabAccountInput[];
|
|
682
|
+
};
|
|
501
683
|
|
|
502
684
|
/**
|
|
503
685
|
* Version of the sealed-corpus on-disk format. Bumped whenever the shape changes so a
|
|
504
686
|
* stale recording is rejected instead of half-applied.
|
|
687
|
+
*
|
|
688
|
+
* - 1: observations, catalog and lab accounts.
|
|
689
|
+
* - 2: adds `teamId`, the recording team, so lab-account allowlists load verbatim.
|
|
505
690
|
*/
|
|
506
|
-
declare const SEALED_CORPUS_VERSION =
|
|
691
|
+
declare const SEALED_CORPUS_VERSION = 2;
|
|
692
|
+
/** Versions `parseSealedCorpus` still loads. A version-1 corpus behaves as it did in 0.2.0. */
|
|
693
|
+
declare const SUPPORTED_SEALED_CORPUS_VERSIONS: readonly number[];
|
|
507
694
|
/**
|
|
508
695
|
* Exact sandbox recording of the provider-owned reads a drop-in consumer depends on:
|
|
509
696
|
* parameter-stable GET observations (area/PSC inventory), the lab catalog, team labs, and
|
|
@@ -511,9 +698,14 @@ declare const SEALED_CORPUS_VERSION = 1;
|
|
|
511
698
|
* `booking_key`s can never match a live cache key, so it stays with the generator.
|
|
512
699
|
*/
|
|
513
700
|
type SealedCorpus = {
|
|
514
|
-
version: typeof SEALED_CORPUS_VERSION;
|
|
701
|
+
version: 1 | typeof SEALED_CORPUS_VERSION;
|
|
515
702
|
recordedAt: string;
|
|
516
703
|
source: string;
|
|
704
|
+
/**
|
|
705
|
+
* The recording team's id (version 2+). When present it is the mock's default team,
|
|
706
|
+
* and each lab account's `team_id_allowlist` is kept exactly as recorded.
|
|
707
|
+
*/
|
|
708
|
+
teamId?: string;
|
|
517
709
|
/** SHA-256 of the recording's content, written by `corpus pull`. Identifies it in logs. */
|
|
518
710
|
fingerprint?: string;
|
|
519
711
|
observations: Record<string, GetCacheEntry>;
|
|
@@ -645,10 +837,38 @@ type JunctionAdminOptions = {
|
|
|
645
837
|
webhooks: WebhookDispatcher | undefined;
|
|
646
838
|
};
|
|
647
839
|
|
|
840
|
+
type SeedCacheEntry = {
|
|
841
|
+
status: number;
|
|
842
|
+
headers: Record<string, string>;
|
|
843
|
+
body: unknown;
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
type PrefetchTarget = {
|
|
847
|
+
baseUrl: string;
|
|
848
|
+
fetch: (request: Request) => Promise<Response>;
|
|
849
|
+
headers: () => Promise<Record<string, string>> | Record<string, string>;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* Seal coverage-corpus routing ZIPs + availability POSTs into the seed observation cache.
|
|
853
|
+
* Call after warmup, before `seedFrom`, so compare walks can forceInclude geo/scheduling reads.
|
|
854
|
+
*/
|
|
855
|
+
declare const prefetchCoverageObservations: (args: {
|
|
856
|
+
real: PrefetchTarget;
|
|
857
|
+
getCache: Map<string, SeedCacheEntry>;
|
|
858
|
+
zips?: readonly string[];
|
|
859
|
+
/** ZIPs that also get PSC availability POST seals. Defaults to scheduling corpus. */
|
|
860
|
+
schedulingZips?: readonly string[];
|
|
861
|
+
/** ZIPs for phlebotomy availability (narrow served set). Defaults to PHLEBOTOMY_ZIPS. */
|
|
862
|
+
phlebotomyZips?: readonly string[];
|
|
863
|
+
labIds?: readonly number[];
|
|
864
|
+
/** Also prefetch phlebotomy + PSC availability. Default true. */
|
|
865
|
+
includeAvailability?: boolean;
|
|
866
|
+
sleep?: (ms: number) => Promise<void>;
|
|
867
|
+
minIntervalMs?: number;
|
|
868
|
+
}) => Promise<void>;
|
|
869
|
+
|
|
648
870
|
declare const DEFAULT_JUNCTION_BASE_URL = "https://api.sandbox.tryvital.io";
|
|
649
|
-
|
|
650
|
-
declare const SANDBOX_KEY_PREFIXES: readonly ["sk_us_", "sk_eu_"];
|
|
651
|
-
declare const isSandboxKey: (key: string) => boolean;
|
|
871
|
+
|
|
652
872
|
type PullCorpusOptions = {
|
|
653
873
|
apiKey: string;
|
|
654
874
|
baseUrl?: string;
|
|
@@ -677,6 +897,11 @@ type SetDiff = {
|
|
|
677
897
|
};
|
|
678
898
|
type CorpusDiff = {
|
|
679
899
|
identical: boolean;
|
|
900
|
+
/** Set when the recorded team differs (or one side recorded none). */
|
|
901
|
+
teamId?: {
|
|
902
|
+
before: string | null;
|
|
903
|
+
after: string | null;
|
|
904
|
+
};
|
|
680
905
|
observations: SetDiff;
|
|
681
906
|
labTests: SetDiff;
|
|
682
907
|
labAccounts: SetDiff;
|
|
@@ -870,40 +1095,20 @@ type OpenAPIDocument = {
|
|
|
870
1095
|
};
|
|
871
1096
|
|
|
872
1097
|
declare const document: OpenAPIDocument;
|
|
873
|
-
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_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";
|
|
874
|
-
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_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";
|
|
875
|
-
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_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"];
|
|
876
|
-
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_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"];
|
|
877
|
-
|
|
878
|
-
type SeedCacheEntry = {
|
|
879
|
-
status: number;
|
|
880
|
-
headers: Record<string, string>;
|
|
881
|
-
body: unknown;
|
|
882
|
-
};
|
|
1098
|
+
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";
|
|
1099
|
+
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";
|
|
1100
|
+
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"];
|
|
1101
|
+
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"];
|
|
883
1102
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
fetch: (request: Request) => Promise<Response>;
|
|
887
|
-
headers: () => Promise<Record<string, string>> | Record<string, string>;
|
|
888
|
-
};
|
|
1103
|
+
/** The `detail` of each order-scoped operation's 404 for an order that does not exist. */
|
|
1104
|
+
declare const ORDER_NOT_FOUND: Readonly<Record<string, string>>;
|
|
889
1105
|
/**
|
|
890
|
-
*
|
|
891
|
-
*
|
|
1106
|
+
* Names the missing resource: `order <id>`, `user <id>`, or `user client:<client_user_id>`
|
|
1107
|
+
* (the id percent-encoded). Never part of Junction's answer.
|
|
892
1108
|
*/
|
|
893
|
-
declare const
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
zips?: readonly string[];
|
|
897
|
-
/** ZIPs that also get PSC availability POST seals. Defaults to scheduling corpus. */
|
|
898
|
-
schedulingZips?: readonly string[];
|
|
899
|
-
/** ZIPs for phlebotomy availability (narrow served set). Defaults to PHLEBOTOMY_ZIPS. */
|
|
900
|
-
phlebotomyZips?: readonly string[];
|
|
901
|
-
labIds?: readonly number[];
|
|
902
|
-
/** Also prefetch phlebotomy + PSC availability. Default true. */
|
|
903
|
-
includeAvailability?: boolean;
|
|
904
|
-
sleep?: (ms: number) => Promise<void>;
|
|
905
|
-
minIntervalMs?: number;
|
|
906
|
-
}) => Promise<void>;
|
|
1109
|
+
declare const MISS_HEADER = "x-mockingbird-miss";
|
|
1110
|
+
/** What the namespace does hold: `users=<n> orders=<n>`. */
|
|
1111
|
+
declare const KNOWN_HEADER = "x-mockingbird-known";
|
|
907
1112
|
|
|
908
1113
|
type Violation = "wrong-type" | "string-too-long" | "string-too-short" | "number-too-large" | "number-too-small" | "not-in-enum" | "missing-required" | "unexpected-property" | "array-too-long" | "array-too-short" | "bad-format";
|
|
909
1114
|
type Mutation = {
|
|
@@ -980,8 +1185,18 @@ type JunctionRuntimeOptions = {
|
|
|
980
1185
|
corpus?: SealedCorpus;
|
|
981
1186
|
/** Default: `corpus` when a corpus is loaded, otherwise `synthetic`. */
|
|
982
1187
|
geo?: GeoMode;
|
|
983
|
-
/** The team's lab accounts
|
|
984
|
-
labAccounts?:
|
|
1188
|
+
/** The team's lab accounts, or `{ presets, accounts }`; see {@link JunctionAPIOptions.labAccounts}. */
|
|
1189
|
+
labAccounts?: LabAccountLayout;
|
|
1190
|
+
/** The team the mock answers as. Default: the corpus's recorded team, else a fixed id. */
|
|
1191
|
+
teamId?: string;
|
|
1192
|
+
/** Sandbox-only restrictions, every one off by default; per namespace via `PUT /__admin/limits`. */
|
|
1193
|
+
limits?: JunctionLimitsInput;
|
|
1194
|
+
/** `adopt-users` creates unknown user ids on first use. Default `strict`. */
|
|
1195
|
+
identity?: IdentityMode;
|
|
1196
|
+
/** Users and orders every namespace starts with, re-applied on each reset. */
|
|
1197
|
+
fixtures?: JunctionFixtures;
|
|
1198
|
+
/** Requests each namespace's journal keeps (`GET /__admin/requests`). Default 1000. */
|
|
1199
|
+
journalSize?: number;
|
|
985
1200
|
/** Deliver signed webhooks here, with Svix's retry schedule. */
|
|
986
1201
|
webhooks?: WebhookEndpoint;
|
|
987
1202
|
/** Called in-process for every webhook event, delivered or not. */
|
|
@@ -1028,8 +1243,12 @@ declare const UNKNOWN_ZIP_ERROR_TYPE = "MOCKINGBIRD_UNKNOWN_ZIP";
|
|
|
1028
1243
|
* optionally orders) run against both sides, comparing status codes, response
|
|
1029
1244
|
* shapes, and — for the documented error bodies — exact bytes.
|
|
1030
1245
|
*
|
|
1246
|
+
* The scenario also replays every order-scoped operation against a random unknown order
|
|
1247
|
+
* (each 404 body compared exactly) and, with `orders` and a corpus holding an account whose
|
|
1248
|
+
* `team_id_allowlist` is empty, orders through that account with and without its id.
|
|
1249
|
+
*
|
|
1031
1250
|
* Only a sandbox team should be used: the scenario creates, and always deletes, one
|
|
1032
|
-
* user (and, with `orders`, places and cancels
|
|
1251
|
+
* user (and, with `orders`, places and cancels its orders).
|
|
1033
1252
|
*/
|
|
1034
1253
|
type VerifyOptions = {
|
|
1035
1254
|
realKey: string;
|
|
@@ -1089,10 +1308,22 @@ type JunctionAPIOptions = APIOptions & {
|
|
|
1089
1308
|
*/
|
|
1090
1309
|
geo?: GeoMode;
|
|
1091
1310
|
/**
|
|
1092
|
-
* The team's lab accounts, replacing the built-in fixtures (and any from the corpus)
|
|
1093
|
-
* `
|
|
1311
|
+
* The team's lab accounts, replacing the built-in fixtures (and any from the corpus):
|
|
1312
|
+
* a list of accounts, or `{ presets: [...], accounts: [...] }`. `create_order` routes,
|
|
1313
|
+
* accepts and rejects `lab_account_id` against these.
|
|
1314
|
+
*/
|
|
1315
|
+
labAccounts?: LabAccountLayout;
|
|
1316
|
+
/**
|
|
1317
|
+
* The team the mock answers as: `team_id` on users and orders, and the team lab-account
|
|
1318
|
+
* allowlists are checked against. Default: the corpus's recorded team, else a fixed id.
|
|
1094
1319
|
*/
|
|
1095
|
-
|
|
1320
|
+
teamId?: string;
|
|
1321
|
+
/** Sandbox-only restrictions to enforce. Every one is off unless set here. */
|
|
1322
|
+
limits?: JunctionLimitsInput;
|
|
1323
|
+
/** `adopt-users` creates an unknown (well-formed) `user_id` on first use. Default `strict`. */
|
|
1324
|
+
identity?: IdentityMode;
|
|
1325
|
+
/** Users and orders to load into every namespace, re-applied on every `reset()`. */
|
|
1326
|
+
fixtures?: JunctionFixtures;
|
|
1096
1327
|
};
|
|
1097
1328
|
/** What a loaded corpus covers, for `/health` and startup logs. */
|
|
1098
1329
|
type CorpusInfo = {
|
|
@@ -1103,6 +1334,8 @@ type CorpusInfo = {
|
|
|
1103
1334
|
labTests: number;
|
|
1104
1335
|
labAccounts: number;
|
|
1105
1336
|
zips: number;
|
|
1337
|
+
/** The recording team, when the corpus recorded one (version 2+). */
|
|
1338
|
+
teamId?: string;
|
|
1106
1339
|
};
|
|
1107
1340
|
/** A short, stable name for a corpus: its recording date plus a digest of what it holds. */
|
|
1108
1341
|
declare const corpusLabel: (corpus: SealedCorpus) => string;
|
|
@@ -1111,6 +1344,10 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
1111
1344
|
readonly sqlite: SqliteClient;
|
|
1112
1345
|
private readonly service;
|
|
1113
1346
|
private readonly state;
|
|
1347
|
+
private readonly now;
|
|
1348
|
+
private readonly explicitTeamId;
|
|
1349
|
+
private readonly fixtures;
|
|
1350
|
+
private readonly rateWindow;
|
|
1114
1351
|
private corpus;
|
|
1115
1352
|
private labAccountConfig;
|
|
1116
1353
|
constructor(options?: JunctionAPIOptions);
|
|
@@ -1127,9 +1364,40 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
1127
1364
|
* recorded from a team with no accounts leaves in place).
|
|
1128
1365
|
*/
|
|
1129
1366
|
private seedLabAccounts;
|
|
1130
|
-
/**
|
|
1131
|
-
|
|
1367
|
+
/** The team this namespace answers as. */
|
|
1368
|
+
get teamId(): string;
|
|
1369
|
+
/**
|
|
1370
|
+
* Replace the team's lab accounts (a list, or `{ presets, accounts }`); `undefined`
|
|
1371
|
+
* restores the default. Kept across `reset()`, per namespace.
|
|
1372
|
+
*/
|
|
1373
|
+
configureLabAccounts(accounts: LabAccountLayout | undefined): StoredLabAccount[];
|
|
1132
1374
|
labAccounts(): StoredLabAccount[];
|
|
1375
|
+
/** Apply one change to the effective account list and keep it as this namespace's config. */
|
|
1376
|
+
private editLabAccounts;
|
|
1377
|
+
/** Add one account. Throws `LabAccountConflict` when the id is taken. Kept across resets. */
|
|
1378
|
+
addLabAccount(input: LabAccountInput | StoredLabAccount): StoredLabAccount;
|
|
1379
|
+
/** Add a named preset (see `LAB_ACCOUNT_PRESETS`); `undefined` for an unknown name. */
|
|
1380
|
+
addLabAccountPreset(name: string, id?: string): StoredLabAccount | undefined;
|
|
1381
|
+
/** Merge fields into an account; `undefined` when there is none with that id. */
|
|
1382
|
+
patchLabAccount(id: string, patch: Partial<LabAccountInput>): StoredLabAccount | undefined;
|
|
1383
|
+
removeLabAccount(id: string): boolean;
|
|
1384
|
+
/** The sandbox limits this namespace enforces. Every one is off unless configured. */
|
|
1385
|
+
get limits(): JunctionLimits;
|
|
1386
|
+
/** Change some limits (`null` lifts a numeric one); kept across `reset()`. */
|
|
1387
|
+
configureLimits(input: JunctionLimitsInput): JunctionLimits;
|
|
1388
|
+
get identity(): IdentityMode;
|
|
1389
|
+
set identity(mode: IdentityMode);
|
|
1390
|
+
/** Insert users with chosen ids, all or none. Throws `FixtureError` (400/404/409). */
|
|
1391
|
+
insertUsers(users: readonly UserFixture[]): UserRecord[];
|
|
1392
|
+
/** Remove a user outright, leaving no deletion tombstone. */
|
|
1393
|
+
hardDeleteUser(userId: string): boolean;
|
|
1394
|
+
/** Insert orders, optionally already in a status. No webhook fires unless asked. */
|
|
1395
|
+
insertOrders(orders: readonly OrderFixture[], options?: InsertOptions): OrderRecord[];
|
|
1396
|
+
/** Load users, then orders, in one call. */
|
|
1397
|
+
importFixtures(fixtures: JunctionFixtures, options?: InsertOptions): {
|
|
1398
|
+
users: UserRecord[];
|
|
1399
|
+
orders: OrderRecord[];
|
|
1400
|
+
};
|
|
1133
1401
|
corpusInfo(): CorpusInfo | undefined;
|
|
1134
1402
|
get geoMode(): GeoMode;
|
|
1135
1403
|
set geoMode(mode: GeoMode);
|
|
@@ -1154,6 +1422,11 @@ declare class JunctionAPI implements FetchAPI {
|
|
|
1154
1422
|
webhookEvents(): JunctionWebhookEvent[];
|
|
1155
1423
|
webhookDeliveryAttempts(): WebhookDeliveryAttempt[];
|
|
1156
1424
|
}
|
|
1425
|
+
/** Raised by `addLabAccount` for an id the namespace already has. */
|
|
1426
|
+
declare class LabAccountConflict extends Error {
|
|
1427
|
+
readonly id: string;
|
|
1428
|
+
constructor(id: string);
|
|
1429
|
+
}
|
|
1157
1430
|
|
|
1158
|
-
export { AVAILABILITY_ADDRESS, AVAILABILITY_START_DATE, COVERAGE_ZIPS, DEFAULT_JUNCTION_BASE_URL, FAULT_PRESETS, JUNCTION_NAMESPACE, JunctionAPI, ORDER_STATUSES_BY_METHOD, PHLEBOTOMY_AVAILABILITY_ZIPS, PSC_AVAILABILITY_ZIPS, PSC_LAB_IDS, RESULT_FIXTURES, SANDBOX_KEY_PREFIXES, SEALED_CORPUS_VERSION, TEAM_LAB_ACCOUNTS, TRANSITION_ALIASES, UNKNOWN_ZIP_ERROR_TYPE, UNKNOWN_ZIP_STATUS, US_STATES, corpusLabel, createRuntime, createWebhookDispatcher, diffCorpus, document, fingerprintCorpus, isSandboxKey, labAccountFromInput, observationCacheKey, operationIds, parseSealedCorpus, prefetchCoverageObservations, pullCorpus, reshapeCoverageGeoCommand, resolveTransition, signSvix, supportedOperationIds, verifyAgainstReal, verifySvix };
|
|
1159
|
-
export type { CorpusDiff, CorpusInfo, Divergence, FetchAPI, GeoMode, GetCacheEntry, JunctionAPIOptions, JunctionAdminOptions, JunctionRuntime, JunctionRuntimeOptions, JunctionWebhookEvent, JunctionWebhookOptions, LabAccountDelegatedFlow, LabAccountInput, LabAccountRecord, LabAccountStatus, OperationId, OrderRecord, PullCorpusOptions, ResultFixture, SealedCorpus, SeedObservations, SeedReport, SeedSource, SetDiff, SqliteClient, StoredLabAccount, SupportedOperationId, VerifyOptions, VerifyReport, WebhookAttempt, WebhookDelivery, WebhookDispatcher, WebhookEndpoint, WebhookPublisher };
|
|
1431
|
+
export { AVAILABILITY_ADDRESS, AVAILABILITY_START_DATE, COVERAGE_ZIPS, DEFAULT_JUNCTION_BASE_URL, DEFAULT_LIMITS, DELEGATED_ACCOUNT_STATES, FAULT_PRESETS, FixtureError, IDENTITY_MODES, JUNCTION_NAMESPACE, JunctionAPI, KNOWN_HEADER, LAB_ACCOUNT_PRESETS, 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, 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 };
|
|
1432
|
+
export type { 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 };
|