Skip to content

Commit 2aa8f21

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

File tree

19 files changed

+485
-487
lines changed

19 files changed

+485
-487
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import AsgardeoAPIError from '../../errors/AsgardeoAPIError';
20-
import {EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2} from '../../models/v2/embedded-flow-v2';
20+
import { EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2 } from '../../models/v2/embedded-flow-v2';
2121
import {
2222
EmbeddedSignInFlowResponse as EmbeddedSignInFlowResponseV2,
2323
EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatusV2,
@@ -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,11 +61,11 @@ 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> =
68-
hasOnlyAppIdAndFlowType || hasOnlyFlowId ? {...cleanPayload, verbose: true} : cleanPayload;
68+
hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
6969

7070
const response: Response = await fetch(endpoint, {
7171
...requestConfig,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import AsgardeoAPIError from '../../errors/AsgardeoAPIError';
20-
import {EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2} from '../../models/v2/embedded-flow-v2';
20+
import { EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2 } from '../../models/v2/embedded-flow-v2';
2121
import {
2222
EmbeddedSignUpFlowResponse as EmbeddedSignUpFlowResponseV2,
2323
EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatusV2,
@@ -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,11 +61,11 @@ 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> =
68-
hasOnlyAppIdAndFlowType || hasOnlyFlowId ? {...cleanPayload, verbose: true} : cleanPayload;
68+
hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
6969

7070
const response: Response = await fetch(endpoint, {
7171
...requestConfig,

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818

1919
import AsgardeoAPIError from '../../errors/AsgardeoAPIError';
20-
import {EmbeddedFlowType} from '../../models/embedded-flow';
21-
import {EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2} from '../../models/v2/embedded-flow-v2';
20+
import { EmbeddedFlowType } from '../../models/embedded-flow';
21+
import { EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2 } from '../../models/v2/embedded-flow-v2';
2222

2323
/**
2424
* Response from the user onboarding flow execution.
@@ -47,7 +47,7 @@ export interface EmbeddedUserOnboardingFlowResponse {
4747
/**
4848
* Unique identifier for the flow execution.
4949
*/
50-
flowExecId: string;
50+
executionId: 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,17 +128,17 @@ 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
140140
const requestPayload: Record<string, unknown> =
141-
hasOnlyFlowType || hasOnlyFlowId || hasFlowIdWithInputs ? {...cleanPayload, verbose: true} : cleanPayload;
141+
hasOnlyFlowType || hasOnlyFlowId || hasFlowIdWithInputs ? { ...cleanPayload, verbose: true } : cleanPayload;
142142

143143
// Ensure flowType is USER_ONBOARDING for initial requests
144144
if ('flowType' in requestPayload && requestPayload['flowType'] !== EmbeddedFlowType.UserOnboarding) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* under the License.
1717
*/
1818

19-
import {EmbeddedFlowResponseData as EmbeddedFlowResponseDataV2} from './embedded-flow-v2';
19+
import { EmbeddedFlowResponseData as EmbeddedFlowResponseDataV2 } from './embedded-flow-v2';
2020
import {
2121
EmbeddedFlowResponseType as EmbeddedFlowResponseTypeV1,
2222
EmbeddedFlowType as EmbeddedFlowTypeV1,
@@ -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: {
@@ -206,7 +206,7 @@ export interface EmbeddedSignInFlowResponse extends ExtendedEmbeddedSignInFlowRe
206206
* Unique identifier for this specific flow instance.
207207
* Used to maintain state across multiple API calls during the authentication process.
208208
*/
209-
flowExecId: string;
209+
executionId: 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export interface EmbeddedSignUpFlowResponse extends ExtendedEmbeddedSignUpFlowRe
173173
/**
174174
* Unique identifier for this sign-up flow instance.
175175
*/
176-
flowExecId: string;
176+
executionId: 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."
@@ -277,7 +277,7 @@ export interface EmbeddedSignUpFlowErrorResponse {
277277
* This ID is used to track the flow state and correlate error responses
278278
* with the specific sign-up attempt that failed.
279279
*/
280-
flowExecId: string;
280+
executionId: string;
281281

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

packages/react/src/AsgardeoReactClient.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import getAllOrganizations from './api/getAllOrganizations';
5858
import getMeOrganizations from './api/getMeOrganizations';
5959
import getSchemas from './api/getSchemas';
6060
import getScim2Me from './api/getScim2Me';
61-
import {AsgardeoReactConfig} from './models/config';
61+
import { AsgardeoReactConfig } from './models/config';
6262

6363
/**
6464
* Client for mplementing Asgardeo in React applications.
@@ -172,8 +172,8 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
172172
baseUrl = configData?.baseUrl;
173173
}
174174

175-
const profile: User = await getScim2Me({baseUrl});
176-
const schemas: any = await getSchemas({baseUrl});
175+
const profile: User = await getScim2Me({ baseUrl });
176+
const schemas: any = await getSchemas({ baseUrl });
177177

178178
return generateUserProfile(profile, flattenUserSchema(schemas));
179179
} catch (error) {
@@ -199,8 +199,8 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
199199
baseUrl = configData?.baseUrl;
200200
}
201201

202-
const profile: User = await getScim2Me({baseUrl, instanceId: this.getInstanceId()});
203-
const schemas: any = await getSchemas({baseUrl, instanceId: this.getInstanceId()});
202+
const profile: User = await getScim2Me({ baseUrl, instanceId: this.getInstanceId() });
203+
const schemas: any = await getSchemas({ baseUrl, instanceId: this.getInstanceId() });
204204

205205
const processedSchemas: any = flattenUserSchema(schemas);
206206

@@ -230,11 +230,10 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
230230
baseUrl = configData?.baseUrl;
231231
}
232232

233-
return await getMeOrganizations({baseUrl, instanceId: this.getInstanceId()});
233+
return await getMeOrganizations({ baseUrl, instanceId: this.getInstanceId() });
234234
} catch (error) {
235235
throw new AsgardeoRuntimeError(
236-
`Failed to fetch the user's associated organizations: ${
237-
error instanceof Error ? error.message : String(error)
236+
`Failed to fetch the user's associated organizations: ${error instanceof Error ? error.message : String(error)
238237
}`,
239238
'AsgardeoReactClient-getMyOrganizations-RuntimeError-001',
240239
'react',
@@ -252,7 +251,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
252251
baseUrl = configData?.baseUrl;
253252
}
254253

255-
return await getAllOrganizations({baseUrl, instanceId: this.getInstanceId()});
254+
return await getAllOrganizations({ baseUrl, instanceId: this.getInstanceId() });
256255
} catch (error) {
257256
throw new AsgardeoRuntimeError(
258257
`Failed to fetch all organizations: ${error instanceof Error ? error.message : String(error)}`,
@@ -312,7 +311,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
312311
signInRequired: sourceInstanceId === undefined,
313312
};
314313

315-
return (await this.asgardeo.exchangeToken(exchangeConfig, () => {})) as TokenResponse | Response;
314+
return (await this.asgardeo.exchangeToken(exchangeConfig, () => { })) as TokenResponse | Response;
316315
} catch (error) {
317316
throw new AsgardeoRuntimeError(
318317
`Failed to switch organization: ${error.message || error}`,
@@ -342,7 +341,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
342341

343342
override async exchangeToken(config: TokenExchangeRequestConfig): Promise<TokenResponse | Response> {
344343
return this.withLoading(
345-
async () => this.asgardeo.exchangeToken(config, () => {}) as unknown as TokenResponse | Response,
344+
async () => this.asgardeo.exchangeToken(config, () => { }) as unknown as TokenResponse | Response,
346345
);
347346
}
348347

@@ -385,7 +384,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
385384
typeof arg1 === 'object' &&
386385
arg1 !== null &&
387386
!isEmpty(arg1) &&
388-
('flowExecId' in arg1 || 'applicationId' in arg1)
387+
('executionId' in arg1 || 'applicationId' in arg1)
389388
) {
390389
const authIdFromUrl: string = new URL(window.location.href).searchParams.get('authId');
391390
const authIdFromStorage: string = sessionStorage.getItem('asgardeo_auth_id');
@@ -514,7 +513,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
514513
baseUrl,
515514
payload:
516515
typeof firstArg === 'object' && 'flowType' in firstArg
517-
? {...(firstArg as EmbeddedFlowExecuteRequestPayload), verbose: true}
516+
? { ...(firstArg as EmbeddedFlowExecuteRequestPayload), verbose: true }
518517
: (firstArg as EmbeddedFlowExecuteRequestPayload),
519518
}) as any;
520519
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* under the License.
1717
*/
1818

19-
import {FC, ReactElement, ReactNode, useMemo} from 'react';
20-
import BaseAcceptInvite, {BaseAcceptInviteRenderProps, AcceptInviteFlowResponse} from './BaseAcceptInvite';
19+
import { FC, ReactElement, ReactNode, useMemo } from 'react';
20+
import BaseAcceptInvite, { BaseAcceptInviteRenderProps, AcceptInviteFlowResponse } from './BaseAcceptInvite';
2121

2222
/**
2323
* Render props for AcceptInvite (re-exported for convenience).
@@ -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)