Skip to content

Commit e8b8ab3

Browse files
authored
Merge pull request #56 from moneytree/bump-version-2.1.0
Releasing v2.1.0
2 parents 3f56549 + 1feda8a commit e8b8ab3

10 files changed

+87
-30
lines changed

CHANGELOG.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# [2.1.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/2.0.0...2.1.0) (2020-12-09)
2+
3+
### Bug Fixes
4+
5+
* **authorize-api:** fix for Safari 14 issue ([9fb69d0](https://github.com/moneytree/mt-link-javascript-sdk/commit/9fb69d014752698df1897527ff27d60ffd116843))
6+
* update for lint error and test failed ([362f0b7](https://github.com/moneytree/mt-link-javascript-sdk/commit/362f0b749797a438ac8c0024616e7072dbc641ee))
7+
8+
9+
### Features
10+
11+
* **headers:** set sdk info as additional headers parameter ([1a55579](https://github.com/moneytree/mt-link-javascript-sdk/commit/1a5557919ee9844409848154ba22ec863c4d1a58))
12+
* **sample-app:** add example ([89edfcf](https://github.com/moneytree/mt-link-javascript-sdk/commit/89edfcf2e6bc961842f9721345a074779e0549be))
13+
* add del to storage ([c5f2bda](https://github.com/moneytree/mt-link-javascript-sdk/commit/c5f2bdaf597909f71a3ee551966daa0e47367baf))
14+
* authorize & onboard accepts `pkce` & `codeChallenge` options ([bc6bfe5](https://github.com/moneytree/mt-link-javascript-sdk/commit/bc6bfe5da725493fb3046dabab57824fe09fa501))
15+
* **open-services:** deeplink support ([c179072](https://github.com/moneytree/mt-link-javascript-sdk/commit/c179072ba008e8f6be3f94bf4ced88e314485544))
16+
17+
18+
* refactor!: remove auto generate state logic ([c68d223](https://github.com/moneytree/mt-link-javascript-sdk/commit/c68d22331c1783a3c859af0b4cb3ddecfcfbf8b4))
19+
* refactor!: standardize tokenInfo response ([491dda8](https://github.com/moneytree/mt-link-javascript-sdk/commit/491dda82dc1c2982f5ea5d95d4a8ff4fb121d91d))
20+
* refactor!: remove options from tokenInfo ([c918b9d](https://github.com/moneytree/mt-link-javascript-sdk/commit/c918b9d584e412616d02996516b2bfad8b28c74b))
21+
22+
23+
### BREAKING CHANGES
24+
25+
* No more auto generate state on init to be used in `authorize`
26+
and `onboard` API. There will be no default `state` and you will have to pass
27+
one via the APIs' options parameter if you need one.
28+
* change `tokenInfo` API response to standard format.
29+
* `tokenInfo` API no longer accept options parameter as it provide no benefit.
30+
131
# [2.0.0](https://github.com/moneytree/mt-link-javascript-sdk/compare/1.4.0...2.0.0) (2020-10-19)
232

333

@@ -99,6 +129,3 @@
99129
### Features
100130

101131
* creating a JS SDK ([333cf8c](https://github.com/moneytree/mt-link-javascript-sdk/commit/333cf8c36f7a8299c2bccf441454b04d31e7d907))
102-
103-
104-

dist/api/open-service.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { StoredOptions, ServiceId, ConfigsOptions } from '../typings';
2-
export default function openService(storedOptions: StoredOptions, serviceId: ServiceId, options?: ConfigsOptions): void;
1+
import { StoredOptions, ServiceId, OpenServicesConfigsOptions } from '../typings';
2+
export default function openService(storedOptions: StoredOptions, serviceId: ServiceId, options?: OpenServicesConfigsOptions): void;

dist/api/token-info.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { StoredOptions, TokenInfoOptions, TokenInfo } from '../typings';
2-
export default function tokenInfo(storedOptions: StoredOptions, token: string, options?: TokenInfoOptions): Promise<TokenInfo>;
1+
import { StoredOptions, TokenInfo } from '../typings';
2+
export default function tokenInfo(storedOptions: StoredOptions, token: string): Promise<TokenInfo>;

dist/helper.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ export declare function constructScopes(scopes?: Scopes): string | undefined;
33
export declare function getIsTabValue(isNewTab?: boolean): '' | '_self';
44
export declare function mergeConfigs(initValues: InitOptions, newValues: ConfigsOptions, ignoreKeys?: string[]): ConfigsOptions;
55
export declare function generateConfigs(configs?: ConfigsOptions): string;
6+
export declare function generateCodeChallenge(): string;
7+
export declare function generateSdkHeaderInfo(): {
8+
'mt-sdk-platform': string;
9+
'mt-sdk-version': string;
10+
};

dist/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { StoredOptions, ServiceId, ConfigsOptions, LogoutOptions, InitOptions, AuthorizeOptions, ExchangeTokenOptions, TokenInfoOptions, RequestMagicLinkOptions, TokenInfo } from './typings';
1+
import { StoredOptions, ServiceId, ConfigsOptions, LogoutOptions, InitOptions, AuthorizeOptions, OnboardOptions, ExchangeTokenOptions, RequestMagicLinkOptions, TokenInfo } from './typings';
22
export * from './typings';
33
export declare class MtLinkSdk {
44
storedOptions: StoredOptions;
55
init(clientId: string, options?: InitOptions): void;
66
authorize(options?: AuthorizeOptions): void;
7-
onboard(options?: AuthorizeOptions): void;
7+
onboard(options?: OnboardOptions): void;
88
logout(options?: LogoutOptions): void;
99
openService(serviceId: ServiceId, options?: ConfigsOptions): void;
1010
requestMagicLink(options?: RequestMagicLinkOptions): Promise<void>;
1111
exchangeToken(options?: ExchangeTokenOptions): Promise<string>;
12-
tokenInfo(token: string, options?: TokenInfoOptions): Promise<TokenInfo>;
12+
tokenInfo(token: string): Promise<TokenInfo>;
1313
}
1414
declare const mtLinkSdk: MtLinkSdk;
1515
declare global {

dist/index.js

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

dist/storage.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
export declare const STORE_KEY = "mt-link-javascript-sdk";
22
export declare function get(key: string): string | undefined;
33
export declare function set(key: string, value: string): void;
4+
export declare function del(key: string): void;
45
declare const _default: {
56
set: typeof set;
67
get: typeof get;
8+
del: typeof del;
79
};
810
export default _default;

dist/typings.d.ts

+39-15
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,50 @@ export interface ConfigsOptions extends PrivateConfigsOptions {
1414
showRememberMe?: boolean;
1515
isNewTab?: boolean;
1616
}
17+
export declare type ServicesListType = {
18+
view?: 'services-list';
19+
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';
20+
type?: 'bank' | 'credit_card' | 'stored_value' | 'point' | 'corporate';
21+
search?: string;
22+
};
23+
export declare type ServiceConnectionType = {
24+
view?: 'service-connection';
25+
entityKey: string;
26+
};
27+
export declare type ConnectionSettingType = {
28+
view?: 'connection-setting';
29+
credentialId: string;
30+
};
31+
export declare type CustomerSupportType = {
32+
view?: 'customer-support';
33+
};
34+
export declare type OpenServicesConfigsOptions = ConfigsOptions & (ServicesListType | ServiceConnectionType | ConnectionSettingType | CustomerSupportType);
1735
export declare type Scopes = string | string[];
1836
interface AuthorizeConfigsOptions {
1937
forceLogout?: boolean;
2038
}
2139
interface OAuthSharedParams {
2240
state?: string;
2341
redirectUri?: string;
24-
codeVerifier?: string;
2542
}
2643
export interface AuthorizeOptions extends OAuthSharedParams, ConfigsOptions, AuthorizeConfigsOptions {
2744
country?: string;
2845
scopes?: Scopes;
46+
codeChallenge?: string;
47+
pkce?: boolean;
2948
}
3049
export declare type Mode = 'production' | 'staging' | 'develop' | 'local';
31-
export declare type InitOptions = Omit<AuthorizeOptions, 'forceLogout'> & PrivateParams & {
50+
export declare type InitOptions = Omit<Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'codeChallenge'>, 'pkce'> & PrivateParams & {
3251
mode?: Mode;
3352
locale?: string;
3453
};
3554
export interface StoredOptions extends InitOptions {
3655
clientId?: string;
3756
mode: Mode;
38-
codeVerifier: string;
39-
state: string;
4057
}
4158
export interface ExchangeTokenOptions extends OAuthSharedParams {
4259
code?: string;
60+
codeVerifier?: string;
4361
}
4462
export declare type LogoutOptions = ConfigsOptions;
4563
export declare type OnboardOptions = Omit<Omit<Omit<Omit<AuthorizeOptions, 'showAuthToggle'>, 'forceLogout'>, 'showRememberMe'>, 'authAction'>;
@@ -48,17 +66,23 @@ export declare type MagicLinkTo = string | 'settings' | 'settings/authorized-app
4866
export interface RequestMagicLinkOptions extends ConfigsOptions {
4967
magicLinkTo?: MagicLinkTo;
5068
}
51-
export declare type TokenInfoOptions = Omit<Omit<OAuthSharedParams, 'state'>, 'codeVerifier'>;
5269
export interface TokenInfo {
53-
guestUid: string;
54-
resourceServer: string;
55-
country: string;
56-
currency: string;
57-
language: string;
58-
clientName: string;
59-
clientId: string;
60-
expTimestamp: number;
61-
scopes: Scopes;
62-
isMtClient: boolean;
70+
iss: string;
71+
iat: number;
72+
exp: number;
73+
aud: string[];
74+
sub: null | string;
75+
scope: string;
76+
client_id: null | string;
77+
app: null | {
78+
name: string;
79+
is_mt: boolean;
80+
};
81+
guest: null | {
82+
email: string;
83+
country: string;
84+
currency: string;
85+
lang: string;
86+
};
6387
}
6488
export {};

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": "2.0.0",
3+
"version": "2.1.0",
44
"description": "Moneytree Link JavaScript SDK",
55
"main": "dist/index.js",
66
"files": [

sample/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "mt-link-javascript-sdk-sample",
3-
"version": "2.0.0",
43
"author": "Moneytree",
54
"description": "An example of the Moneytree Web SDK.",
65
"license": "MIT",

0 commit comments

Comments
 (0)