@teamhanko/hanko-frontend-sdk 1.4.0 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamhanko/hanko-frontend-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,61 +0,0 @@
1
- import { SessionDetail } from "./events/CustomEvents";
2
- import { SessionState } from "./state/session/SessionState";
3
- import { Cookie } from "./Cookie";
4
- /**
5
- * Options for Session
6
- *
7
- * @category SDK
8
- * @subcategory Internal
9
- * @property {string} cookieName - The name of the session cookie set from the SDK.
10
- * @property {string} localStorageKey - The prefix / name of the local storage keys.
11
- */
12
- interface SessionOptions {
13
- cookieName: string;
14
- localStorageKey: string;
15
- }
16
- /**
17
- A class representing a session.
18
-
19
- @category SDK
20
- @subcategory Session
21
- @param {SessionOptions} options - The options that can be used
22
- */
23
- export declare class Session {
24
- _sessionState: SessionState;
25
- _cookie: Cookie;
26
- constructor(options: SessionOptions);
27
- /**
28
- Retrieves the session details.
29
-
30
- @returns {SessionDetail} The session details.
31
- */
32
- get(): SessionDetail;
33
- /**
34
- Checks if the user is logged in.
35
-
36
- @returns {boolean} true if the user is logged in, false otherwise.
37
- */
38
- isValid(): boolean;
39
- /**
40
- Retrieves the session details.
41
-
42
- @ignore
43
- @returns {SessionDetail} The session details.
44
- */
45
- _get(): SessionDetail;
46
- /**
47
- Checks if the auth flow is completed. The value resets after the next login attempt.
48
-
49
- @returns {boolean} Returns true if the authentication flow is completed, false otherwise
50
- */
51
- isAuthFlowCompleted(): boolean;
52
- /**
53
- Validates the session.
54
-
55
- @private
56
- @param {SessionDetail} detail - The session details to validate.
57
- @returns {boolean} true if the session is valid, false otherwise.
58
- */
59
- private static validate;
60
- }
61
- export {};
@@ -1,76 +0,0 @@
1
- import { State } from "../State";
2
- /**
3
- * Options for SessionState
4
- *
5
- * @category SDK
6
- * @subcategory Internal
7
- * @property {string} localStorageKey - The prefix / name of the local storage keys.
8
- */
9
- interface SessionStateOptions {
10
- localStorageKey: string;
11
- }
12
- /**
13
- * @interface
14
- * @category SDK
15
- * @subcategory Internal
16
- * @property {Object.<string, LocalStorageSession>} - A dictionary for mapping users to their states.
17
- */
18
- export interface LocalStorageSession {
19
- expiry: number;
20
- authFlowCompleted: boolean;
21
- }
22
- /**
23
- * A class to read and write local storage contents regarding sessions.
24
- *
25
- * @extends State
26
- * @param {SessionStateOptions} options - The options that can be used
27
- * @category SDK
28
- * @subcategory Internal
29
- */
30
- declare class SessionState extends State {
31
- constructor(options: SessionStateOptions);
32
- /**
33
- * Reads the current state.
34
- *
35
- * @public
36
- * @return {SessionState}
37
- */
38
- read(): SessionState;
39
- /**
40
- * Gets the session state.
41
- *
42
- * @return {LocalStorageSession}
43
- */
44
- getState(): LocalStorageSession;
45
- /**
46
- * Gets the number of seconds until the active session is valid.
47
- *
48
- * @return {number}
49
- */
50
- getExpirationSeconds(): number;
51
- /**
52
- * Sets the number of seconds until the active session is valid.
53
- *
54
- * @param {number} seconds - The number of seconds
55
- * @return {SessionState}
56
- */
57
- setExpirationSeconds(seconds: number): SessionState;
58
- /**
59
- * Gets the authFlowCompleted indicator.
60
- */
61
- getAuthFlowCompleted(): boolean;
62
- /**
63
- * Sets the authFlowCompleted indicator.
64
- *
65
- * @param {string} completed - The authFlowCompleted indicator.
66
- * @return {SessionState}
67
- */
68
- setAuthFlowCompleted(completed: boolean): SessionState;
69
- /**
70
- * Removes the session details.
71
- *
72
- * @return {SessionState}
73
- */
74
- reset(): SessionState;
75
- }
76
- export { SessionState };