bkper-js 1.47.3 → 2.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/CHANGELOG.md ADDED
@@ -0,0 +1,345 @@
1
+ ### **Changelog**
2
+
3
+ See what's new and what has changed in bkper-js
4
+
5
+ 2025
6
+ ----
7
+
8
+ **July 2025**
9
+ * **BREAKING CHANGE:** Refactored `Bkper` class from static methods to constructor-based pattern
10
+ * **BREAKING CHANGE:** Removed deprecated methods: `Transaction.remove()`, `Transaction.restore()`, `Account.getBalance()`, `Account.getBalanceRaw()`
11
+ * **MIGRATION:** Use `transaction.trash()` and `transaction.untrash()` instead of `remove()` and `restore()`
12
+ * **MIGRATION:** Use `Book.getBalancesReport()` instead of `Account.getBalance()` methods
13
+
14
+ **June 2025**
15
+ * Added [Book.copy](/docs/bkper-js/#book_copy)
16
+ * Added [Transaction.getUpdatedAt](/docs/bkper-js/#transaction_getupdatedat)
17
+ * Added [Transaction.getUpdatedAtFormatted](/docs/bkper-js/#transaction_getupdatedatformatted)
18
+
19
+ **May 2025**
20
+ * Added [Group.isLocked](/docs/bkper-js/#group_islocked)
21
+ * Added [Group.setLocked](/docs/bkper-js/#group_setlocked)
22
+ * Added [Message.stream](/docs/bkper-js/#message_stream)
23
+ * Added [Query](/docs/bkper-js/#query)
24
+ * Added [Query.json](/docs/bkper-js/#query_getbook)
25
+ * Added [Query.getId](/docs/bkper-js/#query_getid)
26
+ * Added [Query.getTitle](/docs/bkper-js/#query_gettitle)
27
+ * Added [Query.setTitle](/docs/bkper-js/#query_settitle)
28
+ * Added [Query.getQuery](/docs/bkper-js/#query_getquery)
29
+ * Added [Query.setQuery](/docs/bkper-js/#query_setquery)
30
+ * Added [Query.create](/docs/bkper-js/#query_create)
31
+ * Added [Query.update](/docs/bkper-js/#query_update)
32
+ * Added [Query.remove](/docs/bkper-js/#query_remove)
33
+ * Added [Book.getSavedQueries](/docs/bkper-js/#book_getsavedqueries)
34
+ * Added [Book.batchPostTransactions](/docs/bkper-js/#book_batchposttransactions)
35
+ * Added [Book.batchCheckTransactions](/docs/bkper-js/#book_batchchecktransactions)
36
+ * Added [Book.batchUncheckTransactions](/docs/bkper-js/#book_batchunchecktransactions)
37
+ * Added [Book.batchUpdateTransactions](/docs/bkper-js/#book_batchupdatetransactions)
38
+ * Added [Book.batchUntrashTransactions](/docs/bkper-js/#book_batchuntrashtransactions)
39
+
40
+ **April 2025**
41
+ * Added [Book.batchCreateAccounts](/docs/bkper-js/#book_batchcreateaccounts)
42
+ * Added [Book.batchCreateGroups](/docs/bkper-js/#book_batchcreategroups)
43
+
44
+ **March 2025**
45
+ * Added [Agent.getLogoUrlDark](/docs/bkper-js/#agent_getlogourldark)
46
+ * Added [App.getFilePatterns](/docs/bkper-js/#app_getfilepatterns)
47
+ * Added [App.getLogoUrlDark](/docs/bkper-js/#app_getlogourldark)
48
+ * Added [App.getOwnerLogoUrl](/docs/bkper-js/#app_getownerlogourl)
49
+ * Added [App.getOwnerName](/docs/bkper-js/#app_getownername)
50
+ * Added [App.isConversational](/docs/bkper-js/#app_isconversational)
51
+ * Added [App.isPublished](/docs/bkper-js/#app_ispublished)
52
+ * Added [App.setConversationUrlDev](/docs/bkper-js/#app_setconversationurldev)
53
+ * Added [Bkper.getConversations](/docs/bkper-js/#app_getconversations)
54
+ * Added [Conversation](/docs/bkper-js/#conversation)
55
+ * Added [Conversation.create](/docs/bkper-js/#conversation_create)
56
+ * Added [Conversation.getAgent](/docs/bkper-js/#conversation_getagent)
57
+ * Added [Conversation.getCreatedAt](/docs/bkper-js/#conversation_getcreatedat)
58
+ * Added [Conversation.getId](/docs/bkper-js/#conversation_getid)
59
+ * Added [Conversation.getMessages](/docs/bkper-js/#conversation_getmessages)
60
+ * Added [Conversation.getTitle](/docs/bkper-js/#conversation_gettitle)
61
+ * Added [Conversation.getUpdatedAt](/docs/bkper-js/#conversation_getupdatedat)
62
+ * Added [Conversation.json](/docs/bkper-js/#conversation_json)
63
+ * Added [Message](/docs/bkper-js/#message)
64
+ * Added [Message.create](/docs/bkper-js/#message_create)
65
+ * Added [Message.deleteProperty](/docs/bkper-js/#message_deleteproperty)
66
+ * Added [Message.getAgent](/docs/bkper-js/#message_getagent)
67
+ * Added [Message.getCreatedAt](/docs/bkper-js/#message_getcreatedat)
68
+ * Added [Message.getContent](/docs/bkper-js/#message_getcontent)
69
+ * Added [Message.getConversation](/docs/bkper-js/#message_getconversation)
70
+ * Added [Message.getId](/docs/bkper-js/#message_getid)
71
+ * Added [Message.getProperties](/docs/bkper-js/#message_getproperties)
72
+ * Added [Message.getProperty](/docs/bkper-js/#message_getproperty)
73
+ * Added [Message.getUser](/docs/bkper-js/#message_getuser)
74
+ * Added [Message.setContent](/docs/bkper-js/#message_setcontent)
75
+ * Added [Message.setProperties](/docs/bkper-js/#message_setproperties)
76
+ * Added [Message.setProperty](/docs/bkper-js/#message_setproperty)
77
+ * Added [Message.json](/docs/bkper-js/#message_json)
78
+ * Added [Transaction.getAgentName](/docs/bkper-js/#transaction_getagentname)
79
+ * Added [Transaction.getAgentLogoUrl](/docs/bkper-js/#transaction_getagentlogourl)
80
+ * Added [Transaction.getAgentLogoUrlDark](/docs/bkper-js/#transaction_getagentlogourldark)
81
+
82
+ **February 2025**
83
+ * Added [EventType](/docs/bkper-js/#eventtype) enum
84
+ * Added [BotResponseType](/docs/bkper-js/#botresponsetype) enum
85
+ * Added [Agent](/docs/bkper-js/#agent)
86
+ * Added [Agent.getId](/docs/bkper-js/#agent_getid)
87
+ * Added [Agent.getLogoUrl](/docs/bkper-js/#agent_getlogourl)
88
+ * Added [Agent.getName](/docs/bkper-js/#agent_getname)
89
+ * Added [Agent.json](/docs/bkper-js/#agent_json)
90
+ * Added [App.getDescription](/docs/bkper-js/#app_getdescription)
91
+ * Added [App.getEvents](/docs/bkper-js/#app_getevents)
92
+ * Added [App.getLogoUrl](/docs/bkper-js/#app_getlogourl)
93
+ * Added [App.getName](/docs/bkper-js/#app_getname)
94
+ * Added [App.hasEvents](/docs/bkper-js/#app_hasevents)
95
+ * Added [Book.batchReplayEvents](/docs/bkper-js/#book_batchreplayevents)
96
+ * Added [Book.getApps](/docs/bkper-js/#book_getapps)
97
+ * Added [BotResponse](/docs/bkper-js/#botresponse)
98
+ * Added [BotResponse.getAgentId](/docs/bkper-js/#botresponse_getagentid)
99
+ * Added [BotResponse.getCreatedAt](/docs/bkper-js/#botresponse_getcreatedat)
100
+ * Added [BotResponse.getEvent](/docs/bkper-js/#botresponse_getevent)
101
+ * Added [BotResponse.getMessage](/docs/bkper-js/#botresponse_getmessage)
102
+ * Added [BotResponse.getType](/docs/bkper-js/#botresponse_gettype)
103
+ * Added [BotResponse.remove](/docs/bkper-js/#botresponse_remove)
104
+ * Added [BotResponse.replay](/docs/bkper-js/#botresponse_replay)
105
+ * Added [Event.getAgent](/docs/bkper-js/#event_getagent)
106
+ * Added [Event.getBook](/docs/bkper-js/#event_getbook)
107
+ * Added [Event.getBotResponses](/docs/bkper-js/#event_getbotresponses)
108
+ * Added [Event.getCreatedAt](/docs/bkper-js/#event_getcreatedat)
109
+ * Added [Event.getId](/docs/bkper-js/#event_getid)
110
+ * Added [Event.getType](/docs/bkper-js/#event_gettype)
111
+ * Added [Event.getUser](/docs/bkper-js/#event_getuser)
112
+ * Added [Event.hasErrorResponse](/docs/bkper-js/#event_haserrorresponse)
113
+ * Added [User.getAvatarUrl](/docs/bkper-js/#user_getavatarurl)
114
+
115
+ **January 2025**
116
+ * Added [BalancesContainer](/docs/bkper-js/#balancescontainer)
117
+ * Added [BalancesContainer.getName](/docs/bkper-js/#balancescontainer_getname)
118
+ * Added [BalancesContainer.getNormalizedName](/docs/bkper-js/#balancescontainer_getnormalizedname)
119
+ * Added [BalancesContainer.getGroup](/docs/bkper-js/#balancescontainer_getgroup)
120
+ * Added [BalancesContainer.getAccount](/docs/bkper-js/#balancescontainer_getaccount)
121
+ * Added [BalancesContainer.getParent](/docs/bkper-js/#balancescontainer_getparent)
122
+ * Added [BalancesContainer.getDepth](/docs/bkper-js/#balancescontainer_getdepth)
123
+ * Added [BalancesContainer.isCredit](/docs/bkper-js/#balancescontainer_iscredit)
124
+ * Added [BalancesContainer.isPermanent](/docs/bkper-js/#balancescontainer_ispermanent)
125
+ * Added [BalancesContainer.isFromAccount](/docs/bkper-js/#balancescontainer_isfromaccount)
126
+ * Added [BalancesContainer.isFromGroup](/docs/bkper-js/#balancescontainer_isfromgroup)
127
+ * Added [BalancesContainer.hasGroupBalances](/docs/bkper-js/#balancescontainer_hasgroupbalances)
128
+ * Added [BalancesContainer.getCumulativeBalance](/docs/bkper-js/#balancescontainer_getcumulativebalance)
129
+ * Added [BalancesContainer.getCumulativeBalanceRaw](/docs/bkper-js/#balancescontainer_getcumulativebalanceraw)
130
+ * Added [BalancesContainer.getCumulativeBalanceText](/docs/bkper-js/#balancescontainer_getcumulativebalancetext)
131
+ * Added [BalancesContainer.getCumulativeBalanceRawText](/docs/bkper-js/#balancescontainer_getcumulativebalancerawtext)
132
+ * Added [BalancesContainer.getPeriodBalance](/docs/bkper-js/#balancescontainer_getperiodbalance)
133
+ * Added [BalancesContainer.getPeriodBalanceRaw](/docs/bkper-js/#balancescontainer_getperiodbalanceraw)
134
+ * Added [BalancesContainer.getPeriodBalanceText](/docs/bkper-js/#balancescontainer_getperiodbalancetext)
135
+ * Added [BalancesContainer.getPeriodBalanceRawText](/docs/bkper-js/#balancescontainer_getperiodbalancerawtext)
136
+ * Added [BalancesContainer.getBalancesContainers](/docs/bkper-js/#balancescontainer_getbalancescontainers)
137
+ * Added [BalancesContainer.getBalancesContainer](/docs/bkper-js/#balancescontainer_getbalancescontainer)
138
+ * Added [BalancesReport](/docs/bkper-js/#balancesreport)
139
+ * Added [BalancesReport.getBook](/docs/bkper-js/#balancesreport_getbook)
140
+ * Added [BalancesReport.getPeriod](/docs/bkper-js/#balancesreport_getperiod)
141
+ * Added [BalancesReport.getBalancesContainers](/docs/bkper-js/#balancesreport_getbalancescontainers)
142
+ * Added [BalancesReport.getBalancesContainer](/docs/bkper-js/#balancesreport_getbalancescontainer)
143
+ * Added [Book.getAutoPost](/docs/bkper-js/#book_getautopost)
144
+ * Added [Book.setAutoPost](/docs/bkper-js/#book_setautopost)
145
+ * Added [Group.isCredit](/docs/bkper-js/#group_iscredit)
146
+ * Added [Group.isMixed](/docs/bkper-js/#group_ismixed)
147
+ * Added [User.getPlan](/docs/bkper-js/#user_getplan)
148
+ * Added [User.hasBillingEnabled](/docs/bkper-js/#user_hasbillingenabled)
149
+
150
+
151
+ 2024
152
+ ----
153
+
154
+ **December 2024**
155
+ * Added [Book.listEvents](/docs/bkper-js/#book_listevents)
156
+ * Added [EventList](/docs/bkper-js/#eventlist)
157
+ * Added [EventList.getCursor](/docs/bkper-js/#eventlist_getcursor)
158
+ * Added [EventList.getFirst](/docs/bkper-js/#eventlist_getfirst)
159
+ * Added [EventList.getItems](/docs/bkper-js/#eventlist_getitems)
160
+ * Added [EventList.size](/docs/bkper-js/#eventlist_size)
161
+ * Added [Group.isPermanent](/docs/bkper-js/#group_ispermanent)
162
+ * Added [Group.hasParent](/docs/bkper-js/#group_hasparent)
163
+ * Added [Group.getChildren](/docs/bkper-js/#group_getchildren)
164
+ * Added [Group.getDescendants](/docs/bkper-js/#group_getdescendants)
165
+ * Added [Group.getDescendantTreeIds](/docs/bkper-js/#group_getdescendanttreeids)
166
+ * Added [Group.hasChildren](/docs/bkper-js/#group_haschildren)
167
+ * Added [Group.isLeaf](/docs/bkper-js/#group_isleaf)
168
+ * Added [Group.isRoot](/docs/bkper-js/#group_isroot)
169
+ * Added [Group.getDepth](/docs/bkper-js/#group_getdepth)
170
+ * Added [Group.getRoot](/docs/bkper-js/#group_getroot)
171
+ * Added [Group.getRootName](/docs/bkper-js/#group_getrootname)
172
+ * Added [Group.hasAccounts](/docs/bkper-js/#group_hasaccounts)
173
+
174
+ **November 2024**
175
+ * Added [Transaction.trash](/docs/bkper-js/#transaction_trash)
176
+ * Added [Transaction.untrash](/docs/bkper-js/#transaction_untrash)
177
+ * Added [Transaction.getAmountFormatted](/docs/bkper-js/#transaction_getamountformatted)
178
+ * Added [Transaction.isLocked](/docs/bkper-js/#transaction_islocked)
179
+ * Removed ```Transaction.remove``` from [Transaction](/docs/bkper-js/#transaction)
180
+ * Removed ```Transaction.restore``` from [Transaction](/docs/bkper-js/#transaction)
181
+
182
+ **October 2024**
183
+ * Exposed ```payload``` property on all objects from [bkper-js](/docs/bkper-js) interface
184
+ * Added [Collection.addBooks](/docs/bkper-js/#collection_addbooks)
185
+ * Added [Collection.create](/docs/bkper-js/#collection_create)
186
+ * Added [Collection.getOwnerUsername](/docs/bkper-js/#collection_getownerusername)
187
+ * Added [Collection.getPermission](/docs/bkper-js/#collection_getpermission)
188
+ * Added [Collection.getUpdatedAt](/docs/bkper-js/#collection_getupdatedat)
189
+ * Added [Collection.remove](/docs/bkper-js/#collection_remove)
190
+ * Added [Collection.removeBooks](/docs/bkper-js/#collection_removebooks)
191
+ * Added [Collection.setName](/docs/bkper-js/#collection_setname)
192
+ * Added [Collection.update](/docs/bkper-js/#collection_update)
193
+ * Added [Bkper.getBillingPortalUrl](/docs/bkper-js/#bkper_getbillingportalurl)
194
+ * Added [Connection.getDateAddedMs](/docs/bkper-js/#connection_getdateaddedms)
195
+ * Added [Connection.getLogo](/docs/bkper-js/#connection_getlogo)
196
+ * Added [Connection.remove](/docs/bkper-js/#connection_remove)
197
+ * Added [Integration.getAddedBy](/docs/bkper-js/#integration_getaddedby)
198
+ * Added [Integration.getAgentId](/docs/bkper-js/#integration_getagentid)
199
+ * Added [Integration.getDateAddedMs](/docs/bkper-js/#integration_getdateaddedms)
200
+ * Added [Integration.getLastUpdateMs](/docs/bkper-js/#integration_getlastupdatems)
201
+ * Added [Integration.getLogo](/docs/bkper-js/#integration_getlogo)
202
+ * Added [Integration.remove](/docs/bkper-js/#integration_remove)
203
+ * Added [TransactionList](/docs/bkper-js/#transactionlist) returned from [Book.listTransactions](/docs/bkper-js/#book_listtransactions)
204
+ * Removed ```TransactionIterator``` from [Transaction](/docs/bkper-js/#transaction)
205
+ * Removed ```newTransaction``` from [Book](/docs/bkper-js/#book). Use [Transaction](/docs/bkper-js/#transaction) constructor instead
206
+ * Removed ```newAccount``` from [Book](/docs/bkper-js/#book). Use [Account](/docs/bkper-js/#account) constructor instead
207
+ * Removed ```newGroup``` from [Book](/docs/bkper-js/#book). Use [Group](/docs/bkper-js/#group) constructor instead
208
+ * Removed ```newFile``` from [Book](/docs/bkper-js/#book). Use [File](/docs/bkper-js/#file) constructor instead
209
+
210
+ **September 2024**
211
+ * Extracted [bkper-js](https://github.com/bkper/bkper-js) from [bkper](https://github.com/bkper/bkper-node) as a standalone library.
212
+ * Added [Config.requestRetryHandler](/docs/bkper-js/#config_requestretryhandler)
213
+ * Added [Visibility](/docs/bkper-js/#visibility) enum
214
+ * Added [App.json](/docs/bkper-js/#app_json)
215
+ * Added [Bkper.getApps](/docs/bkper-js/#bkper_getapps)
216
+ * Added [Bkper.getBooks](/docs/bkper-js/#bkper_getbooks)
217
+ * Added [Bkper.getTemplates](/docs/bkper-js/#bkper_gettemplates)
218
+ * Added [Bkper.newBook](/docs/bkper-js/#bkper_newbook)
219
+ * Added [Book.getTotalTransactions](/docs/bkper-js/#book_gettotaltransactions)
220
+ * Added [Book.getTotalTransactionsCurrentMonth](/docs/bkper-js/#book_gettotaltransactionscurrentmonth)
221
+ * Added [Book.getTotalTransactionsCurrentYear](/docs/bkper-js/#book_gettotaltransactionscurrentyear)
222
+ * Added [Book.getVisibility](/docs/bkper-js/#book_getvisibility)
223
+ * Added [Book.create](/docs/bkper-js/#book_create)
224
+ * Added [Collection.json](/docs/bkper-js/#collection_json)
225
+ * Added [Template](/docs/bkper-js/#template)
226
+ * Added [Template.getBookId](/docs/bkper-js/#template_getbookid)
227
+ * Added [Template.getBookLink](/docs/bkper-js/#template_getbooklink)
228
+ * Added [Template.getCategory](/docs/bkper-js/#template_getcategory)
229
+ * Added [Template.getDescription](/docs/bkper-js/#template_getdescription)
230
+ * Added [Template.getImageUrl](/docs/bkper-js/#template_getimageurl)
231
+ * Added [Template.getName](/docs/bkper-js/#template_getname)
232
+ * Added [Template.getSheetsLink](/docs/bkper-js/#template_getsheetslink)
233
+ * Added [Template.getTimesUsed](/docs/bkper-js/#template_gettimesused)
234
+ * Added [Template.json](/docs/bkper-js/#template_json)
235
+ * Added [User.getEmail](/docs/bkper-js/#user_getemail)
236
+ * Added [User.getHostedDomain](/docs/bkper-js/#user_gethosteddomain)
237
+ * Added [User.isFree](/docs/bkper-js/#user_isfree)
238
+ * Added [User.hasStartedTrial](/docs/bkper-js/#user_hasstartedtrial)
239
+ * Added [User.getDaysLeftInTrial](/docs/bkper-js/#user_getdaysleftintrial)
240
+ * Added [User.hasUsedConnections](/docs/bkper-js/#user_hasusedconnections)
241
+ * Added [User.json](/docs/bkper-js/#user_json)
242
+
243
+ **January 2024**
244
+ * Added [Transaction.setChecked](/docs/bkper-js/#transaction_setchecked)
245
+
246
+
247
+ 2023
248
+ ----
249
+
250
+ **June 2023**
251
+ * Added [Bkper.getUser](/docs/bkper-js/#bkper_getuser)
252
+ * Added [Bkper.setConfig](/docs/bkper-js/#bkper_setconfig)
253
+ * Added [Book.batchTrashTransactions](/docs/bkper-js/#book_batchtrashtransactions)
254
+ * Added [Book.createIntegration](/docs/bkper-js/#book_createintegration)
255
+ * Added [Book.getIntegrations](/docs/bkper-js/#book_getintegrations)
256
+ * Added [Book.updateIntegration](/docs/bkper-js/#book_updateintegration)
257
+ * Added [Config](/docs/bkper-js/#config) interface
258
+ * Added [Connection](/docs/bkper-js/#connection)
259
+ * Added [Connection.clearTokenProperties](/docs/bkper-js/#connection_cleartokenproperties)
260
+ * Added [Connection.create](/docs/bkper-js/#connection_create)
261
+ * Added [Connection.deleteProperty](/docs/bkper-js/#connection_deleteproperty)
262
+ * Added [Connection.getAgentId](/docs/bkper-js/#connection_getagentid)
263
+ * Added [Connection.getEmail](/docs/bkper-js/#connection_getemail)
264
+ * Added [Connection.getId](/docs/bkper-js/#connection_getid)
265
+ * Added [Connection.getIntegrations](/docs/bkper-js/#connection_getintegrations)
266
+ * Added [Connection.getName](/docs/bkper-js/#connection_getname)
267
+ * Added [Connection.getProperties](/docs/bkper-js/#connection_getproperties)
268
+ * Added [Connection.getProperty](/docs/bkper-js/#connection_getproperty)
269
+ * Added [Connection.getPropertyKeys](/docs/bkper-js/#connection_getpropertykeys)
270
+ * Added [Connection.getType](/docs/bkper-js/#connection_gettype)
271
+ * Added [Connection.getUUID](/docs/bkper-js/#connection_getuuid)
272
+ * Added [Connection.json](/docs/bkper-js/#connection_json)
273
+ * Added [Connection.setAgentId](/docs/bkper-js/#connection_setagentid)
274
+ * Added [Connection.setName](/docs/bkper-js/#connection_setname)
275
+ * Added [Connection.setProperties](/docs/bkper-js/#connection_setproperties)
276
+ * Added [Connection.setProperty](/docs/bkper-js/#connection_setproperty)
277
+ * Added [Connection.setType](/docs/bkper-js/#connection_settype)
278
+ * Added [Connection.setUUID](/docs/bkper-js/#connection_setuuid)
279
+ * Added [Integration](/docs/bkper-js/#integration)
280
+ * Added [Integration.deleteProperty](/docs/bkper-js/#integration_deleteproperty)
281
+ * Added [Integration.getBookId](/docs/bkper-js/#integration_getbookid)
282
+ * Added [Integration.getId](/docs/bkper-js/#integration_getid)
283
+ * Added [Integration.getName](/docs/bkper-js/#integration_getname)
284
+ * Added [Integration.getProperties](/docs/bkper-js/#integration_getproperties)
285
+ * Added [Integration.getProperty](/docs/bkper-js/#integration_getproperty)
286
+ * Added [Integration.json](/docs/bkper-js/#integration_json)
287
+ * Added [Integration.setProperties](/docs/bkper-js/#integration_setproperties)
288
+ * Added [Integration.setProperty](/docs/bkper-js/#integration_setproperty)
289
+ * Added [User](/docs/bkper-js/#user)
290
+ * Added [User.getConnection](/docs/bkper-js/#user_getconnection)
291
+ * Added [User.getConnections](/docs/bkper-js/#user_getconnections)
292
+ * Added [User.getFullName](/docs/bkper-js/#user_getfullname)
293
+ * Added [User.getId](/docs/bkper-js/#user_getid)
294
+ * Added [User.getName](/docs/bkper-js/#user_getname)
295
+ * Deprecated [Bkper.setApiKey](/docs/bkper-js/#bkper_setapikey)
296
+ * Deprecated [Bkper.setOAuthTokenProvider](/docs/bkper-js/#bkper_setoauthtokenprovider)
297
+
298
+
299
+ 2022
300
+ ----
301
+
302
+ **September 2022**
303
+ * Deprecated [Account.getBalance](/docs/bkper-js/#account_getbalance)
304
+
305
+ **May 2022**
306
+ * Added [Book.parseDate](/docs/bkper-js/#book_parsedate)
307
+
308
+ **April 2022**
309
+ * Added [Book.getClosingDate](/docs/bkper-js/#book_getclosingdate)
310
+ * Added [Book.setClosingDate](/docs/bkper-js/#book_setclosingdate)
311
+
312
+
313
+ 2021
314
+ ----
315
+
316
+ **October 2021**
317
+ * Added [Book.getGroupsByAccount](/docs/bkper-js/#book_getgroupsbyaccount)
318
+
319
+ **May 2021**
320
+ * Added [Group.getParent](/docs/bkper-js/#group_getparent)
321
+ * Added [Group.setParent](/docs/bkper-js/#group_setparent)
322
+ * **BREAKING CHANGE:** Removed **AccountsDataTableBuilder**
323
+ * **BREAKING CHANGE:** Removed **BalancesDataTableBuilder**
324
+ * **BREAKING CHANGE:** Removed **TransactionsDataTableBuilder**
325
+ * **BREAKING CHANGE:** Removed **BalancesReport**
326
+ * **BREAKING CHANGE:** Removed **Balance**
327
+ * **BREAKING CHANGE:** Removed **BalancesContainer**
328
+
329
+ **April 2021**
330
+ * Added [Book.getLockDate](/docs/bkper-js/#book_getlockdate)
331
+ * Added [Book.setLockDate](/docs/bkper-js/#book_setlockdate)
332
+
333
+ **March 2021**
334
+ * **BREAKING CHANGE:** : Removed **BalanceCheckedType**
335
+
336
+ **February 2021**
337
+ * Added [Book.getPeriod](/docs/bkper-js/#book_getperiod)
338
+ * Added [Book.setPeriod](/docs/bkper-js/#book_setperiod)
339
+ * Added [Book.getPeriodStartMonth](/docs/bkper-js/#book_getperiodstartmonth)
340
+ * Added [Book.setPeriodStartMonth](/docs/bkper-js/#book_setperiodstartmonth)
341
+ * Added [Book.getPageSize](/docs/bkper-js/#book_getpagesize)
342
+ * Added [Book.setPageSize](/docs/bkper-js/#book_setpagesize)
343
+
344
+ **January 2021**
345
+ * [bkper](https://www.npmjs.com/package/bkper) client library published
package/README.md CHANGED
@@ -27,4 +27,31 @@ or
27
27
  bun add bkper-js
28
28
  ```
29
29
 
30
+ ## Usage
31
+
32
+ ```typescript
33
+ import { Bkper } from 'bkper-js';
34
+
35
+ // Set global configuration
36
+ Bkper.setConfig({
37
+ apiKeyProvider: () => process.env.BKPER_API_KEY,
38
+ oauthTokenProvider: () => process.env.BKPER_OAUTH_TOKEN
39
+ });
40
+
41
+ // Create Bkper instance (uses global config)
42
+ const bkper = new Bkper();
43
+
44
+ // Get a book and work with it
45
+ const book = await bkper.getBook('your-book-id');
46
+ console.log(`Book: ${book.getName()}`);
47
+
48
+ // List all books
49
+ const books = await bkper.getBooks();
50
+ console.log(`You have ${books.length} books`);
51
+
52
+ // Get current user
53
+ const user = await bkper.getUser();
54
+ console.log(`Logged in as: ${user.getName()}`);
55
+ ```
56
+
30
57
 
package/lib/index.d.ts CHANGED
@@ -108,22 +108,6 @@ export declare class Account {
108
108
  * @returns This Account, for chaining
109
109
  */
110
110
  deleteProperty(key: string): Account;
111
- /**
112
- * Gets the balance based on credit nature of this Account.
113
- *
114
- * @deprecated Use `Book.getBalancesReport` instead.
115
- *
116
- * @returns The balance of this Account.
117
- */
118
- getBalance(): Amount;
119
- /**
120
- * Gets the raw balance, no matter credit nature of this Account.
121
- *
122
- * @deprecated Use `Book.getBalancesReport` instead.
123
- *
124
- * @returns The balance of this Account.
125
- */
126
- getBalanceRaw(): Amount;
127
111
  /**
128
112
  * Tells if this Account is archived.
129
113
  *
@@ -841,7 +825,7 @@ export declare class BalancesReport {
841
825
  /**
842
826
  * This is the main entry point of the [bkper-js](https://www.npmjs.com/package/bkper-js) library.
843
827
  *
844
- * You start by setting the API [[Config]] object.
828
+ * You start by setting the API [[Config]] object using the static setConfig method.
845
829
  *
846
830
  * Example:
847
831
  *
@@ -849,14 +833,28 @@ export declare class BalancesReport {
849
833
  * Bkper.setConfig({
850
834
  * apiKeyProvider: () => process.env.BKPER_API_KEY,
851
835
  * oauthTokenProvider: () => process.env.BKPER_OAUTH_TOKEN
852
- * })
836
+ * });
837
+ *
838
+ * const bkper = new Bkper();
839
+ * const book = await bkper.getBook('bookId');
853
840
  * ```
854
841
  *
855
- * Once the config is set, you can start using the library.
842
+ * Once the config is set, you can create instances and start using the library.
856
843
  *
857
844
  * @public
858
845
  */
859
846
  export declare class Bkper {
847
+ /**
848
+ * Sets the global API configuration for all Bkper operations.
849
+ *
850
+ * @param config - The Config object containing API key and OAuth token providers
851
+ */
852
+ static setConfig(config: Config): void;
853
+ /**
854
+ * Creates a new Bkper instance using the global configuration set via setConfig().
855
+ * Make sure to call Bkper.setConfig() before creating instances.
856
+ */
857
+ constructor();
860
858
  /**
861
859
  * Gets the [[Book]] with the specified bookId from url param.
862
860
  *
@@ -865,44 +863,44 @@ export declare class Bkper {
865
863
  *
866
864
  * @returns The retrieved Book
867
865
  */
868
- static getBook(id: string, includeAccounts?: boolean): Promise<Book>;
866
+ getBook(id: string, includeAccounts?: boolean): Promise<Book>;
869
867
  /**
870
868
  * Gets all [[Books]] the user has access to.
871
869
  *
872
870
  * @param query - Optional search term to filter books
873
871
  * @returns The retrieved list of Books
874
872
  */
875
- static getBooks(query?: string): Promise<Book[]>;
873
+ getBooks(query?: string): Promise<Book[]>;
876
874
  /**
877
875
  * Gets all [[Collections]] the user has access to.
878
876
  *
879
877
  * @returns The retrieved list of Collections
880
878
  */
881
- static getCollections(): Promise<Collection[]>;
879
+ getCollections(): Promise<Collection[]>;
882
880
  /**
883
881
  * Gets all [[Apps]] available for the user.
884
882
  *
885
883
  * @returns The retrieved list of Apps
886
884
  */
887
- static getApps(): Promise<App[]>;
885
+ getApps(): Promise<App[]>;
888
886
  /**
889
887
  * Gets all [[Conversations]] available for the user.
890
888
  *
891
889
  * @returns The retrieved list of Conversations
892
890
  */
893
- static getConversations(): Promise<Conversation[]>;
891
+ getConversations(): Promise<Conversation[]>;
894
892
  /**
895
893
  * Gets all [[Templates]] available for the user.
896
894
  *
897
895
  * @returns The retrieved list of Templates
898
896
  */
899
- static getTemplates(): Promise<Template[]>;
897
+ getTemplates(): Promise<Template[]>;
900
898
  /**
901
899
  * Gets the current logged [[User]].
902
900
  *
903
901
  * @returns The retrieved User
904
902
  */
905
- static getUser(): Promise<User>;
903
+ getUser(): Promise<User>;
906
904
  /**
907
905
  * Gets the URL to redirect the User to the billing portal.
908
906
  *
@@ -910,29 +908,7 @@ export declare class Bkper {
910
908
  *
911
909
  * @returns The URL to redirect the User to the billing portal
912
910
  */
913
- static getBillingPortalUrl(returnUrl: string): Promise<string | undefined>;
914
- /**
915
- * Sets the API [[Config]] object.
916
- *
917
- * @param config - The Config object
918
- */
919
- static setConfig(config: Config): void;
920
- /**
921
- * Sets the API key to identify the agent.
922
- *
923
- * @param key - The API key
924
- *
925
- * @returns The defined [[App]] object
926
- *
927
- * @deprecated Use `setConfig()` instead
928
- */
929
- static setApiKey(key: string): App;
930
- /**
931
- * Sets the provider of the valid OAuth2 access token
932
- *
933
- * @deprecated Use `setConfig()` instead
934
- */
935
- static setOAuthTokenProvider(oauthTokenProvider: () => Promise<string>): Promise<void>;
911
+ getBillingPortalUrl(returnUrl: string): Promise<string | undefined>;
936
912
  }
937
913
 
938
914
  /**
@@ -3337,10 +3313,6 @@ export declare class Transaction {
3337
3313
  * @returns This Transaction, for chaining
3338
3314
  */
3339
3315
  untrash(): Promise<Transaction>;
3340
- /** @deprecated */
3341
- remove(): Promise<Transaction>;
3342
- /** @deprecated */
3343
- restore(): Promise<Transaction>;
3344
3316
  }
3345
3317
 
3346
3318
  /**
@@ -10,8 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import * as AccountService from '../service/account-service.js';
11
11
  import * as GroupService from '../service/group-service.js';
12
12
  import { Group } from './Group.js';
13
- import { normalizeText, round } from '../utils.js';
14
- import { Amount } from './Amount.js';
13
+ import { normalizeText } from '../utils.js';
15
14
  /**
16
15
  * This class defines an [Account](https://en.wikipedia.org/wiki/Account_(bookkeeping)) of a [[Book]].
17
16
  *
@@ -163,34 +162,6 @@ export class Account {
163
162
  this.setProperty(key, null);
164
163
  return this;
165
164
  }
166
- /**
167
- * Gets the balance based on credit nature of this Account.
168
- *
169
- * @deprecated Use `Book.getBalancesReport` instead.
170
- *
171
- * @returns The balance of this Account.
172
- */
173
- getBalance() {
174
- var balance = new Amount('0');
175
- if (this.payload.balance != null) {
176
- balance = round(this.payload.balance, this.book.getFractionDigits());
177
- }
178
- return balance;
179
- }
180
- /**
181
- * Gets the raw balance, no matter credit nature of this Account.
182
- *
183
- * @deprecated Use `Book.getBalancesReport` instead.
184
- *
185
- * @returns The balance of this Account.
186
- */
187
- getBalanceRaw() {
188
- var balance = new Amount('0');
189
- if (this.payload.balance != null) {
190
- balance = round(this.payload.balance, this.book.getFractionDigits());
191
- }
192
- return balance;
193
- }
194
165
  /**
195
166
  * Tells if this Account is archived.
196
167
  *
@@ -24,7 +24,7 @@ import { Agent } from "./Agent.js";
24
24
  /**
25
25
  * This is the main entry point of the [bkper-js](https://www.npmjs.com/package/bkper-js) library.
26
26
  *
27
- * You start by setting the API [[Config]] object.
27
+ * You start by setting the API [[Config]] object using the static setConfig method.
28
28
  *
29
29
  * Example:
30
30
  *
@@ -32,14 +32,32 @@ import { Agent } from "./Agent.js";
32
32
  * Bkper.setConfig({
33
33
  * apiKeyProvider: () => process.env.BKPER_API_KEY,
34
34
  * oauthTokenProvider: () => process.env.BKPER_OAUTH_TOKEN
35
- * })
35
+ * });
36
+ *
37
+ * const bkper = new Bkper();
38
+ * const book = await bkper.getBook('bookId');
36
39
  * ```
37
40
  *
38
- * Once the config is set, you can start using the library.
41
+ * Once the config is set, you can create instances and start using the library.
39
42
  *
40
43
  * @public
41
44
  */
42
45
  export class Bkper {
46
+ /**
47
+ * Sets the global API configuration for all Bkper operations.
48
+ *
49
+ * @param config - The Config object containing API key and OAuth token providers
50
+ */
51
+ static setConfig(config) {
52
+ HttpApiRequest.config = config;
53
+ }
54
+ /**
55
+ * Creates a new Bkper instance using the global configuration set via setConfig().
56
+ * Make sure to call Bkper.setConfig() before creating instances.
57
+ */
58
+ constructor() {
59
+ // Uses global configuration set via setConfig()
60
+ }
43
61
  /**
44
62
  * Gets the [[Book]] with the specified bookId from url param.
45
63
  *
@@ -48,7 +66,7 @@ export class Bkper {
48
66
  *
49
67
  * @returns The retrieved Book
50
68
  */
51
- static getBook(id, includeAccounts) {
69
+ getBook(id, includeAccounts) {
52
70
  return __awaiter(this, void 0, void 0, function* () {
53
71
  let book = yield BookService.loadBook(id, includeAccounts);
54
72
  return new Book(book);
@@ -60,7 +78,7 @@ export class Bkper {
60
78
  * @param query - Optional search term to filter books
61
79
  * @returns The retrieved list of Books
62
80
  */
63
- static getBooks(query) {
81
+ getBooks(query) {
64
82
  return __awaiter(this, void 0, void 0, function* () {
65
83
  let books = yield BookService.loadBooks(query);
66
84
  return books.map(book => new Book(book));
@@ -71,7 +89,7 @@ export class Bkper {
71
89
  *
72
90
  * @returns The retrieved list of Collections
73
91
  */
74
- static getCollections() {
92
+ getCollections() {
75
93
  return __awaiter(this, void 0, void 0, function* () {
76
94
  let collections = yield CollectionService.loadCollections();
77
95
  return collections.map(collection => new Collection(collection));
@@ -82,7 +100,7 @@ export class Bkper {
82
100
  *
83
101
  * @returns The retrieved list of Apps
84
102
  */
85
- static getApps() {
103
+ getApps() {
86
104
  return __awaiter(this, void 0, void 0, function* () {
87
105
  let apps = yield AppService.getApps();
88
106
  return apps.map(app => new App(app));
@@ -93,7 +111,7 @@ export class Bkper {
93
111
  *
94
112
  * @returns The retrieved list of Conversations
95
113
  */
96
- static getConversations() {
114
+ getConversations() {
97
115
  return __awaiter(this, void 0, void 0, function* () {
98
116
  const conversationPayloads = yield ConversationService.getConversations();
99
117
  let conversations = [];
@@ -110,7 +128,7 @@ export class Bkper {
110
128
  *
111
129
  * @returns The retrieved list of Templates
112
130
  */
113
- static getTemplates() {
131
+ getTemplates() {
114
132
  return __awaiter(this, void 0, void 0, function* () {
115
133
  let templates = yield TemplateService.getTemplates();
116
134
  return templates.map(template => new Template(template));
@@ -121,7 +139,7 @@ export class Bkper {
121
139
  *
122
140
  * @returns The retrieved User
123
141
  */
124
- static getUser() {
142
+ getUser() {
125
143
  return __awaiter(this, void 0, void 0, function* () {
126
144
  let user = yield UserService.getUser();
127
145
  return new User(user);
@@ -134,42 +152,11 @@ export class Bkper {
134
152
  *
135
153
  * @returns The URL to redirect the User to the billing portal
136
154
  */
137
- static getBillingPortalUrl(returnUrl) {
155
+ getBillingPortalUrl(returnUrl) {
138
156
  return __awaiter(this, void 0, void 0, function* () {
139
157
  let url = yield UserService.getBillingPortalUrl(returnUrl);
140
158
  return url.url;
141
159
  });
142
160
  }
143
- /**
144
- * Sets the API [[Config]] object.
145
- *
146
- * @param config - The Config object
147
- */
148
- static setConfig(config) {
149
- HttpApiRequest.config = config;
150
- }
151
- /**
152
- * Sets the API key to identify the agent.
153
- *
154
- * @param key - The API key
155
- *
156
- * @returns The defined [[App]] object
157
- *
158
- * @deprecated Use `setConfig()` instead
159
- */
160
- static setApiKey(key) {
161
- HttpApiRequest.config.apiKeyProvider = () => __awaiter(this, void 0, void 0, function* () { return key; });
162
- return new App({});
163
- }
164
- /**
165
- * Sets the provider of the valid OAuth2 access token
166
- *
167
- * @deprecated Use `setConfig()` instead
168
- */
169
- static setOAuthTokenProvider(oauthTokenProvider) {
170
- return __awaiter(this, void 0, void 0, function* () {
171
- HttpApiRequest.config.oauthTokenProvider = oauthTokenProvider;
172
- });
173
- }
174
161
  }
175
162
  //# sourceMappingURL=Bkper.js.map
@@ -830,17 +830,5 @@ export class Transaction {
830
830
  return this;
831
831
  });
832
832
  }
833
- /** @deprecated */
834
- remove() {
835
- return __awaiter(this, void 0, void 0, function* () {
836
- return this.trash();
837
- });
838
- }
839
- /** @deprecated */
840
- restore() {
841
- return __awaiter(this, void 0, void 0, function* () {
842
- return this.untrash();
843
- });
844
- }
845
833
  }
846
834
  //# sourceMappingURL=Transaction.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.47.3",
3
+ "version": "2.1.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",