wealthica-sdk-js 0.0.4 → 0.0.6

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/CHANGELOG.md CHANGED
@@ -4,5 +4,9 @@ All notable changes to the Wealthica Connect SDK across versions will be documen
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## v0.0.6
8
+ - React Native Example
7
9
 
8
- [Unreleased]: https://github.com/wealthica/wealthica-sdk-js/compare/v0.0.1...HEAD
10
+
11
+ [Unreleased]: https://github.com/wealthica/wealthica-sdk-js/compare/v0.0.6...HEAD
12
+ [Unreleased]: https://github.com/wealthica/wealthica-sdk-js/compare/v0.0.6...v0.0.5
package/README.md CHANGED
@@ -433,5 +433,5 @@ yarn test
433
433
  npm version patch # or minor/major
434
434
  git push && git push --tags
435
435
  # wait until merged then
436
- npm publish
436
+
437
437
  ```
@@ -9,7 +9,7 @@ declare var Wealthica: {
9
9
  interface APIInterface {
10
10
  constructor(config: APIConfig)
11
11
  __init(): APIInterface
12
- login(loginName: string): APIUserInterface
12
+ login(loginName?: string): APIUserInterface
13
13
  getToken(options: TokenOptions): Promise<string>
14
14
  fetchToken(): Promise<string>
15
15
  authApi: ApisauceInstance
@@ -64,16 +64,17 @@ interface TransactionsInterface {
64
64
 
65
65
  type APIConfig = {
66
66
  clientId: string;
67
- secret: string;
67
+ secret?: string;
68
68
  baseURL?: string;
69
69
  connectURL?: string;
70
70
  redirectURI?: string;
71
71
  loginName?: string | null;
72
- authEndpoint?: string
72
+ authEndpoint?: string;
73
73
  auth?: {
74
74
  headers?: object;
75
75
  params?: object;
76
- }
76
+ },
77
+ authorizer?(callback: Function): void | Promise<void>;
77
78
  }
78
79
 
79
80
  type TokenOptions = {
@@ -9,7 +9,7 @@ declare var Wealthica: {
9
9
  interface APIInterface {
10
10
  constructor(config: APIConfig)
11
11
  __init(): APIInterface
12
- login(loginName: string): APIUserInterface
12
+ login(loginName?: string): APIUserInterface
13
13
  getToken(options: TokenOptions): Promise<string>
14
14
  fetchToken(): Promise<string>
15
15
  authApi: ApisauceInstance
@@ -64,16 +64,17 @@ interface TransactionsInterface {
64
64
 
65
65
  type APIConfig = {
66
66
  clientId: string;
67
- secret: string;
67
+ secret?: string;
68
68
  baseURL?: string;
69
69
  connectURL?: string;
70
70
  redirectURI?: string;
71
71
  loginName?: string | null;
72
- authEndpoint?: string
72
+ authEndpoint?: string;
73
73
  auth?: {
74
74
  headers?: object;
75
75
  params?: object;
76
- }
76
+ },
77
+ authorizer?(callback: Function): void | Promise<void>;
77
78
  }
78
79
 
79
80
  type TokenOptions = {
@@ -5982,10 +5982,10 @@ var API = /*#__PURE__*/function () {
5982
5982
  if (!clientId || typeof clientId !== 'string') {
5983
5983
  throw new Error('Please provide a valid Wealthica clientId.');
5984
5984
  }
5985
- if (this.isNode && (!secret || typeof secret !== 'string')) {
5985
+ if (!this.isClient && (!secret || typeof secret !== 'string')) {
5986
5986
  throw new Error('Please provide a valid Wealthica secret.');
5987
5987
  }
5988
- if (this.isBrowser) {
5988
+ if (this.isClient) {
5989
5989
  var auth = config.auth || {};
5990
5990
  this.config.authEndpoint = this.config.authEndpoint || '/wealthica/auth';
5991
5991
  this.config.auth = {
@@ -6020,7 +6020,7 @@ var API = /*#__PURE__*/function () {
6020
6020
  }, {
6021
6021
  key: "login",
6022
6022
  value: function login(loginName) {
6023
- if (this.isNode && (!loginName || typeof loginName !== 'string')) {
6023
+ if (!this.isClient && (!loginName || typeof loginName !== 'string')) {
6024
6024
  throw new Error('Please provide a valid loginName.');
6025
6025
  }
6026
6026
  var baseURL = this.config.baseURL;
@@ -6821,6 +6821,9 @@ module.exports = Institutions;
6821
6821
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6822
6822
 
6823
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 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; }
6825
+ 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; }
6826
+ 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; }
6824
6827
  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
6828
  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
6829
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -6850,7 +6853,9 @@ var Providers = /*#__PURE__*/function () {
6850
6853
  case 0:
6851
6854
  options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
6852
6855
  url = '/providers';
6853
- query = getQueryString(options);
6856
+ query = getQueryString(_objectSpread(_objectSpread({}, options), {}, {
6857
+ format: 'array'
6858
+ }));
6854
6859
  if (query) url = "".concat(url, "?").concat(query);
6855
6860
  _context.next = 6;
6856
6861
  return this.api.get(url);
package/dist/wealthica.js CHANGED
@@ -5972,10 +5972,10 @@ var API = /*#__PURE__*/function () {
5972
5972
  if (!clientId || typeof clientId !== 'string') {
5973
5973
  throw new Error('Please provide a valid Wealthica clientId.');
5974
5974
  }
5975
- if (this.isNode && (!secret || typeof secret !== 'string')) {
5975
+ if (!this.isClient && (!secret || typeof secret !== 'string')) {
5976
5976
  throw new Error('Please provide a valid Wealthica secret.');
5977
5977
  }
5978
- if (this.isBrowser) {
5978
+ if (this.isClient) {
5979
5979
  var auth = config.auth || {};
5980
5980
  this.config.authEndpoint = this.config.authEndpoint || '/wealthica/auth';
5981
5981
  this.config.auth = {
@@ -6010,7 +6010,7 @@ var API = /*#__PURE__*/function () {
6010
6010
  }, {
6011
6011
  key: "login",
6012
6012
  value: function login(loginName) {
6013
- if (this.isNode && (!loginName || typeof loginName !== 'string')) {
6013
+ if (!this.isClient && (!loginName || typeof loginName !== 'string')) {
6014
6014
  throw new Error('Please provide a valid loginName.');
6015
6015
  }
6016
6016
  var baseURL = this.config.baseURL;
@@ -6811,6 +6811,9 @@ module.exports = Institutions;
6811
6811
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6812
6812
 
6813
6813
  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); }
6814
+ 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; }
6815
+ 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; }
6816
+ 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; }
6814
6817
  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); } }
6815
6818
  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); }); }; }
6816
6819
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -6840,7 +6843,9 @@ var Providers = /*#__PURE__*/function () {
6840
6843
  case 0:
6841
6844
  options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
6842
6845
  url = '/providers';
6843
- query = getQueryString(options);
6846
+ query = getQueryString(_objectSpread(_objectSpread({}, options), {}, {
6847
+ format: 'array'
6848
+ }));
6844
6849
  if (query) url = "".concat(url, "?").concat(query);
6845
6850
  _context.next = 6;
6846
6851
  return this.api.get(url);
@@ -9,7 +9,7 @@ declare var Wealthica: {
9
9
  interface APIInterface {
10
10
  constructor(config: APIConfig)
11
11
  __init(): APIInterface
12
- login(loginName: string): APIUserInterface
12
+ login(loginName?: string): APIUserInterface
13
13
  getToken(options: TokenOptions): Promise<string>
14
14
  fetchToken(): Promise<string>
15
15
  authApi: ApisauceInstance
@@ -64,16 +64,17 @@ interface TransactionsInterface {
64
64
 
65
65
  type APIConfig = {
66
66
  clientId: string;
67
- secret: string;
67
+ secret?: string;
68
68
  baseURL?: string;
69
69
  connectURL?: string;
70
70
  redirectURI?: string;
71
71
  loginName?: string | null;
72
- authEndpoint?: string
72
+ authEndpoint?: string;
73
73
  auth?: {
74
74
  headers?: object;
75
75
  params?: object;
76
- }
76
+ },
77
+ authorizer?(callback: Function): void | Promise<void>;
77
78
  }
78
79
 
79
80
  type TokenOptions = {