node-autotask 0.83.0 → 0.85.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 +17 -0
  2. package/MCP_TOOL_CATALOG.json +323 -11
  3. package/README.md +1 -1
  4. package/capabilities.json +1739 -361
  5. package/dist/capabilities-data.js +2463 -1085
  6. package/dist/capabilities.cjs +4 -4
  7. package/dist/capabilities.js +1 -1
  8. package/dist/{chunk-C2AFRW5M.cjs → chunk-7GNZT7Y7.cjs} +375 -93
  9. package/dist/{chunk-ZKAJVHHZ.js → chunk-EPJG7M5C.js} +42 -7
  10. package/dist/{chunk-DBEAS3IR.js → chunk-GTTAPAGP.js} +3 -3
  11. package/dist/{chunk-HQJLIRXW.js → chunk-HF5YG4TV.js} +5 -2
  12. package/dist/{chunk-QCA5R7QF.cjs → chunk-JCKYM7FD.cjs} +3 -3
  13. package/dist/{chunk-QEMBBAF5.cjs → chunk-JV6MX2U3.cjs} +237 -202
  14. package/dist/{chunk-CV56RIGS.js → chunk-L6YCH2I4.js} +370 -88
  15. package/dist/{chunk-5AHEJCSP.cjs → chunk-PBOH2OHJ.cjs} +33 -30
  16. package/dist/{index-8Hg6dytT.d.cts → index-CCW_EpLg.d.cts} +203 -140
  17. package/dist/{index-8Hg6dytT.d.ts → index-CCW_EpLg.d.ts} +203 -140
  18. package/dist/{index-DxESlIIg.d.cts → index-DkyNXWyt.d.cts} +108 -86
  19. package/dist/{index-nXhYAQOf.d.ts → index-rWcPjRpX.d.ts} +108 -86
  20. package/dist/index.cjs +84 -84
  21. package/dist/index.d.cts +6 -5
  22. package/dist/index.d.ts +6 -5
  23. package/dist/index.js +5 -5
  24. package/dist/operations/index.cjs +51 -51
  25. package/dist/operations/index.d.cts +4 -4
  26. package/dist/operations/index.d.ts +4 -4
  27. package/dist/operations/index.js +2 -2
  28. package/dist/pool.cjs +12 -12
  29. package/dist/pool.d.cts +1 -1
  30. package/dist/pool.d.ts +1 -1
  31. package/dist/pool.js +4 -4
  32. package/dist/resources/index.cjs +27 -27
  33. package/dist/resources/index.d.cts +2 -2
  34. package/dist/resources/index.d.ts +2 -2
  35. package/dist/resources/index.js +3 -3
  36. package/dist/types/index.d.cts +1 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/docs/API.md +32 -20
  39. package/docs/RELEASING.md +2 -1
  40. package/docs/VENDOR-QUIRKS.md +3 -1
  41. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { GenericResource, readTasks, OperationNotSupportedError, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-CV56RIGS.js';
2
- import { loadCapabilityRecords } from './chunk-DBEAS3IR.js';
1
+ import { GenericResource, readTasks, OperationNotSupportedError, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-L6YCH2I4.js';
2
+ import { loadCapabilityRecords } from './chunk-GTTAPAGP.js';
3
3
 
4
4
  // src/resources/special/configuration_items.ts
5
5
  async function fetchRecord(http, path, label, readOpts) {
@@ -80,6 +80,11 @@ async function moveConfigurationItem(_resource, sourceId, opts) {
80
80
  return { sourceId: numericSource, newId, destinationCompanyId: destId, sourceDeactivated };
81
81
  }
82
82
  var PROFILE_PART_LIMIT = 50;
83
+ var CI_NAME_FKS = [
84
+ ["contractID", "contract"],
85
+ ["companyID", "company"],
86
+ ["vendorID", "company"]
87
+ ];
83
88
  function profilePartLimit(value, name) {
84
89
  const n = value === void 0 ? PROFILE_PART_LIMIT : Math.trunc(value);
85
90
  if (!Number.isInteger(n) || n < 1) {
@@ -106,6 +111,14 @@ async function contextFetchPart(http, entityPath, referenceId, entity) {
106
111
  throw err;
107
112
  }
108
113
  }
114
+ async function degradable(read) {
115
+ try {
116
+ return { value: await read() };
117
+ } catch (err) {
118
+ if (isAutotaskError(err) && err.code !== "ABORTED") return { fault: err.code };
119
+ throw err;
120
+ }
121
+ }
109
122
  async function ciScopedQuery(http, path, itemID, limit) {
110
123
  const res = await http.request({
111
124
  method: "POST",
@@ -120,15 +133,24 @@ async function profile(resource, id, opts = {}) {
120
133
  const http = resource.http;
121
134
  const noteLimit = profilePartLimit(opts.noteLimit, "noteLimit");
122
135
  const relatedLimit = profilePartLimit(opts.relatedLimit, "relatedLimit");
136
+ const subscriptionLimit = profilePartLimit(opts.subscriptionLimit, "subscriptionLimit");
123
137
  const ci = await resource.get(id);
124
138
  const root = ci;
125
- const [type, category, notes, relatedItems, associations] = await readTasks(http, [
139
+ const productRef = root["productID"] === 0 ? null : root["productID"];
140
+ const [type, category, productRead, notes, relatedItems, associations, subscriptionsRead] = await readTasks(http, [
126
141
  () => contextFetchPart(http, "/V1.0/ConfigurationItemTypes", root["configurationItemType"], "configuration_item_type"),
127
142
  () => contextFetchPart(http, "/V1.0/ConfigurationItemCategories", root["configurationItemCategoryID"], "configuration_item_category"),
143
+ () => degradable(() => contextFetchPart(http, "/V1.0/Products", productRef, "product")),
128
144
  () => ciScopedQuery(http, "/V1.0/ConfigurationItemNotes/query", id, noteLimit),
129
145
  () => ciScopedQuery(http, "/V1.0/ConfigurationItemRelatedItems/query", id, relatedLimit),
130
- () => ciScopedQuery(http, "/V1.0/ConfigurationItemBillingProductAssociations/query", id, PROFILE_PART_LIMIT)
146
+ () => ciScopedQuery(http, "/V1.0/ConfigurationItemBillingProductAssociations/query", id, PROFILE_PART_LIMIT),
147
+ () => degradable(() => ciScopedQuery(http, "/V1.0/Subscriptions/query", id, subscriptionLimit))
131
148
  ]);
149
+ const product = "value" in productRead ? productRead.value : null;
150
+ const subscriptions = "value" in subscriptionsRead ? subscriptionsRead.value : [];
151
+ const unavailable = {};
152
+ if ("fault" in productRead) unavailable.product = productRead.fault;
153
+ if ("fault" in subscriptionsRead) unavailable.subscriptions = subscriptionsRead.fault;
132
154
  const productAssociations = {
133
155
  items: associations,
134
156
  capped: associations.length >= PROFILE_PART_LIMIT,
@@ -138,24 +160,37 @@ async function profile(resource, id, opts = {}) {
138
160
  ci,
139
161
  type,
140
162
  category,
163
+ product,
141
164
  notes: { items: notes, capped: notes.length >= noteLimit },
142
165
  relatedItems: { items: relatedItems, capped: relatedItems.length >= relatedLimit },
143
166
  productAssociations,
167
+ subscriptions: { items: subscriptions, capped: subscriptions.length >= subscriptionLimit },
144
168
  parts: {
145
169
  ci: "ok",
146
170
  type: type !== null ? "ok" : "absent",
147
171
  category: category !== null ? "ok" : "absent",
172
+ product: unavailable.product !== void 0 ? "unavailable" : product !== null ? "ok" : "absent",
148
173
  notes: "ok",
149
174
  relatedItems: "ok",
150
- productAssociations: "ok"
175
+ productAssociations: "ok",
176
+ subscriptions: unavailable.subscriptions !== void 0 ? "unavailable" : "ok"
151
177
  }
152
178
  };
179
+ if (Object.keys(unavailable).length > 0) result.unavailable = unavailable;
153
180
  if (opts.names === true) {
154
181
  const builder = createNamePlan();
155
- builder.addFk("contract", root["contractID"]);
182
+ for (const [field, table] of CI_NAME_FKS) builder.addFk(table, root[field]);
156
183
  const names = await resolveCompositeNames(http, builder.plan(), { maxNameReads: opts.maxNameReads });
157
184
  const ciRow = { ...ci };
158
- addNameSibling(ciRow, "contractID", (v) => names.recordName("contract", v));
185
+ for (const [field, table] of CI_NAME_FKS) addNameSibling(ciRow, field, (v) => names.recordName(table, v));
186
+ if (root["productID"] !== void 0) {
187
+ const raw = product?.["name"];
188
+ const name = typeof raw === "string" && raw.trim() !== "" ? raw : null;
189
+ ciRow["productIDName"] = name;
190
+ if (typeof productRef === "number") {
191
+ names.section.rows[`product:${productRef}`] = "fault" in productRead ? { name: null, blind: false, error: { code: productRead.fault, message: "the product part read faulted" } } : { name, blind: product === null };
192
+ }
193
+ }
159
194
  result.ci = ciRow;
160
195
  result.names = names.section;
161
196
  }
@@ -1,8 +1,8 @@
1
1
  // src/capabilities.ts
2
2
  var CAPABILITY_PLAN_HASHES = {
3
- "B": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede",
4
- "A": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede",
5
- "operations": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede"
3
+ "B": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735",
4
+ "A": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735",
5
+ "operations": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735"
6
6
  };
7
7
  var cached = null;
8
8
  function loadCapabilities() {
@@ -1,5 +1,5 @@
1
- import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-ZKAJVHHZ.js';
2
- import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-CV56RIGS.js';
1
+ import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-EPJG7M5C.js';
2
+ import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-L6YCH2I4.js';
3
3
 
4
4
  // src/client.ts
5
5
  var AutotaskClient = class {
@@ -67,6 +67,9 @@ var AutotaskClient = class {
67
67
  contractTicketPurchases;
68
68
  countries;
69
69
  currencies;
70
+ deletedTaskActivityLogs;
71
+ deletedTicketActivityLogs;
72
+ deletedTicketLogs;
70
73
  departments;
71
74
  domainRegistrars;
72
75
  entityInformation;
@@ -2,9 +2,9 @@
2
2
 
3
3
  // src/capabilities.ts
4
4
  var CAPABILITY_PLAN_HASHES = {
5
- "B": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede",
6
- "A": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede",
7
- "operations": "d758816a699191e3da784f70f8ebe1f37ea9458aaf528241770f7bac94ba6ede"
5
+ "B": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735",
6
+ "A": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735",
7
+ "operations": "9521525945b1306da363ce5fb38649e17c5526f2c0842da64c3bec7993e62735"
8
8
  };
9
9
  var cached = null;
10
10
  function loadCapabilities() {