@moneytree/mt-link-javascript-sdk 3.2.1 → 4.1.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,58 +20,69 @@ export interface ConfigsOptions extends PrivateConfigsOptions {
20
20
  forceLogout?: boolean;
21
21
  authnMethod?: AuthnMethod;
22
22
  }
23
- export declare type ConfigsOptionsWithoutIsNewTab = Omit<ConfigsOptions, 'isNewTab'>;
24
- export declare type VaultViewServiceList = {
23
+ export type ConfigsOptionsWithoutIsNewTab = Omit<ConfigsOptions, 'isNewTab'>;
24
+ export type VaultViewServiceList = {
25
25
  view: 'services-list';
26
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';
27
27
  type?: 'bank' | 'credit_card' | 'stored_value' | 'point' | 'corporate';
28
28
  search?: string;
29
29
  };
30
- export declare type VaultViewServiceConnection = {
30
+ export type VaultViewServiceConnection = {
31
31
  view: 'service-connection';
32
32
  entityKey: string;
33
33
  };
34
- export declare type VaultViewConnectionSetting = {
34
+ export type VaultViewConnectionSetting = {
35
35
  view: 'connection-setting';
36
36
  credentialId: string;
37
37
  };
38
- export declare type VaultViewCustomerSupport = {
38
+ export type VaultViewConnectionUpdate = {
39
+ view: 'connection-update';
40
+ credentialId: string;
41
+ };
42
+ export type VaultViewConnectionDelete = {
43
+ view: 'connection-delete';
44
+ credentialId: string;
45
+ };
46
+ export type VaultViewCustomerSupport = {
39
47
  view: 'customer-support';
40
48
  };
41
- export declare type VaultServiceTypes = VaultViewServiceList | VaultViewServiceConnection | VaultViewConnectionSetting | VaultViewCustomerSupport;
42
- export declare type MyAccountServiceTypes = {
49
+ export type VaultServiceTypes = VaultViewServiceList | VaultViewServiceConnection | VaultViewConnectionSetting | VaultViewConnectionUpdate | VaultViewConnectionDelete | VaultViewCustomerSupport;
50
+ export type MyAccountServiceTypes = {
43
51
  view: LoginLinkTo;
44
52
  };
45
- export declare type MyAccountOpenServiceOptions = ConfigsOptions | (ConfigsOptions & MyAccountServiceTypes);
46
- export declare type MyAccountOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab | (ConfigsOptionsWithoutIsNewTab & MyAccountServiceTypes);
47
- export declare type VaultOpenServiceViewServiceList = ConfigsOptions & VaultViewServiceList;
48
- export declare type VaultOpenServiceViewServiceConnection = ConfigsOptions & VaultViewServiceConnection;
49
- export declare type VaultOpenServiceViewConnectionSetting = ConfigsOptions & VaultViewConnectionSetting;
50
- export declare type VaultOpenServiceViewCustomerSupport = ConfigsOptions & VaultViewCustomerSupport;
51
- export declare type VaultOpenServiceUrlViewServiceList = ConfigsOptionsWithoutIsNewTab & VaultViewServiceList;
52
- export declare type VaultOpenServiceUrlViewServiceConnection = ConfigsOptionsWithoutIsNewTab & VaultViewServiceConnection;
53
- export declare type VaultOpenServiceUrlViewConnectionSetting = ConfigsOptionsWithoutIsNewTab & VaultViewConnectionSetting;
54
- export declare type VaultOpenServiceUrlViewCustomerSupport = ConfigsOptionsWithoutIsNewTab & VaultViewCustomerSupport;
55
- export declare type LinkKitOpenServiceOptions = ConfigsOptions;
56
- export declare type LinkKitOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab;
57
- export declare type OpenServiceOptions = MyAccountOpenServiceOptions | ConfigsOptions | VaultOpenServiceViewServiceList | VaultOpenServiceViewConnectionSetting | VaultOpenServiceViewCustomerSupport | LinkKitOpenServiceOptions;
58
- export declare type OpenServiceUrlOptions = MyAccountOpenServiceUrlOptions | ConfigsOptionsWithoutIsNewTab | VaultOpenServiceUrlViewServiceList | VaultOpenServiceUrlViewConnectionSetting | VaultOpenServiceUrlViewCustomerSupport | LinkKitOpenServiceUrlOptions;
59
- export declare type Scopes = string | string[];
53
+ export type MyAccountOpenServiceOptions = ConfigsOptions | (ConfigsOptions & MyAccountServiceTypes);
54
+ export type MyAccountOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab | (ConfigsOptionsWithoutIsNewTab & MyAccountServiceTypes);
55
+ export type VaultOpenServiceViewServiceList = ConfigsOptions & VaultViewServiceList;
56
+ export type VaultOpenServiceViewServiceConnection = ConfigsOptions & VaultViewServiceConnection;
57
+ export type VaultOpenServiceViewConnectionSetting = ConfigsOptions & VaultViewConnectionSetting;
58
+ export type VaultOpenServiceViewConnectionUpdate = ConfigsOptions & VaultViewConnectionUpdate;
59
+ export type VaultOpenServiceViewConnectionDelete = ConfigsOptions & VaultViewConnectionDelete;
60
+ export type VaultOpenServiceViewCustomerSupport = ConfigsOptions & VaultViewCustomerSupport;
61
+ export type VaultOpenServiceUrlViewServiceList = ConfigsOptionsWithoutIsNewTab & VaultViewServiceList;
62
+ export type VaultOpenServiceUrlViewServiceConnection = ConfigsOptionsWithoutIsNewTab & VaultViewServiceConnection;
63
+ export type VaultOpenServiceUrlViewConnectionSetting = ConfigsOptionsWithoutIsNewTab & VaultViewConnectionSetting;
64
+ export type VaultOpenServiceUrlViewConnectionUpdate = ConfigsOptionsWithoutIsNewTab & VaultViewConnectionUpdate;
65
+ export type VaultOpenServiceUrlViewConnectionDelete = ConfigsOptionsWithoutIsNewTab & VaultViewConnectionDelete;
66
+ export type VaultOpenServiceUrlViewCustomerSupport = ConfigsOptionsWithoutIsNewTab & VaultViewCustomerSupport;
67
+ export type LinkKitOpenServiceOptions = ConfigsOptions;
68
+ export type LinkKitOpenServiceUrlOptions = ConfigsOptionsWithoutIsNewTab;
69
+ export type OpenServiceOptions = MyAccountOpenServiceOptions | ConfigsOptions | VaultOpenServiceViewServiceList | VaultOpenServiceViewConnectionSetting | VaultOpenServiceViewConnectionUpdate | VaultOpenServiceViewConnectionDelete | VaultOpenServiceViewCustomerSupport | LinkKitOpenServiceOptions;
70
+ export type OpenServiceUrlOptions = MyAccountOpenServiceUrlOptions | ConfigsOptionsWithoutIsNewTab | VaultOpenServiceUrlViewServiceList | VaultOpenServiceUrlViewConnectionSetting | VaultOpenServiceUrlViewConnectionUpdate | VaultOpenServiceUrlViewConnectionDelete | VaultOpenServiceUrlViewCustomerSupport | LinkKitOpenServiceUrlOptions;
71
+ export type Scopes = string | string[];
60
72
  interface AuthorizeConfigsOptions {
61
73
  forceLogout?: boolean;
62
74
  }
63
- interface OAuthSharedParams {
75
+ export interface OAuthSharedParams {
64
76
  state?: string;
65
77
  redirectUri?: string;
66
78
  }
67
79
  export interface AuthorizeOptions extends OAuthSharedParams, ConfigsOptions, AuthorizeConfigsOptions {
68
80
  scopes?: Scopes;
69
81
  codeChallenge?: string;
70
- pkce?: boolean;
71
82
  }
72
- export declare type AuthorizeUrlOptions = Omit<AuthorizeOptions, 'isNewTab'>;
73
- export declare type Mode = 'production' | 'staging' | 'develop' | 'local';
74
- export declare type InitOptions = Omit<Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'codeChallenge'>, 'pkce'> & PrivateParams & {
83
+ export type AuthorizeUrlOptions = Omit<AuthorizeOptions, 'isNewTab'>;
84
+ export type Mode = 'production' | 'staging' | 'develop' | 'local';
85
+ export type InitOptions = Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'codeChallenge'> & PrivateParams & {
75
86
  mode?: Mode;
76
87
  locale?: string;
77
88
  };
@@ -83,12 +94,12 @@ export interface ExchangeTokenOptions extends OAuthSharedParams {
83
94
  code?: string;
84
95
  codeVerifier?: string;
85
96
  }
86
- export declare type LogoutOptions = ConfigsOptions;
87
- export declare type LogoutUrlOptions = Omit<ConfigsOptions, 'isNewTab'>;
88
- export declare type OnboardOptions = Omit<Omit<Omit<Omit<AuthorizeOptions, 'showAuthToggle'>, 'forceLogout'>, 'showRememberMe'>, 'authAction'>;
89
- export declare type OnboardUrlOptions = Omit<OnboardOptions, 'isNewTab'>;
90
- export declare type ServiceId = 'vault' | 'myaccount' | 'link-kit';
91
- export declare type LoginLinkTo = 'settings' | 'settings/authorized-applications' | 'settings/change-language' | 'settings/email-preferences' | 'settings/delete-account' | 'settings/update-email' | 'settings/update-password';
97
+ export type LogoutOptions = ConfigsOptions;
98
+ export type LogoutUrlOptions = Omit<ConfigsOptions, 'isNewTab'>;
99
+ export type OnboardOptions = Omit<Omit<Omit<Omit<AuthorizeOptions, 'showAuthToggle'>, 'forceLogout'>, 'showRememberMe'>, 'authAction'>;
100
+ export type OnboardUrlOptions = Omit<OnboardOptions, 'isNewTab'>;
101
+ export type ServiceId = 'vault' | 'myaccount' | 'link-kit';
102
+ export type LoginLinkTo = 'settings' | 'settings/authorized-applications' | 'settings/change-language' | 'settings/email-preferences' | 'settings/delete-account' | 'settings/update-email' | 'settings/update-password';
92
103
  export interface RequestLoginLinkOptions extends ConfigsOptions {
93
104
  loginLinkTo?: LoginLinkTo;
94
105
  }
@@ -111,4 +122,13 @@ export interface TokenInfo {
111
122
  lang: string;
112
123
  };
113
124
  }
125
+ export interface Token {
126
+ access_token: string;
127
+ refresh_token: string;
128
+ token_type: string;
129
+ created_at: number;
130
+ expires_in: number;
131
+ scope: string;
132
+ resource_server: string;
133
+ }
114
134
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneytree/mt-link-javascript-sdk",
3
- "version": "3.2.1",
3
+ "version": "4.1.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": {