@enyo-energy/energy-app-sdk 0.0.40 → 0.0.42

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.
@@ -76,7 +76,7 @@ export declare class ApplianceManager {
76
76
  * @param config Configuration options for the manager
77
77
  * @returns Promise that resolves to an initialized ApplianceManager instance
78
78
  */
79
- private static initialize;
79
+ static initialize(energyApp: EnergyApp, config?: ApplianceManagerConfig): Promise<ApplianceManager>;
80
80
  /**
81
81
  * Creates or updates an appliance with the given configuration.
82
82
  * Automatically detects if an appliance already exists based on the identifier strategy.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdentifierStrategyFactory = exports.FallbackIdentifierStrategy = exports.CompositeIdentifierStrategy = exports.CustomMetadataStrategy = exports.SerialNumberStrategy = void 0;
3
+ exports.IdentifierStrategyFactory = exports.FallbackIdentifierStrategy = exports.CompositeIdentifierStrategy = exports.CustomMetadataStrategy = exports.TypeStrategy = exports.SerialNumberStrategy = void 0;
4
4
  /**
5
5
  * Strategy that uses the appliance's serial number as the identifier.
6
6
  * Useful when appliances can move between network devices.
@@ -17,6 +17,22 @@ class SerialNumberStrategy {
17
17
  }
18
18
  }
19
19
  exports.SerialNumberStrategy = SerialNumberStrategy;
20
+ /**
21
+ * Strategy that uses the appliance's serial number as the identifier.
22
+ * Useful when appliances can move between network devices.
23
+ */
24
+ class TypeStrategy {
25
+ name = 'type';
26
+ /**
27
+ * Extracts the serial number from the appliance metadata.
28
+ * @param appliance The appliance to extract the serial number from
29
+ * @returns The serial number or undefined
30
+ */
31
+ extract(appliance) {
32
+ return appliance.type;
33
+ }
34
+ }
35
+ exports.TypeStrategy = TypeStrategy;
20
36
  /**
21
37
  * Strategy that uses a custom metadata field as the identifier.
22
38
  * Allows using any field from the appliance metadata.
@@ -120,6 +136,12 @@ class IdentifierStrategyFactory {
120
136
  static serialNumber() {
121
137
  return new SerialNumberStrategy();
122
138
  }
139
+ /**
140
+ * Creates a serial number strategy.
141
+ */
142
+ static type() {
143
+ return new TypeStrategy();
144
+ }
123
145
  /**
124
146
  * Creates a custom metadata field strategy.
125
147
  * @param fieldName The metadata field to use
@@ -29,6 +29,19 @@ export declare class SerialNumberStrategy implements IdentifierStrategy {
29
29
  */
30
30
  extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
31
31
  }
32
+ /**
33
+ * Strategy that uses the appliance's serial number as the identifier.
34
+ * Useful when appliances can move between network devices.
35
+ */
36
+ export declare class TypeStrategy implements IdentifierStrategy {
37
+ name: string;
38
+ /**
39
+ * Extracts the serial number from the appliance metadata.
40
+ * @param appliance The appliance to extract the serial number from
41
+ * @returns The serial number or undefined
42
+ */
43
+ extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
44
+ }
32
45
  /**
33
46
  * Strategy that uses a custom metadata field as the identifier.
34
47
  * Allows using any field from the appliance metadata.
@@ -96,6 +109,10 @@ export declare class IdentifierStrategyFactory {
96
109
  * Creates a serial number strategy.
97
110
  */
98
111
  static serialNumber(): SerialNumberStrategy;
112
+ /**
113
+ * Creates a serial number strategy.
114
+ */
115
+ static type(): SerialNumberStrategy;
99
116
  /**
100
117
  * Creates a custom metadata field strategy.
101
118
  * @param fieldName The metadata field to use
@@ -17,7 +17,7 @@ export interface EnergyAppSecretManager {
17
17
  * // Returns: { client_id: "...", client_secret: "..." }
18
18
  * ```
19
19
  */
20
- getSecret(secretName: string, encryptionKey: string): Promise<SecretValue>;
20
+ getSecret<T>(secretName: string, encryptionKey: string): Promise<T>;
21
21
  /**
22
22
  * Retrieves and decrypts multiple secrets from the developer organization's secret store in a single request.
23
23
  * This is more efficient than making multiple individual requests.
@@ -22,9 +22,7 @@ export interface EnergyTariffConstantPricing {
22
22
  /** Optional fixed price per kWh for grid feed-in */
23
23
  feedInPricePerKwh?: number;
24
24
  /** Start of validity period in ISO format */
25
- validFromIso: string;
26
- /** End of validity period in ISO format (optional for indefinite validity) */
27
- validUntilIso?: string;
25
+ validFromIso?: string;
28
26
  }
29
27
  /**
30
28
  * Represents interval-based pricing structure (15min or 1hr intervals)
@@ -34,10 +32,6 @@ export interface EnergyTariffIntervalPricing {
34
32
  interval: EnergyTariffInterval;
35
33
  /** Array of price points for the specified intervals */
36
34
  pricePoints: EnergyTariffPricePoint[];
37
- /** Start date for which these intervals are valid in ISO format */
38
- validFromIso: string;
39
- /** End date for which these intervals are valid in ISO format */
40
- validUntilIso: string;
41
35
  }
42
36
  /**
43
37
  * Union type for different pricing data structures
@@ -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.40';
12
+ exports.SDK_VERSION = '0.0.42';
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.40";
8
+ export declare const SDK_VERSION = "0.0.42";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -76,7 +76,7 @@ export declare class ApplianceManager {
76
76
  * @param config Configuration options for the manager
77
77
  * @returns Promise that resolves to an initialized ApplianceManager instance
78
78
  */
79
- private static initialize;
79
+ static initialize(energyApp: EnergyApp, config?: ApplianceManagerConfig): Promise<ApplianceManager>;
80
80
  /**
81
81
  * Creates or updates an appliance with the given configuration.
82
82
  * Automatically detects if an appliance already exists based on the identifier strategy.
@@ -29,6 +29,19 @@ export declare class SerialNumberStrategy implements IdentifierStrategy {
29
29
  */
30
30
  extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
31
31
  }
32
+ /**
33
+ * Strategy that uses the appliance's serial number as the identifier.
34
+ * Useful when appliances can move between network devices.
35
+ */
36
+ export declare class TypeStrategy implements IdentifierStrategy {
37
+ name: string;
38
+ /**
39
+ * Extracts the serial number from the appliance metadata.
40
+ * @param appliance The appliance to extract the serial number from
41
+ * @returns The serial number or undefined
42
+ */
43
+ extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
44
+ }
32
45
  /**
33
46
  * Strategy that uses a custom metadata field as the identifier.
34
47
  * Allows using any field from the appliance metadata.
@@ -96,6 +109,10 @@ export declare class IdentifierStrategyFactory {
96
109
  * Creates a serial number strategy.
97
110
  */
98
111
  static serialNumber(): SerialNumberStrategy;
112
+ /**
113
+ * Creates a serial number strategy.
114
+ */
115
+ static type(): SerialNumberStrategy;
99
116
  /**
100
117
  * Creates a custom metadata field strategy.
101
118
  * @param fieldName The metadata field to use
@@ -13,6 +13,21 @@ export class SerialNumberStrategy {
13
13
  return appliance.metadata?.serialNumber;
14
14
  }
15
15
  }
16
+ /**
17
+ * Strategy that uses the appliance's serial number as the identifier.
18
+ * Useful when appliances can move between network devices.
19
+ */
20
+ export class TypeStrategy {
21
+ name = 'type';
22
+ /**
23
+ * Extracts the serial number from the appliance metadata.
24
+ * @param appliance The appliance to extract the serial number from
25
+ * @returns The serial number or undefined
26
+ */
27
+ extract(appliance) {
28
+ return appliance.type;
29
+ }
30
+ }
16
31
  /**
17
32
  * Strategy that uses a custom metadata field as the identifier.
18
33
  * Allows using any field from the appliance metadata.
@@ -113,6 +128,12 @@ export class IdentifierStrategyFactory {
113
128
  static serialNumber() {
114
129
  return new SerialNumberStrategy();
115
130
  }
131
+ /**
132
+ * Creates a serial number strategy.
133
+ */
134
+ static type() {
135
+ return new TypeStrategy();
136
+ }
116
137
  /**
117
138
  * Creates a custom metadata field strategy.
118
139
  * @param fieldName The metadata field to use
@@ -17,7 +17,7 @@ export interface EnergyAppSecretManager {
17
17
  * // Returns: { client_id: "...", client_secret: "..." }
18
18
  * ```
19
19
  */
20
- getSecret(secretName: string, encryptionKey: string): Promise<SecretValue>;
20
+ getSecret<T>(secretName: string, encryptionKey: string): Promise<T>;
21
21
  /**
22
22
  * Retrieves and decrypts multiple secrets from the developer organization's secret store in a single request.
23
23
  * This is more efficient than making multiple individual requests.
@@ -22,9 +22,7 @@ export interface EnergyTariffConstantPricing {
22
22
  /** Optional fixed price per kWh for grid feed-in */
23
23
  feedInPricePerKwh?: number;
24
24
  /** Start of validity period in ISO format */
25
- validFromIso: string;
26
- /** End of validity period in ISO format (optional for indefinite validity) */
27
- validUntilIso?: string;
25
+ validFromIso?: string;
28
26
  }
29
27
  /**
30
28
  * Represents interval-based pricing structure (15min or 1hr intervals)
@@ -34,10 +32,6 @@ export interface EnergyTariffIntervalPricing {
34
32
  interval: EnergyTariffInterval;
35
33
  /** Array of price points for the specified intervals */
36
34
  pricePoints: EnergyTariffPricePoint[];
37
- /** Start date for which these intervals are valid in ISO format */
38
- validFromIso: string;
39
- /** End date for which these intervals are valid in ISO format */
40
- validUntilIso: string;
41
35
  }
42
36
  /**
43
37
  * Union type for different pricing data structures
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.40";
8
+ export declare const SDK_VERSION = "0.0.42";
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.40';
8
+ export const SDK_VERSION = '0.0.42';
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.40",
3
+ "version": "0.0.42",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",