@acorex-platform/module-communication-management-client 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/fesm2022/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs +2375 -0
  2. package/fesm2022/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs +69 -0
  4. package/fesm2022/acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs +285 -0
  6. package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs +514 -0
  8. package/fesm2022/acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs +85 -0
  10. package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs +111 -0
  12. package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs +155 -0
  14. package/fesm2022/acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-communication-management-client-contracts.mjs +278 -0
  16. package/fesm2022/acorex-platform-module-communication-management-client-contracts.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-communication-management-client.mjs +2 -0
  18. package/fesm2022/acorex-platform-module-communication-management-client.mjs.map +1 -0
  19. package/package.json +28 -0
  20. package/types/acorex-platform-module-communication-management-client-contracts.d.ts +330 -0
  21. package/types/acorex-platform-module-communication-management-client.d.ts +360 -0
@@ -0,0 +1,330 @@
1
+ type CommunicationAggregateStatus = 'Pending' | 'Processing' | 'Completed' | 'Failed' | 'Cancelled';
2
+ type CommunicationDeliveryStatus = 'Pending' | 'Queued' | 'Processing' | 'Accepted' | 'Sent' | 'Delivered' | 'Failed' | 'RetryScheduled' | 'Cancelled' | 'DeadLettered';
3
+ interface CommunicationMessage {
4
+ subject: string;
5
+ body: string;
6
+ }
7
+ interface CommunicationNotificationAction {
8
+ title: string;
9
+ command: {
10
+ name: string;
11
+ options?: Record<string, unknown>;
12
+ };
13
+ }
14
+ type CommunicationPriority = 'Notice' | 'Danger' | 'Warning';
15
+ interface AXMCommunicationModel {
16
+ id: string;
17
+ title: string;
18
+ message?: CommunicationMessage;
19
+ definitionKey?: string;
20
+ correlationId?: string;
21
+ idempotencyKey?: string;
22
+ actions?: CommunicationNotificationAction[];
23
+ status: CommunicationAggregateStatus;
24
+ primaryChannel?: string;
25
+ recipientSummary?: string;
26
+ priority?: CommunicationPriority;
27
+ }
28
+ interface AXMCommunicationDeliveryModel {
29
+ id: string;
30
+ communicationId: string;
31
+ channel: string;
32
+ providerKey?: string;
33
+ status: CommunicationDeliveryStatus;
34
+ recipientUserId?: string;
35
+ recipientAddress?: string;
36
+ /** Provider-assigned message id (SMTP Message-ID, Telegram message_id, WhatsApp wamid, etc.). */
37
+ providerMessageId?: string | null;
38
+ sentAt?: Date | null;
39
+ deliveredAt?: Date | null;
40
+ seenAt?: Date | null;
41
+ readAt?: Date | null;
42
+ repliedAt?: Date | null;
43
+ isPinned?: boolean;
44
+ archivedAt?: Date | null;
45
+ timelineSummary?: string;
46
+ }
47
+ interface CommunicationSendInput {
48
+ title: string;
49
+ message: CommunicationMessage;
50
+ channel: string;
51
+ recipientUserId?: string;
52
+ recipientAddress?: string;
53
+ /** Human-readable recipient label (e.g. employee full name) for summaries and job titles. */
54
+ recipientName?: string;
55
+ /**
56
+ * Tenant scope for system/unauthenticated sends (e.g. public password-reset).
57
+ * When omitted, channel adapters use the authenticated session tenant.
58
+ */
59
+ tenantId?: string;
60
+ definitionKey?: string;
61
+ correlationId?: string;
62
+ idempotencyKey?: string;
63
+ priority?: CommunicationPriority;
64
+ actions?: CommunicationNotificationAction[];
65
+ }
66
+ interface CommunicationSendResult {
67
+ communicationId: string;
68
+ deliveryId: string;
69
+ status: CommunicationDeliveryStatus;
70
+ }
71
+ interface CommunicationDeliverPayload {
72
+ deliveryId: string;
73
+ communicationId: string;
74
+ tenantId: string;
75
+ }
76
+ interface CommunicationDeliverResult {
77
+ deliveryId: string;
78
+ status: CommunicationDeliveryStatus;
79
+ messageId?: string;
80
+ }
81
+ interface CommunicationSmtpTestInput {
82
+ recipientAddress: string;
83
+ }
84
+ interface CommunicationSmtpTestResult {
85
+ recipientAddress: string;
86
+ messageId?: string;
87
+ }
88
+
89
+ interface CommunicationChannelCapabilities {
90
+ deliveryConfirmation: boolean;
91
+ deliveryReceipt: boolean;
92
+ seenTracking: boolean;
93
+ readReceipt: boolean;
94
+ replyTracking: boolean;
95
+ webhookCallbacks: boolean;
96
+ }
97
+ interface CommunicationChannelDefinition {
98
+ key: string;
99
+ title: string;
100
+ builtIn: boolean;
101
+ capabilities: CommunicationChannelCapabilities;
102
+ }
103
+ declare const COMMUNICATION_BUILTIN_CHANNEL_KEYS: readonly ["in-app", "email-smtp"];
104
+ type CommunicationBuiltinChannelKey = (typeof COMMUNICATION_BUILTIN_CHANNEL_KEYS)[number];
105
+ declare const BUILTIN_CHANNEL_DEFINITIONS: readonly CommunicationChannelDefinition[];
106
+
107
+ interface CommunicationChannelAdapterContext {
108
+ communicationId: string;
109
+ deliveryId: string;
110
+ input: CommunicationSendInput;
111
+ channel: CommunicationChannelDefinition;
112
+ now: Date;
113
+ }
114
+ interface CommunicationChannelDeliverResult {
115
+ status: CommunicationDeliveryStatus;
116
+ sentAt?: Date | null;
117
+ deliveredAt?: Date | null;
118
+ timelineLines: string[];
119
+ communicationStatus: CommunicationAggregateStatus;
120
+ }
121
+ interface CommunicationChannelAdapter {
122
+ readonly channelKey: string;
123
+ deliver(context: CommunicationChannelAdapterContext): Promise<CommunicationChannelDeliverResult>;
124
+ }
125
+
126
+ declare const COMMUNICATION_CHANNEL_ADAPTER: unique symbol;
127
+ declare const COMMUNICATION_DELIVERY_EXECUTOR: unique symbol;
128
+ interface CommunicationDeliveryExecutor {
129
+ readonly channelKey: string;
130
+ execute(payload: CommunicationDeliverPayload): Promise<CommunicationDeliverResult>;
131
+ }
132
+ declare const COMMUNICATION_CHANNEL_SEND_VALIDATOR: unique symbol;
133
+ interface CommunicationChannelSendValidator {
134
+ readonly channelKey: string;
135
+ validate(input: CommunicationSendInput): void;
136
+ }
137
+
138
+ declare function listCommunicationChannels(): CommunicationChannelDefinition[];
139
+ declare function getCommunicationChannel(key: string): CommunicationChannelDefinition | undefined;
140
+ declare function registerCommunicationChannel(definition: CommunicationChannelDefinition): void;
141
+ declare function isBuiltInCommunicationChannel(key: string): boolean;
142
+
143
+ declare const COMMUNICATION_DEBUG_REDIRECT_RESOLVER: unique symbol;
144
+ interface CommunicationDebugRedirectResolver {
145
+ readonly channelKey: string;
146
+ resolveOverride(tenantId: string): Promise<string | null>;
147
+ }
148
+ interface CommunicationDebugRedirectResult {
149
+ effectiveRecipient: string | null;
150
+ redirected: boolean;
151
+ skipped: boolean;
152
+ timelineNote?: string;
153
+ }
154
+
155
+ declare const COMMUNICATION_MANAGEMENT_EMAIL_SHOW_DIALOG_COMMAND_KEY: "CommunicationManagement:Email:ShowDialog";
156
+ declare const COMMUNICATION_MANAGEMENT_EMAIL_SEND_COMMAND_KEY: "CommunicationManagement:Email:Send";
157
+
158
+ /** Opens the send-email layout dialog (optional text template pre-render). */
159
+ interface CommunicationManagementEmailShowDialogInput {
160
+ dialogTitle?: string;
161
+ to?: string;
162
+ cc?: string;
163
+ bcc?: string;
164
+ subject?: string;
165
+ body?: string;
166
+ textTemplateId?: string;
167
+ merge?: Record<string, string>;
168
+ }
169
+ interface CommunicationManagementEmailSendInput {
170
+ to: string;
171
+ cc?: string;
172
+ bcc?: string;
173
+ subject: string;
174
+ body: string;
175
+ textTemplateId?: string;
176
+ }
177
+ interface CommunicationManagementEmailSendResult {
178
+ communicationId: string;
179
+ deliveryId: string;
180
+ }
181
+
182
+ declare const AXMCommunicationManagementCommandKeys: {
183
+ readonly Send: "CommunicationManagement:Communication:Send";
184
+ readonly TestSmtp: "CommunicationManagement:Communication:TestSmtp";
185
+ readonly EmailShowDialog: "CommunicationManagement:Email:ShowDialog";
186
+ readonly EmailSend: "CommunicationManagement:Email:Send";
187
+ readonly ShowSentMessage: "CommunicationManagement:Communication:ShowSentMessage";
188
+ };
189
+
190
+ declare function resolveCommunicationMessage(communication: Record<string, unknown>, fallbackTitle?: string): CommunicationMessage;
191
+
192
+ type CommunicationRecipientLabelInput = Pick<CommunicationSendInput, 'recipientName' | 'recipientAddress' | 'recipientUserId'>;
193
+ declare function resolveCommunicationRecipientLabel(input: CommunicationRecipientLabelInput): string;
194
+ declare function formatCommunicationDeliveryJobTitle(channelLabel: string, input: CommunicationRecipientLabelInput): string;
195
+
196
+ interface CommunicationDeliveryEngagementRequest {
197
+ deliveryIds: string[];
198
+ }
199
+ interface CommunicationDeliveryEngagementResult {
200
+ updatedIds: string[];
201
+ }
202
+ interface CommunicationDeliveryMutationResult {
203
+ affectedIds: string[];
204
+ }
205
+
206
+ declare const AXMCommunicationManagementMenuKeys: {
207
+ readonly Root: "CommunicationManagement:Menu:Root";
208
+ readonly Communications: "CommunicationManagement:Menu:Communications";
209
+ };
210
+
211
+ /**
212
+ * Collaboration capabilities used by this module.
213
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
214
+ */
215
+ declare const AXPCollaborationPermissionKeys: {
216
+ readonly Access: "Collaboration:Permission:Access";
217
+ readonly MaintainConversations: "Collaboration:Permission:MaintainConversations";
218
+ readonly MaintainMeetings: "Collaboration:Permission:MaintainMeetings";
219
+ readonly MaintainCalendars: "Collaboration:Permission:MaintainCalendars";
220
+ readonly MaintainCommunications: "Collaboration:Permission:MaintainCommunications";
221
+ readonly MaintainReservations: "Collaboration:Permission:MaintainReservations";
222
+ readonly MaintainHelpDesk: "Collaboration:Permission:MaintainHelpDesk";
223
+ readonly Setup: "Collaboration:Permission:Setup";
224
+ };
225
+ /**
226
+ * @deprecated Prefer {@link AXPCollaborationPermissionKeys}.
227
+ * Legacy flat shape kept so existing imports compile during migration.
228
+ */
229
+ declare const AXMCommunicationManagementPermissionKeys: {
230
+ readonly Management: "Collaboration:Permission:MaintainCommunications";
231
+ readonly Send: "Collaboration:Permission:MaintainCommunications";
232
+ readonly Email: {
233
+ readonly ShowDialog: "Collaboration:Permission:MaintainCommunications";
234
+ readonly Send: "Collaboration:Permission:MaintainCommunications";
235
+ };
236
+ };
237
+
238
+ declare const RootConfig: {
239
+ readonly config: {
240
+ i18n: string;
241
+ };
242
+ readonly module: {
243
+ readonly name: "CommunicationManagement";
244
+ readonly title: "@communication-management:module.title";
245
+ readonly icon: "fa-light fa-paper-plane";
246
+ };
247
+ readonly entities: {
248
+ readonly communication: {
249
+ readonly name: "Communications";
250
+ readonly title: "@communication-management:entities.communication.title";
251
+ readonly titlePlural: "@communication-management:entities.communication.plural";
252
+ readonly icon: "fa-light fa-envelope";
253
+ };
254
+ readonly communicationDelivery: {
255
+ readonly name: "CommunicationDeliveries";
256
+ readonly title: "@communication-management:entities.communication-delivery.title";
257
+ readonly titlePlural: "@communication-management:entities.communication-delivery.plural";
258
+ readonly icon: "fa-light fa-truck-fast";
259
+ };
260
+ };
261
+ readonly widgets: {
262
+ readonly myInAppInboxDashboard: string;
263
+ };
264
+ readonly queries: {
265
+ readonly dashboard: {
266
+ readonly deliveryStatusDonut: "CommunicationManagement:Dashboard:DeliveryStatusDonut";
267
+ };
268
+ };
269
+ };
270
+ declare const COMMUNICATION_ENTITY_NAME: string;
271
+ declare const COMMUNICATION_DELIVERY_ENTITY_NAME: string;
272
+
273
+ declare const AXMCommunicationManagementServerCommands: {
274
+ readonly Send: "CommunicationManagement:Server:Send";
275
+ readonly Deliver: "CommunicationManagement:Server:Deliver";
276
+ readonly InApp: {
277
+ readonly MarkSeen: "CommunicationManagement:InApp:MarkSeen";
278
+ readonly MarkRead: "CommunicationManagement:InApp:MarkRead";
279
+ readonly MarkAllRead: "CommunicationManagement:InApp:MarkAllRead";
280
+ readonly TogglePin: "CommunicationManagement:InApp:TogglePin";
281
+ readonly Archive: "CommunicationManagement:InApp:Archive";
282
+ readonly Delete: "CommunicationManagement:InApp:Delete";
283
+ };
284
+ readonly Smtp: {
285
+ readonly Test: "CommunicationManagement:Smtp:Test";
286
+ };
287
+ };
288
+
289
+ /** Settings group slug → `/:app/settings/user/communication-notifications` */
290
+ declare const AXP_COMMUNICATION_USER_NOTIFICATIONS_SETTINGS_GROUP = "communication-notifications";
291
+ /** Section within {@link AXP_COMMUNICATION_USER_NOTIFICATIONS_SETTINGS_GROUP}. */
292
+ declare const AXP_COMMUNICATION_DELIVERY_CHANNELS_SETTINGS_SECTION = "delivery-channels";
293
+
294
+ declare enum AXPCommunicationManagementSettingKeys {
295
+ EmailServer = "CommunicationManagement:Setting:Email.Server",
296
+ EmailPort = "CommunicationManagement:Setting:Email.Port",
297
+ EmailUsername = "CommunicationManagement:Setting:Email.Username",
298
+ EmailPassword = "CommunicationManagement:Setting:Email.Password",
299
+ EmailFromAddress = "CommunicationManagement:Setting:Email.FromAddress",
300
+ EmailUseSsl = "CommunicationManagement:Setting:Email.UseSSL",
301
+ EmailUseTls = "CommunicationManagement:Setting:Email.UseTLS",
302
+ DebugRedirectEmailAddress = "CommunicationManagement:Setting:Debug.Redirect.EmailAddress",
303
+ UserChannelInAppEnabled = "CommunicationManagement:Setting:User.Channel.InApp.Enabled",
304
+ UserChannelEmailEnabled = "CommunicationManagement:Setting:User.Channel.Email.Enabled"
305
+ }
306
+ declare const AXP_COMMUNICATION_USER_NOTIFICATION_DEFAULTS: Record<string, unknown>;
307
+ declare const AXP_COMMUNICATION_SMTP_SETTING_DEFAULTS: Record<string, unknown>;
308
+ interface CommunicationSmtpSettings {
309
+ server: string;
310
+ port: number;
311
+ username: string;
312
+ password: string;
313
+ fromAddress: string;
314
+ useSsl: boolean;
315
+ useTls: boolean;
316
+ }
317
+
318
+ /** Registered client status provider key for logical communications. */
319
+ declare const AXP_COMMUNICATION_STATUS_DEFINITION_KEY = "communication-management.status.communication";
320
+ /** Registered client status provider key for communication deliveries. */
321
+ declare const AXP_COMMUNICATION_DELIVERY_STATUS_DEFINITION_KEY = "communication-management.status.communication-delivery";
322
+ declare const AXP_COMMUNICATION_STATUS_PENDING: "Pending";
323
+ declare const AXP_COMMUNICATION_STATUS_PROCESSING: "Processing";
324
+ declare const AXP_COMMUNICATION_STATUS_COMPLETED: "Completed";
325
+ declare const AXP_COMMUNICATION_STATUS_FAILED: "Failed";
326
+ declare const AXP_COMMUNICATION_DELIVERY_STATUS_PENDING: "Pending";
327
+ declare const AXP_COMMUNICATION_DELIVERY_STATUS_DELIVERED: "Delivered";
328
+
329
+ export { AXMCommunicationManagementCommandKeys, AXMCommunicationManagementMenuKeys, AXMCommunicationManagementPermissionKeys, AXMCommunicationManagementServerCommands, AXPCollaborationPermissionKeys, AXPCommunicationManagementSettingKeys, AXP_COMMUNICATION_DELIVERY_CHANNELS_SETTINGS_SECTION, AXP_COMMUNICATION_DELIVERY_STATUS_DEFINITION_KEY, AXP_COMMUNICATION_DELIVERY_STATUS_DELIVERED, AXP_COMMUNICATION_DELIVERY_STATUS_PENDING, AXP_COMMUNICATION_SMTP_SETTING_DEFAULTS, AXP_COMMUNICATION_STATUS_COMPLETED, AXP_COMMUNICATION_STATUS_DEFINITION_KEY, AXP_COMMUNICATION_STATUS_FAILED, AXP_COMMUNICATION_STATUS_PENDING, AXP_COMMUNICATION_STATUS_PROCESSING, AXP_COMMUNICATION_USER_NOTIFICATIONS_SETTINGS_GROUP, AXP_COMMUNICATION_USER_NOTIFICATION_DEFAULTS, BUILTIN_CHANNEL_DEFINITIONS, COMMUNICATION_BUILTIN_CHANNEL_KEYS, COMMUNICATION_CHANNEL_ADAPTER, COMMUNICATION_CHANNEL_SEND_VALIDATOR, COMMUNICATION_DEBUG_REDIRECT_RESOLVER, COMMUNICATION_DELIVERY_ENTITY_NAME, COMMUNICATION_DELIVERY_EXECUTOR, COMMUNICATION_ENTITY_NAME, COMMUNICATION_MANAGEMENT_EMAIL_SEND_COMMAND_KEY, COMMUNICATION_MANAGEMENT_EMAIL_SHOW_DIALOG_COMMAND_KEY, RootConfig, formatCommunicationDeliveryJobTitle, getCommunicationChannel, isBuiltInCommunicationChannel, listCommunicationChannels, registerCommunicationChannel, resolveCommunicationMessage, resolveCommunicationRecipientLabel };
330
+ export type { AXMCommunicationDeliveryModel, AXMCommunicationModel, CommunicationAggregateStatus, CommunicationBuiltinChannelKey, CommunicationChannelAdapter, CommunicationChannelAdapterContext, CommunicationChannelCapabilities, CommunicationChannelDefinition, CommunicationChannelDeliverResult, CommunicationChannelSendValidator, CommunicationDebugRedirectResolver, CommunicationDebugRedirectResult, CommunicationDeliverPayload, CommunicationDeliverResult, CommunicationDeliveryEngagementRequest, CommunicationDeliveryEngagementResult, CommunicationDeliveryExecutor, CommunicationDeliveryMutationResult, CommunicationDeliveryStatus, CommunicationManagementEmailSendInput, CommunicationManagementEmailSendResult, CommunicationManagementEmailShowDialogInput, CommunicationMessage, CommunicationNotificationAction, CommunicationPriority, CommunicationRecipientLabelInput, CommunicationSendInput, CommunicationSendResult, CommunicationSmtpSettings, CommunicationSmtpTestInput, CommunicationSmtpTestResult };