@arsedizioni/ars-utils 22.0.50 → 22.0.51
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.
|
@@ -256,6 +256,16 @@ class SupportService {
|
|
|
256
256
|
initialize(serviceUri, products = SupportProduct.None, productModules = SupportProductModule.None) {
|
|
257
257
|
this.notifications.initialize(serviceUri, products, productModules);
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Updates the unread notifications count by fetching it from the server and setting the `unreadNotifications` signal. Sets `undefined` when the count is zero.
|
|
261
|
+
* @param products - Bitmask of `SupportProduct` values to scope the count (default: current value).
|
|
262
|
+
* @param productModules - Bitmask of `SupportProductModule` values to scope the count (default: current value).
|
|
263
|
+
* @returns void
|
|
264
|
+
*/
|
|
265
|
+
setProducts(products, productModules) {
|
|
266
|
+
this.core.setProducts(products);
|
|
267
|
+
this.core.setProductModules(productModules);
|
|
268
|
+
}
|
|
259
269
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
|
|
260
270
|
static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.1", ngImport: i0, type: SupportService }); }
|
|
261
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arsedizioni-ars-utils-support.common.mjs","sources":["../../../projects/ars-utils/support.common/common/messages.ts","../../../projects/ars-utils/support.common/common/definitions.ts","../../../projects/ars-utils/support.common/common/services/core.service.ts","../../../projects/ars-utils/support.common/common/services/notifications.service.ts","../../../projects/ars-utils/support.common/common/services/support.service.ts","../../../projects/ars-utils/support.common/common/services/index.ts","../../../projects/ars-utils/support.common/public_api.ts","../../../projects/ars-utils/support.common/arsedizioni-ars-utils-support.common.ts"],"sourcesContent":["export const SupportMessages = {\r\n /**\r\n * Messages\r\n */\r\n // Error\r\n ERROR: '§support-error',\r\n\r\n // Login\r\n LOGIN_CHANGED: '§support-login-changed',\r\n LOGIN_COMPLETED: '§support-login-completed',\r\n LOGOUT_COMPLETED: '§support-logout-completed',\r\n LOGIN_PENDING: '§support-login-pending',\r\n LOGIN_FAILED: '§support-login-failed', \r\n LOGOUT: '§support-logout',\r\n\r\n // Notifications\r\n NOTIFICATION_READ: '§support-notification-read',\r\n};\r\n","import { LoginResult } from '@arsedizioni/ars-utils/core';\r\nimport { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';\r\n\r\n\r\n\r\nexport interface SupportUserInfo {\r\n id: number;\r\n groups?: number;\r\n groupNames?: string;\r\n displayName?: string;\r\n dashboard?: string;\r\n sessionId?: string;\r\n email?: string;\r\n customerId?: number;\r\n companyName?: string;\r\n role: number;\r\n scopes?: string[];\r\n sla: number;\r\n isCommercial?: boolean;\r\n isAdministrator: boolean;\r\n isGuest: boolean;\r\n isUser: boolean;\r\n isOperator: boolean;\r\n isTemporary: boolean;\r\n}\r\n\r\n\r\nexport interface SupportLoginResult extends LoginResult<SupportUserInfo> {\r\n}\r\n\r\nexport interface SupportLoginInfo {\r\n context: SupportUserInfo;\r\n oauth?: LoginOAuthType;\r\n remember?: boolean;\r\n}\r\n\r\nexport interface SupportNotificationsSearchParams {\r\n any?: string;\r\n products?: number;\r\n productModules?: number;\r\n first?: number;\r\n count?: number;\r\n}\r\n\r\nexport interface SupportNotificationsSearchResult {\r\n interval?: string;\r\n items?: SupportNotificationInfo[];\r\n total?: number;\r\n}\r\n\r\nexport interface Notification {\r\n id: number;\r\n products: number;\r\n productModules?: number;\r\n publishingDate?: Date;\r\n title: string;\r\n text: string;\r\n state: number;\r\n created: Date;\r\n createdBy: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n productNames?: string;\r\n productModuleNames?: string;\r\n isPublished: boolean;\r\n isInternal: boolean;\r\n stateName: string;\r\n documents?: SupportDocumentInfo[];\r\n isRead: boolean;\r\n totalRead: number;\r\n}\r\n\r\nexport interface SupportDocumentInfo {\r\n id?: number;\r\n origin?: number;\r\n ownerId?: number;\r\n name?: string;\r\n description?: string;\r\n size?: number;\r\n binaryId?: number;\r\n url?: string;\r\n customerId?: number;\r\n created?: Date;\r\n createdBy?: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n isBinary?: boolean;\r\n}\r\n\r\nexport interface SupportNotificationInfo {\r\n id: number;\r\n products?: number;\r\n productModules?: number;\r\n publishingDate?: Date;\r\n title: string;\r\n text: string;\r\n state: number;\r\n created: Date;\r\n createdBy: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n productNames?: string;\r\n productModuleNames?: string;\r\n isPublished: boolean;\r\n isInternal: boolean;\r\n stateName: string;\r\n documents?: SupportDocumentInfo[];\r\n isRead: boolean;\r\n totalRead: number;\r\n isMenuOpen?: boolean;\r\n isOver?: boolean;\r\n\r\n}\r\n\r\nexport interface SupportNotificationsMarkParams {\r\n ids: number[];\r\n unmark: boolean;\r\n}\r\n\r\nexport enum SupportProduct {\r\n None = 0,\r\n Clipper = 1,\r\n Evolution = 1 << 1,\r\n DGInfo = 1 << 2\r\n}\r\n\r\nexport enum SupportProductModule {\r\n None = 0,\r\n EvoFormazione = 1,\r\n EvoDPI = 1 << 1,\r\n EvoSorveglianzaSanitaria = 1 << 2,\r\n EvoRegistroEScadenzario = 1 << 3,\r\n EvoAttrezzatureEImpianti = 1 << 4,\r\n EvoMonitoraggio = 1 << 5,\r\n EvoBollettino = 1 << 6,\r\n DgiADR = 1 << 7,\r\n DgiRID = 1 << 8,\r\n DgiIMDG = 1 << 9,\r\n DgiCLP = 1 << 10,\r\n}\r\n","import { Service, WritableSignal, signal } from '@angular/core';\nimport { SupportProduct, SupportProductModule } from '../definitions';\n\n/**\n * @internal\n * Private state container for the Support module.\n *\n * Intentionally NOT exported from the barrel: it must never be injected by\n * application code. Its state is re-published through {@link SupportService};\n * {@link NotificationsService} injects it to read the config and update the\n * unread-count signal.\n */\n@Service()\nexport class CoreService {\n\n private _serviceUri: string | undefined;\n /**\n * Gets the base URI of the Support 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 Support 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 _products: SupportProduct = SupportProduct.None;\n /**\n * Gets the products bitmask used to scope notifications.\n * @returns The active {@link SupportProduct} bitmask.\n */\n get products(): SupportProduct {\n return this._products;\n }\n /**\n * Sets the products bitmask used to scope notifications.\n * @param products - The products bitmask.\n * @returns void\n */\n setProducts(products: SupportProduct): void {\n this._products = products;\n }\n\n private _productModules: SupportProductModule = SupportProductModule.None;\n /**\n * Gets the product-modules bitmask used to scope notifications.\n * @returns The active {@link SupportProductModule} bitmask.\n */\n get productModules(): SupportProductModule {\n return this._productModules;\n }\n /**\n * Sets the product-modules bitmask used to scope notifications.\n * @param productModules - The product-modules bitmask.\n * @returns void\n */\n setProductModules(productModules: SupportProductModule): void {\n this._productModules = productModules;\n }\n\n /** Number of unread notifications, or `undefined` when there are none. */\n public readonly unreadNotifications: WritableSignal<number | undefined> = signal<number | undefined>(undefined);\n}\n","import { HttpClient } from '@angular/common/http';\nimport { DestroyRef, Service, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ApiResult, BroadcastMessageInfo, BroadcastService } from '@arsedizioni/ars-utils/core';\nimport { SupportMessages } from '../messages';\nimport {\n SupportNotificationInfo, SupportNotificationsMarkParams, SupportNotificationsSearchParams,\n SupportNotificationsSearchResult, SupportProduct, SupportProductModule\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * Notifications service for the Support module: the unread-count tracking,\n * the notification queries and document download, plus the session bootstrap\n * (the `NOTIFICATION_READ` broadcast subscription). State lives in the\n * private {@link CoreService}.\n */\n@Service()\nexport class NotificationsService {\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 * Initialises the service with the back-end URI and the products/modules it should track.\n * Must be called once during application bootstrap before any other method.\n * @param serviceUri - Base URL of the support service.\n * @param products - Bitmask of `SupportProduct` values to scope notifications (default: `None`).\n * @param productModules - Bitmask of `SupportProductModule` values to scope notifications (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n products: SupportProduct = SupportProduct.None,\n productModules: SupportProductModule = SupportProductModule.None\n ): void {\n this.core.setServiceUri(serviceUri);\n this.core.setProducts(products);\n this.core.setProductModules(productModules);\n\n if (!this.broadcastInitialized) {\n this.broadcastInitialized = true;\n this.broadcastService\n .getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((message: BroadcastMessageInfo) => {\n if (message.id === SupportMessages.NOTIFICATION_READ) {\n this.countUnreadNotifications();\n }\n });\n }\n }\n\n /**\n * Fetches the count of unread notifications from the server and updates\n * the `unreadNotifications` signal. Sets `undefined` when the count is zero.\n * @returns void\n */\n countUnreadNotifications(): void {\n this.httpClient\n .get<ApiResult<number>>(\n this.core.serviceUri +\n '/notifications/unread/?products=' + (this.core.products ?? 0) +\n '&modules=' + (this.core.productModules ?? 0)\n )\n .subscribe((r: ApiResult<number>) => {\n if (r.success) {\n this.core.unreadNotifications.set(r.value > 0 ? r.value : undefined);\n }\n });\n }\n\n /**\n * Queries the notification list using the supplied filter parameters.\n * The `products` and `productModules` fields are automatically populated\n * from the service configuration before the request is sent.\n * @param params - Search parameters for the notification query.\n * @returns An observable that emits `ApiResult<SupportNotificationsSearchResult>`.\n */\n queryNotifications(params: SupportNotificationsSearchParams) {\n params.products = this.core.products ?? 0;\n params.productModules = this.core.productModules ?? 0;\n return this.httpClient.post<ApiResult<SupportNotificationsSearchResult>>(\n this.core.serviceUri + '/notifications',\n params\n );\n }\n\n /**\n * Retrieves a single notification by id.\n * @param id - The notification id.\n * @returns An observable that emits `ApiResult<SupportNotificationInfo>`.\n */\n getNotification(id: number) {\n return this.httpClient.get<ApiResult<SupportNotificationInfo>>(\n this.core.serviceUri + '/notifications/' + id\n );\n }\n\n /**\n * Marks one or more notifications as read.\n * @param params - Parameters identifying the notifications to mark.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n markNotifications(params: SupportNotificationsMarkParams) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/notifications/mark',\n params\n );\n }\n\n /**\n * Downloads a notification attachment as a binary blob.\n * @param documentId - The id of the document to download.\n * @returns An observable that emits the binary blob response.\n */\n downloadNotificationDocument(documentId: number) {\n return this.httpClient.get(\n this.core.serviceUri + '/documents/download/' + documentId,\n { responseType: 'blob' }\n );\n }\n}\n","import { Service, Signal, inject } from '@angular/core';\nimport { SupportProduct, SupportProductModule } from '../definitions';\nimport { CoreService } from './core.service';\nimport { NotificationsService } from './notifications.service';\n\n/**\n * Public entry point for the Support module.\n *\n * The private {@link CoreService} is never exposed; its state is re-published\n * here. All operations are reached through the namespaced sub-service:\n * - `support.notifications` — unread count, queries, mark, document download\n *\n * The facade itself exposes ONLY the re-published core state plus `initialize`\n * — it intentionally does NOT flatten the sub-service methods.\n */\n@Service()\nexport class SupportService {\n\n /** Private: never exposed to consumers. */\n private readonly core = inject(CoreService);\n\n /** Notifications sub-service (unread count, queries, mark, downloads). */\n readonly notifications = inject(NotificationsService);\n\n // ── Re-published core state ─────────────────────────────────────────────────\n\n /**\n * Gets the base URI of the Support 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 products bitmask used to scope notifications.\n * @returns The active {@link SupportProduct} bitmask.\n */\n get products(): SupportProduct { return this.core.products; }\n\n /**\n * Gets the product-modules bitmask used to scope notifications.\n * @returns The active {@link SupportProductModule} bitmask.\n */\n get productModules(): SupportProductModule { return this.core.productModules; }\n\n /** Number of unread notifications, or `undefined` when there are none. */\n get unreadNotifications(): Signal<number | undefined> { return this.core.unreadNotifications; }\n\n // ── Lifecycle (the only flattened sub-service method) ───────────────────────\n\n /**\n * Initialises the service with the back-end URI and the products/modules to track.\n * @param serviceUri - Base URL of the support service.\n * @param products - Bitmask of `SupportProduct` values (default: `None`).\n * @param productModules - Bitmask of `SupportProductModule` values (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n products: SupportProduct = SupportProduct.None,\n productModules: SupportProductModule = SupportProductModule.None\n ): void {\n this.notifications.initialize(serviceUri, products, productModules);\n }\n}\n","// Public barrel for the Support services.\n//\n// CoreService is intentionally NOT exported: it is private/internal and must\n// never be injected directly. Consumers use SupportService (the facade, with\n// the namespaced `notifications` sub-service and the re-published core state)\n// or the NotificationsService directly in size-sensitive code.\nexport * from './notifications.service';\nexport * from './support.service';\n","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './common/messages';\r\nexport * from './common/definitions';\r\nexport * from './common/services/index';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAO,MAAM,eAAe,GAAG;AAC7B;;AAEG;;AAEH,IAAA,KAAK,EAAE,gBAAgB;;AAGvB,IAAA,aAAa,EAAE,wBAAwB;AACvC,IAAA,eAAe,EAAE,0BAA0B;AAC3C,IAAA,gBAAgB,EAAE,2BAA2B;AAC7C,IAAA,aAAa,EAAE,wBAAwB;AACvC,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,MAAM,EAAE,iBAAiB;;AAGzB,IAAA,iBAAiB,EAAE,4BAA4B;;;ICuGrC;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACX,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,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ImB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;;AAGlC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyCtD,IAAA;;AArCC;;;AAGG;IACH,IAAI,UAAU,GAAA,EAAyB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAEpE;;;AAGG;IACH,IAAI,QAAQ,GAAA,EAAqB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAE5D;;;AAGG;IACH,IAAI,cAAc,GAAA,EAA2B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;;IAG9E,IAAI,mBAAmB,GAAA,EAAiC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;;AAI9F;;;;;;AAMG;IACH,UAAU,CACR,UAAkB,EAClB,QAAA,GAA2B,cAAc,CAAC,IAAI,EAC9C,cAAA,GAAuC,oBAAoB,CAAC,IAAI,EAAA;QAEhE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC;IACrE;8GA9CW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,OAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACfD;AACA;AACA;AACA;AACA;AACA;;ACLA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-support.common.mjs","sources":["../../../projects/ars-utils/support.common/common/messages.ts","../../../projects/ars-utils/support.common/common/definitions.ts","../../../projects/ars-utils/support.common/common/services/core.service.ts","../../../projects/ars-utils/support.common/common/services/notifications.service.ts","../../../projects/ars-utils/support.common/common/services/support.service.ts","../../../projects/ars-utils/support.common/common/services/index.ts","../../../projects/ars-utils/support.common/public_api.ts","../../../projects/ars-utils/support.common/arsedizioni-ars-utils-support.common.ts"],"sourcesContent":["export const SupportMessages = {\r\n /**\r\n * Messages\r\n */\r\n // Error\r\n ERROR: '§support-error',\r\n\r\n // Login\r\n LOGIN_CHANGED: '§support-login-changed',\r\n LOGIN_COMPLETED: '§support-login-completed',\r\n LOGOUT_COMPLETED: '§support-logout-completed',\r\n LOGIN_PENDING: '§support-login-pending',\r\n LOGIN_FAILED: '§support-login-failed', \r\n LOGOUT: '§support-logout',\r\n\r\n // Notifications\r\n NOTIFICATION_READ: '§support-notification-read',\r\n};\r\n","import { LoginResult } from '@arsedizioni/ars-utils/core';\r\nimport { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';\r\n\r\n\r\n\r\nexport interface SupportUserInfo {\r\n id: number;\r\n groups?: number;\r\n groupNames?: string;\r\n displayName?: string;\r\n dashboard?: string;\r\n sessionId?: string;\r\n email?: string;\r\n customerId?: number;\r\n companyName?: string;\r\n role: number;\r\n scopes?: string[];\r\n sla: number;\r\n isCommercial?: boolean;\r\n isAdministrator: boolean;\r\n isGuest: boolean;\r\n isUser: boolean;\r\n isOperator: boolean;\r\n isTemporary: boolean;\r\n}\r\n\r\n\r\nexport interface SupportLoginResult extends LoginResult<SupportUserInfo> {\r\n}\r\n\r\nexport interface SupportLoginInfo {\r\n context: SupportUserInfo;\r\n oauth?: LoginOAuthType;\r\n remember?: boolean;\r\n}\r\n\r\nexport interface SupportNotificationsSearchParams {\r\n any?: string;\r\n products?: number;\r\n productModules?: number;\r\n first?: number;\r\n count?: number;\r\n}\r\n\r\nexport interface SupportNotificationsSearchResult {\r\n interval?: string;\r\n items?: SupportNotificationInfo[];\r\n total?: number;\r\n}\r\n\r\nexport interface Notification {\r\n id: number;\r\n products: number;\r\n productModules?: number;\r\n publishingDate?: Date;\r\n title: string;\r\n text: string;\r\n state: number;\r\n created: Date;\r\n createdBy: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n productNames?: string;\r\n productModuleNames?: string;\r\n isPublished: boolean;\r\n isInternal: boolean;\r\n stateName: string;\r\n documents?: SupportDocumentInfo[];\r\n isRead: boolean;\r\n totalRead: number;\r\n}\r\n\r\nexport interface SupportDocumentInfo {\r\n id?: number;\r\n origin?: number;\r\n ownerId?: number;\r\n name?: string;\r\n description?: string;\r\n size?: number;\r\n binaryId?: number;\r\n url?: string;\r\n customerId?: number;\r\n created?: Date;\r\n createdBy?: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n isBinary?: boolean;\r\n}\r\n\r\nexport interface SupportNotificationInfo {\r\n id: number;\r\n products?: number;\r\n productModules?: number;\r\n publishingDate?: Date;\r\n title: string;\r\n text: string;\r\n state: number;\r\n created: Date;\r\n createdBy: string;\r\n lastUpdated?: Date;\r\n lastUpdatedBy?: string;\r\n productNames?: string;\r\n productModuleNames?: string;\r\n isPublished: boolean;\r\n isInternal: boolean;\r\n stateName: string;\r\n documents?: SupportDocumentInfo[];\r\n isRead: boolean;\r\n totalRead: number;\r\n isMenuOpen?: boolean;\r\n isOver?: boolean;\r\n\r\n}\r\n\r\nexport interface SupportNotificationsMarkParams {\r\n ids: number[];\r\n unmark: boolean;\r\n}\r\n\r\nexport enum SupportProduct {\r\n None = 0,\r\n Clipper = 1,\r\n Evolution = 1 << 1,\r\n DGInfo = 1 << 2\r\n}\r\n\r\nexport enum SupportProductModule {\r\n None = 0,\r\n EvoFormazione = 1,\r\n EvoDPI = 1 << 1,\r\n EvoSorveglianzaSanitaria = 1 << 2,\r\n EvoRegistroEScadenzario = 1 << 3,\r\n EvoAttrezzatureEImpianti = 1 << 4,\r\n EvoMonitoraggio = 1 << 5,\r\n EvoBollettino = 1 << 6,\r\n DgiADR = 1 << 7,\r\n DgiRID = 1 << 8,\r\n DgiIMDG = 1 << 9,\r\n DgiCLP = 1 << 10,\r\n}\r\n","import { Service, WritableSignal, signal } from '@angular/core';\nimport { SupportProduct, SupportProductModule } from '../definitions';\n\n/**\n * @internal\n * Private state container for the Support module.\n *\n * Intentionally NOT exported from the barrel: it must never be injected by\n * application code. Its state is re-published through {@link SupportService};\n * {@link NotificationsService} injects it to read the config and update the\n * unread-count signal.\n */\n@Service()\nexport class CoreService {\n\n private _serviceUri: string | undefined;\n /**\n * Gets the base URI of the Support 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 Support 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 _products: SupportProduct = SupportProduct.None;\n /**\n * Gets the products bitmask used to scope notifications.\n * @returns The active {@link SupportProduct} bitmask.\n */\n get products(): SupportProduct {\n return this._products;\n }\n /**\n * Sets the products bitmask used to scope notifications.\n * @param products - The products bitmask.\n * @returns void\n */\n setProducts(products: SupportProduct): void {\n this._products = products;\n }\n\n private _productModules: SupportProductModule = SupportProductModule.None;\n /**\n * Gets the product-modules bitmask used to scope notifications.\n * @returns The active {@link SupportProductModule} bitmask.\n */\n get productModules(): SupportProductModule {\n return this._productModules;\n }\n /**\n * Sets the product-modules bitmask used to scope notifications.\n * @param productModules - The product-modules bitmask.\n * @returns void\n */\n setProductModules(productModules: SupportProductModule): void {\n this._productModules = productModules;\n }\n\n /** Number of unread notifications, or `undefined` when there are none. */\n public readonly unreadNotifications: WritableSignal<number | undefined> = signal<number | undefined>(undefined);\n}\n","import { HttpClient } from '@angular/common/http';\nimport { DestroyRef, Service, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ApiResult, BroadcastMessageInfo, BroadcastService } from '@arsedizioni/ars-utils/core';\nimport { SupportMessages } from '../messages';\nimport {\n SupportNotificationInfo, SupportNotificationsMarkParams, SupportNotificationsSearchParams,\n SupportNotificationsSearchResult, SupportProduct, SupportProductModule\n} from '../definitions';\nimport { CoreService } from './core.service';\n\n/**\n * Notifications service for the Support module: the unread-count tracking,\n * the notification queries and document download, plus the session bootstrap\n * (the `NOTIFICATION_READ` broadcast subscription). State lives in the\n * private {@link CoreService}.\n */\n@Service()\nexport class NotificationsService {\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 * Initialises the service with the back-end URI and the products/modules it should track.\n * Must be called once during application bootstrap before any other method.\n * @param serviceUri - Base URL of the support service.\n * @param products - Bitmask of `SupportProduct` values to scope notifications (default: `None`).\n * @param productModules - Bitmask of `SupportProductModule` values to scope notifications (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n products: SupportProduct = SupportProduct.None,\n productModules: SupportProductModule = SupportProductModule.None\n ): void {\n this.core.setServiceUri(serviceUri);\n this.core.setProducts(products);\n this.core.setProductModules(productModules);\n\n if (!this.broadcastInitialized) {\n this.broadcastInitialized = true;\n this.broadcastService\n .getMessage()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((message: BroadcastMessageInfo) => {\n if (message.id === SupportMessages.NOTIFICATION_READ) {\n this.countUnreadNotifications();\n }\n });\n }\n }\n\n /**\n * Fetches the count of unread notifications from the server and updates\n * the `unreadNotifications` signal. Sets `undefined` when the count is zero.\n * @returns void\n */\n countUnreadNotifications(): void {\n this.httpClient\n .get<ApiResult<number>>(\n this.core.serviceUri +\n '/notifications/unread/?products=' + (this.core.products ?? 0) +\n '&modules=' + (this.core.productModules ?? 0)\n )\n .subscribe((r: ApiResult<number>) => {\n if (r.success) {\n this.core.unreadNotifications.set(r.value > 0 ? r.value : undefined);\n }\n });\n }\n\n /**\n * Queries the notification list using the supplied filter parameters.\n * The `products` and `productModules` fields are automatically populated\n * from the service configuration before the request is sent.\n * @param params - Search parameters for the notification query.\n * @returns An observable that emits `ApiResult<SupportNotificationsSearchResult>`.\n */\n queryNotifications(params: SupportNotificationsSearchParams) {\n params.products = this.core.products ?? 0;\n params.productModules = this.core.productModules ?? 0;\n return this.httpClient.post<ApiResult<SupportNotificationsSearchResult>>(\n this.core.serviceUri + '/notifications',\n params\n );\n }\n\n /**\n * Retrieves a single notification by id.\n * @param id - The notification id.\n * @returns An observable that emits `ApiResult<SupportNotificationInfo>`.\n */\n getNotification(id: number) {\n return this.httpClient.get<ApiResult<SupportNotificationInfo>>(\n this.core.serviceUri + '/notifications/' + id\n );\n }\n\n /**\n * Marks one or more notifications as read.\n * @param params - Parameters identifying the notifications to mark.\n * @returns An observable that emits `ApiResult<boolean>`.\n */\n markNotifications(params: SupportNotificationsMarkParams) {\n return this.httpClient.post<ApiResult<boolean>>(\n this.core.serviceUri + '/notifications/mark',\n params\n );\n }\n\n /**\n * Downloads a notification attachment as a binary blob.\n * @param documentId - The id of the document to download.\n * @returns An observable that emits the binary blob response.\n */\n downloadNotificationDocument(documentId: number) {\n return this.httpClient.get(\n this.core.serviceUri + '/documents/download/' + documentId,\n { responseType: 'blob' }\n );\n }\n}\n","import { Service, Signal, inject } from '@angular/core';\nimport { SupportProduct, SupportProductModule } from '../definitions';\nimport { CoreService } from './core.service';\nimport { NotificationsService } from './notifications.service';\n\n/**\n * Public entry point for the Support module.\n *\n * The private {@link CoreService} is never exposed; its state is re-published\n * here. All operations are reached through the namespaced sub-service:\n * - `support.notifications` — unread count, queries, mark, document download\n *\n * The facade itself exposes ONLY the re-published core state plus `initialize`\n * — it intentionally does NOT flatten the sub-service methods.\n */\n@Service()\nexport class SupportService {\n\n /** Private: never exposed to consumers. */\n private readonly core = inject(CoreService);\n\n /** Notifications sub-service (unread count, queries, mark, downloads). */\n readonly notifications = inject(NotificationsService);\n\n // ── Re-published core state ─────────────────────────────────────────────────\n\n /**\n * Gets the base URI of the Support 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 products bitmask used to scope notifications.\n * @returns The active {@link SupportProduct} bitmask.\n */\n get products(): SupportProduct { return this.core.products; }\n\n /**\n * Gets the product-modules bitmask used to scope notifications.\n * @returns The active {@link SupportProductModule} bitmask.\n */\n get productModules(): SupportProductModule { return this.core.productModules; }\n\n /** Number of unread notifications, or `undefined` when there are none. */\n get unreadNotifications(): Signal<number | undefined> { return this.core.unreadNotifications; }\n\n // ── Lifecycle (the only flattened sub-service method) ───────────────────────\n\n /**\n * Initialises the service with the back-end URI and the products/modules to track.\n * @param serviceUri - Base URL of the support service.\n * @param products - Bitmask of `SupportProduct` values (default: `None`).\n * @param productModules - Bitmask of `SupportProductModule` values (default: `None`).\n * @returns void\n */\n initialize(\n serviceUri: string,\n products: SupportProduct = SupportProduct.None,\n productModules: SupportProductModule = SupportProductModule.None\n ): void {\n this.notifications.initialize(serviceUri, products, productModules);\n }\n\n /**\n * Updates the unread notifications count by fetching it from the server and setting the `unreadNotifications` signal. Sets `undefined` when the count is zero.\n * @param products - Bitmask of `SupportProduct` values to scope the count (default: current value).\n * @param productModules - Bitmask of `SupportProductModule` values to scope the count (default: current value).\n * @returns void\n */\n setProducts(products: SupportProduct, productModules: SupportProductModule): void {\n this.core.setProducts(products);\n this.core.setProductModules(productModules);\n }\n}\n","// Public barrel for the Support services.\n//\n// CoreService is intentionally NOT exported: it is private/internal and must\n// never be injected directly. Consumers use SupportService (the facade, with\n// the namespaced `notifications` sub-service and the re-published core state)\n// or the NotificationsService directly in size-sensitive code.\nexport * from './notifications.service';\nexport * from './support.service';\n","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './common/messages';\r\nexport * from './common/definitions';\r\nexport * from './common/services/index';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAO,MAAM,eAAe,GAAG;AAC7B;;AAEG;;AAEH,IAAA,KAAK,EAAE,gBAAgB;;AAGvB,IAAA,aAAa,EAAE,wBAAwB;AACvC,IAAA,eAAe,EAAE,0BAA0B;AAC3C,IAAA,gBAAgB,EAAE,2BAA2B;AAC7C,IAAA,aAAa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,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC;IAC7C;8GAzDW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,OAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACfD;AACA;AACA;AACA;AACA;AACA;;ACLA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -239,6 +239,13 @@ declare class SupportService {
|
|
|
239
239
|
* @returns void
|
|
240
240
|
*/
|
|
241
241
|
initialize(serviceUri: string, products?: SupportProduct, productModules?: SupportProductModule): void;
|
|
242
|
+
/**
|
|
243
|
+
* Updates the unread notifications count by fetching it from the server and setting the `unreadNotifications` signal. Sets `undefined` when the count is zero.
|
|
244
|
+
* @param products - Bitmask of `SupportProduct` values to scope the count (default: current value).
|
|
245
|
+
* @param productModules - Bitmask of `SupportProductModule` values to scope the count (default: current value).
|
|
246
|
+
* @returns void
|
|
247
|
+
*/
|
|
248
|
+
setProducts(products: SupportProduct, productModules: SupportProductModule): void;
|
|
242
249
|
static ɵfac: i0.ɵɵFactoryDeclaration<SupportService, never>;
|
|
243
250
|
static ɵprov: i0.ɵɵInjectableDeclaration<SupportService>;
|
|
244
251
|
}
|