bkper-js 1.8.2 → 1.9.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
@@ -729,56 +729,6 @@ export declare class Book {
729
729
  * @returns The updated Integration object
730
730
  */
731
731
  updateIntegration(integration: bkper.Integration): Promise<Integration>;
732
- /**
733
- * Instantiate a new [[Transaction]]
734
- *
735
- * Example:
736
- *
737
- * ```js
738
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
739
- *
740
- * book.newTransaction()
741
- * .setDate('2013-01-25')
742
- * .setDescription("Filling tank of my truck")
743
- * .from('Credit Card')
744
- * .to('Gas')
745
- * .setAmount(126.50)
746
- * .create();
747
- *
748
- * ```
749
- *
750
- */
751
- newTransaction(): Transaction;
752
- /**
753
- * Instantiate a new [[Account]]
754
- *
755
- * Example:
756
- * ```js
757
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
758
- *
759
- * book.newAccount()
760
- * .setName('Some New Account')
761
- * .setType('INCOMING')
762
- * .addGroup('Revenue').addGroup('Salary')
763
- * .setProperties({prop_a: 'A', prop_b: 'B'})
764
- * .create();
765
- * ```
766
- */
767
- newAccount(): Account;
768
- /**
769
- * Instantiate a new [[Group]]
770
- *
771
- * Example:
772
- * ```js
773
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
774
- *
775
- * book.newGroup()
776
- * .setName('Some New Group')
777
- * .setProperty('key', 'value')
778
- * .create();
779
- * ```
780
- */
781
- newGroup(): Group;
782
732
  /**
783
733
  * Gets an [[Account]] object
784
734
  *
@@ -820,19 +770,6 @@ export declare class Book {
820
770
  * Retrieve a transaction by id
821
771
  */
822
772
  getTransaction(id: string): Promise<Transaction | undefined>;
823
- /**
824
- * Instantiate a new [[BkperFile]]
825
- *
826
- * Example:
827
- * ```js
828
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
829
- *
830
- * book.newFile()
831
- * .setBlob(UrlFetchApp.fetch('https://bkper.com/images/index/integrations4.png').getBlob())
832
- * .create();
833
- * ```
834
- */
835
- newFile(): File;
836
773
  /**
837
774
  * Retrieve a file by id
838
775
  */
@@ -25,7 +25,9 @@ import { Amount } from './Amount.js';
25
25
  export class Account {
26
26
  constructor(book, payload) {
27
27
  this.book = book;
28
- this.payload = payload || {};
28
+ this.payload = payload || {
29
+ createdAt: `${Date.now()}`
30
+ };
29
31
  }
30
32
  /**
31
33
  * @returns An immutable copy of the json payload
package/lib/model/Book.js CHANGED
@@ -453,66 +453,6 @@ export class Book {
453
453
  return new Integration(integration);
454
454
  });
455
455
  }
456
- /**
457
- * Instantiate a new [[Transaction]]
458
- *
459
- * Example:
460
- *
461
- * ```js
462
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
463
- *
464
- * book.newTransaction()
465
- * .setDate('2013-01-25')
466
- * .setDescription("Filling tank of my truck")
467
- * .from('Credit Card')
468
- * .to('Gas')
469
- * .setAmount(126.50)
470
- * .create();
471
- *
472
- * ```
473
- *
474
- */
475
- newTransaction() {
476
- let transaction = new Transaction(this, {});
477
- return transaction;
478
- }
479
- /**
480
- * Instantiate a new [[Account]]
481
- *
482
- * Example:
483
- * ```js
484
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
485
- *
486
- * book.newAccount()
487
- * .setName('Some New Account')
488
- * .setType('INCOMING')
489
- * .addGroup('Revenue').addGroup('Salary')
490
- * .setProperties({prop_a: 'A', prop_b: 'B'})
491
- * .create();
492
- * ```
493
- */
494
- newAccount() {
495
- let account = new Account(this, {});
496
- account.setArchived(false);
497
- return account;
498
- }
499
- /**
500
- * Instantiate a new [[Group]]
501
- *
502
- * Example:
503
- * ```js
504
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
505
- *
506
- * book.newGroup()
507
- * .setName('Some New Group')
508
- * .setProperty('key', 'value')
509
- * .create();
510
- * ```
511
- */
512
- newGroup() {
513
- let group = new Group(this, {});
514
- return group;
515
- }
516
456
  /**
517
457
  * Gets an [[Account]] object
518
458
  *
@@ -669,22 +609,6 @@ export class Book {
669
609
  return transaction;
670
610
  });
671
611
  }
672
- /**
673
- * Instantiate a new [[BkperFile]]
674
- *
675
- * Example:
676
- * ```js
677
- * var book = Bkper.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
678
- *
679
- * book.newFile()
680
- * .setBlob(UrlFetchApp.fetch('https://bkper.com/images/index/integrations4.png').getBlob())
681
- * .create();
682
- * ```
683
- */
684
- newFile() {
685
- let file = new File(this, {});
686
- return file;
687
- }
688
612
  /**
689
613
  * Retrieve a file by id
690
614
  */
package/lib/model/File.js CHANGED
@@ -19,7 +19,10 @@ import * as FileService from '../service/file-service.js';
19
19
  export class File {
20
20
  constructor(book, payload) {
21
21
  this.book = book;
22
- this.payload = payload || {};
22
+ this.payload = payload || {
23
+ createdAt: `${Date.now()}`
24
+ };
25
+ ;
23
26
  }
24
27
  /**
25
28
  * @returns An immutable copy of the json payload
@@ -22,7 +22,9 @@ import { Account } from './Account.js';
22
22
  export class Group {
23
23
  constructor(book, payload) {
24
24
  this.book = book;
25
- this.payload = payload || {};
25
+ this.payload = payload || {
26
+ createdAt: `${Date.now()}`
27
+ };
26
28
  }
27
29
  /**
28
30
  * @returns An immutable copy of the json payload
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",