node-autotask 0.9.0 → 0.11.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 (77) hide show
  1. package/MCP_TOOL_CATALOG.json +3 -3
  2. package/MCP_TOOL_MANIFEST.md +5 -5
  3. package/N8N_MCP_MANIFEST.json +2 -2
  4. package/N8N_MCP_MANIFEST.md +3 -3
  5. package/capabilities.json +1354 -1263
  6. package/dist/capabilities.cjs +2 -3
  7. package/dist/capabilities.js +1 -2
  8. package/dist/{chunk-53MC2QRQ.cjs → chunk-25ZUKHS4.cjs} +135 -136
  9. package/dist/{chunk-BZPFDRAE.js → chunk-7L23FDQW.js} +1353 -1263
  10. package/dist/{chunk-UYJ5V262.js → chunk-CJONZQ7E.js} +32 -182
  11. package/dist/chunk-DMMMWO6A.js +0 -0
  12. package/dist/chunk-FLB2X6O5.cjs +1 -0
  13. package/dist/chunk-IDPB4N2Q.cjs +1 -0
  14. package/dist/{chunk-UDWV4VVD.js → chunk-LNRN45XS.js} +214 -20
  15. package/dist/{chunk-OYHKIYVR.cjs → chunk-QAX222R6.cjs} +422 -572
  16. package/dist/{chunk-QJU2N32V.js → chunk-SXHPUQMB.js} +2 -3
  17. package/dist/{chunk-LTKMTXUR.cjs → chunk-T5FLSJOD.cjs} +1353 -1263
  18. package/dist/chunk-UPQIUWOS.js +0 -0
  19. package/dist/{chunk-RWLPTU67.cjs → chunk-YKEX4SK7.cjs} +235 -41
  20. package/dist/{index-ZknpNhtc.d.ts → index-B_xToSpq.d.ts} +8 -8
  21. package/dist/{index-CfU1JDgS.d.cts → index-Dv_GSZaN.d.cts} +8 -8
  22. package/dist/{index-O2zzIMcQ.d.cts → index-cQ6CRexR.d.cts} +3 -1
  23. package/dist/{index-O2zzIMcQ.d.ts → index-cQ6CRexR.d.ts} +3 -1
  24. package/dist/index.cjs +21 -22
  25. package/dist/index.d.cts +4 -4
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +6 -7
  28. package/dist/operations/index.cjs +284 -131
  29. package/dist/operations/index.d.cts +28 -5
  30. package/dist/operations/index.d.ts +28 -5
  31. package/dist/operations/index.js +160 -7
  32. package/dist/pool.cjs +36 -12
  33. package/dist/pool.d.cts +2 -2
  34. package/dist/pool.d.ts +2 -2
  35. package/dist/pool.js +31 -7
  36. package/dist/resources/index.cjs +5 -6
  37. package/dist/resources/index.d.cts +2 -2
  38. package/dist/resources/index.d.ts +2 -2
  39. package/dist/resources/index.js +4 -5
  40. package/dist/types/index.cjs +1 -2
  41. package/dist/types/index.d.cts +1 -1
  42. package/dist/types/index.d.ts +1 -1
  43. package/dist/types/index.js +1 -2
  44. package/dist/untrusted.cjs +0 -1
  45. package/dist/untrusted.js +0 -1
  46. package/docs/API.md +12 -6
  47. package/package.json +1 -1
  48. package/dist/capabilities.cjs.map +0 -1
  49. package/dist/capabilities.js.map +0 -1
  50. package/dist/chunk-53MC2QRQ.cjs.map +0 -1
  51. package/dist/chunk-BZPFDRAE.js.map +0 -1
  52. package/dist/chunk-CXM35TEC.cjs +0 -1
  53. package/dist/chunk-CXM35TEC.cjs.map +0 -1
  54. package/dist/chunk-GIVD2CQ3.js +0 -1
  55. package/dist/chunk-GIVD2CQ3.js.map +0 -1
  56. package/dist/chunk-LTKMTXUR.cjs.map +0 -1
  57. package/dist/chunk-MHBMSBTA.js +0 -1
  58. package/dist/chunk-MHBMSBTA.js.map +0 -1
  59. package/dist/chunk-NZUFSSIZ.cjs +0 -1
  60. package/dist/chunk-NZUFSSIZ.cjs.map +0 -1
  61. package/dist/chunk-OYHKIYVR.cjs.map +0 -1
  62. package/dist/chunk-QJU2N32V.js.map +0 -1
  63. package/dist/chunk-RWLPTU67.cjs.map +0 -1
  64. package/dist/chunk-UDWV4VVD.js.map +0 -1
  65. package/dist/chunk-UYJ5V262.js.map +0 -1
  66. package/dist/index.cjs.map +0 -1
  67. package/dist/index.js.map +0 -1
  68. package/dist/operations/index.cjs.map +0 -1
  69. package/dist/operations/index.js.map +0 -1
  70. package/dist/pool.cjs.map +0 -1
  71. package/dist/pool.js.map +0 -1
  72. package/dist/resources/index.cjs.map +0 -1
  73. package/dist/resources/index.js.map +0 -1
  74. package/dist/types/index.cjs.map +0 -1
  75. package/dist/types/index.js.map +0 -1
  76. package/dist/untrusted.cjs.map +0 -1
  77. package/dist/untrusted.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/operations/searchAcrossResources.ts","../../src/operations/resolveAny.ts","../../src/field-sets.ts","../../src/operations/fetchMany.ts","../../src/operations/aggregate.ts","../../src/operations/fetchByIds.ts","../../src/operations/relationshipMap.ts","../../src/operations/blindSurfaces.ts","../../src/operations/probeReachability.ts","../../src/operations/createGuidance.ts","../../src/operations/recovery.ts","../../src/operations/invoke.ts"],"sourcesContent":["/**\n * `operations.searchAcrossResources` — bounded multi-resource text search\n * (ARCHITECTURE section 19.2).\n *\n * Runs each requested resource's OWN `search` helper (server-side bounded\n * `contains` — never a listAll scan) across the selected resources with one\n * limit budget. Resources without a `search` helper are skipped and REPORTED\n * (the `skipped` array), never errored. The limit defaults to 25 per\n * resource and is clamped to the vendor max of 500.\n */\nimport { AutotaskConfigError } from '../errors.js';\nimport { clampPageSize } from '../pagination.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey } from '../utils/index.js';\nimport {\n WORKFLOW_RESOURCES,\n type SearchAcrossResourcesOptions,\n type SearchAcrossResourcesResult,\n type SearchAcrossResourcesRow,\n} from './types.js';\n\nconst DEFAULT_LIMIT = 25;\n\n/** A resource surface that carries the `search` helper. */\ninterface Searchable {\n search(query: string, opts?: { limit?: number }): Promise<unknown>;\n}\n\nfunction resourceFor<T>(client: AutotaskClient, key: string): T | undefined {\n return (client as unknown as Record<string, T | undefined>)[camelKey(key)];\n}\n\nexport async function searchAcrossResources(\n client: AutotaskClient,\n query: string,\n opts: SearchAcrossResourcesOptions = {},\n): Promise<SearchAcrossResourcesResult> {\n const text = query.trim();\n if (text === '') {\n throw new AutotaskConfigError('searchAcrossResources: query must be a non-empty string');\n }\n const keys = opts.resources ?? WORKFLOW_RESOURCES;\n if (keys.length === 0) {\n throw new AutotaskConfigError('searchAcrossResources: no resources requested');\n }\n const limit = clampPageSize(opts.limit ?? DEFAULT_LIMIT);\n const results: SearchAcrossResourcesRow[] = [];\n const skipped: string[] = [];\n for (const key of keys) {\n const holder = resourceFor<Searchable>(client, key);\n if (holder === undefined || typeof holder.search !== 'function') {\n skipped.push(key);\n continue;\n }\n const matches = await holder.search(text, { limit });\n const rows = Array.isArray(matches)\n ? matches\n .filter((m): m is Record<string, unknown> => typeof m === 'object' && m !== null)\n .map((m) => m as Record<string, unknown>)\n : [];\n results.push({ resource: key, matches: rows });\n }\n return { query: text, results, skipped };\n}\n","/**\n * `operations.resolveAny` — one identifier against several resources\n * (ARCHITECTURE section 19.2).\n *\n * Calls each requested resource's `resolve` with the SAME identifier. Unlike\n * single-resource `resolve`, a miss does NOT throw: the result lists\n * per-resource candidates and the error code when a resource could not\n * resolve (empty `candidates` = no match). Bare-value order per resource:\n * numeric id, then the primary text field (the resource's `searchCovers`),\n * exact match only; with `resolution.scanOnMiss` the bounded client-scan\n * re-check (and its truncation cap) applies per resource.\n */\nimport { AutotaskConfigError, isAutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey, parseIdentifier } from '../utils/index.js';\nimport type { BaseResource } from '../resources/base.js';\nimport {\n WORKFLOW_RESOURCES,\n type ResolveAnyOptions,\n type ResolveAnyResourceOutcome,\n type ResolveAnyResult,\n} from './types.js';\n\nfunction resourceFor<T>(client: AutotaskClient, key: string): T | undefined {\n return (client as unknown as Record<string, T | undefined>)[camelKey(key)];\n}\n\n/** Error categories that are real faults, not resolution misses. */\nconst FAULT_CATEGORIES: ReadonlySet<string> = new Set(['auth', 'rate_limit', 'server', 'network', 'timeout', 'policy']);\n\n/** The cost label for a miss: what the resolution attempted. */\nfunction missCost(identifier: number | string): 'direct' | 'server-filter' {\n if (typeof identifier === 'number') return 'direct';\n return /^\\d+$/.test(identifier.trim()) ? 'direct' : 'server-filter';\n}\n\nexport async function resolveAny(\n client: AutotaskClient,\n identifier: number | string,\n opts: ResolveAnyOptions = {},\n): Promise<ResolveAnyResult> {\n if (typeof identifier === 'number') {\n // The SAME identifier contract as every other read path (QA §3\n // unification): parseIdentifier refuses an unsafe (already corrupted)\n // JS number pre-scan, instead of N per-resource CONFIG_ERROR misses.\n parseIdentifier(identifier, 'identifier');\n } else if (identifier.trim() === '') {\n throw new AutotaskConfigError('resolveAny: identifier must be non-empty');\n }\n const keys = opts.resources ?? WORKFLOW_RESOURCES;\n if (keys.length === 0) {\n throw new AutotaskConfigError('resolveAny: no resources requested');\n }\n const results: ResolveAnyResourceOutcome[] = [];\n for (const key of keys) {\n const holder = resourceFor<BaseResource<Record<string, unknown>>>(client, key);\n if (holder === undefined || typeof holder.resolveDetailed !== 'function') {\n // No resolve surface on this resource: reported, not errored.\n results.push({\n resource: key,\n value: null,\n resolutionCost: missCost(identifier),\n scanned: 0,\n scanTruncated: false,\n candidates: [],\n error: 'NO_RESOLVE',\n });\n continue;\n }\n try {\n const r = await holder.resolveDetailed(identifier);\n results.push({\n resource: key,\n value: (r.value ?? null) as Record<string, unknown> | null,\n resolutionCost: r.resolutionCost,\n scanned: r.scanned,\n scanTruncated: r.scanTruncated,\n candidates: (r.candidates ?? []).map((c) => c.id),\n });\n } catch (err) {\n // Misses do not throw: map the error code onto the outcome. A real\n // fault (auth, rate limit, server, network, timeout, policy) is not a\n // miss — it propagates, so a revoked credential never reads as \"no match\".\n let code: string;\n let candidates: (number | string)[] = [];\n if (err instanceof AutotaskConfigError) {\n code = 'CONFIG_ERROR';\n } else if (isAutotaskError(err)) {\n if (FAULT_CATEGORIES.has(err.category)) throw err;\n code = err.code;\n // Only ambiguity carries candidates; a NOT_FOUND miss's resourceIds\n // name the missed id, not candidates.\n if (code === 'RESOLUTION_AMBIGUOUS' && err.resourceIds !== undefined) {\n candidates = err.resourceIds;\n }\n } else {\n throw err;\n }\n results.push({\n resource: key,\n value: null,\n resolutionCost: missCost(identifier),\n scanned: 0,\n scanTruncated: code === 'RESOLUTION_TRUNCATED',\n candidates,\n error: code,\n });\n }\n }\n const matches = results.filter((r) => r.value !== null).map((r) => r.resource);\n return { identifier, results, matches };\n}\n","/**\n * Model field sets (the vendored-spec field sets, resource → model field names).\n * GENERATED by scripts/generate-batch.mjs from api-docs.json + the plan\n * (the 6th generated artifact; S12-B, run mcp-fix-20261003). Do not\n * hand-edit; re-run the generator. The drift guard is\n * scripts/check-capabilities.mjs + test/scripts/fieldsets-artifact.test.ts.\n *\n * Consumers:\n * - operations.fetchMany validates per-item `fields` projections PRE-REQUEST\n * against these sets (a hallucinated field key is a shape error, never a\n * silent projection-miss — the F-A1 lesson applied to reads);\n * - a plan resource WITHOUT an entry is not single-record GETtable by bare\n * id (the 7 {id}-less integration endpoints + the 4 resources with no\n * get row) — fetchMany refuses it pre-request.\n *\n * planHash: ac8d4bed714eeae53029f1da07c0305ab80916424dab448904f865c715b192c6\n */\n// [GENERATED:FIELDSETS:START]\nexport const MODEL_FIELD_SETS: Record<string, readonly string[]> = {\n \"appointments\": [\"id\", \"createDateTime\", \"creatorResourceID\", \"description\", \"endDateTime\", \"resourceID\", \"startDateTime\", \"title\", \"updateDateTime\"],\n \"billing_codes\": [\"id\", \"afterHoursWorkType\", \"billingCodeType\", \"department\", \"description\", \"externalNumber\", \"generalLedgerAccount\", \"isActive\", \"isExcludedFromNewContracts\", \"markupRate\", \"name\", \"taxCategoryID\", \"unitCost\", \"unitPrice\", \"useType\"],\n \"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\"],\n \"change_request_links\": [\"id\", \"changeRequestTicketID\", \"problemOrIncidentTicketID\"],\n \"checklist_libraries\": [\"id\", \"description\", \"entityType\", \"isActive\", \"name\"],\n \"checklist_library_checklist_items\": [\"id\", \"checklistLibraryID\", \"isImportant\", \"itemName\", \"knowledgebaseArticleID\", \"position\", \"soapParentPropertyId\"],\n \"classification_icons\": [\"id\", \"description\", \"isActive\", \"isSystem\", \"name\", \"relativeUrl\"],\n \"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\"],\n \"company_alerts\": [\"id\", \"alertText\", \"alertTypeID\", \"companyID\", \"soapParentPropertyId\"],\n \"company_locations\": [\"id\", \"address1\", \"address2\", \"alternatePhone1\", \"alternatePhone2\", \"city\", \"companyID\", \"countryID\", \"description\", \"fax\", \"isActive\", \"isPrimary\", \"isTaxExempt\", \"overrideCompanyTaxSettings\", \"name\", \"phone\", \"postalCode\", \"roundtripDistance\", \"state\", \"taxRegionID\", \"soapParentPropertyId\"],\n \"company_notes\": [\"id\", \"actionType\", \"assignedResourceID\", \"companyID\", \"completedDateTime\", \"contactID\", \"createDateTime\", \"endDateTime\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastModifiedDate\", \"name\", \"note\", \"opportunityID\", \"startDateTime\", \"soapParentPropertyId\"],\n \"company_site_configurations\": [\"id\", \"companyID\", \"locationName\", \"soapParentPropertyId\", \"userDefinedFields\"],\n \"company_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"configuration_item_billing_product_associations\": [\"id\", \"billingProductID\", \"configurationItemID\", \"effectiveDate\", \"expirationDate\", \"soapParentPropertyId\"],\n \"configuration_item_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isClientPortalDefault\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"configuration_item_category_udf_associations\": [\"id\", \"configurationItemCategoryID\", \"isRequired\", \"userDefinedFieldDefinitionID\", \"soapParentPropertyId\"],\n \"configuration_item_dns_records\": [\"id\", \"createDateTime\", \"data\", \"installedProductID\", \"timeToLiveSeconds\", \"dnsType\", \"soapParentPropertyId\"],\n \"configuration_item_notes\": [\"id\", \"configurationItemID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"noteType\", \"title\", \"soapParentPropertyId\"],\n \"configuration_item_related_items\": [\"id\", \"configurationItemID\", \"relatedConfigurationItemID\", \"relationship\", \"soapParentPropertyId\"],\n \"configuration_item_ssl_subject_alternative_names\": [\"id\", \"configurationItemID\", \"name\", \"soapParentPropertyId\"],\n \"configuration_item_types\": [\"id\", \"isActive\", \"name\"],\n \"configuration_item_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"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\"],\n \"contact_group_contacts\": [\"id\", \"contactId\", \"contactGroupId\", \"soapParentPropertyId\"],\n \"contact_groups\": [\"id\", \"name\", \"isActive\"],\n \"contact_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"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\"],\n \"contract_billing_rules\": [\"id\", \"contractID\", \"createChargesAsBillable\", \"dailyProratedCost\", \"dailyProratedPrice\", \"determineUnits\", \"endDate\", \"executionMethod\", \"includeItemsInChargeDescription\", \"invoiceDescription\", \"isActive\", \"isDailyProrationEnabled\", \"maximumUnits\", \"minimumUnits\", \"productID\", \"startDate\", \"soapParentPropertyId\"],\n \"contract_block_hour_factors\": [\"id\", \"blockHourMultiplier\", \"contractHourlyRate\", \"contractID\", \"internalCurrencyContractHourlyRate\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_blocks\": [\"id\", \"contractID\", \"datePurchased\", \"endDate\", \"hourlyRate\", \"hours\", \"hoursApproved\", \"invoiceNumber\", \"isPaid\", \"paymentNumber\", \"paymentType\", \"startDate\", \"status\", \"soapParentPropertyId\"],\n \"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\"],\n \"contract_exclusion_billing_codes\": [\"id\", \"billingCodeID\", \"contractID\", \"soapParentPropertyId\"],\n \"contract_exclusion_roles\": [\"id\", \"contractID\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_exclusion_set_excluded_roles\": [\"id\", \"contractExclusionSetID\", \"excludedRoleID\", \"soapParentPropertyId\"],\n \"contract_exclusion_set_excluded_work_types\": [\"id\", \"contractExclusionSetID\", \"excludedWorkTypeID\", \"soapParentPropertyId\"],\n \"contract_exclusion_sets\": [\"id\", \"description\", \"isActive\", \"name\"],\n \"contract_milestones\": [\"id\", \"amount\", \"billingCodeID\", \"contractID\", \"createDate\", \"creatorResourceID\", \"dateDue\", \"description\", \"internalCurrencyAmount\", \"isInitialPayment\", \"organizationalLevelAssociationID\", \"status\", \"title\", \"soapParentPropertyId\"],\n \"contract_notes\": [\"id\", \"contractID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"title\", \"soapParentPropertyId\"],\n \"contract_rates\": [\"id\", \"contractHourlyRate\", \"contractID\", \"internalCurrencyContractHourlyRate\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_retainers\": [\"id\", \"amount\", \"amountApproved\", \"contractID\", \"datePurchased\", \"endDate\", \"internalCurrencyAmount\", \"internalCurrencyAmountApproved\", \"invoiceNumber\", \"isPaid\", \"paymentID\", \"paymentNumber\", \"startDate\", \"status\", \"soapParentPropertyId\"],\n \"contract_role_costs\": [\"id\", \"contractID\", \"rate\", \"resourceID\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_service_bundle_units\": [\"id\", \"approveAndPostDate\", \"contractID\", \"contractServiceBundleID\", \"cost\", \"endDate\", \"internalCurrencyPrice\", \"organizationalLevelAssociationID\", \"price\", \"serviceBundleID\", \"startDate\", \"units\", \"soapParentPropertyId\"],\n \"contract_service_bundles\": [\"id\", \"adjustedPrice\", \"contractID\", \"internalCurrencyAdjustedPrice\", \"internalCurrencyUnitPrice\", \"internalDescription\", \"invoiceDescription\", \"quoteItemID\", \"serviceBundleID\", \"unitPrice\", \"soapParentPropertyId\"],\n \"contract_service_units\": [\"id\", \"approveAndPostDate\", \"contractID\", \"contractServiceID\", \"cost\", \"endDate\", \"internalCurrencyPrice\", \"organizationalLevelAssociationID\", \"price\", \"serviceID\", \"startDate\", \"units\", \"vendorCompanyID\", \"soapParentPropertyId\"],\n \"contract_services\": [\"id\", \"contractID\", \"internalCurrencyAdjustedPrice\", \"internalCurrencyUnitPrice\", \"internalDescription\", \"invoiceDescription\", \"quoteItemID\", \"serviceID\", \"unitCost\", \"unitPrice\", \"soapParentPropertyId\"],\n \"contract_ticket_purchases\": [\"id\", \"contractID\", \"datePurchased\", \"endDate\", \"invoiceNumber\", \"isPaid\", \"paymentNumber\", \"paymentType\", \"perTicketRate\", \"startDate\", \"status\", \"ticketsPurchased\", \"ticketsUsed\", \"soapParentPropertyId\"],\n \"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\"],\n \"countries\": [\"id\", \"addressFormatID\", \"countryCode\", \"displayName\", \"invoiceTemplateID\", \"isActive\", \"isDefaultCountry\", \"name\", \"purchaseOrderTemplateID\", \"quoteTemplateID\"],\n \"departments\": [\"id\", \"description\", \"name\", \"number\", \"primaryLocationID\"],\n \"domain_registrars\": [\"id\", \"name\", \"url\"],\n \"expense_item_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"expenseItemID\", \"expenseReportID\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"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\"],\n \"expense_reports\": [\"id\", \"amountDue\", \"approvedDate\", \"approverID\", \"departmentNumber\", \"internalCurrencyCashAdvanceAmount\", \"internalCurrencyExpenseTotal\", \"name\", \"organizationalLevelAssociationID\", \"quickBooksReferenceNumber\", \"reimbursementCurrencyAmountDue\", \"reimbursementCurrencyCashAdvanceAmount\", \"reimbursementCurrencyID\", \"rejectionReason\", \"status\", \"submit\", \"submitDate\", \"submitterID\", \"weekEnding\"],\n \"holiday_sets\": [\"id\", \"holidaySetDescription\", \"holidaySetName\"],\n \"holidays\": [\"id\", \"holidayDate\", \"holidayName\", \"holidaySetID\", \"soapParentPropertyId\"],\n \"inventory_products\": [\"id\", \"availableUnits\", \"backOrderQuantity\", \"bin\", \"createDateTime\", \"createdByResourceID\", \"inventoryLocationID\", \"onHandUnits\", \"pickedUnits\", \"productID\", \"quantityMaximum\", \"quantityMinimum\", \"referenceNumber\", \"reservedUnits\", \"unitsOnOrder\"],\n \"invoices\": [\"id\", \"batchID\", \"comments\", \"companyID\", \"createDateTime\", \"creatorResourceID\", \"dueDate\", \"fromDate\", \"invoiceDateTime\", \"invoiceEditorTemplateID\", \"invoiceNumber\", \"invoiceTotal\", \"isVoided\", \"orderNumber\", \"paidDate\", \"paymentTerm\", \"taxGroup\", \"taxRegionName\", \"toDate\", \"totalTaxValue\", \"voidedByResourceID\", \"voidedDate\", \"webServiceDate\"],\n \"notification_history\": [\"id\", \"companyID\", \"entityNumber\", \"entityTitle\", \"initiatingContactID\", \"initiatingResourceID\", \"isActive\", \"isDeleted\", \"isTemplateJob\", \"notificationHistoryTypeID\", \"notificationSentTime\", \"opportunityID\", \"projectID\", \"quoteID\", \"recipientDisplayName\", \"recipientEmailAddress\", \"taskID\", \"templateName\", \"ticketID\", \"timeEntryID\"],\n \"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\"],\n \"opportunity_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentAttachmentID\", \"parentID\", \"publish\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"opportunity_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"phases\": [\"id\", \"createDate\", \"creatorResourceID\", \"description\", \"dueDate\", \"estimatedHours\", \"externalID\", \"isScheduled\", \"lastActivityDateTime\", \"parentPhaseID\", \"phaseNumber\", \"projectID\", \"startDate\", \"title\", \"soapParentPropertyId\"],\n \"product_vendors\": [\"id\", \"isActive\", \"isDefault\", \"productID\", \"vendorCost\", \"vendorID\", \"vendorPartNumber\", \"soapParentPropertyId\"],\n \"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\"],\n \"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\"],\n \"project_notes\": [\"id\", \"createDateTime\", \"createdByContactID\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"isAnnouncement\", \"lastActivityDate\", \"noteType\", \"projectID\", \"publish\", \"title\", \"soapParentPropertyId\"],\n \"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\"],\n \"purchase_approvals\": [\"id\", \"costType\", \"isApproved\", \"rejectNote\"],\n \"purchase_order_item_receiving\": [\"id\", \"purchaseOrderItemID\", \"quantityBackOrdered\", \"quantityNowReceiving\", \"quantityPreviouslyReceived\", \"receiveDate\", \"receivedByResourceID\", \"serialNumber\", \"vendorInvoiceNumber\", \"soapParentPropertyId\"],\n \"purchase_order_items\": [\"id\", \"chargeID\", \"contractID\", \"estimatedArrivalDate\", \"internalCurrencyUnitCost\", \"inventoryLocationID\", \"memo\", \"orderID\", \"productID\", \"projectID\", \"quantity\", \"salesOrderID\", \"ticketID\", \"unitCost\", \"soapParentPropertyId\"],\n \"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\"],\n \"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\"],\n \"quote_locations\": [\"id\", \"address1\", \"address2\", \"city\", \"postalCode\", \"state\"],\n \"quote_templates\": [\"id\", \"calculateTaxSeparately\", \"createDate\", \"createdBy\", \"currencyNegativeFormat\", \"currencyPositiveFormat\", \"dateFormat\", \"description\", \"displayTaxCategorySuperscripts\", \"isActive\", \"lastActivityBy\", \"lastActivityDate\", \"name\", \"numberFormat\", \"pageLayout\", \"pageNumberFormat\", \"showEachTaxInGroup\", \"showGridHeader\", \"showTaxCategory\", \"showVerticalGridLines\"],\n \"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\"],\n \"resource_role_queues\": [\"id\", \"queueID\", \"resourceID\", \"soapParentPropertyId\"],\n \"resource_roles\": [\"id\", \"departmentID\", \"isActive\", \"queueID\", \"resourceID\", \"roleID\", \"soapParentPropertyId\"],\n \"resource_skills\": [\"id\", \"resourceID\", \"skillDescription\", \"skillID\", \"skillLevel\", \"soapParentPropertyId\"],\n \"resource_time_off_approvers\": [\"id\", \"resourceID\", \"approverResourceID\", \"approvalLevel\", \"soapParentPropertyId\"],\n \"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\"],\n \"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\"],\n \"roles\": [\"id\", \"description\", \"hourlyFactor\", \"hourlyRate\", \"isActive\", \"isExcludedFromNewContracts\", \"isSystemRole\", \"name\", \"quoteItemDefaultTaxCategoryId\", \"roleType\"],\n \"service_call_task_resources\": [\"id\", \"resourceID\", \"serviceCallTaskID\", \"soapParentPropertyId\"],\n \"service_call_tasks\": [\"id\", \"serviceCallID\", \"taskID\", \"soapParentPropertyId\"],\n \"service_call_ticket_resources\": [\"id\", \"resourceID\", \"serviceCallTicketID\", \"soapParentPropertyId\"],\n \"service_call_tickets\": [\"id\", \"serviceCallID\", \"ticketID\", \"soapParentPropertyId\"],\n \"service_calls\": [\"id\", \"cancelationNoticeHours\", \"canceledByResourceID\", \"canceledDateTime\", \"companyID\", \"companyLocationID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"duration\", \"endDateTime\", \"impersonatorCreatorResourceID\", \"isComplete\", \"lastModifiedDateTime\", \"startDateTime\", \"status\"],\n \"service_level_agreement_results\": [\"id\", \"firstResponseElapsedHours\", \"firstResponseInitiatingResourceID\", \"firstResponseResourceID\", \"isFirstResponseMet\", \"isResolutionMet\", \"isResolutionPlanMet\", \"resolutionElapsedHours\", \"resolutionPlanElapsedHours\", \"resolutionPlanResourceID\", \"resolutionResourceID\", \"serviceLevelAgreementName\", \"ticketID\", \"soapParentPropertyId\"],\n \"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\"],\n \"skills\": [\"id\", \"categoryID\", \"description\", \"isActive\", \"name\"],\n \"subscription_periods\": [\"id\", \"periodCost\", \"periodDate\", \"periodPrice\", \"postedDate\", \"purchaseOrderNumber\", \"subscriptionID\", \"soapParentPropertyId\"],\n \"subscriptions\": [\"id\", \"configurationItemID\", \"description\", \"effectiveDate\", \"expirationDate\", \"impersonatorCreatorResourceID\", \"materialCodeID\", \"organizationalLevelAssociationID\", \"periodCost\", \"periodPrice\", \"periodType\", \"purchaseOrderNumber\", \"status\", \"subscriptionName\", \"totalCost\", \"totalPrice\", \"vendorID\", \"userDefinedFields\"],\n \"survey_results\": [\"id\", \"companyID\", \"companyRating\", \"completeDate\", \"contactID\", \"contactRating\", \"resourceRating\", \"sendDate\", \"surveyID\", \"surveyRating\", \"ticketID\"],\n \"surveys\": [\"id\", \"description\", \"displayName\", \"name\"],\n \"tag_aliases\": [\"id\", \"alias\", \"tagID\", \"soapParentPropertyId\"],\n \"tag_groups\": [\"id\", \"displayColor\", \"isActive\", \"isSystem\", \"label\"],\n \"tags\": [\"id\", \"createDateTime\", \"isActive\", \"isExcludedFromAutomaticTagging\", \"isSystem\", \"label\", \"lastModifiedDateTime\", \"tagGroupID\"],\n \"task_secondary_resources\": [\"id\", \"resourceID\", \"roleID\", \"taskID\", \"soapParentPropertyId\"],\n \"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\"],\n \"ticket_additional_configuration_items\": [\"id\", \"configurationItemID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_additional_contacts\": [\"id\", \"contactID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentAttachmentID\", \"parentID\", \"publish\", \"ticketID\", \"ticketNoteID\", \"timeEntryID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"ticket_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isApiOnly\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"ticket_category_field_defaults\": [\"id\", \"description\", \"estimatedHours\", \"issueTypeID\", \"organizationalLevelAssociationID\", \"priority\", \"purchaseOrderNumber\", \"queueID\", \"resolution\", \"serviceLevelAgreementID\", \"sourceID\", \"status\", \"subIssueTypeID\", \"ticketCategoryID\", \"ticketTypeID\", \"title\", \"workTypeID\", \"soapParentPropertyId\"],\n \"ticket_change_request_approvals\": [\"id\", \"approveRejectDateTime\", \"approveRejectNote\", \"contactID\", \"isApproved\", \"resourceID\", \"ticketID\", \"soapParentPropertyId\"],\n \"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\"],\n \"ticket_checklist_items\": [\"id\", \"completedByResourceID\", \"completedDateTime\", \"isCompleted\", \"isImportant\", \"itemName\", \"knowledgebaseArticleID\", \"position\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_history\": [\"id\", \"action\", \"date\", \"detail\", \"resourceID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_note_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"ticketID\", \"ticketNoteID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"ticket_note_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"ticket_notes\": [\"id\", \"createDateTime\", \"createdByContactID\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"noteType\", \"publish\", \"ticketID\", \"title\", \"soapParentPropertyId\"],\n \"ticket_secondary_resources\": [\"id\", \"resourceID\", \"roleID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"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\"],\n \"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\"],\n \"time_entry_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"taskID\", \"ticketID\", \"timeEntryID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"time_off_requests\": [\"id\", \"approvedDateTime\", \"approveRejectResourceID\", \"createdByResourceID\", \"createDateTime\", \"endTime\", \"hours\", \"impersonatorApproveRejectResourceID\", \"lastModifiedByResourceID\", \"lastModifiedDateTime\", \"lastApprovedLevel\", \"reason\", \"rejectReason\", \"requestDate\", \"resourceID\", \"startTime\", \"status\", \"timeOffRequestType\", \"soapParentPropertyId\"],\n};\n// [GENERATED:FIELDSETS:END]\n","/**\n * `operations.fetchMany` — the batch/fan-out read primitive (S12-B, run\n * mcp-fix-20261003; plan §2.2 pinned contract).\n *\n * One call fetches up to {@link FETCH_MANY_MAX_ITEMS} single records across\n * MIXED resources (sequential GETs — one per item; no in-SDK concurrency: the\n * vendor threshold + the throttle discipline argue against parallel fan-out,\n * and 20 × ~200 ms RTT ≈ 4 s worst case). The MCP server's worst cost\n * pattern today is N sequential `autotask_read` tool calls; this collapses\n * it to one.\n *\n * Pinned semantics:\n * - `fields` = client-side PROJECTION of the full-model GET response (the\n * vendor single-record GET has no includeFields — projection is post-fetch,\n * zero extra wire);\n * - ids are vendor numeric ids (safe integers) or their canonical integer\n * STRING form (ids above 2^53 — the same identifier contract as every\n * other read path: the exact digits travel to the item GET verbatim); a\n * NON-NUMERIC string identifier is `resolveAny`/`findBy*` territory —\n * refused PRE-REQUEST with a pointer at `autotask_resolve_any` (keeps the\n * per-item taxonomy small and deterministic);\n * - unknown field keys are refused PRE-REQUEST against the resource's\n * vendored-spec field set (src/field-sets.ts — generated, drift-guarded):\n * a hallucinated field is a shape error, not a silent projection-miss\n * (the F-A1 lesson applied to reads);\n * - OPT-IN live field validation (`opts.liveFields: true`, issue #66): the\n * `fields` check becomes LIVE-FIRST — the requested fields validate\n * against the tenant's LIVE entity field metadata (the existing cached\n * metadata channel: a warm fieldCache costs zero wire; a cold run is one\n * `entityInformation/fields` GET per distinct resource in the batch,\n * sequential). A resource whose metadata read rejects degrades to the\n * vendored-spec set for THAT resource only (unavailability never throws\n * and never blocks the batch); when the live set is available it is\n * authoritative — a field it lacks is refused even if the spec lists it,\n * and a live field the spec lacks (e.g. `time_entries` `postedDate`) is\n * accepted. The default (`liveFields` absent) is the vendored-spec-only\n * validation above, bit-for-bit (zero metadata wire). Field discovery\n * for both modes: `operations.fieldCatalog`;\n * - partial failures are PER-ITEM typed (`NOT_FOUND` / `SERVER_ERROR` / the\n * fault's typed code), never all-or-nothing: an item's failure NEVER\n * aborts the remaining items;\n * - the op throws ONLY pre-request (`CONFIG_ERROR`: shape, limits, unknown\n * resource, unknown field key — all items validated up-front, the complete\n * problem list in one message, zero wire);\n * - it is a READ op: the governor appends no bag (no dry-run/confirm\n * interaction); the invoke path's declared `inputSchema` is\n * `items` (required object[]) plus the `opts` bag (`liveFields`, `maxItems`);\n * the loose check passes arrays through, the deep validation is this op's own.\n */\nimport { AutotaskConfigError, isAutotaskError, NotFoundError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport type { FieldInformationModel, Identifier } from '../types/common.js';\nimport { camelKey, parseIdentifier } from '../utils/index.js';\nimport { MODEL_FIELD_SETS } from '../field-sets.js';\nimport { RELATIONSHIP_MAP } from '../relationships.js';\nimport type { FetchManyItem, FetchManyItemResult, FetchManyResult } from './types.js';\n\n/** The pinned per-call item cap (over → CONFIG_ERROR pre-request, zero wire). */\nexport const FETCH_MANY_MAX_ITEMS = 20;\n\nexport interface FetchManyOptions {\n /** May LOWER the {@link FETCH_MANY_MAX_ITEMS} cap (integer >= 1) — never raise it. */\n maxItems?: number;\n /**\n * Opt-in live field validation (issue #66): when `true`, each item's\n * requested `fields` are validated against the tenant's LIVE entity field\n * metadata (the cached metadata channel — a warm fieldCache costs zero\n * wire; a cold run is one `entityInformation/fields` GET per distinct\n * resource in the batch) instead of the vendored-spec field set alone.\n * When a resource's metadata is unavailable the validation falls back to\n * the vendored-spec field set for THAT resource (unavailability never\n * throws and never blocks the batch); when available the live set is\n * authoritative — a field it lacks is refused even if the spec lists it,\n * and a live field the spec lacks (e.g. `time_entries` `postedDate`) is\n * accepted. Default `false` = today's vendored-spec-only validation,\n * bit-for-bit (zero metadata wire).\n */\n liveFields?: boolean;\n}\n\nexport interface ValidateFetchManyValidation {\n /**\n * The resolved authoritative per-resource field sets (the `liveFields`\n * mode, issue #66): the live entity field set when available, `null` when\n * that resource's metadata read rejected (the vendored-spec fallback was\n * applied at resolution). Absent / no entry = the vendored-spec set.\n */\n fieldSetsByResource?: ReadonlyMap<string, readonly string[] | null>;\n /** Run the field-NAME membership check (the live mode's shape-only pass passes `false`). */\n fieldCheck?: boolean;\n}\n\n/**\n * The pre-request validation (zero wire): one `CONFIG_ERROR` carries the\n * COMPLETE problem list for ALL items (shape, limits, unknown resource,\n * string id, unknown field key) — the caller fixes everything in one round.\n *\n * `validation` (the `liveFields` mode, issue #66): the resolved\n * authoritative per-resource field sets to validate `fields` against; absent\n * = the vendored-spec sets, bit-for-bit the default.\n */\nexport function validateFetchManyItems(\n items: unknown,\n cap: number,\n opName = 'fetchMany',\n capRef = `FETCH_MANY_MAX_ITEMS = ${FETCH_MANY_MAX_ITEMS}`,\n validation?: ValidateFetchManyValidation,\n): void {\n if (!Array.isArray(items)) {\n throw new AutotaskConfigError(\n `${opName}: items must be the items ARRAY — one positional arg, [{ resource: string, id: number, fields?: string[] }] (got ${Array.isArray(items) ? 'an array' : typeof items})`,\n {\n suggestedAction: 'Pass args = [[{ resource: \"tickets\", id: 123 }, { resource: \"projects\", id: 456 }]] — the items array is the single positional argument.',\n },\n );\n }\n if (items.length === 0) {\n throw new AutotaskConfigError(`${opName}: items must not be empty (a zero-item batch is a shape error, not a no-op)`, {\n suggestedAction: 'Pass at least one { resource, id } item — or use the resource\\'s query op for a filtered read.',\n });\n }\n if (items.length > cap) {\n throw new AutotaskConfigError(\n `${opName}: ${items.length} items over the ${cap}-item cap (${capRef}) — zero items were fetched (pre-request)`,\n {\n suggestedAction: `Split the batch into groups of <= ${cap} items — or, for more than ${cap} records / a filtered set, use the resource's bounded query op (<resource>.query).`,\n },\n );\n }\n const problems: string[] = [];\n for (let i = 0; i < items.length; i += 1) {\n const it = items[i]!;\n const at = `items[${i}]`;\n if (typeof it !== 'object' || it === null || Array.isArray(it)) {\n problems.push(`${at}: must be an object { resource: string, id: number, fields?: string[] }`);\n continue;\n }\n const item = it as Record<string, unknown>;\n if (typeof item.resource !== 'string' || item.resource.trim() === '') {\n problems.push(`${at}.resource: required — the plan resource key (string, e.g. 'tickets'; see autotask_catalog)`);\n continue;\n }\n const resourceKey = item.resource;\n const fields = MODEL_FIELD_SETS[resourceKey];\n if (fields === undefined) {\n problems.push(\n `${at}.resource: \"${resourceKey}\" is not a single-record GETtable resource (${Object.keys(MODEL_FIELD_SETS).length} known) — see autotask_catalog for the exact plan keys`,\n );\n continue;\n }\n const rel = RELATIONSHIP_MAP[resourceKey];\n if (rel !== undefined && rel.parentScoped) {\n problems.push(\n `${at}.resource: \"${resourceKey}\" is a parent-scoped child — its get needs (parentId, id); fetchMany takes single numeric ids of TOP-LEVEL records (scoped reads: client.${camelKey(resourceKey)}.get(parentId, id))`,\n );\n continue;\n }\n // QA F3: the id rides the SDK's identifier contract (parseIdentifier):\n // safe integers pass as numbers; canonical integer strings (ids above\n // 2^53) pass with their exact digits; everything else is refused with a\n // shape-teaching pointer — numeric-string vs non-numeric-string vs other.\n try {\n parseIdentifier(item.id, `${at}.id`);\n } catch {\n if (typeof item.id === 'string') {\n problems.push(\n `${at}.id: \"${item.id}\" is not a vendor numeric id — non-numeric string identifiers are autotask_resolve_any territory (resolveAny / the resource's findBy* helpers)`,\n );\n } else if (typeof item.id === 'number') {\n problems.push(\n `${at}.id: ${item.id} is not a non-negative safe integer (a JS number this large is already corrupted — pass the canonical integer string form)`,\n );\n } else {\n problems.push(`${at}.id: required — the vendor numeric id (safe integer, or the canonical integer string for ids above 2^53)`);\n }\n continue;\n }\n if (item.fields !== undefined) {\n if (!Array.isArray(item.fields) || item.fields.some((f) => typeof f !== 'string')) {\n problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via operations.fieldCatalog)`);\n continue;\n }\n // The authoritative set for this resource (issue #66): the resolved\n // live set when the caller passed one (`null` = that resource's\n // metadata was unavailable — the vendored-spec fallback), otherwise\n // the vendored-spec set (bit-for-bit the default).\n if (validation?.fieldCheck !== false) {\n const authoritative = validation?.fieldSetsByResource?.get(resourceKey) ?? fields;\n for (const f of item.fields) {\n if (!authoritative.includes(f)) {\n problems.push(\n `${at}.fields: \"${f}\" is not a field of ${resourceKey} — a hallucinated field is a shape error, not a silent projection-miss (exact vendor field names via operations.fieldCatalog)`,\n );\n }\n }\n }\n }\n }\n if (problems.length > 0) {\n throw new AutotaskConfigError(\n `${opName}: ${problems.length} problem(s) found pre-request (zero wire was issued)\\n- ` + problems.join('\\n- '),\n { suggestedAction: 'Fix every item above and call again — validation covers the whole batch up-front (one round, zero wire).' },\n );\n }\n}\n\n/** Project a fetched record to the requested fields (best-effort: a vendor\n * partial record may omit a validated key; validated keys absent from the\n * record are simply not present in the projection). */\nfunction project(value: Record<string, unknown>, fields: readonly string[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n if (f in value) out[f] = value[f];\n }\n return out;\n}\n\n/**\n * Fetch up to 20 single records across mixed resources in ONE call\n * (sequential GETs; per-item typed partial failure; the op throws only\n * pre-request).\n *\n * ```ts\n * import { fetchMany } from 'node-autotask/operations';\n * const { results, ok, failed } = await fetchMany(client, [\n * { resource: 'tickets', id: 527119 },\n * { resource: 'tickets', id: 527118, fields: ['id', 'title', 'status'] },\n * { resource: 'projects', id: 693 },\n * ]);\n * ```\n */\nexport async function fetchMany(\n client: AutotaskClient,\n items: readonly FetchManyItem[],\n opts: FetchManyOptions = {},\n): Promise<FetchManyResult> {\n if (opts.maxItems !== undefined) {\n if (!Number.isInteger(opts.maxItems) || opts.maxItems < 1) {\n throw new AutotaskConfigError(`fetchMany: maxItems must be an integer >= 1 (got ${String(opts.maxItems)})`);\n }\n }\n if (opts.liveFields !== undefined && typeof opts.liveFields !== 'boolean') {\n throw new AutotaskConfigError(`fetchMany: liveFields must be a boolean (got ${typeof opts.liveFields})`);\n }\n const cap = Math.min(FETCH_MANY_MAX_ITEMS, opts.maxItems ?? FETCH_MANY_MAX_ITEMS);\n if (opts.liveFields === true) {\n // (1) the shape-level validation FIRST (zero wire, as today — a\n // malformed `fields` never costs the metadata wire); the field-NAME\n // membership check is deferred: in live mode the tenant's live entity\n // metadata is the authority (a spec-unknown field may be live-valid).\n validateFetchManyItems(items, cap, undefined, undefined, { fieldCheck: false });\n // (2) the distinct-resource live metadata resolution (sequential — the\n // house no-unbounded-Promise.all rule; first-occurrence order, a\n // repeated resource reuses the first read): one cache-aware\n // `entityInformation/fields` read per distinct resource (zero wire on a\n // fieldCache hit; a cold run is one GET per distinct resource — the\n // same shared `resource:fields` entries the operations.fieldCatalog\n // channel uses). A rejecting read degrades ONLY that resource to the\n // vendored-spec set (unavailability never throws and never blocks the\n // batch); an ABORTED / non-SDK fault propagates (swallowing it would\n // fake a pre-request pass).\n const liveFieldSets = new Map<string, string[] | null>();\n for (const item of items) {\n const key = item.resource;\n if (liveFieldSets.has(key)) continue;\n const holder = (client as unknown as Record<string, { getFieldInfo: () => Promise<readonly FieldInformationModel[]> } | undefined>)[camelKey(key)];\n if (holder === undefined) {\n // Unreachable after validation (the key was checked against MODEL_FIELD_SETS) — fail loudly anyway.\n throw new AutotaskConfigError(`fetchMany: the client exposes no accessor for resource \"${key}\"`, {\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n try {\n const rows = await holder.getFieldInfo();\n // The live field set = the `name` values of the fields-kind rows\n // (UDFs ride under the `userDefinedFields` object, not top-level\n // record keys — UDF-kind names are not part of the projection-valid\n // set).\n const names: string[] = [];\n for (const row of rows) {\n if (typeof row.name === 'string') names.push(row.name);\n }\n // an empty live list is \"unavailable\" (degrade), never \"every field is unknown\"\n liveFieldSets.set(key, names.length > 0 ? names : null);\n } catch (err) {\n if (!isAutotaskError(err) || err.code === 'ABORTED') throw err;\n // An SDK vendor fault (network / 5xx / INVALID_RESPONSE / TIMEOUT):\n // degrade THIS resource to the vendored-spec set.\n liveFieldSets.set(key, null);\n }\n }\n // (3) the field-name check against the resolved per-resource sets — the\n // one-round problem list (shape + live-field problems in the SAME\n // CONFIG_ERROR).\n validateFetchManyItems(items, cap, undefined, undefined, { fieldSetsByResource: liveFieldSets });\n } else {\n // The default: the vendored-spec-only validation, bit-for-bit (zero\n // metadata wire).\n validateFetchManyItems(items, cap);\n }\n\n const results: FetchManyItemResult[] = [];\n for (const item of items) {\n const key = item.resource;\n // Re-canonicalise (validation already proved it passes): the item result\n // reports the CANONICAL id (safe integer, or the exact-digit string).\n const id = parseIdentifier(item.id, `items[${results.length}].id`);\n const holder = (client as unknown as Record<string, { get: (id: Identifier) => Promise<Record<string, unknown>> } | undefined>)[camelKey(key)];\n if (holder === undefined) {\n // Unreachable after validation (the key was checked against MODEL_FIELD_SETS) — fail loudly anyway.\n throw new AutotaskConfigError(`fetchMany: the client exposes no accessor for resource \"${key}\"`, {\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n try {\n const value = (await holder.get(id)) as Record<string, unknown>;\n results.push({ resource: key, id, found: true, value: item.fields !== undefined ? project(value, item.fields) : value });\n } catch (err) {\n // A miss or a vendor fault is a PER-ITEM typed result — it never\n // aborts the remaining items (sequential, independent GETs).\n if (err instanceof NotFoundError) {\n results.push({ resource: key, id, found: false, value: null, error: { code: 'NOT_FOUND', message: err.message } });\n } else if (isAutotaskError(err) && err.code !== 'ABORTED') {\n const e: FetchManyItemResult['error'] = { code: err.code, message: err.message };\n if (err.httpStatus !== undefined) e.httpStatus = err.httpStatus;\n results.push({ resource: key, id, found: false, value: null, error: e });\n } else {\n // Not an item-level vendor outcome (an abort, or a non-SDK fault):\n // propagate — swallowing it would fake a partial result.\n throw err;\n }\n }\n }\n const ok = results.filter((r) => r.found).length;\n return { results, ok, failed: results.length - ok };\n}\n","/**\n * `operations.aggregate` — the generic aggregate + the cheap count (issue #62).\n *\n * One op, two families of modes (selected by the opts shape — the issue's\n * \"one tool … plus a cheap count\"):\n *\n * | mode | when | wire |\n * |-----------|---------------------------------------|--------------------------------------------------|\n * | `count` | NEITHER `groupBy` NOR `sum` | ONE `POST /V1.0/<Entity>/query/count` (the vendor count endpoint — `countGlobal`; no walk) |\n * | `group` | `groupBy` given (with or without `sum`) | the house server-side-paginated `queryBounded` walk (page size min(500, limit); the 1000-page guard) + the client-side fold |\n * | `sum` | `sum` only | the same walk + fold (the `groups` carry the sums; `count` per group rides along) |\n *\n * Pinned semantics:\n * - `operation` is EXACTLY `<planResourceKey>.query` — a plan resource WITH\n * a `query` row (the registry is the closed set). A special op, a `.count`\n * row, or an unknown resource is refused PRE-REQUEST naming the pointer\n * to `autotask_catalog` (zero wire).\n * - `filter` = the query-bag filter grammar (13 leaf operators + and/or\n * grouping; caps 500 OR-conditions / 1 UDF / 8000 chars — the existing\n * `buildFilter` validation reused; an empty array is the vendor-accepted\n * no-filter shape).\n * - `groupBy`/`sum` field names validate against the resource's vendored\n * `MODEL_FIELD_SETS` (the fetchMany default-mode oracle — pre-request,\n * zero wire; the complete problem list in one typed error; a\n * live-field opt-in is a follow-up, not this op).\n * - count mode: the S12-C blind-surface sentinel rides through (the base\n * `count` wrap is filter-aware: an `unfiltered-blind` surface stamps a 0\n * ONLY when the call is unfiltered — a FILTERED 0 is a true zero, never\n * a sentinel; a non-zero count is a plain number). `blind: true` + the\n * `blindSurface` sentinel on a plan-pinned blind shape; the\n * `emptyReason` stamp rides alongside when the base attaches one.\n * - group/sum mode: `queryBounded`'s walk stamps ride through\n * (`blindSurface`/`emptyReason` on a 0-row walk; zero new stamp code);\n * `hasMore` = the walk's truncation flag — when true, `groups`/`sums`\n * cover the RETURNED rows only (the truncation honesty: no silent\n * partial sums; `totalScanned` = the walk's fetched count). Non-numeric/\n * absent `sum` values contribute 0 (documented). `top` keeps the top-N\n * groups (descending count; the deterministic group-key order breaks\n * ties).\n * - A mid-walk vendor `429` propagates as the typed `RATE_LIMITED` error\n * (the partial fold is discarded — the error IS the answer); the\n * page/record caps bound the walk's call count (limit rows ≤\n * ceil(limit/500) pages + the guard).\n * - Closed opts bag (unknown key → typed CONFIG_ERROR naming the key + the\n * valid keys, one-round complete problem list, pre-request, zero wire).\n * - READ op: the governor appends no bag (no dry-run/confirm interaction).\n */\nimport { AutotaskConfigError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey } from '../utils/index.js';\nimport { MODEL_FIELD_SETS } from '../field-sets.js';\nimport { buildFilter } from '../query.js';\nimport { BOUNDED_QUERY_MAX_LIMIT } from '../resources/base.js';\nimport { CAPABILITIES } from '../capabilities.js';\nimport type { BlindSurfaceInfo } from '../relationships.js';\nimport type { EmptyReasonInfo, FilterCondition, QueryParams } from '../types/common.js';\n\n/** The group-row cap (top may lower it, never raise it). */\nexport const AGGREGATE_TOP_MAX = 100;\n/** The default group-row count. */\nexport const AGGREGATE_DEFAULT_TOP = 25;\n/** The walk-mode default record cap = the house `BOUNDED_QUERY_MAX_LIMIT` (the hard max — `queryBounded` rejects above it). */\nexport const AGGREGATE_DEFAULT_LIMIT = BOUNDED_QUERY_MAX_LIMIT;\n\n/** The closed opts bag for `operations.aggregate`. */\nexport interface AggregateOptions {\n /** The group-by vendor field names (the group key = the field tuple). */\n groupBy?: string[];\n /** The numeric vendor field names to sum per group. */\n sum?: string[];\n /** The group-row cap (default 25, clamped 1..100). */\n top?: number;\n /** The total-record cap for the walk modes (default = max = the house 2500 — `queryBounded`'s hard limit). */\n limit?: number;\n}\n\n/** One folded group (the key = the groupBy field tuple; `sums` present iff `sum` was given). */\nexport interface AggregateGroup {\n key: Record<string, unknown>;\n count: number;\n sums?: Record<string, number>;\n}\n\n/** The aggregate result (the mode discards the other mode's fields). */\nexport interface AggregateResult {\n mode: 'count' | 'group' | 'sum';\n /** count mode: the count value (a plain number; 0 + `blind` on a pinned blind shape). */\n count?: number;\n /** group/sum mode: the top-N folded groups (the returned rows ONLY when `hasMore`). */\n groups?: AggregateGroup[];\n /** group/sum mode: the walk's fetched record count. */\n totalScanned?: number;\n /** group/sum mode: the walk's truncation flag (true → groups/sums cover the returned rows only). */\n hasMore?: boolean;\n /** count mode: true exactly when the S12-C sentinel stamped the 0 (the filter-aware predicate). */\n blind?: boolean;\n /** The S12-C typed sentinel (count mode: the blind 0; walk mode: the 0-row walk stamp). */\n blindSurface?: BlindSurfaceInfo;\n /** The typed empty-reason stamp (the base's 0-row/0-count channel, when attached). */\n emptyReason?: EmptyReasonInfo;\n}\n\n/** The plan resources WITH a `query` row (the registry is the closed set — the `operation` oracle). */\nconst QUERY_RESOURCE_KEYS: ReadonlySet<string> = (() => {\n const s = new Set<string>();\n for (const rec of CAPABILITIES) if (rec.operation === 'query') s.add(rec.resource);\n return s;\n})();\n\nconst AGGREGATE_OPT_KEYS: readonly string[] = ['groupBy', 'sum', 'top', 'limit'];\nconst OP_RE = /^([a-z0-9_]+)\\.query$/;\n\n/** A non-finite/absent numeric field contributes 0 (the documented fold rule). */\nfunction num(v: unknown): number {\n return typeof v === 'number' && Number.isFinite(v) ? v : 0;\n}\n\ninterface ValidatedAggregate {\n resourceKey: string;\n conditions: FilterCondition[]; // the bare conditions array (never the Filter wrapper — the house wraps take the array)\n groupBy: string[];\n sum: string[];\n top: number;\n limit: number;\n}\n\n/** The pre-request validation (zero wire; ONE complete problem list). */\nfunction validateAggregate(operation: string, filter: unknown, opts: AggregateOptions): ValidatedAggregate {\n const problems: string[] = [];\n // 1) the closed operation set: exactly <planResourceKey>.query with a query row.\n let resourceKey: string | undefined;\n if (typeof operation !== 'string' || !OP_RE.test(operation)) {\n problems.push(\n `operation must be exactly \"<planResourceKey>.query\" (the resource's bounded query op — e.g. \"billing_items.query\"); a special op, a \".count\" row, or any other verb is not an aggregate surface — see autotask_catalog for the exact plan keys`,\n );\n } else {\n const key = OP_RE.exec(operation)![1] as string; // group 1 always present on a match\n resourceKey = key;\n if (!QUERY_RESOURCE_KEYS.has(key)) {\n problems.push(\n `operation \"${operation}\": \"${key}\" has no query row in the capability registry (116 query surfaces) — see autotask_catalog for the exact plan keys`,\n );\n }\n }\n // 2) the filter grammar (the query-bag filter: 13 operators; 500 OR / 1 UDF / 8000 chars).\n // The default [] is the vendor-accepted no-filter shape; every fault branch\n // pushes a problem (and throws before the return), so the default never leaks.\n let conditions: FilterCondition[] = [];\n if (filter === undefined || filter === null) {\n conditions = []; // the unfiltered call (the blind predicate's stamp case)\n } else {\n const conds = Array.isArray(filter) ? filter : (filter as { filter?: unknown[] }).filter;\n if (!Array.isArray(conds)) {\n problems.push('filter must be the query-bag filter (a conditions array, or { filter: [...] })');\n } else if (conds.length === 0) {\n conditions = []; // the vendor-accepted no-filter shape (the unfiltered call — the blind predicate's stamp case)\n } else {\n try {\n conditions = buildFilter(conds as unknown as FilterCondition[]).filter;\n } catch (err) {\n problems.push(err instanceof AutotaskConfigError ? err.message : `filter must be the query-bag filter (13 operators; caps 500 OR-conditions / 1 UDF / 8000 chars); ${String(err)}`);\n }\n }\n }\n // 3) the closed opts bag + the field oracles (the complete problem list).\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError(\n `aggregate: opts must be the options object (got ${Array.isArray(opts) ? 'an array' : typeof opts})`,\n { operation: 'operations.aggregate' },\n );\n }\n for (const key of Object.keys(opts ?? {})) {\n if (!AGGREGATE_OPT_KEYS.includes(key)) {\n problems.push(`unknown opts key \"${key}\" — the bag is closed: ${AGGREGATE_OPT_KEYS.join(', ')}`);\n }\n }\n const fieldSets = resourceKey !== undefined ? MODEL_FIELD_SETS[resourceKey] : undefined;\n const checkFields = (name: string, fields: unknown): string[] => {\n if (fields === undefined) return [];\n if (!Array.isArray(fields) || fields.length === 0 || fields.some((f) => typeof f !== 'string' || (f as string).trim() === '')) {\n problems.push(`${name} must be a non-empty array of exact vendor field names (discover them via operations.fieldCatalog)`);\n return [];\n }\n const out: string[] = [];\n for (const f of fields as string[]) {\n if (fieldSets === undefined || !fieldSets.includes(f)) {\n problems.push(`${name}: \"${f}\" is not a field of ${resourceKey} — a hallucinated field is a shape error, not a silent fold-miss (exact vendor field names via operations.fieldCatalog)`);\n } else {\n out.push(f);\n }\n }\n return out;\n };\n const groupBy = checkFields('groupBy', opts.groupBy);\n const sum = checkFields('sum', opts.sum);\n // 4) the top/limit integer rules (clamped as the plan pins).\n let top = AGGREGATE_DEFAULT_TOP;\n if (opts.top !== undefined) {\n if (!Number.isInteger(opts.top)) {\n problems.push(`top must be an integer (got ${String(opts.top)})`);\n } else {\n top = Math.min(Math.max(opts.top, 1), AGGREGATE_TOP_MAX);\n }\n }\n let limit = AGGREGATE_DEFAULT_LIMIT;\n if (opts.limit !== undefined) {\n if (!Number.isInteger(opts.limit)) {\n problems.push(`limit must be an integer (got ${String(opts.limit)})`);\n } else {\n limit = Math.min(Math.max(opts.limit, 1), BOUNDED_QUERY_MAX_LIMIT);\n }\n }\n if (problems.length > 0) {\n throw new AutotaskConfigError(\n `aggregate: ${problems.length} problem(s) found pre-request (zero wire was issued)\\n- ` + problems.join('\\n- '),\n { operation: 'operations.aggregate' },\n );\n }\n return { resourceKey: resourceKey!, conditions, groupBy, sum, top, limit };\n}\n\n/**\n * `operations.aggregate` — fold any query surface into groups/sums in one\n * bounded call, or count it with the vendor count endpoint when no folding\n * is needed (the `groupBy`/`sum`-absent mode). See the module header for\n * the pinned semantics (the mode table, the blind-surface marking, the\n * truncation honesty, the closed-arg contract).\n *\n * ```ts\n * import { aggregate } from 'node-autotask/operations';\n * const count = await aggregate(client, 'billing_items.query', [{ field: 'companyID', op: 'eq', value: 30132785 }]);\n * const fold = await aggregate(client, 'time_entries.query', [{ field: 'dateWorked', op: 'gte', value: '2026-09-01' }], { groupBy: ['ticketID'], sum: ['hoursWorked'], top: 10 });\n * ```\n */\nexport async function aggregate(\n client: AutotaskClient,\n operation: string,\n filter: unknown,\n opts: AggregateOptions = {},\n): Promise<AggregateResult> {\n const v = validateAggregate(operation, filter, opts);\n const holder = (client as unknown as Record<string, {\n count: (params?: QueryParams) => Promise<number>;\n queryBounded: (params?: { filter?: QueryParams['filter']; limit?: number }) => Promise<{\n items: Array<Record<string, unknown>>;\n fetched: number;\n hasMore: boolean;\n blindSurface?: BlindSurfaceInfo;\n emptyReason?: EmptyReasonInfo;\n }>;\n } | undefined>)[camelKey(v.resourceKey)];\n if (holder === undefined) {\n // Unreachable after validation (the key was checked against the registry) — fail loudly anyway.\n throw new AutotaskConfigError(`aggregate: the client exposes no accessor for resource \"${v.resourceKey}\"`, {\n operation: 'operations.aggregate',\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n // The vendor-accepted no-filter shape rides the wire as `filter: []` —\n // the house count/query wraps serialise it themselves when the filter is\n // ABSENT (an explicit empty array reaches the buildFilter \"at least one\n // condition\" refusal before any wire). The unfiltered call is the blind\n // predicate's stamp case — undefined, not [], is the unfiltered carrier.\n const wireFilter: QueryParams['filter'] = v.conditions.length === 0 ? undefined : v.conditions;\n // count mode (NEITHER groupBy NOR sum): ONE vendor /query/count — the S12-C\n // sentinel (the base's filter-aware blind 0) rides through; a mid-call\n // RATE_LIMITED propagates (the error is the answer).\n if (v.groupBy.length === 0 && v.sum.length === 0) {\n const raw = await holder.count({ filter: wireFilter });\n const sentinel = typeof raw === 'object' && raw !== null && 'count' in raw ? (raw as { count: number; blindSurface?: BlindSurfaceInfo; emptyReason?: EmptyReasonInfo }) : { count: raw };\n const result: AggregateResult = { mode: 'count', count: sentinel.count, blind: sentinel.blindSurface !== undefined };\n if (sentinel.blindSurface !== undefined) result.blindSurface = sentinel.blindSurface;\n if (sentinel.emptyReason !== undefined) result.emptyReason = sentinel.emptyReason;\n return result;\n }\n // group/sum mode: the house bounded walk (server-side pagination; the\n // 1000-page guard; the blind/emptyReason stamps ride through) + the\n // client-side fold. A mid-walk RATE_LIMITED propagates — the partial fold\n // is discarded (the error IS the answer, never a silent partial sum).\n const res = await holder.queryBounded({ filter: wireFilter, limit: v.limit });\n const groups = new Map<string, { key: Record<string, unknown>; keyOrder: string; count: number; sums?: Record<string, number> }>();\n for (const item of res.items) {\n const key: Record<string, unknown> = {};\n const values: unknown[] = [];\n for (const f of v.groupBy) {\n key[f] = item[f];\n values.push(item[f]);\n }\n const keyOrder = JSON.stringify(values); // the deterministic tie-break order\n let g = groups.get(keyOrder);\n if (g === undefined) {\n g = { key, keyOrder, count: 0, ...(v.sum.length > 0 ? { sums: {} as Record<string, number> } : {}) };\n groups.set(keyOrder, g);\n }\n g.count += 1;\n if (g.sums !== undefined) {\n for (const f of v.sum) g.sums[f] = (g.sums[f] ?? 0) + num(item[f]);\n }\n }\n // top-N: descending count; the deterministic group-key order breaks ties.\n const sorted = [...groups.values()].sort((a, b) => (b.count - a.count) || (a.keyOrder < b.keyOrder ? -1 : a.keyOrder > b.keyOrder ? 1 : 0));\n const top = sorted.slice(0, v.top);\n const result: AggregateResult = {\n mode: v.groupBy.length > 0 ? 'group' : 'sum',\n groups: top.map((g) => ({ key: g.key, count: g.count, ...(g.sums !== undefined ? { sums: g.sums } : {}) })),\n totalScanned: res.fetched,\n hasMore: res.hasMore,\n };\n if (res.blindSurface !== undefined) result.blindSurface = res.blindSurface;\n if (res.emptyReason !== undefined) result.emptyReason = res.emptyReason;\n return result;\n}\n","/**\n * `operations.fetchByIds` — the bulk fetch by ids (issue #59, PR-B; plan §5.1).\n *\n * Query-first, per-id `get` fallback (the amendment decision, grounded):\n * one call fetches up to {@link FETCH_BY_IDS_MAX_ITEMS} single records across\n * MIXED resources. Per resource group the unique ids ride chunked `id in`\n * QUERY calls (250/chunk — a 250-id `in` condition serializes ~2.5k chars «\n * the 8000-char vendor cap, and 250 is well under the 500 vendor page max ⇒ each\n * chunk query is a SINGLE page, no cursor walk); every id the chunk query\n * does NOT return is re-verified by the per-id `get` FALLBACK before it is\n * reported (the GET is the authority on every surface — the blind-surface\n * re-trial, generalized pin-independently: the owner's live-observed blind\n * set is 69 of 116 on one tenant, so the fallback is NOT limited to the\n * plan-pinned blind surfaces).\n *\n * Pinned semantics (the fetchMany contract, scaled):\n * - per-id typed outcomes REUSING the fetchMany result shapes\n * (`FetchManyItem` / `FetchManyItemResult` / `FetchManyResult` from\n * ./types.js): one entry per input occurrence; a miss is a typed\n * `NOT_FOUND`, never a null-padded row — the op NEVER fabricates rows;\n * - ids are vendor numeric ids (safe integers) or their canonical integer\n * STRING form (ids above 2^53 — the exact digits ride the `in` condition\n * verbatim); a NON-NUMERIC string identifier is `resolveAny`/`findBy*`\n * territory — refused PRE-REQUEST with a pointer at\n * `autotask_resolve_any` (the same identifier contract as every other\n * read path);\n * - unknown field keys are refused PRE-REQUEST against the resource's\n * vendored-spec field set (the fetchMany taxonomy, re-used through\n * `validateFetchManyItems` with the calling op named);\n * - partial failures are PER-ITEM typed (`NOT_FOUND` / `SERVER_ERROR` /\n * the fault's typed code), never all-or-nothing: an item's failure\n * NEVER aborts the remaining items — including across chunk boundaries\n * (a chunk-level vendor fault faults every item of that chunk and the\n * remaining chunks still run);\n * - the op throws ONLY pre-request (`CONFIG_ERROR`: shape, limits, unknown\n * resource, unknown field key — all items validated up-front, the\n * complete problem list in one message, zero wire);\n * - wire cost: per resource group `ceil(uniqueIds/250)` query calls + one\n * `get` per query-missed id. Clean 500 ids, one resource: 2 wire. Blind\n * surface worst case: 2 + up to 500 gets — fetchMany parity, never\n * worse.\n *\n * It is a READ op: the governor appends no bag (no dry-run/confirm\n * interaction).\n */\nimport { AutotaskConfigError, isAutotaskError, NotFoundError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport type { Identifier } from '../types/common.js';\nimport { buildQueryRequest } from '../http.js';\nimport { unwrapItems } from '../http.js';\nimport { camelKey, parseIdentifier } from '../utils/index.js';\nimport { validateFetchManyItems } from './fetchMany.js';\nimport type { FetchManyItem, FetchManyItemResult, FetchManyItemError, FetchManyResult } from './types.js';\n\n/** The pinned per-call item cap (total items per call, mixed resources — the issue's \"500 ids\" budget; over → CONFIG_ERROR pre-request, zero wire). */\nexport const FETCH_BY_IDS_MAX_ITEMS = 500;\n\n/** The pinned `id in` chunk size (250/chunk — the chunk query is a single page: 250 is well under the 500 vendor page max). */\nexport const FETCH_BY_IDS_CHUNK_SIZE = 250;\n\nexport interface FetchByIdsOptions {\n /** May LOWER the {@link FETCH_BY_IDS_MAX_ITEMS} cap (integer >= 1) — never raise it. */\n maxItems?: number;\n}\n\ntype ItemOutcome = { found: true; value: Record<string, unknown> } | { found: false; value: null; error: FetchManyItemError };\n\n/** Project a fetched row to the requested fields (best-effort — the same\n * semantics as fetchMany's projection: validated keys absent from the row\n * are simply not present in the projection). */\nfunction project(value: Record<string, unknown>, fields: readonly string[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n if (f in value) out[f] = value[f];\n }\n return out;\n}\n\n/** The versioned global URL segment of a top-level resource holder (the\n * protected `resourcePath` getter, read off the live holder — one source of\n * truth with the resource itself). */\nfunction resourcePathOf(key: string, holder: unknown): string {\n const path = (holder as { resourcePath?: unknown } | null)?.resourcePath;\n if (typeof path !== 'string' || path === '') {\n // Unreachable after validation (the key was checked against the plan\n // resource set) — fail loudly anyway.\n throw new AutotaskConfigError(`fetchByIds: the client exposes no ${key} resource path (registry drift)`, {\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n return path;\n}\n\n/**\n * Fetch up to 500 single records by vendor numeric id across mixed\n * resources in ONE call (query-first chunked `id in` reads + the per-id\n * `get` fallback; per-item typed partial failure; the op throws only\n * pre-request).\n *\n * ```ts\n * import { fetchByIds } from 'node-autotask/operations';\n * const { results, ok, failed } = await fetchByIds(client, [\n * { resource: 'tickets', id: 527119 },\n * { resource: 'tickets', id: 527118, fields: ['id', 'title', 'status'] },\n * { resource: 'projects', id: 693 },\n * ]);\n * ```\n */\nexport async function fetchByIds(\n client: AutotaskClient,\n items: readonly FetchManyItem[],\n opts: FetchByIdsOptions = {},\n): Promise<FetchManyResult> {\n if (opts.maxItems !== undefined) {\n if (!Number.isInteger(opts.maxItems) || opts.maxItems < 1) {\n throw new AutotaskConfigError(`fetchByIds: maxItems must be an integer >= 1 (got ${String(opts.maxItems)})`);\n }\n }\n const cap = Math.min(FETCH_BY_IDS_MAX_ITEMS, opts.maxItems ?? FETCH_BY_IDS_MAX_ITEMS);\n // The shared pre-request validation (the fetchMany taxonomy, op name +\n // cap reference named for the calling op): shape, non-empty, cap, known\n // resource, parent-scoped refused, the identifier contract, the unknown\n // field keys — the complete problem list in one message, zero wire.\n validateFetchManyItems(items, cap, 'fetchByIds', `FETCH_BY_IDS_MAX_ITEMS = ${FETCH_BY_IDS_MAX_ITEMS}`);\n\n const groups = new Map<string, { indices: number[]; fields: Set<string>; anyFields: boolean }>();\n const canonical: Identifier[] = []; // per input index\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i]!;\n const id = parseIdentifier(item.id, `items[${i}].id`); // re-canonicalise (validation proved it passes)\n canonical[i] = id;\n const g = groups.get(item.resource) ?? { indices: [], fields: new Set<string>(), anyFields: false };\n g.indices.push(i);\n if (item.fields !== undefined) {\n g.anyFields = true;\n for (const f of item.fields) g.fields.add(f);\n }\n groups.set(item.resource, g);\n }\n\n /** Per RESOURCE-QUALIFIED key (`<resource>:<id>`): the settled outcome\n * (query hit / chunk fault / get fallback). The resource qualifier is\n * mandatory — the SAME numeric id may appear in DIFFERENT resources of\n * one mixed input (tickets id 1 vs projects id 1), and each resource's\n * rows and faults must settle independently. */\n const byKey = new Map<string, ItemOutcome>();\n\n for (const [key, group] of groups) {\n // The resource path + holder (validation proved the key is known and\n // top-level; fail loudly on drift).\n const holder = (client as unknown as Record<string, { get: (id: Identifier) => Promise<Record<string, unknown>> } | undefined>)[camelKey(key)];\n if (holder === undefined) {\n throw new AutotaskConfigError(`fetchByIds: the client exposes no accessor for resource \"${key}\"`, {\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n const resourcePath = resourcePathOf(key, holder);\n // Unique ids of the group (input order of first occurrence) — the wire\n // de-duplication: duplicates ride ONE chunk entry + ONE get (the\n // read cache on the holder dedups repeated gets when the client's\n // opt-in read cache is on).\n const unique: Identifier[] = [];\n const seen = new Set<string>();\n for (const i of group.indices) {\n const k = String(canonical[i]);\n if (!seen.has(k)) {\n seen.add(k);\n unique.push(canonical[i]!);\n }\n }\n // The group field union — IncludeFields ONLY when EVERY item of the group\n // requests fields (a whole-record item must not get a narrowed row; the\n // per-item project() narrows the rest) (the P1 id-append in buildQueryRequest then\n // guarantees `id` on every row ⇒ the rows are mappable by id).\n const includeFields = group.anyFields && group.indices.every((i) => items[i]!.fields !== undefined) ? [...group.fields] : undefined;\n\n // The resource-qualified byKey key (the group's plan key = the items'\n // `resource` field — the groups are built keyed by it): identical\n // numeric ids in different resources never share an outcome.\n const kOf = (id: unknown) => `${key}:${String(id)}`;\n\n for (let c = 0; c < unique.length; c += FETCH_BY_IDS_CHUNK_SIZE) {\n const chunk = unique.slice(c, c + FETCH_BY_IDS_CHUNK_SIZE);\n const chunkKeys = new Set(chunk.map((id) => String(id)));\n try {\n // ONE POST {resourcePath}/query per chunk — the single-page `id in`\n // read (250 is well under the 500 vendor page max; no cursor walk).\n const req = buildQueryRequest(client.http.baseUrl, resourcePath, {\n filter: [{ field: 'id', op: 'in', value: chunk }],\n maxRecords: FETCH_BY_IDS_CHUNK_SIZE,\n includeFields,\n });\n const res = await client.http.request<unknown>({ ...req, operation: `${key}.fetchByIds` });\n const { items: rows } = unwrapItems<Record<string, unknown>>(res, `${key}.fetchByIds`);\n for (const row of rows) {\n const k = String(row.id);\n if (!chunkKeys.has(k)) continue;\n const q = kOf(k);\n if (!byKey.has(q)) byKey.set(q, { found: true, value: row });\n }\n } catch (err) {\n // Chunk-level vendor fault: EVERY item of this chunk gets the\n // per-item typed fault (the chunk's code/httpStatus); the remaining\n // chunks STILL run (the never-aborts contract holds across chunk\n // boundaries). Non-SDK/abort faults propagate — swallowing one\n // would fake a partial result (the fetchMany rule).\n if (isAutotaskError(err) && err.code !== 'ABORTED') {\n const e: FetchManyItemError = { code: err.code, message: err.message };\n if (err.httpStatus !== undefined) e.httpStatus = err.httpStatus;\n for (const u of chunk) {\n const q = kOf(u);\n if (!byKey.has(q)) byKey.set(q, { found: false, value: null, error: e });\n }\n continue;\n }\n throw err;\n }\n }\n\n // The per-id `get` fallback: every unique id the chunk queries did NOT\n // settle (query-missed on a blind surface — or never chunked at all).\n // The GET is the authority on every surface (repo-pinned).\n for (const id of unique) {\n const k = kOf(id);\n if (byKey.has(k)) continue;\n try {\n const value = (await holder.get(id)) as Record<string, unknown>;\n byKey.set(k, { found: true, value });\n } catch (err) {\n if (err instanceof NotFoundError) {\n byKey.set(k, { found: false, value: null, error: { code: 'NOT_FOUND', message: err.message } });\n } else if (isAutotaskError(err) && err.code !== 'ABORTED') {\n const e: FetchManyItemError = { code: err.code, message: err.message };\n if (err.httpStatus !== undefined) e.httpStatus = err.httpStatus;\n byKey.set(k, { found: false, value: null, error: e });\n } else {\n // Not an item-level vendor outcome (an abort, or a non-SDK fault):\n // propagate — swallowing it would fake a partial result.\n throw err;\n }\n }\n }\n }\n\n // Re-merge into INPUT order (duplicates: each occurrence gets its own\n // entry with the identical outcome).\n const results: FetchManyItemResult[] = [];\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i]!;\n const id = canonical[i]!;\n const out = byKey.get(`${item.resource}:${String(id)}`)!; // every resource-qualified key settled: hit / fault / fallback\n const value = out.found ? (item.fields !== undefined ? project(out.value, item.fields) : out.value) : null;\n results.push(\n out.found\n ? { resource: item.resource, id, found: true, value }\n : { resource: item.resource, id, found: false, value: null, error: out.error },\n );\n }\n const ok = results.filter((r) => r.found).length;\n return { results, ok, failed: results.length - ok };\n}\n","/**\n * `operations.relationshipMap` — the served relationship artifact (S12-B,\n * run mcp-fix-20261003; plan §2.4 pinned shape).\n *\n * Serves the generated `src/relationships.ts` entry (the 5th generated\n * artifact, drift-guarded) for one plan resource: the resource, its parent,\n * its children (each with the scoped-op presence — which of create/query/\n * update/delete exist as registry ops — and its special ops), its natural\n * lookup keys (the searchCovers line + the findBy helpers), its pinned\n * blind-surface stamps, and the zone-verified create required sets + quirks.\n *\n * ZERO wire by construction: the data is the plan-pinned registry artifact —\n * \"what can I attach to a ticket?\" is answered from served data in one call\n * (today: catalog scan + 3-5 autotask_describe calls + relationship\n * re-derivation). The zone facts are zone-specific (the zone label travels\n * with them — never read across zones).\n *\n * The `client` parameter is part of the operations-layer call shape (every\n * helper takes the client first) — it is deliberately UNUSED: this op never\n * issues a request.\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { RELATIONSHIP_MAP, RELATIONSHIP_ZONE, type RelationshipResource } from '../relationships.js';\n\n/**\n * Serve one resource's relationship entry (zero wire).\n *\n * ```ts\n * import { relationshipMap } from 'node-autotask/operations';\n * const map = await relationshipMap(client, 'tickets');\n * // map.children — the scoped child resources with their scoped-op flags\n * // map.blindSurfaces — the pinned typed-sentinel stamps\n * // map.zoneFacts — the zone-verified required sets + quirks\n * ```\n *\n * @param client The wired client (unused — zero wire by construction).\n * @param resourceKey The plan resource key (e.g. `tickets`). Unknown keys\n * throw the typed `RESOURCE_UNKNOWN` (carries the resource\n * count + a pointer to `autotask_catalog` — never a\n * 128-key dump).\n */\nexport async function relationshipMap(client: AutotaskClient, resourceKey: string): Promise<RelationshipResource> {\n void client; // zero wire by construction — the served artifact needs no transport\n if (typeof resourceKey !== 'string' || resourceKey.trim() === '') {\n throw new AutotaskConfigError(\n `relationshipMap: resourceKey must be a non-empty plan resource key string (e.g. 'tickets'; got ${typeof resourceKey === 'string' ? 'a blank string' : typeof resourceKey})`,\n { suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. tickets, companies, configuration_items, ticket_notes.' },\n );\n }\n const key = resourceKey.trim();\n const entry = RELATIONSHIP_MAP[key];\n if (entry === undefined) {\n throw new AutotaskError(\n `relationshipMap: unknown resource \"${key}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${RELATIONSHIP_ZONE.label} (${RELATIONSHIP_ZONE.zone})-verified.`,\n },\n );\n }\n return entry;\n}\n","/**\n * `operations.blindSurfaces` — the served blind-surface inventory (issue\n * #11, wall QoL-01 / B1).\n *\n * Serves the generated `src/relationships.ts` inventory entry (the 116-\n * surface discovery artifact transfer — plan.reachability, drift-guarded by\n * scripts/check-capabilities.mjs clause 14) in ONE ZERO-wire call: per\n * resource the affected read ops, the blind class (the closed 4-set), the\n * unfiltered row count the ww29 discovery sweep observed, the authority op,\n * and the proof level — plus the data-full set, the artifact counts, and\n * the generic + per-resource remedies.\n *\n * The 6 pinned blindSurfaces stamps and their wording are UNCHANGED (the\n * pins stay byte-identical — the pinned trio rides the inventory with the\n * pin's own note text in remedies.byResource); this op is the WIDER\n * discovery set (69 blind / 46 data-full / 1 vendor-500 of the 116\n * query-able surfaces).\n *\n * ZERO wire by construction: the data is the plan-pinned discovery\n * artifact — \"can this user see this table at all?\" is answered from\n * served data (today: one more failed empty query per table).\n *\n * The `client` parameter is part of the operations-layer call shape (every\n * helper takes the client first) — it is deliberately UNUSED: this op never\n * issues a request.\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { BLIND_SURFACE_INVENTORY, RELATIONSHIP_MAP, type BlindSurfaceInventory, type BlindSurfaceRow } from '../relationships.js';\n\n/** The closed blind-class set (the gate clause 14 validates against this). */\nexport type BlindSurfaceKind = 'unowned-blind' | 'fully-blind' | 'unfiltered-blind' | 'unknown';\n\n/** The valid blind classes (served in the typed refusals — deterministic text). */\nexport const BLIND_SURFACE_KINDS: readonly BlindSurfaceKind[] = [\n 'unowned-blind',\n 'fully-blind',\n 'unfiltered-blind',\n 'unknown',\n];\n\n/** The optional filter bag for `operations.blindSurfaces`. */\nexport interface BlindSurfaceOptions {\n /** The plan resource key (e.g. `tickets`) — narrows the row set to that resource. Unknown keys throw the typed `RESOURCE_UNKNOWN`. */\n resource?: string;\n /** The blind class — narrows the row set to one class. Unknown kinds throw the typed `CONFIG_ERROR`. */\n kind?: BlindSurfaceKind;\n}\n\n/**\n * Serve the plan-pinned blind-surface inventory (ZERO wire).\n *\n * ```ts\n * import { blindSurfaces } from 'node-autotask/operations';\n * const inv = await blindSurfaces(client); // all 116 surfaces\n * const t = await blindSurfaces(client, { resource: 'tickets' }); // one resource\n * const b = await blindSurfaces(client, { kind: 'unfiltered-blind' }); // one class\n * // inv.counts — { total: 116, dataFull: 46, blind: 69, pinned: 6 } (always artifact-wide)\n * // inv.dataFull — the resources whose unfiltered reads are safe\n * // inv.remedies — the generic + per-resource (pinned trio) remedy text\n * ```\n *\n * The counts describe the WHOLE pinned artifact regardless of the filter —\n * only `surfaces` narrows (the counts are the drift-pinned discovery fact).\n *\n * @param client The wired client (unused — zero wire by construction).\n * @param opts The optional filter ({ resource?, kind? }).\n */\nexport async function blindSurfaces(client: AutotaskClient, opts?: BlindSurfaceOptions): Promise<BlindSurfaceInventory> {\n void client; // zero wire by construction — the served artifact needs no transport\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError('blindSurfaces: opts must be an object { resource?: string, kind?: BlindSurfaceKind }');\n }\n const inv = BLIND_SURFACE_INVENTORY;\n if (inv === null) {\n // Unreachable in the shipped artifact (the gate pins the block) — fail\n // closed with a deterministic message rather than serving nothing.\n throw new AutotaskConfigError('blindSurfaces: the reachability inventory is absent from the generated artifact — re-run the build');\n }\n let surfaces = inv.surfaces;\n if (opts?.resource !== undefined) {\n const key = typeof opts.resource === 'string' ? opts.resource.trim() : '';\n if (key === '') {\n throw new AutotaskConfigError(\n 'blindSurfaces: opts.resource must be a non-empty plan resource key string (e.g. \\'tickets\\')',\n { suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. tickets, companies, configuration_items.' },\n );\n }\n if (!inv.surfaces.some((row) => row.resource === key)) {\n throw new AutotaskError(\n `blindSurfaces: unknown resource \"${key}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${inv.label} (${inv.zone})-verified.`,\n },\n );\n }\n surfaces = surfaces.filter((row) => row.resource === key);\n }\n if (opts?.kind !== undefined) {\n if (!(BLIND_SURFACE_KINDS as readonly string[]).includes(opts.kind)) {\n throw new AutotaskConfigError(\n `blindSurfaces: unknown kind \"${String(opts.kind)}\" — the valid classes are: ${BLIND_SURFACE_KINDS.join(', ')}`,\n { suggestedAction: `Filter with one of: ${BLIND_SURFACE_KINDS.join(', ')} (or omit kind for the full 116-surface inventory).` },\n );\n }\n surfaces = surfaces.filter((row) => row.kind === opts.kind);\n }\n return { ...inv, surfaces };\n}\n\n\n/** Re-export the row type for consumers (the inventory's surface rows). */\nexport type { BlindSurfaceRow };\n","/**\n * `operations.probeReachability` — the bounded, caller-opted, read-only\n * reachability sweep (issue #11, wall QoL-01 / B1).\n *\n * Re-runs the blind-surface discovery live, on THIS tenant: ONE bounded\n * limit-N query per named surface (default 2 rows, 1-2 accepted), a hard\n * wire cap (default 40, REFUSED above 80), and an explicit `confirmProbe:\n * true` (mirroring the write governor's confirm discipline — the op\n * deliberately fans out reads across the tenant, so the act is the\n * caller's). Per-resource failures are recorded on the row (code +\n * message) and NEVER abort the sweep; the result reports `wireUsed` (≤ cap\n * by construction — over-cap requests are refused pre-request, never\n * truncated) and `truncated: false` (refuse-not-truncate is the contract).\n *\n * Read-only by construction: every probe is a bounded `queryBounded` read\n * (one vendor call per surface; no create/update/delete wire). The pinned\n * inventory (operations.blindSurfaces) stays the ww29 discovery artifact —\n * this op is how ANOTHER tenant gets its own answer.\n */\nimport { AutotaskConfigError, AutotaskError, isAutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { BLIND_SURFACE_INVENTORY, REACHABILITY_PROBE_DEFAULTS, type BlindSurfaceRow } from '../relationships.js';\nimport { camelKey } from '../utils/index.js';\n\n/** The optional sweep bag for `operations.probeReachability`. */\nexport interface ProbeReachabilityOptions {\n /** The plan resource keys to probe. Omitted → the 70 non-data-full pinned surfaces (the 69 blind + ticket_history); that set exceeds the default cap, so probing it requires an explicit `maxWireCalls` (≤ 80). */\n resources?: string[];\n /** Rows per surface (1-2; default 2). Out of range → CONFIG_ERROR. */\n limit?: number;\n /** The hard cap for this call (default 40) — it bounds the number of probed surfaces (one bounded read each); transport retries on a probe are not counted against it. Refused above 80; a requested set larger than the cap is refused pre-request (refused, never truncated). */\n maxWireCalls?: number;\n /** REQUIRED. Without it the op refuses with CONFIG_ERROR before any request (the deliberate act is the caller's). */\n confirmProbe?: true;\n}\n\n/**\n * One probe outcome (the pinned row + the live probe result). The pinned\n * fields reuse the GENERATED `BlindSurfaceRow` (the plan's ops/kind/proof\n * unions — a plan change re-derives them here; no hand-duplicated unions\n * that could drift, post-verification F4).\n */\nexport type ProbeSurfaceRow = Omit<BlindSurfaceRow, 'unfilteredRows'> & {\n /** The LIVE observed unfiltered row count (null when the probe failed). */\n unfilteredRows: number | null;\n /** The probe outcome for this surface. */\n probe: {\n ok: boolean;\n /** The bounded reads this probe issued (0 = refused pre-probe, 1 = one bounded read). */\n wire: number;\n /** The recorded failure (never thrown; the sweep keeps going). */\n error: { code: string; message: string } | null;\n };\n}\n\n/** The sweep result. */\nexport interface ProbeReachabilityResult {\n results: ProbeSurfaceRow[];\n /**\n * The bounded probe reads actually issued — one per probed surface, so it\n * can never exceed `cap` (the cap bounds the SURFACE SET; transport\n * retries inside a probe are additional wire and are not counted — the\n * raw wire total can therefore exceed `cap` slightly).\n */\n wireUsed: number;\n /** The wire cap the call ran under. */\n cap: number;\n /** Always false: over-cap requests REFUSE (CONFIG_ERROR) — they are never silently truncated. */\n truncated: boolean;\n}\n\n/**\n * Run the bounded reachability sweep (caller-opted, read-only).\n *\n * ```ts\n * import { probeReachability } from 'node-autotask/operations';\n * const res = await probeReachability(client, {\n * resources: ['contacts', 'resources', 'companies'],\n * limit: 2, // 1-2, default 2\n * maxWireCalls: 40, // default 40, refused above 80\n * confirmProbe: true, // REQUIRED\n * });\n * // res.wireUsed — the probes issued (≤ cap); res.results — one row per\n * // requested surface (probe.ok false + probe.error where one failed)\n * ```\n *\n * @param client The wired client (the probes issue bounded queryBounded reads).\n * @param opts The sweep bag ({ resources?, limit?, maxWireCalls?, confirmProbe? }).\n */\nexport async function probeReachability(\n client: AutotaskClient,\n opts?: ProbeReachabilityOptions,\n): Promise<ProbeReachabilityResult> {\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError('probeReachability: opts must be an object { resources?: string[], limit?: 1|2, maxWireCalls?: number, confirmProbe?: true }');\n }\n const defs = REACHABILITY_PROBE_DEFAULTS;\n // --- the deliberate act: confirmProbe is REQUIRED (pre-request, zero wire)\n if (opts?.confirmProbe !== true) {\n throw new AutotaskConfigError(\n 'probeReachability: confirmProbe: true is required — the op deliberately fans out read wire across the tenant (one bounded query per surface); pass confirmProbe: true to run it',\n { suggestedAction: `Re-call with { confirmProbe: true } (plus resources/limit/maxWireCalls as needed). For the ZERO-wire pinned inventory use operations.blindSurfaces.` },\n );\n }\n // --- the limit bounds (1-2; pre-request, zero wire)\n const limit = opts?.limit ?? defs.limitDefault;\n if (!Number.isInteger(limit) || limit < 1 || limit > defs.limitMax) {\n throw new AutotaskConfigError(\n `probeReachability: limit must be an integer 1..${defs.limitMax} (got ${String(limit)}) — the rows-per-surface bound for the discovery read`,\n );\n }\n // --- the wire cap (default 40; refused above the hard cap of 80)\n const cap = opts?.maxWireCalls ?? defs.defaultCap;\n if (!Number.isInteger(cap) || cap < 1) {\n throw new AutotaskConfigError(`probeReachability: maxWireCalls must be a positive integer (got ${String(cap)})`);\n }\n if (cap > defs.hardCap) {\n throw new AutotaskConfigError(\n `probeReachability: maxWireCalls ${cap} exceeds the hard wire cap of ${defs.hardCap} — the sweep is refused above it (never capped silently)`,\n { suggestedAction: `Pass maxWireCalls ≤ ${defs.hardCap} and a resources set no larger than the cap (the refused set is never truncated).` },\n );\n }\n // --- the target set (explicit resources, or the derived default set)\n const inv = BLIND_SURFACE_INVENTORY;\n if (inv === null) {\n throw new AutotaskConfigError('probeReachability: the reachability inventory is absent from the generated artifact — re-run the build');\n }\n let targets: string[];\n if (opts?.resources === undefined) {\n targets = [...defs.defaultTargets];\n } else {\n if (!Array.isArray(opts.resources) || opts.resources.length === 0) {\n throw new AutotaskConfigError('probeReachability: opts.resources must be a non-empty string[] of plan resource keys (or omit it for the default non-data-full set)');\n }\n const seen = new Set<string>();\n for (const r of opts.resources) {\n if (typeof r !== 'string' || r.trim() === '') {\n throw new AutotaskConfigError(`probeReachability: opts.resources must contain non-empty plan resource key strings (got ${typeof r === 'string' && r.trim() === '' ? 'a blank string' : typeof r})`);\n }\n const key = r.trim();\n if (!inv.surfaces.some((row) => row.resource === key)) {\n const surfaceCount = new Set(inv.surfaces.map((s) => s.resource)).size;\n throw new AutotaskError(\n `probeReachability: unknown resource \"${key}\" — the inventory has ${surfaceCount} surfaces`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items).',\n },\n );\n }\n seen.add(key);\n }\n targets = [...seen];\n }\n if (targets.length > cap) {\n throw new AutotaskConfigError(\n `probeReachability: ${targets.length} requested surface(s) exceed the wire cap of ${cap} — the sweep is refused above its cap (never truncated)`,\n { suggestedAction: `Raise maxWireCalls (≤ ${defs.hardCap}) to cover the set, or pass a smaller resources list.` },\n );\n }\n // --- the sweep (sequential bounded reads; per-surface failures recorded)\n const byResource = new Map(inv.surfaces.map((row) => [row.resource, row]));\n const results: ProbeSurfaceRow[] = [];\n for (const resource of targets.sort()) {\n const row = byResource.get(resource);\n if (row === undefined) continue; // unreachable: validated above\n const holder = (client as unknown as Record<string, unknown>)[camelKey(resource)] as\n | { queryBounded?: (params?: { filter?: unknown; limit?: number; includeFields?: string[] }) => Promise<{ items: unknown[] }> }\n | undefined;\n const probeFn = holder?.queryBounded;\n if (typeof probeFn !== 'function') {\n results.push({\n ...row,\n unfilteredRows: null,\n probe: { ok: false, wire: 0, error: { code: 'RESOURCE_NO_QUERY_OP', message: `no queryBounded read exists on the client accessor for \"${resource}\" — nothing was probed` } },\n });\n continue;\n }\n try {\n const res = await probeFn.call(holder, { limit });\n // The probe reads ONE page (limit ≤ 2): reachability is\n // items.length > 0 — `hasMore` is intentionally NOT followed (a probe\n // that walked pages would turn a bounded read into a sweep).\n const items = Array.isArray(res?.items) ? res.items : [];\n results.push({\n ...row,\n unfilteredRows: items.length,\n probe: { ok: true, wire: 1, error: null },\n });\n } catch (err) {\n const code = isAutotaskError(err) ? err.code : 'NETWORK_ERROR';\n const message = err instanceof Error ? err.message : String(err);\n results.push({\n ...row,\n unfilteredRows: null,\n probe: { ok: false, wire: 1, error: { code, message } },\n });\n }\n }\n // Single source (post-verification N1): the per-row wire counts ARE the\n // total (0 = refused pre-probe / no query op, 1 = one bounded read).\n const wireUsed = results.reduce((n, r) => n + r.probe.wire, 0);\n return { results, wireUsed, cap, truncated: false };\n}\n","/**\n * `operations.createGuidance` — the zone-fact create-guidance catalog\n * (issue #12, wall QoL-03).\n *\n * Serves the WIDENED zone facts ZERO-wire: the 92 campaign-decoded create\n * entities of the stage-11 apply-matrix (marker FULL100W-1791110339, ww29) —\n * per resource the correct create op, the live-proven required-field prefix\n * (vendor-demand order), whether the create still failed after it (unproven),\n * the structured blocker (the wall class + the remedy), the EXACT vendor\n * message text observed (never paraphrased), and the spec-derived delete\n * boundary (the W-A1 field on the same row). The discovery cost was already\n * paid by the write campaign (461 classified write requests); this op is how\n * a caller gets that answer without paying it again.\n *\n * The relationship map keeps serving its existing `zoneFacts` shape (the 11\n * hand-authored entries keep their createRequiredSet/quirks byte-for-byte) —\n * the per-resource `createGuidance` plan field is additive, and THIS op is\n * the wider served view (one row per plan create op).\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport {\n CREATE_GUIDANCE,\n type CreateBlockerKind,\n type CreateGuidanceReport,\n type CreateGuidanceRow,\n} from '../relationships.js';\n\n/** The closed blocker-kind set (the gate re-derives it; unknown kind → CONFIG_ERROR). */\n/**\n * The closed blocker-kind set served by `operations.createGuidance`.\n * Superset of issue #12's 8-value enumeration: the campaign decode produced\n * 14 rows that matched no named blocker (wall-adjacent create shapes with\n * verbatim vendor evidence) — the closed set gained `'unknown'` (9 kinds)\n * rather than forcing those rows into a misfitting class.\n */\nexport const CREATE_BLOCKER_KINDS: readonly CreateBlockerKind[] = [\n 'ok',\n 'blind-reference',\n 'blind-parent',\n 'picklist-unexposed',\n 'undocumented-ladder',\n 'resource-role-pair',\n 'delete-absent',\n 'non-mutable',\n 'unknown',\n] as const;\n\n/** The optional filter bag for `operations.createGuidance`. */\nexport interface CreateGuidanceOptions {\n /** The plan resource keys — narrows the row set. Unknown key → typed RESOURCE_UNKNOWN (zero wire). */\n resources?: string[];\n /** Narrows to one blocker kind. Unknown kind → typed CONFIG_ERROR naming the valid kinds (zero wire). */\n kind?: CreateBlockerKind;\n}\n\n/**\n * Serve the zone-fact create-guidance catalog (zero wire).\n *\n * ```ts\n * import { createGuidance } from 'node-autotask/operations';\n * const rep = await createGuidance(client, { resources: ['tickets', 'projects'] });\n * // rep.rows — one row per named resource: the create op, the live-proven\n * // prefix, the blocker (wall class + remedy), the exact vendor text, the\n * // delete boundary. rep.counts describe the WHOLE pinned catalog.\n * ```\n *\n * @param client The wired client (unused — the served data is plan-pinned; the parameter exists so the op rides the invoke holder like every other operation).\n * @param opts The optional filter bag ({ resources?, kind? }).\n */\nexport async function createGuidance(\n client: AutotaskClient,\n opts?: CreateGuidanceOptions,\n): Promise<CreateGuidanceReport> {\n void client; // zero wire by construction — the data is the plan-pinned artifact\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError(\n 'createGuidance: opts must be an object { resources?: string[], kind?: CreateBlockerKind }',\n );\n }\n let rows: CreateGuidanceRow[] = CREATE_GUIDANCE.rows;\n // --- the resource filter (narrow only; unknown keys refuse zero-wire)\n if (opts?.resources !== undefined) {\n if (!Array.isArray(opts.resources) || opts.resources.length === 0) {\n throw new AutotaskConfigError('createGuidance: opts.resources must be a non-empty string[] of plan resource keys');\n }\n const wanted = new Set<string>();\n for (const r of opts.resources) {\n if (typeof r !== 'string' || r.trim() === '') {\n throw new AutotaskConfigError('createGuidance: opts.resources must contain non-empty plan resource key strings');\n }\n const key = r.trim();\n if (!CREATE_GUIDANCE.rows.some((row) => row.resource === key)) {\n throw new AutotaskError(\n `createGuidance: unknown resource \"${key}\" — the catalog has ${CREATE_GUIDANCE.rows.length} create entities`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, projects, opportunities).',\n },\n );\n }\n wanted.add(key);\n }\n rows = rows.filter((row) => wanted.has(row.resource));\n }\n // --- the kind filter (closed 9-set; unknown kinds refuse zero-wire)\n if (opts?.kind !== undefined) {\n if (!CREATE_BLOCKER_KINDS.includes(opts.kind)) {\n throw new AutotaskConfigError(\n `createGuidance: unknown kind \"${String(opts.kind)}\" — the valid kinds are: ${CREATE_BLOCKER_KINDS.join(', ')}`,\n );\n }\n rows = rows.filter((row) => row.blocker?.kind === opts.kind);\n }\n // the counts describe the WHOLE pinned catalog regardless of the filter\n return {\n zone: CREATE_GUIDANCE.zone,\n label: CREATE_GUIDANCE.label,\n verifiedAt: CREATE_GUIDANCE.verifiedAt,\n rows,\n counts: CREATE_GUIDANCE.counts,\n };\n}\n","/**\n * `operations.recovery` — the one-call recovery/cleanup op (issue #9, wall\n * W-A1 / P1).\n *\n * The delete-boundary reality (the spec-derived audit in\n * scripts/lib/delete-boundary.mjs, plan.deleteBoundaries): the vendored spec\n * defines NO DELETE on many entity paths — most of them the campaign's own\n * resources. A `create` that cannot be undone through the API leaves the\n * created record as permanent residue once its id is lost. This op is the\n * typed one-call path out:\n *\n * - `find` (the default — a READ): ONE bounded marker-filtered query\n * (server-side pagination, zero mutating wire) returns the matched\n * records' ids + the delete-boundary fact + the UI-only cleanup note.\n * - `delete` (destructive, dry-run-first): the dry run performs the search\n * and reports the match set with ZERO DELETE wire; the apply requires the\n * exact confirm string (`RECOVERY_CONFIRM`) and issues one DELETE per\n * safe match id + one verification read per id.\n *\n * Pinned semantics (the P1 discipline — never a silent failure mode):\n * - the boundary is KNOWN LOCALLY (the spec audit): a delete on a\n * delete-less resource refuses PRE-SEARCH with the typed `DELETE_BOUNDARY`\n * (zero wire) — never a raw vendor 405;\n * - a match whose id is NOT representable as a safe JS integer (beyond\n * Number.MAX_SAFE_INTEGER) is NEVER a silent skip: `delete` refuses with\n * the typed `MARKER_UNSAFE_ID` (zero DELETE wire); `find` marks the match\n * `id: null` + `unsafeId: true` so the caller sees the unaddressable\n * record (and the UI-only cleanup note);\n * - a bounded search that TRIPS the match cap (more matches than `limit`)\n * refuses with the typed `RECOVERY_TRUNCATED` — never a silent\n * truncation, never a silent empty;\n * - an unknown `resource` refuses PRE-REQUEST with the typed\n * `RESOURCE_UNKNOWN` (the same code `operations.relationshipMap` uses:\n * carries the resource count + the `autotask_catalog` pointer — never a\n * 128-key dump).\n *\n * The marker search is a `contains` filter on the name-like field the write\n * stamped (default: the plan's `markerField` for the resource — the\n * spec-derived deterministic priority over the vendored model's field set;\n * pass `field` to override, or it is required when the resource has no\n * markerField). The search itself is a plain bounded query on the resource's\n * own surface (the governor's bounded-scan discipline applies — the walk\n * stops at `limit`, never scans unbounded).\n */\nimport {\n AutotaskConfigError,\n AutotaskError,\n ConfirmationRequiredError,\n DeleteBoundaryError,\n isAutotaskError,\n MarkerUnsafeIdError,\n NotFoundError,\n RecoveryTruncatedError,\n} from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey, isRecord } from '../utils/index.js';\nimport { DELETE_BOUNDARY_NOTES, MARKER_FIELDS, RELATIONSHIP_MAP } from '../relationships.js';\nimport type { FilterCondition } from '../types/common.js';\n\n/** The exact confirmation string the destructive apply requires (R4 style: the op key). */\nexport const RECOVERY_CONFIRM = 'operations.recovery';\n\n/** The default TOTAL match cap of the marker search. */\nexport const RECOVERY_DEFAULT_LIMIT = 25;\n\n/** The hard TOTAL match cap (a CONFIG_ERROR above it — pre-request, zero wire). */\nexport const RECOVERY_MAX_LIMIT = 100;\n\n/** The one-call recovery/cleanup input (all validation is pre-request, zero wire). */\nexport interface RecoveryInput {\n /** The plan resource key (e.g. 'companies'). Unknown → typed RESOURCE_UNKNOWN. */\n resource: string;\n /** The marker the write stamped into a name-like field (searched with `contains`). */\n marker: string;\n /**\n * The name-like vendor field to filter on (API casing). Default: the\n * plan's markerField for the resource; REQUIRED when the resource has no\n * markerField (a CONFIG_ERROR names the model's fields as the candidates).\n */\n field?: string;\n /** Parent scope (parent-scoped child resources only — narrows the search on the parent FK). */\n parentId?: number;\n /** Extra leaf filter conditions narrowing the search (e.g. `{ field: 'status', op: 'eq', value: 'open' }`). */\n filter?: FilterCondition[];\n /** The TOTAL match cap (default 25, max 100). */\n limit?: number;\n /** 'find' (default — a read) | 'delete' (destructive — dry-run-first, confirm-gated apply). */\n action?: 'find' | 'delete';\n /**\n * The apply confirmation for `action: 'delete'` (the exact op key —\n * `operations.recovery`). Accepted on the INPUT as well as in\n * {@link RecoveryOptions.confirm} so the MCP tool path can apply a delete:\n * the tool bag has no confirm slot, so the input object rides it (the SDK\n * options path stays the canonical form; the two are equivalent).\n */\n confirm?: string;\n}\n\n/** One matched record (the id is null when unrepresentable — see unsafeId). */\nexport interface RecoveryMatch {\n /** The record's id (null when beyond Number.MAX_SAFE_INTEGER — never a silent skip). */\n id: number | null;\n /** The marker field's value in the matched record. */\n value: string | number | boolean | null;\n}\n\n/** The delete-boundary fact carried in every recovery result. */\nexport interface RecoveryDeleteBoundary {\n /** False when the vendor defines no DELETE for the resource (cleanup is UI-only). */\n available: boolean;\n /** The spec-derived boundary note (available=false) — null when the boundary is available. */\n reason: string | null;\n /** The authority op that answers for the record (null — the boundary is spec-derived). */\n authority: string | null;\n}\n\n/** The one-call recovery/cleanup result (issue #9). */\nexport interface RecoveryResult {\n /** The resource key the op ran against. */\n resource: string;\n /** The marker searched. */\n marker: string;\n /** The field the marker was searched on. */\n field: string;\n /** The action that ran ('find' | 'delete'). */\n action: 'find' | 'delete';\n /** The matched records (empty = the marker matched nothing in the bounded scan). */\n matches: RecoveryMatch[];\n /** Records returned by the single bounded query. */\n scanned: number;\n /**\n * Always false in a returned result: a cap-tripped search REFUSES with\n * RECOVERY_TRUNCATED before any result exists (never a silent truncation).\n */\n truncated: boolean;\n /** The spec-derived delete boundary (zero wire — the plan audit). */\n delete: RecoveryDeleteBoundary;\n /** True when ANY match's id is unrepresentable (beyond Number.MAX_SAFE_INTEGER — P1). */\n unsafeId: boolean;\n /** The manual cleanup note (delete-less resources) — null when the boundary is available. */\n cleanup: { manual: boolean; note: string } | null;\n /** Delete apply only: the per-id outcome (code = the typed code of a failed per-id DELETE). */\n deleted?: Array<{ id: number; verified: boolean; code?: string }>;\n /** Delete dry run only: the envelope marker (the apply path omits it). */\n simulated?: boolean;\n /** The dry-run flag the op ran under (the governor appends dry-run-first). */\n dryRun?: boolean;\n}\n\n/** The op options (the governor's trailing bag lands here). */\nexport interface RecoveryOptions {\n /** Simulate (default true — dry-run-first; the governor appends the governed flag). */\n dryRun?: boolean;\n /** The exact confirmation string for the delete apply (RECOVERY_CONFIRM). */\n confirm?: string;\n}\n\n/** The structural slice of the resource surface the op needs (typed loosely — the holder is a client accessor). */\ninterface RecoveryHolder {\n queryBounded: (params?: { filter?: FilterCondition[]; limit?: number }) => Promise<{\n items: Array<Record<string, unknown>>;\n fetched: number;\n hasMore: boolean;\n pagesWalked: number;\n }>;\n get: (...ids: number[]) => Promise<Record<string, unknown>>;\n delete?: (...ids: number[]) => Promise<unknown>;\n}\n\nfunction configError(message: string, operation: string, suggestedAction: string): never {\n throw new AutotaskConfigError(message, { operation, suggestedAction });\n}\n\n/** Parse a vendor record id into a safe JS integer (null + unsafe when unrepresentable — P1). */\nfunction parseMatchId(record: Record<string, unknown>): { id: number | null; unsafe: boolean } {\n const raw = record.id;\n if (typeof raw === 'number') {\n if (Number.isInteger(raw) && raw >= 0 && raw <= Number.MAX_SAFE_INTEGER) return { id: raw, unsafe: false };\n return { id: null, unsafe: true };\n }\n if (typeof raw === 'string' && /^\\d+$/.test(raw.trim())) {\n const n = Number(raw.trim());\n if (Number.isSafeInteger(n)) return { id: n, unsafe: false };\n return { id: null, unsafe: true };\n }\n return { id: null, unsafe: true };\n}\n\n/**\n * Run the one-call recovery/cleanup op.\n *\n * ```ts\n * import { recovery } from 'node-autotask/operations';\n * // Find the scratch record the write just created (one bounded query, zero mutating wire):\n * const r = await recovery(client, { resource: 'companies', marker: 'FULL100W-1791110339' });\n * // r.delete.available === false + r.cleanup.note — the spec says the vendor has no DELETE.\n *\n * // Where the vendor DOES allow it (delete available):\n * const dry = await recovery(client, { resource: 'configuration_item_dns_records', marker: 'm', parentId: 42 }, { dryRun: true });\n * const applied = await recovery(client, { resource: 'configuration_item_dns_records', marker: 'm', parentId: 42, action: 'delete' }, { dryRun: false, confirm: 'operations.recovery' });\n * ```\n *\n * @param client The wired client (the op runs against the resource's own bounded-query surface).\n * @param input The recovery input (see {@link RecoveryInput}).\n * @param opts The op options (dryRun / confirm — the governor appends the governed bag).\n */\nexport async function recovery(\n client: AutotaskClient,\n input: RecoveryInput,\n opts: RecoveryOptions = {},\n): Promise<RecoveryResult> {\n const operation = RECOVERY_CONFIRM;\n\n // ---- input validation (pre-request, zero wire) --------------------------\n if (!isRecord(input)) {\n configError(\n `recovery: input must be an object { resource, marker, ... } (got ${typeof input})`,\n operation,\n \"Pass { resource: '<plan key>', marker: '<the marker the write stamped>' } — e.g. { resource: 'companies', marker: 'FULL100W-1791110339' }.\",\n );\n }\n const resource = typeof input.resource === 'string' ? input.resource.trim() : '';\n if (resource === '') {\n configError(\n `recovery: input.resource must be a non-empty plan resource key string (e.g. 'companies')`,\n operation,\n 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. companies, tickets, configuration_items.',\n );\n }\n const marker = typeof input.marker === 'string' ? input.marker : '';\n if (marker.trim() === '') {\n configError(\n 'recovery: input.marker must be a non-empty string — the marker the write stamped into a name-like field',\n operation,\n \"Stamp a deterministic marker into the record at create time (e.g. `FULL100W-${Date.now()}`) and pass it here; a guess is not a marker.\",\n );\n }\n const action: 'find' | 'delete' = input.action ?? 'find';\n if (action !== 'find' && action !== 'delete') {\n configError(\n `recovery: input.action must be 'find' (default) or 'delete' (got ${JSON.stringify(String(input.action))})`,\n operation,\n \"Pass action: 'delete' for the destructive path (dry-run-first; the apply requires the confirm string).\",\n );\n }\n\n // ---- resource resolution (the typed RESOURCE_UNKNOWN — zero wire) -------\n const entry = RELATIONSHIP_MAP[resource];\n if (entry === undefined) {\n throw new AutotaskError(\n `recovery: unknown resource \"${resource}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n operation,\n suggestedAction:\n 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items).',\n },\n );\n }\n const holder = (client as unknown as Record<string, unknown>)[camelKey(resource)] as RecoveryHolder | undefined;\n if (!holder || typeof holder.queryBounded !== 'function') {\n configError(\n `recovery: ${resource} exposes no bounded query surface — the marker search cannot run`,\n operation,\n 'Use a resource with a query surface, or address the record by id directly (get/fetchMany).',\n );\n }\n\n // ---- the marker field (the plan's markerField default) -------------------\n const field = input.field !== undefined ? String(input.field) : MARKER_FIELDS[resource];\n if (typeof field !== 'string' || field.trim() === '') {\n configError(\n `recovery: ${resource} has no plan markerField and no input.field was passed — the marker search needs a name-like field to filter on`,\n operation,\n 'Pass input.field — a name-like vendor field the marker was stamped into (see the resource model in autotask_describe / autotask_catalog).',\n );\n }\n\n // ---- the parent scope (parent-scoped child resources only) ---------------\n let parentId: number | undefined;\n if (input.parentId !== undefined) {\n if (!Number.isInteger(input.parentId) || input.parentId < 0) {\n configError(\n `recovery: input.parentId must be a non-negative integer (got ${String(input.parentId)})`,\n operation,\n 'Pass the parent record id (e.g. the ticket id for a ticket note).',\n );\n }\n parentId = input.parentId;\n if (entry.parent === null || entry.parent.field === null) {\n configError(\n `recovery: ${resource} is not a parent-scoped child resource — input.parentId does not apply`,\n operation,\n `Drop input.parentId (the search runs unscoped), or pass the child resource that IS scoped under ${resource}.`,\n );\n }\n }\n\n // ---- the extra filter (leaf conditions only) ------------------------------\n const extra: FilterCondition[] = [];\n if (input.filter !== undefined) {\n if (!Array.isArray(input.filter)) {\n configError(\n `recovery: input.filter must be an array of leaf filter conditions (got ${typeof input.filter})`,\n operation,\n 'Pass e.g. [{ field: \\'status\\', op: \\'eq\\', value: \\'open\\' }] — leaf conditions only.',\n );\n }\n for (const c of input.filter) {\n if (!isRecord(c) || typeof c.op !== 'string' || c.op === 'and' || c.op === 'or') {\n configError(\n 'recovery: input.filter accepts only plain leaf conditions ({ field, op, value }) — no grouping',\n operation,\n 'Pass flat leaf conditions; grouping operators are not supported here.',\n );\n }\n extra.push(c as FilterCondition);\n }\n }\n\n // ---- the match cap --------------------------------------------------------\n let limit = RECOVERY_DEFAULT_LIMIT;\n if (input.limit !== undefined) {\n if (!Number.isInteger(input.limit) || input.limit < 1 || input.limit > RECOVERY_MAX_LIMIT) {\n configError(\n `recovery: input.limit must be an integer 1..${RECOVERY_MAX_LIMIT} (got ${String(input.limit)})`,\n operation,\n `Raise the marker precision instead of the cap, or pass limit up to ${RECOVERY_MAX_LIMIT}.`,\n );\n }\n limit = input.limit;\n }\n\n // ---- the spec-derived delete boundary (zero wire — the plan audit) --------\n const boundaryNote = DELETE_BOUNDARY_NOTES[resource];\n const boundary: RecoveryDeleteBoundary = {\n available: boundaryNote === undefined,\n reason: boundaryNote ?? null,\n authority: null,\n };\n const cleanup =\n boundaryNote === undefined\n ? null\n : {\n manual: true,\n note: `the vendor defines no DELETE for ${resource} — remove the record(s) in the Autotask UI (UI-only cleanup; the API 405s the method). ${boundaryNote}`,\n };\n\n const isDelete = action === 'delete';\n\n // ---- delete: the PRE-SEARCH boundary refusal (zero wire) ------------------\n if (isDelete && boundaryNote !== undefined) {\n throw new DeleteBoundaryError(\n `recovery: the vendor defines no DELETE for ${resource} — the delete cannot be issued through the API (zero wire was issued)`,\n {\n operation,\n suggestedAction: cleanup!.note,\n details: { resource, note: boundaryNote },\n },\n );\n }\n\n // ---- delete: the confirm gate (dry-run-first; apply is deliberate) --------\n const dryRun = opts?.dryRun !== false;\n // The confirm is read from the options bag (the SDK canonical path, the\n // governor forwards it) OR the input object (the MCP tool path — the tool\n // bag has no confirm slot; post-verification F2).\n const confirm = opts?.confirm ?? input.confirm;\n if (isDelete && !dryRun && confirm !== RECOVERY_CONFIRM) {\n throw new ConfirmationRequiredError(\n `recovery: action 'delete' apply is destructive and requires its confirmation flag: pass confirm: \"${RECOVERY_CONFIRM}\"`,\n {\n operation: RECOVERY_CONFIRM,\n suggestedAction:\n 'Pass confirm equal to the operation key to acknowledge the deliberate act — or keep the dry run (omit dryRun: false) and read the match set first.',\n },\n );\n }\n\n // ---- ONE bounded query (the marker search — a read) -----------------------\n const conditions: FilterCondition[] = [\n { field, op: 'contains', value: marker },\n ...(parentId !== undefined && entry.parent !== null && entry.parent.field !== null\n ? [{ field: entry.parent.field, op: 'eq' as const, value: parentId } as FilterCondition]\n : []),\n ...extra,\n ];\n const query = await holder.queryBounded({ filter: conditions, limit });\n\n // ---- the cap-tripped refusal (never a silent truncation / silent empty) ---\n if (query.hasMore) {\n const wire = isDelete ? 'DELETE wire' : 'mutating wire';\n throw new RecoveryTruncatedError(\n `recovery: the marker search on ${resource} TRIPPED its match cap (${limit}) — more matches exist than were returned (zero ${wire} was issued)`,\n {\n operation,\n suggestedAction: `Narrow the search (a more precise marker, an input.filter condition, input.parentId) or pass a higher limit (max ${RECOVERY_MAX_LIMIT}).`,\n details: { resource, scanned: query.fetched, limit },\n },\n );\n }\n\n // ---- the matches (ids parsed into safe integers — never a silent skip) ----\n const matches: RecoveryMatch[] = [];\n const unsafeIds: number[] = [];\n query.items.forEach((record, idx) => {\n const parsed = parseMatchId(record);\n if (parsed.unsafe) unsafeIds.push(idx);\n const value = record[field];\n matches.push({\n id: parsed.id,\n value: typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? value : null,\n });\n });\n const unsafeId = unsafeIds.length > 0;\n\n const base: RecoveryResult = {\n resource,\n marker,\n field,\n action,\n matches,\n scanned: query.fetched,\n truncated: false,\n delete: boundary,\n unsafeId,\n cleanup,\n dryRun: undefined,\n };\n\n // ---- find: return (zero mutating wire) ------------------------------------\n if (!isDelete) return base;\n\n // ---- delete dry run: the match set + the boundary, ZERO DELETE wire -------\n if (dryRun) {\n // The dry run performs the search (above) and reports; the unsafe-id\n // refusal applies to the APPLY, but the dry run still surfaces it (the\n // caller must see the unaddressable match before confirming the apply).\n return { ...base, simulated: true, dryRun: true };\n }\n\n // ---- delete apply: one DELETE per safe match id + one verification read --\n if (unsafeId) {\n throw new MarkerUnsafeIdError(\n `recovery: ${unsafeIds.length} of ${matches.length} match(es) on ${resource} have ids beyond Number.MAX_SAFE_INTEGER — they CANNOT be addressed through the SDK's typed delete surface (zero DELETE wire was issued)`,\n {\n operation,\n suggestedAction: cleanup\n ? cleanup.note\n : 'Remove the unaddressable record(s) in the Autotask UI, then re-run the recovery (the safe matches are addressed one by one).',\n details: { resource, unsafeMatches: unsafeIds.length, totalMatches: matches.length },\n },\n );\n }\n\n const deleteMethod = holder.delete;\n if (deleteMethod === undefined) {\n // The plan says the boundary is available (a DELETE exists in the spec)\n // but the client exposes no delete method — a registry/spec mismatch.\n throw new DeleteBoundaryError(\n `recovery: ${resource} has no delete method on the client — the boundary is marked available in the plan but the typed delete surface is missing`,\n {\n operation,\n suggestedAction: 'Report the registry drift (plan says deletable, client exposes no delete) — or clean up via the Autotask UI.',\n details: { resource },\n },\n );\n }\n\n const deleted: Array<{ id: number; verified: boolean; code?: string }> = [];\n for (const match of matches) {\n const id = match.id as number;\n let verify: 'not-found' | 'still-present' | 'error' = 'error';\n let code: string | undefined;\n try {\n if (parentId !== undefined) {\n await (deleteMethod as (p: number, i: number, o?: unknown) => Promise<unknown>).call(holder, parentId, id, { dryRun: false });\n } else {\n await (deleteMethod as (i: number, o?: unknown) => Promise<unknown>).call(holder, id, { dryRun: false });\n }\n try {\n if (parentId !== undefined) {\n await (holder.get as (p: number, i: number) => Promise<unknown>).call(holder, parentId, id);\n verify = 'still-present';\n } else {\n await (holder.get as (i: number) => Promise<unknown>).call(holder, id);\n verify = 'still-present';\n }\n } catch (err) {\n if (err instanceof NotFoundError) verify = 'not-found';\n else {\n verify = 'error';\n code = isAutotaskError(err) ? err.code : 'SERVER_ERROR';\n }\n }\n } catch (err) {\n // Per-item typed partial failure (the SDK house style — fetchMany):\n // a failed DELETE never aborts the remaining ids.\n code = isAutotaskError(err) ? err.code : 'SERVER_ERROR';\n }\n deleted.push({ id, verified: verify === 'not-found', code });\n }\n\n return { ...base, deleted, dryRun: false };\n}\n","/**\n * `operations.invoke` — the registry-driven call path with the WRITE\n * GOVERNOR (ARCHITECTURE section 19.5 R2–R4).\n *\n * The generated registry lists EVERY implemented operation; this module is\n * the deterministic call path for ones that are not a typed convenience of\n * their own. The MCP mode tools (`autotask_read` / `autotask_write` /\n * `autotask_delete`) dispatch through the same router with the mode pinned;\n * `invoke()` itself stays the programmatic escape hatch — its mode is derived\n * from the record, so it can never be cross-mode-refused.\n * It is deliberately MCP-independent — plain SDK code, no MCP import.\n *\n * ```ts\n * import { invoke } from 'node-autotask/operations';\n *\n * await invoke(client, 'companies.get', [3]); // read: one request\n * await invoke(client, 'companies.update', [3, { companyName: 'A' }]); // write: DRY RUN by default\n * await invoke(client, 'companies.update', [3, { companyName: 'A' }], { dryRun: false }); // apply\n * await invoke(client, 'companies.delete', [3], { dryRun: false, confirm: 'companies.delete' }); // destructive\n * ```\n *\n * Governor rules (pinned):\n * - the operation key must EXACTLY match a registry record (unknown keys\n * refuse before any request);\n * - a mode-pinned call (the mode tools) REFUSES a cross-mode op before any\n * request (the mode is the registry `effect`: read → `read`, write →\n * `write`, destructive → `delete`; the refusal message carries the op key\n * + the effect + the correct target tool — zero wire, it throws before\n * holder/method resolution);\n * - a read REFUSES `dryRun: true` (a read has no dry run to run);\n * - a write is DRY-RUN-FIRST: unless the caller passes `dryRun: false`, the\n * call travels with `dryRun: true` and the real mutating request is never\n * issued (the result is the pinned `DryRunResult`, `simulated: true`);\n * - a destructive or approval-gated operation (registry `effect` +\n * `flags`) REFUSES without its confirmation flag: `confirm` must equal the\n * operation key exactly (no booleans, no fuzzy matching) — in BOTH dry-run\n * and apply mode (the deliberate act is the call, not the write);\n * - query operations (`<resource>.query`) are routed to the resource's\n * `queryBounded` (server-side pagination): ONE invoke call returns a\n * bounded, complete-enough result — the vendor cursor walk happens inside\n * the SDK; the caller passes `limit` as the TOTAL cap (default 500, max\n * 2500) and never owns a stream. `queryAll` keeps its raw behavior (the\n * unbounded walk; the catalog text steers the caller away for normal work);\n * - the governor OPTIONS object is closed: an unknown option key (a typo of\n * `dryRun` / `confirm` / `lastModifiedDate`) is refused pre-request (the\n * key is named + the valid keys listed — never the values);\n * - the query-family params bag (`args[0]` for `query` / `queryAll` /\n * `count`) is CLOSED at its top level: the valid key set is per-verb\n * (PARAMS_BAG_KEYS — for `query` routed to `queryBounded`:\n * filter / limit / latest / includeFields / via) and an unknown key\n * (`filters`, `lmit`, `pageSize`, `cursor`, …) is refused pre-request\n * with a typed error naming the key + the valid keys + a did-you-mean\n * (`last` → `latest`, issue #59); entity bodies,\n * UDF maps and the filter tree stay open (strictness applies to tool\n * arguments, not vendor payloads);\n * - the caller's `args` are validated against the record's declared\n * `inputSchema` BEFORE the method is applied (pre-request, zero wire):\n * MORE args than the declared positional list are REFUSED, FEWER than the\n * required count are REFUSED, and scalar-typed args (number/string) are\n * loosely type-checked — each refusal is a shape-teaching message naming\n * the operation, the declared arg list (names + types) and the count\n * passed (never the values — redaction discipline). v0.2.0 behavior\n * change: extra args were SILENTLY DROPPED (the JS call ignores them);\n * v0.3.0 refuses them, so a wrong-arity call can never shadow the\n * governed trailing bag or land in the wrong positional slot. The\n * governed `{ dryRun, lastModifiedDate? }` bag is NOT a declared arg —\n * it travels through the invoke options and is appended by the router.\n *\n * Dispatch calls the SAME typed method the SDK publishes, with the caller's\n * `args` in the method's positional order; for writes the governed\n * `{ dryRun, lastModifiedDate? }` bag is appended as the method's final\n * `MutationOpts` argument. Every guard that path already has (bounded scans,\n * the stale check, the dry-run envelope) is that path's, not a second\n * implementation.\n */\nimport { CAPABILITIES, type CapabilityRecord } from '../capabilities.js';\nimport { AutotaskConfigError, ConfirmationRequiredError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport type { Identifier } from '../types/common.js';\nimport { camelKey, isRecord } from '../utils/index.js';\nimport type { InvokeOptions, ResolveAnyOptions, SearchAcrossResourcesOptions, FetchManyItem } from './types.js';\nimport { resolveAny } from './resolveAny.js';\nimport { searchAcrossResources } from './searchAcrossResources.js';\nimport { fetchMany, type FetchManyOptions } from './fetchMany.js';\nimport { aggregate, type AggregateOptions } from './aggregate.js';\nimport { fetchByIds, type FetchByIdsOptions } from './fetchByIds.js';\nimport { expandResourceNames, type ExpandResourceNamesOptions } from './expandResourceNames.js';\nimport { relationshipMap } from './relationshipMap.js';\nimport { blindSurfaces } from './blindSurfaces.js';\nimport type { BlindSurfaceOptions } from './blindSurfaces.js';\nimport { probeReachability } from './probeReachability.js';\nimport type { ProbeReachabilityOptions } from './probeReachability.js';\nimport { createGuidance } from './createGuidance.js';\nimport type { CreateGuidanceOptions } from './createGuidance.js';\nimport { fieldCatalog } from './fieldCatalog.js';\nimport type { FieldCatalogOptions } from './fieldCatalog.js';\nimport { recovery, type RecoveryInput, type RecoveryOptions } from './recovery.js';\n\nconst RECORDS: readonly CapabilityRecord[] = CAPABILITIES;\nconst byId = new Map<string, CapabilityRecord>(RECORDS.map((r) => [r.id, r]));\n\n/** True for an operation that needs a deliberate act before it runs (R4). */\nexport function needsConfirmation(record: CapabilityRecord): boolean {\n return record.effect === 'destructive' || (record.flags ?? []).includes('requiresApproval');\n}\n\nfunction refuse(message: string, operation: string, suggestedAction?: string): never {\n throw new ConfirmationRequiredError(message, { operation, suggestedAction });\n}\n\n/**\n * The mode the operation's registry `effect` belongs to — the A2 predicate,\n * verified one-to-one over all registry records.\n */\nexport type InvokeMode = 'read' | 'write' | 'delete';\n\nconst MODE_BY_EFFECT: Record<CapabilityRecord['effect'], InvokeMode> = {\n read: 'read',\n write: 'write',\n destructive: 'delete',\n};\n\n/** The MCP tool (and SDK wrapper) that owns each mode. */\nconst MODE_TOOL: Record<InvokeMode, string> = {\n read: 'autotask_read',\n write: 'autotask_write',\n delete: 'autotask_delete',\n};\n\nconst MODE_SDK: Record<InvokeMode, string> = {\n read: 'invokeRead',\n write: 'invokeWrite',\n delete: 'invokeDelete',\n};\n\n/** The effect label each mode's tool routes (the refusal message wording). */\nconst MODE_EFFECT: Record<InvokeMode, string> = {\n read: 'read',\n write: 'write',\n delete: 'destructive',\n};\n\n/**\n * The cross-mode refusal (pre-request, zero wire): the op key + the actual\n * effect + the correct target tool — shape-teaching, consistent with the\n * existing refusal style.\n */\nfunction crossModeRefusal(operation: string, effect: CapabilityRecord['effect'], mode: InvokeMode): string {\n const actual = MODE_BY_EFFECT[effect];\n const subject = effect === 'write' ? 'a write' : effect === 'destructive' ? 'destructive' : 'a read';\n const target =\n actual === 'read'\n ? `Route it through the read mode (${MODE_SDK[actual]} / ${MODE_TOOL[actual]}).`\n : actual === 'write'\n ? `Route it through the write mode (${MODE_SDK[actual]} / ${MODE_TOOL[actual]} — dry-run first).`\n : `Deletes have their own tool (${MODE_TOOL[actual]}) and require confirm: \"${operation}\".`;\n return `invoke: \"${operation}\" is ${subject} (effect=${effect}) — refused on the ${mode} path (${MODE_TOOL[mode]} routes effect=${MODE_EFFECT[mode]} operations only). ${target}`;\n}\n\nfunction isSafeNonNegativeInteger(value: unknown): boolean {\n return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;\n}\n\n/** The audited arg types the loose typeof check understands (the rest pass\n * through to the method's own validation). */\nfunction looseTypeOk(type: string, value: unknown): boolean {\n switch (type) {\n case 'number':\n // Every audited 'number' arg is an integer (picklist / year). Issue #54:\n // a float, negative or unsafe number is refused pre-request; numeric\n // strings pass (parseIdentifier accepts them and v0.2.0 forwarded them).\n return isSafeNonNegativeInteger(value) || (typeof value === 'string' && /^\\d+$/.test(value));\n case 'string':\n return typeof value === 'string';\n case 'string | number':\n // The number branch is always an id (issue #54): safe non-negative integers only.\n return typeof value === 'string' || isSafeNonNegativeInteger(value);\n case 'number[]':\n return Array.isArray(value);\n case 'string[]':\n return Array.isArray(value) && value.every((v) => typeof v === 'string');\n case 'object':\n return isRecord(value);\n default:\n // The descriptors are signature-audited and pinned by the registry\n // tests; an unknown one passes and the method's own validation catches\n // a real mismatch (never a silent forward of an undeclared arg — that\n // is refused above, pre-request).\n return true;\n }\n}\n\n/** The declared arg list rendered for refusal messages (names + types, in\n * declaration order — never values: redaction discipline). */\nfunction declaredArgList(record: CapabilityRecord): string {\n const schema = record.inputSchema ?? {};\n const names = Object.keys(schema);\n if (names.length === 0) return 'no positional args';\n return names.map((n) => `${n}: ${schema[n]!.type}`).join(', ');\n}\n\n/**\n * Validate the caller's positional args against the record's declared\n * `inputSchema` (A-F2). Refusals are pre-request (zero wire) and shape-\n * teaching: they name the operation, the declared arg list (names + types)\n * and the count passed — never the values.\n *\n * Rules (the v0.2.0 → v0.3.0 tightening):\n * - MORE args than the declared positional list → REFUSED (v0.2.0 silently\n * dropped them);\n * - FEWER args than the required count → REFUSED (they would have landed in\n * the wrong positional slot — a bare scalar where an object belongs);\n * - scalar-typed args (number/string/number[]/object) get a loose typeof\n * check on the value actually passed.\n * Query-family ops (`query`/`queryAll`/`count`) validate against the real\n * `queryBounded`/`count` signature: at most ONE optional params object — a\n * bare conditions array is refused here, not after the walk has started.\n */\nexport function validateDispatchArgs(record: CapabilityRecord, argsIn: readonly unknown[] | null | undefined): void {\n const args = argsIn ?? [];\n const operation = record.id;\n const schema = record.inputSchema ?? {};\n const names = Object.keys(schema);\n if (args.length > names.length) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" declares ${names.length} positional arg(s) (${declaredArgList(record)}) but ${args.length} were passed — extra args are refused, not dropped (v0.2.0 silently dropped them)`,\n {\n operation,\n suggestedAction: `Pass exactly the declared args in order (${declaredArgList(record)}); dryRun/confirm/lastModifiedDate travel through the invoke options, never the args.`,\n },\n );\n }\n const required = names.filter((n) => schema[n]!.required);\n if (args.length < required.length) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" requires ${required.length} positional arg(s) (${required\n .map((n) => `${n}: ${schema[n]!.type}`)\n .join(', ')}) but only ${args.length} were passed — declared args: ${declaredArgList(record)}`,\n { operation },\n );\n }\n for (let i = 0; i < args.length; i += 1) {\n const value = args[i]!;\n if (value === undefined) continue;\n const name = names[i]!;\n const spec = schema[name]!; // within bounds: args.length <= names.length (refused above)\n if (!looseTypeOk(spec.type, value)) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" arg ${i + 1} is declared ${name}: ${spec.type} — the value has the wrong type (pass a ${spec.type} value)`,\n { operation },\n );\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Closed input sets (issue #3) — the params bag and the governor options.\n// Strictness applies to TOOL ARGUMENTS, never to vendor payloads: entity\n// bodies for create/update, UDF maps and the filter tree stay open (or\n// schema-driven). The key sets mirror the generated docs\n// (scripts/lib/args-derive.mjs PARAMS_OBJECT_SHAPES — the same closed sets\n// the registry's inputSchema descriptions state) and are driven by the\n// record's `inputSchemaStrict` flag (the plan channel, always true).\n// ---------------------------------------------------------------------------\n\n/** The CLOSED params-bag key set per query-family verb (`args[0]`).\n * `query` routes to `queryBounded`, whose method reads only\n * filter / limit / includeFields / via — `maxRecords` is ignored by it\n * (the vendor page size is derived from `limit`), so it is refused with a\n * suggestion for `limit`; the raw `queryAll` walk keeps the full\n * `QueryParams` set. */\nexport const PARAMS_BAG_KEYS: Readonly<Record<string, readonly string[]>> = {\n query: ['filter', 'limit', 'includeFields', 'via', 'latest', 'noteChars', 'fieldsPreset'],\n queryAll: ['filter', 'maxRecords', 'includeFields', 'maxTotalRecords', 'via'],\n count: ['filter'],\n};\n\n/** Known wrong-key synonyms (the issue's typo classes) — consulted before\n * the Levenshtein fallback, and honoured only when the target is in the\n * verb's valid set (e.g. `cursor` → `limit` on `query`, not on `count`). */\nconst BAG_KEY_SYNONYMS: Readonly<Record<string, string>> = {\n filters: 'filter',\n last: 'latest', // issue #59: the expected typo class (honoured only on `query`)\n lmit: 'limit',\n page: 'limit',\n pageSize: 'limit',\n cursor: 'limit',\n maxrecords: 'maxRecords',\n};\n\n/** Minimal Levenshtein (the SDK stays dependency-free). */\nfunction levenshtein(a: string, b: string): number {\n if (a === b) return 0;\n const prev = new Array<number>(b.length + 1);\n const cur = new Array<number>(b.length + 1);\n for (let j = 0; j <= b.length; j += 1) prev[j] = j;\n for (let i = 1; i <= a.length; i += 1) {\n cur[0] = i;\n for (let j = 1; j <= b.length; j += 1) {\n cur[j] = Math.min((prev[j] ?? 0) + 1, (cur[j - 1] ?? 0) + 1, prev[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n for (let j = 0; j <= b.length; j += 1) prev[j] = cur[j]!;\n }\n return prev[b.length] ?? 0;\n}\n\n/** The did-you-mean for one unknown key (synonym first, then the nearest\n * valid key within edit distance 3; null when no candidate is close). */\nfunction suggestForKey(key: string, valid: readonly string[]): string | null {\n const synonym = BAG_KEY_SYNONYMS[key.toLowerCase()];\n if (synonym !== undefined && valid.includes(synonym)) return synonym;\n let best: { key: string; dist: number } | null = null;\n for (const v of valid) {\n const dist = levenshtein(key.toLowerCase(), v.toLowerCase());\n if (best === null || dist < best.dist) best = { key: v, dist };\n }\n if (best !== null && best.dist <= 3) return best.key;\n return null;\n}\n\n/**\n * Refuse unknown params-bag keys (issue #3). `args[0]` of the query-family\n * verbs (`query` / `queryAll` / `count`) is the params object; its top level\n * is CLOSED per verb (PARAMS_BAG_KEYS). Refusals are pre-request (zero\n * wire) and name the unknown key(s) + the valid keys + a did-you-mean —\n * never the values (redaction discipline). Records with\n * `inputSchemaStrict` not true (the plan channel; always true today) skip\n * the check — the strictness is emitted per record by the generator.\n */\nexport function validateParamsBag(record: CapabilityRecord, args: readonly unknown[] | null | undefined): void {\n if (record.inputSchemaStrict !== true) return;\n const valid = PARAMS_BAG_KEYS[record.operation];\n if (valid === undefined) return; // only the query-family verbs take a params bag\n const bag = args?.[0];\n if (bag === undefined || bag === null || !isRecord(bag)) return; // non-objects refuse in validateDispatchArgs\n const unknown = Object.keys(bag).filter((k) => !valid.includes(k));\n if (unknown.length === 0) return;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, valid)] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n throw new AutotaskConfigError(\n `invoke: \"${record.id}\" params bag has unknown key(s) ${unknown.map((k) => `\"${k}\"`).join(', ')} — the bag is closed (valid keys: ${valid.join(', ')})`,\n {\n operation: record.id,\n suggestedAction: suggestions.length > 0\n ? `Fix the key name (${suggestions.join(', ')}); the full bag contract is in the operation's inputSchema (autotask_describe).`\n : `Pass only the valid keys (${valid.join(', ')}); the full bag contract is in the operation's inputSchema (autotask_describe).`,\n },\n );\n}\n\n/** The CLOSED governor-option key set (public keys; `mode` is the internal\n * mode-tool pin the wrappers pass — it is allowed but never suggested). */\nexport const INVOKE_OPTION_KEYS: readonly string[] = ['dryRun', 'confirm', 'lastModifiedDate', 'mode'];\n\n/**\n * Refuse unknown governor-option keys (issue #3): the `opts` object of\n * `invoke` / the mode wrappers is closed — a typo of `dryRun` / `confirm` /\n * `lastModifiedDate` is refused pre-request (zero wire), naming the key +\n * the valid keys. Refusals use the existing validation error code\n * (CONFIG_ERROR) + `suggestedAction`; values are never echoed.\n */\nexport function validateInvokeOptions(opts: Record<string, unknown> | undefined, operation: string): void {\n if (opts === undefined || opts === null) return;\n const unknown = Object.keys(opts).filter((k) => !INVOKE_OPTION_KEYS.includes(k));\n if (unknown.length === 0) return;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, ['dryRun', 'confirm', 'lastModifiedDate'])] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" has unknown option key(s) ${unknown.map((k) => `\"${k}\"`).join(', ')} — the options set is closed (valid: dryRun, confirm, lastModifiedDate)`,\n {\n operation,\n suggestedAction: suggestions.length > 0\n ? `Fix the option name (${suggestions.join(', ')}).`\n : `Pass only dryRun / confirm / lastModifiedDate.`,\n },\n );\n}\n\n/**\n * The typed refusal for UNKNOWN TOP-LEVEL KEYS (issue #3) — the shared\n * message contract of the closed input sets: the MCP reference servers run\n * it on every tool's top-level argument object (the closed wire surface),\n * and it is the shape the params-bag / governor-option refusals follow.\n * Names the unknown key(s) + the valid keys + a did-you-mean — NEVER a\n * value (redaction discipline). Returns null when every key is known.\n */\nexport function unknownKeysRefusal(\n raw: unknown,\n validKeys: readonly string[],\n subject: string,\n operation?: string,\n): AutotaskConfigError | null {\n if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return null; // non-objects are a shape error — refused by the caller's own check\n const unknown = Object.keys(raw).filter((k) => !validKeys.includes(k));\n if (unknown.length === 0) return null;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, [...validKeys])] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n return new AutotaskConfigError(\n `unknown ${subject} ${unknown.map((k) => `\"${k}\"`).join(', ')} — the ${subject} set is closed (valid keys: ${validKeys.join(', ')})`,\n {\n ...(operation !== undefined ? { operation } : {}),\n suggestedAction: suggestions.length > 0\n ? `Fix the ${subject} name (${suggestions.join(', ')}); the full contract is in the tool's inputSchema (autotask_describe).`\n : `Pass only the valid keys (${validKeys.join(', ')}).`,\n },\n );\n}\n\n/**\n * Invoke one registry operation through its typed SDK method — the shared\n * router behind `invoke` and the three mode-guarded wrappers.\n *\n * @param client The wired `AutotaskClient`.\n * @param operation The registry key, e.g. `companies.update`.\n * @param args The method's positional arguments, in order\n * (e.g. `[id, data]` for `update`, `[parentId, id, data]`\n * for a parent-scoped `update`).\n * @param opts The governor options (`dryRun`, `confirm`, `lastModifiedDate`)\n * + `mode` for the mode tools (pre-request cross-mode check;\n * unset for the legacy `invoke` path).\n */\nexport async function invokeMode(\n client: AutotaskClient,\n operation: string,\n argsIn: readonly unknown[] | null = [],\n opts: InvokeOptions & { mode?: InvokeMode } = {},\n): Promise<unknown> {\n const args = argsIn ?? [];\n const record = byId.get(operation);\n if (record === undefined) {\n throw new AutotaskConfigError(\n `invoke: unknown operation \"${operation}\" — it is not in the capability registry`,\n { operation, suggestedAction: 'List the registry (the ./capabilities subpath) for the exact operation key.' },\n );\n }\n // Closed governor options (issue #3, PRE-REQUEST — zero wire): an unknown\n // option key (a typo of dryRun/confirm/lastModifiedDate) is refused up\n // front, so a flag the caller believed they set is never silently ignored.\n validateInvokeOptions(opts as Record<string, unknown>, operation);\n // Cross-mode check (PRE-REQUEST, before any holder/method resolution —\n // zero wire): fires only when the caller pinned the mode (the mode tools);\n // the legacy path passes no mode and can never be refused here.\n const mode = opts.mode;\n if (mode !== undefined && MODE_BY_EFFECT[record.effect] !== mode) {\n throw new AutotaskConfigError(crossModeRefusal(operation, record.effect, mode), { operation });\n }\n // dryRun is a safety flag: anything but a real boolean is refused up\n // front (zero wire). A truthy string like 'true' must never fall through\n // a strict `=== true` check inside a method and become a live write.\n if (opts.dryRun !== undefined && typeof opts.dryRun !== 'boolean') {\n throw new AutotaskConfigError(\n `invoke: dryRun must be a boolean (got ${typeof opts.dryRun}) — \"${operation}\" was not issued`,\n { operation, suggestedAction: 'Pass dryRun: true (simulate) or dryRun: false (apply) as a real boolean.' },\n );\n }\n const isWrite = record.effect !== 'read';\n if (!isWrite && opts.dryRun === true) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" is a read — dryRun is not applicable (reads issue their request as-is)`,\n { operation },\n );\n }\n if (needsConfirmation(record) && opts.confirm !== operation) {\n refuse(\n `invoke: \"${operation}\" is ${record.effect}${(record.flags ?? []).includes('requiresApproval') ? ' approval-gated' : ''} and requires its confirmation flag: pass confirm: \"${operation}\"`,\n operation,\n 'Pass confirm equal to the operation key to acknowledge the deliberate act.',\n );\n }\n // Dispatch validation (A-F2, v0.3.0): the caller's args are checked\n // against the record's declared inputSchema BEFORE the method is applied\n // (pre-request, zero wire) — extra args are refused, not dropped.\n validateDispatchArgs(record, args);\n // Closed params bag (issue #3): the query-family `args[0]` object's top\n // level is closed per verb (validateParamsBag) — an unknown key is\n // refused pre-request, never silently dropped.\n validateParamsBag(record, args);\n // Query ops route to queryBounded (server-side pagination): one invoke\n // call = one bounded result; the caller never owns the cursor walk.\n const boundedQuery = record.kind === 'primitive' && record.operation === 'query';\n let holder = (client as unknown as Record<string, unknown>)[camelKey(record.resource)];\n if (typeof holder === 'function') {\n // A convenience function shadows the resource holder (client.authenticate()\n // is the token probe; the `authenticate.*` ops live on the holder the\n // client exposes as `<key>Resource`) — route to the holder, not the function.\n holder = (client as unknown as Record<string, unknown>)[`${camelKey(record.resource)}Resource`] ?? holder;\n }\n if (holder === undefined && record.resource === 'operations') {\n // S12-B (run mcp-fix-20261003): the virtual \"operations\" resource — the\n // cross-resource helpers are module functions (src/operations/), not\n // client accessors, so the router materialises the holder: the same\n // typed functions the `./operations` subpath exports, bound to THIS\n // client. This is what makes `invokeRead(client, 'operations.fetchMany',\n // [items])` (and `autotask_read` for the operations-layer ops) dispatch\n // through the governed path; pre-request validation stays the op's own.\n holder = {\n resolveAny: (identifier: unknown, opts?: unknown) => resolveAny(client, identifier as number | string, opts as ResolveAnyOptions | undefined),\n searchAcrossResources: (query: unknown, opts?: unknown) => searchAcrossResources(client, query as string, opts as SearchAcrossResourcesOptions | undefined),\n fetchMany: (items: unknown, opts?: unknown) => fetchMany(client, items as readonly FetchManyItem[], opts as FetchManyOptions | undefined),\n // Issue #62: the generic aggregate + the cheap count — the\n // groupBy/sum-absent mode is ONE vendor /query/count (the S12-C blind\n // sentinel rides through); the group/sum modes walk the named\n // <resource>.query op via the house bounded walk and fold client-side\n // (truncation honesty: hasMore/totalScanned — no silent partial sums).\n aggregate: (operation: unknown, filter: unknown, opts?: unknown) => aggregate(client, operation as string, filter, opts as AggregateOptions | undefined),\n // Issue #59 PR-B: the bulk fetch by ids — query-first chunked `id in`\n // reads + the per-id `get` fallback (blind-surface-safe; per-item\n // typed outcomes reuse the fetchMany shapes).\n fetchByIds: (items: unknown, opts?: unknown) => fetchByIds(client, items as readonly FetchManyItem[], opts as FetchByIdsOptions | undefined),\n // Issue #65: opt-in resource name expansion — per-id resources.get\n // reads ONLY (never an id-in query — the resources table can be blind\n // to count/query while per-id reads work); blind-marked rows for ids\n // the API user cannot resolve; the name cache (default-on).\n expandResourceNames: (ids: unknown, opts?: unknown) => expandResourceNames(client, ids as readonly Identifier[], opts as ExpandResourceNamesOptions | undefined),\n relationshipMap: (resourceKey: unknown) => relationshipMap(client, resourceKey as string),\n // Issue #11: the served blind-surface inventory (zero wire) + the\n // bounded caller-opted reachability sweep (read-only, confirmProbe-\n // required — the op's own pre-request gates keep it deliberate).\n blindSurfaces: (opts?: unknown) => blindSurfaces(client, opts as BlindSurfaceOptions | undefined),\n probeReachability: (opts?: unknown) => probeReachability(client, opts as ProbeReachabilityOptions | undefined),\n // Issue #12: the served zone-fact create-guidance catalog (zero wire).\n createGuidance: (opts?: unknown) => createGuidance(client, opts as CreateGuidanceOptions | undefined),\n // Issue #31: the opt-in live field-metadata channel — N bounded\n // entityInformation GETs (the op's own cap refuses over-cap fan-outs\n // pre-request; per-resource failures are recorded on the row and\n // never abort the call).\n fieldCatalog: (opts?: unknown) => fieldCatalog(client, opts as FieldCatalogOptions | undefined),\n // Issue #9: the one-call recovery/cleanup op — effect write in the\n // registry (the governor's dry-run-first applies to it); the op's own\n // confirm gate makes the destructive action deliberate (the governor\n // forwards the caller's confirm through the trailing bag below).\n recovery: (input: unknown, opts?: unknown) => recovery(client, input as RecoveryInput, opts as RecoveryOptions | undefined),\n };\n }\n if (holder === undefined) {\n throw new AutotaskConfigError(\n `invoke: the client exposes no accessor for resource \"${record.resource}\"`,\n { operation },\n );\n }\n const methodName = boundedQuery ? 'queryBounded' : record.operation;\n const method = (holder as Record<string, unknown>)[methodName];\n if (typeof method !== 'function') {\n throw new AutotaskConfigError(\n `invoke: \"${record.resource}.${methodName}\" is not a callable method on the client`,\n { operation },\n );\n }\n // Writes travel with the governed dry-run flag (and the optional\n // caller-observed lastModifiedDate) as the method's trailing MutationOpts.\n const dryRun = isWrite ? opts.dryRun !== false : false;\n const mutationOpts: Record<string, unknown> = { dryRun };\n if (isWrite && opts.lastModifiedDate !== undefined) {\n mutationOpts.lastModifiedDate = opts.lastModifiedDate;\n }\n // Issue #9: the caller's confirm flag rides the trailing bag too. The\n // governor's own confirm gate covers effect=destructive records; an op\n // that is a write record but carries an action-scoped destructive sub-op\n // (operations.recovery's `action: 'delete'`) enforces ITS confirm\n // (confirm === 'operations.recovery') inside the op — without the ride\n // the governed path could never reach the apply branch. Base methods\n // ignore the extra key (MutationOpts is read, not validated, at runtime).\n if (isWrite && opts.confirm !== undefined) {\n mutationOpts.confirm = opts.confirm;\n }\n // Bag-riding declared args: the governor FOLDS them into the trailing\n // MutationOpts instead of passing them positionally (the method takes them\n // inside its options object, beside dryRun/lastModifiedDate):\n // createIfNotExists.dedupFields (base.ts unified overload) and\n // moveConfigurationItem.destinationCompanyId (D2: the required domain field\n // of MoveConfigurationItemOptions — without the fold the invoke path could\n // never supply it and the method threw CONFIG_ERROR pre-wire). The runtime\n // mirror of scripts/lib/args-derive.mjs BAG_RIDING_ARGS (kept in lockstep;\n // the g11e tripwire + the invoke dispatch tests pin both sides).\n const BAG_RIDING_ARGS: Readonly<Record<string, readonly string[]>> = {\n createIfNotExists: ['dedupFields'],\n moveConfigurationItem: ['destinationCompanyId'],\n };\n const declaredNames = Object.keys(record.inputSchema ?? {});\n const bagRiding = new Set(BAG_RIDING_ARGS[record.operation] ?? []);\n let positional = args;\n for (const argName of BAG_RIDING_ARGS[record.operation] ?? []) {\n const at = declaredNames.indexOf(argName);\n if (at >= 0 && args.length > at) {\n mutationOpts[argName] = args[at];\n positional = positional.slice(0, at);\n }\n }\n const callArgs: unknown[] = [...positional];\n if (isWrite) {\n // The trailing bag must land in the method's LAST parameter (the governed\n // options bag). Omitted intermediate OPTIONAL declared args are padded\n // with undefined — an un-padded bag shadows the omitted slot (the v0.8.0\n // composition ops' `extra` / `fields` / `assign` parameter), the method\n // silently receives `opts = {}`, dryRun is lost and the APPLY path runs\n // under the dry-run flag (FULL100 D1: a contact created on ww29).\n const declaredPositional = declaredNames.filter((n) => !bagRiding.has(n));\n while (callArgs.length < declaredPositional.length) callArgs.push(undefined);\n callArgs.push(mutationOpts);\n }\n const result = await (method as (...call: unknown[]) => unknown).apply(holder, callArgs);\n return Buffer.isBuffer(result) ? bufferResult(result) : result;\n}\n\n/** Largest attachment body `invoke` inlines (base64) into a result. */\nexport const INVOKE_MAX_INLINE_BYTES = 1024 * 1024;\n\n/**\n * A `download` yields a raw Buffer, which JSON-serialises as\n * `{\"type\":\"Buffer\",\"data\":[...]}` (~4x the bytes) — useless to an agent and\n * unbounded. The governed path returns a self-describing, bounded shape: the\n * base64 body up to {@link INVOKE_MAX_INLINE_BYTES}, metadata only above it.\n * Programmatic callers that need the Buffer call `client.<resource>.download`.\n */\nfunction bufferResult(buf: Buffer): Record<string, unknown> {\n if (buf.byteLength <= INVOKE_MAX_INLINE_BYTES) {\n return { encoding: 'base64', byteLength: buf.byteLength, truncated: false, data: buf.toString('base64') };\n }\n return {\n encoding: 'base64',\n byteLength: buf.byteLength,\n truncated: true,\n note: `Body exceeds the ${INVOKE_MAX_INLINE_BYTES}-byte inline limit and was not returned; call the resource's download method directly.`,\n };\n}\n\n/**\n * Invoke one registry operation through its typed SDK method — the legacy\n * path (programmatic escape hatch). The mode is derived from the registry\n * record, so the cross-mode check never fires: the behavior is exactly the\n * pre-split governor (dry-run-first + confirm), bit-for-bit.\n */\nexport async function invoke(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: undefined });\n}\n\n/**\n * `autotask_read` (SDK form): route an `effect=read` operation. A write or\n * destructive op refuses PRE-REQUEST (zero wire); a read with `dryRun: true`\n * refuses (reads have no dry run).\n */\nexport async function invokeRead(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: 'read' });\n}\n\n/**\n * `autotask_write` (SDK form): route an `effect=write` operation, dry-run-\n * first (the governed `dryRun ?? true`). A read or destructive op refuses\n * PRE-REQUEST; the 3 approval-gated writes additionally need\n * `confirm === operation`.\n */\nexport async function invokeWrite(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: 'write' });\n}\n\n/**\n * `autotask_delete` (SDK form): route an `effect=destructive` operation.\n * `confirm === operation` is REQUIRED for every delete (in BOTH dry-run and\n * apply mode); a read or write op refuses PRE-REQUEST.\n */\nexport async function invokeDelete(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return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