bkper-js 1.25.0 → 1.26.0

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/lib/index.d.ts CHANGED
@@ -1462,6 +1462,10 @@ export declare class Event {
1462
1462
  * @returns The Bot Responses associated to this Event
1463
1463
  */
1464
1464
  getBotResponses(): BotResponse[];
1465
+ /**
1466
+ * @returns True if this Event has at least one Bot Response of type ERROR
1467
+ */
1468
+ hasErrorResponse(): boolean;
1465
1469
  }
1466
1470
 
1467
1471
  /**
@@ -1,5 +1,6 @@
1
1
  import { Agent } from "./Agent.js";
2
2
  import { BotResponse } from "./BotResponse.js";
3
+ import { BotResponseType } from "./Enums.js";
3
4
  import { User } from "./User.js";
4
5
  /**
5
6
  *
@@ -59,5 +60,17 @@ export class Event {
59
60
  this.botResponses = botResponses;
60
61
  return this.botResponses;
61
62
  }
63
+ /**
64
+ * @returns True if this Event has at least one Bot Response of type ERROR
65
+ */
66
+ hasErrorResponse() {
67
+ const botResponses = this.getBotResponses();
68
+ for (const botResponse of botResponses) {
69
+ if (botResponse.getType() === BotResponseType.ERROR) {
70
+ return true;
71
+ }
72
+ }
73
+ return false;
74
+ }
62
75
  }
63
76
  //# sourceMappingURL=Event.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",