@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,24 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { SessionInfo } from '@cccteam/ccc-lib/src/types';
3
- import { Observable } from 'rxjs';
4
- import * as i0 from "@angular/core";
5
- export declare class AuthService {
6
- private http;
7
- private apiUrl;
8
- constructor(http: HttpClient, apiUrl: string);
9
- /**
10
- * Logs a user out.
11
- *
12
- * @returns Observable with a boolean indicating whether they were logged out.
13
- */
14
- logout(): Observable<boolean>;
15
- /**
16
- * Checks a user's session with the server.
17
- *
18
- * @returns Observable with the user session info
19
- */
20
- checkUserSession(): Observable<SessionInfo | null>;
21
- loginRoute(): string;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
23
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
24
- }
@@ -1 +0,0 @@
1
- export * from './auth.service';
@@ -1,27 +0,0 @@
1
- import { Permission, PermissionScope, Resource, SessionInfo } from '@cccteam/ccc-lib/src/types';
2
- import { StateContext } from '@ngxs/store';
3
- import { Observable } from 'rxjs';
4
- import * as i0 from "@angular/core";
5
- export interface AuthStateModel {
6
- authenticated: boolean;
7
- redirectUrl: string;
8
- sessionInfo: SessionInfo | null;
9
- }
10
- export declare const initState: AuthStateModel;
11
- export declare class AuthState {
12
- private authService;
13
- private static permissionFn;
14
- constructor();
15
- private static initializePermissionFn;
16
- static hasPermission(state: AuthStateModel): (scope?: PermissionScope) => boolean;
17
- static requiresPermission(resource: Resource, permission: Permission): boolean;
18
- static isAuthenticated(state: AuthStateModel): boolean;
19
- static redirectUrl(state: AuthStateModel): string;
20
- checkUserSession(ctx: StateContext<AuthStateModel>): Observable<SessionInfo | null>;
21
- logout(ctx: StateContext<AuthStateModel>): Observable<boolean>;
22
- setRedirectUrl(ctx: StateContext<AuthStateModel>, action: {
23
- redirectUrl: string;
24
- }): AuthStateModel;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthState, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthState>;
27
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-state" />
5
- export * from './public-api';
@@ -1 +0,0 @@
1
- export * from './auth.state';
@@ -1,41 +0,0 @@
1
- import { CreateNotificationMessage } from './notification-message';
2
- export declare namespace AuthenticationGuardAction {
3
- class SetRedirectUrl {
4
- redirectUrl: string;
5
- static readonly type = "[AuthenticationGuard] Set Redirect Url And Navigate To Login Page";
6
- constructor(redirectUrl: string);
7
- }
8
- class CheckUserSession {
9
- static readonly type = "[AuthenticationGuard] Check User Session";
10
- }
11
- }
12
- export declare namespace LoginAction {
13
- class Logout {
14
- static readonly type = "[Login] Auto Logout";
15
- }
16
- class SetRedirectUrl {
17
- redirectUrl: string;
18
- static readonly type = "[Login] Set Redirect Url";
19
- constructor(redirectUrl: string);
20
- }
21
- class PublishError {
22
- message: CreateNotificationMessage;
23
- static readonly type = "[Login] Publish Error";
24
- constructor(message: CreateNotificationMessage);
25
- }
26
- }
27
- export declare namespace AppAction {
28
- class CheckUserSession {
29
- static readonly type = "[App] Check User Session";
30
- }
31
- class SetRedirectUrl {
32
- redirectUrl: string;
33
- static readonly type = "[App] Set Redirect Url";
34
- constructor(redirectUrl: string);
35
- }
36
- class SetNavIdentifier {
37
- identifier: string;
38
- static readonly type = "[App] Set Nav Identifier";
39
- constructor(identifier: string);
40
- }
41
- }
@@ -1,31 +0,0 @@
1
- import { CreateNotificationMessage } from './notification-message';
2
- export declare namespace ApiInterceptorAction {
3
- class BeginActivity {
4
- process: string;
5
- static readonly type = "[ApiInterceptor] Add Loading Activity";
6
- constructor(process: string);
7
- }
8
- class EndActivity {
9
- process: string;
10
- static readonly type = "[ApiInterceptor] Remove Loading Activity";
11
- constructor(process: string);
12
- }
13
- class PublishError {
14
- message: CreateNotificationMessage;
15
- static readonly type = "[ApiInterceptor] Publish Error";
16
- constructor(message: CreateNotificationMessage);
17
- }
18
- class SetRedirectUrl {
19
- redirectUrl: string;
20
- static readonly type = "[ApiInterceptor] Set Redirect Url";
21
- constructor(redirectUrl: string);
22
- }
23
- }
24
- export declare namespace HeaderAction {
25
- class ToggleSidenav {
26
- static readonly type = "[Header] Toggle Sidenav";
27
- }
28
- class Logout {
29
- static readonly type = "[Header] User Logout";
30
- }
31
- }
@@ -1,18 +0,0 @@
1
- export declare enum AlertLevel {
2
- ERROR = "warn",
3
- INFO = "accent",
4
- SUCCESS = "success"
5
- }
6
- export interface CreateNotificationMessage {
7
- duration?: number;
8
- message: string;
9
- link: string;
10
- level: AlertLevel;
11
- }
12
- export interface NotificationMessage {
13
- id: number;
14
- duration?: number;
15
- message: string;
16
- link: string;
17
- level: AlertLevel;
18
- }
@@ -1,15 +0,0 @@
1
- type Brand<K, T> = K & {
2
- __brand: T;
3
- };
4
- export type Permission = Brand<string, 'Permission'>;
5
- export type Resource = Brand<string, 'Resource'>;
6
- export type Domain = Brand<string, 'Domain'>;
7
- export type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;
8
- export interface PermissionScope {
9
- resource: Resource;
10
- permission: Permission;
11
- domain: Domain;
12
- }
13
- export declare const ReadPermission: Permission;
14
- export declare const UpdatePermission: Permission;
15
- export {};
@@ -1,6 +0,0 @@
1
- export * from './auth.actions';
2
- export * from './core.actions';
3
- export * from './notification-message';
4
- export * from './permissions';
5
- export * from './session-info';
6
- export * from './tokens';
@@ -1,9 +0,0 @@
1
- import { DomainPermissions } from './permissions';
2
- /**
3
- * Session Information for a logged in user
4
- */
5
- export interface SessionInfo {
6
- authenticated: boolean;
7
- username: string;
8
- permissions: DomainPermissions;
9
- }
@@ -1,13 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { Domain, Permission, Resource } from './permissions';
3
- export declare const BASE_URL: InjectionToken<string>;
4
- export declare const API_URL: InjectionToken<string>;
5
- export declare const PERMISSION_REQUIRED: InjectionToken<(resource: Resource, permission: Permission) => boolean>;
6
- export declare const AVAILABLE_PERMISSIONS: InjectionToken<{
7
- Create: Permission;
8
- Delete: Permission;
9
- List: Permission;
10
- Read: Permission;
11
- Update: Permission;
12
- }>;
13
- export declare const AVAILABLE_DOMAINS: InjectionToken<Record<string, Domain>[]>;
@@ -1,13 +0,0 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { NotificationMessage } from '@cccteam/ccc-lib/src/types';
3
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
4
- import * as i0 from "@angular/core";
5
- export declare class AlertComponent implements OnInit {
6
- error: NotificationMessage;
7
- dismiss: EventEmitter<any>;
8
- errors: NotificationService;
9
- ngOnInit(): void;
10
- dismissAlert(): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "ccc-alert", never, { "error": { "alias": "error"; "required": true; }; }, { "dismiss": "dismiss"; }, never, never, true, never>;
13
- }
@@ -1 +0,0 @@
1
- export * from './alert.component';
@@ -1,28 +0,0 @@
1
- import { AppAction, CreateNotificationMessage } from '@cccteam/ccc-lib/src/types';
2
- import { StateContext } from '@ngxs/store';
3
- import * as i0 from "@angular/core";
4
- interface CoreStateModel {
5
- loading: string[];
6
- sidenavOpened: boolean;
7
- currentSidenavIdentifier: string;
8
- }
9
- export declare class CoreState {
10
- private notifications;
11
- static sidenavOpened(state: CoreStateModel): boolean;
12
- static isLoading(state: CoreStateModel): boolean;
13
- static currentSidenavIdentifier(state: CoreStateModel): string;
14
- setNavIdentifier(ctx: StateContext<CoreStateModel>, action: AppAction.SetNavIdentifier): void;
15
- publishError(ctx: StateContext<CoreStateModel>, action: {
16
- message: CreateNotificationMessage;
17
- }): void;
18
- beginActivity(ctx: StateContext<CoreStateModel>, action: {
19
- process: string;
20
- }): CoreStateModel;
21
- endActivity(ctx: StateContext<CoreStateModel>, action: {
22
- process: string;
23
- }): CoreStateModel | null;
24
- toggleSidenav(ctx: StateContext<CoreStateModel>): void;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<CoreState, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<CoreState>;
27
- }
28
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-core-state" />
5
- export * from './public-api';
@@ -1 +0,0 @@
1
- export * from './core.state';
@@ -1,12 +0,0 @@
1
- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- export declare class ApiInterceptor implements HttpInterceptor {
5
- private store;
6
- private router;
7
- private ngZone;
8
- private baseUrl;
9
- intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<ApiInterceptor, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<ApiInterceptor>;
12
- }
@@ -1 +0,0 @@
1
- export * from './api.interceptor';
@@ -1,30 +0,0 @@
1
- import { CreateNotificationMessage, NotificationMessage } from '@cccteam/ccc-lib/src/types';
2
- import * as i0 from "@angular/core";
3
- export declare class NotificationService {
4
- private notificationId;
5
- private _notifications;
6
- notifications: import("@angular/core").Signal<NotificationMessage[]>;
7
- /**
8
- * Adds a new global notification.
9
- * @param notification The notification message to add.
10
- * @returns The unique ID assigned to the notification.
11
- */
12
- addGlobalNotification(notification: CreateNotificationMessage): number;
13
- /**
14
- * Dismisses a global notification by its ID.
15
- * @param notificationId The ID of the notification to dismiss.
16
- */
17
- dismissGlobalNotificationById(notificationId: number): void;
18
- /**
19
- * Dismisses a specific global notification.
20
- * @param notification The notification to dismiss.
21
- */
22
- dismissGlobalNotification(notification: NotificationMessage): void;
23
- /**
24
- * Updates an existing notification.
25
- * @param updatedNotification The notification with updated information.
26
- */
27
- updateNotification(updatedNotification: NotificationMessage): void;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
29
- static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
30
- }
@@ -1 +0,0 @@
1
- export * from './notification.service';
@@ -1 +0,0 @@
1
- export * from './sidenav.component';
@@ -1,31 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { PermissionScope } from '@cccteam/ccc-lib/src/types';
3
- import { Observable } from 'rxjs';
4
- import * as i0 from "@angular/core";
5
- export interface NavItem {
6
- type: 'link' | 'header' | 'expandable';
7
- routerLink?: string[];
8
- label: string;
9
- icon?: string;
10
- permission?: PermissionScope;
11
- children?: NavItem[];
12
- isExpanded?: boolean;
13
- attentionCount?: Observable<number>;
14
- }
15
- export type NavGroups = Record<string, NavItem[]>;
16
- export declare class SidenavComponent implements OnInit {
17
- private store;
18
- private destroyRef;
19
- navGroups?: NavGroups;
20
- currentNav: NavItem[];
21
- ngOnInit(): void;
22
- /**
23
- * Updates the currentNav based on the identifier
24
- * @param identifier
25
- * @returns NavItem[]
26
- * @memberof SidenavComponent
27
- */
28
- updateNavItems(identifier: string): NavItem[];
29
- static ɵfac: i0.ɵɵFactoryDeclaration<SidenavComponent, never>;
30
- static ɵcmp: i0.ɵɵComponentDeclaration<SidenavComponent, "ccc-sidenav", never, { "navGroups": { "alias": "navGroups"; "required": false; }; }, {}, never, never, true, never>;
31
- }
@@ -1 +0,0 @@
1
- export * from './request-options';
@@ -1,8 +0,0 @@
1
- import { HttpContext, HttpContextToken } from '@angular/common/http';
2
- export interface CustomHttpRequestOptions {
3
- suppressGlobalError: boolean;
4
- }
5
- export declare const CUSTOM_HTTP_REQUEST_OPTIONS: HttpContextToken<CustomHttpRequestOptions>;
6
- export declare function errorOptions(suppressGlobalError: boolean | undefined): {
7
- context: HttpContext;
8
- };