node-autotask 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/MCP_TOOL_CATALOG.json +26 -8
  2. package/MCP_TOOL_MANIFEST.md +12 -11
  3. package/N8N_MCP_MANIFEST.json +3 -3
  4. package/N8N_MCP_MANIFEST.md +4 -4
  5. package/README.md +1 -1
  6. package/capabilities.json +1352 -1233
  7. package/dist/capabilities.cjs +2 -2
  8. package/dist/capabilities.js +1 -1
  9. package/dist/{chunk-SXHPUQMB.js → chunk-3WIDDEHP.js} +2 -2
  10. package/dist/{chunk-7L23FDQW.js → chunk-4A6XLQHE.js} +1351 -1232
  11. package/dist/{chunk-YKEX4SK7.cjs → chunk-5N6DYKXO.cjs} +519 -39
  12. package/dist/{chunk-LNRN45XS.js → chunk-GD4JRPYF.js} +498 -18
  13. package/dist/{chunk-T5FLSJOD.cjs → chunk-JKZVCFRY.cjs} +1351 -1232
  14. package/dist/{chunk-CJONZQ7E.js → chunk-MY7ZSXY3.js} +1075 -6
  15. package/dist/{chunk-25ZUKHS4.cjs → chunk-SRJI5XUZ.cjs} +135 -135
  16. package/dist/{chunk-QAX222R6.cjs → chunk-TELBX6HK.cjs} +1462 -393
  17. package/dist/{index-B_xToSpq.d.ts → index-D8I6taEo.d.cts} +200 -2
  18. package/dist/{index-Dv_GSZaN.d.cts → index-uAxAcRol.d.ts} +200 -2
  19. package/dist/index.cjs +19 -19
  20. package/dist/index.d.cts +4 -4
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +4 -4
  23. package/dist/operations/index.cjs +123 -588
  24. package/dist/operations/index.d.cts +4 -4
  25. package/dist/operations/index.d.ts +4 -4
  26. package/dist/operations/index.js +10 -475
  27. package/dist/pool.cjs +8 -8
  28. package/dist/pool.d.cts +2 -2
  29. package/dist/pool.d.ts +2 -2
  30. package/dist/pool.js +4 -4
  31. package/dist/resources/index.cjs +4 -4
  32. package/dist/resources/index.d.cts +2 -2
  33. package/dist/resources/index.d.ts +2 -2
  34. package/dist/resources/index.js +3 -3
  35. package/dist/types/index.d.cts +1 -1
  36. package/dist/types/index.d.ts +1 -1
  37. package/docs/API.md +192 -2
  38. package/docs/N8N-ADAPTER.md +1 -1
  39. package/package.json +1 -1
  40. package/dist/{index-cQ6CRexR.d.cts → index-BXtKN1M5.d.cts} +201 -201
  41. package/dist/{index-cQ6CRexR.d.ts → index-BXtKN1M5.d.ts} +201 -201
@@ -8,10 +8,15 @@ import {
8
8
  DELETE_BOUNDARY_NOTES,
9
9
  DeleteBoundaryError,
10
10
  EXPAND_RESOURCE_NAMES_MAX_IDS,
11
+ FETCH_BY_IDS_CHUNK_SIZE,
12
+ FETCH_BY_IDS_MAX_ITEMS,
13
+ FETCH_MANY_MAX_ITEMS,
11
14
  FIELD_CACHE_KINDS,
12
15
  FIELD_CATALOG_HONESTY_NOTE,
13
16
  MARKER_FIELDS,
14
17
  MAX_FIELD_CATALOG_WIRE,
18
+ MODEL_DATE_FIELDS,
19
+ MODEL_FIELD_SETS,
15
20
  MarkerUnsafeIdError,
16
21
  NotFoundError,
17
22
  PICKLIST_VALUE_NOT_SERVED_NOTE,
@@ -21,19 +26,20 @@ import {
21
26
  RecoveryTruncatedError,
22
27
  WORKFLOW_RESOURCES,
23
28
  buildFilter,
24
- buildQueryRequest,
25
29
  camelKey,
26
30
  clampPageSize,
27
31
  expandResourceNames,
32
+ fetchByIds,
33
+ fetchMany,
28
34
  fieldCatalog,
29
35
  isAutotaskError,
30
36
  isRecord,
31
37
  parseIdentifier,
32
- unwrapItems
33
- } from "../chunk-LNRN45XS.js";
38
+ validateFetchManyItems
39
+ } from "../chunk-GD4JRPYF.js";
34
40
  import {
35
41
  CAPABILITIES
36
- } from "../chunk-7L23FDQW.js";
42
+ } from "../chunk-4A6XLQHE.js";
37
43
 
38
44
  // src/operations/searchAcrossResources.ts
39
45
  var DEFAULT_LIMIT = 25;
@@ -138,353 +144,6 @@ async function resolveAny(client, identifier, opts = {}) {
138
144
  return { identifier, results, matches };
139
145
  }
140
146
 
141
- // src/field-sets.ts
142
- var MODEL_FIELD_SETS = {
143
- "appointments": ["id", "createDateTime", "creatorResourceID", "description", "endDateTime", "resourceID", "startDateTime", "title", "updateDateTime"],
144
- "billing_codes": ["id", "afterHoursWorkType", "billingCodeType", "department", "description", "externalNumber", "generalLedgerAccount", "isActive", "isExcludedFromNewContracts", "markupRate", "name", "taxCategoryID", "unitCost", "unitPrice", "useType"],
145
- "billing_items": ["id", "accountManagerWhenApprovedID", "billingCodeID", "billingItemType", "companyID", "configurationItemID", "contractBlockID", "contractChargeID", "contractID", "contractServiceAdjustmentID", "contractServiceBundleAdjustmentID", "contractServiceBundleID", "contractServiceBundlePeriodID", "contractServiceID", "contractServicePeriodID", "description", "expenseItemID", "extendedPrice", "internalCurrencyExtendedPrice", "internalCurrencyRate", "internalCurrencyTaxDollars", "internalCurrencyTotalAmount", "invoiceID", "itemApproverID", "itemDate", "itemName", "lineItemFullDescription", "lineItemGroupDescription", "milestoneID", "nonBillable", "organizationalLevelAssociationID", "ourCost", "postedDate", "postedOnTime", "projectChargeID", "projectID", "purchaseOrderNumber", "quantity", "rate", "roleID", "serviceBundleID", "serviceID", "sortOrderID", "subType", "taskID", "taxDollars", "ticketChargeID", "ticketID", "timeEntryID", "totalAmount", "vendorID", "webServiceDate"],
146
- "change_request_links": ["id", "changeRequestTicketID", "problemOrIncidentTicketID"],
147
- "checklist_libraries": ["id", "description", "entityType", "isActive", "name"],
148
- "checklist_library_checklist_items": ["id", "checklistLibraryID", "isImportant", "itemName", "knowledgebaseArticleID", "position", "soapParentPropertyId"],
149
- "classification_icons": ["id", "description", "isActive", "isSystem", "name", "relativeUrl"],
150
- "companies": ["id", "additionalAddressInformation", "address1", "address2", "alternatePhone1", "alternatePhone2", "apiVendorID", "assetValue", "billToCompanyLocationID", "billToAdditionalAddressInformation", "billingAddress1", "billingAddress2", "billToAddressToUse", "billToAttention", "billToCity", "billToCountryID", "billToState", "billToZipCode", "city", "classification", "companyCategoryID", "companyName", "companyNumber", "companyType", "competitorID", "countryID", "createDate", "createdByResourceID", "currencyID", "fax", "impersonatorCreatorResourceID", "invoiceEmailMessageID", "invoiceMethod", "invoiceNonContractItemsToParentCompany", "invoiceTemplateID", "isActive", "isClientPortalActive", "isEnabledForComanaged", "isSample", "isTaskFireActive", "isTaxExempt", "lastActivityDate", "lastTrackedModifiedDateTime", "marketSegmentID", "ownerResourceID", "parentCompanyID", "phone", "postalCode", "purchaseOrderTemplateID", "quoteEmailMessageID", "quoteTemplateID", "sicCode", "state", "stockMarket", "stockSymbol", "surveyCompanyRating", "taxID", "taxRegionID", "territoryID", "webAddress", "userDefinedFields"],
151
- "company_alerts": ["id", "alertText", "alertTypeID", "companyID", "soapParentPropertyId"],
152
- "company_locations": ["id", "address1", "address2", "alternatePhone1", "alternatePhone2", "city", "companyID", "countryID", "description", "fax", "isActive", "isPrimary", "isTaxExempt", "overrideCompanyTaxSettings", "name", "phone", "postalCode", "roundtripDistance", "state", "taxRegionID", "soapParentPropertyId"],
153
- "company_notes": ["id", "actionType", "assignedResourceID", "companyID", "completedDateTime", "contactID", "createDateTime", "endDateTime", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastModifiedDate", "name", "note", "opportunityID", "startDateTime", "soapParentPropertyId"],
154
- "company_site_configurations": ["id", "companyID", "locationName", "soapParentPropertyId", "userDefinedFields"],
155
- "company_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
156
- "configuration_item_billing_product_associations": ["id", "billingProductID", "configurationItemID", "effectiveDate", "expirationDate", "soapParentPropertyId"],
157
- "configuration_item_categories": ["id", "displayColorRGB", "isActive", "isClientPortalDefault", "isGlobalDefault", "name", "nickname"],
158
- "configuration_item_category_udf_associations": ["id", "configurationItemCategoryID", "isRequired", "userDefinedFieldDefinitionID", "soapParentPropertyId"],
159
- "configuration_item_dns_records": ["id", "createDateTime", "data", "installedProductID", "timeToLiveSeconds", "dnsType", "soapParentPropertyId"],
160
- "configuration_item_notes": ["id", "configurationItemID", "createDateTime", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "noteType", "title", "soapParentPropertyId"],
161
- "configuration_item_related_items": ["id", "configurationItemID", "relatedConfigurationItemID", "relationship", "soapParentPropertyId"],
162
- "configuration_item_ssl_subject_alternative_names": ["id", "configurationItemID", "name", "soapParentPropertyId"],
163
- "configuration_item_types": ["id", "isActive", "name"],
164
- "configuration_item_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
165
- "configuration_items": ["id", "apiVendorID", "configurationItemCategoryID", "companyID", "companyLocationID", "configurationItemType", "contactID", "contractID", "contractServiceBundleID", "contractServiceID", "createDate", "createdByPersonID", "dailyCost", "dattoAvailableKilobytes", "dattoDeviceMemoryMegabytes", "dattoDrivesErrors", "dattoHostname", "dattoInternalIP", "dattoKernelVersionID", "dattoLastCheckInDateTime", "dattoNICSpeedKilobitsPerSecond", "dattoNumberOfAgents", "dattoNumberOfDrives", "dattoNumberOfVolumes", "dattoOffsiteUsedBytes", "dattoOSVersionID", "dattoPercentageUsed", "dattoProtectedKilobytes", "dattoRemoteIP", "dattoSerialNumber", "dattoUptimeSeconds", "dattoUsedKilobytes", "dattoZFSVersionID", "deviceNetworkingID", "domain", "domainRegistrarID", "domainRegistrationDateTime", "domainLastUpdatedDateTime", "domainExpirationDateTime", "hourlyCost", "impersonatorCreatorResourceID", "installDate", "installedByContactID", "installedByID", "isActive", "lastActivityPersonID", "lastActivityPersonType", "lastModifiedTime", "location", "monthlyCost", "notes", "numberOfUsers", "parentConfigurationItemID", "perUseCost", "productID", "referenceNumber", "referenceTitle", "rmmDeviceAuditAntivirusStatusID", "rmmDeviceAuditArchitectureID", "rmmDeviceAuditBackupStatusID", "rmmDeviceAuditDescription", "rmmDeviceAuditDeviceTypeID", "rmmDeviceAuditDisplayAdaptorID", "rmmDeviceAuditDomainID", "rmmDeviceAuditExternalIPAddress", "rmmDeviceAuditHostname", "rmmDeviceAuditIPAddress", "rmmDeviceAuditLastUser", "rmmDeviceAuditMacAddress", "rmmDeviceAuditManufacturerID", "rmmDeviceAuditFirmwareID", "rmmDeviceAuditMemoryBytes", "rmmDeviceAuditMissingPatchCount", "rmmDeviceAuditMobileNetworkOperatorID", "rmmDeviceAuditMobileNumber", "rmmDeviceAuditModelID", "rmmDeviceAuditMotherboardID", "rmmDeviceAuditOperatingSystem", "rmmDeviceAuditPatchStatusID", "rmmDeviceAuditProcessorID", "rmmDeviceAuditServicePackID", "rmmDeviceAuditSNMPContact", "rmmDeviceAuditSNMPLocation", "rmmDeviceAuditSNMPName", "rmmDeviceAuditSoftwareStatusID", "rmmDeviceAuditStorageBytes", "rmmDeviceID", "rmmDeviceUID", "rmmVsaxDeviceID", "rmmOpenAlertCount", "serialNumber", "serviceBundleID", "serviceID", "serviceLevelAgreementID", "setupFee", "sourceChargeID", "sourceChargeType", "sslSource", "sslCommonName", "sslValidFromDateTime", "sslValidUntilDateTime", "sslIssuedBy", "sslOrganization", "sslOrganizationUnit", "sslLocation", "sslSerialNumber", "sslSignatureAlgorithm", "vendorID", "warrantyExpirationDate", "rmmIsInMaintenanceMode", "rmmIsMobileDeviceManagementEnrolled", "rmmDeviceUrl", "userDefinedFields"],
166
- "contact_group_contacts": ["id", "contactId", "contactGroupId", "soapParentPropertyId"],
167
- "contact_groups": ["id", "name", "isActive"],
168
- "contact_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
169
- "contacts": ["id", "additionalAddressInformation", "addressLine", "addressLine1", "alternatePhone", "apiVendorID", "bulkEmailOptOutTime", "city", "companyID", "companyLocationID", "countryID", "createDate", "emailAddress", "emailAddress2", "emailAddress3", "extension", "externalID", "facebookUrl", "faxNumber", "firstName", "impersonatorCreatorResourceID", "isActive", "isOptedOutFromBulkEmail", "lastActivityDate", "lastModifiedDate", "lastName", "linkedInUrl", "middleInitial", "mobilePhone", "namePrefix", "nameSuffix", "note", "receivesEmailNotifications", "phone", "primaryContact", "roomNumber", "solicitationOptOut", "solicitationOptOutTime", "state", "surveyOptOut", "title", "twitterUrl", "zipCode", "soapParentPropertyId", "userDefinedFields"],
170
- "contract_billing_rules": ["id", "contractID", "createChargesAsBillable", "dailyProratedCost", "dailyProratedPrice", "determineUnits", "endDate", "executionMethod", "includeItemsInChargeDescription", "invoiceDescription", "isActive", "isDailyProrationEnabled", "maximumUnits", "minimumUnits", "productID", "startDate", "soapParentPropertyId"],
171
- "contract_block_hour_factors": ["id", "blockHourMultiplier", "contractHourlyRate", "contractID", "internalCurrencyContractHourlyRate", "roleID", "soapParentPropertyId"],
172
- "contract_blocks": ["id", "contractID", "datePurchased", "endDate", "hourlyRate", "hours", "hoursApproved", "invoiceNumber", "isPaid", "paymentNumber", "paymentType", "startDate", "status", "soapParentPropertyId"],
173
- "contract_charges": ["id", "billableAmount", "billingCodeID", "chargeType", "contractID", "contractServiceBundleID", "contractServiceID", "createDate", "creatorResourceID", "datePurchased", "description", "extendedCost", "internalCurrencyBillableAmount", "internalCurrencyUnitPrice", "internalPurchaseOrderNumber", "isBillableToCompany", "isBilled", "name", "notes", "organizationalLevelAssociationID", "productID", "purchaseOrderNumber", "status", "statusLastModifiedBy", "statusLastModifiedDate", "unitCost", "unitPrice", "unitQuantity", "soapParentPropertyId"],
174
- "contract_exclusion_billing_codes": ["id", "billingCodeID", "contractID", "soapParentPropertyId"],
175
- "contract_exclusion_roles": ["id", "contractID", "roleID", "soapParentPropertyId"],
176
- "contract_exclusion_set_excluded_roles": ["id", "contractExclusionSetID", "excludedRoleID", "soapParentPropertyId"],
177
- "contract_exclusion_set_excluded_work_types": ["id", "contractExclusionSetID", "excludedWorkTypeID", "soapParentPropertyId"],
178
- "contract_exclusion_sets": ["id", "description", "isActive", "name"],
179
- "contract_milestones": ["id", "amount", "billingCodeID", "contractID", "createDate", "creatorResourceID", "dateDue", "description", "internalCurrencyAmount", "isInitialPayment", "organizationalLevelAssociationID", "status", "title", "soapParentPropertyId"],
180
- "contract_notes": ["id", "contractID", "createDateTime", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "title", "soapParentPropertyId"],
181
- "contract_rates": ["id", "contractHourlyRate", "contractID", "internalCurrencyContractHourlyRate", "roleID", "soapParentPropertyId"],
182
- "contract_retainers": ["id", "amount", "amountApproved", "contractID", "datePurchased", "endDate", "internalCurrencyAmount", "internalCurrencyAmountApproved", "invoiceNumber", "isPaid", "paymentID", "paymentNumber", "startDate", "status", "soapParentPropertyId"],
183
- "contract_role_costs": ["id", "contractID", "rate", "resourceID", "roleID", "soapParentPropertyId"],
184
- "contract_service_bundle_units": ["id", "approveAndPostDate", "contractID", "contractServiceBundleID", "cost", "endDate", "internalCurrencyPrice", "organizationalLevelAssociationID", "price", "serviceBundleID", "startDate", "units", "soapParentPropertyId"],
185
- "contract_service_bundles": ["id", "adjustedPrice", "contractID", "internalCurrencyAdjustedPrice", "internalCurrencyUnitPrice", "internalDescription", "invoiceDescription", "quoteItemID", "serviceBundleID", "unitPrice", "soapParentPropertyId"],
186
- "contract_service_units": ["id", "approveAndPostDate", "contractID", "contractServiceID", "cost", "endDate", "internalCurrencyPrice", "organizationalLevelAssociationID", "price", "serviceID", "startDate", "units", "vendorCompanyID", "soapParentPropertyId"],
187
- "contract_services": ["id", "contractID", "internalCurrencyAdjustedPrice", "internalCurrencyUnitPrice", "internalDescription", "invoiceDescription", "quoteItemID", "serviceID", "unitCost", "unitPrice", "soapParentPropertyId"],
188
- "contract_ticket_purchases": ["id", "contractID", "datePurchased", "endDate", "invoiceNumber", "isPaid", "paymentNumber", "paymentType", "perTicketRate", "startDate", "status", "ticketsPurchased", "ticketsUsed", "soapParentPropertyId"],
189
- "contracts": ["id", "billingPreference", "billToCompanyContactID", "billToCompanyID", "companyID", "contactID", "contactName", "contractCategory", "contractExclusionSetID", "contractName", "contractNumber", "contractPeriodType", "contractType", "description", "endDate", "estimatedCost", "estimatedHours", "estimatedRevenue", "exclusionContractID", "internalCurrencyOverageBillingRate", "internalCurrencySetupFee", "isCompliant", "isDefaultContract", "lastModifiedDateTime", "opportunityID", "organizationalLevelAssociationID", "overageBillingRate", "purchaseOrderNumber", "renewedContractID", "serviceLevelAgreementID", "setupFee", "setupFeeBillingCodeID", "startDate", "status", "timeReportingRequiresStartAndStopTimes", "userDefinedFields"],
190
- "countries": ["id", "addressFormatID", "countryCode", "displayName", "invoiceTemplateID", "isActive", "isDefaultCountry", "name", "purchaseOrderTemplateID", "quoteTemplateID"],
191
- "departments": ["id", "description", "name", "number", "primaryLocationID"],
192
- "domain_registrars": ["id", "name", "url"],
193
- "expense_item_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "expenseItemID", "expenseReportID", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
194
- "expense_items": ["id", "companyID", "description", "destination", "entertainmentLocation", "expenseCategory", "expenseCurrencyExpenseAmount", "expenseCurrencyID", "expenseDate", "expenseReportID", "glCode", "haveReceipt", "internalCurrencyExpenseAmount", "internalCurrencyReimbursementAmount", "isBillableToCompany", "isReimbursable", "isRejected", "miles", "odometerEnd", "odometerStart", "origin", "paymentType", "projectID", "purchaseOrderNumber", "reimbursementCurrencyReimbursementAmount", "taskID", "ticketID", "workType", "soapParentPropertyId"],
195
- "expense_reports": ["id", "amountDue", "approvedDate", "approverID", "departmentNumber", "internalCurrencyCashAdvanceAmount", "internalCurrencyExpenseTotal", "name", "organizationalLevelAssociationID", "quickBooksReferenceNumber", "reimbursementCurrencyAmountDue", "reimbursementCurrencyCashAdvanceAmount", "reimbursementCurrencyID", "rejectionReason", "status", "submit", "submitDate", "submitterID", "weekEnding"],
196
- "holiday_sets": ["id", "holidaySetDescription", "holidaySetName"],
197
- "holidays": ["id", "holidayDate", "holidayName", "holidaySetID", "soapParentPropertyId"],
198
- "inventory_products": ["id", "availableUnits", "backOrderQuantity", "bin", "createDateTime", "createdByResourceID", "inventoryLocationID", "onHandUnits", "pickedUnits", "productID", "quantityMaximum", "quantityMinimum", "referenceNumber", "reservedUnits", "unitsOnOrder"],
199
- "invoices": ["id", "batchID", "comments", "companyID", "createDateTime", "creatorResourceID", "dueDate", "fromDate", "invoiceDateTime", "invoiceEditorTemplateID", "invoiceNumber", "invoiceTotal", "isVoided", "orderNumber", "paidDate", "paymentTerm", "taxGroup", "taxRegionName", "toDate", "totalTaxValue", "voidedByResourceID", "voidedDate", "webServiceDate"],
200
- "notification_history": ["id", "companyID", "entityNumber", "entityTitle", "initiatingContactID", "initiatingResourceID", "isActive", "isDeleted", "isTemplateJob", "notificationHistoryTypeID", "notificationSentTime", "opportunityID", "projectID", "quoteID", "recipientDisplayName", "recipientEmailAddress", "taskID", "templateName", "ticketID", "timeEntryID"],
201
- "opportunities": ["id", "advancedField1", "advancedField2", "advancedField3", "advancedField4", "advancedField5", "amount", "assessmentScore", "barriers", "closedDate", "companyID", "contactID", "cost", "createDate", "creatorResourceID", "description", "helpNeeded", "impersonatorCreatorResourceID", "lastActivity", "leadSource", "lossReason", "lossReasonDetail", "lostDate", "market", "monthlyCost", "monthlyRevenue", "nextStep", "onetimeCost", "onetimeRevenue", "opportunityCategoryID", "organizationalLevelAssociationID", "ownerResourceID", "primaryCompetitor", "probability", "productID", "projectedCloseDate", "promisedFulfillmentDate", "promotionName", "quarterlyCost", "quarterlyRevenue", "rating", "relationshipAssessmentScore", "revenueSpread", "revenueSpreadUnit", "salesOrderID", "salesProcessPercentComplete", "semiannualCost", "semiannualRevenue", "stage", "startDate", "status", "technicalAssessmentScore", "throughDate", "title", "totalAmountMonths", "useQuoteTotals", "winReason", "winReasonDetail", "yearlyCost", "yearlyRevenue", "userDefinedFields"],
202
- "opportunity_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentAttachmentID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
203
- "opportunity_categories": ["id", "displayColorRGB", "isActive", "isGlobalDefault", "name", "nickname"],
204
- "phases": ["id", "createDate", "creatorResourceID", "description", "dueDate", "estimatedHours", "externalID", "isScheduled", "lastActivityDateTime", "parentPhaseID", "phaseNumber", "projectID", "startDate", "title", "soapParentPropertyId"],
205
- "product_vendors": ["id", "isActive", "isDefault", "productID", "vendorCost", "vendorID", "vendorPartNumber", "soapParentPropertyId"],
206
- "products": ["id", "billingType", "chargeBillingCodeID", "createdByResourceID", "createdTime", "defaultVendorID", "description", "doesNotRequireProcurement", "externalProductID", "impersonatorCreatorResourceID", "internalProductID", "isActive", "isEligibleForRma", "isSerialized", "link", "manufacturerName", "manufacturerProductName", "markupRate", "msrp", "name", "periodType", "priceCostMethod", "productBillingCodeID", "productCategory", "sku", "unitCost", "unitPrice", "vendorProductNumber", "defaultInstalledProductCategoryID", "userDefinedFields"],
207
- "project_charges": ["id", "billableAmount", "billingCodeID", "chargeType", "contractServiceBundleID", "contractServiceID", "createDate", "creatorResourceID", "datePurchased", "description", "estimatedCost", "extendedCost", "internalCurrencyBillableAmount", "internalCurrencyUnitPrice", "internalPurchaseOrderNumber", "isBillableToCompany", "isBilled", "name", "notes", "organizationalLevelAssociationID", "productID", "projectID", "purchaseOrderNumber", "status", "statusLastModifiedBy", "statusLastModifiedDate", "unitCost", "unitPrice", "unitQuantity", "soapParentPropertyId"],
208
- "project_notes": ["id", "createDateTime", "createdByContactID", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "isAnnouncement", "lastActivityDate", "noteType", "projectID", "publish", "title", "soapParentPropertyId"],
209
- "projects": ["id", "actualBilledHours", "actualHours", "changeOrdersBudget", "changeOrdersRevenue", "companyID", "companyOwnerResourceID", "completedDateTime", "completedPercentage", "contractID", "createDateTime", "creatorResourceID", "department", "description", "duration", "endDateTime", "estimatedSalesCost", "estimatedTime", "extProjectNumber", "extProjectType", "impersonatorCreatorResourceID", "laborEstimatedCosts", "laborEstimatedMarginPercentage", "laborEstimatedRevenue", "lastActivityDateTime", "lastActivityPersonType", "lastActivityResourceID", "opportunityID", "organizationalLevelAssociationID", "originalEstimatedRevenue", "projectCostEstimatedMarginPercentage", "projectCostsBudget", "projectCostsRevenue", "projectLeadResourceID", "projectName", "projectNumber", "projectType", "purchaseOrderNumber", "sgda", "startDateTime", "status", "statusDateTime", "statusDetail", "userDefinedFields"],
210
- "purchase_approvals": ["id", "costType", "isApproved", "rejectNote"],
211
- "purchase_order_item_receiving": ["id", "purchaseOrderItemID", "quantityBackOrdered", "quantityNowReceiving", "quantityPreviouslyReceived", "receiveDate", "receivedByResourceID", "serialNumber", "vendorInvoiceNumber", "soapParentPropertyId"],
212
- "purchase_order_items": ["id", "chargeID", "contractID", "estimatedArrivalDate", "internalCurrencyUnitCost", "inventoryLocationID", "memo", "orderID", "productID", "projectID", "quantity", "salesOrderID", "ticketID", "unitCost", "soapParentPropertyId"],
213
- "purchase_orders": ["id", "cancelDateTime", "createDateTime", "creatorResourceID", "externalPONumber", "fax", "freight", "generalMemo", "impersonatorCreatorResourceID", "internalCurrencyFreight", "latestEstimatedArrivalDate", "paymentTerm", "phone", "purchaseForCompanyID", "purchaseOrderNumber", "purchaseOrderTemplateID", "shippingDate", "shippingType", "shipToAddress1", "shipToAddress2", "shipToCity", "shipToName", "shipToPostalCode", "shipToState", "showEachTaxInGroup", "showTaxCategory", "status", "submitDateTime", "taxRegionID", "useItemDescriptionsFrom", "vendorID", "vendorInvoiceNumber", "additionalVendorInvoiceNumbers"],
214
- "quote_items": ["id", "averageCost", "chargeID", "description", "expenseID", "highestCost", "internalCurrencyLineDiscount", "internalCurrencyUnitDiscount", "internalCurrencyUnitPrice", "isOptional", "isTaxable", "laborID", "lineDiscount", "markupRate", "name", "percentageDiscount", "periodType", "productID", "quantity", "quoteID", "quoteItemType", "serviceBundleID", "serviceID", "shippingID", "sortOrderID", "taxCategoryID", "totalEffectiveTax", "unitCost", "unitDiscount", "unitPrice", "soapParentPropertyId"],
215
- "quote_locations": ["id", "address1", "address2", "city", "postalCode", "state"],
216
- "quote_templates": ["id", "calculateTaxSeparately", "createDate", "createdBy", "currencyNegativeFormat", "currencyPositiveFormat", "dateFormat", "description", "displayTaxCategorySuperscripts", "isActive", "lastActivityBy", "lastActivityDate", "name", "numberFormat", "pageLayout", "pageNumberFormat", "showEachTaxInGroup", "showGridHeader", "showTaxCategory", "showVerticalGridLines"],
217
- "quotes": ["id", "approvalStatus", "approvalStatusChangedByResourceID", "approvalStatusChangedDate", "billToLocationID", "calculateTaxSeparately", "comment", "companyID", "contactID", "createDate", "creatorResourceID", "description", "effectiveDate", "expirationDate", "extApprovalContactResponse", "extApprovalResponseDate", "extApprovalResponseSignature", "externalQuoteNumber", "groupByID", "impersonatorCreatorResourceID", "isActive", "lastActivityDate", "lastModifiedBy", "lastPublishedByResourceID", "lastPublishedDateTime", "name", "opportunityID", "paymentTerm", "paymentType", "primaryQuote", "proposalProjectID", "purchaseOrderNumber", "quoteNumber", "quoteTemplateID", "shippingType", "shipToLocationID", "showEachTaxInGroup", "showTaxCategory", "soldToLocationID", "taxRegionID"],
218
- "resource_role_queues": ["id", "queueID", "resourceID", "soapParentPropertyId"],
219
- "resource_roles": ["id", "departmentID", "isActive", "queueID", "resourceID", "roleID", "soapParentPropertyId"],
220
- "resource_skills": ["id", "resourceID", "skillDescription", "skillID", "skillLevel", "soapParentPropertyId"],
221
- "resource_time_off_approvers": ["id", "resourceID", "approverResourceID", "approvalLevel", "soapParentPropertyId"],
222
- "resource_time_off_balances": ["id", "resourceID", "floatingHolidayAnnualAllowance", "floatingHolidayBalance", "floatingHolidayPlanned", "floatingHolidayUsed", "floatingHolidayWaitingApproval", "personalTimeAnnualAllowance", "personalTimeBalance", "personalTimePlanned", "personalTimeUsed", "personalTimeWaitingApproval", "sickTimeAnnualAllowance", "sickTimeBalance", "sickTimePlanned", "sickTimeUsed", "sickTimeWaitingApproval", "vacationTimeAnnualAllowance", "vacationTimeBalance", "vacationTimePlanned", "vacationTimeUsed", "vacationTimeWaitingApproval", "year", "soapParentPropertyId"],
223
- "resources": ["id", "accountingReferenceID", "dateFormat", "defaultServiceDeskRoleID", "email", "email2", "email3", "emailTypeCode", "emailTypeCode2", "emailTypeCode3", "firstName", "gender", "greeting", "hireDate", "homePhone", "initials", "internalCost", "isActive", "lastName", "licenseType", "locationID", "middleName", "mobilePhone", "numberFormat", "officeExtension", "officePhone", "payrollIdentifier", "payrollType", "resourceType", "suffix", "surveyResourceRating", "timeFormat", "title", "travelAvailabilityPct", "userName", "userType"],
224
- "roles": ["id", "description", "hourlyFactor", "hourlyRate", "isActive", "isExcludedFromNewContracts", "isSystemRole", "name", "quoteItemDefaultTaxCategoryId", "roleType"],
225
- "service_call_task_resources": ["id", "resourceID", "serviceCallTaskID", "soapParentPropertyId"],
226
- "service_call_tasks": ["id", "serviceCallID", "taskID", "soapParentPropertyId"],
227
- "service_call_ticket_resources": ["id", "resourceID", "serviceCallTicketID", "soapParentPropertyId"],
228
- "service_call_tickets": ["id", "serviceCallID", "ticketID", "soapParentPropertyId"],
229
- "service_calls": ["id", "cancelationNoticeHours", "canceledByResourceID", "canceledDateTime", "companyID", "companyLocationID", "createDateTime", "creatorResourceID", "description", "duration", "endDateTime", "impersonatorCreatorResourceID", "isComplete", "lastModifiedDateTime", "startDateTime", "status"],
230
- "service_level_agreement_results": ["id", "firstResponseElapsedHours", "firstResponseInitiatingResourceID", "firstResponseResourceID", "isFirstResponseMet", "isResolutionMet", "isResolutionPlanMet", "resolutionElapsedHours", "resolutionPlanElapsedHours", "resolutionPlanResourceID", "resolutionResourceID", "serviceLevelAgreementName", "ticketID", "soapParentPropertyId"],
231
- "services": ["id", "billingCodeID", "createDate", "creatorResourceID", "description", "invoiceDescription", "isActive", "lastModifiedDate", "markupRate", "name", "periodType", "serviceLevelAgreementID", "unitCost", "unitPrice", "updateResourceID", "vendorCompanyID", "manufacturerServiceProvider", "manufacturerServiceProviderProductNumber", "catalogNumberPartNumber", "sku", "internalID", "externalID", "url", "userDefinedFields"],
232
- "skills": ["id", "categoryID", "description", "isActive", "name"],
233
- "subscription_periods": ["id", "periodCost", "periodDate", "periodPrice", "postedDate", "purchaseOrderNumber", "subscriptionID", "soapParentPropertyId"],
234
- "subscriptions": ["id", "configurationItemID", "description", "effectiveDate", "expirationDate", "impersonatorCreatorResourceID", "materialCodeID", "organizationalLevelAssociationID", "periodCost", "periodPrice", "periodType", "purchaseOrderNumber", "status", "subscriptionName", "totalCost", "totalPrice", "vendorID", "userDefinedFields"],
235
- "survey_results": ["id", "companyID", "companyRating", "completeDate", "contactID", "contactRating", "resourceRating", "sendDate", "surveyID", "surveyRating", "ticketID"],
236
- "surveys": ["id", "description", "displayName", "name"],
237
- "tag_aliases": ["id", "alias", "tagID", "soapParentPropertyId"],
238
- "tag_groups": ["id", "displayColor", "isActive", "isSystem", "label"],
239
- "tags": ["id", "createDateTime", "isActive", "isExcludedFromAutomaticTagging", "isSystem", "label", "lastModifiedDateTime", "tagGroupID"],
240
- "task_secondary_resources": ["id", "resourceID", "roleID", "taskID", "soapParentPropertyId"],
241
- "tasks": ["id", "assignedResourceID", "assignedResourceRoleID", "billingCodeID", "canClientPortalUserCompleteTask", "companyLocationID", "completedByResourceID", "completedByType", "completedDateTime", "createDateTime", "creatorResourceID", "creatorType", "departmentID", "description", "endDateTime", "estimatedHours", "externalID", "hoursToBeScheduled", "isTaskBillable", "isVisibleInClientPortal", "lastActivityDateTime", "lastActivityPersonType", "lastActivityResourceID", "phaseID", "priority", "priorityLabel", "projectID", "purchaseOrderNumber", "remainingHours", "startDateTime", "status", "taskCategoryID", "taskNumber", "taskType", "title", "soapParentPropertyId", "userDefinedFields"],
242
- "ticket_additional_configuration_items": ["id", "configurationItemID", "ticketID", "soapParentPropertyId"],
243
- "ticket_additional_contacts": ["id", "contactID", "ticketID", "soapParentPropertyId"],
244
- "ticket_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentAttachmentID", "parentID", "publish", "ticketID", "ticketNoteID", "timeEntryID", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
245
- "ticket_categories": ["id", "displayColorRGB", "isActive", "isApiOnly", "isGlobalDefault", "name", "nickname"],
246
- "ticket_category_field_defaults": ["id", "description", "estimatedHours", "issueTypeID", "organizationalLevelAssociationID", "priority", "purchaseOrderNumber", "queueID", "resolution", "serviceLevelAgreementID", "sourceID", "status", "subIssueTypeID", "ticketCategoryID", "ticketTypeID", "title", "workTypeID", "soapParentPropertyId"],
247
- "ticket_change_request_approvals": ["id", "approveRejectDateTime", "approveRejectNote", "contactID", "isApproved", "resourceID", "ticketID", "soapParentPropertyId"],
248
- "ticket_charges": ["id", "billableAmount", "billingCodeID", "chargeType", "contractServiceBundleID", "contractServiceID", "createDate", "creatorResourceID", "datePurchased", "description", "extendedCost", "internalCurrencyBillableAmount", "internalCurrencyUnitPrice", "internalPurchaseOrderNumber", "isBillableToCompany", "isBilled", "name", "notes", "organizationalLevelAssociationID", "productID", "purchaseOrderNumber", "status", "statusLastModifiedBy", "statusLastModifiedDate", "ticketID", "unitCost", "unitPrice", "unitQuantity", "soapParentPropertyId"],
249
- "ticket_checklist_items": ["id", "completedByResourceID", "completedDateTime", "isCompleted", "isImportant", "itemName", "knowledgebaseArticleID", "position", "ticketID", "soapParentPropertyId"],
250
- "ticket_history": ["id", "action", "date", "detail", "resourceID", "ticketID", "soapParentPropertyId"],
251
- "ticket_note_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "ticketID", "ticketNoteID", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
252
- "ticket_note_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
253
- "ticket_notes": ["id", "createDateTime", "createdByContactID", "creatorResourceID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "noteType", "publish", "ticketID", "title", "soapParentPropertyId"],
254
- "ticket_secondary_resources": ["id", "resourceID", "roleID", "ticketID", "soapParentPropertyId"],
255
- "ticket_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
256
- "tickets": ["id", "apiVendorID", "assignedResourceID", "assignedResourceRoleID", "billingCodeID", "changeApprovalBoard", "changeApprovalStatus", "changeApprovalType", "changeInfoField1", "changeInfoField2", "changeInfoField3", "changeInfoField4", "changeInfoField5", "companyID", "companyLocationID", "completedByResourceID", "completedDate", "configurationItemID", "contactID", "contractID", "contractServiceBundleID", "contractServiceID", "createDate", "createdByContactID", "creatorResourceID", "creatorType", "currentServiceThermometerRating", "description", "dueDateTime", "estimatedHours", "externalID", "firstResponseAssignedResourceID", "firstResponseDateTime", "firstResponseDueDateTime", "firstResponseInitiatingResourceID", "hoursToBeScheduled", "impersonatorCreatorResourceID", "isAssignedToComanaged", "issueType", "isVisibleToComanaged", "lastActivityDate", "lastActivityPersonType", "lastActivityResourceID", "lastCustomerNotificationDateTime", "lastCustomerVisibleActivityDateTime", "lastTrackedModificationDateTime", "monitorID", "monitorTypeID", "opportunityID", "organizationalLevelAssociationID", "previousServiceThermometerRating", "priority", "problemTicketId", "projectID", "purchaseOrderNumber", "queueID", "resolution", "resolutionPlanDateTime", "resolutionPlanDueDateTime", "resolvedDateTime", "resolvedDueDateTime", "rmaStatus", "rmaType", "rmmAlertID", "serviceLevelAgreementHasBeenMet", "serviceLevelAgreementID", "serviceLevelAgreementPausedNextEventHours", "serviceThermometerTemperature", "source", "status", "subIssueType", "ticketCategory", "ticketNumber", "ticketType", "title", "userDefinedFields"],
257
- "time_entries": ["id", "billingApprovalDateTime", "billingApprovalLevelMostRecent", "billingApprovalResourceID", "billingCodeID", "contractID", "contractServiceBundleID", "contractServiceID", "createDateTime", "creatorUserID", "dateWorked", "endDateTime", "hoursToBill", "hoursWorked", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "internalBillingCodeID", "internalNotes", "isInternalNotesVisibleToComanaged", "isNonBillable", "lastModifiedDateTime", "lastModifiedUserID", "offsetHours", "resourceID", "roleID", "showOnInvoice", "startDateTime", "summaryNotes", "taskID", "ticketID", "timeEntryType"],
258
- "time_entry_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "taskID", "ticketID", "timeEntryID", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
259
- "time_off_requests": ["id", "approvedDateTime", "approveRejectResourceID", "createdByResourceID", "createDateTime", "endTime", "hours", "impersonatorApproveRejectResourceID", "lastModifiedByResourceID", "lastModifiedDateTime", "lastApprovedLevel", "reason", "rejectReason", "requestDate", "resourceID", "startTime", "status", "timeOffRequestType", "soapParentPropertyId"]
260
- };
261
- var MODEL_DATE_FIELDS = {
262
- "appointments": ["createDateTime", "endDateTime", "startDateTime", "updateDateTime"],
263
- "billing_items": ["itemDate", "postedDate", "postedOnTime", "webServiceDate"],
264
- "companies": ["createDate", "lastActivityDate", "lastTrackedModifiedDateTime"],
265
- "company_notes": ["completedDateTime", "createDateTime", "endDateTime", "lastModifiedDate", "startDateTime"],
266
- "configuration_item_billing_product_associations": ["effectiveDate", "expirationDate"],
267
- "configuration_item_dns_records": ["createDateTime"],
268
- "configuration_item_notes": ["createDateTime", "lastActivityDate"],
269
- "configuration_items": ["createDate", "dattoLastCheckInDateTime", "domainRegistrationDateTime", "domainLastUpdatedDateTime", "domainExpirationDateTime", "installDate", "lastModifiedTime", "sslValidFromDateTime", "sslValidUntilDateTime", "warrantyExpirationDate"],
270
- "contacts": ["bulkEmailOptOutTime", "createDate", "lastActivityDate", "lastModifiedDate", "solicitationOptOutTime"],
271
- "contract_billing_rules": ["endDate", "startDate"],
272
- "contract_blocks": ["datePurchased", "endDate", "startDate"],
273
- "contract_charges": ["createDate", "datePurchased", "statusLastModifiedDate"],
274
- "contract_milestones": ["createDate", "dateDue"],
275
- "contract_notes": ["createDateTime", "lastActivityDate"],
276
- "contract_retainers": ["datePurchased", "endDate", "startDate"],
277
- "contract_service_bundle_units": ["approveAndPostDate", "endDate", "startDate"],
278
- "contract_service_units": ["approveAndPostDate", "endDate", "startDate"],
279
- "contract_ticket_purchases": ["datePurchased", "endDate", "startDate"],
280
- "contracts": ["endDate", "lastModifiedDateTime", "startDate"],
281
- "expense_item_attachments": ["attachDate"],
282
- "expense_items": ["expenseDate"],
283
- "expense_reports": ["approvedDate", "submitDate", "weekEnding"],
284
- "holidays": ["holidayDate"],
285
- "inventory_products": ["createDateTime"],
286
- "invoices": ["createDateTime", "dueDate", "fromDate", "invoiceDateTime", "paidDate", "toDate", "voidedDate", "webServiceDate"],
287
- "notification_history": ["notificationSentTime"],
288
- "opportunities": ["closedDate", "createDate", "lastActivity", "lostDate", "projectedCloseDate", "promisedFulfillmentDate", "startDate", "throughDate"],
289
- "opportunity_attachments": ["attachDate"],
290
- "phases": ["createDate", "dueDate", "lastActivityDateTime", "startDate"],
291
- "products": ["createdTime"],
292
- "project_charges": ["createDate", "datePurchased", "statusLastModifiedDate"],
293
- "project_notes": ["createDateTime", "lastActivityDate"],
294
- "projects": ["completedDateTime", "createDateTime", "endDateTime", "lastActivityDateTime", "startDateTime", "statusDateTime"],
295
- "purchase_order_item_receiving": ["receiveDate"],
296
- "purchase_order_items": ["estimatedArrivalDate"],
297
- "purchase_orders": ["cancelDateTime", "createDateTime", "latestEstimatedArrivalDate", "shippingDate", "submitDateTime"],
298
- "quote_templates": ["createDate", "lastActivityDate"],
299
- "quotes": ["approvalStatusChangedDate", "createDate", "effectiveDate", "expirationDate", "extApprovalResponseDate", "lastActivityDate", "lastPublishedDateTime"],
300
- "resources": ["hireDate"],
301
- "service_calls": ["canceledDateTime", "createDateTime", "endDateTime", "lastModifiedDateTime", "startDateTime"],
302
- "services": ["createDate", "lastModifiedDate"],
303
- "subscription_periods": ["periodDate", "postedDate"],
304
- "subscriptions": ["effectiveDate", "expirationDate"],
305
- "survey_results": ["completeDate", "sendDate"],
306
- "tags": ["createDateTime", "lastModifiedDateTime"],
307
- "tasks": ["completedDateTime", "createDateTime", "endDateTime", "lastActivityDateTime", "startDateTime"],
308
- "ticket_attachments": ["attachDate"],
309
- "ticket_change_request_approvals": ["approveRejectDateTime"],
310
- "ticket_charges": ["createDate", "datePurchased", "statusLastModifiedDate"],
311
- "ticket_checklist_items": ["completedDateTime"],
312
- "ticket_history": ["date"],
313
- "ticket_note_attachments": ["attachDate"],
314
- "ticket_notes": ["createDateTime", "lastActivityDate"],
315
- "tickets": ["completedDate", "createDate", "dueDateTime", "firstResponseDateTime", "firstResponseDueDateTime", "lastActivityDate", "lastCustomerNotificationDateTime", "lastCustomerVisibleActivityDateTime", "lastTrackedModificationDateTime", "resolutionPlanDateTime", "resolutionPlanDueDateTime", "resolvedDateTime", "resolvedDueDateTime"],
316
- "time_entries": ["billingApprovalDateTime", "createDateTime", "dateWorked", "endDateTime", "lastModifiedDateTime", "startDateTime"],
317
- "time_entry_attachments": ["attachDate"],
318
- "time_off_requests": ["approvedDateTime", "createDateTime", "endTime", "lastModifiedDateTime", "requestDate", "startTime"]
319
- };
320
-
321
- // src/operations/fetchMany.ts
322
- var FETCH_MANY_MAX_ITEMS = 20;
323
- function validateFetchManyItems(items, cap, opName = "fetchMany", capRef = `FETCH_MANY_MAX_ITEMS = ${FETCH_MANY_MAX_ITEMS}`, validation) {
324
- if (!Array.isArray(items)) {
325
- throw new AutotaskConfigError(
326
- `${opName}: items must be the items ARRAY \u2014 one positional arg, [{ resource: string, id: number, fields?: string[] }] (got ${Array.isArray(items) ? "an array" : typeof items})`,
327
- {
328
- suggestedAction: 'Pass args = [[{ resource: "tickets", id: 123 }, { resource: "projects", id: 456 }]] \u2014 the items array is the single positional argument.'
329
- }
330
- );
331
- }
332
- if (items.length === 0) {
333
- throw new AutotaskConfigError(`${opName}: items must not be empty (a zero-item batch is a shape error, not a no-op)`, {
334
- suggestedAction: "Pass at least one { resource, id } item \u2014 or use the resource's query op for a filtered read."
335
- });
336
- }
337
- if (items.length > cap) {
338
- throw new AutotaskConfigError(
339
- `${opName}: ${items.length} items over the ${cap}-item cap (${capRef}) \u2014 zero items were fetched (pre-request)`,
340
- {
341
- suggestedAction: `Split the batch into groups of <= ${cap} items \u2014 or, for more than ${cap} records / a filtered set, use the resource's bounded query op (<resource>.query).`
342
- }
343
- );
344
- }
345
- const problems = [];
346
- for (let i = 0; i < items.length; i += 1) {
347
- const it = items[i];
348
- const at = `items[${i}]`;
349
- if (typeof it !== "object" || it === null || Array.isArray(it)) {
350
- problems.push(`${at}: must be an object { resource: string, id: number, fields?: string[] }`);
351
- continue;
352
- }
353
- const item = it;
354
- if (typeof item.resource !== "string" || item.resource.trim() === "") {
355
- problems.push(`${at}.resource: required \u2014 the plan resource key (string, e.g. 'tickets'; see autotask_catalog)`);
356
- continue;
357
- }
358
- const resourceKey = item.resource;
359
- const fields = MODEL_FIELD_SETS[resourceKey];
360
- if (fields === void 0) {
361
- problems.push(
362
- `${at}.resource: "${resourceKey}" is not a single-record GETtable resource (${Object.keys(MODEL_FIELD_SETS).length} known) \u2014 see autotask_catalog for the exact plan keys`
363
- );
364
- continue;
365
- }
366
- const rel = RELATIONSHIP_MAP[resourceKey];
367
- if (rel !== void 0 && rel.parentScoped) {
368
- problems.push(
369
- `${at}.resource: "${resourceKey}" is a parent-scoped child \u2014 its get needs (parentId, id); fetchMany takes single numeric ids of TOP-LEVEL records (scoped reads: client.${camelKey(resourceKey)}.get(parentId, id))`
370
- );
371
- continue;
372
- }
373
- try {
374
- parseIdentifier(item.id, `${at}.id`);
375
- } catch {
376
- if (typeof item.id === "string") {
377
- problems.push(
378
- `${at}.id: "${item.id}" is not a vendor numeric id \u2014 non-numeric string identifiers are autotask_resolve_any territory (resolveAny / the resource's findBy* helpers)`
379
- );
380
- } else if (typeof item.id === "number") {
381
- problems.push(
382
- `${at}.id: ${item.id} is not a non-negative safe integer (a JS number this large is already corrupted \u2014 pass the canonical integer string form)`
383
- );
384
- } else {
385
- problems.push(`${at}.id: required \u2014 the vendor numeric id (safe integer, or the canonical integer string for ids above 2^53)`);
386
- }
387
- continue;
388
- }
389
- if (item.fields !== void 0) {
390
- if (!Array.isArray(item.fields) || item.fields.some((f) => typeof f !== "string")) {
391
- problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via operations.fieldCatalog)`);
392
- continue;
393
- }
394
- if (validation?.fieldCheck !== false) {
395
- const authoritative = validation?.fieldSetsByResource?.get(resourceKey) ?? fields;
396
- for (const f of item.fields) {
397
- if (!authoritative.includes(f)) {
398
- problems.push(
399
- `${at}.fields: "${f}" is not a field of ${resourceKey} \u2014 a hallucinated field is a shape error, not a silent projection-miss (exact vendor field names via operations.fieldCatalog)`
400
- );
401
- }
402
- }
403
- }
404
- }
405
- }
406
- if (problems.length > 0) {
407
- throw new AutotaskConfigError(
408
- `${opName}: ${problems.length} problem(s) found pre-request (zero wire was issued)
409
- - ` + problems.join("\n- "),
410
- { suggestedAction: "Fix every item above and call again \u2014 validation covers the whole batch up-front (one round, zero wire)." }
411
- );
412
- }
413
- }
414
- function project(value, fields) {
415
- const out = {};
416
- for (const f of fields) {
417
- if (f in value) out[f] = value[f];
418
- }
419
- return out;
420
- }
421
- async function fetchMany(client, items, opts = {}) {
422
- if (opts.maxItems !== void 0) {
423
- if (!Number.isInteger(opts.maxItems) || opts.maxItems < 1) {
424
- throw new AutotaskConfigError(`fetchMany: maxItems must be an integer >= 1 (got ${String(opts.maxItems)})`);
425
- }
426
- }
427
- if (opts.liveFields !== void 0 && typeof opts.liveFields !== "boolean") {
428
- throw new AutotaskConfigError(`fetchMany: liveFields must be a boolean (got ${typeof opts.liveFields})`);
429
- }
430
- const cap = Math.min(FETCH_MANY_MAX_ITEMS, opts.maxItems ?? FETCH_MANY_MAX_ITEMS);
431
- if (opts.liveFields === true) {
432
- validateFetchManyItems(items, cap, void 0, void 0, { fieldCheck: false });
433
- const liveFieldSets = /* @__PURE__ */ new Map();
434
- for (const item of items) {
435
- const key = item.resource;
436
- if (liveFieldSets.has(key)) continue;
437
- const holder = client[camelKey(key)];
438
- if (holder === void 0) {
439
- throw new AutotaskConfigError(`fetchMany: the client exposes no accessor for resource "${key}"`, {
440
- suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
441
- });
442
- }
443
- try {
444
- const rows = await holder.getFieldInfo();
445
- const names = [];
446
- for (const row of rows) {
447
- if (typeof row.name === "string") names.push(row.name);
448
- }
449
- liveFieldSets.set(key, names.length > 0 ? names : null);
450
- } catch (err) {
451
- if (!isAutotaskError(err) || err.code === "ABORTED") throw err;
452
- liveFieldSets.set(key, null);
453
- }
454
- }
455
- validateFetchManyItems(items, cap, void 0, void 0, { fieldSetsByResource: liveFieldSets });
456
- } else {
457
- validateFetchManyItems(items, cap);
458
- }
459
- const results = [];
460
- for (const item of items) {
461
- const key = item.resource;
462
- const id = parseIdentifier(item.id, `items[${results.length}].id`);
463
- const holder = client[camelKey(key)];
464
- if (holder === void 0) {
465
- throw new AutotaskConfigError(`fetchMany: the client exposes no accessor for resource "${key}"`, {
466
- suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
467
- });
468
- }
469
- try {
470
- const value = await holder.get(id);
471
- results.push({ resource: key, id, found: true, value: item.fields !== void 0 ? project(value, item.fields) : value });
472
- } catch (err) {
473
- if (err instanceof NotFoundError) {
474
- results.push({ resource: key, id, found: false, value: null, error: { code: "NOT_FOUND", message: err.message } });
475
- } else if (isAutotaskError(err) && err.code !== "ABORTED") {
476
- const e = { code: err.code, message: err.message };
477
- if (err.httpStatus !== void 0) e.httpStatus = err.httpStatus;
478
- results.push({ resource: key, id, found: false, value: null, error: e });
479
- } else {
480
- throw err;
481
- }
482
- }
483
- }
484
- const ok = results.filter((r) => r.found).length;
485
- return { results, ok, failed: results.length - ok };
486
- }
487
-
488
147
  // src/operations/aggregate.ts
489
148
  var AGGREGATE_TOP_MAX = 100;
490
149
  var AGGREGATE_DEFAULT_TOP = 25;
@@ -729,130 +388,6 @@ async function aggregate(client, operation, filter, opts = {}) {
729
388
  return result;
730
389
  }
731
390
 
732
- // src/operations/fetchByIds.ts
733
- var FETCH_BY_IDS_MAX_ITEMS = 500;
734
- var FETCH_BY_IDS_CHUNK_SIZE = 250;
735
- function project2(value, fields) {
736
- const out = {};
737
- for (const f of fields) {
738
- if (f in value) out[f] = value[f];
739
- }
740
- return out;
741
- }
742
- function resourcePathOf(key, holder) {
743
- const path = holder?.resourcePath;
744
- if (typeof path !== "string" || path === "") {
745
- throw new AutotaskConfigError(`fetchByIds: the client exposes no ${key} resource path (registry drift)`, {
746
- suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
747
- });
748
- }
749
- return path;
750
- }
751
- async function fetchByIds(client, items, opts = {}) {
752
- if (opts.maxItems !== void 0) {
753
- if (!Number.isInteger(opts.maxItems) || opts.maxItems < 1) {
754
- throw new AutotaskConfigError(`fetchByIds: maxItems must be an integer >= 1 (got ${String(opts.maxItems)})`);
755
- }
756
- }
757
- const cap = Math.min(FETCH_BY_IDS_MAX_ITEMS, opts.maxItems ?? FETCH_BY_IDS_MAX_ITEMS);
758
- validateFetchManyItems(items, cap, "fetchByIds", `FETCH_BY_IDS_MAX_ITEMS = ${FETCH_BY_IDS_MAX_ITEMS}`);
759
- const groups = /* @__PURE__ */ new Map();
760
- const canonical = [];
761
- for (let i = 0; i < items.length; i += 1) {
762
- const item = items[i];
763
- const id = parseIdentifier(item.id, `items[${i}].id`);
764
- canonical[i] = id;
765
- const g = groups.get(item.resource) ?? { indices: [], fields: /* @__PURE__ */ new Set(), anyFields: false };
766
- g.indices.push(i);
767
- if (item.fields !== void 0) {
768
- g.anyFields = true;
769
- for (const f of item.fields) g.fields.add(f);
770
- }
771
- groups.set(item.resource, g);
772
- }
773
- const byKey = /* @__PURE__ */ new Map();
774
- for (const [key, group] of groups) {
775
- const holder = client[camelKey(key)];
776
- if (holder === void 0) {
777
- throw new AutotaskConfigError(`fetchByIds: the client exposes no accessor for resource "${key}"`, {
778
- suggestedAction: "Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan)."
779
- });
780
- }
781
- const resourcePath = resourcePathOf(key, holder);
782
- const unique = [];
783
- const seen = /* @__PURE__ */ new Set();
784
- for (const i of group.indices) {
785
- const k = String(canonical[i]);
786
- if (!seen.has(k)) {
787
- seen.add(k);
788
- unique.push(canonical[i]);
789
- }
790
- }
791
- const includeFields = group.anyFields && group.indices.every((i) => items[i].fields !== void 0) ? [...group.fields] : void 0;
792
- const kOf = (id) => `${key}:${String(id)}`;
793
- for (let c = 0; c < unique.length; c += FETCH_BY_IDS_CHUNK_SIZE) {
794
- const chunk = unique.slice(c, c + FETCH_BY_IDS_CHUNK_SIZE);
795
- const chunkKeys = new Set(chunk.map((id) => String(id)));
796
- try {
797
- const req = buildQueryRequest(client.http.baseUrl, resourcePath, {
798
- filter: [{ field: "id", op: "in", value: chunk }],
799
- maxRecords: FETCH_BY_IDS_CHUNK_SIZE,
800
- includeFields
801
- });
802
- const res = await client.http.request({ ...req, operation: `${key}.fetchByIds` });
803
- const { items: rows } = unwrapItems(res, `${key}.fetchByIds`);
804
- for (const row of rows) {
805
- const k = String(row.id);
806
- if (!chunkKeys.has(k)) continue;
807
- const q = kOf(k);
808
- if (!byKey.has(q)) byKey.set(q, { found: true, value: row });
809
- }
810
- } catch (err) {
811
- if (isAutotaskError(err) && err.code !== "ABORTED") {
812
- const e = { code: err.code, message: err.message };
813
- if (err.httpStatus !== void 0) e.httpStatus = err.httpStatus;
814
- for (const u of chunk) {
815
- const q = kOf(u);
816
- if (!byKey.has(q)) byKey.set(q, { found: false, value: null, error: e });
817
- }
818
- continue;
819
- }
820
- throw err;
821
- }
822
- }
823
- for (const id of unique) {
824
- const k = kOf(id);
825
- if (byKey.has(k)) continue;
826
- try {
827
- const value = await holder.get(id);
828
- byKey.set(k, { found: true, value });
829
- } catch (err) {
830
- if (err instanceof NotFoundError) {
831
- byKey.set(k, { found: false, value: null, error: { code: "NOT_FOUND", message: err.message } });
832
- } else if (isAutotaskError(err) && err.code !== "ABORTED") {
833
- const e = { code: err.code, message: err.message };
834
- if (err.httpStatus !== void 0) e.httpStatus = err.httpStatus;
835
- byKey.set(k, { found: false, value: null, error: e });
836
- } else {
837
- throw err;
838
- }
839
- }
840
- }
841
- }
842
- const results = [];
843
- for (let i = 0; i < items.length; i += 1) {
844
- const item = items[i];
845
- const id = canonical[i];
846
- const out = byKey.get(`${item.resource}:${String(id)}`);
847
- const value = out.found ? item.fields !== void 0 ? project2(out.value, item.fields) : out.value : null;
848
- results.push(
849
- out.found ? { resource: item.resource, id, found: true, value } : { resource: item.resource, id, found: false, value: null, error: out.error }
850
- );
851
- }
852
- const ok = results.filter((r) => r.found).length;
853
- return { results, ok, failed: results.length - ok };
854
- }
855
-
856
391
  // src/operations/relationshipMap.ts
857
392
  async function relationshipMap(client, resourceKey) {
858
393
  void client;