@elevasis/ui 2.41.0 → 2.42.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.
- package/dist/api/index.js +4 -6
- package/dist/app/index.css +384 -0
- package/dist/app/index.d.ts +5 -1
- package/dist/app/index.js +17 -26
- package/dist/auth/index.css +659 -0
- package/dist/auth/index.js +19 -5
- package/dist/charts/index.css +533 -0
- package/dist/charts/index.js +18 -14
- package/dist/{chunk-JAN2ZXN5.js → chunk-3MTAHV5M.js} +28535 -18021
- package/dist/{chunk-73EWE2EW.js → chunk-EDVZ3AHA.js} +1 -1
- package/dist/chunk-GMXGDO3I.js +244 -0
- package/dist/{chunk-CXY7FMUM.js → chunk-GUKY77FJ.js} +50 -4
- package/dist/{chunk-TE4P6OSJ.js → chunk-MA7YCY7C.js} +1 -1
- package/dist/{chunk-5JYKCULK.js → chunk-NZ2F5RQ4.js} +44 -2
- package/dist/{chunk-WF7CONXF.js → chunk-OJJK27GC.js} +658 -6
- package/dist/chunk-YEGMSADG.js +1781 -0
- package/dist/components/chat/index.js +1 -2
- package/dist/components/index.css +149 -149
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +13 -36
- package/dist/components/navigation/index.css +659 -0
- package/dist/components/navigation/index.js +25 -3
- package/dist/features/auth/index.js +14 -37
- package/dist/features/clients/index.css +149 -149
- package/dist/features/clients/index.js +13 -36
- package/dist/features/crm/index.js +13 -36
- package/dist/features/dashboard/index.d.ts +5 -1
- package/dist/features/dashboard/index.js +13 -36
- package/dist/features/delivery/index.js +13 -36
- package/dist/features/knowledge/index.css +659 -0
- package/dist/features/knowledge/index.js +25 -247
- package/dist/features/lead-gen/index.d.ts +5 -1
- package/dist/features/lead-gen/index.js +13 -36
- package/dist/features/monitoring/index.js +13 -36
- package/dist/features/monitoring/requests/index.js +19 -149
- package/dist/features/operations/index.d.ts +5 -1
- package/dist/features/operations/index.js +13 -36
- package/dist/features/seo/index.js +1 -4
- package/dist/features/settings/index.js +13 -36
- package/dist/hooks/access/index.css +659 -0
- package/dist/hooks/access/index.js +19 -4
- package/dist/hooks/delivery/index.js +13 -36
- package/dist/hooks/index.d.ts +5 -1
- package/dist/hooks/index.js +13 -36
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +5 -1
- package/dist/hooks/published.d.ts +5 -1
- package/dist/hooks/published.js +13 -36
- package/dist/index.d.ts +5 -1
- package/dist/index.js +14 -37
- package/dist/initialization/index.js +1 -1
- package/dist/knowledge/index.css +659 -0
- package/dist/knowledge/index.d.ts +5 -1
- package/dist/knowledge/index.js +25 -15
- package/dist/layout/index.css +659 -0
- package/dist/layout/index.js +24 -9
- package/dist/organization/index.js +13 -36
- package/dist/provider/index.css +384 -0
- package/dist/provider/index.d.ts +5 -1
- package/dist/provider/index.js +18 -21
- package/dist/provider/published.css +533 -0
- package/dist/provider/published.d.ts +5 -1
- package/dist/provider/published.js +18 -16
- package/dist/test-utils/index.js +4 -6
- package/dist/theme/index.js +2 -5
- package/dist/theme/presets/index.js +1 -2
- package/dist/types/index.d.ts +5 -1
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.js +1 -3
- package/package.json +3 -3
- package/dist/chunk-3KMDHCAR.js +0 -52
- package/dist/chunk-4DRI3G36.js +0 -1016
- package/dist/chunk-56O7QQE7.js +0 -356
- package/dist/chunk-5EYJ2GIN.js +0 -122
- package/dist/chunk-66U7JOWV.js +0 -425
- package/dist/chunk-6D4LCJ52.js +0 -10
- package/dist/chunk-6ROXVZ3L.js +0 -9
- package/dist/chunk-A2XN6PR2.js +0 -111
- package/dist/chunk-B2DZLPDL.js +0 -39
- package/dist/chunk-CLDCYJQT.js +0 -1
- package/dist/chunk-CTJBPF3Z.js +0 -734
- package/dist/chunk-DT3QYZVU.js +0 -23
- package/dist/chunk-FIMGOWOT.js +0 -3644
- package/dist/chunk-IIMU5YAJ.js +0 -53
- package/dist/chunk-JHVEA5NE.js +0 -133
- package/dist/chunk-L7GXUSCV.js +0 -215
- package/dist/chunk-NYBEU5TE.js +0 -118
- package/dist/chunk-QVQMOQXB.js +0 -1240
- package/dist/chunk-RH5VWWSC.js +0 -624
- package/dist/chunk-RXH4D6TY.js +0 -801
- package/dist/chunk-S4R2ZQS7.js +0 -2131
- package/dist/chunk-TYRUKGGD.js +0 -46
- package/dist/chunk-VAAU2Z3S.js +0 -85
- package/dist/chunk-WLOQ4IBG.js +0 -654
- package/dist/chunk-X4WBGKJQ.js +0 -138
- package/dist/chunk-YPWN2WQ3.js +0 -340
package/dist/chunk-RXH4D6TY.js
DELETED
|
@@ -1,801 +0,0 @@
|
|
|
1
|
-
import { formatOntologyId, getSystem, compileOrganizationOntology, parseOntologyId, getLeadGenStageCatalog } from './chunk-RH5VWWSC.js';
|
|
2
|
-
import { formatDistanceToNow } from 'date-fns';
|
|
3
|
-
import { IconUser, IconExternalLink, IconPlug, IconBolt, IconGitBranch, IconBrain } from '@tabler/icons-react';
|
|
4
|
-
|
|
5
|
-
// src/utils/dateFormatters.ts
|
|
6
|
-
function formatDateTime(dateString) {
|
|
7
|
-
if (!dateString) return "Never";
|
|
8
|
-
const date = new Date(dateString);
|
|
9
|
-
return date.toLocaleDateString("en-US", {
|
|
10
|
-
year: "numeric",
|
|
11
|
-
month: "short",
|
|
12
|
-
day: "numeric",
|
|
13
|
-
hour: "2-digit",
|
|
14
|
-
minute: "2-digit"
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function formatDate(dateString) {
|
|
18
|
-
if (!dateString) return "Never";
|
|
19
|
-
const date = new Date(dateString);
|
|
20
|
-
return date.toLocaleDateString("en-US", {
|
|
21
|
-
year: "numeric",
|
|
22
|
-
month: "short",
|
|
23
|
-
day: "numeric"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function formatChartAxisDate(dateString) {
|
|
27
|
-
if (!dateString) return "";
|
|
28
|
-
const date = new Date(dateString);
|
|
29
|
-
const month = date.getMonth() + 1;
|
|
30
|
-
const day = date.getDate();
|
|
31
|
-
const hour = date.getHours();
|
|
32
|
-
const period = hour >= 12 ? "PM" : "AM";
|
|
33
|
-
const hour12 = hour % 12 || 12;
|
|
34
|
-
return `${month}/${day}, ${hour12}${period}`;
|
|
35
|
-
}
|
|
36
|
-
function formatRelativeTime(date) {
|
|
37
|
-
if (!date) return "N/A";
|
|
38
|
-
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
39
|
-
return formatDistanceToNow(dateObj, { addSuffix: true });
|
|
40
|
-
}
|
|
41
|
-
function formatTimeAgo(date) {
|
|
42
|
-
if (!date) return "-";
|
|
43
|
-
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
44
|
-
const diffMs = Date.now() - dateObj.getTime();
|
|
45
|
-
const diffMinutes = Math.floor(diffMs / (1e3 * 60));
|
|
46
|
-
const diffHours = Math.floor(diffMs / (1e3 * 60 * 60));
|
|
47
|
-
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
48
|
-
if (diffMinutes < 1) return "Just now";
|
|
49
|
-
if (diffHours < 1) return `${diffMinutes}m ago`;
|
|
50
|
-
if (diffDays < 1) return `${diffHours}h ago`;
|
|
51
|
-
if (diffDays === 1) return "1d ago";
|
|
52
|
-
return `${diffDays}d ago`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/utils/validateEmail.ts
|
|
56
|
-
var validateEmail = (email) => {
|
|
57
|
-
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/.test(email);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// src/utils/error-utils.ts
|
|
61
|
-
var APIClientError = class extends Error {
|
|
62
|
-
statusCode;
|
|
63
|
-
code;
|
|
64
|
-
requestId;
|
|
65
|
-
fields;
|
|
66
|
-
retryAfter;
|
|
67
|
-
constructor(message, code, statusCode, requestId, fields, retryAfter) {
|
|
68
|
-
super(message);
|
|
69
|
-
this.name = "APIClientError";
|
|
70
|
-
this.code = code;
|
|
71
|
-
this.statusCode = statusCode;
|
|
72
|
-
this.requestId = requestId;
|
|
73
|
-
this.fields = fields;
|
|
74
|
-
this.retryAfter = retryAfter;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
function isAPIClientError(error) {
|
|
78
|
-
return error instanceof APIClientError;
|
|
79
|
-
}
|
|
80
|
-
function getErrorInfo(error) {
|
|
81
|
-
if (isAPIClientError(error)) {
|
|
82
|
-
return {
|
|
83
|
-
message: error.message,
|
|
84
|
-
code: error.code,
|
|
85
|
-
requestId: error.requestId,
|
|
86
|
-
statusCode: error.statusCode,
|
|
87
|
-
fields: error.fields,
|
|
88
|
-
retryAfter: error.retryAfter
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
if (error instanceof Error) {
|
|
92
|
-
return {
|
|
93
|
-
message: error.message
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
message: String(error)
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function getErrorTitle(code) {
|
|
101
|
-
if (!code) return "Error";
|
|
102
|
-
switch (code) {
|
|
103
|
-
case "VALIDATION_ERROR":
|
|
104
|
-
return "Validation Error";
|
|
105
|
-
case "AUTHENTICATION_FAILED":
|
|
106
|
-
return "Authentication Required";
|
|
107
|
-
case "FORBIDDEN":
|
|
108
|
-
return "Access Denied";
|
|
109
|
-
case "NOT_FOUND":
|
|
110
|
-
return "Not Found";
|
|
111
|
-
case "CONFLICT":
|
|
112
|
-
return "Conflict";
|
|
113
|
-
case "RATE_LIMIT_EXCEEDED":
|
|
114
|
-
return "Rate Limit Exceeded";
|
|
115
|
-
case "INTERNAL_SERVER_ERROR":
|
|
116
|
-
return "Server Error";
|
|
117
|
-
case "SERVICE_UNAVAILABLE":
|
|
118
|
-
return "Service Temporarily Unavailable";
|
|
119
|
-
default:
|
|
120
|
-
return "Error";
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
function formatErrorMessage(message, requestId, fields, retryAfter) {
|
|
124
|
-
let formatted = message;
|
|
125
|
-
if (fields && Object.keys(fields).length > 0) {
|
|
126
|
-
const fieldErrors = [];
|
|
127
|
-
for (const [field, errors] of Object.entries(fields)) {
|
|
128
|
-
const fieldName = field === "root" || field === "_root" ? "Request" : field;
|
|
129
|
-
errors.forEach((error) => {
|
|
130
|
-
fieldErrors.push(`\u2022 ${fieldName}: ${error}`);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
if (fieldErrors.length > 0) {
|
|
134
|
-
formatted = fieldErrors.join("\n");
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (retryAfter) {
|
|
138
|
-
formatted += `
|
|
139
|
-
|
|
140
|
-
Please wait ${retryAfter} seconds before retrying.`;
|
|
141
|
-
}
|
|
142
|
-
if (requestId) {
|
|
143
|
-
formatted += `
|
|
144
|
-
|
|
145
|
-
Request ID: ${requestId}`;
|
|
146
|
-
}
|
|
147
|
-
return formatted;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// ../core/src/platform/utils/debounce.ts
|
|
151
|
-
function debounce(fn, wait) {
|
|
152
|
-
let timeoutId = null;
|
|
153
|
-
const debounced = (...args) => {
|
|
154
|
-
if (timeoutId !== null) {
|
|
155
|
-
clearTimeout(timeoutId);
|
|
156
|
-
}
|
|
157
|
-
timeoutId = setTimeout(() => {
|
|
158
|
-
fn(...args);
|
|
159
|
-
timeoutId = null;
|
|
160
|
-
}, wait);
|
|
161
|
-
};
|
|
162
|
-
debounced.cancel = () => {
|
|
163
|
-
if (timeoutId !== null) {
|
|
164
|
-
clearTimeout(timeoutId);
|
|
165
|
-
timeoutId = null;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
return debounced;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// ../core/src/business/acquisition/ontology-validation.ts
|
|
172
|
-
var LEAD_GEN_API_INTERFACE = {
|
|
173
|
-
systemPath: "sales.lead-gen",
|
|
174
|
-
interfaceKey: "api",
|
|
175
|
-
readinessProfile: "sales.lead-gen.api"
|
|
176
|
-
};
|
|
177
|
-
var CRM_API_INTERFACE = {
|
|
178
|
-
systemPath: "sales.crm",
|
|
179
|
-
interfaceKey: "api",
|
|
180
|
-
readinessProfile: "sales.crm.api"
|
|
181
|
-
};
|
|
182
|
-
var LEAD_GEN_CRM_HANDOFF_INTERFACE = {
|
|
183
|
-
systemPath: "sales.lead-gen",
|
|
184
|
-
interfaceKey: "crm-handoff",
|
|
185
|
-
readinessProfile: "sales.lead-gen.crm-handoff"
|
|
186
|
-
};
|
|
187
|
-
LEAD_GEN_API_INTERFACE.readinessProfile;
|
|
188
|
-
CRM_API_INTERFACE.readinessProfile;
|
|
189
|
-
var LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
190
|
-
scope: "sales.lead-gen",
|
|
191
|
-
kind: "object",
|
|
192
|
-
localId: "list"
|
|
193
|
-
});
|
|
194
|
-
var LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
195
|
-
scope: "sales.lead-gen",
|
|
196
|
-
kind: "object",
|
|
197
|
-
localId: "company"
|
|
198
|
-
});
|
|
199
|
-
var LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
200
|
-
scope: "sales.lead-gen",
|
|
201
|
-
kind: "object",
|
|
202
|
-
localId: "contact"
|
|
203
|
-
});
|
|
204
|
-
var LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
205
|
-
scope: "sales.lead-gen",
|
|
206
|
-
kind: "catalog",
|
|
207
|
-
localId: "build-template"
|
|
208
|
-
});
|
|
209
|
-
var LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
210
|
-
scope: "sales.lead-gen",
|
|
211
|
-
kind: "catalog",
|
|
212
|
-
localId: "company-stage"
|
|
213
|
-
});
|
|
214
|
-
var LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
215
|
-
scope: "sales.lead-gen",
|
|
216
|
-
kind: "catalog",
|
|
217
|
-
localId: "contact-stage"
|
|
218
|
-
});
|
|
219
|
-
var CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
220
|
-
scope: "sales.crm",
|
|
221
|
-
kind: "catalog",
|
|
222
|
-
localId: "crm.pipeline"
|
|
223
|
-
});
|
|
224
|
-
var LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
225
|
-
scope: "sales.lead-gen",
|
|
226
|
-
kind: "catalog",
|
|
227
|
-
localId: "lead-gen.stage-catalog"
|
|
228
|
-
});
|
|
229
|
-
function createLeadGenStageCatalog(model) {
|
|
230
|
-
return {
|
|
231
|
-
id: LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID,
|
|
232
|
-
label: "Lead Gen Processing Stages",
|
|
233
|
-
ownerSystemId: "sales.lead-gen",
|
|
234
|
-
kind: "processing-stage-catalog",
|
|
235
|
-
entries: Object.fromEntries(
|
|
236
|
-
Object.entries(getLeadGenStageCatalog(model)).map(([key, entry]) => [
|
|
237
|
-
key,
|
|
238
|
-
{
|
|
239
|
-
...entry
|
|
240
|
-
}
|
|
241
|
-
])
|
|
242
|
-
),
|
|
243
|
-
legacyCatalogKey: "LEAD_GEN_STAGE_CATALOG"
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
function isPlainRecord(value) {
|
|
247
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
248
|
-
}
|
|
249
|
-
function addReadinessIssue(issues, family, code, message, details = {}) {
|
|
250
|
-
issues.push({
|
|
251
|
-
family,
|
|
252
|
-
code,
|
|
253
|
-
message,
|
|
254
|
-
...details
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
function formatInterfaceIdentity(systemPath, interfaceKey) {
|
|
258
|
-
return `${systemPath}/${interfaceKey}`;
|
|
259
|
-
}
|
|
260
|
-
function profileForInterface(systemPath, interfaceKey, readinessProfile) {
|
|
261
|
-
return readinessProfile ?? `${systemPath}.${interfaceKey}`;
|
|
262
|
-
}
|
|
263
|
-
function readinessMarkerPath(context) {
|
|
264
|
-
return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
|
|
265
|
-
}
|
|
266
|
-
function getActiveScopedResources(model, resourceIds, issues, context) {
|
|
267
|
-
const resources = [];
|
|
268
|
-
for (const [index, resourceId] of resourceIds.entries()) {
|
|
269
|
-
const resource = model.resources?.[resourceId];
|
|
270
|
-
const path = `${readinessMarkerPath(context)}.resourceIds.${index}`;
|
|
271
|
-
if (resource === void 0) {
|
|
272
|
-
addReadinessIssue(
|
|
273
|
-
issues,
|
|
274
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
275
|
-
"missing-resource",
|
|
276
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes missing resource "${resourceId}".`,
|
|
277
|
-
{ path, ref: resourceId }
|
|
278
|
-
);
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
if (resource.systemPath !== context.systemPath) {
|
|
282
|
-
addReadinessIssue(
|
|
283
|
-
issues,
|
|
284
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
285
|
-
"resource-system-mismatch",
|
|
286
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes resource "${resourceId}" from system "${resource.systemPath}".`,
|
|
287
|
-
{ path, ref: resourceId }
|
|
288
|
-
);
|
|
289
|
-
continue;
|
|
290
|
-
}
|
|
291
|
-
if (resource.status !== "active") {
|
|
292
|
-
addReadinessIssue(
|
|
293
|
-
issues,
|
|
294
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
295
|
-
"inactive-resource",
|
|
296
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes inactive resource "${resourceId}".`,
|
|
297
|
-
{ path, ref: resourceId }
|
|
298
|
-
);
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
resources.push(resource);
|
|
302
|
-
}
|
|
303
|
-
return resources;
|
|
304
|
-
}
|
|
305
|
-
function resourceBindingIds(resources, key) {
|
|
306
|
-
return new Set(resources.flatMap((resource) => resource.ontology?.[key] ?? []));
|
|
307
|
-
}
|
|
308
|
-
function requireScopedBinding(issues, boundIds, bindingKey, ontologyId, context) {
|
|
309
|
-
if (boundIds.has(ontologyId)) return;
|
|
310
|
-
addReadinessIssue(
|
|
311
|
-
issues,
|
|
312
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
313
|
-
"missing-resource-binding",
|
|
314
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" has no active scoped resource with ontology.${bindingKey} binding "${ontologyId}".`,
|
|
315
|
-
{ path: `${readinessMarkerPath(context)}.resourceIds`, ref: ontologyId }
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
function ontologyOwnerMatches(ontologyId, expectedSystemPath, catalog) {
|
|
319
|
-
if (catalog?.ownerSystemId !== void 0) return catalog.ownerSystemId === expectedSystemPath;
|
|
320
|
-
return parseOntologyId(ontologyId).scope === expectedSystemPath;
|
|
321
|
-
}
|
|
322
|
-
function requireObjectReadiness(issues, index, objectId, context) {
|
|
323
|
-
const object = index.ontology.objectTypes[objectId];
|
|
324
|
-
if (object === void 0) {
|
|
325
|
-
addReadinessIssue(
|
|
326
|
-
issues,
|
|
327
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
328
|
-
"missing-object",
|
|
329
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required object type "${objectId}".`,
|
|
330
|
-
{ ref: objectId }
|
|
331
|
-
);
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
const ownerSystemId = object.ownerSystemId ?? parseOntologyId(objectId).scope;
|
|
335
|
-
if (ownerSystemId !== context.systemPath) {
|
|
336
|
-
addReadinessIssue(
|
|
337
|
-
issues,
|
|
338
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
339
|
-
"foreign-object",
|
|
340
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires object "${objectId}" owned by "${ownerSystemId}".`,
|
|
341
|
-
{ ref: objectId }
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
function requireCatalogReadiness(issues, index, catalogId, context) {
|
|
346
|
-
const catalog = index.ontology.catalogTypes[catalogId];
|
|
347
|
-
if (catalog === void 0) {
|
|
348
|
-
addReadinessIssue(
|
|
349
|
-
issues,
|
|
350
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
351
|
-
"missing-catalog",
|
|
352
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required catalog "${catalogId}".`,
|
|
353
|
-
{ ref: catalogId }
|
|
354
|
-
);
|
|
355
|
-
return void 0;
|
|
356
|
-
}
|
|
357
|
-
if (context.allowForeignOwner !== true && !ontologyOwnerMatches(catalogId, context.systemPath, catalog)) {
|
|
358
|
-
addReadinessIssue(
|
|
359
|
-
issues,
|
|
360
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
361
|
-
"foreign-catalog",
|
|
362
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog "${catalogId}" owned by "${catalog.ownerSystemId ?? parseOntologyId(catalogId).scope}".`,
|
|
363
|
-
{ ref: catalogId }
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
if (Object.keys(getCatalogEntries(catalog)).length === 0) {
|
|
367
|
-
addReadinessIssue(
|
|
368
|
-
issues,
|
|
369
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
370
|
-
"empty-catalog",
|
|
371
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog entries for "${catalogId}".`,
|
|
372
|
-
{ ref: catalogId }
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
return catalog;
|
|
376
|
-
}
|
|
377
|
-
function requireLeadGenInterfaceReadiness(issues, index, resources, context) {
|
|
378
|
-
const reads = resourceBindingIds(resources, "reads");
|
|
379
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
380
|
-
for (const objectId of [
|
|
381
|
-
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID,
|
|
382
|
-
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID,
|
|
383
|
-
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID
|
|
384
|
-
]) {
|
|
385
|
-
requireObjectReadiness(issues, index, objectId, context);
|
|
386
|
-
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
387
|
-
}
|
|
388
|
-
for (const catalogId of [
|
|
389
|
-
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID,
|
|
390
|
-
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID,
|
|
391
|
-
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID
|
|
392
|
-
]) {
|
|
393
|
-
requireCatalogReadiness(issues, index, catalogId, context);
|
|
394
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
395
|
-
}
|
|
396
|
-
const templateStepCatalog = findLeadGenTemplateStepCatalog(index);
|
|
397
|
-
if (templateStepCatalog === void 0) {
|
|
398
|
-
addReadinessIssue(
|
|
399
|
-
issues,
|
|
400
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
401
|
-
"missing-template-step-catalog",
|
|
402
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing a lead-gen template-step catalog.`
|
|
403
|
-
);
|
|
404
|
-
} else {
|
|
405
|
-
requireCatalogReadiness(issues, index, templateStepCatalog.id, context);
|
|
406
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", templateStepCatalog.id, context);
|
|
407
|
-
}
|
|
408
|
-
const leadGenStageCatalog = requireCatalogReadiness(issues, index, LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID, context);
|
|
409
|
-
return leadGenStageCatalog;
|
|
410
|
-
}
|
|
411
|
-
function requireCrmInterfaceReadiness(issues, index, resources, context) {
|
|
412
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
413
|
-
const crmPipelineCatalog = requireCatalogReadiness(issues, index, CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
414
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
415
|
-
return crmPipelineCatalog;
|
|
416
|
-
}
|
|
417
|
-
function findSystemInterfaceGrant(model, consumer, provider) {
|
|
418
|
-
return Object.values(model.topology?.relationships ?? {}).find((relationship) => {
|
|
419
|
-
const grant = relationship.metadata?.["systemInterfaceGrant"];
|
|
420
|
-
if (!isPlainRecord(grant) || !isPlainRecord(grant.consumer) || !isPlainRecord(grant.provider)) return false;
|
|
421
|
-
return grant.consumer.systemPath === consumer.systemPath && grant.consumer.interfaceKey === consumer.interfaceKey && grant.provider.systemPath === provider.systemPath && grant.provider.interfaceKey === provider.interfaceKey;
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function requireHandoffBridgeReadiness(issues, model, context) {
|
|
425
|
-
const crmResult = computeInterfaceReadiness(model, CRM_API_INTERFACE);
|
|
426
|
-
if (!crmResult.ready) {
|
|
427
|
-
for (const issue of crmResult.issues) {
|
|
428
|
-
addReadinessIssue(
|
|
429
|
-
issues,
|
|
430
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
431
|
-
issue.code,
|
|
432
|
-
`Provider interface ${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)} is not ready: ${issue.message}`,
|
|
433
|
-
{ path: issue.path, ref: issue.ref }
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
const bridgeGrant = findSystemInterfaceGrant(model, context, CRM_API_INTERFACE);
|
|
438
|
-
if (bridgeGrant === void 0) {
|
|
439
|
-
addReadinessIssue(
|
|
440
|
-
issues,
|
|
441
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
442
|
-
"missing-topology-grant",
|
|
443
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires a scoped topology grant to "${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)}".`
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
return bridgeGrant;
|
|
447
|
-
}
|
|
448
|
-
function getLeadGenCrmHandoffResourceIds(model) {
|
|
449
|
-
return Object.values(model.resources ?? {}).filter(
|
|
450
|
-
(resource) => resource.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && resource.ontology?.usesCatalogs?.includes(CRM_PIPELINE_CATALOG_ONTOLOGY_ID) === true
|
|
451
|
-
).map((resource) => resource.id);
|
|
452
|
-
}
|
|
453
|
-
function getSystemInterfaceReadinessMarker(model, request) {
|
|
454
|
-
const system = getSystem(model, request.systemPath);
|
|
455
|
-
if (system === void 0) return void 0;
|
|
456
|
-
if (request.interfaceKey === LEAD_GEN_API_INTERFACE.interfaceKey) {
|
|
457
|
-
return system.apiInterface;
|
|
458
|
-
}
|
|
459
|
-
if (request.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
|
|
460
|
-
return {
|
|
461
|
-
lifecycle: "active",
|
|
462
|
-
readinessProfile: LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile,
|
|
463
|
-
resourceIds: getLeadGenCrmHandoffResourceIds(model)
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
return void 0;
|
|
467
|
-
}
|
|
468
|
-
function mergeLeadGenDerivedCatalogs(model) {
|
|
469
|
-
const baseCatalogTypes = model.ontology?.catalogTypes ?? {};
|
|
470
|
-
const derivedCatalogTypes = {};
|
|
471
|
-
if (baseCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] === void 0) {
|
|
472
|
-
derivedCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] = createLeadGenStageCatalog(model);
|
|
473
|
-
}
|
|
474
|
-
if (Object.keys(derivedCatalogTypes).length === 0) return model;
|
|
475
|
-
return {
|
|
476
|
-
...model,
|
|
477
|
-
ontology: {
|
|
478
|
-
...model.ontology ?? {},
|
|
479
|
-
catalogTypes: {
|
|
480
|
-
...baseCatalogTypes,
|
|
481
|
-
...derivedCatalogTypes
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function compileBusinessOntology(model, contractId) {
|
|
487
|
-
const compilation = compileOrganizationOntology(mergeLeadGenDerivedCatalogs(model));
|
|
488
|
-
if (compilation.diagnostics.length > 0) {
|
|
489
|
-
const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
|
|
490
|
-
throw new Error(`${contractId} ontology validation index failed to compile: ${summary}`);
|
|
491
|
-
}
|
|
492
|
-
return {
|
|
493
|
-
ontology: compilation.ontology,
|
|
494
|
-
actionTypesByLegacyId: indexActionTypesByLegacyId(compilation.ontology.actionTypes)
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
function tryCompileBusinessOntology(model, readinessProfile, issues) {
|
|
498
|
-
try {
|
|
499
|
-
return compileBusinessOntology(model, readinessProfile);
|
|
500
|
-
} catch (error) {
|
|
501
|
-
addReadinessIssue(
|
|
502
|
-
issues,
|
|
503
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
504
|
-
"ontology-compile-failed",
|
|
505
|
-
error instanceof Error ? error.message : String(error)
|
|
506
|
-
);
|
|
507
|
-
return void 0;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
function computeInterfaceReadiness(model, request) {
|
|
511
|
-
const issues = [];
|
|
512
|
-
const system = getSystem(model, request.systemPath);
|
|
513
|
-
const systemInterface = getSystemInterfaceReadinessMarker(model, request);
|
|
514
|
-
const readinessProfile = systemInterface === void 0 ? void 0 : profileForInterface(request.systemPath, request.interfaceKey, systemInterface.readinessProfile);
|
|
515
|
-
const scopedResourceIds = systemInterface?.resourceIds ?? [];
|
|
516
|
-
if (system === void 0) {
|
|
517
|
-
addReadinessIssue(
|
|
518
|
-
issues,
|
|
519
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
520
|
-
"missing-system",
|
|
521
|
-
`System "${request.systemPath}" is missing.`,
|
|
522
|
-
{ ref: request.systemPath }
|
|
523
|
-
);
|
|
524
|
-
return { ready: false, systemPath: request.systemPath, interfaceKey: request.interfaceKey, scopedResourceIds, issues };
|
|
525
|
-
}
|
|
526
|
-
if (systemInterface === void 0) {
|
|
527
|
-
addReadinessIssue(
|
|
528
|
-
issues,
|
|
529
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
530
|
-
"missing-interface",
|
|
531
|
-
`System "${request.systemPath}" does not declare interface "${request.interfaceKey}".`,
|
|
532
|
-
{ path: readinessMarkerPath(request) }
|
|
533
|
-
);
|
|
534
|
-
return { ready: false, systemPath: request.systemPath, interfaceKey: request.interfaceKey, scopedResourceIds, issues };
|
|
535
|
-
}
|
|
536
|
-
if (systemInterface.lifecycle !== "active") {
|
|
537
|
-
addReadinessIssue(
|
|
538
|
-
issues,
|
|
539
|
-
"SYSTEM_INTERFACE_DISABLED",
|
|
540
|
-
"inactive-interface",
|
|
541
|
-
`System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" lifecycle is "${systemInterface.lifecycle}".`,
|
|
542
|
-
{ path: `${readinessMarkerPath(request)}.lifecycle` }
|
|
543
|
-
);
|
|
544
|
-
}
|
|
545
|
-
const supportedProfiles = [
|
|
546
|
-
LEAD_GEN_API_INTERFACE.readinessProfile,
|
|
547
|
-
CRM_API_INTERFACE.readinessProfile,
|
|
548
|
-
LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile
|
|
549
|
-
];
|
|
550
|
-
const supportedProfile = readinessProfile !== void 0 && supportedProfiles.some((profile) => profile === readinessProfile);
|
|
551
|
-
if (!supportedProfile) {
|
|
552
|
-
addReadinessIssue(
|
|
553
|
-
issues,
|
|
554
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
555
|
-
"unknown-readiness-profile",
|
|
556
|
-
`System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" references unknown readiness profile "${readinessProfile}".`,
|
|
557
|
-
{ path: `${readinessMarkerPath(request)}.readinessProfile`, ref: readinessProfile }
|
|
558
|
-
);
|
|
559
|
-
return {
|
|
560
|
-
ready: false,
|
|
561
|
-
systemPath: request.systemPath,
|
|
562
|
-
interfaceKey: request.interfaceKey,
|
|
563
|
-
readinessProfile,
|
|
564
|
-
scopedResourceIds,
|
|
565
|
-
issues
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
if (scopedResourceIds.length === 0) {
|
|
569
|
-
addReadinessIssue(
|
|
570
|
-
issues,
|
|
571
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
572
|
-
"missing-scoped-resources",
|
|
573
|
-
`System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" must scope at least one active resource.`,
|
|
574
|
-
{ path: `${readinessMarkerPath(request)}.resourceIds` }
|
|
575
|
-
);
|
|
576
|
-
}
|
|
577
|
-
const checkedReadinessProfile = readinessProfile;
|
|
578
|
-
if (checkedReadinessProfile === void 0) {
|
|
579
|
-
throw new Error("Supported readiness profile unexpectedly resolved to undefined");
|
|
580
|
-
}
|
|
581
|
-
const resources = getActiveScopedResources(model, scopedResourceIds, issues, request);
|
|
582
|
-
const index = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
|
|
583
|
-
if (index !== void 0) {
|
|
584
|
-
if (checkedReadinessProfile === LEAD_GEN_API_INTERFACE.readinessProfile) {
|
|
585
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request);
|
|
586
|
-
} else if (checkedReadinessProfile === CRM_API_INTERFACE.readinessProfile) {
|
|
587
|
-
requireCrmInterfaceReadiness(issues, index, resources, request);
|
|
588
|
-
} else if (checkedReadinessProfile === LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile) {
|
|
589
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request);
|
|
590
|
-
requireCrmInterfaceReadiness(issues, index, resources, { ...request, allowForeignOwner: true });
|
|
591
|
-
requireHandoffBridgeReadiness(issues, model, request);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
return {
|
|
595
|
-
ready: issues.length === 0,
|
|
596
|
-
systemPath: request.systemPath,
|
|
597
|
-
interfaceKey: request.interfaceKey,
|
|
598
|
-
readinessProfile,
|
|
599
|
-
scopedResourceIds,
|
|
600
|
-
issues
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
function findLeadGenTemplateStepCatalog(index) {
|
|
604
|
-
return Object.values(index.ontology.catalogTypes).find(
|
|
605
|
-
(catalog) => catalog.ownerSystemId === "sales.lead-gen" && catalog.kind === "template-step" && catalog.appliesTo === LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
function indexActionTypesByLegacyId(actionTypes) {
|
|
609
|
-
const byLegacyId = {};
|
|
610
|
-
for (const actionType of Object.values(actionTypes)) {
|
|
611
|
-
const legacyActionId = actionType["legacyActionId"];
|
|
612
|
-
if (typeof legacyActionId === "string") {
|
|
613
|
-
byLegacyId[legacyActionId] = actionType;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
return byLegacyId;
|
|
617
|
-
}
|
|
618
|
-
function getCatalogEntries(catalog) {
|
|
619
|
-
return isPlainRecord(catalog.entries) ? catalog.entries : {};
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
// ../core/src/platform/registry/resource-metadata.ts
|
|
623
|
-
var resourceTypeIconNames = {
|
|
624
|
-
agent: "IconBrain",
|
|
625
|
-
workflow: "IconGitBranch",
|
|
626
|
-
trigger: "IconBolt",
|
|
627
|
-
integration: "IconPlug",
|
|
628
|
-
external: "IconExternalLink",
|
|
629
|
-
human: "IconUser"
|
|
630
|
-
};
|
|
631
|
-
var resourceTypeColors = {
|
|
632
|
-
agent: "violet",
|
|
633
|
-
workflow: "blue",
|
|
634
|
-
trigger: "orange",
|
|
635
|
-
integration: "teal",
|
|
636
|
-
external: "gray",
|
|
637
|
-
human: "yellow"
|
|
638
|
-
};
|
|
639
|
-
function getResourceIconName(type) {
|
|
640
|
-
return resourceTypeIconNames[type];
|
|
641
|
-
}
|
|
642
|
-
function getResourceColor(type) {
|
|
643
|
-
return resourceTypeColors[type];
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// ../core/src/operations/observability/utils.ts
|
|
647
|
-
function getTimeRangeDates(range) {
|
|
648
|
-
const end = /* @__PURE__ */ new Date();
|
|
649
|
-
const start = /* @__PURE__ */ new Date();
|
|
650
|
-
switch (range) {
|
|
651
|
-
case "1h":
|
|
652
|
-
start.setHours(start.getHours() - 1);
|
|
653
|
-
break;
|
|
654
|
-
case "24h":
|
|
655
|
-
start.setHours(start.getHours() - 24);
|
|
656
|
-
break;
|
|
657
|
-
case "7d":
|
|
658
|
-
start.setDate(start.getDate() - 7);
|
|
659
|
-
break;
|
|
660
|
-
case "30d":
|
|
661
|
-
start.setDate(start.getDate() - 30);
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
return {
|
|
665
|
-
startDate: start.toISOString(),
|
|
666
|
-
endDate: end.toISOString()
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
function getTimeRangeLabel(range) {
|
|
670
|
-
switch (range) {
|
|
671
|
-
case "1h":
|
|
672
|
-
return "Last 1 hour";
|
|
673
|
-
case "24h":
|
|
674
|
-
return "Last 24 hours";
|
|
675
|
-
case "7d":
|
|
676
|
-
return "Last 7 days";
|
|
677
|
-
case "30d":
|
|
678
|
-
return "Last 30 days";
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
function formatBucketTime(timestamp, granularity) {
|
|
682
|
-
const date = new Date(timestamp);
|
|
683
|
-
if (granularity === "hour") {
|
|
684
|
-
return date.toLocaleTimeString("en-US", {
|
|
685
|
-
hour: "2-digit",
|
|
686
|
-
minute: "2-digit",
|
|
687
|
-
hour12: false
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
return date.toLocaleDateString("en-US", {
|
|
691
|
-
month: "short",
|
|
692
|
-
day: "numeric"
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
// src/utils/resource-icons.tsx
|
|
697
|
-
var iconNameToComponent = {
|
|
698
|
-
IconBrain,
|
|
699
|
-
IconGitBranch,
|
|
700
|
-
IconBolt,
|
|
701
|
-
IconPlug,
|
|
702
|
-
IconExternalLink,
|
|
703
|
-
IconUser
|
|
704
|
-
};
|
|
705
|
-
function getResourceIcon(type) {
|
|
706
|
-
const iconName = getResourceIconName(type);
|
|
707
|
-
return iconNameToComponent[iconName];
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
// src/utils/constants/api.ts
|
|
711
|
-
var API_URL = import.meta.env.PROD ? "https://api.elevasis.io" : "http://localhost:5170";
|
|
712
|
-
|
|
713
|
-
// src/utils/constants/polling.ts
|
|
714
|
-
var REFETCH_INTERVAL_DASHBOARD = 6e4;
|
|
715
|
-
var REFETCH_INTERVAL_REALTIME = 3e4;
|
|
716
|
-
var REFETCH_INTERVAL_RUNNING = 2e3;
|
|
717
|
-
var REFETCH_INTERVAL_RUNNING_FAST = 1e3;
|
|
718
|
-
|
|
719
|
-
// src/utils/constants/reconnection.ts
|
|
720
|
-
var SSE_TOKEN_REFRESH_DELAY = 2e3;
|
|
721
|
-
var SSE_CLOSE_GRACE_PERIOD = 5e3;
|
|
722
|
-
var WS_RECONNECT_BASE_DELAY = 1e3;
|
|
723
|
-
var WS_RECONNECT_MAX_DELAY = 3e4;
|
|
724
|
-
var WS_MAX_RETRIES_BEFORE_ERROR = 3;
|
|
725
|
-
|
|
726
|
-
// src/utils/constants/ui.ts
|
|
727
|
-
var PAGE_SIZE_DEFAULT = 20;
|
|
728
|
-
var LIMIT_ACTIVITY_FEED = 50;
|
|
729
|
-
var DEBOUNCE_FILTER = 150;
|
|
730
|
-
var DEBOUNCE_SLIDER = 500;
|
|
731
|
-
var OAUTH_FLOW_TIMEOUT = 3e5;
|
|
732
|
-
|
|
733
|
-
// src/utils/suppress-warnings.ts
|
|
734
|
-
var SUPPRESSED_WARNINGS = [
|
|
735
|
-
// Mantine SegmentedControl data-orientation deprecation warnings
|
|
736
|
-
/Unsupported style property.*data-orientation/i,
|
|
737
|
-
/Did you mean.*dataOrientation/i,
|
|
738
|
-
// Recharts/Mantine Charts dimension warnings (charts work fine after layout completes)
|
|
739
|
-
/The width\(-1\) and height\(-1\) of chart should be greater than 0/i
|
|
740
|
-
];
|
|
741
|
-
var originalConsoleError = console.error;
|
|
742
|
-
var originalConsoleWarn = console.warn;
|
|
743
|
-
function suppressKnownWarnings() {
|
|
744
|
-
console.error = (...args) => {
|
|
745
|
-
const message = args.join(" ");
|
|
746
|
-
const shouldSuppress = SUPPRESSED_WARNINGS.some((pattern) => pattern.test(message));
|
|
747
|
-
if (!shouldSuppress) {
|
|
748
|
-
originalConsoleError(...args);
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
console.warn = (...args) => {
|
|
752
|
-
const message = args.join(" ");
|
|
753
|
-
const shouldSuppress = SUPPRESSED_WARNINGS.some((pattern) => pattern.test(message));
|
|
754
|
-
if (!shouldSuppress) {
|
|
755
|
-
originalConsoleWarn(...args);
|
|
756
|
-
}
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
function restoreConsole() {
|
|
760
|
-
console.error = originalConsoleError;
|
|
761
|
-
console.warn = originalConsoleWarn;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
// src/utils/browser-mocks.ts
|
|
765
|
-
function setupMatchMedia() {
|
|
766
|
-
const win = globalThis.window;
|
|
767
|
-
if (typeof win === "undefined") return;
|
|
768
|
-
Object.defineProperty(win, "matchMedia", {
|
|
769
|
-
writable: true,
|
|
770
|
-
value: (query) => ({
|
|
771
|
-
matches: false,
|
|
772
|
-
media: query,
|
|
773
|
-
onchange: null,
|
|
774
|
-
addListener: () => {
|
|
775
|
-
},
|
|
776
|
-
removeListener: () => {
|
|
777
|
-
},
|
|
778
|
-
addEventListener: () => {
|
|
779
|
-
},
|
|
780
|
-
removeEventListener: () => {
|
|
781
|
-
},
|
|
782
|
-
dispatchEvent: () => true
|
|
783
|
-
})
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
function setupResizeObserver() {
|
|
787
|
-
globalThis.ResizeObserver = class ResizeObserver {
|
|
788
|
-
observe() {
|
|
789
|
-
}
|
|
790
|
-
unobserve() {
|
|
791
|
-
}
|
|
792
|
-
disconnect() {
|
|
793
|
-
}
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
function setupBrowserMocks() {
|
|
797
|
-
setupMatchMedia();
|
|
798
|
-
setupResizeObserver();
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
export { APIClientError, API_URL, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, LEAD_GEN_API_INTERFACE, LIMIT_ACTIVITY_FEED, OAUTH_FLOW_TIMEOUT, PAGE_SIZE_DEFAULT, REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_REALTIME, REFETCH_INTERVAL_RUNNING, REFETCH_INTERVAL_RUNNING_FAST, SSE_CLOSE_GRACE_PERIOD, SSE_TOKEN_REFRESH_DELAY, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, computeInterfaceReadiness, debounce, formatBucketTime, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, getTimeRangeDates, getTimeRangeLabel, isAPIClientError, restoreConsole, setupBrowserMocks, suppressKnownWarnings, validateEmail };
|