@flusys/ng-auth 3.0.0 → 4.0.0-rc

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/ng-auth",
3
- "version": "3.0.0",
3
+ "version": "4.0.0-rc",
4
4
  "description": "Authentication module for FLUSYS Angular applications",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -8,9 +8,9 @@
8
8
  "@angular/core": ">=21.0.0",
9
9
  "@angular/forms": ">=21.0.0",
10
10
  "@angular/router": ">=21.0.0",
11
- "@flusys/ng-core": ">=3.0.0",
12
- "@flusys/ng-layout": ">=3.0.0",
13
- "@flusys/ng-shared": ">=3.0.0",
11
+ "@flusys/ng-core": ">=4.0.0-rc",
12
+ "@flusys/ng-layout": ">=4.0.0-rc",
13
+ "@flusys/ng-shared": ">=4.0.0-rc",
14
14
  "@primeuix/themes": ">=1.0.0",
15
15
  "primeicons": ">=7.0.0",
16
16
  "primeng": ">=21.0.0"
@@ -1,4 +1,4 @@
1
- import { IMessageResponse, ApiResourceService, ISingleResponse, ICompanyApiProvider, IListResponse, ICompanyBasicInfo, IAuthStateProvider, IUserPermissionProvider, IUserProvider, IUserBasicInfo, ILogicNode, IProfileRoleInfo, IProfileActionInfo, UploadFileFn } from '@flusys/ng-shared';
1
+ import { IMessageResponse, ApiResourceService, ISingleResponse, ICompanyApiProvider, IListResponse, ICompanyBasicInfo, IAuthStateProvider, IUserPermissionProvider, IUserProvider, IUserBasicInfo, ILogicNode, IProfileRoleInfo, IProfileActionInfo } from '@flusys/ng-shared';
2
2
  import * as rxjs from 'rxjs';
3
3
  import { Observable } from 'rxjs';
4
4
  import * as _angular_core from '@angular/core';
@@ -386,6 +386,7 @@ declare class AuthStateService {
386
386
  private readonly appConfig;
387
387
  private readonly router;
388
388
  private readonly platform;
389
+ private readonly translateAdapter;
389
390
  private readonly _user;
390
391
  private readonly _accessToken;
391
392
  private readonly _tokenExpiresAt;
@@ -765,6 +766,36 @@ interface IProfileExtensionProvider {
765
766
  validateExtraFields?(data: Record<string, unknown>): string | null;
766
767
  }
767
768
  declare const AUTH_PROFILE_EXTENSION: InjectionToken<IProfileExtensionProvider>;
769
+ interface IUserFormFieldTemplateContext {
770
+ field: IUserFormExtraField;
771
+ value: unknown;
772
+ updateValue: (value: unknown) => void;
773
+ }
774
+ declare const USER_FORM_FIELD_CONTEXT: InjectionToken<IUserFormFieldTemplateContext>;
775
+ interface IUserFormExtraField {
776
+ key: string;
777
+ label: string;
778
+ type: 'text' | 'number' | 'select' | 'checkbox' | 'textarea' | 'date' | 'template';
779
+ placeholder?: string;
780
+ required?: boolean;
781
+ options?: Array<{
782
+ label: string;
783
+ value: unknown;
784
+ }>;
785
+ pattern?: RegExp;
786
+ validationMessage?: string;
787
+ order?: number;
788
+ template?: TemplateRef<IUserFormFieldTemplateContext>;
789
+ component?: Type<unknown>;
790
+ injector?: Injector;
791
+ }
792
+ interface IUserFormExtensionProvider {
793
+ getExtraFields?(): IUserFormExtraField[];
794
+ getExtraFieldValues?(userId: string): Observable<Record<string, unknown>>;
795
+ saveExtraFieldValues?(userId: string, data: Record<string, unknown>): Observable<void>;
796
+ validateExtraFields?(data: Record<string, unknown>): string | null;
797
+ }
798
+ declare const AUTH_USER_FORM_EXTENSION: InjectionToken<IUserFormExtensionProvider>;
768
799
  type UserDetailViewMode = 'dialog' | 'sidebar' | 'page';
769
800
  interface IUserDetailViewConfig {
770
801
  viewMode: UserDetailViewMode;
@@ -808,9 +839,11 @@ declare const AUTH_ENDPOINTS: {
808
839
  /** Check if a URL matches a specific endpoint */
809
840
  declare function isEndpoint(url: string, endpoint: string): boolean;
810
841
 
842
+ declare const AUTH_MESSAGES: Record<string, string>;
843
+
811
844
  interface ITab {
812
845
  id: string;
813
- label: string;
846
+ labelKey: string;
814
847
  icon: string;
815
848
  route: string;
816
849
  permission: string;
@@ -832,8 +865,6 @@ declare class AdministrationPageComponent {
832
865
  readonly companyFeatureEnabled: _angular_core.Signal<boolean>;
833
866
  /** Visible tabs based on config and permissions */
834
867
  readonly visibleTabs: _angular_core.Signal<ITab[]>;
835
- /** Dynamic subtitle based on visible tabs */
836
- readonly subtitle: _angular_core.Signal<string>;
837
868
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdministrationPageComponent, never>;
838
869
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdministrationPageComponent, "lib-administration-page", never, {}, {}, never, never, true, never>;
839
870
  }
@@ -860,6 +891,8 @@ declare class BranchFormComponent {
860
891
  private readonly branchService;
861
892
  private readonly companyService;
862
893
  private readonly authState;
894
+ private readonly translateAdapter;
895
+ private translate;
863
896
  private readonly routeParams;
864
897
  private readonly queryParams;
865
898
  /** Loading state */
@@ -911,6 +944,8 @@ declare class BranchListComponent {
911
944
  private readonly branchService;
912
945
  private readonly companyService;
913
946
  private readonly authState;
947
+ private readonly translateAdapter;
948
+ private translate;
914
949
  private readonly queryParamMap;
915
950
  private initialized;
916
951
  /** Selected company ID (signal for zoneless change detection) */
@@ -956,6 +991,8 @@ declare class CompanyFormComponent {
956
991
  private readonly route;
957
992
  private readonly messageService;
958
993
  private readonly companyService;
994
+ private readonly translateAdapter;
995
+ private translate;
959
996
  private readonly routeParams;
960
997
  /** Loading state */
961
998
  readonly isLoading: _angular_core.WritableSignal<boolean>;
@@ -1002,6 +1039,8 @@ declare class CompanyListComponent {
1002
1039
  private readonly messageService;
1003
1040
  private readonly confirmationService;
1004
1041
  private readonly companyService;
1042
+ private readonly translateAdapter;
1043
+ private translate;
1005
1044
  /** Companies from service */
1006
1045
  readonly companies: _angular_core.Signal<ICompany[]>;
1007
1046
  /** Loading state from service */
@@ -1027,6 +1066,8 @@ declare class ForgotPasswordPageComponent {
1027
1066
  private readonly destroyRef;
1028
1067
  private readonly messageService;
1029
1068
  private readonly authApi;
1069
+ private readonly translateAdapter;
1070
+ private translate;
1030
1071
  readonly isLoading: _angular_core.WritableSignal<boolean>;
1031
1072
  readonly emailSent: _angular_core.WritableSignal<boolean>;
1032
1073
  readonly submittedEmail: _angular_core.WritableSignal<string>;
@@ -1057,7 +1098,9 @@ declare class LoginPageComponent {
1057
1098
  private readonly messageService;
1058
1099
  private readonly authApi;
1059
1100
  private readonly authState;
1101
+ private readonly translateAdapter;
1060
1102
  private readonly validationConfig;
1103
+ private translate;
1061
1104
  readonly returnUrl: _angular_core.InputSignal<string>;
1062
1105
  readonly currentStep: _angular_core.WritableSignal<LoginStep>;
1063
1106
  readonly isLoading: _angular_core.WritableSignal<boolean>;
@@ -1109,9 +1152,12 @@ declare class ProfilePageComponent {
1109
1152
  private readonly userService;
1110
1153
  private readonly authApiService;
1111
1154
  private readonly fileUrlService;
1112
- private readonly uploadProvider;
1155
+ private readonly fileProvider;
1113
1156
  private readonly permissionProvider;
1114
1157
  private readonly profileExtension;
1158
+ private readonly userFormExtension;
1159
+ private readonly translateAdapter;
1160
+ private translate;
1115
1161
  readonly isLoading: _angular_core.WritableSignal<boolean>;
1116
1162
  readonly isLoadingPermissions: _angular_core.WritableSignal<boolean>;
1117
1163
  readonly isLoadingExtraFields: _angular_core.WritableSignal<boolean>;
@@ -1122,12 +1168,12 @@ declare class ProfilePageComponent {
1122
1168
  private readonly _userActions;
1123
1169
  readonly userActions: _angular_core.Signal<IProfileActionInfo[]>;
1124
1170
  readonly extraSections: _angular_core.Signal<IProfileExtraSection[]>;
1125
- readonly extraFields: _angular_core.Signal<IProfileExtraField[]>;
1126
- readonly viewOnlyFields: _angular_core.Signal<IProfileExtraField[]>;
1127
1171
  readonly editableFields: _angular_core.Signal<IProfileExtraField[]>;
1172
+ readonly viewOnlyFields: _angular_core.Signal<IUserFormExtraField[]>;
1128
1173
  readonly hasExtraContent: _angular_core.Signal<boolean>;
1129
1174
  readonly extraFieldsModel: _angular_core.WritableSignal<Record<string, unknown>>;
1130
1175
  readonly originalExtraFieldsModel: _angular_core.WritableSignal<Record<string, unknown>>;
1176
+ readonly adminFieldsModel: _angular_core.WritableSignal<Record<string, unknown>>;
1131
1177
  readonly isExtraFieldsDirty: _angular_core.Signal<boolean>;
1132
1178
  readonly extraFieldsValidationError: _angular_core.Signal<string | null>;
1133
1179
  readonly userEmail: _angular_core.Signal<string>;
@@ -1149,7 +1195,8 @@ declare class ProfilePageComponent {
1149
1195
  readonly isFormDirty: _angular_core.Signal<boolean>;
1150
1196
  updateExtraField(key: string, value: unknown): void;
1151
1197
  getExtraFieldValue(key: string): unknown;
1152
- getSelectLabel(field: IProfileExtraField, value: unknown): string;
1198
+ getAdminFieldValue(key: string): unknown;
1199
+ getSelectLabel(field: IProfileExtraField | IUserFormExtraField, value: unknown): string;
1153
1200
  getFieldTemplateContext(field: IProfileExtraField): IProfileFieldTemplateContext;
1154
1201
  private readonly parentInjector;
1155
1202
  getFieldInjector(field: IProfileExtraField): Injector;
@@ -1157,8 +1204,13 @@ declare class ProfilePageComponent {
1157
1204
  readonly isPasswordLoading: _angular_core.WritableSignal<boolean>;
1158
1205
  readonly isPasswordFormValid: _angular_core.Signal<boolean>;
1159
1206
  readonly passwordsMatch: _angular_core.Signal<boolean>;
1160
- readonly uploadFileFn: UploadFileFn;
1161
- private mapUploadResultToUploadedFile;
1207
+ readonly profileUploadOptions: {
1208
+ folderPath: string;
1209
+ compress: boolean;
1210
+ maxWidth: number;
1211
+ maxHeight: number;
1212
+ isPrivate: boolean;
1213
+ };
1162
1214
  constructor();
1163
1215
  private loadUserData;
1164
1216
  private loadPermissions;
@@ -1202,6 +1254,8 @@ declare class RegisterPageComponent {
1202
1254
  private readonly router;
1203
1255
  private readonly validationConfig;
1204
1256
  private readonly registrationExtension;
1257
+ private readonly translateAdapter;
1258
+ private translate;
1205
1259
  private readonly queryParamMap;
1206
1260
  private companySlugInitialized;
1207
1261
  readonly returnUrl: _angular_core.InputSignal<string>;
@@ -1247,6 +1301,8 @@ declare class ResetPasswordPageComponent {
1247
1301
  private readonly route;
1248
1302
  private readonly messageService;
1249
1303
  private readonly authApi;
1304
+ private readonly translateAdapter;
1305
+ private translate;
1250
1306
  private readonly queryParams;
1251
1307
  private tokenInitialized;
1252
1308
  private token;
@@ -1285,6 +1341,10 @@ declare class UserFormComponent {
1285
1341
  private readonly userService;
1286
1342
  private readonly permissionService;
1287
1343
  private readonly authState;
1344
+ private readonly translateAdapter;
1345
+ private readonly userFormExtension;
1346
+ private readonly parentInjector;
1347
+ private translate;
1288
1348
  private readonly routeParams;
1289
1349
  private userLoadTriggered;
1290
1350
  /** Loading state */
@@ -1303,14 +1363,27 @@ declare class UserFormComponent {
1303
1363
  readonly formModel: _angular_core.WritableSignal<IUserFormModel>;
1304
1364
  /** Form with validation schema */
1305
1365
  readonly formTree: _angular_forms_signals.FieldTree<IUserFormModel, string | number>;
1366
+ readonly isLoadingExtraFields: _angular_core.WritableSignal<boolean>;
1367
+ readonly extraFieldsModel: _angular_core.WritableSignal<Record<string, unknown>>;
1368
+ readonly originalExtraFieldsModel: _angular_core.WritableSignal<Record<string, unknown>>;
1369
+ readonly extraFields: _angular_core.Signal<IUserFormExtraField[]>;
1370
+ readonly hasExtraFields: _angular_core.Signal<boolean>;
1371
+ readonly extraFieldsValidationError: _angular_core.Signal<string | null>;
1372
+ readonly isExtraFieldsDirty: _angular_core.Signal<boolean>;
1373
+ updateExtraField(key: string, value: unknown): void;
1374
+ getExtraFieldValue(key: string): unknown;
1375
+ getFieldTemplateContext(field: IUserFormExtraField): IUserFormFieldTemplateContext;
1376
+ getFieldInjector(field: IUserFormExtraField): Injector;
1306
1377
  /** Check if form is valid */
1307
1378
  readonly isFormValid: _angular_core.Signal<boolean>;
1308
1379
  constructor();
1309
1380
  loadUser(id: string): void;
1381
+ private loadExtraFields;
1310
1382
  private toFormModel;
1311
1383
  onSubmit(): void;
1312
1384
  private updateUser;
1313
1385
  private createUser;
1386
+ private saveExtraFieldsForNewUser;
1314
1387
  private onSaveSuccess;
1315
1388
  /**
1316
1389
  * Assign user to current company and branch
@@ -1335,6 +1408,8 @@ declare class UserListComponent {
1335
1408
  private readonly userService;
1336
1409
  private readonly userListExtension;
1337
1410
  readonly userDetailConfig: _flusys_ng_auth.IUserDetailViewConfig | null;
1411
+ private readonly translateAdapter;
1412
+ private translate;
1338
1413
  readonly users: _angular_core.Signal<IUser[]>;
1339
1414
  readonly isLoading: _angular_core.Signal<boolean>;
1340
1415
  readonly total: _angular_core.Signal<number>;
@@ -1379,6 +1454,8 @@ declare class VerifyEmailPageComponent {
1379
1454
  private readonly route;
1380
1455
  private readonly messageService;
1381
1456
  private readonly authApi;
1457
+ private readonly translateAdapter;
1458
+ private translate;
1382
1459
  private readonly queryParams;
1383
1460
  private verificationTriggered;
1384
1461
  readonly isLoading: _angular_core.WritableSignal<boolean>;
@@ -1405,6 +1482,8 @@ declare class UserBranchPermissionDialogComponent {
1405
1482
  private readonly branchApi;
1406
1483
  private readonly permissionApi;
1407
1484
  private readonly messageService;
1485
+ private readonly translateAdapter;
1486
+ private t;
1408
1487
  readonly visible: _angular_core.InputSignal<boolean>;
1409
1488
  readonly user: _angular_core.InputSignal<IUser | null>;
1410
1489
  readonly closed: _angular_core.OutputEmitterRef<void>;
@@ -1435,6 +1514,8 @@ declare class UserCompanyPermissionDialogComponent {
1435
1514
  private readonly companyApi;
1436
1515
  private readonly permissionApi;
1437
1516
  private readonly messageService;
1517
+ private readonly translateAdapter;
1518
+ private t;
1438
1519
  readonly visible: _angular_core.InputSignal<boolean>;
1439
1520
  readonly user: _angular_core.InputSignal<IUser | null>;
1440
1521
  readonly closed: _angular_core.OutputEmitterRef<void>;
@@ -1451,5 +1532,5 @@ declare class UserCompanyPermissionDialogComponent {
1451
1532
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserCompanyPermissionDialogComponent, "lib-user-company-permission-dialog", never, { "visible": { "alias": "visible"; "required": true; "isSignal": true; }; "user": { "alias": "user"; "required": true; "isSignal": true; }; }, { "closed": "closed"; "permissionsChanged": "permissionsChanged"; }, never, never, true, never>;
1452
1533
  }
1453
1534
 
1454
- export { ADMINISTRATION_ROUTES, AUTH_ENDPOINTS, AUTH_PROFILE_EXTENSION, AUTH_REGISTRATION_EXTENSION, AUTH_ROUTES, AUTH_USER_DETAIL_CONFIG, AUTH_USER_LIST_EXTENSION, AUTH_VALIDATION_CONFIG, AdministrationPageComponent, AuthApiService, AuthCompanyApiProviderAdapter, AuthInitService, AuthLayoutApiAdapter, AuthLayoutStateAdapter, AuthStateProviderAdapter, AuthStateService, AuthUserPermissionProviderAdapter, AuthUserProviderAdapter, BranchApiService, BranchFormComponent, BranchListComponent, CompanyApiService, CompanyFormComponent, CompanyListComponent, ForgotPasswordPageComponent, LoginPageComponent, PROFILE_FIELD_CONTEXT, PROFILE_ROUTES, ProfilePageComponent, REGISTRATION_FIELD_CONTEXT, RegisterPageComponent, ResetPasswordPageComponent, TokenRefreshStateService, UserApiService, UserBranchPermissionDialogComponent, UserCompanyPermissionDialogComponent, UserFormComponent, UserListComponent, UserPermissionApiService, VerifyEmailPageComponent, authGuard, authInterceptor, companyFeatureGuard, emailFeatureGuard, guestGuard, isCompanySelectionResponse, isEmailVerificationRequired, isEndpoint, isLoginResponse, provideAuthLayoutIntegration, provideAuthProviders, signUpFeatureGuard, tokenRefreshInterceptor, validateEmail, validatePassword };
1455
- export type { AuthResponse, IAssignUserBranchRequest, IAssignUserCompanyRequest, IAuthValidationConfig, IBatchOperationResponse, IBranch, IBranchInfo, IBranchSelectionInfo, IChangePasswordRequest, ICompany, ICompanyInfo, ICompanySelectionResponse, ICompanyWithBranches, ICreateBranchRequest, ICreateCompanyRequest, ICreateUserRequest, IEmailValidationConfig, ILoginRequest, ILoginRequiresEmailVerification, ILoginResponse, IMeResponse, IPasswordValidationConfig, IPermissionItem, IProfileExtensionProvider, IProfileExtraField, IProfileExtraSection, IProfileFieldTemplateContext, IRefreshTokenResponse, IRegistrationExtensionProvider, IRegistrationExtraField, IRegistrationFieldTemplateContext, IRegistrationRequest, IRegistrationResponse, ISelectRequest, ISwitchCompanyRequest, IUpdateBranchRequest, IUpdateCompanyRequest, IUpdateUserRequest, IUser, IUserBranchPermission, IUserBranchesResponse, IUserCompaniesResponse, IUserCompanyPermission, IUserDetailViewConfig, IUserInfo, IUserListExtensionProvider, IUserListExtraAction, IUserListExtraColumn, UserDetailViewMode };
1535
+ export { ADMINISTRATION_ROUTES, AUTH_ENDPOINTS, AUTH_MESSAGES, AUTH_PROFILE_EXTENSION, AUTH_REGISTRATION_EXTENSION, AUTH_ROUTES, AUTH_USER_DETAIL_CONFIG, AUTH_USER_FORM_EXTENSION, AUTH_USER_LIST_EXTENSION, AUTH_VALIDATION_CONFIG, AdministrationPageComponent, AuthApiService, AuthCompanyApiProviderAdapter, AuthInitService, AuthLayoutApiAdapter, AuthLayoutStateAdapter, AuthStateProviderAdapter, AuthStateService, AuthUserPermissionProviderAdapter, AuthUserProviderAdapter, BranchApiService, BranchFormComponent, BranchListComponent, CompanyApiService, CompanyFormComponent, CompanyListComponent, ForgotPasswordPageComponent, LoginPageComponent, PROFILE_FIELD_CONTEXT, PROFILE_ROUTES, ProfilePageComponent, REGISTRATION_FIELD_CONTEXT, RegisterPageComponent, ResetPasswordPageComponent, TokenRefreshStateService, USER_FORM_FIELD_CONTEXT, UserApiService, UserBranchPermissionDialogComponent, UserCompanyPermissionDialogComponent, UserFormComponent, UserListComponent, UserPermissionApiService, VerifyEmailPageComponent, authGuard, authInterceptor, companyFeatureGuard, emailFeatureGuard, guestGuard, isCompanySelectionResponse, isEmailVerificationRequired, isEndpoint, isLoginResponse, provideAuthLayoutIntegration, provideAuthProviders, signUpFeatureGuard, tokenRefreshInterceptor, validateEmail, validatePassword };
1536
+ export type { AuthResponse, IAssignUserBranchRequest, IAssignUserCompanyRequest, IAuthValidationConfig, IBatchOperationResponse, IBranch, IBranchInfo, IBranchSelectionInfo, IChangePasswordRequest, ICompany, ICompanyInfo, ICompanySelectionResponse, ICompanyWithBranches, ICreateBranchRequest, ICreateCompanyRequest, ICreateUserRequest, IEmailValidationConfig, ILoginRequest, ILoginRequiresEmailVerification, ILoginResponse, IMeResponse, IPasswordValidationConfig, IPermissionItem, IProfileExtensionProvider, IProfileExtraField, IProfileExtraSection, IProfileFieldTemplateContext, IRefreshTokenResponse, IRegistrationExtensionProvider, IRegistrationExtraField, IRegistrationFieldTemplateContext, IRegistrationRequest, IRegistrationResponse, ISelectRequest, ISwitchCompanyRequest, IUpdateBranchRequest, IUpdateCompanyRequest, IUpdateUserRequest, IUser, IUserBranchPermission, IUserBranchesResponse, IUserCompaniesResponse, IUserCompanyPermission, IUserDetailViewConfig, IUserFormExtensionProvider, IUserFormExtraField, IUserFormFieldTemplateContext, IUserInfo, IUserListExtensionProvider, IUserListExtraAction, IUserListExtraColumn, UserDetailViewMode };