1616 * under the License.
1717 */
1818
19- import { EmbeddedFlowExecuteRequestConfig , EmbeddedFlowExecuteRequestPayload , EmbeddedFlowExecuteResponse } from './embedded-flow' ;
19+ import { AllOrganizationsApiResponse } from '../models/organization' ;
20+ import {
21+ EmbeddedFlowExecuteRequestConfig ,
22+ EmbeddedFlowExecuteRequestPayload ,
23+ EmbeddedFlowExecuteResponse ,
24+ } from './embedded-flow' ;
2025import { EmbeddedSignInFlowHandleRequestPayload } from './embedded-signin-flow' ;
2126import { Organization } from './organization' ;
2227import { User , UserProfile } from './user' ;
28+ import { TokenResponse } from './token' ;
2329
2430export type SignInOptions = Record < string , unknown > ;
2531export type SignOutOptions = Record < string , unknown > ;
@@ -37,11 +43,13 @@ export type SignUpOptions = Record<string, unknown>;
3743 */
3844export interface AsgardeoClient < T > {
3945 /**
40- * Gets the users associated organizations.
46+ * Gets the current signed-in user's associated organizations.
4147 *
4248 * @returns Associated organizations.
4349 */
44- getOrganizations ( options ?: any ) : Promise < Organization [ ] > ;
50+ getMyOrganizations ( options ?: any , sessionId ?: string ) : Promise < Organization [ ] > ;
51+
52+ getAllOrganizations ( options ?: any , sessionId ?: string ) : Promise < AllOrganizationsApiResponse > ;
4553
4654 /**
4755 * Gets the current organization of the user.
@@ -55,7 +63,7 @@ export interface AsgardeoClient<T> {
5563 * @param organization - The organization to switch to.
5664 * @returns A promise that resolves when the switch is complete.
5765 */
58- switchOrganization ( organization : Organization ) : Promise < void > ;
66+ switchOrganization ( organization : Organization , sessionId ?: string ) : Promise < TokenResponse | Response > ;
5967
6068 getConfiguration ( ) : T ;
6169
@@ -147,7 +155,11 @@ export interface AsgardeoClient<T> {
147155 * @param afterSignOut - Callback function to be executed after sign-out is complete.
148156 * @returns A promise that resolves to true if sign-out is successful
149157 */
150- signOut ( options ?: SignOutOptions , sessionId ?: string , afterSignOut ?: ( afterSignOutUrl : string ) => void ) : Promise < string > ;
158+ signOut (
159+ options ?: SignOutOptions ,
160+ sessionId ?: string ,
161+ afterSignOut ?: ( afterSignOutUrl : string ) => void ,
162+ ) : Promise < string > ;
151163
152164 /**
153165 * Initiates a redirection-based sign-up process for the user.
0 commit comments