@dudousxd/nestjs-durable-store-mikro-orm 0.33.0 → 0.33.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.d.cts CHANGED
@@ -273,6 +273,7 @@ declare class MikroOrmStateStore implements StateStore {
273
273
  * the in-memory store's reindex so the side-table always reflects the run's live searchAttributes. */
274
274
  private reindexAttributes;
275
275
  getRun(runId: string): Promise<WorkflowRun | null>;
276
+ getRuns(runIds: string[]): Promise<WorkflowRun[]>;
276
277
  deleteRun(runId: string): Promise<void>;
277
278
  deleteRuns(runIds: string[]): Promise<void>;
278
279
  pruneTerminalRuns(policy: RetentionPolicy, nowMs: number, limit: number): Promise<number>;
package/dist/index.d.ts CHANGED
@@ -273,6 +273,7 @@ declare class MikroOrmStateStore implements StateStore {
273
273
  * the in-memory store's reindex so the side-table always reflects the run's live searchAttributes. */
274
274
  private reindexAttributes;
275
275
  getRun(runId: string): Promise<WorkflowRun | null>;
276
+ getRuns(runIds: string[]): Promise<WorkflowRun[]>;
276
277
  deleteRun(runId: string): Promise<void>;
277
278
  deleteRuns(runIds: string[]): Promise<void>;
278
279
  pruneTerminalRuns(policy: RetentionPolicy, nowMs: number, limit: number): Promise<number>;
package/dist/index.js CHANGED
@@ -1112,6 +1112,17 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
1112
1112
  });
1113
1113
  return entity ? fromRunEntity(entity) : null;
1114
1114
  }
1115
+ async getRuns(runIds) {
1116
+ if (runIds.length === 0) return [];
1117
+ const rows = await this.fork().find(WorkflowRunEntity, {
1118
+ id: {
1119
+ $in: [
1120
+ ...new Set(runIds)
1121
+ ]
1122
+ }
1123
+ });
1124
+ return rows.map(fromRunEntity);
1125
+ }
1115
1126
  async deleteRun(runId) {
1116
1127
  const em = this.fork();
1117
1128
  await em.nativeDelete(StepCheckpointEntity, {