@dx-do/client 7.7.2 → 7.9.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/index.cjs.js +1384 -337
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1349 -338
- package/dist/index.esm.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/model/alarm/alarm-enrichment-rule.d.ts +263 -0
- package/dist/src/lib/model/alarm/alarm-enrichment-rule.d.ts.map +1 -0
- package/dist/src/lib/model/channel/ticket-enrichment.d.ts +201 -0
- package/dist/src/lib/model/channel/ticket-enrichment.d.ts.map +1 -0
- package/dist/src/lib/model/config/DXDoConfiguration.d.ts +8 -0
- package/dist/src/lib/model/config/DXDoConfiguration.d.ts.map +1 -1
- package/dist/src/lib/model/datastore/tas/store.d.ts +114 -129
- package/dist/src/lib/model/datastore/tas/store.d.ts.map +1 -1
- package/dist/src/lib/model/log/ingest.d.ts +13 -0
- package/dist/src/lib/model/log/ingest.d.ts.map +1 -1
- package/dist/src/lib/model/nass/NASS.d.ts +4 -2
- package/dist/src/lib/model/nass/NASS.d.ts.map +1 -1
- package/dist/src/lib/model/oi/services.create.d.ts +19 -0
- package/dist/src/lib/model/oi/services.create.d.ts.map +1 -1
- package/dist/src/lib/model/oi/services.transform.d.ts +20 -1
- package/dist/src/lib/model/oi/services.transform.d.ts.map +1 -1
- package/dist/src/lib/model/service/service-overview.d.ts +2 -0
- package/dist/src/lib/model/service/service-overview.d.ts.map +1 -1
- package/dist/src/lib/model/tas/TASGraph.d.ts +7 -3
- package/dist/src/lib/model/tas/TASGraph.d.ts.map +1 -1
- package/dist/src/lib/services/alarm.service.d.ts +78 -4
- package/dist/src/lib/services/alarm.service.d.ts.map +1 -1
- package/dist/src/lib/services/channel.service.d.ts +42 -0
- package/dist/src/lib/services/channel.service.d.ts.map +1 -1
- package/dist/src/lib/services/datastore/datastore-metrics-metadata.service.d.ts +6 -3
- package/dist/src/lib/services/datastore/datastore-metrics-metadata.service.d.ts.map +1 -1
- package/dist/src/lib/services/datastore/datastore-nass.service.d.ts +6 -2
- package/dist/src/lib/services/datastore/datastore-nass.service.d.ts.map +1 -1
- package/dist/src/lib/services/datastore/datastore-tas.service.d.ts +8 -5
- package/dist/src/lib/services/datastore/datastore-tas.service.d.ts.map +1 -1
- package/dist/src/lib/services/dx-saas.service.d.ts +16 -7
- package/dist/src/lib/services/dx-saas.service.d.ts.map +1 -1
- package/dist/src/lib/services/event.service.d.ts +10 -1
- package/dist/src/lib/services/event.service.d.ts.map +1 -1
- package/dist/src/lib/services/logs.service.d.ts +40 -0
- package/dist/src/lib/services/logs.service.d.ts.map +1 -1
- package/dist/src/lib/services/service.service.d.ts +24 -2
- package/dist/src/lib/services/service.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -267,6 +267,608 @@ exports.AlarmEnrichmentFilter = void 0;
|
|
|
267
267
|
AlarmEnrichmentFilter.convertFilterToNode = convertFilterToNode;
|
|
268
268
|
})(exports.AlarmEnrichmentFilter || (exports.AlarmEnrichmentFilter = {}));
|
|
269
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Write bodies for notification policies (`dxinotify/notify/v1/filters`) and
|
|
272
|
+
* message templates (`dxinotify/notify/v1/templates`) — the key sets the UI
|
|
273
|
+
* sends, observed in HAR captures on the lab tenant. Both endpoints use one
|
|
274
|
+
* `PUT` for create and update: policies discriminate on `id` (0 creates),
|
|
275
|
+
* templates on `oldTemplateName` (null creates, the current name updates).
|
|
276
|
+
* The read shapes carry more (author, timestamps, contentVersion, …); the
|
|
277
|
+
* projections below drop them.
|
|
278
|
+
*/
|
|
279
|
+
const PolicyLinkedEntitySchema = v4.z.looseObject({
|
|
280
|
+
channelName: v4.z.string().describe('Channel the policy delivers to'),
|
|
281
|
+
messageTemplateName: v4.z
|
|
282
|
+
.string()
|
|
283
|
+
.nullable()
|
|
284
|
+
.optional()
|
|
285
|
+
.describe('Template override for this channel; "" (write) / null (read) for the channel default'),
|
|
286
|
+
});
|
|
287
|
+
const PolicyWriteBodySchema = v4.z.looseObject({
|
|
288
|
+
id: v4.z.number().describe('Policy id; 0 creates, an existing id updates in place'),
|
|
289
|
+
orgId: v4.z.string().describe('Tenant common name; stamped by the service'),
|
|
290
|
+
keyLevel: v4.z.number().describe('1 for user policies (the built-in default policy reads -1)'),
|
|
291
|
+
name: v4.z.string().min(1).describe('Policy (filter) name; unique per tenant'),
|
|
292
|
+
filterType: v4.z.string().describe('"AUTOMATIC" or "MANUAL"'),
|
|
293
|
+
reminderTime: v4.z.number().describe('Reminder interval; 0 = none'),
|
|
294
|
+
reminderTimeUnit: v4.z.string().describe('Reminder unit, e.g. HOURS'),
|
|
295
|
+
channelNames: v4.z.array(v4.z.string()).describe('Channels the policy delivers to, by name'),
|
|
296
|
+
active: v4.z.boolean().describe('true = enabled'),
|
|
297
|
+
description: v4.z.string().describe('Free-text description'),
|
|
298
|
+
alarmCategory: v4.z.string().describe('rawAlarm, service, or SituationCluster'),
|
|
299
|
+
serviceAlarmAction: v4.z.boolean().describe('Service-alarm action flag'),
|
|
300
|
+
filterExpressionV1: v4.z.unknown().describe('Opaque alarm-match expression tree, round-tripped verbatim'),
|
|
301
|
+
isComplexFilter: v4.z.boolean().describe('Complex-filter flag'),
|
|
302
|
+
jobInfo: v4.z.unknown().nullable().optional().describe('null on UI writes'),
|
|
303
|
+
linkedEntities: v4.z.array(PolicyLinkedEntitySchema).describe('Channel ↔ template links'),
|
|
304
|
+
linkedMappings: v4.z.array(v4.z.unknown()).optional().describe('[] on UI writes'),
|
|
305
|
+
linkedActions: v4.z.array(v4.z.unknown()).optional().describe('Alarm actions; [] when none'),
|
|
306
|
+
});
|
|
307
|
+
const PolicyWriteResponseSchema = v4.z.looseObject({
|
|
308
|
+
newContentVersion: v4.z.number().describe('0 for a create, previous + 1 for an update'),
|
|
309
|
+
});
|
|
310
|
+
const TemplateWriteBodySchema = v4.z.looseObject({
|
|
311
|
+
orgId: v4.z.string().describe('Tenant common name; stamped by the service'),
|
|
312
|
+
keyLevel: v4.z.number().describe('Always 1'),
|
|
313
|
+
defaultTemplate: v4.z
|
|
314
|
+
.union([v4.z.boolean(), v4.z.string()])
|
|
315
|
+
.describe('Built-in platform template flag; false for user templates (the read shape carries "true"/"false" strings)'),
|
|
316
|
+
templateName: v4.z.string().min(1).describe('Template name; unique per tenant'),
|
|
317
|
+
oldTemplateName: v4.z
|
|
318
|
+
.string()
|
|
319
|
+
.nullable()
|
|
320
|
+
.describe('null creates; the current name updates in place (a different name renames)'),
|
|
321
|
+
contentVersion: v4.z.number().describe('0 on create; the current version on update'),
|
|
322
|
+
locale: v4.z.string().describe('Locale; "en_US" in practice'),
|
|
323
|
+
subjectTemplate: v4.z.string().describe('Subject line template'),
|
|
324
|
+
senderNameTemplate: v4.z.string().describe('Sender display name'),
|
|
325
|
+
imageUsage: v4.z.number().describe('0 in practice'),
|
|
326
|
+
channelNames: v4.z.array(v4.z.string()).describe('Channels using this template (reverse index); [] on create'),
|
|
327
|
+
useHtml: v4.z.boolean().describe('Render templateHtml instead of templateText'),
|
|
328
|
+
templateText: v4.z.string().describe('Body template, base64-encoded (stored and returned encoded)'),
|
|
329
|
+
templateHtml: v4.z.string().describe('HTML body; "" when unused'),
|
|
330
|
+
linkedEntities: v4.z.array(v4.z.unknown()).describe('Policy links (reverse index); [] on create'),
|
|
331
|
+
});
|
|
332
|
+
const TemplateWriteResponseSchema = v4.z.looseObject({
|
|
333
|
+
existingTemplateUpdated: v4.z.boolean().describe('true when an existing template was updated'),
|
|
334
|
+
newContentVersion: v4.z.number().describe('Content version after the save'),
|
|
335
|
+
});
|
|
336
|
+
/** Built-in / platform-managed policies read back with author SYSTEM (or none, for the default policy). */
|
|
337
|
+
function isBuiltInPolicy(policy) {
|
|
338
|
+
return policy.author === undefined || policy.author === null || policy.author === 'SYSTEM';
|
|
339
|
+
}
|
|
340
|
+
/** Built-in templates are flagged defaultTemplate; platform-provided ones without the flag have no author. */
|
|
341
|
+
function isBuiltInTemplate(template) {
|
|
342
|
+
return (template.defaultTemplate === true ||
|
|
343
|
+
template.defaultTemplate === 'true' ||
|
|
344
|
+
template.author === undefined ||
|
|
345
|
+
template.author === null);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Projects a policy as read from a tenant (or an export file) onto the write
|
|
349
|
+
* body the UI sends: read-only fields dropped, `id`/`orgId` replaced with the
|
|
350
|
+
* target's, `jobInfo` null, links reduced to channel + template names.
|
|
351
|
+
*/
|
|
352
|
+
function toPolicyWriteBody(source, opts) {
|
|
353
|
+
const keyLevel = typeof source.keyLevel === 'number' && source.keyLevel >= 0 ? source.keyLevel : 1;
|
|
354
|
+
return {
|
|
355
|
+
id: opts.id,
|
|
356
|
+
orgId: opts.orgId,
|
|
357
|
+
keyLevel,
|
|
358
|
+
name: source.name,
|
|
359
|
+
filterType: source.filterType ?? 'AUTOMATIC',
|
|
360
|
+
reminderTime: source.reminderTime ?? 0,
|
|
361
|
+
reminderTimeUnit: source.reminderTimeUnit ?? 'HOURS',
|
|
362
|
+
channelNames: source.channelNames ?? [],
|
|
363
|
+
active: source.active ?? true,
|
|
364
|
+
description: source.description ?? '',
|
|
365
|
+
alarmCategory: source.alarmCategory ?? 'rawAlarm',
|
|
366
|
+
serviceAlarmAction: source.serviceAlarmAction ?? false,
|
|
367
|
+
filterExpressionV1: source.filterExpressionV1,
|
|
368
|
+
isComplexFilter: source.isComplexFilter ?? false,
|
|
369
|
+
jobInfo: null,
|
|
370
|
+
linkedEntities: (source.linkedEntities ?? []).map((link) => ({
|
|
371
|
+
channelName: link.channelName,
|
|
372
|
+
messageTemplateName: link.messageTemplateName ?? '',
|
|
373
|
+
})),
|
|
374
|
+
linkedMappings: [],
|
|
375
|
+
linkedActions: source.linkedActions ?? [],
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Projects a template as read from a tenant (or an export file) onto the write
|
|
380
|
+
* body the UI sends. `oldTemplateName` null creates; pass the target's current
|
|
381
|
+
* name and contentVersion to update in place. templateText stays base64.
|
|
382
|
+
*/
|
|
383
|
+
function toTemplateWriteBody(source, opts) {
|
|
384
|
+
return {
|
|
385
|
+
orgId: opts.orgId,
|
|
386
|
+
keyLevel: 1,
|
|
387
|
+
defaultTemplate: opts.defaultTemplate ?? false,
|
|
388
|
+
templateName: source.templateName,
|
|
389
|
+
oldTemplateName: opts.oldTemplateName,
|
|
390
|
+
contentVersion: opts.contentVersion,
|
|
391
|
+
locale: source.locale ?? 'en_US',
|
|
392
|
+
subjectTemplate: source.subjectTemplate ?? '',
|
|
393
|
+
senderNameTemplate: source.senderNameTemplate ?? '',
|
|
394
|
+
imageUsage: source.imageUsage ?? 0,
|
|
395
|
+
channelNames: opts.channelNames ?? [],
|
|
396
|
+
useHtml: source.useHtml ?? false,
|
|
397
|
+
templateText: source.templateText ?? '',
|
|
398
|
+
templateHtml: source.templateHtml ?? '',
|
|
399
|
+
linkedEntities: [],
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
// ---------------------------------------------------------------------------
|
|
403
|
+
// Policy filter expressions
|
|
404
|
+
// ---------------------------------------------------------------------------
|
|
405
|
+
const POLICY_ALARM_CATEGORIES = ['rawAlarm', 'service', 'SituationCluster'];
|
|
406
|
+
/**
|
|
407
|
+
* Conditions accepted in policy filter atoms. `equals`, `not_equals`,
|
|
408
|
+
* `greater_than`, `increases`, and `changed` are observed in UI-authored
|
|
409
|
+
* policies; the string matchers come from the platform's shared filter model.
|
|
410
|
+
*/
|
|
411
|
+
const POLICY_FILTER_CONDITIONS = [
|
|
412
|
+
'equals',
|
|
413
|
+
'not_equals',
|
|
414
|
+
'contains',
|
|
415
|
+
'not_contains',
|
|
416
|
+
'starts_with',
|
|
417
|
+
'not_starts_with',
|
|
418
|
+
'ends_with',
|
|
419
|
+
'not_ends_with',
|
|
420
|
+
'greater_than',
|
|
421
|
+
'less_than',
|
|
422
|
+
'increases',
|
|
423
|
+
'decreases',
|
|
424
|
+
'changed',
|
|
425
|
+
];
|
|
426
|
+
const PolicyFilterAtomSchema = v4.z.looseObject({
|
|
427
|
+
field: v4.z.string().min(1).describe('Alarm field name (see the per-category field catalog)'),
|
|
428
|
+
fieldDescription: v4.z.string().optional().describe('Human label the UI stores next to the field'),
|
|
429
|
+
condition: v4.z.string().describe('One of the policy filter conditions, e.g. equals, not_equals, greater_than, changed'),
|
|
430
|
+
value: v4.z
|
|
431
|
+
.union([v4.z.string(), v4.z.boolean(), v4.z.number()])
|
|
432
|
+
.describe('Comparison value; "" for changed, the field name itself for increases/decreases'),
|
|
433
|
+
});
|
|
434
|
+
const PolicyFilterExpressionLazy = v4.z.lazy(() => v4.z.union([
|
|
435
|
+
PolicyFilterAtomSchema,
|
|
436
|
+
v4.z.looseObject({ and: v4.z.looseObject({ expressions: v4.z.array(PolicyFilterExpressionLazy) }) }),
|
|
437
|
+
v4.z.looseObject({ or: v4.z.looseObject({ expressions: v4.z.array(PolicyFilterExpressionLazy) }) }),
|
|
438
|
+
]));
|
|
439
|
+
/** Recursive and/or tree of {@link PolicyFilterAtomSchema} atoms (`filterExpressionV1`). */
|
|
440
|
+
const PolicyFilterExpressionSchema = PolicyFilterExpressionLazy;
|
|
441
|
+
/**
|
|
442
|
+
* The atoms the UI prepends for a category so the policy only sees its own
|
|
443
|
+
* alarm kind: rawAlarm and SituationCluster are observed; service mirrors them.
|
|
444
|
+
*/
|
|
445
|
+
function policyCategoryGuard(category) {
|
|
446
|
+
switch (category) {
|
|
447
|
+
case 'rawAlarm':
|
|
448
|
+
return [{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'not_equals', value: 'Service' }];
|
|
449
|
+
case 'service':
|
|
450
|
+
return [{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'equals', value: 'Service' }];
|
|
451
|
+
case 'SituationCluster':
|
|
452
|
+
return [
|
|
453
|
+
{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'equals', value: 'SituationCluster' },
|
|
454
|
+
{ field: 'isOrphan', fieldDescription: 'Is Orphan', condition: 'equals', value: false },
|
|
455
|
+
];
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Builds `filterExpressionV1` the way the UI does: an outer AND of the
|
|
460
|
+
* category guard group and the user's atoms (AND-ed). No atoms → guard only.
|
|
461
|
+
*/
|
|
462
|
+
function buildPolicyFilterExpression(category, atoms) {
|
|
463
|
+
const guard = { and: { expressions: policyCategoryGuard(category) } };
|
|
464
|
+
if (atoms.length === 0) {
|
|
465
|
+
return guard;
|
|
466
|
+
}
|
|
467
|
+
return { and: { expressions: [guard, { and: { expressions: atoms } }] } };
|
|
468
|
+
}
|
|
469
|
+
/** Flattens an expression into its atoms (for previews and field checks). */
|
|
470
|
+
function policyFilterAtoms(expression) {
|
|
471
|
+
if ('condition' in expression) {
|
|
472
|
+
return [expression];
|
|
473
|
+
}
|
|
474
|
+
if ('and' in expression) {
|
|
475
|
+
return expression.and.expressions.flatMap(policyFilterAtoms);
|
|
476
|
+
}
|
|
477
|
+
if ('or' in expression) {
|
|
478
|
+
return expression.or.expressions.flatMap(policyFilterAtoms);
|
|
479
|
+
}
|
|
480
|
+
return [];
|
|
481
|
+
}
|
|
482
|
+
/** One entry of the per-category alarm field catalog the policy editor offers. */
|
|
483
|
+
const AlarmFilterFieldSchema = v4.z.looseObject({
|
|
484
|
+
field: v4.z.string().describe('Field name to use in filter atoms'),
|
|
485
|
+
fieldDescription: v4.z.string().describe('Human label'),
|
|
486
|
+
values: v4.z.array(v4.z.string()).describe('Closed vocabulary when non-empty (e.g. severity levels)'),
|
|
487
|
+
fieldType: v4.z.string().describe('String, Number, …'),
|
|
488
|
+
});
|
|
489
|
+
const AlarmFilterFieldsResponseSchema = v4.z.array(AlarmFilterFieldSchema);
|
|
490
|
+
/** The catalog endpoint per alarm category (`GET`, bare array). */
|
|
491
|
+
const ALARM_FILTER_FIELD_PATHS = {
|
|
492
|
+
rawAlarm: 'oi/v2/api/normalizedalarms/fields',
|
|
493
|
+
service: 'oi/v2/api/dxservicealarms/fields',
|
|
494
|
+
SituationCluster: 'oi/v2/api/dxiclusteralarms/fields',
|
|
495
|
+
};
|
|
496
|
+
// ---------------------------------------------------------------------------
|
|
497
|
+
// Deletes (endpoints found by probing — absent from every UI HAR)
|
|
498
|
+
// ---------------------------------------------------------------------------
|
|
499
|
+
/** Response of `DELETE dxinotify/notify/v1/filters/{orgId}/{name}`. */
|
|
500
|
+
const PolicyDeleteResponseSchema = v4.z.looseObject({
|
|
501
|
+
deletedCount: v4.z.number().describe('1 when the policy was deleted'),
|
|
502
|
+
});
|
|
503
|
+
/** Response of `DELETE dxinotify/notify/v1/templates/{name}/{locale}/{orgId}`. */
|
|
504
|
+
const TemplateDeleteResponseSchema = v4.z.looseObject({
|
|
505
|
+
deletedCount: v4.z.number().describe('Rows removed (3 observed for one template: content plus its link rows)'),
|
|
506
|
+
});
|
|
507
|
+
const ITSM_TEMPLATE_KEYS = new Set([
|
|
508
|
+
'ITSM_ALL_ALARM_TEMPLATE_NAME',
|
|
509
|
+
'ITSM_SERVICE_ALARM_TEMPLATE_NAME',
|
|
510
|
+
'ITSM_SITUATION_TEMPLATE_NAME',
|
|
511
|
+
]);
|
|
512
|
+
/** Who uses a template, computed from the channel and policy lists (not the template's own reverse index, which can lag). */
|
|
513
|
+
function templateUsage(templateName, channels, policies) {
|
|
514
|
+
return {
|
|
515
|
+
channels: channels
|
|
516
|
+
.filter((channel) => (channel.smtpItsmConfigs?.templates ?? []).some((t) => t.templateName === templateName) ||
|
|
517
|
+
(channel.itsmConfig?.PropertyList ?? []).some((p) => ITSM_TEMPLATE_KEYS.has(p.propertyName) && p.propertyValue === templateName))
|
|
518
|
+
.map((channel) => channel.name),
|
|
519
|
+
policies: policies
|
|
520
|
+
.filter((policy) => (policy.linkedEntities ?? []).some((link) => link.messageTemplateName === templateName))
|
|
521
|
+
.map((policy) => policy.name),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Alarm enrichment rules: the priority-ordered rules of Settings → Alarm
|
|
527
|
+
* Enrichment Rules. Each rule matches alarms with an and/or filter tree and
|
|
528
|
+
* copies a TAS topology attribute (or a literal value) onto one of the
|
|
529
|
+
* alarm's `custom_N` fields.
|
|
530
|
+
*
|
|
531
|
+
* Store: `oi/v2/alarm/enrichment/rules` — `GET` lists, `PUT` saves one rule
|
|
532
|
+
* (no `rule_id` creates, an existing `rule_id` updates in place), `DELETE
|
|
533
|
+
* rules/{rule_id}` removes one, and `PUT rules/preview` runs the rule against
|
|
534
|
+
* recent alarms without persisting anything.
|
|
535
|
+
*
|
|
536
|
+
* Shapes observed in HARs of the demo and lab tenants
|
|
537
|
+
* (alarm-ticket-enrichment{,-2,-3}.har, 2026-09-08).
|
|
538
|
+
*
|
|
539
|
+
* @see {@link EnrichmentCustomFieldSchema} — the registry that binds an
|
|
540
|
+
* attribute name to its `custom_N` field and decides the TAS / CUSTOM arm.
|
|
541
|
+
*/
|
|
542
|
+
/**
|
|
543
|
+
* Conditions the enrichment filter editor offers. Eight string matchers, a
|
|
544
|
+
* subset of the platform filter model's conditions — enrichment filters have
|
|
545
|
+
* no numeric or change-detection operators.
|
|
546
|
+
*/
|
|
547
|
+
const ENRICHMENT_FILTER_CONDITIONS = [
|
|
548
|
+
'equals',
|
|
549
|
+
'not_equals',
|
|
550
|
+
'contains',
|
|
551
|
+
'not_contains',
|
|
552
|
+
'starts_with',
|
|
553
|
+
'not_starts_with',
|
|
554
|
+
'ends_with',
|
|
555
|
+
'not_ends_with',
|
|
556
|
+
];
|
|
557
|
+
/** The two enrichment arms: a TAS topology attribute, or a literal CUSTOM value. */
|
|
558
|
+
const ENRICHMENT_SOURCES = ['TAS', 'CUSTOM'];
|
|
559
|
+
/** The preview windows the editor offers, in seconds. The query param is milliseconds. */
|
|
560
|
+
const ENRICHMENT_PREVIEW_WINDOWS = {
|
|
561
|
+
'1h': 3600,
|
|
562
|
+
'4h': 14400,
|
|
563
|
+
'8h': 28800,
|
|
564
|
+
'24h': 86400,
|
|
565
|
+
'3d': 259200,
|
|
566
|
+
'1w': 604800,
|
|
567
|
+
};
|
|
568
|
+
// ---------------------------------------------------------------------------
|
|
569
|
+
// Wire shapes
|
|
570
|
+
// ---------------------------------------------------------------------------
|
|
571
|
+
const EnrichmentMappingSchema = v4.z.looseObject({
|
|
572
|
+
alarmField: v4.z
|
|
573
|
+
.string()
|
|
574
|
+
.min(1)
|
|
575
|
+
.describe("Target alarm field, always a custom slot ('custom_16'); from the custom-field registry"),
|
|
576
|
+
enrichmentField: v4.z
|
|
577
|
+
.string()
|
|
578
|
+
.describe("Source: a TAS vertex attribute name ('networkInterfaces') or the CUSTOM entry's label"),
|
|
579
|
+
defaultValue: v4.z.string().describe("Value written when the source resolves to nothing; '' for none"),
|
|
580
|
+
});
|
|
581
|
+
const EnrichmentSchema = v4.z.looseObject({
|
|
582
|
+
type: v4.z.enum(ENRICHMENT_SOURCES).describe("'TAS' resolves from the topology graph; 'CUSTOM' writes a literal"),
|
|
583
|
+
filename: v4.z
|
|
584
|
+
.string()
|
|
585
|
+
.nullable()
|
|
586
|
+
.optional()
|
|
587
|
+
.describe('Reserved for CSV-backed CUSTOM enrichment; the UI sends null on save and the server drops it'),
|
|
588
|
+
mappings: v4.z.array(EnrichmentMappingSchema).describe('Mappings of this arm; [] when the arm is unused'),
|
|
589
|
+
});
|
|
590
|
+
const EnrichmentRuleSchema = v4.z.looseObject({
|
|
591
|
+
tenant_id: v4.z.string().describe('Cohort UUID the rule belongs to; server-assigned'),
|
|
592
|
+
rule_id: v4.z.string().describe('Rule UUID; the identifier for detail, update, reorder and delete'),
|
|
593
|
+
rule_name: v4.z.string().describe('Display name; unique per tenant, enforced by the server'),
|
|
594
|
+
priority: v4.z
|
|
595
|
+
.number()
|
|
596
|
+
.describe('Evaluation order, ascending — lower runs first. Seeded from the create timestamp; a reorder ' +
|
|
597
|
+
'writes the midpoint of its new neighbours, hence fractional values'),
|
|
598
|
+
rule_version: v4.z.number().describe('Optimistic version; send the current value, the server increments it'),
|
|
599
|
+
created_by: v4.z.string().optional().describe('Email of the creator'),
|
|
600
|
+
updated_by: v4.z.string().optional().describe('Email of the last editor'),
|
|
601
|
+
created_time: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
602
|
+
updated_time: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
603
|
+
enabled: v4.z.boolean().describe('Whether the rule is evaluated'),
|
|
604
|
+
filter: PolicyFilterExpressionSchema.describe('and/or tree of match atoms over the enrichment field catalog'),
|
|
605
|
+
filterSearchFields: v4.z.array(v4.z.unknown()).optional().describe('UI search state; always [] in captures'),
|
|
606
|
+
enrichments: v4.z.array(EnrichmentSchema).describe('One entry per arm; the UI always sends both TAS and CUSTOM'),
|
|
607
|
+
isComplexFilter: v4.z.boolean().optional().describe('true when the filter was authored in the raw expression editor'),
|
|
608
|
+
});
|
|
609
|
+
const EnrichmentRulesResponseSchema = v4.z.array(EnrichmentRuleSchema);
|
|
610
|
+
/**
|
|
611
|
+
* The body of `PUT oi/v2/alarm/enrichment/rules`. Omitting `rule_id` creates a
|
|
612
|
+
* rule and lets the server seed `priority` from the create time; sending one
|
|
613
|
+
* updates in place, and is also how a reorder writes a new `priority`.
|
|
614
|
+
*/
|
|
615
|
+
const EnrichmentRuleWriteBodySchema = v4.z.looseObject({
|
|
616
|
+
rule_id: v4.z.string().optional().describe('Rule UUID; absent creates, present updates in place'),
|
|
617
|
+
rule_name: v4.z
|
|
618
|
+
.string()
|
|
619
|
+
.min(1)
|
|
620
|
+
.describe('Display name; must be unique in the tenant — a clash is rejected with 400 "Duplicate rule name provided"'),
|
|
621
|
+
enabled: v4.z.boolean().describe('Whether the rule is evaluated'),
|
|
622
|
+
filter: PolicyFilterExpressionSchema.describe('and/or tree of match atoms'),
|
|
623
|
+
isComplexFilter: v4.z.boolean().describe('false for trees built from atoms'),
|
|
624
|
+
enrichments: v4.z.array(EnrichmentSchema).describe('Both arms, each with its mappings ([] when unused)'),
|
|
625
|
+
priority: v4.z.number().optional().describe('Update only: the new evaluation order. Absent on create'),
|
|
626
|
+
rule_version: v4.z.number().optional().describe('Update only: the rule\'s current version, echoed back'),
|
|
627
|
+
tenant_id: v4.z.string().optional().describe('Update only: echoed from the existing rule'),
|
|
628
|
+
created_by: v4.z.string().optional().describe('Update only: echoed from the existing rule'),
|
|
629
|
+
updated_by: v4.z.string().optional().describe('Update only: echoed from the existing rule'),
|
|
630
|
+
created_time: v4.z.number().optional().describe('Update only: echoed from the existing rule'),
|
|
631
|
+
updated_time: v4.z.number().optional().describe('Update only: echoed from the existing rule'),
|
|
632
|
+
filterSearchFields: v4.z.array(v4.z.unknown()).optional().describe('Update only: echoed from the existing rule'),
|
|
633
|
+
});
|
|
634
|
+
/**
|
|
635
|
+
* The response of `PUT oi/v2/alarm/enrichment/rules/preview`. A server-side dry
|
|
636
|
+
* run: it accepts a rule with no `rule_id` and persists nothing.
|
|
637
|
+
*/
|
|
638
|
+
const EnrichmentPreviewResponseSchema = v4.z.looseObject({
|
|
639
|
+
alarmCount: v4.z
|
|
640
|
+
.union([v4.z.string(), v4.z.number()])
|
|
641
|
+
.describe('Matching alarms in the window, as a string in captures ("0")'),
|
|
642
|
+
alarms: v4.z.array(v4.z.looseObject({})).describe('The matched alarms, up to `size`, with the enrichment applied'),
|
|
643
|
+
pageNumber: v4.z.number().nullable().optional().describe('Null in captures'),
|
|
644
|
+
pageSize: v4.z.number().nullable().optional().describe('Null in captures'),
|
|
645
|
+
aggregatedData: v4.z.unknown().optional().describe('Null in captures'),
|
|
646
|
+
itsmEnabled: v4.z.boolean().optional().describe('Whether the tenant has an ITSM integration'),
|
|
647
|
+
});
|
|
648
|
+
/**
|
|
649
|
+
* One entry of the custom-field registry
|
|
650
|
+
* (`oi/v3/api/notifications/configAttributes?configKey=custom.field.description`).
|
|
651
|
+
* This is what binds a `custom_N` slot to an attribute name and decides which
|
|
652
|
+
* arm a mapping lands in. The `PUT` replaces the whole list.
|
|
653
|
+
*/
|
|
654
|
+
const EnrichmentCustomFieldSchema = v4.z.looseObject({
|
|
655
|
+
field: v4.z.string().describe("The custom slot, 'custom_11' through 'custom_24' in captures"),
|
|
656
|
+
fieldDescription: v4.z
|
|
657
|
+
.string()
|
|
658
|
+
.describe("The attribute name a mapping references as its enrichmentField ('networkInterfaces')"),
|
|
659
|
+
fieldType: v4.z.string().describe("Value type; 'String' in every capture"),
|
|
660
|
+
fieldSource: v4.z.string().describe("'TAS' resolves from the topology graph, 'CUSTOM' holds a literal"),
|
|
661
|
+
});
|
|
662
|
+
const EnrichmentCustomFieldsResponseSchema = v4.z.array(EnrichmentCustomFieldSchema);
|
|
663
|
+
/** `custom_1` … `custom_N`; the only shape the registry and mappings accept. */
|
|
664
|
+
const CUSTOM_FIELD_PATTERN = /^custom_\d+$/;
|
|
665
|
+
/**
|
|
666
|
+
* Resolves attribute names into the two enrichment arms the way the editor
|
|
667
|
+
* does: look the name up as `fieldDescription` in the custom-field registry;
|
|
668
|
+
* found gives the `custom_N` slot and, when `fieldSource` is CUSTOM, the CUSTOM
|
|
669
|
+
* arm; anything else lands in TAS.
|
|
670
|
+
*
|
|
671
|
+
* @remarks Always returns both arms, an empty `mappings` where unused — the
|
|
672
|
+
* shape the UI sends.
|
|
673
|
+
*/
|
|
674
|
+
function resolveEnrichmentMappings(input, registry) {
|
|
675
|
+
const blockers = [];
|
|
676
|
+
const warnings = [];
|
|
677
|
+
const tas = [];
|
|
678
|
+
const custom = [];
|
|
679
|
+
const claimed = new Map();
|
|
680
|
+
for (const attribute of input.attributes) {
|
|
681
|
+
const entry = registry.find((candidate) => candidate.fieldDescription === attribute);
|
|
682
|
+
const override = input.alarmFields?.[attribute];
|
|
683
|
+
if (override !== undefined && !CUSTOM_FIELD_PATTERN.test(override)) {
|
|
684
|
+
blockers.push(`alarmField.${attribute}='${override}' is not a custom slot (expected custom_<n>)`);
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const alarmField = override ?? entry?.field;
|
|
688
|
+
if (!alarmField) {
|
|
689
|
+
blockers.push(`'${attribute}' is not in the custom-field registry and no alarmField.${attribute}=custom_<n> was given ` +
|
|
690
|
+
'(see `alarm list-enrichment-custom-fields`)');
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
const previous = claimed.get(alarmField);
|
|
694
|
+
if (previous !== undefined) {
|
|
695
|
+
blockers.push(`${alarmField} is mapped twice, by '${previous}' and '${attribute}'`);
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
claimed.set(alarmField, attribute);
|
|
699
|
+
if (!entry) {
|
|
700
|
+
warnings.push(`'${attribute}' is not in the custom-field registry; the alarm will carry ${alarmField} but nothing ` +
|
|
701
|
+
'labels it — register it with `alarm register-enrichment-custom-field`');
|
|
702
|
+
}
|
|
703
|
+
else if (override !== undefined && override !== entry.field) {
|
|
704
|
+
warnings.push(`'${attribute}' is registered as ${entry.field}; alarmField.${attribute}=${override} overrides that`);
|
|
705
|
+
}
|
|
706
|
+
const mapping = {
|
|
707
|
+
alarmField,
|
|
708
|
+
enrichmentField: attribute,
|
|
709
|
+
defaultValue: input.defaults?.[attribute] ?? '',
|
|
710
|
+
};
|
|
711
|
+
if (entry && entry.fieldSource.toUpperCase() === 'CUSTOM') {
|
|
712
|
+
custom.push(mapping);
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
tas.push(mapping);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return {
|
|
719
|
+
enrichments: [
|
|
720
|
+
{ type: 'TAS', filename: null, mappings: tas },
|
|
721
|
+
{ type: 'CUSTOM', filename: null, mappings: custom },
|
|
722
|
+
],
|
|
723
|
+
blockers,
|
|
724
|
+
warnings,
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
/** The create body: no `rule_id`, so the server assigns one and seeds `priority`. */
|
|
728
|
+
function toEnrichmentRuleCreateBody(input) {
|
|
729
|
+
return {
|
|
730
|
+
rule_name: input.ruleName,
|
|
731
|
+
enabled: input.enabled ?? true,
|
|
732
|
+
filter: input.filter,
|
|
733
|
+
isComplexFilter: input.isComplexFilter ?? false,
|
|
734
|
+
enrichments: input.enrichments,
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Read-modify-write body for an existing rule: every server-owned field is
|
|
739
|
+
* echoed back, `rule_version` included, and only the patched fields change.
|
|
740
|
+
*
|
|
741
|
+
* @returns `changes` is the human before→after list; `[]` means nothing to save.
|
|
742
|
+
*/
|
|
743
|
+
function buildEnrichmentRuleUpdateBody(existing, patch) {
|
|
744
|
+
const changes = [];
|
|
745
|
+
const ruleName = patch.ruleName ?? existing.rule_name;
|
|
746
|
+
if (patch.ruleName !== undefined && patch.ruleName !== existing.rule_name) {
|
|
747
|
+
changes.push(`name: '${existing.rule_name}' -> '${patch.ruleName}'`);
|
|
748
|
+
}
|
|
749
|
+
const enabled = patch.enabled ?? existing.enabled;
|
|
750
|
+
if (patch.enabled !== undefined && patch.enabled !== existing.enabled) {
|
|
751
|
+
changes.push(`enabled: ${existing.enabled} -> ${patch.enabled}`);
|
|
752
|
+
}
|
|
753
|
+
const priority = patch.priority ?? existing.priority;
|
|
754
|
+
if (patch.priority !== undefined && patch.priority !== existing.priority) {
|
|
755
|
+
changes.push(`priority: ${existing.priority} -> ${patch.priority}`);
|
|
756
|
+
}
|
|
757
|
+
const filter = patch.filter ?? existing.filter;
|
|
758
|
+
if (patch.filter !== undefined) {
|
|
759
|
+
changes.push('filter: replaced');
|
|
760
|
+
}
|
|
761
|
+
const enrichments = patch.enrichments ?? existing.enrichments;
|
|
762
|
+
if (patch.enrichments !== undefined) {
|
|
763
|
+
changes.push('enrichments: replaced');
|
|
764
|
+
}
|
|
765
|
+
const body = {
|
|
766
|
+
...existing,
|
|
767
|
+
rule_name: ruleName,
|
|
768
|
+
enabled,
|
|
769
|
+
priority,
|
|
770
|
+
filter,
|
|
771
|
+
enrichments,
|
|
772
|
+
isComplexFilter: existing.isComplexFilter ?? false,
|
|
773
|
+
};
|
|
774
|
+
return { body, changes };
|
|
775
|
+
}
|
|
776
|
+
// ---------------------------------------------------------------------------
|
|
777
|
+
// Ordering
|
|
778
|
+
// ---------------------------------------------------------------------------
|
|
779
|
+
/**
|
|
780
|
+
* Evaluation order: ascending `priority`, the way the editor sorts. The list
|
|
781
|
+
* endpoint returns rules unsorted, so every consumer must sort for itself.
|
|
782
|
+
*/
|
|
783
|
+
function sortRulesByPriority(rules) {
|
|
784
|
+
return [...rules].sort((left, right) => left.priority - right.priority);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Works out the `priority` that moves `ruleId` to the requested destination:
|
|
788
|
+
* the midpoint of its new neighbours, one below the head, or one above the
|
|
789
|
+
* tail. Exactly one of `position` / `before` / `after` / `priority` must be set.
|
|
790
|
+
*
|
|
791
|
+
* @remarks A reorder writes only the moved rule — priorities of its neighbours
|
|
792
|
+
* are left alone, which is why they drift fractional over time.
|
|
793
|
+
*/
|
|
794
|
+
function planEnrichmentReorder(rules, ruleId, target) {
|
|
795
|
+
const blockers = [];
|
|
796
|
+
const sorted = sortRulesByPriority(rules);
|
|
797
|
+
const fromIndex = sorted.findIndex((rule) => rule.rule_id === ruleId);
|
|
798
|
+
const current = sorted[fromIndex];
|
|
799
|
+
const fromPosition = fromIndex + 1;
|
|
800
|
+
if (!current) {
|
|
801
|
+
return { priority: 0, fromPosition: 0, toPosition: 0, blockers: [`no enrichment rule with id '${ruleId}'`] };
|
|
802
|
+
}
|
|
803
|
+
const given = ['position', 'before', 'after', 'priority'].filter((key) => target[key] !== undefined);
|
|
804
|
+
if (given.length === 0) {
|
|
805
|
+
blockers.push('pass exactly one of position=, before=, after= or priority=');
|
|
806
|
+
return { priority: current.priority, fromPosition, toPosition: fromPosition, blockers };
|
|
807
|
+
}
|
|
808
|
+
if (given.length > 1) {
|
|
809
|
+
blockers.push(`pass exactly one destination, not ${given.join(' + ')}`);
|
|
810
|
+
return { priority: current.priority, fromPosition, toPosition: fromPosition, blockers };
|
|
811
|
+
}
|
|
812
|
+
const others = sorted.filter((rule) => rule.rule_id !== ruleId);
|
|
813
|
+
if (target.priority !== undefined) {
|
|
814
|
+
const wanted = target.priority;
|
|
815
|
+
const collision = others.find((rule) => rule.priority === wanted);
|
|
816
|
+
if (collision) {
|
|
817
|
+
blockers.push(`priority ${wanted} is already held by '${collision.rule_name}' (${collision.rule_id})`);
|
|
818
|
+
}
|
|
819
|
+
const toPosition = others.filter((rule) => rule.priority < wanted).length + 1;
|
|
820
|
+
return { priority: wanted, fromPosition, toPosition, blockers };
|
|
821
|
+
}
|
|
822
|
+
if (others.length === 0) {
|
|
823
|
+
blockers.push('there is only one enrichment rule — nothing to reorder');
|
|
824
|
+
return { priority: current.priority, fromPosition, toPosition: fromPosition, blockers };
|
|
825
|
+
}
|
|
826
|
+
let targetIndex;
|
|
827
|
+
if (target.position !== undefined) {
|
|
828
|
+
if (!Number.isInteger(target.position) || target.position < 1 || target.position > sorted.length) {
|
|
829
|
+
blockers.push(`position ${target.position} is out of range (1..${sorted.length})`);
|
|
830
|
+
return { priority: current.priority, fromPosition, toPosition: fromPosition, blockers };
|
|
831
|
+
}
|
|
832
|
+
targetIndex = target.position - 1;
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
const anchorId = target.before ?? target.after;
|
|
836
|
+
const anchorIndex = others.findIndex((rule) => rule.rule_id === anchorId);
|
|
837
|
+
if (anchorIndex < 0) {
|
|
838
|
+
const label = target.before !== undefined ? 'before' : 'after';
|
|
839
|
+
const reason = sorted.some((rule) => rule.rule_id === anchorId)
|
|
840
|
+
? `${label}='${anchorId}' is the rule being moved`
|
|
841
|
+
: `no enrichment rule with id '${anchorId}' for ${label}=`;
|
|
842
|
+
blockers.push(reason);
|
|
843
|
+
return { priority: current.priority, fromPosition, toPosition: fromPosition, blockers };
|
|
844
|
+
}
|
|
845
|
+
targetIndex = target.before !== undefined ? anchorIndex : anchorIndex + 1;
|
|
846
|
+
}
|
|
847
|
+
const previous = others[targetIndex - 1];
|
|
848
|
+
const next = others[targetIndex];
|
|
849
|
+
let priority;
|
|
850
|
+
if (!previous && next) {
|
|
851
|
+
priority = next.priority - 1;
|
|
852
|
+
}
|
|
853
|
+
else if (previous && !next) {
|
|
854
|
+
priority = previous.priority + 1;
|
|
855
|
+
}
|
|
856
|
+
else if (previous && next) {
|
|
857
|
+
priority = (previous.priority + next.priority) / 2;
|
|
858
|
+
if (priority === previous.priority || priority === next.priority) {
|
|
859
|
+
blockers.push(`no room between priority ${previous.priority} and ${next.priority} — set priority= explicitly ` +
|
|
860
|
+
'or renumber the rules in the UI');
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
priority = current.priority;
|
|
865
|
+
}
|
|
866
|
+
if (others.some((rule) => rule.priority === priority)) {
|
|
867
|
+
blockers.push(`the computed priority ${priority} collides with an existing rule — set priority= explicitly`);
|
|
868
|
+
}
|
|
869
|
+
return { priority, fromPosition, toPosition: targetIndex + 1, blockers };
|
|
870
|
+
}
|
|
871
|
+
|
|
270
872
|
exports.AlarmEnrichment = void 0;
|
|
271
873
|
(function (AlarmEnrichment) {
|
|
272
874
|
/** @internal */
|
|
@@ -545,261 +1147,6 @@ exports.AlarmEnrichment = void 0;
|
|
|
545
1147
|
];
|
|
546
1148
|
})(exports.AlarmEnrichment || (exports.AlarmEnrichment = {}));
|
|
547
1149
|
|
|
548
|
-
/**
|
|
549
|
-
* Write bodies for notification policies (`dxinotify/notify/v1/filters`) and
|
|
550
|
-
* message templates (`dxinotify/notify/v1/templates`) — the key sets the UI
|
|
551
|
-
* sends, observed in HAR captures on the lab tenant. Both endpoints use one
|
|
552
|
-
* `PUT` for create and update: policies discriminate on `id` (0 creates),
|
|
553
|
-
* templates on `oldTemplateName` (null creates, the current name updates).
|
|
554
|
-
* The read shapes carry more (author, timestamps, contentVersion, …); the
|
|
555
|
-
* projections below drop them.
|
|
556
|
-
*/
|
|
557
|
-
const PolicyLinkedEntitySchema = v4.z.looseObject({
|
|
558
|
-
channelName: v4.z.string().describe('Channel the policy delivers to'),
|
|
559
|
-
messageTemplateName: v4.z
|
|
560
|
-
.string()
|
|
561
|
-
.nullable()
|
|
562
|
-
.optional()
|
|
563
|
-
.describe('Template override for this channel; "" (write) / null (read) for the channel default'),
|
|
564
|
-
});
|
|
565
|
-
const PolicyWriteBodySchema = v4.z.looseObject({
|
|
566
|
-
id: v4.z.number().describe('Policy id; 0 creates, an existing id updates in place'),
|
|
567
|
-
orgId: v4.z.string().describe('Tenant common name; stamped by the service'),
|
|
568
|
-
keyLevel: v4.z.number().describe('1 for user policies (the built-in default policy reads -1)'),
|
|
569
|
-
name: v4.z.string().min(1).describe('Policy (filter) name; unique per tenant'),
|
|
570
|
-
filterType: v4.z.string().describe('"AUTOMATIC" or "MANUAL"'),
|
|
571
|
-
reminderTime: v4.z.number().describe('Reminder interval; 0 = none'),
|
|
572
|
-
reminderTimeUnit: v4.z.string().describe('Reminder unit, e.g. HOURS'),
|
|
573
|
-
channelNames: v4.z.array(v4.z.string()).describe('Channels the policy delivers to, by name'),
|
|
574
|
-
active: v4.z.boolean().describe('true = enabled'),
|
|
575
|
-
description: v4.z.string().describe('Free-text description'),
|
|
576
|
-
alarmCategory: v4.z.string().describe('rawAlarm, service, or SituationCluster'),
|
|
577
|
-
serviceAlarmAction: v4.z.boolean().describe('Service-alarm action flag'),
|
|
578
|
-
filterExpressionV1: v4.z.unknown().describe('Opaque alarm-match expression tree, round-tripped verbatim'),
|
|
579
|
-
isComplexFilter: v4.z.boolean().describe('Complex-filter flag'),
|
|
580
|
-
jobInfo: v4.z.unknown().nullable().optional().describe('null on UI writes'),
|
|
581
|
-
linkedEntities: v4.z.array(PolicyLinkedEntitySchema).describe('Channel ↔ template links'),
|
|
582
|
-
linkedMappings: v4.z.array(v4.z.unknown()).optional().describe('[] on UI writes'),
|
|
583
|
-
linkedActions: v4.z.array(v4.z.unknown()).optional().describe('Alarm actions; [] when none'),
|
|
584
|
-
});
|
|
585
|
-
const PolicyWriteResponseSchema = v4.z.looseObject({
|
|
586
|
-
newContentVersion: v4.z.number().describe('0 for a create, previous + 1 for an update'),
|
|
587
|
-
});
|
|
588
|
-
const TemplateWriteBodySchema = v4.z.looseObject({
|
|
589
|
-
orgId: v4.z.string().describe('Tenant common name; stamped by the service'),
|
|
590
|
-
keyLevel: v4.z.number().describe('Always 1'),
|
|
591
|
-
defaultTemplate: v4.z
|
|
592
|
-
.union([v4.z.boolean(), v4.z.string()])
|
|
593
|
-
.describe('Built-in platform template flag; false for user templates (the read shape carries "true"/"false" strings)'),
|
|
594
|
-
templateName: v4.z.string().min(1).describe('Template name; unique per tenant'),
|
|
595
|
-
oldTemplateName: v4.z
|
|
596
|
-
.string()
|
|
597
|
-
.nullable()
|
|
598
|
-
.describe('null creates; the current name updates in place (a different name renames)'),
|
|
599
|
-
contentVersion: v4.z.number().describe('0 on create; the current version on update'),
|
|
600
|
-
locale: v4.z.string().describe('Locale; "en_US" in practice'),
|
|
601
|
-
subjectTemplate: v4.z.string().describe('Subject line template'),
|
|
602
|
-
senderNameTemplate: v4.z.string().describe('Sender display name'),
|
|
603
|
-
imageUsage: v4.z.number().describe('0 in practice'),
|
|
604
|
-
channelNames: v4.z.array(v4.z.string()).describe('Channels using this template (reverse index); [] on create'),
|
|
605
|
-
useHtml: v4.z.boolean().describe('Render templateHtml instead of templateText'),
|
|
606
|
-
templateText: v4.z.string().describe('Body template, base64-encoded (stored and returned encoded)'),
|
|
607
|
-
templateHtml: v4.z.string().describe('HTML body; "" when unused'),
|
|
608
|
-
linkedEntities: v4.z.array(v4.z.unknown()).describe('Policy links (reverse index); [] on create'),
|
|
609
|
-
});
|
|
610
|
-
const TemplateWriteResponseSchema = v4.z.looseObject({
|
|
611
|
-
existingTemplateUpdated: v4.z.boolean().describe('true when an existing template was updated'),
|
|
612
|
-
newContentVersion: v4.z.number().describe('Content version after the save'),
|
|
613
|
-
});
|
|
614
|
-
/** Built-in / platform-managed policies read back with author SYSTEM (or none, for the default policy). */
|
|
615
|
-
function isBuiltInPolicy(policy) {
|
|
616
|
-
return policy.author === undefined || policy.author === null || policy.author === 'SYSTEM';
|
|
617
|
-
}
|
|
618
|
-
/** Built-in templates are flagged defaultTemplate; platform-provided ones without the flag have no author. */
|
|
619
|
-
function isBuiltInTemplate(template) {
|
|
620
|
-
return (template.defaultTemplate === true ||
|
|
621
|
-
template.defaultTemplate === 'true' ||
|
|
622
|
-
template.author === undefined ||
|
|
623
|
-
template.author === null);
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Projects a policy as read from a tenant (or an export file) onto the write
|
|
627
|
-
* body the UI sends: read-only fields dropped, `id`/`orgId` replaced with the
|
|
628
|
-
* target's, `jobInfo` null, links reduced to channel + template names.
|
|
629
|
-
*/
|
|
630
|
-
function toPolicyWriteBody(source, opts) {
|
|
631
|
-
const keyLevel = typeof source.keyLevel === 'number' && source.keyLevel >= 0 ? source.keyLevel : 1;
|
|
632
|
-
return {
|
|
633
|
-
id: opts.id,
|
|
634
|
-
orgId: opts.orgId,
|
|
635
|
-
keyLevel,
|
|
636
|
-
name: source.name,
|
|
637
|
-
filterType: source.filterType ?? 'AUTOMATIC',
|
|
638
|
-
reminderTime: source.reminderTime ?? 0,
|
|
639
|
-
reminderTimeUnit: source.reminderTimeUnit ?? 'HOURS',
|
|
640
|
-
channelNames: source.channelNames ?? [],
|
|
641
|
-
active: source.active ?? true,
|
|
642
|
-
description: source.description ?? '',
|
|
643
|
-
alarmCategory: source.alarmCategory ?? 'rawAlarm',
|
|
644
|
-
serviceAlarmAction: source.serviceAlarmAction ?? false,
|
|
645
|
-
filterExpressionV1: source.filterExpressionV1,
|
|
646
|
-
isComplexFilter: source.isComplexFilter ?? false,
|
|
647
|
-
jobInfo: null,
|
|
648
|
-
linkedEntities: (source.linkedEntities ?? []).map((link) => ({
|
|
649
|
-
channelName: link.channelName,
|
|
650
|
-
messageTemplateName: link.messageTemplateName ?? '',
|
|
651
|
-
})),
|
|
652
|
-
linkedMappings: [],
|
|
653
|
-
linkedActions: source.linkedActions ?? [],
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Projects a template as read from a tenant (or an export file) onto the write
|
|
658
|
-
* body the UI sends. `oldTemplateName` null creates; pass the target's current
|
|
659
|
-
* name and contentVersion to update in place. templateText stays base64.
|
|
660
|
-
*/
|
|
661
|
-
function toTemplateWriteBody(source, opts) {
|
|
662
|
-
return {
|
|
663
|
-
orgId: opts.orgId,
|
|
664
|
-
keyLevel: 1,
|
|
665
|
-
defaultTemplate: opts.defaultTemplate ?? false,
|
|
666
|
-
templateName: source.templateName,
|
|
667
|
-
oldTemplateName: opts.oldTemplateName,
|
|
668
|
-
contentVersion: opts.contentVersion,
|
|
669
|
-
locale: source.locale ?? 'en_US',
|
|
670
|
-
subjectTemplate: source.subjectTemplate ?? '',
|
|
671
|
-
senderNameTemplate: source.senderNameTemplate ?? '',
|
|
672
|
-
imageUsage: source.imageUsage ?? 0,
|
|
673
|
-
channelNames: opts.channelNames ?? [],
|
|
674
|
-
useHtml: source.useHtml ?? false,
|
|
675
|
-
templateText: source.templateText ?? '',
|
|
676
|
-
templateHtml: source.templateHtml ?? '',
|
|
677
|
-
linkedEntities: [],
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
// ---------------------------------------------------------------------------
|
|
681
|
-
// Policy filter expressions
|
|
682
|
-
// ---------------------------------------------------------------------------
|
|
683
|
-
const POLICY_ALARM_CATEGORIES = ['rawAlarm', 'service', 'SituationCluster'];
|
|
684
|
-
/**
|
|
685
|
-
* Conditions accepted in policy filter atoms. `equals`, `not_equals`,
|
|
686
|
-
* `greater_than`, `increases`, and `changed` are observed in UI-authored
|
|
687
|
-
* policies; the string matchers come from the platform's shared filter model.
|
|
688
|
-
*/
|
|
689
|
-
const POLICY_FILTER_CONDITIONS = [
|
|
690
|
-
'equals',
|
|
691
|
-
'not_equals',
|
|
692
|
-
'contains',
|
|
693
|
-
'not_contains',
|
|
694
|
-
'starts_with',
|
|
695
|
-
'not_starts_with',
|
|
696
|
-
'ends_with',
|
|
697
|
-
'not_ends_with',
|
|
698
|
-
'greater_than',
|
|
699
|
-
'less_than',
|
|
700
|
-
'increases',
|
|
701
|
-
'decreases',
|
|
702
|
-
'changed',
|
|
703
|
-
];
|
|
704
|
-
const PolicyFilterAtomSchema = v4.z.looseObject({
|
|
705
|
-
field: v4.z.string().min(1).describe('Alarm field name (see the per-category field catalog)'),
|
|
706
|
-
fieldDescription: v4.z.string().optional().describe('Human label the UI stores next to the field'),
|
|
707
|
-
condition: v4.z.string().describe('One of the policy filter conditions, e.g. equals, not_equals, greater_than, changed'),
|
|
708
|
-
value: v4.z
|
|
709
|
-
.union([v4.z.string(), v4.z.boolean(), v4.z.number()])
|
|
710
|
-
.describe('Comparison value; "" for changed, the field name itself for increases/decreases'),
|
|
711
|
-
});
|
|
712
|
-
const PolicyFilterExpressionLazy = v4.z.lazy(() => v4.z.union([
|
|
713
|
-
PolicyFilterAtomSchema,
|
|
714
|
-
v4.z.looseObject({ and: v4.z.looseObject({ expressions: v4.z.array(PolicyFilterExpressionLazy) }) }),
|
|
715
|
-
v4.z.looseObject({ or: v4.z.looseObject({ expressions: v4.z.array(PolicyFilterExpressionLazy) }) }),
|
|
716
|
-
]));
|
|
717
|
-
/** Recursive and/or tree of {@link PolicyFilterAtomSchema} atoms (`filterExpressionV1`). */
|
|
718
|
-
const PolicyFilterExpressionSchema = PolicyFilterExpressionLazy;
|
|
719
|
-
/**
|
|
720
|
-
* The atoms the UI prepends for a category so the policy only sees its own
|
|
721
|
-
* alarm kind: rawAlarm and SituationCluster are observed; service mirrors them.
|
|
722
|
-
*/
|
|
723
|
-
function policyCategoryGuard(category) {
|
|
724
|
-
switch (category) {
|
|
725
|
-
case 'rawAlarm':
|
|
726
|
-
return [{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'not_equals', value: 'Service' }];
|
|
727
|
-
case 'service':
|
|
728
|
-
return [{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'equals', value: 'Service' }];
|
|
729
|
-
case 'SituationCluster':
|
|
730
|
-
return [
|
|
731
|
-
{ field: 'alarmType', fieldDescription: 'Alarm Type', condition: 'equals', value: 'SituationCluster' },
|
|
732
|
-
{ field: 'isOrphan', fieldDescription: 'Is Orphan', condition: 'equals', value: false },
|
|
733
|
-
];
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
/**
|
|
737
|
-
* Builds `filterExpressionV1` the way the UI does: an outer AND of the
|
|
738
|
-
* category guard group and the user's atoms (AND-ed). No atoms → guard only.
|
|
739
|
-
*/
|
|
740
|
-
function buildPolicyFilterExpression(category, atoms) {
|
|
741
|
-
const guard = { and: { expressions: policyCategoryGuard(category) } };
|
|
742
|
-
if (atoms.length === 0) {
|
|
743
|
-
return guard;
|
|
744
|
-
}
|
|
745
|
-
return { and: { expressions: [guard, { and: { expressions: atoms } }] } };
|
|
746
|
-
}
|
|
747
|
-
/** Flattens an expression into its atoms (for previews and field checks). */
|
|
748
|
-
function policyFilterAtoms(expression) {
|
|
749
|
-
if ('condition' in expression) {
|
|
750
|
-
return [expression];
|
|
751
|
-
}
|
|
752
|
-
if ('and' in expression) {
|
|
753
|
-
return expression.and.expressions.flatMap(policyFilterAtoms);
|
|
754
|
-
}
|
|
755
|
-
if ('or' in expression) {
|
|
756
|
-
return expression.or.expressions.flatMap(policyFilterAtoms);
|
|
757
|
-
}
|
|
758
|
-
return [];
|
|
759
|
-
}
|
|
760
|
-
/** One entry of the per-category alarm field catalog the policy editor offers. */
|
|
761
|
-
const AlarmFilterFieldSchema = v4.z.looseObject({
|
|
762
|
-
field: v4.z.string().describe('Field name to use in filter atoms'),
|
|
763
|
-
fieldDescription: v4.z.string().describe('Human label'),
|
|
764
|
-
values: v4.z.array(v4.z.string()).describe('Closed vocabulary when non-empty (e.g. severity levels)'),
|
|
765
|
-
fieldType: v4.z.string().describe('String, Number, …'),
|
|
766
|
-
});
|
|
767
|
-
const AlarmFilterFieldsResponseSchema = v4.z.array(AlarmFilterFieldSchema);
|
|
768
|
-
/** The catalog endpoint per alarm category (`GET`, bare array). */
|
|
769
|
-
const ALARM_FILTER_FIELD_PATHS = {
|
|
770
|
-
rawAlarm: 'oi/v2/api/normalizedalarms/fields',
|
|
771
|
-
service: 'oi/v2/api/dxservicealarms/fields',
|
|
772
|
-
SituationCluster: 'oi/v2/api/dxiclusteralarms/fields',
|
|
773
|
-
};
|
|
774
|
-
// ---------------------------------------------------------------------------
|
|
775
|
-
// Deletes (endpoints found by probing — absent from every UI HAR)
|
|
776
|
-
// ---------------------------------------------------------------------------
|
|
777
|
-
/** Response of `DELETE dxinotify/notify/v1/filters/{orgId}/{name}`. */
|
|
778
|
-
const PolicyDeleteResponseSchema = v4.z.looseObject({
|
|
779
|
-
deletedCount: v4.z.number().describe('1 when the policy was deleted'),
|
|
780
|
-
});
|
|
781
|
-
/** Response of `DELETE dxinotify/notify/v1/templates/{name}/{locale}/{orgId}`. */
|
|
782
|
-
const TemplateDeleteResponseSchema = v4.z.looseObject({
|
|
783
|
-
deletedCount: v4.z.number().describe('Rows removed (3 observed for one template: content plus its link rows)'),
|
|
784
|
-
});
|
|
785
|
-
const ITSM_TEMPLATE_KEYS = new Set([
|
|
786
|
-
'ITSM_ALL_ALARM_TEMPLATE_NAME',
|
|
787
|
-
'ITSM_SERVICE_ALARM_TEMPLATE_NAME',
|
|
788
|
-
'ITSM_SITUATION_TEMPLATE_NAME',
|
|
789
|
-
]);
|
|
790
|
-
/** Who uses a template, computed from the channel and policy lists (not the template's own reverse index, which can lag). */
|
|
791
|
-
function templateUsage(templateName, channels, policies) {
|
|
792
|
-
return {
|
|
793
|
-
channels: channels
|
|
794
|
-
.filter((channel) => (channel.smtpItsmConfigs?.templates ?? []).some((t) => t.templateName === templateName) ||
|
|
795
|
-
(channel.itsmConfig?.PropertyList ?? []).some((p) => ITSM_TEMPLATE_KEYS.has(p.propertyName) && p.propertyValue === templateName))
|
|
796
|
-
.map((channel) => channel.name),
|
|
797
|
-
policies: policies
|
|
798
|
-
.filter((policy) => (policy.linkedEntities ?? []).some((link) => link.messageTemplateName === templateName))
|
|
799
|
-
.map((policy) => policy.name),
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
|
|
803
1150
|
exports.PlatformFilters = void 0;
|
|
804
1151
|
(function (PlatformFilters) {
|
|
805
1152
|
PlatformFilters.ValidFieldConditions = [
|
|
@@ -28318,6 +28665,146 @@ function toItsmTestConnectionRequest(properties) {
|
|
|
28318
28665
|
return request;
|
|
28319
28666
|
}
|
|
28320
28667
|
|
|
28668
|
+
/**
|
|
28669
|
+
* Ticket enrichment rules: the per-ITSM-channel maps of Settings → Ticket
|
|
28670
|
+
* Enrichment Rules. Each rule sends alarm fields into service-desk fields
|
|
28671
|
+
* when a ticket is opened (e.g. the alarm's `startTime` into ServiceNow's
|
|
28672
|
+
* `opened_at`), or writes a literal.
|
|
28673
|
+
*
|
|
28674
|
+
* Store: `dxinotify/notify/v1/customMappings` — `GET /{orgId}` lists,
|
|
28675
|
+
* `PUT` saves one rule (`id: 0` creates, an existing id updates in place),
|
|
28676
|
+
* `DELETE /{orgId}/{id}` removes one. The list endpoint returns a bare `{}`
|
|
28677
|
+
* on a tenant with no rules, not `{ customMappings: [] }`.
|
|
28678
|
+
*
|
|
28679
|
+
* Shapes observed in HARs of the demo and lab tenants
|
|
28680
|
+
* (alarm-ticket-enrichment{,-2}.har, 2026-09-08), plus a live probe of the
|
|
28681
|
+
* alarm-type vocabulary against the lab tenant.
|
|
28682
|
+
*/
|
|
28683
|
+
/** The three alarm kinds a rule can enrich tickets for. */
|
|
28684
|
+
const TICKET_ENRICHMENT_ALARM_TYPES = ['all_alarms', 'service_alarms', 'situations'];
|
|
28685
|
+
/**
|
|
28686
|
+
* The alarm-field catalog codes each alarm type maps to. An alarm field is
|
|
28687
|
+
* only usable in a rule when its own `alarmType` array carries the code for
|
|
28688
|
+
* the rule's type — the server answers 400 otherwise, with no explanation.
|
|
28689
|
+
* (Probed on the lab tenant: `startTime` is ALARMS_ALL + SITUATIONS, so a
|
|
28690
|
+
* `service_alarms` rule mapping it is rejected; `acknowledged`, which is
|
|
28691
|
+
* ALARMS_ALL + ALARMS_SERVICE, is accepted.)
|
|
28692
|
+
*/
|
|
28693
|
+
const TICKET_ENRICHMENT_FIELD_CODES = {
|
|
28694
|
+
all_alarms: 'ALARMS_ALL',
|
|
28695
|
+
service_alarms: 'ALARMS_SERVICE',
|
|
28696
|
+
situations: 'SITUATIONS',
|
|
28697
|
+
};
|
|
28698
|
+
// ---------------------------------------------------------------------------
|
|
28699
|
+
// Wire shapes
|
|
28700
|
+
// ---------------------------------------------------------------------------
|
|
28701
|
+
const TicketEnrichmentMappingSchema = v4.z.looseObject({
|
|
28702
|
+
svcDeskField: v4.z
|
|
28703
|
+
.string()
|
|
28704
|
+
.min(1)
|
|
28705
|
+
.describe("Service-desk field to fill; the `mappedTo` of a channel's field catalog ('opened_at')"),
|
|
28706
|
+
alarmField: v4.z
|
|
28707
|
+
.looseObject({
|
|
28708
|
+
title: v4.z.string().describe("Human label of the alarm field ('StartTime')"),
|
|
28709
|
+
value: v4.z.string().describe("Alarm field name ('startTime'); '' when only a literal is sent"),
|
|
28710
|
+
})
|
|
28711
|
+
.describe('Alarm field the value comes from'),
|
|
28712
|
+
customization: v4.z.string().describe("Literal appended or sent instead of the alarm field; '' for none"),
|
|
28713
|
+
});
|
|
28714
|
+
const TicketEnrichmentRuleSchema = v4.z.looseObject({
|
|
28715
|
+
id: v4.z.number().describe('Rule id; the identifier for detail and delete'),
|
|
28716
|
+
orgId: v4.z.string().describe('Tenant common name (orgId); stamped by the service on write'),
|
|
28717
|
+
keyLevel: v4.z.number().describe('Tenant key level; 1 in every capture'),
|
|
28718
|
+
name: v4.z.string().describe('Display name; unique per tenant, enforced by the server'),
|
|
28719
|
+
description: v4.z.string().optional().describe('Free-text description'),
|
|
28720
|
+
contentVersion: v4.z.number().describe('Optimistic version; send the current value, the server increments it'),
|
|
28721
|
+
alarmType: v4.z.string().describe("Which alarms the rule applies to: all_alarms, service_alarms or situations"),
|
|
28722
|
+
author: v4.z.string().optional().describe('Display name of the last editor'),
|
|
28723
|
+
svcDeskType: v4.z.string().describe("The channel's service-desk product ('ServiceNow')"),
|
|
28724
|
+
created: v4.z.string().nullable().optional().describe('ISO-8601 creation timestamp'),
|
|
28725
|
+
lastUpdated: v4.z.string().nullable().optional().describe('ISO-8601 update timestamp'),
|
|
28726
|
+
mappings: v4.z.array(TicketEnrichmentMappingSchema).describe('Alarm field to service-desk field maps'),
|
|
28727
|
+
linkedPolicies: v4.z.array(v4.z.unknown()).optional().describe('Notification policies referencing the rule; [] in captures'),
|
|
28728
|
+
channelId: v4.z.number().describe('Id of the ITSM channel the rule belongs to'),
|
|
28729
|
+
cohortId: v4.z.string().optional().describe('Cohort UUID; server-assigned on write'),
|
|
28730
|
+
});
|
|
28731
|
+
/** `GET dxinotify/notify/v1/customMappings/{orgId}`. A tenant with no rules returns a bare `{}`. */
|
|
28732
|
+
const TicketEnrichmentListResponseSchema = v4.z.looseObject({
|
|
28733
|
+
customMappings: v4.z.array(TicketEnrichmentRuleSchema).optional().describe('The rules; absent when there are none'),
|
|
28734
|
+
});
|
|
28735
|
+
/** The body of `PUT dxinotify/notify/v1/customMappings`. `id: 0` creates. */
|
|
28736
|
+
const TicketEnrichmentWriteBodySchema = v4.z.looseObject({
|
|
28737
|
+
id: v4.z.number().describe('Rule id. 0 creates a new rule; an existing id updates it in place'),
|
|
28738
|
+
orgId: v4.z.string().describe('Tenant common name (orgId); stamped by the service on write'),
|
|
28739
|
+
keyLevel: v4.z.number().describe('Tenant key level; always 1'),
|
|
28740
|
+
name: v4.z
|
|
28741
|
+
.string()
|
|
28742
|
+
.min(1)
|
|
28743
|
+
.describe('Display name; must be unique in the tenant — a clash is rejected with a 500 naming the existing entity'),
|
|
28744
|
+
description: v4.z.string().describe("Free-text description; '' for none"),
|
|
28745
|
+
contentVersion: v4.z.number().describe('Current version on update, 1 on create; the server increments it'),
|
|
28746
|
+
alarmType: v4.z.enum(TICKET_ENRICHMENT_ALARM_TYPES).describe('Which alarms the rule applies to'),
|
|
28747
|
+
svcDeskType: v4.z.string().describe("The channel's service-desk product, echoed from the channel"),
|
|
28748
|
+
created: v4.z.string().nullable().describe('Echoed on update, null on create'),
|
|
28749
|
+
linkedPolicies: v4.z.array(v4.z.unknown()).describe('Notification policies referencing the rule; [] on create'),
|
|
28750
|
+
channelId: v4.z.number().describe('Id of the ITSM channel the rule belongs to'),
|
|
28751
|
+
mappings: v4.z.array(TicketEnrichmentMappingSchema).min(1).describe('At least one mapping is required'),
|
|
28752
|
+
});
|
|
28753
|
+
/** `PUT dxinotify/notify/v1/customMappings` — the persisted rule, including its new id on create. */
|
|
28754
|
+
const TicketEnrichmentWriteResponseSchema = v4.z.looseObject({
|
|
28755
|
+
returnValue: v4.z
|
|
28756
|
+
.looseObject({ message: v4.z.string().describe("'insert was successful' / 'update was successful'") })
|
|
28757
|
+
.optional()
|
|
28758
|
+
.describe('Server-side outcome message'),
|
|
28759
|
+
customMapping: TicketEnrichmentRuleSchema.optional().describe('The persisted rule, with its id'),
|
|
28760
|
+
});
|
|
28761
|
+
/**
|
|
28762
|
+
* One entry of `GET oi/v2/tenantmgmtservice/properties?channelId=<id>`: the
|
|
28763
|
+
* service-desk field catalog of one ITSM channel. `mappedTo` is the value a
|
|
28764
|
+
* mapping's `svcDeskField` takes.
|
|
28765
|
+
*/
|
|
28766
|
+
const ServiceDeskFieldSchema = v4.z.looseObject({
|
|
28767
|
+
name: v4.z.string().describe("Internal name of the field ('assigneeGroup')"),
|
|
28768
|
+
mappedTo: v4.z.string().describe("The service-desk field a mapping targets ('assignment_group')"),
|
|
28769
|
+
description: v4.z.string().optional().describe('Human description of the field'),
|
|
28770
|
+
dataType: v4.z.string().optional().describe("Value type ('string', 'datetime')"),
|
|
28771
|
+
default: v4.z.string().optional().describe('Default value the service desk applies'),
|
|
28772
|
+
custom: v4.z.boolean().optional().describe('true for tenant-defined fields, false for product fields'),
|
|
28773
|
+
possibleValues: v4.z.array(v4.z.unknown()).optional().describe('Closed vocabulary when present'),
|
|
28774
|
+
});
|
|
28775
|
+
const ServiceDeskFieldsResponseSchema = v4.z.array(ServiceDeskFieldSchema);
|
|
28776
|
+
/**
|
|
28777
|
+
* One entry of
|
|
28778
|
+
* `GET oi/v2/api/alarm/messageTemplate/fields?usedInTicketEnrichment=true`:
|
|
28779
|
+
* the alarm fields a ticket enrichment rule can read.
|
|
28780
|
+
*/
|
|
28781
|
+
const TicketEnrichmentAlarmFieldSchema = v4.z.looseObject({
|
|
28782
|
+
alarmFieldName: v4.z.string().describe("Alarm field name a mapping reads ('startTime')"),
|
|
28783
|
+
messageTemplateText: v4.z.string().describe("Human label stored as the mapping's alarmField.title"),
|
|
28784
|
+
alarmType: v4.z
|
|
28785
|
+
.array(v4.z.string())
|
|
28786
|
+
.describe('Catalog codes the field is valid for; must contain the rule type\'s code or the save is rejected'),
|
|
28787
|
+
description: v4.z.string().optional().describe('Free-text description; empty in captures'),
|
|
28788
|
+
});
|
|
28789
|
+
const TicketEnrichmentAlarmFieldsResponseSchema = v4.z.array(TicketEnrichmentAlarmFieldSchema);
|
|
28790
|
+
/** The create body: `id: 0`, `created: null`, `contentVersion: 1`. */
|
|
28791
|
+
function toTicketEnrichmentWriteBody(input) {
|
|
28792
|
+
return {
|
|
28793
|
+
id: 0,
|
|
28794
|
+
orgId: '',
|
|
28795
|
+
keyLevel: 1,
|
|
28796
|
+
name: input.name,
|
|
28797
|
+
description: input.description ?? '',
|
|
28798
|
+
contentVersion: 1,
|
|
28799
|
+
alarmType: input.alarmType ?? 'all_alarms',
|
|
28800
|
+
svcDeskType: input.svcDeskType,
|
|
28801
|
+
created: null,
|
|
28802
|
+
linkedPolicies: [],
|
|
28803
|
+
channelId: input.channelId,
|
|
28804
|
+
mappings: input.mappings,
|
|
28805
|
+
};
|
|
28806
|
+
}
|
|
28807
|
+
|
|
28321
28808
|
// these aren't really private, but nor are they really useful to document
|
|
28322
28809
|
|
|
28323
28810
|
/**
|
|
@@ -48910,29 +49397,114 @@ const TasGraphSchema = v4.z.looseObject({
|
|
|
48910
49397
|
totalEdges: v4.z.number().optional(),
|
|
48911
49398
|
});
|
|
48912
49399
|
|
|
49400
|
+
/**
|
|
49401
|
+
* Attribute value the TAS write interface accepts: a string or a list of
|
|
49402
|
+
* strings (`docs/data-store-doc/tas-rest.html`, "Write Interface").
|
|
49403
|
+
*/
|
|
49404
|
+
const TasStoreAttributeValueSchema = v4.z
|
|
49405
|
+
.union([v4.z.string(), v4.z.array(v4.z.string())])
|
|
49406
|
+
.describe('Attribute value: a string or an array of strings');
|
|
49407
|
+
/**
|
|
49408
|
+
* Request-side vertex for `POST /tas/graph/store`.
|
|
49409
|
+
*
|
|
49410
|
+
* Ingestion identifies a vertex by `externalId` only — a vertex being created
|
|
49411
|
+
* has no numeric id yet (`docs/data-store-doc/tas-index.html` §2.2, "ingestion
|
|
49412
|
+
* tasks should use external ID only") — so this deliberately differs from the
|
|
49413
|
+
* response-side `TasVertexSchema`, which requires `id`.
|
|
49414
|
+
*/
|
|
49415
|
+
const TasStoreVertexSchema = v4.z.looseObject({
|
|
49416
|
+
externalId: TasExternalIdSchema.describe('Ingestion identity of the vertex (`<LAYER>:<TYPE>:…`); the only id a producer supplies'),
|
|
49417
|
+
id: v4.z
|
|
49418
|
+
.number()
|
|
49419
|
+
.optional()
|
|
49420
|
+
.describe('Numeric id; only meaningful when updating a vertex the platform already holds'),
|
|
49421
|
+
startTime: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
49422
|
+
endTime: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
49423
|
+
attributes: v4.z
|
|
49424
|
+
.object({
|
|
49425
|
+
name: v4.z.string().describe('Display name — required by the platform'),
|
|
49426
|
+
type: v4.z
|
|
49427
|
+
.string()
|
|
49428
|
+
.describe('Vertex type, e.g. AGENT or ACTIVEMQ_DESTINATION — required by the platform'),
|
|
49429
|
+
})
|
|
49430
|
+
.catchall(TasStoreAttributeValueSchema)
|
|
49431
|
+
.describe('Complete attribute set. A GATHERED store replaces the previous attribute set wholesale, so always send every attribute'),
|
|
49432
|
+
attributesType: v4.z
|
|
49433
|
+
.record(v4.z.string(), TasAttributeTypeSchema)
|
|
49434
|
+
.optional()
|
|
49435
|
+
.describe('Per-attribute store type override (GATHERED, CUSTOM, DECORATED, HIDDEN)'),
|
|
49436
|
+
});
|
|
49437
|
+
/**
|
|
49438
|
+
* Request-side edge for `POST /tas/graph/store`: endpoints are named by
|
|
49439
|
+
* `externalId`; numeric ids are optional and only apply to edges between
|
|
49440
|
+
* vertices the platform already holds. The platform silently drops an edge
|
|
49441
|
+
* whose endpoint vertex does not exist.
|
|
49442
|
+
*/
|
|
49443
|
+
const TasStoreEdgeSchema = v4.z.looseObject({
|
|
49444
|
+
sourceExternalId: TasExternalIdSchema.describe('externalId of the source (parent) vertex'),
|
|
49445
|
+
targetExternalId: TasExternalIdSchema.describe('externalId of the target (child) vertex'),
|
|
49446
|
+
flowExternalId: TasExternalIdSchema.optional().describe('externalId of the flow vertex, when the edge belongs to a flow'),
|
|
49447
|
+
wireExternalId: TasExternalIdSchema.optional().describe('externalId of the wire vertex, when the edge belongs to a wire'),
|
|
49448
|
+
sourceId: v4.z.number().optional().describe('Numeric id of the source vertex (existing vertices only)'),
|
|
49449
|
+
targetId: v4.z.number().optional().describe('Numeric id of the target vertex (existing vertices only)'),
|
|
49450
|
+
flowId: v4.z.number().optional().describe('Numeric id of the flow vertex'),
|
|
49451
|
+
wireId: v4.z.number().optional().describe('Numeric id of the wire vertex'),
|
|
49452
|
+
startTime: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
49453
|
+
endTime: v4.z.number().optional().describe('Epoch milliseconds'),
|
|
49454
|
+
attributes: v4.z
|
|
49455
|
+
.record(v4.z.string(), TasStoreAttributeValueSchema)
|
|
49456
|
+
.optional()
|
|
49457
|
+
.describe('Edge attributes (e.g. `semantic`)'),
|
|
49458
|
+
attributesType: v4.z
|
|
49459
|
+
.record(v4.z.string(), TasAttributeTypeSchema)
|
|
49460
|
+
.optional()
|
|
49461
|
+
.describe('Per-attribute store type override'),
|
|
49462
|
+
});
|
|
49463
|
+
/** The graph body of a store request: externalId-keyed vertices and edges. */
|
|
49464
|
+
const TasStoreGraphSchema = v4.z.looseObject({
|
|
49465
|
+
vertices: v4.z.array(TasStoreVertexSchema).optional().describe('Vertices to create or update'),
|
|
49466
|
+
edges: v4.z.array(TasStoreEdgeSchema).optional().describe('Edges to create or update'),
|
|
49467
|
+
});
|
|
48913
49468
|
const TasStoreGraphInputSchema = v4.z.looseObject({
|
|
48914
|
-
includeSuccessResult: v4.z
|
|
48915
|
-
|
|
48916
|
-
|
|
48917
|
-
|
|
48918
|
-
|
|
49469
|
+
includeSuccessResult: v4.z
|
|
49470
|
+
.boolean()
|
|
49471
|
+
.optional()
|
|
49472
|
+
.describe('Echo the stored graph back in the response'),
|
|
49473
|
+
ttl: v4.z
|
|
49474
|
+
.number()
|
|
49475
|
+
.optional()
|
|
49476
|
+
.describe('Time to live in milliseconds for every vertex in this request; omitted = the platform default (24 h). One ttl per request'),
|
|
49477
|
+
endTimeAllowedThreshold: v4.z.number().optional().describe('Platform option; see tas-rest.html'),
|
|
49478
|
+
storeType: TasAttributeTypeSchema.optional().describe('Attribute store type for the whole request (default GATHERED)'),
|
|
49479
|
+
graph: TasStoreGraphSchema,
|
|
48919
49480
|
});
|
|
48920
49481
|
const TasStoreChangeSchema = v4.z.looseObject({
|
|
48921
49482
|
changeType: v4.z.string().optional(),
|
|
48922
49483
|
id: v4.z.unknown().optional(),
|
|
48923
49484
|
});
|
|
49485
|
+
/**
|
|
49486
|
+
* A vertex or edge the platform refused, echoed back as it was sent (so it
|
|
49487
|
+
* carries the request-side externalId shape, not a numeric id).
|
|
49488
|
+
*/
|
|
49489
|
+
const TasStoreFailedObjectSchema = v4.z.looseObject({
|
|
49490
|
+
externalId: TasExternalIdSchema.optional(),
|
|
49491
|
+
sourceExternalId: TasExternalIdSchema.optional(),
|
|
49492
|
+
targetExternalId: TasExternalIdSchema.optional(),
|
|
49493
|
+
id: v4.z.number().optional(),
|
|
49494
|
+
attributes: v4.z.record(v4.z.string(), v4.z.unknown()).optional(),
|
|
49495
|
+
});
|
|
48924
49496
|
const TasStoreGraphResponseSchema = v4.z.looseObject({
|
|
48925
49497
|
graph: TasGraphSchema.optional(),
|
|
48926
49498
|
failedVertices: v4.z
|
|
48927
49499
|
.array(v4.z.looseObject({
|
|
48928
|
-
object:
|
|
49500
|
+
object: TasStoreFailedObjectSchema,
|
|
48929
49501
|
code: v4.z.string().optional(),
|
|
48930
49502
|
message: v4.z.string().optional(),
|
|
48931
49503
|
}))
|
|
48932
49504
|
.optional(),
|
|
48933
49505
|
failedEdges: v4.z
|
|
48934
49506
|
.array(v4.z.looseObject({
|
|
48935
|
-
object:
|
|
49507
|
+
object: TasStoreFailedObjectSchema,
|
|
48936
49508
|
code: v4.z.string().optional(),
|
|
48937
49509
|
message: v4.z.string().optional(),
|
|
48938
49510
|
}))
|
|
@@ -59619,6 +60191,24 @@ exports.LogIngest = void 0;
|
|
|
59619
60191
|
return LogIngest.RESERVED_ADDITIONAL_FIELDS.includes(name.toLowerCase());
|
|
59620
60192
|
}
|
|
59621
60193
|
LogIngest.isReservedLogField = isReservedLogField;
|
|
60194
|
+
/**
|
|
60195
|
+
* Thrown by `DxSaasService.resolveLogIngestionURL` when no log gateway can
|
|
60196
|
+
* be determined. `definitive` is true when the profile itself rules an
|
|
60197
|
+
* endpoint out (unparseable or on-premise gateway, Log Analytics absent or
|
|
60198
|
+
* not provisioned) and false when only the products lookup failed — a
|
|
60199
|
+
* producer keeps shipping off for the process in the first case and retries
|
|
60200
|
+
* later in the second. The message names the reason and how to set
|
|
60201
|
+
* `dxLogIngestionURL`.
|
|
60202
|
+
*/
|
|
60203
|
+
class LogIngestionEndpointError extends Error {
|
|
60204
|
+
definitive;
|
|
60205
|
+
constructor(message, definitive) {
|
|
60206
|
+
super(message);
|
|
60207
|
+
this.definitive = definitive;
|
|
60208
|
+
this.name = 'LogIngestionEndpointError';
|
|
60209
|
+
}
|
|
60210
|
+
}
|
|
60211
|
+
LogIngest.LogIngestionEndpointError = LogIngestionEndpointError;
|
|
59622
60212
|
LogIngest.LogIngestOptionsSchema = v4.z.looseObject({
|
|
59623
60213
|
logtype: v4.z
|
|
59624
60214
|
.string()
|
|
@@ -59653,7 +60243,7 @@ exports.LogIngest = void 0;
|
|
|
59653
60243
|
file: v4.z
|
|
59654
60244
|
.string()
|
|
59655
60245
|
.optional()
|
|
59656
|
-
.describe('Source file label (default: `"dx-do.cli"`)'),
|
|
60246
|
+
.describe('Source file label, typically a logger name (default: `"dx-do.cli"`). A value without a dot gets `.log` appended: the platform only parses a dotted source file, and an undotted one corrupts the stored `message`, `file` and `tags` (#620).'),
|
|
59657
60247
|
ip: v4.z
|
|
59658
60248
|
.string()
|
|
59659
60249
|
.optional()
|
|
@@ -60133,6 +60723,12 @@ exports.OIAlarm = void 0;
|
|
|
60133
60723
|
};
|
|
60134
60724
|
})(exports.OIAlarm || (exports.OIAlarm = {}));
|
|
60135
60725
|
|
|
60726
|
+
exports.CreateServices = void 0;
|
|
60727
|
+
(function (CreateServices) {
|
|
60728
|
+
/** The service kinds the platform recognises, in wire casing (`servicerepo/filters` catalog). */
|
|
60729
|
+
CreateServices.SERVICE_TYPES = ['Service', 'Application', 'Group'];
|
|
60730
|
+
})(exports.CreateServices || (exports.CreateServices = {}));
|
|
60731
|
+
|
|
60136
60732
|
/**
|
|
60137
60733
|
* The `service export` / `service export-hierarchy` file format and the
|
|
60138
60734
|
* `service import` boundary validator.
|
|
@@ -60213,6 +60809,7 @@ exports.ServiceTransform = void 0;
|
|
|
60213
60809
|
attributes: {
|
|
60214
60810
|
type: 'saService',
|
|
60215
60811
|
name: a.name,
|
|
60812
|
+
serviceType: normalizeServiceType(a.serviceType),
|
|
60216
60813
|
state: 'ACTIVE',
|
|
60217
60814
|
maintenance: a.maintenance ?? false,
|
|
60218
60815
|
situationsIncludeChildServices: a.situationsIncludeChildServices ?? false,
|
|
@@ -60228,6 +60825,80 @@ exports.ServiceTransform = void 0;
|
|
|
60228
60825
|
};
|
|
60229
60826
|
}
|
|
60230
60827
|
ServiceTransform.retrievedToServiceVertex = retrievedToServiceVertex;
|
|
60828
|
+
const SERVICE_TYPE_BY_LOWER = Object.fromEntries(exports.CreateServices.SERVICE_TYPES.map((t) => [t.toLowerCase(), t]));
|
|
60829
|
+
/**
|
|
60830
|
+
* Canonicalise a read-back `serviceType` (any casing). Missing or unknown
|
|
60831
|
+
* values map to `Service`, the server's default for records that predate
|
|
60832
|
+
* the field.
|
|
60833
|
+
*/
|
|
60834
|
+
function normalizeServiceType(value) {
|
|
60835
|
+
if (typeof value !== 'string')
|
|
60836
|
+
return 'Service';
|
|
60837
|
+
return SERVICE_TYPE_BY_LOWER[value.toLowerCase()] ?? 'Service';
|
|
60838
|
+
}
|
|
60839
|
+
ServiceTransform.normalizeServiceType = normalizeServiceType;
|
|
60840
|
+
/** Parse a user-supplied service type (`service|application|group`, any casing); throws on anything else. */
|
|
60841
|
+
function parseServiceType(input) {
|
|
60842
|
+
const t = SERVICE_TYPE_BY_LOWER[input.trim().toLowerCase()];
|
|
60843
|
+
if (!t) {
|
|
60844
|
+
throw new Error(`Unknown service type '${input}' — expected one of ${exports.CreateServices.SERVICE_TYPES.map((x) => x.toLowerCase()).join(', ')}`);
|
|
60845
|
+
}
|
|
60846
|
+
return t;
|
|
60847
|
+
}
|
|
60848
|
+
ServiceTransform.parseServiceType = parseServiceType;
|
|
60849
|
+
function list(xs) {
|
|
60850
|
+
return `[${xs.join(', ')}]`;
|
|
60851
|
+
}
|
|
60852
|
+
function sameSet(a, b) {
|
|
60853
|
+
const sa = [...a].sort();
|
|
60854
|
+
const sb = [...b].sort();
|
|
60855
|
+
return sa.length === sb.length && sa.every((x, i) => x === sb[i]);
|
|
60856
|
+
}
|
|
60857
|
+
function propPairs(ps) {
|
|
60858
|
+
return ps.map((p) => `${p.name}=${p.value}`);
|
|
60859
|
+
}
|
|
60860
|
+
/**
|
|
60861
|
+
* Apply an attribute patch to ONE vertex of a store body (in place) and return
|
|
60862
|
+
* human-readable change lines; an empty result means nothing differs. Fields
|
|
60863
|
+
* omitted from the patch keep their values; `tags` / `customProperties` are
|
|
60864
|
+
* replaced wholesale (what the UI editor sends), not merged. The name and the
|
|
60865
|
+
* `serviceType` are never touched — both are fixed at creation (the server
|
|
60866
|
+
* does not allow renames and ignores a type change on a re-save).
|
|
60867
|
+
*
|
|
60868
|
+
* @throws Error if `serviceName` is not among `body.vertices`.
|
|
60869
|
+
*/
|
|
60870
|
+
function applyServiceUpdate(body, serviceName, patch) {
|
|
60871
|
+
const target = body.vertices.find((v) => v.attributes.name === serviceName);
|
|
60872
|
+
if (!target) {
|
|
60873
|
+
throw new Error(`No service with name '${serviceName}' found`);
|
|
60874
|
+
}
|
|
60875
|
+
const a = target.attributes;
|
|
60876
|
+
const changes = [];
|
|
60877
|
+
if (patch.description !== undefined && patch.description !== a.description) {
|
|
60878
|
+
changes.push(`description: '${a.description}' -> '${patch.description}'`);
|
|
60879
|
+
a.description = patch.description;
|
|
60880
|
+
}
|
|
60881
|
+
if (patch.location !== undefined && patch.location !== a.location) {
|
|
60882
|
+
changes.push(`location: '${a.location}' -> '${patch.location}'`);
|
|
60883
|
+
a.location = patch.location;
|
|
60884
|
+
}
|
|
60885
|
+
if (patch.tags !== undefined && !sameSet(patch.tags, a.tags)) {
|
|
60886
|
+
changes.push(`tags: ${list(a.tags)} -> ${list(patch.tags)}`);
|
|
60887
|
+
a.tags = [...patch.tags];
|
|
60888
|
+
}
|
|
60889
|
+
if (patch.customProperties !== undefined &&
|
|
60890
|
+
!sameSet(propPairs(patch.customProperties), propPairs(a.customProperties))) {
|
|
60891
|
+
changes.push(`properties: ${list(propPairs(a.customProperties))} -> ${list(propPairs(patch.customProperties))}`);
|
|
60892
|
+
a.customProperties = patch.customProperties.map((p) => ({ ...p }));
|
|
60893
|
+
}
|
|
60894
|
+
if (patch.situationsIncludeChildServices !== undefined &&
|
|
60895
|
+
patch.situationsIncludeChildServices !== a.situationsIncludeChildServices) {
|
|
60896
|
+
changes.push(`includeChildServices: ${a.situationsIncludeChildServices} -> ${patch.situationsIncludeChildServices}`);
|
|
60897
|
+
a.situationsIncludeChildServices = patch.situationsIncludeChildServices;
|
|
60898
|
+
}
|
|
60899
|
+
return changes;
|
|
60900
|
+
}
|
|
60901
|
+
ServiceTransform.applyServiceUpdate = applyServiceUpdate;
|
|
60231
60902
|
/**
|
|
60232
60903
|
* Build NAME-keyed store edges from a topology graph, preserving weights +
|
|
60233
60904
|
* semantic. Endpoints are mapped from `SA:<uuid>` to service name via the
|
|
@@ -66657,6 +67328,46 @@ class AlarmService {
|
|
|
66657
67328
|
alarmId: alarmId,
|
|
66658
67329
|
});
|
|
66659
67330
|
}
|
|
67331
|
+
/**
|
|
67332
|
+
* Finds one alarm, open or closed, by its ID (for an ingested alarm, the
|
|
67333
|
+
* `alarm_unique_id` it was sent with) among alarms from the last
|
|
67334
|
+
* `lookbackMs`, through the alarm search.
|
|
67335
|
+
*
|
|
67336
|
+
* @remarks Resolves `undefined` when there is no such alarm. {@link getAlarm}
|
|
67337
|
+
* cannot tell that apart from a failure: its endpoint answers HTTP 500 for an
|
|
67338
|
+
* unknown ID.
|
|
67339
|
+
*/
|
|
67340
|
+
async findAlarm(alarmId, lookbackMs, requestOverrides = {}) {
|
|
67341
|
+
const now = Date.now();
|
|
67342
|
+
const body = {
|
|
67343
|
+
...DEFAULT_ALARMS_REQUEST_BODY$1,
|
|
67344
|
+
timeFrom: now - lookbackMs,
|
|
67345
|
+
timeTo: now,
|
|
67346
|
+
pageNumber: 0,
|
|
67347
|
+
pageSize: 10,
|
|
67348
|
+
includeClosedAlarms: true,
|
|
67349
|
+
customFilter: {
|
|
67350
|
+
and: {
|
|
67351
|
+
expressions: [
|
|
67352
|
+
{
|
|
67353
|
+
or: {
|
|
67354
|
+
expressions: [
|
|
67355
|
+
{
|
|
67356
|
+
fieldDescription: 'Alarm Id',
|
|
67357
|
+
field: 'alarmId',
|
|
67358
|
+
value: alarmId,
|
|
67359
|
+
condition: 'equals',
|
|
67360
|
+
},
|
|
67361
|
+
],
|
|
67362
|
+
},
|
|
67363
|
+
},
|
|
67364
|
+
],
|
|
67365
|
+
},
|
|
67366
|
+
},
|
|
67367
|
+
};
|
|
67368
|
+
const response = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', body, undefined, undefined, requestOverrides);
|
|
67369
|
+
return (response.alarms ?? []).find((alarm) => alarm.alarmId === alarmId);
|
|
67370
|
+
}
|
|
66660
67371
|
/** Returns the overview (first alarm in a custom-filter search) for an alarm ID. */
|
|
66661
67372
|
async getAlarmOverview(alarmId) {
|
|
66662
67373
|
const singleAlarmQuery = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', {
|
|
@@ -66865,9 +67576,126 @@ class AlarmService {
|
|
|
66865
67576
|
mapAlarms(alarmAllPage.alarms);
|
|
66866
67577
|
return alarmIdMap;
|
|
66867
67578
|
}
|
|
66868
|
-
/**
|
|
67579
|
+
/**
|
|
67580
|
+
* Lists every alarm enrichment rule of the tenant
|
|
67581
|
+
* (`GET oi/v2/alarm/enrichment/rules`).
|
|
67582
|
+
*
|
|
67583
|
+
* @remarks The server returns the rules **unsorted**. Evaluation order is
|
|
67584
|
+
* ascending `priority` — pass the result through `sortRulesByPriority`.
|
|
67585
|
+
* Response-validated, not thrown.
|
|
67586
|
+
*/
|
|
66869
67587
|
async getEnrichmentRules() {
|
|
66870
|
-
|
|
67588
|
+
const raw = await this.dxSaaSService.oiGet('oi/v2/alarm/enrichment/rules');
|
|
67589
|
+
const result = EnrichmentRulesResponseSchema.safeParse(raw);
|
|
67590
|
+
if (!result.success) {
|
|
67591
|
+
this.simpleLog.warn('EnrichmentRulesResponse validation warning:', result.error.message);
|
|
67592
|
+
}
|
|
67593
|
+
return raw;
|
|
67594
|
+
}
|
|
67595
|
+
/**
|
|
67596
|
+
* Saves one alarm enrichment rule (`PUT oi/v2/alarm/enrichment/rules`).
|
|
67597
|
+
* A body without `rule_id` creates and lets the server seed `priority`;
|
|
67598
|
+
* a body with one updates in place, which is also how a reorder writes a
|
|
67599
|
+
* new `priority`.
|
|
67600
|
+
*
|
|
67601
|
+
* @remarks Response-validated, not thrown.
|
|
67602
|
+
* @throws ZodError on a malformed body.
|
|
67603
|
+
*/
|
|
67604
|
+
async saveEnrichmentRule(body) {
|
|
67605
|
+
EnrichmentRuleWriteBodySchema.parse(body);
|
|
67606
|
+
const raw = await this.dxSaaSService.oiPut('oi/v2/alarm/enrichment/rules', body);
|
|
67607
|
+
const result = EnrichmentRuleSchema.safeParse(raw);
|
|
67608
|
+
if (!result.success) {
|
|
67609
|
+
this.simpleLog.warn('EnrichmentRule validation warning:', result.error.message);
|
|
67610
|
+
}
|
|
67611
|
+
return raw;
|
|
67612
|
+
}
|
|
67613
|
+
/** Permanently deletes an alarm enrichment rule (`DELETE oi/v2/alarm/enrichment/rules/{ruleId}`). */
|
|
67614
|
+
async deleteEnrichmentRule(ruleId) {
|
|
67615
|
+
return this.dxSaaSService.oiDelete(`oi/v2/alarm/enrichment/rules/${encodeURIComponent(ruleId)}`);
|
|
67616
|
+
}
|
|
67617
|
+
/**
|
|
67618
|
+
* Runs a rule against recent alarms without persisting it
|
|
67619
|
+
* (`PUT oi/v2/alarm/enrichment/rules/preview`) — the server-side dry run
|
|
67620
|
+
* behind `alarm create-enrichment-rule`.
|
|
67621
|
+
*
|
|
67622
|
+
* @param body a full or partial rule; `rule_id` may be absent.
|
|
67623
|
+
* @param options `size` caps the returned alarms, `timeDurationInMillis`
|
|
67624
|
+
* is the lookback window (86400000 = 24 h in the UI's default).
|
|
67625
|
+
* @remarks Response-validated, not thrown.
|
|
67626
|
+
* @throws ZodError on a malformed body.
|
|
67627
|
+
*/
|
|
67628
|
+
async previewEnrichmentRule(body, options = {}) {
|
|
67629
|
+
EnrichmentRuleWriteBodySchema.parse(body);
|
|
67630
|
+
const raw = await this.dxSaaSService.oiPut('oi/v2/alarm/enrichment/rules/preview', body, {
|
|
67631
|
+
size: options.size ?? 100,
|
|
67632
|
+
timeDurationInMillis: options.timeDurationInMillis ?? 86400000,
|
|
67633
|
+
});
|
|
67634
|
+
const result = EnrichmentPreviewResponseSchema.safeParse(raw);
|
|
67635
|
+
if (!result.success) {
|
|
67636
|
+
this.simpleLog.warn('EnrichmentPreviewResponse validation warning:', result.error.message);
|
|
67637
|
+
}
|
|
67638
|
+
return raw;
|
|
67639
|
+
}
|
|
67640
|
+
/**
|
|
67641
|
+
* The field catalog the enrichment filter editor offers
|
|
67642
|
+
* (`GET oi/v2/alarm/enrichment/fields`) — same shape as the queue and
|
|
67643
|
+
* filter catalogs, so `annotateAtoms` works against it unchanged.
|
|
67644
|
+
*
|
|
67645
|
+
* @remarks Response-validated, not thrown.
|
|
67646
|
+
*/
|
|
67647
|
+
async listEnrichmentFilterFields() {
|
|
67648
|
+
const raw = await this.dxSaaSService.oiGet('oi/v2/alarm/enrichment/fields');
|
|
67649
|
+
const result = AlarmQueueFieldsResponseSchema.safeParse(raw);
|
|
67650
|
+
if (!result.success) {
|
|
67651
|
+
this.simpleLog.warn('Enrichment field catalog validation warning:', result.error.message);
|
|
67652
|
+
}
|
|
67653
|
+
return raw;
|
|
67654
|
+
}
|
|
67655
|
+
/** The topology vertex types enrichment can read attributes from (`GET oi/v2/alarm/enrichment/vertexTypes`). */
|
|
67656
|
+
async listEnrichmentVertexTypes() {
|
|
67657
|
+
return this.dxSaaSService.oiGet('oi/v2/alarm/enrichment/vertexTypes');
|
|
67658
|
+
}
|
|
67659
|
+
/** The attribute names of one vertex type (`GET oi/v2/alarm/enrichment/attributesByVertexType`). */
|
|
67660
|
+
async listEnrichmentVertexAttributes(vertexType) {
|
|
67661
|
+
return this.dxSaaSService.oiGet('oi/v2/alarm/enrichment/attributesByVertexType', { vertexType });
|
|
67662
|
+
}
|
|
67663
|
+
/**
|
|
67664
|
+
* The custom-field registry that binds each `custom_N` slot to an attribute
|
|
67665
|
+
* name and its TAS / CUSTOM source
|
|
67666
|
+
* (`GET oi/v3/api/notifications/configAttributes?configKey=custom.field.description`).
|
|
67667
|
+
*
|
|
67668
|
+
* @remarks Response-validated, not thrown.
|
|
67669
|
+
*/
|
|
67670
|
+
async listEnrichmentCustomFields() {
|
|
67671
|
+
const raw = await this.dxSaaSService.oiGet('oi/v3/api/notifications/configAttributes', {
|
|
67672
|
+
configKey: 'custom.field.description',
|
|
67673
|
+
});
|
|
67674
|
+
const result = EnrichmentCustomFieldsResponseSchema.safeParse(raw);
|
|
67675
|
+
if (!result.success) {
|
|
67676
|
+
this.simpleLog.warn('EnrichmentCustomFields validation warning:', result.error.message);
|
|
67677
|
+
}
|
|
67678
|
+
return raw;
|
|
67679
|
+
}
|
|
67680
|
+
/**
|
|
67681
|
+
* Replaces the whole custom-field registry
|
|
67682
|
+
* (`PUT oi/v3/api/notifications/configAttributes?configKey=custom.field.description`).
|
|
67683
|
+
*
|
|
67684
|
+
* @remarks The PUT is a **whole-list replace**, not a merge — read the
|
|
67685
|
+
* current list, edit it, and send all of it back, or entries are lost.
|
|
67686
|
+
* Response-validated, not thrown.
|
|
67687
|
+
* @throws ZodError on a malformed list.
|
|
67688
|
+
*/
|
|
67689
|
+
async saveEnrichmentCustomFields(fields) {
|
|
67690
|
+
EnrichmentCustomFieldsResponseSchema.parse(fields);
|
|
67691
|
+
const raw = await this.dxSaaSService.oiPut('oi/v3/api/notifications/configAttributes', fields, {
|
|
67692
|
+
configKey: 'custom.field.description',
|
|
67693
|
+
});
|
|
67694
|
+
const result = EnrichmentCustomFieldsResponseSchema.safeParse(raw);
|
|
67695
|
+
if (!result.success) {
|
|
67696
|
+
this.simpleLog.warn('EnrichmentCustomFields validation warning:', result.error.message);
|
|
67697
|
+
}
|
|
67698
|
+
return raw;
|
|
66871
67699
|
}
|
|
66872
67700
|
/**
|
|
66873
67701
|
* Lists the alarm queues visible to the caller
|
|
@@ -69604,6 +70432,85 @@ class ChannelService {
|
|
|
69604
70432
|
}
|
|
69605
70433
|
return raw;
|
|
69606
70434
|
}
|
|
70435
|
+
// -------------------------------------------------------------------------
|
|
70436
|
+
// Ticket enrichment rules (customMappings)
|
|
70437
|
+
// -------------------------------------------------------------------------
|
|
70438
|
+
/**
|
|
70439
|
+
* Lists the tenant's ticket enrichment rules
|
|
70440
|
+
* (`GET dxinotify/notify/v1/customMappings/{orgId}`).
|
|
70441
|
+
*
|
|
70442
|
+
* @remarks A tenant with no rules answers with a bare `{}`, not
|
|
70443
|
+
* `{ customMappings: [] }` — normalised to `[]` here.
|
|
70444
|
+
* Response-validated, not thrown.
|
|
70445
|
+
*/
|
|
70446
|
+
async listTicketEnrichmentRules() {
|
|
70447
|
+
const raw = await this.notifyRequest('get', 'dxinotify/notify/v1/customMappings', true);
|
|
70448
|
+
const result = TicketEnrichmentListResponseSchema.safeParse(raw);
|
|
70449
|
+
if (!result.success) {
|
|
70450
|
+
this.log.warn('TicketEnrichmentListResponse validation warning:', result.error.message);
|
|
70451
|
+
}
|
|
70452
|
+
return raw.customMappings ?? [];
|
|
70453
|
+
}
|
|
70454
|
+
/**
|
|
70455
|
+
* Saves one ticket enrichment rule
|
|
70456
|
+
* (`PUT dxinotify/notify/v1/customMappings`). `id: 0` creates, an
|
|
70457
|
+
* existing id updates in place.
|
|
70458
|
+
*
|
|
70459
|
+
* @remarks `orgId` is stamped from the caller's token, so the body's value
|
|
70460
|
+
* is ignored. Unlike `saveChannel`, the response carries the persisted rule
|
|
70461
|
+
* including its new id. Response-validated, not thrown.
|
|
70462
|
+
* @throws ZodError on a malformed body.
|
|
70463
|
+
*/
|
|
70464
|
+
async saveTicketEnrichmentRule(body) {
|
|
70465
|
+
const stamped = { ...body, orgId: await this.dxSaaSService.getTenantCN() };
|
|
70466
|
+
TicketEnrichmentWriteBodySchema.parse(stamped);
|
|
70467
|
+
const raw = await this.notifyRequest('put', 'dxinotify/notify/v1/customMappings', false, stamped);
|
|
70468
|
+
const result = TicketEnrichmentWriteResponseSchema.safeParse(raw);
|
|
70469
|
+
if (!result.success) {
|
|
70470
|
+
this.log.warn('TicketEnrichmentWriteResponse validation warning:', result.error.message);
|
|
70471
|
+
}
|
|
70472
|
+
return raw;
|
|
70473
|
+
}
|
|
70474
|
+
/** Permanently deletes a ticket enrichment rule (`DELETE .../customMappings/{orgId}/{id}`). */
|
|
70475
|
+
async deleteTicketEnrichmentRule(ruleId) {
|
|
70476
|
+
const orgId = await this.dxSaaSService.getTenantCN();
|
|
70477
|
+
return this.notifyRequest('delete', `dxinotify/notify/v1/customMappings/${encodeURIComponent(orgId)}/${ruleId}`, false);
|
|
70478
|
+
}
|
|
70479
|
+
/**
|
|
70480
|
+
* The service-desk field catalog of one ITSM channel
|
|
70481
|
+
* (`GET oi/v2/tenantmgmtservice/properties?channelId=<id>`). A mapping's
|
|
70482
|
+
* `svcDeskField` is an entry's `mappedTo`.
|
|
70483
|
+
*
|
|
70484
|
+
* @remarks Field definitions only — it carries no channel credentials.
|
|
70485
|
+
* Response-validated, not thrown.
|
|
70486
|
+
*/
|
|
70487
|
+
async listServiceDeskFields(channelId) {
|
|
70488
|
+
const raw = await this.dxSaaSService.oiGet('oi/v2/tenantmgmtservice/properties', { channelId });
|
|
70489
|
+
const result = ServiceDeskFieldsResponseSchema.safeParse(raw);
|
|
70490
|
+
if (!result.success) {
|
|
70491
|
+
this.log.warn('ItsmProperties validation warning:', result.error.message);
|
|
70492
|
+
}
|
|
70493
|
+
return raw;
|
|
70494
|
+
}
|
|
70495
|
+
/**
|
|
70496
|
+
* The alarm fields a ticket enrichment rule can read
|
|
70497
|
+
* (`GET oi/v2/api/alarm/messageTemplate/fields?usedInTicketEnrichment=true`).
|
|
70498
|
+
*
|
|
70499
|
+
* @remarks Each entry's `alarmType` lists the catalog codes it is valid
|
|
70500
|
+
* for; a rule mapping a field outside its own type's code is rejected with
|
|
70501
|
+
* a bare 400. See `TICKET_ENRICHMENT_FIELD_CODES`.
|
|
70502
|
+
* Response-validated, not thrown.
|
|
70503
|
+
*/
|
|
70504
|
+
async listTicketEnrichmentAlarmFields() {
|
|
70505
|
+
const raw = await this.dxSaaSService.oiGet('oi/v2/api/alarm/messageTemplate/fields', {
|
|
70506
|
+
usedInTicketEnrichment: true,
|
|
70507
|
+
});
|
|
70508
|
+
const result = TicketEnrichmentAlarmFieldsResponseSchema.safeParse(raw);
|
|
70509
|
+
if (!result.success) {
|
|
70510
|
+
this.log.warn('TicketEnrichmentAlarmFields validation warning:', result.error.message);
|
|
70511
|
+
}
|
|
70512
|
+
return raw;
|
|
70513
|
+
}
|
|
69607
70514
|
/** Returns all notification channels using the new DXChannelConfiguration model. */
|
|
69608
70515
|
retrieveAllChannelsNew() {
|
|
69609
70516
|
return this.dxSaaSService
|
|
@@ -74964,6 +75871,12 @@ class DxSaasService {
|
|
|
74964
75871
|
this.simplifiedCohortId = this.dxdoConfiguration.dxConfiguration.cohortId
|
|
74965
75872
|
.replace(/-/g, '')
|
|
74966
75873
|
.toLowerCase();
|
|
75874
|
+
// Opt-in only: without it axios keeps its default of no timeout, which the
|
|
75875
|
+
// CLI's streaming and long-running query paths rely on.
|
|
75876
|
+
const requestTimeoutMs = this.dxdoConfiguration.requestTimeoutMs;
|
|
75877
|
+
if (requestTimeoutMs !== undefined && requestTimeoutMs > 0) {
|
|
75878
|
+
this._httpClient.defaults.timeout = requestTimeoutMs;
|
|
75879
|
+
}
|
|
74967
75880
|
this.initializeProxyIfNecessary();
|
|
74968
75881
|
// Strip auth tokens from any error this client surfaces, so nothing downstream
|
|
74969
75882
|
// (handleAxiosError, re-throws, top-level catches) can log the Authorization header.
|
|
@@ -75248,9 +76161,7 @@ class DxSaasService {
|
|
|
75248
76161
|
* @param body - Request body (JSON-serializable). Defaults to `{}`.
|
|
75249
76162
|
* @param params - Query-string parameters.
|
|
75250
76163
|
* @param headers - Additional request headers merged over the auth header.
|
|
75251
|
-
* @param requestOverrides - Per-call axios settings
|
|
75252
|
-
* the shared client has no default timeout, so a caller that must not
|
|
75253
|
-
* hang — the at-exit command audit — bounds itself here.
|
|
76164
|
+
* @param requestOverrides - Per-call axios settings, see {@link RequestOverrides}.
|
|
75254
76165
|
*/
|
|
75255
76166
|
async tenantPost(path, body, params, headers = {}, requestOverrides = {}) {
|
|
75256
76167
|
const url = `${this.dxdoConfiguration.dxConfiguration.dxGatewayHost}${this.getCohortIDForURL()}/${path}`;
|
|
@@ -75443,10 +76354,14 @@ class DxSaasService {
|
|
|
75443
76354
|
* @param body - Request body.
|
|
75444
76355
|
* @param params - Query-string parameters.
|
|
75445
76356
|
* @param extraHeaders - Additional request headers.
|
|
76357
|
+
* @param requestOverrides - Per-call axios settings, see {@link RequestOverrides}.
|
|
75446
76358
|
*/
|
|
75447
|
-
async oiPost(path, body, params, extraHeaders) {
|
|
76359
|
+
async oiPost(path, body, params, extraHeaders, requestOverrides = {}) {
|
|
75448
76360
|
const url = `${this.dxdoConfiguration.dxConfiguration.dxGatewayHost}${this.getCohortIDForURL()}/${path}`;
|
|
75449
|
-
const config =
|
|
76361
|
+
const config = {
|
|
76362
|
+
...this.createUserAuthorizedRequestConfig(params ?? {}),
|
|
76363
|
+
...requestOverrides,
|
|
76364
|
+
};
|
|
75450
76365
|
if (extraHeaders) {
|
|
75451
76366
|
if (config.headers) {
|
|
75452
76367
|
config.headers = { ...config.headers, ...extraHeaders };
|
|
@@ -75595,7 +76510,10 @@ class DxSaasService {
|
|
|
75595
76510
|
}
|
|
75596
76511
|
const profile = this.dxdoConfiguration.configurationFilePath ?? '~/.dxdo/<profile>.dxo2.config.json';
|
|
75597
76512
|
const host = config.dxGatewayHost;
|
|
75598
|
-
|
|
76513
|
+
// `definitive` tells a long-running producer whether to give up on log
|
|
76514
|
+
// shipping for the process (the profile itself rules it out) or to retry
|
|
76515
|
+
// later (only the products lookup failed, e.g. a maintenance window).
|
|
76516
|
+
const cannot = (reason, definitive = true) => new exports.LogIngest.LogIngestionEndpointError(`Cannot determine the log ingestion endpoint: ${reason}`, definitive);
|
|
75599
76517
|
let gateway;
|
|
75600
76518
|
try {
|
|
75601
76519
|
gateway = parseSaasGateway(host);
|
|
@@ -75618,7 +76536,7 @@ class DxSaasService {
|
|
|
75618
76536
|
catch (error) {
|
|
75619
76537
|
const message = error instanceof Error ? error.message : String(error);
|
|
75620
76538
|
throw cannot(`the tenant products lookup (GET spp/v5/products on ${gateway.hostname}) failed: ${message}. ` +
|
|
75621
|
-
`Set "dxLogIngestionURL" (e.g. "${derived}") in ${profile} to bypass the lookup
|
|
76539
|
+
`Set "dxLogIngestionURL" (e.g. "${derived}") in ${profile} to bypass the lookup.`, false);
|
|
75622
76540
|
}
|
|
75623
76541
|
const tenant = products.displayName ?? '?';
|
|
75624
76542
|
const la = findProduct(products, LOG_ANALYTICS_PRODUCT);
|
|
@@ -75642,14 +76560,19 @@ class DxSaasService {
|
|
|
75642
76560
|
* `dxLogIngestionURL`, or the SaaS logs-gateway derived from the region and
|
|
75643
76561
|
* Log Analytics provisioning. Auth uses the same `Bearer {userToken}` as
|
|
75644
76562
|
* other tenant methods.
|
|
75645
|
-
* @
|
|
76563
|
+
* @param requestOverrides - Per-call axios settings, see {@link RequestOverrides}.
|
|
76564
|
+
* @throws {@link LogIngest.LogIngestionEndpointError} from
|
|
76565
|
+
* {@link resolveLogIngestionURL} when no endpoint can be determined.
|
|
75646
76566
|
*/
|
|
75647
|
-
async logPost(path, body) {
|
|
76567
|
+
async logPost(path, body, requestOverrides = {}) {
|
|
75648
76568
|
const logBase = await this.resolveLogIngestionURL();
|
|
75649
76569
|
const url = `${logBase}/${path}`;
|
|
75650
76570
|
this.log.debug(`log posting to: ${url}`);
|
|
75651
76571
|
return this._httpClient
|
|
75652
|
-
.post(url, body ?? {},
|
|
76572
|
+
.post(url, body ?? {}, {
|
|
76573
|
+
...this.createSimpleUserAuthorizedRequestConfig(undefined),
|
|
76574
|
+
...requestOverrides,
|
|
76575
|
+
})
|
|
75653
76576
|
.then((response) => response.data)
|
|
75654
76577
|
.catch((reason) => {
|
|
75655
76578
|
if (reason.response || reason.request) {
|
|
@@ -76290,6 +77213,17 @@ class EventService {
|
|
|
76290
77213
|
}
|
|
76291
77214
|
/** Ingests a custom alarm event via the Jarvis ingestion API. */
|
|
76292
77215
|
createAlarm(alarmEvent) {
|
|
77216
|
+
return this.createAlarms([alarmEvent]);
|
|
77217
|
+
}
|
|
77218
|
+
/**
|
|
77219
|
+
* Ingests several custom alarm documents in one Jarvis ingestion request.
|
|
77220
|
+
*
|
|
77221
|
+
* @remarks Each document's `alarm_unique_id` is its alarm's id: a second
|
|
77222
|
+
* document with the same id updates that alarm in place, a closed alarm
|
|
77223
|
+
* ignores every later document, and a CLOSED document for an id that was
|
|
77224
|
+
* never opened creates a closed alarm.
|
|
77225
|
+
*/
|
|
77226
|
+
createAlarms(alarmEvents, requestOverrides = {}) {
|
|
76293
77227
|
const ingestionBody = {
|
|
76294
77228
|
documents: [
|
|
76295
77229
|
{
|
|
@@ -76300,14 +77234,14 @@ class EventService {
|
|
|
76300
77234
|
product_id: 'ao',
|
|
76301
77235
|
unique_id: "$['alarm_unique_id']",
|
|
76302
77236
|
},
|
|
76303
|
-
body: [
|
|
77237
|
+
body: [...alarmEvents],
|
|
76304
77238
|
},
|
|
76305
77239
|
],
|
|
76306
77240
|
};
|
|
76307
|
-
this.log.debug('
|
|
77241
|
+
this.log.debug('createAlarms', JSON.stringify(ingestionBody, null, 2));
|
|
76308
77242
|
return this.dxSaaSService.oiPost('jarvis/v2/ingestion', ingestionBody, {}, {
|
|
76309
77243
|
index_name: 'ao_itoa_alarms_custom_1',
|
|
76310
|
-
});
|
|
77244
|
+
}, requestOverrides);
|
|
76311
77245
|
}
|
|
76312
77246
|
/** Ingests a custom event (non-change) via the Jarvis ingestion API. */
|
|
76313
77247
|
createEvent(changeEvent) {
|
|
@@ -80530,8 +81464,93 @@ function detectIPv4() {
|
|
|
80530
81464
|
function orDefault(value, fallback) {
|
|
80531
81465
|
return value ? value : fallback;
|
|
80532
81466
|
}
|
|
80533
|
-
/**
|
|
81467
|
+
/**
|
|
81468
|
+
* A source file slot the platform can actually parse.
|
|
81469
|
+
*
|
|
81470
|
+
* The Kafka consumer's pattern for slot 8 matches only a dotted token. When it does not match, the
|
|
81471
|
+
* parse slides and the record is stored wrong: `tags` swallows the middle, `file` takes the
|
|
81472
|
+
* second-to-last word of the message, and `message` keeps only the last word. Measured on a lab
|
|
81473
|
+
* tenant (2026-09-16, issue #620): `orig.file` parsed, while `orig-file`, `orig_file` and `origfile`
|
|
81474
|
+
* each corrupted the record. Producers that pass a Java logger name never saw it, because those are
|
|
81475
|
+
* dotted; `broker-events` or a bare integration name did.
|
|
81476
|
+
*
|
|
81477
|
+
* Appending `.log` makes the slot parseable and leaves a value that already has a dot untouched.
|
|
81478
|
+
*/
|
|
81479
|
+
function dottedFileSlot(value) {
|
|
81480
|
+
return value.includes('.') ? value : `${value}.log`;
|
|
81481
|
+
}
|
|
81482
|
+
/**
|
|
81483
|
+
* Ingestion path on the log gateway — the uim_logs pipeline shared with the
|
|
81484
|
+
* on-prem log collector. POSTed under the log gateway base (no cohort
|
|
81485
|
+
* segment) via {@link DxSaasService.logPost}.
|
|
81486
|
+
*/
|
|
80534
81487
|
const UIM_LOGS_INGESTION_PATH = 'mdo/v2/aoanalytics/ingestion/uim_logs';
|
|
81488
|
+
/**
|
|
81489
|
+
* Builds the uim_logs document for one log entry — the pure form of
|
|
81490
|
+
* {@link LogsService.buildLogPayload}, for producers that own their own
|
|
81491
|
+
* transport (a monitoring loop's log shipper) but must stay byte-compatible
|
|
81492
|
+
* with what `dx-do log ingest` sends.
|
|
81493
|
+
*
|
|
81494
|
+
* @param cohortId - The tenant's cohort id as it appears in the profile; it is
|
|
81495
|
+
* upper-cased into `tenant_id` and the first `temp_fields` slot.
|
|
81496
|
+
* @param options - Known log entry fields (`message` required; the rest
|
|
81497
|
+
* optional with sensible defaults). Validated against
|
|
81498
|
+
* {@link LogIngest.LogIngestOptionsSchema}.
|
|
81499
|
+
* @param additionalFields - Arbitrary extra fields to include in the indexed
|
|
81500
|
+
* document. `severity` and `logseverity` (any letter case) are refused:
|
|
81501
|
+
* severity travels through `options.severity` and is emitted as `logseverity`.
|
|
81502
|
+
* @remarks `options.file` is passed through {@link dottedFileSlot}: a source file
|
|
81503
|
+
* without a dot gets `.log` appended, because the platform's positional parse
|
|
81504
|
+
* only matches a dotted source file and corrupts the record otherwise (#620).
|
|
81505
|
+
* @throws ZodError if `options` fails schema validation.
|
|
81506
|
+
* @throws Error if `additionalFields` names a reserved field.
|
|
81507
|
+
*/
|
|
81508
|
+
function buildUimLogPayload(cohortId, options, additionalFields) {
|
|
81509
|
+
exports.LogIngest.LogIngestOptionsSchema.parse(options);
|
|
81510
|
+
for (const key of Object.keys(additionalFields ?? {})) {
|
|
81511
|
+
if (exports.LogIngest.isReservedLogField(key)) {
|
|
81512
|
+
throw new Error(`additional field '${key}' is reserved: pass severity through the 'severity' option — it is sent as 'logseverity'`);
|
|
81513
|
+
}
|
|
81514
|
+
}
|
|
81515
|
+
const tenantIdUpper = cohortId.toUpperCase();
|
|
81516
|
+
// `orDefault` (not `??`) so an explicit empty string is treated as omitted —
|
|
81517
|
+
// a blank value in any temp_fields component shifts every downstream
|
|
81518
|
+
// positional field. See the temp_fields comment below.
|
|
81519
|
+
const logtype = orDefault(options.logtype, 'generic');
|
|
81520
|
+
const host = orDefault(options.host, require$$0$3.hostname());
|
|
81521
|
+
const ip = orDefault(options.ip, detectIPv4());
|
|
81522
|
+
const agentInstance = orDefault(options.agentInstance, 'dx-do');
|
|
81523
|
+
const agentName = orDefault(options.agentName, 'Logs Collector');
|
|
81524
|
+
const containerId = orDefault(options.containerId, host);
|
|
81525
|
+
const containerName = orDefault(options.containerName, agentInstance);
|
|
81526
|
+
// A source file without a dot corrupts the whole record; see dottedFileSlot.
|
|
81527
|
+
const file = dottedFileSlot(orDefault(options.file, 'dx-do.cli'));
|
|
81528
|
+
const tag = `${logtype} logs`;
|
|
81529
|
+
// temp_fields must have exactly 9 space-separated components before the message
|
|
81530
|
+
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|
|
81531
|
+
// The Kafka consumer parses positionally: [0]=tenant [1]=logtype [2]=host
|
|
81532
|
+
// [3]=container_id [4]=container_name [5]=ip [6-7]=tags [8]=source_file [9+]=message.
|
|
81533
|
+
const temp_fields = `${tenantIdUpper} ${logtype} ${host} ${containerId} ${containerName} ${ip} ${tag} ${file}`;
|
|
81534
|
+
return {
|
|
81535
|
+
'@timestamp': options.timestamp ?? new Date().toISOString(),
|
|
81536
|
+
// logtype must be top-level: the SaaS filter does `update => ["type", "%{logtype}"]`
|
|
81537
|
+
// which drives Kafka consumer index routing — without it type stays as "ingestionapi"
|
|
81538
|
+
logtype,
|
|
81539
|
+
// The platform indexes severity as `logseverity`; a bare `severity` is
|
|
81540
|
+
// silently dropped, which is why both are reserved as custom fields.
|
|
81541
|
+
logseverity: options.severity ?? exports.LogIngest.DEFAULT_LOG_SEVERITY,
|
|
81542
|
+
message: options.message,
|
|
81543
|
+
host: { name: host, hostname: host },
|
|
81544
|
+
tenant_id: tenantIdUpper,
|
|
81545
|
+
temp_fields,
|
|
81546
|
+
tags: [tag],
|
|
81547
|
+
__agent_name: agentName,
|
|
81548
|
+
__agent_instance: agentInstance,
|
|
81549
|
+
container_id: containerId,
|
|
81550
|
+
container_name: containerName,
|
|
81551
|
+
...additionalFields,
|
|
81552
|
+
};
|
|
81553
|
+
}
|
|
80535
81554
|
/**
|
|
80536
81555
|
* Service for querying and ingesting log analytics data.
|
|
80537
81556
|
*/
|
|
@@ -80572,50 +81591,7 @@ class LogsService {
|
|
|
80572
81591
|
* @throws Error if `additionalFields` names a reserved field.
|
|
80573
81592
|
*/
|
|
80574
81593
|
buildLogPayload(options, additionalFields) {
|
|
80575
|
-
|
|
80576
|
-
for (const key of Object.keys(additionalFields ?? {})) {
|
|
80577
|
-
if (exports.LogIngest.isReservedLogField(key)) {
|
|
80578
|
-
throw new Error(`additional field '${key}' is reserved: pass severity through the 'severity' option — it is sent as 'logseverity'`);
|
|
80579
|
-
}
|
|
80580
|
-
}
|
|
80581
|
-
const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
|
|
80582
|
-
const tenantIdUpper = cohortId.toUpperCase();
|
|
80583
|
-
// `orDefault` (not `??`) so an explicit empty string is treated as omitted —
|
|
80584
|
-
// a blank value in any temp_fields component shifts every downstream
|
|
80585
|
-
// positional field. See the temp_fields comment below.
|
|
80586
|
-
const logtype = orDefault(options.logtype, 'generic');
|
|
80587
|
-
const host = orDefault(options.host, require$$0$3.hostname());
|
|
80588
|
-
const ip = orDefault(options.ip, detectIPv4());
|
|
80589
|
-
const agentInstance = orDefault(options.agentInstance, 'dx-do');
|
|
80590
|
-
const agentName = orDefault(options.agentName, 'Logs Collector');
|
|
80591
|
-
const containerId = orDefault(options.containerId, host);
|
|
80592
|
-
const containerName = orDefault(options.containerName, agentInstance);
|
|
80593
|
-
const file = orDefault(options.file, 'dx-do.cli');
|
|
80594
|
-
const tag = `${logtype} logs`;
|
|
80595
|
-
// temp_fields must have exactly 9 space-separated components before the message
|
|
80596
|
-
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|
|
80597
|
-
// The Kafka consumer parses positionally: [0]=tenant [1]=logtype [2]=host
|
|
80598
|
-
// [3]=container_id [4]=container_name [5]=ip [6-7]=tags [8]=source_file [9+]=message.
|
|
80599
|
-
const temp_fields = `${tenantIdUpper} ${logtype} ${host} ${containerId} ${containerName} ${ip} ${tag} ${file}`;
|
|
80600
|
-
return {
|
|
80601
|
-
'@timestamp': options.timestamp ?? new Date().toISOString(),
|
|
80602
|
-
// logtype must be top-level: the SaaS filter does `update => ["type", "%{logtype}"]`
|
|
80603
|
-
// which drives Kafka consumer index routing — without it type stays as "ingestionapi"
|
|
80604
|
-
logtype,
|
|
80605
|
-
// The platform indexes severity as `logseverity`; a bare `severity` is
|
|
80606
|
-
// silently dropped, which is why both are reserved as custom fields.
|
|
80607
|
-
logseverity: options.severity ?? exports.LogIngest.DEFAULT_LOG_SEVERITY,
|
|
80608
|
-
message: options.message,
|
|
80609
|
-
host: { name: host, hostname: host },
|
|
80610
|
-
tenant_id: tenantIdUpper,
|
|
80611
|
-
temp_fields,
|
|
80612
|
-
tags: [tag],
|
|
80613
|
-
__agent_name: agentName,
|
|
80614
|
-
__agent_instance: agentInstance,
|
|
80615
|
-
container_id: containerId,
|
|
80616
|
-
container_name: containerName,
|
|
80617
|
-
...additionalFields,
|
|
80618
|
-
};
|
|
81594
|
+
return buildUimLogPayload(this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId, options, additionalFields);
|
|
80619
81595
|
}
|
|
80620
81596
|
/**
|
|
80621
81597
|
* Ingests a single log entry into the log gateway.
|
|
@@ -82631,6 +83607,27 @@ class ServiceService {
|
|
|
82631
83607
|
const { body } = await this.buildServiceContentBody(serviceName, newContent, mode);
|
|
82632
83608
|
return this.createService(body, { replace: true });
|
|
82633
83609
|
}
|
|
83610
|
+
/**
|
|
83611
|
+
* Builds the store body for changing a service's own attributes (description,
|
|
83612
|
+
* location, tags, custom properties, includeChildServices) WITHOUT saving.
|
|
83613
|
+
* Re-saves the full subtree (via {@link buildHierarchyBody}) so the children
|
|
83614
|
+
* edges survive `replace=true`; only the target vertex changes. The name and
|
|
83615
|
+
* the service type are never patched — both are fixed at creation (the server
|
|
83616
|
+
* does not allow renames and ignores a `serviceType` change on a re-save).
|
|
83617
|
+
*
|
|
83618
|
+
* @returns the store body plus human-readable change lines (empty = no-op).
|
|
83619
|
+
* @throws Error if the service does not exist.
|
|
83620
|
+
*/
|
|
83621
|
+
async buildServiceUpdateBody(serviceName, patch) {
|
|
83622
|
+
const body = await this.buildHierarchyBody(serviceName);
|
|
83623
|
+
const changes = exports.ServiceTransform.applyServiceUpdate(body, serviceName, patch);
|
|
83624
|
+
return { body, changes };
|
|
83625
|
+
}
|
|
83626
|
+
/** Updates a service's attributes and saves it. See {@link buildServiceUpdateBody}. */
|
|
83627
|
+
async updateService(serviceName, patch) {
|
|
83628
|
+
const { body } = await this.buildServiceUpdateBody(serviceName, patch);
|
|
83629
|
+
return this.createService(body, { replace: true });
|
|
83630
|
+
}
|
|
82634
83631
|
/** Deletes a service by name; optionally deletes child services recursively. */
|
|
82635
83632
|
async deleteService(serviceName, recursive = false) {
|
|
82636
83633
|
return this.dxSaaSService.tenantPost('/oi/v2/sa/service/status', { name: serviceName, action: 'delete' }, { recursive });
|
|
@@ -82650,19 +83647,23 @@ class ServiceService {
|
|
|
82650
83647
|
},
|
|
82651
83648
|
};
|
|
82652
83649
|
}
|
|
82653
|
-
/**
|
|
82654
|
-
|
|
83650
|
+
/**
|
|
83651
|
+
* Builds an empty (no-content) service vertex payload ready to be populated.
|
|
83652
|
+
* @param serviceType - `Service` (default) | `Application` | `Group`.
|
|
83653
|
+
*/
|
|
83654
|
+
generateEmptyServiceVertex(serviceName, serviceDescription, situationsIncludeChildServices, tags = [], customProperties = [], serviceType = 'Service', location = '') {
|
|
82655
83655
|
return {
|
|
82656
83656
|
attributes: {
|
|
82657
83657
|
type: 'saService',
|
|
82658
83658
|
name: serviceName,
|
|
83659
|
+
serviceType,
|
|
82659
83660
|
state: 'ACTIVE',
|
|
82660
83661
|
maintenance: false,
|
|
82661
83662
|
situationsIncludeChildServices,
|
|
82662
83663
|
serviceContent: [],
|
|
82663
83664
|
root_service: null,
|
|
82664
83665
|
tags,
|
|
82665
|
-
location
|
|
83666
|
+
location,
|
|
82666
83667
|
description: serviceDescription,
|
|
82667
83668
|
customProperties,
|
|
82668
83669
|
customMetrics: [],
|
|
@@ -83504,17 +84505,20 @@ class DataStoreMetricsMetadataService {
|
|
|
83504
84505
|
* schema validation, a warning is logged but the raw API response is
|
|
83505
84506
|
* still returned.
|
|
83506
84507
|
*
|
|
84508
|
+
* @param requestOverrides - Per-call `timeout` / `signal`; registration is
|
|
84509
|
+
* an idempotent upsert, so a caller may safely retry after a timeout.
|
|
84510
|
+
*
|
|
83507
84511
|
* @throws ZodError if the request fails schema validation — including the
|
|
83508
84512
|
* tag-registration restrictions ("@tags" non-empty, every listed tag
|
|
83509
84513
|
* present with a non-empty string value, TYPE_TAGS never set without tags).
|
|
83510
84514
|
*/
|
|
83511
|
-
async registerMetrics(metrics, sync) {
|
|
84515
|
+
async registerMetrics(metrics, sync, requestOverrides = {}) {
|
|
83512
84516
|
const body = {
|
|
83513
84517
|
metrics: metrics.map((m) => ensureTypeTagsFlag(m)),
|
|
83514
84518
|
...(sync !== undefined ? { sync } : {}),
|
|
83515
84519
|
};
|
|
83516
84520
|
MetricRegisterRequestSchema.parse(body);
|
|
83517
|
-
const raw = await this.dxSaasService.tenantPost('metadata/registerMetric', body);
|
|
84521
|
+
const raw = await this.dxSaasService.tenantPost('metadata/registerMetric', body, undefined, {}, requestOverrides);
|
|
83518
84522
|
const result = MetricRegisterResponseSchema.safeParse(raw);
|
|
83519
84523
|
if (!result.success) {
|
|
83520
84524
|
this.log.warn('MetricRegisterResponse validation warning:', result.error.message);
|
|
@@ -83522,8 +84526,8 @@ class DataStoreMetricsMetadataService {
|
|
|
83522
84526
|
return raw;
|
|
83523
84527
|
}
|
|
83524
84528
|
/** Registers a single metric. Convenience wrapper around {@link registerMetrics}. */
|
|
83525
|
-
async registerMetric(metric, sync) {
|
|
83526
|
-
return this.registerMetrics([metric], sync);
|
|
84529
|
+
async registerMetric(metric, sync, requestOverrides = {}) {
|
|
84530
|
+
return this.registerMetrics([metric], sync, requestOverrides);
|
|
83527
84531
|
}
|
|
83528
84532
|
/**
|
|
83529
84533
|
* POSTs a metadata query to `/metadata/queryMetric` and returns the matching
|
|
@@ -83780,15 +84784,18 @@ class DataStoreTASService {
|
|
|
83780
84784
|
* POSTs a graph to `/tas/graph/store` and returns the store result including
|
|
83781
84785
|
* any failed vertices or edges.
|
|
83782
84786
|
*
|
|
83783
|
-
* @remarks The request is validated against {@link TasStoreGraphInputSchema}
|
|
83784
|
-
*
|
|
83785
|
-
*
|
|
84787
|
+
* @remarks The request is validated against {@link TasStoreGraphInputSchema}
|
|
84788
|
+
* (externalId-keyed vertices and edges — the ingestion contract; numeric
|
|
84789
|
+
* ids are optional). If the response fails schema validation, a warning is
|
|
84790
|
+
* logged but the raw API response is still returned.
|
|
84791
|
+
* @param requestOverrides - Per-call `timeout` / `signal`; the store is
|
|
84792
|
+
* idempotent, so a caller may safely retry after a timeout.
|
|
83786
84793
|
*
|
|
83787
84794
|
* @throws ZodError if the request fails schema validation.
|
|
83788
84795
|
*/
|
|
83789
|
-
async storeGraph(input) {
|
|
84796
|
+
async storeGraph(input, requestOverrides = {}) {
|
|
83790
84797
|
TasStoreGraphInputSchema.parse(input);
|
|
83791
|
-
const raw = await this.dxSaasService.tenantPost('tas/graph/store', input);
|
|
84798
|
+
const raw = await this.dxSaasService.tenantPost('tas/graph/store', input, undefined, {}, requestOverrides);
|
|
83792
84799
|
const result = TasStoreGraphResponseSchema.safeParse(raw);
|
|
83793
84800
|
if (!result.success) {
|
|
83794
84801
|
this.log.warn('TasStoreGraphResponse validation warning:', result.error.message);
|
|
@@ -84216,13 +85223,17 @@ class DataStoreNASSService {
|
|
|
84216
85223
|
* @remarks The request is validated against {@link NassStoreRequestSchema}.
|
|
84217
85224
|
* If the response fails schema validation, a warning is logged but the raw
|
|
84218
85225
|
* API response is still returned.
|
|
85226
|
+
* @param requestOverrides - Per-call `timeout` / `signal`. A store is NOT
|
|
85227
|
+
* idempotent: a second write to the same `(metricId, timestamp)` merges
|
|
85228
|
+
* with the first, so only retry when the request provably never reached
|
|
85229
|
+
* the server.
|
|
84219
85230
|
*
|
|
84220
85231
|
* @throws ZodError if any datapoint fails schema validation.
|
|
84221
85232
|
*/
|
|
84222
|
-
async storeMetricValues(values) {
|
|
85233
|
+
async storeMetricValues(values, requestOverrides = {}) {
|
|
84223
85234
|
const body = { values };
|
|
84224
85235
|
NassStoreRequestSchema.parse(body);
|
|
84225
|
-
const raw = await this.dxSaasService.tenantPost('nass/metricValue/store', body);
|
|
85236
|
+
const raw = await this.dxSaasService.tenantPost('nass/metricValue/store', body, undefined, {}, requestOverrides);
|
|
84226
85237
|
const result = NassStoreResponseSchema.safeParse(raw);
|
|
84227
85238
|
if (!result.success) {
|
|
84228
85239
|
this.log.warn('NassStoreResponse validation warning:', result.error.message);
|
|
@@ -84788,6 +85799,7 @@ exports.BlobStoreResponseSchema = BlobStoreResponseSchema;
|
|
|
84788
85799
|
exports.CURL_COHORT_VAR = CURL_COHORT_VAR;
|
|
84789
85800
|
exports.CURL_HOST_VAR = CURL_HOST_VAR;
|
|
84790
85801
|
exports.CURL_TOKEN_VAR = CURL_TOKEN_VAR;
|
|
85802
|
+
exports.CUSTOM_FIELD_PATTERN = CUSTOM_FIELD_PATTERN;
|
|
84791
85803
|
exports.CalendarIntervalSchema = CalendarIntervalSchema;
|
|
84792
85804
|
exports.CancelRevokeRequestSchema = CancelRevokeRequestSchema;
|
|
84793
85805
|
exports.ChannelDeleteResponseSchema = ChannelDeleteResponseSchema;
|
|
@@ -84827,8 +85839,19 @@ exports.DeleteTokensResponseSchema = DeleteTokensResponseSchema;
|
|
|
84827
85839
|
exports.DxO2SaasRegionSchema = DxO2SaasRegionSchema;
|
|
84828
85840
|
exports.DxSaasService = DxSaasService;
|
|
84829
85841
|
exports.DxoiService = DxoiService;
|
|
85842
|
+
exports.ENRICHMENT_FILTER_CONDITIONS = ENRICHMENT_FILTER_CONDITIONS;
|
|
85843
|
+
exports.ENRICHMENT_PREVIEW_WINDOWS = ENRICHMENT_PREVIEW_WINDOWS;
|
|
85844
|
+
exports.ENRICHMENT_SOURCES = ENRICHMENT_SOURCES;
|
|
84830
85845
|
exports.EXPORT_INCLUDE_TOKEN_ENV = EXPORT_INCLUDE_TOKEN_ENV;
|
|
84831
85846
|
exports.EdgeNumericIdSchema = EdgeNumericIdSchema;
|
|
85847
|
+
exports.EnrichmentCustomFieldSchema = EnrichmentCustomFieldSchema;
|
|
85848
|
+
exports.EnrichmentCustomFieldsResponseSchema = EnrichmentCustomFieldsResponseSchema;
|
|
85849
|
+
exports.EnrichmentMappingSchema = EnrichmentMappingSchema;
|
|
85850
|
+
exports.EnrichmentPreviewResponseSchema = EnrichmentPreviewResponseSchema;
|
|
85851
|
+
exports.EnrichmentRuleSchema = EnrichmentRuleSchema;
|
|
85852
|
+
exports.EnrichmentRuleWriteBodySchema = EnrichmentRuleWriteBodySchema;
|
|
85853
|
+
exports.EnrichmentRulesResponseSchema = EnrichmentRulesResponseSchema;
|
|
85854
|
+
exports.EnrichmentSchema = EnrichmentSchema;
|
|
84832
85855
|
exports.EventService = EventService;
|
|
84833
85856
|
exports.ExperienceService = ExperienceService;
|
|
84834
85857
|
exports.FILTER_FIELDS = FILTER_FIELDS;
|
|
@@ -84996,6 +86019,8 @@ exports.SLIService = SLIService;
|
|
|
84996
86019
|
exports.SLI_DERIVED_METRIC_SOURCE = SLI_DERIVED_METRIC_SOURCE;
|
|
84997
86020
|
exports.SMTP_DEFAULT_TEMPLATES = SMTP_DEFAULT_TEMPLATES;
|
|
84998
86021
|
exports.SQLService = SQLService;
|
|
86022
|
+
exports.ServiceDeskFieldSchema = ServiceDeskFieldSchema;
|
|
86023
|
+
exports.ServiceDeskFieldsResponseSchema = ServiceDeskFieldsResponseSchema;
|
|
84999
86024
|
exports.ServiceFilterSpecifierSchema = ServiceFilterSpecifierSchema;
|
|
85000
86025
|
exports.ServiceService = ServiceService;
|
|
85001
86026
|
exports.ServiceUniverseAccessEntrySchema = ServiceUniverseAccessEntrySchema;
|
|
@@ -85067,6 +86092,8 @@ exports.StatusPageComponentsSchema = StatusPageComponentsSchema;
|
|
|
85067
86092
|
exports.TAGS_ATTRIBUTE_KEY = TAGS_ATTRIBUTE_KEY;
|
|
85068
86093
|
exports.TASService = TASService;
|
|
85069
86094
|
exports.TC_METRIC_CAP = TC_METRIC_CAP;
|
|
86095
|
+
exports.TICKET_ENRICHMENT_ALARM_TYPES = TICKET_ENRICHMENT_ALARM_TYPES;
|
|
86096
|
+
exports.TICKET_ENRICHMENT_FIELD_CODES = TICKET_ENRICHMENT_FIELD_CODES;
|
|
85070
86097
|
exports.TasAddFlowsFilterSchema = TasAddFlowsFilterSchema;
|
|
85071
86098
|
exports.TasAddTransitioningEdgesFilterSchema = TasAddTransitioningEdgesFilterSchema;
|
|
85072
86099
|
exports.TasAddWireContextFilterSchema = TasAddWireContextFilterSchema;
|
|
@@ -85118,9 +86145,13 @@ exports.TasProjectionFilterSchema = TasProjectionFilterSchema;
|
|
|
85118
86145
|
exports.TasQuerySchema = TasQuerySchema;
|
|
85119
86146
|
exports.TasServiceFilterSchema = TasServiceFilterSchema;
|
|
85120
86147
|
exports.TasStatusFilterSchema = TasStatusFilterSchema;
|
|
86148
|
+
exports.TasStoreAttributeValueSchema = TasStoreAttributeValueSchema;
|
|
85121
86149
|
exports.TasStoreChangeSchema = TasStoreChangeSchema;
|
|
86150
|
+
exports.TasStoreEdgeSchema = TasStoreEdgeSchema;
|
|
85122
86151
|
exports.TasStoreGraphInputSchema = TasStoreGraphInputSchema;
|
|
85123
86152
|
exports.TasStoreGraphResponseSchema = TasStoreGraphResponseSchema;
|
|
86153
|
+
exports.TasStoreGraphSchema = TasStoreGraphSchema;
|
|
86154
|
+
exports.TasStoreVertexSchema = TasStoreVertexSchema;
|
|
85124
86155
|
exports.TasTakeEdgesFilterSchema = TasTakeEdgesFilterSchema;
|
|
85125
86156
|
exports.TasTakeFlowsFilterSchema = TasTakeFlowsFilterSchema;
|
|
85126
86157
|
exports.TasTakeVerticesFilterSchema = TasTakeVerticesFilterSchema;
|
|
@@ -85138,6 +86169,13 @@ exports.TenantProductsResponseSchema = TenantProductsResponseSchema;
|
|
|
85138
86169
|
exports.TenantRoleSchema = TenantRoleSchema;
|
|
85139
86170
|
exports.TenantRolesResponseSchema = TenantRolesResponseSchema;
|
|
85140
86171
|
exports.TenantService = TenantService;
|
|
86172
|
+
exports.TicketEnrichmentAlarmFieldSchema = TicketEnrichmentAlarmFieldSchema;
|
|
86173
|
+
exports.TicketEnrichmentAlarmFieldsResponseSchema = TicketEnrichmentAlarmFieldsResponseSchema;
|
|
86174
|
+
exports.TicketEnrichmentListResponseSchema = TicketEnrichmentListResponseSchema;
|
|
86175
|
+
exports.TicketEnrichmentMappingSchema = TicketEnrichmentMappingSchema;
|
|
86176
|
+
exports.TicketEnrichmentRuleSchema = TicketEnrichmentRuleSchema;
|
|
86177
|
+
exports.TicketEnrichmentWriteBodySchema = TicketEnrichmentWriteBodySchema;
|
|
86178
|
+
exports.TicketEnrichmentWriteResponseSchema = TicketEnrichmentWriteResponseSchema;
|
|
85141
86179
|
exports.TokenCreateResponseSchema = TokenCreateResponseSchema;
|
|
85142
86180
|
exports.TokenDetailsSchema = TokenDetailsSchema;
|
|
85143
86181
|
exports.TokenGetAndVerifyRequestSchema = TokenGetAndVerifyRequestSchema;
|
|
@@ -85150,6 +86188,7 @@ exports.TraversalVertexFilterSchema = TraversalVertexFilterSchema;
|
|
|
85150
86188
|
exports.TraverseCollectSchema = TraverseCollectSchema;
|
|
85151
86189
|
exports.TraverseDirectionSchema = TraverseDirectionSchema;
|
|
85152
86190
|
exports.TraverseSchema = TraverseSchema;
|
|
86191
|
+
exports.UIM_LOGS_INGESTION_PATH = UIM_LOGS_INGESTION_PATH;
|
|
85153
86192
|
exports.UpdateAgentTokenRequestSchema = UpdateAgentTokenRequestSchema;
|
|
85154
86193
|
exports.UpdateTenantTokenRequestSchema = UpdateTenantTokenRequestSchema;
|
|
85155
86194
|
exports.UpdateUserTokenRequestSchema = UpdateUserTokenRequestSchema;
|
|
@@ -85230,12 +86269,14 @@ exports.buildAlarmFilterUpdateBody = buildAlarmFilterUpdateBody;
|
|
|
85230
86269
|
exports.buildAlarmQueueFilterExpression = buildAlarmQueueFilterExpression;
|
|
85231
86270
|
exports.buildAlarmQueueUpdateBody = buildAlarmQueueUpdateBody;
|
|
85232
86271
|
exports.buildAlertEntry = buildAlertEntry;
|
|
86272
|
+
exports.buildEnrichmentRuleUpdateBody = buildEnrichmentRuleUpdateBody;
|
|
85233
86273
|
exports.buildInventoryCustomFilter = buildInventoryCustomFilter;
|
|
85234
86274
|
exports.buildInventoryQueueUpdateBody = buildInventoryQueueUpdateBody;
|
|
85235
86275
|
exports.buildPolicyFilterExpression = buildPolicyFilterExpression;
|
|
85236
86276
|
exports.buildSliFunction = buildSliFunction;
|
|
85237
86277
|
exports.buildSloTriplet = buildSloTriplet;
|
|
85238
86278
|
exports.buildTemplateRefs = buildTemplateRefs;
|
|
86279
|
+
exports.buildUimLogPayload = buildUimLogPayload;
|
|
85239
86280
|
exports.capVertexDetail = capVertexDetail;
|
|
85240
86281
|
exports.checkGet = checkGet;
|
|
85241
86282
|
exports.composeMetricTypeBits = composeMetricTypeBits;
|
|
@@ -85262,6 +86303,7 @@ exports.defaultRuleName = defaultRuleName;
|
|
|
85262
86303
|
exports.deriveSliAs = deriveSliAs;
|
|
85263
86304
|
exports.deriveVertexName = deriveVertexName;
|
|
85264
86305
|
exports.displayColumnsFor = displayColumnsFor;
|
|
86306
|
+
exports.dottedFileSlot = dottedFileSlot;
|
|
85265
86307
|
exports.draftKey = draftKey;
|
|
85266
86308
|
exports.encodeItsmSecret = encodeItsmSecret;
|
|
85267
86309
|
exports.ensureParallelAlerts = ensureParallelAlerts;
|
|
@@ -85373,6 +86415,7 @@ exports.parseExpression = parseExpression;
|
|
|
85373
86415
|
exports.parseFilter = parseFilter;
|
|
85374
86416
|
exports.parseSaasGateway = parseSaasGateway;
|
|
85375
86417
|
exports.parseServiceNowUrl = parseServiceNowUrl;
|
|
86418
|
+
exports.planEnrichmentReorder = planEnrichmentReorder;
|
|
85376
86419
|
exports.policyCategoryGuard = policyCategoryGuard;
|
|
85377
86420
|
exports.policyFilterAtoms = policyFilterAtoms;
|
|
85378
86421
|
exports.producedMetricName = producedMetricName;
|
|
@@ -85384,6 +86427,7 @@ exports.reencodeItsmForWrite = reencodeItsmForWrite;
|
|
|
85384
86427
|
exports.removeAlert = removeAlert;
|
|
85385
86428
|
exports.removeSli = removeSli;
|
|
85386
86429
|
exports.removeSloTriplet = removeSloTriplet;
|
|
86430
|
+
exports.resolveEnrichmentMappings = resolveEnrichmentMappings;
|
|
85387
86431
|
exports.resolveWebhookPayload = resolveWebhookPayload;
|
|
85388
86432
|
exports.sampleServiceDetailRequestBody = sampleServiceDetailRequestBody;
|
|
85389
86433
|
exports.searchUniverse = searchUniverse;
|
|
@@ -85394,6 +86438,7 @@ exports.settingsUpdate = settingsUpdate;
|
|
|
85394
86438
|
exports.sharedRoleDelta = sharedRoleDelta;
|
|
85395
86439
|
exports.sliHumanName = sliHumanName;
|
|
85396
86440
|
exports.sloTripletFor = sloTripletFor;
|
|
86441
|
+
exports.sortRulesByPriority = sortRulesByPriority;
|
|
85397
86442
|
exports.splitAttributePath = splitAttributePath;
|
|
85398
86443
|
exports.splitTemplate = splitTemplate;
|
|
85399
86444
|
exports.stationDelete = stationDelete;
|
|
@@ -85419,12 +86464,14 @@ exports.timezonesList = timezonesList;
|
|
|
85419
86464
|
exports.toAlarmFilterWriteBody = toAlarmFilterWriteBody;
|
|
85420
86465
|
exports.toAlarmQueueWriteBody = toAlarmQueueWriteBody;
|
|
85421
86466
|
exports.toChannelWriteBody = toChannelWriteBody;
|
|
86467
|
+
exports.toEnrichmentRuleCreateBody = toEnrichmentRuleCreateBody;
|
|
85422
86468
|
exports.toGroupMetricsRequest = toGroupMetricsRequest;
|
|
85423
86469
|
exports.toInventoryQueueWriteBody = toInventoryQueueWriteBody;
|
|
85424
86470
|
exports.toItsmTestConnectionRequest = toItsmTestConnectionRequest;
|
|
85425
86471
|
exports.toPolicyWriteBody = toPolicyWriteBody;
|
|
85426
86472
|
exports.toSliGroupSaveRequest = toSliGroupSaveRequest;
|
|
85427
86473
|
exports.toTemplateWriteBody = toTemplateWriteBody;
|
|
86474
|
+
exports.toTicketEnrichmentWriteBody = toTicketEnrichmentWriteBody;
|
|
85428
86475
|
exports.tokenize = tokenize;
|
|
85429
86476
|
exports.translateRuleToMmQuery = translateRuleToMmQuery;
|
|
85430
86477
|
exports.truthy = truthy;
|