node-autotask 0.76.0 → 0.78.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 (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/MCP_TOOL_CATALOG.json +265 -9
  3. package/README.md +1 -1
  4. package/capabilities.json +1224 -272
  5. package/dist/capabilities-data.js +1223 -271
  6. package/dist/capabilities.cjs +4 -4
  7. package/dist/capabilities.js +1 -1
  8. package/dist/{chunk-S7QPD6TR.js → chunk-3SYNF5QD.js} +2 -2
  9. package/dist/{chunk-C4S3EKIK.cjs → chunk-MVKI2AZX.cjs} +3 -3
  10. package/dist/{chunk-UFK7JYYC.js → chunk-S7BJNQ2X.js} +4 -2
  11. package/dist/{chunk-Y4BH5N6R.cjs → chunk-S7JH6K2Z.cjs} +331 -28
  12. package/dist/{chunk-YRTOAPWD.cjs → chunk-U7LVWEO4.cjs} +199 -199
  13. package/dist/{chunk-3SFIKG2R.js → chunk-XBT332X7.js} +326 -23
  14. package/dist/{chunk-ECSE6B3U.js → chunk-YH5UCY2X.js} +3 -3
  15. package/dist/{chunk-55BQEFBO.cjs → chunk-YONRIG6F.cjs} +32 -30
  16. package/dist/{index-BbAzrm2i.d.cts → index-BHqdOo_5.d.cts} +91 -1
  17. package/dist/{index-BbAzrm2i.d.ts → index-BHqdOo_5.d.ts} +91 -1
  18. package/dist/{index-MY7qYY5d.d.cts → index-DfcdtQO0.d.cts} +4 -2
  19. package/dist/{index-CY7exGOe.d.ts → index-ci3TSJrT.d.ts} +4 -2
  20. package/dist/index.cjs +84 -84
  21. package/dist/index.d.cts +3 -3
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +5 -5
  24. package/dist/operations/index.cjs +51 -51
  25. package/dist/operations/index.d.cts +4 -4
  26. package/dist/operations/index.d.ts +4 -4
  27. package/dist/operations/index.js +2 -2
  28. package/dist/pool.cjs +12 -12
  29. package/dist/pool.d.cts +1 -1
  30. package/dist/pool.d.ts +1 -1
  31. package/dist/pool.js +4 -4
  32. package/dist/resources/index.cjs +27 -27
  33. package/dist/resources/index.d.cts +2 -2
  34. package/dist/resources/index.d.ts +2 -2
  35. package/dist/resources/index.js +3 -3
  36. package/dist/types/index.d.cts +1 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/docs/API.md +4 -2
  39. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { loadCapabilityRecords } from './chunk-ECSE6B3U.js';
1
+ import { loadCapabilityRecords } from './chunk-YH5UCY2X.js';
2
2
  import { NoopLogger, REDACTED, deepMarkUntrusted, wrapUntrusted } from './chunk-7NKB4UXV.js';
3
3
  import { randomUUID, createHash } from 'crypto';
4
4
  import { AsyncLocalStorage } from 'async_hooks';
@@ -3023,7 +3023,24 @@ var RELATIONSHIP_MAP = {
3023
3023
  "segment": "Notes",
3024
3024
  "field": "configurationItemID"
3025
3025
  },
3026
- "children": [],
3026
+ "children": [
3027
+ {
3028
+ "resource": "configuration_item_note_attachments",
3029
+ "apiEntity": "ConfigurationItemNoteAttachment",
3030
+ "parentField": "configurationItemNoteID",
3031
+ "parentSegment": "Attachments",
3032
+ "tier": "extended",
3033
+ "workflowResource": false,
3034
+ "specialOps": [],
3035
+ "searchCovers": null,
3036
+ "scopedOps": {
3037
+ "create": true,
3038
+ "query": true,
3039
+ "update": false,
3040
+ "delete": true
3041
+ }
3042
+ }
3043
+ ],
3027
3044
  "naturalKeys": {
3028
3045
  "hasSearch": false,
3029
3046
  "searchCovers": null,
@@ -3247,6 +3264,22 @@ var RELATIONSHIP_MAP = {
3247
3264
  "group": "A",
3248
3265
  "parent": null,
3249
3266
  "children": [
3267
+ {
3268
+ "resource": "configuration_item_attachments",
3269
+ "apiEntity": "ConfigurationItemAttachment",
3270
+ "parentField": "configurationItemID",
3271
+ "parentSegment": "Attachments",
3272
+ "tier": "extended",
3273
+ "workflowResource": false,
3274
+ "specialOps": [],
3275
+ "searchCovers": null,
3276
+ "scopedOps": {
3277
+ "create": true,
3278
+ "query": true,
3279
+ "update": false,
3280
+ "delete": true
3281
+ }
3282
+ },
3250
3283
  {
3251
3284
  "resource": "configuration_item_billing_product_associations",
3252
3285
  "apiEntity": "ConfigurationItemBillingProductAssociations",
@@ -9987,6 +10020,139 @@ var RELATIONSHIP_MAP = {
9987
10020
  },
9988
10021
  "deleteBoundary": null,
9989
10022
  "markerField": null
10023
+ },
10024
+ "configuration_item_attachments": {
10025
+ "resource": "configuration_item_attachments",
10026
+ "apiEntity": "ConfigurationItemAttachment",
10027
+ "kind": "entity",
10028
+ "path": "ConfigurationItemAttachments",
10029
+ "parentScoped": true,
10030
+ "tier": "extended",
10031
+ "workflowResource": false,
10032
+ "group": "A",
10033
+ "parent": {
10034
+ "resource": "configuration_items",
10035
+ "segment": "Attachments",
10036
+ "field": "configurationItemID"
10037
+ },
10038
+ "children": [],
10039
+ "naturalKeys": {
10040
+ "hasSearch": false,
10041
+ "searchCovers": null,
10042
+ "findBy": []
10043
+ },
10044
+ "blindSurfaces": null,
10045
+ "zoneFacts": {
10046
+ "createGuidance": {
10047
+ "createOp": "configuration_item_attachments.create",
10048
+ "parentScoped": true,
10049
+ "liveProvenPrefix": [],
10050
+ "unproven": true,
10051
+ "blocker": {
10052
+ "kind": "unknown",
10053
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
10054
+ "remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
10055
+ "requires": {
10056
+ "allOf": [
10057
+ "attachmentType",
10058
+ "fullPath",
10059
+ "title",
10060
+ "publish",
10061
+ "data"
10062
+ ]
10063
+ }
10064
+ },
10065
+ "requiresByValue": [
10066
+ {
10067
+ "field": "attachmentType",
10068
+ "value": "FILE_ATTACHMENT",
10069
+ "requires": {
10070
+ "allOf": [
10071
+ "data"
10072
+ ]
10073
+ }
10074
+ }
10075
+ ],
10076
+ "vendorEvidence": [
10077
+ "Official ConfigurationItemAttachmentsEntity.htm and REST_Attachments.htm: required file creation inputs; ConfigurationItems parent; separate read-only configurationItemNoteID; no update or UDF metadata. Static contract only; no live create."
10078
+ ],
10079
+ "deleteBoundary": {
10080
+ "available": true,
10081
+ "note": null
10082
+ },
10083
+ "parentCompany": {
10084
+ "via": "configurationItemID",
10085
+ "resource": "configuration_items",
10086
+ "field": "companyID"
10087
+ }
10088
+ }
10089
+ },
10090
+ "deleteBoundary": null,
10091
+ "markerField": null
10092
+ },
10093
+ "configuration_item_note_attachments": {
10094
+ "resource": "configuration_item_note_attachments",
10095
+ "apiEntity": "ConfigurationItemNoteAttachment",
10096
+ "kind": "entity",
10097
+ "path": "ConfigurationItemNoteAttachments",
10098
+ "parentScoped": true,
10099
+ "tier": "extended",
10100
+ "workflowResource": false,
10101
+ "group": "A",
10102
+ "parent": {
10103
+ "resource": "configuration_item_notes",
10104
+ "segment": "Attachments",
10105
+ "field": "configurationItemNoteID"
10106
+ },
10107
+ "children": [],
10108
+ "naturalKeys": {
10109
+ "hasSearch": false,
10110
+ "searchCovers": null,
10111
+ "findBy": []
10112
+ },
10113
+ "blindSurfaces": null,
10114
+ "zoneFacts": {
10115
+ "createGuidance": {
10116
+ "createOp": "configuration_item_note_attachments.create",
10117
+ "parentScoped": true,
10118
+ "liveProvenPrefix": [],
10119
+ "unproven": true,
10120
+ "blocker": {
10121
+ "kind": "unknown",
10122
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
10123
+ "remedy": "Read current field and picklist metadata, supply the configuration-item note id, and preview the attachment before applying.",
10124
+ "requires": {
10125
+ "allOf": [
10126
+ "attachmentType",
10127
+ "fullPath",
10128
+ "title",
10129
+ "publish",
10130
+ "data"
10131
+ ]
10132
+ }
10133
+ },
10134
+ "requiresByValue": [
10135
+ {
10136
+ "field": "attachmentType",
10137
+ "value": "FILE_ATTACHMENT",
10138
+ "requires": {
10139
+ "allOf": [
10140
+ "data"
10141
+ ]
10142
+ }
10143
+ }
10144
+ ],
10145
+ "vendorEvidence": [
10146
+ "Official ConfigurationItemNoteAttachmentsEntity.htm and REST_Attachments.htm: ConfigurationItemNotes is the parent, configurationItemID identifies the asset, and file creation requires title, fullPath, attachmentType, publish and base64 data. Static contract, with live create unproven."
10147
+ ],
10148
+ "deleteBoundary": {
10149
+ "available": true,
10150
+ "note": null
10151
+ }
10152
+ }
10153
+ },
10154
+ "deleteBoundary": null,
10155
+ "markerField": null
9990
10156
  }
9991
10157
  };
9992
10158
  var BLIND_SURFACE_STAMPS = {
@@ -11825,6 +11991,50 @@ var CREATE_GUIDANCE = {
11825
11991
  "note": null
11826
11992
  }
11827
11993
  },
11994
+ {
11995
+ "resource": "configuration_item_attachments",
11996
+ "createOp": "configuration_item_attachments.create",
11997
+ "parentScoped": true,
11998
+ "liveProvenPrefix": [],
11999
+ "unproven": true,
12000
+ "blocker": {
12001
+ "kind": "unknown",
12002
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
12003
+ "remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
12004
+ "requires": {
12005
+ "allOf": [
12006
+ "attachmentType",
12007
+ "fullPath",
12008
+ "title",
12009
+ "publish",
12010
+ "data"
12011
+ ]
12012
+ }
12013
+ },
12014
+ "vendorEvidence": [
12015
+ "Official ConfigurationItemAttachmentsEntity.htm and REST_Attachments.htm: required file creation inputs; ConfigurationItems parent; separate read-only configurationItemNoteID; no update or UDF metadata. Static contract only; no live create."
12016
+ ],
12017
+ "deleteBoundary": {
12018
+ "available": true,
12019
+ "note": null
12020
+ },
12021
+ "requiresByValue": [
12022
+ {
12023
+ "field": "attachmentType",
12024
+ "value": "FILE_ATTACHMENT",
12025
+ "requires": {
12026
+ "allOf": [
12027
+ "data"
12028
+ ]
12029
+ }
12030
+ }
12031
+ ],
12032
+ "parentCompany": {
12033
+ "via": "configurationItemID",
12034
+ "resource": "configuration_items",
12035
+ "field": "companyID"
12036
+ }
12037
+ },
11828
12038
  {
11829
12039
  "resource": "configuration_item_billing_product_associations",
11830
12040
  "createOp": "configuration_item_billing_product_associations.create",
@@ -11893,6 +12103,45 @@ var CREATE_GUIDANCE = {
11893
12103
  "note": null
11894
12104
  }
11895
12105
  },
12106
+ {
12107
+ "resource": "configuration_item_note_attachments",
12108
+ "createOp": "configuration_item_note_attachments.create",
12109
+ "parentScoped": true,
12110
+ "liveProvenPrefix": [],
12111
+ "unproven": true,
12112
+ "blocker": {
12113
+ "kind": "unknown",
12114
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
12115
+ "remedy": "Read current field and picklist metadata, supply the configuration-item note id, and preview the attachment before applying.",
12116
+ "requires": {
12117
+ "allOf": [
12118
+ "attachmentType",
12119
+ "fullPath",
12120
+ "title",
12121
+ "publish",
12122
+ "data"
12123
+ ]
12124
+ }
12125
+ },
12126
+ "vendorEvidence": [
12127
+ "Official ConfigurationItemNoteAttachmentsEntity.htm and REST_Attachments.htm: ConfigurationItemNotes is the parent, configurationItemID identifies the asset, and file creation requires title, fullPath, attachmentType, publish and base64 data. Static contract, with live create unproven."
12128
+ ],
12129
+ "deleteBoundary": {
12130
+ "available": true,
12131
+ "note": null
12132
+ },
12133
+ "requiresByValue": [
12134
+ {
12135
+ "field": "attachmentType",
12136
+ "value": "FILE_ATTACHMENT",
12137
+ "requires": {
12138
+ "allOf": [
12139
+ "data"
12140
+ ]
12141
+ }
12142
+ }
12143
+ ]
12144
+ },
11896
12145
  {
11897
12146
  "resource": "configuration_item_notes",
11898
12147
  "createOp": "configuration_item_notes.create",
@@ -14208,7 +14457,7 @@ var CREATE_GUIDANCE = {
14208
14457
  }
14209
14458
  ],
14210
14459
  "counts": {
14211
- "total": 106,
14460
+ "total": 108,
14212
14461
  "byKind": {
14213
14462
  "ok": 41,
14214
14463
  "blind-reference": 16,
@@ -14218,7 +14467,7 @@ var CREATE_GUIDANCE = {
14218
14467
  "resource-role-pair": 2,
14219
14468
  "delete-absent": 0,
14220
14469
  "non-mutable": 0,
14221
- "unknown": 30
14470
+ "unknown": 32
14222
14471
  }
14223
14472
  }
14224
14473
  };
@@ -14954,6 +15203,12 @@ var UNTRUSTED_FIELDS_BY_RESOURCE = {
14954
15203
  ],
14955
15204
  "task_note_attachments": [
14956
15205
  "title"
15206
+ ],
15207
+ "configuration_item_attachments": [
15208
+ "title"
15209
+ ],
15210
+ "configuration_item_note_attachments": [
15211
+ "title"
14957
15212
  ]
14958
15213
  };
14959
15214
 
@@ -17958,10 +18213,12 @@ var MODEL_FIELD_SETS = {
17958
18213
  "company_notes": ["id", "actionType", "assignedResourceID", "companyID", "completedDateTime", "contactID", "createDateTime", "endDateTime", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastModifiedDate", "name", "note", "opportunityID", "startDateTime", "soapParentPropertyId"],
17959
18214
  "company_site_configurations": ["id", "companyID", "locationName", "soapParentPropertyId", "userDefinedFields"],
17960
18215
  "company_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
18216
+ "configuration_item_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "configurationItemID", "configurationItemNoteID", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentAttachmentID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
17961
18217
  "configuration_item_billing_product_associations": ["id", "billingProductID", "configurationItemID", "effectiveDate", "expirationDate", "soapParentPropertyId"],
17962
18218
  "configuration_item_categories": ["id", "displayColorRGB", "isActive", "isClientPortalDefault", "isGlobalDefault", "name", "nickname"],
17963
18219
  "configuration_item_category_udf_associations": ["id", "configurationItemCategoryID", "isRequired", "userDefinedFieldDefinitionID", "soapParentPropertyId"],
17964
18220
  "configuration_item_dns_records": ["id", "createDateTime", "data", "installedProductID", "timeToLiveSeconds", "dnsType", "soapParentPropertyId"],
18221
+ "configuration_item_note_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "configurationItemID", "configurationItemNoteID", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
17965
18222
  "configuration_item_notes": ["id", "configurationItemID", "createDateTime", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "noteType", "title", "soapParentPropertyId"],
17966
18223
  "configuration_item_related_items": ["id", "configurationItemID", "relatedConfigurationItemID", "relationship", "soapParentPropertyId"],
17967
18224
  "configuration_item_ssl_subject_alternative_names": ["id", "configurationItemID", "name", "soapParentPropertyId"],
@@ -18085,8 +18342,10 @@ var MODEL_DATE_FIELDS = {
18085
18342
  "company_attachments": ["attachDate"],
18086
18343
  "company_note_attachments": ["attachDate"],
18087
18344
  "company_notes": ["completedDateTime", "createDateTime", "endDateTime", "lastModifiedDate", "startDateTime"],
18345
+ "configuration_item_attachments": ["attachDate"],
18088
18346
  "configuration_item_billing_product_associations": ["effectiveDate", "expirationDate"],
18089
18347
  "configuration_item_dns_records": ["createDateTime"],
18348
+ "configuration_item_note_attachments": ["attachDate"],
18090
18349
  "configuration_item_notes": ["createDateTime", "lastActivityDate"],
18091
18350
  "configuration_items": ["createDate", "dattoLastCheckInDateTime", "domainRegistrationDateTime", "domainLastUpdatedDateTime", "domainExpirationDateTime", "installDate", "lastModifiedTime", "sslValidFromDateTime", "sslValidUntilDateTime", "warrantyExpirationDate"],
18092
18351
  "contacts": ["bulkEmailOptOutTime", "createDate", "lastActivityDate", "lastModifiedDate", "solicitationOptOutTime"],
@@ -20483,10 +20742,19 @@ async function findUnknownFieldNames(record, holder, lists) {
20483
20742
  return { known: resolved.known, authority: resolved.authority, unknown };
20484
20743
  }
20485
20744
 
20486
- // src/resources/special/taskAttachments.ts
20745
+ // src/resources/special/scopedAttachments.ts
20487
20746
  var WRITABLE2 = /* @__PURE__ */ new Set(["attachmentType", "contentType", "data", "fullPath", "parentAttachmentID", "publish", "taskID", "title"]);
20488
- var NOTE_WRITABLE = /* @__PURE__ */ new Set(["attachmentType", "data", "fullPath", "publish", "title", "attachedByContactID"]);
20747
+ var FILE_WRITABLE = /* @__PURE__ */ new Set(["attachmentType", "data", "fullPath", "publish", "title"]);
20489
20748
  var NON_QUERYABLE = /* @__PURE__ */ new Set(["creatortype", "data", "filesize"]);
20749
+ var SCOPED_ATTACHMENT_PARENTS = {
20750
+ task_attachments: { field: "taskID", name: "task" },
20751
+ task_note_attachments: { field: "taskNoteID", name: "task note" },
20752
+ configuration_item_attachments: { field: "configurationItemID", name: "configuration item" },
20753
+ configuration_item_note_attachments: { field: "configurationItemNoteID", name: "configuration item note" }
20754
+ };
20755
+ function isScopedAttachmentResource(resource) {
20756
+ return Object.hasOwn(SCOPED_ATTACHMENT_PARENTS, resource);
20757
+ }
20490
20758
  function isBase64(value) {
20491
20759
  return value.length % 4 === 0 && /^[A-Za-z0-9+/]+={0,2}$/.test(value);
20492
20760
  }
@@ -20518,32 +20786,37 @@ function admitTaskAttachment(data, parentId) {
20518
20786
  parseIdentifier(body.parentAttachmentID, "parentAttachmentID");
20519
20787
  }
20520
20788
  }
20521
- function admitTaskNoteAttachment(data, parentId) {
20789
+ function admitFileAttachment(resource, data, parentId) {
20522
20790
  parseIdentifier(parentId, "parentId");
20523
20791
  const fail2 = (message) => {
20524
- throw new AutotaskConfigError(`task_note_attachments: ${message}`);
20792
+ throw new AutotaskConfigError(`${resource}: ${message}`);
20525
20793
  };
20526
20794
  if (data === null || typeof data !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(data))) fail2("data must be a plain record");
20527
20795
  const body = data;
20528
- for (const field of Object.keys(body)) if (!NOTE_WRITABLE.has(field)) fail2(`${field} is not a supported create field`);
20796
+ const reference = {
20797
+ task_note_attachments: "attachedByContactID",
20798
+ configuration_item_attachments: "parentAttachmentID",
20799
+ configuration_item_note_attachments: void 0
20800
+ }[resource];
20801
+ for (const field of Object.keys(body)) if (!FILE_WRITABLE.has(field) && field !== reference) fail2(`${field} is not a supported create field`);
20529
20802
  if (body.attachmentType !== "FILE_ATTACHMENT") fail2("attachmentType must explicitly be FILE_ATTACHMENT; other attachment types are unsupported");
20530
20803
  for (const field of ["fullPath", "title"]) {
20531
20804
  if (typeof body[field] !== "string" || body[field].trim() === "" || body[field].length > 255) fail2(`${field} is required and must be a nonblank string of at most 255 characters`);
20532
20805
  }
20533
20806
  if (typeof body.publish !== "number" || !Number.isSafeInteger(body.publish)) fail2("publish must be an integer from current field metadata");
20534
20807
  if (typeof body.data !== "string" || !isBase64(body.data)) fail2("FILE_ATTACHMENT requires nonempty base64 data");
20535
- if (body.attachedByContactID !== void 0) {
20536
- if (typeof body.attachedByContactID !== "number") fail2("attachedByContactID must be a numeric identifier");
20537
- if (parseIdentifier(body.attachedByContactID, "attachedByContactID") === 0) fail2("attachedByContactID must be positive");
20808
+ if (reference !== void 0 && body[reference] !== void 0) {
20809
+ if (typeof body[reference] !== "number") fail2(`${reference} must be a numeric identifier`);
20810
+ if (parseIdentifier(body[reference], reference) === 0) fail2(`${reference} must be positive`);
20538
20811
  }
20539
20812
  }
20540
- function admitTaskAttachmentQuery(resource, params) {
20813
+ function admitScopedAttachmentQuery(resource, params) {
20541
20814
  const fields = collectFilterFieldNames(normalizedConditions(params?.filter) ?? [], resource);
20542
20815
  for (const field of fields) {
20543
20816
  if (NON_QUERYABLE.has(field.toLowerCase())) throw new AutotaskConfigError(`${resource}: ${field} is not queryable`);
20544
20817
  }
20545
20818
  }
20546
- function assertTaskAttachmentIdentity(resource, model, parentId, id) {
20819
+ function assertScopedAttachmentIdentity(resource, model, parentId, id) {
20547
20820
  const matches = (value, expected) => {
20548
20821
  try {
20549
20822
  return parseIdentifier(value) === parseIdentifier(expected);
@@ -20551,9 +20824,8 @@ function assertTaskAttachmentIdentity(resource, model, parentId, id) {
20551
20824
  return false;
20552
20825
  }
20553
20826
  };
20554
- const parentField = resource === "task_attachments" ? "taskID" : "taskNoteID";
20827
+ const { field: parentField, name: parentName } = SCOPED_ATTACHMENT_PARENTS[resource];
20555
20828
  if (!isRecord2(model) || !matches(model.id, id) || model[parentField] != null && !matches(model[parentField], parentId)) {
20556
- const parentName = resource === "task_attachments" ? "task" : "task note";
20557
20829
  throw new AutotaskError(`Returned attachment identifiers contradict the requested ${parentName} or attachment`, {
20558
20830
  code: "INVALID_RESPONSE",
20559
20831
  category: "server",
@@ -20761,6 +21033,20 @@ var SIMPLE_RESOURCES = [
20761
21033
  helpers: { search: true, resolve: true, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
20762
21034
  opForms: { get: "global", create: "global", update: "global", delete: "global" }
20763
21035
  },
21036
+ {
21037
+ key: "configuration_item_attachments",
21038
+ accessor: "configurationItemAttachments",
21039
+ resourcePath: "/V1.0/ConfigurationItemAttachments",
21040
+ parentScopedPath: "/V1.0/ConfigurationItems/{parentId}/Attachments",
21041
+ parentPath: "/V1.0/ConfigurationItems",
21042
+ parentField: "configurationItemID",
21043
+ deletable: true,
21044
+ udfCapable: false,
21045
+ attachmentGet: true,
21046
+ ops: { query: true, queryAll: false, count: true, get: true, create: true, update: false, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: false, download: false },
21047
+ helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
21048
+ opForms: { get: "scoped", create: "scoped", delete: "scoped" }
21049
+ },
20764
21050
  {
20765
21051
  key: "configuration_item_billing_product_associations",
20766
21052
  accessor: "configurationItemBillingProductAssociations",
@@ -20812,6 +21098,20 @@ var SIMPLE_RESOURCES = [
20812
21098
  helpers: { search: false, resolve: true, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
20813
21099
  opForms: { get: "scoped", delete: "scoped" }
20814
21100
  },
21101
+ {
21102
+ key: "configuration_item_note_attachments",
21103
+ accessor: "configurationItemNoteAttachments",
21104
+ resourcePath: "/V1.0/ConfigurationItemNoteAttachments",
21105
+ parentScopedPath: "/V1.0/ConfigurationItemNotes/{parentId}/Attachments",
21106
+ parentPath: "/V1.0/ConfigurationItemNotes",
21107
+ parentField: "configurationItemNoteID",
21108
+ deletable: true,
21109
+ udfCapable: false,
21110
+ attachmentGet: true,
21111
+ ops: { query: true, queryAll: false, count: true, get: true, create: true, update: false, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: false, download: false },
21112
+ helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
21113
+ opForms: { get: "scoped", create: "scoped", delete: "scoped" }
21114
+ },
20815
21115
  {
20816
21116
  key: "configuration_item_notes",
20817
21117
  accessor: "configurationItemNotes",
@@ -22109,10 +22409,10 @@ var SIMPLE_RESOURCES = [
22109
22409
  var GenericResource = class extends BaseResource {
22110
22410
  constructor(http, config, pageSize) {
22111
22411
  super(http, config, pageSize);
22112
- if (["company_attachments", "company_note_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
22412
+ if (["company_attachments", "company_note_attachments", "configuration_item_attachments", "configuration_item_note_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
22113
22413
  throw new OperationNotSupportedError(config.key, "getUdfInfo");
22114
22414
  };
22115
- if (config.ops?.create === false || ["company_attachments", "task_attachments", "task_note_attachments", "task_predecessors"].includes(config.key)) this.createIfNotExists = async () => {
22415
+ if (config.ops?.create === false || isScopedAttachmentResource(config.key) || ["company_attachments", "task_predecessors"].includes(config.key)) this.createIfNotExists = async () => {
22116
22416
  throw new OperationNotSupportedError(config.key, "createIfNotExists");
22117
22417
  };
22118
22418
  if (config.key === "task_notes") {
@@ -22145,17 +22445,17 @@ var GenericResource = class extends BaseResource {
22145
22445
  async getScopedModel(parentId, id, fresh = false) {
22146
22446
  const model = await super.getScopedModel(parentId, id, fresh);
22147
22447
  const key = this.config.key;
22148
- if (key === "task_attachments" || key === "task_note_attachments") assertTaskAttachmentIdentity(key, model, parentId, id);
22448
+ if (isScopedAttachmentResource(key)) assertScopedAttachmentIdentity(key, model, parentId, id);
22149
22449
  return model;
22150
22450
  }
22151
22451
  async fetchPage(params, page, pageSize, state2) {
22152
22452
  const key = this.config.key;
22153
- if (key === "task_attachments" || key === "task_note_attachments") admitTaskAttachmentQuery(key, params);
22453
+ if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
22154
22454
  return super.fetchPage(params, page, pageSize, state2);
22155
22455
  }
22156
22456
  async countGlobal(params) {
22157
22457
  const key = this.config.key;
22158
- if (key === "task_attachments" || key === "task_note_attachments") admitTaskAttachmentQuery(key, params);
22458
+ if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
22159
22459
  return super.countGlobal(params);
22160
22460
  }
22161
22461
  /** Query records with the G3 filter surface (server-side JSON filter). */
@@ -22197,8 +22497,11 @@ var GenericResource = class extends BaseResource {
22197
22497
  const data2 = this.config.key === "task_predecessors" ? admitTaskPredecessor(b, parentId, true) : b;
22198
22498
  const opts2 = this.config.key === "task_predecessors" ? { ...c } : c ?? {};
22199
22499
  if (this.config.key === "task_notes") admitTaskNote(data2, parentId, true);
22200
- if (this.config.key === "task_attachments") admitTaskAttachment(data2, parentId);
22201
- if (this.config.key === "task_note_attachments") admitTaskNoteAttachment(data2, parentId);
22500
+ const key = this.config.key;
22501
+ if (isScopedAttachmentResource(key)) {
22502
+ if (key === "task_attachments") admitTaskAttachment(data2, parentId);
22503
+ else admitFileAttachment(key, data2, parentId);
22504
+ }
22202
22505
  if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, void 0, data2);
22203
22506
  if (opts2.dryRun === true) return this.runCreateDryRun(data2, parentId);
22204
22507
  return this.createScopedRaw(parentId, data2, opts2);
@@ -1,8 +1,8 @@
1
1
  // src/capabilities.ts
2
2
  var CAPABILITY_PLAN_HASHES = {
3
- "B": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4",
4
- "A": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4",
5
- "operations": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4"
3
+ "B": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2",
4
+ "A": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2",
5
+ "operations": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2"
6
6
  };
7
7
  var cached = null;
8
8
  function loadCapabilities() {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkYRTOAPWD_cjs = require('./chunk-YRTOAPWD.cjs');
4
- var chunkY4BH5N6R_cjs = require('./chunk-Y4BH5N6R.cjs');
3
+ var chunkU7LVWEO4_cjs = require('./chunk-U7LVWEO4.cjs');
4
+ var chunkS7JH6K2Z_cjs = require('./chunk-S7JH6K2Z.cjs');
5
5
 
6
6
  // src/client.ts
7
7
  var AutotaskClient = class {
@@ -28,10 +28,12 @@ var AutotaskClient = class {
28
28
  companyNotes;
29
29
  companySiteConfigurations;
30
30
  companyWebhooks;
31
+ configurationItemAttachments;
31
32
  configurationItemBillingProductAssociations;
32
33
  configurationItemCategories;
33
34
  configurationItemCategoryUdfAssociations;
34
35
  configurationItemDnsRecords;
36
+ configurationItemNoteAttachments;
35
37
  configurationItemNotes;
36
38
  configurationItemRelatedItems;
37
39
  configurationItems;
@@ -161,34 +163,34 @@ var AutotaskClient = class {
161
163
  * anything is wired. Construction issues NO request.
162
164
  */
163
165
  constructor(options) {
164
- this.config = chunkY4BH5N6R_cjs.resolveConfig(options);
165
- this.http = new chunkY4BH5N6R_cjs.HttpClient(this.config);
166
+ this.config = chunkS7JH6K2Z_cjs.resolveConfig(options);
167
+ this.http = new chunkS7JH6K2Z_cjs.HttpClient(this.config);
166
168
  this.http.client = this;
167
- for (const entry of chunkY4BH5N6R_cjs.SIMPLE_RESOURCES) {
168
- this[entry.accessor] = new chunkY4BH5N6R_cjs.GenericResource(this.http, entry, this.config.pageSize);
169
+ for (const entry of chunkS7JH6K2Z_cjs.SIMPLE_RESOURCES) {
170
+ this[entry.accessor] = new chunkS7JH6K2Z_cjs.GenericResource(this.http, entry, this.config.pageSize);
169
171
  }
170
- this.companies = new chunkY4BH5N6R_cjs.CompaniesResource(this.http, this.config.pageSize);
171
- this.configurationItems = new chunkYRTOAPWD_cjs.ConfigurationItemsResource(this.http, this.config.pageSize);
172
- this.contacts = new chunkYRTOAPWD_cjs.ContactsResource(this.http, this.config.pageSize);
173
- this.contracts = new chunkY4BH5N6R_cjs.ContractsResource(this.http, this.config.pageSize);
174
- this.inventoryProducts = new chunkYRTOAPWD_cjs.InventoryProductsResource(this.http, this.config.pageSize);
175
- this.invoices = new chunkY4BH5N6R_cjs.InvoicesResource(this.http, this.config.pageSize);
176
- this.quotes = new chunkYRTOAPWD_cjs.QuotesResource(this.http, this.config.pageSize);
177
- this.resourceTimeOffAdditional = new chunkYRTOAPWD_cjs.ResourceTimeOffAdditionalResource(this.http, this.config.pageSize);
178
- this.resourceTimeOffBalances = new chunkYRTOAPWD_cjs.ResourceTimeOffBalancesResource(this.http, this.config.pageSize);
179
- this.resources = new chunkYRTOAPWD_cjs.ResourcesResource(this.http, this.config, this.config.pageSize);
180
- this.serviceCalls = new chunkYRTOAPWD_cjs.ServiceCallsResource(this.http, this.config.pageSize);
181
- this.ticketCharges = new chunkYRTOAPWD_cjs.TicketChargesResource(this.http, this.config.pageSize);
182
- this.tickets = new chunkYRTOAPWD_cjs.TicketsResource(this.http, this.config.pageSize);
183
- this.timeEntries = new chunkY4BH5N6R_cjs.TimeEntriesResource(this.http, this.config.pageSize);
184
- this.timeOffRequests = new chunkYRTOAPWD_cjs.TimeOffRequestsResource(this.http, this.config.pageSize);
185
- this.authenticateResource = new chunkYRTOAPWD_cjs.AuthenticateResource(this.http);
186
- this.entityInformation = new chunkYRTOAPWD_cjs.EntityInformationResource(this.http);
187
- this.modules = new chunkYRTOAPWD_cjs.ModulesResource(this.http);
188
- this.thresholdInformation = new chunkYRTOAPWD_cjs.ThresholdInformationResource(this.http);
189
- this.version = new chunkYRTOAPWD_cjs.VersionResource(this.http);
190
- this.versionInformation = new chunkYRTOAPWD_cjs.VersionInformationResource(this.http);
191
- this.zoneInformation = new chunkYRTOAPWD_cjs.ZoneInformationResource(this.http);
172
+ this.companies = new chunkS7JH6K2Z_cjs.CompaniesResource(this.http, this.config.pageSize);
173
+ this.configurationItems = new chunkU7LVWEO4_cjs.ConfigurationItemsResource(this.http, this.config.pageSize);
174
+ this.contacts = new chunkU7LVWEO4_cjs.ContactsResource(this.http, this.config.pageSize);
175
+ this.contracts = new chunkS7JH6K2Z_cjs.ContractsResource(this.http, this.config.pageSize);
176
+ this.inventoryProducts = new chunkU7LVWEO4_cjs.InventoryProductsResource(this.http, this.config.pageSize);
177
+ this.invoices = new chunkS7JH6K2Z_cjs.InvoicesResource(this.http, this.config.pageSize);
178
+ this.quotes = new chunkU7LVWEO4_cjs.QuotesResource(this.http, this.config.pageSize);
179
+ this.resourceTimeOffAdditional = new chunkU7LVWEO4_cjs.ResourceTimeOffAdditionalResource(this.http, this.config.pageSize);
180
+ this.resourceTimeOffBalances = new chunkU7LVWEO4_cjs.ResourceTimeOffBalancesResource(this.http, this.config.pageSize);
181
+ this.resources = new chunkU7LVWEO4_cjs.ResourcesResource(this.http, this.config, this.config.pageSize);
182
+ this.serviceCalls = new chunkU7LVWEO4_cjs.ServiceCallsResource(this.http, this.config.pageSize);
183
+ this.ticketCharges = new chunkU7LVWEO4_cjs.TicketChargesResource(this.http, this.config.pageSize);
184
+ this.tickets = new chunkU7LVWEO4_cjs.TicketsResource(this.http, this.config.pageSize);
185
+ this.timeEntries = new chunkS7JH6K2Z_cjs.TimeEntriesResource(this.http, this.config.pageSize);
186
+ this.timeOffRequests = new chunkU7LVWEO4_cjs.TimeOffRequestsResource(this.http, this.config.pageSize);
187
+ this.authenticateResource = new chunkU7LVWEO4_cjs.AuthenticateResource(this.http);
188
+ this.entityInformation = new chunkU7LVWEO4_cjs.EntityInformationResource(this.http);
189
+ this.modules = new chunkU7LVWEO4_cjs.ModulesResource(this.http);
190
+ this.thresholdInformation = new chunkU7LVWEO4_cjs.ThresholdInformationResource(this.http);
191
+ this.version = new chunkU7LVWEO4_cjs.VersionResource(this.http);
192
+ this.versionInformation = new chunkU7LVWEO4_cjs.VersionInformationResource(this.http);
193
+ this.zoneInformation = new chunkU7LVWEO4_cjs.ZoneInformationResource(this.http);
192
194
  }
193
195
  /**
194
196
  * `GET /V1.0/Authenticate` → `AuthTokenResultModel` (as-is). The SDK does
@@ -222,10 +224,10 @@ var AutotaskClient = class {
222
224
  * parameter on each: `await client.withSignal(signal, () => invoke(client, ...))`.
223
225
  */
224
226
  withSignal(signal, fn) {
225
- return chunkY4BH5N6R_cjs.runWithSignal(signal, fn);
227
+ return chunkS7JH6K2Z_cjs.runWithSignal(signal, fn);
226
228
  }
227
229
  async batch(fn, items, opts = {}) {
228
- return chunkY4BH5N6R_cjs.runBounded(fn, items, { ...opts, concurrency: opts.concurrency ?? this.config.maxConcurrent });
230
+ return chunkS7JH6K2Z_cjs.runBounded(fn, items, { ...opts, concurrency: opts.concurrency ?? this.config.maxConcurrent });
229
231
  }
230
232
  };
231
233