bkper-js 1.12.0 → 1.13.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
@@ -1662,13 +1662,13 @@ export declare class Transaction {
1662
1662
  *
1663
1663
  * Adds a file attachment to the Transaction.
1664
1664
  *
1665
- * Files not previously created in the Book will be automatically created.
1665
+ * Files MUST be previously created in the Book.
1666
1666
  *
1667
1667
  * @param file - The file to add
1668
1668
  *
1669
1669
  * @returns This Transaction, for chainning.
1670
1670
  */
1671
- addFile(file: File): Promise<Transaction>;
1671
+ addFile(file: File): Transaction;
1672
1672
  /**
1673
1673
  * Check if the transaction has the specified tag.
1674
1674
  */
@@ -164,24 +164,18 @@ export class Transaction {
164
164
  *
165
165
  * Adds a file attachment to the Transaction.
166
166
  *
167
- * Files not previously created in the Book will be automatically created.
167
+ * Files MUST be previously created in the Book.
168
168
  *
169
169
  * @param file - The file to add
170
170
  *
171
171
  * @returns This Transaction, for chainning.
172
172
  */
173
173
  addFile(file) {
174
- return __awaiter(this, void 0, void 0, function* () {
175
- if (this.payload.files == null) {
176
- this.payload.files = [];
177
- }
178
- //Make sure file is already created
179
- if (file.getId() == null) {
180
- file = yield file.create();
181
- }
182
- this.payload.files.push(file.json());
183
- return this;
184
- });
174
+ if (this.payload.files == null) {
175
+ this.payload.files = [];
176
+ }
177
+ this.payload.files.push(file.json());
178
+ return this;
185
179
  }
186
180
  /**
187
181
  * Check if the transaction has the specified tag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",