@crvouga/mockingbird-service-livekit 1.7.0 → 1.8.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 +21 -4
- package/dist/chunk-3VTAPQLB.js +801 -0
- package/dist/chunk-3VTAPQLB.js.map +7 -0
- package/dist/{chunk-KUUBFZEF.js → chunk-OYDPGLNO.js} +205 -28
- package/dist/chunk-OYDPGLNO.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +1 -1
- package/dist/server.d.ts +62 -4
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-KUUBFZEF.js.map +0 -7
- package/dist/chunk-QYZHDKN7.js +0 -334
- package/dist/chunk-QYZHDKN7.js.map +0 -7
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -207,6 +207,15 @@ type FaultCandidate = {
|
|
|
207
207
|
namespace: string;
|
|
208
208
|
};
|
|
209
209
|
type FaultRegistry = {
|
|
210
|
+
isolateNamespaces(): void;
|
|
211
|
+
snapshot(namespace: string): {
|
|
212
|
+
rules: (FaultRule & {
|
|
213
|
+
remaining: number | null;
|
|
214
|
+
hits: number;
|
|
215
|
+
position: number;
|
|
216
|
+
})[];
|
|
217
|
+
rngState: number;
|
|
218
|
+
};
|
|
210
219
|
add(rule: FaultRule): FaultRule;
|
|
211
220
|
list(): (FaultRule & {
|
|
212
221
|
remaining: number | null;
|
|
@@ -214,6 +223,14 @@ type FaultRegistry = {
|
|
|
214
223
|
})[];
|
|
215
224
|
remove(id: string): boolean;
|
|
216
225
|
clear(): void;
|
|
226
|
+
restore(namespace: string, state: {
|
|
227
|
+
rules: (FaultRule & {
|
|
228
|
+
remaining: number | null;
|
|
229
|
+
hits: number;
|
|
230
|
+
position: number;
|
|
231
|
+
})[];
|
|
232
|
+
rngState: number;
|
|
233
|
+
}): void;
|
|
217
234
|
/**
|
|
218
235
|
* Every fault this request should get, in rule order, stopping at the first that answers
|
|
219
236
|
* or drops (effect-only and delay-only rules let later rules match too). Consumes one of
|
|
@@ -391,8 +408,8 @@ type MetricsReport = {
|
|
|
391
408
|
};
|
|
392
409
|
type Metrics = {
|
|
393
410
|
record(entry: RequestLog): void;
|
|
394
|
-
report(): MetricsReport;
|
|
395
|
-
reset(): void;
|
|
411
|
+
report(namespace?: string): MetricsReport;
|
|
412
|
+
reset(namespace?: string): void;
|
|
396
413
|
};
|
|
397
414
|
|
|
398
415
|
/** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
|
|
@@ -558,6 +575,9 @@ type PublishInput = {
|
|
|
558
575
|
id?: string;
|
|
559
576
|
};
|
|
560
577
|
type WebhookHub = {
|
|
578
|
+
pending(namespace: string): number;
|
|
579
|
+
snapshot(namespace: string): unknown;
|
|
580
|
+
restore(namespace: string, snapshot: unknown): void;
|
|
561
581
|
publish(input: PublishInput): WebhookMessage;
|
|
562
582
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
563
583
|
setEndpoints(namespace: string, endpoints: WebhookEndpoint[]): WebhookEndpoint[];
|
|
@@ -585,6 +605,8 @@ type ServiceTimelineState = Readonly<{
|
|
|
585
605
|
}>;
|
|
586
606
|
type ServiceCheckpoint = Checkpoint<ServiceTimelineState>;
|
|
587
607
|
type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
608
|
+
/** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
|
|
609
|
+
stop?(): void;
|
|
588
610
|
readonly name: string;
|
|
589
611
|
readonly sqlite: SqliteClient$1;
|
|
590
612
|
readonly clock: Clock;
|
|
@@ -595,6 +617,13 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
595
617
|
readonly credentials: CredentialRegistry;
|
|
596
618
|
/** The webhook hub, when the service has outbound webhooks. */
|
|
597
619
|
readonly webhooks: WebhookHub | undefined;
|
|
620
|
+
/** Enable independent namespace clocks and PRNGs before serving a fleet. */
|
|
621
|
+
isolateNamespaces(): void;
|
|
622
|
+
namespaceClock(namespace?: string): Clock;
|
|
623
|
+
namespaceOf(request: Request): string;
|
|
624
|
+
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
625
|
+
fleetSnapshot(namespace: string): object;
|
|
626
|
+
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
598
627
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
599
628
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
|
|
600
629
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -154,6 +154,15 @@ type FaultCandidate$1 = {
|
|
|
154
154
|
namespace: string;
|
|
155
155
|
};
|
|
156
156
|
type FaultRegistry$1 = {
|
|
157
|
+
isolateNamespaces(): void;
|
|
158
|
+
snapshot(namespace: string): {
|
|
159
|
+
rules: (FaultRule$1 & {
|
|
160
|
+
remaining: number | null;
|
|
161
|
+
hits: number;
|
|
162
|
+
position: number;
|
|
163
|
+
})[];
|
|
164
|
+
rngState: number;
|
|
165
|
+
};
|
|
157
166
|
add(rule: FaultRule$1): FaultRule$1;
|
|
158
167
|
list(): (FaultRule$1 & {
|
|
159
168
|
remaining: number | null;
|
|
@@ -161,6 +170,14 @@ type FaultRegistry$1 = {
|
|
|
161
170
|
})[];
|
|
162
171
|
remove(id: string): boolean;
|
|
163
172
|
clear(): void;
|
|
173
|
+
restore(namespace: string, state: {
|
|
174
|
+
rules: (FaultRule$1 & {
|
|
175
|
+
remaining: number | null;
|
|
176
|
+
hits: number;
|
|
177
|
+
position: number;
|
|
178
|
+
})[];
|
|
179
|
+
rngState: number;
|
|
180
|
+
}): void;
|
|
164
181
|
/**
|
|
165
182
|
* Every fault this request should get, in rule order, stopping at the first that answers
|
|
166
183
|
* or drops (effect-only and delay-only rules let later rules match too). Consumes one of
|
|
@@ -325,8 +342,8 @@ type MetricsReport$1 = {
|
|
|
325
342
|
};
|
|
326
343
|
type Metrics$1 = {
|
|
327
344
|
record(entry: RequestLog$1): void;
|
|
328
|
-
report(): MetricsReport$1;
|
|
329
|
-
reset(): void;
|
|
345
|
+
report(namespace?: string): MetricsReport$1;
|
|
346
|
+
reset(namespace?: string): void;
|
|
330
347
|
};
|
|
331
348
|
|
|
332
349
|
/** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
|
|
@@ -480,6 +497,9 @@ type PublishInput$1 = {
|
|
|
480
497
|
id?: string;
|
|
481
498
|
};
|
|
482
499
|
type WebhookHub$1 = {
|
|
500
|
+
pending(namespace: string): number;
|
|
501
|
+
snapshot(namespace: string): unknown;
|
|
502
|
+
restore(namespace: string, snapshot: unknown): void;
|
|
483
503
|
publish(input: PublishInput$1): WebhookMessage$1;
|
|
484
504
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
485
505
|
setEndpoints(namespace: string, endpoints: WebhookEndpoint$1[]): WebhookEndpoint$1[];
|
|
@@ -507,6 +527,8 @@ type ServiceTimelineState$1 = Readonly<{
|
|
|
507
527
|
}>;
|
|
508
528
|
type ServiceCheckpoint$1 = Checkpoint$1<ServiceTimelineState$1>;
|
|
509
529
|
type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
|
|
530
|
+
/** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
|
|
531
|
+
stop?(): void;
|
|
510
532
|
readonly name: string;
|
|
511
533
|
readonly sqlite: SqliteClient$2;
|
|
512
534
|
readonly clock: Clock$1;
|
|
@@ -517,6 +539,13 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
|
|
|
517
539
|
readonly credentials: CredentialRegistry$1;
|
|
518
540
|
/** The webhook hub, when the service has outbound webhooks. */
|
|
519
541
|
readonly webhooks: WebhookHub$1 | undefined;
|
|
542
|
+
/** Enable independent namespace clocks and PRNGs before serving a fleet. */
|
|
543
|
+
isolateNamespaces(): void;
|
|
544
|
+
namespaceClock(namespace?: string): Clock$1;
|
|
545
|
+
namespaceOf(request: Request): string;
|
|
546
|
+
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
547
|
+
fleetSnapshot(namespace: string): object;
|
|
548
|
+
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
520
549
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
521
550
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule$1>): FaultRule$1[];
|
|
522
551
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
|
@@ -780,6 +809,15 @@ type FaultCandidate = {
|
|
|
780
809
|
namespace: string;
|
|
781
810
|
};
|
|
782
811
|
type FaultRegistry = {
|
|
812
|
+
isolateNamespaces(): void;
|
|
813
|
+
snapshot(namespace: string): {
|
|
814
|
+
rules: (FaultRule & {
|
|
815
|
+
remaining: number | null;
|
|
816
|
+
hits: number;
|
|
817
|
+
position: number;
|
|
818
|
+
})[];
|
|
819
|
+
rngState: number;
|
|
820
|
+
};
|
|
783
821
|
add(rule: FaultRule): FaultRule;
|
|
784
822
|
list(): (FaultRule & {
|
|
785
823
|
remaining: number | null;
|
|
@@ -787,6 +825,14 @@ type FaultRegistry = {
|
|
|
787
825
|
})[];
|
|
788
826
|
remove(id: string): boolean;
|
|
789
827
|
clear(): void;
|
|
828
|
+
restore(namespace: string, state: {
|
|
829
|
+
rules: (FaultRule & {
|
|
830
|
+
remaining: number | null;
|
|
831
|
+
hits: number;
|
|
832
|
+
position: number;
|
|
833
|
+
})[];
|
|
834
|
+
rngState: number;
|
|
835
|
+
}): void;
|
|
790
836
|
/**
|
|
791
837
|
* Every fault this request should get, in rule order, stopping at the first that answers
|
|
792
838
|
* or drops (effect-only and delay-only rules let later rules match too). Consumes one of
|
|
@@ -964,8 +1010,8 @@ type MetricsReport = {
|
|
|
964
1010
|
};
|
|
965
1011
|
type Metrics = {
|
|
966
1012
|
record(entry: RequestLog): void;
|
|
967
|
-
report(): MetricsReport;
|
|
968
|
-
reset(): void;
|
|
1013
|
+
report(namespace?: string): MetricsReport;
|
|
1014
|
+
reset(namespace?: string): void;
|
|
969
1015
|
};
|
|
970
1016
|
|
|
971
1017
|
/** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
|
|
@@ -1131,6 +1177,9 @@ type PublishInput = {
|
|
|
1131
1177
|
id?: string;
|
|
1132
1178
|
};
|
|
1133
1179
|
type WebhookHub = {
|
|
1180
|
+
pending(namespace: string): number;
|
|
1181
|
+
snapshot(namespace: string): unknown;
|
|
1182
|
+
restore(namespace: string, snapshot: unknown): void;
|
|
1134
1183
|
publish(input: PublishInput): WebhookMessage;
|
|
1135
1184
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
1136
1185
|
setEndpoints(namespace: string, endpoints: WebhookEndpoint[]): WebhookEndpoint[];
|
|
@@ -1158,6 +1207,8 @@ type ServiceTimelineState = Readonly<{
|
|
|
1158
1207
|
}>;
|
|
1159
1208
|
type ServiceCheckpoint = Checkpoint<ServiceTimelineState>;
|
|
1160
1209
|
type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
1210
|
+
/** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
|
|
1211
|
+
stop?(): void;
|
|
1161
1212
|
readonly name: string;
|
|
1162
1213
|
readonly sqlite: SqliteClient$1;
|
|
1163
1214
|
readonly clock: Clock;
|
|
@@ -1168,6 +1219,13 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
1168
1219
|
readonly credentials: CredentialRegistry;
|
|
1169
1220
|
/** The webhook hub, when the service has outbound webhooks. */
|
|
1170
1221
|
readonly webhooks: WebhookHub | undefined;
|
|
1222
|
+
/** Enable independent namespace clocks and PRNGs before serving a fleet. */
|
|
1223
|
+
isolateNamespaces(): void;
|
|
1224
|
+
namespaceClock(namespace?: string): Clock;
|
|
1225
|
+
namespaceOf(request: Request): string;
|
|
1226
|
+
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
1227
|
+
fleetSnapshot(namespace: string): object;
|
|
1228
|
+
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
1171
1229
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
1172
1230
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
|
|
1173
1231
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-livekit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Stateful LiveKit mock with Twirp room APIs, JWT grants, participants, data, SIP/egress controls, and signed webhooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|