@replit/river 0.201.0 → 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 (32) hide show
  1. package/dist/{chunk-UBUD2LMZ.js → chunk-2T22KY5X.js} +3 -3
  2. package/dist/{chunk-52DVJUVZ.js → chunk-BDUOHZMF.js} +2 -2
  3. package/dist/{chunk-OZ3ITXW5.js → chunk-NSH4D6OB.js} +3 -3
  4. package/dist/{chunk-7IUEEQP7.js → chunk-QMXUCLGE.js} +2 -2
  5. package/dist/{chunk-7IUEEQP7.js.map → chunk-QMXUCLGE.js.map} +1 -1
  6. package/dist/{chunk-PJ4GJ5CU.js → chunk-W4AGHFXK.js} +2 -2
  7. package/dist/router/index.cjs +20 -3
  8. package/dist/router/index.cjs.map +1 -1
  9. package/dist/router/index.d.cts +5 -4
  10. package/dist/router/index.d.ts +5 -4
  11. package/dist/router/index.js +20 -3
  12. package/dist/router/index.js.map +1 -1
  13. package/dist/{services-e71ea921.d.ts → services-a05f5174.d.ts} +7 -2
  14. package/dist/testUtil/index.cjs +1 -1
  15. package/dist/testUtil/index.cjs.map +1 -1
  16. package/dist/testUtil/index.d.cts +1 -1
  17. package/dist/testUtil/index.d.ts +1 -1
  18. package/dist/testUtil/index.js +4 -4
  19. package/dist/transport/impls/ws/client.cjs +1 -1
  20. package/dist/transport/impls/ws/client.cjs.map +1 -1
  21. package/dist/transport/impls/ws/client.js +4 -4
  22. package/dist/transport/impls/ws/server.cjs +1 -1
  23. package/dist/transport/impls/ws/server.cjs.map +1 -1
  24. package/dist/transport/impls/ws/server.js +4 -4
  25. package/dist/transport/index.cjs +1 -1
  26. package/dist/transport/index.cjs.map +1 -1
  27. package/dist/transport/index.js +4 -4
  28. package/package.json +1 -1
  29. /package/dist/{chunk-UBUD2LMZ.js.map → chunk-2T22KY5X.js.map} +0 -0
  30. /package/dist/{chunk-52DVJUVZ.js.map → chunk-BDUOHZMF.js.map} +0 -0
  31. /package/dist/{chunk-OZ3ITXW5.js.map → chunk-NSH4D6OB.js.map} +0 -0
  32. /package/dist/{chunk-PJ4GJ5CU.js.map → chunk-W4AGHFXK.js.map} +0 -0
@@ -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
  */
@@ -525,7 +525,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
525
525
  var import_api = require("@opentelemetry/api");
526
526
 
527
527
  // package.json
528
- var version = "0.201.0";
528
+ var version = "0.202.0";
529
529
 
530
530
  // tracing/index.ts
531
531
  function getPropagationContext(ctx) {