@cccteam/ccc-lib 0.0.12 → 0.0.14

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.
Files changed (76) hide show
  1. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +7 -15
  2. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +1 -1
  3. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +10 -9
  4. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +1 -1
  5. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +9 -10
  6. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +1 -1
  7. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +11 -18
  8. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +1 -1
  9. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +45 -13
  10. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +1 -1
  11. package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +1 -1
  12. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +4 -4
  13. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +1 -1
  14. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs +41 -0
  15. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +1 -0
  16. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +13 -11
  17. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +1 -1
  18. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +11 -5
  19. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +1 -1
  20. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +10 -20
  21. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +1 -1
  22. package/fesm2022/cccteam-ccc-lib.mjs +3 -4
  23. package/fesm2022/cccteam-ccc-lib.mjs.map +1 -1
  24. package/index.d.ts +12 -5
  25. package/package.json +11 -15
  26. package/src/auth-authentication-guard/index.d.ts +6 -5
  27. package/src/auth-authorization-guard/index.d.ts +6 -5
  28. package/src/auth-forms/index.d.ts +43 -3
  29. package/src/auth-has-permission/index.d.ts +15 -5
  30. package/src/auth-service/index.d.ts +36 -5
  31. package/src/types/index.d.ts +131 -3
  32. package/src/ui-alert/index.d.ts +16 -5
  33. package/src/ui-core-service/index.d.ts +20 -0
  34. package/src/ui-interceptor/index.d.ts +16 -5
  35. package/src/ui-notification-service/index.d.ts +33 -5
  36. package/src/ui-sidenav/index.d.ts +33 -5
  37. package/src/util-request-options/index.d.ts +12 -5
  38. package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs +0 -109
  39. package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs.map +0 -1
  40. package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs +0 -100
  41. package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs.map +0 -1
  42. package/public-api.d.ts +0 -13
  43. package/src/auth-authentication-guard/authentication.guard.d.ts +0 -3
  44. package/src/auth-authentication-guard/public-api.d.ts +0 -1
  45. package/src/auth-authorization-guard/authorization.guard.d.ts +0 -3
  46. package/src/auth-authorization-guard/public-api.d.ts +0 -1
  47. package/src/auth-forms/ccc-field/ccc-field.component.d.ts +0 -25
  48. package/src/auth-forms/form-helpers.d.ts +0 -16
  49. package/src/auth-forms/public-api.d.ts +0 -2
  50. package/src/auth-has-permission/has-permission.directive.d.ts +0 -12
  51. package/src/auth-has-permission/public-api.d.ts +0 -1
  52. package/src/auth-service/auth.service.d.ts +0 -24
  53. package/src/auth-service/public-api.d.ts +0 -1
  54. package/src/auth-state/auth.state.d.ts +0 -27
  55. package/src/auth-state/index.d.ts +0 -5
  56. package/src/auth-state/public-api.d.ts +0 -1
  57. package/src/types/auth.actions.d.ts +0 -41
  58. package/src/types/core.actions.d.ts +0 -31
  59. package/src/types/notification-message.d.ts +0 -18
  60. package/src/types/permissions.d.ts +0 -15
  61. package/src/types/public-api.d.ts +0 -6
  62. package/src/types/session-info.d.ts +0 -9
  63. package/src/types/tokens.d.ts +0 -13
  64. package/src/ui-alert/alert.component.d.ts +0 -13
  65. package/src/ui-alert/public-api.d.ts +0 -1
  66. package/src/ui-core-state/core.state.d.ts +0 -28
  67. package/src/ui-core-state/index.d.ts +0 -5
  68. package/src/ui-core-state/public-api.d.ts +0 -1
  69. package/src/ui-interceptor/api.interceptor.d.ts +0 -12
  70. package/src/ui-interceptor/public-api.d.ts +0 -1
  71. package/src/ui-notification-service/notification.service.d.ts +0 -30
  72. package/src/ui-notification-service/public-api.d.ts +0 -1
  73. package/src/ui-sidenav/public-api.d.ts +0 -1
  74. package/src/ui-sidenav/sidenav.component.d.ts +0 -31
  75. package/src/util-request-options/public-api.d.ts +0 -1
  76. package/src/util-request-options/request-options.d.ts +0 -8
@@ -1,5 +1,133 @@
1
+ import { InjectionToken } from '@angular/core';
2
+
3
+ declare enum AlertLevel {
4
+ ERROR = "warn",
5
+ INFO = "accent",
6
+ SUCCESS = "success"
7
+ }
8
+ interface CreateNotificationMessage {
9
+ duration?: number;
10
+ message: string;
11
+ link: string;
12
+ level: AlertLevel;
13
+ }
14
+ interface NotificationMessage {
15
+ id: number;
16
+ duration?: number;
17
+ message: string;
18
+ link: string;
19
+ level: AlertLevel;
20
+ }
21
+
22
+ declare namespace AuthenticationGuardAction {
23
+ class SetRedirectUrl {
24
+ redirectUrl: string;
25
+ static readonly type = "[AuthenticationGuard] Set Redirect Url And Navigate To Login Page";
26
+ constructor(redirectUrl: string);
27
+ }
28
+ class CheckUserSession {
29
+ static readonly type = "[AuthenticationGuard] Check User Session";
30
+ }
31
+ }
32
+ declare namespace LoginAction {
33
+ class Logout {
34
+ static readonly type = "[Login] Auto Logout";
35
+ }
36
+ class SetRedirectUrl {
37
+ redirectUrl: string;
38
+ static readonly type = "[Login] Set Redirect Url";
39
+ constructor(redirectUrl: string);
40
+ }
41
+ class PublishError {
42
+ message: CreateNotificationMessage;
43
+ static readonly type = "[Login] Publish Error";
44
+ constructor(message: CreateNotificationMessage);
45
+ }
46
+ }
47
+ declare namespace AppAction {
48
+ class CheckUserSession {
49
+ static readonly type = "[App] Check User Session";
50
+ }
51
+ class SetRedirectUrl {
52
+ redirectUrl: string;
53
+ static readonly type = "[App] Set Redirect Url";
54
+ constructor(redirectUrl: string);
55
+ }
56
+ class SetNavIdentifier {
57
+ identifier: string;
58
+ static readonly type = "[App] Set Nav Identifier";
59
+ constructor(identifier: string);
60
+ }
61
+ }
62
+
63
+ declare namespace ApiInterceptorAction {
64
+ class BeginActivity {
65
+ process: string;
66
+ static readonly type = "[ApiInterceptor] Add Loading Activity";
67
+ constructor(process: string);
68
+ }
69
+ class EndActivity {
70
+ process: string;
71
+ static readonly type = "[ApiInterceptor] Remove Loading Activity";
72
+ constructor(process: string);
73
+ }
74
+ class PublishError {
75
+ message: CreateNotificationMessage;
76
+ static readonly type = "[ApiInterceptor] Publish Error";
77
+ constructor(message: CreateNotificationMessage);
78
+ }
79
+ class SetRedirectUrl {
80
+ redirectUrl: string;
81
+ static readonly type = "[ApiInterceptor] Set Redirect Url";
82
+ constructor(redirectUrl: string);
83
+ }
84
+ }
85
+ declare namespace HeaderAction {
86
+ class ToggleSidenav {
87
+ static readonly type = "[Header] Toggle Sidenav";
88
+ }
89
+ class Logout {
90
+ static readonly type = "[Header] User Logout";
91
+ }
92
+ }
93
+
94
+ type Brand<K, T> = K & {
95
+ __brand: T;
96
+ };
97
+ type Permission = Brand<string, 'Permission'>;
98
+ type Resource = Brand<string, 'Resource'>;
99
+ type Domain = Brand<string, 'Domain'>;
100
+ type FieldName = Brand<string, 'FieldName'>;
101
+ type Method = Brand<string, 'Method'>;
102
+ type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;
103
+ interface PermissionScope {
104
+ resource: Resource;
105
+ permission: Permission;
106
+ domain: Domain;
107
+ }
108
+ declare const ReadPermission: Permission;
109
+ declare const UpdatePermission: Permission;
110
+
1
111
  /**
2
- * Generated bundle index. Do not edit.
112
+ * Session Information for a logged in user
3
113
  */
4
- /// <amd-module name="@cccteam/ccc-lib/src/types" />
5
- export * from './public-api';
114
+ interface SessionInfo {
115
+ authenticated: boolean;
116
+ username: string;
117
+ permissions: DomainPermissions;
118
+ }
119
+
120
+ declare const BASE_URL: InjectionToken<string>;
121
+ declare const API_URL: InjectionToken<string>;
122
+ declare const PERMISSION_REQUIRED: InjectionToken<(resource: Resource, permission: Permission) => boolean>;
123
+ declare const AVAILABLE_PERMISSIONS: InjectionToken<{
124
+ Create: Permission;
125
+ Delete: Permission;
126
+ List: Permission;
127
+ Read: Permission;
128
+ Update: Permission;
129
+ }>;
130
+ declare const AVAILABLE_DOMAINS: InjectionToken<Record<string, Domain>[]>;
131
+
132
+ export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, ApiInterceptorAction, AppAction, AuthenticationGuardAction, BASE_URL, HeaderAction, LoginAction, PERMISSION_REQUIRED, ReadPermission, UpdatePermission };
133
+ export type { CreateNotificationMessage, Domain, DomainPermissions, FieldName, Method, NotificationMessage, Permission, PermissionScope, Resource, SessionInfo };
@@ -1,5 +1,16 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-alert" />
5
- export * from './public-api';
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, EventEmitter } from '@angular/core';
3
+ import { NotificationMessage } from '@cccteam/ccc-lib/src/types';
4
+ import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
5
+
6
+ declare class AlertComponent implements OnInit {
7
+ error: NotificationMessage;
8
+ dismiss: EventEmitter<any>;
9
+ errors: NotificationService;
10
+ ngOnInit(): void;
11
+ dismissAlert(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "ccc-alert", never, { "error": { "alias": "error"; "required": true; }; }, { "dismiss": "dismiss"; }, never, never, true, never>;
14
+ }
15
+
16
+ export { AlertComponent };
@@ -0,0 +1,20 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { CreateNotificationMessage } from '@cccteam/ccc-lib/src/types';
3
+ import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
4
+
5
+ declare class UiCoreService {
6
+ notifications: NotificationService;
7
+ loadingSignal: _angular_core.WritableSignal<string[]>;
8
+ sidenavOpened: _angular_core.WritableSignal<boolean>;
9
+ currentSidenavIdentifier: _angular_core.WritableSignal<string>;
10
+ private loading;
11
+ isLoading: _angular_core.Signal<boolean>;
12
+ publishError(message: CreateNotificationMessage): void;
13
+ beginActivity(process: string): void;
14
+ endActivity(process: string): void;
15
+ toggleSidenav(): void;
16
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiCoreService, never>;
17
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<UiCoreService>;
18
+ }
19
+
20
+ export { UiCoreService };
@@ -1,5 +1,16 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-interceptor" />
5
- export * from './public-api';
1
+ import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from '@angular/core';
4
+
5
+ declare class ApiInterceptor implements HttpInterceptor {
6
+ private ui;
7
+ private auth;
8
+ private router;
9
+ private ngZone;
10
+ private baseUrl;
11
+ intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiInterceptor, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiInterceptor>;
14
+ }
15
+
16
+ export { ApiInterceptor };
@@ -1,5 +1,33 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-notification-service" />
5
- export * from './public-api';
1
+ import * as i0 from '@angular/core';
2
+ import { NotificationMessage, CreateNotificationMessage } from '@cccteam/ccc-lib/src/types';
3
+
4
+ declare class NotificationService {
5
+ private notificationId;
6
+ private _notifications;
7
+ notifications: i0.Signal<NotificationMessage[]>;
8
+ /**
9
+ * Adds a new global notification.
10
+ * @param notification The notification message to add.
11
+ * @returns The unique ID assigned to the notification.
12
+ */
13
+ addGlobalNotification(notification: CreateNotificationMessage): number;
14
+ /**
15
+ * Dismisses a global notification by its ID.
16
+ * @param notificationId The ID of the notification to dismiss.
17
+ */
18
+ dismissGlobalNotificationById(notificationId: number): void;
19
+ /**
20
+ * Dismisses a specific global notification.
21
+ * @param notification The notification to dismiss.
22
+ */
23
+ dismissGlobalNotification(notification: NotificationMessage): void;
24
+ /**
25
+ * Updates an existing notification.
26
+ * @param updatedNotification The notification with updated information.
27
+ */
28
+ updateNotification(updatedNotification: NotificationMessage): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
31
+ }
32
+
33
+ export { NotificationService };
@@ -1,5 +1,33 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-sidenav" />
5
- export * from './public-api';
1
+ import * as i0 from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { PermissionScope } from '@cccteam/ccc-lib/src/types';
4
+ import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
5
+
6
+ interface NavItem {
7
+ type: 'link' | 'header' | 'expandable';
8
+ routerLink?: string[];
9
+ label: string;
10
+ icon?: string;
11
+ permission?: PermissionScope;
12
+ children?: NavItem[];
13
+ isExpanded?: boolean;
14
+ attentionCount?: Signal<number>;
15
+ }
16
+ type NavGroups = Record<string, NavItem[]>;
17
+ declare class SidenavComponent {
18
+ ui: UiCoreService;
19
+ navGroups?: NavGroups;
20
+ currentNav: Signal<NavItem[]>;
21
+ /**
22
+ * Updates the currentNav based on the identifier
23
+ * @param identifier
24
+ * @returns NavItem[]
25
+ * @memberof SidenavComponent
26
+ */
27
+ updateNavItems(identifier: string): NavItem[];
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<SidenavComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<SidenavComponent, "ccc-sidenav", never, { "navGroups": { "alias": "navGroups"; "required": false; }; }, {}, never, never, true, never>;
30
+ }
31
+
32
+ export { SidenavComponent };
33
+ export type { NavGroups, NavItem };
@@ -1,5 +1,12 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/util-request-options" />
5
- export * from './public-api';
1
+ import { HttpContextToken, HttpContext } from '@angular/common/http';
2
+
3
+ interface CustomHttpRequestOptions {
4
+ suppressGlobalError: boolean;
5
+ }
6
+ declare const CUSTOM_HTTP_REQUEST_OPTIONS: HttpContextToken<CustomHttpRequestOptions>;
7
+ declare function errorOptions(suppressGlobalError: boolean | undefined): {
8
+ context: HttpContext;
9
+ };
10
+
11
+ export { CUSTOM_HTTP_REQUEST_OPTIONS, errorOptions };
12
+ export type { CustomHttpRequestOptions };
@@ -1,109 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { inject, Injectable } from '@angular/core';
4
- import { AuthService } from '@cccteam/ccc-lib/src/auth-service';
5
- import { PERMISSION_REQUIRED, AppAction, AuthenticationGuardAction, LoginAction, ApiInterceptorAction } from '@cccteam/ccc-lib/src/types';
6
- import { Action, Selector, State } from '@ngxs/store';
7
- import { patch } from '@ngxs/store/operators';
8
- import { cloneDeep } from 'lodash-es';
9
- import { tap } from 'rxjs';
10
-
11
- var AuthState_1;
12
- const initState = {
13
- authenticated: false,
14
- redirectUrl: '',
15
- sessionInfo: null,
16
- };
17
- let AuthState = class AuthState {
18
- static { AuthState_1 = this; }
19
- authService = inject(AuthService);
20
- static permissionFn;
21
- constructor() {
22
- AuthState_1.initializePermissionFn();
23
- }
24
- static initializePermissionFn() {
25
- if (!AuthState_1.permissionFn) {
26
- AuthState_1.permissionFn = inject(PERMISSION_REQUIRED);
27
- }
28
- }
29
- static hasPermission(state) {
30
- return (scope) => {
31
- if (!scope)
32
- return true;
33
- const resourcePermissions = state?.sessionInfo?.permissions?.[scope.domain]?.[scope.resource];
34
- return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);
35
- };
36
- }
37
- static requiresPermission(resource, permission) {
38
- if (!AuthState_1.permissionFn) {
39
- throw new Error(`AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`);
40
- }
41
- return AuthState_1.permissionFn(resource, permission);
42
- }
43
- static isAuthenticated(state) {
44
- return state?.authenticated;
45
- }
46
- static redirectUrl(state) {
47
- return state?.redirectUrl;
48
- }
49
- checkUserSession(ctx) {
50
- return this.authService.checkUserSession().pipe(tap((result) => ctx.setState(patch({
51
- authenticated: !!result?.authenticated,
52
- sessionInfo: result,
53
- }))));
54
- }
55
- logout(ctx) {
56
- const localStateCopy = cloneDeep(initState);
57
- localStateCopy.redirectUrl = ctx.getState().redirectUrl;
58
- return this.authService.logout().pipe(tap(() => {
59
- ctx.setState(localStateCopy);
60
- }));
61
- }
62
- setRedirectUrl(ctx, action) {
63
- ctx.setState(patch({
64
- redirectUrl: action.redirectUrl,
65
- }));
66
- return ctx.getState();
67
- }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AuthState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
69
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AuthState });
70
- };
71
- __decorate([
72
- Action([AppAction.CheckUserSession, AuthenticationGuardAction.CheckUserSession])
73
- ], AuthState.prototype, "checkUserSession", null);
74
- __decorate([
75
- Action([LoginAction.Logout])
76
- ], AuthState.prototype, "logout", null);
77
- __decorate([
78
- Action([
79
- AppAction.SetRedirectUrl,
80
- LoginAction.SetRedirectUrl,
81
- AuthenticationGuardAction.SetRedirectUrl,
82
- ApiInterceptorAction.SetRedirectUrl,
83
- ])
84
- ], AuthState.prototype, "setRedirectUrl", null);
85
- __decorate([
86
- Selector()
87
- ], AuthState, "hasPermission", null);
88
- __decorate([
89
- Selector()
90
- ], AuthState, "isAuthenticated", null);
91
- __decorate([
92
- Selector()
93
- ], AuthState, "redirectUrl", null);
94
- AuthState = AuthState_1 = __decorate([
95
- State({
96
- name: 'authState',
97
- defaults: initState,
98
- })
99
- ], AuthState);
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: AuthState, decorators: [{
101
- type: Injectable
102
- }], ctorParameters: () => [], propDecorators: { checkUserSession: [], logout: [], setRedirectUrl: [] } });
103
-
104
- /**
105
- * Generated bundle index. Do not edit.
106
- */
107
-
108
- export { AuthState, initState };
109
- //# sourceMappingURL=cccteam-ccc-lib-src-auth-state.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cccteam-ccc-lib-src-auth-state.mjs","sources":["../../../projects/ccc-lib/src/auth-state/auth.state.ts","../../../projects/ccc-lib/src/auth-state/cccteam-ccc-lib-src-auth-state.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AuthService } from '@cccteam/ccc-lib/src/auth-service';\nimport {\n ApiInterceptorAction,\n AppAction,\n AuthenticationGuardAction,\n LoginAction,\n Permission,\n PERMISSION_REQUIRED,\n PermissionScope,\n Resource,\n SessionInfo,\n} from '@cccteam/ccc-lib/src/types';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\nimport { cloneDeep } from 'lodash-es';\nimport { Observable, tap } from 'rxjs';\n\nexport interface AuthStateModel {\n authenticated: boolean;\n redirectUrl: string;\n sessionInfo: SessionInfo | null;\n}\n\nexport const initState: AuthStateModel = {\n authenticated: false,\n redirectUrl: '',\n sessionInfo: null,\n};\n\n@State<AuthStateModel>({\n name: 'authState',\n defaults: initState,\n})\n@Injectable()\nexport class AuthState {\n private authService = inject(AuthService);\n private static permissionFn: (resource: Resource, permission: Permission) => boolean;\n\n constructor() {\n AuthState.initializePermissionFn();\n }\n\n private static initializePermissionFn(): void {\n if (!AuthState.permissionFn) {\n AuthState.permissionFn = inject(PERMISSION_REQUIRED);\n }\n }\n\n @Selector()\n static hasPermission(state: AuthStateModel): (scope?: PermissionScope) => boolean {\n return (scope?: PermissionScope) => {\n if (!scope) return true;\n const resourcePermissions = state?.sessionInfo?.permissions?.[scope.domain]?.[scope.resource];\n return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);\n };\n }\n\n static requiresPermission(resource: Resource, permission: Permission): boolean {\n if (!AuthState.permissionFn) {\n throw new Error(\n `AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`,\n );\n }\n return AuthState.permissionFn(resource, permission);\n }\n\n @Selector()\n static isAuthenticated(state: AuthStateModel): boolean {\n return state?.authenticated;\n }\n\n @Selector()\n static redirectUrl(state: AuthStateModel): string {\n return state?.redirectUrl;\n }\n\n @Action([AppAction.CheckUserSession, AuthenticationGuardAction.CheckUserSession])\n checkUserSession(ctx: StateContext<AuthStateModel>): Observable<SessionInfo | null> {\n return this.authService.checkUserSession().pipe(\n tap((result) =>\n ctx.setState(\n patch({\n authenticated: !!result?.authenticated,\n sessionInfo: result,\n }),\n ),\n ),\n );\n }\n\n @Action([LoginAction.Logout])\n logout(ctx: StateContext<AuthStateModel>): Observable<boolean> {\n const localStateCopy = cloneDeep(initState);\n localStateCopy.redirectUrl = ctx.getState().redirectUrl;\n return this.authService.logout().pipe(\n tap(() => {\n ctx.setState(localStateCopy);\n }),\n );\n }\n\n @Action([\n AppAction.SetRedirectUrl,\n LoginAction.SetRedirectUrl,\n AuthenticationGuardAction.SetRedirectUrl,\n ApiInterceptorAction.SetRedirectUrl,\n ])\n setRedirectUrl(ctx: StateContext<AuthStateModel>, action: { redirectUrl: string }): AuthStateModel {\n ctx.setState(\n patch({\n redirectUrl: action.redirectUrl,\n }),\n );\n return ctx.getState();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAwBa,MAAA,SAAS,GAAmB;AACvC,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,WAAW,EAAE,IAAI;;AAQN,IAAA,SAAS,GAAf,MAAM,SAAS,CAAA;;AACZ,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IACjC,OAAO,YAAY;AAE3B,IAAA,WAAA,GAAA;QACE,WAAS,CAAC,sBAAsB,EAAE;;AAG5B,IAAA,OAAO,sBAAsB,GAAA;AACnC,QAAA,IAAI,CAAC,WAAS,CAAC,YAAY,EAAE;AAC3B,YAAA,WAAS,CAAC,YAAY,GAAG,MAAM,CAAC,mBAAmB,CAAC;;;AAKjD,IAAP,OAAO,aAAa,CAAC,KAAqB,EAAA;QACxC,OAAO,CAAC,KAAuB,KAAI;AACjC,YAAA,IAAI,CAAC,KAAK;AAAE,gBAAA,OAAO,IAAI;AACvB,YAAA,MAAM,mBAAmB,GAAG,KAAK,EAAE,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;AAC7F,YAAA,OAAO,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC;AAC7F,SAAC;;AAGH,IAAA,OAAO,kBAAkB,CAAC,QAAkB,EAAE,UAAsB,EAAA;AAClE,QAAA,IAAI,CAAC,WAAS,CAAC,YAAY,EAAE;AAC3B,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,8GAAA,CAAgH,CACjH;;QAEH,OAAO,WAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,C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,EAAA,IAAA,CAAA;AAGD,UAAA,CAAA;AADC,IAAA,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;AAS3B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;AAQD,UAAA,CAAA;AANC,IAAA,MAAM,CAAC;AACN,QAAA,SAAS,CAAC,cAAc;AACxB,QAAA,WAAW,CAAC,cAAc;AAC1B,QAAA,yBAAyB,CAAC,cAAc;AACxC,QAAA,oBAAoB,CAAC,cAAc;KACpC;AAQA,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,IAAA,CAAA;AAjEM,UAAA,CAAA;AADN,IAAA,QAAQ;AAOR,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,IAAA,CAAA;AAYM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,IAAA,CAAA;AAGM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,aAAA,EAAA,IAAA,CAAA;AAxCU,SAAS,GAAA,WAAA,GAAA,UAAA,CAAA;AALrB,IAAA,KAAK,CAAiB;AACrB,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,QAAQ,EAAE,SAAS;KACpB;AAEY,CAAA,EAAA,SAAS,CAiFrB;2FAjFY,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;wDA4CC,gBAAgB,EAAA,EAAA,EAchB,MAAM,EAAA,EAAA,EAgBN,cAAc,EAAA,EAAA,EAAA,EAAA,CAAA;;AC5GhB;;AAEG;;;;"}
@@ -1,100 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { inject, Injectable } from '@angular/core';
4
- import { AppAction, ApiInterceptorAction, LoginAction, HeaderAction } from '@cccteam/ccc-lib/src/types';
5
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
6
- import { Action, Selector, State } from '@ngxs/store';
7
- import { patch } from '@ngxs/store/operators';
8
-
9
- const initState = {
10
- loading: [],
11
- sidenavOpened: true,
12
- currentSidenavIdentifier: '',
13
- };
14
- let CoreState = class CoreState {
15
- notifications = inject(NotificationService);
16
- static sidenavOpened(state) {
17
- return state?.sidenavOpened;
18
- }
19
- static isLoading(state) {
20
- return state.loading.length > 0;
21
- }
22
- static currentSidenavIdentifier(state) {
23
- return state.currentSidenavIdentifier;
24
- }
25
- setNavIdentifier(ctx, action) {
26
- ctx.setState(patch({
27
- currentSidenavIdentifier: action.identifier,
28
- }));
29
- }
30
- publishError(ctx, action) {
31
- this.notifications.addGlobalNotification(action.message);
32
- }
33
- beginActivity(ctx, action) {
34
- const state = ctx.getState();
35
- ctx.patchState({
36
- loading: [action.process, ...state.loading],
37
- });
38
- return ctx.getState();
39
- }
40
- endActivity(ctx, action) {
41
- const loading = ctx.getState().loading;
42
- // There can be multiple activities running with the same process signature
43
- const index = loading.findIndex((activity) => activity === action.process);
44
- if (index !== -1) {
45
- const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];
46
- ctx.patchState({
47
- loading: newLoading,
48
- });
49
- return ctx.getState();
50
- }
51
- return null;
52
- }
53
- toggleSidenav(ctx) {
54
- ctx.setState(patch({
55
- sidenavOpened: !ctx.getState().sidenavOpened,
56
- }));
57
- }
58
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
59
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState });
60
- };
61
- __decorate([
62
- Action([AppAction.SetNavIdentifier])
63
- ], CoreState.prototype, "setNavIdentifier", null);
64
- __decorate([
65
- Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])
66
- ], CoreState.prototype, "publishError", null);
67
- __decorate([
68
- Action([ApiInterceptorAction.BeginActivity])
69
- ], CoreState.prototype, "beginActivity", null);
70
- __decorate([
71
- Action([ApiInterceptorAction.EndActivity])
72
- ], CoreState.prototype, "endActivity", null);
73
- __decorate([
74
- Action([HeaderAction.ToggleSidenav])
75
- ], CoreState.prototype, "toggleSidenav", null);
76
- __decorate([
77
- Selector()
78
- ], CoreState, "sidenavOpened", null);
79
- __decorate([
80
- Selector()
81
- ], CoreState, "isLoading", null);
82
- __decorate([
83
- Selector()
84
- ], CoreState, "currentSidenavIdentifier", null);
85
- CoreState = __decorate([
86
- State({
87
- name: 'coreState',
88
- defaults: initState,
89
- })
90
- ], CoreState);
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: CoreState, decorators: [{
92
- type: Injectable
93
- }], propDecorators: { setNavIdentifier: [], publishError: [], beginActivity: [], endActivity: [], toggleSidenav: [] } });
94
-
95
- /**
96
- * Generated bundle index. Do not edit.
97
- */
98
-
99
- export { CoreState };
100
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-core-state.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cccteam-ccc-lib-src-ui-core-state.mjs","sources":["../../../projects/ccc-lib/src/ui-core-state/core.state.ts","../../../projects/ccc-lib/src/ui-core-state/cccteam-ccc-lib-src-ui-core-state.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport {\n ApiInterceptorAction,\n AppAction,\n CreateNotificationMessage,\n HeaderAction,\n LoginAction,\n} from '@cccteam/ccc-lib/src/types';\nimport { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\n\ninterface CoreStateModel {\n loading: string[];\n sidenavOpened: boolean;\n currentSidenavIdentifier: string;\n}\n\nconst initState: CoreStateModel = {\n loading: [],\n sidenavOpened: true,\n currentSidenavIdentifier: '',\n};\n\n@State<CoreStateModel>({\n name: 'coreState',\n defaults: initState,\n})\n@Injectable()\nexport class CoreState {\n private notifications = inject(NotificationService);\n\n @Selector()\n static sidenavOpened(state: CoreStateModel): boolean {\n return state?.sidenavOpened;\n }\n\n @Selector()\n static isLoading(state: CoreStateModel): boolean {\n return state.loading.length > 0;\n }\n\n @Selector()\n static currentSidenavIdentifier(state: CoreStateModel): string {\n return state.currentSidenavIdentifier;\n }\n\n @Action([AppAction.SetNavIdentifier])\n setNavIdentifier(ctx: StateContext<CoreStateModel>, action: AppAction.SetNavIdentifier): void {\n ctx.setState(\n patch({\n currentSidenavIdentifier: action.identifier,\n }),\n );\n }\n\n @Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])\n publishError(ctx: StateContext<CoreStateModel>, action: { message: CreateNotificationMessage }): void {\n this.notifications.addGlobalNotification(action.message);\n }\n\n @Action([ApiInterceptorAction.BeginActivity])\n beginActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel {\n const state = ctx.getState();\n ctx.patchState({\n loading: [action.process, ...state.loading],\n });\n return ctx.getState();\n }\n\n @Action([ApiInterceptorAction.EndActivity])\n endActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel | null {\n const loading = ctx.getState().loading;\n // There can be multiple activities running with the same process signature\n const index = loading.findIndex((activity) => activity === action.process);\n if (index !== -1) {\n const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];\n ctx.patchState({\n loading: newLoading,\n });\n return ctx.getState();\n }\n return null;\n }\n\n @Action([HeaderAction.ToggleSidenav])\n toggleSidenav(ctx: StateContext<CoreStateModel>): void {\n ctx.setState(\n patch({\n sidenavOpened: !ctx.getState().sidenavOpened,\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAkBA,MAAM,SAAS,GAAmB;AAChC,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,wBAAwB,EAAE,EAAE;CAC7B;AAOY,IAAA,SAAS,GAAf,MAAM,SAAS,CAAA;AACZ,IAAA,a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ADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,IAAA,CAAA;AAGM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,IAAA,CAAA;AAGM,UAAA,CAAA;AADN,IAAA,QAAQ;AAGR,CAAA,EAAA,SAAA,EAAA,0BAAA,EAAA,IAAA,CAAA;AAhBU,SAAS,GAAA,UAAA,CAAA;AALrB,IAAA,KAAK,CAAiB;AACrB,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,QAAQ,EAAE,SAAS;KACpB;AAEY,CAAA,EAAA,SAAS,CAgErB;2FAhEY,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;AAoBC,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,gBAAgB,MAShB,YAAY,EAAA,EAAA,EAKZ,aAAa,EASb,EAAA,EAAA,WAAW,MAeX,aAAa,EAAA,EAAA,EAAA,EAAA,CAAA;;ACtFf;;AAEG;;;;"}
package/public-api.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from '@cccteam/ccc-lib/src/auth-has-permission';
2
- export * from '@cccteam/ccc-lib/src/auth-forms';
3
- export * from '@cccteam/ccc-lib/src/auth-authentication-guard';
4
- export * from '@cccteam/ccc-lib/src/auth-authorization-guard';
5
- export * from '@cccteam/ccc-lib/src/auth-service';
6
- export * from '@cccteam/ccc-lib/src/util-request-options';
7
- export * from '@cccteam/ccc-lib/src/auth-state';
8
- export * from '@cccteam/ccc-lib/src/types';
9
- export * from '@cccteam/ccc-lib/src/ui-alert';
10
- export * from '@cccteam/ccc-lib/src/ui-sidenav';
11
- export * from '@cccteam/ccc-lib/src/ui-interceptor';
12
- export * from '@cccteam/ccc-lib/src/ui-notification-service';
13
- export * from '@cccteam/ccc-lib/src/ui-core-state';
@@ -1,3 +0,0 @@
1
- import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- export declare const AuthenticationGuard: (route: ActivatedRouteSnapshot, routerState: RouterStateSnapshot) => Observable<boolean>;
@@ -1 +0,0 @@
1
- export * from './authentication.guard';
@@ -1,3 +0,0 @@
1
- import { ActivatedRouteSnapshot } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- export declare const AuthorizationGuard: (route: ActivatedRouteSnapshot) => Observable<boolean>;
@@ -1 +0,0 @@
1
- export * from './authorization.guard';
@@ -1,25 +0,0 @@
1
- import { OnInit, Signal } from '@angular/core';
2
- import { Domain, Resource } from '@cccteam/ccc-lib/src/types';
3
- import { Store } from '@ngxs/store';
4
- import * as i0 from "@angular/core";
5
- export declare enum InputMode {
6
- Read = "read",
7
- Edit = "edit"
8
- }
9
- export declare class CccInputFieldComponent implements OnInit {
10
- store: Store;
11
- className: import("@angular/core").InputSignal<unknown>;
12
- mode: import("@angular/core").InputSignal<InputMode>;
13
- resource: import("@angular/core").InputSignal<Resource>;
14
- domain: import("@angular/core").InputSignal<Domain>;
15
- value: import("@angular/core").InputSignal<unknown>;
16
- name: import("@angular/core").InputSignal<string>;
17
- inputMode: typeof InputMode;
18
- canEdit: Signal<boolean>;
19
- canEditSelector: boolean;
20
- canRead: Signal<boolean>;
21
- canReadSelector: boolean;
22
- ngOnInit(): void;
23
- static ɵfac: i0.ɵɵFactoryDeclaration<CccInputFieldComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<CccInputFieldComponent, "ccc-input-field", never, { "className": { "alias": "className"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": true; "isSignal": true; }; "resource": { "alias": "resource"; "required": true; "isSignal": true; }; "domain": { "alias": "domain"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
25
- }
@@ -1,16 +0,0 @@
1
- import { FormArray, FormGroup } from '@angular/forms';
2
- /**
3
- * Accepts a FormGroup and compares it to an object to return the dirty form values
4
- * as a sparse object
5
- * @param form - FormGroup
6
- * @param compareData - object to compare form values against
7
- * @returns Partial<T>
8
- * @example sparseFormData<UserCreate>(this.userForm, initUser)
9
- */
10
- export declare function sparseFormData<T>(form: FormGroup, compareData: T): T;
11
- /**
12
- * Accepts a FormArray and removes empty strings
13
- * @param formArray - FormArray
14
- * @returns FormArray
15
- */
16
- export declare function cleanStringFormArray(formArray: FormArray): FormArray;
@@ -1,2 +0,0 @@
1
- export * from './ccc-field/ccc-field.component';
2
- export * from './form-helpers';
@@ -1,12 +0,0 @@
1
- import { PermissionScope } from '@cccteam/ccc-lib/src/types';
2
- import * as i0 from "@angular/core";
3
- export declare class HasPermissionDirective {
4
- private templateRef;
5
- private viewContainer;
6
- private store;
7
- private scope;
8
- set cccHasPermission(scope: PermissionScope);
9
- constructor();
10
- static ɵfac: i0.ɵɵFactoryDeclaration<HasPermissionDirective, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<HasPermissionDirective, "[cccHasPermission]", never, { "cccHasPermission": { "alias": "cccHasPermission"; "required": false; }; }, {}, never, never, true, never>;
12
- }
@@ -1 +0,0 @@
1
- export * from './has-permission.directive';