serverless-ircd 0.3.0 → 0.5.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/.github/workflows/ci.yml +2 -2
- package/.github/workflows/deploy-aws.yml +1 -3
- package/.github/workflows/deploy-cf-tcp.yml +87 -0
- package/.github/workflows/deploy-cf.yml +1 -1
- package/.node-version +1 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +349 -18
- package/README.md +132 -30
- package/apps/aws-stack/README.md +6 -5
- package/apps/aws-stack/bin/aws.ts +7 -0
- package/apps/aws-stack/package.json +4 -4
- package/apps/aws-stack/src/aws-stack.ts +150 -10
- package/apps/aws-stack/tests/stack.test.ts +145 -4
- package/apps/cf-tcp-container/Dockerfile +69 -0
- package/apps/cf-tcp-container/package.json +34 -0
- package/apps/cf-tcp-container/src/config-loader.ts +145 -0
- package/apps/cf-tcp-container/src/container-do.ts +38 -0
- package/apps/cf-tcp-container/src/container-server.ts +363 -0
- package/apps/cf-tcp-container/src/main.ts +77 -0
- package/apps/cf-tcp-container/src/persistence.ts +144 -0
- package/apps/cf-tcp-container/src/worker.ts +41 -0
- package/apps/cf-tcp-container/terraform/provider.tf +24 -0
- package/apps/cf-tcp-container/terraform/spectrum.tf +81 -0
- package/apps/cf-tcp-container/tests/config-loader.test.ts +217 -0
- package/apps/cf-tcp-container/tests/container-server.test.ts +465 -0
- package/apps/cf-tcp-container/tests/persistence.test.ts +227 -0
- package/apps/cf-tcp-container/tests/tls-e2e.test.ts +275 -0
- package/apps/cf-tcp-container/tsconfig.build.json +17 -0
- package/apps/cf-tcp-container/tsconfig.test.json +15 -0
- package/apps/cf-tcp-container/vitest.config.ts +26 -0
- package/apps/cf-tcp-container/wrangler.toml +63 -0
- package/apps/cf-worker/package.json +1 -1
- package/apps/cf-worker/wrangler.test.toml +6 -0
- package/apps/cf-worker/wrangler.toml +28 -2
- package/apps/local-cli/package.json +1 -1
- package/apps/local-cli/src/config-loader.ts +10 -0
- package/apps/local-cli/src/server.ts +149 -24
- package/apps/local-cli/tests/e2e.test.ts +1 -1
- package/apps/local-cli/tests/ws-subprotocol.test.ts +257 -0
- package/package.json +14 -10
- package/packages/aws-adapter/package.json +3 -3
- package/packages/aws-adapter/src/account-store.ts +1 -1
- package/packages/aws-adapter/src/admission.ts +74 -0
- package/packages/aws-adapter/src/aws-runtime.ts +75 -4
- package/packages/aws-adapter/src/config-loader.ts +32 -0
- package/packages/aws-adapter/src/dynamo-account-store.ts +35 -96
- package/packages/aws-adapter/src/handlers/connect.ts +96 -9
- package/packages/aws-adapter/src/handlers/default.ts +98 -7
- package/packages/aws-adapter/src/handlers/index.ts +109 -4
- package/packages/aws-adapter/src/handlers/nlb-stream.ts +490 -0
- package/packages/aws-adapter/src/handlers/ping-checker.ts +1 -1
- package/packages/aws-adapter/src/index.ts +8 -0
- package/packages/aws-adapter/src/serialize.ts +11 -1
- package/packages/aws-adapter/src/stats.ts +80 -0
- package/packages/aws-adapter/tests/account-store-dynamo.test.ts +45 -34
- package/packages/aws-adapter/tests/account-store.test.ts +19 -20
- package/packages/aws-adapter/tests/admission.test.ts +70 -0
- package/packages/aws-adapter/tests/aws-harness.ts +13 -1
- package/packages/aws-adapter/tests/aws-integration.test.ts +1 -1
- package/packages/aws-adapter/tests/aws-runtime.test.ts +61 -0
- package/packages/aws-adapter/tests/config-loader.test.ts +20 -0
- package/packages/aws-adapter/tests/connect.test.ts +174 -0
- package/packages/aws-adapter/tests/disconnect-fanout.test.ts +47 -40
- package/packages/aws-adapter/tests/gone-exception.test.ts +31 -26
- package/packages/aws-adapter/tests/handlers.test.ts +302 -53
- package/packages/aws-adapter/tests/nlb-stream.test.ts +480 -0
- package/packages/aws-adapter/tests/ping-checker.test.ts +34 -29
- package/packages/aws-adapter/tests/stats.test.ts +317 -0
- package/packages/aws-adapter/tests/sweeper.test.ts +25 -18
- package/packages/aws-adapter/tests/transactions.test.ts +25 -20
- package/packages/cf-adapter/package.json +5 -1
- package/packages/cf-adapter/src/cf-runtime.ts +68 -5
- package/packages/cf-adapter/src/channel-do.ts +2 -2
- package/packages/cf-adapter/src/config-loader.ts +33 -0
- package/packages/cf-adapter/src/connection-do.ts +278 -85
- package/packages/cf-adapter/src/d1-account-store.ts +198 -0
- package/packages/cf-adapter/src/env.ts +54 -11
- package/packages/cf-adapter/src/index.ts +11 -8
- package/packages/cf-adapter/src/registry-do.ts +22 -3
- package/packages/cf-adapter/src/sharding.ts +1 -2
- package/packages/cf-adapter/src/stats.ts +65 -0
- package/packages/cf-adapter/tests/cf-harness.ts +12 -2
- package/packages/cf-adapter/tests/cf-integration.test.ts +6 -5
- package/packages/cf-adapter/tests/cf-runtime.test.ts +38 -2
- package/packages/cf-adapter/tests/channel-do.test.ts +2 -2
- package/packages/cf-adapter/tests/config-loader.test.ts +22 -0
- package/packages/cf-adapter/tests/connection-do-channel-registration.test.ts +37 -0
- package/packages/cf-adapter/tests/connection-do-no-batching-reservation.test.ts +52 -0
- package/packages/cf-adapter/tests/connection-do-sasl-d1.test.ts +166 -0
- package/packages/cf-adapter/tests/connection-do-ws-spec-contract.test.ts +289 -0
- package/packages/cf-adapter/tests/connection-do-ws-subprotocol.test.ts +184 -0
- package/packages/cf-adapter/tests/connection-do.test.ts +27 -2
- package/packages/cf-adapter/tests/d1-account-store.test.ts +226 -0
- package/packages/cf-adapter/tests/raw-modules.d.ts +11 -0
- package/packages/cf-adapter/tests/registry-do.test.ts +4 -4
- package/packages/cf-adapter/tests/sharding.test.ts +1 -1
- package/packages/cf-adapter/tests/stats.test.ts +120 -0
- package/packages/cf-adapter/tests/worker/main.ts +15 -8
- package/packages/cf-adapter/tests/worker/stubs/channel-stub.ts +2 -2
- package/packages/cf-adapter/tests/worker/stubs/registry-stub.ts +8 -2
- package/packages/cf-adapter/wrangler.test.toml +15 -0
- package/packages/in-memory-runtime/package.json +1 -1
- package/packages/in-memory-runtime/src/in-memory-runtime.ts +39 -0
- package/packages/in-memory-runtime/tests/in-memory-runtime.test.ts +259 -0
- package/packages/irc-core/package.json +6 -1
- package/packages/irc-core/scripts/generate-build-info.mjs +31 -0
- package/packages/irc-core/src/admission.ts +16 -15
- package/packages/irc-core/src/caps/capabilities.ts +24 -3
- package/packages/irc-core/src/cloak.ts +1 -1
- package/packages/irc-core/src/commands/cap.ts +8 -1
- package/packages/irc-core/src/commands/index.ts +17 -0
- package/packages/irc-core/src/commands/invite.ts +2 -4
- package/packages/irc-core/src/commands/ison.ts +61 -0
- package/packages/irc-core/src/commands/isupport.ts +6 -2
- package/packages/irc-core/src/commands/kick.ts +2 -4
- package/packages/irc-core/src/commands/kill.ts +127 -0
- package/packages/irc-core/src/commands/list.ts +1 -1
- package/packages/irc-core/src/commands/lusers.ts +204 -0
- package/packages/irc-core/src/commands/mode.ts +4 -8
- package/packages/irc-core/src/commands/names.ts +3 -5
- package/packages/irc-core/src/commands/part.ts +2 -4
- package/packages/irc-core/src/commands/quit.ts +12 -0
- package/packages/irc-core/src/commands/registration.ts +18 -12
- package/packages/irc-core/src/commands/rehash.ts +119 -0
- package/packages/irc-core/src/commands/sasl.ts +72 -9
- package/packages/irc-core/src/commands/server-info.ts +129 -0
- package/packages/irc-core/src/commands/setname.ts +109 -0
- package/packages/irc-core/src/commands/stats.ts +152 -0
- package/packages/irc-core/src/commands/topic.ts +2 -4
- package/packages/irc-core/src/commands/trace.ts +137 -0
- package/packages/irc-core/src/commands/userhost.ts +84 -0
- package/packages/irc-core/src/commands/wallops.ts +118 -0
- package/packages/irc-core/src/commands/whowas.ts +113 -0
- package/packages/irc-core/src/config.ts +65 -0
- package/packages/irc-core/src/credential-hashing.ts +124 -0
- package/packages/irc-core/src/effects.ts +33 -30
- package/packages/irc-core/src/index.ts +3 -0
- package/packages/irc-core/src/ports.ts +360 -12
- package/packages/irc-core/src/protocol/numerics.ts +48 -11
- package/packages/irc-core/src/protocol/outbound.ts +20 -3
- package/packages/irc-core/src/types.ts +46 -2
- package/packages/irc-core/src/ws-framing.ts +132 -0
- package/packages/irc-core/src/ws-subprotocol.ts +66 -0
- package/packages/irc-core/tests/account-store.test.ts +45 -2
- package/packages/irc-core/tests/admission.test.ts +18 -0
- package/packages/irc-core/tests/caps/capabilities.test.ts +4 -3
- package/packages/irc-core/tests/commands/cap.test.ts +33 -1
- package/packages/irc-core/tests/commands/ison.test.ts +166 -0
- package/packages/irc-core/tests/commands/kill.test.ts +243 -0
- package/packages/irc-core/tests/commands/lusers.test.ts +368 -0
- package/packages/irc-core/tests/commands/mode.test.ts +57 -0
- package/packages/irc-core/tests/commands/quit.test.ts +69 -2
- package/packages/irc-core/tests/commands/registration.test.ts +151 -6
- package/packages/irc-core/tests/commands/rehash.test.ts +171 -0
- package/packages/irc-core/tests/commands/sasl.test.ts +118 -10
- package/packages/irc-core/tests/commands/server-info.test.ts +274 -0
- package/packages/irc-core/tests/commands/setname.test.ts +225 -0
- package/packages/irc-core/tests/commands/stats.test.ts +294 -0
- package/packages/irc-core/tests/commands/tagmsg.test.ts +9 -35
- package/packages/irc-core/tests/commands/trace.test.ts +282 -0
- package/packages/irc-core/tests/commands/userhost.test.ts +264 -0
- package/packages/irc-core/tests/commands/wallops.test.ts +231 -0
- package/packages/irc-core/tests/commands/whowas.test.ts +312 -0
- package/packages/irc-core/tests/config.test.ts +95 -1
- package/packages/irc-core/tests/credential-hashing.test.ts +170 -0
- package/packages/irc-core/tests/dropped-s2s-and-obsolete-verbs.test.ts +90 -0
- package/packages/irc-core/tests/effects.test.ts +14 -27
- package/packages/irc-core/tests/nick-history-store.test.ts +162 -0
- package/packages/irc-core/tests/numerics.test.ts +102 -0
- package/packages/irc-core/tests/outbound.test.ts +51 -0
- package/packages/irc-core/tests/ports.test.ts +22 -0
- package/packages/irc-core/tests/raw-modules.d.ts +11 -0
- package/packages/irc-core/tests/stats-store.test.ts +222 -0
- package/packages/irc-core/tests/types.test.ts +35 -1
- package/packages/irc-core/tests/ws-framing.test.ts +213 -0
- package/packages/irc-core/tests/ws-subprotocol.test.ts +111 -0
- package/packages/irc-core/tsconfig.build.json +1 -1
- package/packages/irc-core/tsconfig.test.json +1 -1
- package/packages/irc-server/package.json +1 -1
- package/packages/irc-server/src/actor.ts +393 -16
- package/packages/irc-server/src/dispatch.ts +1 -3
- package/packages/irc-server/src/index.ts +10 -2
- package/packages/irc-server/src/routing.ts +15 -0
- package/packages/irc-server/src/runtime.ts +31 -0
- package/packages/irc-server/src/transport.ts +104 -0
- package/packages/irc-server/tests/actor.test.ts +1489 -4
- package/packages/irc-server/tests/dispatch.test.ts +37 -17
- package/packages/irc-server/tests/raw-modules.d.ts +11 -0
- package/packages/irc-server/tests/routing.test.ts +5 -0
- package/packages/irc-server/tests/runtime.test.ts +7 -0
- package/packages/irc-server/tests/transport.test.ts +230 -0
- package/packages/irc-test-support/package.json +1 -1
- package/packages/irc-test-support/src/harness.ts +44 -9
- package/packages/irc-test-support/src/in-memory-harness.ts +73 -9
- package/packages/irc-test-support/src/index.ts +3 -0
- package/packages/irc-test-support/src/scenarios.ts +141 -3
- package/packages/irc-test-support/tests/in-memory-harness.test.ts +2 -1
- package/packages/irc-test-support/tests/in-memory-scenarios.test.ts +23 -9
- package/pnpm-workspace.yaml +10 -1
- package/tools/ci-hardening/package.json +1 -1
- package/tools/package.json +9 -0
- package/tools/seed-aws-accounts.ts +5 -6
- package/tools/seed-cf-accounts.ts +107 -0
- package/tools/tcp-ws-forwarder/package.json +1 -1
- package/tools/tcp-ws-forwarder/src/forwarder.ts +57 -9
- package/tools/tcp-ws-forwarder/tests/forwarder.test.ts +34 -1
- package/tools/tcp-ws-forwarder/tests/framing.test.ts +65 -1
- package/docs/ADR-001-pure-reducers-and-effect-system.md +0 -74
- package/docs/ADR-002-location-of-authority.md +0 -82
- package/docs/ADR-003-durable-object-sharding.md +0 -93
- package/docs/ADR-004-dynamodb-schema.md +0 -96
- package/docs/ADR-005-wss-only-transport-v1.md +0 -83
- package/docs/ADR-006-sasl-mechanism-scope.md +0 -86
- package/docs/ADR-007-deterministic-ports.md +0 -82
- package/docs/ADR-008-monorepo-tooling.md +0 -60
- package/docs/AWS-Adapter-Architecture.md +0 -496
- package/docs/AWS-Deployment.md +0 -1186
- package/docs/Cloudflare-Deployment-Guide.md +0 -660
- package/docs/Home.md +0 -11
- package/docs/Observability.md +0 -87
- package/docs/PlanIRCv3Websocket.md +0 -489
- package/docs/PlanWebClient.md +0 -451
- package/docs/Release-Process.md +0 -443
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
ConnectionState,
|
|
18
18
|
Nick,
|
|
19
19
|
RawLine,
|
|
20
|
+
ServerConfig,
|
|
20
21
|
} from '@serverless-ircd/irc-core';
|
|
21
22
|
|
|
22
23
|
export interface IrcRuntime {
|
|
@@ -35,6 +36,24 @@ export interface IrcRuntime {
|
|
|
35
36
|
lines: RawLine[],
|
|
36
37
|
notFoundLines?: RawLine[],
|
|
37
38
|
): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Global cross-connection fanout for `WALLOPS`. Delivers `lines` to every
|
|
41
|
+
* live connection whose `+w` user mode is set, skipping `except` (the
|
|
42
|
+
* originator, so an oper never receives their own wallops). Unlike
|
|
43
|
+
* {@link broadcast} this is NOT channel-scoped — it reaches connections
|
|
44
|
+
* with no shared channel membership.
|
|
45
|
+
*
|
|
46
|
+
* Each adapter applies its own cost cap and enumeration strategy:
|
|
47
|
+
* - in-memory: scans its connection map, filters `+w`.
|
|
48
|
+
* - Cloudflare: walks the sharded registry to enumerate connIds, then
|
|
49
|
+
* fetches each state to check `+w`. Capped to bound the fan-out RPC
|
|
50
|
+
* count; document a ceiling for very large fleets.
|
|
51
|
+
* - AWS: `Scan`s the `Connections` table and `PostToConnection`s each
|
|
52
|
+
* `+w` row. DynamoDB `Scan` reads scale with table size, so this is
|
|
53
|
+
* expensive at high connection counts — callers should bound the
|
|
54
|
+
* oper's WALLOPS rate.
|
|
55
|
+
*/
|
|
56
|
+
broadcastWallops(lines: RawLine[], except?: ConnId): Promise<void>;
|
|
38
57
|
|
|
39
58
|
// nickname registry
|
|
40
59
|
reserveNick(nick: Nick, conn: ConnId): Promise<{ ok: true } | { ok: false }>;
|
|
@@ -58,4 +77,16 @@ export interface IrcRuntime {
|
|
|
58
77
|
getChannelSnapshot(chan: ChanName): Promise<ChanSnapshot | null>;
|
|
59
78
|
getChannelConnections(chan: ChanName): Promise<ReadonlyMap<ConnId, ConnectionState>>;
|
|
60
79
|
listChannels(): Promise<ChanSnapshot[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Re-fetches the deployment's {@link ServerConfig} from the adapter's bound
|
|
82
|
+
* source (CF: KV/secret env; AWS: Secrets Manager/SSM env; local-cli: the
|
|
83
|
+
* config file/options) and returns the fresh value. The caller (the
|
|
84
|
+
* ConnectionActor's `REHASH` route) swaps its live config reference with
|
|
85
|
+
* the result; on rejection the previous config stays in effect.
|
|
86
|
+
*
|
|
87
|
+
* Modelled as a request/response runtime method — like `lookupNick` /
|
|
88
|
+
* `getConnection` — rather than a fire-and-forget `Effect`, because the
|
|
89
|
+
* refreshed value must come back to the actor.
|
|
90
|
+
*/
|
|
91
|
+
reloadConfig(): Promise<ServerConfig>;
|
|
61
92
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport seam: turns raw transport input into complete IRC lines.
|
|
3
|
+
*
|
|
4
|
+
* PLAN §9 (ADR-009) — the pure reducer core + `ConnectionActor` are shared
|
|
5
|
+
* across both the WebSocket (`wss`) and the raw TCP+TLS (`irc+tls :6697`)
|
|
6
|
+
* transports. The only transport-specific concern is line framing:
|
|
7
|
+
* - A WebSocket text frame is a complete unit (one or N `\r\n`-joined
|
|
8
|
+
* messages), so a trailing unterminated line is still emitted.
|
|
9
|
+
* - A raw TCP byte stream arrives in arbitrary chunks, so a partial line
|
|
10
|
+
* at a chunk boundary must be buffered until its `\r\n` terminator
|
|
11
|
+
* arrives.
|
|
12
|
+
*
|
|
13
|
+
* Both transports emit complete lines (no terminators); the actor skips
|
|
14
|
+
* empty lines and parses each non-empty one through the shared
|
|
15
|
+
* parser/reducer/dispatch pipeline.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { splitFrameLines } from '@serverless-ircd/irc-core';
|
|
19
|
+
|
|
20
|
+
export { splitFrameLines };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The line-framing contract a {@link ConnectionActor} consumes. `feed`
|
|
24
|
+
* returns the complete IRC lines terminated within `chunk`; a stateful
|
|
25
|
+
* transport buffers any incomplete trailing line for the next call.
|
|
26
|
+
*/
|
|
27
|
+
export interface Transport {
|
|
28
|
+
feed(chunk: string): string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Splits a WebSocket text frame into IRC lines. Re-exported from
|
|
33
|
+
* `@serverless-ircd/irc-core` (`ws-framing.ts`), which owns the canonical
|
|
34
|
+
* legacy-tolerant framing so the IRCv3 spec-mode framing and this legacy
|
|
35
|
+
* behaviour never diverge. Tolerates `\r\n`, bare `\n`, and a missing
|
|
36
|
+
* trailing terminator (a WS frame is a complete unit). Returns each line
|
|
37
|
+
* bare (no CRLF). This is the legacy-tolerant WS contract.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Stateless WS-frame transport: one {@link feed} call per inbound text frame.
|
|
42
|
+
* A frame may carry one message or N `\r\n`-joined messages; a trailing
|
|
43
|
+
* unterminated line is emitted because the frame itself is the unit of
|
|
44
|
+
* completeness. This is the default transport for the WebSocket adapters.
|
|
45
|
+
*/
|
|
46
|
+
export class WsTextFrameTransport implements Transport {
|
|
47
|
+
feed(chunk: string): string[] {
|
|
48
|
+
return splitFrameLines(chunk);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Stateful TCP byte-stream transport: reassembles `\r\n`- (or bare `\n`-)
|
|
54
|
+
* terminated lines across arbitrary chunks, buffering any partial trailing
|
|
55
|
+
* line until its terminator arrives. Used by the raw TCP+TLS adapter path
|
|
56
|
+
* (PLAN §9). One instance owns one connection's buffer for its lifetime.
|
|
57
|
+
*
|
|
58
|
+
* For long-lived TCP connections fronted by request/response compute (AWS
|
|
59
|
+
* NLB + Lambda) each client chunk arrives in a fresh Lambda
|
|
60
|
+
* invocation. The partial-line buffer must persist across those
|
|
61
|
+
* invocations. {@link getBuffer} / {@link restore} snapshot the in-flight
|
|
62
|
+
* bytes so the adapter can round-trip them through its data store
|
|
63
|
+
* (DynamoDB) between chunks.
|
|
64
|
+
*/
|
|
65
|
+
export class TcpByteStreamTransport implements Transport {
|
|
66
|
+
private buffer = '';
|
|
67
|
+
|
|
68
|
+
feed(chunk: string): string[] {
|
|
69
|
+
if (chunk.length === 0) return [];
|
|
70
|
+
this.buffer += chunk;
|
|
71
|
+
const lines: string[] = [];
|
|
72
|
+
let start = 0;
|
|
73
|
+
for (let i = 0; i < this.buffer.length; i++) {
|
|
74
|
+
if (this.buffer[i] === '\n') {
|
|
75
|
+
// A `\n` terminates a line. Strip a preceding `\r` so both `\r\n`
|
|
76
|
+
// and bare `\n` yield the same bare line.
|
|
77
|
+
const lineEnd = i > 0 && this.buffer[i - 1] === '\r' ? i - 1 : i;
|
|
78
|
+
lines.push(this.buffer.slice(start, lineEnd));
|
|
79
|
+
start = i + 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.buffer = this.buffer.slice(start);
|
|
83
|
+
return lines;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns the partial-line bytes currently buffered (not yet terminated).
|
|
88
|
+
* Empty when every fed byte has been emitted as a complete line. The
|
|
89
|
+
* adapter persists this between compute invocations so a chunk split
|
|
90
|
+
* across two requests is reassembled correctly.
|
|
91
|
+
*/
|
|
92
|
+
getBuffer(): string {
|
|
93
|
+
return this.buffer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Replaces the internal buffer with `buffer`. Call before {@link feed}
|
|
98
|
+
* when restoring from a persisted snapshot. An empty (or omitted)
|
|
99
|
+
* `buffer` resets the transport to a fresh state.
|
|
100
|
+
*/
|
|
101
|
+
restore(buffer: string): void {
|
|
102
|
+
this.buffer = buffer;
|
|
103
|
+
}
|
|
104
|
+
}
|