@moneytree/mt-link-javascript-sdk 3.2.0 → 4.0.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/dist/typings.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const supportedAuthAction: readonly ["login", "signup"];
2
- export declare type AuthAction = typeof supportedAuthAction[number];
2
+ export type AuthAction = typeof supportedAuthAction[number];
3
3
  export interface PrivateParams {
4
4
  cobrandClientId?: string;
5
5
  samlSubjectId?: string;
@@ -9,7 +9,7 @@ export interface PrivateConfigsOptions {
9
9
  sdkVersion?: string;
10
10
  }
11
11
  export declare const supportedAuthnMethod: readonly ["passwordless", "sso", "credentials"];
12
- export declare type AuthnMethod = typeof supportedAuthnMethod[number];
12
+ export type AuthnMethod = typeof supportedAuthnMethod[number];
13
13
  export interface ConfigsOptions extends PrivateConfigsOptions {
14
14
  email?: string;
15
15
  backTo?: string;
@@ -20,52 +20,57 @@ export interface ConfigsOptions extends PrivateConfigsOptions {
20
20
  forceLogout?: boolean;
21
21
  authnMethod?: AuthnMethod;
22
22
  }
23
- export declare type ServicesListType = {
23
+ export type ConfigsOptionsWithoutIsNewTab = Omit<ConfigsOptions, 'isNewTab'>;
24
+ export type VaultViewServiceList = {
24
25
  view: 'services-list';
25
26
  group?: 'grouping_bank' | 'grouping_bank_credit_card' | 'grouping_bank_dc_card' | 'grouping_corporate_credit_card' | 'grouping_credit_card' | 'grouping_credit_coop' | 'grouping_credit_union' | 'grouping_dc_pension_plan' | 'grouping_debit_card' | 'grouping_digital_money' | 'grouping_ja_bank' | 'grouping_life_insurance' | 'grouping_point' | 'grouping_regional_bank' | 'grouping_stock' | 'grouping_testing';
26
27
  type?: 'bank' | 'credit_card' | 'stored_value' | 'point' | 'corporate';
27
28
  search?: string;
28
29
  };
29
- export declare type ServiceConnectionType = {
30
+ export type VaultViewServiceConnection = {
30
31
  view: 'service-connection';
31
32
  entityKey: string;
32
33
  };
33
- export declare type ConnectionSettingType = {
34
+ export type VaultViewConnectionSetting = {
34
35
  view: 'connection-setting';
35
36
  credentialId: string;
36
37
  };
37
- export declare type CustomerSupportType = {
38
+ export type VaultViewCustomerSupport = {
38
39
  view: 'customer-support';
39
40
  };
40
- export declare type VaultOpenServiceOptions = ConfigsOptions & (ServicesListType | ServiceConnectionType | ConnectionSettingType | CustomerSupportType);
41
- export declare type MyAccountOpenServiceOptions = ConfigsOptions & {
41
+ export type VaultServiceTypes = VaultViewServiceList | VaultViewServiceConnection | VaultViewConnectionSetting | VaultViewCustomerSupport;
42
+ export type MyAccountServiceTypes = {
42
43
  view: LoginLinkTo;
43
44
  };
44
- export declare type LinkKitOpenServiceOptions = ConfigsOptions;
45
- export declare type OpenServiceOptions = VaultOpenServiceOptions | MyAccountOpenServiceOptions | LinkKitOpenServiceOptions;
46
- declare type ConfigsOptionsWithoutIsNewTab = Omit<ConfigsOptions, 'isNewTab'>;
47
- export declare type VaultOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab & (ServicesListType | ServiceConnectionType | ConnectionSettingType | CustomerSupportType);
48
- export declare type MyAccountOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab & {
49
- view: LoginLinkTo;
50
- };
51
- export declare type LinkKitOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab;
52
- export declare type OpenServiceUrlOptions = VaultOpenServiceUrlOptions | MyAccountOpenServiceUrlOptions | LinkKitOpenServiceUrlOptions;
53
- export declare type Scopes = string | string[];
45
+ export type MyAccountOpenServiceOptions = ConfigsOptions | (ConfigsOptions & MyAccountServiceTypes);
46
+ export type MyAccountOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab | (ConfigsOptionsWithoutIsNewTab & MyAccountServiceTypes);
47
+ export type VaultOpenServiceViewServiceList = ConfigsOptions & VaultViewServiceList;
48
+ export type VaultOpenServiceViewServiceConnection = ConfigsOptions & VaultViewServiceConnection;
49
+ export type VaultOpenServiceViewConnectionSetting = ConfigsOptions & VaultViewConnectionSetting;
50
+ export type VaultOpenServiceViewCustomerSupport = ConfigsOptions & VaultViewCustomerSupport;
51
+ export type VaultOpenServiceUrlViewServiceList = ConfigsOptionsWithoutIsNewTab & VaultViewServiceList;
52
+ export type VaultOpenServiceUrlViewServiceConnection = ConfigsOptionsWithoutIsNewTab & VaultViewServiceConnection;
53
+ export type VaultOpenServiceUrlViewConnectionSetting = ConfigsOptionsWithoutIsNewTab & VaultViewConnectionSetting;
54
+ export type VaultOpenServiceUrlViewCustomerSupport = ConfigsOptionsWithoutIsNewTab & VaultViewCustomerSupport;
55
+ export type LinkKitOpenServiceOptions = ConfigsOptions;
56
+ export type LinkKitOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab;
57
+ export type OpenServiceOptions = MyAccountOpenServiceOptions | ConfigsOptions | VaultOpenServiceViewServiceList | VaultOpenServiceViewConnectionSetting | VaultOpenServiceViewCustomerSupport | LinkKitOpenServiceOptions;
58
+ export type OpenServiceUrlOptions = MyAccountOpenServiceUrlOptions | ConfigsOptionsWithoutIsNewTab | VaultOpenServiceUrlViewServiceList | VaultOpenServiceUrlViewConnectionSetting | VaultOpenServiceUrlViewCustomerSupport | LinkKitOpenServiceUrlOptions;
59
+ export type Scopes = string | string[];
54
60
  interface AuthorizeConfigsOptions {
55
61
  forceLogout?: boolean;
56
62
  }
57
- interface OAuthSharedParams {
63
+ export interface OAuthSharedParams {
58
64
  state?: string;
59
65
  redirectUri?: string;
60
66
  }
61
67
  export interface AuthorizeOptions extends OAuthSharedParams, ConfigsOptions, AuthorizeConfigsOptions {
62
68
  scopes?: Scopes;
63
69
  codeChallenge?: string;
64
- pkce?: boolean;
65
70
  }
66
- export declare type AuthorizeUrlOptions = Omit<AuthorizeOptions, 'isNewTab'>;
67
- export declare type Mode = 'production' | 'staging' | 'develop' | 'local';
68
- export declare type InitOptions = Omit<Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'codeChallenge'>, 'pkce'> & PrivateParams & {
71
+ export type AuthorizeUrlOptions = Omit<AuthorizeOptions, 'isNewTab'>;
72
+ export type Mode = 'production' | 'staging' | 'develop' | 'local';
73
+ export type InitOptions = Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'codeChallenge'> & PrivateParams & {
69
74
  mode?: Mode;
70
75
  locale?: string;
71
76
  };
@@ -77,12 +82,12 @@ export interface ExchangeTokenOptions extends OAuthSharedParams {
77
82
  code?: string;
78
83
  codeVerifier?: string;
79
84
  }
80
- export declare type LogoutOptions = ConfigsOptions;
81
- export declare type LogoutUrlOptions = Omit<ConfigsOptions, 'isNewTab'>;
82
- export declare type OnboardOptions = Omit<Omit<Omit<Omit<AuthorizeOptions, 'showAuthToggle'>, 'forceLogout'>, 'showRememberMe'>, 'authAction'>;
83
- export declare type OnboardUrlOptions = Omit<OnboardOptions, 'isNewTab'>;
84
- export declare type ServiceId = 'vault' | 'myaccount' | 'link-kit';
85
- export declare type LoginLinkTo = 'settings' | 'settings/authorized-applications' | 'settings/change-language' | 'settings/email-preferences' | 'settings/delete-account' | 'settings/update-email' | 'settings/update-password';
85
+ export type LogoutOptions = ConfigsOptions;
86
+ export type LogoutUrlOptions = Omit<ConfigsOptions, 'isNewTab'>;
87
+ export type OnboardOptions = Omit<Omit<Omit<Omit<AuthorizeOptions, 'showAuthToggle'>, 'forceLogout'>, 'showRememberMe'>, 'authAction'>;
88
+ export type OnboardUrlOptions = Omit<OnboardOptions, 'isNewTab'>;
89
+ export type ServiceId = 'vault' | 'myaccount' | 'link-kit';
90
+ export type LoginLinkTo = 'settings' | 'settings/authorized-applications' | 'settings/change-language' | 'settings/email-preferences' | 'settings/delete-account' | 'settings/update-email' | 'settings/update-password';
86
91
  export interface RequestLoginLinkOptions extends ConfigsOptions {
87
92
  loginLinkTo?: LoginLinkTo;
88
93
  }
@@ -105,4 +110,13 @@ export interface TokenInfo {
105
110
  lang: string;
106
111
  };
107
112
  }
113
+ export interface Token {
114
+ access_token: string;
115
+ refresh_token: string;
116
+ token_type: string;
117
+ created_at: number;
118
+ expires_in: number;
119
+ scope: string;
120
+ resource_server: string;
121
+ }
108
122
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneytree/mt-link-javascript-sdk",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
4
4
  "description": "Moneytree Link JavaScript SDK",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -10,23 +10,28 @@
10
10
  "author": "Moneytree",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
- "build": "rm -rf dist && webpack",
14
- "prepareRelease": "npm run build && git add dist",
15
- "createChangelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
13
+ "build": "rm -rf dist && NODE_OPTIONS=--openssl-legacy-provider webpack",
14
+ "build:docs": "rm -rf docs/types && typedoc --out docs/types src",
15
+ "prepareRelease": "npm run build && git add dist && npm run build:docs && git add docs",
16
+ "createChangelog": "conventional-changelog -i CHANGELOG.md -s && git add CHANGELOG.md",
16
17
  "version": "npm run prepareRelease && npm run createChangelog",
17
18
  "test": "jest --no-cache",
18
19
  "lint:js": "eslint '**/*.js'",
19
20
  "lint:ts": "eslint -c './.eslintrc-ts.js' '**/*.ts'",
20
21
  "lint": "yarn lint:js; yarn lint:ts",
22
+ "format": "prettier scripts src sample/src --write",
23
+ "spellcheck": "cspell src script sample/src",
21
24
  "lint:fix": "yarn lint:js --fix; yarn lint:ts --fix",
22
25
  "start:docs": "docsify serve docs",
23
26
  "prepare": "husky install"
24
27
  },
25
28
  "dependencies": {
26
29
  "crypto-browserify": "^3.12.0",
30
+ "cspell": "^7.3.7",
27
31
  "node-fetch": "^2.6.1",
28
32
  "qs": "^6.10.1",
29
33
  "snake-case": "^3.0.4",
34
+ "typedoc": "^0.25.1",
30
35
  "url-safe-base64": "^1.1.1"
31
36
  },
32
37
  "devDependencies": {
package/CHANGELOG.md DELETED
@@ -1,139 +0,0 @@
1
- # [3.2.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/3.1.1...3.2.0) (2023-08-22)
2
-
3
-
4
- ### Features
5
-
6
- * **api:** Add authorizeUrl API ([43dd559](https://github.com/moneytree/mt-link-javascript-sdk/commit/43dd55963caf5b4b099a3269e9d9d30d415c5ca7))
7
- * **api:** Add logoutUrl API ([7b15f1b](https://github.com/moneytree/mt-link-javascript-sdk/commit/7b15f1b5b00692a0e936f973b0a4db7be2445328))
8
- * **api:** Add onboardUrl API ([32820fb](https://github.com/moneytree/mt-link-javascript-sdk/commit/32820fb04c4899d1aa3ec28f0f9d08178d815500))
9
- * **api:** Add openServiceUrl API ([eeafa30](https://github.com/moneytree/mt-link-javascript-sdk/commit/eeafa302a6631f386c5dbc9987cee5855c77d6d3))
10
-
11
-
12
-
13
- ## [3.1.1](https://github.com/moneytree/mt-link-javascript-sdk/compare/3.1.0...3.1.1) (2023-03-16)
14
-
15
-
16
- ### Bug Fixes
17
-
18
- * **configs:** default sdk info always overwrite options values ([6d2734e](https://github.com/moneytree/mt-link-javascript-sdk/commit/6d2734e0d2748ca4ffa39c80eea3788323fbad1f))
19
-
20
-
21
- ### Features
22
-
23
- * **MyAccount:** Add support for authn_method ([b94ea4b](https://github.com/moneytree/mt-link-javascript-sdk/commit/b94ea4b186699d8af21885eb4150c2e96b605916))
24
- * **MyAccount:** Add support for saml_subject_id ([de9af0f](https://github.com/moneytree/mt-link-javascript-sdk/commit/de9af0f4d20acc90c3a7fa59e1e571a656287975))
25
-
26
-
27
-
28
- # [3.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.1.2...3.0.0) (2021-06-01)
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * add two private config value ([cd64d6a](https://github.com/moneytree/mt-link-javascript-sdk/commit/cd64d6a281fbe773dfea8bd236e2c8e74cda3563))
34
- * **authorize-api:** fix for Safari 14 issue ([9fb69d0](https://github.com/moneytree/mt-link-javascript-sdk/commit/9fb69d014752698df1897527ff27d60ffd116843))
35
- * update for lint error and test failed ([362f0b7](https://github.com/moneytree/mt-link-javascript-sdk/commit/362f0b749797a438ac8c0024616e7072dbc641ee))
36
- * **logout:** add optional backTo parameter ([9b9da89](https://github.com/moneytree/mt-link-javascript-sdk/commit/9b9da8941ff58049ed200d6dd6324bc5918adca0))
37
-
38
-
39
- ### Features
40
-
41
- * **headers:** set sdk info as additional headers parameter ([1a55579](https://github.com/moneytree/mt-link-javascript-sdk/commit/1a5557919ee9844409848154ba22ec863c4d1a58))
42
- * **index:** new logout endpoint ([64156ca](https://github.com/moneytree/mt-link-javascript-sdk/commit/64156caba35f251f6a501edba60f736ab13da57c))
43
- * **myaccount:** able to open each page ([72c1e71](https://github.com/moneytree/mt-link-javascript-sdk/commit/72c1e715f2028e8d9d95b8e109e763d776c87e57))
44
- * **open-service:** rename myaccount-settings to myaccount ([71cdd6c](https://github.com/moneytree/mt-link-javascript-sdk/commit/71cdd6cd373d6564e47f971b95f3bd0c222715c0))
45
- * **open-services:** deeplink support ([c179072](https://github.com/moneytree/mt-link-javascript-sdk/commit/c179072ba008e8f6be3f94bf4ced88e314485544))
46
- * **sample-app:** add example ([89edfcf](https://github.com/moneytree/mt-link-javascript-sdk/commit/89edfcf2e6bc961842f9721345a074779e0549be))
47
- * add del to storage ([c5f2bda](https://github.com/moneytree/mt-link-javascript-sdk/commit/c5f2bdaf597909f71a3ee551966daa0e47367baf))
48
- * authorize & onboard accepts `pkce` & `codeChallenge` options ([bc6bfe5](https://github.com/moneytree/mt-link-javascript-sdk/commit/bc6bfe5da725493fb3046dabab57824fe09fa501))
49
- * **sample_app:** add a very basic sample app to test the SDK ([84a4d18](https://github.com/moneytree/mt-link-javascript-sdk/commit/84a4d187506960f44dffd102b62ce4732bec3301))
50
-
51
-
52
- * refactor!: remove auto generate state logic ([c68d223](https://github.com/moneytree/mt-link-javascript-sdk/commit/c68d22331c1783a3c859af0b4cb3ddecfcfbf8b4))
53
- * refactor!: standardize tokenInfo response ([491dda8](https://github.com/moneytree/mt-link-javascript-sdk/commit/491dda82dc1c2982f5ea5d95d4a8ff4fb121d91d))
54
- * refactor!: remove options from tokenInfo ([c918b9d](https://github.com/moneytree/mt-link-javascript-sdk/commit/c918b9d584e412616d02996516b2bfad8b28c74b))
55
-
56
-
57
- ### BREAKING CHANGES
58
-
59
- * No more auto generate state on init to be used in `authorize`
60
- and `onboard` API. There will be no default `state` and you will have to pass
61
- one via the APIs' options parameter if you need one.
62
- * change `tokenInfo` API response to standard format.
63
- * `tokenInfo` API no longer accept options parameter as it provide no benefit.
64
-
65
-
66
-
67
- ## [1.2.3](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.2.2...1.2.3) (2019-05-23)
68
-
69
-
70
-
71
- ## [1.2.2](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.2.1...1.2.2) (2019-05-23)
72
-
73
-
74
- ### Bug Fixes
75
-
76
- * **continue:** rename param to "continue" as intended ([b9dc043](https://github.com/moneytree/mt-link-javascript-sdk/commit/b9dc0437ab91d2378ade516f3f178606ae38f1ae))
77
-
78
-
79
-
80
- ## [1.2.1](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.2.0...1.2.1) (2019-05-22)
81
-
82
-
83
- ### Bug Fixes
84
-
85
- * **continueTo:** resupport continueTo ([c71c280](https://github.com/moneytree/mt-link-javascript-sdk/commit/c71c28079ce31ead8b16ef124adef735cc23f146))
86
-
87
-
88
- ### Features
89
-
90
- * **lint:** add lint support ([1d1a302](https://github.com/moneytree/mt-link-javascript-sdk/commit/1d1a3028c3ca512526efe1ec1634f8d6adbc9665))
91
-
92
-
93
-
94
- # [1.2.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.1.2...1.2.0) (2019-05-17)
95
-
96
-
97
- ### Bug Fixes
98
-
99
- * **configs:** separate configs option by semicolon ([db2bed4](https://github.com/moneytree/mt-link-javascript-sdk/commit/db2bed4cc205d01e88c3fe7f2d6f2802e2c54a4e))
100
- * **encoding:** fix enconding issue and some typecript typing tweaks ([239704f](https://github.com/moneytree/mt-link-javascript-sdk/commit/239704f4819c68c4d682e28511e5ee3b26d8fe0b))
101
-
102
-
103
- ### Features
104
-
105
- * **sdkVersion:** add sdk version ([bbc9a87](https://github.com/moneytree/mt-link-javascript-sdk/commit/bbc9a8724a96ea548f93165f101a237ed8a1e157))
106
-
107
-
108
-
109
- ## [1.1.2](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.1.1...1.1.2) (2019-04-04)
110
-
111
-
112
- ### Bug Fixes
113
-
114
- * **configs:** encode configs parameter value ([448383a](https://github.com/moneytree/mt-link-javascript-sdk/commit/448383a94b96beeeafd79a9ec5e15732b8d1866d))
115
-
116
-
117
-
118
- ## [1.1.1](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.1.0...1.1.1) (2018-12-04)
119
-
120
-
121
-
122
- # [1.1.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.0.0...1.1.0) (2018-09-07)
123
-
124
-
125
- ### Features
126
-
127
- * **link2app:** adding an option to go back to caller ([f67ac97](https://github.com/moneytree/mt-link-javascript-sdk/commit/f67ac9739b2685db54e6ef792ecccc8f7802bef7))
128
-
129
-
130
-
131
- # [1.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/333cf8c36f7a8299c2bccf441454b04d31e7d907...1.0.0) (2018-08-01)
132
-
133
-
134
- ### Features
135
-
136
- * creating a JS SDK ([333cf8c](https://github.com/moneytree/mt-link-javascript-sdk/commit/333cf8c36f7a8299c2bccf441454b04d31e7d907))
137
-
138
-
139
-