@asgardeo/javascript 0.1.2 → 0.1.4

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.
@@ -15,10 +15,12 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
+ import { AllOrganizationsApiResponse } from './models/organization';
18
19
  import { AsgardeoClient, SignInOptions, SignOutOptions, SignUpOptions } from './models/client';
19
20
  import { Config } from './models/config';
20
21
  import { EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from './models/embedded-flow';
21
22
  import { EmbeddedSignInFlowHandleRequestPayload } from './models/embedded-signin-flow';
23
+ import { TokenResponse } from './models/token';
22
24
  import { Organization } from './models/organization';
23
25
  import { User, UserProfile } from './models/user';
24
26
  /**
@@ -28,10 +30,11 @@ import { User, UserProfile } from './models/user';
28
30
  * @typeParam T - Configuration type that extends Config.
29
31
  */
30
32
  declare abstract class AsgardeoJavaScriptClient<T = Config> implements AsgardeoClient<T> {
31
- abstract switchOrganization(organization: Organization): Promise<void>;
33
+ abstract switchOrganization(organization: Organization, sessionId?: string): Promise<TokenResponse | Response>;
32
34
  abstract initialize(config: T): Promise<boolean>;
33
35
  abstract getUser(options?: any): Promise<User>;
34
- abstract getOrganizations(options?: any): Promise<Organization[]>;
36
+ abstract getAllOrganizations(options?: any, sessionId?: string): Promise<AllOrganizationsApiResponse>;
37
+ abstract getMyOrganizations(options?: any, sessionId?: string): Promise<Organization[]>;
35
38
  abstract getCurrentOrganization(sessionId?: string): Promise<Organization | null>;
36
39
  abstract getUserProfile(options?: any): Promise<UserProfile>;
37
40
  abstract isLoading(): boolean;
@@ -40,6 +43,7 @@ declare abstract class AsgardeoJavaScriptClient<T = Config> implements AsgardeoC
40
43
  abstract getConfiguration(): T;
41
44
  abstract signIn(options?: SignInOptions, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
42
45
  abstract signIn(payload: EmbeddedSignInFlowHandleRequestPayload, request: Request, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
46
+ abstract signInSilently(options?: SignInOptions): Promise<User | boolean>;
43
47
  abstract signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
44
48
  abstract signOut(options?: SignOutOptions, sessionId?: string, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
45
49
  abstract signUp(options?: SignUpOptions): Promise<void>;
@@ -15,16 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { Organization } from '../models/organization';
19
- /**
20
- * Interface for paginated organization response.
21
- */
22
- export interface PaginatedOrganizationsResponse {
23
- hasMore?: boolean;
24
- nextCursor?: string;
25
- organizations: Organization[];
26
- totalCount?: number;
27
- }
18
+ import { AllOrganizationsApiResponse } from '../models/organization';
28
19
  /**
29
20
  * Configuration for the getAllOrganizations request
30
21
  */
@@ -108,5 +99,5 @@ export interface GetAllOrganizationsConfig extends Omit<RequestInit, 'method'> {
108
99
  * }
109
100
  * ```
110
101
  */
111
- declare const getAllOrganizations: ({ baseUrl, filter, limit, recursive, fetcher, ...requestConfig }: GetAllOrganizationsConfig) => Promise<PaginatedOrganizationsResponse>;
102
+ declare const getAllOrganizations: ({ baseUrl, filter, limit, recursive, fetcher, ...requestConfig }: GetAllOrganizationsConfig) => Promise<AllOrganizationsApiResponse>;
112
103
  export default getAllOrganizations;