node-autotask 0.15.0 → 0.17.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 (38) hide show
  1. package/ARCHITECTURE.md +8 -0
  2. package/N8N_MCP_MANIFEST.json +2 -2
  3. package/N8N_MCP_MANIFEST.md +3 -3
  4. package/README.md +40 -2
  5. package/capabilities.json +4 -4
  6. package/dist/capabilities.cjs +2 -2
  7. package/dist/capabilities.js +1 -1
  8. package/dist/{chunk-Z7YT72SS.cjs → chunk-4RJG73GY.cjs} +164 -81
  9. package/dist/{chunk-EWMG3HHU.cjs → chunk-5ZGXWS4E.cjs} +3 -3
  10. package/dist/{chunk-JIDR3NPV.js → chunk-6SP6GJJR.js} +3 -3
  11. package/dist/{chunk-V7QPZA7L.cjs → chunk-DQIZUZWP.cjs} +135 -135
  12. package/dist/{chunk-AXVYQPTB.js → chunk-EGR2ZLYM.js} +49 -39
  13. package/dist/{chunk-CSA6QSV6.js → chunk-HC6YWPIY.js} +104 -21
  14. package/dist/{chunk-VLIUHEPE.cjs → chunk-NQVD2XLH.cjs} +429 -419
  15. package/dist/{chunk-LH5BXQ7A.js → chunk-UV2PECAL.js} +2 -2
  16. package/dist/{index-M0qJIiRt.d.ts → index-BAFdPxjG.d.ts} +88 -7
  17. package/dist/{index-BXIwhAN4.d.cts → index-CjC0oWZX.d.cts} +88 -7
  18. package/dist/index.cjs +26 -22
  19. package/dist/index.d.cts +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +8 -4
  22. package/dist/operations/index.cjs +103 -103
  23. package/dist/operations/index.d.cts +12 -6
  24. package/dist/operations/index.d.ts +12 -6
  25. package/dist/operations/index.js +2 -2
  26. package/dist/pool.cjs +8 -8
  27. package/dist/pool.d.cts +1 -1
  28. package/dist/pool.d.ts +1 -1
  29. package/dist/pool.js +4 -4
  30. package/dist/resources/index.cjs +4 -4
  31. package/dist/resources/index.d.cts +1 -1
  32. package/dist/resources/index.d.ts +1 -1
  33. package/dist/resources/index.js +3 -3
  34. package/docs/API.md +55 -9
  35. package/examples/basic.ts +2 -2
  36. package/examples/mcp-server-http.ts +5 -4
  37. package/examples/mcp-server.ts +3 -3
  38. package/package.json +1 -1
package/ARCHITECTURE.md CHANGED
@@ -534,6 +534,14 @@ export interface RequestOptions {
534
534
  that premise is unprovable from the response, and the #104 classifier pins this
535
535
  code as `unknown` for a write (never blindly resend). `idempotent: true` /
536
536
  `maxRetries` remain the explicit opt-ins.
537
+ - **Maintenance-window wait (weekly window):** a non-JSON `2xx` that reads as a
538
+ maintenance notice is waited out for up to `maintenanceMaxWaitMs` (default 1 h,
539
+ polled every `maintenancePollMs` = 30 s) from the first such page — for reads
540
+ AND writes, because the edge answered before the vendor application saw the
541
+ request. It does not consume `maxRetries`, each post-wait attempt gets a fresh
542
+ `timeoutMs`, and the timer is re-armed around the wait. On exhaustion the error
543
+ carries `details.maintenance = { waits, waitedMs, maxWaitMs, exhausted }`. A page
544
+ that does not read as maintenance (a wrong `baseUrl`) never enters the loop.
537
545
  - **Per-call budget override:** `InvokeOptions.maxRetries` / `MutationOpts.maxRetries`
538
546
  threads the transport's per-request override through a mutation (and its
539
547
  auxiliary reads, e.g. a partial-update merge read); `0` = exactly one send per
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "node-autotask n8n consumer mcp projection v1",
3
- "generatedAt": "2026-10-17T13:48:43.907Z",
3
+ "generatedAt": "2026-10-18T23:23:18.804Z",
4
4
  "generator": "scripts/project-n8n-mcp.mjs",
5
5
  "inputs": {
6
6
  "capabilities": "capabilities.json (the capability registry — the single source of truth)",
@@ -3667,6 +3667,6 @@
3667
3667
  "approvalGatedWrites": 2,
3668
3668
  "destructiveExcluded": 3
3669
3669
  },
3670
- "capabilitiesHash": "fd92667b96dd9c74d9bbda2a34bf50b9791e2f236a6d2bb50b50a02a1d064882",
3670
+ "capabilitiesHash": "26246eab57263743486ab1afda89379b7b26462c592c5b104e727e337de92886",
3671
3671
  "curationHash": "e19117ce73e38d9aded3be7e7f077a4e185d2e10294622b76c17d67f63cf9e3b"
3672
3672
  }
@@ -1,6 +1,6 @@
1
1
  # N8N MCP Manifest — node-autotask (consumer projection)
2
2
 
3
- <!-- GENERATED by scripts/project-n8n-mcp.mjs at 2026-10-17T13:48:43.907Z — do not hand-edit. -->
3
+ <!-- GENERATED by scripts/project-n8n-mcp.mjs at 2026-10-18T23:23:18.804Z — do not hand-edit. -->
4
4
 
5
5
  The n8n CONSUMER projection of the capability registry: the canonical source for what the
6
6
  n8n-side MCP tools must expose. The SDK is canonical — this is a projection of it, never a
@@ -282,6 +282,6 @@ only via a recorded change to `n8n-mcp.curation.json`.
282
282
 
283
283
  ## Meta
284
284
 
285
- - generatedAt: 2026-10-17T13:48:43.907Z
286
- - capabilitiesHash: fd92667b96dd9c74d9bbda2a34bf50b9791e2f236a6d2bb50b50a02a1d064882
285
+ - generatedAt: 2026-10-18T23:23:18.804Z
286
+ - capabilitiesHash: 26246eab57263743486ab1afda89379b7b26462c592c5b104e727e337de92886
287
287
  - curationHash: e19117ce73e38d9aded3be7e7f077a4e185d2e10294622b76c17d67f63cf9e3b
package/README.md CHANGED
@@ -147,6 +147,42 @@ length and a two-character prefix per value — never a full value. See
147
147
  [`docs/LIVE-TESTING.md`](./docs/LIVE-TESTING.md) §0b.
148
148
 
149
149
 
150
+ ### The full variable set
151
+
152
+ `.env.example` is the committed template; `.env*` is gitignored, so real values never enter git.
153
+
154
+ ```sh
155
+ cp .env.example .env # then fill in the three credentials
156
+ ```
157
+
158
+ Optional settings are **commented out with a sample value** — uncomment a line to set it. For example
159
+ `AUTOTASK_PROFILE=agent` selects the conservative agent profile (page 25, 8,000/hr, 20 s timeout,
160
+ 1 retry, 3 concurrent), and `AUTOTASK_MAX_RETRIES=1` is that profile's retry budget. Leave the five
161
+ server-layer overrides unset rather than blank: an empty value is *invalid* for them by design
162
+ (fail-closed), so a stray `AUTOTASK_MAX_RETRIES=` stops startup with an error naming the variable.
163
+
164
+ | variable | read by | meaning |
165
+ |---|---|---|
166
+ | `AUTOTASK_TRACKING_IDENTIFIER` | `bin/doctor.js`, examples, live scripts | API tracking identifier (aliases: `AUTOTASK_API_CODE`, `AUTOTASK_API_INTEGRATION_CODE`) |
167
+ | `AUTOTASK_USERNAME` | same | API user (alias: `AUTOTASK_USER`) |
168
+ | `AUTOTASK_SECRET` | same | secret — see the single-quote contract above |
169
+ | `AUTOTASK_ZONE` | doctor, examples, live scripts | **catalog name**, not a host (default `old-australian` = webservices6); `other` requires a base URL — the template lists all 23 |
170
+ | `AUTOTASK_BASE_URL` | doctor, examples, live scripts | explicit REST base; **wins** over the zone; include `/atservicesrest` |
171
+ | `AUTOTASK_IMPERSONATION_ID` | doctor, examples | optional `ImpersonationResourceId` header |
172
+ | `AUTOTASK_PROFILE` | reference MCP servers | `library` (default) / `agent` — the agent profile's numbers are compared in the template and in *Agent profile* above |
173
+ | `AUTOTASK_RATE_LIMIT_PER_HOUR` | reference MCP servers | hourly limiter: a positive integer, or `0` / `off` to disable |
174
+ | `AUTOTASK_MAX_CONCURRENT` | reference MCP servers | concurrency guard (vendor max 10) |
175
+ | `AUTOTASK_TIMEOUT_MS` | reference MCP servers | whole-call timeout |
176
+ | `AUTOTASK_MAX_RETRIES` | reference MCP servers | retry budget (`0` disables) |
177
+ | `AUTOTASK_UNTRUSTED_WRAP` | MCP servers | `on` (default) / `off` — the `<untrusted_content>` projection |
178
+ | `AUTOTASK_GATEWAY_MODE` | `examples/mcp-server-http.ts` | `on` for multi-tenant gateway mode (per-request credentials) |
179
+ | `PORT` | `examples/mcp-server-http.ts` | listen port (default 7437) |
180
+ | `AUTOTASK_ENV_FILE` | live scripts | alternate `.env` path (shell variables always win) |
181
+
182
+ The SDK itself never reads `process.env`: pass `apiIntegrationCode` / `userName` / `secret`
183
+ explicitly, or call `loadAutotaskCredentialsFromEnv()`.
184
+
185
+
150
186
  ## Agent profile (conservative limits for LLM-driven servers)
151
187
 
152
188
  `profile: 'agent'` on the config switches the SDK to conservative limits for
@@ -397,8 +433,10 @@ The SDK ships the mechanical substrate, not a server (no MCP imports, no zod):
397
433
  gains two server-category codes: `UNEXPECTED_CONTENT_TYPE` (a non-JSON 2xx
398
434
  whose `Content-Type` is not a JSON media type — the vendor maintenance
399
435
  page; `details` carries the content-type + a 256-byte truncated snippet
400
- that the MCP servers wrap as untrusted host text; a `GET` or an explicitly
401
- `idempotent`-flagged call retries, a write makes ONE call and says the write
436
+ that the MCP servers wrap as untrusted host text; a maintenance notice is waited
437
+ out for up to `maintenanceMaxWaitMs` (default 1 h — the weekly window is usually
438
+ under 30 min) for reads and writes, otherwise a `GET` or an explicitly
439
+ `idempotent`-flagged call retries and a write makes ONE call and says the write
402
440
  may have taken effect) and `EMPTY_RESPONSE` (a blank 2xx on a call that expects a result
403
441
  — `expectBody`, non-DELETE by default; `DELETE` / 204 keep `undefined` and
404
442
  the delete ops synthesize `{ id }` from the path id on a blank answer). A
package/capabilities.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "generatedAt": "2026-10-17T13:48:43.536Z",
2
+ "generatedAt": "2026-10-18T23:23:18.606Z",
3
3
  "groups": {
4
4
  "B": {
5
5
  "planHash": "bd88648453f58ede018062ce66acefacb672fecaa450af89f421057809971e14",
6
- "builtAt": "2026-10-17T13:48:43.535Z",
6
+ "builtAt": "2026-10-18T23:23:18.605Z",
7
7
  "records": [
8
8
  {
9
9
  "id": "appointments.count",
@@ -56168,7 +56168,7 @@
56168
56168
  },
56169
56169
  "A": {
56170
56170
  "planHash": "bd88648453f58ede018062ce66acefacb672fecaa450af89f421057809971e14",
56171
- "builtAt": "2026-10-17T13:48:43.536Z",
56171
+ "builtAt": "2026-10-18T23:23:18.606Z",
56172
56172
  "records": [
56173
56173
  {
56174
56174
  "id": "companies.count",
@@ -112388,7 +112388,7 @@
112388
112388
  },
112389
112389
  "operations": {
112390
112390
  "planHash": "bd88648453f58ede018062ce66acefacb672fecaa450af89f421057809971e14",
112391
- "builtAt": "2026-10-17T13:48:43.536Z",
112391
+ "builtAt": "2026-10-18T23:23:18.606Z",
112392
112392
  "records": [
112393
112393
  {
112394
112394
  "id": "operations.aggregate",
@@ -2,9 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkEWMG3HHUcjs = require('./chunk-EWMG3HHU.cjs');
5
+ var _chunk5ZGXWS4Ecjs = require('./chunk-5ZGXWS4E.cjs');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.CAPABILITIES = _chunkEWMG3HHUcjs.CAPABILITIES; exports.CAPABILITY_GROUPS = _chunkEWMG3HHUcjs.CAPABILITY_GROUPS; exports.CAPABILITY_PLAN_HASHES = _chunkEWMG3HHUcjs.CAPABILITY_PLAN_HASHES;
10
+ exports.CAPABILITIES = _chunk5ZGXWS4Ecjs.CAPABILITIES; exports.CAPABILITY_GROUPS = _chunk5ZGXWS4Ecjs.CAPABILITY_GROUPS; exports.CAPABILITY_PLAN_HASHES = _chunk5ZGXWS4Ecjs.CAPABILITY_PLAN_HASHES;
@@ -2,7 +2,7 @@ import {
2
2
  CAPABILITIES,
3
3
  CAPABILITY_GROUPS,
4
4
  CAPABILITY_PLAN_HASHES
5
- } from "./chunk-JIDR3NPV.js";
5
+ } from "./chunk-6SP6GJJR.js";
6
6
  export {
7
7
  CAPABILITIES,
8
8
  CAPABILITY_GROUPS,