@crvouga/mockingbird-service-aha 3.3.0 → 3.4.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 +12 -4
- package/dist/{chunk-Z5MOBI2J.js → chunk-J25NCC75.js} +203 -22
- package/dist/chunk-J25NCC75.js.map +7 -0
- package/dist/chunk-N2VUOIXE.js +4810 -0
- package/dist/chunk-N2VUOIXE.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +15 -1
- package/dist/index.js +1 -1
- package/dist/server.d.ts +31 -2
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-NUFOMXBF.js +0 -1002
- package/dist/chunk-NUFOMXBF.js.map +0 -7
- package/dist/chunk-Z5MOBI2J.js.map +0 -7
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -534,6 +534,8 @@ type SnapshotDocument = {
|
|
|
534
534
|
faults?: unknown;
|
|
535
535
|
latency?: unknown;
|
|
536
536
|
virtualTime?: boolean;
|
|
537
|
+
/** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
|
|
538
|
+
webhooks?: unknown;
|
|
537
539
|
};
|
|
538
540
|
/** Controls for one namespace. */
|
|
539
541
|
type NamespaceControls = {
|
|
@@ -765,6 +767,8 @@ declare class IdempotencyStore {
|
|
|
765
767
|
run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number) => boolean): Promise<Response>;
|
|
766
768
|
}
|
|
767
769
|
|
|
770
|
+
type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
|
|
771
|
+
|
|
768
772
|
/**
|
|
769
773
|
* A point-in-time copy of everything a service namespace holds.
|
|
770
774
|
*
|
|
@@ -882,8 +886,16 @@ type PublishInput = {
|
|
|
882
886
|
id?: string;
|
|
883
887
|
};
|
|
884
888
|
type WebhookHub = {
|
|
889
|
+
observeDeliveries(listener: (event: {
|
|
890
|
+
namespace: string;
|
|
891
|
+
state: string;
|
|
892
|
+
deliveryId: string;
|
|
893
|
+
}) => void): () => void;
|
|
894
|
+
setTransportPolicy(policy: OwnedTransport): void;
|
|
885
895
|
pending(namespace: string): number;
|
|
886
896
|
snapshot(namespace: string): unknown;
|
|
897
|
+
exportSnapshot(handle: unknown): unknown;
|
|
898
|
+
importSnapshot(namespace: string, document: unknown): unknown;
|
|
887
899
|
restore(namespace: string, snapshot: unknown): void;
|
|
888
900
|
publish(input: PublishInput): WebhookMessage;
|
|
889
901
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
@@ -896,7 +908,7 @@ type WebhookHub = {
|
|
|
896
908
|
/** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
|
|
897
909
|
flush(): Promise<void>;
|
|
898
910
|
/** Resolve once nothing is in flight. */
|
|
899
|
-
idle(): Promise<void>;
|
|
911
|
+
idle(namespace?: string): Promise<void>;
|
|
900
912
|
fault(namespace: string, fault: WebhookFault): void;
|
|
901
913
|
clear(namespace?: string): void;
|
|
902
914
|
};
|
|
@@ -940,6 +952,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
940
952
|
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
941
953
|
fleetSnapshot(namespace: string): object;
|
|
942
954
|
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
955
|
+
fleetExport(snapshot: unknown): SnapshotDocument;
|
|
956
|
+
fleetImport(namespace: string, document: unknown): object;
|
|
943
957
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
944
958
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
|
|
945
959
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -445,6 +445,8 @@ type SnapshotDocument$1 = {
|
|
|
445
445
|
faults?: unknown;
|
|
446
446
|
latency?: unknown;
|
|
447
447
|
virtualTime?: boolean;
|
|
448
|
+
/** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
|
|
449
|
+
webhooks?: unknown;
|
|
448
450
|
};
|
|
449
451
|
/** Controls for one namespace. */
|
|
450
452
|
type NamespaceControls$1 = {
|
|
@@ -658,6 +660,8 @@ type CredentialRegistry$1 = {
|
|
|
658
660
|
}[];
|
|
659
661
|
};
|
|
660
662
|
|
|
663
|
+
type OwnedTransport$1 = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
|
|
664
|
+
|
|
661
665
|
/**
|
|
662
666
|
* A point-in-time copy of everything a service namespace holds.
|
|
663
667
|
*
|
|
@@ -775,8 +779,16 @@ type PublishInput$1 = {
|
|
|
775
779
|
id?: string;
|
|
776
780
|
};
|
|
777
781
|
type WebhookHub$1 = {
|
|
782
|
+
observeDeliveries(listener: (event: {
|
|
783
|
+
namespace: string;
|
|
784
|
+
state: string;
|
|
785
|
+
deliveryId: string;
|
|
786
|
+
}) => void): () => void;
|
|
787
|
+
setTransportPolicy(policy: OwnedTransport$1): void;
|
|
778
788
|
pending(namespace: string): number;
|
|
779
789
|
snapshot(namespace: string): unknown;
|
|
790
|
+
exportSnapshot(handle: unknown): unknown;
|
|
791
|
+
importSnapshot(namespace: string, document: unknown): unknown;
|
|
780
792
|
restore(namespace: string, snapshot: unknown): void;
|
|
781
793
|
publish(input: PublishInput$1): WebhookMessage$1;
|
|
782
794
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
@@ -789,7 +801,7 @@ type WebhookHub$1 = {
|
|
|
789
801
|
/** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
|
|
790
802
|
flush(): Promise<void>;
|
|
791
803
|
/** Resolve once nothing is in flight. */
|
|
792
|
-
idle(): Promise<void>;
|
|
804
|
+
idle(namespace?: string): Promise<void>;
|
|
793
805
|
fault(namespace: string, fault: WebhookFault$1): void;
|
|
794
806
|
clear(namespace?: string): void;
|
|
795
807
|
};
|
|
@@ -833,6 +845,8 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$2 & {
|
|
|
833
845
|
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
834
846
|
fleetSnapshot(namespace: string): object;
|
|
835
847
|
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
848
|
+
fleetExport(snapshot: unknown): SnapshotDocument$1;
|
|
849
|
+
fleetImport(namespace: string, document: unknown): object;
|
|
836
850
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
837
851
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule$1>): FaultRule$1[];
|
|
838
852
|
/** The instance behind `namespace` (the default one when omitted), created on first use. */
|
|
@@ -925,6 +939,7 @@ type CommonServeOptions = {
|
|
|
925
939
|
* `serveTarget`, which is also how `serve --config` finds services by name.
|
|
926
940
|
*/
|
|
927
941
|
type ServeTarget = {
|
|
942
|
+
packageVersion?: string;
|
|
928
943
|
name: string;
|
|
929
944
|
defaultPort: number;
|
|
930
945
|
/** Serve flags beyond the common ones. */
|
|
@@ -1447,6 +1462,8 @@ type SnapshotDocument = {
|
|
|
1447
1462
|
faults?: unknown;
|
|
1448
1463
|
latency?: unknown;
|
|
1449
1464
|
virtualTime?: boolean;
|
|
1465
|
+
/** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
|
|
1466
|
+
webhooks?: unknown;
|
|
1450
1467
|
};
|
|
1451
1468
|
/** Controls for one namespace. */
|
|
1452
1469
|
type NamespaceControls = {
|
|
@@ -1678,6 +1695,8 @@ declare class IdempotencyStore {
|
|
|
1678
1695
|
run(key: string, fingerprint: string, errors: IdempotencyErrors, handler: () => Promise<Response> | Response, replayable?: (status: number) => boolean): Promise<Response>;
|
|
1679
1696
|
}
|
|
1680
1697
|
|
|
1698
|
+
type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
|
|
1699
|
+
|
|
1681
1700
|
/**
|
|
1682
1701
|
* A point-in-time copy of everything a service namespace holds.
|
|
1683
1702
|
*
|
|
@@ -1795,8 +1814,16 @@ type PublishInput = {
|
|
|
1795
1814
|
id?: string;
|
|
1796
1815
|
};
|
|
1797
1816
|
type WebhookHub = {
|
|
1817
|
+
observeDeliveries(listener: (event: {
|
|
1818
|
+
namespace: string;
|
|
1819
|
+
state: string;
|
|
1820
|
+
deliveryId: string;
|
|
1821
|
+
}) => void): () => void;
|
|
1822
|
+
setTransportPolicy(policy: OwnedTransport): void;
|
|
1798
1823
|
pending(namespace: string): number;
|
|
1799
1824
|
snapshot(namespace: string): unknown;
|
|
1825
|
+
exportSnapshot(handle: unknown): unknown;
|
|
1826
|
+
importSnapshot(namespace: string, document: unknown): unknown;
|
|
1800
1827
|
restore(namespace: string, snapshot: unknown): void;
|
|
1801
1828
|
publish(input: PublishInput): WebhookMessage;
|
|
1802
1829
|
/** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
|
|
@@ -1809,7 +1836,7 @@ type WebhookHub = {
|
|
|
1809
1836
|
/** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
|
|
1810
1837
|
flush(): Promise<void>;
|
|
1811
1838
|
/** Resolve once nothing is in flight. */
|
|
1812
|
-
idle(): Promise<void>;
|
|
1839
|
+
idle(namespace?: string): Promise<void>;
|
|
1813
1840
|
fault(namespace: string, fault: WebhookFault): void;
|
|
1814
1841
|
clear(namespace?: string): void;
|
|
1815
1842
|
};
|
|
@@ -1853,6 +1880,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
|
|
|
1853
1880
|
/** Opaque in-process checkpoint including records, controls and webhook history. */
|
|
1854
1881
|
fleetSnapshot(namespace: string): object;
|
|
1855
1882
|
fleetRestore(snapshot: unknown, namespace: string): void;
|
|
1883
|
+
fleetExport(snapshot: unknown): SnapshotDocument;
|
|
1884
|
+
fleetImport(namespace: string, document: unknown): object;
|
|
1856
1885
|
/** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
|
|
1857
1886
|
applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
|
|
1858
1887
|
/** 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-aha",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Stateful AHA phlebotomy emulator with signed HTTP orders, status webhooks, and a real deterministic SSH/SFTP result server.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|