@idosgames/core 0.1.2 → 0.1.4
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/index.cjs +2 -2
- package/dist/index.d.cts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +2 -2
- package/package.json +58 -58
package/dist/index.d.cts
CHANGED
|
@@ -2960,10 +2960,28 @@ declare class AuthenticationService {
|
|
|
2960
2960
|
private readonly ctx;
|
|
2961
2961
|
private authContext;
|
|
2962
2962
|
private refreshing;
|
|
2963
|
+
private rememberSession;
|
|
2964
|
+
private sessionAuthType;
|
|
2965
|
+
private sessionEmail;
|
|
2966
|
+
private sessionPassword;
|
|
2963
2967
|
constructor(ctx: ClientContext);
|
|
2964
2968
|
get context(): AuthContext | null;
|
|
2965
2969
|
get isLoggedIn(): boolean;
|
|
2970
|
+
/** The PERSISTED login method — what a cold start would replay. `None` = nothing to replay. */
|
|
2966
2971
|
get lastAuthType(): AuthType;
|
|
2972
|
+
/**
|
|
2973
|
+
* "Remember me" — call BEFORE a login method (it is read when the login completes).
|
|
2974
|
+
*
|
|
2975
|
+
* On (the default, and the behaviour of every release before this one) a successful login is
|
|
2976
|
+
* written to storage, so the next launch signs the player back in silently. Off, nothing is
|
|
2977
|
+
* written and the next launch opens on the login screen — and any previously remembered session
|
|
2978
|
+
* is dropped, so a player who unticks the box on a shared machine is not left behind on disk.
|
|
2979
|
+
*
|
|
2980
|
+
* Off does NOT weaken the current session: the credentials stay in memory for this tab, so the
|
|
2981
|
+
* transport's automatic 401 re-login still works.
|
|
2982
|
+
*/
|
|
2983
|
+
setRememberSession(remember: boolean): void;
|
|
2984
|
+
get remembersSession(): boolean;
|
|
2967
2985
|
private baseRequest;
|
|
2968
2986
|
loginWithDeviceID(): Promise<OperationResult<ClientState>>;
|
|
2969
2987
|
loginWithTelegram(): Promise<OperationResult<ClientState>>;
|
|
@@ -2997,11 +3015,28 @@ declare class AuthenticationService {
|
|
|
2997
3015
|
* login method themselves in that case.
|
|
2998
3016
|
*/
|
|
2999
3017
|
autoLogin(): Promise<OperationResult<ClientState>>;
|
|
3000
|
-
|
|
3018
|
+
private replay;
|
|
3019
|
+
/**
|
|
3020
|
+
* Registered with the transport: a 401 transparently triggers one re-login + retry.
|
|
3021
|
+
*
|
|
3022
|
+
* Reads the SESSION tier first so a player who declined "remember me" still recovers from an
|
|
3023
|
+
* expired ticket; it falls back to the persisted tier for a client that has not logged in yet
|
|
3024
|
+
* this tab (a 401 on the very first call after a cold start).
|
|
3025
|
+
*/
|
|
3001
3026
|
refreshSession(): Promise<string | null>;
|
|
3027
|
+
/**
|
|
3028
|
+
* Ends the session and forgets it on both tiers.
|
|
3029
|
+
*
|
|
3030
|
+
* Clearing storage is deliberate: without it a logout did not survive a reload — the next launch
|
|
3031
|
+
* replayed the very account the player had just left, which on a shared machine is the one moment
|
|
3032
|
+
* it must not do that. To sign out but stay remembered, do not call this.
|
|
3033
|
+
*/
|
|
3002
3034
|
logout(): void;
|
|
3003
3035
|
static isValidEmail(email: string): boolean;
|
|
3004
3036
|
static isValidPasswordLength(password: string): boolean;
|
|
3037
|
+
/** Email/password go to the session tier always, to storage only when remembering. */
|
|
3038
|
+
private keepEmailCredentials;
|
|
3039
|
+
private forgetSession;
|
|
3005
3040
|
private applyAuthContext;
|
|
3006
3041
|
private fetchAndApplyClientState;
|
|
3007
3042
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2960,10 +2960,28 @@ declare class AuthenticationService {
|
|
|
2960
2960
|
private readonly ctx;
|
|
2961
2961
|
private authContext;
|
|
2962
2962
|
private refreshing;
|
|
2963
|
+
private rememberSession;
|
|
2964
|
+
private sessionAuthType;
|
|
2965
|
+
private sessionEmail;
|
|
2966
|
+
private sessionPassword;
|
|
2963
2967
|
constructor(ctx: ClientContext);
|
|
2964
2968
|
get context(): AuthContext | null;
|
|
2965
2969
|
get isLoggedIn(): boolean;
|
|
2970
|
+
/** The PERSISTED login method — what a cold start would replay. `None` = nothing to replay. */
|
|
2966
2971
|
get lastAuthType(): AuthType;
|
|
2972
|
+
/**
|
|
2973
|
+
* "Remember me" — call BEFORE a login method (it is read when the login completes).
|
|
2974
|
+
*
|
|
2975
|
+
* On (the default, and the behaviour of every release before this one) a successful login is
|
|
2976
|
+
* written to storage, so the next launch signs the player back in silently. Off, nothing is
|
|
2977
|
+
* written and the next launch opens on the login screen — and any previously remembered session
|
|
2978
|
+
* is dropped, so a player who unticks the box on a shared machine is not left behind on disk.
|
|
2979
|
+
*
|
|
2980
|
+
* Off does NOT weaken the current session: the credentials stay in memory for this tab, so the
|
|
2981
|
+
* transport's automatic 401 re-login still works.
|
|
2982
|
+
*/
|
|
2983
|
+
setRememberSession(remember: boolean): void;
|
|
2984
|
+
get remembersSession(): boolean;
|
|
2967
2985
|
private baseRequest;
|
|
2968
2986
|
loginWithDeviceID(): Promise<OperationResult<ClientState>>;
|
|
2969
2987
|
loginWithTelegram(): Promise<OperationResult<ClientState>>;
|
|
@@ -2997,11 +3015,28 @@ declare class AuthenticationService {
|
|
|
2997
3015
|
* login method themselves in that case.
|
|
2998
3016
|
*/
|
|
2999
3017
|
autoLogin(): Promise<OperationResult<ClientState>>;
|
|
3000
|
-
|
|
3018
|
+
private replay;
|
|
3019
|
+
/**
|
|
3020
|
+
* Registered with the transport: a 401 transparently triggers one re-login + retry.
|
|
3021
|
+
*
|
|
3022
|
+
* Reads the SESSION tier first so a player who declined "remember me" still recovers from an
|
|
3023
|
+
* expired ticket; it falls back to the persisted tier for a client that has not logged in yet
|
|
3024
|
+
* this tab (a 401 on the very first call after a cold start).
|
|
3025
|
+
*/
|
|
3001
3026
|
refreshSession(): Promise<string | null>;
|
|
3027
|
+
/**
|
|
3028
|
+
* Ends the session and forgets it on both tiers.
|
|
3029
|
+
*
|
|
3030
|
+
* Clearing storage is deliberate: without it a logout did not survive a reload — the next launch
|
|
3031
|
+
* replayed the very account the player had just left, which on a shared machine is the one moment
|
|
3032
|
+
* it must not do that. To sign out but stay remembered, do not call this.
|
|
3033
|
+
*/
|
|
3002
3034
|
logout(): void;
|
|
3003
3035
|
static isValidEmail(email: string): boolean;
|
|
3004
3036
|
static isValidPasswordLength(password: string): boolean;
|
|
3037
|
+
/** Email/password go to the session tier always, to storage only when remembering. */
|
|
3038
|
+
private keepEmailCredentials;
|
|
3039
|
+
private forgetSession;
|
|
3005
3040
|
private applyAuthContext;
|
|
3006
3041
|
private fetchAndApplyClientState;
|
|
3007
3042
|
}
|