wealthica-sdk-js 0.0.8 → 0.0.10

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 CHANGED
@@ -188,6 +188,7 @@ const { url, token } = await user.getConnectData({
188
188
  state: 'YOUR_APP_STATE', // optional
189
189
  lang: 'en', // optional (en | es | fr | it), 'en' by default
190
190
  providers: ['wise', 'stockchase'], // optional, ignored if `provider` is also passed in.
191
+ providerGroups: ['core', 'thirdparty'], // optional, ['core'] by default
191
192
  theme: 'light', // optional (light | dark), 'light' by default
192
193
  providersPerLine: 1, // optional (1 | 2), 2 by default
193
194
  features: 'feature1,feature2', // optional, a comma-separated list of features. undefined by default
@@ -16,8 +16,8 @@ interface APIInterface {
16
16
  api: ApisauceInstance
17
17
  getTeam(): string;
18
18
  getConnectData(options: ConnectDataOptions): Promise<ConnectData>
19
- connect(options?: APIConfig): APIInterface
20
- reconnect(institutionId: string): APIUserInterface
19
+ connect(options?: ConnectDataOptions): APIInterface
20
+ reconnect(institutionId: string, options: ConnectDataOptions): APIUserInterface
21
21
  onConnection(callback: Function): APIInterface
22
22
  onError(callback: Function): APIInterface
23
23
  onEvent(callback: Function): APIInterface
@@ -89,6 +89,7 @@ type ConnectDataOptions = {
89
89
  lang: string;
90
90
  redirectURI: string;
91
91
  providers: Array<string> | undefined;
92
+ providerGroups: Array<string> | undefined;
92
93
  }
93
94
 
94
95
  type ConnectData = {
@@ -16,8 +16,8 @@ interface APIInterface {
16
16
  api: ApisauceInstance
17
17
  getTeam(): string;
18
18
  getConnectData(options: ConnectDataOptions): Promise<ConnectData>
19
- connect(options?: APIConfig): APIInterface
20
- reconnect(institutionId: string): APIUserInterface
19
+ connect(options?: ConnectDataOptions): APIInterface
20
+ reconnect(institutionId: string, options: ConnectDataOptions): APIUserInterface
21
21
  onConnection(callback: Function): APIInterface
22
22
  onError(callback: Function): APIInterface
23
23
  onEvent(callback: Function): APIInterface
@@ -89,6 +89,7 @@ type ConnectDataOptions = {
89
89
  lang: string;
90
90
  redirectURI: string;
91
91
  providers: Array<string> | undefined;
92
+ providerGroups: Array<string> | undefined;
92
93
  }
93
94
 
94
95
  type ConnectData = {
@@ -6203,6 +6203,8 @@ var API = /*#__PURE__*/function () {
6203
6203
  _options$redirectURI,
6204
6204
  redirectURI,
6205
6205
  providers,
6206
+ _options$providerGrou,
6207
+ providerGroups,
6206
6208
  theme,
6207
6209
  providersPerLine,
6208
6210
  features,
@@ -6219,7 +6221,7 @@ var API = /*#__PURE__*/function () {
6219
6221
  switch (_context4.prev = _context4.next) {
6220
6222
  case 0:
6221
6223
  options = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
6222
- provider = options.provider, institutionId = options.institutionId, state = options.state, _options$origin = options.origin, origin = _options$origin === void 0 ? this.isBrowser ? window.location.origin : undefined : _options$origin, lang = options.lang, _options$redirectURI = options.redirectURI, redirectURI = _options$redirectURI === void 0 ? this.config.redirectURI : _options$redirectURI, providers = options.providers, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features;
6224
+ provider = options.provider, institutionId = options.institutionId, state = options.state, _options$origin = options.origin, origin = _options$origin === void 0 ? this.isBrowser ? window.location.origin : undefined : _options$origin, lang = options.lang, _options$redirectURI = options.redirectURI, redirectURI = _options$redirectURI === void 0 ? this.config.redirectURI : _options$redirectURI, providers = options.providers, _options$providerGrou = options.providerGroups, providerGroups = _options$providerGrou === void 0 ? ['core'] : _options$providerGrou, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features;
6223
6225
  _this$config5 = this.config, clientId = _this$config5.clientId, connectURL = _this$config5.connectURL; // Get a token with at least 10 minutes left
6224
6226
  _context4.next = 5;
6225
6227
  return this.getToken({
@@ -6235,6 +6237,7 @@ var API = /*#__PURE__*/function () {
6235
6237
  origin: origin,
6236
6238
  // 'provider' param in priority, skip 'providers' param if 'provider' is set
6237
6239
  providers: !provider && Array.isArray(providers) && providers.length ? providers.join(',') : undefined,
6240
+ provider_groups: providerGroups.join(','),
6238
6241
  theme: ['light', 'dark'].includes(theme) ? theme : 'light',
6239
6242
  providers_per_line: providersPerLine && ['1', '2'].includes(providersPerLine.toString()) ? providersPerLine.toString() : '2',
6240
6243
  features: features
@@ -6310,18 +6313,19 @@ var API = /*#__PURE__*/function () {
6310
6313
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6311
6314
  if (!this.isBrowser) throw new Error('Only supported in Browser.');
6312
6315
  _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
6313
- var provider, providers, institutionId, lang, theme, providersPerLine, features, connectionType, _yield$_this$getConne, url, token;
6316
+ var provider, providers, providerGroups, institutionId, lang, theme, providersPerLine, features, connectionType, _yield$_this$getConne, url, token;
6314
6317
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
6315
6318
  while (1) {
6316
6319
  switch (_context5.prev = _context5.next) {
6317
6320
  case 0:
6318
6321
  _context5.prev = 0;
6319
6322
  _this._widgetOpened = true;
6320
- provider = options.provider, providers = options.providers, institutionId = options.institutionId, lang = options.lang, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features, connectionType = options.connectionType;
6323
+ provider = options.provider, providers = options.providers, providerGroups = options.providerGroups, institutionId = options.institutionId, lang = options.lang, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features, connectionType = options.connectionType;
6321
6324
  _context5.next = 5;
6322
6325
  return _this.getConnectData({
6323
6326
  provider: provider,
6324
6327
  providers: providers,
6328
+ providerGroups: providerGroups,
6325
6329
  institutionId: institutionId,
6326
6330
  lang: lang,
6327
6331
  theme: theme,
package/dist/wealthica.js CHANGED
@@ -6193,6 +6193,8 @@ var API = /*#__PURE__*/function () {
6193
6193
  _options$redirectURI,
6194
6194
  redirectURI,
6195
6195
  providers,
6196
+ _options$providerGrou,
6197
+ providerGroups,
6196
6198
  theme,
6197
6199
  providersPerLine,
6198
6200
  features,
@@ -6209,7 +6211,7 @@ var API = /*#__PURE__*/function () {
6209
6211
  switch (_context4.prev = _context4.next) {
6210
6212
  case 0:
6211
6213
  options = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
6212
- provider = options.provider, institutionId = options.institutionId, state = options.state, _options$origin = options.origin, origin = _options$origin === void 0 ? this.isBrowser ? window.location.origin : undefined : _options$origin, lang = options.lang, _options$redirectURI = options.redirectURI, redirectURI = _options$redirectURI === void 0 ? this.config.redirectURI : _options$redirectURI, providers = options.providers, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features;
6214
+ provider = options.provider, institutionId = options.institutionId, state = options.state, _options$origin = options.origin, origin = _options$origin === void 0 ? this.isBrowser ? window.location.origin : undefined : _options$origin, lang = options.lang, _options$redirectURI = options.redirectURI, redirectURI = _options$redirectURI === void 0 ? this.config.redirectURI : _options$redirectURI, providers = options.providers, _options$providerGrou = options.providerGroups, providerGroups = _options$providerGrou === void 0 ? ['core'] : _options$providerGrou, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features;
6213
6215
  _this$config5 = this.config, clientId = _this$config5.clientId, connectURL = _this$config5.connectURL; // Get a token with at least 10 minutes left
6214
6216
  _context4.next = 5;
6215
6217
  return this.getToken({
@@ -6225,6 +6227,7 @@ var API = /*#__PURE__*/function () {
6225
6227
  origin: origin,
6226
6228
  // 'provider' param in priority, skip 'providers' param if 'provider' is set
6227
6229
  providers: !provider && Array.isArray(providers) && providers.length ? providers.join(',') : undefined,
6230
+ provider_groups: providerGroups.join(','),
6228
6231
  theme: ['light', 'dark'].includes(theme) ? theme : 'light',
6229
6232
  providers_per_line: providersPerLine && ['1', '2'].includes(providersPerLine.toString()) ? providersPerLine.toString() : '2',
6230
6233
  features: features
@@ -6300,18 +6303,19 @@ var API = /*#__PURE__*/function () {
6300
6303
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6301
6304
  if (!this.isBrowser) throw new Error('Only supported in Browser.');
6302
6305
  _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
6303
- var provider, providers, institutionId, lang, theme, providersPerLine, features, connectionType, _yield$_this$getConne, url, token;
6306
+ var provider, providers, providerGroups, institutionId, lang, theme, providersPerLine, features, connectionType, _yield$_this$getConne, url, token;
6304
6307
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
6305
6308
  while (1) {
6306
6309
  switch (_context5.prev = _context5.next) {
6307
6310
  case 0:
6308
6311
  _context5.prev = 0;
6309
6312
  _this._widgetOpened = true;
6310
- provider = options.provider, providers = options.providers, institutionId = options.institutionId, lang = options.lang, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features, connectionType = options.connectionType;
6313
+ provider = options.provider, providers = options.providers, providerGroups = options.providerGroups, institutionId = options.institutionId, lang = options.lang, theme = options.theme, providersPerLine = options.providersPerLine, features = options.features, connectionType = options.connectionType;
6311
6314
  _context5.next = 5;
6312
6315
  return _this.getConnectData({
6313
6316
  provider: provider,
6314
6317
  providers: providers,
6318
+ providerGroups: providerGroups,
6315
6319
  institutionId: institutionId,
6316
6320
  lang: lang,
6317
6321
  theme: theme,
@@ -16,8 +16,8 @@ interface APIInterface {
16
16
  api: ApisauceInstance
17
17
  getTeam(): string;
18
18
  getConnectData(options: ConnectDataOptions): Promise<ConnectData>
19
- connect(options?: APIConfig): APIInterface
20
- reconnect(institutionId: string): APIUserInterface
19
+ connect(options?: ConnectDataOptions): APIInterface
20
+ reconnect(institutionId: string, options: ConnectDataOptions): APIUserInterface
21
21
  onConnection(callback: Function): APIInterface
22
22
  onError(callback: Function): APIInterface
23
23
  onEvent(callback: Function): APIInterface
@@ -89,6 +89,7 @@ type ConnectDataOptions = {
89
89
  lang: string;
90
90
  redirectURI: string;
91
91
  providers: Array<string> | undefined;
92
+ providerGroups: Array<string> | undefined;
92
93
  }
93
94
 
94
95
  type ConnectData = {