@enyo-energy/energy-app-sdk 0.0.178 → 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.
@@ -14,6 +14,24 @@ export interface EnergyAppCharge {
14
14
  findActiveCharge: (applianceId: string) => Promise<EnyoCharge | null>;
15
15
  /** Find the currently active charge by appliance ID and transaction ID */
16
16
  findActiveChargeByTransactionId: (applianceId: string, transactionId: string) => Promise<EnyoCharge | null>;
17
+ /**
18
+ * Adds an additional transaction ID to the currently active charging
19
+ * session of an appliance.
20
+ *
21
+ * A single physical charging session can span multiple OCPP
22
+ * transactions (e.g. after a short interruption or re-authorization).
23
+ * Use this to associate a newly started transaction with the charge
24
+ * that is already active for the given appliance. The transaction ID is
25
+ * appended to {@link EnyoCharge.additionalTransactionIds}.
26
+ *
27
+ * **Required permission:** `EnergyManager`.
28
+ *
29
+ * @param applianceId - The appliance (charger) whose active charge should be updated.
30
+ * @param transactionId - The additional transaction ID to associate with the active charge.
31
+ * @returns Promise that resolves once the transaction ID has been added.
32
+ * Resolves without effect if no active charge exists for the appliance.
33
+ */
34
+ addTransactionIdToActiveCharge: (applianceId: string, transactionId: string) => Promise<void>;
17
35
  /**
18
36
  * Sets the default charging mode for a specific appliance, optionally
19
37
  * with a target completion time and its timezone.
@@ -38,6 +38,15 @@ export interface EnyoCharge {
38
38
  id: string;
39
39
  /** Transaction ID for the charging session */
40
40
  transactionId: string;
41
+ /**
42
+ * Additional transaction IDs associated with this charging session.
43
+ *
44
+ * A single physical charging session can span multiple OCPP
45
+ * transactions (e.g. after a short interruption or re-authorization).
46
+ * These supplementary transaction IDs are tracked here in addition to
47
+ * the primary {@link EnyoCharge.transactionId}.
48
+ */
49
+ additionalTransactionIds?: string[];
41
50
  /** ID of the appliance (charger) handling this session */
42
51
  applianceId: string;
43
52
  /** ID of the charging card used for this session */
@@ -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.178';
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.178";
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.
@@ -14,6 +14,24 @@ export interface EnergyAppCharge {
14
14
  findActiveCharge: (applianceId: string) => Promise<EnyoCharge | null>;
15
15
  /** Find the currently active charge by appliance ID and transaction ID */
16
16
  findActiveChargeByTransactionId: (applianceId: string, transactionId: string) => Promise<EnyoCharge | null>;
17
+ /**
18
+ * Adds an additional transaction ID to the currently active charging
19
+ * session of an appliance.
20
+ *
21
+ * A single physical charging session can span multiple OCPP
22
+ * transactions (e.g. after a short interruption or re-authorization).
23
+ * Use this to associate a newly started transaction with the charge
24
+ * that is already active for the given appliance. The transaction ID is
25
+ * appended to {@link EnyoCharge.additionalTransactionIds}.
26
+ *
27
+ * **Required permission:** `EnergyManager`.
28
+ *
29
+ * @param applianceId - The appliance (charger) whose active charge should be updated.
30
+ * @param transactionId - The additional transaction ID to associate with the active charge.
31
+ * @returns Promise that resolves once the transaction ID has been added.
32
+ * Resolves without effect if no active charge exists for the appliance.
33
+ */
34
+ addTransactionIdToActiveCharge: (applianceId: string, transactionId: string) => Promise<void>;
17
35
  /**
18
36
  * Sets the default charging mode for a specific appliance, optionally
19
37
  * with a target completion time and its timezone.
@@ -38,6 +38,15 @@ export interface EnyoCharge {
38
38
  id: string;
39
39
  /** Transaction ID for the charging session */
40
40
  transactionId: string;
41
+ /**
42
+ * Additional transaction IDs associated with this charging session.
43
+ *
44
+ * A single physical charging session can span multiple OCPP
45
+ * transactions (e.g. after a short interruption or re-authorization).
46
+ * These supplementary transaction IDs are tracked here in addition to
47
+ * the primary {@link EnyoCharge.transactionId}.
48
+ */
49
+ additionalTransactionIds?: string[];
41
50
  /** ID of the appliance (charger) handling this session */
42
51
  applianceId: string;
43
52
  /** ID of the charging card used for this session */
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.178";
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.178';
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.178",
3
+ "version": "0.0.180",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",