@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.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,56 @@ class LogsService {
|
|
|
73347
73446
|
queryLogs(logQueryBody) {
|
|
73348
73447
|
return this.dxSaasService.oiPost('oi/loganalytics/v1/api/logs/filter', logQueryBody);
|
|
73349
73448
|
}
|
|
73449
|
+
/** Ingests a single log entry into the log gateway. */
|
|
73450
|
+
ingestLog(entry) {
|
|
73451
|
+
return this.ingestLogs([entry]);
|
|
73452
|
+
}
|
|
73453
|
+
/**
|
|
73454
|
+
* Builds the enriched payload array that will be sent to the uim_logs endpoint.
|
|
73455
|
+
* Exposed so callers can inspect the payload without sending (e.g. dry-run).
|
|
73456
|
+
*/
|
|
73457
|
+
buildLogPayload(entries) {
|
|
73458
|
+
const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
|
|
73459
|
+
const tenantIdUpper = cohortId.toUpperCase();
|
|
73460
|
+
const now = new Date().toISOString();
|
|
73461
|
+
return entries.map((e) => {
|
|
73462
|
+
const host = e.host ?? require$$0$4.hostname();
|
|
73463
|
+
const logtype = e.logtype;
|
|
73464
|
+
const ip = e.ip ?? detectIPv4();
|
|
73465
|
+
const agentInstance = e.agentInstance ?? 'dx-do';
|
|
73466
|
+
const agentName = e.agentName ?? 'Logs Collector';
|
|
73467
|
+
const containerId = e.containerId ?? host;
|
|
73468
|
+
const containerName = e.containerName ?? agentInstance;
|
|
73469
|
+
const file = e.file ?? 'dx-do.cli';
|
|
73470
|
+
const tag = `${logtype} logs`;
|
|
73471
|
+
// temp_fields must have exactly 9 space-separated components before the message
|
|
73472
|
+
// is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
|
|
73473
|
+
// The Kafka consumer parses positionally: [0]=tenant [1]=logtype [2]=host
|
|
73474
|
+
// [3]=container_id [4]=container_name [5]=ip [6-7]=tags [8]=source_file [9+]=message.
|
|
73475
|
+
const temp_fields = `${tenantIdUpper} ${logtype} ${host} ${containerId} ${containerName} ${ip} ${tag} ${file}`;
|
|
73476
|
+
return {
|
|
73477
|
+
'@timestamp': now,
|
|
73478
|
+
// logtype must be top-level: the SaaS filter does `update => ["type", "%{logtype}"]`
|
|
73479
|
+
// which drives Kafka consumer index routing — without it type stays as "ingestionapi"
|
|
73480
|
+
logtype,
|
|
73481
|
+
message: e.message ?? '',
|
|
73482
|
+
host: { name: host, hostname: host },
|
|
73483
|
+
tenant_id: tenantIdUpper,
|
|
73484
|
+
temp_fields,
|
|
73485
|
+
tags: [tag],
|
|
73486
|
+
__agent_name: agentName,
|
|
73487
|
+
__agent_instance: agentInstance,
|
|
73488
|
+
container_id: containerId,
|
|
73489
|
+
container_name: containerName,
|
|
73490
|
+
...Object.fromEntries(Object.entries(e).filter(([k]) => !['logtype', 'message', 'host', 'timestamp', 'ip',
|
|
73491
|
+
'agentInstance', 'agentName', 'containerId', 'containerName', 'file'].includes(k))),
|
|
73492
|
+
};
|
|
73493
|
+
});
|
|
73494
|
+
}
|
|
73495
|
+
/** Ingests a batch of log entries into the log gateway. */
|
|
73496
|
+
ingestLogs(entries) {
|
|
73497
|
+
return this.dxSaasService.logPost('mdo/v2/aoanalytics/ingestion/uim_logs', this.buildLogPayload(entries));
|
|
73498
|
+
}
|
|
73350
73499
|
}
|
|
73351
73500
|
|
|
73352
73501
|
/**
|
|
@@ -73806,7 +73955,11 @@ class NASSService {
|
|
|
73806
73955
|
this.dxSaaSService = dxSaaSService;
|
|
73807
73956
|
this.log = log;
|
|
73808
73957
|
}
|
|
73809
|
-
/**
|
|
73958
|
+
/**
|
|
73959
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetrics} instead —
|
|
73960
|
+
* it accepts the full `MetricRegister[]` shape including `typeEnum`, `id`,
|
|
73961
|
+
* `firstSeen`, and `lastSeen`.
|
|
73962
|
+
*/
|
|
73810
73963
|
async registerMetrics(metricRegistrations) {
|
|
73811
73964
|
const metricRegistrationBody = {
|
|
73812
73965
|
metrics: metricRegistrations,
|
|
@@ -73866,7 +74019,9 @@ class NASSService {
|
|
|
73866
74019
|
};
|
|
73867
74020
|
return this.dxSaaSService.tenantPost('/metadata/queryMetric', metadataQuery);
|
|
73868
74021
|
}
|
|
73869
|
-
/**
|
|
74022
|
+
/**
|
|
74023
|
+
* @deprecated Use {@link DataStoreMetricsMetadataService.registerMetric} instead.
|
|
74024
|
+
*/
|
|
73870
74025
|
async registerMetric(sourceName, attributeName, metricType, attributes) {
|
|
73871
74026
|
const metricRegistrationBody = {
|
|
73872
74027
|
metrics: [
|
|
@@ -73880,7 +74035,11 @@ class NASSService {
|
|
|
73880
74035
|
};
|
|
73881
74036
|
return this.dxSaaSService.tenantPost('/metadata/registerMetric', metricRegistrationBody);
|
|
73882
74037
|
}
|
|
73883
|
-
/**
|
|
74038
|
+
/**
|
|
74039
|
+
* @deprecated Use {@link DataStoreNASSService.storeMetricValues} instead — it
|
|
74040
|
+
* accepts typed {@link NassDatapoint} tuples covering regular, string, and
|
|
74041
|
+
* extension metric variants, and returns a typed {@link NassStoreResponse}.
|
|
74042
|
+
*/
|
|
73884
74043
|
async storeMetricValue(metricValues) {
|
|
73885
74044
|
const metricStoreBody = { values: new Array() };
|
|
73886
74045
|
metricValues.forEach((metricValue) => metricStoreBody.values.push([
|
|
@@ -74880,7 +75039,11 @@ class TASService {
|
|
|
74880
75039
|
this.dxSaaSService = dxSaaSService;
|
|
74881
75040
|
this.log = log;
|
|
74882
75041
|
}
|
|
74883
|
-
/**
|
|
75042
|
+
/**
|
|
75043
|
+
* @deprecated Use {@link DataStoreTASService.storeGraph} instead — it accepts
|
|
75044
|
+
* the full `TasStoreGraphInput` model with all optional fields and returns a
|
|
75045
|
+
* typed `TasStoreGraphResponse` with `failedVertices`/`failedEdges`.
|
|
75046
|
+
*/
|
|
74884
75047
|
async storeGraph(graphBody) {
|
|
74885
75048
|
this.log.debug('storing');
|
|
74886
75049
|
return this.dxSaaSService.tenantPost('/tas/graph/store', graphBody);
|
|
@@ -76138,6 +76301,32 @@ class DataStoreMetricsMetadataService {
|
|
|
76138
76301
|
this.dxSaasService = dxSaasService;
|
|
76139
76302
|
this.log = log;
|
|
76140
76303
|
}
|
|
76304
|
+
/**
|
|
76305
|
+
* Registers one or more metrics via `POST /metadata/registerMetric`.
|
|
76306
|
+
*
|
|
76307
|
+
* @remarks The request is validated against {@link MetricRegisterRequestSchema}.
|
|
76308
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76309
|
+
* API response is still returned.
|
|
76310
|
+
*
|
|
76311
|
+
* @throws ZodError if the request fails schema validation.
|
|
76312
|
+
*/
|
|
76313
|
+
async registerMetrics(metrics, sync) {
|
|
76314
|
+
const body = {
|
|
76315
|
+
metrics,
|
|
76316
|
+
...(sync !== undefined ? { sync } : {}),
|
|
76317
|
+
};
|
|
76318
|
+
MetricRegisterRequestSchema.parse(body);
|
|
76319
|
+
const raw = await this.dxSaasService.tenantPost('metadata/registerMetric', body);
|
|
76320
|
+
const result = MetricRegisterResponseSchema.safeParse(raw);
|
|
76321
|
+
if (!result.success) {
|
|
76322
|
+
this.log.warn('MetricRegisterResponse validation warning:', result.error.message);
|
|
76323
|
+
}
|
|
76324
|
+
return raw;
|
|
76325
|
+
}
|
|
76326
|
+
/** Registers a single metric. Convenience wrapper around {@link registerMetrics}. */
|
|
76327
|
+
async registerMetric(metric, sync) {
|
|
76328
|
+
return this.registerMetrics([metric], sync);
|
|
76329
|
+
}
|
|
76141
76330
|
/**
|
|
76142
76331
|
* POSTs a metadata query to `/metadata/queryMetric` and returns the matching
|
|
76143
76332
|
* metric / folder records.
|
|
@@ -76483,6 +76672,25 @@ class DataStoreTASService {
|
|
|
76483
76672
|
this.dxSaasService = dxSaasService;
|
|
76484
76673
|
this.log = log;
|
|
76485
76674
|
}
|
|
76675
|
+
/**
|
|
76676
|
+
* POSTs a graph to `/tas/graph/store` and returns the store result including
|
|
76677
|
+
* any failed vertices or edges.
|
|
76678
|
+
*
|
|
76679
|
+
* @remarks The request is validated against {@link TasStoreGraphInputSchema}.
|
|
76680
|
+
* If the response fails schema validation, a warning is logged but the raw
|
|
76681
|
+
* API response is still returned.
|
|
76682
|
+
*
|
|
76683
|
+
* @throws ZodError if the request fails schema validation.
|
|
76684
|
+
*/
|
|
76685
|
+
async storeGraph(input) {
|
|
76686
|
+
TasStoreGraphInputSchema.parse(input);
|
|
76687
|
+
const raw = await this.dxSaasService.tenantPost('tas/graph/store', input);
|
|
76688
|
+
const result = TasStoreGraphResponseSchema.safeParse(raw);
|
|
76689
|
+
if (!result.success) {
|
|
76690
|
+
this.log.warn('TasStoreGraphResponse validation warning:', result.error.message);
|
|
76691
|
+
}
|
|
76692
|
+
return raw;
|
|
76693
|
+
}
|
|
76486
76694
|
/**
|
|
76487
76695
|
* POSTs a TAS graph query to `/tas/graph/query` and returns the resulting
|
|
76488
76696
|
* graph (vertices, edges, states).
|
|
@@ -76966,6 +77174,50 @@ class DataStoreTokensService {
|
|
|
76966
77174
|
}
|
|
76967
77175
|
}
|
|
76968
77176
|
|
|
77177
|
+
/**
|
|
77178
|
+
* Service for storing metric data points in the DX SaaS DataStore NASS API
|
|
77179
|
+
* (`POST /nass/metricValue/store`).
|
|
77180
|
+
*
|
|
77181
|
+
* Metrics must be registered first via
|
|
77182
|
+
* {@link DataStoreMetricsMetadataService.registerMetric} before values can be
|
|
77183
|
+
* stored. Use the metric's `id` from the registration response as the first
|
|
77184
|
+
* element of each {@link NassDatapoint} tuple.
|
|
77185
|
+
*
|
|
77186
|
+
* Three datapoint variants are supported — see {@link NassDatapoint}:
|
|
77187
|
+
* - **Regular** numeric: `[id, time, min, max, value, count, interval?]`
|
|
77188
|
+
* - **String** metric: same shape but `min` and `max` must be `null`
|
|
77189
|
+
* - **Extension**: `[id, extensionId, time, interval, ...values]`
|
|
77190
|
+
*
|
|
77191
|
+
* @example
|
|
77192
|
+
* ```ts
|
|
77193
|
+
* const service = new DataStoreNASSService(dxSaasService, log);
|
|
77194
|
+
* const response = await service.storeMetricValues([
|
|
77195
|
+
* ['metricId', Date.now() / 1000, 0, 100, 42, 1, 15],
|
|
77196
|
+
* ['strMetricId', Date.now() / 1000, null, null, 'running', 1, 15],
|
|
77197
|
+
* ]);
|
|
77198
|
+
* // response.metricForwardFailures — count of failed forwarding (only present if > 0)
|
|
77199
|
+
* ```
|
|
77200
|
+
*/
|
|
77201
|
+
class DataStoreNASSService {
|
|
77202
|
+
dxSaasService;
|
|
77203
|
+
log;
|
|
77204
|
+
constructor(dxSaasService, log) {
|
|
77205
|
+
this.dxSaasService = dxSaasService;
|
|
77206
|
+
this.log = log;
|
|
77207
|
+
}
|
|
77208
|
+
/**
|
|
77209
|
+
* POSTs one or more metric datapoints to `/nass/metricValue/store`.
|
|
77210
|
+
*
|
|
77211
|
+
* @param values - Array of {@link NassDatapoint} tuples. Each tuple must
|
|
77212
|
+
* begin with a registered metric ID obtained from
|
|
77213
|
+
* {@link DataStoreMetricsMetadataService.registerMetric}.
|
|
77214
|
+
*/
|
|
77215
|
+
async storeMetricValues(values) {
|
|
77216
|
+
const body = { values };
|
|
77217
|
+
return this.dxSaasService.tenantPost('nass/metricValue/store', body);
|
|
77218
|
+
}
|
|
77219
|
+
}
|
|
77220
|
+
|
|
76969
77221
|
var NullSimpleLog = Logging.NullSimpleLog;
|
|
76970
77222
|
/**
|
|
76971
77223
|
* Creates and returns a container of all DX client services (ACC, alerts, alarms,
|
|
@@ -76997,6 +77249,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
|
|
|
76997
77249
|
dxChannelService: new ChannelService(dxSaaSService),
|
|
76998
77250
|
dxDashboardService: new DashboardService(dxSaaSService),
|
|
76999
77251
|
dxDataStoreMetricsMetadataService: new DataStoreMetricsMetadataService(dxSaaSService, log),
|
|
77252
|
+
dxDataStoreNASSService: new DataStoreNASSService(dxSaaSService, log),
|
|
77000
77253
|
dxDataStoreNASSQLService: new DataStoreNASSQLService(dxSaaSService, log),
|
|
77001
77254
|
dxDataStoreTASService: new DataStoreTASService(dxSaaSService, log),
|
|
77002
77255
|
dxEventService: new EventService(dxSaaSService, log),
|
|
@@ -77069,6 +77322,7 @@ exports.DataStoreBlobStorageService = DataStoreBlobStorageService;
|
|
|
77069
77322
|
exports.DataStoreFeaturesService = DataStoreFeaturesService;
|
|
77070
77323
|
exports.DataStoreMetricsMetadataService = DataStoreMetricsMetadataService;
|
|
77071
77324
|
exports.DataStoreNASSQLService = DataStoreNASSQLService;
|
|
77325
|
+
exports.DataStoreNASSService = DataStoreNASSService;
|
|
77072
77326
|
exports.DataStoreStatesService = DataStoreStatesService;
|
|
77073
77327
|
exports.DataStoreTASService = DataStoreTASService;
|
|
77074
77328
|
exports.DataStoreTokensService = DataStoreTokensService;
|
|
@@ -77103,6 +77357,10 @@ exports.MetricAttributeSchema = MetricAttributeSchema;
|
|
|
77103
77357
|
exports.MetricBatchService = MetricBatchService;
|
|
77104
77358
|
exports.MetricFolderSchema = MetricFolderSchema;
|
|
77105
77359
|
exports.MetricGroupingService = MetricGroupingService;
|
|
77360
|
+
exports.MetricRegisterRequestSchema = MetricRegisterRequestSchema;
|
|
77361
|
+
exports.MetricRegisterResponseSchema = MetricRegisterResponseSchema;
|
|
77362
|
+
exports.MetricRegisterSchema = MetricRegisterSchema;
|
|
77363
|
+
exports.MetricRegisterSourceSchema = MetricRegisterSourceSchema;
|
|
77106
77364
|
exports.MetricTypeEnumNameSchema = MetricTypeEnumNameSchema;
|
|
77107
77365
|
exports.NASSService = NASSService;
|
|
77108
77366
|
exports.NassValueTypeSchema = NassValueTypeSchema;
|
|
@@ -77203,6 +77461,9 @@ exports.TasProjectionFilterSchema = TasProjectionFilterSchema;
|
|
|
77203
77461
|
exports.TasQuerySchema = TasQuerySchema;
|
|
77204
77462
|
exports.TasServiceFilterSchema = TasServiceFilterSchema;
|
|
77205
77463
|
exports.TasStatusFilterSchema = TasStatusFilterSchema;
|
|
77464
|
+
exports.TasStoreChangeSchema = TasStoreChangeSchema;
|
|
77465
|
+
exports.TasStoreGraphInputSchema = TasStoreGraphInputSchema;
|
|
77466
|
+
exports.TasStoreGraphResponseSchema = TasStoreGraphResponseSchema;
|
|
77206
77467
|
exports.TasTakeEdgesFilterSchema = TasTakeEdgesFilterSchema;
|
|
77207
77468
|
exports.TasTakeFlowsFilterSchema = TasTakeFlowsFilterSchema;
|
|
77208
77469
|
exports.TasTakeVerticesFilterSchema = TasTakeVerticesFilterSchema;
|