wealthica-sdk-js 0.0.10 → 0.0.13
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 +22 -8
- package/dist/wealthica.d.ts +79 -5
- package/dist/wealthica.es5.d.ts +79 -5
- package/dist/wealthica.es5.js +98 -48
- package/dist/wealthica.js +98 -48
- package/dist/wealthica.min.d.ts +79 -5
- package/dist/wealthica.min.js +6 -6
- package/dist/wealthica.min.js.map +1 -1
- package/lib/wealthica.d.ts +79 -5
- package/lib/wealthica.js +98 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -314,7 +314,7 @@ This method removes a single institution from the user.
|
|
|
314
314
|
await user.institutions.remove('603522490d2b02001233a5d6');
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
#### user.history.getList({
|
|
317
|
+
#### user.history.getList({ institutions, from, to, investments })
|
|
318
318
|
|
|
319
319
|
This method retrieves the balance history for an institution.
|
|
320
320
|
|
|
@@ -322,10 +322,10 @@ Returns data within the last 1 year by default.
|
|
|
322
322
|
|
|
323
323
|
```javascript
|
|
324
324
|
const history = await user.history.getList({
|
|
325
|
-
|
|
325
|
+
institutions: ['603522490d2b02001233a5d6'],
|
|
326
326
|
from: '2021-01-01',
|
|
327
327
|
to: '2021-09-09',
|
|
328
|
-
|
|
328
|
+
investments: ['bitcoin:cash:usd'],
|
|
329
329
|
});
|
|
330
330
|
```
|
|
331
331
|
|
|
@@ -342,13 +342,13 @@ Returns data within the last 1 year by default.
|
|
|
342
342
|
|
|
343
343
|
```javascript
|
|
344
344
|
const transactions = await user.transactions.getList({
|
|
345
|
-
|
|
346
|
-
ticker: 'BTC', // optional
|
|
345
|
+
institutions: ['603522490d2b02001233a5d6'],
|
|
347
346
|
from: '2020-08-31', // optional
|
|
348
347
|
to: '2021-08-31', // optional
|
|
349
|
-
investment: '
|
|
348
|
+
investment: 'wise:cash:usd', // optional
|
|
350
349
|
last: '603522490d2b02001233a5d6', // optional, blank string is allowed
|
|
351
350
|
limit: 10, // optional
|
|
351
|
+
institutionId: '603522490d2b02001233a5d6', // Deprecated, use institutions prop
|
|
352
352
|
});
|
|
353
353
|
```
|
|
354
354
|
|
|
@@ -357,13 +357,12 @@ todo: add response example
|
|
|
357
357
|
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
-
#### user.transactions.getOne({
|
|
360
|
+
#### user.transactions.getOne({ txId })
|
|
361
361
|
|
|
362
362
|
This method retrieves a single transaction.
|
|
363
363
|
|
|
364
364
|
```javascript
|
|
365
365
|
const transaction = await user.transactions.getOne({
|
|
366
|
-
institutionId: '603522490d2b02001233a5d6',
|
|
367
366
|
txId: '603522490d2b02001233a5d6'
|
|
368
367
|
});
|
|
369
368
|
```
|
|
@@ -373,6 +372,21 @@ todo: add response example
|
|
|
373
372
|
|
|
374
373
|
```
|
|
375
374
|
|
|
375
|
+
#### user.positions.getList({ institutions })
|
|
376
|
+
|
|
377
|
+
This method retrieves user positions.
|
|
378
|
+
|
|
379
|
+
```javascript
|
|
380
|
+
const positions = await user.positions.getList({
|
|
381
|
+
institutions: ['603522490d2b02001233a5d6']
|
|
382
|
+
});
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
todo: add response example
|
|
386
|
+
```json
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
|
|
376
390
|
### Data APIs
|
|
377
391
|
|
|
378
392
|
These methods provide general Wealthica information and do not require logging in a user.
|
package/dist/wealthica.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ interface APIUserInterface extends APIInterface {
|
|
|
41
41
|
institutions: InstitutionsInterface
|
|
42
42
|
history: HistoryInterface
|
|
43
43
|
transactions: TransactionsInterface
|
|
44
|
+
positions: PositionsInterface
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
interface InstitutionsInterface {
|
|
@@ -62,6 +63,11 @@ interface TransactionsInterface {
|
|
|
62
63
|
getOne(options: TransactionOptions): Promise<Transactions> | Promise<never>
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
interface PositionsInterface {
|
|
67
|
+
constructor(api: APIUserInterface)
|
|
68
|
+
getList(options: PositionsOptions): Promise<Position[]> | Promise<never>
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
type APIConfig = {
|
|
66
72
|
clientId: string;
|
|
67
73
|
secret?: string;
|
|
@@ -98,19 +104,41 @@ type ConnectData = {
|
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
type TransactionsOptions = {
|
|
101
|
-
|
|
107
|
+
institutions?: Array<string>;
|
|
108
|
+
investments?: Array<string>;
|
|
109
|
+
groups?: Array<string>;
|
|
102
110
|
from?: string;
|
|
103
111
|
to?: string;
|
|
104
|
-
|
|
112
|
+
assets?: boolean;
|
|
113
|
+
liabilities?: boolean;
|
|
114
|
+
banking?: boolean;
|
|
115
|
+
types?: Array<string>;
|
|
116
|
+
deleted?: Boolean;
|
|
117
|
+
invalid?: Boolean;
|
|
118
|
+
new?: Boolean;
|
|
119
|
+
peek?: Boolean;
|
|
120
|
+
missing?: Boolean;
|
|
105
121
|
last?: string;
|
|
106
122
|
limit?: number;
|
|
123
|
+
sort?: string;
|
|
124
|
+
security?: Boolean;
|
|
125
|
+
skip_date_filter?: Boolean;
|
|
126
|
+
institutionId?: string;
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
type TransactionOptions = {
|
|
110
|
-
institutionId: string;
|
|
111
130
|
txId: string;
|
|
112
131
|
}
|
|
113
132
|
|
|
133
|
+
type PositionsOptions = {
|
|
134
|
+
groups?: Array<string>;
|
|
135
|
+
institutions?: Array<string>;
|
|
136
|
+
investments?: Array<string>;
|
|
137
|
+
assets?: Boolean;
|
|
138
|
+
liabilities?: Boolean;
|
|
139
|
+
banking?: Boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
114
142
|
type Part = {
|
|
115
143
|
direction: string;
|
|
116
144
|
ticker: string;
|
|
@@ -145,10 +173,10 @@ type Transactions = {
|
|
|
145
173
|
}
|
|
146
174
|
|
|
147
175
|
type HistoryListOptions = {
|
|
148
|
-
|
|
176
|
+
institutions: string[];
|
|
149
177
|
from?: string;
|
|
150
178
|
to?: string;
|
|
151
|
-
investments?: string;
|
|
179
|
+
investments?: string[];
|
|
152
180
|
}
|
|
153
181
|
|
|
154
182
|
type BalanceHistory = {
|
|
@@ -204,3 +232,49 @@ type Institution = {
|
|
|
204
232
|
updated_at: number;
|
|
205
233
|
resource_type: string;
|
|
206
234
|
}
|
|
235
|
+
|
|
236
|
+
type Position = {
|
|
237
|
+
_id: string;
|
|
238
|
+
class: string;
|
|
239
|
+
classes: {
|
|
240
|
+
class: string;
|
|
241
|
+
weight: number;
|
|
242
|
+
};
|
|
243
|
+
category: string;
|
|
244
|
+
categories: Array<string>;
|
|
245
|
+
security: Security;
|
|
246
|
+
investments: Array<PositionInvestment>
|
|
247
|
+
quantity: number;
|
|
248
|
+
book_value: number;
|
|
249
|
+
market_value: number;
|
|
250
|
+
gain_amount: number;
|
|
251
|
+
gain_percent: number;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
type Security = {
|
|
255
|
+
_id: string;
|
|
256
|
+
currency: string;
|
|
257
|
+
symbol: string;
|
|
258
|
+
type: string;
|
|
259
|
+
name: string;
|
|
260
|
+
aliases: Array<string>;
|
|
261
|
+
last_price: number;
|
|
262
|
+
last_date: string;
|
|
263
|
+
high_price: number;
|
|
264
|
+
high_date: string;
|
|
265
|
+
low_price: number;
|
|
266
|
+
low_date: string;
|
|
267
|
+
cusip: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
type PositionInvestment = {
|
|
271
|
+
institution: string;
|
|
272
|
+
investment: string;
|
|
273
|
+
currency: string;
|
|
274
|
+
quantity: number;
|
|
275
|
+
book_value: number;
|
|
276
|
+
market_value: number;
|
|
277
|
+
value: number;
|
|
278
|
+
gain_amount: number;
|
|
279
|
+
gain_percent: number;
|
|
280
|
+
}
|
package/dist/wealthica.es5.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ interface APIUserInterface extends APIInterface {
|
|
|
41
41
|
institutions: InstitutionsInterface
|
|
42
42
|
history: HistoryInterface
|
|
43
43
|
transactions: TransactionsInterface
|
|
44
|
+
positions: PositionsInterface
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
interface InstitutionsInterface {
|
|
@@ -62,6 +63,11 @@ interface TransactionsInterface {
|
|
|
62
63
|
getOne(options: TransactionOptions): Promise<Transactions> | Promise<never>
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
interface PositionsInterface {
|
|
67
|
+
constructor(api: APIUserInterface)
|
|
68
|
+
getList(options: PositionsOptions): Promise<Position[]> | Promise<never>
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
type APIConfig = {
|
|
66
72
|
clientId: string;
|
|
67
73
|
secret?: string;
|
|
@@ -98,19 +104,41 @@ type ConnectData = {
|
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
type TransactionsOptions = {
|
|
101
|
-
|
|
107
|
+
institutions?: Array<string>;
|
|
108
|
+
investments?: Array<string>;
|
|
109
|
+
groups?: Array<string>;
|
|
102
110
|
from?: string;
|
|
103
111
|
to?: string;
|
|
104
|
-
|
|
112
|
+
assets?: boolean;
|
|
113
|
+
liabilities?: boolean;
|
|
114
|
+
banking?: boolean;
|
|
115
|
+
types?: Array<string>;
|
|
116
|
+
deleted?: Boolean;
|
|
117
|
+
invalid?: Boolean;
|
|
118
|
+
new?: Boolean;
|
|
119
|
+
peek?: Boolean;
|
|
120
|
+
missing?: Boolean;
|
|
105
121
|
last?: string;
|
|
106
122
|
limit?: number;
|
|
123
|
+
sort?: string;
|
|
124
|
+
security?: Boolean;
|
|
125
|
+
skip_date_filter?: Boolean;
|
|
126
|
+
institutionId?: string;
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
type TransactionOptions = {
|
|
110
|
-
institutionId: string;
|
|
111
130
|
txId: string;
|
|
112
131
|
}
|
|
113
132
|
|
|
133
|
+
type PositionsOptions = {
|
|
134
|
+
groups?: Array<string>;
|
|
135
|
+
institutions?: Array<string>;
|
|
136
|
+
investments?: Array<string>;
|
|
137
|
+
assets?: Boolean;
|
|
138
|
+
liabilities?: Boolean;
|
|
139
|
+
banking?: Boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
114
142
|
type Part = {
|
|
115
143
|
direction: string;
|
|
116
144
|
ticker: string;
|
|
@@ -145,10 +173,10 @@ type Transactions = {
|
|
|
145
173
|
}
|
|
146
174
|
|
|
147
175
|
type HistoryListOptions = {
|
|
148
|
-
|
|
176
|
+
institutions: string[];
|
|
149
177
|
from?: string;
|
|
150
178
|
to?: string;
|
|
151
|
-
investments?: string;
|
|
179
|
+
investments?: string[];
|
|
152
180
|
}
|
|
153
181
|
|
|
154
182
|
type BalanceHistory = {
|
|
@@ -204,3 +232,49 @@ type Institution = {
|
|
|
204
232
|
updated_at: number;
|
|
205
233
|
resource_type: string;
|
|
206
234
|
}
|
|
235
|
+
|
|
236
|
+
type Position = {
|
|
237
|
+
_id: string;
|
|
238
|
+
class: string;
|
|
239
|
+
classes: {
|
|
240
|
+
class: string;
|
|
241
|
+
weight: number;
|
|
242
|
+
};
|
|
243
|
+
category: string;
|
|
244
|
+
categories: Array<string>;
|
|
245
|
+
security: Security;
|
|
246
|
+
investments: Array<PositionInvestment>
|
|
247
|
+
quantity: number;
|
|
248
|
+
book_value: number;
|
|
249
|
+
market_value: number;
|
|
250
|
+
gain_amount: number;
|
|
251
|
+
gain_percent: number;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
type Security = {
|
|
255
|
+
_id: string;
|
|
256
|
+
currency: string;
|
|
257
|
+
symbol: string;
|
|
258
|
+
type: string;
|
|
259
|
+
name: string;
|
|
260
|
+
aliases: Array<string>;
|
|
261
|
+
last_price: number;
|
|
262
|
+
last_date: string;
|
|
263
|
+
high_price: number;
|
|
264
|
+
high_date: string;
|
|
265
|
+
low_price: number;
|
|
266
|
+
low_date: string;
|
|
267
|
+
cusip: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
type PositionInvestment = {
|
|
271
|
+
institution: string;
|
|
272
|
+
investment: string;
|
|
273
|
+
currency: string;
|
|
274
|
+
quantity: number;
|
|
275
|
+
book_value: number;
|
|
276
|
+
market_value: number;
|
|
277
|
+
value: number;
|
|
278
|
+
gain_amount: number;
|
|
279
|
+
gain_percent: number;
|
|
280
|
+
}
|
package/dist/wealthica.es5.js
CHANGED
|
@@ -6059,7 +6059,7 @@ var API = /*#__PURE__*/function () {
|
|
|
6059
6059
|
return _ref.apply(this, arguments);
|
|
6060
6060
|
};
|
|
6061
6061
|
}());
|
|
6062
|
-
var userResources = createResources(user, ['institutions', 'history', 'transactions']);
|
|
6062
|
+
var userResources = createResources(user, ['institutions', 'history', 'transactions', 'positions']);
|
|
6063
6063
|
Object.assign(user, userResources);
|
|
6064
6064
|
user.config.loginName = loginName;
|
|
6065
6065
|
return user;
|
|
@@ -6550,9 +6550,6 @@ module.exports = new Wealthica();
|
|
|
6550
6550
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6551
6551
|
|
|
6552
6552
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6553
|
-
var _excluded = ["institutionId"];
|
|
6554
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6555
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6556
6553
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6557
6554
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6558
6555
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -6572,8 +6569,6 @@ var History = /*#__PURE__*/function () {
|
|
|
6572
6569
|
value: function () {
|
|
6573
6570
|
var _getList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
6574
6571
|
var options,
|
|
6575
|
-
institutionId,
|
|
6576
|
-
params,
|
|
6577
6572
|
url,
|
|
6578
6573
|
query,
|
|
6579
6574
|
response,
|
|
@@ -6583,28 +6578,21 @@ var History = /*#__PURE__*/function () {
|
|
|
6583
6578
|
switch (_context.prev = _context.next) {
|
|
6584
6579
|
case 0:
|
|
6585
6580
|
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
_context.next = 4;
|
|
6589
|
-
break;
|
|
6590
|
-
}
|
|
6591
|
-
throw new Error('Please provide a valid Wealthica institution id.');
|
|
6592
|
-
case 4:
|
|
6593
|
-
url = "/institutions/".concat(institutionId, "/history");
|
|
6594
|
-
query = getQueryString(params);
|
|
6581
|
+
url = '/history';
|
|
6582
|
+
query = getQueryString(options);
|
|
6595
6583
|
if (query) url = "".concat(url, "?").concat(query);
|
|
6596
|
-
_context.next =
|
|
6584
|
+
_context.next = 6;
|
|
6597
6585
|
return this.api.get(url);
|
|
6598
|
-
case
|
|
6586
|
+
case 6:
|
|
6599
6587
|
response = _context.sent;
|
|
6600
6588
|
if (response.ok) {
|
|
6601
|
-
_context.next =
|
|
6589
|
+
_context.next = 9;
|
|
6602
6590
|
break;
|
|
6603
6591
|
}
|
|
6604
6592
|
throw response.originalError;
|
|
6605
|
-
case
|
|
6593
|
+
case 9:
|
|
6606
6594
|
return _context.abrupt("return", response.data);
|
|
6607
|
-
case
|
|
6595
|
+
case 10:
|
|
6608
6596
|
case "end":
|
|
6609
6597
|
return _context.stop();
|
|
6610
6598
|
}
|
|
@@ -6632,7 +6620,8 @@ var RESOURCES = {
|
|
|
6632
6620
|
history: __webpack_require__(55987),
|
|
6633
6621
|
providers: __webpack_require__(95269),
|
|
6634
6622
|
teams: __webpack_require__(67523),
|
|
6635
|
-
transactions: __webpack_require__(46123)
|
|
6623
|
+
transactions: __webpack_require__(46123),
|
|
6624
|
+
positions: __webpack_require__(87334)
|
|
6636
6625
|
};
|
|
6637
6626
|
module.exports = function createResources(api, resources) {
|
|
6638
6627
|
return resources.reduce(function (res, resource) {
|
|
@@ -6828,6 +6817,71 @@ module.exports = Institutions;
|
|
|
6828
6817
|
|
|
6829
6818
|
/***/ }),
|
|
6830
6819
|
|
|
6820
|
+
/***/ 87334:
|
|
6821
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6822
|
+
|
|
6823
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6824
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6825
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6826
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6827
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6828
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6829
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6830
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6831
|
+
var _require = __webpack_require__(9853),
|
|
6832
|
+
getQueryString = _require.getQueryString;
|
|
6833
|
+
var Positions = /*#__PURE__*/function () {
|
|
6834
|
+
function Positions(api) {
|
|
6835
|
+
_classCallCheck(this, Positions);
|
|
6836
|
+
this.api = api.userApi;
|
|
6837
|
+
}
|
|
6838
|
+
_createClass(Positions, [{
|
|
6839
|
+
key: "getList",
|
|
6840
|
+
value: function () {
|
|
6841
|
+
var _getList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
6842
|
+
var options,
|
|
6843
|
+
url,
|
|
6844
|
+
query,
|
|
6845
|
+
response,
|
|
6846
|
+
_args = arguments;
|
|
6847
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6848
|
+
while (1) {
|
|
6849
|
+
switch (_context.prev = _context.next) {
|
|
6850
|
+
case 0:
|
|
6851
|
+
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
6852
|
+
url = '/positions';
|
|
6853
|
+
query = getQueryString(options);
|
|
6854
|
+
if (query) url = "".concat(url, "?").concat(query);
|
|
6855
|
+
_context.next = 6;
|
|
6856
|
+
return this.api.get(url);
|
|
6857
|
+
case 6:
|
|
6858
|
+
response = _context.sent;
|
|
6859
|
+
if (response.ok) {
|
|
6860
|
+
_context.next = 9;
|
|
6861
|
+
break;
|
|
6862
|
+
}
|
|
6863
|
+
throw response.originalError;
|
|
6864
|
+
case 9:
|
|
6865
|
+
return _context.abrupt("return", response.data);
|
|
6866
|
+
case 10:
|
|
6867
|
+
case "end":
|
|
6868
|
+
return _context.stop();
|
|
6869
|
+
}
|
|
6870
|
+
}
|
|
6871
|
+
}, _callee, this);
|
|
6872
|
+
}));
|
|
6873
|
+
function getList() {
|
|
6874
|
+
return _getList.apply(this, arguments);
|
|
6875
|
+
}
|
|
6876
|
+
return getList;
|
|
6877
|
+
}()
|
|
6878
|
+
}]);
|
|
6879
|
+
return Positions;
|
|
6880
|
+
}();
|
|
6881
|
+
module.exports = Positions;
|
|
6882
|
+
|
|
6883
|
+
/***/ }),
|
|
6884
|
+
|
|
6831
6885
|
/***/ 95269:
|
|
6832
6886
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6833
6887
|
|
|
@@ -6996,10 +7050,12 @@ module.exports = Teams;
|
|
|
6996
7050
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6997
7051
|
|
|
6998
7052
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6999
|
-
var _excluded = ["
|
|
7000
|
-
_excluded2 = ["institutionId", "txId"];
|
|
7053
|
+
var _excluded = ["txId"];
|
|
7001
7054
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7002
7055
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7056
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7057
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7058
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7003
7059
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
7004
7060
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7005
7061
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -7019,9 +7075,8 @@ var Transactions = /*#__PURE__*/function () {
|
|
|
7019
7075
|
value: function () {
|
|
7020
7076
|
var _getList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
7021
7077
|
var options,
|
|
7022
|
-
institutionId,
|
|
7023
|
-
params,
|
|
7024
7078
|
url,
|
|
7079
|
+
institutions,
|
|
7025
7080
|
query,
|
|
7026
7081
|
response,
|
|
7027
7082
|
_args = arguments;
|
|
@@ -7030,15 +7085,17 @@ var Transactions = /*#__PURE__*/function () {
|
|
|
7030
7085
|
switch (_context.prev = _context.next) {
|
|
7031
7086
|
case 0:
|
|
7032
7087
|
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7088
|
+
url = '/transactions';
|
|
7089
|
+
institutions = options.institutions || []; // Add institutionId for backward compatibility
|
|
7090
|
+
if (options.institutionId && !institutions.includes(options.institutionId)) {
|
|
7091
|
+
institutions.push(options.institutionId);
|
|
7037
7092
|
}
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
query = getQueryString(
|
|
7093
|
+
|
|
7094
|
+
// eslint-disable-next-line no-param-reassign
|
|
7095
|
+
delete options.institutionId;
|
|
7096
|
+
query = getQueryString(_objectSpread(_objectSpread({}, options), {}, {
|
|
7097
|
+
institutions: institutions
|
|
7098
|
+
}));
|
|
7042
7099
|
if (query) url = "".concat(url, "?").concat(query);
|
|
7043
7100
|
_context.next = 9;
|
|
7044
7101
|
return this.api.get(url);
|
|
@@ -7068,7 +7125,6 @@ var Transactions = /*#__PURE__*/function () {
|
|
|
7068
7125
|
value: function () {
|
|
7069
7126
|
var _getOne = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
7070
7127
|
var options,
|
|
7071
|
-
institutionId,
|
|
7072
7128
|
txId,
|
|
7073
7129
|
params,
|
|
7074
7130
|
url,
|
|
@@ -7080,34 +7136,28 @@ var Transactions = /*#__PURE__*/function () {
|
|
|
7080
7136
|
switch (_context2.prev = _context2.next) {
|
|
7081
7137
|
case 0:
|
|
7082
7138
|
options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
7083
|
-
|
|
7084
|
-
if (!(!institutionId || typeof institutionId !== 'string')) {
|
|
7085
|
-
_context2.next = 4;
|
|
7086
|
-
break;
|
|
7087
|
-
}
|
|
7088
|
-
throw new Error('Please provide a valid Wealthica institution id.');
|
|
7089
|
-
case 4:
|
|
7139
|
+
txId = options.txId, params = _objectWithoutProperties(options, _excluded);
|
|
7090
7140
|
if (!(!txId || typeof txId !== 'string')) {
|
|
7091
|
-
_context2.next =
|
|
7141
|
+
_context2.next = 4;
|
|
7092
7142
|
break;
|
|
7093
7143
|
}
|
|
7094
7144
|
throw new Error('Please provide a valid Wealthica transaction id.');
|
|
7095
|
-
case
|
|
7145
|
+
case 4:
|
|
7096
7146
|
url = "/transactions/".concat(txId);
|
|
7097
7147
|
query = getQueryString(params);
|
|
7098
7148
|
if (query) url = "".concat(url, "?").concat(query);
|
|
7099
|
-
_context2.next =
|
|
7149
|
+
_context2.next = 9;
|
|
7100
7150
|
return this.api.get(url);
|
|
7101
|
-
case
|
|
7151
|
+
case 9:
|
|
7102
7152
|
response = _context2.sent;
|
|
7103
7153
|
if (response.ok) {
|
|
7104
|
-
_context2.next =
|
|
7154
|
+
_context2.next = 12;
|
|
7105
7155
|
break;
|
|
7106
7156
|
}
|
|
7107
7157
|
throw response.originalError;
|
|
7108
|
-
case
|
|
7158
|
+
case 12:
|
|
7109
7159
|
return _context2.abrupt("return", response.data);
|
|
7110
|
-
case
|
|
7160
|
+
case 13:
|
|
7111
7161
|
case "end":
|
|
7112
7162
|
return _context2.stop();
|
|
7113
7163
|
}
|