bkper-js 1.24.0 → 1.25.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
@@ -1071,6 +1071,53 @@ export declare class Book {
1071
1071
  getBalancesReport(query: string): Promise<BalancesReport>;
1072
1072
  }
1073
1073
 
1074
+ /**
1075
+ *
1076
+ * This class defines a Bot Response associated to an [[Event]].
1077
+ *
1078
+ * @public
1079
+ */
1080
+ export declare class BotResponse {
1081
+ payload: bkper.BotResponse;
1082
+ constructor(payload?: bkper.BotResponse);
1083
+ /**
1084
+ * @return The type of this Bot Response
1085
+ */
1086
+ getType(): BotResponseType | undefined;
1087
+ /**
1088
+ * @return The agent id of this Bot Response
1089
+ */
1090
+ getAgentId(): string | undefined;
1091
+ /**
1092
+ * @return The message of this Bot Response
1093
+ */
1094
+ getMessage(): string | undefined;
1095
+ /**
1096
+ * @returns The date this Bot Response was created
1097
+ */
1098
+ getCreatedAt(): Date | undefined;
1099
+ }
1100
+
1101
+ /**
1102
+ * Enum that represents the type of a Bot Response
1103
+ *
1104
+ * @public
1105
+ */
1106
+ export declare enum BotResponseType {
1107
+ /**
1108
+ * Info bot response
1109
+ */
1110
+ INFO = "INFO",
1111
+ /**
1112
+ * Warning bot response
1113
+ */
1114
+ WARNING = "WARNING",
1115
+ /**
1116
+ * Error bot response
1117
+ */
1118
+ ERROR = "ERROR"
1119
+ }
1120
+
1074
1121
  /**
1075
1122
  * This class defines a Collection of [[Books]].
1076
1123
  *
@@ -1389,27 +1436,32 @@ export declare enum DecimalSeparator {
1389
1436
  */
1390
1437
  export declare class Event {
1391
1438
  payload: bkper.Event;
1439
+
1392
1440
  constructor(payload?: bkper.Event);
1393
1441
  /**
1394
1442
  * @returns The wrapped plain json object
1395
1443
  */
1396
1444
  json(): bkper.Event;
1397
1445
  /**
1398
- * @returns The user who performed the event
1446
+ * @returns The user who performed the Event
1399
1447
  */
1400
1448
  getUser(): User | undefined;
1401
1449
  /**
1402
- * @returns The user who performed the event
1450
+ * @returns The user who performed the Event
1403
1451
  */
1404
1452
  getAgent(): Agent | undefined;
1405
1453
  /**
1406
- * @returns The date the event was created
1454
+ * @returns The date the Event was created
1407
1455
  */
1408
1456
  getCreatedAt(): Date | undefined;
1409
1457
  /**
1410
- * @returns The type of the event
1458
+ * @returns The type of the Event
1411
1459
  */
1412
1460
  getType(): EventType | undefined;
1461
+ /**
1462
+ * @returns The Bot Responses associated to this Event
1463
+ */
1464
+ getBotResponses(): BotResponse[];
1413
1465
  }
1414
1466
 
1415
1467
  /**
package/lib/index.js CHANGED
@@ -21,7 +21,8 @@ export { Template } from './model/Template.js';
21
21
  export { Transaction } from './model/Transaction.js';
22
22
  export { TransactionList } from './model/TransactionList.js';
23
23
  export { Event } from './model/Event.js';
24
+ export { BotResponse } from './model/BotResponse.js';
24
25
  export { EventList } from './model/EventList.js';
25
26
  export { User } from './model/User.js';
26
- export { Periodicity, DecimalSeparator, Permission, Visibility, AccountType, Period, Month, EventType, AppType } from './model/Enums.js';
27
+ export { Periodicity, DecimalSeparator, Permission, Visibility, AccountType, Period, Month, EventType, AppType, BotResponseType } from './model/Enums.js';
27
28
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ *
3
+ * This class defines a Bot Response associated to an [[Event]].
4
+ *
5
+ * @public
6
+ */
7
+ export class BotResponse {
8
+ constructor(payload) {
9
+ this.payload = payload || {};
10
+ }
11
+ /**
12
+ * @return The type of this Bot Response
13
+ */
14
+ getType() {
15
+ return this.payload.type;
16
+ }
17
+ /**
18
+ * @return The agent id of this Bot Response
19
+ */
20
+ getAgentId() {
21
+ return this.payload.agentId;
22
+ }
23
+ /**
24
+ * @return The message of this Bot Response
25
+ */
26
+ getMessage() {
27
+ return this.payload.message;
28
+ }
29
+ /**
30
+ * @returns The date this Bot Response was created
31
+ */
32
+ getCreatedAt() {
33
+ return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
34
+ }
35
+ }
36
+ //# sourceMappingURL=BotResponse.js.map
@@ -170,6 +170,26 @@ export var AppType;
170
170
  */
171
171
  AppType["BOT"] = "BOT";
172
172
  })(AppType || (AppType = {}));
173
+ /**
174
+ * Enum that represents the type of a Bot Response
175
+ *
176
+ * @public
177
+ */
178
+ export var BotResponseType;
179
+ (function (BotResponseType) {
180
+ /**
181
+ * Info bot response
182
+ */
183
+ BotResponseType["INFO"] = "INFO";
184
+ /**
185
+ * Warning bot response
186
+ */
187
+ BotResponseType["WARNING"] = "WARNING";
188
+ /**
189
+ * Error bot response
190
+ */
191
+ BotResponseType["ERROR"] = "ERROR";
192
+ })(BotResponseType || (BotResponseType = {}));
173
193
  /**
174
194
  * Enum that represents event types.
175
195
  *
@@ -1,5 +1,6 @@
1
- import { Agent } from "./Agent";
2
- import { User } from "./User";
1
+ import { Agent } from "./Agent.js";
2
+ import { BotResponse } from "./BotResponse.js";
3
+ import { User } from "./User.js";
3
4
  /**
4
5
  *
5
6
  * This class defines an Event from a [[Book]].
@@ -19,28 +20,44 @@ export class Event {
19
20
  return Object.assign({}, this.payload);
20
21
  }
21
22
  /**
22
- * @returns The user who performed the event
23
+ * @returns The user who performed the Event
23
24
  */
24
25
  getUser() {
25
26
  return this.payload.user ? new User(this.payload.user) : undefined;
26
27
  }
27
28
  /**
28
- * @returns The user who performed the event
29
+ * @returns The user who performed the Event
29
30
  */
30
31
  getAgent() {
31
32
  return this.payload.agent ? new Agent(this.payload.agent) : undefined;
32
33
  }
33
34
  /**
34
- * @returns The date the event was created
35
+ * @returns The date the Event was created
35
36
  */
36
37
  getCreatedAt() {
37
38
  return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
38
39
  }
39
40
  /**
40
- * @returns The type of the event
41
+ * @returns The type of the Event
41
42
  */
42
43
  getType() {
43
44
  return this.payload.type;
44
45
  }
46
+ /**
47
+ * @returns The Bot Responses associated to this Event
48
+ */
49
+ getBotResponses() {
50
+ if (this.botResponses !== undefined) {
51
+ return this.botResponses;
52
+ }
53
+ let botResponses = [];
54
+ if (this.payload.botResponses) {
55
+ for (const botResponse of this.payload.botResponses) {
56
+ botResponses.push(new BotResponse(botResponse));
57
+ }
58
+ }
59
+ this.botResponses = botResponses;
60
+ return this.botResponses;
61
+ }
45
62
  }
46
63
  //# sourceMappingURL=Event.js.map
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.11"
8
+ "packageVersion": "7.50.0"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.24.0",
3
+ "version": "1.25.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
@@ -34,7 +34,7 @@
34
34
  "postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
35
35
  },
36
36
  "peerDependencies": {
37
- "@bkper/bkper-api-types": "^5.12.0"
37
+ "@bkper/bkper-api-types": "^5.13.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "@google-cloud/local-auth": "^3.0.1",