@seniorsistemas/components-ai 0.0.0-master-d4a804fe

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/CHANGELOG.md +101 -0
  2. package/CONTRIBUTING.md +317 -0
  3. package/README.md +161 -0
  4. package/docs/API.md +486 -0
  5. package/docs/COMPONENTS.md +272 -0
  6. package/docs/EXAMPLES.md +559 -0
  7. package/docs/MIGRATION.md +367 -0
  8. package/esm2022/lib/angular-components.module.mjs +25 -0
  9. package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +121 -0
  10. package/esm2022/lib/components/bulk-delete-dialog/bulk-delete-dialog.component.mjs +176 -0
  11. package/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +625 -0
  12. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-date.component.mjs +86 -0
  13. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-dropdown.component.mjs +103 -0
  14. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-lookup.component.mjs +599 -0
  15. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-number.component.mjs +92 -0
  16. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-text.component.mjs +163 -0
  17. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-textarea.component.mjs +81 -0
  18. package/esm2022/lib/components/dynamic-form/fields/dynamic-field-wrapper.component.mjs +93 -0
  19. package/esm2022/lib/components/dynamic-form/fields/index.mjs +8 -0
  20. package/esm2022/lib/components/dynamic-form/models/dynamic-form.models.mjs +2 -0
  21. package/esm2022/lib/components/export-dialog/export-dialog.component.mjs +219 -0
  22. package/esm2022/lib/config/translation.config.mjs +70 -0
  23. package/esm2022/lib/directives/cep-mask.directive.mjs +79 -0
  24. package/esm2022/lib/directives/document-mask.directive.mjs +62 -0
  25. package/esm2022/lib/directives/phone-mask.directive.mjs +59 -0
  26. package/esm2022/lib/interceptors/api.interceptor.mjs +55 -0
  27. package/esm2022/lib/models/base-entity.interface.mjs +2 -0
  28. package/esm2022/lib/models/entity-list.config.mjs +2 -0
  29. package/esm2022/lib/pipes/translate.pipe.mjs +74 -0
  30. package/esm2022/lib/services/auth.service.mjs +169 -0
  31. package/esm2022/lib/services/cookie.service.mjs +90 -0
  32. package/esm2022/lib/services/entity.service.mjs +208 -0
  33. package/esm2022/lib/services/mask.service.mjs +121 -0
  34. package/esm2022/lib/services/permission.service.mjs +180 -0
  35. package/esm2022/lib/services/senior-token.service.mjs +209 -0
  36. package/esm2022/lib/services/theme.service.mjs +85 -0
  37. package/esm2022/lib/services/translation.service.mjs +232 -0
  38. package/esm2022/public-api.mjs +90 -0
  39. package/esm2022/seniorsistemas-components-ai.mjs +5 -0
  40. package/fesm2022/seniorsistemas-components-ai.mjs +4006 -0
  41. package/fesm2022/seniorsistemas-components-ai.mjs.map +1 -0
  42. package/index.d.ts +5 -0
  43. package/lib/angular-components.module.d.ts +13 -0
  44. package/lib/components/breadcrumb/breadcrumb.component.d.ts +23 -0
  45. package/lib/components/bulk-delete-dialog/bulk-delete-dialog.component.d.ts +46 -0
  46. package/lib/components/dynamic-form/dynamic-form.component.d.ts +97 -0
  47. package/lib/components/dynamic-form/fields/dynamic-field-date.component.d.ts +16 -0
  48. package/lib/components/dynamic-form/fields/dynamic-field-dropdown.component.d.ts +17 -0
  49. package/lib/components/dynamic-form/fields/dynamic-field-lookup.component.d.ts +52 -0
  50. package/lib/components/dynamic-form/fields/dynamic-field-number.component.d.ts +16 -0
  51. package/lib/components/dynamic-form/fields/dynamic-field-text.component.d.ts +17 -0
  52. package/lib/components/dynamic-form/fields/dynamic-field-textarea.component.d.ts +16 -0
  53. package/lib/components/dynamic-form/fields/dynamic-field-wrapper.component.d.ts +20 -0
  54. package/lib/components/dynamic-form/fields/index.d.ts +7 -0
  55. package/lib/components/dynamic-form/models/dynamic-form.models.d.ts +178 -0
  56. package/lib/components/export-dialog/export-dialog.component.d.ts +56 -0
  57. package/lib/config/translation.config.d.ts +24 -0
  58. package/lib/directives/cep-mask.directive.d.ts +13 -0
  59. package/lib/directives/document-mask.directive.d.ts +19 -0
  60. package/lib/directives/phone-mask.directive.d.ts +11 -0
  61. package/lib/interceptors/api.interceptor.d.ts +2 -0
  62. package/lib/models/base-entity.interface.d.ts +7 -0
  63. package/lib/models/entity-list.config.d.ts +161 -0
  64. package/lib/pipes/translate.pipe.d.ts +21 -0
  65. package/lib/services/auth.service.d.ts +82 -0
  66. package/lib/services/cookie.service.d.ts +31 -0
  67. package/lib/services/entity.service.d.ts +99 -0
  68. package/lib/services/mask.service.d.ts +36 -0
  69. package/lib/services/permission.service.d.ts +91 -0
  70. package/lib/services/senior-token.service.d.ts +70 -0
  71. package/lib/services/theme.service.d.ts +16 -0
  72. package/lib/services/translation.service.d.ts +54 -0
  73. package/package.json +53 -0
  74. package/public-api.d.ts +17 -0
  75. package/src/lib/styles/entity-list.shared.scss +383 -0
  76. package/src/lib/styles/index.scss +10 -0
@@ -0,0 +1,11 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PhoneMaskDirective {
4
+ private el;
5
+ constructor(el: ElementRef);
6
+ onInput(event: any): void;
7
+ onBlur(event: any): void;
8
+ private applyPhoneMask;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneMaskDirective, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PhoneMaskDirective, "[siaPhoneMask]", never, {}, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { HttpInterceptorFn } from '@angular/common/http';
2
+ export declare const apiInterceptor: HttpInterceptorFn;
@@ -0,0 +1,7 @@
1
+ export interface BaseEntity {
2
+ createdBy?: string;
3
+ createdAt?: Date;
4
+ changedBy?: string;
5
+ changedAt?: Date;
6
+ custom?: any;
7
+ }
@@ -0,0 +1,161 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { ValidatorFn } from '@angular/forms';
3
+ /**
4
+ * Column configuration for entity list table
5
+ */
6
+ export interface ColumnConfig {
7
+ field: string;
8
+ header: string;
9
+ sortable?: boolean;
10
+ width?: string;
11
+ type?: 'text' | 'number' | 'status' | 'custom';
12
+ customTemplate?: TemplateRef<any>;
13
+ }
14
+ /**
15
+ * Lookup column configuration
16
+ */
17
+ export interface LookupColumn {
18
+ field: string;
19
+ header: string;
20
+ width?: string;
21
+ type?: 'text' | 'number';
22
+ }
23
+ /**
24
+ * Responsive size configuration for filter fields
25
+ */
26
+ export interface FilterFieldSize {
27
+ xs?: number;
28
+ sm?: number;
29
+ md?: number;
30
+ lg?: number;
31
+ xl?: number;
32
+ }
33
+ /**
34
+ * Filter section configuration for grouping filters
35
+ */
36
+ export interface FilterSection {
37
+ title: string;
38
+ filters: FilterConfig[];
39
+ }
40
+ /**
41
+ * Filter configuration for entity list
42
+ */
43
+ export interface FilterConfig {
44
+ field: string;
45
+ label: string;
46
+ type: 'text' | 'number' | 'dropdown' | 'lookup' | 'date';
47
+ options?: any[];
48
+ placeholder?: string;
49
+ optionLabel?: string;
50
+ optionValue?: string;
51
+ defaultValue?: any;
52
+ disabled?: boolean;
53
+ min?: number;
54
+ max?: number;
55
+ disabledWhen?: {
56
+ field: string;
57
+ value: any;
58
+ };
59
+ colspan?: number;
60
+ size?: FilterFieldSize;
61
+ colspanXs?: number;
62
+ colspanSm?: number;
63
+ colspanMd?: number;
64
+ colspanLg?: number;
65
+ colspanXl?: number;
66
+ lookupService?: any;
67
+ lookupDisplayField?: string;
68
+ lookupDisplayFields?: string[];
69
+ lookupValueField?: string;
70
+ lookupSearchFields?: string[];
71
+ lookupColumns?: LookupColumn[];
72
+ lookupDynamicFilters?: (formValues: any) => {
73
+ [key: string]: any;
74
+ };
75
+ }
76
+ /**
77
+ * Form field configuration for entity form
78
+ */
79
+ export interface FormFieldConfig {
80
+ field: string;
81
+ label: string;
82
+ type: 'text' | 'number' | 'dropdown' | 'lookup' | 'textarea' | 'enum' | 'date';
83
+ validators?: ValidatorFn[];
84
+ options?: any[];
85
+ required?: boolean;
86
+ placeholder?: string;
87
+ optionLabel?: string;
88
+ optionValue?: string;
89
+ min?: number;
90
+ max?: number;
91
+ minLength?: number;
92
+ maxLength?: number;
93
+ useGrouping?: boolean;
94
+ rows?: number;
95
+ fullSize?: boolean;
96
+ colspan?: number;
97
+ colspanWhen?: {
98
+ field: string;
99
+ value: any;
100
+ colspan: number;
101
+ }[];
102
+ visibleWhen?: {
103
+ field: string;
104
+ value: any;
105
+ };
106
+ disabledWhen?: {
107
+ field: string;
108
+ value: any;
109
+ };
110
+ defaultValue?: any;
111
+ lookupService?: any;
112
+ lookupDisplayField?: string;
113
+ lookupDisplayFields?: string[];
114
+ lookupValueField?: string;
115
+ lookupSearchFields?: string[];
116
+ lookupColumns?: LookupColumn[];
117
+ lookupFilters?: {
118
+ [key: string]: any;
119
+ };
120
+ lookupDynamicFilters?: (formValues: any) => {
121
+ [key: string]: any;
122
+ };
123
+ enumOptions?: {
124
+ value: any;
125
+ label: string;
126
+ }[];
127
+ enumValues?: string[];
128
+ enumLabels?: {
129
+ [key: string]: string;
130
+ };
131
+ useCepMask?: boolean;
132
+ usePhoneMask?: boolean;
133
+ mask?: 'dynamic' | 'cpf' | 'cnpj' | 'cep' | 'phone' | 'document';
134
+ disabled?: boolean;
135
+ dateFormat?: string;
136
+ minFractionDigits?: number;
137
+ maxFractionDigits?: number;
138
+ numberMode?: 'decimal' | 'currency';
139
+ currency?: string;
140
+ locale?: string;
141
+ showClear?: boolean;
142
+ filter?: boolean;
143
+ filterBy?: string;
144
+ lookupEntity?: string;
145
+ }
146
+ /**
147
+ * Entity list configuration
148
+ */
149
+ export interface EntityListConfig {
150
+ entityName: string;
151
+ entityIcon: string;
152
+ subtitle: string;
153
+ columns: ColumnConfig[];
154
+ filters: FilterConfig[];
155
+ fixedFilters?: FilterConfig[];
156
+ filterSections?: FilterSection[];
157
+ formFields: FormFieldConfig[];
158
+ exportEnabled?: boolean;
159
+ bulkDeleteEnabled?: boolean;
160
+ addButtonLabel?: string;
161
+ }
@@ -0,0 +1,21 @@
1
+ import { PipeTransform, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import { TranslationService } from '../services/translation.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TranslatePipe implements PipeTransform, OnDestroy {
5
+ private translationService;
6
+ private cdr;
7
+ private subscription?;
8
+ private lastKey?;
9
+ private lastParams?;
10
+ private lastTranslation?;
11
+ private isLoading;
12
+ constructor(translationService: TranslationService, cdr: ChangeDetectorRef);
13
+ transform(key: string, params?: {
14
+ [key: string]: any;
15
+ }): string;
16
+ ngOnDestroy(): void;
17
+ private shouldUpdate;
18
+ private updateTranslation;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
20
+ static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, "translate", true>;
21
+ }
@@ -0,0 +1,82 @@
1
+ import { CookieService } from './cookie.service';
2
+ import * as i0 from "@angular/core";
3
+ export interface UserToken {
4
+ access_token: string;
5
+ expires_in: number;
6
+ refresh_token: string;
7
+ token_type: string;
8
+ refresh_expires_in: number;
9
+ username: string;
10
+ email: string;
11
+ fullName: string;
12
+ tenantName: string;
13
+ locale: string;
14
+ type: string;
15
+ }
16
+ export declare class AuthService {
17
+ private cookieService;
18
+ private readonly TOKEN_COOKIE_NAME;
19
+ private readonly API_URL_COOKIE_NAME;
20
+ private readonly API_PATH_SUFFIX;
21
+ private currentUserSubject;
22
+ currentUser$: import("rxjs").Observable<UserToken | null>;
23
+ constructor(cookieService: CookieService);
24
+ /**
25
+ * Load user token from cookie
26
+ */
27
+ private loadUserFromCookie;
28
+ /**
29
+ * Get current user token
30
+ */
31
+ getCurrentUser(): UserToken | null;
32
+ /**
33
+ * Get access token
34
+ */
35
+ getAccessToken(): string | null;
36
+ /**
37
+ * Get token type (e.g., "Bearer")
38
+ */
39
+ getTokenType(): string;
40
+ /**
41
+ * Get refresh token
42
+ */
43
+ getRefreshToken(): string | null;
44
+ /**
45
+ * Get API base URL from cookie
46
+ */
47
+ getApiBaseUrl(): string | null;
48
+ /**
49
+ * Check if user is authenticated
50
+ */
51
+ isAuthenticated(): boolean;
52
+ /**
53
+ * Check if token is valid (not expired)
54
+ */
55
+ private isTokenValid;
56
+ /**
57
+ * Check if refresh token is valid
58
+ */
59
+ isRefreshTokenValid(): boolean;
60
+ /**
61
+ * Get user locale
62
+ */
63
+ getUserLocale(): string;
64
+ /**
65
+ * Get user full name
66
+ */
67
+ getUserFullName(): string;
68
+ /**
69
+ * Get user email
70
+ */
71
+ getUserEmail(): string;
72
+ /**
73
+ * Get tenant name
74
+ */
75
+ getTenantName(): string;
76
+ /**
77
+ * Get username
78
+ */
79
+ getUsername(): string;
80
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
81
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
82
+ }
@@ -0,0 +1,31 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CookieService {
3
+ /**
4
+ * Obtém o valor de um cookie pelo nome
5
+ */
6
+ getCookie(name: string): string | null;
7
+ /**
8
+ * Define um cookie
9
+ */
10
+ setCookie(name: string, value: string, days?: number, path?: string): void;
11
+ /**
12
+ * Remove um cookie
13
+ */
14
+ deleteCookie(name: string, path?: string): void;
15
+ /**
16
+ * Verifica se um cookie existe
17
+ */
18
+ hasCookie(name: string): boolean;
19
+ /**
20
+ * Obtém todos os cookies como objeto
21
+ */
22
+ getAllCookies(): {
23
+ [key: string]: string;
24
+ };
25
+ /**
26
+ * Debug: Lista todos os cookies disponíveis
27
+ */
28
+ debugAllCookies(): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<CookieService, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<CookieService>;
31
+ }
@@ -0,0 +1,99 @@
1
+ import { HttpClient, HttpParams } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export interface SortMeta {
5
+ field: string;
6
+ order: number;
7
+ }
8
+ export interface ListParams {
9
+ page?: number;
10
+ size?: number;
11
+ sort?: SortMeta[];
12
+ filterQuery?: string;
13
+ displayFields?: string[];
14
+ }
15
+ export interface BodyParams {
16
+ offset?: number;
17
+ size?: number;
18
+ orderBy?: string;
19
+ filter?: string;
20
+ displayfields?: string;
21
+ }
22
+ export interface EntityListResponse<T> {
23
+ contents: T[];
24
+ totalElements: number;
25
+ totalPages: number;
26
+ size?: number;
27
+ number?: number;
28
+ first?: boolean;
29
+ last?: boolean;
30
+ }
31
+ export interface TranslationService {
32
+ translate(key: string, params?: any): string;
33
+ }
34
+ export declare abstract class EntityService<T> {
35
+ protected http: HttpClient;
36
+ protected translationService?: TranslationService | undefined;
37
+ protected abstract entityUrl: string;
38
+ protected abstract actionsUrl: string;
39
+ protected queriesUrl: string;
40
+ constructor(http: HttpClient, translationService?: TranslationService | undefined);
41
+ /**
42
+ * Initialize the service - call this after setting actionsUrl
43
+ */
44
+ protected initializeService(): void;
45
+ /**
46
+ * Convert ListParams to HttpParams for GET requests
47
+ */
48
+ protected getListQueryParams(listParams: ListParams): HttpParams;
49
+ /**
50
+ * Convert ListParams to body parameters for POST requests
51
+ */
52
+ protected getBodyParams(listParams: ListParams): BodyParams;
53
+ /**
54
+ * Default error handler
55
+ */
56
+ protected handleError: (error: any) => Observable<never>;
57
+ /**
58
+ * List entities with pagination, sorting, and filtering
59
+ */
60
+ list(listParams?: ListParams): Observable<EntityListResponse<T>>;
61
+ /**
62
+ * Get entity by ID
63
+ */
64
+ get(id: any): Observable<T>;
65
+ /**
66
+ * Create new entity
67
+ */
68
+ insert(entity: T): Observable<T>;
69
+ /**
70
+ * Update existing entity
71
+ */
72
+ update(id: any, entity: T): Observable<T>;
73
+ /**
74
+ * Delete entity by ID
75
+ */
76
+ delete(id: any): Observable<void>;
77
+ /**
78
+ * Execute custom filter action
79
+ */
80
+ listCustomFilter(listParams: ListParams, action: string): Observable<EntityListResponse<T>>;
81
+ /**
82
+ * Execute custom query
83
+ */
84
+ executeQuery(queryName: string, params?: any): Observable<any>;
85
+ /**
86
+ * Execute custom action
87
+ */
88
+ executeAction(actionName: string, params?: any): Observable<any>;
89
+ /**
90
+ * Check if entity exists by ID
91
+ */
92
+ exists(id: any): Observable<boolean>;
93
+ /**
94
+ * Bulk delete entities
95
+ */
96
+ bulkDelete(ids: any[]): Observable<void>;
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityService<any>, never>;
98
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityService<any>>;
99
+ }
@@ -0,0 +1,36 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MaskService {
3
+ /**
4
+ * Aplica máscara de CPF (999.999.999-99) - 100% numérico
5
+ */
6
+ applyCpfMask(value: string): string;
7
+ /**
8
+ * Aplica máscara de CNPJ alfanumérico (XX.XXX.XXX/XXXX-XX)
9
+ * Aceita letras e números em todos os caracteres
10
+ */
11
+ applyCnpjMask(value: string): string;
12
+ /**
13
+ * Aplica a máscara apropriada baseada no tipo de pessoa
14
+ * CPF: 100% numérico (999.999.999-99)
15
+ * CNPJ: alfanumérico (XX.XXX.XXX/XXXX-XX)
16
+ */
17
+ applyDocumentMask(value: string, typePerson: 'NATURAL_PERSON' | 'JURIDICAL_PERSON'): string;
18
+ /**
19
+ * Remove a máscara de um documento (mantém apenas alfanuméricos)
20
+ */
21
+ removeMask(value: string): string;
22
+ /**
23
+ * Determina se um documento é CPF ou CNPJ baseado no comprimento
24
+ */
25
+ getDocumentType(value: string): 'cpf' | 'cnpj' | 'unknown';
26
+ /**
27
+ * Valida se um CPF tem formato válido (11 dígitos numéricos)
28
+ */
29
+ isValidCpfFormat(value: string): boolean;
30
+ /**
31
+ * Valida se um CNPJ tem formato válido (14 caracteres alfanuméricos)
32
+ */
33
+ isValidCnpjFormat(value: string): boolean;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<MaskService, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<MaskService>;
36
+ }
@@ -0,0 +1,91 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export interface PermissionRequest {
5
+ resource: string;
6
+ action: string;
7
+ context?: {
8
+ [key: string]: any;
9
+ };
10
+ }
11
+ export interface PermissionResponse {
12
+ allowed: boolean;
13
+ resource: string;
14
+ action: string;
15
+ reason?: string;
16
+ }
17
+ export interface CheckAccessRequest {
18
+ permissions: PermissionRequest[];
19
+ }
20
+ export interface CheckAccessResponse {
21
+ results: PermissionResponse[];
22
+ }
23
+ export interface AuthServiceInterface {
24
+ isAuthenticated(): boolean;
25
+ getAccessToken(): string | null;
26
+ }
27
+ export declare class PermissionService {
28
+ private http;
29
+ private authService?;
30
+ private readonly PERMISSION_ENDPOINT;
31
+ private permissionCache;
32
+ private cacheExpiry;
33
+ private readonly CACHE_DURATION;
34
+ constructor(http: HttpClient, authService?: AuthServiceInterface | undefined);
35
+ /**
36
+ * Check access for a single permission
37
+ */
38
+ checkAccess(resource: string, action: string, context?: {
39
+ [key: string]: any;
40
+ }): Observable<boolean>;
41
+ /**
42
+ * Check access for multiple permissions
43
+ */
44
+ checkMultipleAccess(permissions: PermissionRequest[]): Observable<PermissionResponse[]>;
45
+ /**
46
+ * Check if user can read a resource
47
+ */
48
+ canRead(resource: string, context?: {
49
+ [key: string]: any;
50
+ }): Observable<boolean>;
51
+ /**
52
+ * Check if user can write to a resource
53
+ */
54
+ canWrite(resource: string, context?: {
55
+ [key: string]: any;
56
+ }): Observable<boolean>;
57
+ /**
58
+ * Check if user can delete a resource
59
+ */
60
+ canDelete(resource: string, context?: {
61
+ [key: string]: any;
62
+ }): Observable<boolean>;
63
+ /**
64
+ * Check if user can execute an action on a resource
65
+ */
66
+ canExecute(resource: string, action: string, context?: {
67
+ [key: string]: any;
68
+ }): Observable<boolean>;
69
+ /**
70
+ * Clear permission cache
71
+ */
72
+ clearCache(): void;
73
+ /**
74
+ * Clear expired cache entries
75
+ */
76
+ clearExpiredCache(): void;
77
+ /**
78
+ * Generate cache key for permission
79
+ */
80
+ private getCacheKey;
81
+ /**
82
+ * Get cached permission result
83
+ */
84
+ private getCachedPermission;
85
+ /**
86
+ * Cache permission result
87
+ */
88
+ private cachePermission;
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<PermissionService, [null, { optional: true; }]>;
90
+ static ɵprov: i0.ɵɵInjectableDeclaration<PermissionService>;
91
+ }
@@ -0,0 +1,70 @@
1
+ import { CookieService } from './cookie.service';
2
+ import * as i0 from "@angular/core";
3
+ export interface SeniorTokenData {
4
+ locale?: string;
5
+ userId?: string;
6
+ userName?: string;
7
+ access_token?: string;
8
+ expires_in?: number;
9
+ refresh_token?: string;
10
+ token_type?: string;
11
+ refresh_expires_in?: number;
12
+ username?: string;
13
+ email?: string;
14
+ fullName?: string;
15
+ tenantName?: string;
16
+ type?: string;
17
+ [key: string]: any;
18
+ }
19
+ /**
20
+ * Serviço para gerenciar o token Senior e extrair informações específicas
21
+ * para o sistema de traduções.
22
+ *
23
+ * Nota: Este serviço foca especificamente na extração do locale e informações
24
+ * básicas do usuário. Para funcionalidades completas de autenticação,
25
+ * use o AuthService que tem uma interface mais robusta.
26
+ */
27
+ export declare class SeniorTokenService {
28
+ private cookieService;
29
+ private readonly SENIOR_TOKEN_COOKIE;
30
+ constructor(cookieService: CookieService);
31
+ /**
32
+ * Obtém o token Senior completo do cookie
33
+ */
34
+ getSeniorToken(): string | null;
35
+ /**
36
+ * Decodifica e obtém os dados do token Senior
37
+ */
38
+ getSeniorTokenData(): SeniorTokenData | null;
39
+ /**
40
+ * Obtém o locale do usuário do token Senior
41
+ */
42
+ getUserLocale(): string | null;
43
+ /**
44
+ * Obtém informações do usuário do token Senior
45
+ */
46
+ getUserInfo(): {
47
+ userId?: string;
48
+ userName?: string;
49
+ locale?: string;
50
+ email?: string;
51
+ fullName?: string;
52
+ } | null;
53
+ /**
54
+ * Verifica se o usuário está logado (token existe e é válido)
55
+ */
56
+ isUserLoggedIn(): boolean;
57
+ /**
58
+ * Monitora mudanças no cookie do token (para detectar login/logout)
59
+ */
60
+ watchTokenChanges(callback: (tokenData: SeniorTokenData | null) => void): void;
61
+ /**
62
+ * Valida se o token tem a estrutura esperada do Senior
63
+ */
64
+ validateTokenStructure(): {
65
+ isValid: boolean;
66
+ issues: string[];
67
+ };
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<SeniorTokenService, never>;
69
+ static ɵprov: i0.ɵɵInjectableDeclaration<SeniorTokenService>;
70
+ }
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ThemeService {
3
+ private document;
4
+ private isDarkModeSubject;
5
+ isDarkMode$: import("rxjs").Observable<boolean>;
6
+ private mediaQuery;
7
+ constructor(document: Document);
8
+ private followSystemTheme;
9
+ toggleTheme(): void;
10
+ setThemeMode(mode: 'light' | 'dark' | 'auto'): void;
11
+ private setTheme;
12
+ get isDarkMode(): boolean;
13
+ get currentThemeMode(): 'light' | 'dark' | 'auto';
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
16
+ }
@@ -0,0 +1,54 @@
1
+ import { Observable } from 'rxjs';
2
+ import { LanguageConfig } from '../config/translation.config';
3
+ import { SeniorTokenService } from './senior-token.service';
4
+ import * as i0 from "@angular/core";
5
+ export type SupportedLanguage = 'pt-BR' | 'en-US' | 'es-ES';
6
+ export interface TranslationLoader {
7
+ loadTranslations(language: string): Promise<any>;
8
+ }
9
+ export declare class TranslationService {
10
+ private seniorTokenService;
11
+ private currentLanguage;
12
+ private translations;
13
+ private loadingLanguages;
14
+ private translationLoader?;
15
+ constructor(seniorTokenService: SeniorTokenService, loader?: TranslationLoader);
16
+ get currentLanguage$(): Observable<SupportedLanguage>;
17
+ getCurrentLanguage(): SupportedLanguage;
18
+ setLanguage(language: SupportedLanguage): Promise<void>;
19
+ waitForTranslations(): Promise<void>;
20
+ /**
21
+ * Verifica se as traduções do idioma atual estão carregadas
22
+ */
23
+ isLanguageLoaded(language?: SupportedLanguage): boolean;
24
+ translate(key: string, params?: {
25
+ [key: string]: any;
26
+ }): string;
27
+ private loadTranslations;
28
+ private doLoadTranslations;
29
+ private loadStoredLanguage;
30
+ private replaceParams;
31
+ getSupportedLanguages(): LanguageConfig[];
32
+ /**
33
+ * Força o recarregamento das traduções (útil para desenvolvimento)
34
+ */
35
+ reloadTranslations(): Promise<void>;
36
+ /**
37
+ * Obtém todas as chaves de tradução carregadas
38
+ */
39
+ getLoadedKeys(): string[];
40
+ /**
41
+ * Verifica se um código de idioma é suportado
42
+ */
43
+ private isValidLanguage;
44
+ /**
45
+ * Monitora mudanças no token Senior para atualizar idioma automaticamente
46
+ */
47
+ private watchTokenChanges;
48
+ /**
49
+ * Força atualização do idioma baseado no token atual
50
+ */
51
+ syncWithToken(): Promise<void>;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslationService, [null, { optional: true; }]>;
53
+ static ɵprov: i0.ɵɵInjectableDeclaration<TranslationService>;
54
+ }