@dx-do/client 6.2.2 → 6.3.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.esm.js CHANGED
@@ -45973,6 +45973,226 @@ var OIAlarm;
45973
45973
  };
45974
45974
  })(OIAlarm || (OIAlarm = {}));
45975
45975
 
45976
+ /**
45977
+ * The `service export` / `service export-hierarchy` file format and the
45978
+ * `service import` boundary validator.
45979
+ *
45980
+ * The envelope wraps a re-postable store body ({@link CreateServices.CreateServiceBody})
45981
+ * with provenance metadata. `import` accepts either the envelope or a bare body.
45982
+ */
45983
+ var ServiceExport;
45984
+ (function (ServiceExport) {
45985
+ ServiceExport.SCHEMA_VERSION = 1;
45986
+ // Structural guard for a store body — does not re-validate every field
45987
+ // (the server is the authority); just enough to reject obviously-wrong files.
45988
+ const BodyShape = z.looseObject({
45989
+ vertices: z.array(z.looseObject({ attributes: z.looseObject({ name: z.string() }) })),
45990
+ edges: z.array(z.looseObject({
45991
+ sourceExternalId: z.string(),
45992
+ targetExternalId: z.string(),
45993
+ })),
45994
+ });
45995
+ const EnvelopeShape = z.looseObject({
45996
+ schemaVersion: z.literal(1),
45997
+ kind: z.enum(['service', 'service-hierarchy']),
45998
+ sourceTenant: z.string().optional(),
45999
+ exportedAt: z.string(),
46000
+ body: BodyShape,
46001
+ });
46002
+ /** Wrap a store body in an export envelope. */
46003
+ function envelope(kind, body, sourceTenant, exportedAt) {
46004
+ return { schemaVersion: ServiceExport.SCHEMA_VERSION, kind, sourceTenant, exportedAt, body };
46005
+ }
46006
+ ServiceExport.envelope = envelope;
46007
+ /**
46008
+ * Validate an import file (already JSON-parsed) and return the store body.
46009
+ * Accepts a full export envelope or a bare `{ vertices, edges }` body.
46010
+ * @throws Error when the input is neither shape.
46011
+ */
46012
+ function parseImport(raw) {
46013
+ const asEnvelope = EnvelopeShape.safeParse(raw);
46014
+ if (asEnvelope.success) {
46015
+ return asEnvelope.data.body;
46016
+ }
46017
+ const asBody = BodyShape.safeParse(raw);
46018
+ if (asBody.success) {
46019
+ return raw;
46020
+ }
46021
+ throw new Error('Import file is neither a service export envelope nor a bare {vertices, edges} body. ' +
46022
+ `Envelope error: ${asEnvelope.error.message}`);
46023
+ }
46024
+ ServiceExport.parseImport = parseImport;
46025
+ })(ServiceExport || (ServiceExport = {}));
46026
+
46027
+ /**
46028
+ * Pure (HTTP-free) transforms between the Service read shapes and the store
46029
+ * (`/oi/v2/sa/save`) body. Kept separate from {@link ServiceService} so the
46030
+ * edge/weight logic — the part with real correctness risk — is unit-testable.
46031
+ *
46032
+ * Empirical constraints these helpers encode (see plan Phase 0):
46033
+ * - A parent's direct-child health/risk weights must each total ≤ 1.0 (server rejects otherwise).
46034
+ * - `replace=true` makes each saved vertex's outgoing-edge set authoritative, so a
46035
+ * faithful re-save must carry the whole subtree's vertices + edges.
46036
+ */
46037
+ var ServiceTransform;
46038
+ (function (ServiceTransform) {
46039
+ /**
46040
+ * Convert a retrieved (read) service vertex into a re-postable store vertex.
46041
+ *
46042
+ * @remarks externalId is keyed by the service **name**, not the server
46043
+ * `SA:<uuid>` id. The store API treats `externalId` as a payload-local handle
46044
+ * and resolves/creates services by `attributes.name`; keying edges by `SA:uuid`
46045
+ * makes the server silently drop them (so a `replace` save wipes the existing
46046
+ * edges and re-adds nothing). Names are tenant-unique, so this is unambiguous
46047
+ * and also makes exports portable across tenants.
46048
+ */
46049
+ function retrievedToServiceVertex(v) {
46050
+ const a = v.attributes;
46051
+ return {
46052
+ externalId: a.name,
46053
+ attributes: {
46054
+ type: 'saService',
46055
+ name: a.name,
46056
+ state: 'ACTIVE',
46057
+ maintenance: a.maintenance ?? false,
46058
+ situationsIncludeChildServices: a.situationsIncludeChildServices ?? false,
46059
+ serviceContent: a.serviceContent ?? [],
46060
+ root_service: null,
46061
+ tags: a.tags ?? [],
46062
+ location: a.location ?? '',
46063
+ description: a.description ?? '',
46064
+ customProperties: a.customProperties ?? [],
46065
+ customMetrics: a.customMetrics ?? [],
46066
+ metrics: a.metrics ?? [],
46067
+ },
46068
+ };
46069
+ }
46070
+ ServiceTransform.retrievedToServiceVertex = retrievedToServiceVertex;
46071
+ /**
46072
+ * Build NAME-keyed store edges from a topology graph, preserving weights +
46073
+ * semantic. Endpoints are mapped from `SA:<uuid>` to service name via the
46074
+ * graph's vertices; edges whose endpoints aren't in `topo.vertices` are
46075
+ * dropped — this is exactly the incoming edge(s) from the root's parent, which
46076
+ * `saTopologyGraph` returns without the parent vertex (and which must not be
46077
+ * re-posted: the parent isn't re-saved, so its edge survives anyway).
46078
+ */
46079
+ function edgesFromTopology(topo) {
46080
+ const idToName = new Map(topo.vertices.map((v) => [v.externalId, v.attributes.name]));
46081
+ return topo.edges
46082
+ .map((e) => ({
46083
+ s: idToName.get(e.sourceExternalId),
46084
+ t: idToName.get(e.targetExternalId),
46085
+ e,
46086
+ }))
46087
+ .filter((x) => x.s !== undefined && x.t !== undefined)
46088
+ .map((x) => ({
46089
+ sourceExternalId: x.s,
46090
+ targetExternalId: x.t,
46091
+ attributes: {
46092
+ health_weight: x.e.attributes?.health_weight ?? 1,
46093
+ risk_weight: x.e.attributes?.risk_weight ?? 1,
46094
+ semantic: 'AggregateOf',
46095
+ },
46096
+ }));
46097
+ }
46098
+ ServiceTransform.edgesFromTopology = edgesFromTopology;
46099
+ /** Merge two store bodies, de-duplicating vertices by externalId and edges by endpoints. */
46100
+ function mergeBodies(a, b) {
46101
+ const vertices = [];
46102
+ const seenV = new Set();
46103
+ for (const v of [...a.vertices, ...b.vertices]) {
46104
+ const key = v.externalId ?? v.attributes.name;
46105
+ if (!seenV.has(key)) {
46106
+ seenV.add(key);
46107
+ vertices.push(v);
46108
+ }
46109
+ }
46110
+ const edges = [];
46111
+ const seenE = new Set();
46112
+ for (const e of [...a.edges, ...b.edges]) {
46113
+ const key = `${e.sourceExternalId}|${e.targetExternalId}`;
46114
+ if (!seenE.has(key)) {
46115
+ seenE.add(key);
46116
+ edges.push(e);
46117
+ }
46118
+ }
46119
+ return { vertices, edges };
46120
+ }
46121
+ ServiceTransform.mergeBodies = mergeBodies;
46122
+ /** Insert or update the parent→child edge with the given weights. */
46123
+ function upsertEdge(edges, source, target, healthWeight, riskWeight) {
46124
+ const next = edges.filter((e) => !(e.sourceExternalId === source && e.targetExternalId === target));
46125
+ next.push({
46126
+ sourceExternalId: source,
46127
+ targetExternalId: target,
46128
+ attributes: {
46129
+ health_weight: healthWeight,
46130
+ risk_weight: riskWeight,
46131
+ semantic: 'AggregateOf',
46132
+ },
46133
+ });
46134
+ return next;
46135
+ }
46136
+ ServiceTransform.upsertEdge = upsertEdge;
46137
+ /** Remove the parent→child edge. */
46138
+ function removeEdge(edges, source, target) {
46139
+ return edges.filter((e) => !(e.sourceExternalId === source && e.targetExternalId === target));
46140
+ }
46141
+ ServiceTransform.removeEdge = removeEdge;
46142
+ /** Edges whose source is the given parent (its direct-child associations). */
46143
+ function childEdges(edges, parent) {
46144
+ return edges.filter((e) => e.sourceExternalId === parent);
46145
+ }
46146
+ ServiceTransform.childEdges = childEdges;
46147
+ /**
46148
+ * Keep only edges whose BOTH endpoints are in the given vertex-id set.
46149
+ *
46150
+ * `saTopologyGraph(root)` returns the root's subtree plus the *incoming* edge(s)
46151
+ * from the root's parent(s) — but not the parent vertices. Re-posting such a
46152
+ * dangling edge is rejected ("vertex referenced by edge is not present in the
46153
+ * input graph"). Dropping it is also correct: the parent is not re-saved, so its
46154
+ * edge to the root is preserved server-side (replace is destructive only per
46155
+ * saved vertex).
46156
+ */
46157
+ function filterEdgesToVertices(edges, vertexIds) {
46158
+ return edges.filter((e) => vertexIds.has(e.sourceExternalId) && vertexIds.has(e.targetExternalId));
46159
+ }
46160
+ ServiceTransform.filterEdgesToVertices = filterEdgesToVertices;
46161
+ /**
46162
+ * Evenly distribute a parent's direct-child weights so each total is ≤ 1.0.
46163
+ * Uses floored thirds (e.g. 3 children → 0.333 each, sum 0.999) to avoid
46164
+ * float drift pushing the total over 100%.
46165
+ */
46166
+ function rebalanceChildren(edges, parent) {
46167
+ const kids = childEdges(edges, parent);
46168
+ if (kids.length === 0)
46169
+ return edges;
46170
+ const w = Math.floor((1 / kids.length) * 1000) / 1000;
46171
+ return edges.map((e) => e.sourceExternalId === parent
46172
+ ? {
46173
+ ...e,
46174
+ attributes: {
46175
+ health_weight: w,
46176
+ risk_weight: w,
46177
+ semantic: 'AggregateOf',
46178
+ },
46179
+ }
46180
+ : e);
46181
+ }
46182
+ ServiceTransform.rebalanceChildren = rebalanceChildren;
46183
+ /** Throw if a parent's direct-child weights exceed 100% (the server's hard limit). */
46184
+ function assertWeightsWithinLimit(edges, parent) {
46185
+ const kids = childEdges(edges, parent);
46186
+ const health = kids.reduce((s, e) => s + (e.attributes?.health_weight ?? 0), 0);
46187
+ const risk = kids.reduce((s, e) => s + (e.attributes?.risk_weight ?? 0), 0);
46188
+ const eps = 1e-6;
46189
+ if (health > 1 + eps || risk > 1 + eps) {
46190
+ throw new Error(`Weight total for parent exceeds 100% (health=${health.toFixed(3)}, risk=${risk.toFixed(3)}). Lower the weights or omit them to auto-distribute evenly.`);
46191
+ }
46192
+ }
46193
+ ServiceTransform.assertWeightsWithinLimit = assertWeightsWithinLimit;
46194
+ })(ServiceTransform || (ServiceTransform = {}));
46195
+
45976
46196
  var OIService;
45977
46197
  (function (OIService) {
45978
46198
  /** @internal */
@@ -73699,6 +73919,18 @@ function detectIPv4() {
73699
73919
  }
73700
73920
  return '127.0.0.1';
73701
73921
  }
73922
+ /**
73923
+ * Coalesce a missing *or empty* value to a fallback.
73924
+ *
73925
+ * `??` only catches `null`/`undefined`, but an explicit `""` is a valid string
73926
+ * that would flow straight through. That breaks `temp_fields`: a blank component
73927
+ * collapses one of its space-separated slots, shifting every later field's
73928
+ * position when the SaaS Kafka consumer parses `agentbase_msg`. Treat `""`
73929
+ * exactly like an omitted value.
73930
+ */
73931
+ function orDefault(value, fallback) {
73932
+ return value ? value : fallback;
73933
+ }
73702
73934
  /**
73703
73935
  * Service for querying and ingesting log analytics data.
73704
73936
  */
@@ -73727,14 +73959,17 @@ class LogsService {
73727
73959
  LogIngest.LogIngestOptionsSchema.parse(options);
73728
73960
  const cohortId = this.dxSaasService.dxdoConfiguration.dxConfiguration.cohortId;
73729
73961
  const tenantIdUpper = cohortId.toUpperCase();
73730
- const logtype = options.logtype ?? 'generic';
73731
- const host = options.host ?? hostname();
73732
- const ip = options.ip ?? detectIPv4();
73733
- const agentInstance = options.agentInstance ?? 'dx-do';
73734
- const agentName = options.agentName ?? 'Logs Collector';
73735
- const containerId = options.containerId ?? host;
73736
- const containerName = options.containerName ?? agentInstance;
73737
- const file = options.file ?? 'dx-do.cli';
73962
+ // `orDefault` (not `??`) so an explicit empty string is treated as omitted —
73963
+ // a blank value in any temp_fields component shifts every downstream
73964
+ // positional field. See the temp_fields comment below.
73965
+ const logtype = orDefault(options.logtype, 'generic');
73966
+ const host = orDefault(options.host, hostname());
73967
+ const ip = orDefault(options.ip, detectIPv4());
73968
+ const agentInstance = orDefault(options.agentInstance, 'dx-do');
73969
+ const agentName = orDefault(options.agentName, 'Logs Collector');
73970
+ const containerId = orDefault(options.containerId, host);
73971
+ const containerName = orDefault(options.containerName, agentInstance);
73972
+ const file = orDefault(options.file, 'dx-do.cli');
73738
73973
  const tag = `${logtype} logs`;
73739
73974
  // temp_fields must have exactly 9 space-separated components before the message
73740
73975
  // is appended by the SaaS filter (agentbase_msg = temp_fields + " " + message).
@@ -75405,19 +75640,90 @@ class ServiceService {
75405
75640
  };
75406
75641
  return this.dxSaaSService.oiPost('oi/v2/sa/serviceDetails', serviceDetailRequest);
75407
75642
  }
75643
+ /**
75644
+ * Retrieve a Service — the full read-endpoint envelope (vertices + edges +
75645
+ * paging metadata). Backs the `service detail` and `service export` commands.
75646
+ *
75647
+ * @param serviceName - Service name (URL path segment).
75648
+ * @param subservices - When true, include the service's subservices in the response.
75649
+ */
75650
+ async getService(serviceName, subservices = false) {
75651
+ return this.dxSaaSService.oiGet(`oi/v2/sa/services/${serviceName}`, { subservices });
75652
+ }
75653
+ /**
75654
+ * Returns the full reachable subtree (all descendants + association edges with
75655
+ * weights) for a service via `oi/v2/sa/saTopologyGraph`. Backs the hierarchy
75656
+ * read used by `export-hierarchy`/`associate`/`dissociate`.
75657
+ *
75658
+ * @remarks The documented `oi/v2/sa/service/details/hierarchy` path is not
75659
+ * routable on the tenant gateway; this topology endpoint is the working one.
75660
+ * Its vertex attributes are a subset — use {@link getService} per vertex when
75661
+ * faithful re-save attributes (tags, customProperties, metrics) are needed.
75662
+ */
75663
+ async getServiceTopology(serviceName) {
75664
+ return this.dxSaaSService.oiPost('oi/v2/sa/saTopologyGraph', { serviceName, startTime: Date.now(), endTime: Date.now() });
75665
+ }
75666
+ /**
75667
+ * Builds a faithful, re-postable store body for a service's entire subtree:
75668
+ * topology for structure + a per-vertex {@link getService} for full attributes
75669
+ * (serviceContent, tags, customProperties, metrics). Shared by
75670
+ * `export-hierarchy`, `associate`, and `dissociate`.
75671
+ *
75672
+ * @remarks One GET per vertex — fine for typical (small) hierarchies; reads
75673
+ * are not throttled like saves.
75674
+ */
75675
+ async buildHierarchyBody(rootName) {
75676
+ const topo = await this.getServiceTopology(rootName);
75677
+ const names = new Set([rootName]);
75678
+ topo.vertices.forEach((v) => names.add(v.attributes.name));
75679
+ const vertices = [];
75680
+ const seen = new Set();
75681
+ for (const name of names) {
75682
+ const full = await this.getService(name, false);
75683
+ const fv = full.vertices[0];
75684
+ if (fv && !seen.has(fv.externalId)) {
75685
+ seen.add(fv.externalId);
75686
+ vertices.push(ServiceTransform.retrievedToServiceVertex(fv));
75687
+ }
75688
+ }
75689
+ // Drop edges that reference vertices outside this subtree (e.g. the incoming
75690
+ // edge from the root's parent, which saTopologyGraph returns without the
75691
+ // parent vertex). Re-posting such a dangling edge is rejected by the server.
75692
+ const presentIds = new Set(vertices
75693
+ .map((v) => v.externalId)
75694
+ .filter((id) => id !== undefined));
75695
+ const edges = ServiceTransform.filterEdgesToVertices(ServiceTransform.edgesFromTopology(topo), presentIds);
75696
+ return { vertices, edges };
75697
+ }
75698
+ /** Builds a single-service store body (no edges) for `service export`. */
75699
+ async exportServiceBody(serviceName) {
75700
+ const r = await this.getService(serviceName, false);
75701
+ if (!r.vertices.length) {
75702
+ throw new Error(`No service with name '${serviceName}' found`);
75703
+ }
75704
+ return {
75705
+ vertices: [ServiceTransform.retrievedToServiceVertex(r.vertices[0])],
75706
+ edges: [],
75707
+ };
75708
+ }
75709
+ /**
75710
+ * Resolves a service's server externalId (`SA:<cohort>:<uuid>`).
75711
+ * @throws Error if the service does not exist.
75712
+ */
75713
+ async getServiceExternalId(serviceName) {
75714
+ const r = await this.getService(serviceName, false);
75715
+ const id = r.vertices[0]?.externalId;
75716
+ if (!id)
75717
+ throw new Error(`No service with name '${serviceName}' found`);
75718
+ return id;
75719
+ }
75408
75720
  /** Returns the overview vertex for a named service; throws if not found. */
75409
75721
  async getServiceOverview(serviceName) {
75410
- return this.dxSaaSService
75411
- .oiGet(`oi/v2/sa/services/${serviceName}`, {
75412
- subservices: false,
75413
- })
75414
- .then((graph) => {
75415
- if (graph.vertices.length == 1) {
75416
- return graph.vertices[0];
75417
- }
75418
- else
75419
- throw new Error(`No Service with name '${serviceName}' Found`);
75420
- });
75722
+ const response = await this.getService(serviceName, false);
75723
+ if (response.vertices.length === 1) {
75724
+ return response.vertices[0];
75725
+ }
75726
+ throw new Error(`No Service with name '${serviceName}' Found`);
75421
75727
  }
75422
75728
  /** Returns paginated top-level (grouped) services up to `maxRequests` pages. */
75423
75729
  async getTopLevelServices(pageSize = 100, maxRequests = 20) {
@@ -75507,12 +75813,109 @@ class ServiceService {
75507
75813
  sirb.customFilter.and.expressions[0].or.expressions[0].value = serviceName;
75508
75814
  return sirb;
75509
75815
  }
75510
- /** Creates a new service from the given body; replaces any existing service with the same name. */
75511
- async createService(createServiceBody) {
75512
- return this.dxSaaSService.tenantPost('/oi/v2/sa/save', createServiceBody, {
75816
+ /**
75817
+ * Creates/updates one or more services via the store API (`/oi/v2/sa/save`).
75818
+ *
75819
+ * @remarks Edges not present in the payload are removed for the services it
75820
+ * covers — the store API treats the supplied edge set as authoritative.
75821
+ * @param createServiceBody - vertices + edges to store.
75822
+ * @param opts.replace - When true (default), replaces an existing service of the
75823
+ * same name rather than erroring.
75824
+ * @param opts.autoWeight - When true, the server computes edge health/risk weights,
75825
+ * overriding any weights supplied in the payload. Omitted by default.
75826
+ */
75827
+ async createService(createServiceBody, opts = {}) {
75828
+ const params = { replace: opts.replace ?? true };
75829
+ if (opts.autoWeight !== undefined) {
75830
+ params['auto_weight'] = opts.autoWeight;
75831
+ }
75832
+ return this.dxSaaSService.tenantPost('/oi/v2/sa/save', createServiceBody, params);
75833
+ }
75834
+ /**
75835
+ * Builds the store body for associating `childName` under `parentName` as a
75836
+ * new `AggregateOf` child, WITHOUT saving (so callers can dry-run it).
75837
+ *
75838
+ * Because `replace=true` makes each saved vertex's edge set authoritative, the
75839
+ * body carries both services' full subtrees. Weights: explicit
75840
+ * `healthWeight`/`riskWeight` are applied to the new edge and validated against
75841
+ * the ≤100% limit; otherwise the parent's direct children are evenly rebalanced.
75842
+ */
75843
+ async buildAssociateBody(parentName, childName, opts = {}) {
75844
+ if (parentName === childName) {
75845
+ throw new Error(`A service cannot be associated with itself ('${parentName}')`);
75846
+ }
75847
+ // Validate both services exist (throws "No service with name … found").
75848
+ await this.getServiceExternalId(parentName);
75849
+ await this.getServiceExternalId(childName);
75850
+ // Bodies are keyed by service name (see ServiceTransform.retrievedToServiceVertex).
75851
+ const body = ServiceTransform.mergeBodies(await this.buildHierarchyBody(parentName), await this.buildHierarchyBody(childName));
75852
+ const explicit = opts.healthWeight !== undefined || opts.riskWeight !== undefined;
75853
+ body.edges = ServiceTransform.upsertEdge(body.edges, parentName, childName, opts.healthWeight ?? 1, opts.riskWeight ?? 1);
75854
+ if (explicit) {
75855
+ ServiceTransform.assertWeightsWithinLimit(body.edges, parentName);
75856
+ }
75857
+ else {
75858
+ body.edges = ServiceTransform.rebalanceChildren(body.edges, parentName);
75859
+ }
75860
+ return body;
75861
+ }
75862
+ /** Associates `childName` under `parentName` and saves it. See {@link buildAssociateBody}. */
75863
+ async associateServices(parentName, childName, opts = {}) {
75864
+ const body = await this.buildAssociateBody(parentName, childName, opts);
75865
+ return this.createService(body, {
75513
75866
  replace: true,
75867
+ autoWeight: opts.autoWeight,
75514
75868
  });
75515
75869
  }
75870
+ /**
75871
+ * Builds the store body for removing the `parentName`→`childName` association,
75872
+ * WITHOUT saving. The child (and its own subtree) is preserved as a now-detached
75873
+ * service.
75874
+ * @throws Error if `childName` is not a direct child of `parentName`.
75875
+ */
75876
+ async buildDissociateBody(parentName, childName) {
75877
+ // Validate both services exist (throws "No service with name … found").
75878
+ await this.getServiceExternalId(parentName);
75879
+ await this.getServiceExternalId(childName);
75880
+ const body = await this.buildHierarchyBody(parentName);
75881
+ const before = body.edges.length;
75882
+ body.edges = ServiceTransform.removeEdge(body.edges, parentName, childName);
75883
+ if (body.edges.length === before) {
75884
+ throw new Error(`'${childName}' is not a direct child of '${parentName}' — nothing to dissociate`);
75885
+ }
75886
+ return body;
75887
+ }
75888
+ /** Removes the `parentName`→`childName` association and saves it. See {@link buildDissociateBody}. */
75889
+ async dissociateServices(parentName, childName) {
75890
+ const body = await this.buildDissociateBody(parentName, childName);
75891
+ return this.createService(body, { replace: true });
75892
+ }
75893
+ /**
75894
+ * Builds the store body for updating a service's content queries, WITHOUT
75895
+ * saving. Re-saves the service's full subtree (via {@link buildHierarchyBody})
75896
+ * so its children edges are preserved — only the target vertex's
75897
+ * `serviceContent` changes.
75898
+ *
75899
+ * @param mode - 'set' replaces the content; 'add' appends to the existing content.
75900
+ * @returns the store body plus the service's previous content (for diffing).
75901
+ * @throws Error if the service does not exist.
75902
+ */
75903
+ async buildServiceContentBody(serviceName, newContent, mode) {
75904
+ const body = await this.buildHierarchyBody(serviceName);
75905
+ const target = body.vertices.find((v) => v.attributes.name === serviceName);
75906
+ if (!target) {
75907
+ throw new Error(`No service with name '${serviceName}' found`);
75908
+ }
75909
+ const previousContent = target.attributes.serviceContent;
75910
+ target.attributes.serviceContent =
75911
+ mode === 'set' ? newContent : [...previousContent, ...newContent];
75912
+ return { body, previousContent };
75913
+ }
75914
+ /** Updates a service's content queries and saves it. See {@link buildServiceContentBody}. */
75915
+ async updateServiceContent(serviceName, newContent, mode) {
75916
+ const { body } = await this.buildServiceContentBody(serviceName, newContent, mode);
75917
+ return this.createService(body, { replace: true });
75918
+ }
75516
75919
  /** Deletes a service by name; optionally deletes child services recursively. */
75517
75920
  async deleteService(serviceName, recursive = false) {
75518
75921
  return this.dxSaaSService.tenantPost('/oi/v2/sa/service/status', { name: serviceName, action: 'delete' }, { recursive });
@@ -77554,5 +77957,5 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
77554
77957
  };
77555
77958
  }
77556
77959
 
77557
- 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, BlobAllFilterSchema, BlobAsyncCommandSchema, BlobAsyncDeleteSchemaCommandSchema, BlobAsyncResultEntrySchema, BlobAsyncResultRequestSchema, BlobAsyncResultResponseSchema, BlobAsyncResultStateSchema, BlobAttributeExpressionSchema, BlobAttributeFilterSchema, BlobAttributesSchema, BlobBulkDeleteEntrySchema, BlobBulkDeleteRequestSchema, BlobBulkDeleteResponseSchema, BlobBulkItemSchema, BlobBulkStoreRequestSchema, BlobBulkStoreResponseSchema, BlobDeleteParamsSchema, BlobDeleteResponseSchema, BlobDeleteSchemaResultSchema, BlobExecuteAsyncRequestSchema, BlobExecuteAsyncResponseSchema, BlobFetchParamsSchema, BlobFileEnvelopeSchema, BlobFilterSchema, BlobMetadataSchema, BlobQueryRequestSchema, BlobQueryResponseSchema, BlobSchemaItemSchema, BlobSchemaListRequestSchema, BlobSchemaListResponseSchema, BlobService, BlobStoreParamsSchema, BlobStoreResponseSchema, 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, LogIngest, 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, NassDatapointSchema, NassExtensionDatapointSchema, NassRegularDatapointSchema, NassStoreRequestSchema, NassStoreResponseSchema, 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 };
77960
+ 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, BlobAllFilterSchema, BlobAsyncCommandSchema, BlobAsyncDeleteSchemaCommandSchema, BlobAsyncResultEntrySchema, BlobAsyncResultRequestSchema, BlobAsyncResultResponseSchema, BlobAsyncResultStateSchema, BlobAttributeExpressionSchema, BlobAttributeFilterSchema, BlobAttributesSchema, BlobBulkDeleteEntrySchema, BlobBulkDeleteRequestSchema, BlobBulkDeleteResponseSchema, BlobBulkItemSchema, BlobBulkStoreRequestSchema, BlobBulkStoreResponseSchema, BlobDeleteParamsSchema, BlobDeleteResponseSchema, BlobDeleteSchemaResultSchema, BlobExecuteAsyncRequestSchema, BlobExecuteAsyncResponseSchema, BlobFetchParamsSchema, BlobFileEnvelopeSchema, BlobFilterSchema, BlobMetadataSchema, BlobQueryRequestSchema, BlobQueryResponseSchema, BlobSchemaItemSchema, BlobSchemaListRequestSchema, BlobSchemaListResponseSchema, BlobService, BlobStoreParamsSchema, BlobStoreResponseSchema, 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, LogIngest, 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, NassDatapointSchema, NassExtensionDatapointSchema, NassRegularDatapointSchema, NassStoreRequestSchema, NassStoreResponseSchema, 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, ServiceExport, ServiceFilterSpecifierSchema, ServiceService, ServiceTransform, 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 };
77558
77961
  //# sourceMappingURL=index.esm.js.map