bkper 4.18.4 → 4.20.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.
Files changed (40) hide show
  1. package/README.md +7 -3
  2. package/lib/agent/auth-commands.d.ts +34 -0
  3. package/lib/agent/auth-commands.d.ts.map +1 -0
  4. package/lib/agent/auth-commands.js +389 -0
  5. package/lib/agent/auth-commands.js.map +1 -0
  6. package/lib/agent/bkper-ai-provider.d.ts +9 -0
  7. package/lib/agent/bkper-ai-provider.d.ts.map +1 -0
  8. package/lib/agent/bkper-ai-provider.js +148 -0
  9. package/lib/agent/bkper-ai-provider.js.map +1 -0
  10. package/lib/agent/run-agent-mode.d.ts +7 -2
  11. package/lib/agent/run-agent-mode.d.ts.map +1 -1
  12. package/lib/agent/run-agent-mode.js +98 -14
  13. package/lib/agent/run-agent-mode.js.map +1 -1
  14. package/lib/auth/local-auth-service.d.ts +23 -4
  15. package/lib/auth/local-auth-service.d.ts.map +1 -1
  16. package/lib/auth/local-auth-service.js +97 -27
  17. package/lib/auth/local-auth-service.js.map +1 -1
  18. package/lib/cli.js +2 -0
  19. package/lib/cli.js.map +1 -1
  20. package/lib/commands/events/index.d.ts +3 -0
  21. package/lib/commands/events/index.d.ts.map +1 -0
  22. package/lib/commands/events/index.js +3 -0
  23. package/lib/commands/events/index.js.map +1 -0
  24. package/lib/commands/events/list.d.ts +36 -0
  25. package/lib/commands/events/list.d.ts.map +1 -0
  26. package/lib/commands/events/list.js +160 -0
  27. package/lib/commands/events/list.js.map +1 -0
  28. package/lib/commands/events/register.d.ts +8 -0
  29. package/lib/commands/events/register.d.ts.map +1 -0
  30. package/lib/commands/events/register.js +66 -0
  31. package/lib/commands/events/register.js.map +1 -0
  32. package/lib/commands/events/replay.d.ts +11 -0
  33. package/lib/commands/events/replay.d.ts.map +1 -0
  34. package/lib/commands/events/replay.js +30 -0
  35. package/lib/commands/events/replay.js.map +1 -0
  36. package/lib/docs/cli/app-management.md +6 -1
  37. package/lib/docs/cli/data-management.md +44 -1
  38. package/lib/docs/sdk/bkper-api-types.md +5 -2
  39. package/lib/docs/sdk/bkper-js.md +40 -1
  40. package/package.json +4 -4
@@ -631,7 +631,7 @@ It contains all `Accounts` where `Transactions` are recorded/posted;
631
631
  - `getTransaction(id: string)` → `Promise<Transaction | undefined>` — Retrieve a transaction by id.
632
632
  - `getVisibility()` / `setVisibility(visibility: Visibility)` → `Visibility` — Gets the visibility of the book.
633
633
  - `json()` → `bkper.Book` — Gets an immutable copy of the JSON payload for this resource.
634
- - `listEvents(afterDate: string | null, beforeDate: string | null, onError: boolean | null, resourceId: string | null, limit: number, cursor?: string)` → `Promise<EventList>` — Lists events in the Book based on the provided parameters.
634
+ - `listEvents(options: ListEventsOptions)` → `Promise<EventList>` — Lists events in the Book based on the provided options.
635
635
  - `listFiles(limit?: number, cursor?: string)` → `Promise<FileList>` — Lists files in the Book, for pagination.
636
636
  - `listTransactions(query?: string, limit?: number, cursor?: string)` → `Promise<TransactionList>` — Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
637
637
  - `mergeTransactions(transaction1: string | bkper.Transaction | Transaction, transaction2: string | bkper.Transaction | Transaction)` → `Promise<Transaction>` — Merge two `Transactions` into a single new canonical transaction.
@@ -786,6 +786,7 @@ A Collaborator represents a user that has been granted access to a Book with spe
786
786
  **Methods:**
787
787
 
788
788
  - `create(message?: string)` → `Promise<Collaborator>` — Performs create new Collaborator.
789
+ - `getAvatarUrl()` → `string | undefined` — Gets the public avatar url of the Collaborator.
789
790
  - `getEmail()` / `setEmail(email: string)` → `string | undefined (set: string)` — Gets the Collaborator email address.
790
791
  - `getId()` → `string | undefined` — Gets the Collaborator internal id.
791
792
  - `getPermission()` / `setPermission(permission: Permission)` → `Permission | undefined (set: Permission)` — Gets the permission level of the Collaborator.
@@ -902,11 +903,13 @@ A File can be attached to a `Transaction` or used to import data.
902
903
  - `getBook()` → `Book` — Gets the Book this File belongs to.
903
904
  - `getContent()` / `setContent(content: string)` → `Promise<string | undefined> (set: string)` — Gets the file content Base64 encoded.
904
905
  - `getContentType()` / `setContentType(contentType: string)` → `string | undefined (set: string)` — Gets the File content type.
906
+ - `getCreatedAt()` → `Date | undefined` — Gets the date the File was created.
905
907
  - `getId()` → `string | undefined` — Gets the File id.
906
908
  - `getName()` / `setName(name: string)` → `string | undefined (set: string)` — Gets the File name.
907
909
  - `getSize()` → `number | undefined` — Gets the file size in bytes.
908
910
  - `getUrl()` → `string | undefined` — Gets the file serving url for accessing via browser.
909
911
  - `json()` → `bkper.File` — Gets an immutable copy of the JSON payload for this resource.
912
+ - `remove()` → `Promise<File>` — Perform delete File.
910
913
  - `update()` → `Promise<File>` — Perform update File, applying pending changes.
911
914
 
912
915
  *Standard property methods (deleteProperty, getProperties, getProperty, getPropertyKeys, getVisibleProperties, setProperties, setProperty, setVisibleProperties, setVisibleProperty) — see Account.*
@@ -1202,6 +1205,7 @@ Each User has a unique identity, subscription plan details, and access permissio
1202
1205
  - `getHostedDomain()` → `string | undefined` — Gets the hosted domain of the User.
1203
1206
  - `getId()` → `string | undefined` — Gets the id of the User.
1204
1207
  - `getName()` → `string | undefined` — Gets the name of the User.
1208
+ - `getPlanCycle()` → `"MONTHLY" | "YEARLY" | undefined` — Gets the billing cycle of the User's current plan.
1205
1209
  - `getUsername()` → `string | undefined` — Gets the username of the User.
1206
1210
  - `hasUsedConnections()` → `boolean | undefined` — Tells if the User has already used `Connections`.
1207
1211
  - `json()` → `bkper.User` — Gets an immutable copy of the JSON payload for this resource.
@@ -1311,6 +1315,40 @@ Bkper Platform outbound for server-side app routes.
1311
1315
  This function is called when a request fails and needs to be retried.
1312
1316
  It provides the HTTP status code, error message, and the number of retry attempts made so far.
1313
1317
 
1318
+ ### ListEventsOptions
1319
+
1320
+ Options for listing events in a Book.
1321
+
1322
+ **Properties:**
1323
+
1324
+ - `afterDate?`: `string` — The start date (inclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format.
1325
+ - `beforeDate?`: `string` — The end date (exclusive) for the events search range, in [RFC3339](https://en.wikipedia.org/wiki/ISO_8601#RFC_3339) format.
1326
+ - `cursor?`: `string` — The cursor for pagination.
1327
+ - `limit`: `number` — The maximum number of events to return.
1328
+ - `onError?`: `boolean` — Whether to filter events by error responses.
1329
+ - `resourceId?`: `string` — The ID of the event's resource (Transaction, Account, or Group).
1330
+ - `type?`: `EventType` — The event type to filter by.
1331
+
1332
+ **limit**
1333
+
1334
+ Defaults to `50`, maximum is `200`.
1335
+
1336
+ **onError**
1337
+
1338
+ `true` returns events with at least one error response.
1339
+ `false` returns events with no error responses.
1340
+ `null` or `undefined` includes events regardless of error responses.
1341
+
1342
+ Ignored when `resourceId` is set. When set, `type` is ignored.
1343
+
1344
+ **resourceId**
1345
+
1346
+ When set, `onError` and `type` are ignored.
1347
+
1348
+ **type**
1349
+
1350
+ Ignored when `resourceId` or `onError` is set.
1351
+
1314
1352
  ## Enums
1315
1353
 
1316
1354
  ### AccountType
@@ -1362,6 +1400,7 @@ Enum that represents event types.
1362
1400
  - `COMMENT_CREATED`
1363
1401
  - `COMMENT_DELETED`
1364
1402
  - `FILE_CREATED`
1403
+ - `FILE_DELETED`
1365
1404
  - `FILE_UPDATED`
1366
1405
  - `GROUP_CREATED`
1367
1406
  - `GROUP_DELETED`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "4.18.4",
3
+ "version": "4.20.0",
4
4
  "description": "Command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"
@@ -43,7 +43,7 @@
43
43
  "test:integration": "TS_NODE_TRANSPILE_ONLY=true BKPER_API_URL=${BKPER_API_URL:-http://localhost:8081/_ah/api/bkper} TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.integration.json",
44
44
  "test:deploy": "TS_NODE_TRANSPILE_ONLY=true BKPER_PLATFORM_URL=http://localhost:8790 BKPER_API_URL=https://api-dev.bkper.app TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.deploy.json",
45
45
  "test:all": "bun run test:unit && bun run test:integration",
46
- "version": "bun ./scripts/sync-plugin-version.ts",
46
+ "version": "bun ./scripts/sync-plugin-version.ts && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .codex-plugin/plugin.json",
47
47
  "release:patch": "npm version patch -m \"chore(release): v%s\"",
48
48
  "release:minor": "npm version minor -m \"chore(release): v%s\"",
49
49
  "release:major": "npm version major -m \"chore(release): v%s\"",
@@ -52,8 +52,8 @@
52
52
  "upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
53
53
  },
54
54
  "dependencies": {
55
- "@earendil-works/pi-coding-agent": "0.80.3",
56
- "bkper-js": "^2.37.0",
55
+ "@earendil-works/pi-coding-agent": "0.80.10",
56
+ "bkper-js": "^2.40.1",
57
57
  "commander": "^13.1.0",
58
58
  "dotenv": "^8.2.0",
59
59
  "esbuild": "^0.27.2",