@dx-do/client 6.0.4 → 6.1.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 +286 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +280 -27
- package/dist/index.esm.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/model/config/DXSaaSConfiguration.d.ts +4 -0
- package/dist/src/lib/model/config/DXSaaSConfiguration.d.ts.map +1 -1
- package/dist/src/lib/model/datastore/index.d.ts +1 -0
- package/dist/src/lib/model/datastore/index.d.ts.map +1 -1
- package/dist/src/lib/model/datastore/metrics-metadata/index.d.ts +1 -0
- package/dist/src/lib/model/datastore/metrics-metadata/index.d.ts.map +1 -1
- package/dist/src/lib/model/datastore/metrics-metadata/register.d.ts +49 -0
- package/dist/src/lib/model/datastore/metrics-metadata/register.d.ts.map +1 -0
- package/dist/src/lib/model/datastore/nass/index.d.ts +2 -0
- package/dist/src/lib/model/datastore/nass/index.d.ts.map +1 -0
- package/dist/src/lib/model/datastore/nass/store.d.ts +41 -0
- package/dist/src/lib/model/datastore/nass/store.d.ts.map +1 -0
- package/dist/src/lib/model/datastore/tas/index.d.ts +1 -0
- package/dist/src/lib/model/datastore/tas/index.d.ts.map +1 -1
- package/dist/src/lib/model/datastore/tas/store.d.ts +330 -0
- package/dist/src/lib/model/datastore/tas/store.d.ts.map +1 -0
- package/dist/src/lib/model/log/ingest.d.ts +13 -0
- package/dist/src/lib/model/log/ingest.d.ts.map +1 -0
- package/dist/src/lib/model/log/query-body.d.ts.map +1 -1
- package/dist/src/lib/model/trace/TraceInject.d.ts +44 -0
- package/dist/src/lib/model/trace/TraceInject.d.ts.map +1 -0
- package/dist/src/lib/services/agent.service.d.ts +5 -0
- package/dist/src/lib/services/agent.service.d.ts.map +1 -1
- package/dist/src/lib/services/datastore/datastore-metrics-metadata.service.d.ts +13 -1
- 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 +42 -0
- package/dist/src/lib/services/datastore/datastore-nass.service.d.ts.map +1 -0
- package/dist/src/lib/services/datastore/datastore-tas.service.d.ts +12 -1
- package/dist/src/lib/services/datastore/datastore-tas.service.d.ts.map +1 -1
- package/dist/src/lib/services/dx-saas.service.d.ts +6 -0
- package/dist/src/lib/services/dx-saas.service.d.ts.map +1 -1
- package/dist/src/lib/services/logs.service.d.ts +12 -2
- package/dist/src/lib/services/logs.service.d.ts.map +1 -1
- package/dist/src/lib/services/nass.service.d.ts +13 -3
- package/dist/src/lib/services/nass.service.d.ts.map +1 -1
- package/dist/src/lib/services/service-monolith.d.ts +2 -0
- package/dist/src/lib/services/service-monolith.d.ts.map +1 -1
- package/dist/src/lib/services/tas.service.d.ts +5 -1
- package/dist/src/lib/services/tas.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -13,7 +13,7 @@ import require$$0$6 from 'net';
|
|
|
13
13
|
import require$$1$3 from 'tls';
|
|
14
14
|
import require$$3 from 'assert';
|
|
15
15
|
import require$$1$2 from 'tty';
|
|
16
|
-
import require$$0$4 from 'os';
|
|
16
|
+
import require$$0$4, { hostname, networkInterfaces } from 'os';
|
|
17
17
|
import require$$0$5, { EventEmitter as EventEmitter$1 } from 'events';
|
|
18
18
|
import http2 from 'http2';
|
|
19
19
|
import zlib from 'zlib';
|
|
@@ -28261,6 +28261,37 @@ const TasGraphSchema = z.looseObject({
|
|
|
28261
28261
|
totalEdges: z.number().optional(),
|
|
28262
28262
|
});
|
|
28263
28263
|
|
|
28264
|
+
const TasStoreGraphInputSchema = z.looseObject({
|
|
28265
|
+
includeSuccessResult: z.boolean().optional(),
|
|
28266
|
+
ttl: z.number().optional(),
|
|
28267
|
+
endTimeAllowedThreshold: z.number().optional(),
|
|
28268
|
+
storeType: TasAttributeTypeSchema.optional(),
|
|
28269
|
+
graph: TasGraphSchema,
|
|
28270
|
+
});
|
|
28271
|
+
const TasStoreChangeSchema = z.looseObject({
|
|
28272
|
+
changeType: z.string().optional(),
|
|
28273
|
+
id: z.unknown().optional(),
|
|
28274
|
+
});
|
|
28275
|
+
const TasStoreGraphResponseSchema = z.looseObject({
|
|
28276
|
+
graph: TasGraphSchema.optional(),
|
|
28277
|
+
failedVertices: z
|
|
28278
|
+
.array(z.looseObject({
|
|
28279
|
+
object: TasVertexSchema,
|
|
28280
|
+
code: z.string().optional(),
|
|
28281
|
+
message: z.string().optional(),
|
|
28282
|
+
}))
|
|
28283
|
+
.optional(),
|
|
28284
|
+
failedEdges: z
|
|
28285
|
+
.array(z.looseObject({
|
|
28286
|
+
object: TasEdgeSchema,
|
|
28287
|
+
code: z.string().optional(),
|
|
28288
|
+
message: z.string().optional(),
|
|
28289
|
+
}))
|
|
28290
|
+
.optional(),
|
|
28291
|
+
edgeChanges: z.array(TasStoreChangeSchema).optional(),
|
|
28292
|
+
vertexChanges: z.array(TasStoreChangeSchema).optional(),
|
|
28293
|
+
});
|
|
28294
|
+
|
|
28264
28295
|
/**
|
|
28265
28296
|
* Comparison operators used in the `PART` specifier for comparing
|
|
28266
28297
|
* dot-separated source-name segments numerically or lexically.
|
|
@@ -28890,6 +28921,29 @@ const MetadataMetricQuerySchema = z.looseObject({
|
|
|
28890
28921
|
.describe('Optional server hints; currently supports `ForceRange`'),
|
|
28891
28922
|
});
|
|
28892
28923
|
|
|
28924
|
+
const MetricRegisterSchema = z.looseObject({
|
|
28925
|
+
id: z.string().optional(),
|
|
28926
|
+
sourceName: z.string(),
|
|
28927
|
+
attributeName: z.string(),
|
|
28928
|
+
type: z.number().optional(),
|
|
28929
|
+
typeEnum: z.array(z.string()).optional(),
|
|
28930
|
+
attributes: z.record(z.string(), z.unknown()).optional(),
|
|
28931
|
+
firstSeen: z.number().optional(),
|
|
28932
|
+
lastSeen: z.number().optional(),
|
|
28933
|
+
});
|
|
28934
|
+
const MetricRegisterRequestSchema = z.looseObject({
|
|
28935
|
+
sync: z.boolean().optional(),
|
|
28936
|
+
metrics: z.array(MetricRegisterSchema),
|
|
28937
|
+
});
|
|
28938
|
+
const MetricRegisterSourceSchema = z.looseObject({
|
|
28939
|
+
sourceId: z.string().optional(),
|
|
28940
|
+
name: z.string().optional(),
|
|
28941
|
+
});
|
|
28942
|
+
const MetricRegisterResponseSchema = z.looseObject({
|
|
28943
|
+
metrics: z.array(MetricRegisterSchema).optional(),
|
|
28944
|
+
sources: z.array(MetricRegisterSourceSchema).optional(),
|
|
28945
|
+
});
|
|
28946
|
+
|
|
28893
28947
|
const MetricAttributeSchema = z.looseObject({
|
|
28894
28948
|
id: z.string().optional(),
|
|
28895
28949
|
sourceName: z.string().optional(),
|
|
@@ -45490,36 +45544,35 @@ var LogQuery;
|
|
|
45490
45544
|
};
|
|
45491
45545
|
}
|
|
45492
45546
|
LogQuery.createOr = createOr;
|
|
45493
|
-
function createLogQueryRequestBody(range, ors, severities = [
|
|
45547
|
+
function createLogQueryRequestBody(range, ors, severities = [], includes = [
|
|
45494
45548
|
'_id',
|
|
45495
45549
|
'host',
|
|
45496
45550
|
'logseverity',
|
|
45497
|
-
'
|
|
45551
|
+
'logtype',
|
|
45498
45552
|
'timestamp',
|
|
45499
45553
|
'file',
|
|
45500
45554
|
'message',
|
|
45501
45555
|
], size = 1000, sort = [{ sortKey: 'timestamp', sortOrder: 'Asc' }]) {
|
|
45556
|
+
const nonEmptySeverities = severities.filter((s) => s.length > 0);
|
|
45557
|
+
const severityClause = nonEmptySeverities.length > 0
|
|
45558
|
+
? [
|
|
45559
|
+
{
|
|
45560
|
+
or: {
|
|
45561
|
+
expressions: nonEmptySeverities.map((severity) => ({
|
|
45562
|
+
fieldDescription: 'Log Severity',
|
|
45563
|
+
field: 'logseverity',
|
|
45564
|
+
value: severity,
|
|
45565
|
+
condition: 'equals',
|
|
45566
|
+
})),
|
|
45567
|
+
},
|
|
45568
|
+
},
|
|
45569
|
+
]
|
|
45570
|
+
: [];
|
|
45502
45571
|
return {
|
|
45503
45572
|
size,
|
|
45504
45573
|
query: {
|
|
45505
45574
|
and: {
|
|
45506
|
-
expressions: [
|
|
45507
|
-
{
|
|
45508
|
-
or: {
|
|
45509
|
-
expressions: [
|
|
45510
|
-
...severities.map((severity) => {
|
|
45511
|
-
return {
|
|
45512
|
-
fieldDescription: 'Log Severity',
|
|
45513
|
-
field: 'logseverity',
|
|
45514
|
-
value: severity,
|
|
45515
|
-
condition: 'equals',
|
|
45516
|
-
};
|
|
45517
|
-
}),
|
|
45518
|
-
],
|
|
45519
|
-
},
|
|
45520
|
-
},
|
|
45521
|
-
...ors,
|
|
45522
|
-
],
|
|
45575
|
+
expressions: [...severityClause, ...ors],
|
|
45523
45576
|
},
|
|
45524
45577
|
},
|
|
45525
45578
|
includes,
|
|
@@ -61083,6 +61136,15 @@ class AgentService {
|
|
|
61083
61136
|
};
|
|
61084
61137
|
return this.dxSaaSService.tenantPost('/apm/atc/api/private/trace/summary', traceSummaryRequestBody);
|
|
61085
61138
|
}
|
|
61139
|
+
/** Posts a synthetic transaction trace to the tracestore ingestion endpoint. */
|
|
61140
|
+
injectTrace(trace) {
|
|
61141
|
+
return this.injectTraces([trace]);
|
|
61142
|
+
}
|
|
61143
|
+
/** Posts one or more synthetic transaction traces to the tracestore ingestion endpoint. */
|
|
61144
|
+
injectTraces(traces) {
|
|
61145
|
+
const body = { values: traces };
|
|
61146
|
+
return this.dxSaaSService.tenantPost('/tracestore/process', body);
|
|
61147
|
+
}
|
|
61086
61148
|
/** Starts a trace session on one or more agents with optional filters. */
|
|
61087
61149
|
startAgentTrace(agents, minTXDuration, sessionDuration, parameterName, operationType, parameterNotSign, parameterValue, errorFilterValue) {
|
|
61088
61150
|
let body = {
|
|
@@ -69508,6 +69570,30 @@ class DxSaasService {
|
|
|
69508
69570
|
}
|
|
69509
69571
|
});
|
|
69510
69572
|
}
|
|
69573
|
+
/**
|
|
69574
|
+
* POST to the log ingestion gateway (`dxLogIngestionURL`) without a cohort path segment.
|
|
69575
|
+
* Auth uses the same `Bearer {userToken}` as other tenant methods.
|
|
69576
|
+
* Throws if `dxLogIngestionURL` is not set in config.
|
|
69577
|
+
*/
|
|
69578
|
+
async logPost(path, body) {
|
|
69579
|
+
const logBase = this.dxdoConfiguration.dxConfiguration.dxLogIngestionURL;
|
|
69580
|
+
if (!logBase) {
|
|
69581
|
+
throw new Error('dxLogIngestionURL is not set in config — add it to your .dxo2.config.json (e.g. "https://logs-gateway.dxi-na1.saas.broadcom.com")');
|
|
69582
|
+
}
|
|
69583
|
+
const url = `${logBase}/${path}`;
|
|
69584
|
+
this.log.debug(`log posting to: ${url}`);
|
|
69585
|
+
return this._httpClient
|
|
69586
|
+
.post(url, body ?? {}, this.createSimpleUserAuthorizedRequestConfig(undefined))
|
|
69587
|
+
.then((response) => response.data)
|
|
69588
|
+
.catch((reason) => {
|
|
69589
|
+
if (reason.response || reason.request) {
|
|
69590
|
+
throw DxSaasService.handleAxiosError(reason);
|
|
69591
|
+
}
|
|
69592
|
+
else {
|
|
69593
|
+
throw new Error(reason);
|
|
69594
|
+
}
|
|
69595
|
+
});
|
|
69596
|
+
}
|
|
69511
69597
|
/**
|
|
69512
69598
|
* GET from an ACC path, returning the response as a Node.js readable stream.
|
|
69513
69599
|
* @param path - Path segment appended after `.../acc/`.
|
|
@@ -73312,12 +73398,25 @@ class JsExtensionService {
|
|
|
73312
73398
|
}
|
|
73313
73399
|
}
|
|
73314
73400
|
|
|
73401
|
+
function detectIPv4() {
|
|
73402
|
+
const nets = networkInterfaces();
|
|
73403
|
+
for (const iface of Object.values(nets)) {
|
|
73404
|
+
if (!iface)
|
|
73405
|
+
continue;
|
|
73406
|
+
for (const net of iface) {
|
|
73407
|
+
if (net.family === 'IPv4' && !net.internal) {
|
|
73408
|
+
return net.address;
|
|
73409
|
+
}
|
|
73410
|
+
}
|
|
73411
|
+
}
|
|
73412
|
+
return '127.0.0.1';
|
|
73413
|
+
}
|
|
73315
73414
|
/**
|
|
73316
|
-
* Service for querying
|
|
73415
|
+
* Service for querying and ingesting log analytics data.
|
|
73317
73416
|
*/
|
|
73318
73417
|
class LogsService {
|
|
73319
73418
|
dxSaasService;
|
|
73320
|
-
/** @param dxSaasService - DX SaaS HTTP client
|
|
73419
|
+
/** @param dxSaasService - DX SaaS HTTP client */
|
|
73321
73420
|
constructor(dxSaasService) {
|
|
73322
73421
|
this.dxSaasService = dxSaasService;
|
|
73323
73422
|
}
|
|
@@ -73325,6 +73424,56 @@ class LogsService {
|
|
|
73325
73424
|
queryLogs(logQueryBody) {
|
|
73326
73425
|
return this.dxSaasService.oiPost('oi/loganalytics/v1/api/logs/filter', logQueryBody);
|
|
73327
73426
|
}
|
|
73427
|
+
/** Ingests a single log entry into the log gateway. */
|
|
73428
|
+
ingestLog(entry) {
|
|
73429
|
+
return this.ingestLogs([entry]);
|
|
73430
|
+
}
|
|
73431
|
+
/**
|
|
73432
|
+
* Builds the enriched payload array that will be sent to the uim_logs endpoint.
|
|
73433
|
+
* Exposed so callers can inspect the payload without sending (e.g. dry-run).
|
|
73434
|
+
*/
|
|
73435
|
+
buildLogPayload(entries) {
|
|
73436
|
+
const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
|
|
73437
|
+
const tenantIdUpper = cohortId.toUpperCase();
|
|
73438
|
+
const now = new Date().toISOString();
|
|
73439
|
+
return entries.map((e) => {
|
|
73440
|
+
const host = e.host ?? hostname();
|
|
73441
|
+
const logtype = e.logtype;
|
|
73442
|
+
const ip = e.ip ?? detectIPv4();
|
|
73443
|
+
const agentInstance = e.agentInstance ?? 'dx-do';
|
|
73444
|
+
const agentName = e.agentName ?? 'Logs Collector';
|
|
73445
|
+
const containerId = e.containerId ?? host;
|
|
73446
|
+
const containerName = e.containerName ?? agentInstance;
|
|
73447
|
+
const file = e.file ?? 'dx-do.cli';
|
|
73448
|
+
const tag = `${logtype} logs`;
|
|
73449
|
+
// temp_fields must have exactly 9 space-separated components before the message
|
|
73450
|
+
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|
|
73451
|
+
// The Kafka consumer parses positionally: [0]=tenant [1]=logtype [2]=host
|
|
73452
|
+
// [3]=container_id [4]=container_name [5]=ip [6-7]=tags [8]=source_file [9+]=message.
|
|
73453
|
+
const temp_fields = `${tenantIdUpper} ${logtype} ${host} ${containerId} ${containerName} ${ip} ${tag} ${file}`;
|
|
73454
|
+
return {
|
|
73455
|
+
'@timestamp': now,
|
|
73456
|
+
// logtype must be top-level: the SaaS filter does `update => ["type", "%{logtype}"]`
|
|
73457
|
+
// which drives Kafka consumer index routing — without it type stays as "ingestionapi"
|
|
73458
|
+
logtype,
|
|
73459
|
+
message: e.message ?? '',
|
|
73460
|
+
host: { name: host, hostname: host },
|
|
73461
|
+
tenant_id: tenantIdUpper,
|
|
73462
|
+
temp_fields,
|
|
73463
|
+
tags: [tag],
|
|
73464
|
+
__agent_name: agentName,
|
|
73465
|
+
__agent_instance: agentInstance,
|
|
73466
|
+
container_id: containerId,
|
|
73467
|
+
container_name: containerName,
|
|
73468
|
+
...Object.fromEntries(Object.entries(e).filter(([k]) => !['logtype', 'message', 'host', 'timestamp', 'ip',
|
|
73469
|
+
'agentInstance', 'agentName', 'containerId', 'containerName', 'file'].includes(k))),
|
|
73470
|
+
};
|
|
73471
|
+
});
|
|
73472
|
+
}
|
|
73473
|
+
/** Ingests a batch of log entries into the log gateway. */
|
|
73474
|
+
ingestLogs(entries) {
|
|
73475
|
+
return this.dxSaasService.logPost('mdo/v2/aoanalytics/ingestion/uim_logs', this.buildLogPayload(entries));
|
|
73476
|
+
}
|
|
73328
73477
|
}
|
|
73329
73478
|
|
|
73330
73479
|
/**
|
|
@@ -73784,7 +73933,11 @@ class NASSService {
|
|
|
73784
73933
|
this.dxSaaSService = dxSaaSService;
|
|
73785
73934
|
this.log = log;
|
|
73786
73935
|
}
|
|
73787
|
-
/**
|
|
73936
|
+
/**
|
|
73937
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetrics} instead —
|
|
73938
|
+
* it accepts the full `MetricRegister[]` shape including `typeEnum`, `id`,
|
|
73939
|
+
* `firstSeen`, and `lastSeen`.
|
|
73940
|
+
*/
|
|
73788
73941
|
async registerMetrics(metricRegistrations) {
|
|
73789
73942
|
const metricRegistrationBody = {
|
|
73790
73943
|
metrics: metricRegistrations,
|
|
@@ -73844,7 +73997,9 @@ class NASSService {
|
|
|
73844
73997
|
};
|
|
73845
73998
|
return this.dxSaaSService.tenantPost('/metadata/queryMetric', metadataQuery);
|
|
73846
73999
|
}
|
|
73847
|
-
/**
|
|
74000
|
+
/**
|
|
74001
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetric} instead.
|
|
74002
|
+
*/
|
|
73848
74003
|
async registerMetric(sourceName, attributeName, metricType, attributes) {
|
|
73849
74004
|
const metricRegistrationBody = {
|
|
73850
74005
|
metrics: [
|
|
@@ -73858,7 +74013,11 @@ class NASSService {
|
|
|
73858
74013
|
};
|
|
73859
74014
|
return this.dxSaaSService.tenantPost('/metadata/registerMetric', metricRegistrationBody);
|
|
73860
74015
|
}
|
|
73861
|
-
/**
|
|
74016
|
+
/**
|
|
74017
|
+
* @deprecated Use {@link DataStoreNASSService.storeMetricValues} instead — it
|
|
74018
|
+
* accepts typed {@link NassDatapoint} tuples covering regular, string, and
|
|
74019
|
+
* extension metric variants, and returns a typed {@link NassStoreResponse}.
|
|
74020
|
+
*/
|
|
73862
74021
|
async storeMetricValue(metricValues) {
|
|
73863
74022
|
const metricStoreBody = { values: new Array() };
|
|
73864
74023
|
metricValues.forEach((metricValue) => metricStoreBody.values.push([
|
|
@@ -74858,7 +75017,11 @@ class TASService {
|
|
|
74858
75017
|
this.dxSaaSService = dxSaaSService;
|
|
74859
75018
|
this.log = log;
|
|
74860
75019
|
}
|
|
74861
|
-
/**
|
|
75020
|
+
/**
|
|
75021
|
+
* @deprecated Use {@link DataStoreTASService.storeGraph} instead — it accepts
|
|
75022
|
+
* the full `TasStoreGraphInput` model with all optional fields and returns a
|
|
75023
|
+
* typed `TasStoreGraphResponse` with `failedVertices`/`failedEdges`.
|
|
75024
|
+
*/
|
|
74862
75025
|
async storeGraph(graphBody) {
|
|
74863
75026
|
this.log.debug('storing');
|
|
74864
75027
|
return this.dxSaaSService.tenantPost('/tas/graph/store', graphBody);
|
|
@@ -76116,6 +76279,32 @@ class DataStoreMetricsMetadataService {
|
|
|
76116
76279
|
this.dxSaasService = dxSaasService;
|
|
76117
76280
|
this.log = log;
|
|
76118
76281
|
}
|
|
76282
|
+
/**
|
|
76283
|
+
* Registers one or more metrics via `POST /metadata/registerMetric`.
|
|
76284
|
+
*
|
|
76285
|
+
* @remarks The request is validated against {@link MetricRegisterRequestSchema}.
|
|
76286
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76287
|
+
* API response is still returned.
|
|
76288
|
+
*
|
|
76289
|
+
* @throws ZodError if the request fails schema validation.
|
|
76290
|
+
*/
|
|
76291
|
+
async registerMetrics(metrics, sync) {
|
|
76292
|
+
const body = {
|
|
76293
|
+
metrics,
|
|
76294
|
+
...(sync !== undefined ? { sync } : {}),
|
|
76295
|
+
};
|
|
76296
|
+
MetricRegisterRequestSchema.parse(body);
|
|
76297
|
+
const raw = await this.dxSaasService.tenantPost('metadata/registerMetric', body);
|
|
76298
|
+
const result = MetricRegisterResponseSchema.safeParse(raw);
|
|
76299
|
+
if (!result.success) {
|
|
76300
|
+
this.log.warn('MetricRegisterResponse validation warning:', result.error.message);
|
|
76301
|
+
}
|
|
76302
|
+
return raw;
|
|
76303
|
+
}
|
|
76304
|
+
/** Registers a single metric. Convenience wrapper around {@link registerMetrics}. */
|
|
76305
|
+
async registerMetric(metric, sync) {
|
|
76306
|
+
return this.registerMetrics([metric], sync);
|
|
76307
|
+
}
|
|
76119
76308
|
/**
|
|
76120
76309
|
* POSTs a metadata query to `/metadata/queryMetric` and returns the matching
|
|
76121
76310
|
* metric / folder records.
|
|
@@ -76461,6 +76650,25 @@ class DataStoreTASService {
|
|
|
76461
76650
|
this.dxSaasService = dxSaasService;
|
|
76462
76651
|
this.log = log;
|
|
76463
76652
|
}
|
|
76653
|
+
/**
|
|
76654
|
+
* POSTs a graph to `/tas/graph/store` and returns the store result including
|
|
76655
|
+
* any failed vertices or edges.
|
|
76656
|
+
*
|
|
76657
|
+
* @remarks The request is validated against {@link TasStoreGraphInputSchema}.
|
|
76658
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76659
|
+
* API response is still returned.
|
|
76660
|
+
*
|
|
76661
|
+
* @throws ZodError if the request fails schema validation.
|
|
76662
|
+
*/
|
|
76663
|
+
async storeGraph(input) {
|
|
76664
|
+
TasStoreGraphInputSchema.parse(input);
|
|
76665
|
+
const raw = await this.dxSaasService.tenantPost('tas/graph/store', input);
|
|
76666
|
+
const result = TasStoreGraphResponseSchema.safeParse(raw);
|
|
76667
|
+
if (!result.success) {
|
|
76668
|
+
this.log.warn('TasStoreGraphResponse validation warning:', result.error.message);
|
|
76669
|
+
}
|
|
76670
|
+
return raw;
|
|
76671
|
+
}
|
|
76464
76672
|
/**
|
|
76465
76673
|
* POSTs a TAS graph query to `/tas/graph/query` and returns the resulting
|
|
76466
76674
|
* graph (vertices, edges, states).
|
|
@@ -76944,6 +77152,50 @@ class DataStoreTokensService {
|
|
|
76944
77152
|
}
|
|
76945
77153
|
}
|
|
76946
77154
|
|
|
77155
|
+
/**
|
|
77156
|
+
* Service for storing metric data points in the DX SaaS DataStore NASS API
|
|
77157
|
+
* (`POST /nass/metricValue/store`).
|
|
77158
|
+
*
|
|
77159
|
+
* Metrics must be registered first via
|
|
77160
|
+
* {@link DataStoreMetricsMetadataService.registerMetric} before values can be
|
|
77161
|
+
* stored. Use the metric's `id` from the registration response as the first
|
|
77162
|
+
* element of each {@link NassDatapoint} tuple.
|
|
77163
|
+
*
|
|
77164
|
+
* Three datapoint variants are supported — see {@link NassDatapoint}:
|
|
77165
|
+
* - **Regular** numeric: `[id, time, min, max, value, count, interval?]`
|
|
77166
|
+
* - **String** metric: same shape but `min` and `max` must be `null`
|
|
77167
|
+
* - **Extension**: `[id, extensionId, time, interval, ...values]`
|
|
77168
|
+
*
|
|
77169
|
+
* @example
|
|
77170
|
+
* ```ts
|
|
77171
|
+
* const service = new DataStoreNASSService(dxSaasService, log);
|
|
77172
|
+
* const response = await service.storeMetricValues([
|
|
77173
|
+
* ['metricId', Date.now() / 1000, 0, 100, 42, 1, 15],
|
|
77174
|
+
* ['strMetricId', Date.now() / 1000, null, null, 'running', 1, 15],
|
|
77175
|
+
* ]);
|
|
77176
|
+
* // response.metricForwardFailures — count of failed forwarding (only present if > 0)
|
|
77177
|
+
* ```
|
|
77178
|
+
*/
|
|
77179
|
+
class DataStoreNASSService {
|
|
77180
|
+
dxSaasService;
|
|
77181
|
+
log;
|
|
77182
|
+
constructor(dxSaasService, log) {
|
|
77183
|
+
this.dxSaasService = dxSaasService;
|
|
77184
|
+
this.log = log;
|
|
77185
|
+
}
|
|
77186
|
+
/**
|
|
77187
|
+
* POSTs one or more metric datapoints to `/nass/metricValue/store`.
|
|
77188
|
+
*
|
|
77189
|
+
* @param values - Array of {@link NassDatapoint} tuples. Each tuple must
|
|
77190
|
+
* begin with a registered metric ID obtained from
|
|
77191
|
+
* {@link DataStoreMetricsMetadataService.registerMetric}.
|
|
77192
|
+
*/
|
|
77193
|
+
async storeMetricValues(values) {
|
|
77194
|
+
const body = { values };
|
|
77195
|
+
return this.dxSaasService.tenantPost('nass/metricValue/store', body);
|
|
77196
|
+
}
|
|
77197
|
+
}
|
|
77198
|
+
|
|
76947
77199
|
var NullSimpleLog = Logging.NullSimpleLog;
|
|
76948
77200
|
/**
|
|
76949
77201
|
* Creates and returns a container of all DX client services (ACC, alerts, alarms,
|
|
@@ -76975,6 +77227,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
|
|
|
76975
77227
|
dxChannelService: new ChannelService(dxSaaSService),
|
|
76976
77228
|
dxDashboardService: new DashboardService(dxSaaSService),
|
|
76977
77229
|
dxDataStoreMetricsMetadataService: new DataStoreMetricsMetadataService(dxSaaSService, log),
|
|
77230
|
+
dxDataStoreNASSService: new DataStoreNASSService(dxSaaSService, log),
|
|
76978
77231
|
dxDataStoreNASSQLService: new DataStoreNASSQLService(dxSaaSService, log),
|
|
76979
77232
|
dxDataStoreTASService: new DataStoreTASService(dxSaaSService, log),
|
|
76980
77233
|
dxEventService: new EventService(dxSaaSService, log),
|
|
@@ -77008,5 +77261,5 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
|
|
|
77008
77261
|
};
|
|
77009
77262
|
}
|
|
77010
77263
|
|
|
77011
|
-
export { AXAActivities, AccService, AgentService, AgentTrace, AlarmEnrichment, AlarmEnrichmentFilter, AlarmService, AlertDefinitionResponse, AlertResponse, AlertResponseV2, AlertService, AlignmentSchema, ApmUniverseService, AsmService, AttributeExpressionComparatorSchema, AttributeExpressionOperatorSchema, AttributeExpressionSchema, AttributeFilterOperator, AttributeNameAllSpecifierSchema, AttributeNameAndSpecifierSchema, AttributeNameAnyNumericSpecifierSchema, AttributeNameAttributeSpecifierSchema, AttributeNameChildrenSpecifierSchema, AttributeNameExactSpecifierSchema, AttributeNameFolderSpecifierSchema, AttributeNameNoneSpecifierSchema, AttributeNameNotSpecifierSchema, AttributeNameOperatorSpecifierSchema, AttributeNameOrSpecifierSchema, AttributeNameRegExSpecifierSchema, AttributeNameSpecifierSchema, AttributeNameTypeSpecifierSchema, AttributeService, AttributeValueAsFieldSchema, AuthorizationService, AxaService, BlobService, CalendarIntervalSchema, ChannelService, DEFAULT_EXPERIENCE_REQUEST_BODY, DXChannel, DashboardPermissionsUpdateRequest, DashboardSearch, DashboardService, DataStoreAuditService, DataStoreAuthViewsService, DataStoreBlobStorageService, DataStoreFeaturesService, DataStoreMetricsMetadataService, DataStoreNASSQLService, DataStoreStatesService, DataStoreTASService, DataStoreTokensService, DxSaasService, DxoiService, EdgeNumericIdSchema, EventService, ExperienceService, FillModeSchema, FilterOperation, FolderNameAllSpecifierSchema, FolderNameAndSpecifierSchema, FolderNameChildrenSpecifierSchema, FolderNameExactSpecifierSchema, FolderNameNoneSpecifierSchema, FolderNameNotSpecifierSchema, FolderNameOrSpecifierSchema, FolderNameRegExSpecifierSchema, FolderNameSpecifierSchema, GraphResponse, GraphService, Inventory, InventoryAttributes, InventoryService, JoinTypeSchema, JsExtensionService, LogQuery, LogsService, METRIC_TYPE_ENUM, METRIC_TYPE_ENUM_NAMES, METRIC_TYPE_REGION, MServe, ManagementModuleIdSchema, ManagementModuleService, MatchType, MetadataMetricQueryResponseV2Schema, MetadataMetricQuerySchema, MetricAttributeSchema, MetricBatchService, MetricFolderSchema, MetricGroupingService, MetricTypeEnumNameSchema, NASS, NASSService, NassValueTypeSchema, NotificationService, NumericOperatorSchema, O2NotificationService, O2UniverseService, OIAlarm, OIService, OperatorSchema, PerspectiveService, PlatformAlertService, PlatformFilters, PlatformManagementModuleService, PlatformMetricGroupingService, QuantileMethodSchema, QueryAllSpecifierSchema, QueryAndSpecifierSchema, QueryAttributeExpressionSchema, QueryAttributeSpecifierSchema, QueryColumnTypeSpecSchema, QueryFilterPredicateSpecSchema, QueryFunctionSpecSchema, QueryHintForceRangeSchema, QueryHintSchema, QueryIdSpecifierSchema, QueryMetricGroupSpecifierSchema, QueryMetricIdSchema, QueryNoneSpecifierSchema, QueryNotSpecifierSchema, QueryOrSpecifierSchema, QueryRangeSpecSchema, QueryRequestSchema, QueryResultSchema, QuerySpecSpecifierSchema, QuerySpecifierSchema, SQLService, ServiceFilterSpecifierSchema, ServiceService, SessionService, SimpleHTTPError, SituationLifecycle, SituationService, Situations, SourceNameAllSpecifierSchema, SourceNameAndSpecifierSchema, SourceNameExactSpecifierSchema, SourceNameNoneSpecifierSchema, SourceNameNotSpecifierSchema, SourceNameOrSpecifierSchema, SourceNamePartOperatorSpecifierSchema, SourceNameRegExSpecifierSchema, SourceNameSpecifierSchema, TAS, TASGraph, TASService, TasAddFlowsFilterSchema, TasAddTransitioningEdgesFilterSchema, TasAddWireContextFilterSchema, TasAddWiresFilterSchema, TasAllFilterSchema, TasAnalyticBaseSchema, TasAnalyticResultSchema, TasAndFilterSchema, TasAttributeAlertStatisticsSchema, TasAttributeFilterModeSchema, TasAttributeFilterSchema, TasAttributeNameSchema, TasAttributeTypeSchema, TasCollectAttributeNamesFilterSchema, TasCollectAttributeNamesResultSchema, TasCollectAttributeResultSchema, TasCollectAttributesFilterSchema, TasCollectCardInfoFilterSchema, TasCollectCardInfoResultSchema, TasCollectCardInfoTierSchema, TasCollectCountsFilterSchema, TasCollectCountsResultSchema, TasCollectExperienceAttributesFilterSchema, TasCollectExperienceSelectorSchema, TasCollectGroupingInfoFilterSchema, TasCollectGroupingInfoResultSchema, TasCollectVertexIdFilterSchema, TasCoverageFilterSchema, TasEdgeSchema, TasEmptyFilterSchema, TasExternalIdSchema, TasFilterSchema, TasFollowPathFilterSchema, TasFollowPathFlowFilterSchema, TasFollowPathTypeSchema, TasGraphSchema, TasGroupingAlertStatisticsSchema, TasGroupingInfoSchema, TasGroupingItemSchema, TasJoinFilterSchema, TasJoinTypeSchema, TasLayerFilterSchema, TasLegacyFilterSchema, TasLuceneFilterSchema, TasNotFilterSchema, TasOrFilterSchema, TasOrderSchema, TasProjectionFilterSchema, TasQuerySchema, TasServiceFilterSchema, TasStatusFilterSchema, TasTakeEdgesFilterSchema, TasTakeFlowsFilterSchema, TasTakeVerticesFilterSchema, TasTraverseFilterSchema, TasVariableFilterSchema, TasVariableSchema, TasVertexIdFilterSchema, TasVertexSchema, TasViewSchema, Trace, TraversalEdgeFilterSchema, TraversalVertexFilterSchema, TraverseCollectSchema, TraverseDirectionSchema, TraverseSchema, VertexMappingConfigurationModule, VertexService, VertexStateExternalIdSchema, VertexStateNumericIdSchema, VertexStateSchema, VertexStatusChanges, ags, agsresponse, apiTokenCreate, apiTokenDelete, apiTokenGet, apiTokenList, apiTokenUpdate, checkGet, composeMetricTypeBits, contactActivate, contactDelete, contactTestSend, contactsBlockDelete, contactsBlockPut, contactsConfirm, contactsCreate, contactsGet, contactsGetDetail, contactsReplaceNotificationsWith, contactsRequestConfirmationCode, contactsUpdate, convertLegacyConfiguration, createPostmanRequest, createServiceMonolith, decodeMetricTypeBits, escapeRegExp, example, excludedAttributes, folderAccessGet, folderDelete, folderGet, folderPost, folderUpdate, foldersList, getDataStoreSchema, getUserTokenSub, getUserTokenTid, getVertexAttributeValue, getVertexAttributeValueOrNull, hasVertexAttribute, inventorizePreview, inventorizeResponse, inventorySearchRequestBodyExample, inventorySearchResponseBody, isDataStoreSchemaType, isTenantToken, isUserToken, listDataStoreSchemaOps, locationsCreate, locationsDelete, locationsGet, locationsGetAll, locationsGetByType, locationsLeafGetFilter, locationsPost, logGet, logGetEvent, maintenanceDelete, maintenanceDeleteWindows, maintenanceGet, maintenanceGetDetail, maintenanceGetWindows, maintenanceGetWindowsDetail, maintenanceUpdateWindowsDetail, maintenancesCreate, maintenancesImmediateDelete, maintenancesImmediatePut, maintenancesPostWindows, maintenancesUpdate, messageGet, messagesList, monitorActivate, monitorCreate, monitorDeactivate, monitorDelete, monitorGet, monitorGetAll, monitorUpdate, oauthClientTokensCreate, oauthClientTokensDelete, oauthClientTokensGet, oauthClientTokensList, oauthClientTokensUpdate, oauthCreateToken, oauthGetRefreshTokenList, oauthGetTokenList, oauthRefreshTokenDeleteId, oauthTokenCognateDelete, oauthTokenCognateDeleteCurrent, oauthTokenDelete, oauthTokenDeleteCurrent, parseFilter, sampleServiceDetailRequestBody, searchUniverse, serviceDetailResponseBody, settingsGet, settingsGetDetail, settingsUpdate, stationDelete, stationsAgentType, stationsCreate, stationsDeleteMaintenance, stationsGet, stationsGetAgents, stationsLatest, stationsList, stationsOnpremiseConnected, stationsOnpremiseConnectedAll, stationsOnpremiseList, stationsPutMaintenance, stationsUpdate, statistic, summarizeDataStoreSchema, tagsGetAll, timezonesList, userBlockDelete, userBlockPut, userDelete, userGet, userLockDelete, userPut, userSubaccountsGet, userSubaccountsPost, verifyAndDumpLegacyConfiguration, verifyAndDumpVersion3Configuration, verifyAndDumpVersion4Configuration, vertexMatchesFilters };
|
|
77264
|
+
export { AXAActivities, AccService, AgentService, AgentTrace, AlarmEnrichment, AlarmEnrichmentFilter, AlarmService, AlertDefinitionResponse, AlertResponse, AlertResponseV2, AlertService, AlignmentSchema, ApmUniverseService, AsmService, AttributeExpressionComparatorSchema, AttributeExpressionOperatorSchema, AttributeExpressionSchema, AttributeFilterOperator, AttributeNameAllSpecifierSchema, AttributeNameAndSpecifierSchema, AttributeNameAnyNumericSpecifierSchema, AttributeNameAttributeSpecifierSchema, AttributeNameChildrenSpecifierSchema, AttributeNameExactSpecifierSchema, AttributeNameFolderSpecifierSchema, AttributeNameNoneSpecifierSchema, AttributeNameNotSpecifierSchema, AttributeNameOperatorSpecifierSchema, AttributeNameOrSpecifierSchema, AttributeNameRegExSpecifierSchema, AttributeNameSpecifierSchema, AttributeNameTypeSpecifierSchema, AttributeService, AttributeValueAsFieldSchema, AuthorizationService, AxaService, BlobService, CalendarIntervalSchema, ChannelService, DEFAULT_EXPERIENCE_REQUEST_BODY, DXChannel, DashboardPermissionsUpdateRequest, DashboardSearch, DashboardService, DataStoreAuditService, DataStoreAuthViewsService, DataStoreBlobStorageService, DataStoreFeaturesService, DataStoreMetricsMetadataService, DataStoreNASSQLService, DataStoreNASSService, DataStoreStatesService, DataStoreTASService, DataStoreTokensService, DxSaasService, DxoiService, EdgeNumericIdSchema, EventService, ExperienceService, FillModeSchema, FilterOperation, FolderNameAllSpecifierSchema, FolderNameAndSpecifierSchema, FolderNameChildrenSpecifierSchema, FolderNameExactSpecifierSchema, FolderNameNoneSpecifierSchema, FolderNameNotSpecifierSchema, FolderNameOrSpecifierSchema, FolderNameRegExSpecifierSchema, FolderNameSpecifierSchema, GraphResponse, GraphService, Inventory, InventoryAttributes, InventoryService, JoinTypeSchema, JsExtensionService, LogQuery, LogsService, METRIC_TYPE_ENUM, METRIC_TYPE_ENUM_NAMES, METRIC_TYPE_REGION, MServe, ManagementModuleIdSchema, ManagementModuleService, MatchType, MetadataMetricQueryResponseV2Schema, MetadataMetricQuerySchema, MetricAttributeSchema, MetricBatchService, MetricFolderSchema, MetricGroupingService, MetricRegisterRequestSchema, MetricRegisterResponseSchema, MetricRegisterSchema, MetricRegisterSourceSchema, MetricTypeEnumNameSchema, NASS, NASSService, NassValueTypeSchema, NotificationService, NumericOperatorSchema, O2NotificationService, O2UniverseService, OIAlarm, OIService, OperatorSchema, PerspectiveService, PlatformAlertService, PlatformFilters, PlatformManagementModuleService, PlatformMetricGroupingService, QuantileMethodSchema, QueryAllSpecifierSchema, QueryAndSpecifierSchema, QueryAttributeExpressionSchema, QueryAttributeSpecifierSchema, QueryColumnTypeSpecSchema, QueryFilterPredicateSpecSchema, QueryFunctionSpecSchema, QueryHintForceRangeSchema, QueryHintSchema, QueryIdSpecifierSchema, QueryMetricGroupSpecifierSchema, QueryMetricIdSchema, QueryNoneSpecifierSchema, QueryNotSpecifierSchema, QueryOrSpecifierSchema, QueryRangeSpecSchema, QueryRequestSchema, QueryResultSchema, QuerySpecSpecifierSchema, QuerySpecifierSchema, SQLService, ServiceFilterSpecifierSchema, ServiceService, SessionService, SimpleHTTPError, SituationLifecycle, SituationService, Situations, SourceNameAllSpecifierSchema, SourceNameAndSpecifierSchema, SourceNameExactSpecifierSchema, SourceNameNoneSpecifierSchema, SourceNameNotSpecifierSchema, SourceNameOrSpecifierSchema, SourceNamePartOperatorSpecifierSchema, SourceNameRegExSpecifierSchema, SourceNameSpecifierSchema, TAS, TASGraph, TASService, TasAddFlowsFilterSchema, TasAddTransitioningEdgesFilterSchema, TasAddWireContextFilterSchema, TasAddWiresFilterSchema, TasAllFilterSchema, TasAnalyticBaseSchema, TasAnalyticResultSchema, TasAndFilterSchema, TasAttributeAlertStatisticsSchema, TasAttributeFilterModeSchema, TasAttributeFilterSchema, TasAttributeNameSchema, TasAttributeTypeSchema, TasCollectAttributeNamesFilterSchema, TasCollectAttributeNamesResultSchema, TasCollectAttributeResultSchema, TasCollectAttributesFilterSchema, TasCollectCardInfoFilterSchema, TasCollectCardInfoResultSchema, TasCollectCardInfoTierSchema, TasCollectCountsFilterSchema, TasCollectCountsResultSchema, TasCollectExperienceAttributesFilterSchema, TasCollectExperienceSelectorSchema, TasCollectGroupingInfoFilterSchema, TasCollectGroupingInfoResultSchema, TasCollectVertexIdFilterSchema, TasCoverageFilterSchema, TasEdgeSchema, TasEmptyFilterSchema, TasExternalIdSchema, TasFilterSchema, TasFollowPathFilterSchema, TasFollowPathFlowFilterSchema, TasFollowPathTypeSchema, TasGraphSchema, TasGroupingAlertStatisticsSchema, TasGroupingInfoSchema, TasGroupingItemSchema, TasJoinFilterSchema, TasJoinTypeSchema, TasLayerFilterSchema, TasLegacyFilterSchema, TasLuceneFilterSchema, TasNotFilterSchema, TasOrFilterSchema, TasOrderSchema, TasProjectionFilterSchema, TasQuerySchema, TasServiceFilterSchema, TasStatusFilterSchema, TasStoreChangeSchema, TasStoreGraphInputSchema, TasStoreGraphResponseSchema, TasTakeEdgesFilterSchema, TasTakeFlowsFilterSchema, TasTakeVerticesFilterSchema, TasTraverseFilterSchema, TasVariableFilterSchema, TasVariableSchema, TasVertexIdFilterSchema, TasVertexSchema, TasViewSchema, Trace, TraversalEdgeFilterSchema, TraversalVertexFilterSchema, TraverseCollectSchema, TraverseDirectionSchema, TraverseSchema, VertexMappingConfigurationModule, VertexService, VertexStateExternalIdSchema, VertexStateNumericIdSchema, VertexStateSchema, VertexStatusChanges, ags, agsresponse, apiTokenCreate, apiTokenDelete, apiTokenGet, apiTokenList, apiTokenUpdate, checkGet, composeMetricTypeBits, contactActivate, contactDelete, contactTestSend, contactsBlockDelete, contactsBlockPut, contactsConfirm, contactsCreate, contactsGet, contactsGetDetail, contactsReplaceNotificationsWith, contactsRequestConfirmationCode, contactsUpdate, convertLegacyConfiguration, createPostmanRequest, createServiceMonolith, decodeMetricTypeBits, escapeRegExp, example, excludedAttributes, folderAccessGet, folderDelete, folderGet, folderPost, folderUpdate, foldersList, getDataStoreSchema, getUserTokenSub, getUserTokenTid, getVertexAttributeValue, getVertexAttributeValueOrNull, hasVertexAttribute, inventorizePreview, inventorizeResponse, inventorySearchRequestBodyExample, inventorySearchResponseBody, isDataStoreSchemaType, isTenantToken, isUserToken, listDataStoreSchemaOps, locationsCreate, locationsDelete, locationsGet, locationsGetAll, locationsGetByType, locationsLeafGetFilter, locationsPost, logGet, logGetEvent, maintenanceDelete, maintenanceDeleteWindows, maintenanceGet, maintenanceGetDetail, maintenanceGetWindows, maintenanceGetWindowsDetail, maintenanceUpdateWindowsDetail, maintenancesCreate, maintenancesImmediateDelete, maintenancesImmediatePut, maintenancesPostWindows, maintenancesUpdate, messageGet, messagesList, monitorActivate, monitorCreate, monitorDeactivate, monitorDelete, monitorGet, monitorGetAll, monitorUpdate, oauthClientTokensCreate, oauthClientTokensDelete, oauthClientTokensGet, oauthClientTokensList, oauthClientTokensUpdate, oauthCreateToken, oauthGetRefreshTokenList, oauthGetTokenList, oauthRefreshTokenDeleteId, oauthTokenCognateDelete, oauthTokenCognateDeleteCurrent, oauthTokenDelete, oauthTokenDeleteCurrent, parseFilter, sampleServiceDetailRequestBody, searchUniverse, serviceDetailResponseBody, settingsGet, settingsGetDetail, settingsUpdate, stationDelete, stationsAgentType, stationsCreate, stationsDeleteMaintenance, stationsGet, stationsGetAgents, stationsLatest, stationsList, stationsOnpremiseConnected, stationsOnpremiseConnectedAll, stationsOnpremiseList, stationsPutMaintenance, stationsUpdate, statistic, summarizeDataStoreSchema, tagsGetAll, timezonesList, userBlockDelete, userBlockPut, userDelete, userGet, userLockDelete, userPut, userSubaccountsGet, userSubaccountsPost, verifyAndDumpLegacyConfiguration, verifyAndDumpVersion3Configuration, verifyAndDumpVersion4Configuration, vertexMatchesFilters };
|
|
77012
77265
|
//# sourceMappingURL=index.esm.js.map
|