@dudousxd/nestjs-durable-store-mikro-orm 0.28.0 → 0.28.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/index.cjs CHANGED
@@ -1108,6 +1108,18 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
1108
1108
  await em.upsert(StepCheckpointEntity, toCheckpointEntity(checkpoint));
1109
1109
  await em.flush();
1110
1110
  }
1111
+ async saveCheckpointIfPending(checkpoint) {
1112
+ const { runId: _runId, seq: _seq, ...data } = toCheckpointEntity(checkpoint);
1113
+ const affected = await this.fork().nativeUpdate(StepCheckpointEntity, {
1114
+ runId: checkpoint.runId,
1115
+ seq: checkpoint.seq,
1116
+ status: "pending"
1117
+ }, {
1118
+ ...data,
1119
+ wakeAt: checkpoint.wakeAt != null ? new Date(checkpoint.wakeAt) : null
1120
+ });
1121
+ return affected > 0;
1122
+ }
1111
1123
  async transaction(work) {
1112
1124
  return this.fork().transactional(async (em) => work({
1113
1125
  raw: em,