node-autotask 0.13.0 → 0.15.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 (44) hide show
  1. package/ARCHITECTURE.md +43 -7
  2. package/MCP_TOOL_CATALOG.json +1 -1
  3. package/MCP_TOOL_MANIFEST.md +2 -2
  4. package/N8N_MCP_MANIFEST.json +2 -2
  5. package/N8N_MCP_MANIFEST.md +3 -3
  6. package/README.md +9 -8
  7. package/capabilities.json +2132 -2740
  8. package/dist/capabilities.cjs +2 -2
  9. package/dist/capabilities.d.cts +9 -4
  10. package/dist/capabilities.d.ts +9 -4
  11. package/dist/capabilities.js +1 -1
  12. package/dist/{chunk-Y6O5VVQ4.js → chunk-AXVYQPTB.js} +136 -126
  13. package/dist/{chunk-IKJLIDK3.js → chunk-CSA6QSV6.js} +37 -25
  14. package/dist/{chunk-CXXNONRP.cjs → chunk-EWMG3HHU.cjs} +2131 -2739
  15. package/dist/{chunk-OZD5FQM4.js → chunk-JIDR3NPV.js} +2131 -2739
  16. package/dist/{chunk-DDZXN6LN.js → chunk-LH5BXQ7A.js} +2 -2
  17. package/dist/{chunk-CJA6L6NR.cjs → chunk-V7QPZA7L.cjs} +135 -135
  18. package/dist/{chunk-MTDCLVQQ.cjs → chunk-VLIUHEPE.cjs} +558 -548
  19. package/dist/{chunk-KB2ANVVR.cjs → chunk-Z7YT72SS.cjs} +42 -30
  20. package/dist/{index-DbMKWnEX.d.cts → index-BXIwhAN4.d.cts} +67 -13
  21. package/dist/{index-TuqNq3Ro.d.ts → index-M0qJIiRt.d.ts} +67 -13
  22. package/dist/index.cjs +61 -19
  23. package/dist/index.d.cts +83 -3
  24. package/dist/index.d.ts +83 -3
  25. package/dist/index.js +46 -4
  26. package/dist/operations/index.cjs +110 -107
  27. package/dist/operations/index.d.cts +9 -2
  28. package/dist/operations/index.d.ts +9 -2
  29. package/dist/operations/index.js +9 -6
  30. package/dist/pool.cjs +8 -8
  31. package/dist/pool.d.cts +1 -1
  32. package/dist/pool.d.ts +1 -1
  33. package/dist/pool.js +4 -4
  34. package/dist/resources/index.cjs +4 -4
  35. package/dist/resources/index.d.cts +1 -1
  36. package/dist/resources/index.d.ts +1 -1
  37. package/dist/resources/index.js +3 -3
  38. package/dist/untrusted.cjs +3 -1
  39. package/dist/untrusted.d.cts +9 -4
  40. package/dist/untrusted.d.ts +9 -4
  41. package/dist/untrusted.js +3 -1
  42. package/docs/API.md +112 -22
  43. package/docs/LIVE-TESTING.md +1 -1
  44. package/package.json +2 -2
@@ -33,10 +33,10 @@ import {
33
33
  unwrapItem,
34
34
  unwrapItems,
35
35
  unwrapOperation
36
- } from "./chunk-IKJLIDK3.js";
36
+ } from "./chunk-CSA6QSV6.js";
37
37
  import {
38
38
  CAPABILITIES
39
- } from "./chunk-OZD5FQM4.js";
39
+ } from "./chunk-JIDR3NPV.js";
40
40
 
41
41
  // src/resources/appointments.ts
42
42
  var AppointmentsResource = class extends BaseResource {
@@ -92,7 +92,7 @@ var AppointmentsResource = class extends BaseResource {
92
92
  async delete(id, opts = {}) {
93
93
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
94
94
  await this.guardStaleBeforeMutation(id, opts, "appointments.delete");
95
- return this.deleteGlobal(id);
95
+ return this.deleteGlobal(id, opts);
96
96
  }
97
97
  /** Resolve a Appointment from a numeric id (or, where the vendor indexes a primary text field,
98
98
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -626,7 +626,7 @@ var ChangeRequestLinksResource = class extends BaseResource {
626
626
  async delete(id, opts = {}) {
627
627
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
628
628
  await this.guardStaleBeforeMutation(id, opts, "change_request_links.delete");
629
- return this.deleteGlobal(id);
629
+ return this.deleteGlobal(id, opts);
630
630
  }
631
631
  /** Resolve a ChangeRequestLink from a numeric id (or, where the vendor indexes a primary text field,
632
632
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -696,7 +696,7 @@ var ChecklistLibrariesResource = class extends BaseResource {
696
696
  async delete(id, opts = {}) {
697
697
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
698
698
  await this.guardStaleBeforeMutation(id, opts, "checklist_libraries.delete");
699
- return this.deleteGlobal(id);
699
+ return this.deleteGlobal(id, opts);
700
700
  }
701
701
  /** Resolve a ChecklistLibrary from a numeric id (or, where the vendor indexes a primary text field,
702
702
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -759,14 +759,14 @@ var ChecklistLibraryChecklistItemsResource = class extends BaseResource {
759
759
  async update(parentId, id, data, opts = {}) {
760
760
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
761
761
  await this.guardStaleBeforeMutation(id, opts, "checklist_library_checklist_items.update", parentId);
762
- return this.updateScopedRaw(parentId, id, data);
762
+ return this.updateScopedRaw(parentId, id, data, opts);
763
763
  }
764
764
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
765
765
  * envelope and never issues the delete. */
766
766
  async delete(parentId, id, opts = {}) {
767
767
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
768
768
  await this.guardStaleBeforeMutation(id, opts, "checklist_library_checklist_items.delete", parentId);
769
- return this.deleteScopedRaw(parentId, id);
769
+ return this.deleteScopedRaw(parentId, id, opts);
770
770
  }
771
771
  /** Resolve a ChecklistLibraryChecklistItem from a numeric id (or, where the vendor indexes a primary text field,
772
772
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -1114,7 +1114,7 @@ async function upsertByName(resource, companyName, params, opts, http) {
1114
1114
  let merges = 0;
1115
1115
  for (; ; ) {
1116
1116
  try {
1117
- const created = await resource.create(body, {});
1117
+ const created = await resource.create(body, { maxRetries: opts.maxRetries });
1118
1118
  return {
1119
1119
  id: created.id,
1120
1120
  created: true,
@@ -1762,14 +1762,14 @@ var CompanyAlertsResource = class extends BaseResource {
1762
1762
  async update(parentId, id, data, opts = {}) {
1763
1763
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
1764
1764
  await this.guardStaleBeforeMutation(id, opts, "company_alerts.update", parentId);
1765
- return this.updateScopedRaw(parentId, id, data);
1765
+ return this.updateScopedRaw(parentId, id, data, opts);
1766
1766
  }
1767
1767
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
1768
1768
  * envelope and never issues the delete. */
1769
1769
  async delete(parentId, id, opts = {}) {
1770
1770
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
1771
1771
  await this.guardStaleBeforeMutation(id, opts, "company_alerts.delete", parentId);
1772
- return this.deleteScopedRaw(parentId, id);
1772
+ return this.deleteScopedRaw(parentId, id, opts);
1773
1773
  }
1774
1774
  /** Resolve a CompanyAlert from a numeric id (or, where the vendor indexes a primary text field,
1775
1775
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -1829,14 +1829,14 @@ var CompanyLocationsResource = class extends BaseResource {
1829
1829
  async update(parentId, id, data, opts = {}) {
1830
1830
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
1831
1831
  await this.guardStaleBeforeMutation(id, opts, "company_locations.update", parentId);
1832
- return this.updateScopedRaw(parentId, id, data);
1832
+ return this.updateScopedRaw(parentId, id, data, opts);
1833
1833
  }
1834
1834
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
1835
1835
  * envelope and never issues the delete. */
1836
1836
  async delete(parentId, id, opts = {}) {
1837
1837
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
1838
1838
  await this.guardStaleBeforeMutation(id, opts, "company_locations.delete", parentId);
1839
- return this.deleteScopedRaw(parentId, id);
1839
+ return this.deleteScopedRaw(parentId, id, opts);
1840
1840
  }
1841
1841
  /** Resolve a CompanyLocation from a numeric id (or, where the vendor indexes a primary text field,
1842
1842
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -1901,7 +1901,7 @@ var CompanyNotesResource = class extends BaseResource {
1901
1901
  async update(parentId, id, data, opts = {}) {
1902
1902
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
1903
1903
  await this.guardStaleBeforeMutation(id, opts, "company_notes.update", parentId);
1904
- return this.updateScopedRaw(parentId, id, data);
1904
+ return this.updateScopedRaw(parentId, id, data, opts);
1905
1905
  }
1906
1906
  /** Resolve a CompanyNote from a numeric id (or, where the vendor indexes a primary text field,
1907
1907
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -1956,7 +1956,7 @@ var CompanySiteConfigurationsResource = class extends BaseResource {
1956
1956
  async update(parentId, id, data, opts = {}) {
1957
1957
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
1958
1958
  await this.guardStaleBeforeMutation(id, opts, "company_site_configurations.update", parentId);
1959
- return this.updateScopedRaw(parentId, id, data);
1959
+ return this.updateScopedRaw(parentId, id, data, opts);
1960
1960
  }
1961
1961
  /** Resolve a CompanySiteConfigurations from a numeric id (or, where the vendor indexes a primary text field,
1962
1962
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2028,7 +2028,7 @@ var CompanyWebhooksResource = class extends BaseResource {
2028
2028
  async delete(id, opts = {}) {
2029
2029
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
2030
2030
  await this.guardStaleBeforeMutation(id, opts, "company_webhooks.delete");
2031
- return this.deleteGlobal(id);
2031
+ return this.deleteGlobal(id, opts);
2032
2032
  }
2033
2033
  /** Resolve a CompanyWebhook from a numeric id (or, where the vendor indexes a primary text field,
2034
2034
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -2091,14 +2091,14 @@ var ConfigurationItemBillingProductAssociationsResource = class extends BaseReso
2091
2091
  async update(parentId, id, data, opts = {}) {
2092
2092
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
2093
2093
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_billing_product_associations.update", parentId);
2094
- return this.updateScopedRaw(parentId, id, data);
2094
+ return this.updateScopedRaw(parentId, id, data, opts);
2095
2095
  }
2096
2096
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
2097
2097
  * envelope and never issues the delete. */
2098
2098
  async delete(parentId, id, opts = {}) {
2099
2099
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
2100
2100
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_billing_product_associations.delete", parentId);
2101
- return this.deleteScopedRaw(parentId, id);
2101
+ return this.deleteScopedRaw(parentId, id, opts);
2102
2102
  }
2103
2103
  /** Resolve a ConfigurationItemBillingProductAssociations from a numeric id (or, where the vendor indexes a primary text field,
2104
2104
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2224,14 +2224,14 @@ var ConfigurationItemCategoryUdfAssociationsResource = class extends BaseResourc
2224
2224
  async update(parentId, id, data, opts = {}) {
2225
2225
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
2226
2226
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_category_udf_associations.update", parentId);
2227
- return this.updateScopedRaw(parentId, id, data);
2227
+ return this.updateScopedRaw(parentId, id, data, opts);
2228
2228
  }
2229
2229
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
2230
2230
  * envelope and never issues the delete. */
2231
2231
  async delete(parentId, id, opts = {}) {
2232
2232
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
2233
2233
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_category_udf_associations.delete", parentId);
2234
- return this.deleteScopedRaw(parentId, id);
2234
+ return this.deleteScopedRaw(parentId, id, opts);
2235
2235
  }
2236
2236
  /** Resolve a ConfigurationItemCategoryUdfAssociation from a numeric id (or, where the vendor indexes a primary text field,
2237
2237
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2280,7 +2280,7 @@ var ConfigurationItemDnsRecordsResource = class extends BaseResource {
2280
2280
  async delete(parentId, id, opts = {}) {
2281
2281
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
2282
2282
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_dns_records.delete", parentId);
2283
- return this.deleteScopedRaw(parentId, id);
2283
+ return this.deleteScopedRaw(parentId, id, opts);
2284
2284
  }
2285
2285
  /** Resolve a ConfigurationItemDnsRecord from a numeric id (or, where the vendor indexes a primary text field,
2286
2286
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2339,7 +2339,7 @@ var ConfigurationItemNotesResource = class extends BaseResource {
2339
2339
  async update(parentId, id, data, opts = {}) {
2340
2340
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
2341
2341
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_notes.update", parentId);
2342
- return this.updateScopedRaw(parentId, id, data);
2342
+ return this.updateScopedRaw(parentId, id, data, opts);
2343
2343
  }
2344
2344
  /** Resolve a ConfigurationItemNote from a numeric id (or, where the vendor indexes a primary text field,
2345
2345
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2396,7 +2396,7 @@ var ConfigurationItemRelatedItemsResource = class extends BaseResource {
2396
2396
  async delete(parentId, id, opts = {}) {
2397
2397
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
2398
2398
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_related_items.delete", parentId);
2399
- return this.deleteScopedRaw(parentId, id);
2399
+ return this.deleteScopedRaw(parentId, id, opts);
2400
2400
  }
2401
2401
  /** Resolve a ConfigurationItemRelatedItem from a numeric id (or, where the vendor indexes a primary text field,
2402
2402
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2412,8 +2412,8 @@ var ConfigurationItemRelatedItemsResource = class extends BaseResource {
2412
2412
  };
2413
2413
 
2414
2414
  // src/resources/special/configuration_items.ts
2415
- async function fetchRecord(http, path, label) {
2416
- const res = await http.request({ method: "GET", path, operation: "configuration_items.moveConfigurationItem" });
2415
+ async function fetchRecord(http, path, label, readOpts) {
2416
+ const res = await http.request({ method: "GET", path, operation: "configuration_items.moveConfigurationItem", maxRetries: readOpts?.maxRetries });
2417
2417
  const body = res;
2418
2418
  if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
2419
2419
  throw new NotFoundError(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
@@ -2426,8 +2426,8 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
2426
2426
  throw new AutotaskConfigError("moveConfigurationItem: destinationCompanyId is required");
2427
2427
  }
2428
2428
  const destId = parseIdentifier(opts.destinationCompanyId, "destinationCompanyId");
2429
- const source = await fetchRecord(http, `/V1.0/ConfigurationItems/${numericSource}`, `Configuration item ${numericSource}`);
2430
- await fetchRecord(http, `/V1.0/Companies/${destId}`, `Company ${destId}`);
2429
+ const source = await fetchRecord(http, `/V1.0/ConfigurationItems/${numericSource}`, `Configuration item ${numericSource}`, { maxRetries: opts.maxRetries });
2430
+ await fetchRecord(http, `/V1.0/Companies/${destId}`, `Company ${destId}`, { maxRetries: opts.maxRetries });
2431
2431
  const body = { ...source };
2432
2432
  delete body.id;
2433
2433
  delete body.soapParentPropertyId;
@@ -2467,7 +2467,8 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
2467
2467
  method: "POST",
2468
2468
  path: "/V1.0/ConfigurationItems",
2469
2469
  body,
2470
- operation: "configuration_items.moveConfigurationItem"
2470
+ operation: "configuration_items.moveConfigurationItem",
2471
+ maxRetries: opts.maxRetries
2471
2472
  });
2472
2473
  const createdBody = created;
2473
2474
  const newId = createdBody !== null ? createdBody.itemId ?? createdBody.id : void 0;
@@ -2480,7 +2481,8 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
2480
2481
  method: "PUT",
2481
2482
  path: "/V1.0/ConfigurationItems",
2482
2483
  body: { id: numericSource, isActive: false },
2483
- operation: "configuration_items.moveConfigurationItem"
2484
+ operation: "configuration_items.moveConfigurationItem",
2485
+ maxRetries: opts.maxRetries
2484
2486
  });
2485
2487
  sourceDeactivated = true;
2486
2488
  }
@@ -2698,14 +2700,14 @@ var ConfigurationItemSslSubjectAlternativeNamesResource = class extends BaseReso
2698
2700
  async update(parentId, id, data, opts = {}) {
2699
2701
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
2700
2702
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_ssl_subject_alternative_names.update", parentId);
2701
- return this.updateScopedRaw(parentId, id, data);
2703
+ return this.updateScopedRaw(parentId, id, data, opts);
2702
2704
  }
2703
2705
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
2704
2706
  * envelope and never issues the delete. */
2705
2707
  async delete(parentId, id, opts = {}) {
2706
2708
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
2707
2709
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_ssl_subject_alternative_names.delete", parentId);
2708
- return this.deleteScopedRaw(parentId, id);
2710
+ return this.deleteScopedRaw(parentId, id, opts);
2709
2711
  }
2710
2712
  /** Resolve a ConfigurationItemSslSubjectAlternativeName from a numeric id (or, where the vendor indexes a primary text field,
2711
2713
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -2779,7 +2781,7 @@ var ConfigurationItemTypesResource = class extends BaseResource {
2779
2781
  async delete(id, opts = {}) {
2780
2782
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
2781
2783
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_types.delete");
2782
- return this.deleteGlobal(id);
2784
+ return this.deleteGlobal(id, opts);
2783
2785
  }
2784
2786
  /** Resolve a ConfigurationItemType from a numeric id (or, where the vendor indexes a primary text field,
2785
2787
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -2855,7 +2857,7 @@ var ConfigurationItemWebhooksResource = class extends BaseResource {
2855
2857
  async delete(id, opts = {}) {
2856
2858
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
2857
2859
  await this.guardStaleBeforeMutation(id, opts, "configuration_item_webhooks.delete");
2858
- return this.deleteGlobal(id);
2860
+ return this.deleteGlobal(id, opts);
2859
2861
  }
2860
2862
  /** Resolve a ConfigurationItemWebhook from a numeric id (or, where the vendor indexes a primary text field,
2861
2863
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -2913,7 +2915,7 @@ var ContactGroupContactsResource = class extends BaseResource {
2913
2915
  async delete(id, opts = {}) {
2914
2916
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
2915
2917
  await this.guardStaleBeforeMutation(id, opts, "contact_group_contacts.delete");
2916
- return this.deleteGlobal(id);
2918
+ return this.deleteGlobal(id, opts);
2917
2919
  }
2918
2920
  /** Resolve a ContactGroupContacts from a numeric id (or, where the vendor indexes a primary text field,
2919
2921
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -2983,7 +2985,7 @@ var ContactGroupsResource = class extends BaseResource {
2983
2985
  async delete(id, opts = {}) {
2984
2986
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
2985
2987
  await this.guardStaleBeforeMutation(id, opts, "contact_groups.delete");
2986
- return this.deleteGlobal(id);
2988
+ return this.deleteGlobal(id, opts);
2987
2989
  }
2988
2990
  /** Resolve a ContactGroups from a numeric id (or, where the vendor indexes a primary text field,
2989
2991
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -3003,8 +3005,8 @@ var ContactGroupsResource = class extends BaseResource {
3003
3005
  };
3004
3006
 
3005
3007
  // src/resources/special/contacts.ts
3006
- async function fetchRecord2(http, path, label) {
3007
- const res = await http.request({ method: "GET", path, operation: "contacts.moveToCompany" });
3008
+ async function fetchRecord2(http, path, label, readOpts) {
3009
+ const res = await http.request({ method: "GET", path, operation: "contacts.moveToCompany", maxRetries: readOpts?.maxRetries });
3008
3010
  const body = res;
3009
3011
  if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
3010
3012
  throw new NotFoundError(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
@@ -3014,7 +3016,7 @@ async function fetchRecord2(http, path, label) {
3014
3016
  async function moveToCompany(_resource, sourceContactId, destinationCompanyId, opts = {}, http) {
3015
3017
  const sourceId = parseIdentifier(sourceContactId, "sourceContactId");
3016
3018
  const destId = parseIdentifier(destinationCompanyId, "destinationCompanyId");
3017
- const source = await fetchRecord2(http, `/V1.0/Contacts/${sourceId}`, `Contact ${sourceId}`);
3019
+ const source = await fetchRecord2(http, `/V1.0/Contacts/${sourceId}`, `Contact ${sourceId}`, { maxRetries: opts.maxRetries });
3018
3020
  const companyID = source.companyID;
3019
3021
  if (typeof companyID !== "number" || companyID < 0) {
3020
3022
  throw new NotFoundError(`Contact ${sourceId} has no companyID (cannot scope the source delete)`);
@@ -3028,7 +3030,7 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3028
3030
  );
3029
3031
  }
3030
3032
  }
3031
- await fetchRecord2(http, `/V1.0/Companies/${destId}`, `Company ${destId}`);
3033
+ await fetchRecord2(http, `/V1.0/Companies/${destId}`, `Company ${destId}`, { maxRetries: opts.maxRetries });
3032
3034
  const email = typeof source.emailAddress === "string" ? source.emailAddress : "";
3033
3035
  if (email !== "") {
3034
3036
  const res = await http.request({
@@ -3081,7 +3083,8 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3081
3083
  method: "POST",
3082
3084
  path: `/V1.0/Companies/${destId}/Contacts`,
3083
3085
  body,
3084
- operation: "contacts.moveToCompany"
3086
+ operation: "contacts.moveToCompany",
3087
+ maxRetries: opts.maxRetries
3085
3088
  });
3086
3089
  const createdBody = created;
3087
3090
  const newId = createdBody !== null ? createdBody.itemId ?? createdBody.id : void 0;
@@ -3093,7 +3096,8 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
3093
3096
  await http.request({
3094
3097
  method: "DELETE",
3095
3098
  path: `/V1.0/Companies/${companyID}/Contacts/${sourceId}`,
3096
- operation: "contacts.moveToCompany"
3099
+ operation: "contacts.moveToCompany",
3100
+ maxRetries: opts.maxRetries
3097
3101
  });
3098
3102
  sourceDeleted = true;
3099
3103
  }
@@ -3146,7 +3150,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3146
3150
  throw new AutotaskConfigError("upsertByEmail: extra.lastName must be a string (or omitted \u2014 the node defaults it to the non-empty neutral value Unknown)", { operation: OP_UPSERT_EMAIL });
3147
3151
  }
3148
3152
  }
3149
- const parentRes = await http.request({ method: "GET", path: `/V1.0/Companies/${cid}`, operation: OP_UPSERT_EMAIL });
3153
+ const parentRes = await http.request({ method: "GET", path: `/V1.0/Companies/${cid}`, operation: OP_UPSERT_EMAIL, maxRetries: opts.maxRetries });
3150
3154
  const parentBody = parentRes;
3151
3155
  if (parentBody === null || !("item" in parentBody) || parentBody.item === null || parentBody.item === void 0) {
3152
3156
  throw new CompanyNotFoundError(
@@ -3214,7 +3218,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
3214
3218
  let merges = 0;
3215
3219
  for (; ; ) {
3216
3220
  try {
3217
- const created = await resource.create(cid, body, {});
3221
+ const created = await resource.create(cid, body, { maxRetries: opts.maxRetries });
3218
3222
  return { id: created.id, created: true };
3219
3223
  } catch (err) {
3220
3224
  if (!isAutotaskError(err) || err.vendorError === void 0) throw err;
@@ -3293,14 +3297,14 @@ var ContactsResource = class extends BaseResource {
3293
3297
  async update(parentId, id, data, opts = {}) {
3294
3298
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
3295
3299
  await this.guardStaleBeforeMutation(id, opts, "contacts.update", parentId);
3296
- return this.updateScopedRaw(parentId, id, data);
3300
+ return this.updateScopedRaw(parentId, id, data, opts);
3297
3301
  }
3298
3302
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
3299
3303
  * envelope and never issues the delete. */
3300
3304
  async delete(parentId, id, opts = {}) {
3301
3305
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3302
3306
  await this.guardStaleBeforeMutation(id, opts, "contacts.delete", parentId);
3303
- return this.deleteScopedRaw(parentId, id);
3307
+ return this.deleteScopedRaw(parentId, id, opts);
3304
3308
  }
3305
3309
  /** Resolve a Contact from a numeric id (or, where the vendor indexes a primary text field,
3306
3310
  * from an exact match on firstName / lastName). A numeric id miss throws NOT_FOUND; a complete
@@ -3396,7 +3400,7 @@ var ContactWebhooksResource = class extends BaseResource {
3396
3400
  async delete(id, opts = {}) {
3397
3401
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
3398
3402
  await this.guardStaleBeforeMutation(id, opts, "contact_webhooks.delete");
3399
- return this.deleteGlobal(id);
3403
+ return this.deleteGlobal(id, opts);
3400
3404
  }
3401
3405
  /** Resolve a ContactWebhook from a numeric id (or, where the vendor indexes a primary text field,
3402
3406
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -3459,14 +3463,14 @@ var ContractBillingRulesResource = class extends BaseResource {
3459
3463
  async update(parentId, id, data, opts = {}) {
3460
3464
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
3461
3465
  await this.guardStaleBeforeMutation(id, opts, "contract_billing_rules.update", parentId);
3462
- return this.updateScopedRaw(parentId, id, data);
3466
+ return this.updateScopedRaw(parentId, id, data, opts);
3463
3467
  }
3464
3468
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
3465
3469
  * envelope and never issues the delete. */
3466
3470
  async delete(parentId, id, opts = {}) {
3467
3471
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3468
3472
  await this.guardStaleBeforeMutation(id, opts, "contract_billing_rules.delete", parentId);
3469
- return this.deleteScopedRaw(parentId, id);
3473
+ return this.deleteScopedRaw(parentId, id, opts);
3470
3474
  }
3471
3475
  /** Resolve a ContractBillingRule from a numeric id (or, where the vendor indexes a primary text field,
3472
3476
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3525,7 +3529,7 @@ var ContractBlockHourFactorsResource = class extends BaseResource {
3525
3529
  async update(parentId, id, data, opts = {}) {
3526
3530
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
3527
3531
  await this.guardStaleBeforeMutation(id, opts, "contract_block_hour_factors.update", parentId);
3528
- return this.updateScopedRaw(parentId, id, data);
3532
+ return this.updateScopedRaw(parentId, id, data, opts);
3529
3533
  }
3530
3534
  /** Resolve a ContractBlockHourFactor from a numeric id (or, where the vendor indexes a primary text field,
3531
3535
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3584,7 +3588,7 @@ var ContractBlocksResource = class extends BaseResource {
3584
3588
  async update(parentId, id, data, opts = {}) {
3585
3589
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
3586
3590
  await this.guardStaleBeforeMutation(id, opts, "contract_blocks.update", parentId);
3587
- return this.updateScopedRaw(parentId, id, data);
3591
+ return this.updateScopedRaw(parentId, id, data, opts);
3588
3592
  }
3589
3593
  /** Resolve a ContractBlock from a numeric id (or, where the vendor indexes a primary text field,
3590
3594
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3644,14 +3648,14 @@ var ContractChargesResource = class extends BaseResource {
3644
3648
  async update(parentId, id, data, opts = {}) {
3645
3649
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
3646
3650
  await this.guardStaleBeforeMutation(id, opts, "contract_charges.update", parentId);
3647
- return this.updateScopedRaw(parentId, id, data);
3651
+ return this.updateScopedRaw(parentId, id, data, opts);
3648
3652
  }
3649
3653
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
3650
3654
  * envelope and never issues the delete. */
3651
3655
  async delete(parentId, id, opts = {}) {
3652
3656
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3653
3657
  await this.guardStaleBeforeMutation(id, opts, "contract_charges.delete", parentId);
3654
- return this.deleteScopedRaw(parentId, id);
3658
+ return this.deleteScopedRaw(parentId, id, opts);
3655
3659
  }
3656
3660
  /** Resolve a ContractCharge from a numeric id (or, where the vendor indexes a primary text field,
3657
3661
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -3712,7 +3716,7 @@ var ContractExclusionBillingCodesResource = class extends BaseResource {
3712
3716
  async delete(parentId, id, opts = {}) {
3713
3717
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3714
3718
  await this.guardStaleBeforeMutation(id, opts, "contract_exclusion_billing_codes.delete", parentId);
3715
- return this.deleteScopedRaw(parentId, id);
3719
+ return this.deleteScopedRaw(parentId, id, opts);
3716
3720
  }
3717
3721
  /** Resolve a ContractExclusionBillingCode from a numeric id (or, where the vendor indexes a primary text field,
3718
3722
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3769,7 +3773,7 @@ var ContractExclusionRolesResource = class extends BaseResource {
3769
3773
  async delete(parentId, id, opts = {}) {
3770
3774
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3771
3775
  await this.guardStaleBeforeMutation(id, opts, "contract_exclusion_roles.delete", parentId);
3772
- return this.deleteScopedRaw(parentId, id);
3776
+ return this.deleteScopedRaw(parentId, id, opts);
3773
3777
  }
3774
3778
  /** Resolve a ContractExclusionRoles from a numeric id (or, where the vendor indexes a primary text field,
3775
3779
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3826,7 +3830,7 @@ var ContractExclusionSetExcludedRolesResource = class extends BaseResource {
3826
3830
  async delete(parentId, id, opts = {}) {
3827
3831
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3828
3832
  await this.guardStaleBeforeMutation(id, opts, "contract_exclusion_set_excluded_roles.delete", parentId);
3829
- return this.deleteScopedRaw(parentId, id);
3833
+ return this.deleteScopedRaw(parentId, id, opts);
3830
3834
  }
3831
3835
  /** Resolve a ContractExclusionSetExcludedRoles from a numeric id (or, where the vendor indexes a primary text field,
3832
3836
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3883,7 +3887,7 @@ var ContractExclusionSetExcludedWorkTypesResource = class extends BaseResource {
3883
3887
  async delete(parentId, id, opts = {}) {
3884
3888
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
3885
3889
  await this.guardStaleBeforeMutation(id, opts, "contract_exclusion_set_excluded_work_types.delete", parentId);
3886
- return this.deleteScopedRaw(parentId, id);
3890
+ return this.deleteScopedRaw(parentId, id, opts);
3887
3891
  }
3888
3892
  /** Resolve a ContractExclusionSetExcludedWorkTypes from a numeric id (or, where the vendor indexes a primary text field,
3889
3893
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -3953,7 +3957,7 @@ var ContractExclusionSetsResource = class extends BaseResource {
3953
3957
  async delete(id, opts = {}) {
3954
3958
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
3955
3959
  await this.guardStaleBeforeMutation(id, opts, "contract_exclusion_sets.delete");
3956
- return this.deleteGlobal(id);
3960
+ return this.deleteGlobal(id, opts);
3957
3961
  }
3958
3962
  /** Resolve a ContractExclusionSets from a numeric id (or, where the vendor indexes a primary text field,
3959
3963
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -4016,7 +4020,7 @@ var ContractMilestonesResource = class extends BaseResource {
4016
4020
  async update(parentId, id, data, opts = {}) {
4017
4021
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4018
4022
  await this.guardStaleBeforeMutation(id, opts, "contract_milestones.update", parentId);
4019
- return this.updateScopedRaw(parentId, id, data);
4023
+ return this.updateScopedRaw(parentId, id, data, opts);
4020
4024
  }
4021
4025
  /** Resolve a ContractMilestone from a numeric id (or, where the vendor indexes a primary text field,
4022
4026
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4075,7 +4079,7 @@ var ContractNotesResource = class extends BaseResource {
4075
4079
  async update(parentId, id, data, opts = {}) {
4076
4080
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4077
4081
  await this.guardStaleBeforeMutation(id, opts, "contract_notes.update", parentId);
4078
- return this.updateScopedRaw(parentId, id, data);
4082
+ return this.updateScopedRaw(parentId, id, data, opts);
4079
4083
  }
4080
4084
  /** Resolve a ContractNote from a numeric id (or, where the vendor indexes a primary text field,
4081
4085
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4134,7 +4138,7 @@ var ContractRatesResource = class extends BaseResource {
4134
4138
  async update(parentId, id, data, opts = {}) {
4135
4139
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4136
4140
  await this.guardStaleBeforeMutation(id, opts, "contract_rates.update", parentId);
4137
- return this.updateScopedRaw(parentId, id, data);
4141
+ return this.updateScopedRaw(parentId, id, data, opts);
4138
4142
  }
4139
4143
  /** Resolve a ContractRate from a numeric id (or, where the vendor indexes a primary text field,
4140
4144
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4193,7 +4197,7 @@ var ContractRetainersResource = class extends BaseResource {
4193
4197
  async update(parentId, id, data, opts = {}) {
4194
4198
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4195
4199
  await this.guardStaleBeforeMutation(id, opts, "contract_retainers.update", parentId);
4196
- return this.updateScopedRaw(parentId, id, data);
4200
+ return this.updateScopedRaw(parentId, id, data, opts);
4197
4201
  }
4198
4202
  /** Resolve a ContractRetainers from a numeric id (or, where the vendor indexes a primary text field,
4199
4203
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4252,7 +4256,7 @@ var ContractRoleCostsResource = class extends BaseResource {
4252
4256
  async update(parentId, id, data, opts = {}) {
4253
4257
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4254
4258
  await this.guardStaleBeforeMutation(id, opts, "contract_role_costs.update", parentId);
4255
- return this.updateScopedRaw(parentId, id, data);
4259
+ return this.updateScopedRaw(parentId, id, data, opts);
4256
4260
  }
4257
4261
  /** Resolve a ContractRoleCosts from a numeric id (or, where the vendor indexes a primary text field,
4258
4262
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4379,7 +4383,7 @@ var ContractServiceBundlesResource = class extends BaseResource {
4379
4383
  async update(parentId, id, data, opts = {}) {
4380
4384
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4381
4385
  await this.guardStaleBeforeMutation(id, opts, "contract_service_bundles.update", parentId);
4382
- return this.updateScopedRaw(parentId, id, data);
4386
+ return this.updateScopedRaw(parentId, id, data, opts);
4383
4387
  }
4384
4388
  /** Resolve a ContractServiceBundle from a numeric id (or, where the vendor indexes a primary text field,
4385
4389
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -4480,7 +4484,7 @@ var ContractServicesResource = class extends BaseResource {
4480
4484
  async update(parentId, id, data, opts = {}) {
4481
4485
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
4482
4486
  await this.guardStaleBeforeMutation(id, opts, "contract_services.update", parentId);
4483
- return this.updateScopedRaw(parentId, id, data);
4487
+ return this.updateScopedRaw(parentId, id, data, opts);
4484
4488
  }
4485
4489
  /** Resolve a ContractService from a numeric id (or, where the vendor indexes a primary text field,
4486
4490
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -5908,7 +5912,7 @@ var ContractTicketPurchasesResource = class extends BaseResource {
5908
5912
  async update(parentId, id, data, opts = {}) {
5909
5913
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
5910
5914
  await this.guardStaleBeforeMutation(id, opts, "contract_ticket_purchases.update", parentId);
5911
- return this.updateScopedRaw(parentId, id, data);
5915
+ return this.updateScopedRaw(parentId, id, data, opts);
5912
5916
  }
5913
5917
  /** Resolve a ContractTicketPurchases from a numeric id (or, where the vendor indexes a primary text field,
5914
5918
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -6175,7 +6179,7 @@ var ExpenseItemAttachmentsResource = class extends BaseResource {
6175
6179
  async delete(parentId, id, opts = {}) {
6176
6180
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
6177
6181
  await this.guardStaleBeforeMutation(id, opts, "expense_item_attachments.delete", parentId);
6178
- return this.deleteScopedModel(parentId, id);
6182
+ return this.deleteScopedModel(parentId, id, opts);
6179
6183
  }
6180
6184
  /** Download the attachment bytes (GET .../{id}/data; node-proven path, quirk #9) → Buffer. */
6181
6185
  async download(parentId, id) {
@@ -6238,7 +6242,7 @@ var ExpenseItemsResource = class extends BaseResource {
6238
6242
  async update(parentId, id, data, opts = {}) {
6239
6243
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
6240
6244
  await this.guardStaleBeforeMutation(id, opts, "expense_items.update", parentId);
6241
- return this.updateScopedRaw(parentId, id, data);
6245
+ return this.updateScopedRaw(parentId, id, data, opts);
6242
6246
  }
6243
6247
  /** Resolve a ExpenseItem from a numeric id (or, where the vendor indexes a primary text field,
6244
6248
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -6374,7 +6378,7 @@ var HolidaySetsResource = class extends BaseResource {
6374
6378
  async delete(id, opts = {}) {
6375
6379
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
6376
6380
  await this.guardStaleBeforeMutation(id, opts, "holiday_sets.delete");
6377
- return this.deleteGlobal(id);
6381
+ return this.deleteGlobal(id, opts);
6378
6382
  }
6379
6383
  /** Resolve a HolidaySet from a numeric id (or, where the vendor indexes a primary text field,
6380
6384
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -6433,14 +6437,14 @@ var HolidaysResource = class extends BaseResource {
6433
6437
  async update(parentId, id, data, opts = {}) {
6434
6438
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
6435
6439
  await this.guardStaleBeforeMutation(id, opts, "holidays.update", parentId);
6436
- return this.updateScopedRaw(parentId, id, data);
6440
+ return this.updateScopedRaw(parentId, id, data, opts);
6437
6441
  }
6438
6442
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
6439
6443
  * envelope and never issues the delete. */
6440
6444
  async delete(parentId, id, opts = {}) {
6441
6445
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
6442
6446
  await this.guardStaleBeforeMutation(id, opts, "holidays.delete", parentId);
6443
- return this.deleteScopedRaw(parentId, id);
6447
+ return this.deleteScopedRaw(parentId, id, opts);
6444
6448
  }
6445
6449
  /** Resolve a Holiday from a numeric id (or, where the vendor indexes a primary text field,
6446
6450
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -6479,7 +6483,8 @@ async function stockedItems(_resource, kind, parentId, data, opts = {}, http) {
6479
6483
  method: "POST",
6480
6484
  path: `/V1.0/InventoryProducts/${numericParent}/${suffix}`,
6481
6485
  body: data,
6482
- operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`
6486
+ operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`,
6487
+ maxRetries: opts.maxRetries
6483
6488
  });
6484
6489
  return unwrapOperation(res);
6485
6490
  }
@@ -6538,7 +6543,7 @@ var InventoryProductsResource = class extends BaseResource {
6538
6543
  async delete(id, opts = {}) {
6539
6544
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
6540
6545
  await this.guardStaleBeforeMutation(id, opts, "inventory_products.delete");
6541
- return this.deleteGlobal(id);
6546
+ return this.deleteGlobal(id, opts);
6542
6547
  }
6543
6548
  /** Resolve a InventoryProduct from a numeric id (or, where the vendor indexes a primary text field,
6544
6549
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -6894,7 +6899,7 @@ var OpportunityAttachmentsResource = class extends BaseResource {
6894
6899
  async delete(parentId, id, opts = {}) {
6895
6900
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
6896
6901
  await this.guardStaleBeforeMutation(id, opts, "opportunity_attachments.delete", parentId);
6897
- return this.deleteScopedModel(parentId, id);
6902
+ return this.deleteScopedModel(parentId, id, opts);
6898
6903
  }
6899
6904
  /** Download the attachment bytes (GET .../{id}/data; node-proven path, quirk #9) → Buffer. */
6900
6905
  async download(parentId, id) {
@@ -7016,7 +7021,7 @@ var PhasesResource = class extends BaseResource {
7016
7021
  async update(parentId, id, data, opts = {}) {
7017
7022
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7018
7023
  await this.guardStaleBeforeMutation(id, opts, "phases.update", parentId);
7019
- return this.updateScopedRaw(parentId, id, data);
7024
+ return this.updateScopedRaw(parentId, id, data, opts);
7020
7025
  }
7021
7026
  /** Resolve a Phase from a numeric id (or, where the vendor indexes a primary text field,
7022
7027
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -7142,7 +7147,7 @@ var ProductVendorsResource = class extends BaseResource {
7142
7147
  async update(parentId, id, data, opts = {}) {
7143
7148
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7144
7149
  await this.guardStaleBeforeMutation(id, opts, "product_vendors.update", parentId);
7145
- return this.updateScopedRaw(parentId, id, data);
7150
+ return this.updateScopedRaw(parentId, id, data, opts);
7146
7151
  }
7147
7152
  /** Resolve a ProductVendors from a numeric id (or, where the vendor indexes a primary text field,
7148
7153
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -7202,14 +7207,14 @@ var ProjectChargesResource = class extends BaseResource {
7202
7207
  async update(parentId, id, data, opts = {}) {
7203
7208
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7204
7209
  await this.guardStaleBeforeMutation(id, opts, "project_charges.update", parentId);
7205
- return this.updateScopedRaw(parentId, id, data);
7210
+ return this.updateScopedRaw(parentId, id, data, opts);
7206
7211
  }
7207
7212
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
7208
7213
  * envelope and never issues the delete. */
7209
7214
  async delete(parentId, id, opts = {}) {
7210
7215
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
7211
7216
  await this.guardStaleBeforeMutation(id, opts, "project_charges.delete", parentId);
7212
- return this.deleteScopedRaw(parentId, id);
7217
+ return this.deleteScopedRaw(parentId, id, opts);
7213
7218
  }
7214
7219
  /** Resolve a ProjectCharge from a numeric id (or, where the vendor indexes a primary text field,
7215
7220
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -7272,7 +7277,7 @@ var ProjectNotesResource = class extends BaseResource {
7272
7277
  async update(parentId, id, data, opts = {}) {
7273
7278
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7274
7279
  await this.guardStaleBeforeMutation(id, opts, "project_notes.update", parentId);
7275
- return this.updateScopedRaw(parentId, id, data);
7280
+ return this.updateScopedRaw(parentId, id, data, opts);
7276
7281
  }
7277
7282
  /** Resolve a ProjectNote from a numeric id (or, where the vendor indexes a primary text field,
7278
7283
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -7527,7 +7532,7 @@ var PurchaseOrderItemsResource = class extends BaseResource {
7527
7532
  async update(parentId, id, data, opts = {}) {
7528
7533
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7529
7534
  await this.guardStaleBeforeMutation(id, opts, "purchase_order_items.update", parentId);
7530
- return this.updateScopedRaw(parentId, id, data);
7535
+ return this.updateScopedRaw(parentId, id, data, opts);
7531
7536
  }
7532
7537
  /** Resolve a PurchaseOrderItems from a numeric id (or, where the vendor indexes a primary text field,
7533
7538
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -7649,14 +7654,14 @@ var QuoteItemsResource = class extends BaseResource {
7649
7654
  async update(parentId, id, data, opts = {}) {
7650
7655
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7651
7656
  await this.guardStaleBeforeMutation(id, opts, "quote_items.update", parentId);
7652
- return this.updateScopedRaw(parentId, id, data);
7657
+ return this.updateScopedRaw(parentId, id, data, opts);
7653
7658
  }
7654
7659
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
7655
7660
  * envelope and never issues the delete. */
7656
7661
  async delete(parentId, id, opts = {}) {
7657
7662
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
7658
7663
  await this.guardStaleBeforeMutation(id, opts, "quote_items.delete", parentId);
7659
- return this.deleteScopedRaw(parentId, id);
7664
+ return this.deleteScopedRaw(parentId, id, opts);
7660
7665
  }
7661
7666
  /** Resolve a QuoteItem from a numeric id (or, where the vendor indexes a primary text field,
7662
7667
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -7895,7 +7900,7 @@ var ResourceRoleQueuesResource = class extends BaseResource {
7895
7900
  async update(parentId, id, data, opts = {}) {
7896
7901
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7897
7902
  await this.guardStaleBeforeMutation(id, opts, "resource_role_queues.update", parentId);
7898
- return this.updateScopedRaw(parentId, id, data);
7903
+ return this.updateScopedRaw(parentId, id, data, opts);
7899
7904
  }
7900
7905
  /** Resolve a ResourceRoleQueue from a numeric id (or, where the vendor indexes a primary text field,
7901
7906
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -7988,7 +7993,7 @@ var ResourceSkillsResource = class extends BaseResource {
7988
7993
  async update(parentId, id, data, opts = {}) {
7989
7994
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
7990
7995
  await this.guardStaleBeforeMutation(id, opts, "resource_skills.update", parentId);
7991
- return this.updateScopedRaw(parentId, id, data);
7996
+ return this.updateScopedRaw(parentId, id, data, opts);
7992
7997
  }
7993
7998
  /** Resolve a ResourceSkill from a numeric id (or, where the vendor indexes a primary text field,
7994
7999
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8058,7 +8063,8 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
8058
8063
  const res = await http.request({
8059
8064
  method: "GET",
8060
8065
  path: `/V1.0/Companies/${id}`,
8061
- operation: "resources.transferOwnership"
8066
+ operation: "resources.transferOwnership",
8067
+ maxRetries: opts?.maxRetries
8062
8068
  });
8063
8069
  const company = unwrapItem(res, id);
8064
8070
  const current = typeof company.ownerResourceID === "number" ? company.ownerResourceID : null;
@@ -8068,7 +8074,8 @@ async function transferOwnership(_resource, companyIds, destinationResourceId, h
8068
8074
  method: "PUT",
8069
8075
  path: "/V1.0/Companies",
8070
8076
  body: { id, ownerResourceID: destination },
8071
- operation: "resources.transferOwnership"
8077
+ operation: "resources.transferOwnership",
8078
+ maxRetries: opts?.maxRetries
8072
8079
  });
8073
8080
  unwrapOperation(update);
8074
8081
  applied.push(id);
@@ -8218,7 +8225,7 @@ var ResourceTimeOffAdditionalResource = class extends BaseResource {
8218
8225
  async update(parentId, id, data, opts = {}) {
8219
8226
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
8220
8227
  await this.guardStaleBeforeMutation(id, opts, "resource_time_off_additional.update", parentId);
8221
- return this.updateScopedRaw(parentId, id, data);
8228
+ return this.updateScopedRaw(parentId, id, data, opts);
8222
8229
  }
8223
8230
  /** Resolve a ResourceTimeOffAdditional from a numeric id (or, where the vendor indexes a primary text field,
8224
8231
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8461,7 +8468,7 @@ var ServiceCallsResource = class extends BaseResource {
8461
8468
  async delete(id, opts = {}) {
8462
8469
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
8463
8470
  await this.guardStaleBeforeMutation(id, opts, "service_calls.delete");
8464
- return this.deleteGlobal(id);
8471
+ return this.deleteGlobal(id, opts);
8465
8472
  }
8466
8473
  /** Resolve a ServiceCall from a numeric id (or, where the vendor indexes a primary text field,
8467
8474
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8518,7 +8525,7 @@ var ServiceCallTaskResourcesResource = class extends BaseResource {
8518
8525
  async delete(parentId, id, opts = {}) {
8519
8526
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
8520
8527
  await this.guardStaleBeforeMutation(id, opts, "service_call_task_resources.delete", parentId);
8521
- return this.deleteScopedRaw(parentId, id);
8528
+ return this.deleteScopedRaw(parentId, id, opts);
8522
8529
  }
8523
8530
  /** Resolve a ServiceCallTaskResource from a numeric id (or, where the vendor indexes a primary text field,
8524
8531
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8575,7 +8582,7 @@ var ServiceCallTasksResource = class extends BaseResource {
8575
8582
  async delete(parentId, id, opts = {}) {
8576
8583
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
8577
8584
  await this.guardStaleBeforeMutation(id, opts, "service_call_tasks.delete", parentId);
8578
- return this.deleteScopedRaw(parentId, id);
8585
+ return this.deleteScopedRaw(parentId, id, opts);
8579
8586
  }
8580
8587
  /** Resolve a ServiceCallTask from a numeric id (or, where the vendor indexes a primary text field,
8581
8588
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8632,7 +8639,7 @@ var ServiceCallTicketResourcesResource = class extends BaseResource {
8632
8639
  async delete(parentId, id, opts = {}) {
8633
8640
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
8634
8641
  await this.guardStaleBeforeMutation(id, opts, "service_call_ticket_resources.delete", parentId);
8635
- return this.deleteScopedRaw(parentId, id);
8642
+ return this.deleteScopedRaw(parentId, id, opts);
8636
8643
  }
8637
8644
  /** Resolve a ServiceCallTicketResource from a numeric id (or, where the vendor indexes a primary text field,
8638
8645
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8689,7 +8696,7 @@ var ServiceCallTicketsResource = class extends BaseResource {
8689
8696
  async delete(parentId, id, opts = {}) {
8690
8697
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
8691
8698
  await this.guardStaleBeforeMutation(id, opts, "service_call_tickets.delete", parentId);
8692
- return this.deleteScopedRaw(parentId, id);
8699
+ return this.deleteScopedRaw(parentId, id, opts);
8693
8700
  }
8694
8701
  /** Resolve a ServiceCallTicket from a numeric id (or, where the vendor indexes a primary text field,
8695
8702
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -8948,7 +8955,7 @@ var SubscriptionsResource = class extends BaseResource {
8948
8955
  async delete(id, opts = {}) {
8949
8956
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
8950
8957
  await this.guardStaleBeforeMutation(id, opts, "subscriptions.delete");
8951
- return this.deleteGlobal(id);
8958
+ return this.deleteGlobal(id, opts);
8952
8959
  }
8953
8960
  /** Resolve a Subscription from a numeric id (or, where the vendor indexes a primary text field,
8954
8961
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9088,7 +9095,7 @@ var TagAliasesResource = class extends BaseResource {
9088
9095
  async delete(parentId, id, opts = {}) {
9089
9096
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9090
9097
  await this.guardStaleBeforeMutation(id, opts, "tag_aliases.delete", parentId);
9091
- return this.deleteScopedRaw(parentId, id);
9098
+ return this.deleteScopedRaw(parentId, id, opts);
9092
9099
  }
9093
9100
  /** Resolve a TagAlias from a numeric id (or, where the vendor indexes a primary text field,
9094
9101
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9157,7 +9164,7 @@ var TagGroupsResource = class extends BaseResource {
9157
9164
  async delete(id, opts = {}) {
9158
9165
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
9159
9166
  await this.guardStaleBeforeMutation(id, opts, "tag_groups.delete");
9160
- return this.deleteGlobal(id);
9167
+ return this.deleteGlobal(id, opts);
9161
9168
  }
9162
9169
  /** Resolve a TagGroup from a numeric id (or, where the vendor indexes a primary text field,
9163
9170
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9226,7 +9233,7 @@ var TagsResource = class extends BaseResource {
9226
9233
  async delete(id, opts = {}) {
9227
9234
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
9228
9235
  await this.guardStaleBeforeMutation(id, opts, "tags.delete");
9229
- return this.deleteGlobal(id);
9236
+ return this.deleteGlobal(id, opts);
9230
9237
  }
9231
9238
  /** Resolve a Tag from a numeric id (or, where the vendor indexes a primary text field,
9232
9239
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9283,7 +9290,7 @@ var TaskSecondaryResourcesResource = class extends BaseResource {
9283
9290
  async delete(parentId, id, opts = {}) {
9284
9291
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9285
9292
  await this.guardStaleBeforeMutation(id, opts, "task_secondary_resources.delete", parentId);
9286
- return this.deleteScopedRaw(parentId, id);
9293
+ return this.deleteScopedRaw(parentId, id, opts);
9287
9294
  }
9288
9295
  /** Resolve a TaskSecondaryResource from a numeric id (or, where the vendor indexes a primary text field,
9289
9296
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9343,7 +9350,7 @@ var TasksResource = class extends BaseResource {
9343
9350
  async update(parentId, id, data, opts = {}) {
9344
9351
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
9345
9352
  await this.guardStaleBeforeMutation(id, opts, "tasks.update", parentId);
9346
- return this.updateScopedRaw(parentId, id, data);
9353
+ return this.updateScopedRaw(parentId, id, data, opts);
9347
9354
  }
9348
9355
  /** Resolve a Task from a numeric id (or, where the vendor indexes a primary text field,
9349
9356
  * from an exact match on title). A numeric id miss throws NOT_FOUND; a complete
@@ -9428,7 +9435,7 @@ var TicketAdditionalConfigurationItemsResource = class extends BaseResource {
9428
9435
  async delete(parentId, id, opts = {}) {
9429
9436
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9430
9437
  await this.guardStaleBeforeMutation(id, opts, "ticket_additional_configuration_items.delete", parentId);
9431
- return this.deleteScopedRaw(parentId, id);
9438
+ return this.deleteScopedRaw(parentId, id, opts);
9432
9439
  }
9433
9440
  /** Resolve a TicketAdditionalConfigurationItem from a numeric id (or, where the vendor indexes a primary text field,
9434
9441
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9485,7 +9492,7 @@ var TicketAdditionalContactsResource = class extends BaseResource {
9485
9492
  async delete(parentId, id, opts = {}) {
9486
9493
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9487
9494
  await this.guardStaleBeforeMutation(id, opts, "ticket_additional_contacts.delete", parentId);
9488
- return this.deleteScopedRaw(parentId, id);
9495
+ return this.deleteScopedRaw(parentId, id, opts);
9489
9496
  }
9490
9497
  /** Resolve a TicketAdditionalContact from a numeric id (or, where the vendor indexes a primary text field,
9491
9498
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9543,7 +9550,7 @@ var TicketAttachmentsResource = class extends BaseResource {
9543
9550
  async delete(parentId, id, opts = {}) {
9544
9551
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9545
9552
  await this.guardStaleBeforeMutation(id, opts, "ticket_attachments.delete", parentId);
9546
- return this.deleteScopedModel(parentId, id);
9553
+ return this.deleteScopedModel(parentId, id, opts);
9547
9554
  }
9548
9555
  /** Download the attachment bytes (GET .../{id}/data; node-proven path, quirk #9) → Buffer. */
9549
9556
  async download(parentId, id) {
@@ -9705,7 +9712,7 @@ var TicketChangeRequestApprovalsResource = class extends BaseResource {
9705
9712
  async delete(parentId, id, opts = {}) {
9706
9713
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9707
9714
  await this.guardStaleBeforeMutation(id, opts, "ticket_change_request_approvals.delete", parentId);
9708
- return this.deleteScopedRaw(parentId, id);
9715
+ return this.deleteScopedRaw(parentId, id, opts);
9709
9716
  }
9710
9717
  /** Resolve a TicketChangeRequestApproval from a numeric id (or, where the vendor indexes a primary text field,
9711
9718
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9765,14 +9772,14 @@ var TicketChargesResource = class extends BaseResource {
9765
9772
  async update(parentId, id, data, opts = {}) {
9766
9773
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
9767
9774
  await this.guardStaleBeforeMutation(id, opts, "ticket_charges.update", parentId);
9768
- return this.updateScopedRaw(parentId, id, data);
9775
+ return this.updateScopedRaw(parentId, id, data, opts);
9769
9776
  }
9770
9777
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
9771
9778
  * envelope and never issues the delete. */
9772
9779
  async delete(parentId, id, opts = {}) {
9773
9780
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9774
9781
  await this.guardStaleBeforeMutation(id, opts, "ticket_charges.delete", parentId);
9775
- return this.deleteScopedRaw(parentId, id);
9782
+ return this.deleteScopedRaw(parentId, id, opts);
9776
9783
  }
9777
9784
  /** Resolve a TicketCharge from a numeric id (or, where the vendor indexes a primary text field,
9778
9785
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -9835,14 +9842,14 @@ var TicketChecklistItemsResource = class extends BaseResource {
9835
9842
  async update(parentId, id, data, opts = {}) {
9836
9843
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
9837
9844
  await this.guardStaleBeforeMutation(id, opts, "ticket_checklist_items.update", parentId);
9838
- return this.updateScopedRaw(parentId, id, data);
9845
+ return this.updateScopedRaw(parentId, id, data, opts);
9839
9846
  }
9840
9847
  /** Delete a record under the parent (OperationResultModel → { id}). `dryRun: true` returns the pinned
9841
9848
  * envelope and never issues the delete. */
9842
9849
  async delete(parentId, id, opts = {}) {
9843
9850
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
9844
9851
  await this.guardStaleBeforeMutation(id, opts, "ticket_checklist_items.delete", parentId);
9845
- return this.deleteScopedRaw(parentId, id);
9852
+ return this.deleteScopedRaw(parentId, id, opts);
9846
9853
  }
9847
9854
  /** Resolve a TicketChecklistItem from a numeric id (or, where the vendor indexes a primary text field,
9848
9855
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -9899,7 +9906,8 @@ var TicketChecklistLibrariesResource = class extends BaseResource {
9899
9906
  method: "POST",
9900
9907
  path: `/V1.0/Documents/${n}/ChecklistLibraries`,
9901
9908
  body: { ...data },
9902
- operation: "ticket_checklist_libraries.attachToDocument"
9909
+ operation: "ticket_checklist_libraries.attachToDocument",
9910
+ maxRetries: opts.maxRetries
9903
9911
  });
9904
9912
  return unwrapOperation(res);
9905
9913
  }
@@ -9998,7 +10006,7 @@ var TicketNoteAttachmentsResource = class extends BaseResource {
9998
10006
  async delete(parentId, id, opts = {}) {
9999
10007
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
10000
10008
  await this.guardStaleBeforeMutation(id, opts, "ticket_note_attachments.delete", parentId);
10001
- return this.deleteScopedModel(parentId, id);
10009
+ return this.deleteScopedModel(parentId, id, opts);
10002
10010
  }
10003
10011
  /** Download the attachment bytes (GET .../{id}/data; node-proven path, quirk #9) → Buffer. */
10004
10012
  async download(parentId, id) {
@@ -10061,7 +10069,7 @@ var TicketNotesResource = class extends BaseResource {
10061
10069
  async update(parentId, id, data, opts = {}) {
10062
10070
  if (opts.dryRun === true) return this.runUpdateDryRun(id, data, opts, parentId);
10063
10071
  await this.guardStaleBeforeMutation(id, opts, "ticket_notes.update", parentId);
10064
- return this.updateScopedRaw(parentId, id, data);
10072
+ return this.updateScopedRaw(parentId, id, data, opts);
10065
10073
  }
10066
10074
  /** Resolve a TicketNote from a numeric id (or, where the vendor indexes a primary text field,
10067
10075
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -10133,7 +10141,7 @@ var TicketNoteWebhooksResource = class extends BaseResource {
10133
10141
  async delete(id, opts = {}) {
10134
10142
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
10135
10143
  await this.guardStaleBeforeMutation(id, opts, "ticket_note_webhooks.delete");
10136
- return this.deleteGlobal(id);
10144
+ return this.deleteGlobal(id, opts);
10137
10145
  }
10138
10146
  /** Resolve a TicketNoteWebhook from a numeric id (or, where the vendor indexes a primary text field,
10139
10147
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -10194,7 +10202,7 @@ var TicketSecondaryResourcesResource = class extends BaseResource {
10194
10202
  async delete(parentId, id, opts = {}) {
10195
10203
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
10196
10204
  await this.guardStaleBeforeMutation(id, opts, "ticket_secondary_resources.delete", parentId);
10197
- return this.deleteScopedRaw(parentId, id);
10205
+ return this.deleteScopedRaw(parentId, id, opts);
10198
10206
  }
10199
10207
  /** Resolve a TicketSecondaryResource from a numeric id (or, where the vendor indexes a primary text field,
10200
10208
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -10491,12 +10499,12 @@ function namedVendorFields(err) {
10491
10499
  function vendorDetailOf(err) {
10492
10500
  return isAutotaskError(err) ? formatVendorDetail(err.vendorError) : void 0;
10493
10501
  }
10494
- async function fetchItem(http, path, operation) {
10495
- const res = await http.request({ method: "GET", path, operation });
10502
+ async function fetchItem(http, path, operation, readOpts) {
10503
+ const res = await http.request({ method: "GET", path, operation, maxRetries: readOpts?.maxRetries });
10496
10504
  return unwrapItemOrNull(res);
10497
10505
  }
10498
- async function fetchItemUnredacted(http, path, operation) {
10499
- const res = await http.request({ method: "GET", path, operation, skipResponseRedaction: true });
10506
+ async function fetchItemUnredacted(http, path, operation, readOpts) {
10507
+ const res = await http.request({ method: "GET", path, operation, skipResponseRedaction: true, maxRetries: readOpts?.maxRetries });
10500
10508
  return unwrapItemOrNull(res);
10501
10509
  }
10502
10510
  function unwrapItemOrNull(res) {
@@ -10599,7 +10607,7 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
10599
10607
  }
10600
10608
  if (assign !== void 0 && assignee !== void 0) {
10601
10609
  const rid = assignee;
10602
- const rec = await fetchItem(http, `/V1.0/Resources/${rid}`, OP_OPEN);
10610
+ const rec = await fetchItem(http, `/V1.0/Resources/${rid}`, OP_OPEN, { maxRetries: opts.maxRetries });
10603
10611
  if (rec === null) {
10604
10612
  throw new TicketResourceInvalidError(
10605
10613
  `openWithNoteAndAssign: assignee resource ${assignee} was not found (resources.get returned item: null \u2014 the resources table is blind to the API user; get is the authority)`,
@@ -10698,7 +10706,7 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
10698
10706
  let noteId = null;
10699
10707
  if (noteBody !== null) {
10700
10708
  try {
10701
- const res = await http.request({ method: "POST", path: `/V1.0/Tickets/${ticketId}/Notes`, body: noteBody, operation: OP_OPEN });
10709
+ const res = await http.request({ method: "POST", path: `/V1.0/Tickets/${ticketId}/Notes`, body: noteBody, operation: OP_OPEN, maxRetries: opts.maxRetries });
10702
10710
  noteId = operationId(res) ?? null;
10703
10711
  steps.push({ name: "note", ok: true });
10704
10712
  } catch (err) {
@@ -10709,14 +10717,14 @@ async function openWithNoteAndAssign(resource, params, note, assign, opts, http)
10709
10717
  let ticketNumber = null;
10710
10718
  if (assign !== void 0) {
10711
10719
  try {
10712
- const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_OPEN);
10720
+ const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_OPEN, { maxRetries: opts.maxRetries });
10713
10721
  if (current === null) {
10714
10722
  throw new NotFoundError(`openWithNoteAndAssign: ticket ${ticketId} vanished between the create and the assign merge read`, { operation: OP_OPEN, resourceIds: [ticketId] });
10715
10723
  }
10716
10724
  ticketNumber = typeof current.ticketNumber === "string" ? current.ticketNumber : null;
10717
10725
  const merged = mergePartialBody(current, { id: ticketId, assignedResourceID: assignee, assignedResourceRoleID: roleID });
10718
10726
  merged.id = ticketId;
10719
- await http.request({ method: "PUT", path: "/V1.0/Tickets", body: merged, operation: OP_OPEN });
10727
+ await http.request({ method: "PUT", path: "/V1.0/Tickets", body: merged, operation: OP_OPEN, maxRetries: opts.maxRetries });
10720
10728
  assigned = true;
10721
10729
  steps.push({ name: "assign", ok: true });
10722
10730
  } catch (err) {
@@ -10816,7 +10824,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
10816
10824
  if (fields !== void 0 && (typeof fields !== "object" || fields === null || Array.isArray(fields))) {
10817
10825
  throw new AutotaskConfigError("changeStatus: fields must be a plain object of ticket fields (or omitted)", { operation: OP_STATUS });
10818
10826
  }
10819
- const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS);
10827
+ const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS, { maxRetries: opts.maxRetries });
10820
10828
  if (current === null) {
10821
10829
  throw new NotFoundError(`changeStatus: ticket ${ticketId} was not found (tickets.get returned item: null)`, { operation: OP_STATUS, resourceIds: [ticketId] });
10822
10830
  }
@@ -10901,7 +10909,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
10901
10909
  let merges = 0;
10902
10910
  for (; ; ) {
10903
10911
  try {
10904
- await http.request({ method: "PUT", path: "/V1.0/Tickets", body, operation: OP_STATUS });
10912
+ await http.request({ method: "PUT", path: "/V1.0/Tickets", body, operation: OP_STATUS, maxRetries: opts.maxRetries });
10905
10913
  break;
10906
10914
  } catch (err) {
10907
10915
  const named = namedVendorFields(err);
@@ -10929,7 +10937,7 @@ async function changeStatus(resource, id, targetStatus, fields, opts, http) {
10929
10937
  throw err;
10930
10938
  }
10931
10939
  }
10932
- const verify = await fetchItem(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS);
10940
+ const verify = await fetchItem(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS, { maxRetries: opts.maxRetries });
10933
10941
  if (verify === null) {
10934
10942
  throw new AutotaskError(`changeStatus: the post-PUT read-back found no ticket ${ticketId} (the PUT 200ed but the record is gone)`, {
10935
10943
  code: "INVALID_RESPONSE",
@@ -11225,7 +11233,7 @@ var TicketWebhooksResource = class extends BaseResource {
11225
11233
  async delete(id, opts = {}) {
11226
11234
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
11227
11235
  await this.guardStaleBeforeMutation(id, opts, "ticket_webhooks.delete");
11228
- return this.deleteGlobal(id);
11236
+ return this.deleteGlobal(id, opts);
11229
11237
  }
11230
11238
  /** Resolve a TicketWebhook from a numeric id (or, where the vendor indexes a primary text field,
11231
11239
  * from an exact match on name). A numeric id miss throws NOT_FOUND; a complete
@@ -11663,7 +11671,7 @@ async function createForResource(resource, resourceID, params, opts = {}, http)
11663
11671
  for (let attempt = 1; attempt <= MAX_CREATE_ATTEMPTS; attempt += 1) {
11664
11672
  if (usedLinkage !== "internal") body.roleID = roleCandidates[Math.min(attempt, roleCandidates.length) - 1];
11665
11673
  try {
11666
- const created = await resource.create(body, {});
11674
+ const created = await resource.create(body, { maxRetries: opts.maxRetries });
11667
11675
  return {
11668
11676
  id: created.id,
11669
11677
  linkage: usedLinkage,
@@ -11766,7 +11774,7 @@ var TimeEntriesResource = class extends BaseResource {
11766
11774
  async delete(id, opts = {}) {
11767
11775
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts);
11768
11776
  await this.guardStaleBeforeMutation(id, opts, "time_entries.delete");
11769
- return this.deleteGlobal(id);
11777
+ return this.deleteGlobal(id, opts);
11770
11778
  }
11771
11779
  /** Resolve a TimeEntry from a numeric id (or, where the vendor indexes a primary text field,
11772
11780
  * from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
@@ -11892,7 +11900,7 @@ var TimeEntryAttachmentsResource = class extends BaseResource {
11892
11900
  async delete(parentId, id, opts = {}) {
11893
11901
  if (opts.dryRun === true) return this.runDeleteDryRun(id, opts, parentId);
11894
11902
  await this.guardStaleBeforeMutation(id, opts, "time_entry_attachments.delete", parentId);
11895
- return this.deleteScopedModel(parentId, id);
11903
+ return this.deleteScopedModel(parentId, id, opts);
11896
11904
  }
11897
11905
  /** Download the attachment bytes (GET .../{id}/data; node-proven path, quirk #9) → Buffer. */
11898
11906
  async download(parentId, id) {
@@ -11928,7 +11936,8 @@ async function approve(_resource, id, opts = {}, http) {
11928
11936
  const res = await http.request({
11929
11937
  method: "GET",
11930
11938
  path: `/V1.0/TimeOffRequests/${numericId}/Approve`,
11931
- operation: "time_off_requests.approve"
11939
+ operation: "time_off_requests.approve",
11940
+ maxRetries: opts.maxRetries
11932
11941
  });
11933
11942
  return unwrapOperation(res);
11934
11943
  }
@@ -11954,7 +11963,8 @@ async function reject(_resource, id, reason, opts = {}, http) {
11954
11963
  method: "POST",
11955
11964
  path: `/V1.0/TimeOffRequests/${numericId}/Reject`,
11956
11965
  body: { timeOffRequestID: numericId, reason: text },
11957
- operation: "time_off_requests.reject"
11966
+ operation: "time_off_requests.reject",
11967
+ maxRetries: opts.maxRetries
11958
11968
  });
11959
11969
  return unwrapOperation(res);
11960
11970
  }