@replit/river 0.23.16 → 0.23.18
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 +4 -4
- package/dist/{chunk-R47IZD67.js → chunk-7MJYOL32.js} +5 -6
- package/dist/{chunk-R47IZD67.js.map → chunk-7MJYOL32.js.map} +1 -1
- package/dist/{chunk-UDXM64QK.js → chunk-AVL32IMG.js} +6 -4
- package/dist/{chunk-UDXM64QK.js.map → chunk-AVL32IMG.js.map} +1 -1
- package/dist/{chunk-JA7XGTAL.js → chunk-DPKOJQWF.js} +5 -5
- package/dist/chunk-DPKOJQWF.js.map +1 -0
- package/dist/{chunk-LTSLICON.js → chunk-EV5HW4IC.js} +5 -468
- package/dist/chunk-EV5HW4IC.js.map +1 -0
- package/dist/{chunk-WN77AT67.js → chunk-J6N6H2WU.js} +3 -3
- package/dist/{chunk-YXDAOVP7.js → chunk-MW5JXLHY.js} +3 -2
- package/dist/chunk-MW5JXLHY.js.map +1 -0
- package/dist/{chunk-TXSQRTZB.js → chunk-R2HAS3GM.js} +2 -2
- package/dist/{chunk-TXSQRTZB.js.map → chunk-R2HAS3GM.js.map} +1 -1
- package/dist/{chunk-MQCGG6KL.js → chunk-RJOWZIWB.js} +5 -5
- package/dist/chunk-RJOWZIWB.js.map +1 -0
- package/dist/{client-0926d3d6.d.ts → client-5776a6bb.d.ts} +1 -1
- package/dist/{connection-99a67d3e.d.ts → connection-bd35d442.d.ts} +1 -1
- package/dist/{connection-d738cc08.d.ts → connection-df85db7e.d.ts} +1 -1
- package/dist/{handshake-75d0124f.d.ts → handshake-a947c234.d.ts} +4 -0
- package/dist/router/index.cjs +4 -468
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +8 -47
- package/dist/router/index.d.ts +8 -47
- package/dist/router/index.js +2 -4
- package/dist/{server-3740c5d9.d.ts → server-53cd5b7e.d.ts} +1 -1
- package/dist/{services-75e84a9f.d.ts → services-38b3f758.d.ts} +6 -6
- package/dist/transport/impls/uds/client.cjs +7 -4
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- package/dist/transport/impls/uds/client.d.cts +3 -3
- package/dist/transport/impls/uds/client.d.ts +3 -3
- package/dist/transport/impls/uds/client.js +5 -5
- package/dist/transport/impls/uds/server.cjs +7 -4
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- package/dist/transport/impls/uds/server.d.cts +3 -3
- package/dist/transport/impls/uds/server.d.ts +3 -3
- package/dist/transport/impls/uds/server.js +5 -5
- package/dist/transport/impls/ws/client.cjs +6 -6
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- package/dist/transport/impls/ws/client.js +5 -5
- package/dist/transport/impls/ws/server.cjs +6 -6
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +3 -3
- package/dist/transport/impls/ws/server.d.ts +3 -3
- package/dist/transport/impls/ws/server.js +5 -5
- package/dist/transport/index.cjs +4 -3
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +3 -3
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +5 -5
- package/dist/util/testHelpers.cjs +2 -1
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -4
- package/dist/util/testHelpers.d.ts +4 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-JA7XGTAL.js.map +0 -1
- package/dist/chunk-LTSLICON.js.map +0 -1
- package/dist/chunk-MQCGG6KL.js.map +0 -1
- package/dist/chunk-YXDAOVP7.js.map +0 -1
- /package/dist/{chunk-WN77AT67.js.map → chunk-J6N6H2WU.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as Client, E as Err, O as Ok, z as Output,
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-38b3f758.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-38b3f758.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, m as ServerHandshakeOptions, i as ServiceContext } from '../handshake-
|
|
6
|
-
export { n as ParsedMetadata, o as ServiceContextWithState, p as ServiceContextWithTransportInfo, q as createClientHandshakeOptions, r as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, m as ServerHandshakeOptions, i as ServiceContext } from '../handshake-a947c234.js';
|
|
6
|
+
export { n as ParsedMetadata, o as ServiceContextWithState, p as ServiceContextWithTransportInfo, q as createClientHandshakeOptions, r as createServerHandshakeOptions } from '../handshake-a947c234.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-53cd5b7e.js';
|
|
8
8
|
import '../index-ea74cdbb.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-5776a6bb.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
|
-
interface ServerBreakage {
|
|
15
|
-
serviceBreakages: Record<string, ServiceBreakage>;
|
|
16
|
-
}
|
|
17
|
-
type ServiceBreakage = {
|
|
18
|
-
reason: 'removed';
|
|
19
|
-
} | {
|
|
20
|
-
reason: 'modified';
|
|
21
|
-
procedureBreakages: Record<string, ProcedureBreakage>;
|
|
22
|
-
};
|
|
23
|
-
type ProcedureBreakage = {
|
|
24
|
-
reason: 'removed';
|
|
25
|
-
} | {
|
|
26
|
-
reason: 'type-changed';
|
|
27
|
-
oldType: string;
|
|
28
|
-
newType: string;
|
|
29
|
-
} | {
|
|
30
|
-
reason: 'modified';
|
|
31
|
-
input?: PayloadBreakage;
|
|
32
|
-
init?: PayloadBreakage;
|
|
33
|
-
output?: PayloadBreakage;
|
|
34
|
-
};
|
|
35
|
-
type PayloadBreakage = {
|
|
36
|
-
reason: 'type-changed';
|
|
37
|
-
oldType: string;
|
|
38
|
-
newType: string;
|
|
39
|
-
} | {
|
|
40
|
-
reason: 'new-required';
|
|
41
|
-
} | {
|
|
42
|
-
reason: 'removed-required';
|
|
43
|
-
} | {
|
|
44
|
-
reason: 'field-breakage';
|
|
45
|
-
fieldBreakages: Record<string, PayloadBreakage>;
|
|
46
|
-
};
|
|
47
|
-
interface DiffOptions {
|
|
48
|
-
allowServiceRemoval?: boolean;
|
|
49
|
-
allowProcedureRemoval?: boolean;
|
|
50
|
-
}
|
|
51
|
-
declare function diffServerSchema(oldServer: SerializedServerSchema, newServer: SerializedServerSchema, options?: DiffOptions): ServerBreakage | null;
|
|
52
|
-
|
|
53
14
|
/**
|
|
54
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
55
16
|
* @template Services - The type of services provided by the server.
|
|
@@ -83,6 +44,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
83
44
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
84
45
|
}>): Server<Services>;
|
|
85
46
|
|
|
86
|
-
var version = "0.23.
|
|
47
|
+
var version = "0.23.18";
|
|
87
48
|
|
|
88
|
-
export {
|
|
49
|
+
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as Client, E as Err, O as Ok, z as Output,
|
|
1
|
+
import { A as AnyServiceSchemaMap, I as InstantiatedServiceSchemaMap, P as PayloadType, b as Result, R as RiverError } from '../services-38b3f758.js';
|
|
2
|
+
export { C as Client, E as Err, O as Ok, z as Output, j as ProcErrors, f as ProcHandler, g as ProcInit, h as ProcInput, i as ProcOutput, k as ProcType, a as Procedure, p as ProcedureMap, d as ProcedureResult, q as RPCProcedure, y as ResultUnwrapErr, x as ResultUnwrapOk, w as RiverErrorSchema, c as RiverUncaughtSchema, o as SerializedProcedureSchema, m as SerializedServerSchema, n as SerializedServiceSchema, S as Service, e as ServiceConfiguration, l as ServiceSchema, t as StreamProcedure, r as SubscriptionProcedure, v as UNCAUGHT_ERROR, U as UploadProcedure, V as ValidProcType, u as createClient, s as serializeSchema } from '../services-38b3f758.js';
|
|
3
3
|
import { Static } from '@sinclair/typebox';
|
|
4
4
|
import { Pushable } from 'it-pushable';
|
|
5
|
-
import { C as Connection, m as ServerHandshakeOptions, i as ServiceContext } from '../handshake-
|
|
6
|
-
export { n as ParsedMetadata, o as ServiceContextWithState, p as ServiceContextWithTransportInfo, q as createClientHandshakeOptions, r as createServerHandshakeOptions } from '../handshake-
|
|
7
|
-
import { S as ServerTransport } from '../server-
|
|
5
|
+
import { C as Connection, m as ServerHandshakeOptions, i as ServiceContext } from '../handshake-a947c234.js';
|
|
6
|
+
export { n as ParsedMetadata, o as ServiceContextWithState, p as ServiceContextWithTransportInfo, q as createClientHandshakeOptions, r as createServerHandshakeOptions } from '../handshake-a947c234.js';
|
|
7
|
+
import { S as ServerTransport } from '../server-53cd5b7e.js';
|
|
8
8
|
import '../index-ea74cdbb.js';
|
|
9
9
|
import '@sinclair/typebox/value';
|
|
10
10
|
import '@opentelemetry/api';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-5776a6bb.js';
|
|
12
12
|
import '../types-3e5768ec.js';
|
|
13
13
|
|
|
14
|
-
interface ServerBreakage {
|
|
15
|
-
serviceBreakages: Record<string, ServiceBreakage>;
|
|
16
|
-
}
|
|
17
|
-
type ServiceBreakage = {
|
|
18
|
-
reason: 'removed';
|
|
19
|
-
} | {
|
|
20
|
-
reason: 'modified';
|
|
21
|
-
procedureBreakages: Record<string, ProcedureBreakage>;
|
|
22
|
-
};
|
|
23
|
-
type ProcedureBreakage = {
|
|
24
|
-
reason: 'removed';
|
|
25
|
-
} | {
|
|
26
|
-
reason: 'type-changed';
|
|
27
|
-
oldType: string;
|
|
28
|
-
newType: string;
|
|
29
|
-
} | {
|
|
30
|
-
reason: 'modified';
|
|
31
|
-
input?: PayloadBreakage;
|
|
32
|
-
init?: PayloadBreakage;
|
|
33
|
-
output?: PayloadBreakage;
|
|
34
|
-
};
|
|
35
|
-
type PayloadBreakage = {
|
|
36
|
-
reason: 'type-changed';
|
|
37
|
-
oldType: string;
|
|
38
|
-
newType: string;
|
|
39
|
-
} | {
|
|
40
|
-
reason: 'new-required';
|
|
41
|
-
} | {
|
|
42
|
-
reason: 'removed-required';
|
|
43
|
-
} | {
|
|
44
|
-
reason: 'field-breakage';
|
|
45
|
-
fieldBreakages: Record<string, PayloadBreakage>;
|
|
46
|
-
};
|
|
47
|
-
interface DiffOptions {
|
|
48
|
-
allowServiceRemoval?: boolean;
|
|
49
|
-
allowProcedureRemoval?: boolean;
|
|
50
|
-
}
|
|
51
|
-
declare function diffServerSchema(oldServer: SerializedServerSchema, newServer: SerializedServerSchema, options?: DiffOptions): ServerBreakage | null;
|
|
52
|
-
|
|
53
14
|
/**
|
|
54
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
55
16
|
* @template Services - The type of services provided by the server.
|
|
@@ -83,6 +44,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
|
|
|
83
44
|
extendedContext?: Omit<ServiceContext, 'state'>;
|
|
84
45
|
}>): Server<Services>;
|
|
85
46
|
|
|
86
|
-
var version = "0.23.
|
|
47
|
+
var version = "0.23.18";
|
|
87
48
|
|
|
88
|
-
export {
|
|
49
|
+
export { PayloadType, version as RIVER_VERSION, Result, RiverError, Server, ServiceContext, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -9,12 +9,11 @@ import {
|
|
|
9
9
|
createClientHandshakeOptions,
|
|
10
10
|
createServer,
|
|
11
11
|
createServerHandshakeOptions,
|
|
12
|
-
diffServerSchema,
|
|
13
12
|
serializeSchema
|
|
14
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-EV5HW4IC.js";
|
|
15
14
|
import {
|
|
16
15
|
version
|
|
17
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-R2HAS3GM.js";
|
|
18
17
|
export {
|
|
19
18
|
Err,
|
|
20
19
|
Ok,
|
|
@@ -27,7 +26,6 @@ export {
|
|
|
27
26
|
createClientHandshakeOptions,
|
|
28
27
|
createServer,
|
|
29
28
|
createServerHandshakeOptions,
|
|
30
|
-
diffServerSchema,
|
|
31
29
|
serializeSchema
|
|
32
30
|
};
|
|
33
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Connection, T as Transport, l as ServerTransportOptions, m as ServerHandshakeOptions, S as Session, n as ParsedMetadata, c as ProvidedServerTransportOptions } from './handshake-
|
|
1
|
+
import { C as Connection, T as Transport, l as ServerTransportOptions, m as ServerHandshakeOptions, S as Session, n as ParsedMetadata, c as ProvidedServerTransportOptions } from './handshake-a947c234.js';
|
|
2
2
|
import { c as TransportClientId } from './index-ea74cdbb.js';
|
|
3
3
|
|
|
4
4
|
declare abstract class ServerTransport<ConnType extends Connection> extends Transport<ConnType> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Static, TObject, TUnion, TString, TSchema, TNever, TLiteral } from '@sinclair/typebox';
|
|
2
2
|
import { Pushable } from 'it-pushable';
|
|
3
|
-
import { C as Connection, k as ClientHandshakeOptions, p as ServiceContextWithTransportInfo } from './handshake-
|
|
3
|
+
import { C as Connection, k as ClientHandshakeOptions, p as ServiceContextWithTransportInfo, i as ServiceContext } from './handshake-a947c234.js';
|
|
4
4
|
import { c as TransportClientId } from './index-ea74cdbb.js';
|
|
5
|
-
import { C as ClientTransport } from './client-
|
|
5
|
+
import { C as ClientTransport } from './client-5776a6bb.js';
|
|
6
6
|
|
|
7
7
|
type AsyncIter<T> = AsyncGenerator<T, T>;
|
|
8
8
|
/**
|
|
@@ -476,7 +476,7 @@ interface ServiceConfiguration<State extends object> {
|
|
|
476
476
|
/**
|
|
477
477
|
* A factory function for creating a fresh state.
|
|
478
478
|
*/
|
|
479
|
-
initializeState: () => State;
|
|
479
|
+
initializeState: (extendedContext: ServiceContext) => State;
|
|
480
480
|
}
|
|
481
481
|
interface SerializedProcedureSchema {
|
|
482
482
|
input: PayloadType;
|
|
@@ -515,7 +515,7 @@ declare class ServiceSchema<State extends object, Procedures extends ProcedureMa
|
|
|
515
515
|
/**
|
|
516
516
|
* Factory function for creating a fresh state.
|
|
517
517
|
*/
|
|
518
|
-
protected readonly initializeState: () => State;
|
|
518
|
+
protected readonly initializeState: (extendedContext: ServiceContext) => State;
|
|
519
519
|
/**
|
|
520
520
|
* The procedures for this service.
|
|
521
521
|
*/
|
|
@@ -646,7 +646,7 @@ declare class ServiceSchema<State extends object, Procedures extends ProcedureMa
|
|
|
646
646
|
* You probably don't need this, usually the River server will handle this
|
|
647
647
|
* for you.
|
|
648
648
|
*/
|
|
649
|
-
instantiate(): Service<State, Procedures>;
|
|
649
|
+
instantiate(extendedContext: ServiceContext): Service<State, Procedures>;
|
|
650
650
|
}
|
|
651
651
|
/**
|
|
652
652
|
* A scaffold for defining a service's procedures.
|
|
@@ -706,4 +706,4 @@ declare class ServiceScaffold<State extends object> {
|
|
|
706
706
|
}>;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
-
export { AnyServiceSchemaMap as A, Client as C, Err as E, InstantiatedServiceSchemaMap as I, Ok as O, PayloadType as P, RiverError as R,
|
|
709
|
+
export { AnyServiceSchemaMap as A, Client as C, Err as E, InstantiatedServiceSchemaMap as I, Ok as O, PayloadType as P, RiverError as R, Service as S, UploadProcedure as U, ValidProcType as V, Procedure as a, Result as b, RiverUncaughtSchema as c, ProcedureResult as d, ServiceConfiguration as e, ProcHandler as f, ProcInit as g, ProcInput as h, ProcOutput as i, ProcErrors as j, ProcType as k, ServiceSchema as l, SerializedServerSchema as m, SerializedServiceSchema as n, SerializedProcedureSchema as o, ProcedureMap as p, RpcProcedure as q, SubscriptionProcedure as r, serializeSchema as s, StreamProcedure as t, createClient as u, UNCAUGHT_ERROR as v, RiverErrorSchema as w, ResultUnwrapOk as x, ResultUnwrapErr as y, Output as z };
|
|
@@ -134,7 +134,7 @@ function isAck(controlFlag) {
|
|
|
134
134
|
var import_api = require("@opentelemetry/api");
|
|
135
135
|
|
|
136
136
|
// package.json
|
|
137
|
-
var version = "0.23.
|
|
137
|
+
var version = "0.23.18";
|
|
138
138
|
|
|
139
139
|
// tracing/index.ts
|
|
140
140
|
function getPropagationContext(ctx) {
|
|
@@ -577,9 +577,11 @@ var UdsConnection = class extends Connection {
|
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
579
|
send(payload) {
|
|
580
|
-
if (this.framer.destroyed || !this.sock.writable)
|
|
580
|
+
if (this.framer.destroyed || !this.sock.writable || this.sock.closed) {
|
|
581
581
|
return false;
|
|
582
|
-
|
|
582
|
+
}
|
|
583
|
+
this.sock.write(MessageFramer.write(payload));
|
|
584
|
+
return true;
|
|
583
585
|
}
|
|
584
586
|
close() {
|
|
585
587
|
this.sock.destroy();
|
|
@@ -647,6 +649,7 @@ var defaultTransportOptions = {
|
|
|
647
649
|
heartbeatIntervalMs: 1e3,
|
|
648
650
|
heartbeatsUntilDead: 2,
|
|
649
651
|
sessionDisconnectGraceMs: 5e3,
|
|
652
|
+
handshakeTimeoutMs: 5e3,
|
|
650
653
|
codec: NaiveJsonCodec
|
|
651
654
|
};
|
|
652
655
|
var defaultConnectionRetryOptions = {
|
|
@@ -1302,7 +1305,7 @@ var ClientTransport = class extends Transport {
|
|
|
1302
1305
|
{ ...conn.loggingMetadata, clientId: this.clientId, connectedTo: to }
|
|
1303
1306
|
);
|
|
1304
1307
|
conn.close();
|
|
1305
|
-
}, this.options.
|
|
1308
|
+
}, this.options.handshakeTimeoutMs);
|
|
1306
1309
|
const handshakeHandler = (data) => {
|
|
1307
1310
|
const maybeSession = this.receiveHandshakeResponseMessage(data, conn);
|
|
1308
1311
|
clearTimeout(handshakeTimeout);
|