@crvouga/mockingbird-service-slack 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/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-ZFHCM6E3.js";
7
- import "./chunk-6MIIKZZB.js";
6
+ } from "./chunk-DHAINBRN.js";
7
+ import "./chunk-4JPRLFNZ.js";
8
8
  import "./chunk-6Z2MR3PO.js";
9
9
 
10
10
  // src/cli.ts
package/dist/index.d.ts CHANGED
@@ -691,6 +691,8 @@ type SnapshotDocument = {
691
691
  faults?: unknown;
692
692
  latency?: unknown;
693
693
  virtualTime?: boolean;
694
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
695
+ webhooks?: unknown;
694
696
  };
695
697
  /** Controls for one namespace. */
696
698
  type NamespaceControls = {
@@ -904,6 +906,8 @@ type CredentialRegistry = {
904
906
  }[];
905
907
  };
906
908
 
909
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
910
+
907
911
  /**
908
912
  * A point-in-time copy of everything a service namespace holds.
909
913
  *
@@ -1021,8 +1025,16 @@ type PublishInput = {
1021
1025
  id?: string;
1022
1026
  };
1023
1027
  type WebhookHub = {
1028
+ observeDeliveries(listener: (event: {
1029
+ namespace: string;
1030
+ state: string;
1031
+ deliveryId: string;
1032
+ }) => void): () => void;
1033
+ setTransportPolicy(policy: OwnedTransport): void;
1024
1034
  pending(namespace: string): number;
1025
1035
  snapshot(namespace: string): unknown;
1036
+ exportSnapshot(handle: unknown): unknown;
1037
+ importSnapshot(namespace: string, document: unknown): unknown;
1026
1038
  restore(namespace: string, snapshot: unknown): void;
1027
1039
  publish(input: PublishInput): WebhookMessage;
1028
1040
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1035,7 +1047,7 @@ type WebhookHub = {
1035
1047
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1036
1048
  flush(): Promise<void>;
1037
1049
  /** Resolve once nothing is in flight. */
1038
- idle(): Promise<void>;
1050
+ idle(namespace?: string): Promise<void>;
1039
1051
  fault(namespace: string, fault: WebhookFault): void;
1040
1052
  clear(namespace?: string): void;
1041
1053
  };
@@ -1079,6 +1091,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1079
1091
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1080
1092
  fleetSnapshot(namespace: string): object;
1081
1093
  fleetRestore(snapshot: unknown, namespace: string): void;
1094
+ fleetExport(snapshot: unknown): SnapshotDocument;
1095
+ fleetImport(namespace: string, document: unknown): object;
1082
1096
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1083
1097
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1084
1098
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  operationIds,
12
12
  slackCredential,
13
13
  supportedOperationIds
14
- } from "./chunk-6MIIKZZB.js";
14
+ } from "./chunk-4JPRLFNZ.js";
15
15
  import "./chunk-6Z2MR3PO.js";
16
16
  export {
17
17
  DEFAULT_CHANNELS,
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. */
@@ -1435,6 +1450,8 @@ type SnapshotDocument = {
1435
1450
  faults?: unknown;
1436
1451
  latency?: unknown;
1437
1452
  virtualTime?: boolean;
1453
+ /** Quiescent webhook endpoints, delivery history and fault state. Contains private configuration. */
1454
+ webhooks?: unknown;
1438
1455
  };
1439
1456
  /** Controls for one namespace. */
1440
1457
  type NamespaceControls = {
@@ -1648,6 +1665,8 @@ type CredentialRegistry = {
1648
1665
  }[];
1649
1666
  };
1650
1667
 
1668
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
1669
+
1651
1670
  /**
1652
1671
  * A point-in-time copy of everything a service namespace holds.
1653
1672
  *
@@ -1765,8 +1784,16 @@ type PublishInput = {
1765
1784
  id?: string;
1766
1785
  };
1767
1786
  type WebhookHub = {
1787
+ observeDeliveries(listener: (event: {
1788
+ namespace: string;
1789
+ state: string;
1790
+ deliveryId: string;
1791
+ }) => void): () => void;
1792
+ setTransportPolicy(policy: OwnedTransport): void;
1768
1793
  pending(namespace: string): number;
1769
1794
  snapshot(namespace: string): unknown;
1795
+ exportSnapshot(handle: unknown): unknown;
1796
+ importSnapshot(namespace: string, document: unknown): unknown;
1770
1797
  restore(namespace: string, snapshot: unknown): void;
1771
1798
  publish(input: PublishInput): WebhookMessage;
1772
1799
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
@@ -1779,7 +1806,7 @@ type WebhookHub = {
1779
1806
  /** Run every pending retry (and release held reordered messages) now, and every retry those attempts schedule, until nothing is pending. */
1780
1807
  flush(): Promise<void>;
1781
1808
  /** Resolve once nothing is in flight. */
1782
- idle(): Promise<void>;
1809
+ idle(namespace?: string): Promise<void>;
1783
1810
  fault(namespace: string, fault: WebhookFault): void;
1784
1811
  clear(namespace?: string): void;
1785
1812
  };
@@ -1823,6 +1850,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
1823
1850
  /** Opaque in-process checkpoint including records, controls and webhook history. */
1824
1851
  fleetSnapshot(namespace: string): object;
1825
1852
  fleetRestore(snapshot: unknown, namespace: string): void;
1853
+ fleetExport(snapshot: unknown): SnapshotDocument;
1854
+ fleetImport(namespace: string, document: unknown): object;
1826
1855
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1827
1856
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1828
1857
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  createServer,
4
4
  serveTarget
5
- } from "./chunk-ZFHCM6E3.js";
6
- import "./chunk-6MIIKZZB.js";
5
+ } from "./chunk-DHAINBRN.js";
6
+ import "./chunk-4JPRLFNZ.js";
7
7
  import "./chunk-6Z2MR3PO.js";
8
8
  export {
9
9
  DEFAULT_PORT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-slack",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Stateful emulator of Slack incoming webhooks, the Web API, and the Socket Mode control plane, with an outbox of every alert the app sent.",
5
5
  "license": "MIT",
6
6
  "type": "module",