@enyo-energy/energy-app-sdk 0.0.179 → 0.0.180

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.
@@ -44,6 +44,24 @@ export interface EnergyAppAuthentication {
44
44
  * @returns Promise that resolves to the current authentication state
45
45
  */
46
46
  getAuthenticationState(): Promise<EnyoAuthenticateState>;
47
+ /**
48
+ * Manually sets the current authentication state.
49
+ *
50
+ * Use this when the package manages authentication on its own instead of (or in addition to)
51
+ * the standard {@link EnergyAppAuthentication.requestAuthentication} / {@link EnergyAppAuthentication.listenForAuthenticationResponse}
52
+ * flow — for example when validating a stored session on startup, after refreshing a token,
53
+ * or when reacting to an external authentication event. The provided state is persisted by the
54
+ * host and becomes the value returned by {@link EnergyAppAuthentication.getAuthenticationState}.
55
+ *
56
+ * Setting the state to {@link EnyoAuthenticationStateEnum.Unauthenticated} does not trigger the
57
+ * registered sign-out listeners; use {@link EnergyAppAuthentication.signOut} for an explicit,
58
+ * listener-notifying sign-out.
59
+ *
60
+ * @param state - The authentication state to apply, including the desired {@link EnyoAuthenticationStateEnum},
61
+ * and optionally the account/user name and the request ID that produced it
62
+ * @returns Promise that resolves once the state has been applied by the host
63
+ */
64
+ setAuthenticationState(state: EnyoAuthenticateState): Promise<void>;
47
65
  /**
48
66
  * Signs the user out and updates the authentication state.
49
67
  * This will trigger any registered sign-out listeners.
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
9
9
  /**
10
10
  * Current version of the enyo Energy App SDK.
11
11
  */
12
- exports.SDK_VERSION = '0.0.179';
12
+ exports.SDK_VERSION = '0.0.180';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.179";
8
+ export declare const SDK_VERSION = "0.0.180";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -44,6 +44,24 @@ export interface EnergyAppAuthentication {
44
44
  * @returns Promise that resolves to the current authentication state
45
45
  */
46
46
  getAuthenticationState(): Promise<EnyoAuthenticateState>;
47
+ /**
48
+ * Manually sets the current authentication state.
49
+ *
50
+ * Use this when the package manages authentication on its own instead of (or in addition to)
51
+ * the standard {@link EnergyAppAuthentication.requestAuthentication} / {@link EnergyAppAuthentication.listenForAuthenticationResponse}
52
+ * flow — for example when validating a stored session on startup, after refreshing a token,
53
+ * or when reacting to an external authentication event. The provided state is persisted by the
54
+ * host and becomes the value returned by {@link EnergyAppAuthentication.getAuthenticationState}.
55
+ *
56
+ * Setting the state to {@link EnyoAuthenticationStateEnum.Unauthenticated} does not trigger the
57
+ * registered sign-out listeners; use {@link EnergyAppAuthentication.signOut} for an explicit,
58
+ * listener-notifying sign-out.
59
+ *
60
+ * @param state - The authentication state to apply, including the desired {@link EnyoAuthenticationStateEnum},
61
+ * and optionally the account/user name and the request ID that produced it
62
+ * @returns Promise that resolves once the state has been applied by the host
63
+ */
64
+ setAuthenticationState(state: EnyoAuthenticateState): Promise<void>;
47
65
  /**
48
66
  * Signs the user out and updates the authentication state.
49
67
  * This will trigger any registered sign-out listeners.
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.179";
8
+ export declare const SDK_VERSION = "0.0.180";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '0.0.179';
8
+ export const SDK_VERSION = '0.0.180';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/energy-app-sdk",
3
- "version": "0.0.179",
3
+ "version": "0.0.180",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",