@dx-do/client 7.7.0 → 7.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -919,6 +919,14 @@ exports.PlatformFilters = void 0;
919
919
  PlatformFilters.FilterNode = FilterNode;
920
920
  })(exports.PlatformFilters || (exports.PlatformFilters = {}));
921
921
 
922
+ /**
923
+ * Every `alarmCategory` the alarm-filter store holds: `rawAlarm` entries are
924
+ * alarm queues (All Alarms view), `service` and `situation` entries are the
925
+ * filters of the Service Alarms and Situations views (see alarm-filter.ts),
926
+ * `monitoredInventory` entries are the Inventory page's queues (see
927
+ * model/inventory/inventory-queue.ts, which reads them through their own API).
928
+ */
929
+ const ALARM_QUEUE_CATEGORIES = ['rawAlarm', 'service', 'situation', 'monitoredInventory'];
922
930
  // ---------------------------------------------------------------------------
923
931
  // Filter settings
924
932
  // ---------------------------------------------------------------------------
@@ -953,7 +961,9 @@ const ALARM_QUEUE_DEFAULT_FILTER_SETTINGS = {
953
961
  const AlarmQueueSchema = v4.z.looseObject({
954
962
  id: v4.z.string().describe('Queue UUID, the identifier commands take; names are not unique'),
955
963
  filterName: v4.z.string().describe('Display name chosen by the author; several queues may share one'),
956
- alarmCategory: v4.z.string().describe("Alarm category the queue filters; 'rawAlarm' for alarm queues"),
964
+ alarmCategory: v4.z
965
+ .string()
966
+ .describe('Alarm category the queue filters: rawAlarm (alarm page), monitoredInventory, or situation; the detail and delete reads are per category, so pass the queue\'s own value'),
957
967
  personal: v4.z
958
968
  .boolean()
959
969
  .optional()
@@ -988,12 +998,13 @@ const AlarmQueueSchema = v4.z.looseObject({
988
998
  .record(v4.z.string(), v4.z.boolean())
989
999
  .optional()
990
1000
  .describe('Column id to visible flag; the UI always sends the full ~104-id catalog'),
991
- columnOrder: v4.z.array(v4.z.string()).optional().describe('Column ids in grid order'),
1001
+ columnOrder: v4.z.array(v4.z.string()).nullable().optional().describe('Column ids in grid order; null on service filters'),
992
1002
  columnPreferences: v4.z
993
1003
  .record(v4.z.string(), v4.z.looseObject({ width: v4.z.number().optional() }))
1004
+ .nullable()
994
1005
  .optional()
995
1006
  .describe('Per-column grid preferences (width)'),
996
- columnSize: v4.z.array(v4.z.unknown()).optional().describe('UI column sizing state'),
1007
+ columnSize: v4.z.array(v4.z.unknown()).nullable().optional().describe('UI column sizing state'),
997
1008
  pinnedColumns: v4.z
998
1009
  .union([v4.z.null(), v4.z.record(v4.z.string(), v4.z.unknown())])
999
1010
  .optional()
@@ -1014,9 +1025,23 @@ function isPersonalQueue(queue) {
1014
1025
  function isAlarmQueueNotFound(raw) {
1015
1026
  return typeof raw === 'object' && raw !== null && !('id' in raw);
1016
1027
  }
1017
- /** The detail read (`_search?id=`) adds the filter expression. */
1028
+ /**
1029
+ * The detail read (`_search?id=&alarmCategory=`) adds the match. rawAlarm and
1030
+ * situation queues carry the and/or tree in `filterExpressions`; monitoredInventory
1031
+ * queues carry a flat atom list in `filterExpression` (singular) plus grouping state.
1032
+ */
1018
1033
  const AlarmQueueDetailSchema = AlarmQueueSchema.extend({
1019
- filterExpressions: PolicyFilterExpressionSchema.describe('and/or tree of {field, condition, value} atoms; the UI emits one or-group per atom under an outer and'),
1034
+ filterExpressions: PolicyFilterExpressionSchema.optional().describe('and/or tree of {field, condition, value} atoms (rawAlarm and situation queues); the UI emits one or-group per atom under an outer and; absent on monitoredInventory queues'),
1035
+ filterExpression: v4.z
1036
+ .array(PolicyFilterAtomSchema)
1037
+ .optional()
1038
+ .describe('monitoredInventory queues only: flat list of atoms (e.g. field `sources`), ANDed'),
1039
+ groupByField: v4.z.string().optional().describe("monitoredInventory queues: group-by field, or the string 'null'"),
1040
+ groupById: v4.z.number().optional().describe('monitoredInventory queues: group-by id'),
1041
+ selectToggles: v4.z
1042
+ .record(v4.z.string(), v4.z.boolean())
1043
+ .optional()
1044
+ .describe('monitoredInventory queues: UI view toggles (interfaces, summary)'),
1020
1045
  });
1021
1046
  /** `GET oi/v2/api/alarmfilters/_search`: the queues visible to the caller. */
1022
1047
  const AlarmQueueListResponseSchema = v4.z.looseObject({
@@ -1073,7 +1098,9 @@ const AlarmQueueWriteBodySchema = v4.z
1073
1098
  .looseObject({
1074
1099
  id: v4.z.string().optional().describe('Queue UUID, required on update, absent on create'),
1075
1100
  filterName: v4.z.string().min(1).describe('Display name; the server allows duplicates'),
1076
- alarmCategory: v4.z.string().describe("'rawAlarm' for alarm queues"),
1101
+ alarmCategory: v4.z
1102
+ .string()
1103
+ .describe("'rawAlarm' for alarm-page queues (the CLI creates those only); monitoredInventory and situation queues are UI-authored"),
1077
1104
  isPinned: v4.z.boolean().describe('Pin for the caller (create); the persisted value is echoed on update'),
1078
1105
  isDefault: v4.z.boolean().describe('Make it the default for the caller (create); echoed on update'),
1079
1106
  personal: v4.z.boolean().describe('true = creator-only; false = owned by ownerRole, shared to sharedToRoles'),
@@ -1137,7 +1164,7 @@ const AlarmQueuePreferencesSchema = v4.z.strictObject({
1137
1164
  isPinned: v4.z.boolean().describe("Pin in the caller's queue bar"),
1138
1165
  isDefault: v4.z.boolean().describe("Make it the caller's default queue"),
1139
1166
  sharePreferences: v4.z.boolean().describe('Echo of the queue value (the UI sends false)'),
1140
- alarmCategory: v4.z.string().describe("'rawAlarm'"),
1167
+ alarmCategory: v4.z.string().describe("The queue's own alarmCategory (rawAlarm, monitoredInventory, situation)"),
1141
1168
  });
1142
1169
  const AlarmQueuePreferencesResponseSchema = v4.z.looseObject({
1143
1170
  message: v4.z.string().describe("'Update Alarm Filter Preferences Successful !!!'"),
@@ -1333,8 +1360,16 @@ const ALARM_QUEUE_DEFAULT_COLUMN_ORDER = [
1333
1360
  'custom_14',
1334
1361
  'custom_15',
1335
1362
  ];
1336
- /** Conditions the queue editor offers: the platform's string matchers (no notify-time detectors). */
1337
- const ALARM_QUEUE_FILTER_CONDITIONS = exports.PlatformFilters.ValidFieldConditions;
1363
+ /**
1364
+ * Conditions the queue editor offers: the platform's string matchers plus the
1365
+ * presence tests seen on customer queues (`ticketState does_not_exists`); no
1366
+ * notify-time detectors (`changed`, `increases`, ...).
1367
+ */
1368
+ const ALARM_QUEUE_FILTER_CONDITIONS = [
1369
+ ...exports.PlatformFilters.ValidFieldConditions,
1370
+ 'exists',
1371
+ 'does_not_exists',
1372
+ ];
1338
1373
  // ---------------------------------------------------------------------------
1339
1374
  // Helpers: the invariants live here, not in the CLI
1340
1375
  // ---------------------------------------------------------------------------
@@ -1418,7 +1453,7 @@ function toAlarmQueueWriteBody(input) {
1418
1453
  filterSettings: { ...ALARM_QUEUE_DEFAULT_FILTER_SETTINGS, ...input.filterSettings },
1419
1454
  };
1420
1455
  }
1421
- const list = (items) => `[${(items ?? []).join(', ')}]`;
1456
+ const list$2 = (items) => `[${(items ?? []).join(', ')}]`;
1422
1457
  /**
1423
1458
  * The update body for an existing queue with only the patched fields changed;
1424
1459
  * everything else (display columns, order, settings, pin state) is sent back
@@ -1450,9 +1485,10 @@ function buildAlarmQueueUpdateBody(existing, patch) {
1450
1485
  if (delta.newSharedRoles.length > 0 || delta.unSharedRoles.length > 0) {
1451
1486
  const added = delta.newSharedRoles.map((role) => `+${role}`);
1452
1487
  const removed = delta.unSharedRoles.map((role) => `-${role}`);
1453
- changes.push(`sharedToRoles: ${list(previousRoles)} -> ${list(sharing.sharedToRoles)} (${[...added, ...removed].join(', ')})`);
1488
+ changes.push(`sharedToRoles: ${list$2(previousRoles)} -> ${list$2(sharing.sharedToRoles)} (${[...added, ...removed].join(', ')})`);
1454
1489
  }
1455
- const filterExpressions = patch.filterExpressions ?? existing.filterExpressions;
1490
+ // Inventory queues carry no tree; the empty and-group keeps the preview well-formed (the CLI blocks the write).
1491
+ const filterExpressions = patch.filterExpressions ?? existing.filterExpressions ?? buildAlarmQueueFilterExpression([]);
1456
1492
  if (patch.filterExpressions !== undefined) {
1457
1493
  changes.push('filter: replaced');
1458
1494
  }
@@ -1462,7 +1498,7 @@ function buildAlarmQueueUpdateBody(existing, patch) {
1462
1498
  const nextColumns = displayColumnsFor(patch.visibleColumns);
1463
1499
  const nextVisible = visibleAlarmQueueColumns(nextColumns);
1464
1500
  if (nextVisible.join(',') !== currentVisible.join(',')) {
1465
- changes.push(`columns: ${list(currentVisible)} -> ${list(nextVisible)}`);
1501
+ changes.push(`columns: ${list$2(currentVisible)} -> ${list$2(nextVisible)}`);
1466
1502
  displayColumns = nextColumns;
1467
1503
  }
1468
1504
  }
@@ -1501,6 +1537,215 @@ function buildAlarmQueueUpdateBody(existing, patch) {
1501
1537
  return { body, changes };
1502
1538
  }
1503
1539
 
1540
+ /**
1541
+ * Alarm filters: the saved filters of the Service Alarms and Situations
1542
+ * views of the alarms page. They live in the same `oi/v2/api/alarmfilters`
1543
+ * store as alarm queues (`alarmCategory` service / situation instead of
1544
+ * rawAlarm) but are a lighter concept: no sharing, no per-user preference
1545
+ * bar, a per-view field catalog and column catalog. A selected filter is
1546
+ * applied by inlining its expression as `customFilter` into
1547
+ * `servicealarms/_search` / `clusteralarms/_search`. Shapes observed in a
1548
+ * HAR of the demo tenant's UI (alarm-queue-vs-filter.har, 2026-09-08).
1549
+ */
1550
+ const ALARM_FILTER_CATEGORIES = ['service', 'situation'];
1551
+ /** The three alarms-page views, each with its own field catalog. */
1552
+ const ALARM_VIEW_CATEGORIES = ['rawAlarm', 'service', 'situation'];
1553
+ /** The field catalog each view's filter editor offers (`GET`, bare array of {field, fieldDescription, values}). */
1554
+ const ALARM_VIEW_FIELD_PATHS = {
1555
+ rawAlarm: 'oi/v2/api/alarms/fields',
1556
+ service: 'oi/v2/api/servicealarms/fields',
1557
+ situation: 'oi/v2/api/clusteralarms/fields',
1558
+ };
1559
+ /** The search each view runs; a queue or filter expression goes in as `customFilter`. */
1560
+ const ALARM_VIEW_SEARCH_PATHS = {
1561
+ rawAlarm: 'oi/v2/api/alarms/_search',
1562
+ service: 'oi/v2/api/servicealarms/_search',
1563
+ situation: 'oi/v2/api/clusteralarms/_search',
1564
+ };
1565
+ /** rawAlarm entries are alarm queues (sharing, pin bar); service / situation entries are filters. */
1566
+ function isAlarmQueue(entry) {
1567
+ return entry.alarmCategory === 'rawAlarm';
1568
+ }
1569
+ function isAlarmFilter(entry) {
1570
+ return ALARM_FILTER_CATEGORIES.includes(entry.alarmCategory);
1571
+ }
1572
+ // ---------------------------------------------------------------------------
1573
+ // Per-view column catalogs (the display-column maps the UI sends on create)
1574
+ // ---------------------------------------------------------------------------
1575
+ const ALARM_FILTER_DISPLAY_COLUMN_KEYS = {
1576
+ service: [
1577
+ 'severity',
1578
+ 'alarmId',
1579
+ 'subClustersCount',
1580
+ 'isStable',
1581
+ 'message',
1582
+ 'entity',
1583
+ 'Service',
1584
+ 'sourceProduct',
1585
+ 'ticketID',
1586
+ 'ticketActionStatus',
1587
+ 'troubleShooter',
1588
+ 'assignmentGroup',
1589
+ 'timeOrigin',
1590
+ 'lastUpdateTime',
1591
+ 'closedTime',
1592
+ ],
1593
+ situation: [
1594
+ 'severity',
1595
+ 'alarmId',
1596
+ 'subClustersCount',
1597
+ 'isStable',
1598
+ 'message',
1599
+ 'entity',
1600
+ 'Service',
1601
+ 'sourceProduct',
1602
+ 'ticketID',
1603
+ 'ticketActionStatus',
1604
+ 'troubleShooter',
1605
+ 'assignmentGroup',
1606
+ 'timeOrigin',
1607
+ 'lastUpdateTime',
1608
+ ],
1609
+ };
1610
+ /** Everything but assignmentGroup is visible by default in both views. */
1611
+ const ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS = {
1612
+ service: ALARM_FILTER_DISPLAY_COLUMN_KEYS.service.filter((column) => column !== 'assignmentGroup'),
1613
+ situation: ALARM_FILTER_DISPLAY_COLUMN_KEYS.situation.filter((column) => column !== 'assignmentGroup'),
1614
+ };
1615
+ /** The situation view also persists a grid column order; the service view sends none. */
1616
+ const ALARM_FILTER_DEFAULT_COLUMN_ORDER = {
1617
+ service: [],
1618
+ situation: [
1619
+ 'situation-details',
1620
+ 'Checkbox Column',
1621
+ 'severity',
1622
+ 'alarmActions',
1623
+ 'alarmId',
1624
+ 'subClustersCount',
1625
+ 'alarmsCount',
1626
+ 'situationDefName',
1627
+ 'isStable',
1628
+ 'message',
1629
+ 'entity',
1630
+ 'Service',
1631
+ 'sourceProduct',
1632
+ 'ticketID',
1633
+ 'ticketActionStatus',
1634
+ 'troubleShooter',
1635
+ 'timeOrigin',
1636
+ 'lastUpdateTime',
1637
+ 'closedTime',
1638
+ 'assignmentGroup',
1639
+ 'timelineData',
1640
+ ],
1641
+ };
1642
+ /** The view's full column map with exactly `visible` set to true; unknown ids throw. */
1643
+ function alarmFilterDisplayColumnsFor(category, visible) {
1644
+ const known = ALARM_FILTER_DISPLAY_COLUMN_KEYS[category];
1645
+ const unknown = visible.filter((column) => !known.includes(column));
1646
+ if (unknown.length > 0) {
1647
+ throw new Error(`unknown ${category} filter column(s): ${unknown.join(', ')}`);
1648
+ }
1649
+ const wanted = new Set(visible);
1650
+ return Object.fromEntries(known.map((column) => [column, wanted.has(column)]));
1651
+ }
1652
+ // ---------------------------------------------------------------------------
1653
+ // Write shape
1654
+ // ---------------------------------------------------------------------------
1655
+ /**
1656
+ * Body of `POST oi/v2/api/alarmfilters` (create) and
1657
+ * `PUT oi/v2/api/alarmfilters?filterName=<name>` (update) for a service or
1658
+ * situation filter: the queue body minus every sharing and preference key.
1659
+ * The situation view adds `columnOrder` / `columnSize` / `pinnedColumns`.
1660
+ */
1661
+ const AlarmFilterWriteBodySchema = v4.z.looseObject({
1662
+ id: v4.z.string().optional().describe('Filter UUID, required on update, absent on create'),
1663
+ filterName: v4.z.string().min(1).describe('Display name; the server allows duplicates'),
1664
+ alarmCategory: v4.z.enum(ALARM_FILTER_CATEGORIES).describe("'service' (Service Alarms view) or 'situation' (Situations view)"),
1665
+ isPinned: v4.z.boolean().describe('Pinned in the view (create); echoed on update'),
1666
+ isDefault: v4.z.boolean().describe('Default filter of the view (create); echoed on update'),
1667
+ isComplexFilter: v4.z.boolean().describe('false for expressions built from atoms'),
1668
+ filterExpressions: PolicyFilterExpressionSchema.describe('and/or tree of atoms, one or-group per field+condition'),
1669
+ displayColumns: v4.z.record(v4.z.string(), v4.z.boolean()).describe("Column id to visible flag over the view's column catalog"),
1670
+ columnOrder: v4.z.array(v4.z.string()).optional().describe('Situation view only: grid column order'),
1671
+ columnSize: v4.z.array(v4.z.unknown()).optional().describe('Situation view only: UI column sizing state ([] on create)'),
1672
+ pinnedColumns: v4.z
1673
+ .union([v4.z.null(), v4.z.record(v4.z.string(), v4.z.unknown())])
1674
+ .optional()
1675
+ .describe('Situation view only: pinned grid columns (null on create)'),
1676
+ isFilterExpressionChanged: v4.z.boolean().optional().describe('Update only; the UI sends true on every save'),
1677
+ });
1678
+ /** Same response shape as a queue write: the persisted entry plus the insert flags. */
1679
+ const AlarmFilterWriteResponseSchema = AlarmQueueWriteResponseSchema;
1680
+ /** The create body with the view's defaults filled in. */
1681
+ function toAlarmFilterWriteBody(input) {
1682
+ const body = {
1683
+ filterName: input.filterName,
1684
+ alarmCategory: input.category,
1685
+ isPinned: input.isPinned ?? false,
1686
+ isDefault: input.isDefault ?? false,
1687
+ isComplexFilter: false,
1688
+ filterExpressions: input.filterExpressions,
1689
+ displayColumns: alarmFilterDisplayColumnsFor(input.category, input.visibleColumns ?? ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS[input.category]),
1690
+ };
1691
+ if (input.category === 'situation') {
1692
+ body.columnOrder = [...ALARM_FILTER_DEFAULT_COLUMN_ORDER.situation];
1693
+ body.columnSize = [];
1694
+ body.pinnedColumns = null;
1695
+ }
1696
+ return body;
1697
+ }
1698
+ const list$1 = (items) => `[${items.join(', ')}]`;
1699
+ /**
1700
+ * The update body for an existing filter with only the patched fields
1701
+ * changed; columns and view state are sent back verbatim. Returns
1702
+ * human-readable `changes`; an empty list means nothing to save.
1703
+ * @throws Error when `existing` is not a service / situation filter.
1704
+ */
1705
+ function buildAlarmFilterUpdateBody(existing, patch) {
1706
+ if (!isAlarmFilter(existing)) {
1707
+ throw new Error(`'${existing.filterName}' is a ${existing.alarmCategory} entry, not a service / situation filter`);
1708
+ }
1709
+ const category = existing.alarmCategory;
1710
+ const changes = [];
1711
+ const filterName = patch.filterName ?? existing.filterName;
1712
+ if (filterName !== existing.filterName) {
1713
+ changes.push(`name: '${existing.filterName}' -> '${filterName}'`);
1714
+ }
1715
+ const filterExpressions = patch.filterExpressions ?? existing.filterExpressions ?? buildAlarmQueueFilterExpression([]);
1716
+ if (patch.filterExpressions !== undefined) {
1717
+ changes.push('filter: replaced');
1718
+ }
1719
+ const known = ALARM_FILTER_DISPLAY_COLUMN_KEYS[category];
1720
+ const currentVisible = known.filter((column) => existing.displayColumns?.[column] === true);
1721
+ let displayColumns = existing.displayColumns ?? alarmFilterDisplayColumnsFor(category, ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS[category]);
1722
+ if (patch.visibleColumns !== undefined) {
1723
+ const next = alarmFilterDisplayColumnsFor(category, patch.visibleColumns);
1724
+ const nextVisible = known.filter((column) => next[column] === true);
1725
+ if (nextVisible.join(',') !== currentVisible.join(',')) {
1726
+ changes.push(`columns: ${list$1(currentVisible)} -> ${list$1(nextVisible)}`);
1727
+ displayColumns = next;
1728
+ }
1729
+ }
1730
+ const body = {
1731
+ id: existing.id,
1732
+ filterName,
1733
+ alarmCategory: category,
1734
+ isPinned: existing.isPinned ?? false,
1735
+ isDefault: existing.isDefault ?? false,
1736
+ isComplexFilter: existing.isComplexFilter ?? false,
1737
+ filterExpressions,
1738
+ displayColumns,
1739
+ isFilterExpressionChanged: true,
1740
+ };
1741
+ if (category === 'situation') {
1742
+ body.columnOrder = existing.columnOrder ?? [...ALARM_FILTER_DEFAULT_COLUMN_ORDER.situation];
1743
+ body.columnSize = existing.columnSize ?? [];
1744
+ body.pinnedColumns = existing.pinnedColumns ?? null;
1745
+ }
1746
+ return { body, changes };
1747
+ }
1748
+
1504
1749
  exports.AlertDefinitionResponse = void 0;
1505
1750
  (function (AlertDefinitionResponse) {
1506
1751
  (function (AlertComparisonOperator) {
@@ -57688,6 +57933,259 @@ const InventorizePreviewResponseSchema = v4.z
57688
57933
  .record(v4.z.string(), InventorizePreviewSchema)
57689
57934
  .describe('Preview results keyed by ruleName.');
57690
57935
 
57936
+ /**
57937
+ * Inventory queues: the saved filters of the Monitored Inventory page. They
57938
+ * share the alarm-filter store (`alarmCategory: monitoredInventory` shows up
57939
+ * in `oi/v2/api/alarmfilters/_search`) but the page reads and writes them
57940
+ * through its own `oi/v3/api/inventory/*` family: `filters/_search`,
57941
+ * `save-filter`, `update-filter`, `update-pinned-filter`, `delete-filter`,
57942
+ * `fields`, `group/list`. The match is a flat atom list (`filterExpression`,
57943
+ * singular) that the page turns into an and-of-or `customFilter` for
57944
+ * `oi/v3/api/inventory/_search`. Shapes observed in inventory-queue.har
57945
+ * (demo tenant, 2026-09-08); delete read live from DevTools.
57946
+ */
57947
+ const INVENTORY_QUEUE_CATEGORY = 'monitoredInventory';
57948
+ const InventoryQueueFilterAtomSchema = PolicyFilterAtomSchema;
57949
+ /** Conditions the inventory queue editor offers (string matchers; starts_with / contains / equals observed). */
57950
+ const INVENTORY_QUEUE_FILTER_CONDITIONS = exports.PlatformFilters.ValidFieldConditions;
57951
+ // ---------------------------------------------------------------------------
57952
+ // Catalogs
57953
+ // ---------------------------------------------------------------------------
57954
+ /** One entry of `GET oi/v3/api/inventory/fields` (filterable, 9) or `?all=true` (every attribute, 27). */
57955
+ const InventoryQueueFieldSchema = v4.z.looseObject({
57956
+ field: v4.z.string().describe('Attribute name to use in filter atoms or as a display column'),
57957
+ fieldDescription: v4.z.string().describe("Human label, e.g. 'Entity' for name, 'Source' for sources"),
57958
+ values: v4.z.array(v4.z.string()).describe('Closed vocabulary when non-empty (state, ttl, maintenance)'),
57959
+ fieldType: v4.z.string().nullable().optional().describe('Type hint; null on this endpoint'),
57960
+ });
57961
+ const InventoryQueueFieldsResponseSchema = v4.z.array(InventoryQueueFieldSchema);
57962
+ /** One entry of `GET oi/v3/api/inventory/group/list`: a group-by choice. */
57963
+ const InventoryGroupSchema = v4.z.looseObject({
57964
+ id: v4.z.number().describe('groupById the queue stores'),
57965
+ name: v4.z.string().describe("Display name, e.g. 'Type', 'Source'"),
57966
+ attributes: v4.z.string().describe("groupByField the queue stores, e.g. 'type', 'SourceProduct'"),
57967
+ isDefault: v4.z.boolean().optional().describe('Built-in grouping'),
57968
+ isPublic: v4.z.boolean().optional().describe('Visible to every user'),
57969
+ });
57970
+ const InventoryGroupsResponseSchema = v4.z.looseObject({
57971
+ response: v4.z.array(InventoryGroupSchema).describe('Available groupings'),
57972
+ });
57973
+ /** The page's default display columns (the create body carries only the visible ones, all true). */
57974
+ const INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS = [
57975
+ 'product',
57976
+ 'name',
57977
+ 'ipAddresses',
57978
+ 'serviceNames',
57979
+ 'type',
57980
+ 'maintenance',
57981
+ ];
57982
+ /** The page's default view toggles. */
57983
+ const INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES = { interfaces: false, summary: true };
57984
+ /** How the store spells "no grouping". */
57985
+ const INVENTORY_QUEUE_NO_GROUP = { groupByField: 'null', groupById: 0 };
57986
+ // ---------------------------------------------------------------------------
57987
+ // Read shapes
57988
+ // ---------------------------------------------------------------------------
57989
+ /** One inventory queue as `GET oi/v3/api/inventory/filters/_search?category=monitoredInventory` lists it. */
57990
+ const InventoryQueueSchema = v4.z.looseObject({
57991
+ id: v4.z.string().describe('Queue UUID, the identifier commands take'),
57992
+ filterName: v4.z.string().describe('Display name chosen by the author; the server allows duplicates'),
57993
+ alarmCategory: v4.z.string().describe("'monitoredInventory'"),
57994
+ isPinned: v4.z.boolean().nullable().optional().describe('Pinned on the Inventory page'),
57995
+ isDefault: v4.z.boolean().nullable().optional().describe('Default queue of the Inventory page'),
57996
+ createdBy: v4.z.string().optional().describe('Display name of the creator'),
57997
+ updatedBy: v4.z.string().optional().describe('Display name of the last editor'),
57998
+ creationTime: v4.z.string().optional().describe('Creation time as epoch milliseconds in a string'),
57999
+ lastUpdated: v4.z.string().optional().describe('Last update as epoch milliseconds in a string'),
58000
+ rank: v4.z.string().optional().describe("UI ordering rank, a numeric string ('0')"),
58001
+ groupSelected: v4.z.boolean().optional().describe('UI state: a grouping is selected'),
58002
+ isComplexFilter: v4.z.boolean().optional().describe('false for atom-built matches'),
58003
+ });
58004
+ /** The detail read (`filters/_search?id=`) adds the match and the view state. */
58005
+ const InventoryQueueDetailSchema = InventoryQueueSchema.extend({
58006
+ filterExpression: v4.z
58007
+ .array(InventoryQueueFilterAtomSchema)
58008
+ .describe('Flat list of {field, condition, value} atoms, ANDed; fields from oi/v3/api/inventory/fields'),
58009
+ displayColumns: v4.z
58010
+ .record(v4.z.string(), v4.z.boolean())
58011
+ .optional()
58012
+ .describe('Visible columns (attribute name to true); only the chosen ones are stored'),
58013
+ selectToggles: v4.z
58014
+ .record(v4.z.string(), v4.z.boolean())
58015
+ .optional()
58016
+ .describe('View toggles: interfaces, summary'),
58017
+ groupByField: v4.z.string().optional().describe("Grouping attribute (see group/list), or the string 'null'"),
58018
+ groupById: v4.z.number().optional().describe('Grouping id (see group/list); 0 when none'),
58019
+ sortColumn: v4.z.array(v4.z.string()).optional().describe("Sort entries such as 'timestamp:desc'"),
58020
+ });
58021
+ /**
58022
+ * `GET oi/v3/api/inventory/filters/_search?category=monitoredInventory`: the queues
58023
+ * under an `alarmFilters` key; an empty store answers a message body instead.
58024
+ */
58025
+ const InventoryQueueListResponseSchema = v4.z.union([
58026
+ v4.z.looseObject({ alarmFilters: v4.z.array(InventoryQueueSchema).describe('The inventory queues (no atoms)') }),
58027
+ v4.z.looseObject({ message: v4.z.string().describe("'No Alarm Filter Found !!!' when the store is empty") }),
58028
+ ]);
58029
+ /** Normalizes the two list shapes to a plain array. */
58030
+ function inventoryQueuesOf(raw) {
58031
+ const queues = raw.alarmFilters;
58032
+ return Array.isArray(queues) ? queues : [];
58033
+ }
58034
+ /** The detail read answers 200 with an id-less body when the queue does not exist. */
58035
+ function isInventoryQueueNotFound(raw) {
58036
+ return typeof raw === 'object' && raw !== null && !('id' in raw);
58037
+ }
58038
+ // ---------------------------------------------------------------------------
58039
+ // Write shapes
58040
+ // ---------------------------------------------------------------------------
58041
+ /**
58042
+ * Body of `POST oi/v3/api/inventory/save-filter` (create) and
58043
+ * `PUT oi/v3/api/inventory/update-filter?filterName=<name>` (update, which
58044
+ * adds `id` and `isFilterExpressionChanged`).
58045
+ */
58046
+ const InventoryQueueWriteBodySchema = v4.z.looseObject({
58047
+ id: v4.z.string().optional().describe('Queue UUID, required on update, absent on create'),
58048
+ filterName: v4.z.string().min(1).describe('Display name; the server allows duplicates'),
58049
+ alarmCategory: v4.z.literal(INVENTORY_QUEUE_CATEGORY).describe("'monitoredInventory'"),
58050
+ isPinned: v4.z.boolean().describe('Pin on the Inventory page (create); echoed on update'),
58051
+ isDefault: v4.z.boolean().describe('Make it the default queue (create); echoed on update'),
58052
+ filterExpression: v4.z
58053
+ .array(InventoryQueueFilterAtomSchema)
58054
+ .min(1)
58055
+ .describe('Flat list of atoms, ANDed (the page never saves an empty match)'),
58056
+ displayColumns: v4.z.record(v4.z.string(), v4.z.boolean()).describe('Visible columns (attribute name to true)'),
58057
+ selectToggles: v4.z.record(v4.z.string(), v4.z.boolean()).describe('View toggles: interfaces, summary'),
58058
+ groupByField: v4.z.string().describe("Grouping attribute from group/list, or 'null' for none"),
58059
+ groupById: v4.z.number().describe('Grouping id from group/list, or 0 for none'),
58060
+ isFilterExpressionChanged: v4.z.boolean().optional().describe('Update only; the UI sends true on every save'),
58061
+ });
58062
+ /** Create / update response: the persisted queue plus the insert flags. */
58063
+ const InventoryQueueWriteResponseSchema = InventoryQueueDetailSchema.extend({
58064
+ queueInserted: v4.z.boolean().optional().describe('true when the write persisted'),
58065
+ isDuplicate: v4.z.boolean().optional().describe('true when the server considers the name a duplicate'),
58066
+ isFilterExpressionChanged: v4.z.boolean().optional().describe('Echo of the update flag'),
58067
+ });
58068
+ /** Body of `PUT oi/v3/api/inventory/update-pinned-filter`: exactly the five keys the page sends. */
58069
+ const InventoryQueuePreferencesSchema = v4.z.strictObject({
58070
+ id: v4.z.string().describe('Queue UUID'),
58071
+ filterName: v4.z.string().describe("The queue's current name (echoed)"),
58072
+ isPinned: v4.z.boolean().describe('Pin on the Inventory page'),
58073
+ isDefault: v4.z.boolean().describe('Make it the default queue'),
58074
+ groupByField: v4.z.string().describe("The queue's grouping attribute (echoed)"),
58075
+ });
58076
+ const InventoryQueuePreferencesResponseSchema = v4.z.looseObject({
58077
+ message: v4.z.string().describe("'Update Filter for isPinned Successful !!!'"),
58078
+ });
58079
+ /** `DELETE oi/v3/api/inventory/delete-filter?id=`: observed live on the lab tenant. */
58080
+ const InventoryQueueDeleteResponseSchema = v4.z.looseObject({
58081
+ message: v4.z.string().describe("'Delete Filter Successful !!!'"),
58082
+ });
58083
+ // ---------------------------------------------------------------------------
58084
+ // Helpers: the invariants live here, not in the CLI
58085
+ // ---------------------------------------------------------------------------
58086
+ /**
58087
+ * The `customFilter` the Inventory page sends to `oi/v3/api/inventory/_search`
58088
+ * for a queue: every atom in its own or-group under one outer and.
58089
+ */
58090
+ function buildInventoryCustomFilter(atoms) {
58091
+ return { and: { expressions: atoms.map((atom) => ({ or: { expressions: [atom] } })) } };
58092
+ }
58093
+ /** `displayColumns` for a column list: the chosen names, all true; unknown names throw when a catalog is given. */
58094
+ function inventoryDisplayColumnsFor(visible, catalog) {
58095
+ if (catalog) {
58096
+ const unknown = visible.filter((column) => !catalog.includes(column));
58097
+ if (unknown.length > 0) {
58098
+ throw new Error(`unknown inventory column(s): ${unknown.join(', ')}`);
58099
+ }
58100
+ }
58101
+ return Object.fromEntries(visible.map((column) => [column, true]));
58102
+ }
58103
+ /** Visible column names of a queue, in stored order. */
58104
+ function visibleInventoryColumns(displayColumns) {
58105
+ return Object.entries(displayColumns ?? {})
58106
+ .filter(([, on]) => on)
58107
+ .map(([column]) => column);
58108
+ }
58109
+ /** Resolves a grouping by attribute or display name (case-insensitive); undefined when unknown. */
58110
+ function findInventoryGroup(groups, wanted) {
58111
+ const needle = wanted.toLowerCase();
58112
+ return groups.find((group) => group.attributes.toLowerCase() === needle || group.name.toLowerCase() === needle);
58113
+ }
58114
+ /** The create body with the page's defaults filled in. */
58115
+ function toInventoryQueueWriteBody(input) {
58116
+ return {
58117
+ filterName: input.filterName,
58118
+ alarmCategory: INVENTORY_QUEUE_CATEGORY,
58119
+ isPinned: input.isPinned ?? false,
58120
+ isDefault: input.isDefault ?? false,
58121
+ filterExpression: [...input.atoms],
58122
+ displayColumns: inventoryDisplayColumnsFor(input.visibleColumns ?? INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS),
58123
+ selectToggles: { ...INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES, ...input.selectToggles },
58124
+ groupByField: input.group?.attributes ?? INVENTORY_QUEUE_NO_GROUP.groupByField,
58125
+ groupById: input.group?.id ?? INVENTORY_QUEUE_NO_GROUP.groupById,
58126
+ };
58127
+ }
58128
+ const list = (items) => `[${items.join(', ')}]`;
58129
+ const atomLine = (atom) => `${atom.field} ${atom.condition} ${String(atom.value)}`;
58130
+ /**
58131
+ * The update body for an existing queue with only the patched fields
58132
+ * changed; view state and pin / default are sent back verbatim. Returns
58133
+ * human-readable `changes`; an empty list means nothing to save.
58134
+ */
58135
+ function buildInventoryQueueUpdateBody(existing, patch) {
58136
+ const changes = [];
58137
+ const filterName = patch.filterName ?? existing.filterName;
58138
+ if (filterName !== existing.filterName) {
58139
+ changes.push(`name: '${existing.filterName}' -> '${filterName}'`);
58140
+ }
58141
+ const atoms = patch.atoms ?? existing.filterExpression;
58142
+ if (patch.atoms !== undefined) {
58143
+ changes.push(`filter: ${list(existing.filterExpression.map(atomLine))} -> ${list(patch.atoms.map(atomLine))}`);
58144
+ }
58145
+ const currentGroup = existing.groupByField ?? INVENTORY_QUEUE_NO_GROUP.groupByField;
58146
+ let groupByField = currentGroup;
58147
+ let groupById = existing.groupById ?? INVENTORY_QUEUE_NO_GROUP.groupById;
58148
+ if (patch.group === null) {
58149
+ groupByField = INVENTORY_QUEUE_NO_GROUP.groupByField;
58150
+ groupById = INVENTORY_QUEUE_NO_GROUP.groupById;
58151
+ }
58152
+ else if (patch.group !== undefined) {
58153
+ groupByField = patch.group.attributes;
58154
+ groupById = patch.group.id;
58155
+ }
58156
+ if (groupByField !== currentGroup) {
58157
+ changes.push(`groupBy: ${currentGroup === 'null' ? '(none)' : currentGroup} -> ${groupByField === 'null' ? '(none)' : groupByField}`);
58158
+ }
58159
+ const currentVisible = visibleInventoryColumns(existing.displayColumns);
58160
+ let displayColumns = existing.displayColumns ?? inventoryDisplayColumnsFor(INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS);
58161
+ if (patch.visibleColumns !== undefined && patch.visibleColumns.join(',') !== currentVisible.join(',')) {
58162
+ changes.push(`columns: ${list(currentVisible)} -> ${list(patch.visibleColumns)}`);
58163
+ displayColumns = inventoryDisplayColumnsFor(patch.visibleColumns);
58164
+ }
58165
+ const currentToggles = { ...INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES, ...existing.selectToggles };
58166
+ const selectToggles = { ...currentToggles };
58167
+ for (const [key, on] of Object.entries(patch.selectToggles ?? {})) {
58168
+ if (currentToggles[key] !== on) {
58169
+ changes.push(`toggle.${key}: ${String(currentToggles[key])} -> ${on}`);
58170
+ selectToggles[key] = on;
58171
+ }
58172
+ }
58173
+ const body = {
58174
+ id: existing.id,
58175
+ filterName,
58176
+ alarmCategory: INVENTORY_QUEUE_CATEGORY,
58177
+ isPinned: existing.isPinned ?? false,
58178
+ isDefault: existing.isDefault ?? false,
58179
+ filterExpression: [...atoms],
58180
+ displayColumns,
58181
+ selectToggles,
58182
+ groupByField,
58183
+ groupById,
58184
+ isFilterExpressionChanged: true,
58185
+ };
58186
+ return { body, changes };
58187
+ }
58188
+
57691
58189
  exports.Inventory = void 0;
57692
58190
  (function (Inventory) {
57693
58191
  Inventory.DEFAULT_PROJECTION_FIELDS = [
@@ -66388,14 +66886,16 @@ class AlarmService {
66388
66886
  }
66389
66887
  /**
66390
66888
  * Reads one alarm queue with its filter expression
66391
- * (`GET oi/v2/api/alarmfilters/_search?id=<id>&alarmCategory=rawAlarm`).
66392
- * A missing id answers 200 with an id-less body (see `isAlarmQueueNotFound`).
66889
+ * (`GET oi/v2/api/alarmfilters/_search?id=<id>&alarmCategory=<category>`).
66890
+ * The read is per category: asking for a situation or monitoredInventory
66891
+ * queue under `rawAlarm` answers the not-found body (200, no `id`; see
66892
+ * `isAlarmQueueNotFound`). Use `findAlarmQueue` when the category is unknown.
66393
66893
  * @remarks Response-validated, not thrown.
66394
66894
  */
66395
- async getAlarmQueueDetail(queueId) {
66895
+ async getAlarmQueueDetail(queueId, alarmCategory = 'rawAlarm') {
66396
66896
  const raw = await this.dxSaaSService.oiGet('oi/v2/api/alarmfilters/_search', {
66397
66897
  id: queueId,
66398
- alarmCategory: 'rawAlarm',
66898
+ alarmCategory,
66399
66899
  });
66400
66900
  const result = AlarmQueueDetailSchema.safeParse(raw);
66401
66901
  if (!result.success && !isAlarmQueueNotFound(raw)) {
@@ -66403,6 +66903,16 @@ class AlarmService {
66403
66903
  }
66404
66904
  return raw;
66405
66905
  }
66906
+ /**
66907
+ * The detail of a queue whose category is unknown: resolves `alarmCategory`
66908
+ * from the list read (which spans every category), then reads the detail
66909
+ * with it; falls back to a rawAlarm read when the list lacks the id.
66910
+ * @remarks Response-validated, not thrown; a missing queue yields the not-found body.
66911
+ */
66912
+ async findAlarmQueue(queueId) {
66913
+ const listed = (await this.getAlarmQueues()).alarmFilters?.find((queue) => queue.id === queueId);
66914
+ return this.getAlarmQueueDetail(queueId, listed?.alarmCategory ?? 'rawAlarm');
66915
+ }
66406
66916
  /**
66407
66917
  * Shared alarm queues with their expressions inlined (`GET oi/v2/api/allalarmfilters`).
66408
66918
  * Personal queues are not listed; an empty result is a message body, normalized to `[]`.
@@ -66456,16 +66966,17 @@ class AlarmService {
66456
66966
  }
66457
66967
  /**
66458
66968
  * Deletes an alarm queue
66459
- * (`DELETE oi/v2/api/alarmfilters?id=<id>&alarmCategory=rawAlarm`, read live
66460
- * from the UI's DevTools; the HAR exports never carried the row). Answers
66969
+ * (`DELETE oi/v2/api/alarmfilters?id=<id>&alarmCategory=<category>`, read live
66970
+ * from the UI's DevTools; the HAR exports never carried the row). Pass the
66971
+ * queue's own category (see `findAlarmQueue`). Answers
66461
66972
  * `{ message: 'Delete Filter Successful !!!' }`; callers still prove the
66462
66973
  * delete by re-reading the queue.
66463
66974
  * @remarks Response-validated, not thrown.
66464
66975
  */
66465
- async deleteAlarmQueue(queueId) {
66976
+ async deleteAlarmQueue(queueId, alarmCategory = 'rawAlarm') {
66466
66977
  const raw = await this.dxSaaSService.oiDelete('oi/v2/api/alarmfilters', {
66467
66978
  id: queueId,
66468
- alarmCategory: 'rawAlarm',
66979
+ alarmCategory,
66469
66980
  });
66470
66981
  const result = AlarmQueueDeleteResponseSchema.safeParse(raw);
66471
66982
  if (!result.success) {
@@ -66501,6 +67012,56 @@ class AlarmService {
66501
67012
  }
66502
67013
  return raw;
66503
67014
  }
67015
+ /**
67016
+ * The field catalog of one alarms-page view (`GET oi/v2/api/{alarms,servicealarms,clusteralarms}/fields`):
67017
+ * names, labels, and closed vocabularies for queue (rawAlarm) or filter (service, situation) atoms.
67018
+ * @remarks Response-validated, not thrown.
67019
+ */
67020
+ async listAlarmViewFields(category) {
67021
+ const raw = await this.dxSaaSService.oiGet(ALARM_VIEW_FIELD_PATHS[category]);
67022
+ const result = AlarmQueueFieldsResponseSchema.safeParse(raw);
67023
+ if (!result.success) {
67024
+ this.simpleLog.warn('AlarmQueueFieldsResponse validation warning:', result.error.message);
67025
+ }
67026
+ return raw;
67027
+ }
67028
+ /**
67029
+ * Creates a service / situation filter (`POST oi/v2/api/alarmfilters`, the
67030
+ * filter body: no sharing keys); `toAlarmFilterWriteBody` fills the view's defaults.
67031
+ * @throws ZodError on a malformed body.
67032
+ * @remarks Response-validated, not thrown.
67033
+ */
67034
+ async createAlarmFilter(body) {
67035
+ AlarmFilterWriteBodySchema.parse(body);
67036
+ const raw = await this.dxSaaSService.oiPost('oi/v2/api/alarmfilters', body);
67037
+ const result = AlarmFilterWriteResponseSchema.safeParse(raw);
67038
+ if (!result.success) {
67039
+ this.simpleLog.warn('AlarmFilterWriteResponse validation warning:', result.error.message);
67040
+ }
67041
+ return raw;
67042
+ }
67043
+ /**
67044
+ * Updates a service / situation filter (`PUT oi/v2/api/alarmfilters?filterName=<name>`);
67045
+ * the body carries `id` (see `buildAlarmFilterUpdateBody`).
67046
+ * @throws ZodError on a malformed body; Error when `body.id` is missing.
67047
+ * @remarks Response-validated, not thrown.
67048
+ */
67049
+ async updateAlarmFilter(body, filterNameQuery = body.filterName) {
67050
+ AlarmFilterWriteBodySchema.parse(body);
67051
+ if (!body.id) {
67052
+ throw new Error('updateAlarmFilter needs body.id (the filter UUID)');
67053
+ }
67054
+ const raw = await this.dxSaaSService.oiPut('oi/v2/api/alarmfilters', body, { filterName: filterNameQuery });
67055
+ const result = AlarmFilterWriteResponseSchema.safeParse(raw);
67056
+ if (!result.success) {
67057
+ this.simpleLog.warn('AlarmFilterWriteResponse validation warning:', result.error.message);
67058
+ }
67059
+ return raw;
67060
+ }
67061
+ /** Deletes a service / situation filter: the queue delete under the filter's own category. */
67062
+ async deleteAlarmFilter(filterId, category) {
67063
+ return this.deleteAlarmQueue(filterId, category);
67064
+ }
66504
67065
  /**
66505
67066
  * The tenant's role catalog (`GET oi/v2/api/getUserRoles`), the vocabulary
66506
67067
  * for `ownerRole` / `sharedToRoles`.
@@ -79754,6 +80315,129 @@ class InventoryService {
79754
80315
  });
79755
80316
  return returnRecord;
79756
80317
  }
80318
+ // ---------------------------------------------------------------------------
80319
+ // Inventory queues (the Monitored Inventory page's saved filters)
80320
+ // ---------------------------------------------------------------------------
80321
+ /**
80322
+ * Lists the inventory queues (`GET oi/v3/api/inventory/filters/_search?category=monitoredInventory`).
80323
+ * List entries carry no match; use `getInventoryQueue` for the atoms.
80324
+ * @remarks Response-validated, not thrown.
80325
+ */
80326
+ async listInventoryQueues() {
80327
+ const raw = await this.dxSaaSService.oiGet('oi/v3/api/inventory/filters/_search', {
80328
+ category: INVENTORY_QUEUE_CATEGORY,
80329
+ });
80330
+ const result = InventoryQueueListResponseSchema.safeParse(raw);
80331
+ if (!result.success) {
80332
+ this.log.warn('InventoryQueueListResponse validation warning:', result.error.message);
80333
+ }
80334
+ return inventoryQueuesOf(raw);
80335
+ }
80336
+ /**
80337
+ * Reads one inventory queue with its atoms and view state
80338
+ * (`GET oi/v3/api/inventory/filters/_search?id=<id>`). A missing id answers
80339
+ * 200 with an id-less body (see `isInventoryQueueNotFound`).
80340
+ * @remarks Response-validated, not thrown.
80341
+ */
80342
+ async getInventoryQueue(queueId) {
80343
+ const raw = await this.dxSaaSService.oiGet('oi/v3/api/inventory/filters/_search', { id: queueId });
80344
+ const result = InventoryQueueDetailSchema.safeParse(raw);
80345
+ if (!result.success && !isInventoryQueueNotFound(raw)) {
80346
+ this.log.warn('InventoryQueueDetail validation warning:', result.error.message);
80347
+ }
80348
+ return raw;
80349
+ }
80350
+ /**
80351
+ * Creates an inventory queue (`POST oi/v3/api/inventory/save-filter`);
80352
+ * `toInventoryQueueWriteBody` fills the page's defaults.
80353
+ * @throws ZodError on a malformed body (e.g. no atoms).
80354
+ * @remarks Response-validated, not thrown.
80355
+ */
80356
+ async createInventoryQueue(body) {
80357
+ InventoryQueueWriteBodySchema.parse(body);
80358
+ const raw = await this.dxSaaSService.oiPost('oi/v3/api/inventory/save-filter', body);
80359
+ const result = InventoryQueueWriteResponseSchema.safeParse(raw);
80360
+ if (!result.success) {
80361
+ this.log.warn('InventoryQueueWriteResponse validation warning:', result.error.message);
80362
+ }
80363
+ return raw;
80364
+ }
80365
+ /**
80366
+ * Updates an inventory queue (`PUT oi/v3/api/inventory/update-filter?filterName=<name>`);
80367
+ * the body carries `id` (see `buildInventoryQueueUpdateBody`). The page puts
80368
+ * the name in the query string; `filterNameQuery` defaults to the body's name.
80369
+ * @throws ZodError on a malformed body; Error when `body.id` is missing.
80370
+ * @remarks Response-validated, not thrown.
80371
+ */
80372
+ async updateInventoryQueue(body, filterNameQuery = body.filterName) {
80373
+ InventoryQueueWriteBodySchema.parse(body);
80374
+ if (!body.id) {
80375
+ throw new Error('updateInventoryQueue needs body.id (the queue UUID)');
80376
+ }
80377
+ const raw = await this.dxSaaSService.oiPut('oi/v3/api/inventory/update-filter', body, {
80378
+ filterName: filterNameQuery,
80379
+ });
80380
+ const result = InventoryQueueWriteResponseSchema.safeParse(raw);
80381
+ if (!result.success) {
80382
+ this.log.warn('InventoryQueueWriteResponse validation warning:', result.error.message);
80383
+ }
80384
+ return raw;
80385
+ }
80386
+ /**
80387
+ * Pins / unpins or sets the default inventory queue
80388
+ * (`PUT oi/v3/api/inventory/update-pinned-filter`).
80389
+ * @throws ZodError on a malformed body.
80390
+ * @remarks Response-validated, not thrown.
80391
+ */
80392
+ async setInventoryQueuePreferences(prefs) {
80393
+ InventoryQueuePreferencesSchema.parse(prefs);
80394
+ const raw = await this.dxSaaSService.oiPut('oi/v3/api/inventory/update-pinned-filter', prefs);
80395
+ const result = InventoryQueuePreferencesResponseSchema.safeParse(raw);
80396
+ if (!result.success) {
80397
+ this.log.warn('InventoryQueuePreferencesResponse validation warning:', result.error.message);
80398
+ }
80399
+ return raw;
80400
+ }
80401
+ /**
80402
+ * Deletes an inventory queue (`DELETE oi/v3/api/inventory/delete-filter?id=<id>`,
80403
+ * read live from the UI's DevTools; the HAR export never carried the row).
80404
+ * Answers `{ message: 'Delete Filter Successful !!!' }`; callers still prove the delete by re-reading.
80405
+ * @remarks Response-validated, not thrown.
80406
+ */
80407
+ async deleteInventoryQueue(queueId) {
80408
+ const raw = await this.dxSaaSService.oiDelete('oi/v3/api/inventory/delete-filter', { id: queueId });
80409
+ const result = InventoryQueueDeleteResponseSchema.safeParse(raw);
80410
+ if (!result.success) {
80411
+ this.log.warn('InventoryQueueDeleteResponse validation warning:', result.error.message);
80412
+ }
80413
+ return raw;
80414
+ }
80415
+ /**
80416
+ * The filterable inventory attributes (`GET oi/v3/api/inventory/fields`, 9)
80417
+ * or, with `all`, every attribute the page can show as a column (`?all=true`, 27).
80418
+ * @remarks Response-validated, not thrown.
80419
+ */
80420
+ async listInventoryQueueFields(all = false) {
80421
+ const raw = await this.dxSaaSService.oiGet('oi/v3/api/inventory/fields', all ? { all: 'true' } : undefined);
80422
+ const result = InventoryQueueFieldsResponseSchema.safeParse(raw);
80423
+ if (!result.success) {
80424
+ this.log.warn('InventoryQueueFieldsResponse validation warning:', result.error.message);
80425
+ }
80426
+ return Array.isArray(raw) ? raw : [];
80427
+ }
80428
+ /**
80429
+ * The group-by choices of the Inventory page (`GET oi/v3/api/inventory/group/list`):
80430
+ * `attributes` is the `groupByField` a queue stores, `id` its `groupById`.
80431
+ * @remarks Response-validated, not thrown.
80432
+ */
80433
+ async listInventoryGroups() {
80434
+ const raw = await this.dxSaaSService.oiGet('oi/v3/api/inventory/group/list');
80435
+ const result = InventoryGroupsResponseSchema.safeParse(raw);
80436
+ if (!result.success) {
80437
+ this.log.warn('InventoryGroupsResponse validation warning:', result.error.message);
80438
+ }
80439
+ return raw.response ?? [];
80440
+ }
79757
80441
  }
79758
80442
 
79759
80443
  /**
@@ -83999,18 +84683,28 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
83999
84683
  }
84000
84684
 
84001
84685
  exports.ALARM_CATEGORIES = ALARM_CATEGORIES;
84686
+ exports.ALARM_FILTER_CATEGORIES = ALARM_FILTER_CATEGORIES;
84687
+ exports.ALARM_FILTER_DEFAULT_COLUMN_ORDER = ALARM_FILTER_DEFAULT_COLUMN_ORDER;
84688
+ exports.ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS = ALARM_FILTER_DEFAULT_VISIBLE_COLUMNS;
84689
+ exports.ALARM_FILTER_DISPLAY_COLUMN_KEYS = ALARM_FILTER_DISPLAY_COLUMN_KEYS;
84002
84690
  exports.ALARM_FILTER_FIELD_PATHS = ALARM_FILTER_FIELD_PATHS;
84691
+ exports.ALARM_QUEUE_CATEGORIES = ALARM_QUEUE_CATEGORIES;
84003
84692
  exports.ALARM_QUEUE_DEFAULT_COLUMN_ORDER = ALARM_QUEUE_DEFAULT_COLUMN_ORDER;
84004
84693
  exports.ALARM_QUEUE_DEFAULT_FILTER_SETTINGS = ALARM_QUEUE_DEFAULT_FILTER_SETTINGS;
84005
84694
  exports.ALARM_QUEUE_DEFAULT_VISIBLE_COLUMNS = ALARM_QUEUE_DEFAULT_VISIBLE_COLUMNS;
84006
84695
  exports.ALARM_QUEUE_DISPLAY_COLUMN_KEYS = ALARM_QUEUE_DISPLAY_COLUMN_KEYS;
84007
84696
  exports.ALARM_QUEUE_FILTER_CONDITIONS = ALARM_QUEUE_FILTER_CONDITIONS;
84008
84697
  exports.ALARM_QUEUE_FILTER_SETTING_KEYS = ALARM_QUEUE_FILTER_SETTING_KEYS;
84698
+ exports.ALARM_VIEW_CATEGORIES = ALARM_VIEW_CATEGORIES;
84699
+ exports.ALARM_VIEW_FIELD_PATHS = ALARM_VIEW_FIELD_PATHS;
84700
+ exports.ALARM_VIEW_SEARCH_PATHS = ALARM_VIEW_SEARCH_PATHS;
84009
84701
  exports.AccService = AccService;
84010
84702
  exports.AgentService = AgentService;
84011
84703
  exports.AlarmCategorySchema = AlarmCategorySchema;
84012
84704
  exports.AlarmFilterFieldSchema = AlarmFilterFieldSchema;
84013
84705
  exports.AlarmFilterFieldsResponseSchema = AlarmFilterFieldsResponseSchema;
84706
+ exports.AlarmFilterWriteBodySchema = AlarmFilterWriteBodySchema;
84707
+ exports.AlarmFilterWriteResponseSchema = AlarmFilterWriteResponseSchema;
84014
84708
  exports.AlarmQueueDeleteResponseSchema = AlarmQueueDeleteResponseSchema;
84015
84709
  exports.AlarmQueueDetailSchema = AlarmQueueDetailSchema;
84016
84710
  exports.AlarmQueueFieldSchema = AlarmQueueFieldSchema;
@@ -84166,6 +84860,11 @@ exports.FolderNameRegExSpecifierSchema = FolderNameRegExSpecifierSchema;
84166
84860
  exports.FolderNameSpecifierSchema = FolderNameSpecifierSchema;
84167
84861
  exports.GenericChannelSchema = GenericChannelSchema;
84168
84862
  exports.GraphService = GraphService;
84863
+ exports.INVENTORY_QUEUE_CATEGORY = INVENTORY_QUEUE_CATEGORY;
84864
+ exports.INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES = INVENTORY_QUEUE_DEFAULT_SELECT_TOGGLES;
84865
+ exports.INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS = INVENTORY_QUEUE_DEFAULT_VISIBLE_COLUMNS;
84866
+ exports.INVENTORY_QUEUE_FILTER_CONDITIONS = INVENTORY_QUEUE_FILTER_CONDITIONS;
84867
+ exports.INVENTORY_QUEUE_NO_GROUP = INVENTORY_QUEUE_NO_GROUP;
84169
84868
  exports.ITSM_DEFAULT_TICKET_TEMPLATE = ITSM_DEFAULT_TICKET_TEMPLATE;
84170
84869
  exports.ITSM_SECRET_KEYS = ITSM_SECRET_KEYS;
84171
84870
  exports.ImportTokenRequestSchema = ImportTokenRequestSchema;
@@ -84177,6 +84876,19 @@ exports.InventorizePreviewSchema = InventorizePreviewSchema;
84177
84876
  exports.InventorizeRuleListResponseSchema = InventorizeRuleListResponseSchema;
84178
84877
  exports.InventorizeRuleSchema = InventorizeRuleSchema;
84179
84878
  exports.InventorizeSaveResponseSchema = InventorizeSaveResponseSchema;
84879
+ exports.InventoryGroupSchema = InventoryGroupSchema;
84880
+ exports.InventoryGroupsResponseSchema = InventoryGroupsResponseSchema;
84881
+ exports.InventoryQueueDeleteResponseSchema = InventoryQueueDeleteResponseSchema;
84882
+ exports.InventoryQueueDetailSchema = InventoryQueueDetailSchema;
84883
+ exports.InventoryQueueFieldSchema = InventoryQueueFieldSchema;
84884
+ exports.InventoryQueueFieldsResponseSchema = InventoryQueueFieldsResponseSchema;
84885
+ exports.InventoryQueueFilterAtomSchema = InventoryQueueFilterAtomSchema;
84886
+ exports.InventoryQueueListResponseSchema = InventoryQueueListResponseSchema;
84887
+ exports.InventoryQueuePreferencesResponseSchema = InventoryQueuePreferencesResponseSchema;
84888
+ exports.InventoryQueuePreferencesSchema = InventoryQueuePreferencesSchema;
84889
+ exports.InventoryQueueSchema = InventoryQueueSchema;
84890
+ exports.InventoryQueueWriteBodySchema = InventoryQueueWriteBodySchema;
84891
+ exports.InventoryQueueWriteResponseSchema = InventoryQueueWriteResponseSchema;
84180
84892
  exports.InventoryService = InventoryService;
84181
84893
  exports.ItsmChannelSchema = ItsmChannelSchema;
84182
84894
  exports.ItsmPropertySchema = ItsmPropertySchema;
@@ -84503,6 +85215,7 @@ exports.WebhookTestRequestSchema = WebhookTestRequestSchema;
84503
85215
  exports.WebhookTestResponseSchema = WebhookTestResponseSchema;
84504
85216
  exports.ags = ags;
84505
85217
  exports.agsresponse = agsresponse;
85218
+ exports.alarmFilterDisplayColumnsFor = alarmFilterDisplayColumnsFor;
84506
85219
  exports.alertsForSliIndex = alertsForSliIndex;
84507
85220
  exports.allAlarmQueues = allAlarmQueues;
84508
85221
  exports.apiTokenCreate = apiTokenCreate;
@@ -84513,9 +85226,12 @@ exports.apiTokenUpdate = apiTokenUpdate;
84513
85226
  exports.appendSli = appendSli;
84514
85227
  exports.appendSloTriplet = appendSloTriplet;
84515
85228
  exports.authHeaderValue = authHeaderValue;
85229
+ exports.buildAlarmFilterUpdateBody = buildAlarmFilterUpdateBody;
84516
85230
  exports.buildAlarmQueueFilterExpression = buildAlarmQueueFilterExpression;
84517
85231
  exports.buildAlarmQueueUpdateBody = buildAlarmQueueUpdateBody;
84518
85232
  exports.buildAlertEntry = buildAlertEntry;
85233
+ exports.buildInventoryCustomFilter = buildInventoryCustomFilter;
85234
+ exports.buildInventoryQueueUpdateBody = buildInventoryQueueUpdateBody;
84519
85235
  exports.buildPolicyFilterExpression = buildPolicyFilterExpression;
84520
85236
  exports.buildSliFunction = buildSliFunction;
84521
85237
  exports.buildSloTriplet = buildSloTriplet;
@@ -84559,6 +85275,7 @@ exports.exportIncludesToken = exportIncludesToken;
84559
85275
  exports.expressionPipelineNames = expressionPipelineNames;
84560
85276
  exports.extractComponentGridData = extractComponentGridData;
84561
85277
  exports.findAlertByTarget = findAlertByTarget;
85278
+ exports.findInventoryGroup = findInventoryGroup;
84562
85279
  exports.findProduct = findProduct;
84563
85280
  exports.findRedactedSecretPaths = findRedactedSecretPaths;
84564
85281
  exports.findSliByName = findSliByName;
@@ -84579,13 +85296,18 @@ exports.hasTypeTagsFlag = hasTypeTagsFlag;
84579
85296
  exports.hasVertexAttribute = hasVertexAttribute;
84580
85297
  exports.impliedDxo2Version = impliedDxo2Version;
84581
85298
  exports.incrementVariant = incrementVariant;
85299
+ exports.inventoryDisplayColumnsFor = inventoryDisplayColumnsFor;
85300
+ exports.inventoryQueuesOf = inventoryQueuesOf;
84582
85301
  exports.inventorySearchRequestBodyExample = inventorySearchRequestBodyExample;
84583
85302
  exports.inventorySearchResponseBody = inventorySearchResponseBody;
85303
+ exports.isAlarmFilter = isAlarmFilter;
85304
+ exports.isAlarmQueue = isAlarmQueue;
84584
85305
  exports.isAlarmQueueNotFound = isAlarmQueueNotFound;
84585
85306
  exports.isAuthorizationHeader = isAuthorizationHeader;
84586
85307
  exports.isBuiltInPolicy = isBuiltInPolicy;
84587
85308
  exports.isBuiltInTemplate = isBuiltInTemplate;
84588
85309
  exports.isDataStoreSchemaType = isDataStoreSchemaType;
85310
+ exports.isInventoryQueueNotFound = isInventoryQueueNotFound;
84589
85311
  exports.isPersonalQueue = isPersonalQueue;
84590
85312
  exports.isProductProvisioned = isProductProvisioned;
84591
85313
  exports.isTemplate = isTemplate;
@@ -84694,9 +85416,11 @@ exports.tcSourceNameMatches = tcSourceNameMatches;
84694
85416
  exports.tcSourceNameToMmPattern = tcSourceNameToMmPattern;
84695
85417
  exports.templateUsage = templateUsage;
84696
85418
  exports.timezonesList = timezonesList;
85419
+ exports.toAlarmFilterWriteBody = toAlarmFilterWriteBody;
84697
85420
  exports.toAlarmQueueWriteBody = toAlarmQueueWriteBody;
84698
85421
  exports.toChannelWriteBody = toChannelWriteBody;
84699
85422
  exports.toGroupMetricsRequest = toGroupMetricsRequest;
85423
+ exports.toInventoryQueueWriteBody = toInventoryQueueWriteBody;
84700
85424
  exports.toItsmTestConnectionRequest = toItsmTestConnectionRequest;
84701
85425
  exports.toPolicyWriteBody = toPolicyWriteBody;
84702
85426
  exports.toSliGroupSaveRequest = toSliGroupSaveRequest;
@@ -84717,4 +85441,5 @@ exports.verifyAndDumpVersion3Configuration = verifyAndDumpVersion3Configuration;
84717
85441
  exports.verifyAndDumpVersion4Configuration = verifyAndDumpVersion4Configuration;
84718
85442
  exports.vertexMatchesFilters = vertexMatchesFilters;
84719
85443
  exports.visibleAlarmQueueColumns = visibleAlarmQueueColumns;
85444
+ exports.visibleInventoryColumns = visibleInventoryColumns;
84720
85445
  //# sourceMappingURL=index.cjs.js.map