@dudousxd/nestjs-durable-store-mikro-orm 0.33.2 → 0.33.3

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
@@ -2163,6 +2163,37 @@ var MikroOrmStateStore = class _MikroOrmStateStore {
2163
2163
  payload
2164
2164
  };
2165
2165
  }
2166
+ async listBufferedSignals(tokenPrefix, afterId, limit) {
2167
+ const em = this.fork();
2168
+ const rows = await em.find(BufferedSignalEntity, {
2169
+ token: {
2170
+ $like: `${tokenPrefix}%`
2171
+ },
2172
+ ...afterId !== void 0 ? {
2173
+ id: {
2174
+ $gt: Number(afterId)
2175
+ }
2176
+ } : {}
2177
+ }, {
2178
+ orderBy: {
2179
+ id: "asc"
2180
+ },
2181
+ limit
2182
+ });
2183
+ return rows.filter((r) => r.token.startsWith(tokenPrefix)).map((r) => ({
2184
+ id: String(r.id),
2185
+ token: r.token,
2186
+ payload: r.payload ?? void 0
2187
+ }));
2188
+ }
2189
+ async deleteBufferedSignals(ids) {
2190
+ if (ids.length === 0) return;
2191
+ await this.fork().nativeDelete(BufferedSignalEntity, {
2192
+ id: {
2193
+ $in: ids.map(Number)
2194
+ }
2195
+ });
2196
+ }
2166
2197
  async bufferEvent(input) {
2167
2198
  const em = this.fork();
2168
2199
  const e = new BufferedEventEntity();