@crvouga/mockingbird-runtime 0.4.0 → 0.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/README.md +32 -1
- package/dist/adapter-node.d.ts +29 -1
- package/dist/adapter-node.js +13 -6
- package/dist/adapter-node.js.map +2 -2
- package/dist/authoring.d.ts +1599 -0
- package/dist/authoring.js +83 -0
- package/dist/authoring.js.map +7 -0
- package/dist/{chunk-HGJXAIZJ.js → chunk-BK5KDNUE.js} +454 -262
- package/dist/{chunk-HGJXAIZJ.js.map → chunk-BK5KDNUE.js.map} +3 -3
- package/dist/{chunk-NW5GDYLU.js → chunk-GAIPLMRY.js} +14 -2
- package/dist/chunk-GAIPLMRY.js.map +7 -0
- package/dist/{chunk-4XF56L2I.js → chunk-SVG34QFE.js} +3 -3
- package/dist/http-provider.d.ts +1 -0
- package/dist/http-provider.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +2 -2
- package/dist/mqtt-broker/node.d.ts +1 -0
- package/dist/mqtt-broker/node.js +3 -3
- package/dist/mqtt-broker.d.ts +1 -0
- package/dist/mqtt-broker.js +3 -3
- package/dist/service/admin.js +1 -1
- package/dist/service.d.ts +65 -3
- package/dist/service.js +6 -2
- package/package.json +5 -1
- package/dist/chunk-NW5GDYLU.js.map +0 -7
- /package/dist/{chunk-4XF56L2I.js.map → chunk-SVG34QFE.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_NAMESPACE
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BK5KDNUE.js";
|
|
4
4
|
import {
|
|
5
5
|
fromBase64,
|
|
6
6
|
matchNamespacePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GAIPLMRY.js";
|
|
8
8
|
|
|
9
9
|
// ../mqtt/broker/dist/reason.js
|
|
10
10
|
var ReasonCode = {
|
|
@@ -775,4 +775,4 @@ export {
|
|
|
775
775
|
connectNamespace,
|
|
776
776
|
brokerAdminRoutes
|
|
777
777
|
};
|
|
778
|
-
//# sourceMappingURL=chunk-
|
|
778
|
+
//# sourceMappingURL=chunk-SVG34QFE.js.map
|
package/dist/http-provider.d.ts
CHANGED
|
@@ -335,6 +335,7 @@ declare class Collection$1<T> {
|
|
|
335
335
|
nextSequence(): number;
|
|
336
336
|
get(id: string): T | undefined;
|
|
337
337
|
has(id: string): boolean;
|
|
338
|
+
private assertRoom;
|
|
338
339
|
/** Insert a new record, assigning it the next sequence number. */
|
|
339
340
|
insert(id: string, value: T): Stored<T>;
|
|
340
341
|
/** Replace an existing record's value, keeping its position. */
|
package/dist/http-provider.js
CHANGED
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
Collection,
|
|
20
20
|
bootSqlite
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BK5KDNUE.js";
|
|
22
22
|
import {
|
|
23
23
|
clearNamespace
|
|
24
24
|
} from "./chunk-2KDYLZXC.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-GAIPLMRY.js";
|
|
26
26
|
import {
|
|
27
27
|
requestBaseUrl
|
|
28
28
|
} from "./chunk-U36J5GCB.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* copy (scripts/bundle-service-runtime.ts).
|
|
6
6
|
*/
|
|
7
7
|
/** Every subpath this package exports, in `package.json` order. */
|
|
8
|
-
declare const RUNTIME_SUBPATHS: readonly ["core", "openapi", "openapi-metadata", "http-codec", "http-provider", "mqtt-broker", "mqtt-broker/node", "ui", "sqlite", "service", "service/admin", "adapter-node", "preview/bridge", "preview/host", "preview/artifacts", "preview/harness"];
|
|
8
|
+
declare const RUNTIME_SUBPATHS: readonly ["authoring", "core", "openapi", "openapi-metadata", "http-codec", "http-provider", "mqtt-broker", "mqtt-broker/node", "ui", "sqlite", "service", "service/admin", "adapter-node", "preview/bridge", "preview/host", "preview/artifacts", "preview/harness"];
|
|
9
9
|
|
|
10
10
|
export { RUNTIME_SUBPATHS };
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The shared Mockingbird runtime, published once so every emulator service depends on the same\n * copy. Each subpath re-exports one workspace helper (`@crvouga/mockingbird-runtime/<subpath>` is\n * `@crvouga/mockingbird-<subpath>`); a service's build imports these instead of inlining its own\n * copy (scripts/bundle-service-runtime.ts).\n */\n\n/** Every subpath this package exports, in `package.json` order. */\nexport const RUNTIME_SUBPATHS = [\n \"core\",\n \"openapi\",\n \"openapi-metadata\",\n \"http-codec\",\n \"http-provider\",\n \"mqtt-broker\",\n \"mqtt-broker/node\",\n \"ui\",\n \"sqlite\",\n \"service\",\n \"service/admin\",\n \"adapter-node\",\n \"preview/bridge\",\n \"preview/host\",\n \"preview/artifacts\",\n \"preview/harness\",\n] as const\n"],
|
|
5
|
-
"mappings": ";AAQO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
4
|
+
"sourcesContent": ["/**\n * The shared Mockingbird runtime, published once so every emulator service depends on the same\n * copy. Each subpath re-exports one workspace helper (`@crvouga/mockingbird-runtime/<subpath>` is\n * `@crvouga/mockingbird-<subpath>`); a service's build imports these instead of inlining its own\n * copy (scripts/bundle-service-runtime.ts).\n */\n\n/** Every subpath this package exports, in `package.json` order. */\nexport const RUNTIME_SUBPATHS = [\n \"authoring\",\n \"core\",\n \"openapi\",\n \"openapi-metadata\",\n \"http-codec\",\n \"http-provider\",\n \"mqtt-broker\",\n \"mqtt-broker/node\",\n \"ui\",\n \"sqlite\",\n \"service\",\n \"service/admin\",\n \"adapter-node\",\n \"preview/bridge\",\n \"preview/host\",\n \"preview/artifacts\",\n \"preview/harness\",\n] as const\n"],
|
|
5
|
+
"mappings": ";AAQO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -64,6 +64,7 @@ declare class Collection<T> {
|
|
|
64
64
|
nextSequence(): number;
|
|
65
65
|
get(id: string): T | undefined;
|
|
66
66
|
has(id: string): boolean;
|
|
67
|
+
private assertRoom;
|
|
67
68
|
/** Insert a new record, assigning it the next sequence number. */
|
|
68
69
|
insert(id: string, value: T): Stored<T>;
|
|
69
70
|
/** Replace an existing record's value, keeping its position. */
|
package/dist/mqtt-broker/node.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAX_VARIABLE_BYTE_INTEGER,
|
|
3
3
|
MQTT_WEBSOCKET_PATH
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-SVG34QFE.js";
|
|
5
|
+
import "../chunk-BK5KDNUE.js";
|
|
6
6
|
import "../chunk-2KDYLZXC.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-GAIPLMRY.js";
|
|
8
8
|
import "../chunk-U36J5GCB.js";
|
|
9
9
|
import "../chunk-EQLY2YOA.js";
|
|
10
10
|
import "../chunk-HU6IOAFC.js";
|
package/dist/mqtt-broker.d.ts
CHANGED
|
@@ -339,6 +339,7 @@ declare class Collection<T> {
|
|
|
339
339
|
nextSequence(): number;
|
|
340
340
|
get(id: string): T | undefined;
|
|
341
341
|
has(id: string): boolean;
|
|
342
|
+
private assertRoom;
|
|
342
343
|
/** Insert a new record, assigning it the next sequence number. */
|
|
343
344
|
insert(id: string, value: T): Stored<T>;
|
|
344
345
|
/** Replace an existing record's value, keeping its position. */
|
package/dist/mqtt-broker.js
CHANGED
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
observeClock,
|
|
15
15
|
takeConnackFault,
|
|
16
16
|
webSocketNamespace
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SVG34QFE.js";
|
|
18
18
|
import {
|
|
19
19
|
Collection,
|
|
20
20
|
IdSequence
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BK5KDNUE.js";
|
|
22
22
|
import "./chunk-2KDYLZXC.js";
|
|
23
23
|
import {
|
|
24
24
|
fromBase64,
|
|
25
25
|
toBase64
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GAIPLMRY.js";
|
|
27
27
|
import "./chunk-U36J5GCB.js";
|
|
28
28
|
import "./chunk-EQLY2YOA.js";
|
|
29
29
|
import "./chunk-HU6IOAFC.js";
|
package/dist/service/admin.js
CHANGED
package/dist/service.d.ts
CHANGED
|
@@ -1112,6 +1112,29 @@ type MetricsReport = {
|
|
|
1112
1112
|
faults: number;
|
|
1113
1113
|
totalDurationMs: number;
|
|
1114
1114
|
};
|
|
1115
|
+
/** What a runtime holds across every namespace: the gauges a long-running mock is watched by. */
|
|
1116
|
+
type ResourceReport = {
|
|
1117
|
+
/** Namespaces that hold state now (`GET /__admin/namespaces`). */
|
|
1118
|
+
namespaces: number;
|
|
1119
|
+
/** Stored records, every collection and branch included. */
|
|
1120
|
+
records: number;
|
|
1121
|
+
/** Journal entries held (`GET /__admin/requests`). */
|
|
1122
|
+
journalEntries: number;
|
|
1123
|
+
/** Named snapshots held. */
|
|
1124
|
+
snapshots: number;
|
|
1125
|
+
/** Webhook deliveries waiting for an attempt or a retry. */
|
|
1126
|
+
webhooksPending: number;
|
|
1127
|
+
/** Heap in use, or `null` where the host cannot say. */
|
|
1128
|
+
heapUsedBytes: number | null;
|
|
1129
|
+
/** Namespaces forgotten for being idle since the runtime started. */
|
|
1130
|
+
namespacesExpired: number;
|
|
1131
|
+
/** Idle namespaces whose drop failed; each is retried on a later request. */
|
|
1132
|
+
idleExpiryFailures: number;
|
|
1133
|
+
/** Requests answered `507` for the record cap, their writes rolled back. */
|
|
1134
|
+
recordLimitRefusals: number;
|
|
1135
|
+
/** Snapshots refused for the snapshot cap. */
|
|
1136
|
+
snapshotLimitRefusals: number;
|
|
1137
|
+
};
|
|
1115
1138
|
type Metrics = {
|
|
1116
1139
|
record(entry: RequestLog): void;
|
|
1117
1140
|
report(namespace?: string): MetricsReport;
|
|
@@ -1143,6 +1166,8 @@ type Journal = {
|
|
|
1143
1166
|
readonly size: number;
|
|
1144
1167
|
record(entry: JournalEntry): void;
|
|
1145
1168
|
list(query?: JournalQuery): JournalEntry[];
|
|
1169
|
+
/** Entries held for one namespace, or for every namespace. */
|
|
1170
|
+
count(namespace?: string): number;
|
|
1146
1171
|
/** Forget one namespace's entries, or every namespace's. */
|
|
1147
1172
|
clear(namespace?: string): void;
|
|
1148
1173
|
};
|
|
@@ -1282,6 +1307,8 @@ type NamespaceControlsOptions = {
|
|
|
1282
1307
|
onPreset?(preset: FaultPreset, namespace: string, overrides: Partial<FaultRule>): void;
|
|
1283
1308
|
/** Put a snapshot document into a namespace: the boot `snapshot` control. */
|
|
1284
1309
|
restoreDocument?(namespace: string, document: SnapshotDocument, scope: BootScope): void;
|
|
1310
|
+
/** A namespace was given controls for the first time: it now holds state of its own. */
|
|
1311
|
+
onStart?(namespace: string): void;
|
|
1285
1312
|
};
|
|
1286
1313
|
/**
|
|
1287
1314
|
* Per-namespace seed, clock settings, latency and faults, and the one place a control
|
|
@@ -1428,6 +1455,8 @@ type ControlContext = {
|
|
|
1428
1455
|
applyControls?(namespace: string, plan: ControlPlan): void;
|
|
1429
1456
|
/** Reset a namespace and forget it. Default: reset. */
|
|
1430
1457
|
dropNamespace?(namespace: string): Promise<void>;
|
|
1458
|
+
/** Runtime-wide gauges, added to an unscoped `GET /metrics?resources=1`. */
|
|
1459
|
+
resources?(): ResourceReport;
|
|
1431
1460
|
};
|
|
1432
1461
|
type ControlPlane = {
|
|
1433
1462
|
/** The control-plane response for `request`, or `undefined` for a vendor request. */
|
|
@@ -1538,6 +1567,18 @@ type ListRecordsOptions<T> = {
|
|
|
1538
1567
|
/** Sort order; default newest first. */
|
|
1539
1568
|
order?: "newest" | "oldest";
|
|
1540
1569
|
};
|
|
1570
|
+
/** A write that would store more records in one namespace than the runtime's `maxRecords`. */
|
|
1571
|
+
declare class RecordLimitError extends RangeError {
|
|
1572
|
+
readonly limit: number;
|
|
1573
|
+
constructor(limit: number);
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Cap the records each namespace of `service` may hold in `sqlite`, or lift the cap with
|
|
1577
|
+
* `undefined`. Storage namespaces are `service` and `service:<name>`; another service sharing
|
|
1578
|
+
* the database is not capped. Inserting a new id past it throws {@link RecordLimitError};
|
|
1579
|
+
* replacing a record never does.
|
|
1580
|
+
*/
|
|
1581
|
+
declare const setRecordLimit: (sqlite: SqliteClient, service: string, limit: number | undefined) => void;
|
|
1541
1582
|
/**
|
|
1542
1583
|
* A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
|
|
1543
1584
|
* sequence, never by id lexicographic order, so list semantics stay stable.
|
|
@@ -1561,6 +1602,7 @@ declare class Collection<T> {
|
|
|
1561
1602
|
nextSequence(): number;
|
|
1562
1603
|
get(id: string): T | undefined;
|
|
1563
1604
|
has(id: string): boolean;
|
|
1605
|
+
private assertRoom;
|
|
1564
1606
|
/** Insert a new record, assigning it the next sequence number. */
|
|
1565
1607
|
insert(id: string, value: T): Stored<T>;
|
|
1566
1608
|
/** Replace an existing record's value, keeping its position. */
|
|
@@ -2271,7 +2313,8 @@ type WebhookHub = {
|
|
|
2271
2313
|
deliveryId: string;
|
|
2272
2314
|
}) => void): () => void;
|
|
2273
2315
|
setTransportPolicy(policy: OwnedTransport): void;
|
|
2274
|
-
|
|
2316
|
+
/** Deliveries waiting in one namespace, or in every namespace. */
|
|
2317
|
+
pending(namespace?: string): number;
|
|
2275
2318
|
snapshot(namespace: string): unknown;
|
|
2276
2319
|
exportSnapshot(handle: unknown): unknown;
|
|
2277
2320
|
importSnapshot(namespace: string, document: unknown): unknown;
|
|
@@ -2408,6 +2451,21 @@ type RuntimeOptions<T extends ServiceInstance> = {
|
|
|
2408
2451
|
webhooks?: WebhookHub;
|
|
2409
2452
|
/** Retained time-travel checkpoints per namespace. Default 1,000. */
|
|
2410
2453
|
maxCheckpoints?: number;
|
|
2454
|
+
/**
|
|
2455
|
+
* Forget a namespace (as `DELETE /__admin/namespaces/<key>` does) once no request has named
|
|
2456
|
+
* it for this many wall-clock milliseconds. `default` is never forgotten, nor is a namespace
|
|
2457
|
+
* with a webhook delivery still waiting or a request still running. Default 0: namespaces are
|
|
2458
|
+
* kept until dropped.
|
|
2459
|
+
*/
|
|
2460
|
+
namespaceIdleMs?: number;
|
|
2461
|
+
/**
|
|
2462
|
+
* Records each namespace may hold; a request that would store another answers `507` with
|
|
2463
|
+
* every write it made rolled back. The cap is this runtime's own: another service sharing the
|
|
2464
|
+
* SQLite database is not capped by it. Default: no cap.
|
|
2465
|
+
*/
|
|
2466
|
+
maxRecords?: number;
|
|
2467
|
+
/** Named snapshots each namespace may hold; another is refused with `400`. Default: no cap. */
|
|
2468
|
+
maxSnapshots?: number;
|
|
2411
2469
|
/**
|
|
2412
2470
|
* Record a time-travel checkpoint after every accepted mutation and stamp its id in
|
|
2413
2471
|
* `x-mockingbird-checkpoint`. Default true. Each checkpoint reads the whole namespace, so a
|
|
@@ -2435,6 +2493,8 @@ type RuntimeIO = {
|
|
|
2435
2493
|
monotonicNow(): number;
|
|
2436
2494
|
/** Wait on the wall clock. Rejects with the signal's reason when it aborts first. */
|
|
2437
2495
|
sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
2496
|
+
/** Bytes of heap in use, for `GET /__admin/metrics`; `undefined` where the host cannot say. */
|
|
2497
|
+
heapUsedBytes(): number | undefined;
|
|
2438
2498
|
};
|
|
2439
2499
|
type ServiceTimelineState = Readonly<{
|
|
2440
2500
|
snapshot: NamespaceSnapshot;
|
|
@@ -2489,6 +2549,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
2489
2549
|
reset(namespace?: string): Promise<void>;
|
|
2490
2550
|
/** Reset a namespace and forget it, releasing everything it held. */
|
|
2491
2551
|
dropNamespace(namespace: string): Promise<void>;
|
|
2552
|
+
/** What the runtime holds across every namespace, as `GET /__admin/metrics` reports it. */
|
|
2553
|
+
resources(): ResourceReport;
|
|
2492
2554
|
/** A namespace's controls: seed, clock, virtual time, latency, faults and snapshots. */
|
|
2493
2555
|
controls(namespace?: string): ControlState & {
|
|
2494
2556
|
snapshots: SnapshotInfo[];
|
|
@@ -2682,5 +2744,5 @@ declare const UNRELEASED_VERSION = "0.0.0-development";
|
|
|
2682
2744
|
/** The published version of the service package this code is bundled into. */
|
|
2683
2745
|
declare const PACKAGE_VERSION: string;
|
|
2684
2746
|
|
|
2685
|
-
export { ADMIN_CONTROL_PAGES, ADMIN_DOCS_URL, ADMIN_KEY_HEADER, ADMIN_PREFIX, ADMIN_ROUTE_REFERENCE, AT_HEADER, AwsError, AwsProtocolAPI, BRANCH_HEADER, CHECKPOINT_HEADER, CONTROL_HEADERS, CONTROL_HEADER_REFERENCE, Collection, ControlError, DEFAULT_JOURNAL_SIZE, DEFAULT_NAMESPACE, DroppedConnectionError, FAULT_HEADER, HEALTH_PATH, HttpError, IdSequence, IdempotencyStore, MOCKINGBIRD_HEADER, NAMESPACE_HEADER, OperationRegistryError, OutboxStore, PACKAGE_VERSION, SNAPSHOT_FORMAT, SNAPSHOT_HEADER, STANDARD_ADMIN_ROUTES, STANDARD_FAULT_PRESETS, STATE_FIELD_KINDS, UNRELEASED_VERSION, annotateResponse, anyCredential, assertAdminPrefixAvailable, assertAdminUi, assertSnapshotDocument, awsList, awsMd5, awsPage, awsParseXml, awsRecord, awsRequired, awsXml, awsXmlEscape, basicAuth, bearerToken, bodyIssues, bootSqlite, codePointLength, coerce, controlHeaders, createClock, createControlPlane, createCredentialRegistry, createFaultRegistry, createJournal, createLatencyRegistry, createMetrics, createNamespaceControls, createRng, createRuntime, createService, createWebhookHub, decodeAwsQuery, defineMock, defineOperations, deriveClock, extractCodes, extractLinks, faultEffect, faultEffects, forwardRequestContext, fromBase64, hmac, idBaseOf, inspectState, isAdminPath, issuesByField, jsonRes, jsonRes as jsonResponse, markMutationAccepted, maskCredential, matchNamespacePath, normalizeBootControls, normalizeControls, normalizeFault, normalizeIdBase, opaqueToken, outboxAdminRoutes, ownedTransport, parseControlHeaders, parseDuration, parseFaultHeader, parseForm, parseInstant, parseSince, putObject, recordedIssues, requestBaseUrl, requestFingerprint, resolveAdminPrefix, responseNotes, restoreClock, restoreNamespace, seedFrom, setIdBase, sha, sigV4AccessKeyId, signSvix, signTimestamped, signTwilio, signV4, signers, snapshotNamespace, sortIssues, stableStringify, svixSecretBytes, timingSafeEqual, toBase64, toHex, unsupportedMediaType, upstreamRequest, verifyOperations, webhookAdminRoutes, withNamespaceRollback };
|
|
2686
|
-
export type { APIOptions, AdminBrand, AdminExtension, AdminPanel, AdminRequest, AdminRoute, AdminRoutes, AdminUi, AwsInput, AwsOperation, AwsProtocolOptions, BasicCredentials, BodyIssue, ByteEncoding, Clock, ClockControls, ClockState, ControlClock, ControlContext, ControlHeaderInput, ControlHeaderName, ControlPlane, ControlSettings, ControlState, CredentialRegistry, DerivedClock, Duration, FaultCandidate, FaultHit, FaultInput, FaultListing, FaultPreset, FaultPresetList, FaultRegistry, FaultRule, FaultSnapshot, FieldResult, FormIssue, HmacAlgorithm, IdBase, IdempotencyErrors, IdempotencyStoreOptions, InstanceContext, Instant, Journal, JournalEntry, JournalQuery, LatencyControls, LatencyRegistry, LatencyRule, LatencyRuleInput, LatencyState, ListRecordsOptions, Metrics, MetricsReport, MockCheckpoint, MockControlState, MockControls, MockCreateOptions, MockInstanceSurface, MockSnapshotInfo, MockSurface, MountedAPI, NamespaceControls, NamespaceControls$1 as NamespaceControlsInput, NamespaceSnapshot, OperationContext, OperationHandler, OperationHandlers, OutboundPolicy, OutboxItem, OutboxQuery, OwnedTransport, ParsedForm, PublishInput, RejectedRequest, RequestBodyValue, RequestControls, RequestLog, ResponseNotes, Rng, RuntimeIO, RuntimeOptions, S3Target, Service, ServiceCheckpoint, ServiceInstance, ServiceOptions, ServiceRuntime, ServiceTimelineState, SignInput, SnapshotDocument, SnapshotInfo, SnapshotStore, StandardAdminRoute, StateCollectionView, StateDeclaration, StateField, StateFieldKind, StateMeta, StatePage, StateRecord, StateView, Stored, UnsupportedMediaType, UpstreamOptions, UpstreamState, WebhookAttempt, WebhookDelivery, WebhookEndpoint, WebhookFault, WebhookHub, WebhookHubOptions, WebhookMessage, WebhookSigner };
|
|
2747
|
+
export { ADMIN_CONTROL_PAGES, ADMIN_DOCS_URL, ADMIN_KEY_HEADER, ADMIN_PREFIX, ADMIN_ROUTE_REFERENCE, AT_HEADER, AwsError, AwsProtocolAPI, BRANCH_HEADER, CHECKPOINT_HEADER, CONTROL_HEADERS, CONTROL_HEADER_REFERENCE, Collection, ControlError, DEFAULT_JOURNAL_SIZE, DEFAULT_NAMESPACE, DroppedConnectionError, FAULT_HEADER, HEALTH_PATH, HttpError, IdSequence, IdempotencyStore, MOCKINGBIRD_HEADER, NAMESPACE_HEADER, OperationRegistryError, OutboxStore, PACKAGE_VERSION, RecordLimitError, SNAPSHOT_FORMAT, SNAPSHOT_HEADER, STANDARD_ADMIN_ROUTES, STANDARD_FAULT_PRESETS, STATE_FIELD_KINDS, UNRELEASED_VERSION, annotateResponse, anyCredential, assertAdminPrefixAvailable, assertAdminUi, assertSnapshotDocument, awsList, awsMd5, awsPage, awsParseXml, awsRecord, awsRequired, awsXml, awsXmlEscape, basicAuth, bearerToken, bodyIssues, bootSqlite, codePointLength, coerce, controlHeaders, createClock, createControlPlane, createCredentialRegistry, createFaultRegistry, createJournal, createLatencyRegistry, createMetrics, createNamespaceControls, createRng, createRuntime, createService, createWebhookHub, decodeAwsQuery, defineMock, defineOperations, deriveClock, extractCodes, extractLinks, faultEffect, faultEffects, forwardRequestContext, fromBase64, hmac, idBaseOf, inspectState, isAdminPath, issuesByField, jsonRes, jsonRes as jsonResponse, markMutationAccepted, maskCredential, matchNamespacePath, normalizeBootControls, normalizeControls, normalizeFault, normalizeIdBase, opaqueToken, outboxAdminRoutes, ownedTransport, parseControlHeaders, parseDuration, parseFaultHeader, parseForm, parseInstant, parseSince, putObject, recordedIssues, requestBaseUrl, requestFingerprint, resolveAdminPrefix, responseNotes, restoreClock, restoreNamespace, seedFrom, setIdBase, setRecordLimit, sha, sigV4AccessKeyId, signSvix, signTimestamped, signTwilio, signV4, signers, snapshotNamespace, sortIssues, stableStringify, svixSecretBytes, timingSafeEqual, toBase64, toHex, unsupportedMediaType, upstreamRequest, verifyOperations, webhookAdminRoutes, withNamespaceRollback };
|
|
2748
|
+
export type { APIOptions, AdminBrand, AdminExtension, AdminPanel, AdminRequest, AdminRoute, AdminRoutes, AdminUi, AwsInput, AwsOperation, AwsProtocolOptions, BasicCredentials, BodyIssue, ByteEncoding, Clock, ClockControls, ClockState, ControlClock, ControlContext, ControlHeaderInput, ControlHeaderName, ControlPlane, ControlSettings, ControlState, CredentialRegistry, DerivedClock, Duration, FaultCandidate, FaultHit, FaultInput, FaultListing, FaultPreset, FaultPresetList, FaultRegistry, FaultRule, FaultSnapshot, FieldResult, FormIssue, HmacAlgorithm, IdBase, IdempotencyErrors, IdempotencyStoreOptions, InstanceContext, Instant, Journal, JournalEntry, JournalQuery, LatencyControls, LatencyRegistry, LatencyRule, LatencyRuleInput, LatencyState, ListRecordsOptions, Metrics, MetricsReport, MockCheckpoint, MockControlState, MockControls, MockCreateOptions, MockInstanceSurface, MockSnapshotInfo, MockSurface, MountedAPI, NamespaceControls, NamespaceControls$1 as NamespaceControlsInput, NamespaceSnapshot, OperationContext, OperationHandler, OperationHandlers, OutboundPolicy, OutboxItem, OutboxQuery, OwnedTransport, ParsedForm, PublishInput, RejectedRequest, RequestBodyValue, RequestControls, RequestLog, ResourceReport, ResponseNotes, Rng, RuntimeIO, RuntimeOptions, S3Target, Service, ServiceCheckpoint, ServiceInstance, ServiceOptions, ServiceRuntime, ServiceTimelineState, SignInput, SnapshotDocument, SnapshotInfo, SnapshotStore, StandardAdminRoute, StateCollectionView, StateDeclaration, StateField, StateFieldKind, StateMeta, StatePage, StateRecord, StateView, Stored, UnsupportedMediaType, UpstreamOptions, UpstreamState, WebhookAttempt, WebhookDelivery, WebhookEndpoint, WebhookFault, WebhookHub, WebhookHubOptions, WebhookMessage, WebhookSigner };
|
package/dist/service.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
OperationRegistryError,
|
|
16
16
|
OutboxStore,
|
|
17
17
|
PACKAGE_VERSION,
|
|
18
|
+
RecordLimitError,
|
|
18
19
|
SNAPSHOT_HEADER,
|
|
19
20
|
STATE_FIELD_KINDS,
|
|
20
21
|
UNRELEASED_VERSION,
|
|
@@ -56,6 +57,7 @@ import {
|
|
|
56
57
|
requestFingerprint,
|
|
57
58
|
restoreNamespace,
|
|
58
59
|
setIdBase,
|
|
60
|
+
setRecordLimit,
|
|
59
61
|
signV4,
|
|
60
62
|
signers,
|
|
61
63
|
snapshotNamespace,
|
|
@@ -65,7 +67,7 @@ import {
|
|
|
65
67
|
verifyOperations,
|
|
66
68
|
webhookAdminRoutes,
|
|
67
69
|
withNamespaceRollback
|
|
68
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-BK5KDNUE.js";
|
|
69
71
|
import "./chunk-2KDYLZXC.js";
|
|
70
72
|
import {
|
|
71
73
|
ADMIN_CONTROL_PAGES,
|
|
@@ -127,7 +129,7 @@ import {
|
|
|
127
129
|
toBase64,
|
|
128
130
|
toHex,
|
|
129
131
|
upstreamRequest
|
|
130
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-GAIPLMRY.js";
|
|
131
133
|
import {
|
|
132
134
|
requestBaseUrl
|
|
133
135
|
} from "./chunk-U36J5GCB.js";
|
|
@@ -162,6 +164,7 @@ export {
|
|
|
162
164
|
OperationRegistryError,
|
|
163
165
|
OutboxStore,
|
|
164
166
|
PACKAGE_VERSION,
|
|
167
|
+
RecordLimitError,
|
|
165
168
|
SNAPSHOT_FORMAT,
|
|
166
169
|
SNAPSHOT_HEADER,
|
|
167
170
|
STANDARD_ADMIN_ROUTES,
|
|
@@ -243,6 +246,7 @@ export {
|
|
|
243
246
|
restoreNamespace,
|
|
244
247
|
seedFrom,
|
|
245
248
|
setIdBase,
|
|
249
|
+
setRecordLimit,
|
|
246
250
|
sha,
|
|
247
251
|
sigV4AccessKeyId,
|
|
248
252
|
signSvix,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The shared Mockingbird runtime every emulator service depends on: router, admin API and page, snapshots, faults and clock, installed once however many emulators an application uses.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"default": "./dist/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./authoring": {
|
|
20
|
+
"types": "./dist/authoring.d.ts",
|
|
21
|
+
"default": "./dist/authoring.js"
|
|
22
|
+
},
|
|
19
23
|
"./core": {
|
|
20
24
|
"types": "./dist/core.d.ts",
|
|
21
25
|
"default": "./dist/core.js"
|