@memberjunction/ng-bootstrap 3.4.0 → 4.1.0
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.
- package/README.md +78 -150
- package/fesm2022/memberjunction-ng-bootstrap.mjs +476 -38
- package/fesm2022/memberjunction-ng-bootstrap.mjs.map +1 -1
- package/package.json +26 -15
- package/types/memberjunction-ng-bootstrap.d.ts +251 -0
- package/esm2022/lib/bootstrap.component.mjs +0 -38
- package/esm2022/lib/bootstrap.module.mjs +0 -98
- package/esm2022/lib/bootstrap.types.mjs +0 -13
- package/esm2022/lib/components/auth-shell.component.mjs +0 -148
- package/esm2022/lib/services/initialization.service.mjs +0 -186
- package/esm2022/memberjunction-ng-bootstrap.mjs +0 -5
- package/esm2022/public-api.mjs +0 -9
- package/index.d.ts +0 -5
- package/lib/bootstrap.component.d.ts +0 -16
- package/lib/bootstrap.module.d.ts +0 -63
- package/lib/bootstrap.types.d.ts +0 -72
- package/lib/components/auth-shell.component.d.ts +0 -36
- package/lib/services/initialization.service.d.ts +0 -52
- package/public-api.d.ts +0 -8
package/lib/bootstrap.types.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* Injection token for MJ Environment Configuration
|
|
4
|
-
*/
|
|
5
|
-
export declare const MJ_ENVIRONMENT: InjectionToken<MJEnvironmentConfig>;
|
|
6
|
-
/**
|
|
7
|
-
* Injection token for optional startup validation service
|
|
8
|
-
*/
|
|
9
|
-
export declare const MJ_STARTUP_VALIDATION: InjectionToken<MJStartupValidationService>;
|
|
10
|
-
/**
|
|
11
|
-
* Optional interface for startup validation services
|
|
12
|
-
* Applications can provide their own implementation to handle startup validation
|
|
13
|
-
*/
|
|
14
|
-
export interface MJStartupValidationService {
|
|
15
|
-
/**
|
|
16
|
-
* Runs validation checks during application startup
|
|
17
|
-
*/
|
|
18
|
-
validateSystemSetup(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Adds a validation issue for missing user roles
|
|
21
|
-
*/
|
|
22
|
-
addNoRolesValidationIssue(): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Environment configuration interface for MemberJunction Angular applications
|
|
26
|
-
*/
|
|
27
|
-
export interface MJEnvironmentConfig {
|
|
28
|
-
/**
|
|
29
|
-
* Whether the app is running in production mode
|
|
30
|
-
*/
|
|
31
|
-
production: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* GraphQL HTTP endpoint URL
|
|
34
|
-
* @example 'http://localhost:4000/graphql'
|
|
35
|
-
*/
|
|
36
|
-
GRAPHQL_URI: string;
|
|
37
|
-
/**
|
|
38
|
-
* GraphQL WebSocket endpoint URL for subscriptions
|
|
39
|
-
* @example 'ws://localhost:4000/graphql'
|
|
40
|
-
*/
|
|
41
|
-
GRAPHQL_WS_URI: string;
|
|
42
|
-
/**
|
|
43
|
-
* Authentication provider type
|
|
44
|
-
*/
|
|
45
|
-
AUTH_TYPE: 'msal' | 'auth0';
|
|
46
|
-
/**
|
|
47
|
-
* MemberJunction core schema name in the database
|
|
48
|
-
* @default '__mj'
|
|
49
|
-
*/
|
|
50
|
-
MJ_CORE_SCHEMA_NAME: string;
|
|
51
|
-
/**
|
|
52
|
-
* Microsoft Azure AD/Entra Client ID (for MSAL auth)
|
|
53
|
-
*/
|
|
54
|
-
CLIENT_ID?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Microsoft Azure AD/Entra Tenant ID (for MSAL auth)
|
|
57
|
-
*/
|
|
58
|
-
TENANT_ID?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Auth0 domain (for Auth0 auth)
|
|
61
|
-
* @example 'myapp.us.auth0.com'
|
|
62
|
-
*/
|
|
63
|
-
AUTH0_DOMAIN?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Auth0 client ID (for Auth0 auth)
|
|
66
|
-
*/
|
|
67
|
-
AUTH0_CLIENTID?: string;
|
|
68
|
-
/**
|
|
69
|
-
* Additional custom environment properties
|
|
70
|
-
*/
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MemberJunction 3.0 Auth Shell Component
|
|
3
|
-
*
|
|
4
|
-
* Handles authentication flow and initialization for MJ applications.
|
|
5
|
-
* This component encapsulates all the auth logic that was previously in app.component.ts
|
|
6
|
-
*/
|
|
7
|
-
import { OnInit } from '@angular/core';
|
|
8
|
-
import { Router } from '@angular/router';
|
|
9
|
-
import { MJAuthBase, StandardUserInfo } from '@memberjunction/ng-auth-services';
|
|
10
|
-
import { MJInitializationService } from '../services/initialization.service';
|
|
11
|
-
import { MJEnvironmentConfig } from '../bootstrap.types';
|
|
12
|
-
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class MJAuthShellComponent implements OnInit {
|
|
14
|
-
private router;
|
|
15
|
-
document: Document;
|
|
16
|
-
authBase: MJAuthBase;
|
|
17
|
-
private initService;
|
|
18
|
-
private environment;
|
|
19
|
-
HasError: boolean;
|
|
20
|
-
ErrorMessage: any;
|
|
21
|
-
showValidationOnly: boolean;
|
|
22
|
-
subHeaderText: string;
|
|
23
|
-
private initialPath;
|
|
24
|
-
constructor(router: Router, document: Document, authBase: MJAuthBase, initService: MJInitializationService, environment: MJEnvironmentConfig);
|
|
25
|
-
ngOnInit(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Handle successful login and initialize the application
|
|
28
|
-
*/
|
|
29
|
-
handleLogin(token: string, userInfo: StandardUserInfo): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Setup authentication and handle auth state changes
|
|
32
|
-
*/
|
|
33
|
-
setupAuth(): Promise<void>;
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MJAuthShellComponent, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MJAuthShellComponent, "mj-auth-shell", never, {}, {}, never, ["*"], false, never>;
|
|
36
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Router } from '@angular/router';
|
|
2
|
-
import { MJAuthBase } from '@memberjunction/ng-auth-services';
|
|
3
|
-
import { MJEnvironmentConfig, MJStartupValidationService } from '../bootstrap.types';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export interface InitializationResult {
|
|
6
|
-
success: boolean;
|
|
7
|
-
error?: {
|
|
8
|
-
message: string;
|
|
9
|
-
type: 'no_access' | 'no_roles' | 'auth_error' | 'unknown';
|
|
10
|
-
showValidationOnly?: boolean;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare class MJInitializationService {
|
|
14
|
-
private router;
|
|
15
|
-
private authBase;
|
|
16
|
-
private startupValidationService;
|
|
17
|
-
constructor(router: Router, authBase: MJAuthBase, startupValidationService: MJStartupValidationService | null);
|
|
18
|
-
/**
|
|
19
|
-
* Initialize GraphQL client with authentication token and refresh callback
|
|
20
|
-
*/
|
|
21
|
-
initializeGraphQL(token: string, environment: MJEnvironmentConfig): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Refresh shared data and validate user access
|
|
24
|
-
*/
|
|
25
|
-
validateUserAccess(): Promise<InitializationResult>;
|
|
26
|
-
/**
|
|
27
|
-
* Run startup validation checks (if validation service is provided)
|
|
28
|
-
*/
|
|
29
|
-
runValidationChecks(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Navigate to initial route after successful login
|
|
32
|
-
*/
|
|
33
|
-
navigateToInitialRoute(initialPath: string, document: Document): void;
|
|
34
|
-
/**
|
|
35
|
-
* Check if error is related to missing user roles
|
|
36
|
-
*/
|
|
37
|
-
isNoUserRolesError(err: any): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Handle no roles error by showing validation banner (if validation service is provided)
|
|
40
|
-
*/
|
|
41
|
-
handleNoRolesError(): InitializationResult;
|
|
42
|
-
/**
|
|
43
|
-
* Handle authentication retry logic
|
|
44
|
-
*/
|
|
45
|
-
handleAuthRetry(err: any): Promise<boolean>;
|
|
46
|
-
/**
|
|
47
|
-
* Get auth error message for display
|
|
48
|
-
*/
|
|
49
|
-
getAuthErrorMessage(err: unknown): string;
|
|
50
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MJInitializationService, never>;
|
|
51
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MJInitializationService>;
|
|
52
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public API Surface of @memberjunction/ng-bootstrap
|
|
3
|
-
*/
|
|
4
|
-
export * from './lib/bootstrap.module';
|
|
5
|
-
export * from './lib/bootstrap.component';
|
|
6
|
-
export * from './lib/bootstrap.types';
|
|
7
|
-
export * from './lib/services/initialization.service';
|
|
8
|
-
export * from './lib/components/auth-shell.component';
|