bkper-js 1.0.0 → 1.2.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/README.md +4 -4
- package/lib/index.d.ts +115 -97
- package/lib/index.js +15 -35
- package/lib/model/Account.js +30 -50
- package/lib/model/Amount.js +6 -13
- package/lib/model/App.js +6 -10
- package/lib/model/Bkper.js +14 -41
- package/lib/model/Book.js +64 -103
- package/lib/model/Collection.js +5 -9
- package/lib/model/Config.js +1 -2
- package/lib/model/Connection.js +8 -32
- package/lib/model/Enums.js +12 -15
- package/lib/model/File.js +19 -32
- package/lib/model/Group.js +16 -40
- package/lib/model/Integration.js +6 -7
- package/lib/model/Transaction.js +59 -77
- package/lib/model/TransactionIterator.js +15 -19
- package/lib/model/TransactionPage.js +14 -40
- package/lib/model/User.js +9 -34
- package/lib/service/account-service.js +9 -15
- package/lib/service/app-service.js +7 -12
- package/lib/service/balances-service.js +3 -6
- package/lib/service/book-service.js +7 -12
- package/lib/service/connection-service.js +16 -21
- package/lib/service/file-service.js +5 -9
- package/lib/service/group-service.js +18 -24
- package/lib/service/http-api-request.js +50 -101
- package/lib/service/http-request.js +78 -0
- package/lib/service/integration-service.js +9 -15
- package/lib/service/transaction-service.js +27 -37
- package/lib/service/user-service.js +3 -6
- package/lib/utils.js +72 -85
- package/package.json +9 -7
package/lib/index.js
CHANGED
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
|
-
* Bkper REST API
|
|
2
|
+
* Bkper REST API Javascript client for Node.js and browsers.
|
|
4
3
|
*
|
|
5
4
|
* Learn more at https://bkper.com/docs
|
|
6
5
|
*
|
|
7
6
|
* @packageDocumentation
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var File_1 = require("./model/File");
|
|
24
|
-
Object.defineProperty(exports, "File", { enumerable: true, get: function () { return File_1.File; } });
|
|
25
|
-
var Group_1 = require("./model/Group");
|
|
26
|
-
Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return Group_1.Group; } });
|
|
27
|
-
var Transaction_1 = require("./model/Transaction");
|
|
28
|
-
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_1.Transaction; } });
|
|
29
|
-
var TransactionIterator_1 = require("./model/TransactionIterator");
|
|
30
|
-
Object.defineProperty(exports, "TransactionIterator", { enumerable: true, get: function () { return TransactionIterator_1.TransactionIterator; } });
|
|
31
|
-
var User_1 = require("./model/User");
|
|
32
|
-
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
33
|
-
var Integration_1 = require("./model/Integration");
|
|
34
|
-
Object.defineProperty(exports, "Integration", { enumerable: true, get: function () { return Integration_1.Integration; } });
|
|
35
|
-
var Connection_1 = require("./model/Connection");
|
|
36
|
-
Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return Connection_1.Connection; } });
|
|
37
|
-
var Enums_1 = require("./model/Enums");
|
|
38
|
-
Object.defineProperty(exports, "Periodicity", { enumerable: true, get: function () { return Enums_1.Periodicity; } });
|
|
39
|
-
Object.defineProperty(exports, "AccountType", { enumerable: true, get: function () { return Enums_1.AccountType; } });
|
|
40
|
-
Object.defineProperty(exports, "DecimalSeparator", { enumerable: true, get: function () { return Enums_1.DecimalSeparator; } });
|
|
41
|
-
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return Enums_1.Permission; } });
|
|
8
|
+
export { App } from './model/App.js';
|
|
9
|
+
export { Amount } from "./model/Amount.js";
|
|
10
|
+
export { Bkper } from './model/Bkper.js';
|
|
11
|
+
export { Account } from './model/Account.js';
|
|
12
|
+
export { Book } from './model/Book.js';
|
|
13
|
+
export { Collection } from './model/Collection.js';
|
|
14
|
+
export { File } from './model/File.js';
|
|
15
|
+
export { Group } from './model/Group.js';
|
|
16
|
+
export { Transaction } from './model/Transaction.js';
|
|
17
|
+
export { TransactionIterator } from './model/TransactionIterator.js';
|
|
18
|
+
export { User } from './model/User.js';
|
|
19
|
+
export { Integration } from './model/Integration.js';
|
|
20
|
+
export { Connection } from './model/Connection.js';
|
|
21
|
+
export { Periodicity, AccountType, DecimalSeparator, Permission } from './model/Enums.js';
|
|
42
22
|
//# sourceMappingURL=index.js.map
|
package/lib/model/Account.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -31,14 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
8
|
});
|
|
33
9
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const utils_1 = require("../utils");
|
|
40
|
-
const Amount_1 = require("./Amount");
|
|
41
|
-
const Utils = __importStar(require("../utils"));
|
|
10
|
+
import * as AccountService from '../service/account-service.js';
|
|
11
|
+
import * as GroupService from '../service/group-service.js';
|
|
12
|
+
import { Group } from './Group.js';
|
|
13
|
+
import { normalizeText, round } from '../utils.js';
|
|
14
|
+
import { Amount } from './Amount.js';
|
|
42
15
|
/**
|
|
43
16
|
*
|
|
44
17
|
* This class defines an [Account](https://en.wikipedia.org/wiki/Account_(bookkeeping)) of a [[Book]].
|
|
@@ -49,7 +22,11 @@ const Utils = __importStar(require("../utils"));
|
|
|
49
22
|
*
|
|
50
23
|
* @public
|
|
51
24
|
*/
|
|
52
|
-
class Account {
|
|
25
|
+
export class Account {
|
|
26
|
+
constructor(book, json) {
|
|
27
|
+
this.book = book;
|
|
28
|
+
this.wrapped = json || {};
|
|
29
|
+
}
|
|
53
30
|
/**
|
|
54
31
|
*
|
|
55
32
|
* @returns The wrapped plain json object
|
|
@@ -87,7 +64,7 @@ class Account {
|
|
|
87
64
|
return this.wrapped.normalizedName;
|
|
88
65
|
}
|
|
89
66
|
else {
|
|
90
|
-
return
|
|
67
|
+
return normalizeText(this.getName());
|
|
91
68
|
}
|
|
92
69
|
}
|
|
93
70
|
/**
|
|
@@ -136,7 +113,7 @@ class Account {
|
|
|
136
113
|
return value;
|
|
137
114
|
}
|
|
138
115
|
}
|
|
139
|
-
return
|
|
116
|
+
return undefined;
|
|
140
117
|
}
|
|
141
118
|
/**
|
|
142
119
|
* Sets a custom property in the Account.
|
|
@@ -153,6 +130,9 @@ class Account {
|
|
|
153
130
|
if (this.wrapped.properties == null) {
|
|
154
131
|
this.wrapped.properties = {};
|
|
155
132
|
}
|
|
133
|
+
if (!value) {
|
|
134
|
+
value = '';
|
|
135
|
+
}
|
|
156
136
|
this.wrapped.properties[key] = value;
|
|
157
137
|
return this;
|
|
158
138
|
}
|
|
@@ -173,9 +153,9 @@ class Account {
|
|
|
173
153
|
* @returns The balance of this account.
|
|
174
154
|
*/
|
|
175
155
|
getBalance() {
|
|
176
|
-
var balance = new
|
|
156
|
+
var balance = new Amount('0');
|
|
177
157
|
if (this.wrapped.balance != null) {
|
|
178
|
-
balance =
|
|
158
|
+
balance = round(this.wrapped.balance, this.book.getFractionDigits());
|
|
179
159
|
}
|
|
180
160
|
return balance;
|
|
181
161
|
}
|
|
@@ -185,9 +165,9 @@ class Account {
|
|
|
185
165
|
* @returns The balance of this account.
|
|
186
166
|
*/
|
|
187
167
|
getBalanceRaw() {
|
|
188
|
-
var balance = new
|
|
168
|
+
var balance = new Amount('0');
|
|
189
169
|
if (this.wrapped.balance != null) {
|
|
190
|
-
balance =
|
|
170
|
+
balance = round(this.wrapped.balance, this.book.getFractionDigits());
|
|
191
171
|
}
|
|
192
172
|
return balance;
|
|
193
173
|
}
|
|
@@ -257,11 +237,12 @@ class Account {
|
|
|
257
237
|
*/
|
|
258
238
|
getGroups() {
|
|
259
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
group.book = this.book;
|
|
240
|
+
const id = this.getId();
|
|
241
|
+
if (!id) {
|
|
242
|
+
return [];
|
|
264
243
|
}
|
|
244
|
+
let groups = yield GroupService.getGroupsByAccountId(this.book.getId(), id);
|
|
245
|
+
let groupsObj = groups.map(group => new Group(this.book, group));
|
|
265
246
|
return groupsObj;
|
|
266
247
|
});
|
|
267
248
|
}
|
|
@@ -271,7 +252,7 @@ class Account {
|
|
|
271
252
|
* @returns This Account, for chainning.
|
|
272
253
|
*/
|
|
273
254
|
setGroups(groups) {
|
|
274
|
-
this.wrapped.groups =
|
|
255
|
+
this.wrapped.groups = undefined;
|
|
275
256
|
if (groups != null) {
|
|
276
257
|
groups.forEach(group => this.addGroup(group));
|
|
277
258
|
}
|
|
@@ -283,10 +264,10 @@ class Account {
|
|
|
283
264
|
* @returns This Account, for chainning.
|
|
284
265
|
*/
|
|
285
266
|
addGroup(group) {
|
|
286
|
-
if (this.wrapped.groups
|
|
267
|
+
if (!this.wrapped.groups) {
|
|
287
268
|
this.wrapped.groups = [];
|
|
288
269
|
}
|
|
289
|
-
if (group instanceof
|
|
270
|
+
if (group instanceof Group) {
|
|
290
271
|
this.wrapped.groups.push(group.json());
|
|
291
272
|
}
|
|
292
273
|
else {
|
|
@@ -300,8 +281,8 @@ class Account {
|
|
|
300
281
|
removeGroup(group) {
|
|
301
282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
302
283
|
if (this.wrapped.groups != null) {
|
|
303
|
-
let groupObject =
|
|
304
|
-
if (group instanceof
|
|
284
|
+
let groupObject = undefined;
|
|
285
|
+
if (group instanceof Group) {
|
|
305
286
|
groupObject = group;
|
|
306
287
|
}
|
|
307
288
|
else if (typeof group == "string") {
|
|
@@ -330,7 +311,7 @@ class Account {
|
|
|
330
311
|
return false;
|
|
331
312
|
}
|
|
332
313
|
//Group object
|
|
333
|
-
if (group instanceof
|
|
314
|
+
if (group instanceof Group) {
|
|
334
315
|
return this.isInGroupObject_(group);
|
|
335
316
|
}
|
|
336
317
|
//id or name
|
|
@@ -381,5 +362,4 @@ class Account {
|
|
|
381
362
|
});
|
|
382
363
|
}
|
|
383
364
|
}
|
|
384
|
-
exports.Account = Account;
|
|
385
365
|
//# sourceMappingURL=Account.js.map
|
package/lib/model/Amount.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Amount = void 0;
|
|
7
|
-
const big_js_1 = __importDefault(require("big.js"));
|
|
1
|
+
import Big from "big.js";
|
|
8
2
|
/**
|
|
9
3
|
* This class defines an Amount for arbitrary-precision decimal arithmetic.
|
|
10
4
|
*
|
|
@@ -12,23 +6,23 @@ const big_js_1 = __importDefault(require("big.js"));
|
|
|
12
6
|
*
|
|
13
7
|
* @public
|
|
14
8
|
*/
|
|
15
|
-
class Amount {
|
|
9
|
+
export class Amount {
|
|
16
10
|
/**
|
|
17
11
|
* The Amount constructor.
|
|
18
12
|
*/
|
|
19
13
|
constructor(n) {
|
|
20
14
|
this.checkNumberNotNull(n);
|
|
21
15
|
if (typeof n == "string") {
|
|
22
|
-
this.wrapped = new
|
|
16
|
+
this.wrapped = new Big(n);
|
|
23
17
|
}
|
|
24
18
|
else if (n instanceof Amount) {
|
|
25
|
-
this.wrapped = new
|
|
19
|
+
this.wrapped = new Big(n.wrapped);
|
|
26
20
|
}
|
|
27
21
|
else if (n.toString) {
|
|
28
|
-
this.wrapped = new
|
|
22
|
+
this.wrapped = new Big(n.toString());
|
|
29
23
|
}
|
|
30
24
|
else {
|
|
31
|
-
this.wrapped = new
|
|
25
|
+
this.wrapped = new Big(+n);
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
@@ -291,5 +285,4 @@ class Amount {
|
|
|
291
285
|
return amount;
|
|
292
286
|
}
|
|
293
287
|
}
|
|
294
|
-
exports.Amount = Amount;
|
|
295
288
|
//# sourceMappingURL=Amount.js.map
|
package/lib/model/App.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,9 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
exports.App = void 0;
|
|
13
|
-
const app_service_1 = require("../service/app-service");
|
|
10
|
+
import { createApp, patchApp, updateApp } from "../service/app-service.js";
|
|
14
11
|
/**
|
|
15
12
|
* Defines an App on Bkper.
|
|
16
13
|
*
|
|
@@ -18,9 +15,9 @@ const app_service_1 = require("../service/app-service");
|
|
|
18
15
|
*
|
|
19
16
|
* @public
|
|
20
17
|
*/
|
|
21
|
-
class App {
|
|
18
|
+
export class App {
|
|
22
19
|
constructor(json) {
|
|
23
|
-
this.wrapped = json;
|
|
20
|
+
this.wrapped = json || {};
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
23
|
*
|
|
@@ -87,7 +84,7 @@ class App {
|
|
|
87
84
|
*/
|
|
88
85
|
create() {
|
|
89
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
yield
|
|
87
|
+
yield createApp(this.wrapped);
|
|
91
88
|
return this;
|
|
92
89
|
});
|
|
93
90
|
}
|
|
@@ -96,7 +93,7 @@ class App {
|
|
|
96
93
|
*/
|
|
97
94
|
patch() {
|
|
98
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
yield
|
|
96
|
+
yield patchApp(this.wrapped);
|
|
100
97
|
return this;
|
|
101
98
|
});
|
|
102
99
|
}
|
|
@@ -105,10 +102,9 @@ class App {
|
|
|
105
102
|
*/
|
|
106
103
|
update() {
|
|
107
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
yield
|
|
105
|
+
yield updateApp(this.wrapped);
|
|
109
106
|
return this;
|
|
110
107
|
});
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
|
-
exports.App = App;
|
|
114
110
|
//# sourceMappingURL=App.js.map
|
package/lib/model/Bkper.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -31,20 +7,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
8
|
});
|
|
33
9
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const http_api_request_1 = require("../service/http-api-request");
|
|
41
|
-
const User_1 = require("./User");
|
|
10
|
+
import { Book } from "./Book.js";
|
|
11
|
+
import { App } from "./App.js";
|
|
12
|
+
import * as BookService from '../service/book-service.js';
|
|
13
|
+
import * as UserService from '../service/user-service.js';
|
|
14
|
+
import { HttpApiRequest } from '../service/http-api-request.js';
|
|
15
|
+
import { User } from "./User.js";
|
|
42
16
|
/**
|
|
43
|
-
* This is the main Entry Point of the [bkper-
|
|
17
|
+
* This is the main Entry Point of the [bkper-js](https://www.npmjs.com/package/bkper-js) library.
|
|
44
18
|
*
|
|
45
19
|
* @public
|
|
46
20
|
*/
|
|
47
|
-
class Bkper {
|
|
21
|
+
export class Bkper {
|
|
48
22
|
/**
|
|
49
23
|
* Gets the [[Book]] with the specified bookId from url param.
|
|
50
24
|
*
|
|
@@ -55,7 +29,7 @@ class Bkper {
|
|
|
55
29
|
static getBook(id) {
|
|
56
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
31
|
let book = yield BookService.loadBook(id);
|
|
58
|
-
return new
|
|
32
|
+
return new Book(book);
|
|
59
33
|
});
|
|
60
34
|
}
|
|
61
35
|
/**
|
|
@@ -66,7 +40,7 @@ class Bkper {
|
|
|
66
40
|
static getUser() {
|
|
67
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
42
|
let user = yield UserService.getUser();
|
|
69
|
-
return new
|
|
43
|
+
return new User(user);
|
|
70
44
|
});
|
|
71
45
|
}
|
|
72
46
|
/**
|
|
@@ -75,7 +49,7 @@ class Bkper {
|
|
|
75
49
|
* @param config - The Config object
|
|
76
50
|
*/
|
|
77
51
|
static setConfig(config) {
|
|
78
|
-
|
|
52
|
+
HttpApiRequest.config = config;
|
|
79
53
|
}
|
|
80
54
|
/**
|
|
81
55
|
* Sets the API key to identify the agent.
|
|
@@ -87,8 +61,8 @@ class Bkper {
|
|
|
87
61
|
* @deprecated Use `setConfig()` instead
|
|
88
62
|
*/
|
|
89
63
|
static setApiKey(key) {
|
|
90
|
-
|
|
91
|
-
return new
|
|
64
|
+
HttpApiRequest.config.apiKeyProvider = () => __awaiter(this, void 0, void 0, function* () { return key; });
|
|
65
|
+
return new App({});
|
|
92
66
|
}
|
|
93
67
|
/**
|
|
94
68
|
* Sets the provider of the valid OAuth2 access token
|
|
@@ -97,9 +71,8 @@ class Bkper {
|
|
|
97
71
|
*/
|
|
98
72
|
static setOAuthTokenProvider(oauthTokenProvider) {
|
|
99
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
74
|
+
HttpApiRequest.config.oauthTokenProvider = oauthTokenProvider;
|
|
101
75
|
});
|
|
102
76
|
}
|
|
103
77
|
}
|
|
104
|
-
exports.Bkper = Bkper;
|
|
105
78
|
//# sourceMappingURL=Bkper.js.map
|