@replit/river 0.200.0-rc.1 → 0.200.0-rc.3
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/README.md +21 -20
- package/dist/{chunk-XLXRFSRB.js → chunk-3CCOX55A.js} +76 -42
- package/dist/chunk-3CCOX55A.js.map +1 -0
- package/dist/chunk-GWYJZFCW.js +653 -0
- package/dist/chunk-GWYJZFCW.js.map +1 -0
- package/dist/chunk-O4O2E6DJ.js +277 -0
- package/dist/chunk-O4O2E6DJ.js.map +1 -0
- package/dist/chunk-QXLXDJD5.js +382 -0
- package/dist/chunk-QXLXDJD5.js.map +1 -0
- package/dist/{chunk-WQVOMUNR.js → chunk-UFMDEG44.js} +24 -18
- package/dist/chunk-UFMDEG44.js.map +1 -0
- package/dist/{chunk-45HIR2AS.js → chunk-UIYGPURD.js} +90 -532
- package/dist/chunk-UIYGPURD.js.map +1 -0
- package/dist/{chunk-QMM35C3H.js → chunk-VXYHC666.js} +1 -1
- package/dist/chunk-VXYHC666.js.map +1 -0
- package/dist/chunk-WSCAA7VY.js +50 -0
- package/dist/chunk-WSCAA7VY.js.map +1 -0
- package/dist/chunk-ZQVKFLAB.js +399 -0
- package/dist/chunk-ZQVKFLAB.js.map +1 -0
- package/dist/client-a84783be.d.ts +49 -0
- package/dist/{connection-c6521735.d.ts → connection-320fb130.d.ts} +1 -5
- package/dist/connection-d0b488e6.d.ts +11 -0
- package/dist/context-c9668e95.d.ts +527 -0
- package/dist/logging/index.cjs.map +1 -1
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/{index-10ebd26a.d.ts → message-fd349b27.d.ts} +31 -31
- package/dist/router/index.cjs +142 -544
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +11 -46
- package/dist/router/index.d.ts +11 -46
- package/dist/router/index.js +2 -4
- package/dist/server-dbad597e.d.ts +42 -0
- package/dist/{services-34d97070.d.ts → services-690e5553.d.ts} +11 -602
- package/dist/transport/impls/uds/client.cjs +1240 -1237
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- package/dist/transport/impls/uds/client.d.cts +4 -3
- package/dist/transport/impls/uds/client.d.ts +4 -3
- package/dist/transport/impls/uds/client.js +7 -13
- package/dist/transport/impls/uds/client.js.map +1 -1
- package/dist/transport/impls/uds/server.cjs +1302 -1168
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- package/dist/transport/impls/uds/server.d.cts +4 -4
- package/dist/transport/impls/uds/server.d.ts +4 -4
- package/dist/transport/impls/uds/server.js +6 -6
- package/dist/transport/impls/ws/client.cjs +981 -986
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +6 -5
- package/dist/transport/impls/ws/client.d.ts +6 -5
- package/dist/transport/impls/ws/client.js +6 -7
- package/dist/transport/impls/ws/client.js.map +1 -1
- package/dist/transport/impls/ws/server.cjs +1183 -1064
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +4 -4
- package/dist/transport/impls/ws/server.d.ts +4 -4
- package/dist/transport/impls/ws/server.js +6 -6
- package/dist/transport/index.cjs +1435 -1377
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +4 -26
- package/dist/transport/index.d.ts +4 -26
- package/dist/transport/index.js +9 -9
- package/dist/util/testHelpers.cjs +782 -333
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +9 -4
- package/dist/util/testHelpers.d.ts +9 -4
- package/dist/util/testHelpers.js +45 -23
- package/dist/util/testHelpers.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-45HIR2AS.js.map +0 -1
- package/dist/chunk-75B5D7MR.js +0 -347
- package/dist/chunk-75B5D7MR.js.map +0 -1
- package/dist/chunk-AJBZUHSI.js +0 -492
- package/dist/chunk-AJBZUHSI.js.map +0 -1
- package/dist/chunk-EMIERCU7.js +0 -59
- package/dist/chunk-EMIERCU7.js.map +0 -1
- package/dist/chunk-LH2VHMQM.js +0 -335
- package/dist/chunk-LH2VHMQM.js.map +0 -1
- package/dist/chunk-QMM35C3H.js.map +0 -1
- package/dist/chunk-W75HU4F6.js +0 -476
- package/dist/chunk-W75HU4F6.js.map +0 -1
- package/dist/chunk-WQVOMUNR.js.map +0 -1
- package/dist/chunk-XLXRFSRB.js.map +0 -1
- package/dist/connection-0638316b.d.ts +0 -17
package/dist/router/index.d.cts
CHANGED
|
@@ -1,51 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap } from '../services-690e5553.js';
|
|
2
|
+
export { C as Client, D as Err, E as ErrResult, w as INVALID_REQUEST_CODE, x as InputReaderErrorSchema, z as Ok, O as OkResult, H as Output, d as OutputReaderErrorSchema, P as PayloadType, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, b as Procedure, a as ProcedureErrorSchemaType, p as ProcedureMap, q as RPCProcedure, R as ReadStream, c as Result, G as ResultUnwrapErr, F as ResultUnwrapOk, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, u as UNCAUGHT_ERROR_CODE, v as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as WriteStream, y as createClient, s as serializeSchema } from '../services-690e5553.js';
|
|
3
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../context-c9668e95.js';
|
|
4
|
+
export { r as ParsedMetadata, s as ProcedureHandlerContext, t as createClientHandshakeOptions, u as createServerHandshakeOptions } from '../context-c9668e95.js';
|
|
5
|
+
import { S as ServerTransport } from '../server-dbad597e.js';
|
|
4
6
|
import '@sinclair/typebox';
|
|
5
|
-
import '../
|
|
7
|
+
import '../message-fd349b27.js';
|
|
6
8
|
import '@sinclair/typebox/value';
|
|
7
9
|
import '@opentelemetry/api';
|
|
10
|
+
import '../client-a84783be.js';
|
|
8
11
|
import '../types-3e5768ec.js';
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
serviceBreakages: Record<string, ServiceBreakage>;
|
|
12
|
-
}
|
|
13
|
-
type ServiceBreakage = {
|
|
14
|
-
reason: 'removed';
|
|
15
|
-
} | {
|
|
16
|
-
reason: 'modified';
|
|
17
|
-
procedureBreakages: Record<string, ProcedureBreakage>;
|
|
18
|
-
};
|
|
19
|
-
type ProcedureBreakage = {
|
|
20
|
-
reason: 'removed';
|
|
21
|
-
} | {
|
|
22
|
-
reason: 'type-changed';
|
|
23
|
-
oldType: string;
|
|
24
|
-
newType: string;
|
|
25
|
-
} | {
|
|
26
|
-
reason: 'modified';
|
|
27
|
-
input?: PayloadBreakage;
|
|
28
|
-
init?: PayloadBreakage;
|
|
29
|
-
output?: PayloadBreakage;
|
|
30
|
-
};
|
|
31
|
-
type PayloadBreakage = {
|
|
32
|
-
reason: 'type-changed';
|
|
33
|
-
oldType: string;
|
|
34
|
-
newType: string;
|
|
35
|
-
} | {
|
|
36
|
-
reason: 'new-required';
|
|
37
|
-
} | {
|
|
38
|
-
reason: 'removed-required';
|
|
39
|
-
} | {
|
|
40
|
-
reason: 'field-breakage';
|
|
41
|
-
fieldBreakages: Record<string, PayloadBreakage>;
|
|
42
|
-
};
|
|
43
|
-
interface DiffOptions {
|
|
44
|
-
allowServiceRemoval?: boolean;
|
|
45
|
-
allowProcedureRemoval?: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare function diffServerSchema(oldServer: SerializedServerSchema, newServer: SerializedServerSchema, options?: DiffOptions): ServerBreakage | null;
|
|
48
|
-
|
|
13
|
+
type StreamId = string;
|
|
49
14
|
/**
|
|
50
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
51
16
|
* @template Services - The type of services provided by the server.
|
|
@@ -58,7 +23,7 @@ interface Server<Services extends AnyServiceSchemaMap> {
|
|
|
58
23
|
/**
|
|
59
24
|
* A set of stream ids that are currently open.
|
|
60
25
|
*/
|
|
61
|
-
openStreams: Set<
|
|
26
|
+
openStreams: Set<StreamId>;
|
|
62
27
|
}
|
|
63
28
|
/**
|
|
64
29
|
* Creates a server instance that listens for incoming messages from a transport and routes them to the appropriate service and procedure.
|
|
@@ -79,6 +44,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
79
44
|
maxAbortedStreamTombstonesPerSession?: number;
|
|
80
45
|
}>): Server<Services>;
|
|
81
46
|
|
|
82
|
-
var version = "0.200.0-rc.
|
|
47
|
+
var version = "0.200.0-rc.3";
|
|
83
48
|
|
|
84
|
-
export {
|
|
49
|
+
export { version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,51 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap } from '../services-690e5553.js';
|
|
2
|
+
export { C as Client, D as Err, E as ErrResult, w as INVALID_REQUEST_CODE, x as InputReaderErrorSchema, z as Ok, O as OkResult, H as Output, d as OutputReaderErrorSchema, P as PayloadType, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, b as Procedure, a as ProcedureErrorSchemaType, p as ProcedureMap, q as RPCProcedure, R as ReadStream, c as Result, G as ResultUnwrapErr, F as ResultUnwrapOk, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, u as UNCAUGHT_ERROR_CODE, v as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as WriteStream, y as createClient, s as serializeSchema } from '../services-690e5553.js';
|
|
3
|
+
import { C as Connection, q as ServerHandshakeOptions, n as ServiceContext } from '../context-c9668e95.js';
|
|
4
|
+
export { r as ParsedMetadata, s as ProcedureHandlerContext, t as createClientHandshakeOptions, u as createServerHandshakeOptions } from '../context-c9668e95.js';
|
|
5
|
+
import { S as ServerTransport } from '../server-dbad597e.js';
|
|
4
6
|
import '@sinclair/typebox';
|
|
5
|
-
import '../
|
|
7
|
+
import '../message-fd349b27.js';
|
|
6
8
|
import '@sinclair/typebox/value';
|
|
7
9
|
import '@opentelemetry/api';
|
|
10
|
+
import '../client-a84783be.js';
|
|
8
11
|
import '../types-3e5768ec.js';
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
serviceBreakages: Record<string, ServiceBreakage>;
|
|
12
|
-
}
|
|
13
|
-
type ServiceBreakage = {
|
|
14
|
-
reason: 'removed';
|
|
15
|
-
} | {
|
|
16
|
-
reason: 'modified';
|
|
17
|
-
procedureBreakages: Record<string, ProcedureBreakage>;
|
|
18
|
-
};
|
|
19
|
-
type ProcedureBreakage = {
|
|
20
|
-
reason: 'removed';
|
|
21
|
-
} | {
|
|
22
|
-
reason: 'type-changed';
|
|
23
|
-
oldType: string;
|
|
24
|
-
newType: string;
|
|
25
|
-
} | {
|
|
26
|
-
reason: 'modified';
|
|
27
|
-
input?: PayloadBreakage;
|
|
28
|
-
init?: PayloadBreakage;
|
|
29
|
-
output?: PayloadBreakage;
|
|
30
|
-
};
|
|
31
|
-
type PayloadBreakage = {
|
|
32
|
-
reason: 'type-changed';
|
|
33
|
-
oldType: string;
|
|
34
|
-
newType: string;
|
|
35
|
-
} | {
|
|
36
|
-
reason: 'new-required';
|
|
37
|
-
} | {
|
|
38
|
-
reason: 'removed-required';
|
|
39
|
-
} | {
|
|
40
|
-
reason: 'field-breakage';
|
|
41
|
-
fieldBreakages: Record<string, PayloadBreakage>;
|
|
42
|
-
};
|
|
43
|
-
interface DiffOptions {
|
|
44
|
-
allowServiceRemoval?: boolean;
|
|
45
|
-
allowProcedureRemoval?: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare function diffServerSchema(oldServer: SerializedServerSchema, newServer: SerializedServerSchema, options?: DiffOptions): ServerBreakage | null;
|
|
48
|
-
|
|
13
|
+
type StreamId = string;
|
|
49
14
|
/**
|
|
50
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
51
16
|
* @template Services - The type of services provided by the server.
|
|
@@ -58,7 +23,7 @@ interface Server<Services extends AnyServiceSchemaMap> {
|
|
|
58
23
|
/**
|
|
59
24
|
* A set of stream ids that are currently open.
|
|
60
25
|
*/
|
|
61
|
-
openStreams: Set<
|
|
26
|
+
openStreams: Set<StreamId>;
|
|
62
27
|
}
|
|
63
28
|
/**
|
|
64
29
|
* Creates a server instance that listens for incoming messages from a transport and routes them to the appropriate service and procedure.
|
|
@@ -79,6 +44,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
79
44
|
maxAbortedStreamTombstonesPerSession?: number;
|
|
80
45
|
}>): Server<Services>;
|
|
81
46
|
|
|
82
|
-
var version = "0.200.0-rc.
|
|
47
|
+
var version = "0.200.0-rc.3";
|
|
83
48
|
|
|
84
|
-
export {
|
|
49
|
+
export { version as RIVER_VERSION, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -12,12 +12,11 @@ import {
|
|
|
12
12
|
createClientHandshakeOptions,
|
|
13
13
|
createServer,
|
|
14
14
|
createServerHandshakeOptions,
|
|
15
|
-
diffServerSchema,
|
|
16
15
|
serializeSchema
|
|
17
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-UIYGPURD.js";
|
|
18
17
|
import {
|
|
19
18
|
version
|
|
20
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-3CCOX55A.js";
|
|
21
20
|
export {
|
|
22
21
|
Err,
|
|
23
22
|
INVALID_REQUEST_CODE,
|
|
@@ -33,7 +32,6 @@ export {
|
|
|
33
32
|
createClientHandshakeOptions,
|
|
34
33
|
createServer,
|
|
35
34
|
createServerHandshakeOptions,
|
|
36
|
-
diffServerSchema,
|
|
37
35
|
serializeSchema
|
|
38
36
|
};
|
|
39
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { C as Connection, v as CommonSession, d as SessionState, w as SessionHandshakingListeners, T as Transport, x as ServerTransportOptions, q as ServerHandshakeOptions, r as ParsedMetadata, c as ProvidedServerTransportOptions, S as Session } from './context-c9668e95.js';
|
|
2
|
+
import { M as MessageMetadata, a as TransportMessage, c as TransportClientId, P as PartialTransportMessage, b as OpaqueTransportMessage } from './message-fd349b27.js';
|
|
3
|
+
|
|
4
|
+
declare class SessionWaitingForHandshake<ConnType extends Connection> extends CommonSession {
|
|
5
|
+
readonly state: SessionState.WaitingForHandshake;
|
|
6
|
+
conn: ConnType;
|
|
7
|
+
listeners: SessionHandshakingListeners;
|
|
8
|
+
handshakeTimeout?: ReturnType<typeof setTimeout>;
|
|
9
|
+
constructor(conn: ConnType, listeners: SessionHandshakingListeners, ...args: ConstructorParameters<typeof CommonSession>);
|
|
10
|
+
onHandshakeData: (msg: Uint8Array) => void;
|
|
11
|
+
get loggingMetadata(): MessageMetadata;
|
|
12
|
+
sendHandshake(msg: TransportMessage): boolean;
|
|
13
|
+
_handleStateExit(): void;
|
|
14
|
+
_handleClose(): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare abstract class ServerTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
18
|
+
/**
|
|
19
|
+
* The options for this transport.
|
|
20
|
+
*/
|
|
21
|
+
protected options: ServerTransportOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Optional handshake options for the server.
|
|
24
|
+
*/
|
|
25
|
+
handshakeExtensions?: ServerHandshakeOptions;
|
|
26
|
+
/**
|
|
27
|
+
* A map of session handshake data for each session.
|
|
28
|
+
*/
|
|
29
|
+
sessionHandshakeMetadata: Map<string, ParsedMetadata>;
|
|
30
|
+
pendingSessions: Set<SessionWaitingForHandshake<ConnType>>;
|
|
31
|
+
constructor(clientId: TransportClientId, providedOptions?: ProvidedServerTransportOptions);
|
|
32
|
+
extendHandshake(options: ServerHandshakeOptions): void;
|
|
33
|
+
send(to: string, msg: PartialTransportMessage): string;
|
|
34
|
+
protected deletePendingSession(pendingSession: SessionWaitingForHandshake<ConnType>): void;
|
|
35
|
+
protected deleteSession(session: Session<ConnType>): void;
|
|
36
|
+
protected handleConnection(conn: ConnType): void;
|
|
37
|
+
private rejectHandshakeRequest;
|
|
38
|
+
protected onHandshakeRequest(session: SessionWaitingForHandshake<ConnType>, msg: OpaqueTransportMessage): Promise<void>;
|
|
39
|
+
private validateHandshakeMetadata;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { ServerTransport as S, SessionWaitingForHandshake as a };
|