@enyo-energy/energy-app-sdk 0.0.37 → 0.0.39

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.
Files changed (47) hide show
  1. package/dist/cjs/implementations/appliances/appliance-manager.cjs +399 -0
  2. package/dist/cjs/implementations/appliances/appliance-manager.d.cts +191 -0
  3. package/dist/cjs/implementations/appliances/identifier-strategies.cjs +180 -0
  4. package/dist/cjs/implementations/appliances/identifier-strategies.d.cts +140 -0
  5. package/dist/cjs/implementations/appliances/in-memory-appliance-manager.cjs +281 -0
  6. package/dist/cjs/implementations/appliances/in-memory-appliance-manager.d.cts +119 -0
  7. package/dist/cjs/implementations/data-bus/demo-data-bus.cjs +246 -0
  8. package/dist/cjs/implementations/data-bus/demo-data-bus.d.cts +111 -0
  9. package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.d.cts +2 -2
  10. package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.cjs +76 -0
  11. package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.cts +31 -1
  12. package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.d.cts +2 -2
  13. package/dist/cjs/implementations/modbus/interfaces.d.cts +7 -93
  14. package/dist/cjs/implementations/modbus/sunspec/sunspec-devices.cjs +342 -0
  15. package/dist/cjs/implementations/modbus/sunspec/sunspec-devices.d.cts +95 -0
  16. package/dist/cjs/implementations/modbus/sunspec/sunspec-modbus-client.cjs +433 -0
  17. package/dist/cjs/implementations/modbus/sunspec/sunspec-modbus-client.d.cts +171 -0
  18. package/dist/cjs/index.cjs +2 -3
  19. package/dist/cjs/index.d.cts +2 -3
  20. package/dist/cjs/types/enyo-data-bus-value.d.cts +2 -1
  21. package/dist/cjs/version.cjs +1 -1
  22. package/dist/cjs/version.d.cts +1 -1
  23. package/dist/implementations/appliances/appliance-manager.d.ts +191 -0
  24. package/dist/implementations/appliances/appliance-manager.js +395 -0
  25. package/dist/implementations/appliances/demo-appliance-manager.d.ts +118 -0
  26. package/dist/implementations/appliances/demo-appliance-manager.js +277 -0
  27. package/dist/implementations/appliances/identifier-strategies.d.ts +140 -0
  28. package/dist/implementations/appliances/identifier-strategies.js +171 -0
  29. package/dist/implementations/appliances/in-memory-appliance-manager.d.ts +119 -0
  30. package/dist/implementations/appliances/in-memory-appliance-manager.js +277 -0
  31. package/dist/implementations/data-bus/demo-data-bus.d.ts +111 -0
  32. package/dist/implementations/data-bus/demo-data-bus.js +242 -0
  33. package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.d.ts +2 -2
  34. package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.ts +31 -1
  35. package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.js +76 -0
  36. package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.d.ts +2 -2
  37. package/dist/implementations/modbus/interfaces.d.ts +7 -93
  38. package/dist/implementations/modbus/sunspec/sunspec-devices.d.ts +95 -0
  39. package/dist/implementations/modbus/sunspec/sunspec-devices.js +335 -0
  40. package/dist/implementations/modbus/sunspec/sunspec-modbus-client.d.ts +171 -0
  41. package/dist/implementations/modbus/sunspec/sunspec-modbus-client.js +429 -0
  42. package/dist/index.d.ts +2 -3
  43. package/dist/index.js +2 -3
  44. package/dist/types/enyo-data-bus-value.d.ts +2 -1
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.js +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,118 @@
1
+ import type { EnergyApp } from "../../index.js";
2
+ import { EnyoAppliance, EnyoApplianceConnectionType, EnyoApplianceMetadata, EnyoApplianceStateEnum, EnyoApplianceTypeEnum } from "../../types/enyo-appliance.js";
3
+ import { ApplianceConfig, ApplianceManager, ApplianceManagerConfig, FindResult } from "./appliance-manager.js";
4
+ import { IdentifierStrategy } from "./identifier-strategies.js";
5
+ /**
6
+ * Demo implementation of ApplianceManager that stores all data in memory.
7
+ * This class provides the same interface as ApplianceManager but doesn't
8
+ * use energyApp.useAppliances() for persistence.
9
+ */
10
+ export declare class DemoApplianceManager extends ApplianceManager {
11
+ private memoryStore;
12
+ private nextId;
13
+ private networkDevicesStore;
14
+ /**
15
+ * Creates a new DemoApplianceManager instance.
16
+ * @param energyApp The EnergyApp instance (not used for persistence in demo)
17
+ * @param config Configuration options for the manager
18
+ */
19
+ constructor(energyApp: EnergyApp, config?: ApplianceManagerConfig);
20
+ /**
21
+ * Creates or updates an appliance in memory.
22
+ * @param config The appliance configuration
23
+ * @param existingApplianceId Optional ID of an existing appliance to update
24
+ * @returns The ID of the created or updated appliance
25
+ */
26
+ createOrUpdateAppliance(config: ApplianceConfig, existingApplianceId?: string): Promise<string>;
27
+ /**
28
+ * Gets an appliance by ID from memory.
29
+ * @param applianceId The ID of the appliance
30
+ * @returns The appliance or null if not found
31
+ */
32
+ getApplianceById(applianceId: string): Promise<EnyoAppliance | null>;
33
+ /**
34
+ * Gets all appliances from memory.
35
+ * @returns Array of all appliances
36
+ */
37
+ getAllAppliances(): Promise<EnyoAppliance[]>;
38
+ /**
39
+ * Gets network devices associated with an appliance.
40
+ * @param appliance The appliance
41
+ * @returns Array of network devices
42
+ */
43
+ private getNetworkDevicesForAppliance;
44
+ /**
45
+ * Finds appliances by their identifier using the configured strategy.
46
+ * @param identifier The identifier to search for
47
+ * @returns Array of matching appliances
48
+ */
49
+ findByIdentifier(identifier: string): Promise<EnyoAppliance[]>;
50
+ /**
51
+ * Finds an appliance using multiple strategies.
52
+ * @param searchValue The value to search for
53
+ * @param strategies Array of strategies to try
54
+ * @returns The first matching result or undefined
55
+ */
56
+ findWithStrategies(searchValue: string, strategies: IdentifierStrategy[]): Promise<FindResult | undefined>;
57
+ /**
58
+ * Gets all appliances of a specific type.
59
+ * @param type The appliance type to filter by
60
+ * @returns Array of appliances of the specified type
61
+ */
62
+ getAppliancesByType(type: EnyoApplianceTypeEnum): Promise<EnyoAppliance[]>;
63
+ /**
64
+ * Updates the state of an appliance in memory.
65
+ * @param applianceId The ID of the appliance to update
66
+ * @param connectionType The new connection type
67
+ * @param state The new state
68
+ */
69
+ updateApplianceState(applianceId: string, connectionType: EnyoApplianceConnectionType, state: EnyoApplianceStateEnum): Promise<void>;
70
+ /**
71
+ * Updates metadata for an appliance in memory.
72
+ * @param applianceId The ID of the appliance
73
+ * @param metadata The metadata to update
74
+ */
75
+ updateApplianceMetadata(applianceId: string, metadata: Partial<EnyoApplianceMetadata> & {
76
+ connectionType: EnyoApplianceConnectionType;
77
+ }): Promise<void>;
78
+ /**
79
+ * Removes an appliance from memory.
80
+ * @param applianceId The ID of the appliance to remove
81
+ */
82
+ removeAppliance(applianceId: string): Promise<void>;
83
+ /**
84
+ * Performs a bulk update on multiple appliances in memory.
85
+ * @param updates Array of updates to perform
86
+ * @returns Results of the bulk update operation
87
+ */
88
+ bulkUpdate(updates: Array<{
89
+ applianceId: string;
90
+ data: Partial<Omit<EnyoAppliance, 'id'>>;
91
+ }>): Promise<{
92
+ succeeded: string[];
93
+ failed: string[];
94
+ }>;
95
+ /**
96
+ * Gets statistics about the managed appliances in memory.
97
+ * @returns Statistics object
98
+ */
99
+ getStatistics(): Promise<{
100
+ total: number;
101
+ byType: Record<string, number>;
102
+ byState: Record<string, number>;
103
+ cached: number;
104
+ }>;
105
+ /**
106
+ * Refreshes the cache with all appliances from memory.
107
+ */
108
+ refreshCache(): Promise<void>;
109
+ /**
110
+ * Clears all data from memory (for testing purposes).
111
+ */
112
+ clearAllData(): void;
113
+ /**
114
+ * Gets the current size of the memory store.
115
+ * @returns The number of appliances in memory
116
+ */
117
+ getMemoryStoreSize(): number;
118
+ }
@@ -0,0 +1,277 @@
1
+ import { EnyoApplianceConnectionType, EnyoApplianceStateEnum } from "../../types/enyo-appliance.js";
2
+ import { ApplianceManager } from "./appliance-manager.js";
3
+ /**
4
+ * Demo implementation of ApplianceManager that stores all data in memory.
5
+ * This class provides the same interface as ApplianceManager but doesn't
6
+ * use energyApp.useAppliances() for persistence.
7
+ */
8
+ export class DemoApplianceManager extends ApplianceManager {
9
+ memoryStore = new Map();
10
+ nextId = 1;
11
+ networkDevicesStore = new Map();
12
+ /**
13
+ * Creates a new DemoApplianceManager instance.
14
+ * @param energyApp The EnergyApp instance (not used for persistence in demo)
15
+ * @param config Configuration options for the manager
16
+ */
17
+ constructor(energyApp, config) {
18
+ super(energyApp, config);
19
+ }
20
+ /**
21
+ * Creates or updates an appliance in memory.
22
+ * @param config The appliance configuration
23
+ * @param existingApplianceId Optional ID of an existing appliance to update
24
+ * @returns The ID of the created or updated appliance
25
+ */
26
+ async createOrUpdateAppliance(config, existingApplianceId) {
27
+ const applianceId = existingApplianceId || `appliance_${this.nextId++}`;
28
+ // Build network device IDs list
29
+ const networkDeviceIds = config.networkDevices?.map(d => d.id) ?? [];
30
+ // Get existing metadata if updating
31
+ const existingAppliance = existingApplianceId ? this.memoryStore.get(existingApplianceId) : null;
32
+ // Merge metadata with defaults and existing values
33
+ const metadata = {
34
+ connectionType: config.metadata?.connectionType ||
35
+ existingAppliance?.metadata?.connectionType ||
36
+ EnyoApplianceConnectionType.Connector,
37
+ state: config.metadata?.state ||
38
+ existingAppliance?.metadata?.state ||
39
+ EnyoApplianceStateEnum.Connected,
40
+ ...config.metadata
41
+ };
42
+ // Build appliance data
43
+ const applianceData = {
44
+ id: applianceId,
45
+ name: config.name,
46
+ type: config.type,
47
+ networkDeviceIds,
48
+ metadata,
49
+ ...(config.topology && { topology: config.topology })
50
+ };
51
+ // Add type-specific metadata
52
+ if (config.typeMetadata) {
53
+ Object.assign(applianceData, config.typeMetadata);
54
+ }
55
+ // Save to memory store
56
+ this.memoryStore.set(applianceId, applianceData);
57
+ // Store network devices if provided
58
+ if (config.networkDevices) {
59
+ this.networkDevicesStore.set(applianceId, config.networkDevices);
60
+ }
61
+ // Update cache (from parent class)
62
+ this.updateCache(applianceData, config.networkDevices?.[0]);
63
+ console.log(`[DEMO] ${existingApplianceId ? 'Updated' : 'Created'} appliance ${applianceId} of type ${config.type}`);
64
+ return applianceId;
65
+ }
66
+ /**
67
+ * Gets an appliance by ID from memory.
68
+ * @param applianceId The ID of the appliance
69
+ * @returns The appliance or null if not found
70
+ */
71
+ async getApplianceById(applianceId) {
72
+ return this.memoryStore.get(applianceId) || null;
73
+ }
74
+ /**
75
+ * Gets all appliances from memory.
76
+ * @returns Array of all appliances
77
+ */
78
+ async getAllAppliances() {
79
+ return Array.from(this.memoryStore.values());
80
+ }
81
+ /**
82
+ * Gets network devices associated with an appliance.
83
+ * @param appliance The appliance
84
+ * @returns Array of network devices
85
+ */
86
+ async getNetworkDevicesForAppliance(appliance) {
87
+ return this.networkDevicesStore.get(appliance.id) || [];
88
+ }
89
+ /**
90
+ * Finds appliances by their identifier using the configured strategy.
91
+ * @param identifier The identifier to search for
92
+ * @returns Array of matching appliances
93
+ */
94
+ async findByIdentifier(identifier) {
95
+ const matches = [];
96
+ const strategy = this.getIdentifierStrategy();
97
+ for (const appliance of this.memoryStore.values()) {
98
+ const networkDevices = await this.getNetworkDevicesForAppliance(appliance);
99
+ const extractedId = strategy.extract(appliance, networkDevices[0]);
100
+ if (extractedId === identifier) {
101
+ matches.push(appliance);
102
+ this.updateCache(appliance, networkDevices[0]);
103
+ }
104
+ }
105
+ return matches;
106
+ }
107
+ /**
108
+ * Finds an appliance using multiple strategies.
109
+ * @param searchValue The value to search for
110
+ * @param strategies Array of strategies to try
111
+ * @returns The first matching result or undefined
112
+ */
113
+ async findWithStrategies(searchValue, strategies) {
114
+ for (const strategy of strategies) {
115
+ for (const appliance of this.memoryStore.values()) {
116
+ const networkDevices = await this.getNetworkDevicesForAppliance(appliance);
117
+ const identifier = strategy.extract(appliance, networkDevices[0]);
118
+ if (identifier === searchValue) {
119
+ return {
120
+ appliance,
121
+ identifier,
122
+ strategy: strategy.name
123
+ };
124
+ }
125
+ }
126
+ }
127
+ return undefined;
128
+ }
129
+ /**
130
+ * Gets all appliances of a specific type.
131
+ * @param type The appliance type to filter by
132
+ * @returns Array of appliances of the specified type
133
+ */
134
+ async getAppliancesByType(type) {
135
+ return Array.from(this.memoryStore.values()).filter(a => a.type === type);
136
+ }
137
+ /**
138
+ * Updates the state of an appliance in memory.
139
+ * @param applianceId The ID of the appliance to update
140
+ * @param connectionType The new connection type
141
+ * @param state The new state
142
+ */
143
+ async updateApplianceState(applianceId, connectionType, state) {
144
+ const appliance = this.memoryStore.get(applianceId);
145
+ if (appliance) {
146
+ appliance.metadata = {
147
+ ...appliance.metadata,
148
+ connectionType,
149
+ state
150
+ };
151
+ this.memoryStore.set(applianceId, appliance);
152
+ this.updateCache(appliance);
153
+ console.log(`[DEMO] Updated appliance ${applianceId} state to ${state}`);
154
+ }
155
+ else {
156
+ throw new Error(`Appliance ${applianceId} not found`);
157
+ }
158
+ }
159
+ /**
160
+ * Updates metadata for an appliance in memory.
161
+ * @param applianceId The ID of the appliance
162
+ * @param metadata The metadata to update
163
+ */
164
+ async updateApplianceMetadata(applianceId, metadata) {
165
+ const appliance = this.memoryStore.get(applianceId);
166
+ if (appliance) {
167
+ appliance.metadata = {
168
+ ...appliance.metadata,
169
+ ...metadata
170
+ };
171
+ this.memoryStore.set(applianceId, appliance);
172
+ this.updateCache(appliance);
173
+ console.log(`[DEMO] Updated metadata for appliance ${applianceId}`);
174
+ }
175
+ else {
176
+ throw new Error(`Appliance ${applianceId} not found`);
177
+ }
178
+ }
179
+ /**
180
+ * Removes an appliance from memory.
181
+ * @param applianceId The ID of the appliance to remove
182
+ */
183
+ async removeAppliance(applianceId) {
184
+ if (this.memoryStore.has(applianceId)) {
185
+ this.memoryStore.delete(applianceId);
186
+ this.networkDevicesStore.delete(applianceId);
187
+ // Clean up cache (from parent class)
188
+ this.clearCache();
189
+ console.log(`[DEMO] Removed appliance ${applianceId}`);
190
+ }
191
+ else {
192
+ throw new Error(`Appliance ${applianceId} not found`);
193
+ }
194
+ }
195
+ /**
196
+ * Performs a bulk update on multiple appliances in memory.
197
+ * @param updates Array of updates to perform
198
+ * @returns Results of the bulk update operation
199
+ */
200
+ async bulkUpdate(updates) {
201
+ const succeeded = [];
202
+ const failed = [];
203
+ for (const update of updates) {
204
+ try {
205
+ const appliance = this.memoryStore.get(update.applianceId);
206
+ if (appliance) {
207
+ const updatedAppliance = {
208
+ ...appliance,
209
+ ...update.data,
210
+ id: appliance.id // Ensure ID is preserved
211
+ };
212
+ this.memoryStore.set(update.applianceId, updatedAppliance);
213
+ this.updateCache(updatedAppliance);
214
+ succeeded.push(update.applianceId);
215
+ }
216
+ else {
217
+ failed.push(update.applianceId);
218
+ }
219
+ }
220
+ catch (error) {
221
+ console.error(`[DEMO] Bulk update failed for ${update.applianceId}: ${error}`);
222
+ failed.push(update.applianceId);
223
+ }
224
+ }
225
+ console.log(`[DEMO] Bulk update completed: ${succeeded.length} succeeded, ${failed.length} failed`);
226
+ return { succeeded, failed };
227
+ }
228
+ /**
229
+ * Gets statistics about the managed appliances in memory.
230
+ * @returns Statistics object
231
+ */
232
+ async getStatistics() {
233
+ const appliances = Array.from(this.memoryStore.values());
234
+ const byType = {};
235
+ const byState = {};
236
+ for (const appliance of appliances) {
237
+ // Count by type
238
+ byType[appliance.type] = (byType[appliance.type] ?? 0) + 1;
239
+ // Count by state
240
+ const state = appliance.metadata?.state ?? 'unknown';
241
+ byState[state] = (byState[state] ?? 0) + 1;
242
+ }
243
+ return {
244
+ total: appliances.length,
245
+ byType,
246
+ byState,
247
+ cached: this.memoryStore.size
248
+ };
249
+ }
250
+ /**
251
+ * Refreshes the cache with all appliances from memory.
252
+ */
253
+ async refreshCache() {
254
+ this.clearCache();
255
+ for (const appliance of this.memoryStore.values()) {
256
+ const networkDevices = await this.getNetworkDevicesForAppliance(appliance);
257
+ this.updateCache(appliance, networkDevices[0]);
258
+ }
259
+ }
260
+ /**
261
+ * Clears all data from memory (for testing purposes).
262
+ */
263
+ clearAllData() {
264
+ this.memoryStore.clear();
265
+ this.networkDevicesStore.clear();
266
+ this.clearCache();
267
+ this.nextId = 1;
268
+ console.log('[DEMO] All data cleared from memory');
269
+ }
270
+ /**
271
+ * Gets the current size of the memory store.
272
+ * @returns The number of appliances in memory
273
+ */
274
+ getMemoryStoreSize() {
275
+ return this.memoryStore.size;
276
+ }
277
+ }
@@ -0,0 +1,140 @@
1
+ import type { EnyoAppliance } from "../../types/enyo-appliance.js";
2
+ import type { EnyoNetworkDevice } from "../../types/enyo-network-device.js";
3
+ /**
4
+ * Strategy interface for extracting unique identifiers from appliances.
5
+ * Allows flexible identification of appliances based on different criteria.
6
+ */
7
+ export interface IdentifierStrategy {
8
+ /**
9
+ * Extract the unique identifier from an appliance or its associated data.
10
+ * @param appliance The appliance to extract the identifier from
11
+ * @param networkDevice Optional network device associated with the appliance
12
+ * @returns The extracted identifier string, or undefined if not available
13
+ */
14
+ extract(appliance: Partial<EnyoAppliance>, networkDevice?: EnyoNetworkDevice): string | undefined;
15
+ /**
16
+ * Name of the strategy for logging and debugging purposes.
17
+ */
18
+ name: string;
19
+ }
20
+ /**
21
+ * Strategy that uses the network device ID as the identifier.
22
+ * This is the default strategy for most appliances.
23
+ */
24
+ export declare class NetworkDeviceIdStrategy implements IdentifierStrategy {
25
+ name: string;
26
+ /**
27
+ * Extracts the network device ID.
28
+ * @param appliance The appliance (not used in this strategy)
29
+ * @param networkDevice The network device to get the ID from
30
+ * @returns The network device ID or undefined
31
+ */
32
+ extract(appliance: Partial<EnyoAppliance>, networkDevice?: EnyoNetworkDevice): string | undefined;
33
+ }
34
+ /**
35
+ * Strategy that uses the appliance's serial number as the identifier.
36
+ * Useful when appliances can move between network devices.
37
+ */
38
+ export declare class SerialNumberStrategy implements IdentifierStrategy {
39
+ name: string;
40
+ /**
41
+ * Extracts the serial number from the appliance metadata.
42
+ * @param appliance The appliance to extract the serial number from
43
+ * @returns The serial number or undefined
44
+ */
45
+ extract(appliance: Partial<EnyoAppliance>): string | undefined;
46
+ }
47
+ /**
48
+ * Strategy that uses a custom metadata field as the identifier.
49
+ * Allows using any field from the appliance metadata.
50
+ */
51
+ export declare class CustomMetadataStrategy implements IdentifierStrategy {
52
+ private fieldName;
53
+ name: string;
54
+ /**
55
+ * Creates a strategy that uses a custom metadata field.
56
+ * @param fieldName The name of the metadata field to use as identifier
57
+ */
58
+ constructor(fieldName: keyof NonNullable<EnyoAppliance['metadata']>);
59
+ /**
60
+ * Extracts the custom field value from the appliance metadata.
61
+ * @param appliance The appliance to extract the field from
62
+ * @returns The field value or undefined
63
+ */
64
+ extract(appliance: Partial<EnyoAppliance>): string | undefined;
65
+ }
66
+ /**
67
+ * Strategy that combines multiple identifiers to create a composite key.
68
+ * Useful when a single identifier is not unique enough.
69
+ */
70
+ export declare class CompositeIdentifierStrategy implements IdentifierStrategy {
71
+ private strategies;
72
+ private separator;
73
+ name: string;
74
+ /**
75
+ * Creates a strategy that combines multiple strategies.
76
+ * @param strategies The strategies to combine
77
+ * @param separator The separator to use between identifier parts
78
+ */
79
+ constructor(strategies: IdentifierStrategy[], separator?: string);
80
+ /**
81
+ * Extracts and combines identifiers from multiple strategies.
82
+ * @param appliance The appliance to extract identifiers from
83
+ * @param networkDevice The network device if available
84
+ * @returns The combined identifier or undefined if any part is missing
85
+ */
86
+ extract(appliance: Partial<EnyoAppliance>, networkDevice?: EnyoNetworkDevice): string | undefined;
87
+ }
88
+ /**
89
+ * Strategy that tries multiple strategies in order and uses the first available identifier.
90
+ * Useful for fallback scenarios.
91
+ */
92
+ export declare class FallbackIdentifierStrategy implements IdentifierStrategy {
93
+ private strategies;
94
+ name: string;
95
+ /**
96
+ * Creates a strategy that tries multiple strategies in order.
97
+ * @param strategies The strategies to try in order
98
+ */
99
+ constructor(strategies: IdentifierStrategy[]);
100
+ /**
101
+ * Tries strategies in order and returns the first available identifier.
102
+ * @param appliance The appliance to extract identifiers from
103
+ * @param networkDevice The network device if available
104
+ * @returns The first available identifier or undefined
105
+ */
106
+ extract(appliance: Partial<EnyoAppliance>, networkDevice?: EnyoNetworkDevice): string | undefined;
107
+ }
108
+ /**
109
+ * Factory class for creating common identifier strategies.
110
+ */
111
+ export declare class IdentifierStrategyFactory {
112
+ /**
113
+ * Creates the default network device ID strategy.
114
+ */
115
+ static networkDeviceId(): NetworkDeviceIdStrategy;
116
+ /**
117
+ * Creates a serial number strategy.
118
+ */
119
+ static serialNumber(): SerialNumberStrategy;
120
+ /**
121
+ * Creates a custom metadata field strategy.
122
+ * @param fieldName The metadata field to use
123
+ */
124
+ static customMetadata(fieldName: keyof NonNullable<EnyoAppliance['metadata']>): CustomMetadataStrategy;
125
+ /**
126
+ * Creates a composite strategy that combines multiple identifiers.
127
+ * @param strategies The strategies to combine
128
+ * @param separator The separator between parts
129
+ */
130
+ static composite(strategies: IdentifierStrategy[], separator?: string): CompositeIdentifierStrategy;
131
+ /**
132
+ * Creates a fallback strategy that tries multiple strategies in order.
133
+ * @param strategies The strategies to try
134
+ */
135
+ static fallback(strategies: IdentifierStrategy[]): FallbackIdentifierStrategy;
136
+ /**
137
+ * Creates a strategy that prefers serial number but falls back to network device ID.
138
+ */
139
+ static serialNumberOrDeviceId(): FallbackIdentifierStrategy;
140
+ }