Skip to content

Commit a926047

Browse files
committed
doc(sdk) fix typos and inconsistencies
1 parent a3660a8 commit a926047

File tree

2 files changed

+56
-51
lines changed

2 files changed

+56
-51
lines changed

src/index.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class MtLinkSdk {
5555
* Call `init` to initialize the SDK and set default options for API calls.
5656
*
5757
* Some LINK APIs can be used without calling `init`.
58-
* Calls related to OAuth require a client id which can only be set via the `init` function.
58+
* Calls related to OAuth require a client ID which can only be set via the `init` function.
5959
* These APIs include:
6060
* - {@link authorize}
6161
* - {@link onboard}
@@ -91,7 +91,7 @@ export class MtLinkSdk {
9191
};
9292
}
9393
/**
94-
* Use this method to send a guest identifier to Moneytree so that Moneytree can forward it as `saml_subject_id` parameter
94+
* Use this method to send a user identifier to Moneytree so that Moneytree can forward it as `saml_subject_id` parameter
9595
* to the Identity Provider (IdP) via the SAMLRequest during SAML SSO flows. See the [SAML SSO documentation for details](https://docs.link.getmoneytree.com/docs/saml-introduction#saml-subject-identifier).
9696
*
9797
* This parameter can be set during {@link init} or changed on a request-by-request basis with this method.
@@ -102,19 +102,19 @@ export class MtLinkSdk {
102102
}
103103

104104
/**
105-
* OAuth authorization method to request guest consent to access data via the [Link API](https://getmoneytree.com/jp/link/about).
105+
* OAuth authorization method to request user consent to access data via the [Link API](https://getmoneytree.com/jp/link/about).
106106
*
107107
* The only supported flow is authorization code grant with PKCE [PKCE](https://auth0.com/docs/flows/concepts/auth-code-pkce)
108-
* If the user is not logged in yet this will show the login screen and redirect the guest to the consent screen after they log in.
109-
* After the guest consents, they will be redirected to the redirect URI with an authorization code.
110-
* If the user is already logged and has granted consent in the redirection happens immediately.
108+
* If the user is not logged in yet this will show the login screen and redirect the user to the consent screen after they log in.
109+
* After the user consents, they will be redirected to the redirect URI with an authorization code.
110+
* If the user is already logged in and has granted consent in the redirection happens immediately.
111111
*
112-
* You can pass the {@link AuthorizeOptions.forceLogout} option to force the guest to log in, even if they have an active session.
112+
* You can pass the {@link AuthorizeOptions.forceLogout} option to force the user to log in, even if they have an active session.
113113
*
114114
* You can also choose to display the sign up form when the user is not logged in yet by setting the {@link AuthorizeOptions.authAction} option.
115115
*
116116
* @remark
117-
* You must initialize the SDK via the {@link init} before calling this API.
117+
* You must initialize the SDK via {@link init} before calling this API.
118118
*
119119
* @example
120120
* ```javascript
@@ -126,26 +126,26 @@ export class MtLinkSdk {
126126
}
127127

128128
/**
129-
* This method generates an URL for OAuth authorization that requires guest consent to access data via [Link API](https://getmoneytree.com/jp/link/about).
129+
* This method generates a URL for OAuth authorization that requires user consent to access data via [Link API](https://getmoneytree.com/jp/link/about).
130130
*
131131
* See {@link authorize} API for authorization details. This API has exactly the same parameters as {@link authorize},
132-
* the only difference is that it returns an URL instead of opening immediately with `window.open`.
132+
* the only difference is that it returns a URL instead of opening immediately with `window.open`.
133133
*/
134134
public authorizeUrl(options?: AuthorizeUrlOptions): string {
135135
return authorizeUrl(this.storedOptions, options);
136136
}
137137

138138
/**
139-
* The onboard API allows a new guest to get onboard faster without having to go through the registration process.
140-
* All you have to do is provide an emai address and pass the same options parameter as the {@link authorize} function.
141-
* We will display a consent screen explaining the access requests and applicable scopes.
142-
* Once the guest consents, a new Moneytree account will be created on their behalf and authorization is completed.
139+
* The onboard API allows a new user to get onboard faster without having to go through the registration process.
140+
* All you have to do is provide an email address and pass the same options parameter as the {@link authorize} function.
141+
* Moneytree LINK will display a consent screen explaining the access requests and applicable scopes.
142+
* Once the user consents, a new Moneytree account will be created on their behalf and authorization is completed.
143143
* Resulting behavior will be the same as the {@link authorize} redirection flow.
144144
*
145-
* Onboard will force any current guest session to logout, hence you do not have to call {@link logout} manually to
145+
* Onboard will force any current user session to logout, hence you do not have to call {@link logout} manually to
146146
* ensure a clean state.
147147
*
148-
* If an account with this email address already exists we will redirect the guest to the login screen.
148+
* If an account with this email address already exists we will redirect the user to the login screen.
149149
*
150150
* @remark
151151
* ⚠️ You must initialize the SDK via the {@link init} before calling this API.
@@ -160,9 +160,9 @@ export class MtLinkSdk {
160160
}
161161

162162
/**
163-
* This method generates a URL for guest onboarding.
163+
* This method generates a URL for user onboarding.
164164
*
165-
* This API has exactly the same parameters as {@link onboard}, the only difference being that it returns an URL
165+
* This API has exactly the same parameters as {@link onboard}, the only difference being that it returns a URL
166166
* instead of opening immediately with `window.open`.
167167
*/
168168
public onboardUrl(options?: OnboardUrlOptions): string {
@@ -177,9 +177,9 @@ export class MtLinkSdk {
177177
}
178178

179179
/**
180-
* This method generates a URL to log out the guest.
180+
* This method generates a URL to log out the user.
181181
*
182-
* This API has exactly the same parameters as {@link logout}, the only difference being that it returns an URL
182+
* This API has exactly the same parameters as {@link logout}, the only difference being that it returns a URL
183183
* instead of opening immediately with `window.open`.
184184
*/
185185
public logoutUrl(options?: LogoutUrlOptions): string {
@@ -206,10 +206,10 @@ export class MtLinkSdk {
206206
* Pass `serviceId: 'vault'` to open the Vault service.
207207
*
208208
* Depending on the Vault sub-page you want to open, you can pass the following options:
209-
* - `serviceList`: opens the vault service list page, pass {@link VaultOpenServiceViewServiceList} as options.
210-
* - `serviceConnection`: opens the vault service connection page, pass {@link VaultOpenServiceViewServiceConnection} as options.
211-
* - `connectionSetting`: opens the vault connection setting page, pass {@link VaultOpenServiceViewConnectionSetting} as options.
212-
* - `customerSupport`: opens the vault customer support page, pass {@link VaultOpenServiceViewCustomerSupport} as options.
209+
* - `serviceList`: opens the Vault service list page, pass {@link VaultOpenServiceViewServiceList} as options.
210+
* - `serviceConnection`: opens the Vault service connection page, pass {@link VaultOpenServiceViewServiceConnection} as options.
211+
* - `connectionSetting`: opens the Vault connection setting page, pass {@link VaultOpenServiceViewConnectionSetting} as options.
212+
* - `customerSupport`: opens the Vault customer support page, pass {@link VaultOpenServiceViewCustomerSupport} as options.
213213
*
214214
* @remark ⚠️ calling this API before calling {@link init} will open the services view without branding (company logo etc.)
215215
*/
@@ -237,7 +237,7 @@ export class MtLinkSdk {
237237
/**
238238
* This method can generate URLs for various services provided by Moneytree, such as Moneytree Account Settings and Vault.
239239
*
240-
* This API has exactly the same parameters as {@link openService}, the only difference being that it returns an URL
240+
* This API has exactly the same parameters as {@link openService}, the only difference being that it returns a URL
241241
* instead of opening immediately with `window.open`.
242242
*/
243243
public openServiceUrl(serviceId: 'link-kit', options?: LinkKitOpenServiceUrlOptions): string;
@@ -261,9 +261,9 @@ export class MtLinkSdk {
261261
}
262262

263263
/**
264-
* Request for a password-less login link to be sent to the guest's email address.
264+
* Request for a password-less login link to be sent to the user's email address.
265265
*
266-
* Clicking on the link in the email will log a guest in directly to the screen specified by the
266+
* Clicking on the link in the email will log a user in directly to the screen specified by the
267267
* {@link RequestLoginLinkOptions.loginLinkTo} parameter.
268268
*/
269269
public requestLoginLink(options?: RequestLoginLinkOptions): Promise<void> {

src/typings.ts

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface PrivateParams {
1010
*/
1111
cobrandClientId?: string;
1212
/**
13-
* Sets subject Id for saml session version.
13+
* Sets the subject ID for SAML AuthnRequest.
1414
*/
1515
samlSubjectId?: string;
1616
}
@@ -26,33 +26,33 @@ export type AuthnMethod = typeof supportedAuthnMethod[number];
2626

2727
export interface ConfigsOptions extends PrivateConfigsOptions {
2828
/**
29-
* Email used to pre-fill the email field in login or sign up or form.
29+
* Email address to pre-fill the email field in login or sign up or form.
3030
*
3131
* Set the default value via {@link MtLinkSdk.init}
3232
*/
3333
email?: string;
3434
/**
35-
* A redirection URL for redirecting a guest back to in the following condition:
36-
* - Guest clicks on `Back to [App Name]` button in any Moneytree screen.
37-
* - Guest refuses to give consent to access permission in the consent screen.
38-
* - Guest logs out from Moneytree via an app with this client id
39-
* - Revoke an app's consent from settings screen opened via an app with this client id
35+
* A redirection URL for redirecting a user back to in one of the following conditions:
36+
* - User clicks on `Back to [App Name]` button in any Moneytree screen.
37+
* - User refuses to give consent to access permission in the consent screen.
38+
* - User logs out from Moneytree via an app with this client ID
39+
* - User revokes consent from settings screen opened via an app with this client ID
4040
*
41-
* ⚠️ No `Back to [App Name]` button will be shown if this value is not set, and any of the actions mentioned above will redirect the guest back to login screen by default.
41+
* ⚠️ No `Back to [App Name]` button will be shown if this value is not set, and any of the actions mentioned above will redirect the user back to the login screen by default.
4242
*
4343
* Set the default value via {@link MtLinkSdk.init}
4444
*/
4545
backTo?: string;
4646
/**
47-
* Show login or sign up screen when a session does not exist during an {@link MtLinkSdk.authorize} call.
47+
* Show the login or sign up screen when a session does not exist during an {@link MtLinkSdk.authorize} call.
4848
*
4949
* Set default value via {@link MtLinkSdk.init}
5050
*
5151
* @defaultValue 'login'
5252
*/
5353
authAction?: AuthAction;
5454
/**
55-
* If you wish to disable the login to sign up form toggle button and vice-versa in the auth screen, set this to `false`.
55+
* If you wish to disable the `Login to Sign up` form toggle button and vice-versa in the auth screen, set this to `false`.
5656
*
5757
* Set default value via {@link MtLinkSdk.init}
5858
*
@@ -68,15 +68,15 @@ export interface ConfigsOptions extends PrivateConfigsOptions {
6868
*/
6969
showRememberMe?: boolean;
7070
/**
71-
* Call method and open/render in a new browser tab, by default all views open in the same tab.
71+
* Call method and open/render in a new browser tab. By default all views open in the same tab.
7272
*
7373
* Set default value via {@link MtLinkSdk.init}
7474
*
7575
* @defaultValue false
7676
*/
7777
isNewTab?: boolean;
7878
/**
79-
* Force existing guest session to logout and call authorize with a clean state.
79+
* Force existing user session to logout and call authorize with a clean state.
8080
* @defaultValue false
8181
*/
8282
forceLogout?: boolean;
@@ -194,8 +194,8 @@ export interface OAuthSharedParams {
194194
/**
195195
* The state parameter for OAuth flows, see [here](https://auth0.com/docs/protocols/oauth2/oauth-state) for more details.
196196
*
197-
* If you generates an identifier for the OAuth authorization on your server make sure to set this value explicitly so
198-
* that you can use to acquire the access token after the OAuth redirect occurs.
197+
* If you generate an identifier for the OAuth authorization on your server make sure to set this value explicitly so
198+
* that you can use it to acquire the access token after the OAuth redirect occurs.
199199
*
200200
* The default value is a randomly generated [uuid](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)), or set via {@link MtLinkSdk.init}
201201
*/
@@ -227,7 +227,7 @@ export interface AuthorizeOptions extends OAuthSharedParams, ConfigsOptions, Aut
227227
* - request_refresh
228228
* - life_insurance_read
229229
*
230-
* See the [LINK Platform documenation](https://docs.link.getmoneytree.com/docs/api-scopes) for more details
230+
* See the [LINK Platform documentation](https://docs.link.getmoneytree.com/docs/api-scopes) for more details
231231
*
232232
* @defaultValue `'guest_read'`, or set via {@link MtLinkSdk.init}
233233
*/
@@ -254,12 +254,13 @@ export type InitOptions = Omit<Omit<Omit<AuthorizeOptions, 'forceLogout'>, 'code
254254
/**
255255
* Environment for the SDK to connect to, the SDK will connect to the Moneytree production server by default.
256256
* - Moneytree clients should use `staging` for development as `develop` may contain unstable features.
257-
* - `local` is only for SDK development as it has local dependencies.
257+
* - `local` is only for SDK development by Moneytree engineers.
258258
*/
259259
mode?: Mode;
260260
/**
261-
* Force Moneytree to load content in this specific locale. A default value will be auto detected based on guest
262-
* languages configurations and location if available.
261+
* Force Moneytree to load content in this specific locale.
262+
*
263+
* A default value will be auto detected based on the user's language configuration and location if available.
263264
* Check this [spec](https://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1) for more information.
264265
*
265266
* Currently supported values are:`'en'`, `'en-AU'`, `'ja'`.
@@ -312,9 +313,9 @@ export type ServiceId = 'vault' | 'myaccount' | 'link-kit';
312313

313314
/**
314315
* - `settings` - Main Moneytree account settings screen.
315-
* - `settings/authorized-applications` - List of apps currently connected to Moneytree.
316+
* - `settings/authorized-applications` - List of apps currently connected to the Moneytree account.
316317
* - `settings/change-language` - Change Moneytree account language screen.
317-
* - `settings/email-preferences` - Change Moneytree email preferences screen
318+
* - `settings/email-preferences` - Change Moneytree account email preferences screen.
318319
* - `settings/delete-account` - Delete Moneytree account screen.
319320
* - `settings/update-email` - Change Moneytree account email screen.
320321
* - `settings/update-password` - Change Moneytree account password screen.
@@ -335,13 +336,13 @@ export interface RequestLoginLinkOptions extends ConfigsOptions {
335336
export interface TokenInfo {
336337
/** token issuer */
337338
iss: string;
338-
/** token cretaion time */
339+
/** token creation time */
339340
iat: number;
340341
/** token expiry */
341342
exp: number;
342343
/** token audience(s) */
343344
aud: string[];
344-
/** token subject - the moneytree ide fo the user */
345+
/** token subject - the Moneytree ID of the user */
345346
sub: null | string;
346347
scope: string;
347348
client_id: null | string;
@@ -361,13 +362,17 @@ export interface TokenInfo {
361362
};
362363
}
363364

365+
/** OAuth Access Token Response described in [RFC 6749 section 5.1](https://datatracker.ietf.org/doc/html/rfc6749#section-5.1) */
364366
export interface Token {
365367
access_token: string;
366368
refresh_token: string;
367369
token_type: string;
368-
/** created at in seconds */
370+
/** Creation time of the token, unix timpstamp in seconds */
369371
created_at: number;
370-
/** expiry in seconds */
372+
/**
373+
* The lifetime in seconds of the access token.
374+
* For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.
375+
*/
371376
expires_in: number;
372377
scope: string;
373378
resource_server: string;

0 commit comments

Comments
 (0)