bkper-js 1.47.1 → 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 +891 -355
- 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 +5 -4
- package/lib/model/Book.js +176 -91
- 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/lib/service/book-service.js +19 -2
- package/lib/utils.js +0 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
10
|
* This class defines an [Account](https://en.wikipedia.org/wiki/Account_(bookkeeping)) of a [[Book]].
|
|
12
11
|
*
|
|
13
|
-
* It
|
|
12
|
+
* It maintains a balance of all amount [credited and debited](http://en.wikipedia.org/wiki/Debits_and_credits) in it by [[Transactions]].
|
|
14
13
|
*
|
|
15
14
|
* An Account can be grouped by [[Groups]].
|
|
16
15
|
*
|
|
@@ -21,59 +20,75 @@ export declare class Account {
|
|
|
21
20
|
|
|
22
21
|
constructor(book: Book, payload?: bkper.Account);
|
|
23
22
|
/**
|
|
23
|
+
* Gets an immutable copy of the JSON payload.
|
|
24
|
+
*
|
|
24
25
|
* @returns An immutable copy of the json payload
|
|
25
26
|
*/
|
|
26
27
|
json(): bkper.Account;
|
|
27
28
|
/**
|
|
28
|
-
* Gets the
|
|
29
|
+
* Gets the Account internal id.
|
|
30
|
+
*
|
|
31
|
+
* @returns The Account internal id
|
|
29
32
|
*/
|
|
30
33
|
getId(): string | undefined;
|
|
31
34
|
/**
|
|
32
|
-
* Gets the
|
|
35
|
+
* Gets the Account name.
|
|
36
|
+
*
|
|
37
|
+
* @returns The Account name
|
|
33
38
|
*/
|
|
34
39
|
getName(): string | undefined;
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
37
41
|
* Sets the name of the Account.
|
|
38
42
|
*
|
|
39
|
-
* @
|
|
43
|
+
* @param name - The name to set
|
|
44
|
+
*
|
|
45
|
+
* @returns This Account, for chaining
|
|
40
46
|
*/
|
|
41
47
|
setName(name: string): Account;
|
|
42
48
|
/**
|
|
43
|
-
*
|
|
49
|
+
* Gets the normalized name of this Account without spaces or special characters.
|
|
50
|
+
*
|
|
51
|
+
* @returns The name of this Account without spaces or special characters
|
|
44
52
|
*/
|
|
45
53
|
getNormalizedName(): string;
|
|
46
54
|
/**
|
|
47
|
-
*
|
|
55
|
+
* Gets the type of this Account.
|
|
56
|
+
*
|
|
57
|
+
* @returns The [[AccountType]] of this Account
|
|
48
58
|
*/
|
|
49
59
|
getType(): AccountType;
|
|
50
60
|
/**
|
|
51
|
-
*
|
|
52
61
|
* Sets the type of the Account.
|
|
53
62
|
*
|
|
54
|
-
* @
|
|
63
|
+
* @param type - The [[AccountType]] to set
|
|
64
|
+
*
|
|
65
|
+
* @returns This Account, for chaining
|
|
55
66
|
*/
|
|
56
67
|
setType(type: AccountType): Account;
|
|
57
68
|
/**
|
|
58
69
|
* Gets the custom properties stored in this Account.
|
|
70
|
+
*
|
|
71
|
+
* @returns The custom properties object
|
|
59
72
|
*/
|
|
60
73
|
getProperties(): {
|
|
61
74
|
[key: string]: string;
|
|
62
75
|
};
|
|
63
76
|
/**
|
|
64
|
-
* Sets the custom properties of the Account
|
|
77
|
+
* Sets the custom properties of the Account.
|
|
65
78
|
*
|
|
66
79
|
* @param properties - Object with key/value pair properties
|
|
67
80
|
*
|
|
68
|
-
* @returns This Account, for
|
|
81
|
+
* @returns This Account, for chaining
|
|
69
82
|
*/
|
|
70
83
|
setProperties(properties: {
|
|
71
84
|
[key: string]: string;
|
|
72
85
|
}): Account;
|
|
73
86
|
/**
|
|
74
|
-
* Gets the property value for given keys. First property found will be retrieved
|
|
87
|
+
* Gets the property value for given keys. First property found will be retrieved.
|
|
75
88
|
*
|
|
76
89
|
* @param keys - The property key
|
|
90
|
+
*
|
|
91
|
+
* @returns The property value or undefined if not found
|
|
77
92
|
*/
|
|
78
93
|
getProperty(...keys: string[]): string | undefined;
|
|
79
94
|
/**
|
|
@@ -82,116 +97,145 @@ export declare class Account {
|
|
|
82
97
|
* @param key - The property key
|
|
83
98
|
* @param value - The property value
|
|
84
99
|
*
|
|
85
|
-
* @returns This Account, for
|
|
100
|
+
* @returns This Account, for chaining
|
|
86
101
|
*/
|
|
87
102
|
setProperty(key: string, value: string | null): Account;
|
|
88
103
|
/**
|
|
89
|
-
*
|
|
104
|
+
* Deletes a custom property.
|
|
90
105
|
*
|
|
91
106
|
* @param key - The property key
|
|
92
107
|
*
|
|
93
|
-
* @returns This Account, for
|
|
108
|
+
* @returns This Account, for chaining
|
|
94
109
|
*/
|
|
95
110
|
deleteProperty(key: string): Account;
|
|
96
111
|
/**
|
|
97
112
|
* Gets the balance based on credit nature of this Account.
|
|
113
|
+
*
|
|
98
114
|
* @deprecated Use `Book.getBalancesReport` instead.
|
|
99
|
-
*
|
|
115
|
+
*
|
|
116
|
+
* @returns The balance of this Account.
|
|
100
117
|
*/
|
|
101
118
|
getBalance(): Amount;
|
|
102
119
|
/**
|
|
103
120
|
* Gets the raw balance, no matter credit nature of this Account.
|
|
121
|
+
*
|
|
104
122
|
* @deprecated Use `Book.getBalancesReport` instead.
|
|
105
|
-
*
|
|
123
|
+
*
|
|
124
|
+
* @returns The balance of this Account.
|
|
106
125
|
*/
|
|
107
126
|
getBalanceRaw(): Amount;
|
|
108
127
|
/**
|
|
109
|
-
*
|
|
128
|
+
* Tells if this Account is archived.
|
|
129
|
+
*
|
|
130
|
+
* @returns True if the Account is archived
|
|
110
131
|
*/
|
|
111
132
|
isArchived(): boolean | undefined;
|
|
112
133
|
/**
|
|
113
|
-
*
|
|
134
|
+
* Sets Account archived/unarchived.
|
|
135
|
+
*
|
|
136
|
+
* @param archived - True to archive, false to unarchive
|
|
114
137
|
*
|
|
115
|
-
* @returns This Account, for
|
|
138
|
+
* @returns This Account, for chaining
|
|
116
139
|
*/
|
|
117
140
|
setArchived(archived: boolean): Account;
|
|
118
141
|
/**
|
|
119
|
-
*
|
|
142
|
+
* Tells if the Account has any transaction already posted.
|
|
120
143
|
*
|
|
121
144
|
* Accounts with transaction posted, even with zero balance, can only be archived.
|
|
145
|
+
*
|
|
146
|
+
* @returns True if the Account has transactions posted
|
|
122
147
|
*/
|
|
123
148
|
hasTransactionPosted(): boolean | undefined;
|
|
124
149
|
/**
|
|
125
|
-
*
|
|
126
|
-
* Tell if the account is permanent.
|
|
150
|
+
* Tells if the Account is permanent.
|
|
127
151
|
*
|
|
128
152
|
* Permanent Accounts are the ones which final balance is relevant and keep its balances over time.
|
|
129
153
|
*
|
|
130
|
-
* They are also called [Real Accounts](http://en.wikipedia.org/wiki/Account_(
|
|
154
|
+
* They are also called [Real Accounts](http://en.wikipedia.org/wiki/Account_(Accountancy)#Based_on_periodicity_of_flow)
|
|
131
155
|
*
|
|
132
|
-
* Usually represents assets or tangibles, capable of being perceived by the senses or the mind, like bank
|
|
156
|
+
* Usually represents assets or tangibles, capable of being perceived by the senses or the mind, like bank Accounts, money, debts and so on.
|
|
133
157
|
*
|
|
134
158
|
* @returns True if its a permanent Account
|
|
135
159
|
*/
|
|
136
160
|
isPermanent(): boolean | undefined;
|
|
137
161
|
/**
|
|
138
|
-
*
|
|
162
|
+
* Tells if the Account has a Credit nature or Debit otherwise.
|
|
139
163
|
*
|
|
140
|
-
* Credit
|
|
164
|
+
* Credit Accounts are just for representation purposes. It increase or decrease the absolute balance. It doesn't affect the overall balance or the behavior of the system.
|
|
141
165
|
*
|
|
142
|
-
* The absolute balance of credit
|
|
166
|
+
* The absolute balance of credit Accounts increase when it participate as a credit/origin in a transaction. Its usually for Accounts that increase the balance of the assets, like revenue Accounts.
|
|
143
167
|
*
|
|
144
168
|
* ```
|
|
145
169
|
* Crediting a credit
|
|
146
|
-
* Thus --------------------->
|
|
170
|
+
* Thus ---------------------> Account increases its absolute balance
|
|
147
171
|
* Debiting a debit
|
|
148
172
|
*
|
|
149
173
|
*
|
|
150
174
|
* Debiting a credit
|
|
151
|
-
* Thus --------------------->
|
|
175
|
+
* Thus ---------------------> Account decreases its absolute balance
|
|
152
176
|
* Crediting a debit
|
|
153
177
|
* ```
|
|
154
178
|
*
|
|
155
|
-
* As a rule of thumb, and for simple understanding, almost all
|
|
179
|
+
* As a rule of thumb, and for simple understanding, almost all Accounts are Debit nature (NOT credit), except the ones that "offers" amount for the books, like revenue Accounts.
|
|
180
|
+
*
|
|
181
|
+
* @returns True if the Account has credit nature
|
|
156
182
|
*/
|
|
157
183
|
isCredit(): boolean | undefined;
|
|
158
184
|
/**
|
|
159
|
-
*
|
|
185
|
+
* Gets the [[Groups]] of this Account.
|
|
186
|
+
*
|
|
187
|
+
* @returns Promise with the [[Groups]] of this Account
|
|
160
188
|
*/
|
|
161
189
|
getGroups(): Promise<Group[]>;
|
|
162
190
|
/**
|
|
163
191
|
* Sets the groups of the Account.
|
|
164
192
|
*
|
|
165
|
-
* @
|
|
193
|
+
* @param groups - The groups to set
|
|
194
|
+
*
|
|
195
|
+
* @returns This Account, for chaining
|
|
166
196
|
*/
|
|
167
197
|
setGroups(groups: Group[] | bkper.Group[]): Account;
|
|
168
198
|
/**
|
|
169
|
-
*
|
|
199
|
+
* Adds a group to the Account.
|
|
200
|
+
*
|
|
201
|
+
* @param group - The group to add
|
|
170
202
|
*
|
|
171
|
-
* @returns This Account, for
|
|
203
|
+
* @returns This Account, for chaining
|
|
172
204
|
*/
|
|
173
205
|
addGroup(group: Group | bkper.Group): Account;
|
|
174
206
|
/**
|
|
175
|
-
*
|
|
207
|
+
* Removes a group from the Account.
|
|
208
|
+
*
|
|
209
|
+
* @param group - The group name, id or object to remove
|
|
210
|
+
*
|
|
211
|
+
* @returns Promise with this Account, for chaining
|
|
176
212
|
*/
|
|
177
213
|
removeGroup(group: string | Group): Promise<Account>;
|
|
178
214
|
/**
|
|
179
|
-
*
|
|
215
|
+
* Tells if this Account is in the [[Group]].
|
|
216
|
+
*
|
|
217
|
+
* @param group - The Group name, id or object
|
|
180
218
|
*
|
|
181
|
-
* @
|
|
219
|
+
* @returns Promise with true if the Account is in the group
|
|
182
220
|
*/
|
|
183
221
|
isInGroup(group: string | Group): Promise<boolean>;
|
|
184
222
|
|
|
185
223
|
/**
|
|
186
|
-
*
|
|
224
|
+
* Performs create new Account.
|
|
225
|
+
*
|
|
226
|
+
* @returns Promise with this Account after creation
|
|
187
227
|
*/
|
|
188
228
|
create(): Promise<Account>;
|
|
189
229
|
/**
|
|
190
|
-
*
|
|
230
|
+
* Performs update Account, applying pending changes.
|
|
231
|
+
*
|
|
232
|
+
* @returns Promise with this Account after update
|
|
191
233
|
*/
|
|
192
234
|
update(): Promise<Account>;
|
|
193
235
|
/**
|
|
194
|
-
*
|
|
236
|
+
* Performs delete Account.
|
|
237
|
+
*
|
|
238
|
+
* @returns Promise with this Account after deletion
|
|
195
239
|
*/
|
|
196
240
|
remove(): Promise<Account>;
|
|
197
241
|
|
|
@@ -232,25 +276,31 @@ export declare class Agent {
|
|
|
232
276
|
payload: bkper.Agent;
|
|
233
277
|
constructor(payload?: bkper.Agent);
|
|
234
278
|
/**
|
|
279
|
+
* Gets the wrapped plain JSON object.
|
|
280
|
+
*
|
|
235
281
|
* @returns The wrapped plain json object
|
|
236
282
|
*/
|
|
237
283
|
json(): bkper.Agent;
|
|
238
284
|
/**
|
|
285
|
+
* Gets the Agent universal identifier.
|
|
239
286
|
*
|
|
240
287
|
* @returns The Agent universal identifier
|
|
241
288
|
*/
|
|
242
289
|
getId(): string | undefined;
|
|
243
290
|
/**
|
|
291
|
+
* Gets the Agent name.
|
|
244
292
|
*
|
|
245
293
|
* @returns The Agent name
|
|
246
294
|
*/
|
|
247
295
|
getName(): string | undefined;
|
|
248
296
|
/**
|
|
297
|
+
* Gets the Agent logo URL.
|
|
249
298
|
*
|
|
250
299
|
* @returns The Agent logo url
|
|
251
300
|
*/
|
|
252
301
|
getLogoUrl(): string | undefined;
|
|
253
302
|
/**
|
|
303
|
+
* Gets the Agent logo URL in dark mode.
|
|
254
304
|
*
|
|
255
305
|
* @returns The Agent logo url in dark mode
|
|
256
306
|
*/
|
|
@@ -268,73 +318,132 @@ export declare class Amount {
|
|
|
268
318
|
|
|
269
319
|
/**
|
|
270
320
|
* The Amount constructor.
|
|
321
|
+
*
|
|
322
|
+
* @param n - The number, string, or Amount to initialize with
|
|
271
323
|
*/
|
|
272
324
|
constructor(n: number | string | Amount);
|
|
273
325
|
/**
|
|
274
326
|
* Returns an absolute Amount.
|
|
327
|
+
*
|
|
328
|
+
* @returns The absolute value as a new Amount
|
|
275
329
|
*/
|
|
276
330
|
abs(): Amount;
|
|
277
331
|
/**
|
|
278
|
-
*
|
|
332
|
+
* Compares this Amount with another value.
|
|
333
|
+
*
|
|
334
|
+
* @param n - The value to compare with
|
|
335
|
+
*
|
|
336
|
+
* @returns -1 if less than, 0 if equal, 1 if greater than
|
|
279
337
|
*/
|
|
280
338
|
cmp(n: number | string | Amount): -1 | 0 | 1;
|
|
281
339
|
/**
|
|
282
|
-
*
|
|
340
|
+
* Divides this Amount by another value.
|
|
341
|
+
*
|
|
342
|
+
* @param n - The divisor value
|
|
343
|
+
*
|
|
344
|
+
* @returns The division result as a new Amount
|
|
283
345
|
*/
|
|
284
346
|
div(n: number | string | Amount): Amount;
|
|
285
347
|
/**
|
|
286
|
-
*
|
|
348
|
+
* Checks if this Amount equals another value.
|
|
349
|
+
*
|
|
350
|
+
* @param n - The value to compare with
|
|
351
|
+
*
|
|
352
|
+
* @returns True if equal, false otherwise
|
|
287
353
|
*/
|
|
288
354
|
eq(n: number | string | Amount): boolean;
|
|
289
355
|
/**
|
|
290
|
-
*
|
|
356
|
+
* Checks if this Amount is greater than another value.
|
|
357
|
+
*
|
|
358
|
+
* @param n - The value to compare with
|
|
359
|
+
*
|
|
360
|
+
* @returns True if greater than, false otherwise
|
|
291
361
|
*/
|
|
292
362
|
gt(n: number | string | Amount): boolean;
|
|
293
363
|
/**
|
|
294
|
-
*
|
|
364
|
+
* Checks if this Amount is greater than or equal to another value.
|
|
365
|
+
*
|
|
366
|
+
* @param n - The value to compare with
|
|
367
|
+
*
|
|
368
|
+
* @returns True if greater than or equal, false otherwise
|
|
295
369
|
*/
|
|
296
370
|
gte(n: number | string | Amount): boolean;
|
|
297
371
|
/**
|
|
298
|
-
*
|
|
372
|
+
* Checks if this Amount is less than another value.
|
|
373
|
+
*
|
|
374
|
+
* @param n - The value to compare with
|
|
375
|
+
*
|
|
376
|
+
* @returns True if less than, false otherwise
|
|
299
377
|
*/
|
|
300
378
|
lt(n: number | string | Amount): boolean;
|
|
301
379
|
/**
|
|
302
|
-
*
|
|
380
|
+
* Checks if this Amount is less than or equal to another value.
|
|
381
|
+
*
|
|
382
|
+
* @param n - The value to compare with
|
|
383
|
+
*
|
|
384
|
+
* @returns True if less than or equal, false otherwise
|
|
303
385
|
*/
|
|
304
386
|
lte(n: number | string | Amount): boolean;
|
|
305
387
|
/**
|
|
306
|
-
*
|
|
388
|
+
* Adds another value to this Amount.
|
|
389
|
+
*
|
|
390
|
+
* @param n - The value to add
|
|
391
|
+
*
|
|
392
|
+
* @returns The sum as a new Amount
|
|
307
393
|
*/
|
|
308
394
|
plus(n: number | string | Amount): Amount;
|
|
309
395
|
/**
|
|
310
|
-
*
|
|
396
|
+
* Subtracts another value from this Amount.
|
|
397
|
+
*
|
|
398
|
+
* @param n - The value to subtract
|
|
399
|
+
*
|
|
400
|
+
* @returns The difference as a new Amount
|
|
311
401
|
*/
|
|
312
402
|
minus(n: number | string | Amount): Amount;
|
|
313
403
|
/**
|
|
314
|
-
*
|
|
404
|
+
* Calculates the modulo (remainder) of dividing this Amount by another value.
|
|
315
405
|
*
|
|
316
406
|
* Similar to % operator
|
|
317
407
|
*
|
|
408
|
+
* @param n - The divisor value
|
|
409
|
+
*
|
|
410
|
+
* @returns The remainder as a new Amount
|
|
318
411
|
*/
|
|
319
412
|
mod(n: number | string | Amount): Amount;
|
|
320
413
|
/**
|
|
321
|
-
*
|
|
414
|
+
* Rounds this Amount to a maximum of dp decimal places.
|
|
415
|
+
*
|
|
416
|
+
* @param dp - The number of decimal places (optional)
|
|
417
|
+
*
|
|
418
|
+
* @returns The rounded value as a new Amount
|
|
322
419
|
*/
|
|
323
420
|
round(dp?: number): Amount;
|
|
324
421
|
/**
|
|
325
|
-
*
|
|
422
|
+
* Multiplies this Amount by another value.
|
|
423
|
+
*
|
|
424
|
+
* @param n - The value to multiply by
|
|
425
|
+
*
|
|
426
|
+
* @returns The product as a new Amount
|
|
326
427
|
*/
|
|
327
428
|
times(n: number | string | Amount): Amount;
|
|
328
429
|
/**
|
|
329
|
-
* Returns a string representing the value of this Amount in normal notation to a fixed number of decimal places
|
|
430
|
+
* Returns a string representing the value of this Amount in normal notation to a fixed number of decimal places.
|
|
431
|
+
*
|
|
432
|
+
* @param dp - The number of decimal places (optional)
|
|
433
|
+
*
|
|
434
|
+
* @returns The formatted string representation
|
|
330
435
|
*/
|
|
331
436
|
toFixed(dp?: number): string;
|
|
332
437
|
/**
|
|
333
438
|
* Returns a string representing the value of this Amount.
|
|
439
|
+
*
|
|
440
|
+
* @returns The string representation of this Amount
|
|
334
441
|
*/
|
|
335
442
|
toString(): string;
|
|
336
443
|
/**
|
|
337
444
|
* Returns a primitive number representing the value of this Amount.
|
|
445
|
+
*
|
|
446
|
+
* @returns The numeric value of this Amount
|
|
338
447
|
*/
|
|
339
448
|
toNumber(): number;
|
|
340
449
|
|
|
@@ -353,112 +462,157 @@ export declare class App {
|
|
|
353
462
|
payload: bkper.App;
|
|
354
463
|
constructor(payload?: bkper.App);
|
|
355
464
|
/**
|
|
465
|
+
* Gets the wrapped plain JSON object.
|
|
466
|
+
*
|
|
356
467
|
* @returns The wrapped plain json object
|
|
357
468
|
*/
|
|
358
469
|
json(): bkper.App;
|
|
359
470
|
/**
|
|
360
|
-
*
|
|
361
471
|
* Sets the webhook url for development.
|
|
362
472
|
*
|
|
363
|
-
* @
|
|
473
|
+
* @param webhookUrlDev - The webhook URL for development
|
|
474
|
+
*
|
|
475
|
+
* @returns This App, for chaining
|
|
364
476
|
*/
|
|
365
477
|
setWebhookUrlDev(webhookUrlDev: string): App;
|
|
366
478
|
/**
|
|
367
|
-
*
|
|
368
479
|
* Sets the conversation url for development.
|
|
369
480
|
*
|
|
370
|
-
* @
|
|
481
|
+
* @param conversationUrlDev - The conversation URL for development
|
|
482
|
+
*
|
|
483
|
+
* @returns This App, for chaining
|
|
371
484
|
*/
|
|
372
485
|
setConversationUrlDev(conversationUrlDev: string): App;
|
|
373
486
|
/**
|
|
487
|
+
* Gets the App universal identifier.
|
|
374
488
|
*
|
|
375
489
|
* @returns The App universal identifier
|
|
376
490
|
*/
|
|
377
491
|
getId(): string | undefined;
|
|
378
492
|
/**
|
|
379
|
-
*
|
|
493
|
+
* Gets the name of this App.
|
|
494
|
+
*
|
|
495
|
+
* @returns The name of this App
|
|
380
496
|
*/
|
|
381
497
|
getName(): string | undefined;
|
|
382
498
|
/**
|
|
383
|
-
*
|
|
499
|
+
* Checks if this App has events bound to it.
|
|
500
|
+
*
|
|
501
|
+
* @returns True if this App has events bound to it
|
|
384
502
|
*/
|
|
385
503
|
hasEvents(): boolean;
|
|
386
504
|
/**
|
|
387
|
-
*
|
|
505
|
+
* Gets the events bound to this App.
|
|
506
|
+
*
|
|
507
|
+
* @returns The events bound to this App
|
|
388
508
|
*/
|
|
389
509
|
getEvents(): EventType[] | undefined;
|
|
390
510
|
/**
|
|
391
|
-
*
|
|
511
|
+
* Checks if this App is published.
|
|
512
|
+
*
|
|
513
|
+
* @returns True if this App is published
|
|
392
514
|
*/
|
|
393
515
|
isPublished(): boolean;
|
|
394
516
|
/**
|
|
395
|
-
*
|
|
517
|
+
* Checks if this App is conversational.
|
|
518
|
+
*
|
|
519
|
+
* @returns True if this App is conversational
|
|
396
520
|
*/
|
|
397
521
|
isConversational(): boolean;
|
|
398
522
|
/**
|
|
399
|
-
*
|
|
523
|
+
* Gets the logo url of this App.
|
|
524
|
+
*
|
|
525
|
+
* @returns The logo url of this App
|
|
400
526
|
*/
|
|
401
527
|
getLogoUrl(): string | undefined;
|
|
402
528
|
/**
|
|
403
|
-
*
|
|
529
|
+
* Gets the logo url of this App in dark mode.
|
|
530
|
+
*
|
|
531
|
+
* @returns The logo url of this App in dark mode
|
|
404
532
|
*/
|
|
405
533
|
getLogoUrlDark(): string | undefined;
|
|
406
534
|
/**
|
|
407
|
-
*
|
|
535
|
+
* Gets the description of this App.
|
|
536
|
+
*
|
|
537
|
+
* @returns The description of this App
|
|
408
538
|
*/
|
|
409
539
|
getDescription(): string | undefined;
|
|
410
540
|
/**
|
|
411
|
-
* Sets the whitelabeled user emails
|
|
541
|
+
* Sets the whitelabeled user emails.
|
|
542
|
+
*
|
|
543
|
+
* @param emails - The user emails to whitelist
|
|
412
544
|
*
|
|
413
545
|
* @returns This App for chaining
|
|
414
546
|
*/
|
|
415
547
|
setUserEmails(emails?: string): App;
|
|
416
548
|
/**
|
|
417
|
-
*
|
|
549
|
+
* Gets the name of the owner of this App.
|
|
550
|
+
*
|
|
551
|
+
* @returns The name of the owner of this App
|
|
418
552
|
*/
|
|
419
553
|
getOwnerName(): string | undefined;
|
|
420
554
|
/**
|
|
421
|
-
*
|
|
555
|
+
* Gets the menu url of this App.
|
|
556
|
+
*
|
|
557
|
+
* @returns The menu url of this App
|
|
422
558
|
*/
|
|
423
559
|
getMenuUrl(): string | undefined;
|
|
424
560
|
/**
|
|
425
|
-
*
|
|
561
|
+
* Gets the menu development url of this App.
|
|
562
|
+
*
|
|
563
|
+
* @returns The menu development url of this App
|
|
426
564
|
*/
|
|
427
565
|
getMenuUrlDev(): string | undefined;
|
|
428
566
|
/**
|
|
429
|
-
*
|
|
567
|
+
* Gets the menu text of this App.
|
|
568
|
+
*
|
|
569
|
+
* @returns The menu text of this App
|
|
430
570
|
*/
|
|
431
571
|
getMenuText(): string | undefined;
|
|
432
572
|
/**
|
|
433
|
-
*
|
|
573
|
+
* Gets the menu popup width of this App.
|
|
574
|
+
*
|
|
575
|
+
* @returns The menu popup width of this App
|
|
434
576
|
*/
|
|
435
577
|
getMenuPopupWidth(): string | undefined;
|
|
436
578
|
/**
|
|
437
|
-
*
|
|
579
|
+
* Gets the menu popup height of this App.
|
|
580
|
+
*
|
|
581
|
+
* @returns The menu popup height of this App
|
|
438
582
|
*/
|
|
439
583
|
getMenuPopupHeight(): string | undefined;
|
|
440
584
|
/**
|
|
441
|
-
*
|
|
585
|
+
* Gets the logo url of the owner of this App.
|
|
586
|
+
*
|
|
587
|
+
* @returns The logo url of the owner of this App
|
|
442
588
|
*/
|
|
443
589
|
getOwnerLogoUrl(): string | undefined;
|
|
444
590
|
/**
|
|
445
|
-
*
|
|
591
|
+
* Gets the file patterns the App handles.
|
|
592
|
+
*
|
|
593
|
+
* @returns The file patterns the App handles - E.g *.pdf *.csv
|
|
446
594
|
*/
|
|
447
595
|
getFilePatterns(): string[] | undefined;
|
|
448
596
|
/**
|
|
449
|
-
* Sets the developer email
|
|
597
|
+
* Sets the developer email.
|
|
598
|
+
*
|
|
599
|
+
* @param email - The developer email to set
|
|
450
600
|
*
|
|
451
601
|
* @returns This App for chaining
|
|
452
602
|
*/
|
|
453
603
|
setDeveloperEmail(email?: string): App;
|
|
454
604
|
/**
|
|
455
|
-
* Sets the client secret
|
|
605
|
+
* Sets the client secret.
|
|
606
|
+
*
|
|
607
|
+
* @param clientSecret - The client secret to set
|
|
456
608
|
*
|
|
457
609
|
* @returns This App for chaining
|
|
458
610
|
*/
|
|
459
611
|
setClientSecret(clientSecret?: string): App;
|
|
460
612
|
/**
|
|
461
|
-
* Sets the readme text
|
|
613
|
+
* Sets the readme text.
|
|
614
|
+
*
|
|
615
|
+
* @param readme - The readme text to set
|
|
462
616
|
*
|
|
463
617
|
* @returns This App for chaining
|
|
464
618
|
*/
|
|
@@ -467,14 +621,20 @@ export declare class App {
|
|
|
467
621
|
* Performs the app creation, applying pending changes.
|
|
468
622
|
*
|
|
469
623
|
* The App id MUST be unique. If another app is already existing, an error will be thrown.
|
|
624
|
+
*
|
|
625
|
+
* @returns This App after creation
|
|
470
626
|
*/
|
|
471
627
|
create(): Promise<App>;
|
|
472
628
|
/**
|
|
473
|
-
* Partially
|
|
629
|
+
* Partially updates an App, applying pending changes.
|
|
630
|
+
*
|
|
631
|
+
* @returns This App after the partial update
|
|
474
632
|
*/
|
|
475
633
|
patch(): Promise<App>;
|
|
476
634
|
/**
|
|
477
|
-
*
|
|
635
|
+
* Performs a full update of the App, applying pending changes.
|
|
636
|
+
*
|
|
637
|
+
* @returns This App after the update
|
|
478
638
|
*/
|
|
479
639
|
update(): Promise<App>;
|
|
480
640
|
}
|
|
@@ -488,49 +648,63 @@ export declare class App {
|
|
|
488
648
|
*/
|
|
489
649
|
export declare interface BalancesContainer {
|
|
490
650
|
/**
|
|
491
|
-
*
|
|
651
|
+
* Gets the parent [[BalancesReport]] of the container.
|
|
652
|
+
*
|
|
653
|
+
* @returns The parent [[BalancesReport]] of the container
|
|
492
654
|
*/
|
|
493
655
|
getBalancesReport: () => BalancesReport;
|
|
494
656
|
/**
|
|
657
|
+
* Gets the [[Account]] or [[Group]] name.
|
|
658
|
+
*
|
|
495
659
|
* @returns The [[Account]] or [[Group]] name
|
|
496
660
|
*/
|
|
497
661
|
getName: () => string | undefined;
|
|
498
662
|
/**
|
|
499
|
-
*
|
|
663
|
+
* Gets the [[Account]] or [[Group]] name without spaces or special characters.
|
|
664
|
+
*
|
|
665
|
+
* @returns The [[Account]] or [[Group]] name without spaces or special characters
|
|
500
666
|
*/
|
|
501
667
|
getNormalizedName: () => string | undefined;
|
|
502
668
|
/**
|
|
669
|
+
* Gets the [[Group]] associated with this container.
|
|
670
|
+
*
|
|
503
671
|
* @returns The [[Group]] associated with this container
|
|
504
672
|
*/
|
|
505
673
|
getGroup: () => Promise<Group | null>;
|
|
506
674
|
/**
|
|
675
|
+
* Gets the [[Account]] associated with this container.
|
|
676
|
+
*
|
|
507
677
|
* @returns The [[Account]] associated with this container
|
|
508
678
|
*/
|
|
509
679
|
getAccount: () => Promise<Account | null>;
|
|
510
680
|
/**
|
|
511
|
-
*
|
|
681
|
+
* Gets the parent BalanceContainer.
|
|
682
|
+
*
|
|
683
|
+
* @returns The parent BalanceContainer
|
|
512
684
|
*/
|
|
513
685
|
getParent: () => BalancesContainer | null;
|
|
514
686
|
/**
|
|
515
|
-
*
|
|
687
|
+
* Gets the depth in the parent chain up to the root.
|
|
688
|
+
*
|
|
689
|
+
* @returns The depth in the parent chain up to the root
|
|
516
690
|
*/
|
|
517
691
|
getDepth: () => number;
|
|
518
692
|
/**
|
|
519
|
-
*
|
|
693
|
+
* Gets the credit nature of the BalancesContainer, based on [[Account]] or [[Group]].
|
|
520
694
|
*
|
|
521
|
-
* For [[Account]], the credit nature will be the same as the one from the Account
|
|
695
|
+
* For [[Account]], the credit nature will be the same as the one from the Account.
|
|
522
696
|
*
|
|
523
697
|
* For [[Group]], the credit nature will be the same, if all accounts containing on it has the same credit nature. False if mixed.
|
|
524
698
|
*
|
|
699
|
+
* @returns The credit nature of the BalancesContainer
|
|
525
700
|
*/
|
|
526
701
|
isCredit: () => boolean | undefined;
|
|
527
702
|
/**
|
|
528
|
-
*
|
|
529
|
-
* Tell if this balance container is permament, based on the [[Account]] or [[Group]].
|
|
703
|
+
* Tell if this balance container is permanent, based on the [[Account]] or [[Group]].
|
|
530
704
|
*
|
|
531
705
|
* Permanent are the ones which final balance is relevant and keep its balances over time.
|
|
532
706
|
*
|
|
533
|
-
* They are also called [Real Accounts](http://en.wikipedia.org/wiki/Account_(accountancy)#Based_on_periodicity_of_flow)
|
|
707
|
+
* They are also called [Real Accounts](http://en.wikipedia.org/wiki/Account_(accountancy)#Based_on_periodicity_of_flow).
|
|
534
708
|
*
|
|
535
709
|
* Usually represents assets or liabilities, capable of being perceived by the senses or the mind, like bank accounts, money, debts and so on.
|
|
536
710
|
*
|
|
@@ -538,61 +712,85 @@ export declare interface BalancesContainer {
|
|
|
538
712
|
*/
|
|
539
713
|
isPermanent: () => boolean | undefined;
|
|
540
714
|
/**
|
|
715
|
+
* Gets whether this balance container is from an [[Account]].
|
|
716
|
+
*
|
|
541
717
|
* @returns True if this balance container if from an [[Account]]
|
|
542
718
|
*/
|
|
543
719
|
isFromAccount: () => boolean;
|
|
544
720
|
/**
|
|
721
|
+
* Gets whether this balance container is from a [[Group]].
|
|
722
|
+
*
|
|
545
723
|
* @returns True if this balance container if from a [[Group]]
|
|
546
724
|
*/
|
|
547
725
|
isFromGroup: () => boolean;
|
|
548
726
|
/**
|
|
727
|
+
* Gets whether the balance container is from a parent group.
|
|
728
|
+
*
|
|
549
729
|
* @returns True if the balance container is from a parent group
|
|
550
730
|
*/
|
|
551
731
|
hasGroupBalances: () => boolean;
|
|
552
732
|
/**
|
|
553
|
-
*
|
|
733
|
+
* Gets the cumulative balance to the date.
|
|
734
|
+
*
|
|
735
|
+
* @returns The cumulative balance to the date
|
|
554
736
|
*/
|
|
555
737
|
getCumulativeBalance: () => Amount;
|
|
556
738
|
/**
|
|
557
|
-
*
|
|
739
|
+
* Gets the cumulative raw balance to the date.
|
|
740
|
+
*
|
|
741
|
+
* @returns The cumulative raw balance to the date
|
|
558
742
|
*/
|
|
559
743
|
getCumulativeBalanceRaw: () => Amount;
|
|
560
744
|
/**
|
|
561
|
-
*
|
|
745
|
+
* Gets the cumulative balance formatted according to [[Book]] decimal format and fraction digits.
|
|
746
|
+
*
|
|
747
|
+
* @returns The cumulative balance formatted according to [[Book]] decimal format and fraction digits
|
|
562
748
|
*/
|
|
563
749
|
getCumulativeBalanceText: () => string;
|
|
564
750
|
/**
|
|
565
|
-
*
|
|
751
|
+
* Gets the cumulative raw balance formatted according to [[Book]] decimal format and fraction digits.
|
|
752
|
+
*
|
|
753
|
+
* @returns The cumulative raw balance formatted according to [[Book]] decimal format and fraction digits
|
|
566
754
|
*/
|
|
567
755
|
getCumulativeBalanceRawText: () => string;
|
|
568
756
|
/**
|
|
569
|
-
*
|
|
757
|
+
* Gets the balance on the date period.
|
|
758
|
+
*
|
|
759
|
+
* @returns The balance on the date period
|
|
570
760
|
*/
|
|
571
761
|
getPeriodBalance: () => Amount;
|
|
572
762
|
/**
|
|
573
|
-
*
|
|
763
|
+
* Gets the raw balance on the date period.
|
|
764
|
+
*
|
|
765
|
+
* @returns The raw balance on the date period
|
|
574
766
|
*/
|
|
575
767
|
getPeriodBalanceRaw: () => Amount;
|
|
576
768
|
/**
|
|
769
|
+
* Gets the balance on the date period formatted according to [[Book]] decimal format and fraction digits.
|
|
770
|
+
*
|
|
577
771
|
* @returns The balance on the date period formatted according to [[Book]] decimal format and fraction digits
|
|
578
772
|
*/
|
|
579
773
|
getPeriodBalanceText: () => string;
|
|
580
774
|
/**
|
|
775
|
+
* Gets the raw balance on the date period formatted according to [[Book]] decimal format and fraction digits.
|
|
776
|
+
*
|
|
581
777
|
* @returns The raw balance on the date period formatted according to [[Book]] decimal format and fraction digits
|
|
582
778
|
*/
|
|
583
779
|
getPeriodBalanceRawText: () => string;
|
|
584
780
|
/**
|
|
585
|
-
*
|
|
781
|
+
* Gets all child [[BalancesContainers]].
|
|
586
782
|
*
|
|
587
783
|
* **NOTE**: Only for Group balance containers. Accounts returns null.
|
|
784
|
+
*
|
|
785
|
+
* @returns All child [[BalancesContainers]]
|
|
588
786
|
*/
|
|
589
787
|
getBalancesContainers: () => BalancesContainer[];
|
|
590
788
|
/**
|
|
591
789
|
* Gets a specific [[BalancesContainer]].
|
|
592
790
|
*
|
|
593
|
-
* @param name The [[Account]] or [[Group]] name
|
|
791
|
+
* @param name - The [[Account]] or [[Group]] name
|
|
594
792
|
*
|
|
595
|
-
* @returns The retrieved [[BalancesContainer]]
|
|
793
|
+
* @returns The retrieved [[BalancesContainer]]
|
|
596
794
|
*/
|
|
597
795
|
getBalancesContainer: (name: string) => BalancesContainer;
|
|
598
796
|
}
|
|
@@ -610,23 +808,29 @@ export declare class BalancesReport {
|
|
|
610
808
|
|
|
611
809
|
constructor(book: Book, payload: bkper.Balances);
|
|
612
810
|
/**
|
|
613
|
-
*
|
|
811
|
+
* Gets the [[Book]] that generated the report.
|
|
812
|
+
*
|
|
813
|
+
* @returns The [[Book]] that generated the report
|
|
614
814
|
*/
|
|
615
815
|
getBook(): Book;
|
|
616
816
|
/**
|
|
617
|
-
*
|
|
817
|
+
* Gets the [[Periodicity]] of the query used to generate the report.
|
|
818
|
+
*
|
|
819
|
+
* @returns The [[Periodicity]] of the query used to generate the report
|
|
618
820
|
*/
|
|
619
821
|
getPeriodicity(): Periodicity;
|
|
620
822
|
/**
|
|
621
|
-
*
|
|
823
|
+
* Gets all [[BalancesContainers]] of the report.
|
|
824
|
+
*
|
|
825
|
+
* @returns All [[BalancesContainers]] of the report
|
|
622
826
|
*/
|
|
623
827
|
getBalancesContainers(): BalancesContainer[];
|
|
624
828
|
/**
|
|
625
829
|
* Gets a specific [[BalancesContainer]].
|
|
626
830
|
*
|
|
627
|
-
* @param name The [[Account]] or [[Group]] name
|
|
831
|
+
* @param name - The [[Account]] or [[Group]] name
|
|
628
832
|
*
|
|
629
|
-
* @returns The retrieved [[BalancesContainer]]
|
|
833
|
+
* @returns The retrieved [[BalancesContainer]]
|
|
630
834
|
*/
|
|
631
835
|
getBalancesContainer(name: string): BalancesContainer;
|
|
632
836
|
|
|
@@ -659,15 +863,16 @@ export declare class Bkper {
|
|
|
659
863
|
* @param id - The universal book id - The same bookId param of URL you access at app.bkper.com
|
|
660
864
|
* @param includeAccounts - Optional parameter to include accounts in the retrieved Book
|
|
661
865
|
*
|
|
662
|
-
* @returns The retrieved Book
|
|
866
|
+
* @returns The retrieved Book
|
|
663
867
|
*/
|
|
664
868
|
static getBook(id: string, includeAccounts?: boolean): Promise<Book>;
|
|
665
869
|
/**
|
|
666
870
|
* Gets all [[Books]] the user has access to.
|
|
667
871
|
*
|
|
872
|
+
* @param query - Optional search term to filter books
|
|
668
873
|
* @returns The retrieved list of Books
|
|
669
874
|
*/
|
|
670
|
-
static getBooks(): Promise<Book[]>;
|
|
875
|
+
static getBooks(query?: string): Promise<Book[]>;
|
|
671
876
|
/**
|
|
672
877
|
* Gets all [[Collections]] the user has access to.
|
|
673
878
|
*
|
|
@@ -695,7 +900,7 @@ export declare class Bkper {
|
|
|
695
900
|
/**
|
|
696
901
|
* Gets the current logged [[User]].
|
|
697
902
|
*
|
|
698
|
-
* @returns The retrieved User
|
|
903
|
+
* @returns The retrieved User
|
|
699
904
|
*/
|
|
700
905
|
static getUser(): Promise<User>;
|
|
701
906
|
/**
|
|
@@ -731,8 +936,7 @@ export declare class Bkper {
|
|
|
731
936
|
}
|
|
732
937
|
|
|
733
938
|
/**
|
|
734
|
-
*
|
|
735
|
-
* A Book represents [General Ledger](https://en.wikipedia.org/wiki/General_ledger) for a company or business, but can also represent a [Ledger](https://en.wikipedia.org/wiki/Ledger) for a project or department
|
|
939
|
+
* A Book represents a [General Ledger](https://en.wikipedia.org/wiki/General_ledger) for a company or business, but can also represent a [Ledger](https://en.wikipedia.org/wiki/Ledger) for a project or department
|
|
736
940
|
*
|
|
737
941
|
* It contains all [[Accounts]] where [[Transactions]] are recorded/posted;
|
|
738
942
|
*
|
|
@@ -749,189 +953,241 @@ export declare class Book {
|
|
|
749
953
|
|
|
750
954
|
constructor(payload?: bkper.Book);
|
|
751
955
|
/**
|
|
752
|
-
*
|
|
956
|
+
* Gets an immutable copy of the JSON payload for this Book.
|
|
957
|
+
*
|
|
958
|
+
* @returns An immutable copy of the JSON payload
|
|
753
959
|
*/
|
|
754
960
|
json(): bkper.Book;
|
|
755
961
|
/**
|
|
756
|
-
*
|
|
962
|
+
* Gets the unique identifier of this Book.
|
|
963
|
+
*
|
|
964
|
+
* @returns This Book's unique identifier
|
|
757
965
|
*/
|
|
758
966
|
getId(): string;
|
|
759
967
|
/**
|
|
968
|
+
* Gets the name of this Book.
|
|
969
|
+
*
|
|
760
970
|
* @returns The name of this Book
|
|
761
971
|
*/
|
|
762
972
|
getName(): string | undefined;
|
|
763
973
|
/**
|
|
764
|
-
*
|
|
765
974
|
* Sets the name of the Book.
|
|
766
975
|
*
|
|
767
|
-
* @
|
|
976
|
+
* @param name - The name to set
|
|
977
|
+
*
|
|
978
|
+
* @returns This Book, for chaining
|
|
768
979
|
*/
|
|
769
980
|
setName(name: string): Book;
|
|
770
981
|
/**
|
|
982
|
+
* Gets the number of fraction digits supported by this Book.
|
|
983
|
+
*
|
|
771
984
|
* @returns The number of fraction digits supported by this Book. Same as getDecimalPlaces
|
|
772
985
|
*/
|
|
773
986
|
getFractionDigits(): number | undefined;
|
|
774
987
|
/**
|
|
988
|
+
* Gets the number of decimal places supported by this Book.
|
|
989
|
+
*
|
|
775
990
|
* @returns The number of decimal places supported by this Book. Same as getFractionDigits
|
|
776
991
|
*/
|
|
777
992
|
getDecimalPlaces(): number | undefined;
|
|
778
993
|
/**
|
|
994
|
+
* Sets the number of fraction digits (decimal places) supported by this Book.
|
|
779
995
|
*
|
|
780
|
-
*
|
|
996
|
+
* @param fractionDigits - The number of fraction digits to set (0 to 8)
|
|
781
997
|
*
|
|
782
|
-
* @returns This Book, for
|
|
998
|
+
* @returns This Book, for chaining
|
|
783
999
|
*/
|
|
784
1000
|
setFractionDigits(fractionDigits: number): Book;
|
|
785
1001
|
/**
|
|
1002
|
+
* Gets the period slice for balances visualization.
|
|
1003
|
+
*
|
|
786
1004
|
* @returns The period slice for balances visualization
|
|
787
1005
|
*/
|
|
788
1006
|
getPeriod(): Period;
|
|
789
1007
|
/**
|
|
790
|
-
* Sets the period slice for balances visualization
|
|
1008
|
+
* Sets the period slice for balances visualization.
|
|
791
1009
|
*
|
|
792
|
-
* @
|
|
1010
|
+
* @param period - The period to set
|
|
1011
|
+
*
|
|
1012
|
+
* @returns This Book, for chaining
|
|
793
1013
|
*/
|
|
794
1014
|
setPeriod(period: Period): Book;
|
|
795
1015
|
/**
|
|
796
|
-
*
|
|
1016
|
+
* Gets the start month when YEAR period is set.
|
|
1017
|
+
*
|
|
1018
|
+
* @returns The start month when YEAR period is set
|
|
797
1019
|
*/
|
|
798
1020
|
getPeriodStartMonth(): Month;
|
|
799
1021
|
/**
|
|
800
|
-
* Sets the start month when YEAR period set
|
|
1022
|
+
* Sets the start month when YEAR period is set.
|
|
801
1023
|
*
|
|
802
|
-
* @
|
|
1024
|
+
* @param month - The start month to set
|
|
1025
|
+
*
|
|
1026
|
+
* @returns This Book, for chaining
|
|
803
1027
|
*/
|
|
804
1028
|
setPeriodStartMonth(month: Month): Book;
|
|
805
1029
|
/**
|
|
1030
|
+
* Gets the transactions pagination page size.
|
|
1031
|
+
*
|
|
806
1032
|
* @returns The transactions pagination page size
|
|
807
1033
|
*/
|
|
808
1034
|
getPageSize(): number | undefined;
|
|
809
1035
|
/**
|
|
810
|
-
* Sets the transactions pagination page size
|
|
1036
|
+
* Sets the transactions pagination page size.
|
|
1037
|
+
*
|
|
1038
|
+
* @param pageSize - The page size to set
|
|
811
1039
|
*
|
|
812
|
-
* @returns This Book, for
|
|
1040
|
+
* @returns This Book, for chaining
|
|
813
1041
|
*/
|
|
814
1042
|
setPageSize(pageSize: number): Book;
|
|
815
1043
|
/**
|
|
1044
|
+
* Gets the name of the owner of the Book.
|
|
1045
|
+
*
|
|
816
1046
|
* @returns The name of the owner of the Book
|
|
817
1047
|
*/
|
|
818
1048
|
getOwnerName(): string | undefined;
|
|
819
1049
|
/**
|
|
820
|
-
*
|
|
1050
|
+
* Gets the permission for the current user in this Book.
|
|
1051
|
+
*
|
|
1052
|
+
* @returns The permission for the current user in this Book
|
|
821
1053
|
*/
|
|
822
1054
|
getPermission(): Permission;
|
|
823
1055
|
/**
|
|
824
|
-
*
|
|
1056
|
+
* Gets the collection of this Book, if any.
|
|
1057
|
+
*
|
|
1058
|
+
* @returns The collection of this Book, if any
|
|
825
1059
|
*/
|
|
826
1060
|
getCollection(): Collection | undefined;
|
|
827
1061
|
/**
|
|
1062
|
+
* Gets the date pattern of the Book.
|
|
1063
|
+
*
|
|
828
1064
|
* @returns The date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
|
|
829
1065
|
*/
|
|
830
1066
|
getDatePattern(): string | undefined;
|
|
831
1067
|
/**
|
|
832
|
-
*
|
|
833
1068
|
* Sets the date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
|
|
834
1069
|
*
|
|
835
|
-
* @returns This Book, for
|
|
1070
|
+
* @returns This Book, for chaining
|
|
836
1071
|
*/
|
|
837
1072
|
setDatePattern(datePattern: string): Book;
|
|
838
1073
|
/**
|
|
1074
|
+
* Gets the lock date of the Book in ISO format yyyy-MM-dd.
|
|
1075
|
+
*
|
|
839
1076
|
* @returns The lock date of the Book in ISO format yyyy-MM-dd
|
|
840
1077
|
*/
|
|
841
1078
|
getLockDate(): string | undefined;
|
|
842
1079
|
/**
|
|
843
|
-
*
|
|
844
1080
|
* Sets the lock date of the Book in ISO format yyyy-MM-dd.
|
|
845
1081
|
*
|
|
846
|
-
* @returns This Book, for
|
|
1082
|
+
* @returns This Book, for chaining
|
|
847
1083
|
*/
|
|
848
1084
|
setLockDate(lockDate: string | null): Book;
|
|
849
1085
|
/**
|
|
1086
|
+
* Gets the closing date of the Book in ISO format yyyy-MM-dd.
|
|
1087
|
+
*
|
|
850
1088
|
* @returns The closing date of the Book in ISO format yyyy-MM-dd
|
|
851
1089
|
*/
|
|
852
1090
|
getClosingDate(): string | undefined;
|
|
853
1091
|
/**
|
|
854
|
-
*
|
|
855
1092
|
* Sets the closing date of the Book in ISO format yyyy-MM-dd.
|
|
856
1093
|
*
|
|
857
|
-
* @returns This Book, for
|
|
1094
|
+
* @returns This Book, for chaining
|
|
858
1095
|
*/
|
|
859
1096
|
setClosingDate(closingDate: string | null): Book;
|
|
860
1097
|
/**
|
|
1098
|
+
* Gets the decimal separator of the Book.
|
|
1099
|
+
*
|
|
861
1100
|
* @returns The decimal separator of the Book
|
|
862
1101
|
*/
|
|
863
1102
|
getDecimalSeparator(): DecimalSeparator;
|
|
864
1103
|
/**
|
|
865
|
-
*
|
|
866
1104
|
* Sets the decimal separator of the Book
|
|
867
1105
|
*
|
|
868
|
-
* @returns This Book, for
|
|
1106
|
+
* @returns This Book, for chaining
|
|
869
1107
|
*/
|
|
870
1108
|
setDecimalSeparator(decimalSeparator: DecimalSeparator): Book;
|
|
871
1109
|
/**
|
|
1110
|
+
* Gets the time zone of the Book.
|
|
1111
|
+
*
|
|
872
1112
|
* @returns The time zone of the Book
|
|
873
1113
|
*/
|
|
874
1114
|
getTimeZone(): string | undefined;
|
|
875
1115
|
/**
|
|
1116
|
+
* Sets the time zone of the Book.
|
|
876
1117
|
*
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
* @returns This Book, for chainning.
|
|
1118
|
+
* @returns This Book, for chaining
|
|
880
1119
|
*/
|
|
881
1120
|
setTimeZone(timeZone: string): Book;
|
|
882
1121
|
/**
|
|
1122
|
+
* Gets the time zone offset of the book, in minutes.
|
|
1123
|
+
*
|
|
883
1124
|
* @returns The time zone offset of the book, in minutes
|
|
884
1125
|
*/
|
|
885
1126
|
getTimeZoneOffset(): number | undefined;
|
|
886
1127
|
/**
|
|
1128
|
+
* Gets the auto post status of the Book.
|
|
1129
|
+
*
|
|
887
1130
|
* @returns The auto post status of the Book
|
|
888
1131
|
*/
|
|
889
1132
|
getAutoPost(): boolean | undefined;
|
|
890
1133
|
/**
|
|
1134
|
+
* Sets the auto post status of the Book.
|
|
891
1135
|
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
* @returns This Book, for chainning.
|
|
1136
|
+
* @returns This Book, for chaining
|
|
895
1137
|
*/
|
|
896
1138
|
setAutoPost(autoPost: boolean): Book;
|
|
897
1139
|
/**
|
|
898
|
-
*
|
|
1140
|
+
* Gets the last update date of the book, in milliseconds.
|
|
1141
|
+
*
|
|
1142
|
+
* @returns The last update date of the book, in milliseconds
|
|
899
1143
|
*/
|
|
900
1144
|
getLastUpdateMs(): number | undefined;
|
|
901
1145
|
/**
|
|
1146
|
+
* Gets the total number of posted transactions.
|
|
1147
|
+
*
|
|
902
1148
|
* @returns The total number of posted transactions
|
|
903
1149
|
*/
|
|
904
1150
|
getTotalTransactions(): number;
|
|
905
1151
|
/**
|
|
1152
|
+
* Gets the total number of posted transactions on current month.
|
|
1153
|
+
*
|
|
906
1154
|
* @returns The total number of posted transactions on current month
|
|
907
1155
|
*/
|
|
908
1156
|
getTotalTransactionsCurrentMonth(): number;
|
|
909
1157
|
/**
|
|
1158
|
+
* Gets the total number of posted transactions on current year.
|
|
1159
|
+
*
|
|
910
1160
|
* @returns The total number of posted transactions on current year
|
|
911
1161
|
*/
|
|
912
1162
|
getTotalTransactionsCurrentYear(): number;
|
|
913
1163
|
/**
|
|
1164
|
+
* Gets the visibility of the book.
|
|
1165
|
+
*
|
|
914
1166
|
* @returns The visibility of the book
|
|
915
1167
|
*/
|
|
916
1168
|
getVisibility(): Visibility;
|
|
917
1169
|
/**
|
|
918
|
-
* Gets the custom properties stored in this Book
|
|
1170
|
+
* Gets the custom properties stored in this Book.
|
|
1171
|
+
*
|
|
1172
|
+
* @returns The custom properties object
|
|
919
1173
|
*/
|
|
920
1174
|
getProperties(): {
|
|
921
1175
|
[key: string]: string;
|
|
922
1176
|
};
|
|
923
1177
|
/**
|
|
924
|
-
* Gets the property value for given keys. First property found will be retrieved
|
|
1178
|
+
* Gets the property value for given keys. First property found will be retrieved.
|
|
925
1179
|
*
|
|
926
|
-
* @param keys - The property
|
|
1180
|
+
* @param keys - The property keys to search for
|
|
1181
|
+
*
|
|
1182
|
+
* @returns The property value or undefined if not found
|
|
927
1183
|
*/
|
|
928
1184
|
getProperty(...keys: string[]): string | undefined;
|
|
929
1185
|
/**
|
|
930
|
-
* Sets the custom properties of the Book
|
|
1186
|
+
* Sets the custom properties of the Book.
|
|
931
1187
|
*
|
|
932
1188
|
* @param properties - Object with key/value pair properties
|
|
933
1189
|
*
|
|
934
|
-
* @returns This Book, for
|
|
1190
|
+
* @returns This Book, for chaining
|
|
935
1191
|
*/
|
|
936
1192
|
setProperties(properties: {
|
|
937
1193
|
[key: string]: string;
|
|
@@ -942,7 +1198,7 @@ export declare class Book {
|
|
|
942
1198
|
* @param key - The property key
|
|
943
1199
|
* @param value - The property value
|
|
944
1200
|
*
|
|
945
|
-
* @returns This Book, for
|
|
1201
|
+
* @returns This Book, for chaining
|
|
946
1202
|
*/
|
|
947
1203
|
setProperty(key: string, value: string | null): Book;
|
|
948
1204
|
/**
|
|
@@ -951,13 +1207,15 @@ export declare class Book {
|
|
|
951
1207
|
* @param date - The date to format as string.
|
|
952
1208
|
* @param timeZone - The output timezone of the result. Default to script's timeZone
|
|
953
1209
|
*
|
|
954
|
-
* @returns The date
|
|
1210
|
+
* @returns The formatted date
|
|
955
1211
|
*/
|
|
956
1212
|
formatDate(date: Date, timeZone?: string): string;
|
|
957
1213
|
/**
|
|
958
|
-
* Parse a date string according to date pattern and timezone of the Book.
|
|
1214
|
+
* Parse a date string according to date pattern and timezone of the Book. Also parse ISO yyyy-mm-dd format.
|
|
959
1215
|
*
|
|
960
|
-
*
|
|
1216
|
+
* @param date - The date string to parse
|
|
1217
|
+
*
|
|
1218
|
+
* @returns The parsed Date object
|
|
961
1219
|
*/
|
|
962
1220
|
parseDate(date: string): Date;
|
|
963
1221
|
/**
|
|
@@ -965,25 +1223,29 @@ export declare class Book {
|
|
|
965
1223
|
*
|
|
966
1224
|
* @param value - The value to be formatted.
|
|
967
1225
|
*
|
|
968
|
-
* @returns The value
|
|
1226
|
+
* @returns The formatted value
|
|
969
1227
|
*/
|
|
970
1228
|
formatValue(value: Amount | number | null | undefined): string;
|
|
971
1229
|
/**
|
|
972
1230
|
* Parse a value string according to [[DecimalSeparator]] and fraction digits of the Book.
|
|
1231
|
+
*
|
|
1232
|
+
* @param value - The value string to parse
|
|
1233
|
+
*
|
|
1234
|
+
* @returns The parsed Amount or undefined if parsing fails
|
|
973
1235
|
*/
|
|
974
1236
|
parseValue(value: string): Amount | undefined;
|
|
975
1237
|
/**
|
|
976
|
-
* Rounds a value according to the number of fraction digits of the Book
|
|
1238
|
+
* Rounds a value according to the number of fraction digits of the Book.
|
|
977
1239
|
*
|
|
978
1240
|
* @param value - The value to be rounded
|
|
979
1241
|
*
|
|
980
|
-
* @returns The value
|
|
1242
|
+
* @returns The rounded value
|
|
981
1243
|
*/
|
|
982
1244
|
round(value: Amount | number): Amount;
|
|
983
1245
|
/**
|
|
984
1246
|
* Batch create [[Transactions]] on the Book.
|
|
985
1247
|
*
|
|
986
|
-
* @param transactions The transactions to be created
|
|
1248
|
+
* @param transactions - The transactions to be created
|
|
987
1249
|
*
|
|
988
1250
|
* @returns The created Transactions
|
|
989
1251
|
*/
|
|
@@ -991,65 +1253,65 @@ export declare class Book {
|
|
|
991
1253
|
/**
|
|
992
1254
|
* Batch post [[Transactions]] on the Book.
|
|
993
1255
|
*
|
|
994
|
-
* @param transactions The transactions to be posted
|
|
995
|
-
*
|
|
1256
|
+
* @param transactions - The transactions to be posted
|
|
996
1257
|
*/
|
|
997
1258
|
batchPostTransactions(transactions: Transaction[]): Promise<void>;
|
|
998
1259
|
/**
|
|
999
1260
|
* Batch update [[Transactions]] on the Book.
|
|
1000
1261
|
*
|
|
1001
|
-
* @param transactions The transactions to be updated
|
|
1262
|
+
* @param transactions - The transactions to be updated
|
|
1002
1263
|
*
|
|
1003
|
-
* @param updateChecked True to also update checked transactions
|
|
1264
|
+
* @param updateChecked - True to also update checked transactions
|
|
1004
1265
|
*
|
|
1005
1266
|
* @returns The updated draft Transactions
|
|
1006
|
-
*
|
|
1007
1267
|
*/
|
|
1008
1268
|
batchUpdateTransactions(transactions: Transaction[], updateChecked?: boolean): Promise<Transaction[]>;
|
|
1009
1269
|
/**
|
|
1010
1270
|
* Batch check [[Transactions]] on the Book.
|
|
1011
1271
|
*
|
|
1012
|
-
* @param transactions The transactions to be checked
|
|
1013
|
-
*
|
|
1272
|
+
* @param transactions - The transactions to be checked
|
|
1014
1273
|
*/
|
|
1015
1274
|
batchCheckTransactions(transactions: Transaction[]): Promise<void>;
|
|
1016
1275
|
/**
|
|
1017
1276
|
* Batch uncheck [[Transactions]] on the Book.
|
|
1018
1277
|
*
|
|
1019
|
-
* @param transactions The transactions to be unchecked
|
|
1020
|
-
*
|
|
1278
|
+
* @param transactions - The transactions to be unchecked
|
|
1021
1279
|
*/
|
|
1022
1280
|
batchUncheckTransactions(transactions: Transaction[]): Promise<void>;
|
|
1023
1281
|
/**
|
|
1024
1282
|
* Batch trash [[Transactions]] on the Book.
|
|
1025
1283
|
*
|
|
1026
|
-
* @param transactions The transactions to be trashed
|
|
1027
|
-
*
|
|
1028
|
-
* @param trashChecked True to also trash checked transactions
|
|
1029
|
-
*
|
|
1284
|
+
* @param transactions - The transactions to be trashed
|
|
1285
|
+
* @param trashChecked - True to also trash checked transactions
|
|
1030
1286
|
*/
|
|
1031
1287
|
batchTrashTransactions(transactions: Transaction[], trashChecked?: boolean): Promise<void>;
|
|
1032
1288
|
/**
|
|
1033
1289
|
* Batch untrash [[Transactions]] on the Book.
|
|
1034
1290
|
*
|
|
1035
|
-
* @param transactions The transactions to be untrashed
|
|
1036
|
-
*
|
|
1291
|
+
* @param transactions - The transactions to be untrashed
|
|
1037
1292
|
*/
|
|
1038
1293
|
batchUntrashTransactions(transactions: Transaction[]): Promise<void>;
|
|
1039
1294
|
/**
|
|
1040
1295
|
* Replay [[Events]] on the Book, in batch.
|
|
1296
|
+
*
|
|
1297
|
+
* @param events - The events to be replayed
|
|
1298
|
+
* @param errorOnly - True to only replay events with errors
|
|
1041
1299
|
*/
|
|
1042
1300
|
batchReplayEvents(events: Event[], errorOnly?: boolean): Promise<void>;
|
|
1043
1301
|
/**
|
|
1044
1302
|
* Create [[Accounts]] on the Book, in batch.
|
|
1045
1303
|
*
|
|
1046
|
-
* @
|
|
1304
|
+
* @param accounts - The accounts to be created
|
|
1305
|
+
*
|
|
1306
|
+
* @returns The created Accounts
|
|
1047
1307
|
*/
|
|
1048
1308
|
batchCreateAccounts(accounts: Account[]): Promise<Account[]>;
|
|
1049
1309
|
/**
|
|
1050
1310
|
* Create [[Groups]] on the Book, in batch.
|
|
1051
1311
|
*
|
|
1052
|
-
* @
|
|
1312
|
+
* @param groups - The groups to be created
|
|
1313
|
+
*
|
|
1314
|
+
* @returns The created Groups
|
|
1053
1315
|
*/
|
|
1054
1316
|
batchCreateGroups(groups: Group[]): Promise<Group[]>;
|
|
1055
1317
|
/**
|
|
@@ -1057,35 +1319,35 @@ export declare class Book {
|
|
|
1057
1319
|
*/
|
|
1058
1320
|
audit(): void;
|
|
1059
1321
|
/**
|
|
1060
|
-
* Retrieve installed [[Apps]] for this Book
|
|
1322
|
+
* Retrieve installed [[Apps]] for this Book.
|
|
1061
1323
|
*
|
|
1062
|
-
* @returns The Apps objects
|
|
1324
|
+
* @returns The retrieved Apps objects
|
|
1063
1325
|
*/
|
|
1064
1326
|
getApps(): Promise<App[]>;
|
|
1065
1327
|
/**
|
|
1066
1328
|
* Gets the existing [[Integrations]] in the Book.
|
|
1067
1329
|
*
|
|
1068
|
-
* @returns The
|
|
1330
|
+
* @returns The retrieved Integration objects
|
|
1069
1331
|
*/
|
|
1070
1332
|
getIntegrations(): Promise<Integration[]>;
|
|
1071
1333
|
/**
|
|
1072
1334
|
* Creates a new [[Integration]] in the Book.
|
|
1073
1335
|
*
|
|
1074
|
-
* @param integration - The Integration object or wrapped plain json
|
|
1336
|
+
* @param integration - The [[Integration]] object or wrapped plain json
|
|
1075
1337
|
*
|
|
1076
|
-
* @returns The created Integration object
|
|
1338
|
+
* @returns The created [[Integration]] object
|
|
1077
1339
|
*/
|
|
1078
1340
|
createIntegration(integration: bkper.Integration | Integration): Promise<Integration>;
|
|
1079
1341
|
/**
|
|
1080
1342
|
* Updates an existing [[Integration]] in the Book.
|
|
1081
1343
|
*
|
|
1082
|
-
* @param integration - The Integration wrapped plain json
|
|
1344
|
+
* @param integration - The [[Integration]] wrapped plain json
|
|
1083
1345
|
*
|
|
1084
|
-
* @returns The updated Integration object
|
|
1346
|
+
* @returns The updated [[Integration]] object
|
|
1085
1347
|
*/
|
|
1086
1348
|
updateIntegration(integration: bkper.Integration): Promise<Integration>;
|
|
1087
1349
|
/**
|
|
1088
|
-
* Gets an [[Account]] object
|
|
1350
|
+
* Gets an [[Account]] object.
|
|
1089
1351
|
*
|
|
1090
1352
|
* @param idOrName - The id or name of the Account
|
|
1091
1353
|
*
|
|
@@ -1101,7 +1363,7 @@ export declare class Book {
|
|
|
1101
1363
|
|
|
1102
1364
|
|
|
1103
1365
|
/**
|
|
1104
|
-
* Gets a [[Group]] object
|
|
1366
|
+
* Gets a [[Group]] object.
|
|
1105
1367
|
*
|
|
1106
1368
|
* @param idOrName - The id or name of the Group
|
|
1107
1369
|
*
|
|
@@ -1109,16 +1371,16 @@ export declare class Book {
|
|
|
1109
1371
|
*/
|
|
1110
1372
|
getGroup(idOrName?: string): Promise<Group | undefined>;
|
|
1111
1373
|
/**
|
|
1112
|
-
* Gets all [[Groups]] of this Book
|
|
1374
|
+
* Gets all [[Groups]] of this Book.
|
|
1113
1375
|
*
|
|
1114
|
-
* @returns The retrieved Group objects
|
|
1376
|
+
* @returns The retrieved [[Group]] objects
|
|
1115
1377
|
*/
|
|
1116
1378
|
getGroups(): Promise<Group[]>;
|
|
1117
1379
|
|
|
1118
1380
|
/**
|
|
1119
|
-
* Gets all [[Accounts]] of this Book
|
|
1381
|
+
* Gets all [[Accounts]] of this Book.
|
|
1120
1382
|
*
|
|
1121
|
-
* @returns The retrieved Account objects
|
|
1383
|
+
* @returns The retrieved [[Account]] objects
|
|
1122
1384
|
*/
|
|
1123
1385
|
getAccounts(): Promise<Account[]>;
|
|
1124
1386
|
|
|
@@ -1132,31 +1394,39 @@ export declare class Book {
|
|
|
1132
1394
|
* Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
|
|
1133
1395
|
*
|
|
1134
1396
|
* @param query - The query string to filter transactions
|
|
1135
|
-
* @param limit - The maximum number of transactions to return. Default to 100, max to 1000
|
|
1397
|
+
* @param limit - The maximum number of transactions to return. Default to 100, max to 1000
|
|
1136
1398
|
* @param cursor - The cursor for pagination
|
|
1137
1399
|
*
|
|
1138
|
-
* @returns A
|
|
1400
|
+
* @returns A [[TransactionList]] object containing the list of transactions
|
|
1139
1401
|
*/
|
|
1140
1402
|
listTransactions(query?: string, limit?: number, cursor?: string): Promise<TransactionList>;
|
|
1141
1403
|
/**
|
|
1142
1404
|
* Lists events in the Book based on the provided parameters.
|
|
1143
1405
|
*
|
|
1144
|
-
* @param afterDate - The start date (inclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format. Can be null
|
|
1145
|
-
* @param beforeDate - The end date (exclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format. Can be null
|
|
1146
|
-
* @param onError - True to search only for events on error
|
|
1147
|
-
* @param resourceId - The ID of the event's resource (Transaction, Account, or Group). Can be null
|
|
1148
|
-
* @param limit - The maximum number of events to return
|
|
1149
|
-
* @param cursor - The cursor for pagination. Can be null
|
|
1406
|
+
* @param afterDate - The start date (inclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format. Can be null
|
|
1407
|
+
* @param beforeDate - The end date (exclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format. Can be null
|
|
1408
|
+
* @param onError - True to search only for events on error
|
|
1409
|
+
* @param resourceId - The ID of the event's resource (Transaction, Account, or Group). Can be null
|
|
1410
|
+
* @param limit - The maximum number of events to return
|
|
1411
|
+
* @param cursor - The cursor for pagination. Can be null
|
|
1150
1412
|
*
|
|
1151
|
-
* @returns An EventList object containing the list of events
|
|
1413
|
+
* @returns An [[EventList]] object containing the list of events
|
|
1152
1414
|
*/
|
|
1153
1415
|
listEvents(afterDate: string | null, beforeDate: string | null, onError: boolean, resourceId: string | null, limit: number, cursor?: string): Promise<EventList>;
|
|
1154
1416
|
/**
|
|
1155
|
-
* Retrieve a transaction by id
|
|
1417
|
+
* Retrieve a transaction by id.
|
|
1418
|
+
*
|
|
1419
|
+
* @param id - The transaction ID
|
|
1420
|
+
*
|
|
1421
|
+
* @returns The [[Transaction]] object
|
|
1156
1422
|
*/
|
|
1157
1423
|
getTransaction(id: string): Promise<Transaction | undefined>;
|
|
1158
1424
|
/**
|
|
1159
|
-
* Retrieve a file by id
|
|
1425
|
+
* Retrieve a file by id.
|
|
1426
|
+
*
|
|
1427
|
+
* @param id - The file ID
|
|
1428
|
+
*
|
|
1429
|
+
* @returns The [[File]] object
|
|
1160
1430
|
*/
|
|
1161
1431
|
getFile(id: string): Promise<File>;
|
|
1162
1432
|
/**
|
|
@@ -1165,17 +1435,28 @@ export declare class Book {
|
|
|
1165
1435
|
* @returns The created Book object
|
|
1166
1436
|
*/
|
|
1167
1437
|
create(): Promise<Book>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Creates a copy of this Book
|
|
1440
|
+
*
|
|
1441
|
+
* @param name - The name for the copied book
|
|
1442
|
+
* @param copyTransactions - True to copy transactions from the source book (user must be the Book owner)
|
|
1443
|
+
* @param fromDate - Start date to consider if copying transactions (numeric value in YYYYMMDD format)
|
|
1444
|
+
*
|
|
1445
|
+
* @returns The copied Book object
|
|
1446
|
+
*/
|
|
1447
|
+
copy(name: string, copyTransactions?: boolean, fromDate?: number): Promise<Book>;
|
|
1168
1448
|
/**
|
|
1169
1449
|
* Perform update Book, applying pending changes.
|
|
1450
|
+
*
|
|
1451
|
+
* @returns The updated Book object
|
|
1170
1452
|
*/
|
|
1171
1453
|
update(): Promise<Book>;
|
|
1172
1454
|
/**
|
|
1455
|
+
* Create a [[BalancesReport]] based on query.
|
|
1173
1456
|
*
|
|
1174
|
-
*
|
|
1457
|
+
* @param query - The balances report query
|
|
1175
1458
|
*
|
|
1176
|
-
* @
|
|
1177
|
-
*
|
|
1178
|
-
* @return The balances report
|
|
1459
|
+
* @returns The balances report
|
|
1179
1460
|
*
|
|
1180
1461
|
* Example:
|
|
1181
1462
|
*
|
|
@@ -1186,10 +1467,14 @@ export declare class Book {
|
|
|
1186
1467
|
*
|
|
1187
1468
|
* var accountBalance = balancesReport.getBalancesContainer("Bank Account").getCumulativeBalance();
|
|
1188
1469
|
* ```
|
|
1470
|
+
*
|
|
1471
|
+
* @returns The retrieved [[BalancesReport]] object
|
|
1189
1472
|
*/
|
|
1190
1473
|
getBalancesReport(query: string): Promise<BalancesReport>;
|
|
1191
1474
|
/**
|
|
1192
|
-
*
|
|
1475
|
+
* Gets the saved queries from this book.
|
|
1476
|
+
*
|
|
1477
|
+
* @returns The saved queries from this book
|
|
1193
1478
|
*/
|
|
1194
1479
|
getSavedQueries(): Promise<Query[]>;
|
|
1195
1480
|
}
|
|
@@ -1205,22 +1490,32 @@ export declare class BotResponse {
|
|
|
1205
1490
|
|
|
1206
1491
|
constructor(event: Event, payload?: bkper.BotResponse);
|
|
1207
1492
|
/**
|
|
1208
|
-
*
|
|
1493
|
+
* Gets the type of this Bot Response.
|
|
1494
|
+
*
|
|
1495
|
+
* @returns The type of this Bot Response
|
|
1209
1496
|
*/
|
|
1210
1497
|
getType(): BotResponseType | undefined;
|
|
1211
1498
|
/**
|
|
1212
|
-
*
|
|
1499
|
+
* Gets the agent id of this Bot Response.
|
|
1500
|
+
*
|
|
1501
|
+
* @returns The agent id of this Bot Response
|
|
1213
1502
|
*/
|
|
1214
1503
|
getAgentId(): string | undefined;
|
|
1215
1504
|
/**
|
|
1216
|
-
*
|
|
1505
|
+
* Gets the message of this Bot Response.
|
|
1506
|
+
*
|
|
1507
|
+
* @returns The message of this Bot Response
|
|
1217
1508
|
*/
|
|
1218
1509
|
getMessage(): string | undefined;
|
|
1219
1510
|
/**
|
|
1511
|
+
* Gets the date this Bot Response was created.
|
|
1512
|
+
*
|
|
1220
1513
|
* @returns The date this Bot Response was created
|
|
1221
1514
|
*/
|
|
1222
1515
|
getCreatedAt(): Date | undefined;
|
|
1223
1516
|
/**
|
|
1517
|
+
* Gets the Event this Bot Response is associated to.
|
|
1518
|
+
*
|
|
1224
1519
|
* @returns The Event this Bot Response is associated to
|
|
1225
1520
|
*/
|
|
1226
1521
|
getEvent(): Event;
|
|
@@ -1229,13 +1524,13 @@ export declare class BotResponse {
|
|
|
1229
1524
|
*
|
|
1230
1525
|
* @returns The updated Bot Response
|
|
1231
1526
|
*/
|
|
1232
|
-
replay(): Promise<
|
|
1527
|
+
replay(): Promise<BotResponse>;
|
|
1233
1528
|
/**
|
|
1234
1529
|
* Delete this Bot Response.
|
|
1235
1530
|
*
|
|
1236
1531
|
* @returns The deleted Bot Response
|
|
1237
1532
|
*/
|
|
1238
|
-
remove(): Promise<
|
|
1533
|
+
remove(): Promise<BotResponse>;
|
|
1239
1534
|
|
|
1240
1535
|
}
|
|
1241
1536
|
|
|
@@ -1268,21 +1563,29 @@ export declare class Collection {
|
|
|
1268
1563
|
payload: bkper.Collection;
|
|
1269
1564
|
constructor(payload?: bkper.Collection);
|
|
1270
1565
|
/**
|
|
1566
|
+
* Gets an immutable copy of the JSON payload for this Collection.
|
|
1567
|
+
*
|
|
1271
1568
|
* @returns The wrapped plain json object
|
|
1272
1569
|
*/
|
|
1273
1570
|
json(): bkper.Collection;
|
|
1274
1571
|
/**
|
|
1572
|
+
* Gets the unique identifier of this Collection.
|
|
1573
|
+
*
|
|
1275
1574
|
* @returns The id of this Collection
|
|
1276
1575
|
*/
|
|
1277
1576
|
getId(): string | undefined;
|
|
1278
1577
|
/**
|
|
1578
|
+
* Gets the name of this Collection.
|
|
1579
|
+
*
|
|
1279
1580
|
* @returns The name of this Collection
|
|
1280
1581
|
*/
|
|
1281
1582
|
getName(): string | undefined;
|
|
1282
1583
|
/**
|
|
1283
1584
|
* Sets the name of the Collection.
|
|
1284
1585
|
*
|
|
1285
|
-
* @
|
|
1586
|
+
* @param name - The name to set
|
|
1587
|
+
*
|
|
1588
|
+
* @returns This Collection, for chaining
|
|
1286
1589
|
*/
|
|
1287
1590
|
setName(name: string): Collection;
|
|
1288
1591
|
/**
|
|
@@ -1298,18 +1601,24 @@ export declare class Collection {
|
|
|
1298
1601
|
*/
|
|
1299
1602
|
getPermission(): Permission | undefined;
|
|
1300
1603
|
/**
|
|
1301
|
-
*
|
|
1604
|
+
* Gets all Books of this collection.
|
|
1605
|
+
*
|
|
1606
|
+
* @returns All Books of this collection
|
|
1302
1607
|
*/
|
|
1303
1608
|
getBooks(): Book[];
|
|
1304
1609
|
/**
|
|
1305
1610
|
* Adds Books to this Collection.
|
|
1306
1611
|
*
|
|
1612
|
+
* @param books - The Books to add to this Collection
|
|
1613
|
+
*
|
|
1307
1614
|
* @returns The added Book objects
|
|
1308
1615
|
*/
|
|
1309
1616
|
addBooks(books: Book[]): Promise<Book[]>;
|
|
1310
1617
|
/**
|
|
1311
1618
|
* Removes Books from this Collection.
|
|
1312
1619
|
*
|
|
1620
|
+
* @param books - The Books to remove from this Collection
|
|
1621
|
+
*
|
|
1313
1622
|
* @returns The removed Book objects
|
|
1314
1623
|
*/
|
|
1315
1624
|
removeBooks(books: Book[]): Promise<Book[]>;
|
|
@@ -1395,6 +1704,8 @@ export declare class Connection {
|
|
|
1395
1704
|
payload: bkper.Connection;
|
|
1396
1705
|
constructor(payload?: bkper.Connection);
|
|
1397
1706
|
/**
|
|
1707
|
+
* Gets an immutable copy of the JSON payload for this Connection.
|
|
1708
|
+
*
|
|
1398
1709
|
* @returns An immutable copy of the json payload
|
|
1399
1710
|
*/
|
|
1400
1711
|
json(): bkper.Connection;
|
|
@@ -1415,7 +1726,7 @@ export declare class Connection {
|
|
|
1415
1726
|
*
|
|
1416
1727
|
* @param agentId - The Connection agentId
|
|
1417
1728
|
*
|
|
1418
|
-
* @returns The Connection, for
|
|
1729
|
+
* @returns The Connection, for chaining
|
|
1419
1730
|
*/
|
|
1420
1731
|
setAgentId(agentId: string): Connection;
|
|
1421
1732
|
/**
|
|
@@ -1447,7 +1758,7 @@ export declare class Connection {
|
|
|
1447
1758
|
*
|
|
1448
1759
|
* @param name - The name of the Connection
|
|
1449
1760
|
*
|
|
1450
|
-
* @returns The Connection, for
|
|
1761
|
+
* @returns The Connection, for chaining
|
|
1451
1762
|
*/
|
|
1452
1763
|
setName(name: string): Connection;
|
|
1453
1764
|
/**
|
|
@@ -1455,7 +1766,7 @@ export declare class Connection {
|
|
|
1455
1766
|
*
|
|
1456
1767
|
* @param uuid - The universal unique identifier of the Connection
|
|
1457
1768
|
*
|
|
1458
|
-
* @returns The Connection, for
|
|
1769
|
+
* @returns The Connection, for chaining
|
|
1459
1770
|
*/
|
|
1460
1771
|
setUUID(uuid: string): Connection;
|
|
1461
1772
|
/**
|
|
@@ -1475,7 +1786,7 @@ export declare class Connection {
|
|
|
1475
1786
|
*
|
|
1476
1787
|
* @param type - The Connection type
|
|
1477
1788
|
*
|
|
1478
|
-
* @returns The Connection, for
|
|
1789
|
+
* @returns The Connection, for chaining
|
|
1479
1790
|
*/
|
|
1480
1791
|
setType(type: "APP" | "BANK"): Connection;
|
|
1481
1792
|
/**
|
|
@@ -1491,7 +1802,7 @@ export declare class Connection {
|
|
|
1491
1802
|
*
|
|
1492
1803
|
* @param properties - Object with key/value pair properties
|
|
1493
1804
|
*
|
|
1494
|
-
* @returns The Connection, for
|
|
1805
|
+
* @returns The Connection, for chaining
|
|
1495
1806
|
*/
|
|
1496
1807
|
setProperties(properties: {
|
|
1497
1808
|
[key: string]: string;
|
|
@@ -1518,7 +1829,7 @@ export declare class Connection {
|
|
|
1518
1829
|
*
|
|
1519
1830
|
* @param key - The property key
|
|
1520
1831
|
*
|
|
1521
|
-
* @returns The Connection, for
|
|
1832
|
+
* @returns The Connection, for chaining
|
|
1522
1833
|
*/
|
|
1523
1834
|
deleteProperty(key: string): Connection;
|
|
1524
1835
|
/**
|
|
@@ -1564,36 +1875,43 @@ export declare class Conversation {
|
|
|
1564
1875
|
|
|
1565
1876
|
constructor(agent: Agent, payload?: bkper.Conversation);
|
|
1566
1877
|
/**
|
|
1878
|
+
* Gets an immutable copy of the JSON payload for this Conversation.
|
|
1879
|
+
*
|
|
1567
1880
|
* @returns The wrapped plain json object
|
|
1568
1881
|
*/
|
|
1569
1882
|
json(): bkper.Conversation;
|
|
1570
1883
|
/**
|
|
1884
|
+
* Gets the Agent associated to this Conversation.
|
|
1571
1885
|
*
|
|
1572
1886
|
* @returns The Agent associated to this Conversation
|
|
1573
1887
|
*/
|
|
1574
1888
|
getAgent(): Agent;
|
|
1575
1889
|
/**
|
|
1890
|
+
* Gets the Conversation universal identifier.
|
|
1576
1891
|
*
|
|
1577
1892
|
* @returns The Conversation universal identifier
|
|
1578
1893
|
*/
|
|
1579
1894
|
getId(): string | undefined;
|
|
1580
1895
|
/**
|
|
1896
|
+
* Gets the title of the Conversation.
|
|
1581
1897
|
*
|
|
1582
1898
|
* @returns The title of the Conversation
|
|
1583
1899
|
*/
|
|
1584
1900
|
getTitle(): string | undefined;
|
|
1585
1901
|
/**
|
|
1902
|
+
* Gets the Date the Conversation was created.
|
|
1586
1903
|
*
|
|
1587
1904
|
* @returns The Date the Conversation was created
|
|
1588
1905
|
*/
|
|
1589
1906
|
getCreatedAt(): Date | undefined;
|
|
1590
1907
|
/**
|
|
1908
|
+
* Gets the Date the Conversation was last updated.
|
|
1591
1909
|
*
|
|
1592
1910
|
* @returns The Date the Conversation was last updated
|
|
1593
1911
|
*/
|
|
1594
1912
|
getUpdatedAt(): Date | undefined;
|
|
1595
1913
|
/**
|
|
1596
|
-
* Gets the Messages that compose this Conversation
|
|
1914
|
+
* Gets the Messages that compose this Conversation.
|
|
1597
1915
|
*
|
|
1598
1916
|
* @returns The Messages in this Conversation
|
|
1599
1917
|
*/
|
|
@@ -1601,7 +1919,7 @@ export declare class Conversation {
|
|
|
1601
1919
|
|
|
1602
1920
|
|
|
1603
1921
|
/**
|
|
1604
|
-
* Performs create Conversation
|
|
1922
|
+
* Performs create Conversation.
|
|
1605
1923
|
*
|
|
1606
1924
|
* @returns The created Conversation object
|
|
1607
1925
|
*/
|
|
@@ -1638,38 +1956,56 @@ export declare class Event {
|
|
|
1638
1956
|
|
|
1639
1957
|
constructor(book: Book, payload?: bkper.Event);
|
|
1640
1958
|
/**
|
|
1959
|
+
* Gets an immutable copy of the JSON payload for this Event.
|
|
1960
|
+
*
|
|
1641
1961
|
* @returns The wrapped plain json object
|
|
1642
1962
|
*/
|
|
1643
1963
|
json(): bkper.Event;
|
|
1644
1964
|
/**
|
|
1965
|
+
* Gets the book in which the Event was created.
|
|
1966
|
+
*
|
|
1645
1967
|
* @returns The book in which the Event was created
|
|
1646
1968
|
*/
|
|
1647
1969
|
getBook(): Book;
|
|
1648
1970
|
/**
|
|
1971
|
+
* Gets the id of the Event.
|
|
1972
|
+
*
|
|
1649
1973
|
* @returns The id of the Event
|
|
1650
1974
|
*/
|
|
1651
1975
|
getId(): string | undefined;
|
|
1652
1976
|
/**
|
|
1977
|
+
* Gets the user who performed the Event.
|
|
1978
|
+
*
|
|
1653
1979
|
* @returns The user who performed the Event
|
|
1654
1980
|
*/
|
|
1655
1981
|
getUser(): User | undefined;
|
|
1656
1982
|
/**
|
|
1983
|
+
* Gets the Agent who performed the Event.
|
|
1984
|
+
*
|
|
1657
1985
|
* @returns The Agent who performed the Event
|
|
1658
1986
|
*/
|
|
1659
1987
|
getAgent(): Agent | undefined;
|
|
1660
1988
|
/**
|
|
1989
|
+
* Gets the date the Event was created.
|
|
1990
|
+
*
|
|
1661
1991
|
* @returns The date the Event was created
|
|
1662
1992
|
*/
|
|
1663
1993
|
getCreatedAt(): Date | undefined;
|
|
1664
1994
|
/**
|
|
1995
|
+
* Gets the type of the Event.
|
|
1996
|
+
*
|
|
1665
1997
|
* @returns The type of the Event
|
|
1666
1998
|
*/
|
|
1667
1999
|
getType(): EventType | undefined;
|
|
1668
2000
|
/**
|
|
2001
|
+
* Gets the Bot Responses associated to this Event.
|
|
2002
|
+
*
|
|
1669
2003
|
* @returns The Bot Responses associated to this Event
|
|
1670
2004
|
*/
|
|
1671
2005
|
getBotResponses(): BotResponse[];
|
|
1672
2006
|
/**
|
|
2007
|
+
* Checks if this Event has at least one Bot Response of type ERROR.
|
|
2008
|
+
*
|
|
1673
2009
|
* @returns True if this Event has at least one Bot Response of type ERROR
|
|
1674
2010
|
*/
|
|
1675
2011
|
hasErrorResponse(): boolean;
|
|
@@ -1677,30 +2013,35 @@ export declare class Event {
|
|
|
1677
2013
|
|
|
1678
2014
|
/**
|
|
1679
2015
|
* A list associated with an event query.
|
|
2016
|
+
*
|
|
2017
|
+
* @public
|
|
1680
2018
|
*/
|
|
1681
2019
|
export declare class EventList {
|
|
1682
2020
|
private payload;
|
|
1683
2021
|
|
|
1684
2022
|
constructor(book: Book, payload: bkper.EventList);
|
|
1685
2023
|
/**
|
|
1686
|
-
*
|
|
2024
|
+
* Gets the cursor associated with the query for pagination.
|
|
2025
|
+
*
|
|
2026
|
+
* @returns The cursor associated with the query for pagination
|
|
1687
2027
|
*/
|
|
1688
2028
|
getCursor(): string | undefined;
|
|
1689
2029
|
/**
|
|
1690
|
-
*
|
|
2030
|
+
* Gets the first Event in the list.
|
|
2031
|
+
*
|
|
2032
|
+
* @returns The first Event in the list
|
|
1691
2033
|
*/
|
|
1692
2034
|
getFirst(): Event | undefined;
|
|
1693
2035
|
/**
|
|
1694
|
-
*
|
|
1695
2036
|
* Get the total number of events in the list.
|
|
1696
2037
|
*
|
|
1697
|
-
* @returns The total number of events
|
|
2038
|
+
* @returns The total number of events
|
|
1698
2039
|
*/
|
|
1699
2040
|
size(): number;
|
|
1700
2041
|
/**
|
|
1701
2042
|
* Get the events in the list.
|
|
1702
2043
|
*
|
|
1703
|
-
* @returns An array of Event objects
|
|
2044
|
+
* @returns An array of Event objects
|
|
1704
2045
|
*/
|
|
1705
2046
|
getItems(): Event[];
|
|
1706
2047
|
}
|
|
@@ -1753,56 +2094,75 @@ export declare class File {
|
|
|
1753
2094
|
|
|
1754
2095
|
constructor(book: Book, payload?: bkper.File);
|
|
1755
2096
|
/**
|
|
2097
|
+
* Gets an immutable copy of the JSON payload for this File.
|
|
2098
|
+
*
|
|
1756
2099
|
* @returns An immutable copy of the json payload
|
|
1757
2100
|
*/
|
|
1758
2101
|
json(): bkper.File;
|
|
1759
2102
|
/**
|
|
1760
|
-
* Gets the File id
|
|
2103
|
+
* Gets the File id.
|
|
2104
|
+
*
|
|
2105
|
+
* @returns The File id
|
|
1761
2106
|
*/
|
|
1762
2107
|
getId(): string | undefined;
|
|
1763
2108
|
/**
|
|
1764
|
-
* Gets the File name
|
|
2109
|
+
* Gets the File name.
|
|
2110
|
+
*
|
|
2111
|
+
* @returns The File name
|
|
1765
2112
|
*/
|
|
1766
2113
|
getName(): string | undefined;
|
|
1767
2114
|
/**
|
|
1768
|
-
*
|
|
1769
2115
|
* Sets the name of the File.
|
|
1770
2116
|
*
|
|
1771
|
-
* @
|
|
2117
|
+
* @param name - The name to set
|
|
2118
|
+
*
|
|
2119
|
+
* @returns This File, for chaining
|
|
1772
2120
|
*/
|
|
1773
2121
|
setName(name: string): File;
|
|
1774
2122
|
/**
|
|
1775
|
-
* Gets the File content type
|
|
2123
|
+
* Gets the File content type.
|
|
2124
|
+
*
|
|
2125
|
+
* @returns The File content type
|
|
1776
2126
|
*/
|
|
1777
2127
|
getContentType(): string | undefined;
|
|
1778
2128
|
/**
|
|
1779
|
-
*
|
|
1780
2129
|
* Sets the File content type.
|
|
1781
2130
|
*
|
|
1782
|
-
* @
|
|
2131
|
+
* @param contentType - The content type to set
|
|
2132
|
+
*
|
|
2133
|
+
* @returns This File, for chaining
|
|
1783
2134
|
*/
|
|
1784
2135
|
setContentType(contentType: string): File;
|
|
1785
2136
|
/**
|
|
1786
|
-
* Gets the file content Base64 encoded
|
|
2137
|
+
* Gets the file content Base64 encoded.
|
|
2138
|
+
*
|
|
2139
|
+
* @returns The file content Base64 encoded
|
|
1787
2140
|
*/
|
|
1788
2141
|
getContent(): Promise<string | undefined>;
|
|
1789
2142
|
/**
|
|
1790
|
-
*
|
|
1791
2143
|
* Sets the File content Base64 encoded.
|
|
1792
2144
|
*
|
|
1793
|
-
* @
|
|
2145
|
+
* @param content - The content to set (Base64 encoded)
|
|
2146
|
+
*
|
|
2147
|
+
* @returns This File, for chaining
|
|
1794
2148
|
*/
|
|
1795
2149
|
setContent(content: string): File;
|
|
1796
2150
|
/**
|
|
1797
|
-
* Gets the file serving url for accessing via browser
|
|
2151
|
+
* Gets the file serving url for accessing via browser.
|
|
2152
|
+
*
|
|
2153
|
+
* @returns The file serving url
|
|
1798
2154
|
*/
|
|
1799
2155
|
getUrl(): string | undefined;
|
|
1800
2156
|
/**
|
|
1801
|
-
* Gets the file size in bytes
|
|
2157
|
+
* Gets the file size in bytes.
|
|
2158
|
+
*
|
|
2159
|
+
* @returns The file size in bytes
|
|
1802
2160
|
*/
|
|
1803
2161
|
getSize(): number | undefined;
|
|
1804
2162
|
/**
|
|
1805
2163
|
* Perform create new File.
|
|
2164
|
+
*
|
|
2165
|
+
* @returns The created File object
|
|
1806
2166
|
*/
|
|
1807
2167
|
create(): Promise<File>;
|
|
1808
2168
|
}
|
|
@@ -1826,27 +2186,33 @@ export declare class Group {
|
|
|
1826
2186
|
|
|
1827
2187
|
constructor(book: Book, payload?: bkper.Group);
|
|
1828
2188
|
/**
|
|
2189
|
+
* Gets an immutable copy of the json payload.
|
|
2190
|
+
*
|
|
1829
2191
|
* @returns An immutable copy of the json payload
|
|
1830
2192
|
*/
|
|
1831
2193
|
json(): bkper.Group;
|
|
1832
2194
|
/**
|
|
2195
|
+
* Gets the id of this Group.
|
|
2196
|
+
*
|
|
1833
2197
|
* @returns The id of this Group
|
|
1834
2198
|
*/
|
|
1835
2199
|
getId(): string | undefined;
|
|
1836
2200
|
/**
|
|
2201
|
+
* Gets the name of this Group.
|
|
2202
|
+
*
|
|
1837
2203
|
* @returns The name of this Group
|
|
1838
2204
|
*/
|
|
1839
2205
|
getName(): string | undefined;
|
|
1840
2206
|
/**
|
|
1841
2207
|
* Sets the name of the Group.
|
|
1842
2208
|
*
|
|
1843
|
-
* @returns This Group, for
|
|
2209
|
+
* @returns This Group, for chaining
|
|
1844
2210
|
*/
|
|
1845
2211
|
setName(name: string): Group;
|
|
1846
2212
|
/**
|
|
1847
2213
|
* Tells if the Group is locked by the Book owner.
|
|
1848
2214
|
*
|
|
1849
|
-
* @returns True if the Group is locked
|
|
2215
|
+
* @returns True if the Group is locked
|
|
1850
2216
|
*/
|
|
1851
2217
|
isLocked(): boolean;
|
|
1852
2218
|
/**
|
|
@@ -1854,23 +2220,31 @@ export declare class Group {
|
|
|
1854
2220
|
*
|
|
1855
2221
|
* @param locked - The locked state of the Group.
|
|
1856
2222
|
*
|
|
1857
|
-
* @returns This Group, for
|
|
2223
|
+
* @returns This Group, for chaining
|
|
1858
2224
|
*/
|
|
1859
2225
|
setLocked(locked: boolean): Group;
|
|
1860
2226
|
/**
|
|
2227
|
+
* Gets the normalized name of this group without spaces and special characters.
|
|
2228
|
+
*
|
|
1861
2229
|
* @returns The name of this group without spaces and special characters
|
|
1862
2230
|
*/
|
|
1863
2231
|
getNormalizedName(): string;
|
|
1864
2232
|
/**
|
|
1865
|
-
*
|
|
2233
|
+
* Gets all Accounts of this group.
|
|
2234
|
+
*
|
|
2235
|
+
* @returns All Accounts of this group
|
|
1866
2236
|
*/
|
|
1867
2237
|
getAccounts(): Promise<Account[]>;
|
|
1868
2238
|
/**
|
|
2239
|
+
* Gets the type of the accounts of this group.
|
|
2240
|
+
*
|
|
1869
2241
|
* @returns The type for of the accounts of this group. Null if mixed
|
|
1870
2242
|
*/
|
|
1871
2243
|
getType(): AccountType;
|
|
1872
2244
|
/**
|
|
1873
|
-
* Gets the custom properties stored in this Group
|
|
2245
|
+
* Gets the custom properties stored in this Group.
|
|
2246
|
+
*
|
|
2247
|
+
* @returns The custom properties as a key/value object
|
|
1874
2248
|
*/
|
|
1875
2249
|
getProperties(): {
|
|
1876
2250
|
[key: string]: string;
|
|
@@ -1880,15 +2254,17 @@ export declare class Group {
|
|
|
1880
2254
|
*
|
|
1881
2255
|
* @param properties - Object with key/value pair properties
|
|
1882
2256
|
*
|
|
1883
|
-
* @returns This Group, for
|
|
2257
|
+
* @returns This Group, for chaining
|
|
1884
2258
|
*/
|
|
1885
2259
|
setProperties(properties: {
|
|
1886
2260
|
[key: string]: string;
|
|
1887
2261
|
}): Group;
|
|
1888
2262
|
/**
|
|
1889
|
-
* Gets the property value for given keys. First property found will be retrieved
|
|
2263
|
+
* Gets the property value for given keys. First property found will be retrieved.
|
|
1890
2264
|
*
|
|
1891
2265
|
* @param keys - The property key
|
|
2266
|
+
*
|
|
2267
|
+
* @returns The property value, or undefined if not found
|
|
1892
2268
|
*/
|
|
1893
2269
|
getProperty(...keys: string[]): string | undefined;
|
|
1894
2270
|
/**
|
|
@@ -1896,6 +2272,8 @@ export declare class Group {
|
|
|
1896
2272
|
*
|
|
1897
2273
|
* @param key - The property key
|
|
1898
2274
|
* @param value - The property value
|
|
2275
|
+
*
|
|
2276
|
+
* @returns This Group, for chaining
|
|
1899
2277
|
*/
|
|
1900
2278
|
setProperty(key: string, value: string | null): Group;
|
|
1901
2279
|
/**
|
|
@@ -1903,117 +2281,141 @@ export declare class Group {
|
|
|
1903
2281
|
*
|
|
1904
2282
|
* @param key - The property key
|
|
1905
2283
|
*
|
|
1906
|
-
* @returns This Group, for
|
|
2284
|
+
* @returns This Group, for chaining
|
|
1907
2285
|
*/
|
|
1908
2286
|
deleteProperty(key: string): Group;
|
|
1909
2287
|
/**
|
|
1910
|
-
*
|
|
2288
|
+
* Tells if the Group is hidden on main transactions menu.
|
|
2289
|
+
*
|
|
2290
|
+
* @returns True if the Group is hidden, false otherwise
|
|
1911
2291
|
*/
|
|
1912
2292
|
isHidden(): boolean | undefined;
|
|
1913
2293
|
/**
|
|
1914
|
-
*
|
|
2294
|
+
* Hide/Show group on main menu.
|
|
2295
|
+
*
|
|
2296
|
+
* @param hidden - Whether to hide the group
|
|
2297
|
+
*
|
|
2298
|
+
* @returns This Group, for chaining
|
|
1915
2299
|
*/
|
|
1916
2300
|
setHidden(hidden: boolean): Group;
|
|
1917
2301
|
/**
|
|
1918
|
-
*
|
|
2302
|
+
* Tells if this is a credit (Incoming and Liabilities) group.
|
|
2303
|
+
*
|
|
2304
|
+
* @returns True if this is a credit group
|
|
1919
2305
|
*/
|
|
1920
2306
|
isCredit(): boolean | undefined;
|
|
1921
2307
|
/**
|
|
1922
|
-
*
|
|
2308
|
+
* Tells if this is a mixed (Assets/Liabilities or Incoming/Outgoing) group.
|
|
2309
|
+
*
|
|
2310
|
+
* @returns True if this is a mixed group
|
|
1923
2311
|
*/
|
|
1924
2312
|
isMixed(): boolean | undefined;
|
|
1925
2313
|
/**
|
|
1926
|
-
*
|
|
2314
|
+
* Tells if the Group is permanent.
|
|
2315
|
+
*
|
|
2316
|
+
* @returns True if the Group is permanent
|
|
1927
2317
|
*/
|
|
1928
2318
|
isPermanent(): boolean | undefined;
|
|
1929
2319
|
/**
|
|
2320
|
+
* Gets the parent Group.
|
|
2321
|
+
*
|
|
1930
2322
|
* @returns The parent Group
|
|
1931
2323
|
*/
|
|
1932
2324
|
getParent(): Group | undefined;
|
|
1933
2325
|
/**
|
|
1934
2326
|
* Sets the parent Group.
|
|
1935
2327
|
*
|
|
1936
|
-
* @
|
|
2328
|
+
* @param group - The parent Group to set
|
|
2329
|
+
*
|
|
2330
|
+
* @returns This Group, for chaining
|
|
1937
2331
|
*/
|
|
1938
2332
|
setParent(group: Group | null | undefined): Group;
|
|
1939
2333
|
/**
|
|
1940
2334
|
* Checks if the Group has a parent.
|
|
1941
2335
|
*
|
|
1942
|
-
* @returns True if the Group has a parent, otherwise false
|
|
2336
|
+
* @returns True if the Group has a parent, otherwise false
|
|
1943
2337
|
*/
|
|
1944
2338
|
hasParent(): boolean;
|
|
1945
2339
|
/**
|
|
1946
|
-
*
|
|
2340
|
+
* Gets the children of the Group.
|
|
1947
2341
|
*
|
|
1948
|
-
* @returns An array of child Groups
|
|
2342
|
+
* @returns An array of child Groups
|
|
1949
2343
|
*/
|
|
1950
2344
|
getChildren(): Group[];
|
|
1951
2345
|
|
|
1952
2346
|
/**
|
|
1953
|
-
*
|
|
2347
|
+
* Gets all descendant Groups of the current Group.
|
|
1954
2348
|
*
|
|
1955
|
-
* @returns A set of descendant Groups
|
|
2349
|
+
* @returns A set of descendant Groups
|
|
1956
2350
|
*/
|
|
1957
2351
|
getDescendants(): Set<Group>;
|
|
1958
2352
|
/**
|
|
1959
|
-
*
|
|
2353
|
+
* Gets the IDs of all descendant Groups in a tree structure.
|
|
1960
2354
|
*
|
|
1961
|
-
* @returns A set of descendant Group IDs
|
|
2355
|
+
* @returns A set of descendant Group IDs
|
|
1962
2356
|
*/
|
|
1963
2357
|
getDescendantTreeIds(): Set<string>;
|
|
1964
2358
|
/**
|
|
1965
2359
|
* Checks if the Group has any children.
|
|
1966
2360
|
*
|
|
1967
|
-
* @returns True if the Group has children, otherwise false
|
|
2361
|
+
* @returns True if the Group has children, otherwise false
|
|
1968
2362
|
*/
|
|
1969
2363
|
hasChildren(): boolean;
|
|
1970
2364
|
/**
|
|
1971
2365
|
* Checks if the Group is a leaf node (i.e., has no children).
|
|
1972
2366
|
*
|
|
1973
|
-
* @returns True if the Group is a leaf, otherwise false
|
|
2367
|
+
* @returns True if the Group is a leaf, otherwise false
|
|
1974
2368
|
*/
|
|
1975
2369
|
isLeaf(): boolean;
|
|
1976
2370
|
/**
|
|
1977
2371
|
* Checks if the Group is a root node (i.e., has no parent).
|
|
1978
2372
|
*
|
|
1979
|
-
* @returns True if the Group is a root, otherwise false
|
|
2373
|
+
* @returns True if the Group is a root, otherwise false
|
|
1980
2374
|
*/
|
|
1981
2375
|
isRoot(): boolean;
|
|
1982
2376
|
/**
|
|
1983
|
-
*
|
|
2377
|
+
* Gets the depth of the Group in the hierarchy.
|
|
1984
2378
|
*
|
|
1985
|
-
* @returns The depth of the Group
|
|
2379
|
+
* @returns The depth of the Group
|
|
1986
2380
|
*/
|
|
1987
2381
|
getDepth(): number;
|
|
1988
2382
|
/**
|
|
1989
|
-
*
|
|
2383
|
+
* Gets the root Group of the current Group.
|
|
1990
2384
|
*
|
|
1991
|
-
* @returns The root Group
|
|
2385
|
+
* @returns The root Group
|
|
1992
2386
|
*/
|
|
1993
2387
|
getRoot(): Group;
|
|
1994
2388
|
/**
|
|
1995
|
-
*
|
|
2389
|
+
* Gets the name of the root Group.
|
|
1996
2390
|
*
|
|
1997
|
-
* @returns The name of the root Group
|
|
2391
|
+
* @returns The name of the root Group
|
|
1998
2392
|
*/
|
|
1999
2393
|
getRootName(): string;
|
|
2000
2394
|
|
|
2001
2395
|
|
|
2002
2396
|
|
|
2003
2397
|
/**
|
|
2398
|
+
* Tells if this group has any account in it.
|
|
2399
|
+
*
|
|
2004
2400
|
* @returns True if this group has any account in it
|
|
2005
2401
|
*/
|
|
2006
2402
|
hasAccounts(): boolean | undefined;
|
|
2007
2403
|
/**
|
|
2008
|
-
*
|
|
2404
|
+
* Performs create new group.
|
|
2405
|
+
*
|
|
2406
|
+
* @returns A promise that resolves to this Group
|
|
2009
2407
|
*/
|
|
2010
2408
|
create(): Promise<Group>;
|
|
2011
2409
|
/**
|
|
2012
|
-
*
|
|
2410
|
+
* Performs update group, applying pending changes.
|
|
2411
|
+
*
|
|
2412
|
+
* @returns A promise that resolves to this Group
|
|
2013
2413
|
*/
|
|
2014
2414
|
update(): Promise<Group>;
|
|
2015
2415
|
/**
|
|
2016
|
-
*
|
|
2416
|
+
* Performs delete group.
|
|
2417
|
+
*
|
|
2418
|
+
* @returns A promise that resolves to this Group
|
|
2017
2419
|
*/
|
|
2018
2420
|
remove(): Promise<Group>;
|
|
2019
2421
|
|
|
@@ -2028,6 +2430,8 @@ export declare class Integration {
|
|
|
2028
2430
|
payload: bkper.Integration;
|
|
2029
2431
|
constructor(payload?: bkper.Integration);
|
|
2030
2432
|
/**
|
|
2433
|
+
* Gets an immutable copy of the JSON payload for this Integration.
|
|
2434
|
+
*
|
|
2031
2435
|
* @returns An immutable copy of the json payload
|
|
2032
2436
|
*/
|
|
2033
2437
|
json(): bkper.Integration;
|
|
@@ -2092,7 +2496,7 @@ export declare class Integration {
|
|
|
2092
2496
|
*
|
|
2093
2497
|
* @param properties - Object with key/value pair properties
|
|
2094
2498
|
*
|
|
2095
|
-
* @returns The Integration, for
|
|
2499
|
+
* @returns The Integration, for chaining
|
|
2096
2500
|
*/
|
|
2097
2501
|
setProperties(properties: {
|
|
2098
2502
|
[key: string]: string;
|
|
@@ -2119,7 +2523,7 @@ export declare class Integration {
|
|
|
2119
2523
|
*
|
|
2120
2524
|
* @param key - The property key
|
|
2121
2525
|
*
|
|
2122
|
-
* @returns The Integration, for
|
|
2526
|
+
* @returns The Integration, for chaining
|
|
2123
2527
|
*/
|
|
2124
2528
|
deleteProperty(key: string): Integration;
|
|
2125
2529
|
/**
|
|
@@ -2143,47 +2547,58 @@ export declare class Message {
|
|
|
2143
2547
|
|
|
2144
2548
|
constructor(conversation: Conversation, payload?: bkper.Message);
|
|
2145
2549
|
/**
|
|
2550
|
+
* Gets the wrapped plain json object.
|
|
2551
|
+
*
|
|
2146
2552
|
* @returns The wrapped plain json object
|
|
2147
2553
|
*/
|
|
2148
2554
|
json(): bkper.Message;
|
|
2149
2555
|
/**
|
|
2556
|
+
* Gets the Message universal identifier.
|
|
2150
2557
|
*
|
|
2151
2558
|
* @returns The Message universal identifier
|
|
2152
2559
|
*/
|
|
2153
2560
|
getId(): string | undefined;
|
|
2154
2561
|
/**
|
|
2562
|
+
* Gets the Agent associated with the Message.
|
|
2155
2563
|
*
|
|
2156
|
-
* @returns The Agent associated with the Message,
|
|
2564
|
+
* @returns The Agent associated with the Message, if any
|
|
2157
2565
|
*/
|
|
2158
2566
|
getAgent(): Agent | undefined;
|
|
2159
2567
|
/**
|
|
2568
|
+
* Gets the Conversation of the Message.
|
|
2160
2569
|
*
|
|
2161
2570
|
* @returns The Conversation of the Message
|
|
2162
2571
|
*/
|
|
2163
2572
|
getConversation(): Conversation;
|
|
2164
2573
|
/**
|
|
2574
|
+
* Gets the User associated with the Message.
|
|
2165
2575
|
*
|
|
2166
2576
|
* @returns The User associated with the Message
|
|
2167
2577
|
*/
|
|
2168
2578
|
getUser(): User | undefined;
|
|
2169
2579
|
/**
|
|
2580
|
+
* Gets the Date the Message was created.
|
|
2170
2581
|
*
|
|
2171
2582
|
* @returns The Date the Message was created
|
|
2172
2583
|
*/
|
|
2173
2584
|
getCreatedAt(): Date | undefined;
|
|
2174
2585
|
/**
|
|
2586
|
+
* Gets the text content of the Message.
|
|
2175
2587
|
*
|
|
2176
2588
|
* @returns The text content of the Message
|
|
2177
2589
|
*/
|
|
2178
2590
|
getContent(): string | undefined;
|
|
2179
2591
|
/**
|
|
2592
|
+
* Sets the text content of the Message.
|
|
2180
2593
|
*
|
|
2181
|
-
* @param content The text content of the Message
|
|
2594
|
+
* @param content - The text content of the Message
|
|
2182
2595
|
*
|
|
2183
2596
|
* @returns This Message, for chaining
|
|
2184
2597
|
*/
|
|
2185
2598
|
setContent(content: string): Message;
|
|
2186
2599
|
/**
|
|
2600
|
+
* Gets the custom properties stored in this Message.
|
|
2601
|
+
*
|
|
2187
2602
|
* @returns The custom properties stored in this Message
|
|
2188
2603
|
*/
|
|
2189
2604
|
getProperties(): {
|
|
@@ -2194,7 +2609,7 @@ export declare class Message {
|
|
|
2194
2609
|
*
|
|
2195
2610
|
* @param properties - Object with key/value pair properties
|
|
2196
2611
|
*
|
|
2197
|
-
* @returns This Message, for
|
|
2612
|
+
* @returns This Message, for chaining
|
|
2198
2613
|
*/
|
|
2199
2614
|
setProperties(properties: {
|
|
2200
2615
|
[key: string]: string;
|
|
@@ -2213,7 +2628,7 @@ export declare class Message {
|
|
|
2213
2628
|
* @param key - The property key
|
|
2214
2629
|
* @param value - The property value
|
|
2215
2630
|
*
|
|
2216
|
-
* @returns This Message, for
|
|
2631
|
+
* @returns This Message, for chaining
|
|
2217
2632
|
*/
|
|
2218
2633
|
setProperty(key: string, value: string | null): Message;
|
|
2219
2634
|
/**
|
|
@@ -2221,7 +2636,7 @@ export declare class Message {
|
|
|
2221
2636
|
*
|
|
2222
2637
|
* @param key - The property key
|
|
2223
2638
|
*
|
|
2224
|
-
* @returns This Message, for
|
|
2639
|
+
* @returns This Message, for chaining
|
|
2225
2640
|
*/
|
|
2226
2641
|
deleteProperty(key: string): Message;
|
|
2227
2642
|
/**
|
|
@@ -2232,6 +2647,8 @@ export declare class Message {
|
|
|
2232
2647
|
create(): Promise<Message>;
|
|
2233
2648
|
/**
|
|
2234
2649
|
* Streams the Message to the Bkper API.
|
|
2650
|
+
*
|
|
2651
|
+
* @returns A Promise that resolves when the streaming is complete
|
|
2235
2652
|
*/
|
|
2236
2653
|
stream(): Promise<void>;
|
|
2237
2654
|
}
|
|
@@ -2342,47 +2759,61 @@ export declare class Query {
|
|
|
2342
2759
|
|
|
2343
2760
|
constructor(book: Book, payload?: bkper.Query);
|
|
2344
2761
|
/**
|
|
2762
|
+
* Gets the wrapped plain json object.
|
|
2763
|
+
*
|
|
2345
2764
|
* @returns The wrapped plain json object
|
|
2346
2765
|
*/
|
|
2347
2766
|
json(): bkper.Query;
|
|
2348
2767
|
/**
|
|
2768
|
+
* Gets the Query universal identifier.
|
|
2769
|
+
*
|
|
2349
2770
|
* @returns The Query universal identifier
|
|
2350
2771
|
*/
|
|
2351
2772
|
getId(): string | undefined;
|
|
2352
2773
|
/**
|
|
2353
|
-
*
|
|
2774
|
+
* Gets the title of this saved Query.
|
|
2775
|
+
*
|
|
2776
|
+
* @returns The title of this saved Query
|
|
2354
2777
|
*/
|
|
2355
2778
|
getTitle(): string | undefined;
|
|
2356
2779
|
/**
|
|
2357
2780
|
* Sets the title of this saved Query.
|
|
2358
2781
|
*
|
|
2359
|
-
* @param title The title of this saved Query
|
|
2782
|
+
* @param title - The title of this saved Query
|
|
2360
2783
|
*
|
|
2361
2784
|
* @returns This Query, for chaining
|
|
2362
2785
|
*/
|
|
2363
2786
|
setTitle(title: string): Query;
|
|
2364
2787
|
/**
|
|
2365
|
-
*
|
|
2788
|
+
* Gets the query string to be executed.
|
|
2789
|
+
*
|
|
2790
|
+
* @returns This Query string to be executed
|
|
2366
2791
|
*/
|
|
2367
2792
|
getQuery(): string | undefined;
|
|
2368
2793
|
/**
|
|
2369
2794
|
* Sets the query string associated with this saved Query.
|
|
2370
2795
|
*
|
|
2371
|
-
* @param query The query string to be executed
|
|
2796
|
+
* @param query - The query string to be executed
|
|
2372
2797
|
*
|
|
2373
2798
|
* @returns This Query, for chaining
|
|
2374
2799
|
*/
|
|
2375
2800
|
setQuery(query: string): Query;
|
|
2376
2801
|
/**
|
|
2377
2802
|
* Perform create new Query.
|
|
2803
|
+
*
|
|
2804
|
+
* @returns This Query, for chaining
|
|
2378
2805
|
*/
|
|
2379
2806
|
create(): Promise<Query>;
|
|
2380
2807
|
/**
|
|
2381
2808
|
* Perform update Query, applying pending changes.
|
|
2809
|
+
*
|
|
2810
|
+
* @returns This Query, for chaining
|
|
2382
2811
|
*/
|
|
2383
2812
|
update(): Promise<Query>;
|
|
2384
2813
|
/**
|
|
2385
2814
|
* Perform delete Query.
|
|
2815
|
+
*
|
|
2816
|
+
* @returns This Query, for chaining
|
|
2386
2817
|
*/
|
|
2387
2818
|
remove(): Promise<Query>;
|
|
2388
2819
|
|
|
@@ -2399,6 +2830,8 @@ export declare class Template {
|
|
|
2399
2830
|
payload: bkper.Template;
|
|
2400
2831
|
constructor(json?: bkper.Template);
|
|
2401
2832
|
/**
|
|
2833
|
+
* Gets an immutable copy of the JSON payload for this Template.
|
|
2834
|
+
*
|
|
2402
2835
|
* @returns An immutable copy of the json payload
|
|
2403
2836
|
*/
|
|
2404
2837
|
json(): bkper.Template;
|
|
@@ -2465,116 +2898,149 @@ export declare class Transaction {
|
|
|
2465
2898
|
|
|
2466
2899
|
constructor(book: Book, payload?: bkper.Transaction);
|
|
2467
2900
|
/**
|
|
2901
|
+
* Gets the JSON representation of the transaction.
|
|
2902
|
+
*
|
|
2468
2903
|
* @returns An immutable copy of the json payload
|
|
2469
2904
|
*/
|
|
2470
2905
|
json(): bkper.Transaction;
|
|
2471
2906
|
/**
|
|
2472
|
-
*
|
|
2907
|
+
* Gets the book associated with this transaction.
|
|
2908
|
+
*
|
|
2909
|
+
* @returns The book of the Transaction
|
|
2473
2910
|
*/
|
|
2474
2911
|
getBook(): Book;
|
|
2475
2912
|
/**
|
|
2476
|
-
*
|
|
2913
|
+
* Gets the unique identifier of the transaction.
|
|
2914
|
+
*
|
|
2915
|
+
* @returns The id of the Transaction
|
|
2477
2916
|
*/
|
|
2478
2917
|
getId(): string | undefined;
|
|
2479
2918
|
/**
|
|
2919
|
+
* Gets the unique identifier of the agent that created this transaction.
|
|
2920
|
+
*
|
|
2480
2921
|
* @returns The id of the agent that created this transaction
|
|
2481
2922
|
*/
|
|
2482
2923
|
getAgentId(): string | undefined;
|
|
2483
2924
|
/**
|
|
2925
|
+
* Gets the name of the agent that created this transaction.
|
|
2926
|
+
*
|
|
2484
2927
|
* @returns The name of the agent that created this transaction
|
|
2485
2928
|
*/
|
|
2486
2929
|
getAgentName(): string | undefined;
|
|
2487
2930
|
/**
|
|
2931
|
+
* Gets the logo URL of the agent that created this transaction.
|
|
2932
|
+
*
|
|
2488
2933
|
* @returns The logo of the agent that created this transaction
|
|
2489
2934
|
*/
|
|
2490
2935
|
getAgentLogoUrl(): string | undefined;
|
|
2491
2936
|
/**
|
|
2937
|
+
* Gets the dark mode logo URL of the agent that created this transaction.
|
|
2938
|
+
*
|
|
2492
2939
|
* @returns The logo of the agent that created this transaction in dark mode
|
|
2493
2940
|
*/
|
|
2494
2941
|
getAgentLogoUrlDark(): string | undefined;
|
|
2495
2942
|
/**
|
|
2496
|
-
* Remote ids are used to avoid duplication.
|
|
2943
|
+
* Gets the remote IDs associated with this transaction. Remote ids are used to avoid duplication.
|
|
2497
2944
|
*
|
|
2498
|
-
* @returns The remote ids of the Transaction
|
|
2945
|
+
* @returns The remote ids of the Transaction
|
|
2499
2946
|
*/
|
|
2500
2947
|
getRemoteIds(): string[];
|
|
2501
2948
|
/**
|
|
2502
2949
|
* Add a remote id to the Transaction.
|
|
2503
2950
|
*
|
|
2504
|
-
* @param remoteId - The remote id to add
|
|
2951
|
+
* @param remoteId - The remote id to add
|
|
2505
2952
|
*
|
|
2506
|
-
* @returns This Transaction, for
|
|
2953
|
+
* @returns This Transaction, for chaining
|
|
2507
2954
|
*/
|
|
2508
2955
|
addRemoteId(remoteId: string): Transaction;
|
|
2509
2956
|
/**
|
|
2510
|
-
*
|
|
2957
|
+
* Checks if the transaction has been posted to the accounts.
|
|
2958
|
+
*
|
|
2959
|
+
* @returns True if transaction was already posted to the accounts. False if is still a Draft
|
|
2511
2960
|
*/
|
|
2512
2961
|
isPosted(): boolean | undefined;
|
|
2513
2962
|
/**
|
|
2514
|
-
*
|
|
2963
|
+
* Checks if the transaction is marked as checked.
|
|
2964
|
+
*
|
|
2965
|
+
* @returns True if transaction is checked
|
|
2515
2966
|
*/
|
|
2516
2967
|
isChecked(): boolean | undefined;
|
|
2517
2968
|
/**
|
|
2518
2969
|
* Set the check state of the Transaction.
|
|
2519
2970
|
*
|
|
2520
|
-
* @param checked - The check state
|
|
2971
|
+
* @param checked - The check state
|
|
2521
2972
|
*
|
|
2522
|
-
* @returns This Transaction, for
|
|
2973
|
+
* @returns This Transaction, for chaining
|
|
2523
2974
|
*/
|
|
2524
2975
|
setChecked(checked: boolean): Transaction;
|
|
2525
2976
|
/**
|
|
2526
|
-
*
|
|
2977
|
+
* Checks if the transaction is in the trash.
|
|
2978
|
+
*
|
|
2979
|
+
* @returns True if transaction is in trash
|
|
2527
2980
|
*/
|
|
2528
2981
|
isTrashed(): boolean | undefined;
|
|
2529
2982
|
/**
|
|
2983
|
+
* Checks if the transaction is locked by the book's lock or closing date.
|
|
2984
|
+
*
|
|
2530
2985
|
* @returns True if a transaction is locked by the book lock/closing date
|
|
2531
2986
|
*/
|
|
2532
2987
|
isLocked(): boolean;
|
|
2533
2988
|
/**
|
|
2534
|
-
*
|
|
2989
|
+
* Gets all hashtags used in the transaction.
|
|
2990
|
+
*
|
|
2991
|
+
* @returns All #hashtags used on the transaction
|
|
2535
2992
|
*/
|
|
2536
2993
|
getTags(): string[];
|
|
2537
2994
|
/**
|
|
2538
|
-
*
|
|
2995
|
+
* Gets all URLs associated with the transaction.
|
|
2996
|
+
*
|
|
2997
|
+
* @returns All urls of the transaction
|
|
2539
2998
|
*/
|
|
2540
2999
|
getUrls(): string[];
|
|
2541
3000
|
/**
|
|
2542
3001
|
* Sets the Transaction urls. Url starts with https://
|
|
2543
3002
|
*
|
|
2544
|
-
* @param urls - The urls array
|
|
3003
|
+
* @param urls - The urls array
|
|
2545
3004
|
*
|
|
2546
|
-
* @returns This Transaction, for
|
|
3005
|
+
* @returns This Transaction, for chaining
|
|
2547
3006
|
*/
|
|
2548
3007
|
setUrls(urls: string[]): Transaction;
|
|
2549
3008
|
/**
|
|
2550
3009
|
* Add a url to the Transaction. Url starts with https://
|
|
2551
3010
|
*
|
|
2552
|
-
* @param url - The url to add
|
|
3011
|
+
* @param url - The url to add
|
|
2553
3012
|
*
|
|
2554
|
-
* @returns This Transaction, for
|
|
3013
|
+
* @returns This Transaction, for chaining
|
|
2555
3014
|
*/
|
|
2556
3015
|
addUrl(url: string): Transaction;
|
|
2557
3016
|
/**
|
|
2558
|
-
*
|
|
3017
|
+
* Gets all files attached to the transaction.
|
|
3018
|
+
*
|
|
3019
|
+
* @returns The files attached to the transaction
|
|
2559
3020
|
*/
|
|
2560
3021
|
getFiles(): File[];
|
|
2561
3022
|
/**
|
|
2562
|
-
*
|
|
2563
3023
|
* Adds a file attachment to the Transaction.
|
|
2564
3024
|
*
|
|
2565
3025
|
* Files MUST be previously created in the Book.
|
|
2566
3026
|
*
|
|
2567
3027
|
* @param file - The file to add
|
|
2568
3028
|
*
|
|
2569
|
-
* @returns This Transaction, for
|
|
3029
|
+
* @returns This Transaction, for chaining
|
|
2570
3030
|
*/
|
|
2571
3031
|
addFile(file: File): Transaction;
|
|
2572
3032
|
/**
|
|
2573
3033
|
* Check if the transaction has the specified tag.
|
|
3034
|
+
*
|
|
3035
|
+
* @param tag - The tag to check for
|
|
3036
|
+
*
|
|
3037
|
+
* @returns True if the transaction has the specified tag
|
|
2574
3038
|
*/
|
|
2575
3039
|
hasTag(tag: string): boolean;
|
|
2576
3040
|
/**
|
|
2577
3041
|
* Gets the custom properties stored in this Transaction.
|
|
3042
|
+
*
|
|
3043
|
+
* @returns Object with key/value pair properties
|
|
2578
3044
|
*/
|
|
2579
3045
|
getProperties(): {
|
|
2580
3046
|
[key: string]: string;
|
|
@@ -2584,7 +3050,7 @@ export declare class Transaction {
|
|
|
2584
3050
|
*
|
|
2585
3051
|
* @param properties - Object with key/value pair properties
|
|
2586
3052
|
*
|
|
2587
|
-
* @returns This Transaction, for
|
|
3053
|
+
* @returns This Transaction, for chaining
|
|
2588
3054
|
*/
|
|
2589
3055
|
setProperties(properties: {
|
|
2590
3056
|
[key: string]: string;
|
|
@@ -2593,10 +3059,14 @@ export declare class Transaction {
|
|
|
2593
3059
|
* Gets the property value for given keys. First property found will be retrieved
|
|
2594
3060
|
*
|
|
2595
3061
|
* @param keys - The property key
|
|
3062
|
+
*
|
|
3063
|
+
* @returns The property value or undefined if not found
|
|
2596
3064
|
*/
|
|
2597
3065
|
getProperty(...keys: string[]): string | undefined;
|
|
2598
3066
|
/**
|
|
2599
3067
|
* Gets the custom properties keys stored in this Transaction.
|
|
3068
|
+
*
|
|
3069
|
+
* @returns Array of property keys
|
|
2600
3070
|
*/
|
|
2601
3071
|
getPropertyKeys(): string[];
|
|
2602
3072
|
/**
|
|
@@ -2605,7 +3075,7 @@ export declare class Transaction {
|
|
|
2605
3075
|
* @param key - The property key
|
|
2606
3076
|
* @param value - The property value
|
|
2607
3077
|
*
|
|
2608
|
-
* @returns This Transaction, for
|
|
3078
|
+
* @returns This Transaction, for chaining
|
|
2609
3079
|
*/
|
|
2610
3080
|
setProperty(key: string, value: string | null): Transaction;
|
|
2611
3081
|
/**
|
|
@@ -2613,165 +3083,202 @@ export declare class Transaction {
|
|
|
2613
3083
|
*
|
|
2614
3084
|
* @param key - The property key
|
|
2615
3085
|
*
|
|
2616
|
-
* @returns This Transaction, for
|
|
3086
|
+
* @returns This Transaction, for chaining
|
|
2617
3087
|
*/
|
|
2618
3088
|
deleteProperty(key: string): Transaction;
|
|
2619
3089
|
/**
|
|
2620
|
-
*
|
|
3090
|
+
* Gets the credit account associated with this Transaction. Same as origin account
|
|
3091
|
+
*
|
|
3092
|
+
* @returns The credit (origin) account
|
|
2621
3093
|
*/
|
|
2622
3094
|
getCreditAccount(): Promise<Account | undefined>;
|
|
2623
3095
|
/**
|
|
2624
|
-
*
|
|
3096
|
+
* Gets the name of this Transaction's credit account.
|
|
3097
|
+
*
|
|
3098
|
+
* @returns The credit account name
|
|
2625
3099
|
*/
|
|
2626
3100
|
getCreditAccountName(): Promise<string | undefined>;
|
|
2627
3101
|
/**
|
|
3102
|
+
* Sets the credit/origin [[Account]] of this Transaction. Same as from()
|
|
2628
3103
|
*
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2631
|
-
* @param account - Account id, name or object.
|
|
3104
|
+
* @param account - The Account object
|
|
2632
3105
|
*
|
|
2633
|
-
* @returns This Transaction, for
|
|
3106
|
+
* @returns This Transaction, for chaining
|
|
2634
3107
|
*/
|
|
2635
3108
|
setCreditAccount(account: Account | bkper.Account): Transaction;
|
|
2636
3109
|
/**
|
|
3110
|
+
* Sets the credit/origin [[Account]] of this Transaction. Same as setCreditAccount()
|
|
2637
3111
|
*
|
|
2638
|
-
*
|
|
3112
|
+
* @param account - The Account object
|
|
2639
3113
|
*
|
|
2640
|
-
* @
|
|
2641
|
-
*
|
|
2642
|
-
* @returns This Transaction, for chainning.
|
|
3114
|
+
* @returns This Transaction, for chaining
|
|
2643
3115
|
*/
|
|
2644
3116
|
from(account: Account | bkper.Account): Transaction;
|
|
2645
3117
|
/**
|
|
2646
|
-
*
|
|
3118
|
+
* Gets the debit account associated with this Transaction. Same as destination account
|
|
2647
3119
|
*
|
|
3120
|
+
* @returns The debit (destination) account
|
|
2648
3121
|
*/
|
|
2649
3122
|
getDebitAccount(): Promise<Account | undefined>;
|
|
2650
3123
|
/**
|
|
2651
|
-
*
|
|
3124
|
+
* Gets the name of this Transaction's debit account.
|
|
3125
|
+
*
|
|
3126
|
+
* @returns The debit account name
|
|
2652
3127
|
*/
|
|
2653
3128
|
getDebitAccountName(): Promise<string | undefined>;
|
|
2654
3129
|
/**
|
|
3130
|
+
* Sets the debit/destination [[Account]] of this Transaction. Same as to()
|
|
2655
3131
|
*
|
|
2656
|
-
*
|
|
2657
|
-
*
|
|
2658
|
-
* @param account - Account id, name or object.
|
|
3132
|
+
* @param account - The Account object
|
|
2659
3133
|
*
|
|
2660
|
-
* @returns This Transaction, for
|
|
3134
|
+
* @returns This Transaction, for chaining
|
|
2661
3135
|
*/
|
|
2662
3136
|
setDebitAccount(account: Account | bkper.Account): Transaction;
|
|
2663
3137
|
/**
|
|
3138
|
+
* Sets the debit/destination [[Account]] of this Transaction. Same as setDebitAccount()
|
|
2664
3139
|
*
|
|
2665
|
-
*
|
|
3140
|
+
* @param account - The Account object
|
|
2666
3141
|
*
|
|
2667
|
-
* @
|
|
2668
|
-
*
|
|
2669
|
-
* @returns This Transaction, for chainning.
|
|
3142
|
+
* @returns This Transaction, for chaining
|
|
2670
3143
|
*/
|
|
2671
3144
|
to(account: Account | bkper.Account): Transaction;
|
|
2672
3145
|
/**
|
|
2673
|
-
*
|
|
3146
|
+
* Gets the amount of this Transaction.
|
|
3147
|
+
*
|
|
3148
|
+
* @returns The amount of this Transaction
|
|
2674
3149
|
*/
|
|
2675
3150
|
getAmount(): Amount | undefined;
|
|
2676
3151
|
/**
|
|
2677
|
-
*
|
|
3152
|
+
* Gets the formatted amount of this Transaction according to the Book format.
|
|
3153
|
+
*
|
|
3154
|
+
* @returns The amount of this Transaction, formatted according to the Book format
|
|
2678
3155
|
*/
|
|
2679
3156
|
getAmountFormatted(): string | undefined;
|
|
2680
3157
|
/**
|
|
3158
|
+
* Sets the amount of this Transaction.
|
|
2681
3159
|
*
|
|
2682
|
-
*
|
|
3160
|
+
* @param amount - The amount to set
|
|
2683
3161
|
*
|
|
2684
|
-
* @returns This Transaction, for
|
|
3162
|
+
* @returns This Transaction, for chaining
|
|
2685
3163
|
*/
|
|
2686
3164
|
setAmount(amount: Amount | number | string): Transaction;
|
|
2687
3165
|
/**
|
|
2688
|
-
* Get the absolute amount of this
|
|
3166
|
+
* Get the absolute amount of this Transaction if the given account is at the credit side.
|
|
2689
3167
|
*
|
|
2690
|
-
* @param account - The account object, id or name
|
|
3168
|
+
* @param account - The account object, id or name
|
|
3169
|
+
*
|
|
3170
|
+
* @returns The credit amount or undefined
|
|
2691
3171
|
*/
|
|
2692
3172
|
getCreditAmount(account: Account | string): Promise<Amount | undefined>;
|
|
2693
3173
|
/**
|
|
2694
|
-
* Gets the absolute amount of this
|
|
3174
|
+
* Gets the absolute amount of this Transaction if the given account is at the debit side.
|
|
3175
|
+
*
|
|
3176
|
+
* @param account - The account object, id or name
|
|
2695
3177
|
*
|
|
2696
|
-
* @
|
|
3178
|
+
* @returns The debit amount or undefined
|
|
2697
3179
|
*/
|
|
2698
3180
|
getDebitAmount(account: Account | string): Promise<Amount | undefined>;
|
|
2699
3181
|
/**
|
|
2700
3182
|
* Gets the [[Account]] at the other side of the transaction given the one in one side.
|
|
2701
3183
|
*
|
|
2702
|
-
* @param account - The account object, id or name
|
|
3184
|
+
* @param account - The account object, id or name
|
|
3185
|
+
*
|
|
3186
|
+
* @returns The account at the other side of the transaction
|
|
2703
3187
|
*/
|
|
2704
3188
|
getOtherAccount(account: Account | string): Promise<Account | undefined>;
|
|
2705
3189
|
/**
|
|
3190
|
+
* The Account name at the other side of this Transaction given the one in one side.
|
|
2706
3191
|
*
|
|
2707
|
-
*
|
|
3192
|
+
* @param account - The Account object, id or name
|
|
2708
3193
|
*
|
|
2709
|
-
* @
|
|
3194
|
+
* @returns The name of the Account at the other side
|
|
2710
3195
|
*/
|
|
2711
3196
|
getOtherAccountName(account: string | Account): Promise<string | undefined>;
|
|
2712
3197
|
/**
|
|
3198
|
+
* Tell if the given account is credit on this Transaction
|
|
2713
3199
|
*
|
|
2714
|
-
*
|
|
3200
|
+
* @param account - The Account object
|
|
2715
3201
|
*
|
|
2716
|
-
* @
|
|
3202
|
+
* @returns True if the account is the credit account
|
|
2717
3203
|
*/
|
|
2718
3204
|
isCredit(account?: Account): Promise<boolean>;
|
|
2719
3205
|
/**
|
|
3206
|
+
* Tell if the given account is debit on the Transaction
|
|
2720
3207
|
*
|
|
2721
|
-
*
|
|
3208
|
+
* @param account - The [[Account]] object
|
|
2722
3209
|
*
|
|
2723
|
-
* @
|
|
3210
|
+
* @returns True if the Account is the debit account
|
|
2724
3211
|
*/
|
|
2725
3212
|
isDebit(account?: Account): Promise<boolean>;
|
|
2726
3213
|
|
|
2727
3214
|
/**
|
|
2728
|
-
*
|
|
3215
|
+
* Gets the description of this Transaction.
|
|
3216
|
+
*
|
|
3217
|
+
* @returns The description of this Transaction
|
|
2729
3218
|
*/
|
|
2730
3219
|
getDescription(): string;
|
|
2731
3220
|
/**
|
|
2732
|
-
*
|
|
2733
3221
|
* Sets the description of the Transaction.
|
|
2734
3222
|
*
|
|
2735
|
-
* @
|
|
3223
|
+
* @param description - The description to set
|
|
3224
|
+
*
|
|
3225
|
+
* @returns This Transaction, for chaining
|
|
2736
3226
|
*/
|
|
2737
3227
|
setDescription(description: string): Transaction;
|
|
2738
3228
|
/**
|
|
2739
|
-
*
|
|
3229
|
+
* Gets the transaction date in ISO format.
|
|
3230
|
+
*
|
|
3231
|
+
* @returns The Transaction date, in ISO format yyyy-MM-dd
|
|
2740
3232
|
*/
|
|
2741
3233
|
getDate(): string | undefined;
|
|
2742
3234
|
/**
|
|
2743
|
-
*
|
|
2744
3235
|
* Sets the date of the Transaction.
|
|
2745
3236
|
*
|
|
2746
|
-
* @
|
|
3237
|
+
* @param date - The date to set as string or Date object
|
|
3238
|
+
*
|
|
3239
|
+
* @returns This Transaction, for chaining
|
|
2747
3240
|
*/
|
|
2748
3241
|
setDate(date: string | Date): Transaction;
|
|
2749
3242
|
/**
|
|
2750
|
-
*
|
|
3243
|
+
* Gets the transaction date as a Date object in the book's timezone.
|
|
3244
|
+
*
|
|
3245
|
+
* @returns The Transaction Date object, on the time zone of the [[Book]]
|
|
2751
3246
|
*/
|
|
2752
3247
|
getDateObject(): Date;
|
|
2753
3248
|
/**
|
|
2754
|
-
*
|
|
3249
|
+
* Gets the transaction date as a numeric value.
|
|
3250
|
+
*
|
|
3251
|
+
* @returns The Transaction date number, in format YYYYMMDD
|
|
2755
3252
|
*/
|
|
2756
3253
|
getDateValue(): number | undefined;
|
|
2757
3254
|
/**
|
|
2758
|
-
*
|
|
3255
|
+
* Gets the transaction date formatted according to the book's date pattern.
|
|
3256
|
+
*
|
|
3257
|
+
* @returns The Transaction date, formatted on the date pattern of the [[Book]]
|
|
2759
3258
|
*/
|
|
2760
3259
|
getDateFormatted(): string | undefined;
|
|
2761
3260
|
/**
|
|
2762
|
-
*
|
|
3261
|
+
* Gets the date when the transaction was created.
|
|
3262
|
+
*
|
|
3263
|
+
* @returns The date the transaction was created
|
|
2763
3264
|
*/
|
|
2764
3265
|
getCreatedAt(): Date;
|
|
2765
3266
|
/**
|
|
2766
|
-
*
|
|
3267
|
+
* Gets the formatted creation date of the transaction.
|
|
3268
|
+
*
|
|
3269
|
+
* @returns The date the transaction was created, formatted according to the date pattern of the [[Book]]
|
|
2767
3270
|
*/
|
|
2768
3271
|
getCreatedAtFormatted(): string;
|
|
2769
3272
|
/**
|
|
2770
|
-
*
|
|
3273
|
+
* Gets the date when the transaction was last updated.
|
|
3274
|
+
*
|
|
3275
|
+
* @returns The date the transaction was last updated
|
|
2771
3276
|
*/
|
|
2772
3277
|
getUpdatedAt(): Date;
|
|
2773
3278
|
/**
|
|
2774
|
-
*
|
|
3279
|
+
* Gets the formatted last update date of the transaction.
|
|
3280
|
+
*
|
|
3281
|
+
* @returns The date the transaction was last updated, formatted according to the date pattern of the [[Book]]
|
|
2775
3282
|
*/
|
|
2776
3283
|
getUpdatedAtFormatted(): string;
|
|
2777
3284
|
|
|
@@ -2783,35 +3290,51 @@ export declare class Transaction {
|
|
|
2783
3290
|
*
|
|
2784
3291
|
* Only comes with the last posted transaction of the day.
|
|
2785
3292
|
*
|
|
2786
|
-
* @param raw - True to get the raw balance, no matter the credit nature of the [[Account]]
|
|
3293
|
+
* @param raw - True to get the raw balance, no matter the credit nature of the [[Account]]
|
|
3294
|
+
*
|
|
3295
|
+
* @returns The account balance at the transaction date
|
|
2787
3296
|
*/
|
|
2788
3297
|
getAccountBalance(raw?: boolean): Promise<Amount | undefined>;
|
|
2789
3298
|
/**
|
|
2790
3299
|
* Perform create new draft transaction.
|
|
3300
|
+
*
|
|
3301
|
+
* @returns This Transaction, for chaining
|
|
2791
3302
|
*/
|
|
2792
3303
|
create(): Promise<Transaction>;
|
|
2793
3304
|
/**
|
|
2794
|
-
*
|
|
3305
|
+
* Update transaction, applying pending changes.
|
|
3306
|
+
*
|
|
3307
|
+
* @returns This Transaction, for chaining
|
|
2795
3308
|
*/
|
|
2796
3309
|
update(): Promise<Transaction>;
|
|
2797
3310
|
/**
|
|
2798
3311
|
* Perform check transaction.
|
|
3312
|
+
*
|
|
3313
|
+
* @returns This Transaction, for chaining
|
|
2799
3314
|
*/
|
|
2800
3315
|
check(): Promise<Transaction>;
|
|
2801
3316
|
/**
|
|
2802
3317
|
* Perform uncheck transaction.
|
|
3318
|
+
*
|
|
3319
|
+
* @returns This Transaction, for chaining
|
|
2803
3320
|
*/
|
|
2804
3321
|
uncheck(): Promise<Transaction>;
|
|
2805
3322
|
/**
|
|
2806
3323
|
* Perform post transaction, changing credit and debit [[Account]] balances.
|
|
3324
|
+
*
|
|
3325
|
+
* @returns This Transaction, for chaining
|
|
2807
3326
|
*/
|
|
2808
3327
|
post(): Promise<Transaction>;
|
|
2809
3328
|
/**
|
|
2810
3329
|
* Trash the transaction.
|
|
3330
|
+
*
|
|
3331
|
+
* @returns This Transaction, for chaining
|
|
2811
3332
|
*/
|
|
2812
3333
|
trash(): Promise<Transaction>;
|
|
2813
3334
|
/**
|
|
2814
3335
|
* Untrash the transaction.
|
|
3336
|
+
*
|
|
3337
|
+
* @returns This Transaction, for chaining
|
|
2815
3338
|
*/
|
|
2816
3339
|
untrash(): Promise<Transaction>;
|
|
2817
3340
|
/** @deprecated */
|
|
@@ -2822,40 +3345,51 @@ export declare class Transaction {
|
|
|
2822
3345
|
|
|
2823
3346
|
/**
|
|
2824
3347
|
* A list associated with a transaction query.
|
|
3348
|
+
*
|
|
3349
|
+
* @public
|
|
2825
3350
|
*/
|
|
2826
3351
|
export declare class TransactionList {
|
|
2827
3352
|
private payload;
|
|
2828
3353
|
|
|
2829
3354
|
constructor(book: Book, payload: bkper.TransactionList);
|
|
2830
3355
|
/**
|
|
2831
|
-
*
|
|
3356
|
+
* Gets the cursor associated with the query for pagination.
|
|
3357
|
+
*
|
|
3358
|
+
* @returns The cursor associated with the query for pagination
|
|
2832
3359
|
*/
|
|
2833
3360
|
getCursor(): string | undefined;
|
|
2834
3361
|
/**
|
|
2835
3362
|
* Retrieves the account associated with the query, when filtering by account.
|
|
3363
|
+
*
|
|
3364
|
+
* @returns The account associated with the query, or undefined if not set
|
|
2836
3365
|
*/
|
|
2837
3366
|
getAccount(): Promise<Account | undefined>;
|
|
2838
3367
|
/**
|
|
2839
|
-
*
|
|
3368
|
+
* Gets the first Transaction in the list.
|
|
3369
|
+
*
|
|
3370
|
+
* @returns The first Transaction in the list
|
|
2840
3371
|
*/
|
|
2841
3372
|
getFirst(): Transaction | undefined;
|
|
2842
3373
|
/**
|
|
3374
|
+
* Gets the total number of transactions in the list.
|
|
2843
3375
|
*
|
|
2844
|
-
*
|
|
2845
|
-
*
|
|
2846
|
-
* @returns The total number of transactions.
|
|
3376
|
+
* @returns The total number of transactions
|
|
2847
3377
|
*/
|
|
2848
3378
|
size(): number;
|
|
2849
3379
|
/**
|
|
2850
|
-
*
|
|
3380
|
+
* Gets the transactions in the list.
|
|
2851
3381
|
*
|
|
2852
|
-
* @returns An array of Transaction objects
|
|
3382
|
+
* @returns An array of Transaction objects
|
|
2853
3383
|
*/
|
|
2854
3384
|
getItems(): Transaction[];
|
|
2855
3385
|
}
|
|
2856
3386
|
|
|
2857
3387
|
/**
|
|
2858
|
-
* This class defines a User.
|
|
3388
|
+
* This class defines a User on the Bkper platform.
|
|
3389
|
+
*
|
|
3390
|
+
* Users can own and collaborate on [[Books]], manage [[Collections]], and connect to external services through [[Connections]].
|
|
3391
|
+
*
|
|
3392
|
+
* Each User has a unique identity, subscription plan details, and access permissions across the platform.
|
|
2859
3393
|
*
|
|
2860
3394
|
* @public
|
|
2861
3395
|
*/
|
|
@@ -2863,6 +3397,8 @@ export declare class User {
|
|
|
2863
3397
|
payload: bkper.User;
|
|
2864
3398
|
constructor(payload?: bkper.User);
|
|
2865
3399
|
/**
|
|
3400
|
+
* Gets an immutable copy of the JSON payload for this User.
|
|
3401
|
+
*
|
|
2866
3402
|
* @returns An immutable copy of the json payload
|
|
2867
3403
|
*/
|
|
2868
3404
|
json(): bkper.User;
|