@arsedizioni/ars-utils 22.5.51 → 22.5.53
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/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +43 -43
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-core.mjs +48 -48
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +42 -42
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +94 -24
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +18 -9
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +18 -18
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +61 -61
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +9 -9
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.common.d.ts +5 -5
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1 -1
- package/types/arsedizioni-ars-utils-core.d.ts +5 -5
- package/types/arsedizioni-ars-utils-core.date.d.ts +3 -3
- package/types/arsedizioni-ars-utils-evolution.common.d.ts +23 -7
- package/types/arsedizioni-ars-utils-support.common.d.ts +11 -2
- package/types/arsedizioni-ars-utils-ui.d.ts +2 -2
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.help.d.ts +2 -2
- package/types/arsedizioni-ars-utils-ui.paginator.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.shell.d.ts +1 -1
- package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arsedizioni-ars-utils-evolution.common.mjs","sources":["../../../projects/ars-utils/evolution.common/messages.ts","../../../projects/ars-utils/evolution.common/definitions.ts","../../../projects/ars-utils/evolution.common/interceptors/auth.interceptor.ts","../../../projects/ars-utils/evolution.common/services/core.service.ts","../../../projects/ars-utils/evolution.common/services/login.service.ts","../../../projects/ars-utils/evolution.common/services/compliance.service.ts","../../../projects/ars-utils/evolution.common/services/account.service.ts","../../../projects/ars-utils/evolution.common/services/evolution.service.ts","../../../projects/ars-utils/evolution.common/services/index.ts","../../../projects/ars-utils/evolution.common/public_api.ts","../../../projects/ars-utils/evolution.common/arsedizioni-ars-utils-evolution.common.ts"],"sourcesContent":["export const EvolutionMessages = {\r\n // Error\r\n ERROR: '§evo-error',\r\n SUCCESS: '§evo-success',\r\n SUCCESS_TOAST: '§evo-success-toast',\r\n\r\n // Login\r\n LOGIN_CHANGED: '§evo-login-changed',\r\n LOGIN_COMPLETED: '§evo-login-completed',\r\n LOGOUT_COMPLETED: '§evo-logout-completed',\r\n LOGIN_PENDING: '§evo-login-pending',\r\n LOGIN_FAILED: '§evo-login-failed',\r\n LOGOUT: '§evo-logout'\r\n};\r\n","import { QueryModel, SendToModel } from '@arsedizioni/ars-utils/core';\n\n\n/**\n * Outcome of a login, an MFA confirmation, an account switch or a session restore.\n *\n * Aligned with the Evolution `/session/*` API on 2026-08-25, and mirrors\n * `EVO.API.Models.Requests.LoginResultModel`. It is a plain payload and no longer an envelope of\n * its own: `EvolutionLoginResult extends LoginResult<EvolutionUserInfo>` inherited `success` and\n * `message` from `ApiResult<boolean>`, so every answer carried two outcomes -- the transport's and\n * its own -- and the caller had to know which of the two to read. The API wraps this in\n * `ApiResult<T>` like every other payload, and that wrapper is the only outcome there is.\n *\n * `context` is absent while a login is pending an e-mailed code: nothing about the account is\n * disclosed before the code has been redeemed. `GET /session/me` answers with this same shape,\n * built by the same `ResolveSignInContextAsync`, so restoring a session and opening one give an\n * identical context by construction.\n */\nexport interface EvolutionLoginResult {\n /** The authenticated user with the licence context, or `undefined` while an MFA code is pending. */\n context?: EvolutionUserInfo;\n /** Whether a verification code has been e-mailed and must be confirmed through `/session/confirm`. */\n requiresMfa?: boolean;\n /**\n * Whether the stored password has expired and must be changed before the application is usable.\n *\n * It replaces `context.isTemporary`, which was read for the same purpose and was always false:\n * `UserInfo.IsTemporary` is `[NotMapped]` on the API, is never emitted as a claim and was never\n * filled.\n */\n requiresPasswordChange?: boolean;\n}\n\n/**\n * Answer of `GET /session/status`: whether this browser holds a live session towards the Evolution\n * API.\n *\n * This is the probe behind the link state. The auth cookie is HttpOnly and belongs to the API's\n * host, so nothing here can read it, and its presence would prove nothing anyway — the session also\n * lives server-side and may have been revoked or evicted. The endpoint never answers 401, which is\n * what makes it safe to call with no session at all: a probe that failed with a status code would be\n * reported by the interceptor as an expired session.\n */\nexport interface EvolutionSessionStatus {\n /** True when the cookie this browser presented resolves to a live, validated session. */\n connected: boolean;\n}\n\n/**\n * The session as this library holds it, persisted so a page refresh has something to validate.\n *\n * Two fields went with the new contract, and both were about replaying a login nobody asked for\n * again:\n *\n * - `remember`, the flag behind \"Ricordami\", which made the API issue an `evolution_remember`\n * cookie it could later decrypt the stored password from. `POST /session/login` has no such\n * field, the cookie is not written and nothing is replayed: a sign-in always starts from what the\n * user just typed. This is why `LoginService.autoLogin` no longer exists -- it was\n * a credential-less `login()` that relied on exactly that replay.\n * - `oauth`, the provider the session was opened with, kept so the client could re-post the\n * provider's access token on the next login. The exchange is entirely server-side now, no token\n * ever reaches the browser, and once the session cookie exists a provider login is\n * indistinguishable from a password one.\n *\n * The stored context is a hint, never evidence: the auth cookie is HttpOnly and may have expired\n * while this outlived it, so `LoginService.initialize` validates it against `/session/me` before\n * anyone is told there is a session.\n */\nexport interface EvolutionLoginInfo {\n /** The licence context of the signed-in user, as returned by the last login, switch or restore. */\n context?: EvolutionUserInfo;\n}\n\n/**\n * The `sessionStorage` key naming which account a tab is working as; its value travels on every\n * request as `X-Evo-Account`.\n *\n * It lives here, and not on `CoreService`, so the auth interceptor can read it without importing a\n * service: the interceptor is a factory precisely so that registering it does not pull the Evolution\n * service graph into the eager bundle.\n */\nexport const EVOLUTION_ACTIVE_ACCOUNT_KEY = 'evolution_account';\n\nexport interface EvolutionUserLink {\n id?: number ;\n userId: number;\n userName?: string ;\n key: string;\n}\n\n/**\n * The settings an account may change about itself: the dashboard it opens on and its flags.\n * Mirrors `UpdateUserSettingsModel`; the account is resolved from the session, and the `userId`\n * is only there for an administrator acting on somebody else.\n */\nexport interface EvolutionUpdateUserSettingsModel {\n userId?: number;\n dashboard?: string;\n flags?: number;\n}\n\n/**\n * A password change, serving both flows the API supports: the self-service one, which sends\n * `oldPassword` together with the new one, and the administrator-initiated one, which names the\n * account instead.\n */\nexport interface EvolutionResetPasswordModel {\n userId?: number;\n userEmail?: string;\n password?: string;\n oldPassword?: string;\n recaptchaToken?: string;\n}\n\n/** A password-recovery request: the address to mail the link to, plus the reCAPTCHA that guards it. */\nexport interface EvolutionRecoverPasswordModel {\n email?: string;\n recaptchaToken?: string;\n}\n\nexport interface EvolutionUserModuleInfo {\n name: string;\n module: number;\n level: number;\n hidden: boolean;\n}\n\n\nexport interface EvolutionLicenceModuleInfo {\n module: ERPModule;\n name: string;\n availableUsers: number;\n usedUsers: number;\n availableOption1?: number ;\n usedOption1?: number ;\n availableOption2?: number ;\n usedOption2?: number ;\n availableOption3?: number ;\n usedOption3?: number ;\n}\n\n/**\n * The signed-in account together with its licence context, as `ResolveSignInContextAsync` builds it\n * on the API and as every login, switch and restore returns it.\n *\n * What this interface does NOT declare is what the Evolution application computes for itself after\n * a login -- `hasFormazione`, `hasRS`, `expiry`, `expiryInfo` and the rest of the derived\n * module-accessibility flags. They are not sent by the API and this library does not invent model\n * fields the wire never carries: a host that wants them derives them from {@link allowedModules},\n * as the Evolution client does. The licence customization (logo, templates, colours) is left out\n * for the same reason plus one more: it is a model of its own, and nothing here consumes it.\n */\nexport interface EvolutionUserInfo {\n licenceId: number;\n userId: number;\n /** The place (subject / site / department) the account is scoped to, when it is scoped at all. */\n placeId?: number;\n companyName: string;\n /** Relative path of the licence logo, when the licence carries a customization. */\n companyLogo?: string;\n firstName: string;\n fullName: string;\n flags?: number ;\n email: string;\n sessionId?: string ;\n /**\n * @deprecated Always false. `UserInfo.IsTemporary` is `[NotMapped]` on the API, is never\n * emitted as a claim and is never filled; an expired password is reported by\n * {@link EvolutionLoginResult.requiresPasswordChange}. Kept only so a consumer still reading it\n * keeps compiling.\n */\n isTemporary?: boolean ;\n role: number;\n scope: number;\n roleName: string;\n roleLevel: number;\n allowedModules: EvolutionUserModuleInfo[];\n dashboard?: number ;\n dashboard2?: string ;\n code?: string ;\n subjectId?: number ;\n subjectName?: string ;\n siteId?: number ;\n siteName?: string ;\n siteCostCenter?: string ;\n departmentId?: number ;\n departmentName?: string ;\n /**\n * When the licence expires. A `Date` and not a `string`: the API sends an ISO timestamp and the\n * HTTP date interceptor is what turns it into a date, exactly as it does for every other model.\n */\n expiryDate?: Date ;\n isExpired?: boolean ;\n isAdministrator?: boolean ;\n isPowerUser?: boolean ;\n isObserver?: boolean ;\n isUser?: boolean ;\n isSupportUser?: boolean ;\n isGod?: boolean ;\n /** Whether the licence has the AI assistant available at all. */\n isMcpAvailable?: boolean ;\n /** Whether this account may use it. */\n isMcpEnabled?: boolean ;\n /** Whether the licence also has the orchestrator; its connection details stay on the host. */\n isMcpOrchestratorAvailable?: boolean ;\n /** The operator this account is bound to, for the applications that work by operator. */\n operatorId?: number ;\n /** Whether the licence carries a customization (logo, mail templates, colours). */\n hasCustomization?: boolean ;\n administrators?: string;\n availableModules: EvolutionLicenceModuleInfo[];\n availableUsers: number;\n usedUsers: number;\n availableEmployees: number;\n usedEmployees: number;\n availableStorage: number;\n usedStorage: number;\n availableOption1?: number ;\n availableOption2?: number ;\n availableOption3?: number ;\n}\n\n\n\nexport enum EvolutionServiceFlags {\n None = 0,\n NotifySystemErrors = 1,\n DisplayConnectionStateMessages = 1 << 1,\n Embedded = 1 << 2\n\n}\n\nexport enum ERPModule {\n Formazione = 1,\n DPI = 1 << 1,\n SorveglianzaSanitaria = 1 << 2,\n RegistroEScadenzario = 1 << 3,\n AttrezzatureEImpianti = 1 << 4,\n Monitoraggio = 1 << 5,\n Bollettino = 1 << 6,\n Documenti = 1 << 7\n\n}\n\nexport interface EvolutionPlaceable {\n licenceId?: number ;\n companyName?: string ;\n subjectId?: number ;\n subjectName?: string ;\n siteId?: number ;\n siteName?: string ;\n departmentId?: number ;\n departmentName?: string ;\n placeId?: number ;\n}\n\nexport enum ERPExportType\n{\n Basic = 1,\n Detailed = 8,\n Complete = 9,\n Labels = 10,\n EmployeesCoursesMatrix = 21,\n EmployeesCoursesHoursMatrix = 22,\n EmployeesPPEsMatrix = 23,\n EmployeesHealthChecksMatrix = 24,\n TasksCoursesMatrix = 31,\n Training = 101,\n TrainingExpired = 102,\n TrainingExpiring = 103,\n TrainingAbsents = 104,\n TrainingClosed = 105,\n TrainingCurrentYear = 108,\n TrainingNextYear = 109,\n TrainingAnnualPlannng = 110,\n EquipmentsActivitiesCompleted = 201,\n EquipmentsChecksMatrix = 202,\n RSNormsUsage = 301,\n RSNormsSitesMatrix = 302,\n RSNormsSummary = 303,\n MonitoringLaws = 401,\n MonitoringActivities = 402,\n MonitoringSummary = 403,\n PPEs = 501,\n ComplianceStatistics = 601,\n HealthChecks = 701,\n}\n\nexport enum ERPExportFormat\n{\n Csv = 1,\n Word = 2,\n Pdf = 3\n}\n\nexport enum ERPExportSource\n{\n All = 1,\n Query = 2,\n Selection = 3\n}\n\nexport enum ERPExportPart\n{\n IncludeRisks = 101,\n IncludeTasks = 102,\n IncludeTaskHistory = 103,\n IncludeTrainingRequired = 111,\n IncludeTrainingDone = 112,\n SelectedEmployeeCourses = 121,\n IncludeDisabledEmployees = 131,\n IncludeDismissedEmployees = 132,\n IncludeDocumentUpdates = 201,\n ExcludeNonApplicableOrAcknowledged = 202,\n ExcluteAbblicabilityTable = 203,\n IncludeActivities = 204,\n GroupLaws = 205,\n IncludeApplicableOrAcknowledgedOnly = 4301,\n IncludePPEs = 501,\n IncludeHealthChecks = 601\n}\n\nexport interface EvolutionExportModel<T> extends SendToModel {\n searchParams: T;\n selection?: number[] ;\n type: ERPExportType;\n sort?: number ;\n source: ERPExportSource;\n format: ERPExportFormat;\n parts?: ERPExportPart[] ;\n automateReport?: boolean ;\n automatedReportId?: number ;\n automatedReportSheetName?: string;\n formatExtension?: string ; \n}\n\nexport enum ERPComplianceLawsSelectionType {\n Analysis = 1,\n Activity = 2,\n}\n\nexport enum ERPComplianceProfileRole {\n None = 0,\n Analyst = 1,\n Planner = 1 << 1,\n Validator = 1 << 2,\n Executor = 1 << 3,\n Observer = 1 << 4,\n}\n\nexport enum ERPComplianceProfileFlags {\n\n OverrideNotificationRegisterSettings = 1 << 4,\n}\n\nexport enum ERPComplianceScope {\n None = 0,\n Environment = 1,\n Safety = 1 << 1,\n FoodSafety = 1 << 2,\n Energy = 1 << 3,\n Health = 1 << 4,\n Maintenance = 1 << 5,\n Quality = 1 << 6,\n Organization = 1 << 7,\n Logistics = 1 << 8,\n Facility = 1 << 9,\n Security = 1 << 10,\n GenderEquality = 1 << 11,\n AntiCorruption = 1 << 12,\n Sustainability = 1 << 13,\n InformationSecurity = 1 << 14\n}\n\nexport enum ERPComplianceNotificationLimit {\n None = 0,\n PlannerOnly = 1,\n ExecutorOnly = 2,\n Both = 3,\n}\n\nexport enum ERPComplianceRegisterNotificationType {\n None = 0,\n NewAnalysis = 1,\n AnalysisCompleted = 1 << 1,\n AnalysisNoticePeriodStarted = 1 << 2,\n AnalysisPeriodExpired = 1 << 3,\n AnalysisLawChanged = 1 << 14,\n NewPlanning = 1 << 13,\n PlanningCompleted = 1 << 4,\n PlanningNoticePeriodStarted = 1 << 5,\n PlanningPeriodExpired = 1 << 6,\n NewValidation = 1 << 15,\n ValidationCompleted = 1 << 7,\n ValidationNoticePeriodStarted = 1 << 8,\n ValidationPeriodExpired = 1 << 9,\n NewDeadline = 1 << 16,\n DeadlineNoticePeriodStarted = 1 << 10,\n DeadlineExpired = 1 << 11,\n ActivityCompleted = 1 << 12,\n //NewNoncompliance = 1 << 17,\n //NonComplianceNoticePeriodStarted = 1 << 18,\n //NonCompliancePeriodExpired = 1 << 19,\n //NonComplianceCompleted = 1 << 20,\n LawChanged = 1 << 21,\n}\n\nexport enum ERPComplianceRegisterSiteImportOptions {\n CopyAttachments = 1,\n KeepOriginalDates = 1 << 1,\n DuplicateLaws = 1 << 2,\n DiscardNotApplicables = 1 << 3\n}\n\nexport const EvolutionComplianceProfileRoles = [\n { name: 'Analista', value: ERPComplianceProfileRole.Analyst },\n { name: 'Gestore', value: ERPComplianceProfileRole.Planner },\n //{ name: 'Validatore', value: ERPComplianceProfileRole.Validator },\n { name: 'Esecutore', value: ERPComplianceProfileRole.Executor },\n { name: 'Osservatore', value: ERPComplianceProfileRole.Observer },\n];\n\nexport const EvolutionComplianceProfileFlags = [\n { name: 'Deroghe e limitazioni', divider: true },\n {\n name:\n 'Questo profilo riceve regolarmente le notifiche indipendentemente dalla configurazione generale del registro',\n value: ERPComplianceProfileFlags.OverrideNotificationRegisterSettings,\n },\n];\n\nexport const EvolutionComplianceScopes = [\n { name: 'Ambiente', value: ERPComplianceScope.Environment },\n { name: 'Salute e sicurezza', value: ERPComplianceScope.Safety },\n {\n name: 'Sicurezza alimentare',\n value: ERPComplianceScope.FoodSafety,\n },\n { name: 'Energia', value: ERPComplianceScope.Energy },\n { name: 'Servizi generali', value: ERPComplianceScope.Facility },\n { name: 'Manutenzione', value: ERPComplianceScope.Maintenance },\n { name: 'Qualità', value: ERPComplianceScope.Quality },\n { name: 'Organizzazione', value: ERPComplianceScope.Organization },\n { name: 'Logistica', value: ERPComplianceScope.Logistics },\n { name: 'Security', value: ERPComplianceScope.Security },\n { name: \"Anticorruzione\", value: ERPComplianceScope.AntiCorruption },\n { name: \"Sostenibilità\", value: ERPComplianceScope.Sustainability },\n { name: \"Parità di genere\", value: ERPComplianceScope.GenderEquality },\n { name: \"Sicurezza dell'informazione\", value: ERPComplianceScope.InformationSecurity },\n\n];\n\nexport const EvolutionComplianceNotificationLimits = [\n { name: 'Nessuna limitazione', value: ERPComplianceNotificationLimit.None },\n {\n name: 'Solo gestore che ha pianificato',\n value: ERPComplianceNotificationLimit.PlannerOnly,\n },\n {\n name: \"Solo all'incaricato designato\",\n value: ERPComplianceNotificationLimit.ExecutorOnly,\n },\n {\n name: 'Solo a gestore e incaricato designato',\n value: ERPComplianceNotificationLimit.Both,\n },\n];\n\nexport const EvolutionComplianceNotifications = [\n { name: 'Verifica applicabilità e analisi', divider: true },\n {\n name: 'Richiesta analisi',\n value: ERPComplianceRegisterNotificationType.NewAnalysis,\n },\n {\n name: \"Preavviso: sta per scadere il termine fissato per l'analisi\",\n value: ERPComplianceRegisterNotificationType.AnalysisNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'analisi\",\n value: ERPComplianceRegisterNotificationType.AnalysisPeriodExpired,\n },\n {\n name: 'Analisi completata',\n value: ERPComplianceRegisterNotificationType.AnalysisCompleted,\n },\n {\n name: 'Avviso norma modificata dal legislatore',\n value: ERPComplianceRegisterNotificationType.AnalysisLawChanged,\n },\n { name: 'Pianificazioni', divider: true },\n {\n name: 'Richiesta gestione',\n value: ERPComplianceRegisterNotificationType.NewPlanning,\n },\n {\n name: 'Preavviso: sta per scadere il termine fissato per la gestione',\n value: ERPComplianceRegisterNotificationType.PlanningNoticePeriodStarted,\n },\n {\n name: 'Allarme: è scaduto il termine fissato per la gestione',\n value: ERPComplianceRegisterNotificationType.PlanningPeriodExpired,\n },\n {\n name: 'Gestione completata',\n value: ERPComplianceRegisterNotificationType.PlanningCompleted,\n },\n {\n name: 'Attività completata',\n value: ERPComplianceRegisterNotificationType.ActivityCompleted,\n },\n /*{ name: 'Gestione non conformità', divider: true },\n {\n name: 'Apertura non comformità',\n value: ERPComplianceRegisterNotificationType.NewNoncompliance,\n },\n {\n name:\n \"Preavviso: sta per scadere il termine fissato per l'azione correttiva\",\n value:\n ERPComplianceRegisterNotificationType.NonComplianceNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'azione correttiva\",\n value: ERPComplianceRegisterNotificationType.NonCompliancePeriodExpired,\n },\n {\n name: 'Chiusura non conformità',\n value: ERPComplianceRegisterNotificationType.NonComplianceCompleted,\n },*/\n /*{ name: 'Approvazioni', divider: true },\n { name: 'Richiesta approvazione', value: 1 << 14 },\n {\n name: \"Preavviso: sta per scadere il termine fissato per l'approvazione\",\n value: ERPComplianceRegisterNotificationType.ValidationNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'approvazione\",\n value: ERPComplianceRegisterNotificationType.ValidationPeriodExpired,\n },\n {\n name: 'Approvazione concessa o negata',\n value: ERPComplianceRegisterNotificationType.ValidationCompleted,\n },*/\n { name: 'Scadenze', divider: true },\n {\n name: 'Preavviso: 1° promemoria sulla data di scadenza',\n value: ERPComplianceRegisterNotificationType.NewValidation,\n },\n {\n name: 'Avviso: 2° promemoria sulla data di scadenza',\n value: ERPComplianceRegisterNotificationType.DeadlineNoticePeriodStarted,\n },\n {\n name: 'Allarme: è scaduto il termine',\n value: ERPComplianceRegisterNotificationType.DeadlineExpired,\n },\n { name: 'Norme collegate', divider: true },\n {\n name: 'Modifica o abrogazione',\n value: ERPComplianceRegisterNotificationType.LawChanged,\n },\n\n];\n\nexport enum ERPComplianceLawState {\n ApplicableOrAknowledged = 1,\n NotApplicable = 2,\n NotAnalyzed = 3,\n ExpiredAnalysis = 4,\n UpdatedLaws = 5,\n Analyzed = 6,\n Abrogated = 7,\n Applicable = 8,\n Aknowledged = 9\n}\n\nexport enum ERPComplianceLawOrigin {\n National = 1,\n EU = 2,\n Regional = 3,\n Local = 4,\n Technical = 5,\n Voulontary = 6,\n Internal = 7,\n Other = 8,\n}\n\nexport const EvolutionComplianceLawStates = [\n { name: 'Applicabile', value: ERPComplianceLawState.Applicable },\n { name: 'Da conoscere', value: ERPComplianceLawState.Aknowledged },\n {\n name: 'Applicabile / da conoscere',\n value: ERPComplianceLawState.ApplicableOrAknowledged,\n },\n { name: 'Non applicabile', value: ERPComplianceLawState.NotApplicable },\n { name: 'Abrogata', value: ERPComplianceLawState.Abrogated },\n { name: 'Analizzata', value: ERPComplianceLawState.Analyzed },\n { name: 'Da definire', value: ERPComplianceLawState.NotAnalyzed },\n { name: 'In ritardo', value: ERPComplianceLawState.ExpiredAnalysis },\n {\n name: 'Con aggiornamenti pendenti',\n value: ERPComplianceLawState.UpdatedLaws,\n },\n];\n\nexport const EvolutionComplianceLawOrigins = [\n { name: 'Nazionale', value: ERPComplianceLawOrigin.National },\n { name: 'Comunitaria', value: ERPComplianceLawOrigin.EU },\n { name: 'Regionale', value: ERPComplianceLawOrigin.Regional },\n { name: 'Locale', value: ERPComplianceLawOrigin.Local },\n { name: 'Tecnica', value: ERPComplianceLawOrigin.Technical },\n { name: 'Interna', value: ERPComplianceLawOrigin.Internal },\n { name: 'Volontaria', value: ERPComplianceLawOrigin.Voulontary },\n { name: 'Altro', value: ERPComplianceLawOrigin.Other },\n];\n\nexport const EvolutionComplianceLawChangeStates = [\n { name: 'Aperto', value: 1 },\n { name: 'Chiuso', value: 2 },\n];\n\nexport enum ERPComplianceActivityState {\n NotPlanned = 1 << 7,\n Closed = 1 << 2,\n Expired = 1 << 3,\n Planned = 1 << 8,\n Cancelled = 1 << 9,\n UpdatedLaws = 1 << 10,\n AlreadyManaged = 1 << 11\n}\n\nexport const EvolutionComplianceActivityStates = [\n {\n name: 'Da definire',\n value: ERPComplianceActivityState.NotPlanned,\n },\n {\n name: 'Pianificata',\n value: ERPComplianceActivityState.Planned,\n },\n {\n name: 'Chiusa',\n value: ERPComplianceActivityState.Closed,\n },\n {\n name: 'In ritardo',\n value: ERPComplianceActivityState.Expired,\n },\n {\n name: 'Annullata',\n value: ERPComplianceActivityState.Cancelled,\n },\n {\n name: 'Gestita separatamente',\n value: ERPComplianceActivityState.AlreadyManaged,\n },\n {\n name: 'Con aggiornamenti pendenti',\n value: ERPComplianceActivityState.UpdatedLaws,\n },\n];\n\nexport const EvolutionComplianceObligationTypes = [\n { name: 'Autorizzazione', value: 1 },\n { name: 'Verifiche periodiche manutentive', value: 2 },\n { name: 'Misure organizzative', value: 3 },\n { name: 'Controlli e misurazioni', value: 4 },\n { name: 'Entrata in vigore', value: 5 },\n { name: 'Documenti aziendali obbligatori', value: 6 },\n {\n name: 'Altri adempimenti formali (comunicazioni, dichiarazioni, ecc...)',\n value: 7,\n },\n { name: 'Altro', value: 99 },\n];\n\nexport const EvolutionComplianceObligationAuthorities = [\n { name: 'Agenzia ECHA', value: 1 },\n { name: 'Albo Nazionale dei Gestori Ambientali', value: 2 },\n { name: 'ARPA', value: 4 },\n { name: 'ASL', value: 5 },\n { name: 'Camera di Commercio', value: 8 },\n { name: 'Comando provinciale dei Vigili del Fuoco', value: 10 },\n { name: 'Comune', value: 13 },\n { name: 'Consorzi gestione rifiuti particolari', value: 14 },\n { name: 'Gestore del servizio', value: 21 },\n { name: 'Gestore della rete di trasmissione nazionale', value: 22 },\n { name: 'INAIL - IPSEMA - ISPESL', value: 23 },\n { name: 'ISPRA', value: 26 },\n { name: 'Ministero', value: 27 },\n { name: 'Genio civile', value: 30 },\n { name: 'Organo di vigilanza competente', value: 31 },\n { name: 'Provincia', value: 33 },\n { name: 'Regione', value: 35 },\n { name: 'Uffici tecnici di finanza', value: 36 },\n { name: 'Ispettorato del lavoro', value: 37 },\n { name: 'Comitato Regionale Tecnico VF', value: 38 },\n { name: 'Prefetto', value: 39 },\n { name: 'Organismo notificato', value: 40 },\n { name: 'Città Metropolitana', value: 41 },\n { name: 'Nessuna', value: 28 },\n { name: 'Altro', value: 3 }\n];\n\nexport enum ERPRecurrenceFrequencyType {\n Day = 1,\n Month = 2,\n Year = 3,\n}\nexport const EvolutionRecurrenceFrequencyTypes = [\n { name: 'Anni', value: ERPRecurrenceFrequencyType.Year },\n { name: 'Mesi', value: ERPRecurrenceFrequencyType.Month },\n { name: 'Giorni', value: ERPRecurrenceFrequencyType.Day },\n];\n\nexport enum ERPPlacePermission {\n None = 0,\n Denied = 1,\n Read = 2,\n Write = 3\n}\n\nexport enum ERPPlace {\n Subject = 1,\n Site = 2,\n Department = 3,\n Area = 4,\n Line = 5\n}\nexport interface EvolutionPermission {\n placeId: number;\n userId: number;\n allowRead: number;\n allowWrite: number;\n allowNone: number;\n}\n\nexport interface EvolutionPlacePermission extends EvolutionPermission {\n id: number;\n subjectId?: number;\n siteId?: number;\n departmentId?: number;\n mode: number;\n}\n\nexport interface EvolutionContextInfo {\n id: number;\n userId?: number;\n name: string;\n permission: EvolutionPermission;\n placePermission: ERPPlacePermission;\n costCenter: string;\n selected?: boolean;\n level?: number;\n levelTitle?: string;\n}\n\nexport class EvolutionComplianceContextInfo {\n licenceId?: number;\n companyName?: string;\n registerTitle?: string;\n registerId?: number;\n siteName?: string;\n siteId?: number;\n userId?: number;\n items?: EvolutionContextInfo[];\n}\n\nexport interface EvolutionChangeContextModel {\n userId?: number ;\n licenceId?: number ;\n subjectId?: number ;\n siteId?: number ;\n registerId?: number ;\n role?: ERPComplianceProfileRole ;\n permission?: ERPPlacePermission ;\n option1Value?: number ;\n option2Value?: number ;\n option3Value?: number ;\n allowObservers?: boolean ;\n allowDisabled?: boolean ;\n}\n\nexport interface EvolutionChangeContextResultModel {\n items: EvolutionContextInfo[];\n}\n\nexport interface EvolutionComplianceRegister extends EvolutionPlaceable {\n id: number;\n title?: string;\n enableNotifications?: boolean;\n enableNotification1?: boolean;\n enableNotification2?: boolean;\n enableNotification3?: boolean;\n enableNotification4?: boolean;\n enableNotification5?: boolean;\n enableNotification7?: boolean;\n enableNotification8?: boolean;\n enableNotification9?: boolean;\n notification1NoticeDays?: number;\n notification2NoticeDays?: number;\n notification2Limit?: number;\n notification3NoticeDays?: number;\n notification4NoticeDays?: number;\n notification4Limit?: number;\n notification5NoticeDays?: number;\n notification5Limit?: number;\n notification6Limit?: number;\n notification8NoticeDays?: number;\n notification8Limit?: number;\n enableActivityLawsPopulation?: boolean;\n enableLawChangesTracking?: boolean;\n automationMode?: number;\n automationScope?: number;\n disabled?: boolean;\n created?: Date;\n lastUpdated?: Date;\n lastUpdatedBy?: string;\n totalSites?: number;\n totalProfiles?: number;\n sites?: EvolutionComplianceRegisterSite[];\n oldId?: string;\n isAutomationEnabled?: boolean;\n automationModeDescription?: string;\n automationScopeDescription?: string;\n context?: EvolutionComplianceContextInfo;\n isMenuOpen?: boolean;\n isOver?: boolean;\n}\n\nexport interface EvolutionRegisterProfileSiteInfo extends EvolutionContextInfo {\n\n}\n\nexport interface EvolutionRegisterProfileUserInfo {\n userId: number;\n name: string;\n sites: EvolutionRegisterProfileSiteInfo[];\n}\n\nexport interface ComplianceRegisterUsersResultModel {\n users: EvolutionRegisterProfileUserInfo[];\n sites: EvolutionRegisterProfileSiteInfo[];\n}\n\nexport interface EvolutionComplianceRegisterSite {\n id: number;\n complianceRegisterId?: number;\n complianceSiteId?: number;\n disabled?: boolean;\n created?: Date;\n licenceId?: number;\n subjectId?: number;\n subjectName: string;\n siteId?: number;\n siteName?: string;\n departmentId?: number;\n departmentName?: string;\n registerTitle?: string;\n placeId?: number;\n oldSiteId?: string;\n}\n\nexport interface EvolutionComplianceLaw extends EvolutionPlaceable {\n id?: number;\n state?: number;\n complianceRegisterId?: number;\n lot?: number;\n topicId?: string;\n topicPath?: string;\n topicName?: string;\n summary?: string;\n scope?: number;\n source?: string;\n references?: EvolutionComplianceLawReference[];\n originalLawId?: number ;\n originRegion?: string ;\n origin?: number ;\n originAlternativeDescription?: string ;\n description?: string ;\n documentShortTitle?: string ;\n documentTitle?: string ;\n documentNumber?: string ;\n documentDate?: Date ;\n documentLastUpdate?: string ;\n documentLastUpdateShortTitle?: string ;\n documentUpdateNotes?: string ;\n documentValidated?: boolean ;\n documentId?: string ;\n documentModel?: number ;\n documentReferences?: string ;\n documentNotes?: string ;\n documentForceGlobalCheckForUpdates?: boolean;\n complianceCheckItem1?: boolean ;\n complianceCheckItem2?: boolean ;\n complianceCheckItem3?: boolean ;\n complianceCheckItem4?: boolean ;\n complianceCheckItem5?: boolean ;\n complianceCheckItem6?: boolean ;\n complianceCheckItem7?: boolean ;\n complianceCheckItem8?: boolean ;\n complianceCheckItem9?: boolean ;\n complianceCheckItem10?: boolean ;\n complianceCheckItem11?: boolean ;\n complianceCheckItem12?: boolean ;\n alternativeComplianceCheckItem?: boolean ;\n alternativeComplianceDescription?: string ;\n applicability?: number ;\n analyzedBy?: string ;\n analystOperatorId?: number ;\n analysisExpiringDate?: Date ;\n analysisDate?: Date ;\n analysisNotes?: string ;\n analysisNoticeDate?: string ;\n group1?: string ;\n group2?: string ;\n count?: number ;\n created?: Date ;\n createdBy?: string ;\n lastUpdated?: Date ;\n lastUpdatedBy?: string ;\n}\n\nexport interface EvolutionQueryRegisterProfilesModel extends QueryModel {\n complianceRegisterId?: number;\n siteId?: number;\n userId?: number;\n licenceId?: number;\n name?: string;\n role?: number;\n allowObservers?: boolean;\n allowDisabled?: boolean;\n state?: number;\n}\n\nexport interface EvolutionComplianceRegisterProfile {\n id: number;\n licenceId?: number;\n userId?: number;\n passiveUserName?: string;\n passiveUserOperatorId?: number;\n complianceRegisterId?: number;\n complianceSiteId?: number;\n scopes?: number;\n selectedScopes?: number[];\n roles?: number;\n selectedRoles?: number[];\n notifications?: number;\n flags?: number;\n disabled?: boolean;\n created?: Date;\n lastUpdated?: Date;\n lastUpdatedBy?: string;\n subjectId?: number;\n subjectName?: string;\n siteId?: number;\n siteName?: string;\n siteDisabled?: boolean;\n departmentId?: number;\n departmentName?: string;\n passiveUserEmail?: string;\n placeId?: number;\n userEmail?: string;\n userOperatorId?: number;\n userDisabled?: boolean;\n registerDisabled?: boolean;\n registerTitle?: string;\n name?: string;\n scopeNames?: string;\n isAdministrator?: boolean;\n isObserver?: boolean;\n denied?: boolean;\n oldId?: string;\n operatorId?: number;\n isMenuOpen?: boolean;\n isOver?: boolean;\n context?: EvolutionComplianceContextInfo;\n}\nexport interface EvolutionComplianceLawDocumentInfo {\n documentId?: string;\n documentId2?: string;\n title2?: string;\n title1?: string;\n number?: string;\n date?: Date;\n origin?: number;\n originDescription?: string;\n originAlternativeDescription?: string;\n originRegion?: string;\n notes?: string;\n references?: EvolutionComplianceLawReference[];\n forceGlobalCheckForUpdates?: boolean;\n validated?: boolean;\n description?: string;\n taxonomy?: string;\n taxonomyPath?: string;\n}\n\nexport interface EvolutionComplianceLawsAddParams extends EvolutionComplianceLaw {\n context?: EvolutionComplianceContextInfo;\n documents?: EvolutionComplianceLawDocumentInfo[];\n shouldNotifyAnalysisCompletionAgain?: boolean;\n scopes?: number[];\n sites?: number[];\n registers?: number[];\n}\n\n/** Export parameters for compliance laws. */\nexport interface EvolutionComplianceLaswExportParams extends EvolutionExportModel<Partial<EvolutionComplianceLaw>> {}\n\nexport interface EvolutionComplianceLawReference {\n id?: number ;\n complianceLawId?: number ;\n text: string;\n description?: string ;\n anchor: string;\n}\n\nexport interface EvolutionComplianceActivity extends EvolutionPlaceable {\n id: number;\n state: number;\n monitoringActivityId?: number;\n monitoringActivityTaskId?: number;\n complianceRegisterId?: number;\n childId?: number ;\n parentId?: number ;\n lot?: number ; \n summary?: string;\n scope?: number;\n topicId?: string ;\n topicPath?: string;\n topicName?: string;\n mandatory?: boolean ;\n obligationType?: number ;\n obligationAuthorityId?: number ;\n obligationNotes?: string;\n obligationCheckPoint?: boolean ;\n description?: string;\n deadlineRecurrent?: boolean ;\n deadlineFrequency?: number ;\n deadlineFrequencyType?: number ;\n deadlineFrequencyEndOfMonth?: boolean ;\n deadlineFirstNoticeDays?: number ;\n deadlineLastNoticeDays?: number ;\n deadlineFirstNoticeDate?: Date ;\n deadlineLastNoticeDate?: Date ;\n deadlineExpiringDate?: Date ;\n planningNoticeDate?: Date ;\n planningExpiringDate?: Date ;\n planningDate?: Date ;\n plannedBy?: string;\n plannerOperatorId?: number ;\n planningApplicability?: number ;\n planningNotificationAdditionalEmailHeader?: string;\n planningNotificationAdditionalEmails?: string;\n planningNotificationAdditionalEmailsForAlertsOnly?: string;\n planningNamedExecutorOperatorId?: number ;\n planningNamedExecutorName?: string;\n planningNamedExecutorManagerOperatorId?: number ;\n planningNamedExecutorManagerName?: string;\n planningScheduleNextFromExecutionDate?: boolean ;\n planningNotes?: string;\n executorOperatorId?: number ;\n executed?: boolean;\n executedBy?: string;\n executionDate?: Date;\n externalReference?: string;\n externalDescription?: string;\n group1?: string;\n group2?: string;\n notes?: string;\n created?: Date;\n createdBy?: string;\n lastUpdated?: Date ;\n lastUpdatedBy?: string;\n\n}\n\nexport interface EvolutionComplianceActivitiesAddParams extends EvolutionComplianceActivity {\n context?: EvolutionComplianceContextInfo;\n complianceLawId?: number;\n monitoringLawId?: number;\n enableLawChangesTracking?: boolean;\n enableActivityLawsPopulation?: boolean;\n shouldNotifyPlanningCompletionAgain?: boolean;\n scopes?: number[];\n sites?: number[];\n registers?: number[];\n document?: EvolutionComplianceLawDocumentInfo;\n}","import { HttpInterceptorFn, HttpResponse } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { BroadcastService, ErrorInfo } from '@arsedizioni/ars-utils/core';\nimport { catchError, tap, throwError } from 'rxjs';\nimport { EVOLUTION_ACTIVE_ACCOUNT_KEY, EvolutionServiceFlags } from '../definitions';\nimport { EvolutionMessages } from '../messages';\n\n/** Minimum milliseconds between consecutive generic error broadcasts (debounce guard). */\nconst ERROR_DEBOUNCE_MS = 5000;\n\n/**\n * Returns whether the URL is an authentication endpoint, where a 401 is a normal outcome -- wrong\n * credentials, a rejected code, a refused passkey -- rather than an expired or invalid session.\n *\n * They are called by a visitor who has no session by definition, so answering \"la sessione non è\n * più valida\" would send them back to the page they are already standing on and hide the real\n * reason they were refused.\n *\n * The list covers the whole Evolution sign-in surface, including the ways in that this library does\n * not itself offer: a host application registers one interceptor for every call it makes to the\n * API, its own passkey and provider flows included.\n * @param url - The request URL.\n * @returns True when the URL is a login / confirm / otp / oauth / passkey endpoint.\n */\nfunction isAuthEndpoint(url: string): boolean {\n return url.includes('/session/login')\n || url.includes('/session/confirm')\n || url.includes('/session/otp')\n || url.includes('/session/oauth')\n || url.includes('/passkeys/request-options')\n || url.includes('/passkeys/login');\n}\n\n/**\n * Returns whether the URL is the silent link probe, whose failures must never reach the user.\n *\n * `/session/status` runs unconditionally at every bootstrap, including for users who never linked\n * Evolution at all. When the API is unreachable, reporting that failure would show \"Evolution non è\n * disponibile\" to somebody who never asked Evolution for anything: the error is still rethrown for\n * the caller to observe, but nothing is broadcast.\n * @param url - The request URL.\n * @returns True when the URL is the status probe.\n */\nfunction isStatusProbe(url: string): boolean {\n return url.includes('/session/status');\n}\n\n/**\n * Resolves the user-facing message for a failed request.\n * @param error - The raw HTTP error object.\n * @param errorStatus - The numeric HTTP status code.\n * @returns A localised message, ready to be rendered as HTML.\n */\nfunction resolveErrorMessage(error: any, errorStatus: number): string {\n const message = error?.error?.message ?? error?.message;\n switch (errorStatus) {\n case 0:\n return \"In questo momento Evolution non è disponibile. Riprova tra qualche minuto.\";\n case 401:\n // A 401 that reaches here comes from a sign-in attempt; anything else was classified as a\n // dead session before this function was called.\n return message ?? \"Credenziali non valide o accesso non abilitato.\";\n case 403:\n return \"Non hai i permessi necessari per eseguire l'operazione richiesta.\";\n case 429:\n return message ?? \"Troppe richieste consecutive. Aspetta qualche secondo.\";\n default:\n return (message ?? \"Impossibile eseguire l'operazione richiesta.\")\n .replaceAll('\\r\\n', '</p><p>');\n }\n}\n\n/**\n * Builds the Evolution auth HTTP interceptor.\n *\n * Attaches the credentials, the service-worker bypass and the active-account header to every\n * request aimed at the Evolution API, and turns HTTP failures into broadcast messages -- no UI\n * dependency here.\n *\n * Takes the Evolution base URI and the service flags directly as arguments, captured in the\n * closure, so it never injects `EvolutionService`: registering it does not pull the whole Evolution\n * service into the eager bundle. The debounce and the expiry latch live in that same closure, so\n * two applications registering two interceptors never share them.\n *\n * ## What the statuses mean\n *\n * Aligned with the Evolution API on 2026-08-25. The meaning of the status codes changed with it:\n * failures used to arrive as `200 OK` with `success: false`, and a dead session had to be guessed\n * from a 405, a 410 or any 5xx. Now the status is the truth -- a 401 on an already-authenticated\n * request means the session is gone, a 403 means the permission is missing, a 5xx means the server\n * broke, and those are three different things that used to be one. `invalidateSession` is\n * therefore now, and only, a 401 outside the authentication endpoints.\n *\n * `EvolutionServiceFlags.NotifySystemErrors` still governs one narrow case, and only that one: a\n * 5xx, i.e. a failure of the server rather than of the request. Without the flag it is swallowed,\n * as it always was in this library.\n *\n * Errors are re-thrown rather than swallowed: call sites rely on their `error` callback firing, and\n * on `finalize` clearing a busy dialog.\n *\n * Register it with `withInterceptors`:\n * @example\n * provideHttpClient(withInterceptors([\n * evolutionAuthInterceptor(environment.evolutionServiceUri,\n * EvolutionServiceFlags.DisplayConnectionStateMessages | EvolutionServiceFlags.Embedded),\n * ]))\n *\n * @param serviceUri - Base URI of the Evolution service; only requests starting with it are handled.\n * @param flags - Service flags (e.g. NotifySystemErrors). Defaults to None.\n * @returns An `HttpInterceptorFn` ready to register.\n */\nexport function evolutionAuthInterceptor(\n serviceUri: string,\n flags: EvolutionServiceFlags = EvolutionServiceFlags.None\n): HttpInterceptorFn {\n /** Timestamp of the last generic error shown, used to debounce a burst of failures into one. */\n let lastErrorTime = -1;\n\n /**\n * Whether the session-expiry notification has already been sent. Prevents a storm of dialogs when\n * several in-flight requests fail at once; re-armed on the next successful response.\n */\n let sessionExpiredNotified = false;\n\n /**\n * Broadcasts a generic, user-facing error for an Evolution HTTP failure, debounced.\n * @param error - The raw error value thrown by the HTTP layer.\n * @param errorStatus - The numeric HTTP status code.\n * @param broadcastService - The broadcast service for the current request.\n * @returns void\n */\n function notifyError(error: unknown, errorStatus: number, broadcastService: BroadcastService): void {\n // A broken server is the one case the flag still governs.\n if (errorStatus >= 500 && (flags & EvolutionServiceFlags.NotifySystemErrors) === 0) return;\n\n const now = Date.now();\n if (now - lastErrorTime <= ERROR_DEBOUNCE_MS) return;\n lastErrorTime = now;\n\n broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n {\n invalidateSession: false,\n message: resolveErrorMessage(error, errorStatus),\n title: \"Errore in Evolution\",\n errorStatus,\n service: serviceUri\n } as ErrorInfo\n );\n }\n\n // The interceptor itself. Runs in an injection context, so `inject()` works.\n return (request, next) => {\n if (!serviceUri || !request.url.startsWith(serviceUri)) {\n return next(request);\n }\n\n const broadcastService = inject(BroadcastService);\n\n const authenticatedRequest = request.clone({\n // `withCredentials` is what carries the session: an HttpOnly cookie the application cannot\n // read, cannot forge and cannot forget to send.\n withCredentials: true,\n setHeaders: {\n 'ngsw-bypass': 'ngsw-bypass',\n // Which of the accounts inside the one session cookie this tab is working as. It replaces\n // the per-tab random `X-Client-Id`, whose only job was to give each tab a cookie of its\n // own -- one per tab ever opened, all of them sent on every request, until the header\n // outgrew what the server accepts. Empty on a tab that has not signed in yet: the API then\n // serves the active account.\n 'X-Evo-Account': sessionStorage.getItem(EVOLUTION_ACTIVE_ACCOUNT_KEY) ?? ''\n }\n });\n\n return next(authenticatedRequest).pipe(\n tap(event => {\n // A response means the session is valid again: re-arm the expiry notifier.\n if (event instanceof HttpResponse) {\n sessionExpiredNotified = false;\n }\n }),\n catchError((error: any) => {\n // Which request this was is read from the request, not from `error.url`: a failure with no\n // response -- the browser refusing the connection while the API restarts -- carries no URL\n // at all. Everything that gets here is an Evolution request anyway: the others returned\n // before the pipe was built.\n const errorStatus = parseInt(error?.status ?? '0');\n\n if (isStatusProbe(authenticatedRequest.url)) {\n // The silent probe stays silent: its caller reads the outcome from the rethrown error,\n // nobody else needs to hear about it.\n } else if (errorStatus === 401 && !isAuthEndpoint(authenticatedRequest.url)) {\n // Expired or invalidated session on an authenticated request. Notified once: several\n // in-flight requests failing together is how a single expiry becomes a wall of dialogs.\n if (!sessionExpiredNotified) {\n sessionExpiredNotified = true;\n broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n {\n invalidateSession: true,\n message: \"La sessione di lavoro non è più valida.\",\n title: \"Errore in Evolution\",\n errorStatus,\n service: serviceUri\n } as ErrorInfo\n );\n }\n } else {\n notifyError(error, errorStatus, broadcastService);\n }\n\n return throwError(() => error);\n })\n );\n };\n}\n","import { Service, Signal, WritableSignal, inject, signal } from '@angular/core';\nimport { BroadcastService } from '@arsedizioni/ars-utils/core';\nimport { EvolutionMessages } from '../messages';\nimport { EVOLUTION_ACTIVE_ACCOUNT_KEY, EvolutionLoginInfo, EvolutionLoginResult, EvolutionServiceFlags, EvolutionUserInfo } from '../definitions';\n\n/**\n * @internal\n * Private state container for the Evolution session.\n *\n * Intentionally NOT exported from the barrel: it must never be injected by\n * application code. Its state and pure mutations are re-published through\n * {@link EvolutionService} (and partly {@link LoginService}). The feature\n * services inject it ONLY to read {@link serviceUri}.\n *\n * Owns the back-end URI, feature flags, persisted login info and the session\n * signals. No HTTP, no auth orchestration.\n */\n@Service()\nexport class CoreService {\n\n private readonly broadcastService = inject(BroadcastService);\n\n private _serviceUri: string | undefined;\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined {\n return this._serviceUri;\n }\n /**\n * Sets the base URI of the Evolution back-end service.\n * @param uri - The base URL.\n * @returns void\n */\n setServiceUri(uri: string): void {\n this._serviceUri = uri;\n }\n\n private _flags: EvolutionServiceFlags = EvolutionServiceFlags.None;\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags {\n return this._flags;\n }\n /**\n * Sets the active feature flags.\n * @param flags - The flags bitmask to apply.\n * @returns void\n */\n setFlags(flags: EvolutionServiceFlags): void {\n this._flags = flags;\n }\n\n private _loginInfo?: EvolutionLoginInfo;\n /**\n * Gets the current login info, hydrating it from `localStorage` on first\n * access when no in-memory value is available.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined {\n if (!this._loginInfo) {\n const raw = localStorage.getItem('evolution_context');\n if (raw) {\n try {\n this._loginInfo = JSON.parse(raw) as EvolutionLoginInfo;\n } catch { /* invalid JSON — ignore and leave undefined */ }\n }\n }\n return this._loginInfo;\n }\n\n /**\n * Gets the signed-in account.\n * @returns The current {@link EvolutionUserInfo}, or `undefined` when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.loginInfo?.context; }\n\n /**\n * Seeded from the stored context, which means \"this browser signed in at some point\" and nothing\n * more: the auth cookie is HttpOnly and may have expired while the stored context lived on.\n * `LoginService.initialize` turns the hint into an answer by asking `/session/me`, and the hint\n * is what keeps a visitor who never signed in from calling a route that would answer 401 and\n * raise a dead-session error over the sign-in page.\n */\n private readonly _loggedIn = signal<boolean>(localStorage.getItem('evolution_context') !== null);\n /** `true` when this browser has a session the API has accepted. */\n public readonly loggedIn: Signal<boolean> = this._loggedIn.asReadonly();\n /**\n * Sets the logged-in state.\n * @param value - The new logged-in value.\n * @returns void\n */\n setLoggedIn(value: boolean): void {\n this._loggedIn.set(value);\n }\n\n /** `true` while a login request is in flight. */\n public readonly loggingIn: WritableSignal<boolean> = signal<boolean>(false);\n\n /** The `sessionStorage` key naming which account this tab is working as. */\n static readonly activeAccountKey = EVOLUTION_ACTIVE_ACCOUNT_KEY;\n\n /**\n * Records which account this tab is working as, so the interceptor can name it on every request.\n *\n * `sessionStorage` and not `localStorage`: the choice belongs to the tab. One cookie holds every\n * account this browser has open, and two tabs may sit on two different licences while reading\n * that same cookie -- which is what replaced the per-tab `X-Client-Id`, a random UUID that gave\n * every tab ever opened a session cookie of its own until the header outgrew what the server\n * accepts.\n * @param userId - The account to work as, or `undefined` to stop naming one.\n * @returns void\n */\n setActiveAccount(userId?: number): void {\n if (userId && userId > 0) {\n sessionStorage.setItem(CoreService.activeAccountKey, String(userId));\n } else {\n sessionStorage.removeItem(CoreService.activeAccountKey);\n }\n }\n\n /**\n * Persists the current login info to `localStorage`.\n * @returns void\n */\n storeContext(): void {\n localStorage.setItem('evolution_context', JSON.stringify(this._loginInfo));\n }\n\n /**\n * Merges a login result into the stored login info and persists it.\n * @param result - The login result returned by the login endpoint.\n * @returns void\n */\n updateContext(result: EvolutionLoginResult): void {\n if (!this._loginInfo) {\n this._loginInfo = { context: undefined };\n }\n this._loginInfo.context = result.context;\n this.storeContext();\n }\n\n /**\n * Resets the in-memory login state and broadcasts a logout-completed event.\n * Does NOT touch storage; call {@link clear} for a full cleanup.\n * @returns void\n */\n reset(): void {\n this._loginInfo = undefined;\n this._loggedIn.set(false);\n this.broadcastService.sendMessage(EvolutionMessages.LOGOUT_COMPLETED);\n }\n\n /**\n * Clears every trace of the session on this device -- the stored context, the account this tab\n * was working as and the leftovers of the token era -- and then calls {@link reset}. It asks the\n * API nothing: use `LoginService.logout` for that.\n *\n * It takes no argument any more. `clearOAuthToken` decided whether to drop\n * `evolution_oauth_token`, a provider access token this library no longer obtains, stores or\n * sends: the whole exchange happens on the backend.\n * @returns void\n */\n clear(): void {\n // The stored context goes with the session it describes. It used to be removed by `logout()`\n // alone, so every other way of losing a session -- an expiry, a rejected restore -- left it\n // behind for the next bootstrap to trust.\n localStorage.removeItem('evolution_context');\n\n // The account this tab was working as. Left behind, the next request would name an account no\n // longer in the cookie: harmless, because the API falls back to the active one, but it would\n // also survive a sign-in as somebody else until the next `completeLogin` overwrote it.\n sessionStorage.removeItem(CoreService.activeAccountKey);\n\n // Leftovers of the token era, when the session travelled in session storage instead of an\n // HttpOnly cookie, and of the per-tab cookie era. Nothing writes them any more; they are\n // removed so a browser upgrading from the previous version does not keep them for good.\n sessionStorage.removeItem('evolution_auth');\n sessionStorage.removeItem('evolution_refresh');\n sessionStorage.removeItem('evolution_oauth');\n sessionStorage.removeItem('evolution_auth_oauth');\n sessionStorage.removeItem('evolution_oauth_token');\n sessionStorage.removeItem('evolution_client_id');\n\n this.reset();\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { DestroyRef, Service, Signal, WritableSignal, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ApiResult, BroadcastMessageInfo, BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { EMPTY, Observable, of, throwError } from 'rxjs';\nimport { catchError, finalize, map } from 'rxjs/operators';\n\nimport { EvolutionLoginInfo, EvolutionLoginResult, EvolutionServiceFlags, EvolutionSessionStatus, EvolutionUserInfo } from '../definitions';\nimport { EvolutionMessages } from '../messages';\nimport { CoreService } from './core.service';\n\n/**\n * Authentication for the Evolution back end: password login, e-mailed code confirmation, account\n * switch, logout and session restore. All session state lives in the private {@link CoreService};\n * this service orchestrates the HTTP flows and re-publishes the parts of core that consumers need.\n *\n * Aligned with the Evolution API on 2026-08-25. Everything goes through `/session/*` and an\n * HttpOnly cookie now: there is no bearer token, no `remember` credential the API can replay, and\n * no provider token acquired by the caller -- the external-provider flow is a full-page redirect\n * handled server-side, and all that reaches this service is the `/session/me` call on the way back.\n *\n * ## What this service no longer offers, and why\n *\n * - **`autoLogin`.** It was `login(undefined, undefined, true)`: a credential-less sign-in that\n * worked only because the API could decrypt a stored password from an `evolution_remember`\n * cookie. `POST /session/login` takes a user and a password and nothing else.\n * - **`autoLogout`.** It wrapped {@link logout} in toasts and a callback, and ran the callback\n * from `complete` -- that is, before the request it was waiting for had said anything. A host\n * that wants a callback subscribes: `logout().subscribe(() => …)`.\n * - **re-login on `LOGIN_CHANGED`.** The handler used to answer that message with a silent\n * `autoLogin`, which is the same replay by another name. The message is still broadcast by hosts\n * that link and unlink Evolution, and it is theirs to act on; this library no longer signs\n * anybody in without being asked.\n * - **the OAuth `Authorization` header, and the per-tab `X-Client-Id`.** The first is server-side\n * now; the second was a random UUID that gave every tab a session cookie of its own. A tab says\n * which of the accounts in the one cookie it is working as with `X-Evo-Account`, written by\n * {@link CoreService.setActiveAccount}.\n *\n * This is a deliberately reduced subset of what the Evolution application itself does: passkeys and\n * the provider redirect are not here. A library whose job is to let another application talk to\n * Evolution signs in with a password; an application that offers the other ways in owns them.\n */\n@Service()\nexport class LoginService {\n\n private readonly httpClient = inject(HttpClient);\n private readonly broadcastService = inject(BroadcastService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly core = inject(CoreService);\n\n private broadcastInitialized = false;\n\n /**\n * The address the pending login was started with, kept so {@link confirmIdentity} can send it\n * along with the code.\n *\n * The API stores each verification code under the account it was issued to, so a code alone is\n * not redeemable -- which is what stops a guessed code from opening whatever login happens to be\n * pending.\n */\n private pendingLoginEmail?: string;\n\n // ── Re-published core state (CoreService stays private) ─────────────────────\n\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined { return this.core.serviceUri; }\n\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags { return this.core.flags; }\n\n /**\n * Gets the current login info.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined { return this.core.loginInfo; }\n\n /**\n * Gets the signed-in account with its licence context.\n * @returns The current {@link EvolutionUserInfo}, or undefined when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.core.user; }\n\n /** `true` when this browser has a session the API has accepted. */\n get loggedIn(): Signal<boolean> { return this.core.loggedIn; }\n\n /** `true` while an authentication is in flight. */\n get loggingIn(): WritableSignal<boolean> { return this.core.loggingIn; }\n\n // ── Re-published core operations ────────────────────────────────────────────\n\n /**\n * Persists the current login info to `localStorage` (delegates to core).\n * @returns void\n */\n storeContext(): void { this.core.storeContext(); }\n\n /**\n * Merges a login result into the stored login info (delegates to core).\n * @param result - The login result returned by the login endpoint.\n * @returns void\n */\n updateContext(result: EvolutionLoginResult): void { this.core.updateContext(result); }\n\n /**\n * Resets the in-memory login state and broadcasts logout-completed (delegates to core).\n * @returns void\n */\n reset(): void { this.core.reset(); }\n\n /**\n * Clears every trace of the session on this device without asking the API anything\n * (delegates to core). Use {@link logout} for a real sign-out.\n * @returns void\n */\n clear(): void { this.core.clear(); }\n\n // ── Lifecycle ───────────────────────────────────────────────────────────────\n\n /**\n * Initialises the service with the back-end URI and optional feature flags, and asks the API — the\n * only party that can read the HttpOnly cookie — whether this browser still holds a session.\n *\n * Must be called once during application bootstrap, before any other method. What it used to do\n * on a refresh was announce `LOGIN_COMPLETED` on the strength of a value in local storage; the\n * auth cookie is HttpOnly and may have expired while that value lived on, so the claim was never\n * verified and the consumer met the inevitable 401 as \"your session just expired\" rather than as\n * a bootstrap that never got off the ground.\n * @param serviceUri - Base URL of the Evolution service.\n * @param flags - Bitmask of `EvolutionServiceFlags` (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n flags: EvolutionServiceFlags = EvolutionServiceFlags.None\n ): void {\n this.core.setServiceUri(serviceUri);\n this.core.setFlags(flags);\n\n // Subscribe to broadcast messages (only once)\n if (!this.broadcastInitialized) {\n this.broadcastInitialized = true;\n this.broadcastService\n .getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((message: BroadcastMessageInfo) => {\n this.handleBroadcastMessage(message);\n });\n }\n\n // The probe runs UNCONDITIONALLY, where it used to run only when a stored context existed. The\n // stored context is just a hint -- \"this browser signed in at some point\" -- and the cookie can\n // outlive it: local storage cleared while the month-long cookie stayed put made this library\n // declare \"no link\" with a perfectly valid session in the browser. The API is the only one that\n // knows, and it is asked every time.\n this.core.loggingIn.set(true);\n this.restoreSession();\n }\n\n /**\n * Dispatches an incoming broadcast message to the appropriate handler.\n * @param message - The message received from the broadcast channel.\n * @returns void\n */\n private handleBroadcastMessage(message: BroadcastMessageInfo): void {\n if (message.id !== EvolutionMessages.LOGOUT) return;\n\n if (!this.core.loggedIn()) {\n // No session to close server-side, but the device must still be left clean.\n this.core.clear();\n return;\n }\n\n this.logout().subscribe(r => {\n if (!r.success) {\n if (r.message) {\n this.broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n { message: \"<p>\" + r.message + \"</p><br><br><hr><p class='small'><i>Per eliminare la configurazione di Evolution accedere a:<br><b>menu > personalizza > collegamenti</b></i></p>\" }\n );\n }\n } else if ((this.core.flags & EvolutionServiceFlags.DisplayConnectionStateMessages) > 0) {\n this.broadcastService.sendMessage(\n EvolutionMessages.SUCCESS_TOAST,\n { message: 'Disconnesso da Evolution', icon: 'power_off', duration: 1500 });\n }\n });\n }\n\n /**\n * Sends a one-shot ping to the back end to verify connectivity. Errors are swallowed.\n * @returns void\n */\n ping(): void {\n this.httpClient\n .get<ApiResult<number>>(\n this.core.serviceUri + '/ping?nocache=' + SystemUtils.generateUUID()\n )\n .pipe(catchError(() => EMPTY))\n .subscribe();\n }\n\n // ── Session ─────────────────────────────────────────────────────────────────\n\n /**\n * Authenticates the user with an e-mail address and a password, the only credentials\n * `POST /session/login` accepts.\n *\n * On success the session cookie is issued and the context stored, unless the API answers\n * `requiresMfa`: the device is not a trusted one, a six-digit code has been e-mailed and nothing\n * about the account is disclosed until {@link confirmIdentity} redeems it.\n *\n * A failure is no longer a `200 OK` carrying `success: false`. Wrong credentials come back as a\n * real 4xx with the message in the envelope, so the `next` branch of the caller is never reached.\n * @param email - The user's e-mail address.\n * @param password - The user's password.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n login(email?: string, password?: string): Observable<ApiResult<EvolutionLoginResult>> {\n // Kept for the confirmation step, which has to name the account the code was issued to.\n this.pendingLoginEmail = email;\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/login',\n { user: email ?? '', password: password ?? '' })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n if (r.value?.requiresMfa) {\n // Notify the login is pending an e-mailed code.\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_PENDING, {});\n } else {\n this.completeLogin(r.value);\n }\n }\n return r;\n })\n );\n }\n\n /**\n * Confirms a pending e-mailed code challenge, which establishes the session and marks this device\n * as trusted: the next sign-in from it will not ask for a code again.\n *\n * The address travels with the code, in the body. The API stores each code under the account it\n * was issued to, so naming the account is part of redeeming it; and a code in the body is a code\n * that stays out of the URL, where `POST /login/confirm/{code}` left it for the access logs and\n * the browser history to keep.\n * @param code - The one-time confirmation code provided to the user.\n * @param email - The address the code was sent to; defaults to the one the pending login started with.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n confirmIdentity(code: string, email?: string): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/confirm',\n { email: email ?? this.pendingLoginEmail, code: code })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n this.completeLogin(r.value);\n }\n return r;\n })\n );\n }\n\n /**\n * Asks the API whether this browser holds a live session, without ever failing with a 401: the\n * route is anonymous and answers `connected: false` to a caller with no session. This is the one\n * honest way to know the link state -- the auth cookie is HttpOnly and belongs to the API's host,\n * so it cannot be read from here, and its presence would prove nothing anyway, since the session\n * also lives server-side and may have been revoked or evicted.\n * @returns An observable that emits the `ApiResult<EvolutionSessionStatus>`.\n */\n status(): Observable<ApiResult<EvolutionSessionStatus>> {\n return this.httpClient\n .get<ApiResult<EvolutionSessionStatus>>(this.core.serviceUri + '/session/status');\n }\n\n /**\n * Reads the current session from the server, which resolves it from the auth cookie's claims.\n * Used to restore the state after a page refresh instead of trusting what local storage holds.\n *\n * The route answers with the same `EvolutionLoginResult` a login answers with, built by the same\n * `ResolveSignInContextAsync`, so a restored session and a fresh one are identical by\n * construction.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n me(): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .get<ApiResult<EvolutionLoginResult>>(this.core.serviceUri + '/session/me')\n .pipe(\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r?.success) {\n // No LOGIN_COMPLETED from here: {@link restoreSession} announces it, so a consumer\n // hears it once whether the session was opened or recovered.\n this.completeLogin(r.value, false);\n }\n return r;\n })\n );\n }\n\n /**\n * Asks `/session/status` whether this browser holds a live session, and hydrates the context\n * through {@link me} when it does.\n *\n * The probe is silent by construction: `/session/status` never answers 401, so a visitor who\n * never signed in -- or a cookie whose session has died -- comes back as `connected: false` with\n * no error broadcast and no dialog. Only then is the stale stored context cleared, so the\n * `loggedIn` signal tells the truth at every bootstrap.\n *\n * Nothing is cleared on a transport failure, and that is deliberate: an unreachable API is not\n * proof of a dead session -- the proxy may have answered 502, the device may be offline -- and\n * clearing on any of those would sign the user out with a perfectly valid cookie.\n * @returns void\n */\n private restoreSession(): void {\n // Whether the probe handed over to `/session/me`, which then owns lowering `loggingIn`.\n let restoring = false;\n this.status()\n .pipe(finalize(() => { if (!restoring) { this.core.loggingIn.set(false); } }))\n .subscribe({\n next: r => {\n if (r?.success && r.value?.connected) {\n restoring = true;\n this.me()\n .pipe(finalize(() => this.core.loggingIn.set(false)))\n .subscribe({\n next: m => {\n if (m?.success) {\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);\n }\n },\n // Consumed so the rethrown error is not reported a second time as an unhandled one.\n error: () => { }\n });\n } else if (this.core.loggedIn()) {\n // The stored context outlived its session: drop it, or the next bootstrap would keep\n // claiming a session that is gone.\n this.core.clear();\n }\n },\n // Transport failure: keep the stored hint, the next bootstrap will ask again.\n error: () => { }\n });\n }\n\n /**\n * Switches this tab to another account of the same person -- same address, same stored password\n * -- without re-entering credentials.\n *\n * The account being left stays open: a switch used to close its session, because each account had\n * a cookie of its own, and they now share one cookie holding several. What changes here is only\n * which account THIS tab names on its requests, which {@link completeLogin} records.\n * @param id - The user ID to switch to.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n loginSwitch(id: number): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/switch',\n { userId: id })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n this.completeLogin(r.value, false);\n }\n return r;\n })\n );\n }\n\n /**\n * Signs out: closes this browser's session on the API and clears the local state whatever the\n * answer, since there is nothing useful to do with a logout that failed.\n *\n * `forget` no longer means \"drop the stored credentials\" -- there are none to drop. It means\n * \"stop trusting this device\", that is clear the MFA cookie, so that the next sign-in from here\n * is challenged with an e-mailed code again. It also closes one session and not all of them: an\n * account may hold one per front end, and signing out of this browser must not sign the person\n * out of their phone.\n * @param forget - When `true`, the device stops being a trusted one. Defaults to `false`.\n * @returns An observable that emits `ApiResult<unknown>`.\n */\n logout(forget: boolean = false): Observable<ApiResult<unknown>> {\n return this.httpClient\n .post<ApiResult<unknown>>(this.core.serviceUri + '/session/logout?forget=' + forget, {})\n .pipe(\n finalize(() => this.core.clear()),\n // A logout that failed is still a logout as far as this device is concerned: the local\n // state has already been cleared by `finalize`, and there is nothing useful a caller could\n // do with the failure. `message` is empty rather than absent because `ApiResponse` declares\n // it as a string.\n catchError(() => of<ApiResult<unknown>>({ success: false, value: undefined, message: '' }))\n );\n }\n\n /**\n * Finalises a login, a code confirmation, an account switch or a session restore: stores the\n * context, raises the logged-in signal, records which account this tab is working as and\n * optionally announces `LOGIN_COMPLETED`.\n *\n * `loggedIn` is raised unconditionally. It used to be `!result.context?.isTemporary`, and\n * `isTemporary` was always false -- it is `[NotMapped]` on the API and never filled -- so the\n * condition never did anything. An expired password is reported by `requiresPasswordChange` and\n * does not mean there is no session: the cookie has been issued, and it is what the password\n * change itself travels on.\n *\n * `loggingIn` is deliberately left alone. Whoever raised it lowers it -- {@link restoreSession}\n * for a refresh, the host application for its own sign-in flow -- because lowering it here would\n * drop the host's splash the instant the response arrived, before anything was on screen.\n * @param result - The login result payload from the server.\n * @param notify - Whether to broadcast `LOGIN_COMPLETED`. Defaults to `true`.\n * @returns void\n */\n private completeLogin(result: EvolutionLoginResult, notify: boolean = true): void {\n this.core.updateContext(result);\n this.core.setLoggedIn(true);\n // Which account THIS TAB is working as. Per tab on purpose: two tabs may sit on two different\n // licences, and they share the one cookie that holds both.\n this.core.setActiveAccount(result?.context?.userId);\n if (notify) {\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);\n }\n }\n}\n","import { Service, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ApiResult, FolderTree } from '@arsedizioni/ars-utils/core';\nimport {\n EvolutionChangeContextModel, EvolutionChangeContextResultModel,\n EvolutionComplianceActivitiesAddParams, EvolutionComplianceActivity,\n EvolutionComplianceLaw, EvolutionComplianceLawsAddParams,\n EvolutionComplianceRegister, EvolutionComplianceRegisterProfile,\n EvolutionQueryRegisterProfilesModel\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * Compliance endpoints: taxonomy & groups, context, registers, laws and\n * activities (the `Context` / `Registers` / `Laws` / `Activities` sections,\n * plus the general taxonomy/groups lookups). Pure HTTP; injects the private\n * {@link CoreService} only to read the back-end URI.\n */\n@Service()\nexport class ComplianceService {\n private readonly httpClient = inject(HttpClient);\n private readonly core = inject(CoreService);\n\n // ── Taxonomy & groups ───────────────────────────────────────────────────────\n\n /**\n * Retrieves the taxonomy tree from the back end.\n * @returns An observable that emits `ApiResult<FolderTree>`.\n */\n getTaxonomy() {\n return this.httpClient.get<ApiResult<FolderTree>>(\n this.core.serviceUri + '/taxonomy'\n );\n }\n\n /**\n * Retrieves the compliance groups for a register.\n * @param group - Group index to retrieve (default: `1`).\n * @param register - Optional register ID to scope the query.\n * @returns An observable that emits `ApiResult<string[]>`.\n */\n getGroups(group: number = 1, register?: number) {\n const path = register\n ? `/compliance/groups/?group=${group}®ister=${register}`\n : `/compliance/groups/?group=${group}`;\n return this.httpClient.get<ApiResult<string[]>>(this.core.serviceUri + path);\n }\n\n // ── Context ──────────────────────────────────────────────────────────────────\n\n /**\n * Sends a context-change request to the back end.\n * @param params - The context model describing the desired switch.\n * @returns An observable that emits `ApiResult<EvolutionChangeContextResultModel>`.\n */\n changeContext(params: EvolutionChangeContextModel) {\n return this.httpClient.post<ApiResult<EvolutionChangeContextResultModel>>(\n this.core.serviceUri + '/compliance/context',\n params\n );\n }\n\n // ── Registers ────────────────────────────────────────────────────────────────\n\n /**\n * Retrieves a single compliance register by ID.\n * @param id - The register ID.\n * @returns An observable that emits `ApiResult<EvolutionComplianceRegister>`.\n */\n getRegister(id: number) {\n return this.httpClient.get<ApiResult<EvolutionComplianceRegister>>(\n this.core.serviceUri + '/compliance/registers/' + id\n );\n }\n\n /**\n * Collects register profiles matching the given query parameters.\n * @param params - Query parameters defining the filter criteria.\n * @returns An observable that emits `ApiResult<EvolutionComplianceRegisterProfile[]>`.\n */\n collectRegisterProfiles(params: EvolutionQueryRegisterProfilesModel) {\n return this.httpClient.post<ApiResult<EvolutionComplianceRegisterProfile[]>>(\n this.core.serviceUri + '/compliance/registers/profiles/collect',\n params\n );\n }\n\n // ── Laws ─────────────────────────────────────────────────────────────────────\n\n /**\n * Adds one or more compliance laws.\n * @param params - The laws to add.\n * @returns An observable that emits `ApiResult<EvolutionComplianceLaw[]>`.\n */\n addLaws(params: EvolutionComplianceLawsAddParams) {\n return this.httpClient.post<ApiResult<EvolutionComplianceLaw[]>>(\n this.core.serviceUri + '/compliance/laws/add',\n params\n );\n }\n\n /**\n * Exports compliance laws in the format expected by the server.\n * @param params - Export parameters (model shape is server-defined).\n * @returns An observable that emits the binary blob response.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exportLaws(params: any) {\n return this.httpClient.post(\n this.core.serviceUri + '/compliance/laws/export',\n params,\n { responseType: 'blob' }\n );\n }\n\n // ── Activities ─────────────────────────────────────────────────────────────────\n\n /**\n * Adds one or more compliance activities.\n * @param params - The activities to add.\n * @returns An observable that emits `ApiResult<EvolutionComplianceActivity>`.\n */\n addActivities(params: EvolutionComplianceActivitiesAddParams) {\n return this.httpClient.post<ApiResult<EvolutionComplianceActivity>>(\n this.core.serviceUri + '/compliance/activities/add',\n params\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Service, inject } from '@angular/core';\nimport { ApiResult } from '@arsedizioni/ars-utils/core';\nimport {\n EvolutionRecoverPasswordModel,\n EvolutionResetPasswordModel,\n EvolutionUpdateUserSettingsModel,\n EvolutionUserInfo,\n EvolutionUserLink\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * The `/account/*` endpoints: the links a user account carries, its settings, its password and the\n * licence behind it.\n *\n * Everything here acts on the account the session names, which is why none of these methods takes\n * one. The licence refresh is the exception in appearance only: the id in the route is ignored by\n * the API, which reads the account from the session -- it used to be taken at face value, with no\n * authorization at all, so any integer returned somebody else's company and expiry.\n */\n@Service()\nexport class AccountService {\n private readonly httpClient = inject(HttpClient);\n private readonly core = inject(CoreService);\n\n /**\n * Persists a user link on the server.\n * @param item - The user link to save.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n saveLink(item: EvolutionUserLink) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/links/save',\n item\n );\n }\n\n /**\n * Deletes a user link from the server.\n * @param item - The user link to delete.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n deleteLink(item: EvolutionUserLink) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/links/delete',\n item\n );\n }\n\n /**\n * Persists updated settings for the signed-in account (dashboard, flags).\n * @param params - The settings to save.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n updateSettings(params: EvolutionUpdateUserSettingsModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/settings/save',\n params\n );\n }\n\n /**\n * Changes a password: the signed-in account's own, with `oldPassword`, or somebody else's when an\n * administrator names it.\n * @param params - The password change to apply.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n resetPassword(params: EvolutionResetPasswordModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/password/reset',\n params\n );\n }\n\n /**\n * Starts a password recovery, which mails a reset link to the given address.\n * @param params - The address to recover, with the reCAPTCHA token that guards the route.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n recoverPassword(params: EvolutionRecoverPasswordModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/password/recover',\n params\n );\n }\n\n /**\n * Re-reads the licence of the signed-in account: company, expiry, quotas and allowed modules.\n *\n * Does NOT update the stored context: what the caller does with a fresh licence -- refresh a\n * settings page, recompute a quota, store it -- is the caller's business, and a service that\n * quietly rewrote the session context under it would be doing more than it was asked.\n * @returns An observable that emits `ApiResult<EvolutionUserInfo>`.\n */\n refreshLicence() {\n return this.httpClient.get<ApiResult<EvolutionUserInfo>>(\n this.core.serviceUri + '/account/licenses/refresh/' + (this.core.user?.userId ?? -1)\n );\n }\n}\n","import { Service, Signal, WritableSignal, inject } from '@angular/core';\nimport { EvolutionLoginInfo, EvolutionServiceFlags, EvolutionUserInfo } from '../definitions';\nimport { AccountService } from './account.service';\nimport { ComplianceService } from './compliance.service';\nimport { CoreService } from './core.service';\nimport { LoginService } from './login.service';\n\n/**\n * Public entry point for the Evolution compliance module.\n *\n * The private {@link CoreService} is never exposed; its state and operations\n * are re-published here. All endpoint operations are reached through the\n * namespaced sub-services:\n * - `evolution.session` — authentication / session lifecycle\n * - `evolution.compliance` — taxonomy, context, registers, laws, activities\n * - `evolution.account` — user links\n *\n * The facade itself exposes ONLY the re-published core state/operations plus\n * `initialize` and `ping` — it intentionally does NOT flatten the sub-service\n * methods (use the namespaces for those).\n */\n@Service()\nexport class EvolutionService {\n\n /** Private: never exposed to consumers. */\n private readonly core = inject(CoreService);\n\n /** Authentication / session lifecycle sub-service. */\n readonly session = inject(LoginService);\n /** Compliance endpoints: taxonomy, groups, context, registers, laws, activities. */\n readonly compliance = inject(ComplianceService);\n /** Account endpoints: user links management. */\n readonly account = inject(AccountService);\n\n // ── Re-published core state ─────────────────────────────────────────────────\n\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined { return this.core.serviceUri; }\n\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags { return this.core.flags; }\n\n /**\n * Gets the current login info.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined { return this.core.loginInfo; }\n\n /**\n * Gets the signed-in account with its licence context.\n * @returns The current {@link EvolutionUserInfo}, or undefined when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.core.user; }\n\n /**\n * `true` when this browser has a session the API has accepted. It starts from the stored context\n * and is settled -- raised or cleared -- by the silent `/session/status` probe {@link initialize}\n * makes, which is the one honest way to read a state that lives in an HttpOnly cookie plus a\n * server-side lease. This signal IS the link state: bind it, do not poll it.\n */\n get loggedIn(): Signal<boolean> { return this.core.loggedIn; }\n\n /** `true` while an authentication is in flight. */\n get loggingIn(): WritableSignal<boolean> { return this.core.loggingIn; }\n\n \n // ── Lifecycle (the only flattened sub-service methods) ──────────────────────\n\n /**\n * Initialises the service with the back-end URI and optional feature flags.\n * @param serviceUri - Base URL of the Evolution service.\n * @param flags - Bitmask of `EvolutionServiceFlags` (default: `None`).\n * @returns void\n */\n initialize(serviceUri: string, flags: EvolutionServiceFlags = EvolutionServiceFlags.None): void {\n this.session.initialize(serviceUri, flags);\n }\n\n /**\n * Sends a one-shot ping to the back end to verify connectivity.\n * @returns void\n */\n ping(): void { this.session.ping(); }\n}\n","// Public barrel for the Evolution services.\n//\n// CoreService is intentionally NOT exported: it is private/internal and must\n// never be injected directly. Consumers use EvolutionService (the full facade,\n// with both namespaced sub-services and the backward-compatible flat methods)\n// or, in size-sensitive code, the specific sub-service they need.\nexport * from './login.service';\nexport * from './compliance.service';\nexport * from './account.service';\nexport * from './evolution.service';\n","/*\n * Public API Surface of @arsedizioni/ars-utils/evolution.common\n */\nexport * from './messages';\nexport * from './definitions';\nexport * from './interceptors/index';\nexport * from './services/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["catchError"],"mappings":";;;;;;;;AAAO,MAAM,iBAAiB,GAAG;;AAE/B,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,aAAa,EAAE,oBAAoB;;AAGnC,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,eAAe,EAAE,sBAAsB;AACvC,IAAA,gBAAgB,EAAE,uBAAuB;AACzC,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,YAAY,EAAE,mBAAmB;AACjC,IAAA,MAAM,EAAE;;;AC6DV;;;;;;;AAOG;AACI,MAAM,4BAA4B,GAAG;IA+IhC;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,qBAAA,CAAA,MAAA,CA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AAW,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;8GAlEzB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,OAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B;;;ACrBD;AACA;AACA;AACA;AACA;AACA;;ACLA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-evolution.common.mjs","sources":["../../../projects/ars-utils/evolution.common/messages.ts","../../../projects/ars-utils/evolution.common/definitions.ts","../../../projects/ars-utils/evolution.common/interceptors/auth.interceptor.ts","../../../projects/ars-utils/evolution.common/services/core.service.ts","../../../projects/ars-utils/evolution.common/services/login.service.ts","../../../projects/ars-utils/evolution.common/services/compliance.service.ts","../../../projects/ars-utils/evolution.common/services/account.service.ts","../../../projects/ars-utils/evolution.common/services/evolution.service.ts","../../../projects/ars-utils/evolution.common/services/index.ts","../../../projects/ars-utils/evolution.common/public_api.ts","../../../projects/ars-utils/evolution.common/arsedizioni-ars-utils-evolution.common.ts"],"sourcesContent":["export const EvolutionMessages = {\n // Error\n ERROR: '§evo-error',\n\n /**\n * The API is not answering: the interceptor has already sent the request three times over ten\n * seconds and none of them got an answer carrying an `ApiResult` envelope. Emitted once per\n * outage, however many requests were in flight, and re-armed on the first good response.\n *\n * Deliberately not an `ERROR`: a server being replaced is neither a failed operation to report\n * in a dialog nor an expired session to sign out of, and the host application usually answers it\n * with a banner that clears itself.\n */\n ERROR_UNAVAILABLE: '§evo-error-unavailable',\n SUCCESS: '§evo-success',\n SUCCESS_TOAST: '§evo-success-toast',\n\n // Login\n LOGIN_CHANGED: '§evo-login-changed',\n LOGIN_COMPLETED: '§evo-login-completed',\n LOGOUT_COMPLETED: '§evo-logout-completed',\n LOGIN_PENDING: '§evo-login-pending',\n LOGIN_FAILED: '§evo-login-failed',\n LOGOUT: '§evo-logout'\n};\n","import { QueryModel, SendToModel } from '@arsedizioni/ars-utils/core';\n\n\n/**\n * Outcome of a login, an MFA confirmation, an account switch or a session restore.\n *\n * Aligned with the Evolution `/session/*` API on 2026-08-25, and mirrors\n * `EVO.API.Models.Requests.LoginResultModel`. It is a plain payload and no longer an envelope of\n * its own: `EvolutionLoginResult extends LoginResult<EvolutionUserInfo>` inherited `success` and\n * `message` from `ApiResult<boolean>`, so every answer carried two outcomes -- the transport's and\n * its own -- and the caller had to know which of the two to read. The API wraps this in\n * `ApiResult<T>` like every other payload, and that wrapper is the only outcome there is.\n *\n * `context` is absent while a login is pending an e-mailed code: nothing about the account is\n * disclosed before the code has been redeemed. `GET /session/me` answers with this same shape,\n * built by the same `ResolveSignInContextAsync`, so restoring a session and opening one give an\n * identical context by construction.\n */\nexport interface EvolutionLoginResult {\n /** The authenticated user with the licence context, or `undefined` while an MFA code is pending. */\n context?: EvolutionUserInfo;\n /** Whether a verification code has been e-mailed and must be confirmed through `/session/confirm`. */\n requiresMfa?: boolean;\n /**\n * Whether the stored password has expired and must be changed before the application is usable.\n *\n * It replaces `context.isTemporary`, which was read for the same purpose and was always false:\n * `UserInfo.IsTemporary` is `[NotMapped]` on the API, is never emitted as a claim and was never\n * filled.\n */\n requiresPasswordChange?: boolean;\n}\n\n/**\n * Answer of `GET /session/status`: whether this browser holds a live session towards the Evolution\n * API.\n *\n * This is the probe behind the link state. The auth cookie is HttpOnly and belongs to the API's\n * host, so nothing here can read it, and its presence would prove nothing anyway — the session also\n * lives server-side and may have been revoked or evicted. The endpoint never answers 401, which is\n * what makes it safe to call with no session at all: a probe that failed with a status code would be\n * reported by the interceptor as an expired session.\n */\nexport interface EvolutionSessionStatus {\n /** True when the cookie this browser presented resolves to a live, validated session. */\n connected: boolean;\n}\n\n/**\n * The session as this library holds it, persisted so a page refresh has something to validate.\n *\n * Two fields went with the new contract, and both were about replaying a login nobody asked for\n * again:\n *\n * - `remember`, the flag behind \"Ricordami\", which made the API issue an `evolution_remember`\n * cookie it could later decrypt the stored password from. `POST /session/login` has no such\n * field, the cookie is not written and nothing is replayed: a sign-in always starts from what the\n * user just typed. This is why `LoginService.autoLogin` no longer exists -- it was\n * a credential-less `login()` that relied on exactly that replay.\n * - `oauth`, the provider the session was opened with, kept so the client could re-post the\n * provider's access token on the next login. The exchange is entirely server-side now, no token\n * ever reaches the browser, and once the session cookie exists a provider login is\n * indistinguishable from a password one.\n *\n * The stored context is a hint, never evidence: the auth cookie is HttpOnly and may have expired\n * while this outlived it, so `LoginService.initialize` validates it against `/session/me` before\n * anyone is told there is a session.\n */\nexport interface EvolutionLoginInfo {\n /** The licence context of the signed-in user, as returned by the last login, switch or restore. */\n context?: EvolutionUserInfo;\n}\n\n/**\n * The `sessionStorage` key naming which account a tab is working as; its value travels on every\n * request as `X-Evo-Account`.\n *\n * It lives here, and not on `CoreService`, so the auth interceptor can read it without importing a\n * service: the interceptor is a factory precisely so that registering it does not pull the Evolution\n * service graph into the eager bundle.\n */\nexport const EVOLUTION_ACTIVE_ACCOUNT_KEY = 'evolution_account';\n\nexport interface EvolutionUserLink {\n id?: number ;\n userId: number;\n userName?: string ;\n key: string;\n}\n\n/**\n * The settings an account may change about itself: the dashboard it opens on and its flags.\n * Mirrors `UpdateUserSettingsModel`; the account is resolved from the session, and the `userId`\n * is only there for an administrator acting on somebody else.\n */\nexport interface EvolutionUpdateUserSettingsModel {\n userId?: number;\n dashboard?: string;\n flags?: number;\n}\n\n/**\n * A password change, serving both flows the API supports: the self-service one, which sends\n * `oldPassword` together with the new one, and the administrator-initiated one, which names the\n * account instead.\n */\nexport interface EvolutionResetPasswordModel {\n userId?: number;\n userEmail?: string;\n password?: string;\n oldPassword?: string;\n recaptchaToken?: string;\n}\n\n/** A password-recovery request: the address to mail the link to, plus the reCAPTCHA that guards it. */\nexport interface EvolutionRecoverPasswordModel {\n email?: string;\n recaptchaToken?: string;\n}\n\nexport interface EvolutionUserModuleInfo {\n name: string;\n module: number;\n level: number;\n hidden: boolean;\n}\n\n\nexport interface EvolutionLicenceModuleInfo {\n module: ERPModule;\n name: string;\n availableUsers: number;\n usedUsers: number;\n availableOption1?: number ;\n usedOption1?: number ;\n availableOption2?: number ;\n usedOption2?: number ;\n availableOption3?: number ;\n usedOption3?: number ;\n}\n\n/**\n * The signed-in account together with its licence context, as `ResolveSignInContextAsync` builds it\n * on the API and as every login, switch and restore returns it.\n *\n * What this interface does NOT declare is what the Evolution application computes for itself after\n * a login -- `hasFormazione`, `hasRS`, `expiry`, `expiryInfo` and the rest of the derived\n * module-accessibility flags. They are not sent by the API and this library does not invent model\n * fields the wire never carries: a host that wants them derives them from {@link allowedModules},\n * as the Evolution client does. The licence customization (logo, templates, colours) is left out\n * for the same reason plus one more: it is a model of its own, and nothing here consumes it.\n */\nexport interface EvolutionUserInfo {\n licenceId: number;\n userId: number;\n /** The place (subject / site / department) the account is scoped to, when it is scoped at all. */\n placeId?: number;\n companyName: string;\n /** Relative path of the licence logo, when the licence carries a customization. */\n companyLogo?: string;\n firstName: string;\n fullName: string;\n flags?: number ;\n email: string;\n sessionId?: string ;\n /**\n * @deprecated Always false. `UserInfo.IsTemporary` is `[NotMapped]` on the API, is never\n * emitted as a claim and is never filled; an expired password is reported by\n * {@link EvolutionLoginResult.requiresPasswordChange}. Kept only so a consumer still reading it\n * keeps compiling.\n */\n isTemporary?: boolean ;\n role: number;\n scope: number;\n roleName: string;\n roleLevel: number;\n allowedModules: EvolutionUserModuleInfo[];\n dashboard?: number ;\n dashboard2?: string ;\n code?: string ;\n subjectId?: number ;\n subjectName?: string ;\n siteId?: number ;\n siteName?: string ;\n siteCostCenter?: string ;\n departmentId?: number ;\n departmentName?: string ;\n /**\n * When the licence expires. A `Date` and not a `string`: the API sends an ISO timestamp and the\n * HTTP date interceptor is what turns it into a date, exactly as it does for every other model.\n */\n expiryDate?: Date ;\n isExpired?: boolean ;\n isAdministrator?: boolean ;\n isPowerUser?: boolean ;\n isObserver?: boolean ;\n isUser?: boolean ;\n isSupportUser?: boolean ;\n isGod?: boolean ;\n /** Whether the licence has the AI assistant available at all. */\n isMcpAvailable?: boolean ;\n /** Whether this account may use it. */\n isMcpEnabled?: boolean ;\n /** Whether the licence also has the orchestrator; its connection details stay on the host. */\n isMcpOrchestratorAvailable?: boolean ;\n /** The operator this account is bound to, for the applications that work by operator. */\n operatorId?: number ;\n /** Whether the licence carries a customization (logo, mail templates, colours). */\n hasCustomization?: boolean ;\n administrators?: string;\n availableModules: EvolutionLicenceModuleInfo[];\n availableUsers: number;\n usedUsers: number;\n availableEmployees: number;\n usedEmployees: number;\n availableStorage: number;\n usedStorage: number;\n availableOption1?: number ;\n availableOption2?: number ;\n availableOption3?: number ;\n}\n\n\n\nexport enum EvolutionServiceFlags {\n None = 0,\n NotifySystemErrors = 1,\n DisplayConnectionStateMessages = 1 << 1,\n Embedded = 1 << 2\n\n}\n\nexport enum ERPModule {\n Formazione = 1,\n DPI = 1 << 1,\n SorveglianzaSanitaria = 1 << 2,\n RegistroEScadenzario = 1 << 3,\n AttrezzatureEImpianti = 1 << 4,\n Monitoraggio = 1 << 5,\n Bollettino = 1 << 6,\n Documenti = 1 << 7\n\n}\n\nexport interface EvolutionPlaceable {\n licenceId?: number ;\n companyName?: string ;\n subjectId?: number ;\n subjectName?: string ;\n siteId?: number ;\n siteName?: string ;\n departmentId?: number ;\n departmentName?: string ;\n placeId?: number ;\n}\n\nexport enum ERPExportType\n{\n Basic = 1,\n Detailed = 8,\n Complete = 9,\n Labels = 10,\n EmployeesCoursesMatrix = 21,\n EmployeesCoursesHoursMatrix = 22,\n EmployeesPPEsMatrix = 23,\n EmployeesHealthChecksMatrix = 24,\n TasksCoursesMatrix = 31,\n Training = 101,\n TrainingExpired = 102,\n TrainingExpiring = 103,\n TrainingAbsents = 104,\n TrainingClosed = 105,\n TrainingCurrentYear = 108,\n TrainingNextYear = 109,\n TrainingAnnualPlannng = 110,\n EquipmentsActivitiesCompleted = 201,\n EquipmentsChecksMatrix = 202,\n RSNormsUsage = 301,\n RSNormsSitesMatrix = 302,\n RSNormsSummary = 303,\n MonitoringLaws = 401,\n MonitoringActivities = 402,\n MonitoringSummary = 403,\n PPEs = 501,\n ComplianceStatistics = 601,\n HealthChecks = 701,\n}\n\nexport enum ERPExportFormat\n{\n Csv = 1,\n Word = 2,\n Pdf = 3\n}\n\nexport enum ERPExportSource\n{\n All = 1,\n Query = 2,\n Selection = 3\n}\n\nexport enum ERPExportPart\n{\n IncludeRisks = 101,\n IncludeTasks = 102,\n IncludeTaskHistory = 103,\n IncludeTrainingRequired = 111,\n IncludeTrainingDone = 112,\n SelectedEmployeeCourses = 121,\n IncludeDisabledEmployees = 131,\n IncludeDismissedEmployees = 132,\n IncludeDocumentUpdates = 201,\n ExcludeNonApplicableOrAcknowledged = 202,\n ExcluteAbblicabilityTable = 203,\n IncludeActivities = 204,\n GroupLaws = 205,\n IncludeApplicableOrAcknowledgedOnly = 4301,\n IncludePPEs = 501,\n IncludeHealthChecks = 601\n}\n\nexport interface EvolutionExportModel<T> extends SendToModel {\n searchParams: T;\n selection?: number[] ;\n type: ERPExportType;\n sort?: number ;\n source: ERPExportSource;\n format: ERPExportFormat;\n parts?: ERPExportPart[] ;\n automateReport?: boolean ;\n automatedReportId?: number ;\n automatedReportSheetName?: string;\n formatExtension?: string ; \n}\n\nexport enum ERPComplianceLawsSelectionType {\n Analysis = 1,\n Activity = 2,\n}\n\nexport enum ERPComplianceProfileRole {\n None = 0,\n Analyst = 1,\n Planner = 1 << 1,\n Validator = 1 << 2,\n Executor = 1 << 3,\n Observer = 1 << 4,\n}\n\nexport enum ERPComplianceProfileFlags {\n\n OverrideNotificationRegisterSettings = 1 << 4,\n}\n\nexport enum ERPComplianceScope {\n None = 0,\n Environment = 1,\n Safety = 1 << 1,\n FoodSafety = 1 << 2,\n Energy = 1 << 3,\n Health = 1 << 4,\n Maintenance = 1 << 5,\n Quality = 1 << 6,\n Organization = 1 << 7,\n Logistics = 1 << 8,\n Facility = 1 << 9,\n Security = 1 << 10,\n GenderEquality = 1 << 11,\n AntiCorruption = 1 << 12,\n Sustainability = 1 << 13,\n InformationSecurity = 1 << 14\n}\n\nexport enum ERPComplianceNotificationLimit {\n None = 0,\n PlannerOnly = 1,\n ExecutorOnly = 2,\n Both = 3,\n}\n\nexport enum ERPComplianceRegisterNotificationType {\n None = 0,\n NewAnalysis = 1,\n AnalysisCompleted = 1 << 1,\n AnalysisNoticePeriodStarted = 1 << 2,\n AnalysisPeriodExpired = 1 << 3,\n AnalysisLawChanged = 1 << 14,\n NewPlanning = 1 << 13,\n PlanningCompleted = 1 << 4,\n PlanningNoticePeriodStarted = 1 << 5,\n PlanningPeriodExpired = 1 << 6,\n NewValidation = 1 << 15,\n ValidationCompleted = 1 << 7,\n ValidationNoticePeriodStarted = 1 << 8,\n ValidationPeriodExpired = 1 << 9,\n NewDeadline = 1 << 16,\n DeadlineNoticePeriodStarted = 1 << 10,\n DeadlineExpired = 1 << 11,\n ActivityCompleted = 1 << 12,\n //NewNoncompliance = 1 << 17,\n //NonComplianceNoticePeriodStarted = 1 << 18,\n //NonCompliancePeriodExpired = 1 << 19,\n //NonComplianceCompleted = 1 << 20,\n LawChanged = 1 << 21,\n}\n\nexport enum ERPComplianceRegisterSiteImportOptions {\n CopyAttachments = 1,\n KeepOriginalDates = 1 << 1,\n DuplicateLaws = 1 << 2,\n DiscardNotApplicables = 1 << 3\n}\n\nexport const EvolutionComplianceProfileRoles = [\n { name: 'Analista', value: ERPComplianceProfileRole.Analyst },\n { name: 'Gestore', value: ERPComplianceProfileRole.Planner },\n //{ name: 'Validatore', value: ERPComplianceProfileRole.Validator },\n { name: 'Esecutore', value: ERPComplianceProfileRole.Executor },\n { name: 'Osservatore', value: ERPComplianceProfileRole.Observer },\n];\n\nexport const EvolutionComplianceProfileFlags = [\n { name: 'Deroghe e limitazioni', divider: true },\n {\n name:\n 'Questo profilo riceve regolarmente le notifiche indipendentemente dalla configurazione generale del registro',\n value: ERPComplianceProfileFlags.OverrideNotificationRegisterSettings,\n },\n];\n\nexport const EvolutionComplianceScopes = [\n { name: 'Ambiente', value: ERPComplianceScope.Environment },\n { name: 'Salute e sicurezza', value: ERPComplianceScope.Safety },\n {\n name: 'Sicurezza alimentare',\n value: ERPComplianceScope.FoodSafety,\n },\n { name: 'Energia', value: ERPComplianceScope.Energy },\n { name: 'Servizi generali', value: ERPComplianceScope.Facility },\n { name: 'Manutenzione', value: ERPComplianceScope.Maintenance },\n { name: 'Qualità', value: ERPComplianceScope.Quality },\n { name: 'Organizzazione', value: ERPComplianceScope.Organization },\n { name: 'Logistica', value: ERPComplianceScope.Logistics },\n { name: 'Security', value: ERPComplianceScope.Security },\n { name: \"Anticorruzione\", value: ERPComplianceScope.AntiCorruption },\n { name: \"Sostenibilità\", value: ERPComplianceScope.Sustainability },\n { name: \"Parità di genere\", value: ERPComplianceScope.GenderEquality },\n { name: \"Sicurezza dell'informazione\", value: ERPComplianceScope.InformationSecurity },\n\n];\n\nexport const EvolutionComplianceNotificationLimits = [\n { name: 'Nessuna limitazione', value: ERPComplianceNotificationLimit.None },\n {\n name: 'Solo gestore che ha pianificato',\n value: ERPComplianceNotificationLimit.PlannerOnly,\n },\n {\n name: \"Solo all'incaricato designato\",\n value: ERPComplianceNotificationLimit.ExecutorOnly,\n },\n {\n name: 'Solo a gestore e incaricato designato',\n value: ERPComplianceNotificationLimit.Both,\n },\n];\n\nexport const EvolutionComplianceNotifications = [\n { name: 'Verifica applicabilità e analisi', divider: true },\n {\n name: 'Richiesta analisi',\n value: ERPComplianceRegisterNotificationType.NewAnalysis,\n },\n {\n name: \"Preavviso: sta per scadere il termine fissato per l'analisi\",\n value: ERPComplianceRegisterNotificationType.AnalysisNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'analisi\",\n value: ERPComplianceRegisterNotificationType.AnalysisPeriodExpired,\n },\n {\n name: 'Analisi completata',\n value: ERPComplianceRegisterNotificationType.AnalysisCompleted,\n },\n {\n name: 'Avviso norma modificata dal legislatore',\n value: ERPComplianceRegisterNotificationType.AnalysisLawChanged,\n },\n { name: 'Pianificazioni', divider: true },\n {\n name: 'Richiesta gestione',\n value: ERPComplianceRegisterNotificationType.NewPlanning,\n },\n {\n name: 'Preavviso: sta per scadere il termine fissato per la gestione',\n value: ERPComplianceRegisterNotificationType.PlanningNoticePeriodStarted,\n },\n {\n name: 'Allarme: è scaduto il termine fissato per la gestione',\n value: ERPComplianceRegisterNotificationType.PlanningPeriodExpired,\n },\n {\n name: 'Gestione completata',\n value: ERPComplianceRegisterNotificationType.PlanningCompleted,\n },\n {\n name: 'Attività completata',\n value: ERPComplianceRegisterNotificationType.ActivityCompleted,\n },\n /*{ name: 'Gestione non conformità', divider: true },\n {\n name: 'Apertura non comformità',\n value: ERPComplianceRegisterNotificationType.NewNoncompliance,\n },\n {\n name:\n \"Preavviso: sta per scadere il termine fissato per l'azione correttiva\",\n value:\n ERPComplianceRegisterNotificationType.NonComplianceNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'azione correttiva\",\n value: ERPComplianceRegisterNotificationType.NonCompliancePeriodExpired,\n },\n {\n name: 'Chiusura non conformità',\n value: ERPComplianceRegisterNotificationType.NonComplianceCompleted,\n },*/\n /*{ name: 'Approvazioni', divider: true },\n { name: 'Richiesta approvazione', value: 1 << 14 },\n {\n name: \"Preavviso: sta per scadere il termine fissato per l'approvazione\",\n value: ERPComplianceRegisterNotificationType.ValidationNoticePeriodStarted,\n },\n {\n name: \"Allarme: è scaduto il termine fissato per l'approvazione\",\n value: ERPComplianceRegisterNotificationType.ValidationPeriodExpired,\n },\n {\n name: 'Approvazione concessa o negata',\n value: ERPComplianceRegisterNotificationType.ValidationCompleted,\n },*/\n { name: 'Scadenze', divider: true },\n {\n name: 'Preavviso: 1° promemoria sulla data di scadenza',\n value: ERPComplianceRegisterNotificationType.NewValidation,\n },\n {\n name: 'Avviso: 2° promemoria sulla data di scadenza',\n value: ERPComplianceRegisterNotificationType.DeadlineNoticePeriodStarted,\n },\n {\n name: 'Allarme: è scaduto il termine',\n value: ERPComplianceRegisterNotificationType.DeadlineExpired,\n },\n { name: 'Norme collegate', divider: true },\n {\n name: 'Modifica o abrogazione',\n value: ERPComplianceRegisterNotificationType.LawChanged,\n },\n\n];\n\nexport enum ERPComplianceLawState {\n ApplicableOrAknowledged = 1,\n NotApplicable = 2,\n NotAnalyzed = 3,\n ExpiredAnalysis = 4,\n UpdatedLaws = 5,\n Analyzed = 6,\n Abrogated = 7,\n Applicable = 8,\n Aknowledged = 9\n}\n\nexport enum ERPComplianceLawOrigin {\n National = 1,\n EU = 2,\n Regional = 3,\n Local = 4,\n Technical = 5,\n Voulontary = 6,\n Internal = 7,\n Other = 8,\n}\n\nexport const EvolutionComplianceLawStates = [\n { name: 'Applicabile', value: ERPComplianceLawState.Applicable },\n { name: 'Da conoscere', value: ERPComplianceLawState.Aknowledged },\n {\n name: 'Applicabile / da conoscere',\n value: ERPComplianceLawState.ApplicableOrAknowledged,\n },\n { name: 'Non applicabile', value: ERPComplianceLawState.NotApplicable },\n { name: 'Abrogata', value: ERPComplianceLawState.Abrogated },\n { name: 'Analizzata', value: ERPComplianceLawState.Analyzed },\n { name: 'Da definire', value: ERPComplianceLawState.NotAnalyzed },\n { name: 'In ritardo', value: ERPComplianceLawState.ExpiredAnalysis },\n {\n name: 'Con aggiornamenti pendenti',\n value: ERPComplianceLawState.UpdatedLaws,\n },\n];\n\nexport const EvolutionComplianceLawOrigins = [\n { name: 'Nazionale', value: ERPComplianceLawOrigin.National },\n { name: 'Comunitaria', value: ERPComplianceLawOrigin.EU },\n { name: 'Regionale', value: ERPComplianceLawOrigin.Regional },\n { name: 'Locale', value: ERPComplianceLawOrigin.Local },\n { name: 'Tecnica', value: ERPComplianceLawOrigin.Technical },\n { name: 'Interna', value: ERPComplianceLawOrigin.Internal },\n { name: 'Volontaria', value: ERPComplianceLawOrigin.Voulontary },\n { name: 'Altro', value: ERPComplianceLawOrigin.Other },\n];\n\nexport const EvolutionComplianceLawChangeStates = [\n { name: 'Aperto', value: 1 },\n { name: 'Chiuso', value: 2 },\n];\n\nexport enum ERPComplianceActivityState {\n NotPlanned = 1 << 7,\n Closed = 1 << 2,\n Expired = 1 << 3,\n Planned = 1 << 8,\n Cancelled = 1 << 9,\n UpdatedLaws = 1 << 10,\n AlreadyManaged = 1 << 11\n}\n\nexport const EvolutionComplianceActivityStates = [\n {\n name: 'Da definire',\n value: ERPComplianceActivityState.NotPlanned,\n },\n {\n name: 'Pianificata',\n value: ERPComplianceActivityState.Planned,\n },\n {\n name: 'Chiusa',\n value: ERPComplianceActivityState.Closed,\n },\n {\n name: 'In ritardo',\n value: ERPComplianceActivityState.Expired,\n },\n {\n name: 'Annullata',\n value: ERPComplianceActivityState.Cancelled,\n },\n {\n name: 'Gestita separatamente',\n value: ERPComplianceActivityState.AlreadyManaged,\n },\n {\n name: 'Con aggiornamenti pendenti',\n value: ERPComplianceActivityState.UpdatedLaws,\n },\n];\n\nexport const EvolutionComplianceObligationTypes = [\n { name: 'Autorizzazione', value: 1 },\n { name: 'Verifiche periodiche manutentive', value: 2 },\n { name: 'Misure organizzative', value: 3 },\n { name: 'Controlli e misurazioni', value: 4 },\n { name: 'Entrata in vigore', value: 5 },\n { name: 'Documenti aziendali obbligatori', value: 6 },\n {\n name: 'Altri adempimenti formali (comunicazioni, dichiarazioni, ecc...)',\n value: 7,\n },\n { name: 'Altro', value: 99 },\n];\n\nexport const EvolutionComplianceObligationAuthorities = [\n { name: 'Agenzia ECHA', value: 1 },\n { name: 'Albo Nazionale dei Gestori Ambientali', value: 2 },\n { name: 'ARPA', value: 4 },\n { name: 'ASL', value: 5 },\n { name: 'Camera di Commercio', value: 8 },\n { name: 'Comando provinciale dei Vigili del Fuoco', value: 10 },\n { name: 'Comune', value: 13 },\n { name: 'Consorzi gestione rifiuti particolari', value: 14 },\n { name: 'Gestore del servizio', value: 21 },\n { name: 'Gestore della rete di trasmissione nazionale', value: 22 },\n { name: 'INAIL - IPSEMA - ISPESL', value: 23 },\n { name: 'ISPRA', value: 26 },\n { name: 'Ministero', value: 27 },\n { name: 'Genio civile', value: 30 },\n { name: 'Organo di vigilanza competente', value: 31 },\n { name: 'Provincia', value: 33 },\n { name: 'Regione', value: 35 },\n { name: 'Uffici tecnici di finanza', value: 36 },\n { name: 'Ispettorato del lavoro', value: 37 },\n { name: 'Comitato Regionale Tecnico VF', value: 38 },\n { name: 'Prefetto', value: 39 },\n { name: 'Organismo notificato', value: 40 },\n { name: 'Città Metropolitana', value: 41 },\n { name: 'Nessuna', value: 28 },\n { name: 'Altro', value: 3 }\n];\n\nexport enum ERPRecurrenceFrequencyType {\n Day = 1,\n Month = 2,\n Year = 3,\n}\nexport const EvolutionRecurrenceFrequencyTypes = [\n { name: 'Anni', value: ERPRecurrenceFrequencyType.Year },\n { name: 'Mesi', value: ERPRecurrenceFrequencyType.Month },\n { name: 'Giorni', value: ERPRecurrenceFrequencyType.Day },\n];\n\nexport enum ERPPlacePermission {\n None = 0,\n Denied = 1,\n Read = 2,\n Write = 3\n}\n\nexport enum ERPPlace {\n Subject = 1,\n Site = 2,\n Department = 3,\n Area = 4,\n Line = 5\n}\nexport interface EvolutionPermission {\n placeId: number;\n userId: number;\n allowRead: number;\n allowWrite: number;\n allowNone: number;\n}\n\nexport interface EvolutionPlacePermission extends EvolutionPermission {\n id: number;\n subjectId?: number;\n siteId?: number;\n departmentId?: number;\n mode: number;\n}\n\nexport interface EvolutionContextInfo {\n id: number;\n userId?: number;\n name: string;\n permission: EvolutionPermission;\n placePermission: ERPPlacePermission;\n costCenter: string;\n selected?: boolean;\n level?: number;\n levelTitle?: string;\n}\n\nexport class EvolutionComplianceContextInfo {\n licenceId?: number;\n companyName?: string;\n registerTitle?: string;\n registerId?: number;\n siteName?: string;\n siteId?: number;\n userId?: number;\n items?: EvolutionContextInfo[];\n}\n\nexport interface EvolutionChangeContextModel {\n userId?: number ;\n licenceId?: number ;\n subjectId?: number ;\n siteId?: number ;\n registerId?: number ;\n role?: ERPComplianceProfileRole ;\n permission?: ERPPlacePermission ;\n option1Value?: number ;\n option2Value?: number ;\n option3Value?: number ;\n allowObservers?: boolean ;\n allowDisabled?: boolean ;\n}\n\nexport interface EvolutionChangeContextResultModel {\n items: EvolutionContextInfo[];\n}\n\nexport interface EvolutionComplianceRegister extends EvolutionPlaceable {\n id: number;\n title?: string;\n enableNotifications?: boolean;\n enableNotification1?: boolean;\n enableNotification2?: boolean;\n enableNotification3?: boolean;\n enableNotification4?: boolean;\n enableNotification5?: boolean;\n enableNotification7?: boolean;\n enableNotification8?: boolean;\n enableNotification9?: boolean;\n notification1NoticeDays?: number;\n notification2NoticeDays?: number;\n notification2Limit?: number;\n notification3NoticeDays?: number;\n notification4NoticeDays?: number;\n notification4Limit?: number;\n notification5NoticeDays?: number;\n notification5Limit?: number;\n notification6Limit?: number;\n notification8NoticeDays?: number;\n notification8Limit?: number;\n enableActivityLawsPopulation?: boolean;\n enableLawChangesTracking?: boolean;\n automationMode?: number;\n automationScope?: number;\n disabled?: boolean;\n created?: Date;\n lastUpdated?: Date;\n lastUpdatedBy?: string;\n totalSites?: number;\n totalProfiles?: number;\n sites?: EvolutionComplianceRegisterSite[];\n oldId?: string;\n isAutomationEnabled?: boolean;\n automationModeDescription?: string;\n automationScopeDescription?: string;\n context?: EvolutionComplianceContextInfo;\n isMenuOpen?: boolean;\n isOver?: boolean;\n}\n\nexport interface EvolutionRegisterProfileSiteInfo extends EvolutionContextInfo {\n\n}\n\nexport interface EvolutionRegisterProfileUserInfo {\n userId: number;\n name: string;\n sites: EvolutionRegisterProfileSiteInfo[];\n}\n\nexport interface ComplianceRegisterUsersResultModel {\n users: EvolutionRegisterProfileUserInfo[];\n sites: EvolutionRegisterProfileSiteInfo[];\n}\n\nexport interface EvolutionComplianceRegisterSite {\n id: number;\n complianceRegisterId?: number;\n complianceSiteId?: number;\n disabled?: boolean;\n created?: Date;\n licenceId?: number;\n subjectId?: number;\n subjectName: string;\n siteId?: number;\n siteName?: string;\n departmentId?: number;\n departmentName?: string;\n registerTitle?: string;\n placeId?: number;\n oldSiteId?: string;\n}\n\nexport interface EvolutionComplianceLaw extends EvolutionPlaceable {\n id?: number;\n state?: number;\n complianceRegisterId?: number;\n lot?: number;\n topicId?: string;\n topicPath?: string;\n topicName?: string;\n summary?: string;\n scope?: number;\n source?: string;\n references?: EvolutionComplianceLawReference[];\n originalLawId?: number ;\n originRegion?: string ;\n origin?: number ;\n originAlternativeDescription?: string ;\n description?: string ;\n documentShortTitle?: string ;\n documentTitle?: string ;\n documentNumber?: string ;\n documentDate?: Date ;\n documentLastUpdate?: string ;\n documentLastUpdateShortTitle?: string ;\n documentUpdateNotes?: string ;\n documentValidated?: boolean ;\n documentId?: string ;\n documentModel?: number ;\n documentReferences?: string ;\n documentNotes?: string ;\n documentForceGlobalCheckForUpdates?: boolean;\n complianceCheckItem1?: boolean ;\n complianceCheckItem2?: boolean ;\n complianceCheckItem3?: boolean ;\n complianceCheckItem4?: boolean ;\n complianceCheckItem5?: boolean ;\n complianceCheckItem6?: boolean ;\n complianceCheckItem7?: boolean ;\n complianceCheckItem8?: boolean ;\n complianceCheckItem9?: boolean ;\n complianceCheckItem10?: boolean ;\n complianceCheckItem11?: boolean ;\n complianceCheckItem12?: boolean ;\n alternativeComplianceCheckItem?: boolean ;\n alternativeComplianceDescription?: string ;\n applicability?: number ;\n analyzedBy?: string ;\n analystOperatorId?: number ;\n analysisExpiringDate?: Date ;\n analysisDate?: Date ;\n analysisNotes?: string ;\n analysisNoticeDate?: string ;\n group1?: string ;\n group2?: string ;\n count?: number ;\n created?: Date ;\n createdBy?: string ;\n lastUpdated?: Date ;\n lastUpdatedBy?: string ;\n}\n\nexport interface EvolutionQueryRegisterProfilesModel extends QueryModel {\n complianceRegisterId?: number;\n siteId?: number;\n userId?: number;\n licenceId?: number;\n name?: string;\n role?: number;\n allowObservers?: boolean;\n allowDisabled?: boolean;\n state?: number;\n}\n\nexport interface EvolutionComplianceRegisterProfile {\n id: number;\n licenceId?: number;\n userId?: number;\n passiveUserName?: string;\n passiveUserOperatorId?: number;\n complianceRegisterId?: number;\n complianceSiteId?: number;\n scopes?: number;\n selectedScopes?: number[];\n roles?: number;\n selectedRoles?: number[];\n notifications?: number;\n flags?: number;\n disabled?: boolean;\n created?: Date;\n lastUpdated?: Date;\n lastUpdatedBy?: string;\n subjectId?: number;\n subjectName?: string;\n siteId?: number;\n siteName?: string;\n siteDisabled?: boolean;\n departmentId?: number;\n departmentName?: string;\n passiveUserEmail?: string;\n placeId?: number;\n userEmail?: string;\n userOperatorId?: number;\n userDisabled?: boolean;\n registerDisabled?: boolean;\n registerTitle?: string;\n name?: string;\n scopeNames?: string;\n isAdministrator?: boolean;\n isObserver?: boolean;\n denied?: boolean;\n oldId?: string;\n operatorId?: number;\n isMenuOpen?: boolean;\n isOver?: boolean;\n context?: EvolutionComplianceContextInfo;\n}\nexport interface EvolutionComplianceLawDocumentInfo {\n documentId?: string;\n documentId2?: string;\n title2?: string;\n title1?: string;\n number?: string;\n date?: Date;\n origin?: number;\n originDescription?: string;\n originAlternativeDescription?: string;\n originRegion?: string;\n notes?: string;\n references?: EvolutionComplianceLawReference[];\n forceGlobalCheckForUpdates?: boolean;\n validated?: boolean;\n description?: string;\n taxonomy?: string;\n taxonomyPath?: string;\n}\n\nexport interface EvolutionComplianceLawsAddParams extends EvolutionComplianceLaw {\n context?: EvolutionComplianceContextInfo;\n documents?: EvolutionComplianceLawDocumentInfo[];\n shouldNotifyAnalysisCompletionAgain?: boolean;\n scopes?: number[];\n sites?: number[];\n registers?: number[];\n}\n\n/** Export parameters for compliance laws. */\nexport interface EvolutionComplianceLaswExportParams extends EvolutionExportModel<Partial<EvolutionComplianceLaw>> {}\n\nexport interface EvolutionComplianceLawReference {\n id?: number ;\n complianceLawId?: number ;\n text: string;\n description?: string ;\n anchor: string;\n}\n\nexport interface EvolutionComplianceActivity extends EvolutionPlaceable {\n id: number;\n state: number;\n monitoringActivityId?: number;\n monitoringActivityTaskId?: number;\n complianceRegisterId?: number;\n childId?: number ;\n parentId?: number ;\n lot?: number ; \n summary?: string;\n scope?: number;\n topicId?: string ;\n topicPath?: string;\n topicName?: string;\n mandatory?: boolean ;\n obligationType?: number ;\n obligationAuthorityId?: number ;\n obligationNotes?: string;\n obligationCheckPoint?: boolean ;\n description?: string;\n deadlineRecurrent?: boolean ;\n deadlineFrequency?: number ;\n deadlineFrequencyType?: number ;\n deadlineFrequencyEndOfMonth?: boolean ;\n deadlineFirstNoticeDays?: number ;\n deadlineLastNoticeDays?: number ;\n deadlineFirstNoticeDate?: Date ;\n deadlineLastNoticeDate?: Date ;\n deadlineExpiringDate?: Date ;\n planningNoticeDate?: Date ;\n planningExpiringDate?: Date ;\n planningDate?: Date ;\n plannedBy?: string;\n plannerOperatorId?: number ;\n planningApplicability?: number ;\n planningNotificationAdditionalEmailHeader?: string;\n planningNotificationAdditionalEmails?: string;\n planningNotificationAdditionalEmailsForAlertsOnly?: string;\n planningNamedExecutorOperatorId?: number ;\n planningNamedExecutorName?: string;\n planningNamedExecutorManagerOperatorId?: number ;\n planningNamedExecutorManagerName?: string;\n planningScheduleNextFromExecutionDate?: boolean ;\n planningNotes?: string;\n executorOperatorId?: number ;\n executed?: boolean;\n executedBy?: string;\n executionDate?: Date;\n externalReference?: string;\n externalDescription?: string;\n group1?: string;\n group2?: string;\n notes?: string;\n created?: Date;\n createdBy?: string;\n lastUpdated?: Date ;\n lastUpdatedBy?: string;\n\n}\n\nexport interface EvolutionComplianceActivitiesAddParams extends EvolutionComplianceActivity {\n context?: EvolutionComplianceContextInfo;\n complianceLawId?: number;\n monitoringLawId?: number;\n enableLawChangesTracking?: boolean;\n enableActivityLawsPopulation?: boolean;\n shouldNotifyPlanningCompletionAgain?: boolean;\n scopes?: number[];\n sites?: number[];\n registers?: number[];\n document?: EvolutionComplianceLawDocumentInfo;\n}","import { HttpInterceptorFn, HttpResponse } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { BroadcastService, ErrorInfo } from '@arsedizioni/ars-utils/core';\nimport { catchError, retry, tap, throwError, timer } from 'rxjs';\nimport { EVOLUTION_ACTIVE_ACCOUNT_KEY, EvolutionServiceFlags } from '../definitions';\nimport { EvolutionMessages } from '../messages';\n\n/** Minimum milliseconds between consecutive generic error broadcasts (debounce guard). */\nconst ERROR_DEBOUNCE_MS = 5000;\n\n/** How many more times a request is sent when the API is not there. */\nconst UNAVAILABLE_RETRIES = 2;\n\n/** How long to wait before each of those retries, in milliseconds. */\nconst UNAVAILABLE_RETRY_DELAY = 5000;\n\n/** The statuses a server that is being replaced answers with, plus the one it cannot answer at all. */\nconst UNAVAILABLE_STATUSES = [0, 500, 502, 503, 504];\n\n/**\n * Returns whether the failure means the API is not there, rather than the request being wrong.\n *\n * The discriminator is the body, not the status. An error raised INSIDE the application arrives\n * wrapped in the usual `ApiResult` envelope, so it has been seen, parsed and acted upon: replaying\n * it would run whatever it already ran a second time. A server that is being replaced answers with\n * IIS's own HTML, or with nothing at all — no envelope — and that request never reached any\n * handler. Only the second kind is retried, which is what makes it safe to retry a POST.\n * @param error - The raw HTTP error object.\n * @returns True when the request is worth sending again.\n */\nfunction isServiceUnavailable(error: any): boolean {\n if (!UNAVAILABLE_STATUSES.includes(parseInt(error?.status ?? '0'))) return false;\n\n const body = error?.error;\n const isApiEnvelope = !!body\n && typeof body === 'object'\n && !(body instanceof Blob)\n && ('success' in body || 'problem' in body);\n\n return !isApiEnvelope;\n}\n\n/**\n * Returns whether the URL is an authentication endpoint, where a 401 is a normal outcome -- wrong\n * credentials, a rejected code, a refused passkey -- rather than an expired or invalid session.\n *\n * They are called by a visitor who has no session by definition, so answering \"la sessione non è\n * più valida\" would send them back to the page they are already standing on and hide the real\n * reason they were refused.\n *\n * The list covers the whole Evolution sign-in surface, including the ways in that this library does\n * not itself offer: a host application registers one interceptor for every call it makes to the\n * API, its own passkey and provider flows included.\n * @param url - The request URL.\n * @returns True when the URL is a login / confirm / otp / oauth / passkey endpoint.\n */\nfunction isAuthEndpoint(url: string): boolean {\n return url.includes('/session/login')\n || url.includes('/session/confirm')\n || url.includes('/session/otp')\n || url.includes('/session/oauth')\n || url.includes('/passkeys/request-options')\n || url.includes('/passkeys/login');\n}\n\n/**\n * Returns whether the URL is the silent link probe, whose failures must never reach the user.\n *\n * `/session/status` runs unconditionally at every bootstrap, including for users who never linked\n * Evolution at all. When the API is unreachable, reporting that failure would show \"Evolution non è\n * disponibile\" to somebody who never asked Evolution for anything: the error is still rethrown for\n * the caller to observe, but nothing is broadcast.\n * @param url - The request URL.\n * @returns True when the URL is the status probe.\n */\nfunction isStatusProbe(url: string): boolean {\n return url.includes('/session/status');\n}\n\n/**\n * Resolves the user-facing message for a failed request.\n *\n * There is no branch for status 0 any more, nor for the 5xx family: a request that got no answer,\n * or an answer with no `ApiResult` envelope, never reaches here — it is retried and then reported\n * as `ERROR_UNAVAILABLE`. What is left is the failures the API itself described.\n * @param error - The raw HTTP error object.\n * @param errorStatus - The numeric HTTP status code.\n * @returns A localised message, ready to be rendered as HTML.\n */\nfunction resolveErrorMessage(error: any, errorStatus: number): string {\n const message = error?.error?.message ?? error?.message;\n switch (errorStatus) {\n case 401:\n // A 401 that reaches here comes from a sign-in attempt; anything else was classified as a\n // dead session before this function was called.\n return message ?? \"Credenziali non valide o accesso non abilitato.\";\n case 403:\n return \"Non hai i permessi necessari per eseguire l'operazione richiesta.\";\n case 429:\n return message ?? \"Troppe richieste consecutive. Aspetta qualche secondo.\";\n default:\n return (message ?? \"Impossibile eseguire l'operazione richiesta.\")\n .replaceAll('\\r\\n', '</p><p>');\n }\n}\n\n/**\n * Builds the Evolution auth HTTP interceptor.\n *\n * Attaches the credentials, the service-worker bypass and the active-account header to every\n * request aimed at the Evolution API, and turns HTTP failures into broadcast messages -- no UI\n * dependency here.\n *\n * Takes the Evolution base URI and the service flags directly as arguments, captured in the\n * closure, so it never injects `EvolutionService`: registering it does not pull the whole Evolution\n * service into the eager bundle. The debounce and the expiry latch live in that same closure, so\n * two applications registering two interceptors never share them.\n *\n * ## What the statuses mean\n *\n * Aligned with the Evolution API on 2026-08-25. The meaning of the status codes changed with it:\n * failures used to arrive as `200 OK` with `success: false`, and a dead session had to be guessed\n * from a 405, a 410 or any 5xx. Now the status is the truth -- a 401 on an already-authenticated\n * request means the session is gone, a 403 means the permission is missing, a 5xx means the server\n * broke, and those are three different things that used to be one. `invalidateSession` is\n * therefore now, and only, a 401 outside the authentication endpoints.\n *\n * Between them sits a third case, which is neither: the API is being replaced. A deployment answers\n * with a 5xx that has no `ApiResult` envelope, or does not answer at all, for the few seconds the\n * process takes to come back. That is not worth a dialog and not worth a redirect either, so the\n * request is simply sent again — twice, five seconds apart — and only if the third attempt fails\n * too does it become `EvolutionMessages.ERROR_UNAVAILABLE`, once per outage.\n *\n * `EvolutionServiceFlags.NotifySystemErrors` therefore now governs one narrower case: a 5xx that\n * DOES carry an envelope, i.e. a server error the API itself described. Without the flag it is\n * swallowed, as it always was in this library.\n *\n * Errors are re-thrown rather than swallowed: call sites rely on their `error` callback firing, and\n * on `finalize` clearing a busy dialog.\n *\n * Register it with `withInterceptors`:\n * @example\n * provideHttpClient(withInterceptors([\n * evolutionAuthInterceptor(environment.evolutionServiceUri,\n * EvolutionServiceFlags.DisplayConnectionStateMessages | EvolutionServiceFlags.Embedded),\n * ]))\n *\n * @param serviceUri - Base URI of the Evolution service; only requests starting with it are handled.\n * @param flags - Service flags (e.g. NotifySystemErrors). Defaults to None.\n * @returns An `HttpInterceptorFn` ready to register.\n */\nexport function evolutionAuthInterceptor(\n serviceUri: string,\n flags: EvolutionServiceFlags = EvolutionServiceFlags.None\n): HttpInterceptorFn {\n /** Timestamp of the last generic error shown, used to debounce a burst of failures into one. */\n let lastErrorTime = -1;\n\n /**\n * Whether the session-expiry notification has already been sent. Prevents a storm of dialogs when\n * several in-flight requests fail at once; re-armed on the next successful response.\n */\n let sessionExpiredNotified = false;\n\n /**\n * Whether the unavailable-API notification has already been sent. A deployment fails every\n * request in flight, and one notification is enough. Re-armed on the next successful response.\n */\n let unavailableNotified = false;\n\n /**\n * Broadcasts a generic, user-facing error for an Evolution HTTP failure, debounced.\n * @param error - The raw error value thrown by the HTTP layer.\n * @param errorStatus - The numeric HTTP status code.\n * @param broadcastService - The broadcast service for the current request.\n * @returns void\n */\n function notifyError(error: unknown, errorStatus: number, broadcastService: BroadcastService): void {\n // A 5xx the API described itself is the one case the flag still governs.\n if (errorStatus >= 500 && (flags & EvolutionServiceFlags.NotifySystemErrors) === 0) return;\n\n const now = Date.now();\n if (now - lastErrorTime <= ERROR_DEBOUNCE_MS) return;\n lastErrorTime = now;\n\n broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n {\n invalidateSession: false,\n message: resolveErrorMessage(error, errorStatus),\n title: \"Errore in Evolution\",\n errorStatus,\n service: serviceUri\n } as ErrorInfo\n );\n }\n\n // The interceptor itself. Runs in an injection context, so `inject()` works.\n return (request, next) => {\n if (!serviceUri || !request.url.startsWith(serviceUri)) {\n return next(request);\n }\n\n const broadcastService = inject(BroadcastService);\n\n const authenticatedRequest = request.clone({\n // `withCredentials` is what carries the session: an HttpOnly cookie the application cannot\n // read, cannot forge and cannot forget to send.\n withCredentials: true,\n setHeaders: {\n 'ngsw-bypass': 'ngsw-bypass',\n // Which of the accounts inside the one session cookie this tab is working as. It replaces\n // the per-tab random `X-Client-Id`, whose only job was to give each tab a cookie of its\n // own -- one per tab ever opened, all of them sent on every request, until the header\n // outgrew what the server accepts. Empty on a tab that has not signed in yet: the API then\n // serves the active account.\n 'X-Evo-Account': sessionStorage.getItem(EVOLUTION_ACTIVE_ACCOUNT_KEY) ?? ''\n }\n });\n\n return next(authenticatedRequest).pipe(\n // An API that is being replaced is not an error to show, it is a wait: two more attempts,\n // five seconds apart. Anything else is rethrown on the spot, so a request that genuinely\n // failed still fails immediately.\n retry({\n count: UNAVAILABLE_RETRIES,\n delay: error => isServiceUnavailable(error)\n ? timer(UNAVAILABLE_RETRY_DELAY)\n : throwError(() => error)\n }),\n tap(event => {\n // A response means the session is valid again, and the API is back: re-arm both notifiers.\n if (event instanceof HttpResponse) {\n sessionExpiredNotified = false;\n unavailableNotified = false;\n }\n }),\n catchError((error: any) => {\n // Which request this was is read from the request, not from `error.url`: a failure with no\n // response -- the browser refusing the connection while the API restarts -- carries no URL\n // at all. Everything that gets here is an Evolution request anyway: the others returned\n // before the pipe was built.\n const errorStatus = parseInt(error?.status ?? '0');\n\n if (isStatusProbe(authenticatedRequest.url)) {\n // The silent probe stays silent: its caller reads the outcome from the rethrown error,\n // nobody else needs to hear about it.\n } else if (isServiceUnavailable(error)) {\n // Three attempts over ten seconds and the API is still not answering. There is nothing\n // left to retry, so the host application is told once, however many requests were in\n // flight. Reported whatever the flags say: `NotifySystemErrors` governs a 5xx the API\n // described itself, and a server that never answered described nothing.\n if (!unavailableNotified) {\n unavailableNotified = true;\n broadcastService.sendMessage(EvolutionMessages.ERROR_UNAVAILABLE);\n }\n } else if (errorStatus === 401 && !isAuthEndpoint(authenticatedRequest.url)) {\n // Expired or invalidated session on an authenticated request. Notified once: several\n // in-flight requests failing together is how a single expiry becomes a wall of dialogs.\n if (!sessionExpiredNotified) {\n sessionExpiredNotified = true;\n broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n {\n invalidateSession: true,\n message: \"La sessione di lavoro non è più valida.\",\n title: \"Errore in Evolution\",\n errorStatus,\n service: serviceUri\n } as ErrorInfo\n );\n }\n } else {\n notifyError(error, errorStatus, broadcastService);\n }\n\n return throwError(() => error);\n })\n );\n };\n}\n","import { Service, Signal, WritableSignal, inject, signal } from '@angular/core';\nimport { BroadcastService } from '@arsedizioni/ars-utils/core';\nimport { EvolutionMessages } from '../messages';\nimport { EVOLUTION_ACTIVE_ACCOUNT_KEY, EvolutionLoginInfo, EvolutionLoginResult, EvolutionServiceFlags, EvolutionUserInfo } from '../definitions';\n\n/**\n * @internal\n * Private state container for the Evolution session.\n *\n * Intentionally NOT exported from the barrel: it must never be injected by\n * application code. Its state and pure mutations are re-published through\n * {@link EvolutionService} (and partly {@link LoginService}). The feature\n * services inject it ONLY to read {@link serviceUri}.\n *\n * Owns the back-end URI, feature flags, persisted login info and the session\n * signals. No HTTP, no auth orchestration.\n */\n@Service()\nexport class CoreService {\n\n private readonly broadcastService = inject(BroadcastService);\n\n private _serviceUri: string | undefined;\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined {\n return this._serviceUri;\n }\n /**\n * Sets the base URI of the Evolution back-end service.\n * @param uri - The base URL.\n * @returns void\n */\n setServiceUri(uri: string): void {\n this._serviceUri = uri;\n }\n\n private _flags: EvolutionServiceFlags = EvolutionServiceFlags.None;\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags {\n return this._flags;\n }\n /**\n * Sets the active feature flags.\n * @param flags - The flags bitmask to apply.\n * @returns void\n */\n setFlags(flags: EvolutionServiceFlags): void {\n this._flags = flags;\n }\n\n private _loginInfo?: EvolutionLoginInfo;\n /**\n * Gets the current login info, hydrating it from `localStorage` on first\n * access when no in-memory value is available.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined {\n if (!this._loginInfo) {\n const raw = localStorage.getItem('evolution_context');\n if (raw) {\n try {\n this._loginInfo = JSON.parse(raw) as EvolutionLoginInfo;\n } catch { /* invalid JSON — ignore and leave undefined */ }\n }\n }\n return this._loginInfo;\n }\n\n /**\n * Gets the signed-in account.\n * @returns The current {@link EvolutionUserInfo}, or `undefined` when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.loginInfo?.context; }\n\n /**\n * Seeded from the stored context, which means \"this browser signed in at some point\" and nothing\n * more: the auth cookie is HttpOnly and may have expired while the stored context lived on.\n * `LoginService.initialize` turns the hint into an answer by asking `/session/me`, and the hint\n * is what keeps a visitor who never signed in from calling a route that would answer 401 and\n * raise a dead-session error over the sign-in page.\n */\n private readonly _loggedIn = signal<boolean>(localStorage.getItem('evolution_context') !== null);\n /** `true` when this browser has a session the API has accepted. */\n public readonly loggedIn: Signal<boolean> = this._loggedIn.asReadonly();\n /**\n * Sets the logged-in state.\n * @param value - The new logged-in value.\n * @returns void\n */\n setLoggedIn(value: boolean): void {\n this._loggedIn.set(value);\n }\n\n /** `true` while a login request is in flight. */\n public readonly loggingIn: WritableSignal<boolean> = signal<boolean>(false);\n\n /** The `sessionStorage` key naming which account this tab is working as. */\n static readonly activeAccountKey = EVOLUTION_ACTIVE_ACCOUNT_KEY;\n\n /**\n * Records which account this tab is working as, so the interceptor can name it on every request.\n *\n * `sessionStorage` and not `localStorage`: the choice belongs to the tab. One cookie holds every\n * account this browser has open, and two tabs may sit on two different licences while reading\n * that same cookie -- which is what replaced the per-tab `X-Client-Id`, a random UUID that gave\n * every tab ever opened a session cookie of its own until the header outgrew what the server\n * accepts.\n * @param userId - The account to work as, or `undefined` to stop naming one.\n * @returns void\n */\n setActiveAccount(userId?: number): void {\n if (userId && userId > 0) {\n sessionStorage.setItem(CoreService.activeAccountKey, String(userId));\n } else {\n sessionStorage.removeItem(CoreService.activeAccountKey);\n }\n }\n\n /**\n * Persists the current login info to `localStorage`.\n * @returns void\n */\n storeContext(): void {\n localStorage.setItem('evolution_context', JSON.stringify(this._loginInfo));\n }\n\n /**\n * Merges a login result into the stored login info and persists it.\n * @param result - The login result returned by the login endpoint.\n * @returns void\n */\n updateContext(result: EvolutionLoginResult): void {\n if (!this._loginInfo) {\n this._loginInfo = { context: undefined };\n }\n this._loginInfo.context = result.context;\n this.storeContext();\n }\n\n /**\n * Resets the in-memory login state and broadcasts a logout-completed event.\n * Does NOT touch storage; call {@link clear} for a full cleanup.\n * @returns void\n */\n reset(): void {\n this._loginInfo = undefined;\n this._loggedIn.set(false);\n this.broadcastService.sendMessage(EvolutionMessages.LOGOUT_COMPLETED);\n }\n\n /**\n * Clears every trace of the session on this device -- the stored context, the account this tab\n * was working as and the leftovers of the token era -- and then calls {@link reset}. It asks the\n * API nothing: use `LoginService.logout` for that.\n *\n * It takes no argument any more. `clearOAuthToken` decided whether to drop\n * `evolution_oauth_token`, a provider access token this library no longer obtains, stores or\n * sends: the whole exchange happens on the backend.\n * @returns void\n */\n clear(): void {\n // The stored context goes with the session it describes. It used to be removed by `logout()`\n // alone, so every other way of losing a session -- an expiry, a rejected restore -- left it\n // behind for the next bootstrap to trust.\n localStorage.removeItem('evolution_context');\n\n // The account this tab was working as. Left behind, the next request would name an account no\n // longer in the cookie: harmless, because the API falls back to the active one, but it would\n // also survive a sign-in as somebody else until the next `completeLogin` overwrote it.\n sessionStorage.removeItem(CoreService.activeAccountKey);\n\n // Leftovers of the token era, when the session travelled in session storage instead of an\n // HttpOnly cookie, and of the per-tab cookie era. Nothing writes them any more; they are\n // removed so a browser upgrading from the previous version does not keep them for good.\n sessionStorage.removeItem('evolution_auth');\n sessionStorage.removeItem('evolution_refresh');\n sessionStorage.removeItem('evolution_oauth');\n sessionStorage.removeItem('evolution_auth_oauth');\n sessionStorage.removeItem('evolution_oauth_token');\n sessionStorage.removeItem('evolution_client_id');\n\n this.reset();\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { DestroyRef, Service, Signal, WritableSignal, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ApiResult, BroadcastMessageInfo, BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';\nimport { EMPTY, Observable, of, throwError } from 'rxjs';\nimport { catchError, finalize, map } from 'rxjs/operators';\n\nimport { EvolutionLoginInfo, EvolutionLoginResult, EvolutionServiceFlags, EvolutionSessionStatus, EvolutionUserInfo } from '../definitions';\nimport { EvolutionMessages } from '../messages';\nimport { CoreService } from './core.service';\n\n/**\n * Authentication for the Evolution back end: password login, e-mailed code confirmation, account\n * switch, logout and session restore. All session state lives in the private {@link CoreService};\n * this service orchestrates the HTTP flows and re-publishes the parts of core that consumers need.\n *\n * Aligned with the Evolution API on 2026-08-25. Everything goes through `/session/*` and an\n * HttpOnly cookie now: there is no bearer token, no `remember` credential the API can replay, and\n * no provider token acquired by the caller -- the external-provider flow is a full-page redirect\n * handled server-side, and all that reaches this service is the `/session/me` call on the way back.\n *\n * ## What this service no longer offers, and why\n *\n * - **`autoLogin`.** It was `login(undefined, undefined, true)`: a credential-less sign-in that\n * worked only because the API could decrypt a stored password from an `evolution_remember`\n * cookie. `POST /session/login` takes a user and a password and nothing else.\n * - **`autoLogout`.** It wrapped {@link logout} in toasts and a callback, and ran the callback\n * from `complete` -- that is, before the request it was waiting for had said anything. A host\n * that wants a callback subscribes: `logout().subscribe(() => …)`.\n * - **re-login on `LOGIN_CHANGED`.** The handler used to answer that message with a silent\n * `autoLogin`, which is the same replay by another name. The message is still broadcast by hosts\n * that link and unlink Evolution, and it is theirs to act on; this library no longer signs\n * anybody in without being asked.\n * - **the OAuth `Authorization` header, and the per-tab `X-Client-Id`.** The first is server-side\n * now; the second was a random UUID that gave every tab a session cookie of its own. A tab says\n * which of the accounts in the one cookie it is working as with `X-Evo-Account`, written by\n * {@link CoreService.setActiveAccount}.\n *\n * This is a deliberately reduced subset of what the Evolution application itself does: passkeys and\n * the provider redirect are not here. A library whose job is to let another application talk to\n * Evolution signs in with a password; an application that offers the other ways in owns them.\n */\n@Service()\nexport class LoginService {\n\n private readonly httpClient = inject(HttpClient);\n private readonly broadcastService = inject(BroadcastService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly core = inject(CoreService);\n\n private broadcastInitialized = false;\n\n /**\n * The address the pending login was started with, kept so {@link confirmIdentity} can send it\n * along with the code.\n *\n * The API stores each verification code under the account it was issued to, so a code alone is\n * not redeemable -- which is what stops a guessed code from opening whatever login happens to be\n * pending.\n */\n private pendingLoginEmail?: string;\n\n // ── Re-published core state (CoreService stays private) ─────────────────────\n\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined { return this.core.serviceUri; }\n\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags { return this.core.flags; }\n\n /**\n * Gets the current login info.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined { return this.core.loginInfo; }\n\n /**\n * Gets the signed-in account with its licence context.\n * @returns The current {@link EvolutionUserInfo}, or undefined when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.core.user; }\n\n /** `true` when this browser has a session the API has accepted. */\n get loggedIn(): Signal<boolean> { return this.core.loggedIn; }\n\n /** `true` while an authentication is in flight. */\n get loggingIn(): WritableSignal<boolean> { return this.core.loggingIn; }\n\n // ── Re-published core operations ────────────────────────────────────────────\n\n /**\n * Persists the current login info to `localStorage` (delegates to core).\n * @returns void\n */\n storeContext(): void { this.core.storeContext(); }\n\n /**\n * Merges a login result into the stored login info (delegates to core).\n * @param result - The login result returned by the login endpoint.\n * @returns void\n */\n updateContext(result: EvolutionLoginResult): void { this.core.updateContext(result); }\n\n /**\n * Resets the in-memory login state and broadcasts logout-completed (delegates to core).\n * @returns void\n */\n reset(): void { this.core.reset(); }\n\n /**\n * Clears every trace of the session on this device without asking the API anything\n * (delegates to core). Use {@link logout} for a real sign-out.\n * @returns void\n */\n clear(): void { this.core.clear(); }\n\n // ── Lifecycle ───────────────────────────────────────────────────────────────\n\n /**\n * Initialises the service with the back-end URI and optional feature flags, and asks the API — the\n * only party that can read the HttpOnly cookie — whether this browser still holds a session.\n *\n * Must be called once during application bootstrap, before any other method. What it used to do\n * on a refresh was announce `LOGIN_COMPLETED` on the strength of a value in local storage; the\n * auth cookie is HttpOnly and may have expired while that value lived on, so the claim was never\n * verified and the consumer met the inevitable 401 as \"your session just expired\" rather than as\n * a bootstrap that never got off the ground.\n * @param serviceUri - Base URL of the Evolution service.\n * @param flags - Bitmask of `EvolutionServiceFlags` (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n flags: EvolutionServiceFlags = EvolutionServiceFlags.None\n ): void {\n this.core.setServiceUri(serviceUri);\n this.core.setFlags(flags);\n\n // Subscribe to broadcast messages (only once)\n if (!this.broadcastInitialized) {\n this.broadcastInitialized = true;\n this.broadcastService\n .getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((message: BroadcastMessageInfo) => {\n this.handleBroadcastMessage(message);\n });\n }\n\n // The probe runs UNCONDITIONALLY, where it used to run only when a stored context existed. The\n // stored context is just a hint -- \"this browser signed in at some point\" -- and the cookie can\n // outlive it: local storage cleared while the month-long cookie stayed put made this library\n // declare \"no link\" with a perfectly valid session in the browser. The API is the only one that\n // knows, and it is asked every time.\n this.core.loggingIn.set(true);\n this.restoreSession();\n }\n\n /**\n * Dispatches an incoming broadcast message to the appropriate handler.\n * @param message - The message received from the broadcast channel.\n * @returns void\n */\n private handleBroadcastMessage(message: BroadcastMessageInfo): void {\n if (message.id !== EvolutionMessages.LOGOUT) return;\n\n if (!this.core.loggedIn()) {\n // No session to close server-side, but the device must still be left clean.\n this.core.clear();\n return;\n }\n\n this.logout().subscribe(r => {\n if (!r.success) {\n if (r.message) {\n this.broadcastService.sendMessage(\n EvolutionMessages.ERROR,\n { message: \"<p>\" + r.message + \"</p><br><br><hr><p class='small'><i>Per eliminare la configurazione di Evolution accedere a:<br><b>menu > personalizza > collegamenti</b></i></p>\" }\n );\n }\n } else if ((this.core.flags & EvolutionServiceFlags.DisplayConnectionStateMessages) > 0) {\n this.broadcastService.sendMessage(\n EvolutionMessages.SUCCESS_TOAST,\n { message: 'Disconnesso da Evolution', icon: 'power_off', duration: 1500 });\n }\n });\n }\n\n /**\n * Sends a one-shot ping to the back end to verify connectivity. Errors are swallowed.\n * @returns void\n */\n ping(): void {\n this.httpClient\n .get<ApiResult<number>>(\n this.core.serviceUri + '/ping?nocache=' + SystemUtils.generateUUID()\n )\n .pipe(catchError(() => EMPTY))\n .subscribe();\n }\n\n // ── Session ─────────────────────────────────────────────────────────────────\n\n /**\n * Authenticates the user with an e-mail address and a password, the only credentials\n * `POST /session/login` accepts.\n *\n * On success the session cookie is issued and the context stored, unless the API answers\n * `requiresMfa`: the device is not a trusted one, a six-digit code has been e-mailed and nothing\n * about the account is disclosed until {@link confirmIdentity} redeems it.\n *\n * A failure is no longer a `200 OK` carrying `success: false`. Wrong credentials come back as a\n * real 4xx with the message in the envelope, so the `next` branch of the caller is never reached.\n * @param email - The user's e-mail address.\n * @param password - The user's password.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n login(email?: string, password?: string): Observable<ApiResult<EvolutionLoginResult>> {\n // Kept for the confirmation step, which has to name the account the code was issued to.\n this.pendingLoginEmail = email;\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/login',\n { user: email ?? '', password: password ?? '' })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n if (r.value?.requiresMfa) {\n // Notify the login is pending an e-mailed code.\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_PENDING, {});\n } else {\n this.completeLogin(r.value);\n }\n }\n return r;\n })\n );\n }\n\n /**\n * Confirms a pending e-mailed code challenge, which establishes the session and marks this device\n * as trusted: the next sign-in from it will not ask for a code again.\n *\n * The address travels with the code, in the body. The API stores each code under the account it\n * was issued to, so naming the account is part of redeeming it; and a code in the body is a code\n * that stays out of the URL, where `POST /login/confirm/{code}` left it for the access logs and\n * the browser history to keep.\n * @param code - The one-time confirmation code provided to the user.\n * @param email - The address the code was sent to; defaults to the one the pending login started with.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n confirmIdentity(code: string, email?: string): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/confirm',\n { email: email ?? this.pendingLoginEmail, code: code })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n this.completeLogin(r.value);\n }\n return r;\n })\n );\n }\n\n /**\n * Asks the API whether this browser holds a live session, without ever failing with a 401: the\n * route is anonymous and answers `connected: false` to a caller with no session. This is the one\n * honest way to know the link state -- the auth cookie is HttpOnly and belongs to the API's host,\n * so it cannot be read from here, and its presence would prove nothing anyway, since the session\n * also lives server-side and may have been revoked or evicted.\n * @returns An observable that emits the `ApiResult<EvolutionSessionStatus>`.\n */\n status(): Observable<ApiResult<EvolutionSessionStatus>> {\n return this.httpClient\n .get<ApiResult<EvolutionSessionStatus>>(this.core.serviceUri + '/session/status');\n }\n\n /**\n * Reads the current session from the server, which resolves it from the auth cookie's claims.\n * Used to restore the state after a page refresh instead of trusting what local storage holds.\n *\n * The route answers with the same `EvolutionLoginResult` a login answers with, built by the same\n * `ResolveSignInContextAsync`, so a restored session and a fresh one are identical by\n * construction.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n me(): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .get<ApiResult<EvolutionLoginResult>>(this.core.serviceUri + '/session/me')\n .pipe(\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r?.success) {\n // No LOGIN_COMPLETED from here: {@link restoreSession} announces it, so a consumer\n // hears it once whether the session was opened or recovered.\n this.completeLogin(r.value, false);\n }\n return r;\n })\n );\n }\n\n /**\n * Asks `/session/status` whether this browser holds a live session, and hydrates the context\n * through {@link me} when it does.\n *\n * The probe is silent by construction: `/session/status` never answers 401, so a visitor who\n * never signed in -- or a cookie whose session has died -- comes back as `connected: false` with\n * no error broadcast and no dialog. Only then is the stale stored context cleared, so the\n * `loggedIn` signal tells the truth at every bootstrap.\n *\n * Nothing is cleared on a transport failure, and that is deliberate: an unreachable API is not\n * proof of a dead session -- the proxy may have answered 502, the device may be offline -- and\n * clearing on any of those would sign the user out with a perfectly valid cookie.\n * @returns void\n */\n private restoreSession(): void {\n // Whether the probe handed over to `/session/me`, which then owns lowering `loggingIn`.\n let restoring = false;\n this.status()\n .pipe(finalize(() => { if (!restoring) { this.core.loggingIn.set(false); } }))\n .subscribe({\n next: r => {\n if (r?.success && r.value?.connected) {\n restoring = true;\n this.me()\n .pipe(finalize(() => this.core.loggingIn.set(false)))\n .subscribe({\n next: m => {\n if (m?.success) {\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);\n }\n },\n // Consumed so the rethrown error is not reported a second time as an unhandled one.\n error: () => { }\n });\n } else if (this.core.loggedIn()) {\n // The stored context outlived its session: drop it, or the next bootstrap would keep\n // claiming a session that is gone.\n this.core.clear();\n }\n },\n // Transport failure: keep the stored hint, the next bootstrap will ask again.\n error: () => { }\n });\n }\n\n /**\n * Switches this tab to another account of the same person -- same address, same stored password\n * -- without re-entering credentials.\n *\n * The account being left stays open: a switch used to close its session, because each account had\n * a cookie of its own, and they now share one cookie holding several. What changes here is only\n * which account THIS tab names on its requests, which {@link completeLogin} records.\n * @param id - The user ID to switch to.\n * @returns An observable that emits the `ApiResult<EvolutionLoginResult>`.\n */\n loginSwitch(id: number): Observable<ApiResult<EvolutionLoginResult>> {\n return this.httpClient\n .post<ApiResult<EvolutionLoginResult>>(\n this.core.serviceUri + '/session/switch',\n { userId: id })\n .pipe(\n catchError(err => throwError(() => err)),\n map((r: ApiResult<EvolutionLoginResult>) => {\n if (r.success) {\n this.completeLogin(r.value, false);\n }\n return r;\n })\n );\n }\n\n /**\n * Signs out: closes this browser's session on the API and clears the local state whatever the\n * answer, since there is nothing useful to do with a logout that failed.\n *\n * `forget` no longer means \"drop the stored credentials\" -- there are none to drop. It means\n * \"stop trusting this device\", that is clear the MFA cookie, so that the next sign-in from here\n * is challenged with an e-mailed code again. It also closes one session and not all of them: an\n * account may hold one per front end, and signing out of this browser must not sign the person\n * out of their phone.\n * @param forget - When `true`, the device stops being a trusted one. Defaults to `false`.\n * @returns An observable that emits `ApiResult<unknown>`.\n */\n logout(forget: boolean = false): Observable<ApiResult<unknown>> {\n return this.httpClient\n .post<ApiResult<unknown>>(this.core.serviceUri + '/session/logout?forget=' + forget, {})\n .pipe(\n finalize(() => this.core.clear()),\n // A logout that failed is still a logout as far as this device is concerned: the local\n // state has already been cleared by `finalize`, and there is nothing useful a caller could\n // do with the failure. `message` is empty rather than absent because `ApiResponse` declares\n // it as a string.\n catchError(() => of<ApiResult<unknown>>({ success: false, value: undefined, message: '' }))\n );\n }\n\n /**\n * Finalises a login, a code confirmation, an account switch or a session restore: stores the\n * context, raises the logged-in signal, records which account this tab is working as and\n * optionally announces `LOGIN_COMPLETED`.\n *\n * `loggedIn` is raised unconditionally. It used to be `!result.context?.isTemporary`, and\n * `isTemporary` was always false -- it is `[NotMapped]` on the API and never filled -- so the\n * condition never did anything. An expired password is reported by `requiresPasswordChange` and\n * does not mean there is no session: the cookie has been issued, and it is what the password\n * change itself travels on.\n *\n * `loggingIn` is deliberately left alone. Whoever raised it lowers it -- {@link restoreSession}\n * for a refresh, the host application for its own sign-in flow -- because lowering it here would\n * drop the host's splash the instant the response arrived, before anything was on screen.\n * @param result - The login result payload from the server.\n * @param notify - Whether to broadcast `LOGIN_COMPLETED`. Defaults to `true`.\n * @returns void\n */\n private completeLogin(result: EvolutionLoginResult, notify: boolean = true): void {\n this.core.updateContext(result);\n this.core.setLoggedIn(true);\n // Which account THIS TAB is working as. Per tab on purpose: two tabs may sit on two different\n // licences, and they share the one cookie that holds both.\n this.core.setActiveAccount(result?.context?.userId);\n if (notify) {\n this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);\n }\n }\n}\n","import { Service, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ApiResult, FolderTree } from '@arsedizioni/ars-utils/core';\nimport {\n EvolutionChangeContextModel, EvolutionChangeContextResultModel,\n EvolutionComplianceActivitiesAddParams, EvolutionComplianceActivity,\n EvolutionComplianceLaw, EvolutionComplianceLawsAddParams,\n EvolutionComplianceRegister, EvolutionComplianceRegisterProfile,\n EvolutionQueryRegisterProfilesModel\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * Compliance endpoints: taxonomy & groups, context, registers, laws and\n * activities (the `Context` / `Registers` / `Laws` / `Activities` sections,\n * plus the general taxonomy/groups lookups). Pure HTTP; injects the private\n * {@link CoreService} only to read the back-end URI.\n */\n@Service()\nexport class ComplianceService {\n private readonly httpClient = inject(HttpClient);\n private readonly core = inject(CoreService);\n\n // ── Taxonomy & groups ───────────────────────────────────────────────────────\n\n /**\n * Retrieves the taxonomy tree from the back end.\n * @returns An observable that emits `ApiResult<FolderTree>`.\n */\n getTaxonomy() {\n return this.httpClient.get<ApiResult<FolderTree>>(\n this.core.serviceUri + '/taxonomy'\n );\n }\n\n /**\n * Retrieves the compliance groups for a register.\n * @param group - Group index to retrieve (default: `1`).\n * @param register - Optional register ID to scope the query.\n * @returns An observable that emits `ApiResult<string[]>`.\n */\n getGroups(group: number = 1, register?: number) {\n const path = register\n ? `/compliance/groups/?group=${group}®ister=${register}`\n : `/compliance/groups/?group=${group}`;\n return this.httpClient.get<ApiResult<string[]>>(this.core.serviceUri + path);\n }\n\n // ── Context ──────────────────────────────────────────────────────────────────\n\n /**\n * Sends a context-change request to the back end.\n * @param params - The context model describing the desired switch.\n * @returns An observable that emits `ApiResult<EvolutionChangeContextResultModel>`.\n */\n changeContext(params: EvolutionChangeContextModel) {\n return this.httpClient.post<ApiResult<EvolutionChangeContextResultModel>>(\n this.core.serviceUri + '/compliance/context',\n params\n );\n }\n\n // ── Registers ────────────────────────────────────────────────────────────────\n\n /**\n * Retrieves a single compliance register by ID.\n * @param id - The register ID.\n * @returns An observable that emits `ApiResult<EvolutionComplianceRegister>`.\n */\n getRegister(id: number) {\n return this.httpClient.get<ApiResult<EvolutionComplianceRegister>>(\n this.core.serviceUri + '/compliance/registers/' + id\n );\n }\n\n /**\n * Collects register profiles matching the given query parameters.\n * @param params - Query parameters defining the filter criteria.\n * @returns An observable that emits `ApiResult<EvolutionComplianceRegisterProfile[]>`.\n */\n collectRegisterProfiles(params: EvolutionQueryRegisterProfilesModel) {\n return this.httpClient.post<ApiResult<EvolutionComplianceRegisterProfile[]>>(\n this.core.serviceUri + '/compliance/registers/profiles/collect',\n params\n );\n }\n\n // ── Laws ─────────────────────────────────────────────────────────────────────\n\n /**\n * Adds one or more compliance laws.\n * @param params - The laws to add.\n * @returns An observable that emits `ApiResult<EvolutionComplianceLaw[]>`.\n */\n addLaws(params: EvolutionComplianceLawsAddParams) {\n return this.httpClient.post<ApiResult<EvolutionComplianceLaw[]>>(\n this.core.serviceUri + '/compliance/laws/add',\n params\n );\n }\n\n /**\n * Exports compliance laws in the format expected by the server.\n * @param params - Export parameters (model shape is server-defined).\n * @returns An observable that emits the binary blob response.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exportLaws(params: any) {\n return this.httpClient.post(\n this.core.serviceUri + '/compliance/laws/export',\n params,\n { responseType: 'blob' }\n );\n }\n\n // ── Activities ─────────────────────────────────────────────────────────────────\n\n /**\n * Adds one or more compliance activities.\n * @param params - The activities to add.\n * @returns An observable that emits `ApiResult<EvolutionComplianceActivity>`.\n */\n addActivities(params: EvolutionComplianceActivitiesAddParams) {\n return this.httpClient.post<ApiResult<EvolutionComplianceActivity>>(\n this.core.serviceUri + '/compliance/activities/add',\n params\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Service, inject } from '@angular/core';\nimport { ApiResult } from '@arsedizioni/ars-utils/core';\nimport {\n EvolutionRecoverPasswordModel,\n EvolutionResetPasswordModel,\n EvolutionUpdateUserSettingsModel,\n EvolutionUserInfo,\n EvolutionUserLink\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * The `/account/*` endpoints: the links a user account carries, its settings, its password and the\n * licence behind it.\n *\n * Everything here acts on the account the session names, which is why none of these methods takes\n * one. The licence refresh is the exception in appearance only: the id in the route is ignored by\n * the API, which reads the account from the session -- it used to be taken at face value, with no\n * authorization at all, so any integer returned somebody else's company and expiry.\n */\n@Service()\nexport class AccountService {\n private readonly httpClient = inject(HttpClient);\n private readonly core = inject(CoreService);\n\n /**\n * Persists a user link on the server.\n * @param item - The user link to save.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n saveLink(item: EvolutionUserLink) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/links/save',\n item\n );\n }\n\n /**\n * Deletes a user link from the server.\n * @param item - The user link to delete.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n deleteLink(item: EvolutionUserLink) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/links/delete',\n item\n );\n }\n\n /**\n * Persists updated settings for the signed-in account (dashboard, flags).\n * @param params - The settings to save.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n updateSettings(params: EvolutionUpdateUserSettingsModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/settings/save',\n params\n );\n }\n\n /**\n * Changes a password: the signed-in account's own, with `oldPassword`, or somebody else's when an\n * administrator names it.\n * @param params - The password change to apply.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n resetPassword(params: EvolutionResetPasswordModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/password/reset',\n params\n );\n }\n\n /**\n * Starts a password recovery, which mails a reset link to the given address.\n * @param params - The address to recover, with the reCAPTCHA token that guards the route.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n recoverPassword(params: EvolutionRecoverPasswordModel) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/account/password/recover',\n params\n );\n }\n\n /**\n * Re-reads the licence of the signed-in account: company, expiry, quotas and allowed modules.\n *\n * Does NOT update the stored context: what the caller does with a fresh licence -- refresh a\n * settings page, recompute a quota, store it -- is the caller's business, and a service that\n * quietly rewrote the session context under it would be doing more than it was asked.\n * @returns An observable that emits `ApiResult<EvolutionUserInfo>`.\n */\n refreshLicence() {\n return this.httpClient.get<ApiResult<EvolutionUserInfo>>(\n this.core.serviceUri + '/account/licenses/refresh/' + (this.core.user?.userId ?? -1)\n );\n }\n}\n","import { Service, Signal, WritableSignal, inject } from '@angular/core';\nimport { EvolutionLoginInfo, EvolutionServiceFlags, EvolutionUserInfo } from '../definitions';\nimport { AccountService } from './account.service';\nimport { ComplianceService } from './compliance.service';\nimport { CoreService } from './core.service';\nimport { LoginService } from './login.service';\n\n/**\n * Public entry point for the Evolution compliance module.\n *\n * The private {@link CoreService} is never exposed; its state and operations\n * are re-published here. All endpoint operations are reached through the\n * namespaced sub-services:\n * - `evolution.session` — authentication / session lifecycle\n * - `evolution.compliance` — taxonomy, context, registers, laws, activities\n * - `evolution.account` — user links\n *\n * The facade itself exposes ONLY the re-published core state/operations plus\n * `initialize` and `ping` — it intentionally does NOT flatten the sub-service\n * methods (use the namespaces for those).\n */\n@Service()\nexport class EvolutionService {\n\n /** Private: never exposed to consumers. */\n private readonly core = inject(CoreService);\n\n /** Authentication / session lifecycle sub-service. */\n readonly session = inject(LoginService);\n /** Compliance endpoints: taxonomy, groups, context, registers, laws, activities. */\n readonly compliance = inject(ComplianceService);\n /** Account endpoints: user links management. */\n readonly account = inject(AccountService);\n\n // ── Re-published core state ─────────────────────────────────────────────────\n\n /**\n * Gets the base URI of the Evolution back-end service.\n * @returns The configured service URI, or undefined before initialize().\n */\n get serviceUri(): string | undefined { return this.core.serviceUri; }\n\n /**\n * Gets the active feature flags.\n * @returns The active {@link EvolutionServiceFlags} bitmask.\n */\n get flags(): EvolutionServiceFlags { return this.core.flags; }\n\n /**\n * Gets the current login info.\n * @returns The current {@link EvolutionLoginInfo}, or undefined.\n */\n get loginInfo(): EvolutionLoginInfo | undefined { return this.core.loginInfo; }\n\n /**\n * Gets the signed-in account with its licence context.\n * @returns The current {@link EvolutionUserInfo}, or undefined when there is no session.\n */\n get user(): EvolutionUserInfo | undefined { return this.core.user; }\n\n /**\n * `true` when this browser has a session the API has accepted. It starts from the stored context\n * and is settled -- raised or cleared -- by the silent `/session/status` probe {@link initialize}\n * makes, which is the one honest way to read a state that lives in an HttpOnly cookie plus a\n * server-side lease. This signal IS the link state: bind it, do not poll it.\n */\n get loggedIn(): Signal<boolean> { return this.core.loggedIn; }\n\n /** `true` while an authentication is in flight. */\n get loggingIn(): WritableSignal<boolean> { return this.core.loggingIn; }\n\n \n // ── Lifecycle (the only flattened sub-service methods) ──────────────────────\n\n /**\n * Initialises the service with the back-end URI and optional feature flags.\n * @param serviceUri - Base URL of the Evolution service.\n * @param flags - Bitmask of `EvolutionServiceFlags` (default: `None`).\n * @returns void\n */\n initialize(serviceUri: string, flags: EvolutionServiceFlags = EvolutionServiceFlags.None): void {\n this.session.initialize(serviceUri, flags);\n }\n\n /**\n * Sends a one-shot ping to the back end to verify connectivity.\n * @returns void\n */\n ping(): void { this.session.ping(); }\n}\n","// Public barrel for the Evolution services.\n//\n// CoreService is intentionally NOT exported: it is private/internal and must\n// never be injected directly. Consumers use EvolutionService (the full facade,\n// with both namespaced sub-services and the backward-compatible flat methods)\n// or, in size-sensitive code, the specific sub-service they need.\nexport * from './login.service';\nexport * from './compliance.service';\nexport * from './account.service';\nexport * from './evolution.service';\n","/*\n * Public API Surface of @arsedizioni/ars-utils/evolution.common\n */\nexport * from './messages';\nexport * from './definitions';\nexport * from './interceptors/index';\nexport * from './services/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["catchError"],"mappings":";;;;;;;;AAAO,MAAM,iBAAiB,GAAG;;AAE/B,IAAA,KAAK,EAAE,YAAY;AAEnB;;;;;;;;AAQG;AACH,IAAA,iBAAiB,EAAE,wBAAwB;AAC3C,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,aAAa,EAAE,oBAAoB;;AAGnC,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,eAAe,EAAE,sBAAsB;AACvC,IAAA,gBAAgB,EAAE,uBAAuB;AACzC,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,YAAY,EAAE,mBAAmB;AACjC,IAAA,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