swarm-mail 1.4.0 → 1.5.1
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/adapter.d.ts.map +1 -1
- package/dist/analytics.d.ts +46 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/db/retry.d.ts +24 -0
- package/dist/db/retry.d.ts.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90594 -90208
- package/dist/libsql.convenience.d.ts.map +1 -1
- package/dist/libsql.d.ts.map +1 -1
- package/dist/migrate-pglite-to-libsql.d.ts +3 -0
- package/dist/migrate-pglite-to-libsql.d.ts.map +1 -1
- package/dist/pglite.d.ts +53 -6
- package/dist/pglite.d.ts.map +1 -1
- package/dist/streams/durable-adapter.d.ts +86 -0
- package/dist/streams/durable-adapter.d.ts.map +1 -0
- package/dist/streams/durable-server.d.ts +57 -0
- package/dist/streams/durable-server.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsql.convenience.d.ts","sourceRoot":"","sources":["../src/libsql.convenience.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAUH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"libsql.convenience.d.ts","sourceRoot":"","sources":["../src/libsql.convenience.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAUH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAU3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAajE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAa5D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAyB3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAS3B;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAW7D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAO3D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAiB5C"}
|
package/dist/libsql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsql.d.ts","sourceRoot":"","sources":["../src/libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAA;CAAE,CAuFhD;AAmGD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"libsql.d.ts","sourceRoot":"","sources":["../src/libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAA;CAAE,CAuFhD;AAmGD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,eAAe,CAAC,CA8B1B"}
|
|
@@ -68,6 +68,9 @@ export interface MigrationResult {
|
|
|
68
68
|
export declare function pgliteExists(path: string): boolean;
|
|
69
69
|
/**
|
|
70
70
|
* Migrate all data from PGlite to libSQL
|
|
71
|
+
*
|
|
72
|
+
* @deprecated This is the last version supporting PGlite migration.
|
|
73
|
+
* PGlite support will be removed in the next major version.
|
|
71
74
|
*/
|
|
72
75
|
export declare function migratePGliteToLibSQL(options: MigrationOptions): Promise<MigrationResult>;
|
|
73
76
|
//# sourceMappingURL=migrate-pglite-to-libsql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-pglite-to-libsql.d.ts","sourceRoot":"","sources":["../src/migrate-pglite-to-libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"migrate-pglite-to-libsql.d.ts","sourceRoot":"","sources":["../src/migrate-pglite-to-libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlD;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CA+E1B"}
|
package/dist/pglite.d.ts
CHANGED
|
@@ -1,16 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* PGlite Adapter (DEPRECATED)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* This module provides backward compatibility for PGlite databases.
|
|
5
|
+
* It wraps PGlite instances as DatabaseAdapter and warns about deprecation.
|
|
6
6
|
*
|
|
7
|
-
* @deprecated
|
|
7
|
+
* @deprecated This entire module will be removed in the next major version.
|
|
8
|
+
* Migrate to libSQL using migratePGliteToLibSQL().
|
|
9
|
+
*
|
|
10
|
+
* @module pglite
|
|
8
11
|
*/
|
|
9
12
|
import type { DatabaseAdapter } from "./types/database.js";
|
|
13
|
+
/**
|
|
14
|
+
* Reset deprecation flag (for testing only)
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function _resetDeprecationFlag(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Warn about PGlite deprecation (once per session)
|
|
20
|
+
*
|
|
21
|
+
* Logs a deprecation warning to console.warn() on first call.
|
|
22
|
+
* Subsequent calls are silent to avoid log spam.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { warnPGliteDeprecation } from 'swarm-mail';
|
|
27
|
+
*
|
|
28
|
+
* warnPGliteDeprecation(); // Warns
|
|
29
|
+
* warnPGliteDeprecation(); // Silent
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function warnPGliteDeprecation(): void;
|
|
10
33
|
/**
|
|
11
34
|
* Wrap a PGlite instance as a DatabaseAdapter
|
|
12
35
|
*
|
|
13
|
-
*
|
|
36
|
+
* Provides a DatabaseAdapter interface around a PGlite instance.
|
|
37
|
+
* Warns about deprecation on first call.
|
|
38
|
+
*
|
|
39
|
+
* @param pglite - PGlite database instance
|
|
40
|
+
* @returns DatabaseAdapter wrapping the PGlite instance
|
|
41
|
+
*
|
|
42
|
+
* @deprecated Use libSQL via createLibSQLAdapter() instead.
|
|
43
|
+
* This function will be removed in the next major version.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { PGlite } from '@electric-sql/pglite';
|
|
48
|
+
* import { wrapPGlite } from 'swarm-mail';
|
|
49
|
+
*
|
|
50
|
+
* const pglite = await PGlite.create({ dataDir: './data' });
|
|
51
|
+
* const adapter = wrapPGlite(pglite);
|
|
52
|
+
*
|
|
53
|
+
* await adapter.query('SELECT * FROM users');
|
|
54
|
+
* ```
|
|
14
55
|
*/
|
|
15
|
-
export declare function wrapPGlite(pglite:
|
|
56
|
+
export declare function wrapPGlite(pglite: {
|
|
57
|
+
query: (sql: string, params?: unknown[]) => Promise<{
|
|
58
|
+
rows: unknown[];
|
|
59
|
+
}>;
|
|
60
|
+
exec: (sql: string) => Promise<void>;
|
|
61
|
+
close: () => Promise<void>;
|
|
62
|
+
}): DatabaseAdapter;
|
|
16
63
|
//# sourceMappingURL=pglite.d.ts.map
|
package/dist/pglite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../src/pglite.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../src/pglite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAQ3D;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAO5C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAClC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC,CAAC;IACzE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,GAAG,eAAe,CAkBlB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable Streams Adapter
|
|
3
|
+
*
|
|
4
|
+
* Adapts swarm-mail event store to the Durable Streams protocol.
|
|
5
|
+
*
|
|
6
|
+
* Protocol: https://github.com/durable-streams/durable-streams
|
|
7
|
+
*
|
|
8
|
+
* Key features:
|
|
9
|
+
* - Offset-based resumability (refresh-safe, multi-device, multi-tab)
|
|
10
|
+
* - Long-poll and SSE modes for live tailing
|
|
11
|
+
* - Catch-up reads from any offset
|
|
12
|
+
* - CDN-friendly design for massive fan-out
|
|
13
|
+
*
|
|
14
|
+
* @see .hive/analysis/hive-cell-visualizer.md for full architecture
|
|
15
|
+
*/
|
|
16
|
+
import type { SwarmMailAdapter } from "../types/adapter.js";
|
|
17
|
+
/**
|
|
18
|
+
* StreamEvent format for Durable Streams protocol
|
|
19
|
+
*/
|
|
20
|
+
export interface StreamEvent {
|
|
21
|
+
/** Event sequence number (serves as offset for resumability) */
|
|
22
|
+
offset: number;
|
|
23
|
+
/** JSON-encoded AgentEvent */
|
|
24
|
+
data: string;
|
|
25
|
+
/** Unix timestamp in milliseconds */
|
|
26
|
+
timestamp: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* DurableStreamAdapter interface
|
|
30
|
+
*
|
|
31
|
+
* Provides offset-based access to the swarm-mail event store.
|
|
32
|
+
* Compatible with Durable Streams protocol.
|
|
33
|
+
*/
|
|
34
|
+
export interface DurableStreamAdapter {
|
|
35
|
+
/**
|
|
36
|
+
* Read events starting from offset
|
|
37
|
+
*
|
|
38
|
+
* @param offset - Start reading AFTER this sequence number (0 = from beginning)
|
|
39
|
+
* @param limit - Maximum number of events to return
|
|
40
|
+
* @returns Array of StreamEvents
|
|
41
|
+
*/
|
|
42
|
+
read(offset: number, limit: number): Promise<StreamEvent[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Get the latest sequence number
|
|
45
|
+
*
|
|
46
|
+
* @returns Latest sequence number (0 if no events)
|
|
47
|
+
*/
|
|
48
|
+
head(): Promise<number>;
|
|
49
|
+
/**
|
|
50
|
+
* Subscribe to new events (polling-based)
|
|
51
|
+
*
|
|
52
|
+
* Polls every 100ms for new events and calls callback.
|
|
53
|
+
* Only delivers events that arrive AFTER subscription starts.
|
|
54
|
+
*
|
|
55
|
+
* @param callback - Called with each new event
|
|
56
|
+
* @param startOffset - Optional offset to start from (avoids async race)
|
|
57
|
+
* @returns Unsubscribe function
|
|
58
|
+
*/
|
|
59
|
+
subscribe(callback: (event: StreamEvent) => void, startOffset?: number): () => void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create a DurableStreamAdapter for a specific project
|
|
63
|
+
*
|
|
64
|
+
* @param swarmMail - SwarmMailAdapter instance
|
|
65
|
+
* @param projectKey - Project key to filter events by
|
|
66
|
+
* @returns DurableStreamAdapter instance
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const swarmMail = await createInMemorySwarmMailLibSQL("test");
|
|
71
|
+
* const adapter = createDurableStreamAdapter(swarmMail, "/path/to/project");
|
|
72
|
+
*
|
|
73
|
+
* // Read events from beginning
|
|
74
|
+
* const events = await adapter.read(0, 100);
|
|
75
|
+
*
|
|
76
|
+
* // Get latest sequence
|
|
77
|
+
* const head = await adapter.head();
|
|
78
|
+
*
|
|
79
|
+
* // Subscribe to new events
|
|
80
|
+
* const unsubscribe = adapter.subscribe((event) => {
|
|
81
|
+
* console.log("New event:", event);
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function createDurableStreamAdapter(swarmMail: SwarmMailAdapter, projectKey: string): DurableStreamAdapter;
|
|
86
|
+
//# sourceMappingURL=durable-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-adapter.d.ts","sourceRoot":"","sources":["../../src/streams/durable-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAE5D;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExB;;;;;;;;;OASG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC;CACrF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,gBAAgB,EAC3B,UAAU,EAAE,MAAM,GACjB,oBAAoB,CA0EtB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable Streams HTTP Server
|
|
3
|
+
*
|
|
4
|
+
* Exposes the Durable Streams protocol via Server-Sent Events (SSE).
|
|
5
|
+
* Built with Bun.serve() for HTTP server.
|
|
6
|
+
*
|
|
7
|
+
* Port 4483 = HIVE on phone keypad
|
|
8
|
+
*
|
|
9
|
+
* ## Endpoints
|
|
10
|
+
*
|
|
11
|
+
* GET /streams/:projectKey?offset=N&live=true
|
|
12
|
+
* - offset: Start reading from this sequence (default 0)
|
|
13
|
+
* - live: If true, keep connection open and stream new events via SSE
|
|
14
|
+
*
|
|
15
|
+
* ## SSE Format
|
|
16
|
+
*
|
|
17
|
+
* data: {json}\n\n
|
|
18
|
+
*
|
|
19
|
+
* Each event is sent as a JSON-encoded StreamEvent:
|
|
20
|
+
* { offset: number, data: string, timestamp: number }
|
|
21
|
+
*/
|
|
22
|
+
import type { DurableStreamAdapter } from "./durable-adapter.js";
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for the Durable Stream HTTP server
|
|
25
|
+
*/
|
|
26
|
+
export interface DurableStreamServerConfig {
|
|
27
|
+
/** Adapter for reading events (single project) */
|
|
28
|
+
adapter: DurableStreamAdapter;
|
|
29
|
+
/** Port to listen on (default 4483 - HIVE on phone keypad) */
|
|
30
|
+
port?: number;
|
|
31
|
+
/** Optional project key (for URL matching, defaults to "*" = any) */
|
|
32
|
+
projectKey?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Durable Stream HTTP server interface
|
|
36
|
+
*/
|
|
37
|
+
export interface DurableStreamServer {
|
|
38
|
+
/** Start the HTTP server */
|
|
39
|
+
start(): Promise<void>;
|
|
40
|
+
/** Stop the HTTP server and clean up subscriptions */
|
|
41
|
+
stop(): Promise<void>;
|
|
42
|
+
/** Base URL of the server */
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates a Durable Streams HTTP server exposing events via SSE
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const adapter = createDurableStreamAdapter(swarmMail, "/my/project");
|
|
51
|
+
* const server = createDurableStreamServer({ adapter });
|
|
52
|
+
* await server.start();
|
|
53
|
+
* console.log(`Streaming at ${server.url}/streams/my-project`);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function createDurableStreamServer(config: DurableStreamServerConfig): DurableStreamServer;
|
|
57
|
+
//# sourceMappingURL=durable-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-server.d.ts","sourceRoot":"","sources":["../../src/streams/durable-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAe,MAAM,sBAAsB,CAAC;AAK9E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,sDAAsD;IACtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,yBAAyB,GAChC,mBAAmB,CA+JrB"}
|