@shushed/helpers 0.0.127 → 0.0.128

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.ts CHANGED
@@ -35665,7 +35665,7 @@ declare class ActionHelper<C extends Record<string, any>, O extends RequiredTrig
35665
35665
  private rateLimiters;
35666
35666
  private _envCache;
35667
35667
  private _rateLimitersCache;
35668
- constructor(options: ActionHelperOptions, onExecuteFunction: ((config: C, opts: O, receivedMessage: ReceivedMessage, actionHelper: ActionHelper<C, O, R>) => R));
35668
+ constructor(options: ActionHelperOptions, onExecuteFunction: ((config: C, opts: O, receivedMessage: ReceivedMessage | null, actionHelper: ActionHelper<C, O, R>) => R));
35669
35669
  isApplicableToRequest(message: ReceivedMessage, optionsEnchanced: O): boolean;
35670
35670
  static readonly LOCK_NOT_ACQUIRED_ERROR: unique symbol;
35671
35671
  withLock<T>(key: string, maxWaitTimeMs: number | undefined, fn: () => Promise<T>): Promise<T | typeof ActionHelper.LOCK_NOT_ACQUIRED_ERROR>;
@@ -35683,8 +35683,8 @@ declare class ActionHelper<C extends Record<string, any>, O extends RequiredTrig
35683
35683
  request: RateLimiterRedis;
35684
35684
  };
35685
35685
  preOnExecute(): Promise<void>;
35686
- onExecute(config: C, opts: O, message: ReceivedMessage): Promise<Awaited<R>>;
35687
- static create<C extends Record<string, any>, O extends RequiredTriggerOptions, R>(options: ActionHelperOptions, onExecuteFunction: (config: C, opts: O, message: ReceivedMessage, actionHelper: ActionHelper<C, O, R>) => R): ActionHelper<C, O, R>;
35686
+ onExecute(config: C, opts: O, message: null | ReceivedMessage): Promise<Awaited<R>>;
35687
+ static create<C extends Record<string, any>, O extends RequiredTriggerOptions, R>(options: ActionHelperOptions, onExecuteFunction: (config: C, opts: O, message: ReceivedMessage | null, actionHelper: ActionHelper<C, O, R>) => R): ActionHelper<C, O, R>;
35688
35688
  }
35689
35689
 
35690
35690
  type TriggerOnExecuteOptions = {
package/dist/index.js CHANGED
@@ -171376,7 +171376,7 @@ var ActionHelper = class _ActionHelper {
171376
171376
  if (err instanceof Error) {
171377
171377
  throw err;
171378
171378
  }
171379
- return this.opts.req.throw(427, "");
171379
+ return this.opts.req.throw(427, "Rate limit exceeeded");
171380
171380
  }
171381
171381
  }
171382
171382
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.127",
3
+ "version": "0.0.128",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",