@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.
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -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.
|
|
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
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -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
package/dist/version.js
CHANGED