@replit/river 0.212.2 → 0.213.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/{chunk-JPNTEDEA.js → chunk-2A645F27.js} +6 -6
- package/dist/{chunk-6KQ3NG67.js → chunk-X4PP65DW.js} +23 -2
- package/dist/chunk-X4PP65DW.js.map +1 -0
- package/dist/codec/index.js +2 -2
- package/dist/router/index.cjs +22 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +6 -6
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.js +1 -1
- package/dist/{services-CcGwuhiT.d.cts → services-C656NVV3.d.cts} +8 -8
- package/dist/{services-C-5pVP8V.d.ts → services-ChTb4jmc.d.ts} +8 -8
- package/dist/testUtil/index.cjs +18 -1
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +25 -2
- package/dist/testUtil/index.d.ts +25 -2
- package/dist/testUtil/index.js +19 -3
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +1 -1
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.js +2 -2
- package/dist/transport/impls/ws/server.cjs +1 -1
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.js +2 -2
- package/dist/transport/index.cjs +1 -1
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-6KQ3NG67.js.map +0 -1
- /package/dist/{chunk-JPNTEDEA.js.map → chunk-2A645F27.js.map} +0 -0
package/dist/router/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-
|
|
2
|
-
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client,
|
|
1
|
+
import { A as AnyServiceSchemaMap, M as MaybeDisposable, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-C656NVV3.cjs';
|
|
2
|
+
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client, N as Err, T as ErrResult, F as INVALID_REQUEST_CODE, O as Ok, X as OkResult, h as ProcErrors, d as ProcHandler, e as ProcInit, f as ProcRequest, g as ProcResponse, i as ProcType, z as Procedure, B as ProcedureErrorSchemaType, r as ProcedureMap, R as RPCProcedure, y as RawReadable, v as Readable, x as ReadableBrokenError, w as ReadableResult, H as ReaderErrorSchema, _ as ResponseData, Q as Result, Z as ResultUnwrapErr, Y as ResultUnwrapOk, m as SerializedProcedureSchema, q as SerializedProcedureSchemaProtocolv1, k as SerializedServerSchema, o as SerializedServerSchemaProtocolv1, l as SerializedServiceSchema, p as SerializedServiceSchemaProtocolv1, S as Service, c as ServiceConfiguration, u as StreamProcedure, t as SubscriptionProcedure, D as UNCAUGHT_ERROR_CODE, E as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, K as createClient, j as createServiceSchema, C as flattenErrorType, s as serializeSchema, n as serializeSchemaV1Compat } from '../services-C656NVV3.cjs';
|
|
3
3
|
import { TSchema, Static } from '@sinclair/typebox';
|
|
4
4
|
import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.cjs';
|
|
5
5
|
import { C as Connection, q as ServerHandshakeOptions } from '../transport-CxT7y8Qk.cjs';
|
|
@@ -15,7 +15,7 @@ type StreamId = string;
|
|
|
15
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
16
16
|
* @template Services - The type of services provided by the server.
|
|
17
17
|
*/
|
|
18
|
-
interface Server<Context extends
|
|
18
|
+
interface Server<Context extends MaybeDisposable, ParsedMetadata extends object, Services extends AnyServiceSchemaMap<Context>> {
|
|
19
19
|
/**
|
|
20
20
|
* Services defined for this server.
|
|
21
21
|
*/
|
|
@@ -60,7 +60,7 @@ type Middleware = (param: MiddlewareParam) => void;
|
|
|
60
60
|
* @param extendedContext - An optional object containing additional context to be passed to all services.
|
|
61
61
|
* @returns A promise that resolves to a server instance with the registered services.
|
|
62
62
|
*/
|
|
63
|
-
declare function createServer<
|
|
63
|
+
declare function createServer<MetadataSchema extends TSchema, ParsedMetadata extends object, Services extends AnyServiceSchemaMap<any>, Context extends MaybeDisposable = MaybeDisposable>(transport: ServerTransport<Connection, MetadataSchema, ParsedMetadata>, services: Services, providedServerOptions?: Partial<{
|
|
64
64
|
handshakeOptions?: ServerHandshakeOptions<MetadataSchema, ParsedMetadata>;
|
|
65
65
|
extendedContext?: Context;
|
|
66
66
|
/**
|
|
@@ -74,6 +74,6 @@ declare function createServer<Context extends object, MetadataSchema extends TSc
|
|
|
74
74
|
middlewares?: Array<Middleware>;
|
|
75
75
|
}>): Server<Context, ParsedMetadata, Services>;
|
|
76
76
|
|
|
77
|
-
var version = "0.
|
|
77
|
+
var version = "0.213.1";
|
|
78
78
|
|
|
79
|
-
export { type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
|
79
|
+
export { MaybeDisposable, type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnyServiceSchemaMap, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-
|
|
2
|
-
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client,
|
|
1
|
+
import { A as AnyServiceSchemaMap, M as MaybeDisposable, P as ProcedureHandlerContext, a as PayloadType, I as InstantiatedServiceSchemaMap, b as AnyProcedure } from '../services-ChTb4jmc.js';
|
|
2
|
+
export { J as BaseErrorSchemaType, G as CANCEL_CODE, L as Client, N as Err, T as ErrResult, F as INVALID_REQUEST_CODE, O as Ok, X as OkResult, h as ProcErrors, d as ProcHandler, e as ProcInit, f as ProcRequest, g as ProcResponse, i as ProcType, z as Procedure, B as ProcedureErrorSchemaType, r as ProcedureMap, R as RPCProcedure, y as RawReadable, v as Readable, x as ReadableBrokenError, w as ReadableResult, H as ReaderErrorSchema, _ as ResponseData, Q as Result, Z as ResultUnwrapErr, Y as ResultUnwrapOk, m as SerializedProcedureSchema, q as SerializedProcedureSchemaProtocolv1, k as SerializedServerSchema, o as SerializedServerSchemaProtocolv1, l as SerializedServiceSchema, p as SerializedServiceSchemaProtocolv1, S as Service, c as ServiceConfiguration, u as StreamProcedure, t as SubscriptionProcedure, D as UNCAUGHT_ERROR_CODE, E as UNEXPECTED_DISCONNECT_CODE, U as UploadProcedure, V as ValidProcType, W as Writable, K as createClient, j as createServiceSchema, C as flattenErrorType, s as serializeSchema, n as serializeSchemaV1Compat } from '../services-ChTb4jmc.js';
|
|
3
3
|
import { TSchema, Static } from '@sinclair/typebox';
|
|
4
4
|
import { c as TransportClientId, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.js';
|
|
5
5
|
import { C as Connection, q as ServerHandshakeOptions } from '../transport-pdbkDzmJ.js';
|
|
@@ -15,7 +15,7 @@ type StreamId = string;
|
|
|
15
15
|
* Represents a server with a set of services. Use {@link createServer} to create it.
|
|
16
16
|
* @template Services - The type of services provided by the server.
|
|
17
17
|
*/
|
|
18
|
-
interface Server<Context extends
|
|
18
|
+
interface Server<Context extends MaybeDisposable, ParsedMetadata extends object, Services extends AnyServiceSchemaMap<Context>> {
|
|
19
19
|
/**
|
|
20
20
|
* Services defined for this server.
|
|
21
21
|
*/
|
|
@@ -60,7 +60,7 @@ type Middleware = (param: MiddlewareParam) => void;
|
|
|
60
60
|
* @param extendedContext - An optional object containing additional context to be passed to all services.
|
|
61
61
|
* @returns A promise that resolves to a server instance with the registered services.
|
|
62
62
|
*/
|
|
63
|
-
declare function createServer<
|
|
63
|
+
declare function createServer<MetadataSchema extends TSchema, ParsedMetadata extends object, Services extends AnyServiceSchemaMap<any>, Context extends MaybeDisposable = MaybeDisposable>(transport: ServerTransport<Connection, MetadataSchema, ParsedMetadata>, services: Services, providedServerOptions?: Partial<{
|
|
64
64
|
handshakeOptions?: ServerHandshakeOptions<MetadataSchema, ParsedMetadata>;
|
|
65
65
|
extendedContext?: Context;
|
|
66
66
|
/**
|
|
@@ -74,6 +74,6 @@ declare function createServer<Context extends object, MetadataSchema extends TSc
|
|
|
74
74
|
middlewares?: Array<Middleware>;
|
|
75
75
|
}>): Server<Context, ParsedMetadata, Services>;
|
|
76
76
|
|
|
77
|
-
var version = "0.
|
|
77
|
+
var version = "0.213.1";
|
|
78
78
|
|
|
79
|
-
export { type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
|
79
|
+
export { MaybeDisposable, type Middleware, type MiddlewareContext, type MiddlewareParam, PayloadType, ProcedureHandlerContext, version as RIVER_VERSION, type Server, createServer };
|
package/dist/router/index.js
CHANGED
|
@@ -668,16 +668,16 @@ type AnyService = Service<object, object, object, ProcedureMap>;
|
|
|
668
668
|
/**
|
|
669
669
|
* Represents any {@link ServiceSchema} object.
|
|
670
670
|
*/
|
|
671
|
-
type AnyServiceSchema<Context extends
|
|
671
|
+
type AnyServiceSchema<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object> = InstanceType<ReturnType<typeof createServiceSchema<Context, ParsedMetadata>>>;
|
|
672
672
|
/**
|
|
673
673
|
* A dictionary of {@link ServiceSchema}s, where the key is the service name.
|
|
674
674
|
*/
|
|
675
|
-
type AnyServiceSchemaMap<Context extends
|
|
675
|
+
type AnyServiceSchemaMap<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object> = Record<string, AnyServiceSchema<Context, ParsedMetadata>>;
|
|
676
676
|
/**
|
|
677
677
|
* Takes a {@link AnyServiceSchemaMap} and returns a dictionary of instantiated
|
|
678
678
|
* services.
|
|
679
679
|
*/
|
|
680
|
-
type InstantiatedServiceSchemaMap<Context extends
|
|
680
|
+
type InstantiatedServiceSchemaMap<Context extends MaybeDisposable, ParsedMetadata extends object, T extends AnyServiceSchemaMap<Context, ParsedMetadata>> = {
|
|
681
681
|
[K in keyof T]: T[K] extends AnyServiceSchema<Context, ParsedMetadata> ? T[K] extends {
|
|
682
682
|
initializeState: (ctx: Context) => infer S;
|
|
683
683
|
procedures: infer P;
|
|
@@ -726,14 +726,14 @@ type ProcType<S extends AnyService, ProcName extends keyof S['procedures']> = S[
|
|
|
726
726
|
* was created via the {@link Procedure} constructors.
|
|
727
727
|
*/
|
|
728
728
|
type BrandedProcedureMap<Context, State, ParsedMetadata> = Record<string, Branded<AnyProcedure<Context, State, ParsedMetadata>>>;
|
|
729
|
-
type MaybeDisposable<
|
|
729
|
+
type MaybeDisposable<T extends object = Record<string, unknown>> = T & {
|
|
730
730
|
[Symbol.asyncDispose]?: () => PromiseLike<void>;
|
|
731
731
|
[Symbol.dispose]?: () => void;
|
|
732
732
|
};
|
|
733
733
|
/**
|
|
734
734
|
* The configuration for a service.
|
|
735
735
|
*/
|
|
736
|
-
interface ServiceConfiguration<Context extends
|
|
736
|
+
interface ServiceConfiguration<Context extends MaybeDisposable, State extends object> {
|
|
737
737
|
/**
|
|
738
738
|
* A factory function for creating a fresh state.
|
|
739
739
|
*/
|
|
@@ -819,7 +819,7 @@ declare function serializeSchema(services: AnyServiceSchemaMap, handshakeSchema?
|
|
|
819
819
|
*
|
|
820
820
|
* When defining procedures, always use the {@link Procedure} constructors to create them.
|
|
821
821
|
*/
|
|
822
|
-
declare function createServiceSchema<Context extends
|
|
822
|
+
declare function createServiceSchema<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object>(): {
|
|
823
823
|
new <State extends object, Procedures extends ProcedureMap<Context, State, ParsedMetadata>>(config: ServiceConfiguration<Context, State>, procedures: Procedures): {
|
|
824
824
|
/**
|
|
825
825
|
* Factory function for creating a fresh state.
|
|
@@ -1018,7 +1018,7 @@ declare function createServiceSchema<Context extends object = object, ParsedMeta
|
|
|
1018
1018
|
*
|
|
1019
1019
|
* @see {@link ServiceSchema.scaffold}
|
|
1020
1020
|
*/
|
|
1021
|
-
declare class ServiceScaffold<Context extends
|
|
1021
|
+
declare class ServiceScaffold<Context extends MaybeDisposable, State extends object, ParsedMetadata extends object> {
|
|
1022
1022
|
/**
|
|
1023
1023
|
* The configuration for this service.
|
|
1024
1024
|
*/
|
|
@@ -1095,4 +1095,4 @@ declare class ServiceScaffold<Context extends object, State extends object, Pars
|
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
1097
|
|
|
1098
|
-
export { type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L,
|
|
1098
|
+
export { type ReadableIterator as $, type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L, type MaybeDisposable as M, Err as N, Ok as O, type ProcedureHandlerContext as P, type Result as Q, type RpcProcedure as R, type Service as S, type ErrResult as T, type UploadProcedure as U, type ValidProcType as V, type Writable as W, type OkResult as X, type ResultUnwrapOk as Y, type ResultUnwrapErr as Z, type ResponseData as _, type PayloadType as a, type AnyProcedure as b, type ServiceConfiguration as c, type ProcHandler as d, type ProcInit as e, type ProcRequest as f, type ProcResponse as g, type ProcErrors as h, type ProcType as i, createServiceSchema as j, type SerializedServerSchema as k, type SerializedServiceSchema as l, type SerializedProcedureSchema as m, serializeSchemaV1Compat as n, type SerializedServerSchemaProtocolv1 as o, type SerializedServiceSchemaProtocolv1 as p, type SerializedProcedureSchemaProtocolv1 as q, type ProcedureMap as r, serializeSchema as s, type SubscriptionProcedure as t, type StreamProcedure as u, type Readable as v, type ReadableResult as w, ReadableBrokenError as x, ReadableImpl as y, Procedure as z };
|
|
@@ -668,16 +668,16 @@ type AnyService = Service<object, object, object, ProcedureMap>;
|
|
|
668
668
|
/**
|
|
669
669
|
* Represents any {@link ServiceSchema} object.
|
|
670
670
|
*/
|
|
671
|
-
type AnyServiceSchema<Context extends
|
|
671
|
+
type AnyServiceSchema<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object> = InstanceType<ReturnType<typeof createServiceSchema<Context, ParsedMetadata>>>;
|
|
672
672
|
/**
|
|
673
673
|
* A dictionary of {@link ServiceSchema}s, where the key is the service name.
|
|
674
674
|
*/
|
|
675
|
-
type AnyServiceSchemaMap<Context extends
|
|
675
|
+
type AnyServiceSchemaMap<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object> = Record<string, AnyServiceSchema<Context, ParsedMetadata>>;
|
|
676
676
|
/**
|
|
677
677
|
* Takes a {@link AnyServiceSchemaMap} and returns a dictionary of instantiated
|
|
678
678
|
* services.
|
|
679
679
|
*/
|
|
680
|
-
type InstantiatedServiceSchemaMap<Context extends
|
|
680
|
+
type InstantiatedServiceSchemaMap<Context extends MaybeDisposable, ParsedMetadata extends object, T extends AnyServiceSchemaMap<Context, ParsedMetadata>> = {
|
|
681
681
|
[K in keyof T]: T[K] extends AnyServiceSchema<Context, ParsedMetadata> ? T[K] extends {
|
|
682
682
|
initializeState: (ctx: Context) => infer S;
|
|
683
683
|
procedures: infer P;
|
|
@@ -726,14 +726,14 @@ type ProcType<S extends AnyService, ProcName extends keyof S['procedures']> = S[
|
|
|
726
726
|
* was created via the {@link Procedure} constructors.
|
|
727
727
|
*/
|
|
728
728
|
type BrandedProcedureMap<Context, State, ParsedMetadata> = Record<string, Branded<AnyProcedure<Context, State, ParsedMetadata>>>;
|
|
729
|
-
type MaybeDisposable<
|
|
729
|
+
type MaybeDisposable<T extends object = Record<string, unknown>> = T & {
|
|
730
730
|
[Symbol.asyncDispose]?: () => PromiseLike<void>;
|
|
731
731
|
[Symbol.dispose]?: () => void;
|
|
732
732
|
};
|
|
733
733
|
/**
|
|
734
734
|
* The configuration for a service.
|
|
735
735
|
*/
|
|
736
|
-
interface ServiceConfiguration<Context extends
|
|
736
|
+
interface ServiceConfiguration<Context extends MaybeDisposable, State extends object> {
|
|
737
737
|
/**
|
|
738
738
|
* A factory function for creating a fresh state.
|
|
739
739
|
*/
|
|
@@ -819,7 +819,7 @@ declare function serializeSchema(services: AnyServiceSchemaMap, handshakeSchema?
|
|
|
819
819
|
*
|
|
820
820
|
* When defining procedures, always use the {@link Procedure} constructors to create them.
|
|
821
821
|
*/
|
|
822
|
-
declare function createServiceSchema<Context extends
|
|
822
|
+
declare function createServiceSchema<Context extends MaybeDisposable = MaybeDisposable, ParsedMetadata extends object = object>(): {
|
|
823
823
|
new <State extends object, Procedures extends ProcedureMap<Context, State, ParsedMetadata>>(config: ServiceConfiguration<Context, State>, procedures: Procedures): {
|
|
824
824
|
/**
|
|
825
825
|
* Factory function for creating a fresh state.
|
|
@@ -1018,7 +1018,7 @@ declare function createServiceSchema<Context extends object = object, ParsedMeta
|
|
|
1018
1018
|
*
|
|
1019
1019
|
* @see {@link ServiceSchema.scaffold}
|
|
1020
1020
|
*/
|
|
1021
|
-
declare class ServiceScaffold<Context extends
|
|
1021
|
+
declare class ServiceScaffold<Context extends MaybeDisposable, State extends object, ParsedMetadata extends object> {
|
|
1022
1022
|
/**
|
|
1023
1023
|
* The configuration for this service.
|
|
1024
1024
|
*/
|
|
@@ -1095,4 +1095,4 @@ declare class ServiceScaffold<Context extends object, State extends object, Pars
|
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
1097
|
|
|
1098
|
-
export { type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L,
|
|
1098
|
+
export { type ReadableIterator as $, type AnyServiceSchemaMap as A, type ProcedureErrorSchemaType as B, flattenErrorType as C, UNCAUGHT_ERROR_CODE as D, UNEXPECTED_DISCONNECT_CODE as E, INVALID_REQUEST_CODE as F, CANCEL_CODE as G, ReaderErrorSchema as H, type InstantiatedServiceSchemaMap as I, type BaseErrorSchemaType as J, createClient as K, type Client as L, type MaybeDisposable as M, Err as N, Ok as O, type ProcedureHandlerContext as P, type Result as Q, type RpcProcedure as R, type Service as S, type ErrResult as T, type UploadProcedure as U, type ValidProcType as V, type Writable as W, type OkResult as X, type ResultUnwrapOk as Y, type ResultUnwrapErr as Z, type ResponseData as _, type PayloadType as a, type AnyProcedure as b, type ServiceConfiguration as c, type ProcHandler as d, type ProcInit as e, type ProcRequest as f, type ProcResponse as g, type ProcErrors as h, type ProcType as i, createServiceSchema as j, type SerializedServerSchema as k, type SerializedServiceSchema as l, type SerializedProcedureSchema as m, serializeSchemaV1Compat as n, type SerializedServerSchemaProtocolv1 as o, type SerializedServiceSchemaProtocolv1 as p, type SerializedProcedureSchemaProtocolv1 as q, type ProcedureMap as r, serializeSchema as s, type SubscriptionProcedure as t, type StreamProcedure as u, type Readable as v, type ReadableResult as w, ReadableBrokenError as x, ReadableImpl as y, Procedure as z };
|
package/dist/testUtil/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(testUtil_exports, {
|
|
|
35
35
|
createDummyTransportMessage: () => createDummyTransportMessage,
|
|
36
36
|
createLocalWebSocketClient: () => createLocalWebSocketClient,
|
|
37
37
|
createMockTransportNetwork: () => createMockTransportNetwork,
|
|
38
|
+
createPartialContext: () => createPartialContext,
|
|
38
39
|
createWebSocketServer: () => createWebSocketServer,
|
|
39
40
|
dummySession: () => dummySession,
|
|
40
41
|
getClientSendFn: () => getClientSendFn,
|
|
@@ -558,7 +559,7 @@ function coerceErrorString(err) {
|
|
|
558
559
|
}
|
|
559
560
|
|
|
560
561
|
// package.json
|
|
561
|
-
var version = "0.
|
|
562
|
+
var version = "0.213.1";
|
|
562
563
|
|
|
563
564
|
// tracing/index.ts
|
|
564
565
|
function getPropagationContext(ctx) {
|
|
@@ -2863,6 +2864,21 @@ function closeAllConnections(transport) {
|
|
|
2863
2864
|
conn.close();
|
|
2864
2865
|
}
|
|
2865
2866
|
}
|
|
2867
|
+
function createPartialContext(partial) {
|
|
2868
|
+
return new Proxy(partial, {
|
|
2869
|
+
get(target, prop, receiver) {
|
|
2870
|
+
if (prop in target) {
|
|
2871
|
+
return Reflect.get(target, prop, receiver);
|
|
2872
|
+
}
|
|
2873
|
+
if (typeof prop === "string" && prop !== "then") {
|
|
2874
|
+
throw new Error(
|
|
2875
|
+
`${prop} is not mocked in the test context. Provide it via createPartialContext if your test needs it.`
|
|
2876
|
+
);
|
|
2877
|
+
}
|
|
2878
|
+
return void 0;
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
}
|
|
2866
2882
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2867
2883
|
0 && (module.exports = {
|
|
2868
2884
|
InMemoryConnection,
|
|
@@ -2870,6 +2886,7 @@ function closeAllConnections(transport) {
|
|
|
2870
2886
|
createDummyTransportMessage,
|
|
2871
2887
|
createLocalWebSocketClient,
|
|
2872
2888
|
createMockTransportNetwork,
|
|
2889
|
+
createPartialContext,
|
|
2873
2890
|
createWebSocketServer,
|
|
2874
2891
|
dummySession,
|
|
2875
2892
|
getClientSendFn,
|