@dudousxd/nestjs-durable-store-typeorm 0.25.2 → 0.25.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
@@ -1888,6 +1888,31 @@ var TypeOrmStateStore = class {
1888
1888
  payload: e.payload ?? void 0
1889
1889
  };
1890
1890
  }
1891
+ async listBufferedSignals(tokenPrefix, afterId, limit) {
1892
+ const rows = await this.buffered().find({
1893
+ where: {
1894
+ token: (0, import_typeorm2.Like)(`${tokenPrefix}%`),
1895
+ ...afterId !== void 0 ? {
1896
+ id: (0, import_typeorm2.MoreThan)(Number(afterId))
1897
+ } : {}
1898
+ },
1899
+ order: {
1900
+ id: "ASC"
1901
+ },
1902
+ take: limit
1903
+ });
1904
+ return rows.filter((r) => r.token.startsWith(tokenPrefix)).map((r) => ({
1905
+ id: String(r.id),
1906
+ token: r.token,
1907
+ payload: r.payload ?? void 0
1908
+ }));
1909
+ }
1910
+ async deleteBufferedSignals(ids) {
1911
+ if (ids.length === 0) return;
1912
+ await this.buffered().delete({
1913
+ id: (0, import_typeorm2.In)(ids.map(Number))
1914
+ });
1915
+ }
1891
1916
  async bufferEvent(input) {
1892
1917
  await this.bufferedEvents().save({
1893
1918
  id: input.id,