wealthica-sdk-js 0.0.5 → 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;
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;
@@ -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 = {