@dx-do/client 6.0.4 → 6.1.1
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 +285 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +279 -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 +32 -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 +18 -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.cjs.js
CHANGED
|
@@ -28283,6 +28283,37 @@ const TasGraphSchema = v4.z.looseObject({
|
|
|
28283
28283
|
totalEdges: v4.z.number().optional(),
|
|
28284
28284
|
});
|
|
28285
28285
|
|
|
28286
|
+
const TasStoreGraphInputSchema = v4.z.looseObject({
|
|
28287
|
+
includeSuccessResult: v4.z.boolean().optional(),
|
|
28288
|
+
ttl: v4.z.number().optional(),
|
|
28289
|
+
endTimeAllowedThreshold: v4.z.number().optional(),
|
|
28290
|
+
storeType: TasAttributeTypeSchema.optional(),
|
|
28291
|
+
graph: TasGraphSchema,
|
|
28292
|
+
});
|
|
28293
|
+
const TasStoreChangeSchema = v4.z.looseObject({
|
|
28294
|
+
changeType: v4.z.string().optional(),
|
|
28295
|
+
id: v4.z.unknown().optional(),
|
|
28296
|
+
});
|
|
28297
|
+
const TasStoreGraphResponseSchema = v4.z.looseObject({
|
|
28298
|
+
graph: TasGraphSchema.optional(),
|
|
28299
|
+
failedVertices: v4.z
|
|
28300
|
+
.array(v4.z.looseObject({
|
|
28301
|
+
object: TasVertexSchema,
|
|
28302
|
+
code: v4.z.string().optional(),
|
|
28303
|
+
message: v4.z.string().optional(),
|
|
28304
|
+
}))
|
|
28305
|
+
.optional(),
|
|
28306
|
+
failedEdges: v4.z
|
|
28307
|
+
.array(v4.z.looseObject({
|
|
28308
|
+
object: TasEdgeSchema,
|
|
28309
|
+
code: v4.z.string().optional(),
|
|
28310
|
+
message: v4.z.string().optional(),
|
|
28311
|
+
}))
|
|
28312
|
+
.optional(),
|
|
28313
|
+
edgeChanges: v4.z.array(TasStoreChangeSchema).optional(),
|
|
28314
|
+
vertexChanges: v4.z.array(TasStoreChangeSchema).optional(),
|
|
28315
|
+
});
|
|
28316
|
+
|
|
28286
28317
|
/**
|
|
28287
28318
|
* Comparison operators used in the `PART` specifier for comparing
|
|
28288
28319
|
* dot-separated source-name segments numerically or lexically.
|
|
@@ -28912,6 +28943,29 @@ const MetadataMetricQuerySchema = v4.z.looseObject({
|
|
|
28912
28943
|
.describe('Optional server hints; currently supports `ForceRange`'),
|
|
28913
28944
|
});
|
|
28914
28945
|
|
|
28946
|
+
const MetricRegisterSchema = v4.z.looseObject({
|
|
28947
|
+
id: v4.z.string().optional(),
|
|
28948
|
+
sourceName: v4.z.string(),
|
|
28949
|
+
attributeName: v4.z.string(),
|
|
28950
|
+
type: v4.z.number().optional(),
|
|
28951
|
+
typeEnum: v4.z.array(v4.z.string()).optional(),
|
|
28952
|
+
attributes: v4.z.record(v4.z.string(), v4.z.unknown()).optional(),
|
|
28953
|
+
firstSeen: v4.z.number().optional(),
|
|
28954
|
+
lastSeen: v4.z.number().optional(),
|
|
28955
|
+
});
|
|
28956
|
+
const MetricRegisterRequestSchema = v4.z.looseObject({
|
|
28957
|
+
sync: v4.z.boolean().optional(),
|
|
28958
|
+
metrics: v4.z.array(MetricRegisterSchema),
|
|
28959
|
+
});
|
|
28960
|
+
const MetricRegisterSourceSchema = v4.z.looseObject({
|
|
28961
|
+
sourceId: v4.z.string().optional(),
|
|
28962
|
+
name: v4.z.string().optional(),
|
|
28963
|
+
});
|
|
28964
|
+
const MetricRegisterResponseSchema = v4.z.looseObject({
|
|
28965
|
+
metrics: v4.z.array(MetricRegisterSchema).optional(),
|
|
28966
|
+
sources: v4.z.array(MetricRegisterSourceSchema).optional(),
|
|
28967
|
+
});
|
|
28968
|
+
|
|
28915
28969
|
const MetricAttributeSchema = v4.z.looseObject({
|
|
28916
28970
|
id: v4.z.string().optional(),
|
|
28917
28971
|
sourceName: v4.z.string().optional(),
|
|
@@ -45512,36 +45566,35 @@ exports.LogQuery = void 0;
|
|
|
45512
45566
|
};
|
|
45513
45567
|
}
|
|
45514
45568
|
LogQuery.createOr = createOr;
|
|
45515
|
-
function createLogQueryRequestBody(range, ors, severities = [
|
|
45569
|
+
function createLogQueryRequestBody(range, ors, severities = [], includes = [
|
|
45516
45570
|
'_id',
|
|
45517
45571
|
'host',
|
|
45518
45572
|
'logseverity',
|
|
45519
|
-
'
|
|
45573
|
+
'logtype',
|
|
45520
45574
|
'timestamp',
|
|
45521
45575
|
'file',
|
|
45522
45576
|
'message',
|
|
45523
45577
|
], size = 1000, sort = [{ sortKey: 'timestamp', sortOrder: 'Asc' }]) {
|
|
45578
|
+
const nonEmptySeverities = severities.filter((s) => s.length > 0);
|
|
45579
|
+
const severityClause = nonEmptySeverities.length > 0
|
|
45580
|
+
? [
|
|
45581
|
+
{
|
|
45582
|
+
or: {
|
|
45583
|
+
expressions: nonEmptySeverities.map((severity) => ({
|
|
45584
|
+
fieldDescription: 'Log Severity',
|
|
45585
|
+
field: 'logseverity',
|
|
45586
|
+
value: severity,
|
|
45587
|
+
condition: 'equals',
|
|
45588
|
+
})),
|
|
45589
|
+
},
|
|
45590
|
+
},
|
|
45591
|
+
]
|
|
45592
|
+
: [];
|
|
45524
45593
|
return {
|
|
45525
45594
|
size,
|
|
45526
45595
|
query: {
|
|
45527
45596
|
and: {
|
|
45528
|
-
expressions: [
|
|
45529
|
-
{
|
|
45530
|
-
or: {
|
|
45531
|
-
expressions: [
|
|
45532
|
-
...severities.map((severity) => {
|
|
45533
|
-
return {
|
|
45534
|
-
fieldDescription: 'Log Severity',
|
|
45535
|
-
field: 'logseverity',
|
|
45536
|
-
value: severity,
|
|
45537
|
-
condition: 'equals',
|
|
45538
|
-
};
|
|
45539
|
-
}),
|
|
45540
|
-
],
|
|
45541
|
-
},
|
|
45542
|
-
},
|
|
45543
|
-
...ors,
|
|
45544
|
-
],
|
|
45597
|
+
expressions: [...severityClause, ...ors],
|
|
45545
45598
|
},
|
|
45546
45599
|
},
|
|
45547
45600
|
includes,
|
|
@@ -61105,6 +61158,15 @@ class AgentService {
|
|
|
61105
61158
|
};
|
|
61106
61159
|
return this.dxSaaSService.tenantPost('/apm/atc/api/private/trace/summary', traceSummaryRequestBody);
|
|
61107
61160
|
}
|
|
61161
|
+
/** Posts a synthetic transaction trace to the tracestore ingestion endpoint. */
|
|
61162
|
+
injectTrace(trace) {
|
|
61163
|
+
return this.injectTraces([trace]);
|
|
61164
|
+
}
|
|
61165
|
+
/** Posts one or more synthetic transaction traces to the tracestore ingestion endpoint. */
|
|
61166
|
+
injectTraces(traces) {
|
|
61167
|
+
const body = { values: traces };
|
|
61168
|
+
return this.dxSaaSService.tenantPost('/tracestore/process', body);
|
|
61169
|
+
}
|
|
61108
61170
|
/** Starts a trace session on one or more agents with optional filters. */
|
|
61109
61171
|
startAgentTrace(agents, minTXDuration, sessionDuration, parameterName, operationType, parameterNotSign, parameterValue, errorFilterValue) {
|
|
61110
61172
|
let body = {
|
|
@@ -69530,6 +69592,30 @@ class DxSaasService {
|
|
|
69530
69592
|
}
|
|
69531
69593
|
});
|
|
69532
69594
|
}
|
|
69595
|
+
/**
|
|
69596
|
+
* POST to the log ingestion gateway (`dxLogIngestionURL`) without a cohort path segment.
|
|
69597
|
+
* Auth uses the same `Bearer {userToken}` as other tenant methods.
|
|
69598
|
+
* Throws if `dxLogIngestionURL` is not set in config.
|
|
69599
|
+
*/
|
|
69600
|
+
async logPost(path, body) {
|
|
69601
|
+
const logBase = this.dxdoConfiguration.dxConfiguration.dxLogIngestionURL;
|
|
69602
|
+
if (!logBase) {
|
|
69603
|
+
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")');
|
|
69604
|
+
}
|
|
69605
|
+
const url = `${logBase}/${path}`;
|
|
69606
|
+
this.log.debug(`log posting to: ${url}`);
|
|
69607
|
+
return this._httpClient
|
|
69608
|
+
.post(url, body ?? {}, this.createSimpleUserAuthorizedRequestConfig(undefined))
|
|
69609
|
+
.then((response) => response.data)
|
|
69610
|
+
.catch((reason) => {
|
|
69611
|
+
if (reason.response || reason.request) {
|
|
69612
|
+
throw DxSaasService.handleAxiosError(reason);
|
|
69613
|
+
}
|
|
69614
|
+
else {
|
|
69615
|
+
throw new Error(reason);
|
|
69616
|
+
}
|
|
69617
|
+
});
|
|
69618
|
+
}
|
|
69533
69619
|
/**
|
|
69534
69620
|
* GET from an ACC path, returning the response as a Node.js readable stream.
|
|
69535
69621
|
* @param path - Path segment appended after `.../acc/`.
|
|
@@ -73334,12 +73420,25 @@ class JsExtensionService {
|
|
|
73334
73420
|
}
|
|
73335
73421
|
}
|
|
73336
73422
|
|
|
73423
|
+
function detectIPv4() {
|
|
73424
|
+
const nets = require$$0$4.networkInterfaces();
|
|
73425
|
+
for (const iface of Object.values(nets)) {
|
|
73426
|
+
if (!iface)
|
|
73427
|
+
continue;
|
|
73428
|
+
for (const net of iface) {
|
|
73429
|
+
if (net.family === 'IPv4' && !net.internal) {
|
|
73430
|
+
return net.address;
|
|
73431
|
+
}
|
|
73432
|
+
}
|
|
73433
|
+
}
|
|
73434
|
+
return '127.0.0.1';
|
|
73435
|
+
}
|
|
73337
73436
|
/**
|
|
73338
|
-
* Service for querying
|
|
73437
|
+
* Service for querying and ingesting log analytics data.
|
|
73339
73438
|
*/
|
|
73340
73439
|
class LogsService {
|
|
73341
73440
|
dxSaasService;
|
|
73342
|
-
/** @param dxSaasService - DX SaaS HTTP client
|
|
73441
|
+
/** @param dxSaasService - DX SaaS HTTP client */
|
|
73343
73442
|
constructor(dxSaasService) {
|
|
73344
73443
|
this.dxSaasService = dxSaasService;
|
|
73345
73444
|
}
|
|
@@ -73347,6 +73446,55 @@ class LogsService {
|
|
|
73347
73446
|
queryLogs(logQueryBody) {
|
|
73348
73447
|
return this.dxSaasService.oiPost('oi/loganalytics/v1/api/logs/filter', logQueryBody);
|
|
73349
73448
|
}
|
|
73449
|
+
/**
|
|
73450
|
+
* Builds the enriched payload object for a single log entry.
|
|
73451
|
+
*
|
|
73452
|
+
* @param options - Known log entry fields (all optional with sensible defaults).
|
|
73453
|
+
* @param additionalFields - Arbitrary extra fields to include in the indexed document.
|
|
73454
|
+
* @returns The payload object ready to POST to the uim_logs ingestion endpoint.
|
|
73455
|
+
*/
|
|
73456
|
+
buildLogPayload(options, additionalFields) {
|
|
73457
|
+
const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
|
|
73458
|
+
const tenantIdUpper = cohortId.toUpperCase();
|
|
73459
|
+
const logtype = options.logtype ?? 'generic';
|
|
73460
|
+
const host = options.host ?? require$$0$4.hostname();
|
|
73461
|
+
const ip = options.ip ?? detectIPv4();
|
|
73462
|
+
const agentInstance = options.agentInstance ?? 'dx-do';
|
|
73463
|
+
const agentName = options.agentName ?? 'Logs Collector';
|
|
73464
|
+
const containerId = options.containerId ?? host;
|
|
73465
|
+
const containerName = options.containerName ?? agentInstance;
|
|
73466
|
+
const file = options.file ?? 'dx-do.cli';
|
|
73467
|
+
const tag = `${logtype} logs`;
|
|
73468
|
+
// temp_fields must have exactly 9 space-separated components before the message
|
|
73469
|
+
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|
|
73470
|
+
// The Kafka consumer parses positionally: [0]=tenant [1]=logtype [2]=host
|
|
73471
|
+
// [3]=container_id [4]=container_name [5]=ip [6-7]=tags [8]=source_file [9+]=message.
|
|
73472
|
+
const temp_fields = `${tenantIdUpper} ${logtype} ${host} ${containerId} ${containerName} ${ip} ${tag} ${file}`;
|
|
73473
|
+
return {
|
|
73474
|
+
'@timestamp': options.timestamp ?? new Date().toISOString(),
|
|
73475
|
+
// logtype must be top-level: the SaaS filter does `update => ["type", "%{logtype}"]`
|
|
73476
|
+
// which drives Kafka consumer index routing — without it type stays as "ingestionapi"
|
|
73477
|
+
logtype,
|
|
73478
|
+
message: options.message,
|
|
73479
|
+
host: { name: host, hostname: host },
|
|
73480
|
+
tenant_id: tenantIdUpper,
|
|
73481
|
+
temp_fields,
|
|
73482
|
+
tags: [tag],
|
|
73483
|
+
__agent_name: agentName,
|
|
73484
|
+
__agent_instance: agentInstance,
|
|
73485
|
+
container_id: containerId,
|
|
73486
|
+
container_name: containerName,
|
|
73487
|
+
...additionalFields,
|
|
73488
|
+
};
|
|
73489
|
+
}
|
|
73490
|
+
/** Ingests a single log entry into the log gateway. */
|
|
73491
|
+
ingestLog(options, additionalFields) {
|
|
73492
|
+
return this.dxSaasService.logPost('mdo/v2/aoanalytics/ingestion/uim_logs', [this.buildLogPayload(options, additionalFields)]);
|
|
73493
|
+
}
|
|
73494
|
+
/** Ingests a batch of log entries into the log gateway. */
|
|
73495
|
+
ingestLogs(entries) {
|
|
73496
|
+
return this.dxSaasService.logPost('mdo/v2/aoanalytics/ingestion/uim_logs', entries.map((e) => this.buildLogPayload(e.options, e.additionalFields)));
|
|
73497
|
+
}
|
|
73350
73498
|
}
|
|
73351
73499
|
|
|
73352
73500
|
/**
|
|
@@ -73806,7 +73954,11 @@ class NASSService {
|
|
|
73806
73954
|
this.dxSaaSService = dxSaaSService;
|
|
73807
73955
|
this.log = log;
|
|
73808
73956
|
}
|
|
73809
|
-
/**
|
|
73957
|
+
/**
|
|
73958
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetrics} instead —
|
|
73959
|
+
* it accepts the full `MetricRegister[]` shape including `typeEnum`, `id`,
|
|
73960
|
+
* `firstSeen`, and `lastSeen`.
|
|
73961
|
+
*/
|
|
73810
73962
|
async registerMetrics(metricRegistrations) {
|
|
73811
73963
|
const metricRegistrationBody = {
|
|
73812
73964
|
metrics: metricRegistrations,
|
|
@@ -73866,7 +74018,9 @@ class NASSService {
|
|
|
73866
74018
|
};
|
|
73867
74019
|
return this.dxSaaSService.tenantPost('/metadata/queryMetric', metadataQuery);
|
|
73868
74020
|
}
|
|
73869
|
-
/**
|
|
74021
|
+
/**
|
|
74022
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetric} instead.
|
|
74023
|
+
*/
|
|
73870
74024
|
async registerMetric(sourceName, attributeName, metricType, attributes) {
|
|
73871
74025
|
const metricRegistrationBody = {
|
|
73872
74026
|
metrics: [
|
|
@@ -73880,7 +74034,11 @@ class NASSService {
|
|
|
73880
74034
|
};
|
|
73881
74035
|
return this.dxSaaSService.tenantPost('/metadata/registerMetric', metricRegistrationBody);
|
|
73882
74036
|
}
|
|
73883
|
-
/**
|
|
74037
|
+
/**
|
|
74038
|
+
* @deprecated Use {@link DataStoreNASSService.storeMetricValues} instead — it
|
|
74039
|
+
* accepts typed {@link NassDatapoint} tuples covering regular, string, and
|
|
74040
|
+
* extension metric variants, and returns a typed {@link NassStoreResponse}.
|
|
74041
|
+
*/
|
|
73884
74042
|
async storeMetricValue(metricValues) {
|
|
73885
74043
|
const metricStoreBody = { values: new Array() };
|
|
73886
74044
|
metricValues.forEach((metricValue) => metricStoreBody.values.push([
|
|
@@ -74880,7 +75038,11 @@ class TASService {
|
|
|
74880
75038
|
this.dxSaaSService = dxSaaSService;
|
|
74881
75039
|
this.log = log;
|
|
74882
75040
|
}
|
|
74883
|
-
/**
|
|
75041
|
+
/**
|
|
75042
|
+
* @deprecated Use {@link DataStoreTASService.storeGraph} instead — it accepts
|
|
75043
|
+
* the full `TasStoreGraphInput` model with all optional fields and returns a
|
|
75044
|
+
* typed `TasStoreGraphResponse` with `failedVertices`/`failedEdges`.
|
|
75045
|
+
*/
|
|
74884
75046
|
async storeGraph(graphBody) {
|
|
74885
75047
|
this.log.debug('storing');
|
|
74886
75048
|
return this.dxSaaSService.tenantPost('/tas/graph/store', graphBody);
|
|
@@ -76138,6 +76300,32 @@ class DataStoreMetricsMetadataService {
|
|
|
76138
76300
|
this.dxSaasService = dxSaasService;
|
|
76139
76301
|
this.log = log;
|
|
76140
76302
|
}
|
|
76303
|
+
/**
|
|
76304
|
+
* Registers one or more metrics via `POST /metadata/registerMetric`.
|
|
76305
|
+
*
|
|
76306
|
+
* @remarks The request is validated against {@link MetricRegisterRequestSchema}.
|
|
76307
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76308
|
+
* API response is still returned.
|
|
76309
|
+
*
|
|
76310
|
+
* @throws ZodError if the request fails schema validation.
|
|
76311
|
+
*/
|
|
76312
|
+
async registerMetrics(metrics, sync) {
|
|
76313
|
+
const body = {
|
|
76314
|
+
metrics,
|
|
76315
|
+
...(sync !== undefined ? { sync } : {}),
|
|
76316
|
+
};
|
|
76317
|
+
MetricRegisterRequestSchema.parse(body);
|
|
76318
|
+
const raw = await this.dxSaasService.tenantPost('metadata/registerMetric', body);
|
|
76319
|
+
const result = MetricRegisterResponseSchema.safeParse(raw);
|
|
76320
|
+
if (!result.success) {
|
|
76321
|
+
this.log.warn('MetricRegisterResponse validation warning:', result.error.message);
|
|
76322
|
+
}
|
|
76323
|
+
return raw;
|
|
76324
|
+
}
|
|
76325
|
+
/** Registers a single metric. Convenience wrapper around {@link registerMetrics}. */
|
|
76326
|
+
async registerMetric(metric, sync) {
|
|
76327
|
+
return this.registerMetrics([metric], sync);
|
|
76328
|
+
}
|
|
76141
76329
|
/**
|
|
76142
76330
|
* POSTs a metadata query to `/metadata/queryMetric` and returns the matching
|
|
76143
76331
|
* metric / folder records.
|
|
@@ -76483,6 +76671,25 @@ class DataStoreTASService {
|
|
|
76483
76671
|
this.dxSaasService = dxSaasService;
|
|
76484
76672
|
this.log = log;
|
|
76485
76673
|
}
|
|
76674
|
+
/**
|
|
76675
|
+
* POSTs a graph to `/tas/graph/store` and returns the store result including
|
|
76676
|
+
* any failed vertices or edges.
|
|
76677
|
+
*
|
|
76678
|
+
* @remarks The request is validated against {@link TasStoreGraphInputSchema}.
|
|
76679
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76680
|
+
* API response is still returned.
|
|
76681
|
+
*
|
|
76682
|
+
* @throws ZodError if the request fails schema validation.
|
|
76683
|
+
*/
|
|
76684
|
+
async storeGraph(input) {
|
|
76685
|
+
TasStoreGraphInputSchema.parse(input);
|
|
76686
|
+
const raw = await this.dxSaasService.tenantPost('tas/graph/store', input);
|
|
76687
|
+
const result = TasStoreGraphResponseSchema.safeParse(raw);
|
|
76688
|
+
if (!result.success) {
|
|
76689
|
+
this.log.warn('TasStoreGraphResponse validation warning:', result.error.message);
|
|
76690
|
+
}
|
|
76691
|
+
return raw;
|
|
76692
|
+
}
|
|
76486
76693
|
/**
|
|
76487
76694
|
* POSTs a TAS graph query to `/tas/graph/query` and returns the resulting
|
|
76488
76695
|
* graph (vertices, edges, states).
|
|
@@ -76966,6 +77173,50 @@ class DataStoreTokensService {
|
|
|
76966
77173
|
}
|
|
76967
77174
|
}
|
|
76968
77175
|
|
|
77176
|
+
/**
|
|
77177
|
+
* Service for storing metric data points in the DX SaaS DataStore NASS API
|
|
77178
|
+
* (`POST /nass/metricValue/store`).
|
|
77179
|
+
*
|
|
77180
|
+
* Metrics must be registered first via
|
|
77181
|
+
* {@link DataStoreMetricsMetadataService.registerMetric} before values can be
|
|
77182
|
+
* stored. Use the metric's `id` from the registration response as the first
|
|
77183
|
+
* element of each {@link NassDatapoint} tuple.
|
|
77184
|
+
*
|
|
77185
|
+
* Three datapoint variants are supported — see {@link NassDatapoint}:
|
|
77186
|
+
* - **Regular** numeric: `[id, time, min, max, value, count, interval?]`
|
|
77187
|
+
* - **String** metric: same shape but `min` and `max` must be `null`
|
|
77188
|
+
* - **Extension**: `[id, extensionId, time, interval, ...values]`
|
|
77189
|
+
*
|
|
77190
|
+
* @example
|
|
77191
|
+
* ```ts
|
|
77192
|
+
* const service = new DataStoreNASSService(dxSaasService, log);
|
|
77193
|
+
* const response = await service.storeMetricValues([
|
|
77194
|
+
* ['metricId', Date.now() / 1000, 0, 100, 42, 1, 15],
|
|
77195
|
+
* ['strMetricId', Date.now() / 1000, null, null, 'running', 1, 15],
|
|
77196
|
+
* ]);
|
|
77197
|
+
* // response.metricForwardFailures — count of failed forwarding (only present if > 0)
|
|
77198
|
+
* ```
|
|
77199
|
+
*/
|
|
77200
|
+
class DataStoreNASSService {
|
|
77201
|
+
dxSaasService;
|
|
77202
|
+
log;
|
|
77203
|
+
constructor(dxSaasService, log) {
|
|
77204
|
+
this.dxSaasService = dxSaasService;
|
|
77205
|
+
this.log = log;
|
|
77206
|
+
}
|
|
77207
|
+
/**
|
|
77208
|
+
* POSTs one or more metric datapoints to `/nass/metricValue/store`.
|
|
77209
|
+
*
|
|
77210
|
+
* @param values - Array of {@link NassDatapoint} tuples. Each tuple must
|
|
77211
|
+
* begin with a registered metric ID obtained from
|
|
77212
|
+
* {@link DataStoreMetricsMetadataService.registerMetric}.
|
|
77213
|
+
*/
|
|
77214
|
+
async storeMetricValues(values) {
|
|
77215
|
+
const body = { values };
|
|
77216
|
+
return this.dxSaasService.tenantPost('nass/metricValue/store', body);
|
|
77217
|
+
}
|
|
77218
|
+
}
|
|
77219
|
+
|
|
76969
77220
|
var NullSimpleLog = Logging.NullSimpleLog;
|
|
76970
77221
|
/**
|
|
76971
77222
|
* Creates and returns a container of all DX client services (ACC, alerts, alarms,
|
|
@@ -76997,6 +77248,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
|
|
|
76997
77248
|
dxChannelService: new ChannelService(dxSaaSService),
|
|
76998
77249
|
dxDashboardService: new DashboardService(dxSaaSService),
|
|
76999
77250
|
dxDataStoreMetricsMetadataService: new DataStoreMetricsMetadataService(dxSaaSService, log),
|
|
77251
|
+
dxDataStoreNASSService: new DataStoreNASSService(dxSaaSService, log),
|
|
77000
77252
|
dxDataStoreNASSQLService: new DataStoreNASSQLService(dxSaaSService, log),
|
|
77001
77253
|
dxDataStoreTASService: new DataStoreTASService(dxSaaSService, log),
|
|
77002
77254
|
dxEventService: new EventService(dxSaaSService, log),
|
|
@@ -77069,6 +77321,7 @@ exports.DataStoreBlobStorageService = DataStoreBlobStorageService;
|
|
|
77069
77321
|
exports.DataStoreFeaturesService = DataStoreFeaturesService;
|
|
77070
77322
|
exports.DataStoreMetricsMetadataService = DataStoreMetricsMetadataService;
|
|
77071
77323
|
exports.DataStoreNASSQLService = DataStoreNASSQLService;
|
|
77324
|
+
exports.DataStoreNASSService = DataStoreNASSService;
|
|
77072
77325
|
exports.DataStoreStatesService = DataStoreStatesService;
|
|
77073
77326
|
exports.DataStoreTASService = DataStoreTASService;
|
|
77074
77327
|
exports.DataStoreTokensService = DataStoreTokensService;
|
|
@@ -77103,6 +77356,10 @@ exports.MetricAttributeSchema = MetricAttributeSchema;
|
|
|
77103
77356
|
exports.MetricBatchService = MetricBatchService;
|
|
77104
77357
|
exports.MetricFolderSchema = MetricFolderSchema;
|
|
77105
77358
|
exports.MetricGroupingService = MetricGroupingService;
|
|
77359
|
+
exports.MetricRegisterRequestSchema = MetricRegisterRequestSchema;
|
|
77360
|
+
exports.MetricRegisterResponseSchema = MetricRegisterResponseSchema;
|
|
77361
|
+
exports.MetricRegisterSchema = MetricRegisterSchema;
|
|
77362
|
+
exports.MetricRegisterSourceSchema = MetricRegisterSourceSchema;
|
|
77106
77363
|
exports.MetricTypeEnumNameSchema = MetricTypeEnumNameSchema;
|
|
77107
77364
|
exports.NASSService = NASSService;
|
|
77108
77365
|
exports.NassValueTypeSchema = NassValueTypeSchema;
|
|
@@ -77203,6 +77460,9 @@ exports.TasProjectionFilterSchema = TasProjectionFilterSchema;
|
|
|
77203
77460
|
exports.TasQuerySchema = TasQuerySchema;
|
|
77204
77461
|
exports.TasServiceFilterSchema = TasServiceFilterSchema;
|
|
77205
77462
|
exports.TasStatusFilterSchema = TasStatusFilterSchema;
|
|
77463
|
+
exports.TasStoreChangeSchema = TasStoreChangeSchema;
|
|
77464
|
+
exports.TasStoreGraphInputSchema = TasStoreGraphInputSchema;
|
|
77465
|
+
exports.TasStoreGraphResponseSchema = TasStoreGraphResponseSchema;
|
|
77206
77466
|
exports.TasTakeEdgesFilterSchema = TasTakeEdgesFilterSchema;
|
|
77207
77467
|
exports.TasTakeFlowsFilterSchema = TasTakeFlowsFilterSchema;
|
|
77208
77468
|
exports.TasTakeVerticesFilterSchema = TasTakeVerticesFilterSchema;
|