Skip to content

Commit 345722f

Browse files
authored
Merge pull request #113 from moneytree/LINK-2174-Make-release
[LINK-2174] Prepare Release
2 parents bc6240c + dadaab9 commit 345722f

File tree

7 files changed

+51
-77
lines changed

7 files changed

+51
-77
lines changed

CHANGELOG.md

+14-49
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
1-
## [3.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.1.2...3.0.0) (2021-05-31)
1+
# [3.1.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/3.0.0...3.1.0) (2022-11-22)
22

3-
### BREAKING CHANGES
4-
5-
* chore(magic-link): rename api to login-link ([2a4773d](https://github.com/moneytree/mt-link-javascript-sdk/commit/2a4773db317e669ba8c2485977adbb4a1c037cd3))
6-
* chore(country): support only jp ([08ff6c3](https://github.com/moneytree/mt-link-javascript-sdk/commit/08ff6c3f3de70e8f433b64557997224cea419593))
7-
* feat(open-service): rename myaccount-settings to myaccount ([69fedb4](https://github.com/moneytree/mt-link-javascript-sdk/commit/69fedb48931e3bebfc7aaddad33ff46d5967069d))
83

94
### Features
105

11-
* feat(myaccount): able to open each page ([2a92055](https://github.com/moneytree/mt-link-javascript-sdk/commit/2a920556840fc28a4b7d99d264708ab3d861e40e))
12-
13-
### Chore
6+
* **MyAccount:** Add support for authn_method ([b94ea4b](https://github.com/moneytree/mt-link-javascript-sdk/commit/b94ea4b186699d8af21885eb4150c2e96b605916))
7+
* **MyAccount:** Add support for saml_subject_id ([de9af0f](https://github.com/moneytree/mt-link-javascript-sdk/commit/de9af0f4d20acc90c3a7fa59e1e571a656287975))
148

15-
* chore(config): format with updated prettier settings ([066b0f2](https://github.com/moneytree/mt-link-javascript-sdk/commit/066b0f2688cd44bab571ac40bbf2a6edb32ec10a))
169

17-
## [2.1.2](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.1.1...2.1.2) (2020-12-18)
1810

19-
* fix add two private config value ([cd64d6a](https://github.com/moneytree/mt-link-javascript-sdk/commit/cd64d6a281fbe773dfea8bd236e2c8e74cda3563))
11+
# [3.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.1.2...3.0.0) (2021-06-01)
2012

21-
## [2.1.1](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.1.0...2.1.1) (2020-12-15)
22-
23-
### Bug Fixes
24-
* fix window.open didn't work on Safari 14 ([882c23c](https://github.com/moneytree/mt-link-javascript-sdk/commit/882c23c1abdc467a964b918ea7502f4f70e7da8d))
25-
* fix forceLogout didn't work ([fa3055a](https://github.com/moneytree/mt-link-javascript-sdk/commit/fa3055a100f2bd4b7c5a4660b9dfeba45c601078))
26-
27-
# [2.1.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.0.0...2.1.0) (2020-12-09)
2813

2914
### Bug Fixes
3015

16+
* add two private config value ([cd64d6a](https://github.com/moneytree/mt-link-javascript-sdk/commit/cd64d6a281fbe773dfea8bd236e2c8e74cda3563))
3117
* **authorize-api:** fix for Safari 14 issue ([9fb69d0](https://github.com/moneytree/mt-link-javascript-sdk/commit/9fb69d014752698df1897527ff27d60ffd116843))
3218
* update for lint error and test failed ([362f0b7](https://github.com/moneytree/mt-link-javascript-sdk/commit/362f0b749797a438ac8c0024616e7072dbc641ee))
19+
* **logout:** add optional backTo parameter ([9b9da89](https://github.com/moneytree/mt-link-javascript-sdk/commit/9b9da8941ff58049ed200d6dd6324bc5918adca0))
3320

3421

3522
### Features
3623

3724
* **headers:** set sdk info as additional headers parameter ([1a55579](https://github.com/moneytree/mt-link-javascript-sdk/commit/1a5557919ee9844409848154ba22ec863c4d1a58))
25+
* **index:** new logout endpoint ([64156ca](https://github.com/moneytree/mt-link-javascript-sdk/commit/64156caba35f251f6a501edba60f736ab13da57c))
26+
* **myaccount:** able to open each page ([72c1e71](https://github.com/moneytree/mt-link-javascript-sdk/commit/72c1e715f2028e8d9d95b8e109e763d776c87e57))
27+
* **open-service:** rename myaccount-settings to myaccount ([71cdd6c](https://github.com/moneytree/mt-link-javascript-sdk/commit/71cdd6cd373d6564e47f971b95f3bd0c222715c0))
28+
* **open-services:** deeplink support ([c179072](https://github.com/moneytree/mt-link-javascript-sdk/commit/c179072ba008e8f6be3f94bf4ced88e314485544))
3829
* **sample-app:** add example ([89edfcf](https://github.com/moneytree/mt-link-javascript-sdk/commit/89edfcf2e6bc961842f9721345a074779e0549be))
3930
* add del to storage ([c5f2bda](https://github.com/moneytree/mt-link-javascript-sdk/commit/c5f2bdaf597909f71a3ee551966daa0e47367baf))
4031
* authorize & onboard accepts `pkce` & `codeChallenge` options ([bc6bfe5](https://github.com/moneytree/mt-link-javascript-sdk/commit/bc6bfe5da725493fb3046dabab57824fe09fa501))
41-
* **open-services:** deeplink support ([c179072](https://github.com/moneytree/mt-link-javascript-sdk/commit/c179072ba008e8f6be3f94bf4ced88e314485544))
32+
* **sample_app:** add a very basic sample app to test the SDK ([84a4d18](https://github.com/moneytree/mt-link-javascript-sdk/commit/84a4d187506960f44dffd102b62ce4732bec3301))
4233

4334

4435
* refactor!: remove auto generate state logic ([c68d223](https://github.com/moneytree/mt-link-javascript-sdk/commit/c68d22331c1783a3c859af0b4cb3ddecfcfbf8b4))
@@ -54,35 +45,6 @@ one via the APIs' options parameter if you need one.
5445
* change `tokenInfo` API response to standard format.
5546
* `tokenInfo` API no longer accept options parameter as it provide no benefit.
5647

57-
# [2.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.4.0...2.0.0) (2020-10-19)
58-
59-
60-
### Features
61-
62-
- Support OAuth 2.0 Authorization Code with PKCE Flow.
63-
- Enable to onboard a guest faster.
64-
- Support Magic link(password-less login link).
65-
66-
67-
# [1.4.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.3.1...1.4.0) (2020-01-17)
68-
69-
70-
# [1.3.1](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.3.0...1.3.1) (2020-01-17)
71-
72-
73-
### Bug Fixes
74-
75-
* **logout:** add optional backTo parameter ([9b9da89](https://github.com/moneytree/mt-link-javascript-sdk/commit/9b9da8941ff58049ed200d6dd6324bc5918adca0))
76-
77-
78-
# [1.3.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.2.3...1.3.0) (2019-12-11)
79-
80-
81-
### Features
82-
83-
* **index:** new logout endpoint ([64156ca](https://github.com/moneytree/mt-link-javascript-sdk/commit/64156caba35f251f6a501edba60f736ab13da57c))
84-
* **sample_app:** add a very basic sample app to test the SDK ([84a4d18](https://github.com/moneytree/mt-link-javascript-sdk/commit/84a4d187506960f44dffd102b62ce4732bec3301))
85-
8648

8749

8850
## [1.2.3](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.2.2...1.2.3) (2019-05-23)
@@ -155,3 +117,6 @@ one via the APIs' options parameter if you need one.
155117
### Features
156118

157119
* creating a JS SDK ([333cf8c](https://github.com/moneytree/mt-link-javascript-sdk/commit/333cf8c36f7a8299c2bccf441454b04d31e7d907))
120+
121+
122+

dist/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from './typings';
33
export declare class MtLinkSdk {
44
storedOptions: StoredOptions;
55
init(clientId: string, options?: InitOptions): void;
6+
setSamlSubjectId(value: string): void;
67
authorize(options?: AuthorizeOptions): void;
78
onboard(options?: OnboardOptions): void;
89
logout(options?: LogoutOptions): void;

dist/index.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typings.d.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
export declare type AuthAction = 'login' | 'signup';
1+
export declare const supportedAuthAction: readonly ["login", "signup"];
2+
export declare type AuthAction = typeof supportedAuthAction[number];
23
export interface PrivateParams {
34
cobrandClientId?: string;
5+
samlSubjectId?: string;
46
}
57
export interface PrivateConfigsOptions {
68
sdkPlatform?: 'ios' | 'android' | 'js';
79
sdkVersion?: string;
810
}
11+
export declare const supportedAuthnMethod: readonly ["passwordless", "sso", "credentials"];
12+
export declare type AuthnMethod = typeof supportedAuthnMethod[number];
13+
export declare const supportedConfigsOptions: readonly ["email", "backTo", "authAction", "showAuthToggle", "showRememberMe", "isNewTab", "forceLogout", "authnMethod"];
14+
export declare type SupportedConfigsOptions = typeof supportedConfigsOptions[number];
915
export interface ConfigsOptions extends PrivateConfigsOptions {
1016
email?: string;
1117
backTo?: string;
@@ -14,6 +20,7 @@ export interface ConfigsOptions extends PrivateConfigsOptions {
1420
showRememberMe?: boolean;
1521
isNewTab?: boolean;
1622
forceLogout?: boolean;
23+
authnMethod?: AuthnMethod;
1724
}
1825
export declare type ServicesListType = {
1926
view?: 'services-list';

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mtLinkSdk.init(clientId, options);
6969

7070
### setSamlSubjectId
7171

72-
The `setSamlSubjectId` method is used to set the value of the `saml_subject_id` parameter.
72+
The `setSamlSubjectId` method is used to set the value of the `saml_subject_id` parameter. This parameter can be set during `init` or changed by this method. It can not be overriden.
7373
The `setSamlSubjectId` parameter allows the client to pass a guest identifier to Moneytree so that Moneytree can forward it to the Identity Provider (IdP) via the SAMLRequest.
7474
The `saml_subject_id` parameter will be forwarded to the `authorize`, `logout` and `open-service` methods when defined.
7575

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@moneytree/mt-link-javascript-sdk",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"description": "Moneytree Link JavaScript SDK",
55
"main": "dist/index.js",
66
"files": [

src/helper.ts

+21-20
Original file line numberDiff line numberDiff line change
@@ -113,26 +113,6 @@ export function generateConfigs(configs: ConfigsOptions = {}): string {
113113
});
114114
}
115115

116-
function isAuthnMethod(x: unknown): x is AuthnMethod {
117-
return supportedAuthnMethod.includes(x as AuthnMethod);
118-
}
119-
120-
function parseAuthnMethod(x: unknown): AuthnMethod | undefined {
121-
if (Array.isArray(x)) {
122-
throw new TypeError('Array is not allowed for authnMethod');
123-
}
124-
125-
return isAuthnMethod(x) ? x : undefined;
126-
}
127-
128-
function isAuthAction(x: unknown): x is AuthAction {
129-
return supportedAuthAction.includes(x as AuthAction);
130-
}
131-
132-
function parseAuthAction(x: unknown): AuthAction | undefined {
133-
return isAuthAction(x) ? x : undefined;
134-
}
135-
136116
export function generateCodeChallenge(): string {
137117
const codeVerifier = uuid();
138118

@@ -154,3 +134,24 @@ export function generateSdkHeaderInfo(): {
154134
export function openWindow(url: string, windowName: string): Window | null {
155135
return window.open(url, windowName, 'noreferrer');
156136
}
137+
138+
// Validators
139+
function isAuthnMethod(x: unknown): x is AuthnMethod {
140+
return supportedAuthnMethod.includes(x as AuthnMethod);
141+
}
142+
143+
function parseAuthnMethod(x: unknown): AuthnMethod | undefined {
144+
if (Array.isArray(x)) {
145+
throw new TypeError('Array is not allowed for authnMethod');
146+
}
147+
148+
return isAuthnMethod(x) ? x : undefined;
149+
}
150+
151+
function isAuthAction(x: unknown): x is AuthAction {
152+
return supportedAuthAction.includes(x as AuthAction);
153+
}
154+
155+
function parseAuthAction(x: unknown): AuthAction | undefined {
156+
return isAuthAction(x) ? x : undefined;
157+
}

0 commit comments

Comments
 (0)