bkper-js 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -19,6 +19,7 @@
19
19
  export declare class Account {
20
20
 
21
21
 
22
+ constructor(book: Book, json?: bkper.Account);
22
23
  /**
23
24
  *
24
25
  * @returns The wrapped plain json object
@@ -27,11 +28,11 @@ export declare class Account {
27
28
  /**
28
29
  * Gets the account internal id.
29
30
  */
30
- getId(): string;
31
+ getId(): string | undefined;
31
32
  /**
32
33
  * Gets the account name.
33
34
  */
34
- getName(): string;
35
+ getName(): string | undefined;
35
36
  /**
36
37
  *
37
38
  * Sets the name of the Account.
@@ -75,7 +76,7 @@ export declare class Account {
75
76
  *
76
77
  * @param keys - The property key
77
78
  */
78
- getProperty(...keys: string[]): string;
79
+ getProperty(...keys: string[]): string | undefined;
79
80
  /**
80
81
  * Sets a custom property in the Account.
81
82
  *
@@ -84,7 +85,7 @@ export declare class Account {
84
85
  *
85
86
  * @returns This Account, for chainning.
86
87
  */
87
- setProperty(key: string, value: string): Account;
88
+ setProperty(key: string, value: string | null): Account;
88
89
  /**
89
90
  * Delete a custom property
90
91
  *
@@ -108,7 +109,7 @@ export declare class Account {
108
109
  /**
109
110
  * Tell if this account is archived.
110
111
  */
111
- isArchived(): boolean;
112
+ isArchived(): boolean | undefined;
112
113
  /**
113
114
  * Set account archived/unarchived.
114
115
  *
@@ -120,7 +121,7 @@ export declare class Account {
120
121
  *
121
122
  * Accounts with transaction posted, even with zero balance, can only be archived.
122
123
  */
123
- hasTransactionPosted(): boolean;
124
+ hasTransactionPosted(): boolean | undefined;
124
125
  /**
125
126
  *
126
127
  * Tell if the account is permanent.
@@ -133,7 +134,7 @@ export declare class Account {
133
134
  *
134
135
  * @returns True if its a permanent Account
135
136
  */
136
- isPermanent(): boolean;
137
+ isPermanent(): boolean | undefined;
137
138
  /**
138
139
  * Tell if the account has a Credit nature or Debit otherwise
139
140
  *
@@ -154,7 +155,7 @@ export declare class Account {
154
155
  *
155
156
  * 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.
156
157
  */
157
- isCredit(): boolean;
158
+ isCredit(): boolean | undefined;
158
159
  /**
159
160
  * Get the [[Groups]] of this account.
160
161
  */
@@ -314,7 +315,7 @@ export declare class Amount {
314
315
  */
315
316
  export declare class App {
316
317
 
317
- constructor(json: bkper.App);
318
+ constructor(json?: bkper.App);
318
319
  /**
319
320
  *
320
321
  * Sets the webhook url for development.
@@ -326,31 +327,31 @@ export declare class App {
326
327
  *
327
328
  * @returns The App universal identifier
328
329
  */
329
- getId(): string;
330
+ getId(): string | undefined;
330
331
  /**
331
332
  * Sets the whitelabeled user emails
332
333
  *
333
334
  * @returns This App for chaining
334
335
  */
335
- setUserEmails(emails: string): App;
336
+ setUserEmails(emails?: string): App;
336
337
  /**
337
338
  * Sets the developer email
338
339
  *
339
340
  * @returns This App for chaining
340
341
  */
341
- setDeveloperEmail(email: string): App;
342
+ setDeveloperEmail(email?: string): App;
342
343
  /**
343
344
  * Sets the client secret
344
345
  *
345
346
  * @returns This App for chaining
346
347
  */
347
- setClientSecret(clientSecret: string): App;
348
+ setClientSecret(clientSecret?: string): App;
348
349
  /**
349
350
  * Sets the readme text
350
351
  *
351
352
  * @returns This App for chaining
352
353
  */
353
- setReadme(readme: string): App;
354
+ setReadme(readme?: string): App;
354
355
  /**
355
356
  * Performs the app creation, applying pending changes.
356
357
  *
@@ -368,7 +369,7 @@ export declare class App {
368
369
  }
369
370
 
370
371
  /**
371
- * This is the main Entry Point of the [bkper-node](https://www.npmjs.com/package/bkper) library.
372
+ * This is the main Entry Point of the [bkper-js](https://www.npmjs.com/package/bkper-js) library.
372
373
  *
373
374
  * @public
374
375
  */
@@ -424,7 +425,7 @@ export declare class Book {
424
425
 
425
426
 
426
427
 
427
- constructor(json: bkper.Book);
428
+ constructor(json?: bkper.Book);
428
429
  /**
429
430
  * @returns The wrapped plain json object
430
431
  */
@@ -436,7 +437,7 @@ export declare class Book {
436
437
  /**
437
438
  * @returns The name of this Book
438
439
  */
439
- getName(): string;
440
+ getName(): string | undefined;
440
441
  /**
441
442
  *
442
443
  * Sets the name of the Book.
@@ -447,11 +448,11 @@ export declare class Book {
447
448
  /**
448
449
  * @returns The number of fraction digits supported by this Book. Same as getDecimalPlaces
449
450
  */
450
- getFractionDigits(): number;
451
+ getFractionDigits(): number | undefined;
451
452
  /**
452
453
  * @returns The number of decimal places supported by this Book. Same as getFractionDigits
453
454
  */
454
- getDecimalPlaces(): number;
455
+ getDecimalPlaces(): number | undefined;
455
456
  /**
456
457
  *
457
458
  * Sets the number of fraction digits (decimal places) supported by this Book
@@ -482,7 +483,7 @@ export declare class Book {
482
483
  /**
483
484
  * @returns The transactions pagination page size
484
485
  */
485
- getPageSize(): number;
486
+ getPageSize(): number | undefined;
486
487
  /**
487
488
  * Sets the transactions pagination page size
488
489
  *
@@ -492,7 +493,7 @@ export declare class Book {
492
493
  /**
493
494
  * @returns The name of the owner of the Book
494
495
  */
495
- getOwnerName(): string;
496
+ getOwnerName(): string | undefined;
496
497
  /**
497
498
  * @returns The permission for the current user
498
499
  */
@@ -500,11 +501,11 @@ export declare class Book {
500
501
  /**
501
502
  * @returns The collection of this book
502
503
  */
503
- getCollection(): Collection;
504
+ getCollection(): Collection | undefined;
504
505
  /**
505
506
  * @returns The date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
506
507
  */
507
- getDatePattern(): string;
508
+ getDatePattern(): string | undefined;
508
509
  /**
509
510
  *
510
511
  * Sets the date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
@@ -515,7 +516,7 @@ export declare class Book {
515
516
  /**
516
517
  * @returns The lock date of the Book in ISO format yyyy-MM-dd
517
518
  */
518
- getLockDate(): string;
519
+ getLockDate(): string | undefined;
519
520
  /**
520
521
  *
521
522
  * Sets the lock date of the Book in ISO format yyyy-MM-dd.
@@ -526,7 +527,7 @@ export declare class Book {
526
527
  /**
527
528
  * @returns The closing date of the Book in ISO format yyyy-MM-dd
528
529
  */
529
- getClosingDate(): string;
530
+ getClosingDate(): string | undefined;
530
531
  /**
531
532
  *
532
533
  * Sets the closing date of the Book in ISO format yyyy-MM-dd.
@@ -548,7 +549,7 @@ export declare class Book {
548
549
  /**
549
550
  * @returns The time zone of the Book
550
551
  */
551
- getTimeZone(): string;
552
+ getTimeZone(): string | undefined;
552
553
  /**
553
554
  *
554
555
  * Sets the time zone of the Book
@@ -559,11 +560,11 @@ export declare class Book {
559
560
  /**
560
561
  * @returns The time zone offset of the book, in minutes
561
562
  */
562
- getTimeZoneOffset(): number;
563
+ getTimeZoneOffset(): number | undefined;
563
564
  /**
564
565
  * @returns The last update date of the book, in in milliseconds
565
566
  */
566
- getLastUpdateMs(): number;
567
+ getLastUpdateMs(): number | undefined;
567
568
  /**
568
569
  * Gets the custom properties stored in this Book
569
570
  */
@@ -575,7 +576,7 @@ export declare class Book {
575
576
  *
576
577
  * @param keys - The property key
577
578
  */
578
- getProperty(...keys: string[]): string;
579
+ getProperty(...keys: string[]): string | undefined;
579
580
  /**
580
581
  * Sets the custom properties of the Book
581
582
  *
@@ -594,7 +595,7 @@ export declare class Book {
594
595
  *
595
596
  * @returns This Book, for chainning.
596
597
  */
597
- setProperty(key: string, value: string): Book;
598
+ setProperty(key: string, value: string | null): Book;
598
599
  /**
599
600
  * Formats a date according to date pattern of the Book.
600
601
  *
@@ -621,7 +622,7 @@ export declare class Book {
621
622
  /**
622
623
  * Parse a value string according to [[DecimalSeparator]] and fraction digits of the Book.
623
624
  */
624
- parseValue(value: string): Amount;
625
+ parseValue(value: string): Amount | undefined;
625
626
  /**
626
627
  * Rounds a value according to the number of fraction digits of the Book
627
628
  *
@@ -672,8 +673,6 @@ export declare class Book {
672
673
  * @returns a collection of transactions that remained in a previous iterator when the continuation token was generated
673
674
  */
674
675
  continueTransactionIterator(query: string, continuationToken: string): TransactionIterator;
675
- configureTransactions_(transactions: Transaction[]): Transaction[];
676
-
677
676
  /**
678
677
  * Instantiate a new [[Transaction]]
679
678
  *
@@ -731,7 +730,7 @@ export declare class Book {
731
730
  *
732
731
  * @returns The matching Account object
733
732
  */
734
- getAccount(idOrName: string): Promise<Account>;
733
+ getAccount(idOrName?: string): Promise<Account | undefined>;
735
734
 
736
735
  removeGroupCache(group: Group): void;
737
736
  /**
@@ -741,7 +740,7 @@ export declare class Book {
741
740
  *
742
741
  * @returns The matching Group object
743
742
  */
744
- getGroup(idOrName: string): Promise<Group>;
743
+ getGroup(idOrName?: string): Promise<Group | undefined>;
745
744
  /**
746
745
  * Gets all [[Groups]] of this Book
747
746
  */
@@ -776,7 +775,7 @@ export declare class Book {
776
775
  /**
777
776
  * Retrieve a transaction by id
778
777
  */
779
- getTransaction(id: string): Promise<Transaction>;
778
+ getTransaction(id: string): Promise<Transaction | undefined>;
780
779
  /**
781
780
  * Instantiate a new [[BkperFile]]
782
781
  *
@@ -811,11 +810,11 @@ export declare class Collection {
811
810
  /**
812
811
  * @returns The id of this Collection
813
812
  */
814
- getId(): string;
813
+ getId(): string | undefined;
815
814
  /**
816
815
  * @returns The name of this Collection
817
816
  */
818
- getName(): string;
817
+ getName(): string | undefined;
819
818
  /**
820
819
  * @returns All Books of this collection.
821
820
  */
@@ -875,13 +874,13 @@ export declare class Connection {
875
874
  *
876
875
  * @returns The Connection's id
877
876
  */
878
- getId(): string;
877
+ getId(): string | undefined;
879
878
  /**
880
879
  * Gets the agentId of the Connection.
881
880
  *
882
881
  * @returns The Connection's agentId
883
882
  */
884
- getAgentId(): string;
883
+ getAgentId(): string | undefined;
885
884
  /**
886
885
  * Sets the Connection agentId.
887
886
  *
@@ -895,13 +894,13 @@ export declare class Connection {
895
894
  *
896
895
  * @returns The Connection name
897
896
  */
898
- getName(): string;
897
+ getName(): string | undefined;
899
898
  /**
900
899
  * Gets the email of the owner of the Connection.
901
900
  *
902
901
  * @returns The Connection owner's email
903
902
  */
904
- getEmail(): string;
903
+ getEmail(): string | undefined;
905
904
  /**
906
905
  * Sets the name of the Connection.
907
906
  *
@@ -923,13 +922,13 @@ export declare class Connection {
923
922
  *
924
923
  * @returns The Connection's universal unique identifier name
925
924
  */
926
- getUUID(): string;
925
+ getUUID(): string | undefined;
927
926
  /**
928
927
  * Gets the type of the Connection.
929
928
  *
930
929
  * @returns The Connection type
931
930
  */
932
- getType(): "APP" | "BANK";
931
+ getType(): "APP" | "BANK" | undefined;
933
932
  /**
934
933
  * Sets the Connection type.
935
934
  *
@@ -963,7 +962,7 @@ export declare class Connection {
963
962
  *
964
963
  * @returns The retrieved property value
965
964
  */
966
- getProperty(...keys: string[]): string;
965
+ getProperty(...keys: string[]): string | undefined;
967
966
  /**
968
967
  * Sets a custom property in the Connection.
969
968
  *
@@ -972,7 +971,7 @@ export declare class Connection {
972
971
  *
973
972
  * @returns The Connection, for chaining
974
973
  */
975
- setProperty(key: string, value: string): Connection;
974
+ setProperty(key: string, value: string | null): Connection;
976
975
  /**
977
976
  * Deletes a custom property stored in the Connection.
978
977
  *
@@ -1032,14 +1031,20 @@ export declare enum DecimalSeparator {
1032
1031
  export declare class File {
1033
1032
 
1034
1033
 
1034
+ constructor(book: Book, json?: bkper.File);
1035
+ /**
1036
+ *
1037
+ * @returns The wrapped plain json object
1038
+ */
1039
+ json(): bkper.Transaction;
1035
1040
  /**
1036
1041
  * Gets the File id
1037
1042
  */
1038
- getId(): string;
1043
+ getId(): string | undefined;
1039
1044
  /**
1040
1045
  * Gets the File name
1041
1046
  */
1042
- getName(): string;
1047
+ getName(): string | undefined;
1043
1048
  /**
1044
1049
  *
1045
1050
  * Sets the name of the File.
@@ -1050,7 +1055,7 @@ export declare class File {
1050
1055
  /**
1051
1056
  * Gets the File content type
1052
1057
  */
1053
- getContentType(): string;
1058
+ getContentType(): string | undefined;
1054
1059
  /**
1055
1060
  *
1056
1061
  * Sets the File content type.
@@ -1061,7 +1066,7 @@ export declare class File {
1061
1066
  /**
1062
1067
  * Gets the file content Base64 encoded
1063
1068
  */
1064
- getContent(): Promise<string>;
1069
+ getContent(): Promise<string | undefined>;
1065
1070
  /**
1066
1071
  *
1067
1072
  * Sets the File content Base64 encoded.
@@ -1072,11 +1077,11 @@ export declare class File {
1072
1077
  /**
1073
1078
  * Gets the file serving url for accessing via browser
1074
1079
  */
1075
- getUrl(): string;
1080
+ getUrl(): string | undefined;
1076
1081
  /**
1077
1082
  * Gets the file size in bytes
1078
1083
  */
1079
- getSize(): number;
1084
+ getSize(): number | undefined;
1080
1085
  /**
1081
1086
  * Perform create new File.
1082
1087
  */
@@ -1094,8 +1099,9 @@ export declare class File {
1094
1099
  */
1095
1100
  export declare class Group {
1096
1101
 
1097
- accounts: Set<Account>;
1098
1102
 
1103
+
1104
+ constructor(book: Book, json?: bkper.Group);
1099
1105
  /**
1100
1106
  *
1101
1107
  * @returns The wrapped plain json object
@@ -1104,21 +1110,21 @@ export declare class Group {
1104
1110
  /**
1105
1111
  * @returns The id of this Group
1106
1112
  */
1107
- getId(): string;
1113
+ getId(): string | undefined;
1108
1114
  /**
1109
1115
  * @returns The parent Group
1110
1116
  */
1111
- getParent(): Promise<Group>;
1117
+ getParent(): Promise<Group | undefined>;
1112
1118
  /**
1113
1119
  * Sets the parent Group.
1114
1120
  *
1115
1121
  * @returns This Group, for chainning.
1116
1122
  */
1117
- setParent(group: Group | null): Group;
1123
+ setParent(group: Group | null | undefined): Group;
1118
1124
  /**
1119
1125
  * @returns The name of this Group
1120
1126
  */
1121
- getName(): string;
1127
+ getName(): string | undefined;
1122
1128
  /**
1123
1129
  * Sets the name of the Group.
1124
1130
  *
@@ -1136,7 +1142,7 @@ export declare class Group {
1136
1142
  /**
1137
1143
  * @returns True if this group has any account in it
1138
1144
  */
1139
- hasAccounts(): boolean;
1145
+ hasAccounts(): boolean | undefined;
1140
1146
  /**
1141
1147
  * @returns The type for of the accounts of this group. Null if mixed
1142
1148
  */
@@ -1162,14 +1168,14 @@ export declare class Group {
1162
1168
  *
1163
1169
  * @param keys - The property key
1164
1170
  */
1165
- getProperty(...keys: string[]): string;
1171
+ getProperty(...keys: string[]): string | undefined;
1166
1172
  /**
1167
1173
  * Sets a custom property in the Group.
1168
1174
  *
1169
1175
  * @param key - The property key
1170
1176
  * @param value - The property value
1171
1177
  */
1172
- setProperty(key: string, value: string): Group;
1178
+ setProperty(key: string, value: string | null): Group;
1173
1179
  /**
1174
1180
  * Delete a custom property
1175
1181
  *
@@ -1181,7 +1187,7 @@ export declare class Group {
1181
1187
  /**
1182
1188
  * Tell if the Group is hidden on main transactions menu
1183
1189
  */
1184
- isHidden(): boolean;
1190
+ isHidden(): boolean | undefined;
1185
1191
  /**
1186
1192
  * Hide/Show group on main menu.
1187
1193
  */
@@ -1207,7 +1213,7 @@ export declare class Group {
1207
1213
  */
1208
1214
  export declare class Integration {
1209
1215
 
1210
- constructor(json: bkper.Integration);
1216
+ constructor(json?: bkper.Integration);
1211
1217
  /**
1212
1218
  * Gets the wrapped plain json object of the Integration.
1213
1219
  *
@@ -1219,19 +1225,19 @@ export declare class Integration {
1219
1225
  *
1220
1226
  * @returns The Integration's Book id
1221
1227
  */
1222
- getBookId(): string;
1228
+ getBookId(): string | undefined;
1223
1229
  /**
1224
1230
  * Gets the id of the Integration.
1225
1231
  *
1226
1232
  * @returns This Integration's id
1227
1233
  */
1228
- getId(): string;
1234
+ getId(): string | undefined;
1229
1235
  /**
1230
1236
  * Gets the name of the Integration.
1231
1237
  *
1232
1238
  * @returns The Integration's name
1233
1239
  */
1234
- getName(): string;
1240
+ getName(): string | undefined;
1235
1241
  /**
1236
1242
  * Gets the custom properties stored in the Integration.
1237
1243
  *
@@ -1257,7 +1263,7 @@ export declare class Integration {
1257
1263
  *
1258
1264
  * @returns The retrieved property value
1259
1265
  */
1260
- getProperty(...keys: string[]): string;
1266
+ getProperty(...keys: string[]): string | undefined;
1261
1267
  /**
1262
1268
  * Sets a custom property in the Integration.
1263
1269
  *
@@ -1266,7 +1272,7 @@ export declare class Integration {
1266
1272
  *
1267
1273
  * @returns The Integration, for chaining
1268
1274
  */
1269
- setProperty(key: string, value: string): Integration;
1275
+ setProperty(key: string, value: string | null): Integration;
1270
1276
  /**
1271
1277
  * Deletes a custom property stored in the Integration.
1272
1278
  *
@@ -1382,6 +1388,7 @@ export declare enum Permission {
1382
1388
  export declare class Transaction {
1383
1389
 
1384
1390
 
1391
+ constructor(book: Book, json?: bkper.Transaction);
1385
1392
  /**
1386
1393
  *
1387
1394
  * @returns The wrapped plain json object
@@ -1390,11 +1397,11 @@ export declare class Transaction {
1390
1397
  /**
1391
1398
  * @returns The id of the Transaction.
1392
1399
  */
1393
- getId(): string;
1400
+ getId(): string | undefined;
1394
1401
  /**
1395
1402
  * @returns The id of the agent that created this transaction
1396
1403
  */
1397
- getAgentId(): string;
1404
+ getAgentId(): string | undefined;
1398
1405
  /**
1399
1406
  * Remote ids are used to avoid duplication.
1400
1407
  *
@@ -1412,11 +1419,11 @@ export declare class Transaction {
1412
1419
  /**
1413
1420
  * @returns True if transaction was already posted to the accounts. False if is still a Draft.
1414
1421
  */
1415
- isPosted(): boolean;
1422
+ isPosted(): boolean | undefined;
1416
1423
  /**
1417
1424
  * @returns True if transaction is checked.
1418
1425
  */
1419
- isChecked(): boolean;
1426
+ isChecked(): boolean | undefined;
1420
1427
  /**
1421
1428
  * Set the check state of the Transaction.
1422
1429
  *
@@ -1428,7 +1435,7 @@ export declare class Transaction {
1428
1435
  /**
1429
1436
  * @returns True if transaction is in trash.
1430
1437
  */
1431
- isTrashed(): boolean;
1438
+ isTrashed(): boolean | undefined;
1432
1439
  /**
1433
1440
  * @returns All #hashtags used on the transaction.
1434
1441
  */
@@ -1493,7 +1500,7 @@ export declare class Transaction {
1493
1500
  *
1494
1501
  * @param keys - The property key
1495
1502
  */
1496
- getProperty(...keys: string[]): string;
1503
+ getProperty(...keys: string[]): string | undefined;
1497
1504
  /**
1498
1505
  * Gets the custom properties keys stored in this Transaction.
1499
1506
  */
@@ -1506,7 +1513,7 @@ export declare class Transaction {
1506
1513
  *
1507
1514
  * @returns This Transaction, for chainning.
1508
1515
  */
1509
- setProperty(key: string, value: string): Transaction;
1516
+ setProperty(key: string, value: string | null): Transaction;
1510
1517
  /**
1511
1518
  * Delete a custom property
1512
1519
  *
@@ -1518,11 +1525,11 @@ export declare class Transaction {
1518
1525
  /**
1519
1526
  * @returns The credit account. The same as origin account.
1520
1527
  */
1521
- getCreditAccount(): Promise<Account>;
1528
+ getCreditAccount(): Promise<Account | undefined>;
1522
1529
  /**
1523
1530
  * @returns The credit account name.
1524
1531
  */
1525
- getCreditAccountName(): Promise<string>;
1532
+ getCreditAccountName(): Promise<string | undefined>;
1526
1533
  /**
1527
1534
  *
1528
1535
  * Sets the credit/origin Account of the Transaction. Same as from().
@@ -1545,11 +1552,11 @@ export declare class Transaction {
1545
1552
  * @returns The debit account. The same as destination account.
1546
1553
  *
1547
1554
  */
1548
- getDebitAccount(): Promise<Account>;
1555
+ getDebitAccount(): Promise<Account | undefined>;
1549
1556
  /**
1550
1557
  * @returns The debit account name.
1551
1558
  */
1552
- getDebitAccountName(): Promise<string>;
1559
+ getDebitAccountName(): Promise<string | undefined>;
1553
1560
  /**
1554
1561
  *
1555
1562
  * Sets the debit/destination Account of the Transaction. Same as to().
@@ -1571,7 +1578,7 @@ export declare class Transaction {
1571
1578
  /**
1572
1579
  * @returns The amount of the transaction.
1573
1580
  */
1574
- getAmount(): Amount;
1581
+ getAmount(): Amount | undefined;
1575
1582
  /**
1576
1583
  *
1577
1584
  * Sets the amount of the Transaction.
@@ -1584,40 +1591,40 @@ export declare class Transaction {
1584
1591
  *
1585
1592
  * @param account - The account object, id or name.
1586
1593
  */
1587
- getCreditAmount(account: Account | string): Promise<Amount>;
1594
+ getCreditAmount(account: Account | string): Promise<Amount | undefined>;
1588
1595
  /**
1589
1596
  * Gets the absolute amount of this transaction if the given account is at the debit side, else null.
1590
1597
  *
1591
1598
  * @param account - The account object, id or name.
1592
1599
  */
1593
- getDebitAmount(account: Account | string): Promise<Amount>;
1600
+ getDebitAmount(account: Account | string): Promise<Amount | undefined>;
1594
1601
  /**
1595
1602
  * Gets the [[Account]] at the other side of the transaction given the one in one side.
1596
1603
  *
1597
1604
  * @param account - The account object, id or name.
1598
1605
  */
1599
- getOtherAccount(account: Account | string): Promise<Account>;
1606
+ getOtherAccount(account: Account | string): Promise<Account | undefined>;
1600
1607
  /**
1601
1608
  *
1602
1609
  * The account name at the other side of the transaction given the one in one side.
1603
1610
  *
1604
1611
  * @param account - The account object, id or name.
1605
1612
  */
1606
- getOtherAccountName(account: string | Account): Promise<string>;
1613
+ getOtherAccountName(account: string | Account): Promise<string | undefined>;
1607
1614
  /**
1608
1615
  *
1609
1616
  * Tell if the given account is credit on the transaction
1610
1617
  *
1611
1618
  * @param account - The account object
1612
1619
  */
1613
- isCredit(account: Account): Promise<boolean>;
1620
+ isCredit(account?: Account): Promise<boolean>;
1614
1621
  /**
1615
1622
  *
1616
1623
  * Tell if the given account is debit on the transaction
1617
1624
  *
1618
1625
  * @param account - The account object
1619
1626
  */
1620
- isDebit(account: Account): Promise<boolean>;
1627
+ isDebit(account?: Account): Promise<boolean>;
1621
1628
 
1622
1629
  /**
1623
1630
  * @returns The description of this transaction.
@@ -1633,7 +1640,7 @@ export declare class Transaction {
1633
1640
  /**
1634
1641
  * @returns The Transaction date, in ISO format yyyy-MM-dd.
1635
1642
  */
1636
- getDate(): string;
1643
+ getDate(): string | undefined;
1637
1644
  /**
1638
1645
  *
1639
1646
  * Sets the date of the Transaction.
@@ -1648,11 +1655,11 @@ export declare class Transaction {
1648
1655
  /**
1649
1656
  * @returns The Transaction date number, in format YYYYMMDD.
1650
1657
  */
1651
- getDateValue(): number;
1658
+ getDateValue(): number | undefined;
1652
1659
  /**
1653
1660
  * @returns The Transaction date, formatted on the date pattern of the [[Book]].
1654
1661
  */
1655
- getDateFormatted(): string;
1662
+ getDateFormatted(): string | undefined;
1656
1663
  /**
1657
1664
  * @returns The date the transaction was created.
1658
1665
  */
@@ -1672,7 +1679,7 @@ export declare class Transaction {
1672
1679
  *
1673
1680
  * @param raw - True to get the raw balance, no matter the credit nature of the [[Account]].
1674
1681
  */
1675
- getAccountBalance(raw?: boolean): Promise<Amount>;
1682
+ getAccountBalance(raw?: boolean): Promise<Amount | undefined>;
1676
1683
  /**
1677
1684
  * Perform create new draft transaction.
1678
1685
  */
@@ -1740,7 +1747,7 @@ export declare class TransactionIterator {
1740
1747
  *
1741
1748
  * Continuation tokens are generally valid short period of time.
1742
1749
  */
1743
- getContinuationToken(): string;
1750
+ getContinuationToken(): string | undefined;
1744
1751
  /**
1745
1752
  * Sets a continuation token from previous paused iteration
1746
1753
  */
@@ -1752,11 +1759,11 @@ export declare class TransactionIterator {
1752
1759
  /**
1753
1760
  * Gets the next transaction in the collection of transactions.
1754
1761
  */
1755
- next(): Promise<Transaction>;
1762
+ next(): Promise<Transaction | undefined>;
1756
1763
  /**
1757
1764
  * @returns The account, when filtering by a single account.
1758
1765
  */
1759
- getAccount(): Promise<Account>;
1766
+ getAccount(): Promise<Account | undefined>;
1760
1767
  }
1761
1768
 
1762
1769
  /**
@@ -1766,25 +1773,25 @@ export declare class TransactionIterator {
1766
1773
  */
1767
1774
  export declare class User {
1768
1775
 
1769
- constructor(wrapped: bkper.User);
1776
+ constructor(json?: bkper.User);
1770
1777
  /**
1771
1778
  * Gets the id of the User.
1772
1779
  *
1773
1780
  * @returns The User's id
1774
1781
  */
1775
- getId(): string;
1782
+ getId(): string | undefined;
1776
1783
  /**
1777
1784
  * Gets the name of the User.
1778
1785
  *
1779
1786
  * @returns The User's name
1780
1787
  */
1781
- getName(): string;
1788
+ getName(): string | undefined;
1782
1789
  /**
1783
1790
  * Gets the full name of the User.
1784
1791
  *
1785
1792
  * @returns The User's full name
1786
1793
  */
1787
- getFullName(): string;
1794
+ getFullName(): string | undefined;
1788
1795
  /**
1789
1796
  * Gets the [[Connections]] of the User.
1790
1797
  *