@dudousxd/nestjs-durable-store-typeorm 0.25.5 → 0.25.7

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
@@ -1192,7 +1192,7 @@ var TypeOrmStateStore = class {
1192
1192
  }
1193
1193
  }
1194
1194
  async createRun(run) {
1195
- await this.runs().save(toRunEntity(run));
1195
+ await this.runs().createQueryBuilder().insert().values(toRunEntity(run)).updateEntity(false).execute();
1196
1196
  await this.reindexAttributes(run.id, run.searchAttributes);
1197
1197
  }
1198
1198
  async updateRun(runId, inputPatch) {
@@ -1833,6 +1833,15 @@ var TypeOrmStateStore = class {
1833
1833
  });
1834
1834
  return e ? fromCheckpointEntity(e) : void 0;
1835
1835
  }
1836
+ async hasCheckpoints(runId, fromSeq, toSeq, statuses) {
1837
+ if (statuses.length === 0) return false;
1838
+ const row = await this.checkpoints().createQueryBuilder("cp").select("cp.seq", "seq").where({
1839
+ runId,
1840
+ seq: (0, import_typeorm2.Between)(fromSeq, toSeq),
1841
+ status: (0, import_typeorm2.In)(statuses)
1842
+ }).orderBy("cp.seq", "DESC").limit(1).getRawOne();
1843
+ return row !== void 0;
1844
+ }
1836
1845
  async countCheckpoints(runId, fromSeq, toSeq, statuses) {
1837
1846
  if (statuses.length === 0) return 0;
1838
1847
  const row = await this.checkpoints().createQueryBuilder("cp").select("COUNT(*)", "count").where({