@dx-do/client 7.15.0 → 7.17.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.
Files changed (47) hide show
  1. package/dist/index.cjs.js +2075 -292
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +2061 -293
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/src/index.d.ts +7 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/lib/model/alarm/alarm-record.d.ts +53 -0
  8. package/dist/src/lib/model/alarm/alarm-record.d.ts.map +1 -0
  9. package/dist/src/lib/model/datastore/datastore-schemas.d.ts +2 -7
  10. package/dist/src/lib/model/datastore/datastore-schemas.d.ts.map +1 -1
  11. package/dist/src/lib/model/datastore/metrics-metadata/attribute-name-specifier.d.ts +2 -2
  12. package/dist/src/lib/model/datastore/metrics-metadata/folder-name-specifier.d.ts +2 -2
  13. package/dist/src/lib/model/datastore/metrics-metadata/source-name-specifier.d.ts +2 -2
  14. package/dist/src/lib/model/datastore/nassql/operations.d.ts.map +1 -1
  15. package/dist/src/lib/model/datastore/tas/filters.d.ts +11 -10
  16. package/dist/src/lib/model/datastore/tas/filters.d.ts.map +1 -1
  17. package/dist/src/lib/model/oi/alarms.d.ts +12 -0
  18. package/dist/src/lib/model/oi/alarms.d.ts.map +1 -1
  19. package/dist/src/lib/model/oi/services.bulk-select.d.ts +109 -0
  20. package/dist/src/lib/model/oi/services.bulk-select.d.ts.map +1 -0
  21. package/dist/src/lib/model/oi/services.bulk.d.ts +243 -0
  22. package/dist/src/lib/model/oi/services.bulk.d.ts.map +1 -0
  23. package/dist/src/lib/model/oi/services.d.ts +2 -0
  24. package/dist/src/lib/model/oi/services.d.ts.map +1 -1
  25. package/dist/src/lib/model/oi/services.export.d.ts +10 -0
  26. package/dist/src/lib/model/oi/services.export.d.ts.map +1 -1
  27. package/dist/src/lib/model/oi/services.import.d.ts +43 -0
  28. package/dist/src/lib/model/oi/services.import.d.ts.map +1 -0
  29. package/dist/src/lib/model/oi/services.transform.d.ts +10 -1
  30. package/dist/src/lib/model/oi/services.transform.d.ts.map +1 -1
  31. package/dist/src/lib/model/service/service-overview.d.ts +20 -0
  32. package/dist/src/lib/model/service/service-overview.d.ts.map +1 -1
  33. package/dist/src/lib/services/alarm-export.d.ts +85 -0
  34. package/dist/src/lib/services/alarm-export.d.ts.map +1 -0
  35. package/dist/src/lib/services/alarm-window-search.d.ts +59 -0
  36. package/dist/src/lib/services/alarm-window-search.d.ts.map +1 -0
  37. package/dist/src/lib/services/alarm.service.d.ts +57 -4
  38. package/dist/src/lib/services/alarm.service.d.ts.map +1 -1
  39. package/dist/src/lib/services/dxoi.service.d.ts +15 -3
  40. package/dist/src/lib/services/dxoi.service.d.ts.map +1 -1
  41. package/dist/src/lib/services/lifecycle-pages.d.ts +20 -0
  42. package/dist/src/lib/services/lifecycle-pages.d.ts.map +1 -0
  43. package/dist/src/lib/services/service.service.d.ts +107 -10
  44. package/dist/src/lib/services/service.service.d.ts.map +1 -1
  45. package/dist/src/lib/services/situation.service.d.ts +9 -2
  46. package/dist/src/lib/services/situation.service.d.ts.map +1 -1
  47. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -2071,6 +2071,65 @@ function buildAlarmFilterUpdateBody(existing, patch) {
2071
2071
  return { body, changes };
2072
2072
  }
2073
2073
 
2074
+ /**
2075
+ * One alarm as stored in the alarms analytics index
2076
+ * (`GET oi/v2/aoanalytics/alarms/alarms_all/_search`): one record per alarm,
2077
+ * updated in place. Times are ISO strings with a `+0000` offset, whole seconds.
2078
+ * Fields vary by source product; the declared ones were present on every
2079
+ * sampled record unless marked optional (demo-dev, 2026-10-22).
2080
+ */
2081
+ const AlarmRecordSchema = z.looseObject({
2082
+ alarm_unique_id: z
2083
+ .string()
2084
+ .describe('The alarm id; the same value the alarm search returns as `alarmId`'),
2085
+ status: z.string().describe('Current status: NEW, UPDATED or CLOSED'),
2086
+ severity: z.string().optional().describe('Current severity, as the source sent it'),
2087
+ startTime: z
2088
+ .string()
2089
+ .describe('When the alarm opened (the search\'s `timeOrigin`), ISO `+0000`'),
2090
+ closedTime: z
2091
+ .string()
2092
+ .optional()
2093
+ .describe('When the alarm closed, ISO `+0000`; present exactly when status is CLOSED'),
2094
+ timestamp: z
2095
+ .string()
2096
+ .optional()
2097
+ .describe('Time of the last document the source sent for this alarm (last update), ISO `+0000` — not the open time'),
2098
+ product: z.string().optional().describe('Source product that raised the alarm'),
2099
+ host: z.string().optional().describe('Host the alarm is about'),
2100
+ alarmType: z.string().optional().describe('Alarm type'),
2101
+ message: z.string().optional().describe('Current alarm message'),
2102
+ external_ids: z
2103
+ .array(z.string())
2104
+ .nullable()
2105
+ .optional()
2106
+ .describe('TAS external ids of the entities the alarm is about; null on some records (demo-dev: 4828 of 72747)'),
2107
+ services_impacted: z
2108
+ .array(z.string())
2109
+ .optional()
2110
+ .describe('Names of the services the alarm impacts (from enrichment)'),
2111
+ '@timestamp': z.number().optional().describe('When the record was last indexed, epoch ms'),
2112
+ });
2113
+ /** The analytics search response: Elasticsearch-shaped hits. */
2114
+ const AlarmRecordSearchResponseSchema = z.looseObject({
2115
+ hits: z.looseObject({
2116
+ total: z
2117
+ .looseObject({
2118
+ value: z.number().describe('Number of matching records'),
2119
+ relation: z
2120
+ .string()
2121
+ .describe('`eq` when `value` is exact, `gte` when it is a lower bound (more than 10000)'),
2122
+ })
2123
+ .describe('Match count for the query'),
2124
+ hits: z
2125
+ .array(z.looseObject({
2126
+ _id: z.string().optional().describe('Index id: tenant id + alarm id'),
2127
+ _source: AlarmRecordSchema,
2128
+ }))
2129
+ .describe('The requested page of records'),
2130
+ }),
2131
+ });
2132
+
2074
2133
  var AlertDefinitionResponse;
2075
2134
  (function (AlertDefinitionResponse) {
2076
2135
  (function (AlertComparisonOperator) {
@@ -20394,6 +20453,15 @@ RedirectableRequest.prototype._sanitizeOptions = function (options) {
20394
20453
  if (!options.headers) {
20395
20454
  options.headers = {};
20396
20455
  }
20456
+ // Convert [header1, value1, header2, value2, …] to object
20457
+ else if (Array.isArray(options.headers)) {
20458
+ var headerList = options.headers;
20459
+ options.headers = {};
20460
+ for (var i = 0; i < headerList.length; i += 2) {
20461
+ options.headers[headerList[i]] = headerList[i + 1];
20462
+ }
20463
+ }
20464
+ // Ensure sensitive headers are always present
20397
20465
  if (!isArray$3(options.sensitiveHeaders)) {
20398
20466
  options.sensitiveHeaders = [];
20399
20467
  }
@@ -20793,7 +20861,7 @@ function isURL(value) {
20793
20861
  }
20794
20862
 
20795
20863
  function escapeRegex(regex) {
20796
- return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
20864
+ return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
20797
20865
  }
20798
20866
 
20799
20867
  // Exports
@@ -48393,6 +48461,21 @@ factory(name$9, ['typed', 'equalScalar'], _ref2 => {
48393
48461
  });
48394
48462
  });
48395
48463
 
48464
+ function cyrb53(str, seed = 0) {
48465
+ let h1 = 0xdeadbeef ^ seed;
48466
+ let h2 = 0x41c6ce57 ^ seed;
48467
+ for (let i = 0, ch; i < str.length; i++) {
48468
+ ch = str.charCodeAt(i);
48469
+ h1 = Math.imul(h1 ^ ch, 2654435761);
48470
+ h2 = Math.imul(h2 ^ ch, 1597334677);
48471
+ }
48472
+ h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);
48473
+ h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);
48474
+ h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);
48475
+ h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);
48476
+ return 4294967296 * (2097151 & h2) + (h1 >>> 0);
48477
+ }
48478
+
48396
48479
  var Interpolation;
48397
48480
  (function (Interpolation) {
48398
48481
  function splitWithEscape(text, delimiter, escapeChar) {
@@ -48708,6 +48791,10 @@ const SENSITIVE_KEYS = new Set([
48708
48791
  'revoketoken',
48709
48792
  'password',
48710
48793
  'apikey',
48794
+ // Legacy (pre-v3) dx-do profile secrets.
48795
+ 'dashboardapikey',
48796
+ 'camanagementcookie',
48797
+ 'oiuserkey',
48711
48798
  'x-api-key',
48712
48799
  // Notification-channel write bodies (webhook auth, ServiceNow OAuth).
48713
48800
  'tokenvalue',
@@ -49378,6 +49465,7 @@ const AttributeExpressionSchema = z.looseObject({
49378
49465
  operator: AttributeExpressionOperatorSchema.optional().describe('Comparison operator; defaults to IN'),
49379
49466
  layer: z
49380
49467
  .string()
49468
+ .nullable()
49381
49469
  .optional()
49382
49470
  .describe('Restrict the expression to attributes on a specific layer (overlays the filter-level layer if both set)'),
49383
49471
  comparator: AttributeExpressionComparatorSchema.optional().describe('Value-parsing mode for ordered comparisons; only consulted by GE/GT/LE/LT'),
@@ -49421,7 +49509,7 @@ const TraversalVertexFilterSchema = z.looseObject({
49421
49509
  op: z.string().optional().describe('Op discriminator (ALL/NONE/AND/OR/NOT/ATTRIBUTE/LAYER/VERTEX)'),
49422
49510
  input: z.lazy(() => z.array(TraversalVertexFilterSchema)).optional(),
49423
49511
  expressions: z.array(AttributeExpressionSchema).optional(),
49424
- layer: z.string().optional(),
49512
+ layer: z.string().nullable().optional(),
49425
49513
  values: z.array(z.string()).optional(),
49426
49514
  vertexId: z.array(z.number()).optional(),
49427
49515
  });
@@ -49659,6 +49747,7 @@ const TasAttributeFilterSchema = z.looseObject({
49659
49747
  .describe('Attribute expressions; all must match (AND)'),
49660
49748
  layer: z
49661
49749
  .string()
49750
+ .nullable()
49662
49751
  .optional()
49663
49752
  .describe('Restrict to attributes on a single layer (overlays per-expression layer)'),
49664
49753
  mode: TasAttributeFilterModeSchema.optional().describe('How vertex/edge matching propagates; defaults to VERTEX_AND_RELATED_EDGES'),
@@ -49713,17 +49802,22 @@ const TasVertexIdFilterSchema = z.looseObject({
49713
49802
  * hierarchy as defined in the Service Definition).
49714
49803
  *
49715
49804
  * Toggle `excludeSubServices=true` for an exact-service-only match;
49716
- * `includeServiceHierarchy=true` includes higher-level service ancestors
49717
- * in addition to descendants.
49805
+ * `includeServiceHierarchy=true` adds the `saService` vertices themselves
49806
+ * (the named services and, unless excluded, their sub-services) to the
49807
+ * member entities. It does not add ancestors (measured 2026-10-21).
49718
49808
  */
49719
49809
  const TasServiceFilterSchema = z.looseObject({
49720
49810
  op: z.literal('SERVICE'),
49721
49811
  input: TasFilterLazy.optional().describe('Optional input filter; defaults to ALL'),
49722
- values: z.array(z.string()).optional().describe('Service names to match'),
49812
+ values: z
49813
+ .array(z.string())
49814
+ .optional()
49815
+ .describe('Service names to match; required by the server (missing or empty is a 400), and no wildcard'),
49723
49816
  includeServiceHierarchy: z
49724
49817
  .boolean()
49725
49818
  .optional()
49726
- .describe('Include the entire service hierarchy (ancestors); defaults to false'),
49819
+ .describe('Also return the saService vertices of the matched services (named + sub-services, never ancestors); ' +
49820
+ 'the only way a direct TAS query reaches service vertices; defaults to false'),
49727
49821
  excludeSubServices: z
49728
49822
  .boolean()
49729
49823
  .optional()
@@ -49976,6 +50070,7 @@ const TasCollectAttributesFilterSchema = z.looseObject({
49976
50070
  .describe('Name of the vertex attribute whose values to collect (e.g. "type", "name")'),
49977
50071
  layer: z
49978
50072
  .string()
50073
+ .nullable()
49979
50074
  .optional()
49980
50075
  .describe('Restrict collection to this layer; omit or null for all layers'),
49981
50076
  includeIds: z
@@ -50010,6 +50105,7 @@ const TasCollectAttributeNamesFilterSchema = z.looseObject({
50010
50105
  .describe('Unique key; result appears in analytics[] under this id'),
50011
50106
  layer: z
50012
50107
  .string()
50108
+ .nullable()
50013
50109
  .optional()
50014
50110
  .describe('Restrict to this layer; omit or null for all layers'),
50015
50111
  });
@@ -50050,6 +50146,7 @@ const TasCollectVertexIdFilterSchema = z.looseObject({
50050
50146
  .describe('Unique key; result appears in analytics[] under this id'),
50051
50147
  layer: z
50052
50148
  .string()
50149
+ .nullable()
50053
50150
  .optional()
50054
50151
  .describe('Restrict to this layer; omit or null for all layers'),
50055
50152
  skipBackends: z
@@ -50134,6 +50231,7 @@ const TasCollectExperienceAttributesFilterSchema = z.looseObject({
50134
50231
  .describe('Attribute whose values to collect'),
50135
50232
  layer: z
50136
50233
  .string()
50234
+ .nullable()
50137
50235
  .optional()
50138
50236
  .describe('Restrict to this layer; omit or null for all'),
50139
50237
  caseInsensitive: z
@@ -50706,7 +50804,7 @@ const SourceNameNotSpecifierSchema = z.looseObject({
50706
50804
  */
50707
50805
  const SourceNameExactSpecifierSchema = z.looseObject({
50708
50806
  op: z.literal('EXACT'),
50709
- names: z.array(z.string()).optional().describe('Exact source name strings; any matching name passes'),
50807
+ names: z.array(z.string()).describe('Exact source name strings; any matching name passes. Required: without it the server answers 400 "EXACT specifier - names field is required" (an empty list is accepted)'),
50710
50808
  ignoreCase: z.boolean().optional().describe('Case-insensitive comparison; default false'),
50711
50809
  });
50712
50810
  /**
@@ -50715,7 +50813,7 @@ const SourceNameExactSpecifierSchema = z.looseObject({
50715
50813
  */
50716
50814
  const SourceNameRegExSpecifierSchema = z.looseObject({
50717
50815
  op: z.literal('REGEX'),
50718
- pattern: z.string().optional().describe('Java regex pattern matched against the full source name'),
50816
+ pattern: z.string().describe('Java regex pattern matched against the full source name. Required, and named `pattern`: without it the server answers 400 "REGEX specifier - specifier field is required", naming the wrong field'),
50719
50817
  ignoreCase: z.boolean().optional().describe('Case-insensitive match; default false'),
50720
50818
  });
50721
50819
  /**
@@ -50800,7 +50898,7 @@ const FolderNameNotSpecifierSchema = z.looseObject({
50800
50898
  */
50801
50899
  const FolderNameExactSpecifierSchema = z.looseObject({
50802
50900
  op: z.literal('EXACT'),
50803
- names: z.array(z.string()).optional().describe('Exact folder name strings; any matching name passes'),
50901
+ names: z.array(z.string()).describe('Exact folder name strings; any matching name passes. Required: without it the server answers 400 "EXACT specifier - names field is required" (an empty list is accepted)'),
50804
50902
  ignoreCase: z.boolean().optional().describe('Case-insensitive comparison; default false'),
50805
50903
  });
50806
50904
  /**
@@ -50809,7 +50907,7 @@ const FolderNameExactSpecifierSchema = z.looseObject({
50809
50907
  */
50810
50908
  const FolderNameRegExSpecifierSchema = z.looseObject({
50811
50909
  op: z.literal('REGEX'),
50812
- pattern: z.string().optional().describe('Java regex pattern matched against the full folder name'),
50910
+ pattern: z.string().describe('Java regex pattern matched against the full folder name. Required, and named `pattern`: without it the server answers 400 "REGEX specifier - specifier field is required", naming the wrong field'),
50813
50911
  ignoreCase: z.boolean().optional().describe('Case-insensitive match; default false'),
50814
50912
  });
50815
50913
  /**
@@ -50917,7 +51015,7 @@ const AttributeNameNotSpecifierSchema = z.looseObject({
50917
51015
  */
50918
51016
  const AttributeNameExactSpecifierSchema = z.looseObject({
50919
51017
  op: z.literal('EXACT'),
50920
- names: z.array(z.string()).optional().describe('Exact attribute name strings'),
51018
+ names: z.array(z.string()).describe('Exact attribute name strings. Required: without it the server answers 400 "EXACT specifier - names field is required" (an empty list is accepted)'),
50921
51019
  type: z.number().optional().describe('Optional attribute type bitmask filter'),
50922
51020
  ignoreCase: z.boolean().optional().describe('Case-insensitive comparison; default false'),
50923
51021
  });
@@ -50927,7 +51025,7 @@ const AttributeNameExactSpecifierSchema = z.looseObject({
50927
51025
  */
50928
51026
  const AttributeNameRegExSpecifierSchema = z.looseObject({
50929
51027
  op: z.literal('REGEX'),
50930
- pattern: z.string().optional().describe('Java regex pattern matched against the full attribute name'),
51028
+ pattern: z.string().describe('Java regex pattern matched against the full attribute name. Required, and named `pattern`: without it the server answers 400 "REGEX specifier - specifier field is required", naming the wrong field'),
50931
51029
  ignoreCase: z.boolean().optional().describe('Case-insensitive match; default false'),
50932
51030
  });
50933
51031
  /**
@@ -51916,17 +52014,17 @@ const QueryCalendarWindowSpecSchema = z.looseObject({
51916
52014
  * per-entity grouping column to survive into `KEEP` — otherwise WINDOW
51917
52015
  * + aggregation collapses non-grouped columns away.
51918
52016
  *
51919
- * Java side accepts an empty `columns[]` to clear the grouping ("flatten"
51920
- * pattern); the Zod schema requires `min(1)` so use `--no-validate` if
51921
- * you need that variant.
52017
+ * An empty `columns[]` clears the grouping. It is what makes `TOP` /
52018
+ * `BOTTOM` rank across rows after `GROUP` › an aggregation: without it they
52019
+ * rank within each group and every group comes back (measured on
52020
+ * THE_LABORATORY 2026-10-23: 42 sources, `TOP` 10 returned all 42; after
52021
+ * `GROUP []` it returned the 10 largest, in order).
51922
52022
  */
51923
52023
  const QueryGroupSpecSchema = z.looseObject({
51924
52024
  op: z.literal('GROUP'),
51925
- // No grouping key = no grouping; server rejects empty.
51926
52025
  columns: z
51927
52026
  .array(z.string())
51928
- .min(1)
51929
- .describe('Compound grouping-key columns; must be non-empty'),
52027
+ .describe('Compound grouping-key columns. Empty clears the grouping: put GROUP [] after an aggregation and before TOP / BOTTOM so they rank across all rows, not within each group'),
51930
52028
  });
51931
52029
  /**
51932
52030
  * `ORDER` — SQL-style multi-key sort. Mixed types are ordered: nulls
@@ -52857,6 +52955,27 @@ function discriminatorValueOf(option) {
52857
52955
  *
52858
52956
  * Order matches the union's declaration; not alphabetical.
52859
52957
  */
52958
+ /** The name specifiers a Metrics Metadata `SPEC` holds, each a union of its own ops (REGEX, EXACT, …). */
52959
+ const NAME_SPECIFIERS = [
52960
+ { field: 'sourceNameSpecifier', union: SourceNameSpecifierSchema },
52961
+ { field: 'attributeNameSpecifier', union: AttributeNameSpecifierSchema },
52962
+ { field: 'folderNameSpecifier', union: FolderNameSpecifierSchema },
52963
+ ];
52964
+ const optionsOf = (union) => union.options ?? [];
52965
+ /** The name-specifier ops, which a SPEC (metadata, or a NASSQL FROM / FROM_METADATA `querySpecifier`) carries. */
52966
+ function listNameSpecifierOps() {
52967
+ return [...new Set(NAME_SPECIFIERS.flatMap(({ union }) => optionsOf(union).map(discriminatorValueOf).filter((v) => !!v)))];
52968
+ }
52969
+ /** A name-specifier op's schema, saying which SPEC fields it goes in (#1195); undefined when `op` is none. */
52970
+ function nameSpecifierSchema(op) {
52971
+ const found = NAME_SPECIFIERS.flatMap(({ field, union }) => optionsOf(union).filter((o) => discriminatorValueOf(o) === op).map((o) => ({ field, o })));
52972
+ const first = found[0];
52973
+ if (!first)
52974
+ return undefined;
52975
+ const json = z$1.toJSONSchema(first.o);
52976
+ const where = `A name-specifier op: it goes in a SPEC's ${found.map((f) => f.field).join(' / ')}, not at the top level.`;
52977
+ return { ...json, description: typeof json['description'] === 'string' ? `${json['description']} ${where}` : where };
52978
+ }
52860
52979
  function listDataStoreSchemaOps(type) {
52861
52980
  const { union } = resolveSchemas(type);
52862
52981
  const out = [];
@@ -52896,8 +53015,14 @@ function getDataStoreSchema(type, op) {
52896
53015
  return z$1.toJSONSchema(opt);
52897
53016
  }
52898
53017
  }
53018
+ if (type !== 'tas') {
53019
+ const named = nameSpecifierSchema(op);
53020
+ if (named)
53021
+ return named;
53022
+ }
52899
53023
  const valid = listDataStoreSchemaOps(type);
52900
- throw new Error(`Unknown ${type} op "${op}". Valid ops: ${valid.join(', ')}`);
53024
+ const names = type === 'tas' ? '' : `; inside a SPEC's name specifiers: ${listNameSpecifierOps().join(', ')}`;
53025
+ throw new Error(`Unknown ${type} op "${op}". Valid ops: ${valid.join(', ')}${names}`);
52901
53026
  }
52902
53027
  function describeType(prop) {
52903
53028
  if (Array.isArray(prop['oneOf'])) {
@@ -63631,6 +63756,10 @@ var NASS;
63631
63756
 
63632
63757
  var OIAlarm;
63633
63758
  (function (OIAlarm) {
63759
+ /**
63760
+ * @deprecated Its `timeFrom`/`timeTo` are fixed when the module loads and it is a shared,
63761
+ * mutable object; build a fresh body per request instead.
63762
+ */
63634
63763
  OIAlarm.DEFAULT_SITUATIONS_REQUEST_BODY = {
63635
63764
  pageNumber: 0,
63636
63765
  pageSize: 50,
@@ -63652,6 +63781,10 @@ var OIAlarm;
63652
63781
  showMaintenanceAlarms: false,
63653
63782
  customFilter: {},
63654
63783
  };
63784
+ /**
63785
+ * @deprecated Its `timeFrom`/`timeTo` are fixed when the module loads and it is a shared,
63786
+ * mutable object; use {@link newAlarmSearchBody}.
63787
+ */
63655
63788
  OIAlarm.DEFAULT_ALARMS_REQUEST_BODY = {
63656
63789
  deviceNames: [],
63657
63790
  includeDeviceTypes: [],
@@ -63671,6 +63804,30 @@ var OIAlarm;
63671
63804
  showMaintenanceAlarms: false,
63672
63805
  customFilter: {},
63673
63806
  };
63807
+ /** A fresh `oi/v2/api/alarms/_search` body for `[timeFrom, timeTo]`, first page, nothing filtered. */
63808
+ function newAlarmSearchBody(timeFrom, timeTo, overrides = {}) {
63809
+ return {
63810
+ deviceNames: [],
63811
+ includeDeviceTypes: [],
63812
+ excludeDeviceTypes: [],
63813
+ groups: [],
63814
+ like: '',
63815
+ timeFrom,
63816
+ timeTo,
63817
+ pageNumber: 0,
63818
+ pageSize: 50,
63819
+ services: [],
63820
+ includeSeverity: [],
63821
+ allOtherSeverity: false,
63822
+ includeAlarmTypes: [],
63823
+ excludeAlarmTypes: [],
63824
+ includeClosedAlarms: false,
63825
+ showMaintenanceAlarms: false,
63826
+ customFilter: {},
63827
+ ...overrides,
63828
+ };
63829
+ }
63830
+ OIAlarm.newAlarmSearchBody = newAlarmSearchBody;
63674
63831
  })(OIAlarm || (OIAlarm = {}));
63675
63832
 
63676
63833
  var CreateServices;
@@ -63679,57 +63836,6 @@ var CreateServices;
63679
63836
  CreateServices.SERVICE_TYPES = ['Service', 'Application', 'Group'];
63680
63837
  })(CreateServices || (CreateServices = {}));
63681
63838
 
63682
- /**
63683
- * The `service export` / `service export-hierarchy` file format and the
63684
- * `service import` boundary validator.
63685
- *
63686
- * The envelope wraps a re-postable store body ({@link CreateServices.CreateServiceBody})
63687
- * with provenance metadata. `import` accepts either the envelope or a bare body.
63688
- */
63689
- var ServiceExport;
63690
- (function (ServiceExport) {
63691
- ServiceExport.SCHEMA_VERSION = 1;
63692
- // Structural guard for a store body — does not re-validate every field
63693
- // (the server is the authority); just enough to reject obviously-wrong files.
63694
- const BodyShape = z.looseObject({
63695
- vertices: z.array(z.looseObject({ attributes: z.looseObject({ name: z.string() }) })),
63696
- edges: z.array(z.looseObject({
63697
- sourceExternalId: z.string(),
63698
- targetExternalId: z.string(),
63699
- })),
63700
- });
63701
- const EnvelopeShape = z.looseObject({
63702
- schemaVersion: z.literal(1),
63703
- kind: z.enum(['service', 'service-hierarchy']),
63704
- sourceTenant: z.string().optional(),
63705
- exportedAt: z.string(),
63706
- body: BodyShape,
63707
- });
63708
- /** Wrap a store body in an export envelope. */
63709
- function envelope(kind, body, sourceTenant, exportedAt) {
63710
- return { schemaVersion: ServiceExport.SCHEMA_VERSION, kind, sourceTenant, exportedAt, body };
63711
- }
63712
- ServiceExport.envelope = envelope;
63713
- /**
63714
- * Validate an import file (already JSON-parsed) and return the store body.
63715
- * Accepts a full export envelope or a bare `{ vertices, edges }` body.
63716
- * @throws Error when the input is neither shape.
63717
- */
63718
- function parseImport(raw) {
63719
- const asEnvelope = EnvelopeShape.safeParse(raw);
63720
- if (asEnvelope.success) {
63721
- return asEnvelope.data.body;
63722
- }
63723
- const asBody = BodyShape.safeParse(raw);
63724
- if (asBody.success) {
63725
- return raw;
63726
- }
63727
- throw new Error('Import file is neither a service export envelope nor a bare {vertices, edges} body. ' +
63728
- `Envelope error: ${asEnvelope.error.message}`);
63729
- }
63730
- ServiceExport.parseImport = parseImport;
63731
- })(ServiceExport || (ServiceExport = {}));
63732
-
63733
63839
  /**
63734
63840
  * Pure (HTTP-free) transforms between the Service read shapes and the store
63735
63841
  * (`/oi/v2/sa/save`) body. Kept separate from {@link ServiceService} so the
@@ -63856,6 +63962,7 @@ var ServiceTransform;
63856
63962
  * dropped — this is exactly the incoming edge(s) from the root's parent, which
63857
63963
  * `saTopologyGraph` returns without the parent vertex (and which must not be
63858
63964
  * re-posted: the parent isn't re-saved, so its edge survives anyway).
63965
+ * Also accepts a `?subservices=true` read, which has the same id/edge shape.
63859
63966
  */
63860
63967
  function edgesFromTopology(topo) {
63861
63968
  const idToName = new Map(topo.vertices.map((v) => [v.externalId, v.attributes.name]));
@@ -63974,6 +64081,915 @@ var ServiceTransform;
63974
64081
  ServiceTransform.assertWeightsWithinLimit = assertWeightsWithinLimit;
63975
64082
  })(ServiceTransform || (ServiceTransform = {}));
63976
64083
 
64084
+ /**
64085
+ * Pure (HTTP-free) planning for multi-service edits saved in ONE `sa/save`.
64086
+ *
64087
+ * Measured on a lab tenant (docs/internal/service-bulk-save-findings-2026-10.md):
64088
+ * - Every vertex in a save payload is fully overwritten — attributes AND outgoing
64089
+ * edges — so a payload carries each changed service plus all its descendants,
64090
+ * each complete. Services left out of the payload are untouched, as are
64091
+ * incoming edges; a changed leaf is saved alone.
64092
+ * - A save that fails validation changes nothing.
64093
+ * - `GET sa/services/{name}?subservices=true` returns every hierarchy that
64094
+ * CONTAINS the service; descendants are computed from its edges here.
64095
+ *
64096
+ * Locking is a field-level rebase: a plan records the value each change
64097
+ * replaces; a commit re-reads, refuses only when one of those values moved
64098
+ * ({@link findConflicts}), then re-applies the changes onto the fresh read.
64099
+ */
64100
+ var ServiceBulk;
64101
+ (function (ServiceBulk) {
64102
+ const ServiceNameSchema = z
64103
+ .string()
64104
+ .min(1)
64105
+ .describe('Service name: case-sensitive and unique in the tenant.');
64106
+ const TagsSchema = z
64107
+ .array(z.string().min(1))
64108
+ .min(1)
64109
+ .describe('Tags, compared as a set.');
64110
+ const WeightSchema = z
64111
+ .number()
64112
+ .min(0)
64113
+ .max(1)
64114
+ .describe("Fraction (0–1) of the child's health/risk rolled up into the parent; a parent's children may total at most 1.");
64115
+ const CustomPropertySchema = z.strictObject({
64116
+ name: z.string().min(1).describe('Custom property name.'),
64117
+ value: z.string().describe('Custom property value.'),
64118
+ });
64119
+ ServiceBulk.ServiceChangeSchema = z
64120
+ .discriminatedUnion('op', [
64121
+ z
64122
+ .strictObject({ op: z.literal('addTags'), service: ServiceNameSchema, tags: TagsSchema })
64123
+ .describe('Add tags to a service; tags it already has are left alone.'),
64124
+ z
64125
+ .strictObject({ op: z.literal('removeTags'), service: ServiceNameSchema, tags: TagsSchema })
64126
+ .describe('Remove tags from a service; tags it lacks are ignored.'),
64127
+ z
64128
+ .strictObject({
64129
+ op: z.literal('setProperty'),
64130
+ service: ServiceNameSchema,
64131
+ name: z.string().min(1).describe('Custom property name.'),
64132
+ value: z.string().describe('New value; replaces every existing value of the property.'),
64133
+ })
64134
+ .describe('Set one custom property, adding it when absent.'),
64135
+ z
64136
+ .strictObject({
64137
+ op: z.literal('removeProperty'),
64138
+ service: ServiceNameSchema,
64139
+ name: z.string().min(1).describe('Custom property name.'),
64140
+ })
64141
+ .describe('Remove one custom property; a property the service lacks is ignored.'),
64142
+ z
64143
+ .strictObject({
64144
+ op: z.literal('setAttributes'),
64145
+ service: ServiceNameSchema,
64146
+ description: z.string().optional().describe('New description.'),
64147
+ location: z.string().optional().describe('New location.'),
64148
+ situationsIncludeChildServices: z
64149
+ .boolean()
64150
+ .optional()
64151
+ .describe("Whether the service's situations include its child services."),
64152
+ })
64153
+ .describe('Set scalar attributes; omitted fields keep their values.'),
64154
+ z
64155
+ .strictObject({
64156
+ op: z.literal('createService'),
64157
+ service: ServiceNameSchema,
64158
+ serviceType: z
64159
+ .enum(CreateServices.SERVICE_TYPES)
64160
+ .optional()
64161
+ .describe('Service | Application | Group (default Service); fixed once created.'),
64162
+ description: z.string().optional().describe('Description (default empty).'),
64163
+ location: z.string().optional().describe('Location (default empty).'),
64164
+ tags: z.array(z.string().min(1)).optional().describe('Initial tags.'),
64165
+ customProperties: z
64166
+ .array(CustomPropertySchema)
64167
+ .optional()
64168
+ .describe('Initial custom properties.'),
64169
+ })
64170
+ .describe('Create a service; it is a top-level service unless a link change adds a parent.'),
64171
+ z
64172
+ .strictObject({
64173
+ op: z.literal('link'),
64174
+ parent: ServiceNameSchema,
64175
+ child: ServiceNameSchema,
64176
+ healthWeight: WeightSchema.optional(),
64177
+ riskWeight: WeightSchema.optional(),
64178
+ })
64179
+ .describe("Make child a direct child of parent, or re-weight an existing link. With no weights the parent's children are re-split evenly; one weight given sets both."),
64180
+ z
64181
+ .strictObject({ op: z.literal('unlink'), parent: ServiceNameSchema, child: ServiceNameSchema })
64182
+ .describe("Remove the parent→child link; the remaining children's weights are kept."),
64183
+ ])
64184
+ .describe('One change to one service or to one parent→child link.');
64185
+ class ServiceConflictError extends Error {
64186
+ conflicts;
64187
+ constructor(conflicts) {
64188
+ super(`Services changed since the plan was made — re-plan to see the current state:\n ${conflicts.join('\n ')}`);
64189
+ this.conflicts = conflicts;
64190
+ }
64191
+ }
64192
+ ServiceBulk.ServiceConflictError = ServiceConflictError;
64193
+ const IGNORED_FIELDS = new Set(['metrics', 'root_service', 'type', 'state']);
64194
+ /** Parse untrusted changes (CLI file, MCP input); throws ZodError. */
64195
+ function parseChanges(raw) {
64196
+ return z.array(ServiceBulk.ServiceChangeSchema).min(1).parse(raw);
64197
+ }
64198
+ ServiceBulk.parseChanges = parseChanges;
64199
+ const ChildLinkSchema = z.looseObject({
64200
+ child: z.string(),
64201
+ healthWeight: z.number(),
64202
+ riskWeight: z.number(),
64203
+ });
64204
+ ServiceBulk.ServicePlanSchema = z
64205
+ .looseObject({
64206
+ targets: z.array(z.string()).describe('Services read to build the plan.'),
64207
+ changes: z.array(ServiceBulk.ServiceChangeSchema).min(1).describe('The changes, in order.'),
64208
+ diff: z
64209
+ .array(z.looseObject({
64210
+ service: z.string(),
64211
+ status: z.enum(['created', 'changed']),
64212
+ fields: z.array(z.looseObject({ field: z.string(), before: z.unknown(), after: z.unknown() })),
64213
+ children: z
64214
+ .looseObject({ before: z.array(ChildLinkSchema), after: z.array(ChildLinkSchema) })
64215
+ .optional(),
64216
+ }))
64217
+ .describe('Per-service before/after; the before values are what a commit checks.'),
64218
+ save: z.array(z.string()).describe('Every service the save payload carries.'),
64219
+ })
64220
+ .describe('A plan returned by planServiceChanges, passed back unchanged to commit it.');
64221
+ /** Parse an untrusted plan (file, MCP input); throws ZodError. */
64222
+ function parsePlan(raw) {
64223
+ return ServiceBulk.ServicePlanSchema.parse(raw);
64224
+ }
64225
+ ServiceBulk.parsePlan = parsePlan;
64226
+ /**
64227
+ * Every existing service the changes name — what to read before planning.
64228
+ * Services created by an earlier change in the list are excluded.
64229
+ */
64230
+ function targetsOf(changes) {
64231
+ const created = new Set();
64232
+ const targets = new Set();
64233
+ for (const c of changes) {
64234
+ const names = c.op === 'link' || c.op === 'unlink' ? [c.parent, c.child] : [c.service];
64235
+ if (c.op === 'createService')
64236
+ created.add(c.service);
64237
+ for (const n of names)
64238
+ if (!created.has(n))
64239
+ targets.add(n);
64240
+ }
64241
+ return [...targets];
64242
+ }
64243
+ ServiceBulk.targetsOf = targetsOf;
64244
+ /**
64245
+ * Convert one `?subservices=true` read into a name-keyed graph.
64246
+ * @throws Error when the read is paged — never observed, so refused rather than guessed at.
64247
+ */
64248
+ function graphFromRead(read) {
64249
+ const paged = (read.nextOffset !== undefined && read.nextOffset !== -1) ||
64250
+ (read.totalVertices !== undefined && read.vertices.length < read.totalVertices);
64251
+ if (paged) {
64252
+ throw new Error(`Service hierarchy read is paged (${read.vertices.length} of ${read.totalVertices} services, nextOffset=${read.nextOffset}); bulk edits do not support paged hierarchies yet`);
64253
+ }
64254
+ const vertices = {};
64255
+ for (const v of read.vertices) {
64256
+ vertices[v.attributes.name] = ServiceTransform.retrievedToServiceVertex(v);
64257
+ }
64258
+ return { vertices, edges: ServiceTransform.edgesFromTopology(read) };
64259
+ }
64260
+ ServiceBulk.graphFromRead = graphFromRead;
64261
+ /** Union two graphs; a service or edge present in both keeps the first copy. */
64262
+ function mergeGraphs(a, b) {
64263
+ return {
64264
+ vertices: { ...b.vertices, ...a.vertices },
64265
+ edges: ServiceTransform.mergeBodies({ vertices: [], edges: a.edges }, { vertices: [], edges: b.edges })
64266
+ .edges,
64267
+ };
64268
+ }
64269
+ ServiceBulk.mergeGraphs = mergeGraphs;
64270
+ /** Direct children of a parent, sorted by name. */
64271
+ function childLinks(graph, parent) {
64272
+ return ServiceTransform.childEdges(graph.edges, parent)
64273
+ .map((e) => ({
64274
+ child: e.targetExternalId,
64275
+ healthWeight: e.attributes.health_weight,
64276
+ riskWeight: e.attributes.risk_weight,
64277
+ }))
64278
+ .sort((x, y) => x.child.localeCompare(y.child));
64279
+ }
64280
+ ServiceBulk.childLinks = childLinks;
64281
+ /** The services reachable from the seeds through parent→child edges, seeds included. */
64282
+ function descendantClosure(graph, seeds) {
64283
+ const seen = new Set();
64284
+ const queue = [...seeds];
64285
+ while (queue.length) {
64286
+ const name = queue.shift();
64287
+ if (seen.has(name))
64288
+ continue;
64289
+ seen.add(name);
64290
+ for (const e of ServiceTransform.childEdges(graph.edges, name))
64291
+ queue.push(e.targetExternalId);
64292
+ }
64293
+ return [...seen];
64294
+ }
64295
+ ServiceBulk.descendantClosure = descendantClosure;
64296
+ /** The store body for a set of services: each one complete, with all its outgoing edges. */
64297
+ function bodyFor(graph, services) {
64298
+ const names = new Set(services);
64299
+ const missing = services.filter((n) => !graph.vertices[n]);
64300
+ if (missing.length)
64301
+ throw new Error(`Services not in the graph: ${missing.join(', ')}`);
64302
+ const edges = graph.edges.filter((e) => names.has(e.sourceExternalId));
64303
+ const dangling = edges.filter((e) => !names.has(e.targetExternalId));
64304
+ if (dangling.length) {
64305
+ throw new Error(`Edges leave the payload: ${dangling.map((e) => `${e.sourceExternalId}→${e.targetExternalId}`).join(', ')}`);
64306
+ }
64307
+ return { vertices: services.map((n) => graph.vertices[n]), edges };
64308
+ }
64309
+ ServiceBulk.bodyFor = bodyFor;
64310
+ /** A service and its whole subtree as one store body (export-hierarchy, associate, …). */
64311
+ function subtreeBody(graph, root) {
64312
+ if (!graph.vertices[root])
64313
+ throw new Error(`No service with name '${root}' found`);
64314
+ return bodyFor(graph, descendantClosure(graph, [root]));
64315
+ }
64316
+ ServiceBulk.subtreeBody = subtreeBody;
64317
+ function newVertex(c) {
64318
+ return {
64319
+ externalId: c.service,
64320
+ attributes: {
64321
+ type: 'saService',
64322
+ name: c.service,
64323
+ serviceType: c.serviceType ?? 'Service',
64324
+ state: 'ACTIVE',
64325
+ maintenance: false,
64326
+ situationsIncludeChildServices: false,
64327
+ serviceContent: [],
64328
+ root_service: null,
64329
+ tags: c.tags ? [...new Set(c.tags)] : [],
64330
+ location: c.location ?? '',
64331
+ description: c.description ?? '',
64332
+ customProperties: (c.customProperties ?? []).map((p) => ({ ...p })),
64333
+ customMetrics: [],
64334
+ metrics: [],
64335
+ },
64336
+ };
64337
+ }
64338
+ function isAncestor(graph, candidate, of) {
64339
+ return descendantClosure(graph, [candidate]).includes(of);
64340
+ }
64341
+ /**
64342
+ * Apply changes to a copy of the graph, in order.
64343
+ * @throws Error naming the offending change (unknown service, duplicate create, cycle, missing link).
64344
+ */
64345
+ function applyChanges(graph, changes) {
64346
+ const g = structuredClone(graph);
64347
+ const vertex = (name, i) => {
64348
+ const v = g.vertices[name];
64349
+ if (!v)
64350
+ throw new Error(`change ${i + 1}: no service with name '${name}' found`);
64351
+ return v.attributes;
64352
+ };
64353
+ changes.forEach((c, i) => {
64354
+ switch (c.op) {
64355
+ case 'addTags': {
64356
+ const a = vertex(c.service, i);
64357
+ a.tags = [...new Set([...a.tags, ...c.tags])];
64358
+ break;
64359
+ }
64360
+ case 'removeTags': {
64361
+ const a = vertex(c.service, i);
64362
+ a.tags = a.tags.filter((t) => !c.tags.includes(t));
64363
+ break;
64364
+ }
64365
+ case 'setProperty': {
64366
+ const a = vertex(c.service, i);
64367
+ const rest = a.customProperties.filter((p) => p.name !== c.name);
64368
+ a.customProperties = [...rest, { name: c.name, value: c.value }];
64369
+ break;
64370
+ }
64371
+ case 'removeProperty': {
64372
+ const a = vertex(c.service, i);
64373
+ a.customProperties = a.customProperties.filter((p) => p.name !== c.name);
64374
+ break;
64375
+ }
64376
+ case 'setAttributes': {
64377
+ const a = vertex(c.service, i);
64378
+ if (c.description !== undefined)
64379
+ a.description = c.description;
64380
+ if (c.location !== undefined)
64381
+ a.location = c.location;
64382
+ if (c.situationsIncludeChildServices !== undefined) {
64383
+ a.situationsIncludeChildServices = c.situationsIncludeChildServices;
64384
+ }
64385
+ break;
64386
+ }
64387
+ case 'createService': {
64388
+ if (g.vertices[c.service]) {
64389
+ throw new Error(`change ${i + 1}: service '${c.service}' already exists`);
64390
+ }
64391
+ g.vertices[c.service] = newVertex(c);
64392
+ break;
64393
+ }
64394
+ case 'link': {
64395
+ vertex(c.parent, i);
64396
+ vertex(c.child, i);
64397
+ if (c.parent === c.child || isAncestor(g, c.child, c.parent)) {
64398
+ throw new Error(`change ${i + 1}: linking '${c.child}' under '${c.parent}' would create a cycle`);
64399
+ }
64400
+ const weighted = c.healthWeight !== undefined || c.riskWeight !== undefined;
64401
+ const exists = g.edges.some((e) => e.sourceExternalId === c.parent && e.targetExternalId === c.child);
64402
+ if (weighted) {
64403
+ const h = c.healthWeight ?? c.riskWeight;
64404
+ const r = c.riskWeight ?? h;
64405
+ g.edges = ServiceTransform.upsertEdge(g.edges, c.parent, c.child, h, r);
64406
+ }
64407
+ else if (!exists) {
64408
+ g.edges = ServiceTransform.rebalanceChildren(ServiceTransform.upsertEdge(g.edges, c.parent, c.child, 0, 0), c.parent);
64409
+ }
64410
+ break;
64411
+ }
64412
+ case 'unlink': {
64413
+ vertex(c.parent, i);
64414
+ vertex(c.child, i);
64415
+ const before = g.edges.length;
64416
+ g.edges = ServiceTransform.removeEdge(g.edges, c.parent, c.child);
64417
+ if (g.edges.length === before) {
64418
+ throw new Error(`change ${i + 1}: '${c.child}' is not a direct child of '${c.parent}'`);
64419
+ }
64420
+ break;
64421
+ }
64422
+ }
64423
+ });
64424
+ return g;
64425
+ }
64426
+ ServiceBulk.applyChanges = applyChanges;
64427
+ /** Order-insensitive form of an attribute value, for comparison and display. */
64428
+ function normalize(field, value) {
64429
+ if (field === 'tags' && Array.isArray(value))
64430
+ return [...value].sort();
64431
+ if (field === 'customProperties' && Array.isArray(value)) {
64432
+ return [...value]
64433
+ .map((p) => ({ name: p.name, value: p.value }))
64434
+ .sort((x, y) => x.name.localeCompare(y.name) || x.value.localeCompare(y.value));
64435
+ }
64436
+ return value;
64437
+ }
64438
+ ServiceBulk.normalize = normalize;
64439
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
64440
+ function fieldChanges(before, after) {
64441
+ const out = [];
64442
+ const keys = Object.keys(after);
64443
+ for (const key of keys) {
64444
+ if (IGNORED_FIELDS.has(key))
64445
+ continue;
64446
+ const b = before ? normalize(key, before[key]) : undefined;
64447
+ const a = normalize(key, after[key]);
64448
+ if (!same(a, b))
64449
+ out.push({ field: key, before: b, after: a });
64450
+ }
64451
+ return out;
64452
+ }
64453
+ /** Per-service differences between two graphs (services removed from `after` are not reported). */
64454
+ function diffGraphs(before, after) {
64455
+ const out = [];
64456
+ for (const name of Object.keys(after.vertices).sort()) {
64457
+ const b = before.vertices[name];
64458
+ const fields = fieldChanges(b?.attributes, after.vertices[name].attributes);
64459
+ const kidsBefore = childLinks(before, name);
64460
+ const kidsAfter = childLinks(after, name);
64461
+ const childrenChanged = !same(kidsBefore, kidsAfter);
64462
+ if (b && !fields.length && !childrenChanged)
64463
+ continue;
64464
+ out.push({
64465
+ service: name,
64466
+ status: b ? 'changed' : 'created',
64467
+ fields,
64468
+ ...(childrenChanged ? { children: { before: kidsBefore, after: kidsAfter } } : {}),
64469
+ });
64470
+ }
64471
+ return out;
64472
+ }
64473
+ ServiceBulk.diffGraphs = diffGraphs;
64474
+ /**
64475
+ * Plan changes against a graph read for `targets`: the diff, the services the
64476
+ * payload must carry, and the store body.
64477
+ * @throws Error when a change is invalid or a parent's weights exceed 100 %.
64478
+ */
64479
+ function planChanges(graph, targets, changes) {
64480
+ const after = applyChanges(graph, changes);
64481
+ const diff = diffGraphs(graph, after);
64482
+ const save = descendantClosure(after, diff.map((d) => d.service)).sort();
64483
+ for (const name of save) {
64484
+ try {
64485
+ ServiceTransform.assertWeightsWithinLimit(after.edges, name);
64486
+ }
64487
+ catch (e) {
64488
+ throw new Error(`'${name}': ${e.message}`);
64489
+ }
64490
+ }
64491
+ return { plan: { targets, changes, diff, save }, body: diff.length ? bodyFor(after, save) : { vertices: [], edges: [] } };
64492
+ }
64493
+ ServiceBulk.planChanges = planChanges;
64494
+ /**
64495
+ * What moved between a plan and a fresh read, limited to the values the plan
64496
+ * replaces: a changed field, a changed set of children, a service the plan
64497
+ * edits that is gone, or one it creates that now exists. Empty = safe to commit.
64498
+ */
64499
+ function findConflicts(planned, fresh) {
64500
+ const conflicts = [];
64501
+ for (const d of planned.diff) {
64502
+ const now = fresh.vertices[d.service];
64503
+ if (d.status === 'created') {
64504
+ if (now)
64505
+ conflicts.push(`'${d.service}' was created by someone else`);
64506
+ continue;
64507
+ }
64508
+ if (!now) {
64509
+ conflicts.push(`'${d.service}' no longer exists`);
64510
+ continue;
64511
+ }
64512
+ for (const f of d.fields) {
64513
+ const current = normalize(f.field, now.attributes[f.field]);
64514
+ if (!same(current, f.before)) {
64515
+ conflicts.push(`'${d.service}' ${f.field}: planned from ${JSON.stringify(f.before)}, now ${JSON.stringify(current)}`);
64516
+ }
64517
+ }
64518
+ if (d.children && !same(childLinks(fresh, d.service), d.children.before)) {
64519
+ conflicts.push(`'${d.service}' children changed since the plan`);
64520
+ }
64521
+ }
64522
+ return conflicts;
64523
+ }
64524
+ ServiceBulk.findConflicts = findConflicts;
64525
+ })(ServiceBulk || (ServiceBulk = {}));
64526
+
64527
+ /**
64528
+ * Pure selection and edit expansion for `service bulk-update`: which services a
64529
+ * selector picks, and which concrete {@link ServiceBulk.ServiceChange}s one set of
64530
+ * edits produces for each — only the ones that would change something, with the
64531
+ * reason for every edit that would not (already tagged, text not found, …).
64532
+ */
64533
+ var ServiceBulkSelect;
64534
+ (function (ServiceBulkSelect) {
64535
+ const names = (what) => z.array(z.string().min(1)).min(1).describe(what);
64536
+ ServiceBulkSelect.ServiceSelectorSchema = z
64537
+ .strictObject({
64538
+ services: names('Exactly these services (exact, case-sensitive names).').optional(),
64539
+ root: z
64540
+ .string()
64541
+ .min(1)
64542
+ .describe('This service and its descendants (exact name).')
64543
+ .optional(),
64544
+ depth: z
64545
+ .number()
64546
+ .int()
64547
+ .min(0)
64548
+ .describe('With root: 0 = root only, 1 = root and direct children, … (default: all).')
64549
+ .optional(),
64550
+ name: names('Name matches any of these globs (* and ?, case-insensitive).').optional(),
64551
+ hasTag: names('Has every one of these tags (exact).').optional(),
64552
+ lacksTag: names('Has none of these tags (exact).').optional(),
64553
+ hasProperty: names('Has every one of these custom properties (exact names).').optional(),
64554
+ lacksProperty: names('Has none of these custom properties (exact names).').optional(),
64555
+ where: z
64556
+ .record(z.string().min(1), z.string())
64557
+ .describe('Custom property name → glob its value must match (case-insensitive; no * = equals).')
64558
+ .optional(),
64559
+ location: z.string().describe('Location matches this glob (case-insensitive).').optional(),
64560
+ })
64561
+ .refine((s) => Object.values(s).some((v) => v !== undefined), {
64562
+ message: 'a selector needs at least one criterion',
64563
+ })
64564
+ .refine((s) => s.depth === undefined || s.root !== undefined, {
64565
+ message: 'depth needs root',
64566
+ })
64567
+ .describe('Which services to edit; every criterion given must hold (AND).');
64568
+ ServiceBulkSelect.BulkEditSchema = z
64569
+ .strictObject({
64570
+ addTags: names('Tags to add.').optional(),
64571
+ removeTags: names('Tags to remove.').optional(),
64572
+ setProperties: z
64573
+ .record(z.string().min(1), z.string())
64574
+ .describe('Custom properties to set (name → value); other properties are kept.')
64575
+ .optional(),
64576
+ removeProperties: names('Custom properties to remove.').optional(),
64577
+ replaceInProperty: z
64578
+ .strictObject({
64579
+ property: z.string().min(1).describe("Property name, or '*' for every property."),
64580
+ find: z.string().min(1).describe('Text to find (case-sensitive substring).'),
64581
+ replaceWith: z.string().describe('Replacement for every occurrence.'),
64582
+ })
64583
+ .describe('Search and replace inside custom property values.')
64584
+ .optional(),
64585
+ setLocation: z.string().describe('New location.').optional(),
64586
+ setDescription: z.string().describe('New description.').optional(),
64587
+ })
64588
+ .refine((e) => Object.values(e).some((v) => v !== undefined), {
64589
+ message: 'at least one edit is needed',
64590
+ })
64591
+ .describe('The edits applied to every selected service.');
64592
+ function subjectFromVertex(v) {
64593
+ const a = v.attributes;
64594
+ return { name: a.name, tags: a.tags, properties: a.customProperties, location: a.location };
64595
+ }
64596
+ ServiceBulkSelect.subjectFromVertex = subjectFromVertex;
64597
+ /** From a services-list row, whose custom properties are a name → value map. */
64598
+ function subjectFromListRow(row) {
64599
+ return {
64600
+ name: row.name,
64601
+ tags: row.tags ?? [],
64602
+ properties: Object.entries(row.customProperties ?? {}).map(([name, value]) => ({ name, value })),
64603
+ location: row.location ?? '',
64604
+ };
64605
+ }
64606
+ ServiceBulkSelect.subjectFromListRow = subjectFromListRow;
64607
+ /** A case-insensitive, anchored glob: `*` any run, `?` one character. */
64608
+ function globToRegExp(glob) {
64609
+ const body = glob
64610
+ .split('')
64611
+ .map((c) => (c === '*' ? '.*' : c === '?' ? '.' : c.replace(/[.+^${}()|[\]\\]/g, '\\$&')))
64612
+ .join('');
64613
+ return new RegExp(`^${body}$`, 'i');
64614
+ }
64615
+ ServiceBulkSelect.globToRegExp = globToRegExp;
64616
+ /** The non-scope criteria (everything but services/root/depth) against one service. */
64617
+ function matchesFilters(s, sel) {
64618
+ const has = (p) => s.properties.some((x) => x.name === p);
64619
+ if (sel.name && !sel.name.some((g) => globToRegExp(g).test(s.name)))
64620
+ return false;
64621
+ if (sel.hasTag && !sel.hasTag.every((t) => s.tags.includes(t)))
64622
+ return false;
64623
+ if (sel.lacksTag && sel.lacksTag.some((t) => s.tags.includes(t)))
64624
+ return false;
64625
+ if (sel.hasProperty && !sel.hasProperty.every(has))
64626
+ return false;
64627
+ if (sel.lacksProperty && sel.lacksProperty.some(has))
64628
+ return false;
64629
+ if (sel.location !== undefined && !globToRegExp(sel.location).test(s.location))
64630
+ return false;
64631
+ for (const [prop, glob] of Object.entries(sel.where ?? {})) {
64632
+ const re = globToRegExp(glob);
64633
+ if (!s.properties.some((x) => x.name === prop && re.test(x.value)))
64634
+ return false;
64635
+ }
64636
+ return true;
64637
+ }
64638
+ ServiceBulkSelect.matchesFilters = matchesFilters;
64639
+ /** The selector as one line, for messages: `name="*virt*" AND hasTag=internal`. */
64640
+ function describeSelector(sel) {
64641
+ const parts = [];
64642
+ const list = (xs) => xs.join(',');
64643
+ if (sel.services)
64644
+ parts.push(`services=${list(sel.services)}`);
64645
+ if (sel.root)
64646
+ parts.push(`root="${sel.root}"`);
64647
+ if (sel.depth !== undefined)
64648
+ parts.push(`depth=${sel.depth}`);
64649
+ if (sel.name)
64650
+ parts.push(`name="${list(sel.name)}"`);
64651
+ if (sel.hasTag)
64652
+ parts.push(`hasTag=${list(sel.hasTag)}`);
64653
+ if (sel.lacksTag)
64654
+ parts.push(`lacksTag=${list(sel.lacksTag)}`);
64655
+ if (sel.hasProperty)
64656
+ parts.push(`hasProperty=${list(sel.hasProperty)}`);
64657
+ if (sel.lacksProperty)
64658
+ parts.push(`lacksProperty=${list(sel.lacksProperty)}`);
64659
+ for (const [p, g] of Object.entries(sel.where ?? {}))
64660
+ parts.push(`where.${p}="${g}"`);
64661
+ if (sel.location !== undefined)
64662
+ parts.push(`location="${sel.location}"`);
64663
+ return parts.join(' AND ');
64664
+ }
64665
+ ServiceBulkSelect.describeSelector = describeSelector;
64666
+ /** `root` and its descendants down to `depth` levels (all when undefined). */
64667
+ function withinDepth(graph, root, depth) {
64668
+ const seen = new Set([root]);
64669
+ let frontier = [root];
64670
+ for (let level = 0; frontier.length && (depth === undefined || level < depth); level++) {
64671
+ const next = [];
64672
+ for (const parent of frontier) {
64673
+ for (const link of ServiceBulk.childLinks(graph, parent)) {
64674
+ if (!seen.has(link.child)) {
64675
+ seen.add(link.child);
64676
+ next.push(link.child);
64677
+ }
64678
+ }
64679
+ }
64680
+ frontier = next;
64681
+ }
64682
+ return [...seen];
64683
+ }
64684
+ ServiceBulkSelect.withinDepth = withinDepth;
64685
+ /** Edits that contradict each other; any entry blocks the update. */
64686
+ function editBlockers(e) {
64687
+ const out = [];
64688
+ for (const t of e.addTags ?? []) {
64689
+ if (e.removeTags?.includes(t))
64690
+ out.push(`tag '${t}' is both added and removed`);
64691
+ }
64692
+ for (const p of Object.keys(e.setProperties ?? {})) {
64693
+ if (e.removeProperties?.includes(p))
64694
+ out.push(`property '${p}' is both set and removed`);
64695
+ }
64696
+ const r = e.replaceInProperty;
64697
+ if (r) {
64698
+ if (r.find === r.replaceWith)
64699
+ out.push('find and replaceWith are the same — nothing would change');
64700
+ const named = r.property === '*' ? [] : [r.property];
64701
+ for (const p of named) {
64702
+ if (e.setProperties?.[p] !== undefined || e.removeProperties?.includes(p)) {
64703
+ out.push(`property '${p}' is both replaced and set or removed`);
64704
+ }
64705
+ }
64706
+ }
64707
+ return out;
64708
+ }
64709
+ ServiceBulkSelect.editBlockers = editBlockers;
64710
+ /**
64711
+ * Turn the edits into concrete changes for each named service, emitting a
64712
+ * change only where it alters the service. The services must be in the graph.
64713
+ */
64714
+ function expandEdits(graph, services, e) {
64715
+ const changes = [];
64716
+ const outcomes = [];
64717
+ const warnings = [];
64718
+ for (const service of [...services].sort()) {
64719
+ const v = graph.vertices[service];
64720
+ if (!v)
64721
+ throw new Error(`No service with name '${service}' found`);
64722
+ const a = v.attributes;
64723
+ const will = [];
64724
+ const already = [];
64725
+ const values = (p) => a.customProperties.filter((x) => x.name === p).map((x) => x.value);
64726
+ const add = (e.addTags ?? []).filter((t) => {
64727
+ if (a.tags.includes(t)) {
64728
+ already.push(`already has tag '${t}'`);
64729
+ return false;
64730
+ }
64731
+ const variant = a.tags.find((x) => x.toLowerCase() === t.toLowerCase());
64732
+ if (variant)
64733
+ warnings.push(`'${service}' has tag '${variant}'; adding '${t}' as well`);
64734
+ return true;
64735
+ });
64736
+ if (add.length) {
64737
+ changes.push({ op: 'addTags', service, tags: add });
64738
+ will.push(`add tag ${add.map((t) => `'${t}'`).join(', ')}`);
64739
+ }
64740
+ const remove = (e.removeTags ?? []).filter((t) => {
64741
+ if (a.tags.includes(t))
64742
+ return true;
64743
+ already.push(`does not have tag '${t}'`);
64744
+ return false;
64745
+ });
64746
+ if (remove.length) {
64747
+ changes.push({ op: 'removeTags', service, tags: remove });
64748
+ will.push(`remove tag ${remove.map((t) => `'${t}'`).join(', ')}`);
64749
+ }
64750
+ for (const [name, value] of Object.entries(e.setProperties ?? {})) {
64751
+ const now = values(name);
64752
+ if (now.length === 1 && now[0] === value) {
64753
+ already.push(`property '${name}' is already '${value}'`);
64754
+ continue;
64755
+ }
64756
+ if (now.length > 1) {
64757
+ warnings.push(`'${service}' has ${now.length} values for property '${name}'; setting leaves one`);
64758
+ }
64759
+ changes.push({ op: 'setProperty', service, name, value });
64760
+ will.push(now.length ? `set '${name}': '${now.join("', '")}' → '${value}'` : `add property '${name}' = '${value}'`);
64761
+ }
64762
+ for (const name of e.removeProperties ?? []) {
64763
+ if (!values(name).length) {
64764
+ already.push(`has no property '${name}'`);
64765
+ continue;
64766
+ }
64767
+ changes.push({ op: 'removeProperty', service, name });
64768
+ will.push(`remove property '${name}'`);
64769
+ }
64770
+ const r = e.replaceInProperty;
64771
+ if (r) {
64772
+ const targets = r.property === '*' ? [...new Set(a.customProperties.map((x) => x.name))] : [r.property];
64773
+ let replaced = false;
64774
+ for (const name of targets) {
64775
+ const now = values(name);
64776
+ if (!now.some((x) => x.includes(r.find)))
64777
+ continue;
64778
+ if (now.length > 1) {
64779
+ warnings.push(`'${service}' has ${now.length} values for property '${name}'; not replaced`);
64780
+ already.push(`property '${name}' has ${now.length} values — skipped`);
64781
+ continue;
64782
+ }
64783
+ const value = now[0].split(r.find).join(r.replaceWith);
64784
+ changes.push({ op: 'setProperty', service, name, value });
64785
+ will.push(`set '${name}': '${now[0]}' → '${value}'`);
64786
+ replaced = true;
64787
+ }
64788
+ if (!replaced && !already.some((x) => x.includes('— skipped'))) {
64789
+ already.push(`text '${r.find}' not found in ${r.property === '*' ? 'any property' : `'${r.property}'`}`);
64790
+ }
64791
+ }
64792
+ const attrs = {};
64793
+ if (e.setLocation !== undefined) {
64794
+ if (a.location === e.setLocation)
64795
+ already.push(`location is already '${e.setLocation}'`);
64796
+ else {
64797
+ attrs.location = e.setLocation;
64798
+ will.push(`location: '${a.location}' → '${e.setLocation}'`);
64799
+ }
64800
+ }
64801
+ if (e.setDescription !== undefined) {
64802
+ if (a.description === e.setDescription)
64803
+ already.push('description is already as given');
64804
+ else {
64805
+ attrs.description = e.setDescription;
64806
+ will.push(`description: '${a.description}' → '${e.setDescription}'`);
64807
+ }
64808
+ }
64809
+ if (Object.keys(attrs).length)
64810
+ changes.push({ op: 'setAttributes', service, ...attrs });
64811
+ outcomes.push({ service, will, already });
64812
+ }
64813
+ return { changes, outcomes, warnings };
64814
+ }
64815
+ ServiceBulkSelect.expandEdits = expandEdits;
64816
+ /**
64817
+ * A short, stable hash of what a plan would save (its diff and save set). A
64818
+ * dry-run prints it; an apply must present it, and refuses when the fresh
64819
+ * plan hashes differently — so what was reviewed is what gets saved.
64820
+ */
64821
+ function planToken(plan) {
64822
+ return cyrb53(JSON.stringify({ diff: plan.diff, save: plan.save }))
64823
+ .toString(16)
64824
+ .padStart(14, '0')
64825
+ .slice(0, 10);
64826
+ }
64827
+ ServiceBulkSelect.planToken = planToken;
64828
+ })(ServiceBulkSelect || (ServiceBulkSelect = {}));
64829
+
64830
+ /**
64831
+ * The `service export` / `service export-hierarchy` file format and the
64832
+ * `service import` boundary validator.
64833
+ *
64834
+ * The envelope wraps a re-postable store body ({@link CreateServices.CreateServiceBody})
64835
+ * with provenance metadata. `import` accepts either the envelope or a bare body.
64836
+ */
64837
+ var ServiceExport;
64838
+ (function (ServiceExport) {
64839
+ ServiceExport.SCHEMA_VERSION = 1;
64840
+ // Structural guard for a store body — does not re-validate every field
64841
+ // (the server is the authority); just enough to reject obviously-wrong files.
64842
+ const BodyShape = z.looseObject({
64843
+ vertices: z.array(z.looseObject({ attributes: z.looseObject({ name: z.string() }) })),
64844
+ edges: z.array(z.looseObject({
64845
+ sourceExternalId: z.string(),
64846
+ targetExternalId: z.string(),
64847
+ })),
64848
+ });
64849
+ const EnvelopeShape = z.looseObject({
64850
+ schemaVersion: z.literal(1),
64851
+ kind: z.enum(['service', 'service-hierarchy']),
64852
+ sourceTenant: z.string().optional(),
64853
+ exportedAt: z.string(),
64854
+ body: BodyShape,
64855
+ });
64856
+ /** Wrap a store body in an export envelope. */
64857
+ function envelope(kind, body, sourceTenant, exportedAt) {
64858
+ return { schemaVersion: ServiceExport.SCHEMA_VERSION, kind, sourceTenant, exportedAt, body };
64859
+ }
64860
+ ServiceExport.envelope = envelope;
64861
+ /**
64862
+ * Validate an import file (already JSON-parsed) and return the store body.
64863
+ * Accepts a full export envelope or a bare `{ vertices, edges }` body.
64864
+ * @throws Error when the input is neither shape.
64865
+ */
64866
+ function parseImport(raw) {
64867
+ const asEnvelope = EnvelopeShape.safeParse(raw);
64868
+ if (asEnvelope.success) {
64869
+ return asEnvelope.data.body;
64870
+ }
64871
+ const asBody = BodyShape.safeParse(raw);
64872
+ if (asBody.success) {
64873
+ return raw;
64874
+ }
64875
+ throw new Error('Import file is neither a service export envelope nor a bare {vertices, edges} body. ' +
64876
+ `Envelope error: ${asEnvelope.error.message}`);
64877
+ }
64878
+ ServiceExport.parseImport = parseImport;
64879
+ /**
64880
+ * As {@link parseImport}, plus the envelope's provenance: which tenant the file came from
64881
+ * (absent for a bare body or an envelope that did not record it) and when.
64882
+ * @throws Error when the input is neither shape.
64883
+ */
64884
+ function parseImportFile(raw) {
64885
+ const body = parseImport(raw);
64886
+ const asEnvelope = EnvelopeShape.safeParse(raw);
64887
+ if (!asEnvelope.success)
64888
+ return { body };
64889
+ return {
64890
+ body,
64891
+ ...(asEnvelope.data.sourceTenant ? { sourceTenant: asEnvelope.data.sourceTenant } : {}),
64892
+ exportedAt: asEnvelope.data.exportedAt,
64893
+ };
64894
+ }
64895
+ ServiceExport.parseImportFile = parseImportFile;
64896
+ })(ServiceExport || (ServiceExport = {}));
64897
+
64898
+ /**
64899
+ * Pure planning for `service import` into any tenant
64900
+ * (docs/internal/service-bulk-save-findings-2026-10.md → "Cross-tenant import"):
64901
+ *
64902
+ * - A service's `metrics` are tenant identity: a save carrying another tenant's (or a
64903
+ * re-created service's stale) metrics is stored verbatim and the server assigns none, so
64904
+ * health, risk and availability point at nothing. Metrics therefore always come from the
64905
+ * target: an existing service keeps its current ones, a new one is sent with `[]`.
64906
+ * - Every saved service is overwritten (attributes and child links), so an import into a
64907
+ * tenant that already has some of the names is a diff to review, not a blind write.
64908
+ */
64909
+ var ServiceImport;
64910
+ (function (ServiceImport) {
64911
+ /** Prefix every service name (and link endpoint) in a body. */
64912
+ function renameBody(body, prefix) {
64913
+ const rename = (n) => `${prefix}${n}`;
64914
+ return {
64915
+ vertices: body.vertices.map((v) => ({
64916
+ ...v,
64917
+ externalId: rename(v.attributes.name),
64918
+ attributes: { ...v.attributes, name: rename(v.attributes.name) },
64919
+ })),
64920
+ edges: body.edges.map((e) => ({
64921
+ ...e,
64922
+ sourceExternalId: rename(e.sourceExternalId),
64923
+ targetExternalId: rename(e.targetExternalId),
64924
+ })),
64925
+ };
64926
+ }
64927
+ ServiceImport.renameBody = renameBody;
64928
+ /**
64929
+ * Plan saving `file` into a target whose current state for the same names is `target`
64930
+ * (missing names = new services).
64931
+ */
64932
+ function planImport(file, target) {
64933
+ const blockers = [];
64934
+ const names = new Set(file.vertices.map((v) => v.attributes.name));
64935
+ const dangling = file.edges.filter((e) => !names.has(e.sourceExternalId) || !names.has(e.targetExternalId));
64936
+ if (dangling.length) {
64937
+ blockers.push(`links to services not in the file: ${dangling.map((e) => `${e.sourceExternalId}→${e.targetExternalId}`).join(', ')}`);
64938
+ }
64939
+ const metricsDropped = [];
64940
+ const metricsKeptFromTarget = [];
64941
+ const vertices = file.vertices.map((v) => {
64942
+ const name = v.attributes.name;
64943
+ const current = target.vertices[name];
64944
+ const fileMetrics = v.attributes.metrics ?? [];
64945
+ if (!current) {
64946
+ if (fileMetrics.length)
64947
+ metricsDropped.push(name);
64948
+ return { ...v, externalId: name, attributes: { ...v.attributes, root_service: null, metrics: [] } };
64949
+ }
64950
+ const targetMetrics = current.attributes.metrics ?? [];
64951
+ if (JSON.stringify(fileMetrics) !== JSON.stringify(targetMetrics))
64952
+ metricsKeptFromTarget.push(name);
64953
+ return { ...v, externalId: name, attributes: { ...v.attributes, root_service: null, metrics: targetMetrics } };
64954
+ });
64955
+ const body = { vertices, edges: file.edges };
64956
+ for (const parent of names) {
64957
+ try {
64958
+ ServiceTransform.assertWeightsWithinLimit(file.edges, parent);
64959
+ }
64960
+ catch (e) {
64961
+ blockers.push(`'${parent}': ${e.message}`);
64962
+ }
64963
+ }
64964
+ const after = {
64965
+ vertices: { ...target.vertices, ...Object.fromEntries(vertices.map((v) => [v.attributes.name, v])) },
64966
+ edges: [...target.edges.filter((e) => !names.has(e.sourceExternalId)), ...file.edges],
64967
+ };
64968
+ const diff = ServiceBulk.diffGraphs(target, after).filter((d) => names.has(d.service));
64969
+ const created = diff.filter((d) => d.status === 'created').map((d) => d.service).sort();
64970
+ const overwritten = diff.filter((d) => d.status === 'changed');
64971
+ const unchanged = [...names].filter((n) => target.vertices[n] && !overwritten.some((d) => d.service === n)).sort();
64972
+ return {
64973
+ body,
64974
+ created,
64975
+ overwritten,
64976
+ unchanged,
64977
+ metricsDropped: metricsDropped.sort(),
64978
+ metricsKeptFromTarget: metricsKeptFromTarget.sort(),
64979
+ blockers,
64980
+ };
64981
+ }
64982
+ ServiceImport.planImport = planImport;
64983
+ /** Stable short hash of what an import would change; the apply must present it when overwriting. */
64984
+ function importToken(plan) {
64985
+ return cyrb53(JSON.stringify({ created: plan.created, overwritten: plan.overwritten }))
64986
+ .toString(16)
64987
+ .padStart(14, '0')
64988
+ .slice(0, 10);
64989
+ }
64990
+ ServiceImport.importToken = importToken;
64991
+ })(ServiceImport || (ServiceImport = {}));
64992
+
63977
64993
  var OIService;
63978
64994
  (function (OIService) {
63979
64995
  /** @internal */
@@ -64209,7 +65225,7 @@ var OIService;
64209
65225
  OIService.DEFAULT_SERVICE_REQUEST_PROJECTION_FILTER = ["maintenance", "availability_lastday", "availability", "health", "extId", "name", "risk", "trend", "healthBucket"];
64210
65226
  OIService.TYPICAL_SERVICE_REQUEST_PROJECTION_FILTER = ["rollupFilteredAlarmCount", "situationCount", "availability", "filteredParent", "availability_lastday",
64211
65227
  "immediateFilteredChildren", "immediateFilterChildrenCount", "health", "extId", "location", "maintenance",
64212
- "name", "risk", "status", "tags", "serviceMetricGroups", "healthBucket"];
65228
+ "name", "risk", "status", "tags", "serviceMetricGroups", "healthBucket", "customProperties"];
64213
65229
  /** @internal */
64214
65230
  OIService.DEFAULT_SERVICE_REQUEST_BODY = {
64215
65231
  "time": DateTime.now().toMillis(),
@@ -66374,6 +67390,82 @@ const serviceDetailResponseBody = {
66374
67390
  },
66375
67391
  };
66376
67392
 
67393
+ /** How far back a listed service metric counts as published. */
67394
+ const SERVICE_METRIC_PRESENCE_WINDOW_MS = 30 * 86_400_000;
67395
+ /**
67396
+ * Marks each metric a service record lists with `published`: whether the metric store holds it within
67397
+ * {@link SERVICE_METRIC_PRESENCE_WINDOW_MS}. A service record lists `service_availability` for every service, but the
67398
+ * platform computes it only when the service has an `availability` metric configured (measured 2026-10-26 across 108
67399
+ * services: none of the 93 without one had it in 30 days; 10 of the 15 with one did), so an agent that reads the id
67400
+ * from the record otherwise spends calls on a metric that does not exist. `service_health` / `service_risk` were
67401
+ * published for all 108.
67402
+ */
67403
+ function markServiceMetricPresence(overview, publishedIds) {
67404
+ const metrics = overview.attributes.metrics ?? [];
67405
+ const configured = metrics.find((m) => m.type === 'availability');
67406
+ const marked = metrics.map((m) => {
67407
+ if (publishedIds.has(m.id))
67408
+ return { ...m, published: true };
67409
+ const note = m.type === 'service_availability' && !configured
67410
+ ? 'Never computed: a service publishes service_availability only when it has an availability metric configured, and this one has none. Read service_health and service_risk instead.'
67411
+ : m.type === 'service_availability' && configured
67412
+ ? `Not published in the last 30 days, although an availability metric is configured (${configured.attributeName}): that metric may not be reporting.`
67413
+ : 'Not published in the last 30 days: there is no data under this id.';
67414
+ return { ...m, published: false, note };
67415
+ });
67416
+ return { ...overview, attributes: { ...overview.attributes, metrics: marked } };
67417
+ }
67418
+ // export const SERVICE_OVERVIEW_EXAMPLE: ServiceOverviewVertex = {
67419
+ // externalId:
67420
+ // 'SA:AA0725E0-0402-4320-A2B7-407025E9D673:2ee14366-6460-4606-9d5b-fbae9a4100b6',
67421
+ // attributes: {
67422
+ // type: 'saService',
67423
+ // name: 'ACME NetOps Salisbury DC - NetOps-O2',
67424
+ // state: 'ACTIVE',
67425
+ // root_service: ['ACME NetOps Salisbury DC - NetOps-O2'],
67426
+ // serviceContent: [],
67427
+ // tags: [],
67428
+ // location: '',
67429
+ // source: 'OI',
67430
+ // description: '',
67431
+ // createTimestamp: 1744572230371,
67432
+ // timestamp: 1744589912503,
67433
+ // maintenance: false,
67434
+ // situationsIncludeChildServices: false,
67435
+ // restrictSLOOnMaintenance: false,
67436
+ // serviceType: 'service',
67437
+ // customProperties: [],
67438
+ // metrics: [
67439
+ // {
67440
+ // type: 'service_risk',
67441
+ // sourceName: 'OI|SA|SERVICES|ALL',
67442
+ // attributeName: '2ee14366-6460-4606-9d5b-fbae9a4100b6:service_risk',
67443
+ // id: 'f.l-AE-H9B-OopMDK0B',
67444
+ // firstSeen: 1744571774000,
67445
+ // },
67446
+ // {
67447
+ // type: 'service_health',
67448
+ // sourceName: 'OI|SA|SERVICES|ALL',
67449
+ // attributeName: '2ee14366-6460-4606-9d5b-fbae9a4100b6:service_health',
67450
+ // id: '7Nm-AAB-H9B-kB8SIJ0B',
67451
+ // firstSeen: 1744571774000,
67452
+ // },
67453
+ // {
67454
+ // type: 'service_availability',
67455
+ // sourceName: 'OI|SA|SERVICES|ALL',
67456
+ // attributeName:
67457
+ // '2ee14366-6460-4606-9d5b-fbae9a4100b6:service_availability',
67458
+ // id: 'ddm-AAB-H9B-BCFeKK0B',
67459
+ // firstSeen: 1744571774000,
67460
+ // },
67461
+ // ],
67462
+ // customMetrics: [],
67463
+ // },
67464
+ // endTime: 7537103999999,
67465
+ // id: 3330,
67466
+ // startTime: 1744589912513,
67467
+ // };
67468
+
66377
67469
  var SituationLifecycle;
66378
67470
  (function (SituationLifecycle) {
66379
67471
  })(SituationLifecycle || (SituationLifecycle = {}));
@@ -70640,7 +71732,283 @@ class AgentService {
70640
71732
  }
70641
71733
  }
70642
71734
 
70643
- var DEFAULT_ALARMS_REQUEST_BODY$1 = OIAlarm.DEFAULT_ALARMS_REQUEST_BODY;
71735
+ /**
71736
+ * Most alarms one `oi/v2/api/alarms/_search` request returns, whatever
71737
+ * `pageSize` asks for (1001, 2000 and 5000 all answered 1000; measured on
71738
+ * demo-dev 2026-10-22). `pageNumber` > 0 answers an empty page, so a range
71739
+ * holding more alarms can only be read by splitting it.
71740
+ */
71741
+ const ALARM_SEARCH_PAGE_CAP = 1000;
71742
+ /**
71743
+ * A complete read of an alarm range was not possible. Thrown instead of
71744
+ * returning a partial set, so a caller never mistakes a short list for the
71745
+ * whole range.
71746
+ */
71747
+ class IncompleteAlarmSearchError extends Error {
71748
+ reason;
71749
+ expected;
71750
+ retrieved;
71751
+ constructor(reason, expected, retrieved, detail) {
71752
+ super(`Alarm search incomplete (${reason}): ${detail}`);
71753
+ this.reason = reason;
71754
+ this.expected = expected;
71755
+ this.retrieved = retrieved;
71756
+ this.name = 'IncompleteAlarmSearchError';
71757
+ }
71758
+ }
71759
+ const updatedAt = (alarm) => Number(alarm.lastUpdateTime ?? 0);
71760
+ /**
71761
+ * Reads every alarm in `[from, to]`, splitting the range until each window
71762
+ * fits in one response.
71763
+ *
71764
+ * A window holds every alarm whose lifetime (`timeOrigin` to `closedTime`, or
71765
+ * now) overlaps it, so windows overlap and their counts do not add up; their
71766
+ * union is the range (measured: 448 of 448, 300 of them in both halves). The
71767
+ * merge keys on `alarmId` and keeps the copy with the later `lastUpdateTime`.
71768
+ *
71769
+ * Fails with {@link IncompleteAlarmSearchError} instead of returning less:
71770
+ * - `unsplittable` — more alarms than one response holds are present at a
71771
+ * single instant (every window containing it is over the cap);
71772
+ * - `changed` — the range's count moved during the read, or the merged set
71773
+ * does not match it (alarms arriving or backdated into the range);
71774
+ * - `request-budget` — `maxRequests` ran out.
71775
+ */
71776
+ async function searchAlarmWindows(search, from, to, options = {}) {
71777
+ const concurrency = options.concurrency ?? 4;
71778
+ const maxRequests = options.maxRequests ?? 2000;
71779
+ const log = options.log ?? new Logging.NullSimpleLog();
71780
+ const alarms = new Map();
71781
+ let requests = 0;
71782
+ let windows = 0;
71783
+ let expected = 0;
71784
+ const merge = (page) => {
71785
+ for (const alarm of page.alarms) {
71786
+ const seen = alarms.get(alarm.alarmId);
71787
+ if (!seen || updatedAt(alarm) > updatedAt(seen))
71788
+ alarms.set(alarm.alarmId, alarm);
71789
+ }
71790
+ };
71791
+ const complete = (page) => page.count <= page.alarms.length;
71792
+ const request = async (w) => {
71793
+ if (requests >= maxRequests) {
71794
+ throw new IncompleteAlarmSearchError('request-budget', expected, alarms.size, `${maxRequests} requests made, ${alarms.size} of ${expected} alarms read`);
71795
+ }
71796
+ requests++;
71797
+ return search(w.from, w.to);
71798
+ };
71799
+ const first = await request({ from, to });
71800
+ expected = first.count;
71801
+ if (complete(first)) {
71802
+ merge(first);
71803
+ return { alarms, expected, requests, windows: 1 };
71804
+ }
71805
+ log.info(`${expected} alarms in range; reading it in windows of at most ${ALARM_SEARCH_PAGE_CAP}`);
71806
+ const pending = [{ from, to }];
71807
+ const split = (w) => {
71808
+ const mid = Math.floor((w.from + w.to) / 2);
71809
+ return [
71810
+ { from: w.from, to: mid },
71811
+ { from: mid, to: w.to },
71812
+ ];
71813
+ };
71814
+ const readWindow = async (w) => {
71815
+ if (w.to - w.from <= 1) {
71816
+ const page = await request(w);
71817
+ if (complete(page)) {
71818
+ merge(page);
71819
+ windows++;
71820
+ return [];
71821
+ }
71822
+ throw new IncompleteAlarmSearchError('unsplittable', expected, alarms.size, `${page.count} alarms are present at ${new Date(w.from).toISOString()}; ` +
71823
+ `one response holds at most ${page.alarms.length}`);
71824
+ }
71825
+ const page = await request(w);
71826
+ if (complete(page)) {
71827
+ merge(page);
71828
+ windows++;
71829
+ return [];
71830
+ }
71831
+ const mid = Math.floor((w.from + w.to) / 2);
71832
+ const instant = await request({ from: mid, to: mid + 1 });
71833
+ if (!complete(instant)) {
71834
+ throw new IncompleteAlarmSearchError('unsplittable', expected, alarms.size, `${instant.count} alarms are present at ${new Date(mid).toISOString()}; ` +
71835
+ `one response holds at most ${instant.alarms.length}`);
71836
+ }
71837
+ return split(w);
71838
+ };
71839
+ // Split the root once without re-reading it.
71840
+ pending.splice(0, 1, ...split({ from, to }));
71841
+ while (pending.length > 0) {
71842
+ const batch = pending.splice(0, concurrency);
71843
+ const next = await Promise.all(batch.map(readWindow));
71844
+ pending.push(...next.flat());
71845
+ }
71846
+ const last = await request({ from, to });
71847
+ if (last.count !== expected || alarms.size !== expected) {
71848
+ throw new IncompleteAlarmSearchError('changed', expected, alarms.size, `the range held ${expected} alarms at the start, ${last.count} at the end, ` +
71849
+ `and ${alarms.size} were read; alarms arrived or changed during the read`);
71850
+ }
71851
+ log.info(`Read ${alarms.size} alarms in ${windows} windows (${requests} requests)`);
71852
+ return { alarms, expected, requests, windows };
71853
+ }
71854
+
71855
+ /**
71856
+ * Most records one analytics query can reach: `from + size` over 10000 is
71857
+ * rejected ("Result window is too large"), and a count above it comes back as
71858
+ * a lower bound (`relation: gte`).
71859
+ */
71860
+ const ALARM_RECORD_WINDOW_CAP = 10_000;
71861
+ const ALARM_RECORD_PAGE_SIZE = 1000;
71862
+ /** An instant as the index's query syntax wants it: whole seconds, `+0000` (`Z` matches nothing). */
71863
+ const alarmRecordTime = (ms) => new Date(ms).toISOString().replace(/\.\d{3}Z$/, '+0000');
71864
+ /** Epoch ms of an index time such as `2026-10-22T06:17:39+0000`. */
71865
+ const parseAlarmRecordTime = (value) => Date.parse(value.replace(/([+-]\d{2})(\d{2})$/, '$1:$2'));
71866
+ const windowQuery = (segment, from, to) => {
71867
+ const range = `${segment.field}:[${alarmRecordTime(from)} TO ${alarmRecordTime(to)}}`;
71868
+ return segment.extra ? `${range} AND (${segment.extra})` : range;
71869
+ };
71870
+ /**
71871
+ * Streams every alarm record that `match` selects in `[from, to)`, in open-time
71872
+ * order, reading the analytics index in windows of at most
71873
+ * {@link ALARM_RECORD_WINDOW_CAP} records.
71874
+ *
71875
+ * First the range is planned: count-only requests split it until each window
71876
+ * holds at most the cap, which gives the exact total (the index itself reports
71877
+ * any total over 10000 as "at least 10000"). Then each window is paged with a
71878
+ * fixed sort and checked: the records read must be exactly its planned count. Otherwise it throws
71879
+ * {@link IncompleteAlarmSearchError} rather than yielding a partial export:
71880
+ * - `changed` — the window's count or contents moved during the read;
71881
+ * - `unsplittable` — more than 10000 records share one second;
71882
+ * - `request-budget` — `maxRequests` ran out.
71883
+ * Records already yielded stay valid; the error says where the export stopped.
71884
+ */
71885
+ async function* exportAlarmRecords(source, from, to, match, options = {}) {
71886
+ const maxRequests = options.maxRequests ?? 20_000;
71887
+ const windowCap = options.windowCap ?? ALARM_RECORD_WINDOW_CAP;
71888
+ const pageSize = options.pageSize ?? ALARM_RECORD_PAGE_SIZE;
71889
+ const log = options.log ?? new Logging.NullSimpleLog();
71890
+ const start = Math.floor(from / 1000) * 1000;
71891
+ const end = Math.ceil(to / 1000) * 1000;
71892
+ let requests = 0;
71893
+ let exported = 0;
71894
+ const call = async (fn) => {
71895
+ if (requests >= maxRequests) {
71896
+ throw new IncompleteAlarmSearchError('request-budget', exported, exported, `${maxRequests} requests made; ${exported} alarms exported before stopping`);
71897
+ }
71898
+ requests++;
71899
+ return fn();
71900
+ };
71901
+ const segments = [];
71902
+ if (match === 'opened')
71903
+ segments.push({ field: 'startTime', from: start, to: end });
71904
+ if (match === 'closed')
71905
+ segments.push({ field: 'closedTime', from: start, to: end });
71906
+ if (match === 'active') {
71907
+ segments.push({ field: 'startTime', from: start, to: end });
71908
+ // Opened earlier and still open at `from`: closed after it, or not closed.
71909
+ const stillOpen = `closedTime:{${alarmRecordTime(start)} TO *] OR (*:* -_exists_:closedTime)`;
71910
+ const earlier = `startTime:[* TO ${alarmRecordTime(start)}} AND (${stillOpen})`;
71911
+ const [first] = await call(() => source.page(earlier, 0, 1));
71912
+ if (first) {
71913
+ const earliest = Math.floor(parseAlarmRecordTime(first.startTime) / 1000) * 1000;
71914
+ segments.unshift({ field: 'startTime', from: earliest, to: start, extra: stillOpen });
71915
+ }
71916
+ }
71917
+ const startedAt = Date.now();
71918
+ // Plan: split until every window's count is exact and within the cap.
71919
+ const plan = async (segment, a, b, out) => {
71920
+ const count = await call(() => source.count(windowQuery(segment, a, b)));
71921
+ if (count.exact && count.total <= windowCap) {
71922
+ if (count.total > 0)
71923
+ out.push({ segment, from: a, to: b, count: count.total });
71924
+ return;
71925
+ }
71926
+ if (b - a <= 1000) {
71927
+ throw new IncompleteAlarmSearchError('unsplittable', count.total, 0, `more than ${windowCap} alarms at ${alarmRecordTime(a)}; nothing was exported`);
71928
+ }
71929
+ const mid = a + Math.floor((b - a) / 2000) * 1000;
71930
+ await plan(segment, a, mid, out);
71931
+ await plan(segment, mid, b, out);
71932
+ };
71933
+ const windows = [];
71934
+ for (const segment of segments) {
71935
+ if (segment.to > segment.from)
71936
+ await plan(segment, segment.from, segment.to, windows);
71937
+ }
71938
+ const total = windows.reduce((sum, w) => sum + w.count, 0);
71939
+ options.onPlan?.({ total, windows: windows.length, elapsedMs: Date.now() - startedAt });
71940
+ // Read: page each window with a fixed sort; it must still hold its planned count.
71941
+ for (const [i, w] of windows.entries()) {
71942
+ const query = windowQuery(w.segment, w.from, w.to);
71943
+ const records = [];
71944
+ const ids = new Set();
71945
+ for (let offset = 0; offset < w.count; offset += pageSize) {
71946
+ const page = await call(() => source.page(query, offset, pageSize));
71947
+ if (page.length === 0)
71948
+ break;
71949
+ for (const record of page) {
71950
+ if (!ids.has(record.alarm_unique_id)) {
71951
+ ids.add(record.alarm_unique_id);
71952
+ records.push(record);
71953
+ }
71954
+ }
71955
+ }
71956
+ const recount = await call(() => source.count(query));
71957
+ if (ids.size !== w.count || recount.total !== w.count) {
71958
+ throw new IncompleteAlarmSearchError('changed', total, exported, `window ${alarmRecordTime(w.from)} – ${alarmRecordTime(w.to)} held ${w.count} alarms when planned, ` +
71959
+ `${recount.total} after reading, and ${ids.size} distinct were read; ` +
71960
+ `${exported} of ${total} exported before it. Alarms changed during the read — retry, or end the range further in the past`);
71961
+ }
71962
+ for (const record of records) {
71963
+ exported++;
71964
+ yield record;
71965
+ }
71966
+ options.onWindow?.({
71967
+ from: w.from,
71968
+ to: w.to,
71969
+ records: records.length,
71970
+ index: i + 1,
71971
+ windows: windows.length,
71972
+ exported,
71973
+ total,
71974
+ elapsedMs: Date.now() - startedAt,
71975
+ });
71976
+ }
71977
+ log.info(`Exported ${exported} alarms (${requests} requests)`);
71978
+ }
71979
+
71980
+ /**
71981
+ * Events per `oi/v2/api/alarms/lifecycle/_search` request. The endpoint
71982
+ * reports `totalCount` and pages exactly: for an alarm with 54 events and a
71983
+ * situation with 69, pages of 10 or 20 equalled one read of 1000, same set
71984
+ * and order (THE_LABORATORY and demo-dev, 2026-10-22).
71985
+ */
71986
+ const LIFECYCLE_PAGE_SIZE = 1000;
71987
+ /**
71988
+ * Reads every page of a lifecycle (alarm or situation) until the server's
71989
+ * `totalCount` is reached. `totalCount` is returned as the server reported
71990
+ * it; if a page comes back empty first, the result holds fewer events and a
71991
+ * warning is logged, so a short read stays visible.
71992
+ */
71993
+ async function readLifecyclePages(fetchPage, label, log) {
71994
+ const events = [];
71995
+ let totalCount = '0';
71996
+ for (let pageNumber = 0;; pageNumber++) {
71997
+ const page = await fetchPage(pageNumber, LIFECYCLE_PAGE_SIZE);
71998
+ totalCount = page.totalCount ?? totalCount;
71999
+ const pageEvents = page.lifecycle_events ?? [];
72000
+ events.push(...pageEvents);
72001
+ if (events.length >= Number(totalCount))
72002
+ break;
72003
+ if (pageEvents.length === 0) {
72004
+ log.warn(`Lifecycle of ${label} stopped at ${events.length} of ${totalCount} events: page ${pageNumber} was empty`);
72005
+ break;
72006
+ }
72007
+ }
72008
+ return { totalCount, lifecycle_events: events };
72009
+ }
72010
+
72011
+ var newAlarmSearchBody = OIAlarm.newAlarmSearchBody;
70644
72012
  /**
70645
72013
  * Service for OI alarms: get, search, assign, acknowledge, clear, lifecycle,
70646
72014
  * enrichment rules, alarm queues, and related alarms.
@@ -70673,11 +72041,7 @@ class AlarmService {
70673
72041
  */
70674
72042
  async findAlarm(alarmId, lookbackMs, requestOverrides = {}) {
70675
72043
  const now = Date.now();
70676
- const body = {
70677
- ...DEFAULT_ALARMS_REQUEST_BODY$1,
70678
- timeFrom: now - lookbackMs,
70679
- timeTo: now,
70680
- pageNumber: 0,
72044
+ const body = newAlarmSearchBody(now - lookbackMs, now, {
70681
72045
  pageSize: 10,
70682
72046
  includeClosedAlarms: true,
70683
72047
  customFilter: {
@@ -70698,30 +72062,20 @@ class AlarmService {
70698
72062
  ],
70699
72063
  },
70700
72064
  },
70701
- };
72065
+ });
70702
72066
  const response = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', body, undefined, undefined, requestOverrides);
70703
72067
  return (response.alarms ?? []).find((alarm) => alarm.alarmId === alarmId);
70704
72068
  }
70705
- /** Returns the overview (first alarm in a custom-filter search) for an alarm ID. */
72069
+ /**
72070
+ * Returns an open alarm of the last 30 days by its ID (the payload a channel
72071
+ * notification sends).
72072
+ *
72073
+ * @throws Error when no open alarm has that ID.
72074
+ */
70706
72075
  async getAlarmOverview(alarmId) {
70707
- const singleAlarmQuery = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', {
70708
- deviceNames: [],
70709
- includeDeviceTypes: [],
70710
- excludeDeviceTypes: [],
70711
- groups: [],
70712
- like: '',
70713
- timeFrom: Date.now(),
70714
- timeTo: Date.now() - 30 * 24 * 60 * 60 * 1000,
70715
- pageNumber: 0,
70716
- pageSize: 50,
70717
- services: [],
70718
- includeSeverity: [],
70719
- allOtherSeverity: false,
72076
+ const now = Date.now();
72077
+ const singleAlarmQuery = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', newAlarmSearchBody(now - 30 * 24 * 60 * 60 * 1000, now, {
70720
72078
  sortCol: '',
70721
- includeAlarmTypes: [],
70722
- excludeAlarmTypes: [],
70723
- includeClosedAlarms: false,
70724
- showMaintenanceAlarms: false,
70725
72079
  showAlarmsPartOfSituations: false,
70726
72080
  customFilter: {
70727
72081
  and: {
@@ -70741,13 +72095,12 @@ class AlarmService {
70741
72095
  ],
70742
72096
  },
70743
72097
  },
70744
- });
70745
- if (singleAlarmQuery.alarmCount) {
70746
- return singleAlarmQuery.alarms[0];
70747
- }
70748
- else {
70749
- throw new Error('Bad Alarm Query');
72098
+ }));
72099
+ const alarm = singleAlarmQuery.alarms?.[0];
72100
+ if (Number(singleAlarmQuery.alarmCount) > 0 && alarm) {
72101
+ return alarm;
70750
72102
  }
72103
+ throw new Error(`No open alarm ${alarmId} in the last 30 days`);
70751
72104
  }
70752
72105
  /** Sends a notification for an alarm to the specified channel with optional template/locale. */
70753
72106
  async triggerNotification(alarmId, notificationChannelName, template = '', locale = 'en-US') {
@@ -70864,12 +72217,20 @@ class AlarmService {
70864
72217
  this.simpleLog.debug('update request body', JSON.stringify(body, null, 2));
70865
72218
  return this.dxSaaSService.tenantPost('jarvis/v2/ingestion', body, {}, headers);
70866
72219
  }
70867
- /** Returns the lifecycle event history for a given alarm ID. */
72220
+ /**
72221
+ * Returns an alarm's whole lifecycle event history, newest first.
72222
+ *
72223
+ * @remarks Reads pages of 1000 until the server's `totalCount` is reached
72224
+ * (it used to ask for 20 and stop, dropping the oldest events, "Alarm
72225
+ * Opened" first). `totalCount` is returned as the server reported it; if a
72226
+ * page comes back empty early, the result holds fewer events and a warning
72227
+ * is logged.
72228
+ */
70868
72229
  async getAlarmLifeCycle(alarmId) {
70869
- const alarmLifeCycleRequestBody = {
70870
- alarmId: alarmId,
70871
- pageSize: '20',
70872
- pageNumber: '0',
72230
+ return readLifecyclePages((pageNumber, pageSize) => this.dxSaaSService.oiPost('oi/v2/api/alarms/lifecycle/_search', {
72231
+ alarmId,
72232
+ pageSize: String(pageSize),
72233
+ pageNumber: String(pageNumber),
70873
72234
  sortCol: 'timestamp:desc',
70874
72235
  excludeFields: [
70875
72236
  'isolation_view_link',
@@ -70877,38 +72238,101 @@ class AlarmService {
70877
72238
  'alert_definition_link',
70878
72239
  'occurrence',
70879
72240
  ],
70880
- };
70881
- return this.dxSaaSService.oiPost('oi/v2/api/alarms/lifecycle/_search', alarmLifeCycleRequestBody);
72241
+ }), `alarm ${alarmId}`, this.simpleLog);
70882
72242
  }
70883
- /** Returns all alarms within a time range, with optional type/closed/filter params. */
70884
- async getAlarms(startTime, endTime, includedAlarmTypes = [], includeClosed = false, pageSize = 100, alarmFilter) {
70885
- const alarmRequestBody = {
70886
- ...DEFAULT_ALARMS_REQUEST_BODY$1,
70887
- };
70888
- alarmRequestBody.timeFrom = startTime.toMillis();
70889
- alarmRequestBody.timeTo = endTime.toMillis();
70890
- const alarmIdMap = new Map();
70891
- alarmRequestBody.includeAlarmTypes = includedAlarmTypes;
70892
- alarmRequestBody.includeClosedAlarms = includeClosed;
70893
- alarmRequestBody.pageSize = pageSize;
70894
- if (alarmFilter) {
70895
- alarmRequestBody.customFilter = alarmFilter;
70896
- }
70897
- this.simpleLog.info(`Retrieving first page of alarms with page size ${pageSize}`);
70898
- const alarmFirstPage = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', alarmRequestBody);
70899
- function mapAlarms(alarms) {
70900
- alarms.forEach((alarm) => {
70901
- if (!alarmIdMap.has(alarm.alarmId)) {
70902
- alarmIdMap.set(alarm.alarmId, alarm);
72243
+ /**
72244
+ * One alarm search over `[startTime, endTime]`: the exact number of alarms
72245
+ * in the range and the first `pageSize` of them (at most
72246
+ * {@link ALARM_SEARCH_PAGE_CAP}, whatever is asked). Use it where a sample
72247
+ * plus the true total is enough; {@link getAlarms} reads the whole range.
72248
+ */
72249
+ async searchAlarmPage(startTime, endTime, includedAlarmTypes = [], includeClosed = false, pageSize = ALARM_SEARCH_PAGE_CAP, alarmFilter) {
72250
+ return this.searchPage(startTime.toMillis(), endTime.toMillis(), {
72251
+ includedAlarmTypes,
72252
+ includeClosed,
72253
+ pageSize,
72254
+ alarmFilter,
72255
+ });
72256
+ }
72257
+ /**
72258
+ * Returns every alarm in `[startTime, endTime]`, keyed by `alarmId`.
72259
+ *
72260
+ * One search returns at most {@link ALARM_SEARCH_PAGE_CAP} alarms and cannot
72261
+ * be paged, so a larger range is read in windows and merged
72262
+ * (`searchAlarmWindows`). A window holds every alarm whose lifetime overlaps
72263
+ * it, so long-open alarms appear in all of them; the merge keeps one copy.
72264
+ *
72265
+ * @param pageSize - Ignored: each request asks for the server's
72266
+ * maximum. Kept for signature compatibility.
72267
+ * @throws IncompleteAlarmSearchError when the whole range cannot be read:
72268
+ * more alarms than one response holds at a single instant, alarms arriving
72269
+ * or backdated into the range during the read, or the request budget spent.
72270
+ * A partial set is never returned.
72271
+ */
72272
+ async getAlarms(startTime, endTime, includedAlarmTypes = [], includeClosed = false,
72273
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
72274
+ pageSize = 100, alarmFilter, options = {}) {
72275
+ const result = await searchAlarmWindows((from, to) => this.searchPage(from, to, {
72276
+ includedAlarmTypes,
72277
+ includeClosed,
72278
+ pageSize: ALARM_SEARCH_PAGE_CAP,
72279
+ alarmFilter,
72280
+ }), startTime.toMillis(), endTime.toMillis(), { log: this.simpleLog, ...options });
72281
+ this.simpleLog.info(`Retrieved ${result.alarms.size} of ${result.expected} alarms`);
72282
+ return result.alarms;
72283
+ }
72284
+ /**
72285
+ * Streams every alarm that `match` selects in `[startTime, endTime)` from the
72286
+ * alarms analytics index (`GET oi/v2/aoanalytics/alarms/alarms_all/_search`),
72287
+ * in open-time order — for exports over long ranges.
72288
+ *
72289
+ * Unlike {@link getAlarms} (the alarm search: every alarm active in the range,
72290
+ * 1000 per request), the index filters on the open or close time directly
72291
+ * and allows windows of 10000, so alarms that stay open do not crowd the
72292
+ * windows. Records are the stored documents (see `AlarmRecordSchema`).
72293
+ *
72294
+ * @remarks Responses are validated, not thrown on. The export throws
72295
+ * `IncompleteAlarmSearchError` when a window changes while it is read or
72296
+ * cannot be split; records already yielded are complete and in order.
72297
+ */
72298
+ exportAlarmRecords(startTime, endTime, match = 'opened', options = {}) {
72299
+ // One short warning per distinct mismatch, not one issue dump per page.
72300
+ const warned = new Set();
72301
+ const search = async (params) => {
72302
+ const raw = await this.dxSaaSService.oiGet('oi/v2/aoanalytics/alarms/alarms_all/_search', params);
72303
+ const parsed = AlarmRecordSearchResponseSchema.safeParse(raw);
72304
+ if (!parsed.success) {
72305
+ const fields = [
72306
+ ...new Set(parsed.error.issues.map((issue) => `${issue.path.map((p) => (typeof p === 'number' ? '*' : String(p))).join('.')} (${issue.message})`)),
72307
+ ].join('; ');
72308
+ if (!warned.has(fields)) {
72309
+ warned.add(fields);
72310
+ this.simpleLog.warn(`AlarmRecordSearchResponse validation warning: ${fields}`);
70903
72311
  }
70904
- });
70905
- }
70906
- this.simpleLog.info(`Retrieving ${alarmFirstPage.alarmCount} alarms`);
70907
- alarmRequestBody.pageSize = alarmFirstPage.alarmCount;
70908
- const alarmAllPage = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', alarmRequestBody);
70909
- this.simpleLog.info(`Retrieved ${alarmAllPage.alarms.length} of ${alarmFirstPage.alarmCount} alarms`);
70910
- mapAlarms(alarmAllPage.alarms);
70911
- return alarmIdMap;
72312
+ }
72313
+ return raw;
72314
+ };
72315
+ const source = {
72316
+ count: async (q) => {
72317
+ const total = (await search({ q, size: 0 })).hits?.total;
72318
+ return { total: total?.value ?? 0, exact: total?.relation === 'eq' };
72319
+ },
72320
+ page: async (q, from, size) => ((await search({ q, from, size, sort: 'startTime:asc,alarm_unique_id:asc' })).hits?.hits ?? []).map((hit) => hit._source),
72321
+ };
72322
+ return exportAlarmRecords(source, startTime.toMillis(), endTime.toMillis(), match, {
72323
+ log: this.simpleLog,
72324
+ ...options,
72325
+ });
72326
+ }
72327
+ async searchPage(timeFrom, timeTo, query) {
72328
+ const body = newAlarmSearchBody(timeFrom, timeTo, {
72329
+ includeAlarmTypes: query.includedAlarmTypes,
72330
+ includeClosedAlarms: query.includeClosed,
72331
+ pageSize: Math.min(Math.max(query.pageSize, 1), ALARM_SEARCH_PAGE_CAP),
72332
+ ...(query.alarmFilter ? { customFilter: query.alarmFilter } : {}),
72333
+ });
72334
+ const response = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', body);
72335
+ return { count: Number(response.alarmCount ?? 0), alarms: response.alarms ?? [] };
70912
72336
  }
70913
72337
  /**
70914
72338
  * Lists every alarm enrichment rule of the tenant
@@ -71267,7 +72691,7 @@ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
71267
72691
  var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
71268
72692
  var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
71269
72693
  var booleanValueOf = Boolean.prototype.valueOf;
71270
- var objectToString = Object.prototype.toString;
72694
+ var objectToString$1 = Object.prototype.toString;
71271
72695
  var functionToString = Function.prototype.toString;
71272
72696
  var $match = String.prototype.match;
71273
72697
  var $slice = String.prototype.slice;
@@ -71587,7 +73011,7 @@ function has$2(obj, key) {
71587
73011
  }
71588
73012
 
71589
73013
  function toStr$2(obj) {
71590
- return objectToString.call(obj);
73014
+ return objectToString$1.call(obj);
71591
73015
  }
71592
73016
 
71593
73017
  function nameOf(f) {
@@ -72168,6 +73592,23 @@ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
72168
73592
  overflowChannel.set(obj, maxIndex);
72169
73593
  };
72170
73594
 
73595
+ // Track containers produced by a `strictMerge` conflict wrap, and their current max numeric index,
73596
+ // so repeated conflicts on one path append instead of nesting a new wrapper each time
73597
+ var conflictChannel = getSideChannel$1();
73598
+
73599
+ var markConflict = function markConflict(obj, maxIndex) {
73600
+ conflictChannel.set(obj, maxIndex);
73601
+ return obj;
73602
+ };
73603
+
73604
+ var isConflict = function isConflict(obj) {
73605
+ return conflictChannel.has(obj);
73606
+ };
73607
+
73608
+ var getConflictIndex = function getConflictIndex(obj) {
73609
+ return conflictChannel.get(obj);
73610
+ };
73611
+
72171
73612
  var hexTable = (function () {
72172
73613
  var array = [];
72173
73614
  for (var i = 0; i < 256; ++i) {
@@ -72220,6 +73661,30 @@ var setProperty = function setProperty(obj, key, value) {
72220
73661
  }
72221
73662
  };
72222
73663
 
73664
+ var maxNumericIndex = function maxNumericIndex(obj, min) {
73665
+ var max = min;
73666
+ var keys = Object.keys(obj);
73667
+ for (var i = 0; i < keys.length; ++i) {
73668
+ var num = parseInt(keys[i], 10);
73669
+ if (String(num) === keys[i] && num > max) {
73670
+ max = num;
73671
+ }
73672
+ }
73673
+
73674
+ return max;
73675
+ };
73676
+
73677
+ var limitedPair = function limitedPair(first, second, options) {
73678
+ var pair = [first, second];
73679
+ if (options && typeof options.arrayLimit === 'number' && pair.length > options.arrayLimit) {
73680
+ if (options.throwOnLimitExceeded) {
73681
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
73682
+ }
73683
+ return markOverflow(arrayToObject(pair, options), 1);
73684
+ }
73685
+ return pair;
73686
+ };
73687
+
72223
73688
  var merge = function merge(target, source, options) {
72224
73689
  /* eslint no-param-reassign: 0 */
72225
73690
  if (!source) {
@@ -72242,8 +73707,20 @@ var merge = function merge(target, source, options) {
72242
73707
  var newIndex = getMaxIndex(target) + 1;
72243
73708
  target[newIndex] = source;
72244
73709
  setMaxIndex(target, newIndex);
73710
+ } else if (options && options.strictMerge && isConflict(target)) {
73711
+ var nextConflict = getConflictIndex(target) + 1;
73712
+ if (
73713
+ options.throwOnLimitExceeded
73714
+ && typeof options.arrayLimit === 'number'
73715
+ && nextConflict >= options.arrayLimit
73716
+ ) {
73717
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
73718
+ }
73719
+ target[nextConflict] = source;
73720
+ markConflict(target, nextConflict);
72245
73721
  } else if (options && options.strictMerge) {
72246
- return [target, source];
73722
+ var conflict = limitedPair(target, source, options);
73723
+ return isArray$1(conflict) ? markConflict(conflict, 1) : conflict;
72247
73724
  } else if (
72248
73725
  (options && (options.plainObjects || options.allowPrototypes))
72249
73726
  || !has$1.call(Object.prototype, source)
@@ -72251,7 +73728,7 @@ var merge = function merge(target, source, options) {
72251
73728
  target[source] = true;
72252
73729
  }
72253
73730
  } else {
72254
- return [target, source];
73731
+ return limitedPair(target, source, options);
72255
73732
  }
72256
73733
 
72257
73734
  return target;
@@ -72283,6 +73760,10 @@ var merge = function merge(target, source, options) {
72283
73760
  var mergeTarget = target;
72284
73761
  if (isArray$1(target) && !isArray$1(source)) {
72285
73762
  mergeTarget = arrayToObject(target, options);
73763
+ if (isConflict(target)) {
73764
+ // the array may have grown past its last conflict, so continue after its last index
73765
+ markConflict(mergeTarget, target.length - 1);
73766
+ }
72286
73767
  }
72287
73768
 
72288
73769
  if (isArray$1(target) && isArray$1(source)) {
@@ -72317,7 +73798,7 @@ var merge = function merge(target, source, options) {
72317
73798
  }
72318
73799
 
72319
73800
  if (isOverflow(source) && !isOverflow(acc)) {
72320
- markOverflow(acc, getMaxIndex(source));
73801
+ markOverflow(acc, maxNumericIndex(acc, getMaxIndex(source)));
72321
73802
  }
72322
73803
  if (isOverflow(acc)) {
72323
73804
  var keyNum = parseInt(key, 10);
@@ -72325,6 +73806,12 @@ var merge = function merge(target, source, options) {
72325
73806
  setMaxIndex(acc, keyNum);
72326
73807
  }
72327
73808
  }
73809
+ if (isConflict(acc)) {
73810
+ var conflictKey = parseInt(key, 10);
73811
+ if (String(conflictKey) === key && conflictKey > getConflictIndex(acc)) {
73812
+ markConflict(acc, conflictKey);
73813
+ }
73814
+ }
72328
73815
 
72329
73816
  return acc;
72330
73817
  }, mergeTarget);
@@ -72338,6 +73825,13 @@ var assign = function assignSingleSource(target, source) {
72338
73825
  };
72339
73826
 
72340
73827
  var decode = function (str, defaultDecoder, charset) {
73828
+ // With no `%` there is no escape to expand, in either charset: `unescape` has
73829
+ // nothing to match, and `decodeURIComponent` is the identity on such a string
73830
+ // (and cannot throw). So only `+` -> ' ' remains, and often not even that.
73831
+ if (typeof str === 'string' && str.indexOf('%') === -1) {
73832
+ return str.indexOf('+') === -1 ? str : str.replace(/\+/g, ' ');
73833
+ }
73834
+
72341
73835
  var strWithoutPlus = str.replace(/\+/g, ' ');
72342
73836
  if (charset === 'iso-8859-1') {
72343
73837
  // unescape never throws, no try...catch needed:
@@ -72351,6 +73845,57 @@ var decode = function (str, defaultDecoder, charset) {
72351
73845
  }
72352
73846
  };
72353
73847
 
73848
+ var hasToPrimitive = typeof Symbol === 'function' && typeof Symbol.toPrimitive === 'symbol';
73849
+ var arrayJoin = Array.prototype.join;
73850
+ var arrayToString = Array.prototype.toString;
73851
+ var objectToString = Object.prototype.toString;
73852
+
73853
+ // an object with no callable toString (eg, from JSON, or null-prototype) would make String() or join() throw,
73854
+ // so it becomes its primitive valueOf or else Object.prototype.toString; arrays are walked like join walks them,
73855
+ // copied only once an element changes, with an array already being joined becoming '' as engines do for cycles
73856
+ var toCoercible = function toCoercible(value, joining) {
73857
+ if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
73858
+ return value;
73859
+ }
73860
+ if (hasToPrimitive && value[Symbol.toPrimitive] != null) {
73861
+ return value;
73862
+ }
73863
+ if (isArray$1(value) && value.toString === arrayToString && value.join === arrayJoin) {
73864
+ var ancestors = joining || getSideChannel$1();
73865
+ if (ancestors.has(value)) {
73866
+ return '';
73867
+ }
73868
+ ancestors.set(value, true);
73869
+ var copy;
73870
+ for (var i = 0; i < value.length; i += 1) {
73871
+ var item = value[i];
73872
+ var coerced = toCoercible(item, ancestors);
73873
+ if (!copy && coerced !== item) {
73874
+ copy = [];
73875
+ for (var j = 0; j < i; j += 1) {
73876
+ copy[j] = value[j];
73877
+ }
73878
+ }
73879
+ if (copy) {
73880
+ copy[i] = coerced;
73881
+ }
73882
+ }
73883
+ ancestors['delete'](value);
73884
+ return copy || value;
73885
+ }
73886
+ if (typeof value.toString === 'function') {
73887
+ return value;
73888
+ }
73889
+ var valueOf = value.valueOf;
73890
+ if (typeof valueOf === 'function') {
73891
+ var primitive = valueOf.call(value);
73892
+ if (!primitive || (typeof primitive !== 'object' && typeof primitive !== 'function')) {
73893
+ return String(primitive);
73894
+ }
73895
+ }
73896
+ return objectToString.call(value);
73897
+ };
73898
+
72354
73899
  var limit = 1024;
72355
73900
 
72356
73901
  /* eslint operator-linebreak: [2, "before"] */
@@ -72366,13 +73911,15 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
72366
73911
  if (typeof str === 'symbol') {
72367
73912
  string = Symbol.prototype.toString.call(str);
72368
73913
  } else if (typeof str !== 'string') {
72369
- string = String(str);
73914
+ string = String(toCoercible(str));
72370
73915
  }
72371
73916
 
72372
73917
  if (charset === 'iso-8859-1') {
73918
+ // `escape` leaves `+` untouched, but a literal `+` is decoded back to a space,
73919
+ // so it must be percent-encoded to round-trip (the utf-8 path already does this).
72373
73920
  return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
72374
73921
  return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
72375
- });
73922
+ }).replace(/\+/g, '%2B');
72376
73923
  }
72377
73924
 
72378
73925
  var out = '';
@@ -72524,7 +74071,8 @@ var utils$1 = {
72524
74071
  isRegExp: isRegExp,
72525
74072
  markOverflow: markOverflow,
72526
74073
  maybeMap: maybeMap,
72527
- merge: merge
74074
+ merge: merge,
74075
+ toCoercible: toCoercible
72528
74076
  };
72529
74077
 
72530
74078
  var getSideChannel = sideChannel;
@@ -72677,10 +74225,10 @@ var stringify$2 = function stringify(
72677
74225
  // we need to join elements in
72678
74226
  if (encodeValuesOnly && encoder) {
72679
74227
  obj = utils.maybeMap(obj, function (v) {
72680
- return v == null ? v : encoder(v);
74228
+ return v == null ? v : encoder(v, defaults.encoder, charset, 'value', format);
72681
74229
  });
72682
74230
  }
72683
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
74231
+ objKeys = [{ value: obj.length > 0 ? utils.toCoercible(obj).join(',') || null : void undefined }];
72684
74232
  } else if (isArray(filter)) {
72685
74233
  objKeys = filter;
72686
74234
  } else {
@@ -72688,7 +74236,7 @@ var stringify$2 = function stringify(
72688
74236
  objKeys = sort ? keys.sort(sort) : keys;
72689
74237
  }
72690
74238
 
72691
- var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
74239
+ var encodedPrefix = String(prefix);
72692
74240
 
72693
74241
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
72694
74242
 
@@ -72778,7 +74326,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
72778
74326
  }
72779
74327
 
72780
74328
  var arrayFormat;
72781
- if (opts.arrayFormat in arrayPrefixGenerators) {
74329
+ if (has.call(arrayPrefixGenerators, opts.arrayFormat)) {
72782
74330
  arrayFormat = opts.arrayFormat;
72783
74331
  } else if ('indices' in opts) {
72784
74332
  arrayFormat = opts.indices ? 'indices' : 'repeat';
@@ -80730,7 +82278,6 @@ class DxSaasService {
80730
82278
  }
80731
82279
  }
80732
82280
 
80733
- var DEFAULT_ALARMS_REQUEST_BODY = OIAlarm.DEFAULT_ALARMS_REQUEST_BODY;
80734
82281
  var DEFAULT_SITUATIONS_REQUEST_BODY = OIAlarm.DEFAULT_SITUATIONS_REQUEST_BODY;
80735
82282
  /**
80736
82283
  * Service for OI (Operations Intelligence) read operations: services, situations,
@@ -80738,9 +82285,11 @@ var DEFAULT_SITUATIONS_REQUEST_BODY = OIAlarm.DEFAULT_SITUATIONS_REQUEST_BODY;
80738
82285
  */
80739
82286
  class DxoiService {
80740
82287
  dxSaaSService;
82288
+ alarms;
80741
82289
  /** @param dxSaaSService - DX SaaS HTTP client for OI endpoints */
80742
82290
  constructor(dxSaaSService) {
80743
82291
  this.dxSaaSService = dxSaaSService;
82292
+ this.alarms = new AlarmService(dxSaaSService);
80744
82293
  }
80745
82294
  /** Returns top-level OI services using the default service request body. */
80746
82295
  getServices() {
@@ -80749,9 +82298,11 @@ class DxoiService {
80749
82298
  }
80750
82299
  /** Returns cluster alarms (situations) within the given time range. */
80751
82300
  async getSituations(startTime, endTime) {
80752
- const alarmRequestBody = DEFAULT_SITUATIONS_REQUEST_BODY;
80753
- alarmRequestBody.timeFrom = startTime.toMillis();
80754
- alarmRequestBody.timeTo = endTime.toMillis();
82301
+ const alarmRequestBody = {
82302
+ ...DEFAULT_SITUATIONS_REQUEST_BODY,
82303
+ timeFrom: startTime.toMillis(),
82304
+ timeTo: endTime.toMillis(),
82305
+ };
80755
82306
  return this.dxSaaSService.oiPost('oi/v2/api/clusteralarms/_search', alarmRequestBody);
80756
82307
  }
80757
82308
  /** Returns the entity-detail attributes for a given entity external ID. */
@@ -80760,51 +82311,28 @@ class DxoiService {
80760
82311
  externalId: entityExternalId,
80761
82312
  });
80762
82313
  }
80763
- /** Returns a single alarm by its ID. */
82314
+ /**
82315
+ * Returns a single alarm by its ID.
82316
+ * @deprecated Use `AlarmService.getAlarm` (`ServiceMonolith.dxAlarmService`).
82317
+ */
80764
82318
  async getAlarm(alarmId) {
80765
- return this.dxSaaSService.oiGet('oi/v2/api/alarms/_search', {
80766
- alarmId: alarmId,
80767
- });
82319
+ return this.alarms.getAlarm(alarmId);
80768
82320
  }
80769
- /** Returns the lifecycle event history for a given alarm ID. */
82321
+ /**
82322
+ * Returns the lifecycle event history for a given alarm ID.
82323
+ * @deprecated Use `AlarmService.getAlarmLifeCycle` (`ServiceMonolith.dxAlarmService`).
82324
+ */
80770
82325
  async getAlarmLifeCycle(alarmId) {
80771
- const alarmLifeCycleRequestBody = {
80772
- alarmId: alarmId,
80773
- pageSize: '20',
80774
- pageNumber: '0',
80775
- sortCol: 'timestamp:desc',
80776
- excludeFields: [
80777
- 'isolation_view_link',
80778
- 'metric_view_link',
80779
- 'alert_definition_link',
80780
- 'occurrence',
80781
- ],
80782
- };
80783
- return this.dxSaaSService.oiPost('oi/v2/api/alarms/lifecycle/_search', alarmLifeCycleRequestBody);
82326
+ return this.alarms.getAlarmLifeCycle(alarmId);
80784
82327
  }
80785
- /** Returns all alarms in a time range, paginating until the full count is fetched. */
82328
+ /**
82329
+ * Returns every open alarm in a time range.
82330
+ * @deprecated Use `AlarmService.getAlarms`, which this now calls: it reads
82331
+ * ranges over 1000 alarms in windows and throws `IncompleteAlarmSearchError`
82332
+ * instead of returning a partial set (the old page loop could not end).
82333
+ */
80786
82334
  async getAlarms(startTime, endTime) {
80787
- const alarmRequestBody = DEFAULT_ALARMS_REQUEST_BODY;
80788
- alarmRequestBody.timeFrom = startTime.toMillis();
80789
- alarmRequestBody.timeTo = endTime.toMillis();
80790
- const alarmIdMap = new Map();
80791
- const alarmFirstPage = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', alarmRequestBody);
80792
- function mapAlarms(alarms) {
80793
- alarms.forEach((alarm) => {
80794
- if (!alarmIdMap.has(alarm.alarmId)) {
80795
- alarmIdMap.set(alarm.alarmId, alarm);
80796
- }
80797
- });
80798
- }
80799
- mapAlarms(alarmFirstPage.alarms);
80800
- let currentAlarmPage = 1;
80801
- while (alarmIdMap.size < Number.parseInt(alarmFirstPage.alarmCount)) {
80802
- alarmRequestBody.pageNumber = currentAlarmPage;
80803
- const alarmNextPage = await this.dxSaaSService.oiPost('oi/v2/api/alarms/_search', alarmRequestBody);
80804
- mapAlarms(alarmNextPage.alarms);
80805
- currentAlarmPage++;
80806
- }
80807
- return alarmIdMap;
82335
+ return this.alarms.getAlarms(startTime, endTime);
80808
82336
  }
80809
82337
  }
80810
82338
 
@@ -83043,6 +84571,92 @@ chain.gen = gen;
83043
84571
  chain.fun = fun;
83044
84572
  chain.dataSource = dataSource;
83045
84573
 
84574
+ // @ts-self-types="./path-matcher.d.ts"
84575
+
84576
+ const DIVERGED = -1,
84577
+ MATCHED = -2;
84578
+
84579
+ const defaultFilter$1 = () => true;
84580
+
84581
+ // Array.prototype.join semantics
84582
+ const toPart = key => (key == null ? '' : '' + key);
84583
+
84584
+ class PathMatcher {
84585
+ constructor(filter, separator = '.') {
84586
+ this.filter = filter;
84587
+ this.separator = separator;
84588
+ this.stateful = true;
84589
+ if (typeof filter == 'string') {
84590
+ this.filterWithSeparator = filter + separator;
84591
+ this.states = [0];
84592
+ return;
84593
+ }
84594
+ if (filter instanceof RegExp) {
84595
+ this.paths = [''];
84596
+ this.extend = this._extendRegExp;
84597
+ this.test = this._testRegExp;
84598
+ this.testRecorded = this._testRecordedRegExp;
84599
+ return;
84600
+ }
84601
+ this.stateful = false;
84602
+ this.extend = this._extendNothing;
84603
+ this.test = this.testRecorded = typeof filter == 'function' ? filter : defaultFilter$1;
84604
+ }
84605
+
84606
+ extend(stack) {
84607
+ const length = stack.length;
84608
+ if (length) this.states[length] = this._step(this.states[length - 1], stack[length - 1], length === 1);
84609
+ }
84610
+
84611
+ test(stack, _chunk) {
84612
+ const length = stack.length;
84613
+ return this._isMatch(length ? this._step(this.states[length - 1], stack[length - 1], length === 1) : 0);
84614
+ }
84615
+
84616
+ testRecorded(stack) {
84617
+ return this._isMatch(this.states[stack.length]);
84618
+ }
84619
+
84620
+ _isMatch(state) {
84621
+ return state === MATCHED || state === this.filter.length;
84622
+ }
84623
+
84624
+ // state: a position when the path is a proper prefix of filter + separator
84625
+ _step(state, key, isRoot) {
84626
+ if (!isRoot) state = this._append(state, this.separator);
84627
+ return this._append(state, toPart(key));
84628
+ }
84629
+
84630
+ _append(state, part) {
84631
+ if (state < 0) return state;
84632
+ const filterWithSeparator = this.filterWithSeparator;
84633
+ if (part.length < filterWithSeparator.length - state) return filterWithSeparator.startsWith(part, state) ? state + part.length : DIVERGED;
84634
+ return part.startsWith(filterWithSeparator.slice(state)) ? MATCHED : DIVERGED;
84635
+ }
84636
+
84637
+ _extendRegExp(stack) {
84638
+ const length = stack.length;
84639
+ // kept flat: a test against a concatenated parent costs ~34x more at depth 1000 (nano-bench)
84640
+ if (length) this.paths[length] = length === 1 ? toPart(stack[0]) : [this.paths[length - 1], this.separator, toPart(stack[length - 1])].join('');
84641
+ }
84642
+
84643
+ _testRegExp(stack, _chunk) {
84644
+ const length = stack.length,
84645
+ filter = this.filter;
84646
+ filter.lastIndex = 0;
84647
+ if (!length) return filter.test('');
84648
+ return filter.test(length === 1 ? toPart(stack[0]) : this.paths[length - 1] + this.separator + toPart(stack[length - 1]));
84649
+ }
84650
+
84651
+ _testRecordedRegExp(stack) {
84652
+ const filter = this.filter;
84653
+ filter.lastIndex = 0;
84654
+ return filter.test(this.paths[stack.length]);
84655
+ }
84656
+
84657
+ _extendNothing(_stack) {}
84658
+ }
84659
+
83046
84660
  // @ts-self-types="./filter-base.d.ts"
83047
84661
 
83048
84662
 
@@ -83069,21 +84683,6 @@ const defaultFilter = () => true;
83069
84683
 
83070
84684
  const DEFAULT_MAX_DEPTH = 1024;
83071
84685
 
83072
- const stringFilter = (string, separator) => {
83073
- const stringWithSeparator = string + separator;
83074
- return stack => {
83075
- const path = stack.join(separator);
83076
- return path === string || path.startsWith(stringWithSeparator);
83077
- };
83078
- };
83079
-
83080
- const regExpFilter = (regExp, separator) => {
83081
- return stack => {
83082
- regExp.lastIndex = 0;
83083
- return regExp.test(stack.join(separator));
83084
- };
83085
- };
83086
-
83087
84686
  /** @type {any} */
83088
84687
  const filterBase =
83089
84688
  (
@@ -83098,17 +84697,14 @@ const filterBase =
83098
84697
  const once = options?.once,
83099
84698
  separator = options?.pathSeparator || '.',
83100
84699
  maxDepth = options?.maxDepth ?? DEFAULT_MAX_DEPTH;
83101
- /** @type {(stack: any[], chunk?: any) => boolean} */
84700
+ // the filter as authored: a string or a RegExp is matched by PathMatcher, never called
84701
+ /** @type {((stack: any[], chunk?: any) => boolean) | string | RegExp} */
83102
84702
  let filter = defaultFilter;
83103
84703
  let streamKeys = false,
83104
84704
  mirrorStreamKeys = true;
83105
84705
  if (options) {
83106
- if (typeof options.filter == 'function') {
84706
+ if (typeof options.filter == 'function' || typeof options.filter == 'string' || options.filter instanceof RegExp) {
83107
84707
  filter = options.filter;
83108
- } else if (typeof options.filter == 'string') {
83109
- filter = stringFilter(options.filter, separator);
83110
- } else if (options.filter instanceof RegExp) {
83111
- filter = regExpFilter(options.filter, separator);
83112
84708
  }
83113
84709
  if ('streamValues' in options) {
83114
84710
  streamKeys = options.streamValues;
@@ -83119,7 +84715,8 @@ const filterBase =
83119
84715
  mirrorStreamKeys = false;
83120
84716
  }
83121
84717
  }
83122
- const sanitizedOptions = {...options, filter, streamKeys, separator};
84718
+ const sanitizedOptions = {...options, filter, streamKeys, separator},
84719
+ matcher = new PathMatcher(options?.filter, separator);
83123
84720
  let state = 'check',
83124
84721
  stack = [],
83125
84722
  depth = 0,
@@ -83248,7 +84845,7 @@ const filterBase =
83248
84845
  let action = nonCheckableAction;
83249
84846
  if (checkableTokens[chunk.name] === 1) {
83250
84847
  if (stack.length > maxDepth) throw new RangeError(`filter: JSON nesting depth exceeds maxDepth (${maxDepth})`);
83251
- action = filter(stack, chunk) ? specialAction : defaultAction;
84848
+ action = matcher.test(stack, chunk) ? specialAction : defaultAction;
83252
84849
  }
83253
84850
 
83254
84851
  endToken = stopTokens[chunk.name] || '';
@@ -83297,9 +84894,11 @@ const filterBase =
83297
84894
  // update the stack
83298
84895
  switch (chunk.name) {
83299
84896
  case 'startObject':
84897
+ matcher.extend(stack);
83300
84898
  stack.push(null);
83301
84899
  break;
83302
84900
  case 'startArray':
84901
+ matcher.extend(stack);
83303
84902
  stack.push(-1);
83304
84903
  break;
83305
84904
  case 'endObject':
@@ -87518,36 +89117,206 @@ class ServiceService {
87518
89117
  return this.dxSaaSService.oiPost('oi/v2/sa/saTopologyGraph', { serviceName, startTime: Date.now(), endTime: Date.now() });
87519
89118
  }
87520
89119
  /**
87521
- * Builds a faithful, re-postable store body for a service's entire subtree:
87522
- * topology for structure + a per-vertex {@link getService} for full attributes
87523
- * (serviceContent, tags, customProperties, metrics). Shared by
87524
- * `export-hierarchy`, `associate`, and `dissociate`.
89120
+ * Builds a faithful, re-postable store body for a service's entire subtree
89121
+ * (full attributes + association edges) from one hierarchy read. Shared by
89122
+ * `export-hierarchy`, `associate`, `dissociate` and `update-service`.
87525
89123
  *
87526
- * @remarks One GET per vertex — fine for typical (small) hierarchies; reads
87527
- * are not throttled like saves.
89124
+ * @throws Error if the service does not exist.
87528
89125
  */
87529
89126
  async buildHierarchyBody(rootName) {
87530
- const topo = await this.getServiceTopology(rootName);
87531
- const names = new Set([rootName]);
87532
- topo.vertices.forEach((v) => names.add(v.attributes.name));
87533
- const vertices = [];
87534
- const seen = new Set();
89127
+ const graph = await this.readServiceGraph([rootName]);
89128
+ return ServiceBulk.subtreeBody(graph, rootName);
89129
+ }
89130
+ /**
89131
+ * Reads every hierarchy that contains the named services into one name-keyed
89132
+ * graph: one `GET oi/v2/sa/services/{name}?subservices=true` per service not
89133
+ * already covered by an earlier read (the endpoint returns whole hierarchies
89134
+ * from their top-level services down, full attributes included).
89135
+ *
89136
+ * @param opts.allowMissing - skip services that do not exist instead of throwing.
89137
+ * @throws Error if a service does not exist, or a read is paged.
89138
+ */
89139
+ async readServiceGraph(names, opts = {}) {
89140
+ let graph = { vertices: {}, edges: [] };
87535
89141
  for (const name of names) {
87536
- const full = await this.getService(name, false);
87537
- const fv = full.vertices[0];
87538
- if (fv && !seen.has(fv.externalId)) {
87539
- seen.add(fv.externalId);
87540
- vertices.push(ServiceTransform.retrievedToServiceVertex(fv));
89142
+ if (graph.vertices[name])
89143
+ continue;
89144
+ let read;
89145
+ try {
89146
+ read = await this.getService(name, true);
89147
+ }
89148
+ catch (e) {
89149
+ if (e.httpCode !== 404)
89150
+ throw e;
89151
+ if (opts.allowMissing)
89152
+ continue;
89153
+ throw new Error(`No service with name '${name}' found`);
87541
89154
  }
89155
+ graph = ServiceBulk.mergeGraphs(graph, ServiceBulk.graphFromRead(read));
87542
89156
  }
87543
- // Drop edges that reference vertices outside this subtree (e.g. the incoming
87544
- // edge from the root's parent, which saTopologyGraph returns without the
87545
- // parent vertex). Re-posting such a dangling edge is rejected by the server.
87546
- const presentIds = new Set(vertices
87547
- .map((v) => v.externalId)
87548
- .filter((id) => id !== undefined));
87549
- const edges = ServiceTransform.filterEdgesToVertices(ServiceTransform.edgesFromTopology(topo), presentIds);
87550
- return { vertices, edges };
89157
+ return graph;
89158
+ }
89159
+ /**
89160
+ * Plans changes to any number of services, in any hierarchies, without
89161
+ * saving: reads what the changes name, applies them, and returns the
89162
+ * per-service diff, the services the save would carry, and the store body.
89163
+ *
89164
+ * @throws ZodError for malformed changes; Error for an invalid change or
89165
+ * weights over 100 %.
89166
+ */
89167
+ async planServiceChanges(changes) {
89168
+ const parsed = ServiceBulk.parseChanges(changes);
89169
+ const targets = ServiceBulk.targetsOf(parsed);
89170
+ const graph = await this.readServiceGraph(targets);
89171
+ return ServiceBulk.planChanges(graph, targets, parsed);
89172
+ }
89173
+ /**
89174
+ * Previews one set of edits applied to every service a selector picks, saving
89175
+ * nothing. Candidates come from `services` / `root` when given, otherwise from
89176
+ * the services list; every criterion is then re-checked against the fresh
89177
+ * hierarchy read the save would be built from. Edits that would change
89178
+ * nothing on a service are reported, not emitted.
89179
+ *
89180
+ * @param opts.max - more services to change than this is a blocker (default 25).
89181
+ * @throws ZodError for a malformed selector or edits; Error when nothing matches
89182
+ * or a named service does not exist.
89183
+ */
89184
+ async planBulkUpdate(selector, edits, opts = {}) {
89185
+ const sel = ServiceBulkSelect.ServiceSelectorSchema.parse(selector);
89186
+ const edit = ServiceBulkSelect.BulkEditSchema.parse(edits);
89187
+ const max = opts.max ?? 25;
89188
+ let graph = { vertices: {}, edges: [] };
89189
+ let candidates;
89190
+ if (sel.services) {
89191
+ graph = await this.readServiceGraph(sel.services, { allowMissing: true });
89192
+ const missing = sel.services.filter((n) => !graph.vertices[n]);
89193
+ if (missing.length)
89194
+ throw new Error(await this.unknownServicesMessage(missing));
89195
+ candidates = [...new Set(sel.services)];
89196
+ }
89197
+ if (sel.root) {
89198
+ graph = ServiceBulk.mergeGraphs(graph, await this.readServiceGraph([sel.root]));
89199
+ const scope = ServiceBulkSelect.withinDepth(graph, sel.root, sel.depth);
89200
+ candidates = candidates ? candidates.filter((n) => scope.includes(n)) : scope;
89201
+ }
89202
+ let checked = candidates?.length ?? 0;
89203
+ if (!candidates) {
89204
+ const rows = await this.getAllServices(100);
89205
+ checked = rows.length;
89206
+ candidates = rows
89207
+ .filter((r) => ServiceBulkSelect.matchesFilters(ServiceBulkSelect.subjectFromListRow(r), sel))
89208
+ .map((r) => r.name);
89209
+ graph = await this.readServiceGraph(candidates, { allowMissing: true });
89210
+ }
89211
+ const excluded = [];
89212
+ const matched = candidates.filter((name) => {
89213
+ const v = graph.vertices[name];
89214
+ if (!v) {
89215
+ excluded.push({ service: name, reason: 'no longer exists' });
89216
+ return false;
89217
+ }
89218
+ if (ServiceBulkSelect.matchesFilters(ServiceBulkSelect.subjectFromVertex(v), sel))
89219
+ return true;
89220
+ if (sel.services) {
89221
+ excluded.push({ service: name, reason: 'does not match the other criteria' });
89222
+ }
89223
+ else if (!sel.root) {
89224
+ excluded.push({ service: name, reason: 'no longer matches' });
89225
+ }
89226
+ return false;
89227
+ });
89228
+ if (!matched.length) {
89229
+ throw new Error(`0 of ${checked} services match ${ServiceBulkSelect.describeSelector(sel)}`);
89230
+ }
89231
+ const { changes, outcomes, warnings } = ServiceBulkSelect.expandEdits(graph, matched, edit);
89232
+ const blockers = ServiceBulkSelect.editBlockers(edit);
89233
+ const changing = outcomes.filter((o) => o.will.length).length;
89234
+ if (changing > max) {
89235
+ blockers.push(`${changing} services would change, more than max=${max}; narrow the selector or raise max`);
89236
+ }
89237
+ const planned = changes.length
89238
+ ? ServiceBulk.planChanges(graph, ServiceBulk.targetsOf(changes), changes).plan
89239
+ : { targets: [], changes: [], diff: [], save: [] };
89240
+ const changed = new Set(planned.diff.map((d) => d.service));
89241
+ return {
89242
+ selector: ServiceBulkSelect.describeSelector(sel),
89243
+ checked,
89244
+ matched,
89245
+ outcomes,
89246
+ excluded,
89247
+ warnings,
89248
+ blockers,
89249
+ plan: planned,
89250
+ before: planned.save.length ? ServiceBulk.bodyFor(graph, planned.save) : { vertices: [], edges: [] },
89251
+ carried: planned.save.filter((n) => !changed.has(n)),
89252
+ confirm: ServiceBulkSelect.planToken(planned),
89253
+ };
89254
+ }
89255
+ /** "No service named …", with case-insensitive suggestions from the services list. */
89256
+ async unknownServicesMessage(missing) {
89257
+ const all = (await this.getAllServices(100)).map((s) => s.name);
89258
+ const lines = missing.map((m) => {
89259
+ const near = all.filter((n) => n.toLowerCase() === m.toLowerCase());
89260
+ return near.length ? `'${m}' (did you mean '${near.join("', '")}'?)` : `'${m}'`;
89261
+ });
89262
+ return `No service with name ${lines.join(', ')} found (names are case-sensitive)`;
89263
+ }
89264
+ /**
89265
+ * The tenant's service cap and how many services count against it
89266
+ * (`GET oi/v2/sa/serviceLimitExceeded`).
89267
+ *
89268
+ * @remarks `limitExceeded` is already true when the count equals the limit (the tenant is
89269
+ * full). The count lags deletes by one to three minutes.
89270
+ */
89271
+ async getServiceLimit() {
89272
+ return this.dxSaaSService.oiGet('oi/v2/sa/serviceLimitExceeded');
89273
+ }
89274
+ /**
89275
+ * Plans importing a store body (an export file) into this tenant, saving nothing:
89276
+ * reads the target's current state for every name in the file, takes each service's
89277
+ * metrics from the target ({@link ServiceImport.planImport}), and checks the service cap.
89278
+ *
89279
+ * @param opts.prefix - rename every service in the file first (cloning).
89280
+ */
89281
+ async planImport(file, opts = {}) {
89282
+ const body = opts.prefix ? ServiceImport.renameBody(file, opts.prefix) : file;
89283
+ // Read only names the services list knows, so new ones aren't probed one 404 at a time.
89284
+ const listed = new Set((await this.getAllServices(100)).map((s) => s.name));
89285
+ const names = body.vertices.map((v) => v.attributes.name).filter((n) => listed.has(n));
89286
+ const target = await this.readServiceGraph(names, { allowMissing: true });
89287
+ const plan = ServiceImport.planImport(body, target);
89288
+ const cap = await this.getServiceLimit();
89289
+ const headroom = cap.limit - cap.totalServiceCnt;
89290
+ if (plan.created.length > headroom) {
89291
+ plan.blockers.push(`${plan.created.length} new services but only ${headroom} of ${cap.limit} left under the tenant's service cap`);
89292
+ }
89293
+ return { ...plan, headroom, limit: cap.limit };
89294
+ }
89295
+ /**
89296
+ * Commits a plan in ONE save. Re-reads the plan's services and refuses when a
89297
+ * value the plan replaces has moved; otherwise re-applies the changes onto the
89298
+ * fresh read (so concurrent edits elsewhere are kept) and saves. A plan whose
89299
+ * changes are already in place saves nothing (`response` is absent).
89300
+ *
89301
+ * @param opts.force - skip the conflict check and apply onto whatever is there now.
89302
+ * @throws ServiceBulk.ServiceConflictError listing what moved.
89303
+ * @remarks The server rejects an invalid payload whole — nothing is applied.
89304
+ */
89305
+ async commitServicePlan(plan, opts = {}) {
89306
+ const checked = ServiceBulk.parsePlan(plan);
89307
+ const fresh = await this.readServiceGraph(checked.targets, {
89308
+ allowMissing: true,
89309
+ });
89310
+ if (!opts.force) {
89311
+ const conflicts = ServiceBulk.findConflicts(checked, fresh);
89312
+ if (conflicts.length)
89313
+ throw new ServiceBulk.ServiceConflictError(conflicts);
89314
+ }
89315
+ const rebased = ServiceBulk.planChanges(fresh, checked.targets, checked.changes);
89316
+ if (!rebased.plan.diff.length)
89317
+ return rebased;
89318
+ const response = await this.createService(rebased.body, { replace: true });
89319
+ return { ...rebased, response };
87551
89320
  }
87552
89321
  /** Builds a single-service store body (no edges) for `service export`. */
87553
89322
  async exportServiceBody(serviceName) {
@@ -87579,55 +89348,48 @@ class ServiceService {
87579
89348
  }
87580
89349
  throw new Error(`No Service with name '${serviceName}' Found`);
87581
89350
  }
87582
- /** Returns paginated top-level (grouped) services up to `maxRequests` pages. */
87583
- async getTopLevelServices(pageSize = 100, maxRequests = 20) {
87584
- const returnServices = new Array();
87585
- let totalRequests = 0;
87586
- this.log.info(`Making initial request with pageSize=${pageSize}`);
87587
- const currentRequestBody = this.createParentServiceRequestBody(pageSize);
87588
- return this.dxSaaSService
87589
- .oiPost('oi/v2/servicerepo/services', currentRequestBody)
87590
- .then(async (response) => {
87591
- totalRequests = 1;
87592
- returnServices.push(...response.services);
87593
- while (response.groupedCnt > returnServices.length ||
87594
- totalRequests > maxRequests) {
87595
- totalRequests++;
87596
- currentRequestBody.pageNum++;
87597
- this.log.info('Retrieving Page initial request with pageSize=100');
87598
- await this.dxSaaSService
87599
- .oiPost('oi/v2/servicerepo/services', currentRequestBody)
87600
- .then(async (response) => {
87601
- returnServices.push(...response.services);
87602
- });
87603
- }
87604
- return returnServices;
87605
- });
89351
+ /**
89352
+ * Returns the top-level (grouped) services, every page of them.
89353
+ *
89354
+ * @param pageSize - Services per request.
89355
+ * @param maxRequests - Optional cap on the number of requests; omitted = until `groupedCnt` is reached.
89356
+ * @remarks Stops early on an empty page; a short result (cap or empty page) is logged as a warning.
89357
+ */
89358
+ async getTopLevelServices(pageSize = 100, maxRequests) {
89359
+ return this.fetchServicePages(this.createParentServiceRequestBody(pageSize), (response) => response.groupedCnt, maxRequests);
87606
89360
  }
87607
- /** Returns all services (ungrouped) paginating up to `maxRequests` pages. */
87608
- async getAllServices(pageSize = 100, maxRequests = 10) {
87609
- const returnServices = new Array();
87610
- let totalRequests = 0;
87611
- this.log.info(`Making initial request with pageSize=${pageSize}`);
87612
- const currentRequestBody = this.createAllServiceRequestBody(pageSize);
87613
- return this.dxSaaSService
87614
- .oiPost('oi/v2/servicerepo/services', currentRequestBody)
87615
- .then(async (response) => {
87616
- totalRequests = 1;
87617
- returnServices.push(...response.services);
87618
- while (response.totalCnt > returnServices.length ||
87619
- totalRequests > maxRequests) {
87620
- totalRequests++;
87621
- currentRequestBody.pageNum++;
87622
- this.log.info('Retrieving Page initial request with pageSize=100');
87623
- await this.dxSaaSService
87624
- .oiPost('oi/v2/servicerepo/services', currentRequestBody)
87625
- .then(async (response) => {
87626
- returnServices.push(...response.services);
87627
- });
89361
+ /**
89362
+ * Returns all services (ungrouped), every page of them.
89363
+ *
89364
+ * @param pageSize - Services per request.
89365
+ * @param maxRequests - Optional cap on the number of requests; omitted = until `totalCnt` is reached.
89366
+ * @remarks Stops early on an empty page; a short result (cap or empty page) is logged as a warning.
89367
+ */
89368
+ async getAllServices(pageSize = 100, maxRequests) {
89369
+ return this.fetchServicePages(this.createAllServiceRequestBody(pageSize), (response) => response.totalCnt, maxRequests);
89370
+ }
89371
+ async fetchServicePages(body, expectedCount, maxRequests) {
89372
+ this.log.info(`Requesting services with pageSize=${body.pageSize}`);
89373
+ const first = await this.dxSaaSService.oiPost('oi/v2/servicerepo/services', body);
89374
+ const services = [...first.services];
89375
+ const expected = expectedCount(first);
89376
+ let requests = 1;
89377
+ while (services.length < expected) {
89378
+ if (maxRequests !== undefined && requests >= maxRequests) {
89379
+ this.log.warn(`Service list truncated at ${services.length} of ${expected}: maxRequests=${maxRequests} reached`);
89380
+ break;
87628
89381
  }
87629
- return returnServices;
87630
- });
89382
+ body.pageNum++;
89383
+ requests++;
89384
+ this.log.info(`Requesting services page ${body.pageNum}`);
89385
+ const page = await this.dxSaaSService.oiPost('oi/v2/servicerepo/services', body);
89386
+ if (page.services.length === 0) {
89387
+ this.log.warn(`Service list stopped at ${services.length} of ${expected}: page ${body.pageNum} was empty`);
89388
+ break;
89389
+ }
89390
+ services.push(...page.services);
89391
+ }
89392
+ return services;
87631
89393
  }
87632
89394
  /** Builds a services request body scoped to parent (top-level) services. */
87633
89395
  createParentServiceRequestBody(pageSize) {
@@ -88037,15 +89799,21 @@ class SituationService {
88037
89799
  async getSituationOverview(situationId) {
88038
89800
  return this.dxSaaSService.oiGet(`oi/v2/api/groupalarms/_search/${situationId}/overview`, { type: 'cluster' });
88039
89801
  }
88040
- /** Returns lifecycle (state change) events for a situation. */
89802
+ /**
89803
+ * Returns a situation's whole lifecycle (state change) history, newest first.
89804
+ *
89805
+ * @remarks Reads every page until the server's `totalCount` (it used to
89806
+ * stop at 50; a demo-dev situation had 69). A short read keeps the server's
89807
+ * `totalCount` and logs a warning.
89808
+ */
88041
89809
  async getSituationLifecycleEvents(situationId) {
88042
- return this.dxSaaSService.oiPost('oi/v2/api/alarms/lifecycle/_search', {
89810
+ return readLifecyclePages((pageNumber, pageSize) => this.dxSaaSService.oiPost('oi/v2/api/alarms/lifecycle/_search', {
88043
89811
  alarmId: situationId,
88044
- pageSize: 50,
88045
- pageNumber: 0,
89812
+ pageSize,
89813
+ pageNumber,
88046
89814
  sortCol: 'timestamp:desc',
88047
89815
  lifeCycleType: 'SITUATION',
88048
- });
89816
+ }), `situation ${situationId}`, this.log);
88049
89817
  }
88050
89818
  /** Returns the inspector inspection result for a situation (related alarms, topology). */
88051
89819
  async getSituationInspection(situationId) {
@@ -89858,5 +91626,5 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
89858
91626
  };
89859
91627
  }
89860
91628
 
89861
- export { ALARM_CATEGORIES, ALARM_FILTER_CATEGORIES, ALARM_FILTER_DEFAULT_COLUMN_ORDER, ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS, ALARM_FILTER_DISPLAY_COLUMN_KEYS, ALARM_FILTER_FIELD_PATHS, ALARM_QUEUE_CATEGORIES, ALARM_QUEUE_DEFAULT_COLUMN_ORDER, ALARM_QUEUE_DEFAULT_FILTER_SETTINGS, ALARM_QUEUE_DEFAULT_VISIBLE_COLUMNS, ALARM_QUEUE_DISPLAY_COLUMN_KEYS, ALARM_QUEUE_FILTER_CONDITIONS, ALARM_QUEUE_FILTER_SETTING_KEYS, ALARM_VIEW_CATEGORIES, ALARM_VIEW_FIELD_PATHS, ALARM_VIEW_SEARCH_PATHS, ALGORITHMIC_SITUATIONS_KEY, ANOMALY_DETECTION_PRODUCTS, AXAActivities, AccService, AgentService, AgentTrace, AlarmCategorySchema, AlarmEnrichment, AlarmEnrichmentFilter, AlarmFilterFieldSchema, AlarmFilterFieldsResponseSchema, AlarmFilterWriteBodySchema, AlarmFilterWriteResponseSchema, AlarmQueueDeleteResponseSchema, AlarmQueueDetailSchema, AlarmQueueFieldSchema, AlarmQueueFieldsResponseSchema, AlarmQueueFilterSettingsSchema, AlarmQueueListResponseSchema, AlarmQueuePreferencesResponseSchema, AlarmQueuePreferencesSchema, AlarmQueueSchema, AlarmQueueWriteBodySchema, AlarmQueueWriteResponseSchema, AlarmService, AlertDefinitionResponse, AlertResponse, AlertResponseV2, AlertService, AlignmentSchema, AllAlarmQueuesResponseSchema, AnomalyAlertConfigSchema, AnomalyDetectionGroupDeleteResponseSchema, AnomalyDetectionGroupSaveRequestSchema, AnomalyDetectionGroupSaveResponseSchema, AnomalyDetectionGroupSchema, AnomalyDetectionGroupSearchRequestSchema, AnomalyDetectionGroupSearchResponseSchema, AnomalyGroupMetricsEntrySchema, AnomalyGroupMetricsRequestSchema, AnomalyGroupMetricsResponseSchema, AnomalyMetricFieldsRequestSchema, AnomalyMetricFieldsResponseSchema, AnyChannelSchema, ApmUniverseService, AppVersionSchema, AppVersionsResponseSchema, AsmService, AttributeExpressionComparatorSchema, AttributeExpressionOperatorSchema, AttributeExpressionSchema, AttributeFilterOperator, AttributeNameAllSpecifierSchema, AttributeNameAndSpecifierSchema, AttributeNameAnyNumericSpecifierSchema, AttributeNameAttributeSpecifierSchema, AttributeNameChildrenSpecifierSchema, AttributeNameExactSpecifierSchema, AttributeNameFolderSpecifierSchema, AttributeNameNoneSpecifierSchema, AttributeNameNotSpecifierSchema, AttributeNameOperatorSpecifierSchema, AttributeNameOrSpecifierSchema, AttributeNameRegExSpecifierSchema, AttributeNameSpecifierSchema, AttributeNameTypeSpecifierSchema, AttributeService, AttributeValueAsFieldSchema, AuditGlobalQueryRequestSchema, AuditQueryRequestSchema, AuditQueryResponseSchema, AuditRecordEsSchema, AuditRecordSchema, AuditStoreResponseSchema, 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, CLUSTERING_POLICY_BUILTIN_AUTHORS, CLUSTERING_POLICY_CONDITIONS, CLUSTERING_POLICY_PRESENCE_CONDITIONS, CLUSTERING_POLICY_PREVIEW_RANGES, CLUSTERING_POLICY_STATUSES, CURL_COHORT_VAR, CURL_HOST_VAR, CURL_TOKEN_VAR, CUSTOM_FIELD_PATTERN, CalendarIntervalSchema, CancelRevokeRequestSchema, ChannelDeleteResponseSchema, ChannelEnvelopeSchema, ChannelLinkedEntitySchema, ChannelListResponseSchema, ChannelService, ChannelTemplateRefSchema, ChannelWriteBodySchema, ChannelWriteResponseSchema, ClusteringCriteriaValuesSchema, ClusteringCriterionPropertiesSchema, ClusteringCriterionSchema, ClusteringPolicyCriteriaSchema, ClusteringPolicyPreviewResponseSchema, ClusteringPolicySchema, ClusteringPolicySearchRequestSchema, ClusteringPolicySearchResponseSchema, ClusteringPolicyService, ClusteringPolicyWriteBodySchema, ClusteringPreviewClusterSchema, ClusteringPreviewTemplateSchema, CreateAgentTokenRequestSchema, CreateInternalTokenRequestSchema, CreateServices, CreateTenantTokenRequestSchema, CreateUserTokenRequestSchema, DEFAULT_EXPERIENCE_REQUEST_BODY, DEFAULT_EXTERNAL_ID_FORMAT, DEFAULT_WEBHOOK_AUTH_DETAILS, DEFAULT_WEBHOOK_PAYLOAD_FIELDS, DRAFT_FILE_SUFFIX, DXChannel, DXO2_SAAS_GATEWAYS, DXO2_SAAS_GATEWAY_HOSTNAMES, DXO2_STATUS_PAGE_URL, DashboardPermissionsUpdateRequest, DashboardSearch, DashboardService, DataStoreAuditService, DataStoreAuthViewsService, DataStoreBlobStorageService, DataStoreFeaturesService, DataStoreMetricsMetadataService, DataStoreNASSQLService, DataStoreNASSService, DataStoreStatesService, DataStoreTASService, DataStoreTokensService, DefaultViewsResponseSchema, DeleteTokenRequestSchema, DeleteTokensResponseSchema, DxO2SaasRegionSchema, DxSaasService, DxoiService, ENRICHMENT_FILTER_CONDITIONS, ENRICHMENT_PREVIEW_WINDOWS, ENRICHMENT_SOURCES, EXPORT_INCLUDE_TOKEN_ENV, EdgeNumericIdSchema, EmptyCriteriaSchema, EnrichmentCustomFieldSchema, EnrichmentCustomFieldsResponseSchema, EnrichmentMappingSchema, EnrichmentPreviewResponseSchema, EnrichmentRuleSchema, EnrichmentRuleWriteBodySchema, EnrichmentRulesResponseSchema, EnrichmentSchema, EventService, ExperienceService, FILTER_FIELDS, FeatureAttributesSchema, FeatureDatascopeSchema, FeatureDeleteRequestSchema, FeatureFieldSchema, FeatureFieldTypeSchema, FeatureFilterSchema, FeatureFilterTemplateSchema, FeatureFilterTemplateTypeSchema, FeatureIdFilterSchema, FeatureListResponseSchema, FeatureNodeSchema, FeatureQueryRequestSchema, FeatureStoreRequestSchema, FeatureStoreResponseSchema, FeatureToggleListResponseSchema, FeatureToggleListSchema, FillModeSchema, FilterOperation, FolderNameAllSpecifierSchema, FolderNameAndSpecifierSchema, FolderNameChildrenSpecifierSchema, FolderNameExactSpecifierSchema, FolderNameNoneSpecifierSchema, FolderNameNotSpecifierSchema, FolderNameOrSpecifierSchema, FolderNameRegExSpecifierSchema, FolderNameSpecifierSchema, GenericChannelSchema, GraphResponse, GraphService, INVENTORY_QUEUE_CATEGORY, INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES, INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS, INVENTORY_QUEUE_FILTER_CONDITIONS, INVENTORY_QUEUE_NO_GROUP, ITSM_DEFAULT_TICKET_TEMPLATE, ITSM_SECRET_KEYS, ImportTokenRequestSchema, InventorizeDeleteResponseSchema, InventorizeDraftSchema, InventorizeLayerSchema, InventorizePreviewResponseSchema, InventorizePreviewSchema, InventorizeRuleListResponseSchema, InventorizeRuleSchema, InventorizeSaveResponseSchema, Inventory, InventoryAttributes, InventoryGroupSchema, InventoryGroupsResponseSchema, InventoryQueueDeleteResponseSchema, InventoryQueueDetailSchema, InventoryQueueFieldSchema, InventoryQueueFieldsResponseSchema, InventoryQueueFilterAtomSchema, InventoryQueueListResponseSchema, InventoryQueuePreferencesResponseSchema, InventoryQueuePreferencesSchema, InventoryQueueSchema, InventoryQueueWriteBodySchema, InventoryQueueWriteResponseSchema, InventoryService, ItsmChannelSchema, ItsmPropertySchema, ItsmTestConnectionRequestSchema, ItsmTestConnectionResponseSchema, JEXL_CONTEXT_CATALOG, JEXL_SAMPLE_CONTEXT, JavaRegexError, JexlEvalError, JexlSyntaxError, JoinTypeSchema, JsExtensionService, LOG_ANALYTICS_PRODUCT, LogCustomIngest, LogIngest, LogQuery, LogTypes, LogsService, MAX_SLIS_PER_GROUP, MESSAGE_TEMPLATE_ALARM_TYPES, METRIC_TYPE_ENUM, METRIC_TYPE_ENUM_NAMES, METRIC_TYPE_REGION, MServe, MaintenanceBulkDeleteResponseSchema, MaintenanceCreateRequestSchema, MaintenanceCreateResponseSchema, MaintenanceDeleteRequestSchema, MaintenanceDetailSchema, MaintenanceExcludedMemberSchema, MaintenanceFilterLeafSchema, MaintenanceFilterSchema, MaintenanceMemberSchema, MaintenanceMemberSourceSchema, MaintenanceMemberTypeSchema, MaintenancePreviewRequestSchema, MaintenancePreviewResponseSchema, MaintenanceScheduleSchema, MaintenanceSearchRequestSchema, MaintenanceSearchResponseSchema, MaintenanceService, MaintenanceSummarySchema, ManagementModuleIdSchema, ManagementModuleService, MatchType, MessageTemplateFieldSchema, MessageTemplateFieldsResponseSchema, MetadataMetricQueryResponseV2Schema, MetadataMetricQuerySchema, MetricAnomalyService, MetricAttributeSchema, MetricBatchService, MetricConfigCustomFilterSchema, MetricConfigFilterOrBlockSchema, MetricConfigFilterSchema, MetricFolderSchema, MetricGroupingService, MetricRegisterInputSchema, MetricRegisterRequestSchema, MetricRegisterResponseSchema, MetricRegisterSchema, MetricRegisterSourceSchema, MetricTypeEnumNameSchema, NASS, NASSService, NassDatapointSchema, NassExtensionDatapointSchema, NassRegularDatapointSchema, NassStoreRequestSchema, NassStoreResponseSchema, NassValueTypeSchema, NotificationService, NumericOperatorSchema, O2NotificationService, O2UniverseService, OIAlarm, OIService, OIUsersV2, OperatorSchema, POLICY_ALARM_CATEGORIES, POLICY_FILTER_CONDITIONS, POSTMAN_TOKEN_VAR, PRODUCT_STATUS_PROVISIONED, PerspectiveService, PlatformAlertService, PlatformFilters, PlatformManagementModuleService, PlatformMetricGroupingService, PolicyDeleteResponseSchema, PolicyFieldSchema, PolicyFieldsResponseSchema, PolicyFilterAtomSchema, PolicyFilterExpressionSchema, PolicyLinkedEntitySchema, PolicyNamingOperationSchema, PolicyWriteBodySchema, PolicyWriteResponseSchema, PublicKeyJsonResponseSchema, QuantileMethodSchema, QueryAllSpecifierSchema, QueryAndSpecifierSchema, QueryAttributeExpressionSchema, QueryAttributeSpecifierSchema, QueryColumnTypeSpecSchema, QueryFilterPredicateSpecSchema, QueryFunctionSpecSchema, QueryHintForceRangeSchema, QueryHintSchema, QueryIdSpecifierSchema, QueryMetricGroupSpecifierSchema, QueryMetricIdSchema, QueryNoneSpecifierSchema, QueryNotSpecifierSchema, QueryOrSpecifierSchema, QueryRangeSpecSchema, QueryRequestSchema, QueryResultCellSchema, QueryResultSchema, QueryResultTableSchema, QuerySpecSpecifierSchema, QuerySpecifierSchema, REDACTED_SECRET, RecurrencePattern, RevokeTokenRequestSchema, RevokeTokensResponseSchema, SLIService, SLI_DERIVED_METRIC_SOURCE, SMTP_DEFAULT_TEMPLATES, SOURCENAME_DIALECT_CATALOG, SQLService, ServiceDeskFieldSchema, ServiceDeskFieldsResponseSchema, ServiceExport, ServiceFilterSpecifierSchema, ServiceService, ServiceTransform, ServiceUniverseAccessEntrySchema, ServiceUniverseAccessSchema, ServiceUniverseAttributesSchema, ServiceUniverseBodySchema, ServiceUniverseListItemSchema, ServiceUniverseListResponseSchema, ServiceUniverseNassViewSchema, ServiceUniversePermissionSchema, ServiceUniverseQueryResponseSchema, ServiceUniverseSchema, ServiceUniverseService, ServiceUniverseTasSpecSchema, ServiceUniverseTasViewSchema, ServiceUniverseViewSchema, SessionService, SessionValidateRequestSchema, SessionValidateResponseSchema, SetDefaultViewRequestSchema, SimpleHTTPError, SituationLifecycle, SituationService, Situations, SliAggregationIntervalSchema, SliAlertEntrySchema, SliAlertOperatorSchema, SliAlertTargetSchema, SliDerivedMetricAttributeSchema, SliDerivedMetricsSchema, SliExpressionSchema, SliFilterSchema, SliFunctionCustomParamsSchema, SliFunctionInputSchema, SliFunctionOpSchema, SliFunctionOutputSchema, SliFunctionSchema, SliGroupDeleteResponseSchema, SliGroupMetricsEntrySchema, SliGroupMetricsRequestSchema, SliGroupMetricsResponseSchema, SliGroupSaveRequestSchema, SliGroupSaveResponseSchema, SliGroupSchema, SliGroupSearchRequestSchema, SliGroupSearchResponseSchema, SliMetricFieldSchema, SliMetricFieldsRequestSchema, SliMetricFieldsResponseSchema, SliThresholdComparatorSchema, SliThresholdSchema, SloCalendarPeriodSchema, SloFunctionOpSchema, SloFunctionSchema, SmtpChannelConfigsSchema, SmtpChannelSchema, SmtpTestInputSchema, SmtpTestRequestSchema, SmtpTestResponseSchema, SourceNameAllSpecifierSchema, SourceNameAndSpecifierSchema, SourceNameExactSpecifierSchema, SourceNameNoneSpecifierSchema, SourceNameNotSpecifierSchema, SourceNameOrSpecifierSchema, SourceNamePartOperatorSpecifierSchema, SourceNameRegExSpecifierSchema, SourceNameSpecifierSchema, StatusPageComponentSchema, StatusPageComponentsSchema, StoredCriteriaSchema, TAGS_ATTRIBUTE_KEY, TAS, TASGraph, TASService, TC_METRIC_CAP, TC_RESERVED_CUSTOM_ATTRIBUTE_KEYS, TC_STANDARD_ATTRIBUTE_KEYS, TICKET_ENRICHMENT_ALARM_TYPES, TICKET_ENRICHMENT_FIELD_CODES, 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, TasStoreAttributeValueSchema, TasStoreChangeSchema, TasStoreEdgeSchema, TasStoreGraphInputSchema, TasStoreGraphResponseSchema, TasStoreGraphSchema, TasStoreVertexSchema, TasTakeEdgesFilterSchema, TasTakeFlowsFilterSchema, TasTakeVerticesFilterSchema, TasTraverseFilterSchema, TasVariableFilterSchema, TasVariableSchema, TasVertexIdFilterSchema, TasVertexSchema, TasViewSchema, TemplateDeleteResponseSchema, TemplateWriteBodySchema, TemplateWriteResponseSchema, TenantConfigAttributeSchema, TenantConfigAttributesResponseSchema, TenantConfigAttributesWriteBodySchema, TenantConfigAttributesWriteResponseSchema, TenantProductSchema, TenantProductsResponseSchema, TenantRoleSchema, TenantRolesResponseSchema, TenantService, TicketEnrichmentAlarmFieldSchema, TicketEnrichmentAlarmFieldsResponseSchema, TicketEnrichmentListResponseSchema, TicketEnrichmentMappingSchema, TicketEnrichmentRuleSchema, TicketEnrichmentWriteBodySchema, TicketEnrichmentWriteResponseSchema, TokenCreateResponseSchema, TokenDetailsSchema, TokenGetAndVerifyRequestSchema, TokenMetadataSchema, TokenQueryRequestSchema, TokenQueryResponseSchema, TokenVerifyRequestSchema, Trace, TraversalEdgeFilterSchema, TraversalVertexFilterSchema, TraverseCollectSchema, TraverseDirectionSchema, TraverseSchema, UIM_LOGS_INGESTION_PATH, UpdateAgentTokenRequestSchema, UpdateTenantTokenRequestSchema, UpdateUserTokenRequestSchema, VertexGroupSchema, VertexMappingConfigurationModule, VertexService, VertexStateAlertFilterSchema, VertexStateAllFilterSchema, VertexStateAnalyticResultSchema, VertexStateAndFilterSchema, VertexStateClampSettingSchema, VertexStateCollectVertexGroupStatusFilterSchema, VertexStateEmptyFilterSchema, VertexStateExternalIdInputSchema, VertexStateExternalIdResponseSchema, VertexStateExternalIdSchema, VertexStateFetchRequestSchema, VertexStateFetchResponseSchema, VertexStateFilterSchema, VertexStateGroupResultSchema, VertexStateInputSchema, VertexStateManagementModuleFilterSchema, VertexStateMetricFilterSchema, VertexStateNamespaceFilterSchema, VertexStateNumericIdSchema, VertexStateOrFilterSchema, VertexStateProjectionSchema, VertexStateRangeRequestSchema, VertexStateRangeResponseSchema, VertexStateRepublishRequestSchema, VertexStateResponseItemSchema, VertexStateSchema, VertexStateStateFilterSchema, VertexStateStoreRequestSchema, VertexStateStoreResponseSchema, VertexStateVertexIdFilterSchema, VertexStatusChanges, ViewAccessEntrySchema, ViewAccessRoleSchema, ViewAccessSchema, ViewActiveFilterSchema, ViewAllFilterSchema, ViewAndFilterSchema, ViewAttributeExpressionSchema, ViewAttributeFilterSchema, ViewAttributesSchema, ViewBodySchema, ViewFilterSchema, ViewIdFilterSchema, ViewListResponseSchema, ViewNassSpecSchema, ViewOrFilterSchema, ViewOwnerSchema, ViewQueryRequestSchema, ViewQueryResponseSchema, ViewResponseSchema, ViewSearchRequestSchema, ViewSpecsSchema, ViewTasSpecSchema, WebhookAuthDetailsSchema, WebhookChannelSchema, WebhookSpecSchema, WebhookTestInputSchema, WebhookTestRequestSchema, WebhookTestResponseSchema, ags, agsresponse, alarmFilterDisplayColumnsFor, alertsForSliIndex, algorithmicSituationsEnabled, allAlarmQueues, apiTokenCreate, apiTokenDelete, apiTokenGet, apiTokenList, apiTokenUpdate, appendSli, appendSloTriplet, attributeFilterTargets, authHeaderValue, buildAlarmFilterUpdateBody, buildAlarmQueueFilterExpression, buildAlarmQueueUpdateBody, buildAlertEntry, buildClusteringPolicyUpdateBody, buildCustomLogPayload, buildEnrichmentRuleUpdateBody, buildInventoryCustomFilter, buildInventoryQueueUpdateBody, buildPolicyFilterExpression, buildSliFunction, buildSloTriplet, buildTemplateRefs, buildUimLogPayload, capVertexDetail, checkGet, chunkPayloads, classifyIngestionError, compileTcSourceName, composeMetricTypeBits, contactActivate, contactDelete, contactTestSend, contactsBlockDelete, contactsBlockPut, contactsConfirm, contactsCreate, contactsGet, contactsGetDetail, contactsReplaceNotificationsWith, contactsRequestConfirmationCode, contactsUpdate, convertLegacyConfiguration, createCurlCommand, createCurlScript, createPostmanRequest, createServiceMonolith, customAttributeKeyIssues, decodeMetricTypeBits, defaultItsmPropertyList, defaultRuleName, deriveSliAs, deriveVertexName, describeClusteringCriteria, displayColumnsFor, dottedFileSlot, draftKey, encodeItsmSecret, ensureParallelAlerts, escapeRegExp, evaluate, evaluateTemplate, example, excludedAttributes, exportFileLabel, exportIncludesToken, expressionPipelineNames, extractComponentGridData, findAlertByTarget, findInventoryGroup, findProduct, findRedactedSecretPaths, findSliByName, flattenAxiosHeaders, folderAccessGet, folderDelete, folderGet, folderPost, folderUpdate, foldersList, formExternalId, getDataStoreSchema, getUserTokenSub, getUserTokenTid, getVertexAttributeValue, getVertexAttributeValueOrNull, hasTypeTagsFlag, hasVertexAttribute, impliedDxo2Version, incrementVariant, inventoryDisplayColumnsFor, inventoryQueuesOf, inventorySearchRequestBodyExample, inventorySearchResponseBody, isAlarmFilter, isAlarmQueue, isAlarmQueueNotFound, isAuthorizationHeader, isBuiltInClusteringPolicy, isBuiltInPolicy, isBuiltInTemplate, isDataStoreSchemaType, isEmptyCriteria, isInventoryQueueNotFound, isPersonalQueue, isProductProvisioned, isTemplate, isTenantToken, isUserToken, isWildcardOnlySourceName, itsmMapToProperties, itsmPropertiesToMap, javaFullMatch, javaRegexToJs, javaReplaceAll, javaReplaceFirst, javaSplit, lintSourceName, listDataStoreSchemaOps, listSlis, locationsCreate, locationsDelete, locationsGet, locationsGetAll, locationsGetByType, locationsLeafGetFilter, locationsPost, logGet, logGetEvent, logIngestionURLForGateway, maintenanceDelete, maintenanceDeleteWindows, maintenanceFilter, maintenanceGet, maintenanceGetDetail, maintenanceGetWindows, maintenanceGetWindowsDetail, maintenanceUpdateWindowsDetail, maintenancesCreate, maintenancesImmediateDelete, maintenancesImmediatePut, maintenancesPostWindows, maintenancesUpdate, measureBytes, messageGet, messageTemplateVariables, messagesList, monitorActivate, monitorCreate, monitorDeactivate, monitorDelete, monitorGet, monitorGetAll, monitorUpdate, normalizeAlarmQueueSharing, oauthClientTokensCreate, oauthClientTokensDelete, oauthClientTokensGet, oauthClientTokensList, oauthClientTokensUpdate, oauthCreateToken, oauthGetRefreshTokenList, oauthGetTokenList, oauthRefreshTokenDeleteId, oauthTokenCognateDelete, oauthTokenCognateDeleteCurrent, oauthTokenDelete, oauthTokenDeleteCurrent, orBlocksByField, parseExpression, parseExternalIdFormat, parseFilter, parseSaasGateway, parseServiceNowUrl, pipeGroupRanges, planEnrichmentReorder, policyCategoryGuard, policyFieldBounds, policyFilterAtoms, producedMetricName, projectCustomAttributes, projectRule, pruneOrphanSloFunctions, redactChannelSecrets, reencodeItsmForWrite, removeAlert, removeSli, removeSloTriplet, resolveAnomalyDetectionProduct, resolveEnrichmentMappings, resolveWebhookPayload, sampleServiceDetailRequestBody, searchUniverse, sendWithRetry, serviceDetailResponseBody, settingsGet, settingsGetDetail, settingsUpdate, sharedRoleDelta, sleep, sliHumanName, sloTripletFor, sortRulesByPriority, sourceNameBattery, sourceNameMatrix, splitAttributePath, splitTemplate, standardVertexAttributes, stationDelete, stationsAgentType, stationsCreate, stationsDeleteMaintenance, stationsGet, stationsGetAgents, stationsLatest, stationsList, stationsOnpremiseConnected, stationsOnpremiseConnectedAll, stationsOnpremiseList, stationsPutMaintenance, stationsUpdate, statistic, summarizeDataStoreSchema, tagsGetAll, tcSourceNameMatches, tcSourceNameToJavaRegex, tcSourceNameToMmPattern, templateUsage, tenantConfigAttribute, timezonesList, toAlarmFilterWriteBody, toAlarmQueueWriteBody, toAnomalyDetectionGroupSaveRequest, toAnomalyGroupMetricsRequest, toChannelWriteBody, toClusteringPolicyPreviewBody, toClusteringPolicyWriteBody, toEnrichmentRuleCreateBody, toGroupMetricsRequest, toInventoryQueueWriteBody, toItsmTestConnectionRequest, toPolicyWriteBody, toSliGroupSaveRequest, toTemplateWriteBody, toTicketEnrichmentWriteBody, tokenize, translateRuleToMmQuery, truthy, userBlockDelete, userBlockPut, userDelete, userGet, userLockDelete, userPut, userSubaccountsGet, userSubaccountsPost, verifyAndDumpLegacyConfiguration, verifyAndDumpVersion3Configuration, verifyAndDumpVersion4Configuration, vertexMatchesFilters, visibleAlarmQueueColumns, visibleInventoryColumns };
91629
+ export { ALARM_CATEGORIES, ALARM_FILTER_CATEGORIES, ALARM_FILTER_DEFAULT_COLUMN_ORDER, ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS, ALARM_FILTER_DISPLAY_COLUMN_KEYS, ALARM_FILTER_FIELD_PATHS, ALARM_QUEUE_CATEGORIES, ALARM_QUEUE_DEFAULT_COLUMN_ORDER, ALARM_QUEUE_DEFAULT_FILTER_SETTINGS, ALARM_QUEUE_DEFAULT_VISIBLE_COLUMNS, ALARM_QUEUE_DISPLAY_COLUMN_KEYS, ALARM_QUEUE_FILTER_CONDITIONS, ALARM_QUEUE_FILTER_SETTING_KEYS, ALARM_RECORD_PAGE_SIZE, ALARM_RECORD_WINDOW_CAP, ALARM_SEARCH_PAGE_CAP, ALARM_VIEW_CATEGORIES, ALARM_VIEW_FIELD_PATHS, ALARM_VIEW_SEARCH_PATHS, ALGORITHMIC_SITUATIONS_KEY, ANOMALY_DETECTION_PRODUCTS, AXAActivities, AccService, AgentService, AgentTrace, AlarmCategorySchema, AlarmEnrichment, AlarmEnrichmentFilter, AlarmFilterFieldSchema, AlarmFilterFieldsResponseSchema, AlarmFilterWriteBodySchema, AlarmFilterWriteResponseSchema, AlarmQueueDeleteResponseSchema, AlarmQueueDetailSchema, AlarmQueueFieldSchema, AlarmQueueFieldsResponseSchema, AlarmQueueFilterSettingsSchema, AlarmQueueListResponseSchema, AlarmQueuePreferencesResponseSchema, AlarmQueuePreferencesSchema, AlarmQueueSchema, AlarmQueueWriteBodySchema, AlarmQueueWriteResponseSchema, AlarmRecordSchema, AlarmRecordSearchResponseSchema, AlarmService, AlertDefinitionResponse, AlertResponse, AlertResponseV2, AlertService, AlignmentSchema, AllAlarmQueuesResponseSchema, AnomalyAlertConfigSchema, AnomalyDetectionGroupDeleteResponseSchema, AnomalyDetectionGroupSaveRequestSchema, AnomalyDetectionGroupSaveResponseSchema, AnomalyDetectionGroupSchema, AnomalyDetectionGroupSearchRequestSchema, AnomalyDetectionGroupSearchResponseSchema, AnomalyGroupMetricsEntrySchema, AnomalyGroupMetricsRequestSchema, AnomalyGroupMetricsResponseSchema, AnomalyMetricFieldsRequestSchema, AnomalyMetricFieldsResponseSchema, AnyChannelSchema, ApmUniverseService, AppVersionSchema, AppVersionsResponseSchema, AsmService, AttributeExpressionComparatorSchema, AttributeExpressionOperatorSchema, AttributeExpressionSchema, AttributeFilterOperator, AttributeNameAllSpecifierSchema, AttributeNameAndSpecifierSchema, AttributeNameAnyNumericSpecifierSchema, AttributeNameAttributeSpecifierSchema, AttributeNameChildrenSpecifierSchema, AttributeNameExactSpecifierSchema, AttributeNameFolderSpecifierSchema, AttributeNameNoneSpecifierSchema, AttributeNameNotSpecifierSchema, AttributeNameOperatorSpecifierSchema, AttributeNameOrSpecifierSchema, AttributeNameRegExSpecifierSchema, AttributeNameSpecifierSchema, AttributeNameTypeSpecifierSchema, AttributeService, AttributeValueAsFieldSchema, AuditGlobalQueryRequestSchema, AuditQueryRequestSchema, AuditQueryResponseSchema, AuditRecordEsSchema, AuditRecordSchema, AuditStoreResponseSchema, 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, CLUSTERING_POLICY_BUILTIN_AUTHORS, CLUSTERING_POLICY_CONDITIONS, CLUSTERING_POLICY_PRESENCE_CONDITIONS, CLUSTERING_POLICY_PREVIEW_RANGES, CLUSTERING_POLICY_STATUSES, CURL_COHORT_VAR, CURL_HOST_VAR, CURL_TOKEN_VAR, CUSTOM_FIELD_PATTERN, CalendarIntervalSchema, CancelRevokeRequestSchema, ChannelDeleteResponseSchema, ChannelEnvelopeSchema, ChannelLinkedEntitySchema, ChannelListResponseSchema, ChannelService, ChannelTemplateRefSchema, ChannelWriteBodySchema, ChannelWriteResponseSchema, ClusteringCriteriaValuesSchema, ClusteringCriterionPropertiesSchema, ClusteringCriterionSchema, ClusteringPolicyCriteriaSchema, ClusteringPolicyPreviewResponseSchema, ClusteringPolicySchema, ClusteringPolicySearchRequestSchema, ClusteringPolicySearchResponseSchema, ClusteringPolicyService, ClusteringPolicyWriteBodySchema, ClusteringPreviewClusterSchema, ClusteringPreviewTemplateSchema, CreateAgentTokenRequestSchema, CreateInternalTokenRequestSchema, CreateServices, CreateTenantTokenRequestSchema, CreateUserTokenRequestSchema, DEFAULT_EXPERIENCE_REQUEST_BODY, DEFAULT_EXTERNAL_ID_FORMAT, DEFAULT_WEBHOOK_AUTH_DETAILS, DEFAULT_WEBHOOK_PAYLOAD_FIELDS, DRAFT_FILE_SUFFIX, DXChannel, DXO2_SAAS_GATEWAYS, DXO2_SAAS_GATEWAY_HOSTNAMES, DXO2_STATUS_PAGE_URL, DashboardPermissionsUpdateRequest, DashboardSearch, DashboardService, DataStoreAuditService, DataStoreAuthViewsService, DataStoreBlobStorageService, DataStoreFeaturesService, DataStoreMetricsMetadataService, DataStoreNASSQLService, DataStoreNASSService, DataStoreStatesService, DataStoreTASService, DataStoreTokensService, DefaultViewsResponseSchema, DeleteTokenRequestSchema, DeleteTokensResponseSchema, DxO2SaasRegionSchema, DxSaasService, DxoiService, ENRICHMENT_FILTER_CONDITIONS, ENRICHMENT_PREVIEW_WINDOWS, ENRICHMENT_SOURCES, EXPORT_INCLUDE_TOKEN_ENV, EdgeNumericIdSchema, EmptyCriteriaSchema, EnrichmentCustomFieldSchema, EnrichmentCustomFieldsResponseSchema, EnrichmentMappingSchema, EnrichmentPreviewResponseSchema, EnrichmentRuleSchema, EnrichmentRuleWriteBodySchema, EnrichmentRulesResponseSchema, EnrichmentSchema, EventService, ExperienceService, FILTER_FIELDS, FeatureAttributesSchema, FeatureDatascopeSchema, FeatureDeleteRequestSchema, FeatureFieldSchema, FeatureFieldTypeSchema, FeatureFilterSchema, FeatureFilterTemplateSchema, FeatureFilterTemplateTypeSchema, FeatureIdFilterSchema, FeatureListResponseSchema, FeatureNodeSchema, FeatureQueryRequestSchema, FeatureStoreRequestSchema, FeatureStoreResponseSchema, FeatureToggleListResponseSchema, FeatureToggleListSchema, FillModeSchema, FilterOperation, FolderNameAllSpecifierSchema, FolderNameAndSpecifierSchema, FolderNameChildrenSpecifierSchema, FolderNameExactSpecifierSchema, FolderNameNoneSpecifierSchema, FolderNameNotSpecifierSchema, FolderNameOrSpecifierSchema, FolderNameRegExSpecifierSchema, FolderNameSpecifierSchema, GenericChannelSchema, GraphResponse, GraphService, INVENTORY_QUEUE_CATEGORY, INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES, INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS, INVENTORY_QUEUE_FILTER_CONDITIONS, INVENTORY_QUEUE_NO_GROUP, ITSM_DEFAULT_TICKET_TEMPLATE, ITSM_SECRET_KEYS, ImportTokenRequestSchema, IncompleteAlarmSearchError, InventorizeDeleteResponseSchema, InventorizeDraftSchema, InventorizeLayerSchema, InventorizePreviewResponseSchema, InventorizePreviewSchema, InventorizeRuleListResponseSchema, InventorizeRuleSchema, InventorizeSaveResponseSchema, Inventory, InventoryAttributes, InventoryGroupSchema, InventoryGroupsResponseSchema, InventoryQueueDeleteResponseSchema, InventoryQueueDetailSchema, InventoryQueueFieldSchema, InventoryQueueFieldsResponseSchema, InventoryQueueFilterAtomSchema, InventoryQueueListResponseSchema, InventoryQueuePreferencesResponseSchema, InventoryQueuePreferencesSchema, InventoryQueueSchema, InventoryQueueWriteBodySchema, InventoryQueueWriteResponseSchema, InventoryService, ItsmChannelSchema, ItsmPropertySchema, ItsmTestConnectionRequestSchema, ItsmTestConnectionResponseSchema, JEXL_CONTEXT_CATALOG, JEXL_SAMPLE_CONTEXT, JavaRegexError, JexlEvalError, JexlSyntaxError, JoinTypeSchema, JsExtensionService, LIFECYCLE_PAGE_SIZE, LOG_ANALYTICS_PRODUCT, LogCustomIngest, LogIngest, LogQuery, LogTypes, LogsService, MAX_SLIS_PER_GROUP, MESSAGE_TEMPLATE_ALARM_TYPES, METRIC_TYPE_ENUM, METRIC_TYPE_ENUM_NAMES, METRIC_TYPE_REGION, MServe, MaintenanceBulkDeleteResponseSchema, MaintenanceCreateRequestSchema, MaintenanceCreateResponseSchema, MaintenanceDeleteRequestSchema, MaintenanceDetailSchema, MaintenanceExcludedMemberSchema, MaintenanceFilterLeafSchema, MaintenanceFilterSchema, MaintenanceMemberSchema, MaintenanceMemberSourceSchema, MaintenanceMemberTypeSchema, MaintenancePreviewRequestSchema, MaintenancePreviewResponseSchema, MaintenanceScheduleSchema, MaintenanceSearchRequestSchema, MaintenanceSearchResponseSchema, MaintenanceService, MaintenanceSummarySchema, ManagementModuleIdSchema, ManagementModuleService, MatchType, MessageTemplateFieldSchema, MessageTemplateFieldsResponseSchema, MetadataMetricQueryResponseV2Schema, MetadataMetricQuerySchema, MetricAnomalyService, MetricAttributeSchema, MetricBatchService, MetricConfigCustomFilterSchema, MetricConfigFilterOrBlockSchema, MetricConfigFilterSchema, MetricFolderSchema, MetricGroupingService, MetricRegisterInputSchema, MetricRegisterRequestSchema, MetricRegisterResponseSchema, MetricRegisterSchema, MetricRegisterSourceSchema, MetricTypeEnumNameSchema, NASS, NASSService, NassDatapointSchema, NassExtensionDatapointSchema, NassRegularDatapointSchema, NassStoreRequestSchema, NassStoreResponseSchema, NassValueTypeSchema, NotificationService, NumericOperatorSchema, O2NotificationService, O2UniverseService, OIAlarm, OIService, OIUsersV2, OperatorSchema, POLICY_ALARM_CATEGORIES, POLICY_FILTER_CONDITIONS, POSTMAN_TOKEN_VAR, PRODUCT_STATUS_PROVISIONED, PerspectiveService, PlatformAlertService, PlatformFilters, PlatformManagementModuleService, PlatformMetricGroupingService, PolicyDeleteResponseSchema, PolicyFieldSchema, PolicyFieldsResponseSchema, PolicyFilterAtomSchema, PolicyFilterExpressionSchema, PolicyLinkedEntitySchema, PolicyNamingOperationSchema, PolicyWriteBodySchema, PolicyWriteResponseSchema, PublicKeyJsonResponseSchema, QuantileMethodSchema, QueryAllSpecifierSchema, QueryAndSpecifierSchema, QueryAttributeExpressionSchema, QueryAttributeSpecifierSchema, QueryColumnTypeSpecSchema, QueryFilterPredicateSpecSchema, QueryFunctionSpecSchema, QueryHintForceRangeSchema, QueryHintSchema, QueryIdSpecifierSchema, QueryMetricGroupSpecifierSchema, QueryMetricIdSchema, QueryNoneSpecifierSchema, QueryNotSpecifierSchema, QueryOrSpecifierSchema, QueryRangeSpecSchema, QueryRequestSchema, QueryResultCellSchema, QueryResultSchema, QueryResultTableSchema, QuerySpecSpecifierSchema, QuerySpecifierSchema, REDACTED_SECRET, RecurrencePattern, RevokeTokenRequestSchema, RevokeTokensResponseSchema, SERVICE_METRIC_PRESENCE_WINDOW_MS, SLIService, SLI_DERIVED_METRIC_SOURCE, SMTP_DEFAULT_TEMPLATES, SOURCENAME_DIALECT_CATALOG, SQLService, ServiceBulk, ServiceBulkSelect, ServiceDeskFieldSchema, ServiceDeskFieldsResponseSchema, ServiceExport, ServiceFilterSpecifierSchema, ServiceImport, ServiceService, ServiceTransform, ServiceUniverseAccessEntrySchema, ServiceUniverseAccessSchema, ServiceUniverseAttributesSchema, ServiceUniverseBodySchema, ServiceUniverseListItemSchema, ServiceUniverseListResponseSchema, ServiceUniverseNassViewSchema, ServiceUniversePermissionSchema, ServiceUniverseQueryResponseSchema, ServiceUniverseSchema, ServiceUniverseService, ServiceUniverseTasSpecSchema, ServiceUniverseTasViewSchema, ServiceUniverseViewSchema, SessionService, SessionValidateRequestSchema, SessionValidateResponseSchema, SetDefaultViewRequestSchema, SimpleHTTPError, SituationLifecycle, SituationService, Situations, SliAggregationIntervalSchema, SliAlertEntrySchema, SliAlertOperatorSchema, SliAlertTargetSchema, SliDerivedMetricAttributeSchema, SliDerivedMetricsSchema, SliExpressionSchema, SliFilterSchema, SliFunctionCustomParamsSchema, SliFunctionInputSchema, SliFunctionOpSchema, SliFunctionOutputSchema, SliFunctionSchema, SliGroupDeleteResponseSchema, SliGroupMetricsEntrySchema, SliGroupMetricsRequestSchema, SliGroupMetricsResponseSchema, SliGroupSaveRequestSchema, SliGroupSaveResponseSchema, SliGroupSchema, SliGroupSearchRequestSchema, SliGroupSearchResponseSchema, SliMetricFieldSchema, SliMetricFieldsRequestSchema, SliMetricFieldsResponseSchema, SliThresholdComparatorSchema, SliThresholdSchema, SloCalendarPeriodSchema, SloFunctionOpSchema, SloFunctionSchema, SmtpChannelConfigsSchema, SmtpChannelSchema, SmtpTestInputSchema, SmtpTestRequestSchema, SmtpTestResponseSchema, SourceNameAllSpecifierSchema, SourceNameAndSpecifierSchema, SourceNameExactSpecifierSchema, SourceNameNoneSpecifierSchema, SourceNameNotSpecifierSchema, SourceNameOrSpecifierSchema, SourceNamePartOperatorSpecifierSchema, SourceNameRegExSpecifierSchema, SourceNameSpecifierSchema, StatusPageComponentSchema, StatusPageComponentsSchema, StoredCriteriaSchema, TAGS_ATTRIBUTE_KEY, TAS, TASGraph, TASService, TC_METRIC_CAP, TC_RESERVED_CUSTOM_ATTRIBUTE_KEYS, TC_STANDARD_ATTRIBUTE_KEYS, TICKET_ENRICHMENT_ALARM_TYPES, TICKET_ENRICHMENT_FIELD_CODES, 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, TasStoreAttributeValueSchema, TasStoreChangeSchema, TasStoreEdgeSchema, TasStoreGraphInputSchema, TasStoreGraphResponseSchema, TasStoreGraphSchema, TasStoreVertexSchema, TasTakeEdgesFilterSchema, TasTakeFlowsFilterSchema, TasTakeVerticesFilterSchema, TasTraverseFilterSchema, TasVariableFilterSchema, TasVariableSchema, TasVertexIdFilterSchema, TasVertexSchema, TasViewSchema, TemplateDeleteResponseSchema, TemplateWriteBodySchema, TemplateWriteResponseSchema, TenantConfigAttributeSchema, TenantConfigAttributesResponseSchema, TenantConfigAttributesWriteBodySchema, TenantConfigAttributesWriteResponseSchema, TenantProductSchema, TenantProductsResponseSchema, TenantRoleSchema, TenantRolesResponseSchema, TenantService, TicketEnrichmentAlarmFieldSchema, TicketEnrichmentAlarmFieldsResponseSchema, TicketEnrichmentListResponseSchema, TicketEnrichmentMappingSchema, TicketEnrichmentRuleSchema, TicketEnrichmentWriteBodySchema, TicketEnrichmentWriteResponseSchema, TokenCreateResponseSchema, TokenDetailsSchema, TokenGetAndVerifyRequestSchema, TokenMetadataSchema, TokenQueryRequestSchema, TokenQueryResponseSchema, TokenVerifyRequestSchema, Trace, TraversalEdgeFilterSchema, TraversalVertexFilterSchema, TraverseCollectSchema, TraverseDirectionSchema, TraverseSchema, UIM_LOGS_INGESTION_PATH, UpdateAgentTokenRequestSchema, UpdateTenantTokenRequestSchema, UpdateUserTokenRequestSchema, VertexGroupSchema, VertexMappingConfigurationModule, VertexService, VertexStateAlertFilterSchema, VertexStateAllFilterSchema, VertexStateAnalyticResultSchema, VertexStateAndFilterSchema, VertexStateClampSettingSchema, VertexStateCollectVertexGroupStatusFilterSchema, VertexStateEmptyFilterSchema, VertexStateExternalIdInputSchema, VertexStateExternalIdResponseSchema, VertexStateExternalIdSchema, VertexStateFetchRequestSchema, VertexStateFetchResponseSchema, VertexStateFilterSchema, VertexStateGroupResultSchema, VertexStateInputSchema, VertexStateManagementModuleFilterSchema, VertexStateMetricFilterSchema, VertexStateNamespaceFilterSchema, VertexStateNumericIdSchema, VertexStateOrFilterSchema, VertexStateProjectionSchema, VertexStateRangeRequestSchema, VertexStateRangeResponseSchema, VertexStateRepublishRequestSchema, VertexStateResponseItemSchema, VertexStateSchema, VertexStateStateFilterSchema, VertexStateStoreRequestSchema, VertexStateStoreResponseSchema, VertexStateVertexIdFilterSchema, VertexStatusChanges, ViewAccessEntrySchema, ViewAccessRoleSchema, ViewAccessSchema, ViewActiveFilterSchema, ViewAllFilterSchema, ViewAndFilterSchema, ViewAttributeExpressionSchema, ViewAttributeFilterSchema, ViewAttributesSchema, ViewBodySchema, ViewFilterSchema, ViewIdFilterSchema, ViewListResponseSchema, ViewNassSpecSchema, ViewOrFilterSchema, ViewOwnerSchema, ViewQueryRequestSchema, ViewQueryResponseSchema, ViewResponseSchema, ViewSearchRequestSchema, ViewSpecsSchema, ViewTasSpecSchema, WebhookAuthDetailsSchema, WebhookChannelSchema, WebhookSpecSchema, WebhookTestInputSchema, WebhookTestRequestSchema, WebhookTestResponseSchema, ags, agsresponse, alarmFilterDisplayColumnsFor, alarmRecordTime, alertsForSliIndex, algorithmicSituationsEnabled, allAlarmQueues, apiTokenCreate, apiTokenDelete, apiTokenGet, apiTokenList, apiTokenUpdate, appendSli, appendSloTriplet, attributeFilterTargets, authHeaderValue, buildAlarmFilterUpdateBody, buildAlarmQueueFilterExpression, buildAlarmQueueUpdateBody, buildAlertEntry, buildClusteringPolicyUpdateBody, buildCustomLogPayload, buildEnrichmentRuleUpdateBody, buildInventoryCustomFilter, buildInventoryQueueUpdateBody, buildPolicyFilterExpression, buildSliFunction, buildSloTriplet, buildTemplateRefs, buildUimLogPayload, capVertexDetail, checkGet, chunkPayloads, classifyIngestionError, compileTcSourceName, composeMetricTypeBits, contactActivate, contactDelete, contactTestSend, contactsBlockDelete, contactsBlockPut, contactsConfirm, contactsCreate, contactsGet, contactsGetDetail, contactsReplaceNotificationsWith, contactsRequestConfirmationCode, contactsUpdate, convertLegacyConfiguration, createCurlCommand, createCurlScript, createPostmanRequest, createServiceMonolith, customAttributeKeyIssues, decodeMetricTypeBits, defaultItsmPropertyList, defaultRuleName, deriveSliAs, deriveVertexName, describeClusteringCriteria, displayColumnsFor, dottedFileSlot, draftKey, encodeItsmSecret, ensureParallelAlerts, escapeRegExp, evaluate, evaluateTemplate, example, excludedAttributes, exportAlarmRecords, exportFileLabel, exportIncludesToken, expressionPipelineNames, extractComponentGridData, findAlertByTarget, findInventoryGroup, findProduct, findRedactedSecretPaths, findSliByName, flattenAxiosHeaders, folderAccessGet, folderDelete, folderGet, folderPost, folderUpdate, foldersList, formExternalId, getDataStoreSchema, getUserTokenSub, getUserTokenTid, getVertexAttributeValue, getVertexAttributeValueOrNull, hasTypeTagsFlag, hasVertexAttribute, impliedDxo2Version, incrementVariant, inventoryDisplayColumnsFor, inventoryQueuesOf, inventorySearchRequestBodyExample, inventorySearchResponseBody, isAlarmFilter, isAlarmQueue, isAlarmQueueNotFound, isAuthorizationHeader, isBuiltInClusteringPolicy, isBuiltInPolicy, isBuiltInTemplate, isDataStoreSchemaType, isEmptyCriteria, isInventoryQueueNotFound, isPersonalQueue, isProductProvisioned, isTemplate, isTenantToken, isUserToken, isWildcardOnlySourceName, itsmMapToProperties, itsmPropertiesToMap, javaFullMatch, javaRegexToJs, javaReplaceAll, javaReplaceFirst, javaSplit, lintSourceName, listDataStoreSchemaOps, listNameSpecifierOps, listSlis, locationsCreate, locationsDelete, locationsGet, locationsGetAll, locationsGetByType, locationsLeafGetFilter, locationsPost, logGet, logGetEvent, logIngestionURLForGateway, maintenanceDelete, maintenanceDeleteWindows, maintenanceFilter, maintenanceGet, maintenanceGetDetail, maintenanceGetWindows, maintenanceGetWindowsDetail, maintenanceUpdateWindowsDetail, maintenancesCreate, maintenancesImmediateDelete, maintenancesImmediatePut, maintenancesPostWindows, maintenancesUpdate, markServiceMetricPresence, measureBytes, messageGet, messageTemplateVariables, messagesList, monitorActivate, monitorCreate, monitorDeactivate, monitorDelete, monitorGet, monitorGetAll, monitorUpdate, normalizeAlarmQueueSharing, oauthClientTokensCreate, oauthClientTokensDelete, oauthClientTokensGet, oauthClientTokensList, oauthClientTokensUpdate, oauthCreateToken, oauthGetRefreshTokenList, oauthGetTokenList, oauthRefreshTokenDeleteId, oauthTokenCognateDelete, oauthTokenCognateDeleteCurrent, oauthTokenDelete, oauthTokenDeleteCurrent, orBlocksByField, parseAlarmRecordTime, parseExpression, parseExternalIdFormat, parseFilter, parseSaasGateway, parseServiceNowUrl, pipeGroupRanges, planEnrichmentReorder, policyCategoryGuard, policyFieldBounds, policyFilterAtoms, producedMetricName, projectCustomAttributes, projectRule, pruneOrphanSloFunctions, readLifecyclePages, redactChannelSecrets, reencodeItsmForWrite, removeAlert, removeSli, removeSloTriplet, resolveAnomalyDetectionProduct, resolveEnrichmentMappings, resolveWebhookPayload, sampleServiceDetailRequestBody, searchAlarmWindows, searchUniverse, sendWithRetry, serviceDetailResponseBody, settingsGet, settingsGetDetail, settingsUpdate, sharedRoleDelta, sleep, sliHumanName, sloTripletFor, sortRulesByPriority, sourceNameBattery, sourceNameMatrix, splitAttributePath, splitTemplate, standardVertexAttributes, stationDelete, stationsAgentType, stationsCreate, stationsDeleteMaintenance, stationsGet, stationsGetAgents, stationsLatest, stationsList, stationsOnpremiseConnected, stationsOnpremiseConnectedAll, stationsOnpremiseList, stationsPutMaintenance, stationsUpdate, statistic, summarizeDataStoreSchema, tagsGetAll, tcSourceNameMatches, tcSourceNameToJavaRegex, tcSourceNameToMmPattern, templateUsage, tenantConfigAttribute, timezonesList, toAlarmFilterWriteBody, toAlarmQueueWriteBody, toAnomalyDetectionGroupSaveRequest, toAnomalyGroupMetricsRequest, toChannelWriteBody, toClusteringPolicyPreviewBody, toClusteringPolicyWriteBody, toEnrichmentRuleCreateBody, toGroupMetricsRequest, toInventoryQueueWriteBody, toItsmTestConnectionRequest, toPolicyWriteBody, toSliGroupSaveRequest, toTemplateWriteBody, toTicketEnrichmentWriteBody, tokenize, translateRuleToMmQuery, truthy, userBlockDelete, userBlockPut, userDelete, userGet, userLockDelete, userPut, userSubaccountsGet, userSubaccountsPost, verifyAndDumpLegacyConfiguration, verifyAndDumpVersion3Configuration, verifyAndDumpVersion4Configuration, vertexMatchesFilters, visibleAlarmQueueColumns, visibleInventoryColumns };
89862
91630
  //# sourceMappingURL=index.esm.js.map