infracensus-collector 1.6.69 → 1.6.71

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 (33) hide show
  1. package/dist/aws-index.js +3 -3
  2. package/dist/azure-index.js +3 -3
  3. package/dist/{chunk-YODCYDGU.js → chunk-3AHD4WXA.js} +2 -2
  4. package/dist/{chunk-C7Q64SNU.js → chunk-5ZNDFGWM.js} +2 -2
  5. package/dist/{chunk-OGBYEIPU.js → chunk-CCZ2WP7Y.js} +3 -3
  6. package/dist/{chunk-OEVBPLDZ.js → chunk-CJGLTYNH.js} +3 -3
  7. package/dist/{chunk-FHUSY55M.js → chunk-I5STRYUI.js} +2 -2
  8. package/dist/{chunk-BNU3TPUH.js → chunk-NDFIP23B.js} +2 -2
  9. package/dist/{chunk-WIZJ5HYY.js → chunk-OTDU2R5N.js} +2 -2
  10. package/dist/{chunk-TAPUYQEW.js → chunk-RZIB4TLJ.js} +2 -2
  11. package/dist/{chunk-PUELZPI2.js → chunk-SUHW24G7.js} +46 -11
  12. package/dist/chunk-SUHW24G7.js.map +7 -0
  13. package/dist/{chunk-YMX7IHZO.js → chunk-V4YW27DZ.js} +3 -3
  14. package/dist/cli.js +2 -2
  15. package/dist/gcp-index.js +3 -3
  16. package/dist/identity-index.js +2 -2
  17. package/dist/index.js +9 -9
  18. package/dist/sensitive-data-index.js +4 -4
  19. package/dist/smb-shares-index.js +3 -3
  20. package/dist/{status-TJRZUJGM.js → status-4Y5MEEOX.js} +3 -3
  21. package/dist/voice-index.js +1 -1
  22. package/package.json +1 -1
  23. package/dist/chunk-PUELZPI2.js.map +0 -7
  24. /package/dist/{chunk-YODCYDGU.js.map → chunk-3AHD4WXA.js.map} +0 -0
  25. /package/dist/{chunk-C7Q64SNU.js.map → chunk-5ZNDFGWM.js.map} +0 -0
  26. /package/dist/{chunk-OGBYEIPU.js.map → chunk-CCZ2WP7Y.js.map} +0 -0
  27. /package/dist/{chunk-OEVBPLDZ.js.map → chunk-CJGLTYNH.js.map} +0 -0
  28. /package/dist/{chunk-FHUSY55M.js.map → chunk-I5STRYUI.js.map} +0 -0
  29. /package/dist/{chunk-BNU3TPUH.js.map → chunk-NDFIP23B.js.map} +0 -0
  30. /package/dist/{chunk-WIZJ5HYY.js.map → chunk-OTDU2R5N.js.map} +0 -0
  31. /package/dist/{chunk-TAPUYQEW.js.map → chunk-RZIB4TLJ.js.map} +0 -0
  32. /package/dist/{chunk-YMX7IHZO.js.map → chunk-V4YW27DZ.js.map} +0 -0
  33. /package/dist/{status-TJRZUJGM.js.map → status-4Y5MEEOX.js.map} +0 -0
package/dist/aws-index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  awsWithCost,
4
4
  describeAwsRun,
5
5
  runAwsAccount
6
- } from "./chunk-OGBYEIPU.js";
6
+ } from "./chunk-CCZ2WP7Y.js";
7
7
  import "./chunk-PCPJUPKF.js";
8
8
  import "./chunk-JKLWKARZ.js";
9
9
  import "./chunk-ND7YJJNV.js";
@@ -19,11 +19,11 @@ import {
19
19
  } from "./chunk-D7VTJN62.js";
20
20
  import "./chunk-BPIFQYJR.js";
21
21
  import "./chunk-PTGS7JVX.js";
22
- import "./chunk-YODCYDGU.js";
22
+ import "./chunk-3AHD4WXA.js";
23
23
  import "./chunk-OORBSDZ2.js";
24
24
  import "./chunk-PYKACAVZ.js";
25
25
  import "./chunk-VILM5VKX.js";
26
- import "./chunk-OEVBPLDZ.js";
26
+ import "./chunk-CJGLTYNH.js";
27
27
  import "./chunk-URNQQQIZ.js";
28
28
  import "./chunk-FFJGJCV7.js";
29
29
  import {
@@ -2,7 +2,7 @@ import {
2
2
  buildAzureInventory,
3
3
  listAccessibleSubscriptions,
4
4
  runAzureMonitoringCoverage
5
- } from "./chunk-TAPUYQEW.js";
5
+ } from "./chunk-RZIB4TLJ.js";
6
6
  import "./chunk-ND7YJJNV.js";
7
7
  import "./chunk-6D4KWUKJ.js";
8
8
  import "./chunk-JHEAVIL7.js";
@@ -11,11 +11,11 @@ import "./chunk-4ARXQ6VD.js";
11
11
  import {
12
12
  ArmClient,
13
13
  runCostAfterAzure
14
- } from "./chunk-YODCYDGU.js";
14
+ } from "./chunk-3AHD4WXA.js";
15
15
  import "./chunk-OORBSDZ2.js";
16
16
  import "./chunk-PYKACAVZ.js";
17
17
  import "./chunk-VILM5VKX.js";
18
- import "./chunk-OEVBPLDZ.js";
18
+ import "./chunk-CJGLTYNH.js";
19
19
  import "./chunk-URNQQQIZ.js";
20
20
  import {
21
21
  pushAzureInventory
@@ -70,7 +70,7 @@ import {
70
70
  } from "./chunk-VILM5VKX.js";
71
71
  import {
72
72
  collectorVersion
73
- } from "./chunk-OEVBPLDZ.js";
73
+ } from "./chunk-CJGLTYNH.js";
74
74
  import {
75
75
  collectorOwnsModule
76
76
  } from "./chunk-QANDVYFT.js";
@@ -3774,4 +3774,4 @@ export {
3774
3774
  runCostAfterAzure,
3775
3775
  runCostAfterIdentity
3776
3776
  };
3777
- //# sourceMappingURL=chunk-YODCYDGU.js.map
3777
+ //# sourceMappingURL=chunk-3AHD4WXA.js.map
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-D7VTJN62.js";
17
17
  import {
18
18
  collectorVersion
19
- } from "./chunk-OEVBPLDZ.js";
19
+ } from "./chunk-CJGLTYNH.js";
20
20
  import {
21
21
  PKG_ROOT
22
22
  } from "./chunk-URNQQQIZ.js";
@@ -1096,4 +1096,4 @@ export {
1096
1096
  resolveJobCredentials,
1097
1097
  targetRefusalMessage
1098
1098
  };
1099
- //# sourceMappingURL=chunk-C7Q64SNU.js.map
1099
+ //# sourceMappingURL=chunk-5ZNDFGWM.js.map
@@ -70,7 +70,7 @@ import {
70
70
  costRouteKnownMissing,
71
71
  lineCurrency,
72
72
  pushCostPart
73
- } from "./chunk-YODCYDGU.js";
73
+ } from "./chunk-3AHD4WXA.js";
74
74
  import {
75
75
  COST_CHARGES_MAX_ROWS_PER_SUBSCRIPTION,
76
76
  COST_CHARGE_AMOUNT_MAX,
@@ -95,7 +95,7 @@ import {
95
95
  } from "./chunk-VILM5VKX.js";
96
96
  import {
97
97
  collectorVersion
98
- } from "./chunk-OEVBPLDZ.js";
98
+ } from "./chunk-CJGLTYNH.js";
99
99
  import {
100
100
  isPlanRefusal,
101
101
  planRefusalFrom
@@ -2397,4 +2397,4 @@ export {
2397
2397
  describeAwsRun,
2398
2398
  runAwsScanGuarded
2399
2399
  };
2400
- //# sourceMappingURL=chunk-OGBYEIPU.js.map
2400
+ //# sourceMappingURL=chunk-CCZ2WP7Y.js.map
@@ -6,8 +6,8 @@ import {
6
6
  import { readFileSync } from "node:fs";
7
7
  import { join } from "node:path";
8
8
  function collectorVersion() {
9
- if ("1.6.69".length > 0) {
10
- return "1.6.69";
9
+ if ("1.6.71".length > 0) {
10
+ return "1.6.71";
11
11
  }
12
12
  return installedVersion();
13
13
  }
@@ -31,4 +31,4 @@ export {
31
31
  installedVersion,
32
32
  restartNeededNotice
33
33
  };
34
- //# sourceMappingURL=chunk-OEVBPLDZ.js.map
34
+ //# sourceMappingURL=chunk-CJGLTYNH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  classifyAndPush
3
- } from "./chunk-C7Q64SNU.js";
3
+ } from "./chunk-5ZNDFGWM.js";
4
4
  import {
5
5
  DP_EXTERNAL_DOMAINS_MAX,
6
6
  DP_M365_GRANTEES_PER_FILE,
@@ -1059,4 +1059,4 @@ export {
1059
1059
  m365JobNote,
1060
1060
  scanM365Stores
1061
1061
  };
1062
- //# sourceMappingURL=chunk-FHUSY55M.js.map
1062
+ //# sourceMappingURL=chunk-I5STRYUI.js.map
@@ -9,7 +9,7 @@ import {
9
9
  collectorVersion,
10
10
  installedVersion,
11
11
  restartNeededNotice
12
- } from "./chunk-OEVBPLDZ.js";
12
+ } from "./chunk-CJGLTYNH.js";
13
13
  import {
14
14
  PKG_ROOT
15
15
  } from "./chunk-URNQQQIZ.js";
@@ -1050,4 +1050,4 @@ export {
1050
1050
  condenseLogTail,
1051
1051
  buildUiStatus
1052
1052
  };
1053
- //# sourceMappingURL=chunk-BNU3TPUH.js.map
1053
+ //# sourceMappingURL=chunk-NDFIP23B.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mapWithConcurrency,
3
3
  targetRefusalMessage
4
- } from "./chunk-C7Q64SNU.js";
4
+ } from "./chunk-5ZNDFGWM.js";
5
5
  import {
6
6
  createThrottle,
7
7
  walkShare
@@ -683,4 +683,4 @@ export {
683
683
  machineVerdict,
684
684
  deliveryVerdict
685
685
  };
686
- //# sourceMappingURL=chunk-WIZJ5HYY.js.map
686
+ //# sourceMappingURL=chunk-OTDU2R5N.js.map
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-ZWBSBRJN.js";
17
17
  import {
18
18
  armStatus
19
- } from "./chunk-YODCYDGU.js";
19
+ } from "./chunk-3AHD4WXA.js";
20
20
  import {
21
21
  NotFoundCache,
22
22
  isRouteMissing,
@@ -1412,4 +1412,4 @@ export {
1412
1412
  buildAzureInventory,
1413
1413
  runAzureMonitoringCoverage
1414
1414
  };
1415
- //# sourceMappingURL=chunk-TAPUYQEW.js.map
1415
+ //# sourceMappingURL=chunk-RZIB4TLJ.js.map
@@ -83,6 +83,15 @@ function asStr(v) {
83
83
  if (typeof u === "number" || typeof u === "boolean") return String(u);
84
84
  return void 0;
85
85
  }
86
+ function risCmNodes(response) {
87
+ for (const wrapper of [pick(response, "selectCmDeviceReturn"), pick(response, "return"), response]) {
88
+ if (!isRecord(wrapper)) continue;
89
+ const result = pick(wrapper, "SelectCmDeviceResult");
90
+ if (isRecord(result) && result.CmNodes !== void 0) return result.CmNodes;
91
+ if (wrapper.CmNodes !== void 0) return wrapper.CmNodes;
92
+ }
93
+ return void 0;
94
+ }
86
95
  function firstResponse(body) {
87
96
  for (const [k, v] of Object.entries(body)) {
88
97
  if (k === "Fault") continue;
@@ -1022,6 +1031,11 @@ var AxlClient = class {
1022
1031
  if (deviceNames.length > names.length) {
1023
1032
  failures.push(`only the first ${names.length} of ${deviceNames.length} phones were asked about`);
1024
1033
  }
1034
+ if (failures.length === 0 && out.size === 0 && !this.signal?.aborted) {
1035
+ this.registrationIssue = `RisPort70 answered but listed none of the ${deviceNames.length} phone(s) \u2014 the real-time service has not seen them, or the cluster's reply was not in a form this collector reads`;
1036
+ this.log("warn", `RisPort70: ${this.registrationIssue}`);
1037
+ return out;
1038
+ }
1025
1039
  if (failures.length > 0) {
1026
1040
  const first = failures[0];
1027
1041
  const remedy = /HTTP 40[13]/.test(first) ? ` \u2014 the AXL account is refused by the real-time status service; give it the "Standard CCM Admin Users" and "Standard RealtimeAndTraceCollection" roles` : "";
@@ -1034,8 +1048,8 @@ var AxlClient = class {
1034
1048
  async registrationBatch(deviceNames, out) {
1035
1049
  {
1036
1050
  const risBase = this.base.replace(/\/axl\/?$/, "/realtimeservice2/services/RISService70/");
1037
- const items = deviceNames.map((n) => `<ns:item>${xml(n)}</ns:item>`).join("");
1038
- const envelope = `<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.cisco.com/ast/soap"><soapenv:Body><ns:selectCmDevice><ns:CmSelectionCriteria><ns:MaxReturnedDevices>1000</ns:MaxReturnedDevices><ns:DeviceClass>Phone</ns:DeviceClass><ns:Status>Any</ns:Status><ns:SelectBy>Name</ns:SelectBy><ns:SelectItems>${items}</ns:SelectItems></ns:CmSelectionCriteria></ns:selectCmDevice></soapenv:Body></soapenv:Envelope>`;
1051
+ const items = deviceNames.map((n) => `<ns:item><ns:Item>${xml(n)}</ns:Item></ns:item>`).join("");
1052
+ const envelope = `<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.cisco.com/ast/soap"><soapenv:Body><ns:selectCmDevice><ns:StateInfo></ns:StateInfo><ns:CmSelectionCriteria><ns:MaxReturnedDevices>${RISPORT_BATCH_SIZE}</ns:MaxReturnedDevices><ns:DeviceClass>Phone</ns:DeviceClass><ns:Model>255</ns:Model><ns:Status>Any</ns:Status><ns:NodeName></ns:NodeName><ns:SelectBy>Name</ns:SelectBy><ns:SelectItems>${items}</ns:SelectItems><ns:Protocol>Any</ns:Protocol><ns:DownloadStatus>Any</ns:DownloadStatus></ns:CmSelectionCriteria></ns:selectCmDevice></soapenv:Body></soapenv:Envelope>`;
1039
1053
  const res = await fetch(risBase, {
1040
1054
  ...this.tlsInit,
1041
1055
  method: "POST",
@@ -1056,8 +1070,13 @@ var AxlClient = class {
1056
1070
  }
1057
1071
  const parsed = this.parser.parse(text);
1058
1072
  const body = asRecord(pick(asRecord(pick(parsed, "Envelope")), "Body"));
1059
- const ret = asRecord(pick(firstResponse(body), "return"));
1060
- const cmNodes = asRecord(ret.CmNodes);
1073
+ const nodesRaw = risCmNodes(firstResponse(body));
1074
+ if (nodesRaw === void 0) {
1075
+ const resp = firstResponse(body);
1076
+ const keys = isRecord(resp) ? Object.keys(resp).slice(0, 6).join(", ") : typeof resp;
1077
+ throw new Error(`the reply carried no CmNodes (response elements: ${keys || "none"})`);
1078
+ }
1079
+ const cmNodes = asRecord(nodesRaw);
1061
1080
  for (const nodeRaw of toArray(cmNodes.item)) {
1062
1081
  const node = asRecord(nodeRaw);
1063
1082
  const devices = asRecord(node.CmDevices);
@@ -1155,9 +1174,12 @@ function errMsg2(err) {
1155
1174
  return err instanceof Error ? err.message : String(err);
1156
1175
  }
1157
1176
  function asCount(v) {
1158
- const n = typeof v === "string" ? Number(v) : typeof v === "number" ? v : void 0;
1177
+ const n = typeof v === "string" && v.trim() !== "" ? Number(v) : typeof v === "number" ? v : void 0;
1159
1178
  return n !== void 0 && Number.isFinite(n) && n >= 0 ? Math.round(n) : void 0;
1160
1179
  }
1180
+ function totalOf(json) {
1181
+ return asCount(json["@total"]) ?? asCount(json.total);
1182
+ }
1161
1183
  var CupiClient = class {
1162
1184
  base;
1163
1185
  signal;
@@ -1188,13 +1210,25 @@ var CupiClient = class {
1188
1210
  }
1189
1211
  /** GET /vmrest/users?rowsPerPage=1 — `@total` is the mailbox count, without paging every row. */
1190
1212
  async getMailboxCount() {
1191
- const json = await this.get("users?rowsPerPage=1");
1192
- return asCount(json.total);
1213
+ return this.countOf("users?rowsPerPage=1");
1193
1214
  }
1194
1215
  /** GET /vmrest/ports?rowsPerPage=1 — `@total` is the configured voicemail port count. */
1195
1216
  async getPortCount() {
1196
- const json = await this.get("ports?rowsPerPage=1");
1197
- return asCount(json.total);
1217
+ return this.countOf("ports?rowsPerPage=1");
1218
+ }
1219
+ /**
1220
+ * A list's total, or undefined — and when the reply answered but carried no
1221
+ * total, say which keys it DID carry (names only, bounded), so a format
1222
+ * change is visible in the log instead of becoming a silent "unknown".
1223
+ */
1224
+ async countOf(path) {
1225
+ const json = await this.get(path);
1226
+ const total = totalOf(json);
1227
+ if (total === void 0) {
1228
+ const keys = Object.keys(json).slice(0, 8).join(", ") || "none";
1229
+ this.log("warn", `CUPI GET ${path}: the reply carried no @total (keys: ${keys})`);
1230
+ }
1231
+ return total;
1198
1232
  }
1199
1233
  /**
1200
1234
  * GET /vmrest/telephonyintegrations/ports?rowsPerPage=1 — the first port's
@@ -1740,6 +1774,7 @@ async function buildCucmInventory(client, host, stamp, log = noopLog4) {
1740
1774
  log,
1741
1775
  "RisPort70 registration lookup"
1742
1776
  ) ?? /* @__PURE__ */ new Map();
1777
+ const regByUpperName = new Map([...regByName].map(([k, v]) => [k.toUpperCase(), v]));
1743
1778
  const nodes = (await safe(() => client.listProcessNodes(), log, "CUCM listProcessNode"))?.filter(
1744
1779
  (n) => n.name && !NON_SERVER_PROCESS_NODE_NAMES.has(n.name.toLowerCase())
1745
1780
  ) ?? [];
@@ -1802,7 +1837,7 @@ async function buildCucmInventory(client, host, stamp, log = noopLog4) {
1802
1837
  );
1803
1838
  }
1804
1839
  const endpoints = rawPhones.map((p) => {
1805
- const reg = p.name ? regByName.get(p.name) : void 0;
1840
+ const reg = p.name ? regByName.get(p.name) ?? regByUpperName.get(p.name.toUpperCase()) : void 0;
1806
1841
  return VoiceEndpoint.parse({
1807
1842
  id: p.uuid ? stableId(siteId, "endpoint", normalizeUuid(p.uuid)) : stableId(siteId, "endpoint", p.name ?? "unknown"),
1808
1843
  tenantId,
@@ -2102,4 +2137,4 @@ export {
2102
2137
  buildUnityInventory,
2103
2138
  buildWebexInventory
2104
2139
  };
2105
- //# sourceMappingURL=chunk-PUELZPI2.js.map
2140
+ //# sourceMappingURL=chunk-SUHW24G7.js.map