@yielded/auth-persistence-drizzle 0.1.0-beta.16 → 0.1.0-beta.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.
@@ -86,8 +86,8 @@ const conditionMatches = (condition) => Effect.flatMap(CurrentD1PlanningDatabase
86
86
  function runPlanned(plan, isConstraintConflict, recoverGuard) {
87
87
  const planned = plan.pipe(Effect.map((value) => ({
88
88
  ...value,
89
- isConstraintConflict,
90
- recoverGuard
89
+ ...isConstraintConflict === void 0 ? {} : { isConstraintConflict },
90
+ ...recoverGuard === void 0 ? {} : { recoverGuard }
91
91
  })));
92
92
  const execution = Effect.gen(function* () {
93
93
  const batch = yield* Effect.serviceOption(CurrentD1SessionBatch);
@@ -504,9 +504,10 @@ const makeD1StatefulSessions = (mapping) => {
504
504
  const decoded = yield* Effect.forEach(rows, (row) => mapping.session.decode(row));
505
505
  const codec = Schema.toCodecJson(Schema.toType(SessionMetadata));
506
506
  const sessions = yield* Effect.forEach(decoded.slice(0, input.limit), (record) => Schema.encodeEffect(codec)(record).pipe(Effect.flatMap(Schema.decodeEffect(codec))));
507
+ const nextCursor = decoded.length <= input.limit ? void 0 : sessions.at(-1)?.sessionId;
507
508
  return {
508
509
  sessions,
509
- ...decoded.length <= input.limit ? {} : { nextCursor: sessions.at(-1)?.sessionId }
510
+ ...nextCursor === void 0 ? {} : { nextCursor }
510
511
  };
511
512
  }).pipe(terminalD1) }
512
513
  };