node-autotask 0.29.0 → 0.30.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 (41) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/MCP_TOOL_CATALOG.json +28 -9
  3. package/MCP_TOOL_MANIFEST.md +12 -11
  4. package/N8N_MCP_MANIFEST.json +3 -3
  5. package/N8N_MCP_MANIFEST.md +4 -4
  6. package/README.md +1 -1
  7. package/capabilities.json +1462 -1303
  8. package/dist/capabilities.cjs +2 -2
  9. package/dist/capabilities.js +1 -1
  10. package/dist/{chunk-X4TUU2Y6.js → chunk-2ETR5GSO.js} +2 -2
  11. package/dist/{chunk-PY45RBQ2.cjs → chunk-EDVSWL32.cjs} +1461 -1302
  12. package/dist/{chunk-APXBBN3D.cjs → chunk-L4TDVUJM.cjs} +143 -143
  13. package/dist/{chunk-IKWHRUQ5.cjs → chunk-LLIB4JGK.cjs} +52 -9
  14. package/dist/{chunk-T4SZGOJB.js → chunk-P4PC32RJ.js} +157 -80
  15. package/dist/{chunk-KVT5V7SA.js → chunk-QQPCJT2L.js} +49 -6
  16. package/dist/{chunk-BNIOQEKP.cjs → chunk-RS7QMPRO.cjs} +589 -512
  17. package/dist/{chunk-WKP442HS.js → chunk-TZC4ZAA6.js} +1461 -1302
  18. package/dist/{index-BZkfUU59.d.cts → index-B9VNv-EP.d.cts} +30 -3
  19. package/dist/{index-BGZ1Mhbh.d.cts → index-CJ36PwRG.d.cts} +6 -1
  20. package/dist/{index-BGZ1Mhbh.d.ts → index-CJ36PwRG.d.ts} +6 -1
  21. package/dist/{index-6_i-__sN.d.ts → index-DkpaFqyu.d.ts} +30 -3
  22. package/dist/index.cjs +22 -22
  23. package/dist/index.d.cts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +4 -4
  26. package/dist/operations/index.cjs +112 -112
  27. package/dist/operations/index.d.cts +4 -4
  28. package/dist/operations/index.d.ts +4 -4
  29. package/dist/operations/index.js +2 -2
  30. package/dist/pool.cjs +9 -9
  31. package/dist/pool.d.cts +2 -2
  32. package/dist/pool.d.ts +2 -2
  33. package/dist/pool.js +4 -4
  34. package/dist/resources/index.cjs +4 -4
  35. package/dist/resources/index.d.cts +2 -2
  36. package/dist/resources/index.d.ts +2 -2
  37. package/dist/resources/index.js +3 -3
  38. package/dist/types/index.d.cts +1 -1
  39. package/dist/types/index.d.ts +1 -1
  40. package/docs/API.md +1 -1
  41. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CAPABILITIES
3
- } from "./chunk-WKP442HS.js";
3
+ } from "./chunk-TZC4ZAA6.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var AUTH_HEADERS = {
@@ -17391,8 +17391,17 @@ function createNamePlan(labelFields = []) {
17391
17391
  const recordFks = [];
17392
17392
  const fkSeen = /* @__PURE__ */ new Set();
17393
17393
  let lineOfBusinessId;
17394
+ let lineOfBusinessSource;
17395
+ let lineOfBusinessContractId;
17394
17396
  return {
17395
- plan: () => ({ resourceIds, recordFks, labelFields, ...lineOfBusinessId !== void 0 ? { lineOfBusinessId } : {} }),
17397
+ plan: () => ({
17398
+ resourceIds,
17399
+ recordFks,
17400
+ labelFields,
17401
+ ...lineOfBusinessId !== void 0 ? { lineOfBusinessId } : {},
17402
+ ...lineOfBusinessSource !== void 0 ? { lineOfBusinessSource } : {},
17403
+ ...lineOfBusinessContractId !== void 0 ? { lineOfBusinessContractId } : {}
17404
+ }),
17396
17405
  addResource: (value) => {
17397
17406
  if (!isVendorId(value)) return;
17398
17407
  const k = String(value);
@@ -17409,9 +17418,17 @@ function createNamePlan(labelFields = []) {
17409
17418
  recordFks.push({ table, id: value });
17410
17419
  }
17411
17420
  },
17412
- addLineOfBusiness: (value) => {
17421
+ addLineOfBusinessFromContract: (value) => {
17422
+ if (!isVendorId(value)) return;
17423
+ lineOfBusinessContractId = value;
17424
+ },
17425
+ addLineOfBusiness: (value, origin) => {
17413
17426
  if (!isVendorId(value)) return;
17414
17427
  lineOfBusinessId = value;
17428
+ if (origin !== void 0) {
17429
+ lineOfBusinessSource = origin.source;
17430
+ if (origin.contractId !== void 0) lineOfBusinessContractId = origin.contractId;
17431
+ }
17415
17432
  }
17416
17433
  };
17417
17434
  }
@@ -17532,6 +17549,8 @@ async function resolveCompositeNames(http, plan, opts = {}) {
17532
17549
  const nameCache = http.resourceNameCache;
17533
17550
  const section = { truncated: false, rows: {}, reasons: {} };
17534
17551
  let remaining = budget;
17552
+ let contractLobPointer;
17553
+ let contractLobUnread;
17535
17554
  const coldResource = [];
17536
17555
  for (const id of plan.resourceIds) {
17537
17556
  if (nameCache !== void 0 && nameCache.get(id) !== void 0) continue;
@@ -17575,18 +17594,27 @@ async function resolveCompositeNames(http, plan, opts = {}) {
17575
17594
  if (remaining < 1) {
17576
17595
  section.rows[key] = { name: null, blind: false, capped: true };
17577
17596
  section.truncated = true;
17597
+ if (fk.table === "contract" && plan.lineOfBusinessContractId !== void 0 && String(fk.id) === String(plan.lineOfBusinessContractId)) {
17598
+ contractLobUnread = "capped";
17599
+ }
17578
17600
  continue;
17579
17601
  }
17580
17602
  remaining -= 1;
17581
17603
  }
17582
17604
  try {
17583
17605
  const record = await holders[fk.table].get(fk.id);
17606
+ if (fk.table === "contract" && plan.lineOfBusinessId === void 0 && plan.lineOfBusinessContractId !== void 0 && String(fk.id) === String(plan.lineOfBusinessContractId)) {
17607
+ contractLobPointer = vendorId(record["organizationalLevelAssociationID"]);
17608
+ }
17584
17609
  section.rows[key] = { name: fkName(record, fk.table), blind: false, capped: false };
17585
17610
  } catch (err) {
17586
17611
  if (err instanceof NotFoundError) {
17587
17612
  section.rows[key] = { name: null, blind: true, capped: false };
17588
17613
  } else if (isAutotaskError(err) && err.code !== "ABORTED") {
17589
17614
  section.rows[key] = { name: null, blind: false, capped: false, error: faultRow(err) };
17615
+ if (fk.table === "contract" && plan.lineOfBusinessContractId !== void 0 && String(fk.id) === String(plan.lineOfBusinessContractId)) {
17616
+ contractLobUnread = "unresolved";
17617
+ }
17590
17618
  } else {
17591
17619
  throw err;
17592
17620
  }
@@ -17613,11 +17641,26 @@ async function resolveCompositeNames(http, plan, opts = {}) {
17613
17641
  if (!usable) for (const f of plan.labelFields) section.reasons[f] = FIELD_CATALOG_HONESTY_NOTE;
17614
17642
  }
17615
17643
  let lineOfBusiness = null;
17616
- if (plan.lineOfBusinessId !== void 0) {
17617
- const chain = await resolveLineOfBusinessChain(http, plan.lineOfBusinessId, { budget: remaining, onError: "degrade" });
17644
+ const lobId = plan.lineOfBusinessId ?? contractLobPointer;
17645
+ if (lobId !== void 0) {
17646
+ const chain = await resolveLineOfBusinessChain(http, lobId, { budget: remaining, onError: "degrade" });
17618
17647
  remaining -= chain.used;
17619
17648
  if (chain.truncated) section.truncated = true;
17620
- lineOfBusiness = chain.lineOfBusiness;
17649
+ const fromContract = plan.lineOfBusinessId === void 0;
17650
+ lineOfBusiness = {
17651
+ ...chain.lineOfBusiness,
17652
+ ...fromContract ? { source: "contract", contractId: plan.lineOfBusinessContractId } : plan.lineOfBusinessSource !== void 0 ? { source: plan.lineOfBusinessSource } : {},
17653
+ ...!fromContract && plan.lineOfBusinessContractId !== void 0 ? { contractId: plan.lineOfBusinessContractId } : {}
17654
+ };
17655
+ } else if (contractLobUnread !== void 0 && plan.lineOfBusinessContractId !== void 0) {
17656
+ lineOfBusiness = {
17657
+ source: "contract",
17658
+ contractId: plan.lineOfBusinessContractId,
17659
+ association: null,
17660
+ organizationalLevel2: null,
17661
+ organizationalLevel1: null,
17662
+ markers: { association: contractLobUnread, organizationalLevel2: "missing", organizationalLevel1: "missing" }
17663
+ };
17621
17664
  }
17622
17665
  return {
17623
17666
  section,