node-autotask 0.39.4 → 0.41.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 (44) hide show
  1. package/ARCHITECTURE.md +6 -2
  2. package/CHANGELOG.md +33 -0
  3. package/MCP_TOOL_CATALOG.json +10 -32
  4. package/MCP_TOOL_MANIFEST.md +12 -13
  5. package/N8N_MCP_MANIFEST.json +5 -44
  6. package/N8N_MCP_MANIFEST.md +7 -8
  7. package/README.md +29 -37
  8. package/capabilities.json +1346 -1535
  9. package/dist/base-CVx2VMSj.d.cts +103 -0
  10. package/dist/base-CVx2VMSj.d.ts +103 -0
  11. package/dist/capabilities.cjs +2 -2
  12. package/dist/capabilities.js +1 -1
  13. package/dist/{chunk-SGKGNJEI.cjs → chunk-DKAD7MOV.cjs} +771 -1835
  14. package/dist/{chunk-DJCRQLQE.cjs → chunk-DXEBPK55.cjs} +287 -292
  15. package/dist/{chunk-GHRB46YN.js → chunk-LR6FDJI3.js} +614 -1678
  16. package/dist/{chunk-VR6RYXTD.cjs → chunk-MJ6J74F3.cjs} +1345 -1534
  17. package/dist/{chunk-JBQ55HYG.js → chunk-P5655PGY.js} +2 -2
  18. package/dist/{chunk-DBLXPY4B.js → chunk-TCND5PFF.js} +4 -9
  19. package/dist/{chunk-H4S4KSXX.cjs → chunk-YAHFPOQF.cjs} +143 -143
  20. package/dist/{chunk-GDSCYY2G.js → chunk-ZVSSAULC.js} +1345 -1534
  21. package/dist/{index-DkZVRMeW.d.ts → index-CqO1HNHl.d.cts} +125 -851
  22. package/dist/{index-DkZVRMeW.d.cts → index-CqO1HNHl.d.ts} +125 -851
  23. package/dist/index.cjs +23 -51
  24. package/dist/index.d.cts +103 -102
  25. package/dist/index.d.ts +103 -102
  26. package/dist/index.js +19 -47
  27. package/dist/operations/index.cjs +178 -178
  28. package/dist/operations/index.d.cts +5 -4
  29. package/dist/operations/index.d.ts +5 -4
  30. package/dist/operations/index.js +3 -3
  31. package/dist/pool.cjs +17 -60
  32. package/dist/pool.d.cts +5 -13
  33. package/dist/pool.d.ts +5 -13
  34. package/dist/pool.js +13 -56
  35. package/dist/resources/index.cjs +4 -4
  36. package/dist/resources/index.d.cts +1 -1
  37. package/dist/resources/index.d.ts +1 -1
  38. package/dist/resources/index.js +3 -3
  39. package/dist/types/index.d.cts +1 -1
  40. package/dist/types/index.d.ts +1 -1
  41. package/docs/API.md +138 -340
  42. package/docs/N8N-ADAPTER.md +7 -7
  43. package/examples/mcp-server-http.ts +18 -18
  44. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ /**
2
+ * AutotaskError hierarchy (ARCHITECTURE section 10).
3
+ *
4
+ * Every error carries the structured contract: `code` (stable SCREAMING_SNAKE
5
+ * machine code), `category`, `retryable`, plus `operation`, `httpStatus`,
6
+ * `vendorError` (the vendor payload under a documented key, deep-redacted —
7
+ * the INV-A1 hotfix), `resourceIds` (the LEGACY unlabeled id list — the
8
+ * stamp sites name records of several vendor entities and say nothing about
9
+ * which; every SDK stamp site that sets it also sets `details.idRefs`, the
10
+ * labeled `{ entity, id }` companion — issue #116),
11
+ * `suggestedAction` (deterministic next step only), `correlationId` and `url`.
12
+ *
13
+ * `item: null` on a single GET (HTTP 200) is a NOT FOUND, not a success — the
14
+ * vendor's not-found signal (G1 envelope.md). The vendor documents no error
15
+ * bodies; the shape `{ errors: [{ message, field?, code? }] }` is pinned from
16
+ * the node's errorHandler and parsed defensively here.
17
+ */
18
+ type ErrorCategory = 'auth' | 'not_found' | 'validation' | 'conflict' | 'rate_limit' | 'server' | 'network' | 'timeout' | 'resolution' | 'policy';
19
+ /**
20
+ * A labeled id reference (issue #116). The legacy `resourceIds` field reads
21
+ * as Autotask **Resource** (staff) ids, but the special ops stamp ids of
22
+ * many other entities into it (ticket / company / contact / billing-code /
23
+ * the failed record's own id on a generic `get`), unlabeled — so feeding an
24
+ * error's `resourceIds` to `operations.expandResourceNames` (whose only wire
25
+ * verb is `GET /V1.0/Resources/{id}`) resolves a colliding non-staff id to
26
+ * an unrelated person's name. Every SDK stamp site that sets `resourceIds`
27
+ * now also sets `details.idRefs` — the same ids, each labeled with the vendor entity
28
+ * it identifies — so consumers can resolve against the entity the error
29
+ * actually names instead of parsing the message.
30
+ *
31
+ * `entity` is the vendor entity name (singular snake_case — `company`,
32
+ * `ticket`, `contact`, `billing_code`, `resource`, ...; the de-pluralized
33
+ * vendor table name — the same word the error message uses; the SDK
34
+ * resource key is the same word plural). `resource` (staff) is the ONLY
35
+ * entity `operations.expandResourceNames` resolves — a ref of any other
36
+ * entity must NOT be fed to it.
37
+ */
38
+ interface ErrorIdRef {
39
+ /** The vendor entity the id identifies (singular snake_case, e.g. `company`, `ticket`, `resource` = staff). */
40
+ entity: string;
41
+ /** The value that addresses the record at that entity's endpoint: the
42
+ * vendor id (a safe integer, or the canonical integer-string form) —
43
+ * except `resource_time_off_balances.getByYear`, where the endpoint's
44
+ * path key is the YEAR (the vendor defines no record-id read for this
45
+ * entity). */
46
+ id: number | string;
47
+ }
48
+ interface AutotaskErrorOptions {
49
+ code?: string;
50
+ category?: ErrorCategory;
51
+ operation?: string;
52
+ httpStatus?: number;
53
+ vendorError?: unknown;
54
+ /**
55
+ * The ids the error is about. LEGACY, unlabeled: reads as Resource
56
+ * (staff) ids but the stamp sites name records of several entities
57
+ * (issue #116). Kept for compatibility; the labeled form rides on
58
+ * `details.idRefs` (`ErrorIdRef[]`) and is what consumers should use.
59
+ * The pairing above is a guarantee of the SDK stamp sites — an error you
60
+ * construct yourself may set `resourceIds` without `details.idRefs`.
61
+ */
62
+ resourceIds?: (number | string)[];
63
+ suggestedAction?: string;
64
+ correlationId?: string;
65
+ retryable?: boolean;
66
+ url?: string;
67
+ /**
68
+ * The structured, deterministic extras that ride on the error WITHOUT
69
+ * changing its contract: issue #9 — the recovery refusals' payload
70
+ * (`{ resource, reason/note, ... }` on DELETE_BOUNDARY /
71
+ * MARKER_UNSAFE_ID / RECOVERY_TRUNCATED); issue #14 — `emptyReason`
72
+ * (the typed reason a miss / drift carries — { kind, note, authority,
73
+ * remedy }) and `pointerNote` (the known-unusable-op pointer sentence);
74
+ * issue #116 — `idRefs` (`ErrorIdRef[]`, the labeled `{ entity, id }`
75
+ * companion of the legacy `resourceIds` — every SDK stamp site that sets
76
+ * `resourceIds` also sets it). Additive only — the status, code, message
77
+ * and retryability are never derived from it.
78
+ */
79
+ details?: Record<string, unknown>;
80
+ }
81
+ declare class AutotaskError extends Error {
82
+ code: string;
83
+ category: ErrorCategory;
84
+ operation?: string;
85
+ httpStatus?: number;
86
+ vendorError?: unknown;
87
+ /** Legacy unlabeled id list (issue #116) — see `AutotaskErrorOptions.resourceIds`; the labeled companion rides on `details.idRefs`. */
88
+ resourceIds?: (number | string)[];
89
+ suggestedAction?: string;
90
+ correlationId?: string;
91
+ retryable: boolean;
92
+ url?: string;
93
+ /** Issue #9/#14: the additive structured extras (recovery refusal payload; emptyReason / pointerNote) — never changes the error contract. */
94
+ details?: Record<string, unknown>;
95
+ constructor(message: string, options?: AutotaskErrorOptions);
96
+ }
97
+ declare class AutotaskConfigError extends AutotaskError {
98
+ constructor(message: string, options?: AutotaskErrorOptions);
99
+ }
100
+ /** Type guard for the hierarchy. */
101
+ declare function isAutotaskError(err: unknown): err is AutotaskError;
102
+
103
+ export { AutotaskError as A, type ErrorCategory as E, type AutotaskErrorOptions as a, AutotaskConfigError as b, type ErrorIdRef as c, isAutotaskError as i };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * AutotaskError hierarchy (ARCHITECTURE section 10).
3
+ *
4
+ * Every error carries the structured contract: `code` (stable SCREAMING_SNAKE
5
+ * machine code), `category`, `retryable`, plus `operation`, `httpStatus`,
6
+ * `vendorError` (the vendor payload under a documented key, deep-redacted —
7
+ * the INV-A1 hotfix), `resourceIds` (the LEGACY unlabeled id list — the
8
+ * stamp sites name records of several vendor entities and say nothing about
9
+ * which; every SDK stamp site that sets it also sets `details.idRefs`, the
10
+ * labeled `{ entity, id }` companion — issue #116),
11
+ * `suggestedAction` (deterministic next step only), `correlationId` and `url`.
12
+ *
13
+ * `item: null` on a single GET (HTTP 200) is a NOT FOUND, not a success — the
14
+ * vendor's not-found signal (G1 envelope.md). The vendor documents no error
15
+ * bodies; the shape `{ errors: [{ message, field?, code? }] }` is pinned from
16
+ * the node's errorHandler and parsed defensively here.
17
+ */
18
+ type ErrorCategory = 'auth' | 'not_found' | 'validation' | 'conflict' | 'rate_limit' | 'server' | 'network' | 'timeout' | 'resolution' | 'policy';
19
+ /**
20
+ * A labeled id reference (issue #116). The legacy `resourceIds` field reads
21
+ * as Autotask **Resource** (staff) ids, but the special ops stamp ids of
22
+ * many other entities into it (ticket / company / contact / billing-code /
23
+ * the failed record's own id on a generic `get`), unlabeled — so feeding an
24
+ * error's `resourceIds` to `operations.expandResourceNames` (whose only wire
25
+ * verb is `GET /V1.0/Resources/{id}`) resolves a colliding non-staff id to
26
+ * an unrelated person's name. Every SDK stamp site that sets `resourceIds`
27
+ * now also sets `details.idRefs` — the same ids, each labeled with the vendor entity
28
+ * it identifies — so consumers can resolve against the entity the error
29
+ * actually names instead of parsing the message.
30
+ *
31
+ * `entity` is the vendor entity name (singular snake_case — `company`,
32
+ * `ticket`, `contact`, `billing_code`, `resource`, ...; the de-pluralized
33
+ * vendor table name — the same word the error message uses; the SDK
34
+ * resource key is the same word plural). `resource` (staff) is the ONLY
35
+ * entity `operations.expandResourceNames` resolves — a ref of any other
36
+ * entity must NOT be fed to it.
37
+ */
38
+ interface ErrorIdRef {
39
+ /** The vendor entity the id identifies (singular snake_case, e.g. `company`, `ticket`, `resource` = staff). */
40
+ entity: string;
41
+ /** The value that addresses the record at that entity's endpoint: the
42
+ * vendor id (a safe integer, or the canonical integer-string form) —
43
+ * except `resource_time_off_balances.getByYear`, where the endpoint's
44
+ * path key is the YEAR (the vendor defines no record-id read for this
45
+ * entity). */
46
+ id: number | string;
47
+ }
48
+ interface AutotaskErrorOptions {
49
+ code?: string;
50
+ category?: ErrorCategory;
51
+ operation?: string;
52
+ httpStatus?: number;
53
+ vendorError?: unknown;
54
+ /**
55
+ * The ids the error is about. LEGACY, unlabeled: reads as Resource
56
+ * (staff) ids but the stamp sites name records of several entities
57
+ * (issue #116). Kept for compatibility; the labeled form rides on
58
+ * `details.idRefs` (`ErrorIdRef[]`) and is what consumers should use.
59
+ * The pairing above is a guarantee of the SDK stamp sites — an error you
60
+ * construct yourself may set `resourceIds` without `details.idRefs`.
61
+ */
62
+ resourceIds?: (number | string)[];
63
+ suggestedAction?: string;
64
+ correlationId?: string;
65
+ retryable?: boolean;
66
+ url?: string;
67
+ /**
68
+ * The structured, deterministic extras that ride on the error WITHOUT
69
+ * changing its contract: issue #9 — the recovery refusals' payload
70
+ * (`{ resource, reason/note, ... }` on DELETE_BOUNDARY /
71
+ * MARKER_UNSAFE_ID / RECOVERY_TRUNCATED); issue #14 — `emptyReason`
72
+ * (the typed reason a miss / drift carries — { kind, note, authority,
73
+ * remedy }) and `pointerNote` (the known-unusable-op pointer sentence);
74
+ * issue #116 — `idRefs` (`ErrorIdRef[]`, the labeled `{ entity, id }`
75
+ * companion of the legacy `resourceIds` — every SDK stamp site that sets
76
+ * `resourceIds` also sets it). Additive only — the status, code, message
77
+ * and retryability are never derived from it.
78
+ */
79
+ details?: Record<string, unknown>;
80
+ }
81
+ declare class AutotaskError extends Error {
82
+ code: string;
83
+ category: ErrorCategory;
84
+ operation?: string;
85
+ httpStatus?: number;
86
+ vendorError?: unknown;
87
+ /** Legacy unlabeled id list (issue #116) — see `AutotaskErrorOptions.resourceIds`; the labeled companion rides on `details.idRefs`. */
88
+ resourceIds?: (number | string)[];
89
+ suggestedAction?: string;
90
+ correlationId?: string;
91
+ retryable: boolean;
92
+ url?: string;
93
+ /** Issue #9/#14: the additive structured extras (recovery refusal payload; emptyReason / pointerNote) — never changes the error contract. */
94
+ details?: Record<string, unknown>;
95
+ constructor(message: string, options?: AutotaskErrorOptions);
96
+ }
97
+ declare class AutotaskConfigError extends AutotaskError {
98
+ constructor(message: string, options?: AutotaskErrorOptions);
99
+ }
100
+ /** Type guard for the hierarchy. */
101
+ declare function isAutotaskError(err: unknown): err is AutotaskError;
102
+
103
+ export { AutotaskError as A, type ErrorCategory as E, type AutotaskErrorOptions as a, AutotaskConfigError as b, type ErrorIdRef as c, isAutotaskError as i };
@@ -2,9 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkVR6RYXTDcjs = require('./chunk-VR6RYXTD.cjs');
5
+ var _chunkMJ6J74F3cjs = require('./chunk-MJ6J74F3.cjs');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.CAPABILITIES = _chunkVR6RYXTDcjs.CAPABILITIES; exports.CAPABILITY_GROUPS = _chunkVR6RYXTDcjs.CAPABILITY_GROUPS; exports.CAPABILITY_PLAN_HASHES = _chunkVR6RYXTDcjs.CAPABILITY_PLAN_HASHES;
10
+ exports.CAPABILITIES = _chunkMJ6J74F3cjs.CAPABILITIES; exports.CAPABILITY_GROUPS = _chunkMJ6J74F3cjs.CAPABILITY_GROUPS; exports.CAPABILITY_PLAN_HASHES = _chunkMJ6J74F3cjs.CAPABILITY_PLAN_HASHES;
@@ -2,7 +2,7 @@ import {
2
2
  CAPABILITIES,
3
3
  CAPABILITY_GROUPS,
4
4
  CAPABILITY_PLAN_HASHES
5
- } from "./chunk-GDSCYY2G.js";
5
+ } from "./chunk-ZVSSAULC.js";
6
6
  export {
7
7
  CAPABILITIES,
8
8
  CAPABILITY_GROUPS,