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,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkC4S3EKIK_cjs = require('./chunk-C4S3EKIK.cjs');
3
+ var chunkMVKI2AZX_cjs = require('./chunk-MVKI2AZX.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "CAPABILITY_PLAN_HASHES", {
8
8
  enumerable: true,
9
- get: function () { return chunkC4S3EKIK_cjs.CAPABILITY_PLAN_HASHES; }
9
+ get: function () { return chunkMVKI2AZX_cjs.CAPABILITY_PLAN_HASHES; }
10
10
  });
11
11
  Object.defineProperty(exports, "loadCapabilities", {
12
12
  enumerable: true,
13
- get: function () { return chunkC4S3EKIK_cjs.loadCapabilities; }
13
+ get: function () { return chunkMVKI2AZX_cjs.loadCapabilities; }
14
14
  });
15
15
  Object.defineProperty(exports, "loadCapabilityRecords", {
16
16
  enumerable: true,
17
- get: function () { return chunkC4S3EKIK_cjs.loadCapabilityRecords; }
17
+ get: function () { return chunkMVKI2AZX_cjs.loadCapabilityRecords; }
18
18
  });
@@ -1 +1 @@
1
- export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-ECSE6B3U.js';
1
+ export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-YH5UCY2X.js';
@@ -1,5 +1,5 @@
1
- import { GenericResource, readTasks, OperationNotSupportedError, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-3SFIKG2R.js';
2
- import { loadCapabilityRecords } from './chunk-ECSE6B3U.js';
1
+ import { GenericResource, readTasks, OperationNotSupportedError, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-XBT332X7.js';
2
+ import { loadCapabilityRecords } from './chunk-YH5UCY2X.js';
3
3
 
4
4
  // src/resources/special/configuration_items.ts
5
5
  async function fetchRecord(http, path, label, readOpts) {
@@ -2,9 +2,9 @@
2
2
 
3
3
  // src/capabilities.ts
4
4
  var CAPABILITY_PLAN_HASHES = {
5
- "B": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4",
6
- "A": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4",
7
- "operations": "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4"
5
+ "B": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2",
6
+ "A": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2",
7
+ "operations": "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2"
8
8
  };
9
9
  var cached = null;
10
10
  function loadCapabilities() {
@@ -1,5 +1,5 @@
1
- import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-S7QPD6TR.js';
2
- import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-3SFIKG2R.js';
1
+ import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-3SYNF5QD.js';
2
+ import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-XBT332X7.js';
3
3
 
4
4
  // src/client.ts
5
5
  var AutotaskClient = class {
@@ -26,10 +26,12 @@ var AutotaskClient = class {
26
26
  companyNotes;
27
27
  companySiteConfigurations;
28
28
  companyWebhooks;
29
+ configurationItemAttachments;
29
30
  configurationItemBillingProductAssociations;
30
31
  configurationItemCategories;
31
32
  configurationItemCategoryUdfAssociations;
32
33
  configurationItemDnsRecords;
34
+ configurationItemNoteAttachments;
33
35
  configurationItemNotes;
34
36
  configurationItemRelatedItems;
35
37
  configurationItems;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkC4S3EKIK_cjs = require('./chunk-C4S3EKIK.cjs');
3
+ var chunkMVKI2AZX_cjs = require('./chunk-MVKI2AZX.cjs');
4
4
  var chunkBD4AUGCJ_cjs = require('./chunk-BD4AUGCJ.cjs');
5
5
  var crypto = require('crypto');
6
6
  var async_hooks = require('async_hooks');
@@ -3025,7 +3025,24 @@ var RELATIONSHIP_MAP = {
3025
3025
  "segment": "Notes",
3026
3026
  "field": "configurationItemID"
3027
3027
  },
3028
- "children": [],
3028
+ "children": [
3029
+ {
3030
+ "resource": "configuration_item_note_attachments",
3031
+ "apiEntity": "ConfigurationItemNoteAttachment",
3032
+ "parentField": "configurationItemNoteID",
3033
+ "parentSegment": "Attachments",
3034
+ "tier": "extended",
3035
+ "workflowResource": false,
3036
+ "specialOps": [],
3037
+ "searchCovers": null,
3038
+ "scopedOps": {
3039
+ "create": true,
3040
+ "query": true,
3041
+ "update": false,
3042
+ "delete": true
3043
+ }
3044
+ }
3045
+ ],
3029
3046
  "naturalKeys": {
3030
3047
  "hasSearch": false,
3031
3048
  "searchCovers": null,
@@ -3249,6 +3266,22 @@ var RELATIONSHIP_MAP = {
3249
3266
  "group": "A",
3250
3267
  "parent": null,
3251
3268
  "children": [
3269
+ {
3270
+ "resource": "configuration_item_attachments",
3271
+ "apiEntity": "ConfigurationItemAttachment",
3272
+ "parentField": "configurationItemID",
3273
+ "parentSegment": "Attachments",
3274
+ "tier": "extended",
3275
+ "workflowResource": false,
3276
+ "specialOps": [],
3277
+ "searchCovers": null,
3278
+ "scopedOps": {
3279
+ "create": true,
3280
+ "query": true,
3281
+ "update": false,
3282
+ "delete": true
3283
+ }
3284
+ },
3252
3285
  {
3253
3286
  "resource": "configuration_item_billing_product_associations",
3254
3287
  "apiEntity": "ConfigurationItemBillingProductAssociations",
@@ -9989,6 +10022,139 @@ var RELATIONSHIP_MAP = {
9989
10022
  },
9990
10023
  "deleteBoundary": null,
9991
10024
  "markerField": null
10025
+ },
10026
+ "configuration_item_attachments": {
10027
+ "resource": "configuration_item_attachments",
10028
+ "apiEntity": "ConfigurationItemAttachment",
10029
+ "kind": "entity",
10030
+ "path": "ConfigurationItemAttachments",
10031
+ "parentScoped": true,
10032
+ "tier": "extended",
10033
+ "workflowResource": false,
10034
+ "group": "A",
10035
+ "parent": {
10036
+ "resource": "configuration_items",
10037
+ "segment": "Attachments",
10038
+ "field": "configurationItemID"
10039
+ },
10040
+ "children": [],
10041
+ "naturalKeys": {
10042
+ "hasSearch": false,
10043
+ "searchCovers": null,
10044
+ "findBy": []
10045
+ },
10046
+ "blindSurfaces": null,
10047
+ "zoneFacts": {
10048
+ "createGuidance": {
10049
+ "createOp": "configuration_item_attachments.create",
10050
+ "parentScoped": true,
10051
+ "liveProvenPrefix": [],
10052
+ "unproven": true,
10053
+ "blocker": {
10054
+ "kind": "unknown",
10055
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
10056
+ "remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
10057
+ "requires": {
10058
+ "allOf": [
10059
+ "attachmentType",
10060
+ "fullPath",
10061
+ "title",
10062
+ "publish",
10063
+ "data"
10064
+ ]
10065
+ }
10066
+ },
10067
+ "requiresByValue": [
10068
+ {
10069
+ "field": "attachmentType",
10070
+ "value": "FILE_ATTACHMENT",
10071
+ "requires": {
10072
+ "allOf": [
10073
+ "data"
10074
+ ]
10075
+ }
10076
+ }
10077
+ ],
10078
+ "vendorEvidence": [
10079
+ "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."
10080
+ ],
10081
+ "deleteBoundary": {
10082
+ "available": true,
10083
+ "note": null
10084
+ },
10085
+ "parentCompany": {
10086
+ "via": "configurationItemID",
10087
+ "resource": "configuration_items",
10088
+ "field": "companyID"
10089
+ }
10090
+ }
10091
+ },
10092
+ "deleteBoundary": null,
10093
+ "markerField": null
10094
+ },
10095
+ "configuration_item_note_attachments": {
10096
+ "resource": "configuration_item_note_attachments",
10097
+ "apiEntity": "ConfigurationItemNoteAttachment",
10098
+ "kind": "entity",
10099
+ "path": "ConfigurationItemNoteAttachments",
10100
+ "parentScoped": true,
10101
+ "tier": "extended",
10102
+ "workflowResource": false,
10103
+ "group": "A",
10104
+ "parent": {
10105
+ "resource": "configuration_item_notes",
10106
+ "segment": "Attachments",
10107
+ "field": "configurationItemNoteID"
10108
+ },
10109
+ "children": [],
10110
+ "naturalKeys": {
10111
+ "hasSearch": false,
10112
+ "searchCovers": null,
10113
+ "findBy": []
10114
+ },
10115
+ "blindSurfaces": null,
10116
+ "zoneFacts": {
10117
+ "createGuidance": {
10118
+ "createOp": "configuration_item_note_attachments.create",
10119
+ "parentScoped": true,
10120
+ "liveProvenPrefix": [],
10121
+ "unproven": true,
10122
+ "blocker": {
10123
+ "kind": "unknown",
10124
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
10125
+ "remedy": "Read current field and picklist metadata, supply the configuration-item note id, and preview the attachment before applying.",
10126
+ "requires": {
10127
+ "allOf": [
10128
+ "attachmentType",
10129
+ "fullPath",
10130
+ "title",
10131
+ "publish",
10132
+ "data"
10133
+ ]
10134
+ }
10135
+ },
10136
+ "requiresByValue": [
10137
+ {
10138
+ "field": "attachmentType",
10139
+ "value": "FILE_ATTACHMENT",
10140
+ "requires": {
10141
+ "allOf": [
10142
+ "data"
10143
+ ]
10144
+ }
10145
+ }
10146
+ ],
10147
+ "vendorEvidence": [
10148
+ "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."
10149
+ ],
10150
+ "deleteBoundary": {
10151
+ "available": true,
10152
+ "note": null
10153
+ }
10154
+ }
10155
+ },
10156
+ "deleteBoundary": null,
10157
+ "markerField": null
9992
10158
  }
9993
10159
  };
9994
10160
  var BLIND_SURFACE_STAMPS = {
@@ -11827,6 +11993,50 @@ var CREATE_GUIDANCE = {
11827
11993
  "note": null
11828
11994
  }
11829
11995
  },
11996
+ {
11997
+ "resource": "configuration_item_attachments",
11998
+ "createOp": "configuration_item_attachments.create",
11999
+ "parentScoped": true,
12000
+ "liveProvenPrefix": [],
12001
+ "unproven": true,
12002
+ "blocker": {
12003
+ "kind": "unknown",
12004
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
12005
+ "remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
12006
+ "requires": {
12007
+ "allOf": [
12008
+ "attachmentType",
12009
+ "fullPath",
12010
+ "title",
12011
+ "publish",
12012
+ "data"
12013
+ ]
12014
+ }
12015
+ },
12016
+ "vendorEvidence": [
12017
+ "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."
12018
+ ],
12019
+ "deleteBoundary": {
12020
+ "available": true,
12021
+ "note": null
12022
+ },
12023
+ "requiresByValue": [
12024
+ {
12025
+ "field": "attachmentType",
12026
+ "value": "FILE_ATTACHMENT",
12027
+ "requires": {
12028
+ "allOf": [
12029
+ "data"
12030
+ ]
12031
+ }
12032
+ }
12033
+ ],
12034
+ "parentCompany": {
12035
+ "via": "configurationItemID",
12036
+ "resource": "configuration_items",
12037
+ "field": "companyID"
12038
+ }
12039
+ },
11830
12040
  {
11831
12041
  "resource": "configuration_item_billing_product_associations",
11832
12042
  "createOp": "configuration_item_billing_product_associations.create",
@@ -11895,6 +12105,45 @@ var CREATE_GUIDANCE = {
11895
12105
  "note": null
11896
12106
  }
11897
12107
  },
12108
+ {
12109
+ "resource": "configuration_item_note_attachments",
12110
+ "createOp": "configuration_item_note_attachments.create",
12111
+ "parentScoped": true,
12112
+ "liveProvenPrefix": [],
12113
+ "unproven": true,
12114
+ "blocker": {
12115
+ "kind": "unknown",
12116
+ "message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
12117
+ "remedy": "Read current field and picklist metadata, supply the configuration-item note id, and preview the attachment before applying.",
12118
+ "requires": {
12119
+ "allOf": [
12120
+ "attachmentType",
12121
+ "fullPath",
12122
+ "title",
12123
+ "publish",
12124
+ "data"
12125
+ ]
12126
+ }
12127
+ },
12128
+ "vendorEvidence": [
12129
+ "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."
12130
+ ],
12131
+ "deleteBoundary": {
12132
+ "available": true,
12133
+ "note": null
12134
+ },
12135
+ "requiresByValue": [
12136
+ {
12137
+ "field": "attachmentType",
12138
+ "value": "FILE_ATTACHMENT",
12139
+ "requires": {
12140
+ "allOf": [
12141
+ "data"
12142
+ ]
12143
+ }
12144
+ }
12145
+ ]
12146
+ },
11898
12147
  {
11899
12148
  "resource": "configuration_item_notes",
11900
12149
  "createOp": "configuration_item_notes.create",
@@ -14210,7 +14459,7 @@ var CREATE_GUIDANCE = {
14210
14459
  }
14211
14460
  ],
14212
14461
  "counts": {
14213
- "total": 106,
14462
+ "total": 108,
14214
14463
  "byKind": {
14215
14464
  "ok": 41,
14216
14465
  "blind-reference": 16,
@@ -14220,7 +14469,7 @@ var CREATE_GUIDANCE = {
14220
14469
  "resource-role-pair": 2,
14221
14470
  "delete-absent": 0,
14222
14471
  "non-mutable": 0,
14223
- "unknown": 30
14472
+ "unknown": 32
14224
14473
  }
14225
14474
  }
14226
14475
  };
@@ -14956,6 +15205,12 @@ var UNTRUSTED_FIELDS_BY_RESOURCE = {
14956
15205
  ],
14957
15206
  "task_note_attachments": [
14958
15207
  "title"
15208
+ ],
15209
+ "configuration_item_attachments": [
15210
+ "title"
15211
+ ],
15212
+ "configuration_item_note_attachments": [
15213
+ "title"
14959
15214
  ]
14960
15215
  };
14961
15216
 
@@ -16830,7 +17085,7 @@ async function capabilitySets() {
16830
17085
  const fieldOps = /* @__PURE__ */ new Map();
16831
17086
  const udfCapable = /* @__PURE__ */ new Set();
16832
17087
  const resources = /* @__PURE__ */ new Set();
16833
- for (const rec of await chunkC4S3EKIK_cjs.loadCapabilityRecords()) {
17088
+ for (const rec of await chunkMVKI2AZX_cjs.loadCapabilityRecords()) {
16834
17089
  if (rec.resource === "operations") continue;
16835
17090
  resources.add(rec.resource);
16836
17091
  if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
@@ -16841,7 +17096,7 @@ async function capabilitySets() {
16841
17096
  var derivedIndexPromise = null;
16842
17097
  function derivedIndexLoad() {
16843
17098
  if (derivedIndexPromise === null) {
16844
- derivedIndexPromise = chunkC4S3EKIK_cjs.loadCapabilityRecords().then((records) => {
17099
+ derivedIndexPromise = chunkMVKI2AZX_cjs.loadCapabilityRecords().then((records) => {
16845
17100
  const index = /* @__PURE__ */ new Map();
16846
17101
  for (const rec of records) {
16847
17102
  const declared = rec.metadata?.derivedFields;
@@ -17960,10 +18215,12 @@ var MODEL_FIELD_SETS = {
17960
18215
  "company_notes": ["id", "actionType", "assignedResourceID", "companyID", "completedDateTime", "contactID", "createDateTime", "endDateTime", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastModifiedDate", "name", "note", "opportunityID", "startDateTime", "soapParentPropertyId"],
17961
18216
  "company_site_configurations": ["id", "companyID", "locationName", "soapParentPropertyId", "userDefinedFields"],
17962
18217
  "company_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
18218
+ "configuration_item_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "configurationItemID", "configurationItemNoteID", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentAttachmentID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
17963
18219
  "configuration_item_billing_product_associations": ["id", "billingProductID", "configurationItemID", "effectiveDate", "expirationDate", "soapParentPropertyId"],
17964
18220
  "configuration_item_categories": ["id", "displayColorRGB", "isActive", "isClientPortalDefault", "isGlobalDefault", "name", "nickname"],
17965
18221
  "configuration_item_category_udf_associations": ["id", "configurationItemCategoryID", "isRequired", "userDefinedFieldDefinitionID", "soapParentPropertyId"],
17966
18222
  "configuration_item_dns_records": ["id", "createDateTime", "data", "installedProductID", "timeToLiveSeconds", "dnsType", "soapParentPropertyId"],
18223
+ "configuration_item_note_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "configurationItemID", "configurationItemNoteID", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
17967
18224
  "configuration_item_notes": ["id", "configurationItemID", "createDateTime", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "noteType", "title", "soapParentPropertyId"],
17968
18225
  "configuration_item_related_items": ["id", "configurationItemID", "relatedConfigurationItemID", "relationship", "soapParentPropertyId"],
17969
18226
  "configuration_item_ssl_subject_alternative_names": ["id", "configurationItemID", "name", "soapParentPropertyId"],
@@ -18087,8 +18344,10 @@ var MODEL_DATE_FIELDS = {
18087
18344
  "company_attachments": ["attachDate"],
18088
18345
  "company_note_attachments": ["attachDate"],
18089
18346
  "company_notes": ["completedDateTime", "createDateTime", "endDateTime", "lastModifiedDate", "startDateTime"],
18347
+ "configuration_item_attachments": ["attachDate"],
18090
18348
  "configuration_item_billing_product_associations": ["effectiveDate", "expirationDate"],
18091
18349
  "configuration_item_dns_records": ["createDateTime"],
18350
+ "configuration_item_note_attachments": ["attachDate"],
18092
18351
  "configuration_item_notes": ["createDateTime", "lastActivityDate"],
18093
18352
  "configuration_items": ["createDate", "dattoLastCheckInDateTime", "domainRegistrationDateTime", "domainLastUpdatedDateTime", "domainExpirationDateTime", "installDate", "lastModifiedTime", "sslValidFromDateTime", "sslValidUntilDateTime", "warrantyExpirationDate"],
18094
18353
  "contacts": ["bulkEmailOptOutTime", "createDate", "lastActivityDate", "lastModifiedDate", "solicitationOptOutTime"],
@@ -20485,10 +20744,19 @@ async function findUnknownFieldNames(record, holder, lists) {
20485
20744
  return { known: resolved.known, authority: resolved.authority, unknown };
20486
20745
  }
20487
20746
 
20488
- // src/resources/special/taskAttachments.ts
20747
+ // src/resources/special/scopedAttachments.ts
20489
20748
  var WRITABLE2 = /* @__PURE__ */ new Set(["attachmentType", "contentType", "data", "fullPath", "parentAttachmentID", "publish", "taskID", "title"]);
20490
- var NOTE_WRITABLE = /* @__PURE__ */ new Set(["attachmentType", "data", "fullPath", "publish", "title", "attachedByContactID"]);
20749
+ var FILE_WRITABLE = /* @__PURE__ */ new Set(["attachmentType", "data", "fullPath", "publish", "title"]);
20491
20750
  var NON_QUERYABLE = /* @__PURE__ */ new Set(["creatortype", "data", "filesize"]);
20751
+ var SCOPED_ATTACHMENT_PARENTS = {
20752
+ task_attachments: { field: "taskID", name: "task" },
20753
+ task_note_attachments: { field: "taskNoteID", name: "task note" },
20754
+ configuration_item_attachments: { field: "configurationItemID", name: "configuration item" },
20755
+ configuration_item_note_attachments: { field: "configurationItemNoteID", name: "configuration item note" }
20756
+ };
20757
+ function isScopedAttachmentResource(resource) {
20758
+ return Object.hasOwn(SCOPED_ATTACHMENT_PARENTS, resource);
20759
+ }
20492
20760
  function isBase64(value) {
20493
20761
  return value.length % 4 === 0 && /^[A-Za-z0-9+/]+={0,2}$/.test(value);
20494
20762
  }
@@ -20520,32 +20788,37 @@ function admitTaskAttachment(data, parentId) {
20520
20788
  parseIdentifier(body.parentAttachmentID, "parentAttachmentID");
20521
20789
  }
20522
20790
  }
20523
- function admitTaskNoteAttachment(data, parentId) {
20791
+ function admitFileAttachment(resource, data, parentId) {
20524
20792
  parseIdentifier(parentId, "parentId");
20525
20793
  const fail2 = (message) => {
20526
- throw new AutotaskConfigError(`task_note_attachments: ${message}`);
20794
+ throw new AutotaskConfigError(`${resource}: ${message}`);
20527
20795
  };
20528
20796
  if (data === null || typeof data !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(data))) fail2("data must be a plain record");
20529
20797
  const body = data;
20530
- for (const field of Object.keys(body)) if (!NOTE_WRITABLE.has(field)) fail2(`${field} is not a supported create field`);
20798
+ const reference = {
20799
+ task_note_attachments: "attachedByContactID",
20800
+ configuration_item_attachments: "parentAttachmentID",
20801
+ configuration_item_note_attachments: void 0
20802
+ }[resource];
20803
+ for (const field of Object.keys(body)) if (!FILE_WRITABLE.has(field) && field !== reference) fail2(`${field} is not a supported create field`);
20531
20804
  if (body.attachmentType !== "FILE_ATTACHMENT") fail2("attachmentType must explicitly be FILE_ATTACHMENT; other attachment types are unsupported");
20532
20805
  for (const field of ["fullPath", "title"]) {
20533
20806
  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`);
20534
20807
  }
20535
20808
  if (typeof body.publish !== "number" || !Number.isSafeInteger(body.publish)) fail2("publish must be an integer from current field metadata");
20536
20809
  if (typeof body.data !== "string" || !isBase64(body.data)) fail2("FILE_ATTACHMENT requires nonempty base64 data");
20537
- if (body.attachedByContactID !== void 0) {
20538
- if (typeof body.attachedByContactID !== "number") fail2("attachedByContactID must be a numeric identifier");
20539
- if (parseIdentifier(body.attachedByContactID, "attachedByContactID") === 0) fail2("attachedByContactID must be positive");
20810
+ if (reference !== void 0 && body[reference] !== void 0) {
20811
+ if (typeof body[reference] !== "number") fail2(`${reference} must be a numeric identifier`);
20812
+ if (parseIdentifier(body[reference], reference) === 0) fail2(`${reference} must be positive`);
20540
20813
  }
20541
20814
  }
20542
- function admitTaskAttachmentQuery(resource, params) {
20815
+ function admitScopedAttachmentQuery(resource, params) {
20543
20816
  const fields = collectFilterFieldNames(normalizedConditions(params?.filter) ?? [], resource);
20544
20817
  for (const field of fields) {
20545
20818
  if (NON_QUERYABLE.has(field.toLowerCase())) throw new AutotaskConfigError(`${resource}: ${field} is not queryable`);
20546
20819
  }
20547
20820
  }
20548
- function assertTaskAttachmentIdentity(resource, model, parentId, id) {
20821
+ function assertScopedAttachmentIdentity(resource, model, parentId, id) {
20549
20822
  const matches = (value, expected) => {
20550
20823
  try {
20551
20824
  return parseIdentifier(value) === parseIdentifier(expected);
@@ -20553,9 +20826,8 @@ function assertTaskAttachmentIdentity(resource, model, parentId, id) {
20553
20826
  return false;
20554
20827
  }
20555
20828
  };
20556
- const parentField = resource === "task_attachments" ? "taskID" : "taskNoteID";
20829
+ const { field: parentField, name: parentName } = SCOPED_ATTACHMENT_PARENTS[resource];
20557
20830
  if (!isRecord2(model) || !matches(model.id, id) || model[parentField] != null && !matches(model[parentField], parentId)) {
20558
- const parentName = resource === "task_attachments" ? "task" : "task note";
20559
20831
  throw new AutotaskError(`Returned attachment identifiers contradict the requested ${parentName} or attachment`, {
20560
20832
  code: "INVALID_RESPONSE",
20561
20833
  category: "server",
@@ -20763,6 +21035,20 @@ var SIMPLE_RESOURCES = [
20763
21035
  helpers: { search: true, resolve: true, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
20764
21036
  opForms: { get: "global", create: "global", update: "global", delete: "global" }
20765
21037
  },
21038
+ {
21039
+ key: "configuration_item_attachments",
21040
+ accessor: "configurationItemAttachments",
21041
+ resourcePath: "/V1.0/ConfigurationItemAttachments",
21042
+ parentScopedPath: "/V1.0/ConfigurationItems/{parentId}/Attachments",
21043
+ parentPath: "/V1.0/ConfigurationItems",
21044
+ parentField: "configurationItemID",
21045
+ deletable: true,
21046
+ udfCapable: false,
21047
+ attachmentGet: true,
21048
+ ops: { query: true, queryAll: false, count: true, get: true, create: true, update: false, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: false, download: false },
21049
+ helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
21050
+ opForms: { get: "scoped", create: "scoped", delete: "scoped" }
21051
+ },
20766
21052
  {
20767
21053
  key: "configuration_item_billing_product_associations",
20768
21054
  accessor: "configurationItemBillingProductAssociations",
@@ -20814,6 +21100,20 @@ var SIMPLE_RESOURCES = [
20814
21100
  helpers: { search: false, resolve: true, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
20815
21101
  opForms: { get: "scoped", delete: "scoped" }
20816
21102
  },
21103
+ {
21104
+ key: "configuration_item_note_attachments",
21105
+ accessor: "configurationItemNoteAttachments",
21106
+ resourcePath: "/V1.0/ConfigurationItemNoteAttachments",
21107
+ parentScopedPath: "/V1.0/ConfigurationItemNotes/{parentId}/Attachments",
21108
+ parentPath: "/V1.0/ConfigurationItemNotes",
21109
+ parentField: "configurationItemNoteID",
21110
+ deletable: true,
21111
+ udfCapable: false,
21112
+ attachmentGet: true,
21113
+ ops: { query: true, queryAll: false, count: true, get: true, create: true, update: false, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: false, download: false },
21114
+ helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
21115
+ opForms: { get: "scoped", create: "scoped", delete: "scoped" }
21116
+ },
20817
21117
  {
20818
21118
  key: "configuration_item_notes",
20819
21119
  accessor: "configurationItemNotes",
@@ -22111,10 +22411,10 @@ var SIMPLE_RESOURCES = [
22111
22411
  var GenericResource = class extends BaseResource {
22112
22412
  constructor(http, config, pageSize) {
22113
22413
  super(http, config, pageSize);
22114
- if (["company_attachments", "company_note_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
22414
+ if (["company_attachments", "company_note_attachments", "configuration_item_attachments", "configuration_item_note_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
22115
22415
  throw new OperationNotSupportedError(config.key, "getUdfInfo");
22116
22416
  };
22117
- if (config.ops?.create === false || ["company_attachments", "task_attachments", "task_note_attachments", "task_predecessors"].includes(config.key)) this.createIfNotExists = async () => {
22417
+ if (config.ops?.create === false || isScopedAttachmentResource(config.key) || ["company_attachments", "task_predecessors"].includes(config.key)) this.createIfNotExists = async () => {
22118
22418
  throw new OperationNotSupportedError(config.key, "createIfNotExists");
22119
22419
  };
22120
22420
  if (config.key === "task_notes") {
@@ -22147,17 +22447,17 @@ var GenericResource = class extends BaseResource {
22147
22447
  async getScopedModel(parentId, id, fresh = false) {
22148
22448
  const model = await super.getScopedModel(parentId, id, fresh);
22149
22449
  const key = this.config.key;
22150
- if (key === "task_attachments" || key === "task_note_attachments") assertTaskAttachmentIdentity(key, model, parentId, id);
22450
+ if (isScopedAttachmentResource(key)) assertScopedAttachmentIdentity(key, model, parentId, id);
22151
22451
  return model;
22152
22452
  }
22153
22453
  async fetchPage(params, page, pageSize, state2) {
22154
22454
  const key = this.config.key;
22155
- if (key === "task_attachments" || key === "task_note_attachments") admitTaskAttachmentQuery(key, params);
22455
+ if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
22156
22456
  return super.fetchPage(params, page, pageSize, state2);
22157
22457
  }
22158
22458
  async countGlobal(params) {
22159
22459
  const key = this.config.key;
22160
- if (key === "task_attachments" || key === "task_note_attachments") admitTaskAttachmentQuery(key, params);
22460
+ if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
22161
22461
  return super.countGlobal(params);
22162
22462
  }
22163
22463
  /** Query records with the G3 filter surface (server-side JSON filter). */
@@ -22199,8 +22499,11 @@ var GenericResource = class extends BaseResource {
22199
22499
  const data2 = this.config.key === "task_predecessors" ? admitTaskPredecessor(b, parentId, true) : b;
22200
22500
  const opts2 = this.config.key === "task_predecessors" ? { ...c } : c ?? {};
22201
22501
  if (this.config.key === "task_notes") admitTaskNote(data2, parentId, true);
22202
- if (this.config.key === "task_attachments") admitTaskAttachment(data2, parentId);
22203
- if (this.config.key === "task_note_attachments") admitTaskNoteAttachment(data2, parentId);
22502
+ const key = this.config.key;
22503
+ if (isScopedAttachmentResource(key)) {
22504
+ if (key === "task_attachments") admitTaskAttachment(data2, parentId);
22505
+ else admitFileAttachment(key, data2, parentId);
22506
+ }
22204
22507
  if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, void 0, data2);
22205
22508
  if (opts2.dryRun === true) return this.runCreateDryRun(data2, parentId);
22206
22509
  return this.createScopedRaw(parentId, data2, opts2);
@@ -23991,7 +24294,7 @@ function dateBucketLabel(value, bucket) {
23991
24294
  var queryResourceKeysPromise = null;
23992
24295
  function queryResourceKeys() {
23993
24296
  if (queryResourceKeysPromise === null) {
23994
- queryResourceKeysPromise = chunkC4S3EKIK_cjs.loadCapabilityRecords().then((records) => {
24297
+ queryResourceKeysPromise = chunkMVKI2AZX_cjs.loadCapabilityRecords().then((records) => {
23995
24298
  const s = /* @__PURE__ */ new Set();
23996
24299
  for (const rec of records) if (rec.operation === "query") s.add(rec.resource);
23997
24300
  return s;
@@ -24113,7 +24416,7 @@ function parseTopAndLimit(opts, problems) {
24113
24416
  return { top, limit };
24114
24417
  }
24115
24418
  async function checkFieldNames(resourceKey, conditions, opts, problems) {
24116
- const records = resourceKey === void 0 ? [] : await chunkC4S3EKIK_cjs.loadCapabilityRecords();
24419
+ const records = resourceKey === void 0 ? [] : await chunkMVKI2AZX_cjs.loadCapabilityRecords();
24117
24420
  const record = resourceKey === void 0 ? void 0 : records.find((r) => r.resource === resourceKey && r.operation === "query");
24118
24421
  if (record === void 0) return void 0;
24119
24422
  const strings = (v) => Array.isArray(v) ? v.filter((f) => typeof f === "string" && f.trim() !== "") : [];
@@ -24758,7 +25061,7 @@ async function uiLink(client, input) {
24758
25061
  var indexPromise = null;
24759
25062
  function operationIndex() {
24760
25063
  if (indexPromise === null) {
24761
- indexPromise = chunkC4S3EKIK_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
25064
+ indexPromise = chunkMVKI2AZX_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
24762
25065
  }
24763
25066
  return indexPromise;
24764
25067
  }