bkper-js 1.14.0 → 1.15.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
@@ -1773,6 +1773,10 @@ export declare class Transaction {
1773
1773
  * @returns The amount of the transaction.
1774
1774
  */
1775
1775
  getAmount(): Amount | undefined;
1776
+ /**
1777
+ * @returns The amount of the transaction, formatted according to the Book format.
1778
+ */
1779
+ getAmountFormatted(): string | undefined;
1776
1780
  /**
1777
1781
  *
1778
1782
  * Sets the amount of the Transaction.
@@ -1902,6 +1906,10 @@ export declare class Transaction {
1902
1906
  * Untrash the transaction.
1903
1907
  */
1904
1908
  untrash(): Promise<Transaction>;
1909
+ /** @deprecated */
1910
+ remove(): Promise<Transaction>;
1911
+ /** @deprecated */
1912
+ restore(): Promise<Transaction>;
1905
1913
  }
1906
1914
 
1907
1915
  /**
@@ -393,6 +393,16 @@ export class Transaction {
393
393
  getAmount() {
394
394
  return this.payload.amount != null && this.payload.amount.trim() != '' ? new Amount(this.payload.amount) : undefined;
395
395
  }
396
+ /**
397
+ * @returns The amount of the transaction, formatted according to the Book format.
398
+ */
399
+ getAmountFormatted() {
400
+ const amount = this.getAmount();
401
+ if (amount) {
402
+ return this.book.formatValue(amount);
403
+ }
404
+ return undefined;
405
+ }
396
406
  /**
397
407
  *
398
408
  * Sets the amount of the Transaction.
@@ -698,5 +708,17 @@ export class Transaction {
698
708
  return this;
699
709
  });
700
710
  }
711
+ /** @deprecated */
712
+ remove() {
713
+ return __awaiter(this, void 0, void 0, function* () {
714
+ return this.trash();
715
+ });
716
+ }
717
+ /** @deprecated */
718
+ restore() {
719
+ return __awaiter(this, void 0, void 0, function* () {
720
+ return this.untrash();
721
+ });
722
+ }
701
723
  }
702
724
  //# sourceMappingURL=Transaction.js.map
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.7"
8
+ "packageVersion": "7.47.11"
9
9
  }
10
10
  ]
11
11
  }
package/lib/utils.js CHANGED
@@ -36,7 +36,7 @@ export function formatValue(value, decimalSeparator, fractionDigits) {
36
36
  if (value == null) {
37
37
  return "";
38
38
  }
39
- if (!fractionDigits) {
39
+ if (fractionDigits == null) {
40
40
  fractionDigits = 2;
41
41
  }
42
42
  var formattedValue = (value.toFixed(fractionDigits)) + "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
@@ -33,6 +33,9 @@
33
33
  "preversion": "bun run build",
34
34
  "postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
35
35
  },
36
+ "peerDependencies": {
37
+ "@bkper/bkper-api-types": "^5.10.0"
38
+ },
36
39
  "dependencies": {
37
40
  "@google-cloud/local-auth": "^3.0.1",
38
41
  "axios": "^1.7.7",
@@ -41,7 +44,6 @@
41
44
  "luxon": "^1.25.0"
42
45
  },
43
46
  "devDependencies": {
44
- "@bkper/bkper-api-types": "^5.10.0",
45
47
  "@microsoft/api-extractor": "^7.12.1",
46
48
  "@types/big.js": "^6.0.2",
47
49
  "@types/chai": "^4.2.14",