Skip to content

Commit 2eb2da1

Browse files
committed
Rename flowId in flow execution to executionId
1 parent 19dd39f commit 2eb2da1

File tree

19 files changed

+219
-218
lines changed

19 files changed

+219
-218
lines changed

packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const executeEmbeddedSignInFlowV2 = async ({
5151
// `verbose: true` is required to get the `meta` field in the response that includes component details.
5252
// Add verbose:true if:
5353
// 1. payload contains only applicationId and flowType
54-
// 2. payload contains only flowExecId
54+
// 2. payload contains only executionId
5555
const hasOnlyAppIdAndFlowType: boolean =
5656
typeof cleanPayload === 'object' &&
5757
cleanPayload !== null &&
@@ -61,7 +61,7 @@ const executeEmbeddedSignInFlowV2 = async ({
6161
const hasOnlyFlowId: boolean =
6262
typeof cleanPayload === 'object' &&
6363
cleanPayload !== null &&
64-
'flowExecId' in cleanPayload &&
64+
'executionId' in cleanPayload &&
6565
Object.keys(cleanPayload).length === 1;
6666

6767
const requestPayload: Record<string, unknown> =

packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const executeEmbeddedSignUpFlowV2 = async ({
5151
// `verbose: true` is required to get the `meta` field in the response that includes component details.
5252
// Add verbose:true if:
5353
// 1. payload contains only applicationId and flowType
54-
// 2. payload contains only flowExecId
54+
// 2. payload contains only executionId
5555
const hasOnlyAppIdAndFlowType: boolean =
5656
typeof cleanPayload === 'object' &&
5757
cleanPayload !== null &&
@@ -61,7 +61,7 @@ const executeEmbeddedSignUpFlowV2 = async ({
6161
const hasOnlyFlowId: boolean =
6262
typeof cleanPayload === 'object' &&
6363
cleanPayload !== null &&
64-
'flowExecId' in cleanPayload &&
64+
'executionId' in cleanPayload &&
6565
Object.keys(cleanPayload).length === 1;
6666

6767
const requestPayload: Record<string, unknown> =

packages/javascript/src/api/v2/executeEmbeddedUserOnboardingFlowV2.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ export interface EmbeddedUserOnboardingFlowResponse {
4040
};
4141

4242
/**
43-
* Reason for failure if flowStatus is ERROR.
43+
* Unique identifier for the flow execution.
4444
*/
45-
failureReason?: string;
45+
executionId: string;
4646

4747
/**
48-
* Unique identifier for the flow execution.
48+
* Reason for failure if flowStatus is ERROR.
4949
*/
50-
flowExecId: string;
50+
failureReason?: string;
5151

5252
/**
5353
* Current status of the flow.
@@ -88,7 +88,7 @@ export interface EmbeddedUserOnboardingFlowResponse {
8888
* const response = await executeEmbeddedUserOnboardingFlowV2({
8989
* baseUrl: "https://api.thunder.io",
9090
* payload: {
91-
* flowExecId: "flow-id-from-url",
91+
* executionId: "flow-id-from-url",
9292
* inputs: { inviteToken: "token-from-url" }
9393
* }
9494
* });
@@ -128,12 +128,12 @@ const executeEmbeddedUserOnboardingFlowV2 = async ({
128128
const hasOnlyFlowId: boolean =
129129
typeof cleanPayload === 'object' &&
130130
cleanPayload !== null &&
131-
'flowExecId' in cleanPayload &&
131+
'executionId' in cleanPayload &&
132132
Object.keys(cleanPayload).length === 1;
133133
const hasFlowIdWithInputs: boolean =
134134
typeof cleanPayload === 'object' &&
135135
cleanPayload !== null &&
136-
'flowExecId' in cleanPayload &&
136+
'executionId' in cleanPayload &&
137137
'inputs' in cleanPayload;
138138

139139
// Add verbose for initial requests and when continuing with inputs

packages/javascript/src/models/v2/embedded-signin-flow-v2.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export interface ExtendedEmbeddedSignInFlowResponse {
145145
* @example
146146
* ```typescript
147147
* const response: EmbeddedSignInFlowResponse = {
148-
* flowExecId: "flow_12345",
148+
* executionId: "flow_12345",
149149
* flowStatus: EmbeddedSignInFlowStatus.Incomplete,
150150
* type: EmbeddedSignInFlowType.View,
151151
* data: {
@@ -197,16 +197,16 @@ export interface EmbeddedSignInFlowResponse extends ExtendedEmbeddedSignInFlowRe
197197
};
198198

199199
/**
200-
* Optional reason for flow failure in case of an error.
201-
* Provides additional context when flowStatus is set to ERROR.
200+
* Unique identifier for this specific flow instance.
201+
* Used to maintain state across multiple API calls during the authentication process.
202202
*/
203-
failureReason?: string;
203+
executionId: string;
204204

205205
/**
206-
* Unique identifier for this specific flow instance.
207-
* Used to maintain state across multiple API calls during the authentication process.
206+
* Optional reason for flow failure in case of an error.
207+
* Provides additional context when flowStatus is set to ERROR.
208208
*/
209-
flowExecId: string;
209+
failureReason?: string;
210210

211211
/**
212212
* Current status of the sign-in flow.
@@ -292,14 +292,14 @@ export type EmbeddedSignInFlowInitiateRequest = {
292292
* Request payload for executing steps in Asgardeo embedded sign-in flows.
293293
*
294294
* This interface defines the structure for subsequent requests after flow initiation.
295-
* It supports both continuing existing flows (with flowExecId) and submitting user
295+
* It supports both continuing existing flows (with executionId) and submitting user
296296
* input data collected from the rendered components.
297297
*
298298
* @example
299299
* ```typescript
300300
* // Continue existing flow with user input
301301
* const stepRequest: EmbeddedSignInFlowRequest = {
302-
* flowExecId: "flow_12345",
302+
* executionId: "flow_12345",
303303
* action: "action_001",
304304
* inputs: {
305305
* username: "user@example.com",
@@ -327,7 +327,7 @@ export interface EmbeddedSignInFlowRequest extends Partial<EmbeddedSignInFlowIni
327327
* Identifier of the flow instance to continue.
328328
* Required when submitting data for an existing flow.
329329
*/
330-
flowExecId?: string;
330+
executionId?: string;
331331

332332
/**
333333
* User input data collected from the form components.

packages/javascript/src/models/v2/embedded-signup-flow-v2.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ export interface EmbeddedSignUpFlowResponse extends ExtendedEmbeddedSignUpFlowRe
165165
};
166166

167167
/**
168-
* Optional reason for flow failure in case of an error.
169-
* Provides additional context when flowStatus is set to ERROR.
168+
* Unique identifier for this sign-up flow instance.
170169
*/
171-
failureReason?: string;
170+
executionId: string;
172171

173172
/**
174-
* Unique identifier for this sign-up flow instance.
173+
* Optional reason for flow failure in case of an error.
174+
* Provides additional context when flowStatus is set to ERROR.
175175
*/
176-
flowExecId: string;
176+
failureReason?: string;
177177

178178
/**
179179
* Current status of the sign-up flow.
@@ -210,7 +210,7 @@ export type EmbeddedSignUpFlowInitiateRequest = {
210210
*/
211211
export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowInitiateRequest> {
212212
action?: string;
213-
flowExecId?: string;
213+
executionId?: string;
214214
inputs?: Record<string, any>;
215215
}
216216

@@ -223,7 +223,7 @@ export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowIni
223223
*
224224
* **Key Differences from AsgardeoV1:**
225225
* - Uses `failureReason` instead of `message`/`description` for error details
226-
* - Maintains flow context with `flowExecId` for tracking failed operations
226+
* - Maintains flow context with `executionId` for tracking failed operations
227227
* - Uses structured `flowStatus` enum instead of generic error codes
228228
* - Provides empty `data` object for consistency with success responses
229229
*
@@ -236,7 +236,7 @@ export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowIni
236236
* ```typescript
237237
* // Typical Asgardeo error response
238238
* const errorResponse: EmbeddedSignUpFlowErrorResponse = {
239-
* flowExecId: "0ccfeaf9-18b3-43a5-bcc1-07d863dcb2c0",
239+
* executionId: "0ccfeaf9-18b3-43a5-bcc1-07d863dcb2c0",
240240
* flowStatus: EmbeddedSignUpFlowStatus.Error,
241241
* data: {},
242242
* failureReason: "User already exists with the provided username."
@@ -270,14 +270,14 @@ export interface EmbeddedSignUpFlowErrorResponse {
270270
* Unlike generic error codes, this provides contextual information
271271
* that helps users understand and resolve the issue.
272272
*/
273-
failureReason: string;
274-
275273
/**
276274
* Unique identifier for the sign-up flow instance.
277275
* This ID is used to track the flow state and correlate error responses
278276
* with the specific sign-up attempt that failed.
279277
*/
280-
flowExecId: string;
278+
executionId: string;
279+
280+
failureReason: string;
281281

282282
/**
283283
* Status of the sign-up flow, which will be `EmbeddedSignUpFlowStatus.Error`

packages/react/src/AsgardeoReactClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
385385
typeof arg1 === 'object' &&
386386
arg1 !== null &&
387387
!isEmpty(arg1) &&
388-
('flowExecId' in arg1 || 'applicationId' in arg1)
388+
('executionId' in arg1 || 'applicationId' in arg1)
389389
) {
390390
const authIdFromUrl: string = new URL(window.location.href).searchParams.get('authId');
391391
const authIdFromStorage: string = sessionStorage.getItem('asgardeo_auth_id');

packages/react/src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface AcceptInviteProps {
4949
* Flow ID from the invite link.
5050
* If not provided, will be extracted from URL query parameters.
5151
*/
52-
flowExecId?: string;
52+
executionId?: string;
5353

5454
/**
5555
* Invite token from the invite link.
@@ -101,14 +101,14 @@ export interface AcceptInviteProps {
101101
/**
102102
* Helper to extract query parameters from URL.
103103
*/
104-
const getUrlParams = (): {flowExecId?: string; inviteToken?: string} => {
104+
const getUrlParams = (): {executionId?: string; inviteToken?: string} => {
105105
if (typeof window === 'undefined') {
106106
return {};
107107
}
108108

109109
const params: any = new URLSearchParams(window.location.search);
110110
return {
111-
flowExecId: params.get('flowExecId') || undefined,
111+
executionId: params.get('executionId') || undefined,
112112
inviteToken: params.get('inviteToken') || undefined,
113113
};
114114
};
@@ -118,7 +118,7 @@ const getUrlParams = (): {flowExecId?: string; inviteToken?: string} => {
118118
*
119119
* This component is designed for end users accessing the thunder-gate app via an invite link.
120120
* It automatically:
121-
* 1. Extracts flowExecId and inviteToken from URL query parameters
121+
* 1. Extracts executionId and inviteToken from URL query parameters
122122
* 2. Validates the invite token with the backend
123123
* 3. Displays the password form if token is valid
124124
* 4. Completes the accept invite when password is set
@@ -127,7 +127,7 @@ const getUrlParams = (): {flowExecId?: string; inviteToken?: string} => {
127127
* ```tsx
128128
* import { AcceptInvite } from '@asgardeo/react';
129129
*
130-
* // URL: /invite?flowExecId=xxx&inviteToken=yyy
130+
* // URL: /invite?executionId=xxx&inviteToken=yyy
131131
*
132132
* const AcceptInvitePage = () => {
133133
* return (
@@ -153,7 +153,7 @@ const getUrlParams = (): {flowExecId?: string; inviteToken?: string} => {
153153
*/
154154
const AcceptInvite: FC<AcceptInviteProps> = ({
155155
baseUrl,
156-
flowExecId: flowExecIdProp,
156+
executionId: executionIdProp,
157157
inviteToken: inviteTokenProp,
158158
onComplete,
159159
onError,
@@ -167,9 +167,9 @@ const AcceptInvite: FC<AcceptInviteProps> = ({
167167
showSubtitle = true,
168168
}: AcceptInviteProps): ReactElement => {
169169
// Extract from URL if not provided as props
170-
const {flowExecId: urlFlowExecId, inviteToken: urlInviteToken} = useMemo(() => getUrlParams(), []);
170+
const {executionId: urlExecutionId, inviteToken: urlInviteToken} = useMemo(() => getUrlParams(), []);
171171

172-
const flowExecId: any = flowExecIdProp || urlFlowExecId;
172+
const executionId: any = executionIdProp || urlExecutionId;
173173
const inviteToken: any = inviteTokenProp || urlInviteToken;
174174

175175
// Determine base URL
@@ -211,7 +211,7 @@ const AcceptInvite: FC<AcceptInviteProps> = ({
211211

212212
return (
213213
<BaseAcceptInvite
214-
flowExecId={flowExecId}
214+
executionId={executionId}
215215
inviteToken={inviteToken}
216216
onSubmit={handleSubmit}
217217
onComplete={onComplete}

0 commit comments

Comments
 (0)