node-autotask 0.59.0 → 0.60.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/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.60.1] - 2026-11-09
11
+
12
+ ### Changed
13
+
14
+ - Dev-only dependency refresh: `vitest` and `@vitest/coverage-v8` 5.1.0, `vite` 8.3.6, `rimraf` 6.1.4. The
15
+ package has no runtime dependencies, so consumers install nothing new; the capability plan is unchanged.
16
+ TypeScript 7 is deferred until `typescript-eslint` supports it (its peer range stops below 6.1).
17
+
18
+ ## [0.60.0] - 2026-11-08
19
+
20
+ ### Fixed
21
+
22
+ - `time_entries.updateReviewFields` now uses collection PATCH, including its dry-run request description,
23
+ preserving omitted fields per vendor semantics. The partial PUT introduced in0.59.0 failed the controlled
24
+ sandbox spike because mandatory protected fields were omitted (#425). Do not use0.59.0's restricted helper
25
+ for review writes. No protected fields were resent as a workaround; generic updates keep their existing
26
+ PUT/full-model merge. PATCH never falls back to PUT, even with `putFallback` enabled.
27
+ - Consumer note for `iit-mcp-autotask`: re-pin the SDK and changed plan hash together before retrying the
28
+ controlled omission/protected-field readback tests. No live PATCH success or production authorization is claimed.
29
+
10
30
  ## [0.59.0] - 2026-11-08
11
31
 
12
32
  ### Added
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "generatedBy": "scripts/build-tool-catalog.mjs",
3
- "generatedAt": "2026-11-08T03:11:46.676Z",
4
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
3
+ "generatedAt": "2026-11-08T03:47:47.958Z",
4
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
5
5
  "metaTools": [
6
6
  {
7
7
  "name": "autotask_catalog",
package/capabilities.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "generatedAt": "2026-11-08T03:11:45.586Z",
2
+ "generatedAt": "2026-11-08T03:49:04.964Z",
3
3
  "groups": {
4
4
  "B": {
5
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
6
- "builtAt": "2026-11-08T03:11:45.571Z",
5
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
6
+ "builtAt": "2026-11-08T03:49:04.955Z",
7
7
  "records": [
8
8
  {
9
9
  "id": "appointments.count",
@@ -40275,7 +40275,7 @@
40275
40275
  "udfCapable": true,
40276
40276
  "operation": "updateReviewFields",
40277
40277
  "kind": "helper",
40278
- "endpoint": "PUT|PATCH /V1.0/TimeEntries",
40278
+ "endpoint": "PATCH /V1.0/TimeEntries",
40279
40279
  "effect": "write",
40280
40280
  "flags": [
40281
40281
  "idempotent"
@@ -40308,14 +40308,14 @@
40308
40308
  },
40309
40309
  "resolution": null,
40310
40310
  "retry": {
40311
- "preset": "retry-1849870d"
40311
+ "preset": "retry-c5657094"
40312
40312
  },
40313
40313
  "errors": {
40314
40314
  "set": 1
40315
40315
  },
40316
40316
  "metadata": {
40317
40317
  "purpose": "Update only time-entry review notes, billing code or contract without sending protected fields.",
40318
- "usage": "args[0] id; args[1] non-empty data with only summaryNotes/internalNotes strings (up to 32000 characters) and positive integer billingCodeID/contractID. Unknown fields and null references are refused before requests. The collection PUT contains only id and supplied fields. Dry-run-first via invoke; lastModifiedDate compares a fresh lastModifiedDateTime, refusing unavailable stamps. Optional verifyPersisted reads requested fields back. This is a transport restriction, not financial authorization: the host must validate ownership, unposted state, active compatible references and all protected-field readback. Vendor omission semantics and the remaining external write race must be verified before use.",
40318
+ "usage": "args[0] id; args[1] non-empty data with only summaryNotes/internalNotes strings (up to 32000 characters) and positive integer billingCodeID/contractID. Unknown fields and null references are refused before requests. The collection PATCH contains only id and supplied fields. Dry-run-first via invoke; lastModifiedDate compares a fresh lastModifiedDateTime, refusing unavailable stamps. Optional verifyPersisted reads requested fields back. This is a transport restriction, not financial authorization: the host must validate ownership, unposted state, active compatible references and all protected-field readback. Vendor PATCH documentation preserves omitted fields; tenant omission semantics and the remaining external write race must still be verified before use. No fallback to PUT.",
40319
40319
  "preferredWhen": "A financial review workflow requires an exact partial payload and cannot resend unchanged protected fields.",
40320
40320
  "related": [
40321
40321
  "time_entries.update",
@@ -41691,8 +41691,8 @@
41691
41691
  ]
41692
41692
  },
41693
41693
  "A": {
41694
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
41695
- "builtAt": "2026-11-08T03:11:45.572Z",
41694
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
41695
+ "builtAt": "2026-11-08T03:49:04.955Z",
41696
41696
  "records": [
41697
41697
  {
41698
41698
  "id": "companies.count",
@@ -81100,8 +81100,8 @@
81100
81100
  ]
81101
81101
  },
81102
81102
  "operations": {
81103
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
81104
- "builtAt": "2026-11-08T03:11:45.572Z",
81103
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
81104
+ "builtAt": "2026-11-08T03:49:04.955Z",
81105
81105
  "records": [
81106
81106
  {
81107
81107
  "id": "operations.aggregate",
@@ -348,8 +348,8 @@ const CAPABILITY_DATA = {
348
348
  ],
349
349
  "groups": {
350
350
  "B": {
351
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
352
- "builtAt": "2026-11-08T03:11:45.571Z",
351
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
352
+ "builtAt": "2026-11-08T03:49:04.955Z",
353
353
  "records": [
354
354
  {
355
355
  "id": "appointments.count",
@@ -40621,7 +40621,7 @@ const CAPABILITY_DATA = {
40621
40621
  "udfCapable": true,
40622
40622
  "operation": "updateReviewFields",
40623
40623
  "kind": "helper",
40624
- "endpoint": "PUT|PATCH /V1.0/TimeEntries",
40624
+ "endpoint": "PATCH /V1.0/TimeEntries",
40625
40625
  "effect": "write",
40626
40626
  "flags": [
40627
40627
  "idempotent"
@@ -40654,14 +40654,14 @@ const CAPABILITY_DATA = {
40654
40654
  },
40655
40655
  "resolution": null,
40656
40656
  "retry": {
40657
- "preset": "retry-1849870d"
40657
+ "preset": "retry-c5657094"
40658
40658
  },
40659
40659
  "errors": {
40660
40660
  "set": 1
40661
40661
  },
40662
40662
  "metadata": {
40663
40663
  "purpose": "Update only time-entry review notes, billing code or contract without sending protected fields.",
40664
- "usage": "args[0] id; args[1] non-empty data with only summaryNotes/internalNotes strings (up to 32000 characters) and positive integer billingCodeID/contractID. Unknown fields and null references are refused before requests. The collection PUT contains only id and supplied fields. Dry-run-first via invoke; lastModifiedDate compares a fresh lastModifiedDateTime, refusing unavailable stamps. Optional verifyPersisted reads requested fields back. This is a transport restriction, not financial authorization: the host must validate ownership, unposted state, active compatible references and all protected-field readback. Vendor omission semantics and the remaining external write race must be verified before use.",
40664
+ "usage": "args[0] id; args[1] non-empty data with only summaryNotes/internalNotes strings (up to 32000 characters) and positive integer billingCodeID/contractID. Unknown fields and null references are refused before requests. The collection PATCH contains only id and supplied fields. Dry-run-first via invoke; lastModifiedDate compares a fresh lastModifiedDateTime, refusing unavailable stamps. Optional verifyPersisted reads requested fields back. This is a transport restriction, not financial authorization: the host must validate ownership, unposted state, active compatible references and all protected-field readback. Vendor PATCH documentation preserves omitted fields; tenant omission semantics and the remaining external write race must still be verified before use. No fallback to PUT.",
40665
40665
  "preferredWhen": "A financial review workflow requires an exact partial payload and cannot resend unchanged protected fields.",
40666
40666
  "related": [
40667
40667
  "time_entries.update",
@@ -42037,8 +42037,8 @@ const CAPABILITY_DATA = {
42037
42037
  ]
42038
42038
  },
42039
42039
  "A": {
42040
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
42041
- "builtAt": "2026-11-08T03:11:45.572Z",
42040
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
42041
+ "builtAt": "2026-11-08T03:49:04.955Z",
42042
42042
  "records": [
42043
42043
  {
42044
42044
  "id": "companies.count",
@@ -81446,8 +81446,8 @@ const CAPABILITY_DATA = {
81446
81446
  ]
81447
81447
  },
81448
81448
  "operations": {
81449
- "planHash": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
81450
- "builtAt": "2026-11-08T03:11:45.572Z",
81449
+ "planHash": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
81450
+ "builtAt": "2026-11-08T03:49:04.955Z",
81451
81451
  "records": [
81452
81452
  {
81453
81453
  "id": "operations.aggregate",
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkUULSHBXX_cjs = require('./chunk-UULSHBXX.cjs');
3
+ var chunkXP43NERF_cjs = require('./chunk-XP43NERF.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "CAPABILITY_PLAN_HASHES", {
8
8
  enumerable: true,
9
- get: function () { return chunkUULSHBXX_cjs.CAPABILITY_PLAN_HASHES; }
9
+ get: function () { return chunkXP43NERF_cjs.CAPABILITY_PLAN_HASHES; }
10
10
  });
11
11
  Object.defineProperty(exports, "loadCapabilities", {
12
12
  enumerable: true,
13
- get: function () { return chunkUULSHBXX_cjs.loadCapabilities; }
13
+ get: function () { return chunkXP43NERF_cjs.loadCapabilities; }
14
14
  });
15
15
  Object.defineProperty(exports, "loadCapabilityRecords", {
16
16
  enumerable: true,
17
- get: function () { return chunkUULSHBXX_cjs.loadCapabilityRecords; }
17
+ get: function () { return chunkXP43NERF_cjs.loadCapabilityRecords; }
18
18
  });
@@ -1 +1 @@
1
- export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-U4XISLR7.js';
1
+ export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-K722F7EM.js';
@@ -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-FLNQLJ6D.js';
2
- import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, AutotaskConfigError } from './chunk-WZBIGZMT.js';
1
+ import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-XUPVX5MQ.js';
2
+ import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, AutotaskConfigError } from './chunk-Y2SR6D2D.js';
3
3
 
4
4
  // src/client.ts
5
5
  var AutotaskClient = class {
@@ -1,8 +1,8 @@
1
1
  // src/capabilities.ts
2
2
  var CAPABILITY_PLAN_HASHES = {
3
- "B": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
4
- "A": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2",
5
- "operations": "144fc9158531bbe8478a9c86a7127cbf14a0cd5fa043b6a69f453841813a15c2"
3
+ "B": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
4
+ "A": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8",
5
+ "operations": "95323eaa92fca1ba1541721c6f34ce671118736aca889ea432156d87a8a8ecd8"
6
6
  };
7
7
  var cached = null;
8
8
  function loadCapabilities() {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUULSHBXX_cjs = require('./chunk-UULSHBXX.cjs');
3
+ var chunkXP43NERF_cjs = require('./chunk-XP43NERF.cjs');
4
4
  var chunkBD4AUGCJ_cjs = require('./chunk-BD4AUGCJ.cjs');
5
5
  var crypto = require('crypto');
6
6
  var async_hooks = require('async_hooks');
@@ -1422,7 +1422,7 @@ async function capabilitySets() {
1422
1422
  const fieldOps = /* @__PURE__ */ new Map();
1423
1423
  const udfCapable = /* @__PURE__ */ new Set();
1424
1424
  const resources = /* @__PURE__ */ new Set();
1425
- for (const rec of await chunkUULSHBXX_cjs.loadCapabilityRecords()) {
1425
+ for (const rec of await chunkXP43NERF_cjs.loadCapabilityRecords()) {
1426
1426
  if (rec.resource === "operations") continue;
1427
1427
  resources.add(rec.resource);
1428
1428
  if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
@@ -1433,7 +1433,7 @@ async function capabilitySets() {
1433
1433
  var derivedIndexPromise = null;
1434
1434
  function derivedIndexLoad() {
1435
1435
  if (derivedIndexPromise === null) {
1436
- derivedIndexPromise = chunkUULSHBXX_cjs.loadCapabilityRecords().then((records) => {
1436
+ derivedIndexPromise = chunkXP43NERF_cjs.loadCapabilityRecords().then((records) => {
1437
1437
  const index = /* @__PURE__ */ new Map();
1438
1438
  for (const rec of records) {
1439
1439
  const declared = rec.metadata?.derivedFields;
@@ -17536,7 +17536,7 @@ var MutationBase = class extends MetaBase {
17536
17536
  return { ...result, persistedCheckFailed: err instanceof AutotaskError ? err.code : `UNKNOWN (${err instanceof Error ? err.name : typeof err})` };
17537
17537
  }
17538
17538
  }
17539
- async updateGlobal(id, data, opts = {}) {
17539
+ async updateGlobal(id, data, opts = {}, method = "PUT") {
17540
17540
  const numeric = parseIdentifier(id, "id");
17541
17541
  const operation = `${this.config.key}.update`;
17542
17542
  let body = this.normalizeMutationBody(data);
@@ -17557,18 +17557,18 @@ var MutationBase = class extends MetaBase {
17557
17557
  }
17558
17558
  body.id = numeric;
17559
17559
  }
17560
- const route = collectionUpdate ? `PUT ${this.resourcePath}` : `PUT ${this.resourcePath}/${numeric}`;
17560
+ const route = `${method} ${collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric}`}`;
17561
17561
  let res;
17562
17562
  try {
17563
17563
  res = await this.http.request({
17564
- method: "PUT",
17564
+ method,
17565
17565
  path: collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric}`,
17566
17566
  body,
17567
17567
  operation,
17568
17568
  maxRetries: opts.maxRetries
17569
17569
  });
17570
17570
  } catch (err) {
17571
- if (!this.putFallbackEligible(err)) throw err;
17571
+ if (method === "PATCH" || !this.putFallbackEligible(err)) throw err;
17572
17572
  if (collectionUpdate) {
17573
17573
  throw this.putFallbackDeclined(err, route, false);
17574
17574
  }
@@ -21353,7 +21353,7 @@ function dateBucketLabel(value, bucket) {
21353
21353
  var queryResourceKeysPromise = null;
21354
21354
  function queryResourceKeys() {
21355
21355
  if (queryResourceKeysPromise === null) {
21356
- queryResourceKeysPromise = chunkUULSHBXX_cjs.loadCapabilityRecords().then((records) => {
21356
+ queryResourceKeysPromise = chunkXP43NERF_cjs.loadCapabilityRecords().then((records) => {
21357
21357
  const s = /* @__PURE__ */ new Set();
21358
21358
  for (const rec of records) if (rec.operation === "query") s.add(rec.resource);
21359
21359
  return s;
@@ -21475,7 +21475,7 @@ function parseTopAndLimit(opts, problems) {
21475
21475
  return { top, limit };
21476
21476
  }
21477
21477
  async function checkFieldNames(resourceKey, conditions, opts, problems) {
21478
- const records = resourceKey === void 0 ? [] : await chunkUULSHBXX_cjs.loadCapabilityRecords();
21478
+ const records = resourceKey === void 0 ? [] : await chunkXP43NERF_cjs.loadCapabilityRecords();
21479
21479
  const record = resourceKey === void 0 ? void 0 : records.find((r) => r.resource === resourceKey && r.operation === "query");
21480
21480
  if (record === void 0) return void 0;
21481
21481
  const strings = (v) => Array.isArray(v) ? v.filter((f) => typeof f === "string" && f.trim() !== "") : [];
@@ -22115,7 +22115,7 @@ async function uiLink(client, input) {
22115
22115
  var indexPromise = null;
22116
22116
  function operationIndex() {
22117
22117
  if (indexPromise === null) {
22118
- indexPromise = chunkUULSHBXX_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
22118
+ indexPromise = chunkXP43NERF_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
22119
22119
  }
22120
22120
  return indexPromise;
22121
22121
  }
@@ -25550,7 +25550,7 @@ function clampWindowLimit(limit, OP14) {
25550
25550
  // src/resources/special/time_entries/review.ts
25551
25551
  var OP9 = "time_entries.updateReviewFields";
25552
25552
  var FIELDS = /* @__PURE__ */ new Set(["summaryNotes", "internalNotes", "billingCodeID", "contractID"]);
25553
- async function updateReviewFields(resource, id, data, opts = {}) {
25553
+ async function updateReviewFields(resource, id, data, send, opts = {}) {
25554
25554
  const invalid = () => new AutotaskConfigError(
25555
25555
  `${OP9}: supply a non-empty object of summaryNotes/internalNotes strings (up to 32000 characters) and positive integer billingCodeID/contractID references only`,
25556
25556
  { operation: OP9 }
@@ -25576,7 +25576,7 @@ async function updateReviewFields(resource, id, data, opts = {}) {
25576
25576
  throw new StaleObjectError(`${OP9}: the time entry has changed or its modification time is unavailable`, { operation: OP9 });
25577
25577
  }
25578
25578
  }
25579
- const result = await resource.update(id, payload, { ...opts, raw: true });
25579
+ const result = await send(payload);
25580
25580
  return "simulated" in result ? { ...result, operation: OP9 } : result;
25581
25581
  }
25582
25582
 
@@ -25592,9 +25592,16 @@ var TimeEntriesResource = class extends GenericResource {
25592
25592
  // D1: the spec's item path is GET-only — confirmed updates PUT the collection (id in the body)
25593
25593
  }, pageSize);
25594
25594
  }
25595
- /** Only four review fields; the collection PUT never merges the current entry. */
25595
+ /** Only four review fields; collection PATCH preserves every omitted field. */
25596
25596
  async updateReviewFields(id, data, opts = {}) {
25597
- return updateReviewFields(this, id, data, opts);
25597
+ return updateReviewFields(this, id, data, async (payload) => {
25598
+ const numeric = parseIdentifier(id, "id");
25599
+ if (opts.dryRun === true) {
25600
+ const preview2 = await this.runUpdateDryRun(numeric, payload, { ...opts, raw: true });
25601
+ return { ...preview2, request: { ...preview2.request, method: "PATCH" } };
25602
+ }
25603
+ return this.updateGlobal(numeric, payload, { ...opts, raw: true }, "PATCH");
25604
+ }, opts);
25598
25605
  }
25599
25606
  dateWorkedWindow(from, to, opts) {
25600
25607
  return dateWorkedWindow(this, from, to, opts);