@replit/river 0.200.5 → 0.202.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.
Files changed (60) hide show
  1. package/dist/{chunk-MSJGPQRT.js → chunk-2T22KY5X.js} +4 -6
  2. package/dist/chunk-2T22KY5X.js.map +1 -0
  3. package/dist/{chunk-Z7Q5CDXD.js → chunk-BDUOHZMF.js} +2 -2
  4. package/dist/{chunk-WN7GEBMX.js → chunk-NSH4D6OB.js} +5 -7
  5. package/dist/chunk-NSH4D6OB.js.map +1 -0
  6. package/dist/{chunk-64J442AK.js → chunk-QMXUCLGE.js} +10 -10
  7. package/dist/chunk-QMXUCLGE.js.map +1 -0
  8. package/dist/{chunk-3FMY7VTM.js → chunk-W4AGHFXK.js} +332 -3
  9. package/dist/chunk-W4AGHFXK.js.map +1 -0
  10. package/dist/{client-ba6815ae.d.ts → client-a32692b0.d.ts} +2 -2
  11. package/dist/{connection-d217c989.d.ts → connection-48d021ca.d.ts} +2 -2
  12. package/dist/{context-8d1ed9a1.d.ts → context-8d263a7f.d.ts} +2 -2
  13. package/dist/logging/index.d.cts +1 -1
  14. package/dist/logging/index.d.ts +1 -1
  15. package/dist/{message-45658364.d.ts → message-3def9ded.d.ts} +1 -1
  16. package/dist/router/index.cjs +21 -4
  17. package/dist/router/index.cjs.map +1 -1
  18. package/dist/router/index.d.cts +10 -9
  19. package/dist/router/index.d.ts +10 -9
  20. package/dist/router/index.js +337 -42
  21. package/dist/router/index.js.map +1 -1
  22. package/dist/{server-eb7d2cfd.d.ts → server-48d90a77.d.ts} +2 -2
  23. package/dist/{services-94e0afc3.d.ts → services-a05f5174.d.ts} +11 -6
  24. package/dist/testUtil/index.cjs +2616 -0
  25. package/dist/testUtil/index.cjs.map +1 -0
  26. package/dist/{util/testHelpers.d.ts → testUtil/index.d.cts} +27 -18
  27. package/dist/{util/testHelpers.d.cts → testUtil/index.d.ts} +27 -18
  28. package/dist/testUtil/index.js +370 -0
  29. package/dist/testUtil/index.js.map +1 -0
  30. package/dist/transport/impls/ws/client.cjs +2 -2
  31. package/dist/transport/impls/ws/client.cjs.map +1 -1
  32. package/dist/transport/impls/ws/client.d.cts +4 -4
  33. package/dist/transport/impls/ws/client.d.ts +4 -4
  34. package/dist/transport/impls/ws/client.js +4 -5
  35. package/dist/transport/impls/ws/client.js.map +1 -1
  36. package/dist/transport/impls/ws/server.cjs +2 -2
  37. package/dist/transport/impls/ws/server.cjs.map +1 -1
  38. package/dist/transport/impls/ws/server.d.cts +4 -4
  39. package/dist/transport/impls/ws/server.d.ts +4 -4
  40. package/dist/transport/impls/ws/server.js +4 -5
  41. package/dist/transport/impls/ws/server.js.map +1 -1
  42. package/dist/transport/index.cjs +2 -2
  43. package/dist/transport/index.cjs.map +1 -1
  44. package/dist/transport/index.d.cts +4 -4
  45. package/dist/transport/index.d.ts +4 -4
  46. package/dist/transport/index.js +6 -8
  47. package/package.json +3 -3
  48. package/dist/chunk-3FMY7VTM.js.map +0 -1
  49. package/dist/chunk-64J442AK.js.map +0 -1
  50. package/dist/chunk-7Z5MSOKL.js +0 -340
  51. package/dist/chunk-7Z5MSOKL.js.map +0 -1
  52. package/dist/chunk-MSJGPQRT.js.map +0 -1
  53. package/dist/chunk-WN7GEBMX.js.map +0 -1
  54. package/dist/chunk-ZVWJN6V2.js +0 -307
  55. package/dist/chunk-ZVWJN6V2.js.map +0 -1
  56. package/dist/util/testHelpers.cjs +0 -1563
  57. package/dist/util/testHelpers.cjs.map +0 -1
  58. package/dist/util/testHelpers.js +0 -250
  59. package/dist/util/testHelpers.js.map +0 -1
  60. /package/dist/{chunk-Z7Q5CDXD.js.map → chunk-BDUOHZMF.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { TObject, TString, TSchema, TUnion, TLiteral, TNever, Static } from '@sinclair/typebox';
2
- import { C as Connection, q as ClientHandshakeOptions, v as ProcedureHandlerContext, p as ServiceContext } from './context-8d1ed9a1.js';
3
- import { c as TransportClientId } from './message-45658364.js';
4
- import { C as ClientTransport } from './client-ba6815ae.js';
2
+ import { C as Connection, n as ClientHandshakeOptions, t as ProcedureHandlerContext, s as ServiceContext } from './context-8d263a7f.js';
3
+ import { c as TransportClientId } from './message-3def9ded.js';
4
+ import { C as ClientTransport } from './client-a32692b0.js';
5
5
 
6
6
  /**
7
7
  * {@link UNCAUGHT_ERROR_CODE} is the code that is used when an error is thrown
@@ -504,6 +504,7 @@ declare const Procedure: {
504
504
  interface Service<State extends object, Procs extends ProcedureMap<State>> {
505
505
  readonly state: State;
506
506
  readonly procedures: Procs;
507
+ [Symbol.asyncDispose]: () => Promise<void>;
507
508
  }
508
509
  /**
509
510
  * Represents any {@link Service} object.
@@ -567,6 +568,10 @@ type ProcType<S extends AnyService, ProcName extends keyof S['procedures']> = S[
567
568
  * was created via the {@link Procedure} constructors.
568
569
  */
569
570
  type BrandedProcedureMap<State> = Record<string, Branded<AnyProcedure<State>>>;
571
+ type MaybeDisposable<State extends object> = State & {
572
+ [Symbol.asyncDispose]?: () => Promise<void>;
573
+ [Symbol.dispose]?: () => void;
574
+ };
570
575
  /**
571
576
  * The configuration for a service.
572
577
  */
@@ -574,7 +579,7 @@ interface ServiceConfiguration<State extends object> {
574
579
  /**
575
580
  * A factory function for creating a fresh state.
576
581
  */
577
- initializeState: (extendedContext: ServiceContext) => State;
582
+ initializeState: (extendedContext: ServiceContext) => MaybeDisposable<State>;
578
583
  }
579
584
  interface SerializedProcedureSchemaProtocolv1 {
580
585
  init?: PayloadType;
@@ -636,7 +641,7 @@ declare class ServiceSchema<State extends object, Procedures extends ProcedureMa
636
641
  /**
637
642
  * Factory function for creating a fresh state.
638
643
  */
639
- protected readonly initializeState: (extendedContext: ServiceContext) => State;
644
+ protected readonly initializeState: (extendedContext: ServiceContext) => MaybeDisposable<State>;
640
645
  /**
641
646
  * The procedures for this service.
642
647
  */
@@ -833,4 +838,4 @@ declare class ServiceScaffold<State extends object> {
833
838
  }>;
834
839
  }
835
840
 
836
- export { AnyServiceSchemaMap as A, BaseErrorSchemaType as B, StreamProcedure as C, flattenErrorType as D, UNCAUGHT_ERROR_CODE as E, UNEXPECTED_DISCONNECT_CODE as F, INVALID_REQUEST_CODE as G, CANCEL_CODE as H, InstantiatedServiceSchemaMap as I, createClient as J, Client as K, Err as L, unwrapOrThrow as M, ErrResult as N, Ok as O, PayloadType as P, OkResult as Q, Readable as R, Service as S, ResultUnwrapOk as T, UploadProcedure as U, ValidProcType as V, Writable as W, ResultUnwrapErr as X, ResponseData as Y, ReadableIterator as a, ReadableResult as b, ProcedureErrorSchemaType as c, Procedure as d, Result as e, ReaderErrorSchema as f, AnyProcedure as g, ServiceConfiguration as h, ProcHandler as i, ProcInit as j, ProcRequest as k, ProcResponse as l, ProcErrors as m, ProcType as n, ServiceSchema as o, SerializedServerSchema as p, SerializedServiceSchema as q, SerializedProcedureSchema as r, serializeSchema as s, serializeSchemaV1Compat as t, SerializedServerSchemaProtocolv1 as u, SerializedServiceSchemaProtocolv1 as v, SerializedProcedureSchemaProtocolv1 as w, ProcedureMap as x, RpcProcedure as y, SubscriptionProcedure as z };
841
+ export { AnyServiceSchemaMap as A, INVALID_REQUEST_CODE as B, CANCEL_CODE as C, ReaderErrorSchema as D, BaseErrorSchemaType as E, createClient as F, Client as G, Err as H, InstantiatedServiceSchemaMap as I, unwrapOrThrow as J, Result as K, ErrResult as L, OkResult as M, ResultUnwrapOk as N, Ok as O, ProcHandler as P, ResultUnwrapErr as Q, RpcProcedure as R, Service as S, ResponseData as T, UploadProcedure as U, ValidProcType as V, Writable as W, ReadableIterator as X, ReadableResult as Y, AnyProcedure as a, ServiceConfiguration as b, ProcInit as c, ProcRequest as d, ProcResponse as e, ProcErrors as f, ProcType as g, ServiceSchema as h, SerializedServerSchema as i, SerializedServiceSchema as j, SerializedProcedureSchema as k, serializeSchemaV1Compat as l, SerializedServerSchemaProtocolv1 as m, SerializedServiceSchemaProtocolv1 as n, SerializedProcedureSchemaProtocolv1 as o, PayloadType as p, ProcedureMap as q, SubscriptionProcedure as r, serializeSchema as s, StreamProcedure as t, Readable as u, Procedure as v, ProcedureErrorSchemaType as w, flattenErrorType as x, UNCAUGHT_ERROR_CODE as y, UNEXPECTED_DISCONNECT_CODE as z };