bkper-js 1.47.2 → 1.47.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/lib/index.d.ts +882 -357
- package/lib/model/Account.js +86 -42
- package/lib/model/Agent.js +6 -0
- package/lib/model/Amount.js +72 -13
- package/lib/model/App.js +77 -26
- package/lib/model/BalancesReport.js +11 -5
- package/lib/model/Bkper.js +2 -2
- package/lib/model/Book.js +164 -94
- package/lib/model/BotResponse.js +13 -3
- package/lib/model/Collection.js +16 -2
- package/lib/model/Connection.js +8 -6
- package/lib/model/Conversation.js +9 -2
- package/lib/model/Event.js +18 -0
- package/lib/model/EventList.js +10 -5
- package/lib/model/File.js +31 -12
- package/lib/model/Group.js +75 -33
- package/lib/model/Integration.js +4 -2
- package/lib/model/Message.js +18 -5
- package/lib/model/Query.js +18 -4
- package/lib/model/Template.js +2 -0
- package/lib/model/Transaction.js +165 -81
- package/lib/model/TransactionList.js +14 -7
- package/lib/model/User.js +7 -1
- package/package.json +1 -1
package/lib/model/BotResponse.js
CHANGED
|
@@ -20,30 +20,40 @@ export class BotResponse {
|
|
|
20
20
|
this.payload = payload || {};
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Gets the type of this Bot Response.
|
|
24
|
+
*
|
|
25
|
+
* @returns The type of this Bot Response
|
|
24
26
|
*/
|
|
25
27
|
getType() {
|
|
26
28
|
return this.payload.type;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Gets the agent id of this Bot Response.
|
|
32
|
+
*
|
|
33
|
+
* @returns The agent id of this Bot Response
|
|
30
34
|
*/
|
|
31
35
|
getAgentId() {
|
|
32
36
|
return this.payload.agentId;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
|
-
*
|
|
39
|
+
* Gets the message of this Bot Response.
|
|
40
|
+
*
|
|
41
|
+
* @returns The message of this Bot Response
|
|
36
42
|
*/
|
|
37
43
|
getMessage() {
|
|
38
44
|
return this.payload.message;
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
47
|
+
* Gets the date this Bot Response was created.
|
|
48
|
+
*
|
|
41
49
|
* @returns The date this Bot Response was created
|
|
42
50
|
*/
|
|
43
51
|
getCreatedAt() {
|
|
44
52
|
return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
|
|
45
53
|
}
|
|
46
54
|
/**
|
|
55
|
+
* Gets the Event this Bot Response is associated to.
|
|
56
|
+
*
|
|
47
57
|
* @returns The Event this Bot Response is associated to
|
|
48
58
|
*/
|
|
49
59
|
getEvent() {
|
package/lib/model/Collection.js
CHANGED
|
@@ -19,18 +19,24 @@ export class Collection {
|
|
|
19
19
|
this.payload = payload || {};
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
+
* Gets an immutable copy of the JSON payload for this Collection.
|
|
23
|
+
*
|
|
22
24
|
* @returns The wrapped plain json object
|
|
23
25
|
*/
|
|
24
26
|
json() {
|
|
25
27
|
return Object.assign({}, this.payload);
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
30
|
+
* Gets the unique identifier of this Collection.
|
|
31
|
+
*
|
|
28
32
|
* @returns The id of this Collection
|
|
29
33
|
*/
|
|
30
34
|
getId() {
|
|
31
35
|
return this.payload.id;
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
38
|
+
* Gets the name of this Collection.
|
|
39
|
+
*
|
|
34
40
|
* @returns The name of this Collection
|
|
35
41
|
*/
|
|
36
42
|
getName() {
|
|
@@ -39,7 +45,9 @@ export class Collection {
|
|
|
39
45
|
/**
|
|
40
46
|
* Sets the name of the Collection.
|
|
41
47
|
*
|
|
42
|
-
* @
|
|
48
|
+
* @param name - The name to set
|
|
49
|
+
*
|
|
50
|
+
* @returns This Collection, for chaining
|
|
43
51
|
*/
|
|
44
52
|
setName(name) {
|
|
45
53
|
this.payload.name = name;
|
|
@@ -62,7 +70,9 @@ export class Collection {
|
|
|
62
70
|
return this.payload.permission ? this.payload.permission : undefined;
|
|
63
71
|
}
|
|
64
72
|
/**
|
|
65
|
-
*
|
|
73
|
+
* Gets all Books of this collection.
|
|
74
|
+
*
|
|
75
|
+
* @returns All Books of this collection
|
|
66
76
|
*/
|
|
67
77
|
getBooks() {
|
|
68
78
|
let books = [];
|
|
@@ -78,6 +88,8 @@ export class Collection {
|
|
|
78
88
|
/**
|
|
79
89
|
* Adds Books to this Collection.
|
|
80
90
|
*
|
|
91
|
+
* @param books - The Books to add to this Collection
|
|
92
|
+
*
|
|
81
93
|
* @returns The added Book objects
|
|
82
94
|
*/
|
|
83
95
|
addBooks(books) {
|
|
@@ -94,6 +106,8 @@ export class Collection {
|
|
|
94
106
|
/**
|
|
95
107
|
* Removes Books from this Collection.
|
|
96
108
|
*
|
|
109
|
+
* @param books - The Books to remove from this Collection
|
|
110
|
+
*
|
|
97
111
|
* @returns The removed Book objects
|
|
98
112
|
*/
|
|
99
113
|
removeBooks(books) {
|
package/lib/model/Connection.js
CHANGED
|
@@ -19,6 +19,8 @@ export class Connection {
|
|
|
19
19
|
this.payload = payload || {};
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
+
* Gets an immutable copy of the JSON payload for this Connection.
|
|
23
|
+
*
|
|
22
24
|
* @returns An immutable copy of the json payload
|
|
23
25
|
*/
|
|
24
26
|
json() {
|
|
@@ -45,7 +47,7 @@ export class Connection {
|
|
|
45
47
|
*
|
|
46
48
|
* @param agentId - The Connection agentId
|
|
47
49
|
*
|
|
48
|
-
* @returns The Connection, for
|
|
50
|
+
* @returns The Connection, for chaining
|
|
49
51
|
*/
|
|
50
52
|
setAgentId(agentId) {
|
|
51
53
|
this.payload.agentId = agentId;
|
|
@@ -88,7 +90,7 @@ export class Connection {
|
|
|
88
90
|
*
|
|
89
91
|
* @param name - The name of the Connection
|
|
90
92
|
*
|
|
91
|
-
* @returns The Connection, for
|
|
93
|
+
* @returns The Connection, for chaining
|
|
92
94
|
*/
|
|
93
95
|
setName(name) {
|
|
94
96
|
this.payload.name = name;
|
|
@@ -99,7 +101,7 @@ export class Connection {
|
|
|
99
101
|
*
|
|
100
102
|
* @param uuid - The universal unique identifier of the Connection
|
|
101
103
|
*
|
|
102
|
-
* @returns The Connection, for
|
|
104
|
+
* @returns The Connection, for chaining
|
|
103
105
|
*/
|
|
104
106
|
setUUID(uuid) {
|
|
105
107
|
this.payload.uuid = uuid;
|
|
@@ -126,7 +128,7 @@ export class Connection {
|
|
|
126
128
|
*
|
|
127
129
|
* @param type - The Connection type
|
|
128
130
|
*
|
|
129
|
-
* @returns The Connection, for
|
|
131
|
+
* @returns The Connection, for chaining
|
|
130
132
|
*/
|
|
131
133
|
setType(type) {
|
|
132
134
|
this.payload.type = type;
|
|
@@ -145,7 +147,7 @@ export class Connection {
|
|
|
145
147
|
*
|
|
146
148
|
* @param properties - Object with key/value pair properties
|
|
147
149
|
*
|
|
148
|
-
* @returns The Connection, for
|
|
150
|
+
* @returns The Connection, for chaining
|
|
149
151
|
*/
|
|
150
152
|
setProperties(properties) {
|
|
151
153
|
this.payload.properties = Object.assign({}, properties);
|
|
@@ -194,7 +196,7 @@ export class Connection {
|
|
|
194
196
|
*
|
|
195
197
|
* @param key - The property key
|
|
196
198
|
*
|
|
197
|
-
* @returns The Connection, for
|
|
199
|
+
* @returns The Connection, for chaining
|
|
198
200
|
*/
|
|
199
201
|
deleteProperty(key) {
|
|
200
202
|
this.setProperty(key, null);
|
|
@@ -23,12 +23,15 @@ export class Conversation {
|
|
|
23
23
|
this.payload = payload || {};
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
+
* Gets an immutable copy of the JSON payload for this Conversation.
|
|
27
|
+
*
|
|
26
28
|
* @returns The wrapped plain json object
|
|
27
29
|
*/
|
|
28
30
|
json() {
|
|
29
31
|
return Object.assign({}, this.payload);
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
34
|
+
* Gets the Agent associated to this Conversation.
|
|
32
35
|
*
|
|
33
36
|
* @returns The Agent associated to this Conversation
|
|
34
37
|
*/
|
|
@@ -36,6 +39,7 @@ export class Conversation {
|
|
|
36
39
|
return this.agent;
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
42
|
+
* Gets the Conversation universal identifier.
|
|
39
43
|
*
|
|
40
44
|
* @returns The Conversation universal identifier
|
|
41
45
|
*/
|
|
@@ -43,6 +47,7 @@ export class Conversation {
|
|
|
43
47
|
return this.payload.id;
|
|
44
48
|
}
|
|
45
49
|
/**
|
|
50
|
+
* Gets the title of the Conversation.
|
|
46
51
|
*
|
|
47
52
|
* @returns The title of the Conversation
|
|
48
53
|
*/
|
|
@@ -50,6 +55,7 @@ export class Conversation {
|
|
|
50
55
|
return this.payload.title;
|
|
51
56
|
}
|
|
52
57
|
/**
|
|
58
|
+
* Gets the Date the Conversation was created.
|
|
53
59
|
*
|
|
54
60
|
* @returns The Date the Conversation was created
|
|
55
61
|
*/
|
|
@@ -57,6 +63,7 @@ export class Conversation {
|
|
|
57
63
|
return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
|
|
58
64
|
}
|
|
59
65
|
/**
|
|
66
|
+
* Gets the Date the Conversation was last updated.
|
|
60
67
|
*
|
|
61
68
|
* @returns The Date the Conversation was last updated
|
|
62
69
|
*/
|
|
@@ -64,7 +71,7 @@ export class Conversation {
|
|
|
64
71
|
return this.payload.updatedAt ? new Date(new Number(this.payload.updatedAt).valueOf()) : undefined;
|
|
65
72
|
}
|
|
66
73
|
/**
|
|
67
|
-
* Gets the Messages that compose this Conversation
|
|
74
|
+
* Gets the Messages that compose this Conversation.
|
|
68
75
|
*
|
|
69
76
|
* @returns The Messages in this Conversation
|
|
70
77
|
*/
|
|
@@ -102,7 +109,7 @@ export class Conversation {
|
|
|
102
109
|
this.payload.updatedAt = updatedAtMs;
|
|
103
110
|
}
|
|
104
111
|
/**
|
|
105
|
-
* Performs create Conversation
|
|
112
|
+
* Performs create Conversation.
|
|
106
113
|
*
|
|
107
114
|
* @returns The created Conversation object
|
|
108
115
|
*/
|
package/lib/model/Event.js
CHANGED
|
@@ -16,48 +16,64 @@ export class Event {
|
|
|
16
16
|
this.payload = payload || {};
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
+
* Gets an immutable copy of the JSON payload for this Event.
|
|
20
|
+
*
|
|
19
21
|
* @returns The wrapped plain json object
|
|
20
22
|
*/
|
|
21
23
|
json() {
|
|
22
24
|
return Object.assign({}, this.payload);
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
27
|
+
* Gets the book in which the Event was created.
|
|
28
|
+
*
|
|
25
29
|
* @returns The book in which the Event was created
|
|
26
30
|
*/
|
|
27
31
|
getBook() {
|
|
28
32
|
return this.book;
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
35
|
+
* Gets the id of the Event.
|
|
36
|
+
*
|
|
31
37
|
* @returns The id of the Event
|
|
32
38
|
*/
|
|
33
39
|
getId() {
|
|
34
40
|
return this.payload.id;
|
|
35
41
|
}
|
|
36
42
|
/**
|
|
43
|
+
* Gets the user who performed the Event.
|
|
44
|
+
*
|
|
37
45
|
* @returns The user who performed the Event
|
|
38
46
|
*/
|
|
39
47
|
getUser() {
|
|
40
48
|
return this.payload.user ? new User(this.payload.user) : undefined;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
51
|
+
* Gets the Agent who performed the Event.
|
|
52
|
+
*
|
|
43
53
|
* @returns The Agent who performed the Event
|
|
44
54
|
*/
|
|
45
55
|
getAgent() {
|
|
46
56
|
return this.payload.agent ? new Agent(this.payload.agent) : undefined;
|
|
47
57
|
}
|
|
48
58
|
/**
|
|
59
|
+
* Gets the date the Event was created.
|
|
60
|
+
*
|
|
49
61
|
* @returns The date the Event was created
|
|
50
62
|
*/
|
|
51
63
|
getCreatedAt() {
|
|
52
64
|
return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
|
|
53
65
|
}
|
|
54
66
|
/**
|
|
67
|
+
* Gets the type of the Event.
|
|
68
|
+
*
|
|
55
69
|
* @returns The type of the Event
|
|
56
70
|
*/
|
|
57
71
|
getType() {
|
|
58
72
|
return this.payload.type;
|
|
59
73
|
}
|
|
60
74
|
/**
|
|
75
|
+
* Gets the Bot Responses associated to this Event.
|
|
76
|
+
*
|
|
61
77
|
* @returns The Bot Responses associated to this Event
|
|
62
78
|
*/
|
|
63
79
|
getBotResponses() {
|
|
@@ -74,6 +90,8 @@ export class Event {
|
|
|
74
90
|
return this.botResponses;
|
|
75
91
|
}
|
|
76
92
|
/**
|
|
93
|
+
* Checks if this Event has at least one Bot Response of type ERROR.
|
|
94
|
+
*
|
|
77
95
|
* @returns True if this Event has at least one Bot Response of type ERROR
|
|
78
96
|
*/
|
|
79
97
|
hasErrorResponse() {
|
package/lib/model/EventList.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Event } from "./Event.js";
|
|
2
2
|
/**
|
|
3
3
|
* A list associated with an event query.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
4
6
|
*/
|
|
5
7
|
export class EventList {
|
|
6
8
|
constructor(book, payload) {
|
|
@@ -8,23 +10,26 @@ export class EventList {
|
|
|
8
10
|
this.payload = payload || {};
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Gets the cursor associated with the query for pagination.
|
|
14
|
+
*
|
|
15
|
+
* @returns The cursor associated with the query for pagination
|
|
12
16
|
*/
|
|
13
17
|
getCursor() {
|
|
14
18
|
return this.payload.cursor;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* Gets the first Event in the list.
|
|
22
|
+
*
|
|
23
|
+
* @returns The first Event in the list
|
|
18
24
|
*/
|
|
19
25
|
getFirst() {
|
|
20
26
|
const events = this.getItems();
|
|
21
27
|
return events.length > 0 ? events[0] : undefined;
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
|
-
*
|
|
25
30
|
* Get the total number of events in the list.
|
|
26
31
|
*
|
|
27
|
-
* @returns The total number of events
|
|
32
|
+
* @returns The total number of events
|
|
28
33
|
*/
|
|
29
34
|
size() {
|
|
30
35
|
var _a;
|
|
@@ -33,7 +38,7 @@ export class EventList {
|
|
|
33
38
|
/**
|
|
34
39
|
* Get the events in the list.
|
|
35
40
|
*
|
|
36
|
-
* @returns An array of Event objects
|
|
41
|
+
* @returns An array of Event objects
|
|
37
42
|
*/
|
|
38
43
|
getItems() {
|
|
39
44
|
var _a;
|
package/lib/model/File.js
CHANGED
|
@@ -25,51 +25,63 @@ export class File {
|
|
|
25
25
|
;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
+
* Gets an immutable copy of the JSON payload for this File.
|
|
29
|
+
*
|
|
28
30
|
* @returns An immutable copy of the json payload
|
|
29
31
|
*/
|
|
30
32
|
json() {
|
|
31
33
|
return Object.assign({}, this.payload);
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
|
-
* Gets the File id
|
|
36
|
+
* Gets the File id.
|
|
37
|
+
*
|
|
38
|
+
* @returns The File id
|
|
35
39
|
*/
|
|
36
40
|
getId() {
|
|
37
41
|
return this.payload.id;
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
|
-
* Gets the File name
|
|
44
|
+
* Gets the File name.
|
|
45
|
+
*
|
|
46
|
+
* @returns The File name
|
|
41
47
|
*/
|
|
42
48
|
getName() {
|
|
43
49
|
return this.payload.name;
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
46
|
-
*
|
|
47
52
|
* Sets the name of the File.
|
|
48
53
|
*
|
|
49
|
-
* @
|
|
54
|
+
* @param name - The name to set
|
|
55
|
+
*
|
|
56
|
+
* @returns This File, for chaining
|
|
50
57
|
*/
|
|
51
58
|
setName(name) {
|
|
52
59
|
this.payload.name = name;
|
|
53
60
|
return this;
|
|
54
61
|
}
|
|
55
62
|
/**
|
|
56
|
-
* Gets the File content type
|
|
63
|
+
* Gets the File content type.
|
|
64
|
+
*
|
|
65
|
+
* @returns The File content type
|
|
57
66
|
*/
|
|
58
67
|
getContentType() {
|
|
59
68
|
return this.payload.contentType;
|
|
60
69
|
}
|
|
61
70
|
/**
|
|
62
|
-
*
|
|
63
71
|
* Sets the File content type.
|
|
64
72
|
*
|
|
65
|
-
* @
|
|
73
|
+
* @param contentType - The content type to set
|
|
74
|
+
*
|
|
75
|
+
* @returns This File, for chaining
|
|
66
76
|
*/
|
|
67
77
|
setContentType(contentType) {
|
|
68
78
|
this.payload.contentType = contentType;
|
|
69
79
|
return this;
|
|
70
80
|
}
|
|
71
81
|
/**
|
|
72
|
-
* Gets the file content Base64 encoded
|
|
82
|
+
* Gets the file content Base64 encoded.
|
|
83
|
+
*
|
|
84
|
+
* @returns The file content Base64 encoded
|
|
73
85
|
*/
|
|
74
86
|
getContent() {
|
|
75
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -81,29 +93,36 @@ export class File {
|
|
|
81
93
|
});
|
|
82
94
|
}
|
|
83
95
|
/**
|
|
84
|
-
*
|
|
85
96
|
* Sets the File content Base64 encoded.
|
|
86
97
|
*
|
|
87
|
-
* @
|
|
98
|
+
* @param content - The content to set (Base64 encoded)
|
|
99
|
+
*
|
|
100
|
+
* @returns This File, for chaining
|
|
88
101
|
*/
|
|
89
102
|
setContent(content) {
|
|
90
103
|
this.payload.content = content;
|
|
91
104
|
return this;
|
|
92
105
|
}
|
|
93
106
|
/**
|
|
94
|
-
* Gets the file serving url for accessing via browser
|
|
107
|
+
* Gets the file serving url for accessing via browser.
|
|
108
|
+
*
|
|
109
|
+
* @returns The file serving url
|
|
95
110
|
*/
|
|
96
111
|
getUrl() {
|
|
97
112
|
return this.payload.url;
|
|
98
113
|
}
|
|
99
114
|
/**
|
|
100
|
-
* Gets the file size in bytes
|
|
115
|
+
* Gets the file size in bytes.
|
|
116
|
+
*
|
|
117
|
+
* @returns The file size in bytes
|
|
101
118
|
*/
|
|
102
119
|
getSize() {
|
|
103
120
|
return this.payload.size;
|
|
104
121
|
}
|
|
105
122
|
/**
|
|
106
123
|
* Perform create new File.
|
|
124
|
+
*
|
|
125
|
+
* @returns The created File object
|
|
107
126
|
*/
|
|
108
127
|
create() {
|
|
109
128
|
return __awaiter(this, void 0, void 0, function* () {
|