@enyo-energy/energy-app-sdk 0.0.116 → 0.0.117

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.
@@ -147,6 +147,48 @@ export interface EnergyAppOnboarding {
147
147
  * ```
148
148
  */
149
149
  moveToStep(guideName: string, stepName: string): Promise<void>;
150
+ /**
151
+ * Adds a new step to an existing onboarding guide at runtime.
152
+ *
153
+ * Intended for flows where the next step cannot be known up front — for
154
+ * example when a step submission produces data that determines which (or
155
+ * how many) follow-up steps are needed. Combine with {@link moveToStep}
156
+ * to route the user into the freshly added step.
157
+ *
158
+ * The new step's `name` must be unique within the guide; calls that would
159
+ * introduce a duplicate `name` are rejected. When `options.after` is
160
+ * provided, the step is inserted immediately after the step with that
161
+ * name; if no step matches, or `options` is omitted, the step is appended
162
+ * at the end of the guide.
163
+ *
164
+ * @param guideName - The unique name of the guide to extend
165
+ * @param step - The new step to add to the guide
166
+ * @param options - Optional positioning; `after` inserts the new step
167
+ * immediately after the step with the given `name`. Omit to append.
168
+ * @returns Promise that resolves once the step has been added
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * onboarding.listenForStepSubmission(async (submission) => {
173
+ * if (submission.stepName === 'discover-devices') {
174
+ * const devices = await scanForDevices();
175
+ * for (const device of devices) {
176
+ * await onboarding.addStep(submission.guideName, {
177
+ * name: `configure-${device.id}`,
178
+ * sections: buildSectionsFor(device),
179
+ * nextButtonLabel: [{ language: 'en', value: 'Continue' }],
180
+ * }, { after: 'discover-devices' });
181
+ * }
182
+ * await onboarding.moveToStep(submission.guideName, `configure-${devices[0].id}`);
183
+ * return { state: 'success' };
184
+ * }
185
+ * return { state: 'success' };
186
+ * });
187
+ * ```
188
+ */
189
+ addStep(guideName: string, step: EnyoOnboardingStep, options?: {
190
+ after?: string;
191
+ }): Promise<void>;
150
192
  /**
151
193
  * Marks the onboarding as complete and clears the ConfigurationRequired state.
152
194
  * This updates the state for the specified guide.
@@ -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.116';
12
+ exports.SDK_VERSION = '0.0.117';
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.116";
8
+ export declare const SDK_VERSION = "0.0.117";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -147,6 +147,48 @@ export interface EnergyAppOnboarding {
147
147
  * ```
148
148
  */
149
149
  moveToStep(guideName: string, stepName: string): Promise<void>;
150
+ /**
151
+ * Adds a new step to an existing onboarding guide at runtime.
152
+ *
153
+ * Intended for flows where the next step cannot be known up front — for
154
+ * example when a step submission produces data that determines which (or
155
+ * how many) follow-up steps are needed. Combine with {@link moveToStep}
156
+ * to route the user into the freshly added step.
157
+ *
158
+ * The new step's `name` must be unique within the guide; calls that would
159
+ * introduce a duplicate `name` are rejected. When `options.after` is
160
+ * provided, the step is inserted immediately after the step with that
161
+ * name; if no step matches, or `options` is omitted, the step is appended
162
+ * at the end of the guide.
163
+ *
164
+ * @param guideName - The unique name of the guide to extend
165
+ * @param step - The new step to add to the guide
166
+ * @param options - Optional positioning; `after` inserts the new step
167
+ * immediately after the step with the given `name`. Omit to append.
168
+ * @returns Promise that resolves once the step has been added
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * onboarding.listenForStepSubmission(async (submission) => {
173
+ * if (submission.stepName === 'discover-devices') {
174
+ * const devices = await scanForDevices();
175
+ * for (const device of devices) {
176
+ * await onboarding.addStep(submission.guideName, {
177
+ * name: `configure-${device.id}`,
178
+ * sections: buildSectionsFor(device),
179
+ * nextButtonLabel: [{ language: 'en', value: 'Continue' }],
180
+ * }, { after: 'discover-devices' });
181
+ * }
182
+ * await onboarding.moveToStep(submission.guideName, `configure-${devices[0].id}`);
183
+ * return { state: 'success' };
184
+ * }
185
+ * return { state: 'success' };
186
+ * });
187
+ * ```
188
+ */
189
+ addStep(guideName: string, step: EnyoOnboardingStep, options?: {
190
+ after?: string;
191
+ }): Promise<void>;
150
192
  /**
151
193
  * Marks the onboarding as complete and clears the ConfigurationRequired state.
152
194
  * This updates the state for the specified guide.
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.116";
8
+ export declare const SDK_VERSION = "0.0.117";
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.116';
8
+ export const SDK_VERSION = '0.0.117';
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.116",
3
+ "version": "0.0.117",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",