@tolinax/ayoune-interfaces 2026.61.1 → 2026.63.0
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* in the in-app notifications panel and (up to two primary actions) as native
|
|
4
4
|
* Web-Push action buttons on supporting platforms.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Five dispatch modes:
|
|
7
7
|
* - `link` — internal router navigation (`href` relative to the app)
|
|
8
8
|
* - `api` — `fetch()` call to an absolute endpoint, optionally with
|
|
9
9
|
* a confirm prompt; the service-worker can execute this
|
|
@@ -12,10 +12,21 @@
|
|
|
12
12
|
* dialog in the PWA; the text is POSTed to `endpoint`.
|
|
13
13
|
* - `ai-copilot` — opens the Comm-Sidebar Copilot panel with
|
|
14
14
|
* `copilotContext` pre-populated as the first user message.
|
|
15
|
+
* - `sidebar` — opens a specific Comm-Sidebar panel with an optional
|
|
16
|
+
* `itemId` / `threadId` / `messageId` target so the
|
|
17
|
+
* PWA scrolls/loads directly to the target item.
|
|
18
|
+
* Consumed by `SidebarDeeplinkService` in the
|
|
19
|
+
* `@tolinax/ayoune-comm-sidebar` library.
|
|
15
20
|
*/
|
|
16
|
-
export type NotificationActionType = "link" | "api" | "reply" | "ai-copilot";
|
|
21
|
+
export type NotificationActionType = "link" | "api" | "reply" | "ai-copilot" | "sidebar";
|
|
17
22
|
/** Visual weight of the action button. */
|
|
18
23
|
export type NotificationActionStyle = "primary" | "secondary" | "danger";
|
|
24
|
+
/**
|
|
25
|
+
* Target panel for `type: "sidebar"` actions. Mirrors the `SidebarPanel`
|
|
26
|
+
* union in `@tolinax/ayoune-comm-sidebar` — duplicated here so the
|
|
27
|
+
* interfaces package stays free of Angular/runtime deps.
|
|
28
|
+
*/
|
|
29
|
+
export type NotificationSidebarPanel = "copilot" | "notifications" | "phone" | "video" | "chat" | "contacts" | "channels" | "support" | "inbox";
|
|
19
30
|
export interface INotificationAction {
|
|
20
31
|
/** Stable identifier per notification — used as the Web-Push `action` id. */
|
|
21
32
|
id: string;
|
|
@@ -40,6 +51,21 @@ export interface INotificationAction {
|
|
|
40
51
|
* that are rendered against the notification's `data` context before
|
|
41
52
|
* being inserted into the input. */
|
|
42
53
|
copilotContext?: string;
|
|
54
|
+
/** For `type: "sidebar"` — the target panel to open. */
|
|
55
|
+
panel?: NotificationSidebarPanel;
|
|
56
|
+
/** For `type: "sidebar"` — optional target item inside the panel
|
|
57
|
+
* (notification id, ticket id, external-inbox conversation id, etc.). */
|
|
58
|
+
itemId?: string;
|
|
59
|
+
/** For `type: "sidebar"` with `panel: "chat"` or `panel: "channels"` —
|
|
60
|
+
* the thread/channel id to load before scrolling. */
|
|
61
|
+
threadId?: string;
|
|
62
|
+
/** For `type: "sidebar"` with `panel: "chat"` or `panel: "channels"` —
|
|
63
|
+
* optional message id to scroll into view after the thread loads. */
|
|
64
|
+
messageId?: string;
|
|
65
|
+
/** For `type: "sidebar"` with `panel: "phone"` — dialer sub-action
|
|
66
|
+
* (`accept`, `reject`, `dial`). Auto-fires `CommBridgeService.voice.*`
|
|
67
|
+
* on arrival when set. */
|
|
68
|
+
panelAction?: "accept" | "reject" | "dial" | "join";
|
|
43
69
|
/** Should this action close/dismiss the notification after firing? */
|
|
44
70
|
dismissOnComplete?: boolean;
|
|
45
71
|
}
|
|
@@ -38,6 +38,10 @@ interface INotificationAttachmentBase {
|
|
|
38
38
|
* cover, customer branding. Absolute URL (served from media CDN or
|
|
39
39
|
* customer-meta). */
|
|
40
40
|
image?: string;
|
|
41
|
+
/** Per-attachment action buttons. Worker fills from
|
|
42
|
+
* `defaultActionsByAttachmentType` when producer didn't set any — see
|
|
43
|
+
* INotificationAction for the discriminated-union shape. */
|
|
44
|
+
actions?: import("./INotificationAction").INotificationAction[];
|
|
41
45
|
}
|
|
42
46
|
export interface ICalendarEntryPreview extends INotificationAttachmentBase {
|
|
43
47
|
summary?: string;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { IDefaultFields } from "./IDefaultFields";
|
|
2
|
+
/**
|
|
3
|
+
* Per-policy control for the core's `autoEnrichAttachments()` helper.
|
|
4
|
+
* Defaults to `{ consumer: true, self: true }` — opt-out rather than opt-in
|
|
5
|
+
* so every policy that's ever rendered gets rich notifications by default.
|
|
6
|
+
* Set `consumer: false` for policies where the consumer card would leak
|
|
7
|
+
* privacy-sensitive data to recipients who shouldn't see it. Set `self: false`
|
|
8
|
+
* for event types where the entity itself is context, not the main card
|
|
9
|
+
* (e.g. MailLogs, FormSubmissions, Leads — already excluded by SELF_ATTACH_TYPES
|
|
10
|
+
* in core, but an extra per-policy kill-switch for edge cases).
|
|
11
|
+
*/
|
|
12
|
+
export interface INotificationAutoEnrichConfig {
|
|
13
|
+
/** Auto-attach consumer card when entity/data has _consumerID. Default true. */
|
|
14
|
+
consumer?: boolean;
|
|
15
|
+
/** Auto-attach entity itself as main card for SELF_ATTACH_TYPES (Task,
|
|
16
|
+
* Invoice, Offer, Contract, SupplierOrder, CalendarEntry). Default true. */
|
|
17
|
+
self?: boolean;
|
|
18
|
+
}
|
|
2
19
|
export interface INotificationPolicy extends IDefaultFields {
|
|
3
20
|
_customerID: ObjectId;
|
|
4
21
|
name: string;
|
|
@@ -14,4 +31,7 @@ export interface INotificationPolicy extends IDefaultFields {
|
|
|
14
31
|
};
|
|
15
32
|
active?: boolean;
|
|
16
33
|
order?: number;
|
|
34
|
+
/** Opt-out toggles for auto-attach-on-enqueue. See
|
|
35
|
+
* INotificationAutoEnrichConfig. Omit to accept defaults (both true). */
|
|
36
|
+
autoEnrich?: INotificationAutoEnrichConfig;
|
|
17
37
|
}
|