@replit/river 0.18.4 → 0.18.5
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.
|
@@ -10,6 +10,15 @@ import {
|
|
|
10
10
|
|
|
11
11
|
// router/services.ts
|
|
12
12
|
import { Type } from "@sinclair/typebox";
|
|
13
|
+
function serializeSchema(services) {
|
|
14
|
+
return Object.entries(services).reduce(
|
|
15
|
+
(acc, [name, value]) => {
|
|
16
|
+
acc[name] = value.serialize();
|
|
17
|
+
return acc;
|
|
18
|
+
},
|
|
19
|
+
{}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
13
22
|
var ServiceSchema = class _ServiceSchema {
|
|
14
23
|
/**
|
|
15
24
|
* Factory function for creating a fresh state.
|
|
@@ -1238,9 +1247,10 @@ function createServer(transport, services, extendedContext) {
|
|
|
1238
1247
|
}
|
|
1239
1248
|
|
|
1240
1249
|
// package.json
|
|
1241
|
-
var version = "0.18.
|
|
1250
|
+
var version = "0.18.5";
|
|
1242
1251
|
|
|
1243
1252
|
export {
|
|
1253
|
+
serializeSchema,
|
|
1244
1254
|
ServiceSchema,
|
|
1245
1255
|
Procedure,
|
|
1246
1256
|
pushable,
|
package/dist/router/index.cjs
CHANGED
|
@@ -28,12 +28,22 @@ __export(router_exports, {
|
|
|
28
28
|
ServiceSchema: () => ServiceSchema,
|
|
29
29
|
UNCAUGHT_ERROR: () => UNCAUGHT_ERROR,
|
|
30
30
|
createClient: () => createClient,
|
|
31
|
-
createServer: () => createServer
|
|
31
|
+
createServer: () => createServer,
|
|
32
|
+
serializeSchema: () => serializeSchema
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(router_exports);
|
|
34
35
|
|
|
35
36
|
// router/services.ts
|
|
36
37
|
var import_typebox = require("@sinclair/typebox");
|
|
38
|
+
function serializeSchema(services) {
|
|
39
|
+
return Object.entries(services).reduce(
|
|
40
|
+
(acc, [name, value]) => {
|
|
41
|
+
acc[name] = value.serialize();
|
|
42
|
+
return acc;
|
|
43
|
+
},
|
|
44
|
+
{}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
37
47
|
var ServiceSchema = class _ServiceSchema {
|
|
38
48
|
/**
|
|
39
49
|
* Factory function for creating a fresh state.
|
|
@@ -1334,7 +1344,7 @@ function createServer(transport, services, extendedContext) {
|
|
|
1334
1344
|
}
|
|
1335
1345
|
|
|
1336
1346
|
// package.json
|
|
1337
|
-
var version = "0.18.
|
|
1347
|
+
var version = "0.18.5";
|
|
1338
1348
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1339
1349
|
0 && (module.exports = {
|
|
1340
1350
|
Err,
|
|
@@ -1345,5 +1355,6 @@ var version = "0.18.4";
|
|
|
1345
1355
|
ServiceSchema,
|
|
1346
1356
|
UNCAUGHT_ERROR,
|
|
1347
1357
|
createClient,
|
|
1348
|
-
createServer
|
|
1358
|
+
createServer,
|
|
1359
|
+
serializeSchema
|
|
1349
1360
|
});
|
package/dist/router/index.d.cts
CHANGED
|
@@ -103,6 +103,8 @@ interface SerializedServiceSchema {
|
|
|
103
103
|
init?: PayloadType;
|
|
104
104
|
}>;
|
|
105
105
|
}
|
|
106
|
+
type SerializedServerSchema = Record<string, SerializedServiceSchema>;
|
|
107
|
+
declare function serializeSchema(services: AnyServiceSchemaMap): SerializedServerSchema;
|
|
106
108
|
/**
|
|
107
109
|
* The schema for a {@link Service}. This is used to define a service, specifically
|
|
108
110
|
* its initial state and procedures.
|
|
@@ -410,6 +412,6 @@ interface ProcStream {
|
|
|
410
412
|
*/
|
|
411
413
|
declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
|
|
412
414
|
|
|
413
|
-
var version = "0.18.
|
|
415
|
+
var version = "0.18.5";
|
|
414
416
|
|
|
415
|
-
export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
|
|
417
|
+
export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, SerializedServerSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer, serializeSchema };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ interface SerializedServiceSchema {
|
|
|
103
103
|
init?: PayloadType;
|
|
104
104
|
}>;
|
|
105
105
|
}
|
|
106
|
+
type SerializedServerSchema = Record<string, SerializedServiceSchema>;
|
|
107
|
+
declare function serializeSchema(services: AnyServiceSchemaMap): SerializedServerSchema;
|
|
106
108
|
/**
|
|
107
109
|
* The schema for a {@link Service}. This is used to define a service, specifically
|
|
108
110
|
* its initial state and procedures.
|
|
@@ -410,6 +412,6 @@ interface ProcStream {
|
|
|
410
412
|
*/
|
|
411
413
|
declare function createServer<Services extends AnyServiceSchemaMap>(transport: ServerTransport<Connection>, services: Services, extendedContext?: Omit<ServiceContext, 'state'>): Server<Services>;
|
|
412
414
|
|
|
413
|
-
var version = "0.18.
|
|
415
|
+
var version = "0.18.5";
|
|
414
416
|
|
|
415
|
-
export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer };
|
|
417
|
+
export { Client, PayloadType, ProcErrors, ProcHandler, ProcInit, ProcInput, ProcOutput, ProcType, ProcedureMap, version as RIVER_VERSION, Result, RiverError, RiverUncaughtSchema, SerializedServerSchema, Server, Service, ServiceConfiguration, ServiceContext, ServiceSchema, createClient, createServer, serializeSchema };
|
package/dist/router/index.js
CHANGED
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
UNCAUGHT_ERROR,
|
|
8
8
|
createClient,
|
|
9
9
|
createServer,
|
|
10
|
+
serializeSchema,
|
|
10
11
|
version
|
|
11
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-6Q3MSICL.js";
|
|
12
13
|
import "../chunk-VH3NGOXQ.js";
|
|
13
14
|
import "../chunk-WER2DWCP.js";
|
|
14
15
|
export {
|
|
@@ -20,5 +21,6 @@ export {
|
|
|
20
21
|
ServiceSchema,
|
|
21
22
|
UNCAUGHT_ERROR,
|
|
22
23
|
createClient,
|
|
23
|
-
createServer
|
|
24
|
+
createServer,
|
|
25
|
+
serializeSchema
|
|
24
26
|
};
|
package/dist/util/testHelpers.js
CHANGED
package/package.json
CHANGED