node-autotask 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/MCP_TOOL_CATALOG.json +2 -2
  3. package/MCP_TOOL_MANIFEST.md +7 -7
  4. package/N8N_MCP_MANIFEST.json +2 -2
  5. package/N8N_MCP_MANIFEST.md +3 -3
  6. package/capabilities.json +1460 -1429
  7. package/capabilities.schema.json +2 -1
  8. package/dist/capabilities.cjs +2 -2
  9. package/dist/capabilities.d.cts +4 -4
  10. package/dist/capabilities.d.ts +4 -4
  11. package/dist/capabilities.js +1 -1
  12. package/dist/{chunk-U3K6IDKB.js → chunk-2KQS3RHQ.js} +1459 -1428
  13. package/dist/{chunk-IY5QZZVF.cjs → chunk-45PLS73K.cjs} +213 -135
  14. package/dist/{chunk-7FNKFNIJ.cjs → chunk-6ROB5KXB.cjs} +285 -285
  15. package/dist/{chunk-4QHGCYEI.js → chunk-FV5PJLIZ.js} +94 -16
  16. package/dist/{chunk-DCTUBUIZ.cjs → chunk-KSNK6UEW.cjs} +143 -143
  17. package/dist/{chunk-KPYXO7F5.js → chunk-LD5UPSDB.js} +2 -2
  18. package/dist/{chunk-IY3WCPCK.js → chunk-OKFTECIE.js} +2 -2
  19. package/dist/{chunk-73JMTV4O.cjs → chunk-RAZEXOLC.cjs} +1459 -1428
  20. package/dist/{index-BFbUB5YD.d.cts → index-BVOOHPvr.d.cts} +1 -1
  21. package/dist/{index-Q-4HQEEb.d.ts → index-Bmoiwhx2.d.ts} +1 -1
  22. package/dist/index.cjs +22 -22
  23. package/dist/index.d.cts +2 -2
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +4 -4
  26. package/dist/operations/index.cjs +179 -177
  27. package/dist/operations/index.d.cts +62 -13
  28. package/dist/operations/index.d.ts +62 -13
  29. package/dist/operations/index.js +4 -2
  30. package/dist/pool.cjs +9 -9
  31. package/dist/pool.d.cts +1 -1
  32. package/dist/pool.d.ts +1 -1
  33. package/dist/pool.js +4 -4
  34. package/dist/resources/index.cjs +4 -4
  35. package/dist/resources/index.d.cts +1 -1
  36. package/dist/resources/index.d.ts +1 -1
  37. package/dist/resources/index.js +3 -3
  38. package/docs/API.md +31 -6
  39. package/package.json +1 -1
@@ -126,7 +126,7 @@ import {
126
126
  VersionInformationResource,
127
127
  VersionResource,
128
128
  ZoneInformationResource
129
- } from "../chunk-KPYXO7F5.js";
129
+ } from "../chunk-LD5UPSDB.js";
130
130
  import {
131
131
  BillingCodesResource,
132
132
  BillingItemsResource,
@@ -138,8 +138,8 @@ import {
138
138
  OrganizationalLevelAssociationsResource,
139
139
  ResourcesResource,
140
140
  TimeEntriesResource
141
- } from "../chunk-4QHGCYEI.js";
142
- import "../chunk-U3K6IDKB.js";
141
+ } from "../chunk-FV5PJLIZ.js";
142
+ import "../chunk-2KQS3RHQ.js";
143
143
  import "../chunk-5VHSLJMR.js";
144
144
  export {
145
145
  AppointmentsResource,
package/docs/API.md CHANGED
@@ -2721,15 +2721,19 @@ metadata is (the `autotask_describe` channel, `capabilities.json`,
2721
2721
  `node-autotask/capabilities`). One row shape over a CLOSED kind set:
2722
2722
 
2723
2723
  ```ts
2724
- { kind: 'not-persisted'; fields?: string[]; note: string; remedyOp?: string }
2724
+ { kind: 'not-persisted' | 'field-semantics'; fields?: string[]; note: string; remedyOp?: string }
2725
2725
  ```
2726
2726
 
2727
2727
  - `not-persisted`: the op accepts the listed `fields` but the vendor does not
2728
2728
  store them. `fields` is required for this kind; `remedyOp` names the plan
2729
2729
  operation that does what this one cannot.
2730
+ - `field-semantics` (issue #282): the listed `fields` have meanings a caller
2731
+ must not conflate; `note` states them in a sentence a server can quote.
2732
+ `fields` is required for this kind too.
2730
2733
  - First rows: `time_entries.update` and `ticket_charges.update` declare
2731
2734
  `{ kind: 'not-persisted', fields: ['ticketID'], remedyOp:
2732
- '<resource>.moveToTicket' }`.
2735
+ '<resource>.moveToTicket' }`; `time_entries.query` and `time_entries.get`
2736
+ declare `{ kind: 'field-semantics', fields: ['hoursWorked', 'hoursToBill'] }`.
2733
2737
  - The kind set is closed at build time: `scripts/generate-capabilities.mjs`
2734
2738
  throws on an unknown kind or a malformed row, and gate clause 22 also checks
2735
2739
  that every named field exists on the resource model and every `remedyOp` is
@@ -2910,7 +2914,7 @@ record write says nothing about the field catalog and never invalidates;
2910
2914
  the TTL is the other expiry path.
2911
2915
 
2912
2916
  **The on-demand op:** `operations.fieldCatalog(client, opts?)`
2913
- (`{ resources?, include?, fields?, labels?, fresh? }` — `fields` filters the
2917
+ (`{ resources?, include?, fields?, labels?, fresh?, compact?, maxBytes? }` — `fields` filters the
2914
2918
  fields-kind rows to the named fields and reports `unmatchedFields`; a
2915
2919
  projected row is marked `projected: true` (issue #121 — the four derived
2916
2920
  lists then describe the PROJECTED set only, so a consumer can never read a
@@ -2930,6 +2934,22 @@ the field catalog; the seven integration singletons are refused typed —
2930
2934
  a known key without a catalog → `CONFIG_ERROR`, an unknown key → typed
2931
2935
  `RESOURCE_UNKNOWN` carrying the count + the `autotask_catalog` pointer).
2932
2936
 
2937
+ **Compact rows and the size cap (issue #282).** Measured live from the SDK,
2938
+ a `tickets` result is ~20 KB full, ~137 KB full with `labels: true` and
2939
+ ~11 KB with `compact: true` (`time_entries`: ~9 / ~11 / ~5 KB).
2940
+ `compact: true` serves each field row as `{ name, type, isPickList,
2941
+ isReference, udf }` (picklist values only with `labels: true` AND a `fields`
2942
+ filter; the row name lists stay). `maxBytes` (integer >= 4096) caps the UTF-8
2943
+ JSON size: over it, field rows are dropped from the end (udf rows, then
2944
+ fields rows, last resource first; the name lists only when the field rows
2945
+ alone cannot fit) and the result carries `truncated: true` and
2946
+ `truncation: { reason: 'maxBytes', maxBytes, fullBytes, omitted: [{ resource,
2947
+ kind, count }], note }`, so it is always valid JSON and never over the cap (a
2948
+ result whose envelope alone cannot fit, e.g. many resources under a small cap,
2949
+ is refused with `CONFIG_ERROR`). Both default off (the
2950
+ full rows, no cap); a model-facing server should pass `compact: true` and a
2951
+ `maxBytes`.
2952
+
2933
2953
  **Reference targets (issue #219 N1).** Every projected field row carries
2934
2954
  `targetResource: string | null` and `targetEnumerable: boolean`: the plan
2935
2955
  resource key the vendor `referenceEntityType` names, and whether that
@@ -4096,11 +4116,16 @@ keys of `operations.aggregate`, and the found records of `operations.fetchMany`
4096
4116
  values stay raw (picklists are outside the untrusted class by the registry
4097
4117
  rule). Example: `contractIDName: "<untrusted_content>Managed Services 2026</untrusted_content>"`.
4098
4118
  - `assignedResourceName` is also written (same value as `assignedResourceIDName`):
4099
- a **deprecated alias** kept for one minor release (removed in 0.39.0).
4119
+ a **deprecated alias**, still written in 0.39.0 (null with it, issue #282);
4120
+ its removal is deferred to a later minor.
4100
4121
  - Aggregate: `groups[].key.ticketIDName`, `groups[].key.statusLabel`, … (only the
4101
4122
  returned `top` groups are labelled).
4102
- - An absent, `null` or `0` value gets no sibling. An unknown id (the vendor's
4103
- not-found) gets `null`, never an error.
4123
+ - A labelled field that is present in the row always gets its sibling (issue
4124
+ #282): a `null` or `0` value, an unknown id (the vendor's not-found) or a
4125
+ capped id gets `null`, never a missing key and never an error. Only a field
4126
+ absent from the row gets no sibling. Example: `{ contractID: null,
4127
+ contractIDName: null, assignedResourceID: null, assignedResourceIDName: null,
4128
+ assignedResourceName: null, status: null, statusLabel: null }`.
4104
4129
  - Opt out per call: `names: false` (query bag key, aggregate opts, fetchMany /
4105
4130
  fetchByIds opts). A non-boolean `names` is refused pre-request.
4106
4131
  - Caches: picklists ride the fieldCache, staff names the resource name cache,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-autotask",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "Fully-typed TypeScript SDK for the Autotask (Datto) PSA REST API. Zero runtime dependencies. Built for building MCP servers and integrations.",
5
5
  "type": "module",
6
6
  "sideEffects": false,