@platform-modules/civil-aviation-authority 2.3.280 → 2.3.281

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.
@@ -1,55 +1,5 @@
1
- export type BilingualText = {
2
- en: string;
3
- ar: string;
4
- };
5
- type WorkflowChatI18nCatalog = {
6
- workflowTemplates: Record<string, BilingualText>;
7
- chatTemplates: Record<string, BilingualText>;
8
- workflowStatusLabels: Record<string, string>;
9
- chatStatusLabels: Record<string, string>;
10
- };
11
- /** Read-only view of the shared workflow/chat translation catalog. */
12
- export declare function getWorkflowChatI18nCatalog(): WorkflowChatI18nCatalog;
13
- export declare function buildBilingualFromTemplate(templateCatalog: Record<string, BilingualText>, key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
14
- export declare function workflowTemplate(key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
15
- export declare function chatTemplate(key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
16
- export declare function resolveWorkflowStatusAr(status: string | null | undefined): string | null;
17
- export declare function resolveChatStatusAr(status: string | null | undefined): string | null;
18
- /** Arabic column value only — never falls back to English (for content_ar / message_ar). */
19
- export declare function pickArabicName(arabicName?: string | null): string;
20
- export declare function pickLocalizedName(englishName?: string | null, arabicName?: string | null, fallback?: string): string;
21
- /** EN from English columns; AR from Arabic columns only (no English in ar). */
22
- export declare function joinDeptSectionBilingualLabels(deptEn?: string | null, deptAr?: string | null, sectEn?: string | null, sectAr?: string | null): {
23
- en: string;
24
- ar: string;
25
- };
26
- /** @deprecated Use joinDeptSectionBilingualLabels */
27
- export declare function joinDeptSectionArabicLabels(deptArabic?: string | null, sectionArabic?: string | null): string;
28
- export declare function buildApprovalWorkflowContent(params: {
29
- status: 'Approved' | 'Rejected' | 'Returned for Modification' | 'Pending' | string;
30
- roleName?: string | null;
31
- roleArabicName?: string | null;
32
- comment?: string | null;
33
- }): BilingualText;
34
- export declare function buildHumanApprovalWorkflowContent(params: {
35
- isFirst: boolean;
36
- roleName?: string | null;
37
- roleArabicName?: string | null;
38
- deptName?: string | null;
39
- deptArabicName?: string | null;
40
- sectionName?: string | null;
41
- sectionArabicName?: string | null;
42
- }): BilingualText;
43
- export declare function buildApprovalChatMessage(params: {
44
- status: 'Approved' | 'Rejected' | 'Returned for Modification' | string;
45
- roleName?: string | null;
46
- roleArabicName?: string | null;
47
- comment?: string | null;
48
- }): BilingualText;
49
- /** Resolve Arabic workflow content from a stored English content string (legacy rows). */
50
- export declare function resolveWorkflowContentAr(content: string | null | undefined): string | null;
51
- /** Resolve Arabic chat message from a stored English message string (legacy rows). */
52
- export declare function resolveChatMessageAr(message: string | null | undefined): string | null;
53
- export declare function enrichCancellationWorkflowLog(log: Record<string, unknown>): Record<string, unknown>;
54
- export declare function enrichCancellationChatMessage(chat: Record<string, unknown>): Record<string, unknown>;
55
- export {};
1
+ /**
2
+ * Re-exports the CAA standard bilingual message builder.
3
+ * Import from '@platform-modules/civil-aviation-authority' in all services.
4
+ */
5
+ export * from './workflow-chat-message.builder';
@@ -1,278 +1,21 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getWorkflowChatI18nCatalog = getWorkflowChatI18nCatalog;
7
- exports.buildBilingualFromTemplate = buildBilingualFromTemplate;
8
- exports.workflowTemplate = workflowTemplate;
9
- exports.chatTemplate = chatTemplate;
10
- exports.resolveWorkflowStatusAr = resolveWorkflowStatusAr;
11
- exports.resolveChatStatusAr = resolveChatStatusAr;
12
- exports.pickArabicName = pickArabicName;
13
- exports.pickLocalizedName = pickLocalizedName;
14
- exports.joinDeptSectionBilingualLabels = joinDeptSectionBilingualLabels;
15
- exports.joinDeptSectionArabicLabels = joinDeptSectionArabicLabels;
16
- exports.buildApprovalWorkflowContent = buildApprovalWorkflowContent;
17
- exports.buildHumanApprovalWorkflowContent = buildHumanApprovalWorkflowContent;
18
- exports.buildApprovalChatMessage = buildApprovalChatMessage;
19
- exports.resolveWorkflowContentAr = resolveWorkflowContentAr;
20
- exports.resolveChatMessageAr = resolveChatMessageAr;
21
- exports.enrichCancellationWorkflowLog = enrichCancellationWorkflowLog;
22
- exports.enrichCancellationChatMessage = enrichCancellationChatMessage;
23
- const workflow_chat_i18n_json_1 = __importDefault(require("./workflow-chat-i18n.json"));
24
- const WORKFLOW_TEMPLATES = workflow_chat_i18n_json_1.default.workflowTemplates;
25
- const CHAT_TEMPLATES = workflow_chat_i18n_json_1.default.chatTemplates;
26
- const WORKFLOW_STATUS_LABELS = workflow_chat_i18n_json_1.default.workflowStatusLabels;
27
- const CHAT_STATUS_LABELS = workflow_chat_i18n_json_1.default.chatStatusLabels;
28
- /** Read-only view of the shared workflow/chat translation catalog. */
29
- function getWorkflowChatI18nCatalog() {
30
- return workflow_chat_i18n_json_1.default;
31
- }
32
- function interpolate(template, params = {}) {
33
- return template.replace(/\{\{(\w+)\}\}/g, (_, key) => params[key] ?? '');
34
- }
35
- function buildBilingualFromTemplate(templateCatalog, key, params = {}, arParams) {
36
- const tpl = templateCatalog[key];
37
- if (!tpl) {
38
- return { en: key, ar: key };
39
- }
40
- const arabicParams = arParams ?? params;
41
- return {
42
- en: interpolate(tpl.en, params),
43
- ar: interpolate(tpl.ar, arabicParams),
44
- };
45
- }
46
- function workflowTemplate(key, params = {}, arParams) {
47
- return buildBilingualFromTemplate(WORKFLOW_TEMPLATES, key, params, arParams);
48
- }
49
- function chatTemplate(key, params = {}, arParams) {
50
- return buildBilingualFromTemplate(CHAT_TEMPLATES, key, params, arParams);
51
- }
52
- function resolveWorkflowStatusAr(status) {
53
- if (status == null || status === '')
54
- return null;
55
- return WORKFLOW_STATUS_LABELS[status] ?? status;
56
- }
57
- function resolveChatStatusAr(status) {
58
- if (status == null || status === '')
59
- return null;
60
- return CHAT_STATUS_LABELS[status] ?? status;
61
- }
62
- /** Arabic column value only — never falls back to English (for content_ar / message_ar). */
63
- function pickArabicName(arabicName) {
64
- return arabicName?.trim() || '';
65
- }
66
- function pickLocalizedName(englishName, arabicName, fallback = '') {
67
- const ar = arabicName?.trim();
68
- if (ar)
69
- return ar;
70
- const en = englishName?.trim();
71
- if (en)
72
- return en;
73
- return fallback;
74
- }
75
- function joinDeptSectionLabels(dept, section) {
76
- return [dept, section].map((s) => s?.trim()).filter(Boolean).join(' - ');
77
- }
78
- /** EN from English columns; AR from Arabic columns only (no English in ar). */
79
- function joinDeptSectionBilingualLabels(deptEn, deptAr, sectEn, sectAr) {
80
- return {
81
- en: joinDeptSectionLabels(deptEn, sectEn),
82
- ar: joinDeptSectionLabels(deptAr, sectAr),
83
- };
84
- }
85
- /** @deprecated Use joinDeptSectionBilingualLabels */
86
- function joinDeptSectionArabicLabels(deptArabic, sectionArabic) {
87
- return joinDeptSectionLabels(deptArabic, sectionArabic);
88
- }
89
- function formatWorkflowCommentSuffix(comment) {
90
- const text = comment?.trim();
91
- return text ? `: ${text}` : '';
92
- }
93
- function formatChatCommentSuffix(comment) {
94
- const text = comment?.trim();
95
- return text ? ` - ${text}` : '';
96
- }
97
- function buildWorkflowApprovalByName(templateKey, fallbackKey, nameEn, nameAr, comment) {
98
- const commentSuffix = formatWorkflowCommentSuffix(comment);
99
- return {
100
- en: workflowTemplate(templateKey, { name: nameEn, comment: commentSuffix }).en,
101
- ar: nameAr
102
- ? workflowTemplate(templateKey, { name: nameAr, comment: '' }).ar
103
- : workflowTemplate(fallbackKey, { comment: '' }).ar,
104
- };
105
- }
106
- function buildWorkflowApprovalWithoutName(templateKey, comment) {
107
- const commentSuffix = formatWorkflowCommentSuffix(comment);
108
- return {
109
- en: workflowTemplate(templateKey, { comment: commentSuffix }).en,
110
- ar: workflowTemplate(templateKey, { comment: '' }).ar,
111
- };
112
- }
113
- function buildWorkflowFromNamePair(templateWithNameKey, templateWithoutNameKey, nameEn, nameAr) {
114
- return {
115
- en: workflowTemplate(templateWithNameKey, { name: nameEn }).en,
116
- ar: nameAr
117
- ? workflowTemplate(templateWithNameKey, { name: nameAr }).ar
118
- : workflowTemplate(templateWithoutNameKey).ar,
119
- };
120
- }
121
- function buildApprovalWorkflowContent(params) {
122
- const nameEn = params.roleName?.trim() || '';
123
- const nameAr = pickArabicName(params.roleArabicName);
124
- if (params.status === 'Approved') {
125
- return nameEn
126
- ? buildWorkflowApprovalByName('request_approved_by', 'request_approved', nameEn, nameAr, params.comment)
127
- : buildWorkflowApprovalWithoutName('request_approved', params.comment);
128
- }
129
- if (params.status === 'Rejected') {
130
- return nameEn
131
- ? buildWorkflowApprovalByName('request_rejected_by', 'request_rejected', nameEn, nameAr, params.comment)
132
- : buildWorkflowApprovalWithoutName('request_rejected', params.comment);
133
- }
134
- if (params.status === 'Returned for Modification') {
135
- return nameEn
136
- ? buildWorkflowApprovalByName('request_returned_for_modification_by', 'request_returned_for_modification', nameEn, nameAr, params.comment)
137
- : buildWorkflowApprovalWithoutName('request_returned_for_modification', params.comment);
138
- }
139
- const commentSuffix = formatWorkflowCommentSuffix(params.comment);
140
- if (nameEn) {
141
- return {
142
- en: workflowTemplate('request_approval_pending_from', { name: nameEn, comment: commentSuffix }).en,
143
- ar: nameAr
144
- ? workflowTemplate('request_approval_pending_from', { name: nameAr, comment: '' }).ar
145
- : workflowTemplate('request_approval_pending', { comment: '' }).ar,
146
- };
147
- }
148
- return {
149
- en: workflowTemplate('request_approval_pending', { comment: commentSuffix }).en,
150
- ar: workflowTemplate('request_approval_pending', { comment: '' }).ar,
151
- };
152
- }
153
- function buildHumanApprovalWorkflowContent(params) {
154
- const withNameKey = params.isFirst ? 'request_approval_in_progress_from' : 'request_approval_pending_from';
155
- const withoutNameKey = params.isFirst ? 'request_approval_in_progress' : 'request_approval_pending';
156
- if (params.roleName?.trim()) {
157
- const nameEn = params.roleName.trim();
158
- const nameAr = pickArabicName(params.roleArabicName);
159
- return buildWorkflowFromNamePair(withNameKey, withoutNameKey, nameEn, nameAr);
160
- }
161
- const { en, ar } = joinDeptSectionBilingualLabels(params.deptName, params.deptArabicName, params.sectionName, params.sectionArabicName);
162
- if (en) {
163
- return buildWorkflowFromNamePair(withNameKey, withoutNameKey, en, ar);
164
- }
165
- return params.isFirst
166
- ? workflowTemplate('request_approval_in_progress')
167
- : workflowTemplate('request_approval_pending');
168
- }
169
- function buildApprovalChatMessage(params) {
170
- const roleEn = params.roleName?.trim() || 'Unknown Role';
171
- const roleAr = pickArabicName(params.roleArabicName);
172
- const commentSuffix = formatChatCommentSuffix(params.comment);
173
- let byRoleKey;
174
- let withoutRoleKey;
175
- if (params.status === 'Approved') {
176
- byRoleKey = 'request_approved_by_role';
177
- withoutRoleKey = 'request_approved';
178
- }
179
- else if (params.status === 'Rejected') {
180
- byRoleKey = 'request_rejected_by_role';
181
- withoutRoleKey = 'request_rejected';
182
- }
183
- else if (params.status === 'Returned for Modification') {
184
- byRoleKey = 'request_returned_for_modification_by_role';
185
- withoutRoleKey = 'request_returned_for_modification';
186
- }
187
- else {
188
- byRoleKey = 'request_approved_by_role';
189
- withoutRoleKey = 'request_approved';
190
- }
191
- return {
192
- en: chatTemplate(byRoleKey, { roleName: roleEn, comment: commentSuffix }).en,
193
- ar: roleAr
194
- ? chatTemplate(byRoleKey, { roleName: roleAr, comment: '' }).ar
195
- : chatTemplate(withoutRoleKey, { comment: '' }).ar,
196
- };
197
- }
198
- /** Resolve Arabic workflow content from a stored English content string (legacy rows). */
199
- function resolveWorkflowContentAr(content) {
200
- if (content == null || content.trim() === '')
201
- return null;
202
- const normalized = content.trim();
203
- for (const tpl of Object.values(WORKFLOW_TEMPLATES)) {
204
- if (tpl.en === normalized)
205
- return tpl.ar;
206
- }
207
- const commentIdx = normalized.indexOf(': ');
208
- if (commentIdx > 0) {
209
- const baseEn = normalized.slice(0, commentIdx).trim();
210
- for (const tpl of Object.values(WORKFLOW_TEMPLATES)) {
211
- if (!tpl.en.includes('{{comment}}'))
212
- continue;
213
- const withoutComment = tpl.en.replace('{{comment}}', '');
214
- if (withoutComment.includes('{{name}}')) {
215
- const staticPrefix = withoutComment.replace('{{name}}', '').trim();
216
- if (baseEn.startsWith(staticPrefix)) {
217
- const fallbackKey = Object.entries(WORKFLOW_TEMPLATES).find(([, t]) => t === tpl)?.[0] ?? '';
218
- if (fallbackKey.includes('_by')) {
219
- const genericKey = fallbackKey.replace('_by', '');
220
- if (WORKFLOW_TEMPLATES[genericKey]) {
221
- return WORKFLOW_TEMPLATES[genericKey].ar;
222
- }
223
- }
224
- return tpl.ar.split('{{name}}')[0].trim();
225
- }
226
- }
227
- else if (withoutComment.trim() === baseEn) {
228
- return interpolate(tpl.ar, { comment: '' });
229
- }
230
- }
231
- }
232
- const inProgressPrefix = WORKFLOW_TEMPLATES.request_approval_in_progress_from?.en.split('{{name}}')[0].trim();
233
- if (inProgressPrefix && normalized.startsWith(inProgressPrefix)) {
234
- return WORKFLOW_TEMPLATES.request_approval_in_progress.ar;
235
- }
236
- const pendingPrefix = WORKFLOW_TEMPLATES.request_approval_pending_from?.en.split('{{name}}')[0].trim();
237
- if (pendingPrefix && normalized.startsWith(pendingPrefix)) {
238
- return WORKFLOW_TEMPLATES.request_approval_pending.ar;
239
- }
240
- return null;
241
- }
242
- /** Resolve Arabic chat message from a stored English message string (legacy rows). */
243
- function resolveChatMessageAr(message) {
244
- if (message == null || message.trim() === '')
245
- return null;
246
- const normalized = message.trim();
247
- for (const tpl of Object.values(CHAT_TEMPLATES)) {
248
- if (tpl.en === normalized)
249
- return tpl.ar;
250
- }
251
- return null;
252
- }
253
- function enrichCancellationWorkflowLog(log) {
254
- const status = log.status != null ? String(log.status) : null;
255
- const content = log.content != null ? String(log.content) : null;
256
- const storedAr = log.content_ar != null ? String(log.content_ar).trim() : '';
257
- const hasEnglishInAr = storedAr && /[A-Za-z]/.test(storedAr);
258
- return {
259
- ...log,
260
- content_ar: hasEnglishInAr
261
- ? (resolveWorkflowContentAr(content) ?? storedAr)
262
- : (log.content_ar ?? resolveWorkflowContentAr(content)),
263
- status_ar: log.status_ar ?? resolveWorkflowStatusAr(status),
264
- };
265
- }
266
- function enrichCancellationChatMessage(chat) {
267
- const status = chat.status != null ? String(chat.status) : null;
268
- const message = chat.message != null ? String(chat.message) : null;
269
- const storedAr = chat.message_ar != null ? String(chat.message_ar).trim() : '';
270
- const hasEnglishInAr = storedAr && /[A-Za-z]/.test(storedAr);
271
- return {
272
- ...chat,
273
- message_ar: hasEnglishInAr
274
- ? (resolveChatMessageAr(message) ?? storedAr)
275
- : (chat.message_ar ?? resolveChatMessageAr(message)),
276
- status_ar: chat.status_ar ?? resolveChatStatusAr(status),
277
- };
278
- }
17
+ /**
18
+ * Re-exports the CAA standard bilingual message builder.
19
+ * Import from '@platform-modules/civil-aviation-authority' in all services.
20
+ */
21
+ __exportStar(require("./workflow-chat-message.builder"), exports);
@@ -0,0 +1,103 @@
1
+ export type BilingualText = {
2
+ en: string;
3
+ ar: string;
4
+ };
5
+ export type WorkflowChatI18nCatalog = {
6
+ workflowTemplates: Record<string, BilingualText>;
7
+ chatTemplates: Record<string, BilingualText>;
8
+ workflowStatusLabels: Record<string, string>;
9
+ chatStatusLabels: Record<string, string>;
10
+ };
11
+ /** Master-data fields with English + Arabic columns (roles, departments, sections, users). */
12
+ export type BilingualActorNames = {
13
+ roleName?: string | null;
14
+ roleArabicName?: string | null;
15
+ deptName?: string | null;
16
+ deptArabicName?: string | null;
17
+ sectionName?: string | null;
18
+ sectionArabicName?: string | null;
19
+ userName?: string | null;
20
+ userArabicName?: string | null;
21
+ employeeId?: string | number | null;
22
+ };
23
+ export type WorkflowMessageAction = 'request_submitted' | 'notification_sent_pending' | 'notification_sent_successfully' | 'approval_in_progress' | 'approval_pending' | 'approved' | 'rejected' | 'returned_for_modification' | 'approval_pending_update';
24
+ export type ChatMessageAction = 'cancellation_submitted' | 'request_received' | 'approved' | 'rejected' | 'returned_for_modification';
25
+ export type WorkflowMessageContext = BilingualActorNames & {
26
+ action: WorkflowMessageAction;
27
+ /** First human approval step → "in progress"; later steps → "pending". */
28
+ isFirstApprovalStep?: boolean;
29
+ comment?: string | null;
30
+ };
31
+ export type ChatMessageContext = BilingualActorNames & {
32
+ action: ChatMessageAction;
33
+ comment?: string | null;
34
+ };
35
+ export declare function getWorkflowChatI18nCatalog(): WorkflowChatI18nCatalog;
36
+ /** Arabic DB column preferred; English fallback so AR keeps identical structure to EN. */
37
+ export declare function resolveBilingualName(englishName?: string | null, arabicName?: string | null): string;
38
+ export declare function pickLocalizedName(englishName?: string | null, arabicName?: string | null, fallback?: string): string;
39
+ /** @deprecated Use resolveBilingualName */
40
+ export declare function pickArabicName(arabicName?: string | null): string;
41
+ /** Build parallel EN / AR actor label from role OR dept+section. */
42
+ export declare function resolveActorDisplayNames(actors: BilingualActorNames): {
43
+ en: string;
44
+ ar: string;
45
+ };
46
+ /** @deprecated Use resolveActorDisplayNames */
47
+ export declare function joinDeptSectionBilingualLabels(deptEn?: string | null, deptAr?: string | null, sectEn?: string | null, sectAr?: string | null): {
48
+ en: string;
49
+ ar: string;
50
+ };
51
+ /** @deprecated Use resolveActorDisplayNames */
52
+ export declare function joinDeptSectionArabicLabels(deptArabic?: string | null, sectionArabic?: string | null): string;
53
+ export declare function formatWorkflowCommentSuffix(comment?: string | null): string;
54
+ export declare function formatChatCommentSuffix(comment?: string | null): string;
55
+ /** Core renderer — always pass explicit EN and AR param objects with the same keys. */
56
+ export declare function renderSynchronizedWorkflowMessage(templateKey: string, enParams: Record<string, string>, arParams: Record<string, string>): BilingualText;
57
+ export declare function renderSynchronizedChatMessage(templateKey: string, enParams: Record<string, string>, arParams: Record<string, string>): BilingualText;
58
+ export declare function buildBilingualFromTemplate(templateCatalog: Record<string, BilingualText>, key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
59
+ export declare function workflowTemplate(key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
60
+ export declare function chatTemplate(key: string, params?: Record<string, string>, arParams?: Record<string, string>): BilingualText;
61
+ /**
62
+ * Standard entry point for workflow `content` + `content_ar`.
63
+ * Use for every workflow log insert/update across all CAA modules.
64
+ */
65
+ export declare function buildSynchronizedWorkflowMessage(ctx: WorkflowMessageContext): BilingualText;
66
+ /**
67
+ * Standard entry point for chat `message` + `message_ar`.
68
+ * Use for every chat insert/update across all CAA modules.
69
+ */
70
+ export declare function buildSynchronizedChatMessage(ctx: ChatMessageContext): BilingualText;
71
+ export declare function buildApprovalWorkflowContent(params: {
72
+ status: 'Approved' | 'Rejected' | 'Returned for Modification' | 'Pending' | string;
73
+ roleName?: string | null;
74
+ roleArabicName?: string | null;
75
+ comment?: string | null;
76
+ }): BilingualText;
77
+ export declare function buildHumanApprovalWorkflowContent(params: {
78
+ isFirst: boolean;
79
+ roleName?: string | null;
80
+ roleArabicName?: string | null;
81
+ deptName?: string | null;
82
+ deptArabicName?: string | null;
83
+ sectionName?: string | null;
84
+ sectionArabicName?: string | null;
85
+ }): BilingualText;
86
+ export declare function buildApprovalChatMessage(params: {
87
+ status: 'Approved' | 'Rejected' | 'Returned for Modification' | string;
88
+ roleName?: string | null;
89
+ roleArabicName?: string | null;
90
+ comment?: string | null;
91
+ }): BilingualText;
92
+ export declare function resolveWorkflowStatusAr(status: string | null | undefined): string | null;
93
+ export declare function resolveChatStatusAr(status: string | null | undefined): string | null;
94
+ export declare function resolveWorkflowContentAr(content: string | null | undefined): string | null;
95
+ export declare function resolveChatMessageAr(message: string | null | undefined): string | null;
96
+ /** Generic workflow log enricher — use in all module repositories. */
97
+ export declare function enrichWorkflowLog(log: Record<string, unknown>): Record<string, unknown>;
98
+ /** Generic chat enricher — use in all module repositories. */
99
+ export declare function enrichChatMessage(chat: Record<string, unknown>): Record<string, unknown>;
100
+ /** @deprecated Use enrichWorkflowLog */
101
+ export declare const enrichCancellationWorkflowLog: typeof enrichWorkflowLog;
102
+ /** @deprecated Use enrichChatMessage */
103
+ export declare const enrichCancellationChatMessage: typeof enrichChatMessage;