node-autotask 0.8.0 → 0.8.1

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 (62) hide show
  1. package/ARCHITECTURE.md +54 -12
  2. package/N8N_MCP_MANIFEST.json +2 -2
  3. package/N8N_MCP_MANIFEST.md +3 -3
  4. package/README.md +9 -3
  5. package/dist/{chunk-C7U3ZRRK.js → chunk-2QLOK7PX.js} +27 -31
  6. package/dist/{chunk-C7U3ZRRK.js.map → chunk-2QLOK7PX.js.map} +1 -1
  7. package/dist/{chunk-LDKIIVFV.cjs → chunk-CQIZDSBE.cjs} +272 -276
  8. package/dist/chunk-CQIZDSBE.cjs.map +1 -0
  9. package/dist/{chunk-QUFEIJEB.cjs → chunk-DA73ALND.cjs} +136 -138
  10. package/dist/chunk-DA73ALND.cjs.map +1 -0
  11. package/dist/{chunk-GNS47RBV.js → chunk-IUJJPWUX.js} +612 -18
  12. package/dist/chunk-IUJJPWUX.js.map +1 -0
  13. package/dist/{chunk-RFXGG37L.cjs → chunk-IV2Z3JLR.cjs} +680 -86
  14. package/dist/chunk-IV2Z3JLR.cjs.map +1 -0
  15. package/dist/{chunk-ONPT4PIV.js → chunk-PAQXQFGG.js} +4 -6
  16. package/dist/{chunk-ONPT4PIV.js.map → chunk-PAQXQFGG.js.map} +1 -1
  17. package/dist/index.cjs +120 -27
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +129 -3
  20. package/dist/index.d.ts +129 -3
  21. package/dist/index.js +156 -63
  22. package/dist/index.js.map +1 -1
  23. package/dist/operations/index.cjs +113 -116
  24. package/dist/operations/index.cjs.map +1 -1
  25. package/dist/operations/index.js +9 -12
  26. package/dist/operations/index.js.map +1 -1
  27. package/dist/pool.cjs +8 -11
  28. package/dist/pool.cjs.map +1 -1
  29. package/dist/pool.js +4 -7
  30. package/dist/pool.js.map +1 -1
  31. package/dist/resources/index.cjs +3 -5
  32. package/dist/resources/index.cjs.map +1 -1
  33. package/dist/resources/index.js +2 -4
  34. package/package.json +9 -3
  35. package/dist/chunk-5QVXRT3A.cjs +0 -580
  36. package/dist/chunk-5QVXRT3A.cjs.map +0 -1
  37. package/dist/chunk-FE225M76.js +0 -580
  38. package/dist/chunk-FE225M76.js.map +0 -1
  39. package/dist/chunk-GNS47RBV.js.map +0 -1
  40. package/dist/chunk-IFXFOYDU.cjs +0 -32
  41. package/dist/chunk-IFXFOYDU.cjs.map +0 -1
  42. package/dist/chunk-LDKIIVFV.cjs.map +0 -1
  43. package/dist/chunk-OOEVTGP4.js +0 -121
  44. package/dist/chunk-OOEVTGP4.js.map +0 -1
  45. package/dist/chunk-PBBFMRI5.cjs +0 -121
  46. package/dist/chunk-PBBFMRI5.cjs.map +0 -1
  47. package/dist/chunk-QF4K3XTK.js +0 -32
  48. package/dist/chunk-QF4K3XTK.js.map +0 -1
  49. package/dist/chunk-QUFEIJEB.cjs.map +0 -1
  50. package/dist/chunk-RFXGG37L.cjs.map +0 -1
  51. package/dist/credential-shape.cjs +0 -15
  52. package/dist/credential-shape.cjs.map +0 -1
  53. package/dist/credential-shape.d.cts +0 -52
  54. package/dist/credential-shape.d.ts +0 -52
  55. package/dist/credential-shape.js +0 -15
  56. package/dist/credential-shape.js.map +0 -1
  57. package/dist/credentials.cjs +0 -17
  58. package/dist/credentials.cjs.map +0 -1
  59. package/dist/credentials.d.cts +0 -78
  60. package/dist/credentials.d.ts +0 -78
  61. package/dist/credentials.js +0 -17
  62. package/dist/credentials.js.map +0 -1
@@ -1,14 +1,560 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4;
2
-
3
-
4
-
5
-
6
-
7
- var _chunk5QVXRT3Acjs = require('./chunk-5QVXRT3A.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4;// src/logger.ts
2
+ var NoopLogger = {};
3
+ var REDACTED = "[REDACTED]";
4
+ var CREDENTIAL_HEADER_NAMES = [
5
+ "ApiIntegrationCode",
6
+ "UserName",
7
+ "Secret",
8
+ "ImpersonationResourceId",
9
+ "authToken"
10
+ ];
11
+ function normalizeKey(key) {
12
+ return key.toLowerCase().replace(/[_-]/g, "");
13
+ }
14
+ var CREDENTIAL_KEY_SET = new Set(CREDENTIAL_HEADER_NAMES.map(normalizeKey));
15
+ function isCredentialHeaderName(name, extraSecretKeys) {
16
+ const normalized = normalizeKey(name);
17
+ if (CREDENTIAL_KEY_SET.has(normalized)) return true;
18
+ if (extraSecretKeys === void 0) return false;
19
+ return extraSecretKeys.some((extra) => normalizeKey(extra) === normalized);
20
+ }
21
+ function isPlainRecord(value) {
22
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
23
+ const proto = Object.getPrototypeOf(value);
24
+ return proto === Object.prototype || proto === null;
25
+ }
26
+ function redactRecord(value, extraSecretKeys) {
27
+ if (Array.isArray(value)) {
28
+ return value.map((item) => redactRecord(item, extraSecretKeys));
29
+ }
30
+ if (isPlainRecord(value)) {
31
+ const out = {};
32
+ for (const [key, item] of Object.entries(value)) {
33
+ out[key] = isCredentialHeaderName(key, extraSecretKeys) ? REDACTED : redactRecord(item, extraSecretKeys);
34
+ }
35
+ return out;
36
+ }
37
+ return value;
38
+ }
8
39
 
40
+ // src/redact.ts
41
+ var SECRET_RESPONSE_FIELDS = [
42
+ "password",
43
+ // ClientPortalUserModel
44
+ "secretKey",
45
+ // the 5 webhook models
46
+ "secret"
47
+ // IntegrationVendorInsightModel, IntegrationVendorWidgetModel
48
+ ];
49
+ var PERSONAL_RESPONSE_FIELDS = [
50
+ "additionalAddressInformation",
51
+ "additionalBillToAddressInformation",
52
+ "additionalShipToAddressInformation",
53
+ "address1",
54
+ "address2",
55
+ "addressLine",
56
+ "addressLine1",
57
+ "alternatePhone",
58
+ "alternatePhone1",
59
+ "alternatePhone2",
60
+ "billingAddress1",
61
+ "billingAddress2",
62
+ "billToAdditionalAddressInformation",
63
+ "billToCity",
64
+ "billToPostalCode",
65
+ "billToZipCode",
66
+ "city",
67
+ "email",
68
+ "email2",
69
+ "email3",
70
+ "emailAddress",
71
+ "emailAddress2",
72
+ "emailAddress3",
73
+ "extApprovalContactResponse",
74
+ "fax",
75
+ "faxNumber",
76
+ "gender",
77
+ "homePhone",
78
+ "mobilePhone",
79
+ "notificationEmailAddress",
80
+ "officePhone",
81
+ "phone",
82
+ "postalCode",
83
+ "recipientEmailAddress",
84
+ "rmmIsMobileDeviceManagementEnrolled",
85
+ "shipToAddress1",
86
+ "shipToAddress2",
87
+ "shipToCity",
88
+ "shipToPostalCode",
89
+ "userName",
90
+ "zipCode"
91
+ ];
92
+ var CONFIDENTIAL_RESPONSE_FIELDS = [
93
+ "domain",
94
+ "domainExpirationDateTime",
95
+ "domainLastUpdatedDateTime",
96
+ "domainRegistrationDateTime",
97
+ "primaryContact",
98
+ "rmmDeviceAuditExternalIPAddress",
99
+ "rmmDeviceAuditIPAddress",
100
+ "rmmDeviceAuditMacAddress",
101
+ "rmmDeviceAuditMobileNumber",
102
+ "rmmDeviceAuditSNMPContact",
103
+ "taxID",
104
+ "webAddress"
105
+ ];
106
+ var SECRET_SET = new Set(SECRET_RESPONSE_FIELDS);
107
+ var OPTIONAL_SET = /* @__PURE__ */ new Set([...PERSONAL_RESPONSE_FIELDS, ...CONFIDENTIAL_RESPONSE_FIELDS]);
108
+ function isPlainRecord2(value) {
109
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
110
+ const proto = Object.getPrototypeOf(value);
111
+ return proto === Object.prototype || proto === null;
112
+ }
113
+ function isRedactedFieldName(name, policy) {
114
+ return SECRET_SET.has(name) || policy.redactPersonalData && OPTIONAL_SET.has(name);
115
+ }
116
+ function redactResponseBody(value, policy) {
117
+ const personal = policy.redactPersonalData;
118
+ if (Array.isArray(value)) {
119
+ return value.map((entry) => redactResponseBody(entry, policy));
120
+ }
121
+ if (!isPlainRecord2(value)) return value;
122
+ const out = {};
123
+ for (const [key, entry] of Object.entries(value)) {
124
+ const pinned = SECRET_SET.has(key) || personal && OPTIONAL_SET.has(key);
125
+ out[key] = pinned ? REDACTED : redactResponseBody(entry, policy);
126
+ }
127
+ return out;
128
+ }
9
129
 
130
+ // src/errors.ts
131
+ function isRecord(value) {
132
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
133
+ const proto = Object.getPrototypeOf(value);
134
+ return proto === Object.prototype || proto === null;
135
+ }
136
+ var AutotaskError = class extends Error {
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ /** Issue #9/#14: the additive structured extras (recovery refusal payload; emptyReason / pointerNote) — never changes the error contract. */
148
+
149
+ constructor(message, options = {}) {
150
+ super(message);
151
+ this.name = "AutotaskError";
152
+ this.code = _nullishCoalesce(options.code, () => ( "AUTOTASK_ERROR"));
153
+ this.category = _nullishCoalesce(options.category, () => ( "server"));
154
+ this.retryable = _nullishCoalesce(options.retryable, () => ( false));
155
+ this.operation = options.operation;
156
+ this.httpStatus = options.httpStatus;
157
+ this.vendorError = options.vendorError;
158
+ this.resourceIds = options.resourceIds;
159
+ this.suggestedAction = options.suggestedAction;
160
+ this.correlationId = options.correlationId;
161
+ this.url = options.url;
162
+ this.details = options.details;
163
+ _optionalChain([Error, 'access', _ => _.captureStackTrace, 'optionalCall', _2 => _2(this, this.constructor)]);
164
+ }
165
+ };
166
+ var AutotaskConfigError = class extends AutotaskError {
167
+ constructor(message, options = {}) {
168
+ super(message, { code: "CONFIG_ERROR", category: "validation", ...options });
169
+ this.name = "AutotaskConfigError";
170
+ }
171
+ };
172
+ var AutotaskNetworkError = class extends AutotaskError {
173
+ constructor(message, options = {}) {
174
+ super(message, {
175
+ code: "NETWORK_ERROR",
176
+ category: "network",
177
+ retryable: true,
178
+ suggestedAction: _nullishCoalesce(options.suggestedAction, () => ( "Check connectivity to the Autotask zone and retry.")),
179
+ ...options
180
+ });
181
+ this.name = "AutotaskNetworkError";
182
+ }
183
+ };
184
+ var AutotaskTimeoutError = class extends AutotaskError {
185
+ constructor(message, options = {}) {
186
+ super(message, {
187
+ code: "TIMEOUT",
188
+ category: "timeout",
189
+ retryable: true,
190
+ suggestedAction: _nullishCoalesce(options.suggestedAction, () => ( "Retry, narrow the query, or raise timeoutMs.")),
191
+ ...options
192
+ });
193
+ this.name = "AutotaskTimeoutError";
194
+ }
195
+ };
196
+ var AutotaskAbortError = class extends AutotaskError {
197
+ constructor(message, options = {}) {
198
+ super(message, { code: "ABORTED", category: "network", retryable: false, ...options });
199
+ this.name = "AutotaskAbortError";
200
+ }
201
+ };
202
+ var ResponseRejectedError = class extends AutotaskError {
203
+ constructor(message, options = {}) {
204
+ super(message, { code: "RESPONSE_REJECTED", category: "policy", retryable: false, ...options });
205
+ this.name = "ResponseRejectedError";
206
+ }
207
+ };
208
+ var BadRequestError = class extends AutotaskError {
209
+ constructor(message, options = {}) {
210
+ super(message, { code: "BAD_REQUEST", category: "validation", ...options });
211
+ this.name = "BadRequestError";
212
+ }
213
+ };
214
+ var UnauthorizedError = class extends AutotaskError {
215
+ constructor(message, options = {}) {
216
+ super(message, { code: "UNAUTHORIZED", category: "auth", ...options });
217
+ this.name = "UnauthorizedError";
218
+ }
219
+ };
220
+ var ForbiddenError = class extends AutotaskError {
221
+ constructor(message, options = {}) {
222
+ super(message, { code: "FORBIDDEN", category: "auth", ...options });
223
+ this.name = "ForbiddenError";
224
+ }
225
+ };
226
+ var NotFoundError = class extends AutotaskError {
227
+ constructor(message, options = {}) {
228
+ super(message, { code: "NOT_FOUND", category: "not_found", ...options });
229
+ this.name = "NotFoundError";
230
+ }
231
+ };
232
+ var ConflictError = class extends AutotaskError {
233
+ constructor(message, options = {}) {
234
+ super(message, { code: "CONFLICT", category: "conflict", ...options });
235
+ this.name = "ConflictError";
236
+ }
237
+ };
238
+ var UnprocessableEntityError = class extends AutotaskError {
239
+ constructor(message, options = {}) {
240
+ super(message, { code: "VALIDATION_FAILED", category: "validation", ...options });
241
+ this.name = "UnprocessableEntityError";
242
+ }
243
+ };
244
+ var RateLimitError = class extends AutotaskError {
245
+ /** Seconds the server asked the client to wait (`Retry-After`), when present. */
246
+
247
+ /** True when the call was refused locally (the tenant cooldown gate) and never sent. */
248
+
249
+ constructor(message, options = {}) {
250
+ super(message, { code: "RATE_LIMITED", category: "rate_limit", retryable: true, ...options });
251
+ this.name = "RateLimitError";
252
+ }
253
+ };
254
+ var ServerError = class extends AutotaskError {
255
+ constructor(message, options = {}) {
256
+ super(message, { code: "SERVER_ERROR", category: "server", retryable: true, ...options });
257
+ this.name = "ServerError";
258
+ }
259
+ };
260
+ var UnexpectedContentTypeError = class extends AutotaskError {
261
+ constructor(message, options = {}) {
262
+ super(message, { code: "UNEXPECTED_CONTENT_TYPE", category: "server", retryable: true, ...options });
263
+ this.name = "UnexpectedContentTypeError";
264
+ }
265
+ };
266
+ var EmptyResponseError = class extends AutotaskError {
267
+ constructor(message, options = {}) {
268
+ super(message, { code: "EMPTY_RESPONSE", category: "server", ...options });
269
+ this.name = "EmptyResponseError";
270
+ }
271
+ };
272
+ var CircuitBreakerError = class extends AutotaskError {
273
+ /** Seconds remaining in the open period (absent when the half-open probe budget is in flight). */
274
+
275
+ /** True when the call was refused locally (the circuit is open) and never sent. */
276
+
277
+ constructor(message, options = {}) {
278
+ super(message, { code: "CIRCUIT_BREAKER_OPEN", category: "policy", retryable: true, ...options });
279
+ this.name = "CircuitBreakerError";
280
+ }
281
+ };
282
+ var HostPolicyDeniedError = class extends AutotaskError {
283
+ constructor(message, options = {}) {
284
+ super(message, { code: "HOST_POLICY_DENIED", category: "policy", retryable: false, ...options });
285
+ this.name = "HostPolicyDeniedError";
286
+ }
287
+ };
288
+ var ResolutionError = class extends AutotaskError {
289
+ constructor(message, options = {}) {
290
+ super(message, {
291
+ code: options.code === void 0 ? "RESOLUTION_AMBIGUOUS" : options.code,
292
+ category: "resolution",
293
+ ...options
294
+ });
295
+ this.name = "ResolutionError";
296
+ }
297
+ };
298
+ var PaginationLimitError = class extends AutotaskError {
299
+ constructor(message, options = {}) {
300
+ super(message, {
301
+ code: "PAGINATION_LIMIT",
302
+ category: "policy",
303
+ suggestedAction: _nullishCoalesce(options.suggestedAction, () => ( "Narrow the query with a tighter filter so the walk stays under the 1000-page limit.")),
304
+ ...options
305
+ });
306
+ this.name = "PaginationLimitError";
307
+ }
308
+ };
309
+ var QueryTooLongError = class extends AutotaskError {
310
+ constructor(message, options = {}) {
311
+ super(message, {
312
+ code: "QUERY_TOO_LONG",
313
+ category: "policy",
314
+ suggestedAction: _nullishCoalesce(options.suggestedAction, () => ( 'Use the default POST query path (omit via: "get") for filters above the 2048-char GET cap.')),
315
+ ...options
316
+ });
317
+ this.name = "QueryTooLongError";
318
+ }
319
+ };
320
+ var MISSING_REQUIRED_FIELD = /^Missing Required Field:\s*([A-Za-z_][A-Za-z0-9_]*)/;
321
+ function parseVendorErrors(body) {
322
+ if (!isRecord(body) || !Array.isArray(body.errors)) return void 0;
323
+ const out = [];
324
+ for (const entry of body.errors) {
325
+ if (typeof entry === "string") {
326
+ const item2 = { message: entry };
327
+ const m = MISSING_REQUIRED_FIELD.exec(entry);
328
+ if (m) item2.field = m[1];
329
+ out.push(item2);
330
+ continue;
331
+ }
332
+ if (!isRecord(entry)) continue;
333
+ const item = {};
334
+ if (typeof entry.message === "string") item.message = entry.message;
335
+ if (typeof entry.field === "string") item.field = entry.field;
336
+ if (typeof entry.code === "string") item.code = entry.code;
337
+ if (item.message !== void 0 || item.field !== void 0 || item.code !== void 0) {
338
+ out.push(item);
339
+ }
340
+ }
341
+ return out;
342
+ }
343
+ var DETERMINISTIC_VENDOR_500_PHRASES = [/exceeds maximum length/i];
344
+ function isDeterministicVendor500(entries) {
345
+ if (entries === void 0) return false;
346
+ return entries.some(
347
+ (entry) => entry.message !== void 0 && DETERMINISTIC_VENDOR_500_PHRASES.some((phrase) => phrase.test(entry.message))
348
+ );
349
+ }
350
+ function formatVendorEntry(entry) {
351
+ const parts = [];
352
+ if (entry.code) parts.push(`[${entry.code}]`);
353
+ if (entry.field) parts.push(`Field '${entry.field}':`);
354
+ if (entry.message) parts.push(entry.message);
355
+ return parts.join(" ");
356
+ }
357
+ function formatVendorDetail(body) {
358
+ const entries = parseVendorErrors(body);
359
+ if (entries && entries.length > 0) {
360
+ const formatted = entries.map(formatVendorEntry).filter((line) => line.length > 0);
361
+ if (formatted.length > 0) return formatted.join(" | ");
362
+ }
363
+ if (isRecord(body) && typeof body.message === "string" && body.message.trim().length > 0) {
364
+ return body.message.trim();
365
+ }
366
+ return void 0;
367
+ }
368
+ function isMachineCode(code) {
369
+ return /^[A-Za-z0-9][A-Za-z0-9_-]{2,}$/.test(code) && /\d/.test(code);
370
+ }
371
+ function errorClassForStatus(status) {
372
+ switch (status) {
373
+ case 400:
374
+ return BadRequestError;
375
+ case 401:
376
+ return UnauthorizedError;
377
+ case 403:
378
+ return ForbiddenError;
379
+ case 404:
380
+ return NotFoundError;
381
+ case 409:
382
+ case 412:
383
+ return ConflictError;
384
+ case 422:
385
+ return UnprocessableEntityError;
386
+ case 429:
387
+ return RateLimitError;
388
+ default:
389
+ return status >= 500 && status < 600 ? ServerError : null;
390
+ }
391
+ }
392
+ function statusDefaultMessage(status) {
393
+ switch (status) {
394
+ case 401:
395
+ return "Authentication failed: Invalid credentials";
396
+ case 404:
397
+ return "Resource not found";
398
+ default:
399
+ return `Autotask API request failed with status ${status}`;
400
+ }
401
+ }
402
+ var VENDOR_BODY_SUFFIX_LIMIT = 200;
403
+ function vendorBodySuffix(body) {
404
+ const rendered = typeof body === "string" ? body : JSON.stringify(body);
405
+ if (rendered === void 0 || rendered === "null" || rendered === "{}" || rendered === "[]") return void 0;
406
+ return rendered.length > VENDOR_BODY_SUFFIX_LIMIT ? rendered.slice(0, VENDOR_BODY_SUFFIX_LIMIT) : rendered;
407
+ }
408
+ var DIAGNOSTIC_SHAPE_ANOMALY = "sent value shows shell-quoting/line-break artifacts \u2014 check your env load";
409
+ var DIAGNOSTIC_NO_ANOMALY = "sent value shows no shape anomalies \u2014 credentials or account state are the likely cause";
410
+ var CREDENTIAL_SHAPE_POINTER = "Load the credential the way the file documents: shell-sourced (`set -a; . ./.env; set +a`) or via loadAutotaskCredentialsFromEnv() from node-autotask \u2014 a quote-preserving parser hands the value over with its quotes intact, which the vendor rejects as invalid credentials.";
411
+ function credentialDiagnosticDetails(credential) {
412
+ if (credential === void 0) return void 0;
413
+ const diagnostic = credential.allValuesClean ? DIAGNOSTIC_NO_ANOMALY : `${DIAGNOSTIC_SHAPE_ANOMALY} (${_nullishCoalesce(credential.problem, () => ( "shape anomaly detected"))})`;
414
+ return { diagnostic, pointerNote: CREDENTIAL_SHAPE_POINTER };
415
+ }
416
+ function mergeDetails(base, extra) {
417
+ if (base === void 0) return extra;
418
+ if (extra === void 0) return base;
419
+ return { ...base, ...extra };
420
+ }
421
+ function suggestedActionForStatus(status) {
422
+ switch (status) {
423
+ case 400:
424
+ case 422:
425
+ return "Fix the request payload; see the vendor error for the offending field.";
426
+ case 401:
427
+ return "Check the API integration code, username and secret (3-header auth).";
428
+ case 403:
429
+ return "Verify permissions; if ImpersonationResourceId is set, retry without it.";
430
+ case 404:
431
+ return "Verify the id, or resolve the record by name first.";
432
+ case 409:
433
+ case 412:
434
+ return "Re-read the record and retry with current values.";
435
+ case 429:
436
+ return "Back off and retry; honour Retry-After.";
437
+ default:
438
+ return status >= 500 ? "Retry with backoff; the server error is transient." : void 0;
439
+ }
440
+ }
441
+ function errorFromStatus(status, body, url, operation, redactPersonalData = true, credential) {
442
+ const safeBody = redactResponseBody(body, { redactPersonalData });
443
+ let detail = formatVendorDetail(safeBody);
444
+ if (detail !== void 0 && detail.length > VENDOR_BODY_SUFFIX_LIMIT) {
445
+ detail = detail.slice(0, VENDOR_BODY_SUFFIX_LIMIT);
446
+ }
447
+ const suffix = detail === void 0 ? vendorBodySuffix(safeBody) : void 0;
448
+ const message = _nullishCoalesce(detail, () => ( (suffix !== void 0 ? `${statusDefaultMessage(status)}: ${suffix}` : statusDefaultMessage(status))));
449
+ const mapped = errorClassForStatus(status);
450
+ const Ctor = _nullishCoalesce(mapped, () => ( AutotaskError));
451
+ const code = mapped !== null ? defaultCodeForClass(mapped) : `HTTP_${status}`;
452
+ const entries = parseVendorErrors(safeBody);
453
+ const vendorCodeCandidate = _nullishCoalesce((isRecord(safeBody) && typeof safeBody.code === "string" ? safeBody.code : void 0), () => ( (_nullishCoalesce(_optionalChain([entries, 'optionalAccess', _3 => _3[0], 'optionalAccess', _4 => _4.code]), () => ( void 0)))));
454
+ const credentialDetails = status === 401 ? credentialDiagnosticDetails(credential) : void 0;
455
+ const extraDetails = mergeDetails(void 0, credentialDetails);
456
+ const err = new Ctor(message, {
457
+ code: vendorCodeCandidate !== void 0 && isMachineCode(vendorCodeCandidate) ? vendorCodeCandidate : code,
458
+ httpStatus: status,
459
+ vendorError: safeBody,
460
+ url,
461
+ operation,
462
+ retryable: status === 429 || status >= 500,
463
+ suggestedAction: suggestedActionForStatus(status),
464
+ ...extraDetails !== void 0 ? { details: extraDetails } : {}
465
+ });
466
+ if (Ctor === AutotaskError) err.name = "AutotaskError";
467
+ if (status >= 500 && isDeterministicVendor500(entries)) {
468
+ err.retryable = false;
469
+ err.details = mergeDetails(err.details, { deterministic: true });
470
+ const dot = operation !== void 0 ? operation.indexOf(".") : -1;
471
+ const resource = operation !== void 0 && dot > 0 ? operation.slice(0, dot) : void 0;
472
+ err.suggestedAction = "Deterministic field rejection \u2014 fix the value, do not retry. " + (resource !== void 0 ? `Consult ${resource}.getFieldInfo for the field catalog (types, required, maxLength).` : "Consult the resource's getFieldInfo for the field catalog (types, required, maxLength).");
473
+ }
474
+ return err;
475
+ }
476
+ var StaleObjectError = class extends AutotaskError {
477
+ constructor(message, options = {}) {
478
+ super(message, {
479
+ code: "STALE_OBJECT",
480
+ category: "conflict",
481
+ suggestedAction: "Re-read the record and retry with the fresh lastModifiedDate.",
482
+ ...options
483
+ });
484
+ this.name = "StaleObjectError";
485
+ }
486
+ };
487
+ var ConfirmationRequiredError = class extends AutotaskError {
488
+ constructor(message, options = {}) {
489
+ super(message, { code: "CONFIRMATION_REQUIRED", category: "policy", ...options });
490
+ this.name = "ConfirmationRequiredError";
491
+ }
492
+ };
493
+ var DeleteBoundaryError = class extends AutotaskError {
494
+ constructor(message, options = {}) {
495
+ super(message, { code: "DELETE_BOUNDARY", category: "policy", ...options });
496
+ this.name = "DeleteBoundaryError";
497
+ }
498
+ };
499
+ var MarkerUnsafeIdError = class extends AutotaskError {
500
+ constructor(message, options = {}) {
501
+ super(message, { code: "MARKER_UNSAFE_ID", category: "policy", ...options });
502
+ this.name = "MarkerUnsafeIdError";
503
+ }
504
+ };
505
+ var RecoveryTruncatedError = class extends AutotaskError {
506
+ constructor(message, options = {}) {
507
+ super(message, { code: "RECOVERY_TRUNCATED", category: "policy", ...options });
508
+ this.name = "RecoveryTruncatedError";
509
+ }
510
+ };
511
+ function defaultCodeForClass(Ctor) {
512
+ switch (Ctor) {
513
+ case BadRequestError:
514
+ return "BAD_REQUEST";
515
+ case UnauthorizedError:
516
+ return "UNAUTHORIZED";
517
+ case ForbiddenError:
518
+ return "FORBIDDEN";
519
+ case NotFoundError:
520
+ return "NOT_FOUND";
521
+ case ConflictError:
522
+ return "CONFLICT";
523
+ case UnprocessableEntityError:
524
+ return "VALIDATION_FAILED";
525
+ case RateLimitError:
526
+ return "RATE_LIMITED";
527
+ default:
528
+ return "SERVER_ERROR";
529
+ }
530
+ }
531
+ function isAutotaskError(err) {
532
+ return err instanceof AutotaskError;
533
+ }
10
534
 
11
- var _chunkIFXFOYDUcjs = require('./chunk-IFXFOYDU.cjs');
535
+ // src/credential-shape.ts
536
+ var QUOTE_CHARS = /* @__PURE__ */ new Set(["'", '"']);
537
+ function hasSurroundingQuotes(value) {
538
+ if (value.length < 2) return false;
539
+ const first = value[0];
540
+ return QUOTE_CHARS.has(first) && value[value.length - 1] === first;
541
+ }
542
+ function credentialShapeProblem(value, options = {}) {
543
+ if (!options.skipEdgeWhitespace) {
544
+ if (/^\s/.test(value)) return "leading whitespace";
545
+ if (/\s$/.test(value)) return "trailing whitespace";
546
+ }
547
+ if (!options.skipSurroundingQuotes && hasSurroundingQuotes(value)) {
548
+ return "single- or double-quote surrounding the value";
549
+ }
550
+ if (value.includes("\r")) return "carriage return";
551
+ return void 0;
552
+ }
553
+ var CREDENTIAL_ENV_LOAD_ACTION = "value appears shell-quoted or line-break contaminated \u2014 check how your env file was loaded (single-quoted values must be shell-sourced, not parsed by a quote-preserving loader)";
554
+ var MIN_PREFIX_SUMMARY_LENGTH = 4;
555
+ function credentialValueSummary(value) {
556
+ return value.length >= MIN_PREFIX_SUMMARY_LENGTH ? `len ${value.length}, starts "${value.slice(0, 2)}"` : "short value (length withheld)";
557
+ }
12
558
 
13
559
  // src/fieldCache.ts
14
560
  var FIELD_CACHE_MAX_ENTITIES = 256;
@@ -22,10 +568,10 @@ var FieldCache = (_class = class _FieldCache {
22
568
  __init2() {this.inflightMap = /* @__PURE__ */ new Map()}
23
569
  constructor(ttlMs, maxEntities = FIELD_CACHE_MAX_ENTITIES) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);
24
570
  if (!Number.isInteger(ttlMs) || ttlMs <= 0) {
25
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`fieldCache.ttlMs must be a positive integer (got ${ttlMs})`);
571
+ throw new AutotaskConfigError(`fieldCache.ttlMs must be a positive integer (got ${ttlMs})`);
26
572
  }
27
573
  if (!Number.isInteger(maxEntities) || maxEntities <= 0) {
28
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`fieldCache.maxEntities must be a positive integer (got ${maxEntities})`);
574
+ throw new AutotaskConfigError(`fieldCache.maxEntities must be a positive integer (got ${maxEntities})`);
29
575
  }
30
576
  this.ttlMs = ttlMs;
31
577
  this.maxEntities = maxEntities;
@@ -195,7 +741,7 @@ function defaultCircuitBreakerStore() {
195
741
  return defaultStore;
196
742
  }
197
743
  function resetDefaultCircuitBreakerStore() {
198
- _optionalChain([defaultStore, 'optionalAccess', _ => _.clear, 'call', _2 => _2()]);
744
+ _optionalChain([defaultStore, 'optionalAccess', _5 => _5.clear, 'call', _6 => _6()]);
199
745
  }
200
746
  function buildBreakerKey(baseUrl) {
201
747
  return new URL(baseUrl).host.toLowerCase();
@@ -207,7 +753,7 @@ function isBreakerFailure(err) {
207
753
  if (status === void 0) return false;
208
754
  if (status === 429) return true;
209
755
  if (status >= 500 && status < 600) {
210
- return _optionalChain([err, 'access', _3 => _3.details, 'optionalAccess', _4 => _4.deterministic]) !== true;
756
+ return _optionalChain([err, 'access', _7 => _7.details, 'optionalAccess', _8 => _8.deterministic]) !== true;
211
757
  }
212
758
  return err.code === "UNEXPECTED_CONTENT_TYPE";
213
759
  }
@@ -262,7 +808,7 @@ function defaultCooldownStore() {
262
808
  return defaultStore2;
263
809
  }
264
810
  function resetDefaultCooldownStore() {
265
- _optionalChain([defaultStore2, 'optionalAccess', _5 => _5.clear, 'call', _6 => _6()]);
811
+ _optionalChain([defaultStore2, 'optionalAccess', _9 => _9.clear, 'call', _10 => _10()]);
266
812
  }
267
813
  function buildTenantKey(userName, baseUrl) {
268
814
  return `${userName.toLowerCase()}@${new URL(baseUrl).host.toLowerCase()}`;
@@ -286,20 +832,20 @@ var ReadCache = (_class4 = class {
286
832
  __init5() {this.store = /* @__PURE__ */ new Map()}
287
833
  constructor(ttlMs, perResourceTtlMs) {;_class4.prototype.__init5.call(this);
288
834
  if (!Number.isInteger(ttlMs) || ttlMs <= 0) {
289
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`cache.ttlMs must be a positive integer (got ${ttlMs})`);
835
+ throw new AutotaskConfigError(`cache.ttlMs must be a positive integer (got ${ttlMs})`);
290
836
  }
291
837
  if (perResourceTtlMs !== void 0) {
292
838
  if (perResourceTtlMs === null || typeof perResourceTtlMs !== "object" || Array.isArray(perResourceTtlMs)) {
293
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
839
+ throw new AutotaskConfigError(
294
840
  `cache.perResourceTtlMs must be an object of resource key -> ms (got ${String(perResourceTtlMs)})`
295
841
  );
296
842
  }
297
843
  for (const [key, value] of Object.entries(perResourceTtlMs)) {
298
844
  if (key === "") {
299
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("cache.perResourceTtlMs keys must be non-empty resource keys");
845
+ throw new AutotaskConfigError("cache.perResourceTtlMs keys must be non-empty resource keys");
300
846
  }
301
847
  if (!Number.isInteger(value) || value <= 0) {
302
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
848
+ throw new AutotaskConfigError(
303
849
  `cache.perResourceTtlMs.${key} must be a positive integer (got ${String(value)})`
304
850
  );
305
851
  }
@@ -487,7 +1033,7 @@ function assertHostPolicy(origin, options) {
487
1033
  const violation = decideHostPolicy(origin, options);
488
1034
  if (violation === null) return canonicalOrigin(origin);
489
1035
  const bound = violation.bound === "private" ? "the host is a literal private / loopback / link-local address" : "the host is not on the configured allowedOrigins list";
490
- throw new (0, _chunk5QVXRT3Acjs.HostPolicyDeniedError)(
1036
+ throw new HostPolicyDeniedError(
491
1037
  `Host policy denied "${violation.origin}": ${bound} (hostPolicy is opt-in; remove the bound or use a permitted origin)`,
492
1038
  { details: { bound: violation.bound, origin: violation.origin } }
493
1039
  );
@@ -570,7 +1116,7 @@ var DEFAULT_MAX_SCAN_PAGES = 4;
570
1116
  function zoneUrl(zone) {
571
1117
  const url = ZONE_CATALOG[zone];
572
1118
  if (url === null || url === void 0) {
573
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`Zone "${zone}" has no catalog URL; supply a baseUrl instead`);
1119
+ throw new AutotaskConfigError(`Zone "${zone}" has no catalog URL; supply a baseUrl instead`);
574
1120
  }
575
1121
  return url;
576
1122
  }
@@ -579,10 +1125,10 @@ function normalizeBaseUrl(raw) {
579
1125
  try {
580
1126
  url = new URL(raw);
581
1127
  } catch (e) {
582
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`Invalid baseUrl: "${raw}"`);
1128
+ throw new AutotaskConfigError(`Invalid baseUrl: "${raw}"`);
583
1129
  }
584
1130
  if (url.protocol !== "http:" && url.protocol !== "https:") {
585
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`baseUrl must use http: or https:, got "${url.protocol}"`);
1131
+ throw new AutotaskConfigError(`baseUrl must use http: or https:, got "${url.protocol}"`);
586
1132
  }
587
1133
  const path = url.pathname.replace(/\/+$/, "");
588
1134
  return `${url.origin}${path}`;
@@ -593,21 +1139,21 @@ function isKnownZone(zone) {
593
1139
  function resolveBaseUrl(partial) {
594
1140
  if (partial.baseUrl !== void 0) return normalizeBaseUrl(partial.baseUrl);
595
1141
  if (partial.zone === "other") {
596
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)('zone: "other" requires a baseUrl');
1142
+ throw new AutotaskConfigError('zone: "other" requires a baseUrl');
597
1143
  }
598
1144
  return zoneUrl(_nullishCoalesce(partial.zone, () => ( DEFAULT_ZONE)));
599
1145
  }
600
1146
  function requireCredential(value, field) {
601
1147
  if (typeof value !== "string") {
602
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${field} must be a non-empty string`);
1148
+ throw new AutotaskConfigError(`${field} must be a non-empty string`);
603
1149
  }
604
1150
  const trimmed = value.trim();
605
1151
  if (trimmed.length === 0) {
606
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${field} must be a non-empty string`);
1152
+ throw new AutotaskConfigError(`${field} must be a non-empty string`);
607
1153
  }
608
- const shape = _chunkIFXFOYDUcjs.credentialShapeProblem.call(void 0, trimmed, { skipEdgeWhitespace: true });
1154
+ const shape = credentialShapeProblem(trimmed, { skipEdgeWhitespace: true });
609
1155
  if (shape !== void 0) {
610
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${field} ${_chunkIFXFOYDUcjs.CREDENTIAL_ENV_LOAD_ACTION} (${shape})`, {
1156
+ throw new AutotaskConfigError(`${field} ${CREDENTIAL_ENV_LOAD_ACTION} (${shape})`, {
611
1157
  code: "INVALID_CREDENTIAL_SHAPE",
612
1158
  suggestedAction: "Load the credential with the shell (`set -a; . ./.env; set +a`) or with loadAutotaskCredentialsFromEnv() from node-autotask; single-quoted values must be shell-sourced, not parsed by a quote-preserving loader. No request was sent."
613
1159
  });
@@ -616,18 +1162,18 @@ function requireCredential(value, field) {
616
1162
  }
617
1163
  function resolveConfig(config) {
618
1164
  if (config === null || typeof config !== "object") {
619
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("AutotaskConfig is required");
1165
+ throw new AutotaskConfigError("AutotaskConfig is required");
620
1166
  }
621
1167
  const profile = _nullishCoalesce(config.profile, () => ( "library"));
622
1168
  if (profile !== "library" && profile !== "agent") {
623
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
1169
+ throw new AutotaskConfigError(
624
1170
  `Unknown profile "${String(config.profile)}" \u2014 expected "library" or "agent"`
625
1171
  );
626
1172
  }
627
1173
  const agent = profile === "agent";
628
1174
  const { baseUrl, zone } = config;
629
1175
  if (baseUrl !== void 0 && zone !== void 0 && zone !== "other") {
630
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
1176
+ throw new AutotaskConfigError(
631
1177
  'Provide exactly one of "baseUrl" or "zone" (zone "other" is used with a baseUrl)'
632
1178
  );
633
1179
  }
@@ -638,12 +1184,12 @@ function resolveConfig(config) {
638
1184
  if (zone === "other") resolvedZone = "other";
639
1185
  } else if (zone !== void 0) {
640
1186
  if (!isKnownZone(zone)) {
641
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
1187
+ throw new AutotaskConfigError(
642
1188
  `Unknown zone "${zone}" \u2014 the catalog has ${ZONES.length} zones: ${ZONES.join(", ")} (use one of them, or supply a baseUrl)`
643
1189
  );
644
1190
  }
645
1191
  if (zone === "other") {
646
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)('zone: "other" requires a baseUrl');
1192
+ throw new AutotaskConfigError('zone: "other" requires a baseUrl');
647
1193
  }
648
1194
  resolvedBaseUrl = zoneUrl(zone);
649
1195
  resolvedZone = zone;
@@ -655,25 +1201,25 @@ function resolveConfig(config) {
655
1201
  if (config.hostPolicy !== void 0) {
656
1202
  const raw = config.hostPolicy;
657
1203
  if (raw === null || typeof raw !== "object") {
658
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("hostPolicy must be an object");
1204
+ throw new AutotaskConfigError("hostPolicy must be an object");
659
1205
  }
660
1206
  if (raw.blockPrivateHosts !== void 0 && typeof raw.blockPrivateHosts !== "boolean") {
661
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("hostPolicy.blockPrivateHosts must be a boolean");
1207
+ throw new AutotaskConfigError("hostPolicy.blockPrivateHosts must be a boolean");
662
1208
  }
663
1209
  let allowedOrigins;
664
1210
  if (raw.allowedOrigins !== void 0) {
665
1211
  if (!Array.isArray(raw.allowedOrigins) || raw.allowedOrigins.some((entry) => typeof entry !== "string")) {
666
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("hostPolicy.allowedOrigins must be an array of URL strings");
1212
+ throw new AutotaskConfigError("hostPolicy.allowedOrigins must be an array of URL strings");
667
1213
  }
668
1214
  try {
669
1215
  allowedOrigins = normalizeAllowedOrigins(raw.allowedOrigins);
670
1216
  } catch (e2) {
671
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("hostPolicy.allowedOrigins contains an invalid URL");
1217
+ throw new AutotaskConfigError("hostPolicy.allowedOrigins contains an invalid URL");
672
1218
  }
673
1219
  }
674
1220
  const blockPrivate = raw.blockPrivateHosts === true;
675
1221
  if (!blockPrivate && (allowedOrigins === void 0 || allowedOrigins.length === 0)) {
676
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
1222
+ throw new AutotaskConfigError(
677
1223
  "hostPolicy is present but has no active bound \u2014 set blockPrivateHosts: true and/or a non-empty allowedOrigins (an empty policy is refused fail-closed)"
678
1224
  );
679
1225
  }
@@ -692,24 +1238,24 @@ function resolveConfig(config) {
692
1238
  }
693
1239
  const pageSize = _nullishCoalesce(config.pageSize, () => ( (agent ? AGENT_PROFILE.pageSize : DEFAULT_PAGE_SIZE)));
694
1240
  if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > MAX_PAGE_SIZE) {
695
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`pageSize must be an integer in 1..${MAX_PAGE_SIZE} (got ${String(config.pageSize)})`);
1241
+ throw new AutotaskConfigError(`pageSize must be an integer in 1..${MAX_PAGE_SIZE} (got ${String(config.pageSize)})`);
696
1242
  }
697
1243
  const pageSizeCapped = agent ? Math.min(pageSize, AGENT_PROFILE.maxPageSize) : pageSize;
698
1244
  const timeoutMs = _nullishCoalesce(config.timeoutMs, () => ( (agent ? AGENT_PROFILE.timeoutMs : DEFAULT_TIMEOUT_MS)));
699
1245
  if (!Number.isInteger(timeoutMs) || timeoutMs <= 0) {
700
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("timeoutMs must be a positive integer");
1246
+ throw new AutotaskConfigError("timeoutMs must be a positive integer");
701
1247
  }
702
1248
  const maxRetries = _nullishCoalesce(config.maxRetries, () => ( (agent ? AGENT_PROFILE.maxRetries : DEFAULT_MAX_RETRIES)));
703
1249
  if (!Number.isInteger(maxRetries) || maxRetries < 0) {
704
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("maxRetries must be a non-negative integer");
1250
+ throw new AutotaskConfigError("maxRetries must be a non-negative integer");
705
1251
  }
706
1252
  const maxConcurrent = _nullishCoalesce(config.maxConcurrent, () => ( (agent ? AGENT_PROFILE.maxConcurrent : DEFAULT_MAX_CONCURRENT)));
707
1253
  if (!Number.isInteger(maxConcurrent) || maxConcurrent <= 0) {
708
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("maxConcurrent must be a positive integer");
1254
+ throw new AutotaskConfigError("maxConcurrent must be a positive integer");
709
1255
  }
710
1256
  const maxResponseBytes = _nullishCoalesce(config.maxResponseBytes, () => ( (agent ? AGENT_PROFILE.maxResponseBytes : DEFAULT_MAX_RESPONSE_BYTES)));
711
1257
  if (!Number.isInteger(maxResponseBytes) || maxResponseBytes <= 0) {
712
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("maxResponseBytes must be a positive integer");
1258
+ throw new AutotaskConfigError("maxResponseBytes must be a positive integer");
713
1259
  }
714
1260
  let rateLimit;
715
1261
  if (config.rateLimit !== void 0 && config.rateLimit.perHour !== void 0) {
@@ -718,25 +1264,25 @@ function resolveConfig(config) {
718
1264
  } else {
719
1265
  const perHour = config.rateLimit.perHour;
720
1266
  if (!Number.isInteger(perHour) || perHour <= 0) {
721
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("rateLimit.perHour must be a positive integer or null (explicitly disabled)");
1267
+ throw new AutotaskConfigError("rateLimit.perHour must be a positive integer or null (explicitly disabled)");
722
1268
  }
723
1269
  rateLimit = { perHour };
724
1270
  }
725
1271
  } else if (agent) {
726
1272
  rateLimit = { perHour: AGENT_PROFILE.rateLimit.perHour };
727
1273
  }
728
- const cooldownEnabled = _nullishCoalesce(_optionalChain([config, 'access', _7 => _7.cooldown, 'optionalAccess', _8 => _8.enabled]), () => ( true));
729
- const cooldownMaxMs = _nullishCoalesce(_optionalChain([config, 'access', _9 => _9.cooldown, 'optionalAccess', _10 => _10.maxMs]), () => ( DEFAULT_COOLDOWN_MAX_MS));
1274
+ const cooldownEnabled = _nullishCoalesce(_optionalChain([config, 'access', _11 => _11.cooldown, 'optionalAccess', _12 => _12.enabled]), () => ( true));
1275
+ const cooldownMaxMs = _nullishCoalesce(_optionalChain([config, 'access', _13 => _13.cooldown, 'optionalAccess', _14 => _14.maxMs]), () => ( DEFAULT_COOLDOWN_MAX_MS));
730
1276
  if (!Number.isInteger(cooldownMaxMs) || cooldownMaxMs <= 0) {
731
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("cooldown.maxMs must be a positive integer (ms)");
1277
+ throw new AutotaskConfigError("cooldown.maxMs must be a positive integer (ms)");
732
1278
  }
733
- const cooldownDefaultMs = _nullishCoalesce(_optionalChain([config, 'access', _11 => _11.cooldown, 'optionalAccess', _12 => _12.defaultMs]), () => ( DEFAULT_COOLDOWN_DEFAULT_MS));
1279
+ const cooldownDefaultMs = _nullishCoalesce(_optionalChain([config, 'access', _15 => _15.cooldown, 'optionalAccess', _16 => _16.defaultMs]), () => ( DEFAULT_COOLDOWN_DEFAULT_MS));
734
1280
  if (!Number.isInteger(cooldownDefaultMs) || cooldownDefaultMs <= 0) {
735
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("cooldown.defaultMs must be a positive integer (ms)");
1281
+ throw new AutotaskConfigError("cooldown.defaultMs must be a positive integer (ms)");
736
1282
  }
737
- const cooldownStore = _optionalChain([config, 'access', _13 => _13.cooldown, 'optionalAccess', _14 => _14.store]);
1283
+ const cooldownStore = _optionalChain([config, 'access', _17 => _17.cooldown, 'optionalAccess', _18 => _18.store]);
738
1284
  if (cooldownStore !== void 0 && (typeof cooldownStore.get !== "function" || typeof cooldownStore.set !== "function" || typeof cooldownStore.delete !== "function")) {
739
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("cooldown.store must implement get/set/delete (a CooldownStore)");
1285
+ throw new AutotaskConfigError("cooldown.store must implement get/set/delete (a CooldownStore)");
740
1286
  }
741
1287
  const cooldown = {
742
1288
  enabled: cooldownEnabled,
@@ -744,39 +1290,39 @@ function resolveConfig(config) {
744
1290
  defaultMs: cooldownDefaultMs,
745
1291
  store: cooldownStore
746
1292
  };
747
- const breakerEnabled = _nullishCoalesce(_optionalChain([config, 'access', _15 => _15.circuitBreaker, 'optionalAccess', _16 => _16.enabled]), () => ( false));
748
- const breakerWindowMs = _nullishCoalesce(_optionalChain([config, 'access', _17 => _17.circuitBreaker, 'optionalAccess', _18 => _18.failureWindowMs]), () => ( DEFAULT_CIRCUIT_BREAKER_WINDOW_MS));
1293
+ const breakerEnabled = _nullishCoalesce(_optionalChain([config, 'access', _19 => _19.circuitBreaker, 'optionalAccess', _20 => _20.enabled]), () => ( false));
1294
+ const breakerWindowMs = _nullishCoalesce(_optionalChain([config, 'access', _21 => _21.circuitBreaker, 'optionalAccess', _22 => _22.failureWindowMs]), () => ( DEFAULT_CIRCUIT_BREAKER_WINDOW_MS));
749
1295
  if (!Number.isInteger(breakerWindowMs) || breakerWindowMs <= 0) {
750
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.failureWindowMs must be a positive integer (ms)");
1296
+ throw new AutotaskConfigError("circuitBreaker.failureWindowMs must be a positive integer (ms)");
751
1297
  }
752
- const breakerThreshold = _nullishCoalesce(_optionalChain([config, 'access', _19 => _19.circuitBreaker, 'optionalAccess', _20 => _20.failureThreshold]), () => ( DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD));
1298
+ const breakerThreshold = _nullishCoalesce(_optionalChain([config, 'access', _23 => _23.circuitBreaker, 'optionalAccess', _24 => _24.failureThreshold]), () => ( DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD));
753
1299
  if (!Number.isInteger(breakerThreshold) || breakerThreshold <= 0) {
754
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.failureThreshold must be a positive integer");
1300
+ throw new AutotaskConfigError("circuitBreaker.failureThreshold must be a positive integer");
755
1301
  }
756
- const breakerOpenTimeoutMs = _nullishCoalesce(_optionalChain([config, 'access', _21 => _21.circuitBreaker, 'optionalAccess', _22 => _22.openTimeoutMs]), () => ( DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS));
1302
+ const breakerOpenTimeoutMs = _nullishCoalesce(_optionalChain([config, 'access', _25 => _25.circuitBreaker, 'optionalAccess', _26 => _26.openTimeoutMs]), () => ( DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS));
757
1303
  if (!Number.isInteger(breakerOpenTimeoutMs) || breakerOpenTimeoutMs <= 0) {
758
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.openTimeoutMs must be a positive integer (ms)");
1304
+ throw new AutotaskConfigError("circuitBreaker.openTimeoutMs must be a positive integer (ms)");
759
1305
  }
760
- const breakerSuccessesToClose = _nullishCoalesce(_optionalChain([config, 'access', _23 => _23.circuitBreaker, 'optionalAccess', _24 => _24.successesToClose]), () => ( DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE));
1306
+ const breakerSuccessesToClose = _nullishCoalesce(_optionalChain([config, 'access', _27 => _27.circuitBreaker, 'optionalAccess', _28 => _28.successesToClose]), () => ( DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE));
761
1307
  if (!Number.isInteger(breakerSuccessesToClose) || breakerSuccessesToClose <= 0) {
762
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.successesToClose must be a positive integer");
1308
+ throw new AutotaskConfigError("circuitBreaker.successesToClose must be a positive integer");
763
1309
  }
764
- const breakerHalfOpenProbes = _nullishCoalesce(_optionalChain([config, 'access', _25 => _25.circuitBreaker, 'optionalAccess', _26 => _26.halfOpenProbes]), () => ( breakerSuccessesToClose));
1310
+ const breakerHalfOpenProbes = _nullishCoalesce(_optionalChain([config, 'access', _29 => _29.circuitBreaker, 'optionalAccess', _30 => _30.halfOpenProbes]), () => ( breakerSuccessesToClose));
765
1311
  if (!Number.isInteger(breakerHalfOpenProbes) || breakerHalfOpenProbes <= 0) {
766
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.halfOpenProbes must be a positive integer");
1312
+ throw new AutotaskConfigError("circuitBreaker.halfOpenProbes must be a positive integer");
767
1313
  }
768
1314
  if (breakerHalfOpenProbes < breakerSuccessesToClose) {
769
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(
1315
+ throw new AutotaskConfigError(
770
1316
  `circuitBreaker.halfOpenProbes (${breakerHalfOpenProbes}) must be >= successesToClose (${breakerSuccessesToClose}) \u2014 the breaker could never close`
771
1317
  );
772
1318
  }
773
- const breakerStore = _optionalChain([config, 'access', _27 => _27.circuitBreaker, 'optionalAccess', _28 => _28.store]);
1319
+ const breakerStore = _optionalChain([config, 'access', _31 => _31.circuitBreaker, 'optionalAccess', _32 => _32.store]);
774
1320
  if (breakerStore !== void 0 && (typeof breakerStore.get !== "function" || typeof breakerStore.set !== "function" || typeof breakerStore.delete !== "function")) {
775
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.store must implement get/set/delete (a CircuitBreakerStore)");
1321
+ throw new AutotaskConfigError("circuitBreaker.store must implement get/set/delete (a CircuitBreakerStore)");
776
1322
  }
777
- const breakerIsFailure = _optionalChain([config, 'access', _29 => _29.circuitBreaker, 'optionalAccess', _30 => _30.isFailure]);
1323
+ const breakerIsFailure = _optionalChain([config, 'access', _33 => _33.circuitBreaker, 'optionalAccess', _34 => _34.isFailure]);
778
1324
  if (breakerIsFailure !== void 0 && typeof breakerIsFailure !== "function") {
779
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("circuitBreaker.isFailure must be a function");
1325
+ throw new AutotaskConfigError("circuitBreaker.isFailure must be a function");
780
1326
  }
781
1327
  const circuitBreaker = {
782
1328
  enabled: breakerEnabled,
@@ -788,23 +1334,23 @@ function resolveConfig(config) {
788
1334
  store: breakerStore,
789
1335
  isFailure: breakerIsFailure
790
1336
  };
791
- const maxScanRecords = _nullishCoalesce(_optionalChain([config, 'access', _31 => _31.resolution, 'optionalAccess', _32 => _32.maxScanRecords]), () => ( (agent ? AGENT_PROFILE.resolution.maxScanRecords : DEFAULT_MAX_SCAN_RECORDS)));
1337
+ const maxScanRecords = _nullishCoalesce(_optionalChain([config, 'access', _35 => _35.resolution, 'optionalAccess', _36 => _36.maxScanRecords]), () => ( (agent ? AGENT_PROFILE.resolution.maxScanRecords : DEFAULT_MAX_SCAN_RECORDS)));
792
1338
  if (!Number.isInteger(maxScanRecords) || maxScanRecords < 1) {
793
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("resolution.maxScanRecords must be an integer >= 1");
1339
+ throw new AutotaskConfigError("resolution.maxScanRecords must be an integer >= 1");
794
1340
  }
795
- const maxScanPages = _nullishCoalesce(_optionalChain([config, 'access', _33 => _33.resolution, 'optionalAccess', _34 => _34.maxScanPages]), () => ( (agent ? AGENT_PROFILE.resolution.maxScanPages : DEFAULT_MAX_SCAN_PAGES)));
1341
+ const maxScanPages = _nullishCoalesce(_optionalChain([config, 'access', _37 => _37.resolution, 'optionalAccess', _38 => _38.maxScanPages]), () => ( (agent ? AGENT_PROFILE.resolution.maxScanPages : DEFAULT_MAX_SCAN_PAGES)));
796
1342
  if (!Number.isInteger(maxScanPages) || maxScanPages < 1) {
797
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)("resolution.maxScanPages must be an integer >= 1");
1343
+ throw new AutotaskConfigError("resolution.maxScanPages must be an integer >= 1");
798
1344
  }
799
1345
  const redactPersonalData = _nullishCoalesce(config.redactPersonalData, () => ( true));
800
1346
  const readCache = config.cache === void 0 ? void 0 : new ReadCache(config.cache.ttlMs, config.cache.perResourceTtlMs);
801
1347
  const fieldCache = config.fieldCache === void 0 ? void 0 : new FieldCache(config.fieldCache.ttlMs, _nullishCoalesce(config.fieldCache.maxEntities, () => ( FIELD_CACHE_MAX_ENTITIES)));
802
- const update = { putFallback: _optionalChain([config, 'access', _35 => _35.update, 'optionalAccess', _36 => _36.putFallback]) === true };
1348
+ const update = { putFallback: _optionalChain([config, 'access', _39 => _39.update, 'optionalAccess', _40 => _40.putFallback]) === true };
803
1349
  const reResolveZoneOn401 = config.reResolveZoneOn401 === true;
804
- const logger = _nullishCoalesce(config.logger, () => ( _chunk5QVXRT3Acjs.NoopLogger));
1350
+ const logger = _nullishCoalesce(config.logger, () => ( NoopLogger));
805
1351
  if (resolvedBaseUrl.startsWith("http:")) {
806
1352
  const host = new URL(resolvedBaseUrl).host;
807
- _optionalChain([logger, 'access', _37 => _37.warn, 'optionalCall', _38 => _38(
1353
+ _optionalChain([logger, 'access', _41 => _41.warn, 'optionalCall', _42 => _42(
808
1354
  `[autotask] cleartext credentials to ${host} \u2014 https recommended (baseUrl uses http:; all catalog zones are https)`
809
1355
  )]);
810
1356
  }
@@ -838,13 +1384,13 @@ function resolveConfig(config) {
838
1384
 
839
1385
  // src/utils/index.ts
840
1386
  var _crypto = require('crypto');
841
- function isRecord(value) {
1387
+ function isRecord2(value) {
842
1388
  return typeof value === "object" && value !== null && !Array.isArray(value);
843
1389
  }
844
1390
  function assertRecord(value, label) {
845
- if (!isRecord(value)) {
1391
+ if (!isRecord2(value)) {
846
1392
  const got = value === null ? "null" : Array.isArray(value) ? "array" : typeof value;
847
- throw new (0, _chunk5QVXRT3Acjs.AutotaskError)(`Expected ${label} to be an object, got ${got}`, {
1393
+ throw new AutotaskError(`Expected ${label} to be an object, got ${got}`, {
848
1394
  code: "INVALID_RESPONSE",
849
1395
  category: "server",
850
1396
  retryable: false
@@ -853,7 +1399,7 @@ function assertRecord(value, label) {
853
1399
  return value;
854
1400
  }
855
1401
  function isMergeable(value) {
856
- return isRecord(value);
1402
+ return isRecord2(value);
857
1403
  }
858
1404
  function deepMergeParams(base, override) {
859
1405
  const out = { ...base };
@@ -867,27 +1413,27 @@ function deepMergeParams(base, override) {
867
1413
  function parseIdentifier(value, label = "id") {
868
1414
  if (typeof value === "number") {
869
1415
  if (!Number.isSafeInteger(value) || value < 0) {
870
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${label} must be a non-negative safe integer (got ${value})`);
1416
+ throw new AutotaskConfigError(`${label} must be a non-negative safe integer (got ${value})`);
871
1417
  }
872
1418
  return value;
873
1419
  }
874
1420
  const trimmed = value.trim();
875
1421
  if (!/^\d+$/.test(trimmed)) {
876
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${label} must be a non-negative integer (got "${value}")`);
1422
+ throw new AutotaskConfigError(`${label} must be a non-negative integer (got "${value}")`);
877
1423
  }
878
1424
  const parsed = Number.parseInt(trimmed, 10);
879
1425
  if (!Number.isSafeInteger(parsed)) {
880
- throw new (0, _chunk5QVXRT3Acjs.AutotaskConfigError)(`${label} must be a non-negative safe integer (got "${value}")`);
1426
+ throw new AutotaskConfigError(`${label} must be a non-negative safe integer (got "${value}")`);
881
1427
  }
882
1428
  return parsed;
883
1429
  }
884
1430
  function flattenUdfs(record, options) {
885
- const prefix = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _39 => _39.prefix]), () => ( "udf_"));
1431
+ const prefix = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _43 => _43.prefix]), () => ( "udf_"));
886
1432
  const out = { ...record };
887
1433
  const udfs = record.userDefinedFields;
888
1434
  if (!Array.isArray(udfs)) return out;
889
1435
  for (const udf of udfs) {
890
- if (!isRecord(udf) || typeof udf.name !== "string" || udf.name === "") continue;
1436
+ if (!isRecord2(udf) || typeof udf.name !== "string" || udf.name === "") continue;
891
1437
  const target = udf.name in out ? `${prefix}${udf.name}` : udf.name;
892
1438
  if (!(target in out)) out[target] = udf.value;
893
1439
  }
@@ -899,7 +1445,7 @@ function newCorrelationId() {
899
1445
  var CREDENTIAL_KEY_RE = /(^|[_\-.])(secret|secrets|password|passwd|passphrase|token|tokens|apikey|api_key|apiintegrationcode|credentials?|accesskey|access_key|authcode|authorization)([_\-.]|$)|([A-Za-z0-9])(secrets?|tokens?|password|passwd|passphrase|credentials?|keys?|apiintegrationcode)(?=$)/i;
900
1446
  function redactAuditBody(value) {
901
1447
  if (Array.isArray(value)) return value.map((entry) => redactAuditBody(entry));
902
- if (!isRecord(value)) return value;
1448
+ if (!isRecord2(value)) return value;
903
1449
  const out = {};
904
1450
  for (const [key, entry] of Object.entries(value)) {
905
1451
  out[key] = CREDENTIAL_KEY_RE.test(key) ? "[REDACTED]" : redactAuditBody(entry);
@@ -925,7 +1471,7 @@ async function* paginate(fetchPage, opts = {}) {
925
1471
  let page = 1;
926
1472
  for (; ; ) {
927
1473
  if (page > MAX_PAGES) {
928
- throw new (0, _chunk5QVXRT3Acjs.PaginationLimitError)(
1474
+ throw new PaginationLimitError(
929
1475
  `Pagination exceeded ${MAX_PAGES} pages; refusing to fetch page ${page} (possible runaway walk)`
930
1476
  );
931
1477
  }
@@ -946,7 +1492,7 @@ async function collectAll(fetchPage, opts = {}) {
946
1492
  for await (const page of paginate(fetchPage, opts)) {
947
1493
  all.push(...page.items);
948
1494
  if (cap !== void 0 && all.length > cap) {
949
- throw new (0, _chunk5QVXRT3Acjs.PaginationLimitError)(
1495
+ throw new PaginationLimitError(
950
1496
  `Collected more than maxRecords (${cap}) records; refusing to accumulate further`,
951
1497
  { suggestedAction: "Narrow the query with a tighter filter, or raise maxRecords." }
952
1498
  );
@@ -12911,5 +13457,53 @@ var CREATE_GUIDANCE = {
12911
13457
 
12912
13458
 
12913
13459
 
12914
- exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.decideHostPolicy = decideHostPolicy; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.resolveConfig = resolveConfig; exports.isRecord = isRecord; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.BLIND_SURFACE_STAMPS = BLIND_SURFACE_STAMPS; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.RESPONSE_DRIFT_MARKERS = RESPONSE_DRIFT_MARKERS; exports.EMPTY_REASON_STAMPS = EMPTY_REASON_STAMPS; exports.POINTER_NOTES = POINTER_NOTES; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray;
12915
- //# sourceMappingURL=chunk-RFXGG37L.cjs.map
13460
+
13461
+
13462
+
13463
+
13464
+
13465
+
13466
+
13467
+
13468
+
13469
+
13470
+
13471
+
13472
+
13473
+
13474
+
13475
+
13476
+
13477
+
13478
+
13479
+
13480
+
13481
+
13482
+
13483
+
13484
+
13485
+
13486
+
13487
+
13488
+
13489
+
13490
+
13491
+
13492
+
13493
+
13494
+
13495
+
13496
+
13497
+
13498
+
13499
+
13500
+
13501
+
13502
+
13503
+
13504
+
13505
+
13506
+
13507
+
13508
+ exports.NoopLogger = NoopLogger; exports.REDACTED = REDACTED; exports.CREDENTIAL_HEADER_NAMES = CREDENTIAL_HEADER_NAMES; exports.isCredentialHeaderName = isCredentialHeaderName; exports.redactRecord = redactRecord; exports.SECRET_RESPONSE_FIELDS = SECRET_RESPONSE_FIELDS; exports.PERSONAL_RESPONSE_FIELDS = PERSONAL_RESPONSE_FIELDS; exports.CONFIDENTIAL_RESPONSE_FIELDS = CONFIDENTIAL_RESPONSE_FIELDS; exports.isRedactedFieldName = isRedactedFieldName; exports.redactResponseBody = redactResponseBody; exports.AutotaskError = AutotaskError; exports.AutotaskConfigError = AutotaskConfigError; exports.AutotaskNetworkError = AutotaskNetworkError; exports.AutotaskTimeoutError = AutotaskTimeoutError; exports.AutotaskAbortError = AutotaskAbortError; exports.ResponseRejectedError = ResponseRejectedError; exports.BadRequestError = BadRequestError; exports.UnauthorizedError = UnauthorizedError; exports.ForbiddenError = ForbiddenError; exports.NotFoundError = NotFoundError; exports.ConflictError = ConflictError; exports.UnprocessableEntityError = UnprocessableEntityError; exports.RateLimitError = RateLimitError; exports.ServerError = ServerError; exports.UnexpectedContentTypeError = UnexpectedContentTypeError; exports.EmptyResponseError = EmptyResponseError; exports.CircuitBreakerError = CircuitBreakerError; exports.HostPolicyDeniedError = HostPolicyDeniedError; exports.ResolutionError = ResolutionError; exports.PaginationLimitError = PaginationLimitError; exports.QueryTooLongError = QueryTooLongError; exports.parseVendorErrors = parseVendorErrors; exports.isDeterministicVendor500 = isDeterministicVendor500; exports.formatVendorDetail = formatVendorDetail; exports.CREDENTIAL_SHAPE_POINTER = CREDENTIAL_SHAPE_POINTER; exports.mergeDetails = mergeDetails; exports.errorFromStatus = errorFromStatus; exports.StaleObjectError = StaleObjectError; exports.ConfirmationRequiredError = ConfirmationRequiredError; exports.DeleteBoundaryError = DeleteBoundaryError; exports.MarkerUnsafeIdError = MarkerUnsafeIdError; exports.RecoveryTruncatedError = RecoveryTruncatedError; exports.isAutotaskError = isAutotaskError; exports.hasSurroundingQuotes = hasSurroundingQuotes; exports.credentialShapeProblem = credentialShapeProblem; exports.CREDENTIAL_ENV_LOAD_ACTION = CREDENTIAL_ENV_LOAD_ACTION; exports.MIN_PREFIX_SUMMARY_LENGTH = MIN_PREFIX_SUMMARY_LENGTH; exports.credentialValueSummary = credentialValueSummary; exports.FIELD_CACHE_KINDS = FIELD_CACHE_KINDS; exports.DEFAULT_CIRCUIT_BREAKER_WINDOW_MS = DEFAULT_CIRCUIT_BREAKER_WINDOW_MS; exports.DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD = DEFAULT_CIRCUIT_BREAKER_FAILURE_THRESHOLD; exports.DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS = DEFAULT_CIRCUIT_BREAKER_OPEN_TIMEOUT_MS; exports.DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE = DEFAULT_CIRCUIT_BREAKER_SUCCESSES_TO_CLOSE; exports.DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES = DEFAULT_CIRCUIT_BREAKER_MAX_ENTRIES; exports.InMemoryCircuitBreakerStore = InMemoryCircuitBreakerStore; exports.defaultCircuitBreakerStore = defaultCircuitBreakerStore; exports.resetDefaultCircuitBreakerStore = resetDefaultCircuitBreakerStore; exports.buildBreakerKey = buildBreakerKey; exports.isBreakerFailure = isBreakerFailure; exports.DEFAULT_COOLDOWN_MAX_MS = DEFAULT_COOLDOWN_MAX_MS; exports.DEFAULT_COOLDOWN_DEFAULT_MS = DEFAULT_COOLDOWN_DEFAULT_MS; exports.DEFAULT_COOLDOWN_MAX_ENTRIES = DEFAULT_COOLDOWN_MAX_ENTRIES; exports.InMemoryCooldownStore = InMemoryCooldownStore; exports.defaultCooldownStore = defaultCooldownStore; exports.resetDefaultCooldownStore = resetDefaultCooldownStore; exports.buildTenantKey = buildTenantKey; exports.cooldownDurationMs = cooldownDurationMs; exports.decideHostPolicy = decideHostPolicy; exports.ZONE_CATALOG = ZONE_CATALOG; exports.ZONES = ZONES; exports.DEFAULT_ZONE = DEFAULT_ZONE; exports.AGENT_PROFILE = AGENT_PROFILE; exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE; exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE; exports.DEFAULT_TIMEOUT_MS = DEFAULT_TIMEOUT_MS; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_MAX_CONCURRENT = DEFAULT_MAX_CONCURRENT; exports.DEFAULT_MAX_RESPONSE_BYTES = DEFAULT_MAX_RESPONSE_BYTES; exports.DEFAULT_MAX_SCAN_RECORDS = DEFAULT_MAX_SCAN_RECORDS; exports.DEFAULT_MAX_SCAN_PAGES = DEFAULT_MAX_SCAN_PAGES; exports.zoneUrl = zoneUrl; exports.resolveBaseUrl = resolveBaseUrl; exports.resolveConfig = resolveConfig; exports.isRecord = isRecord2; exports.assertRecord = assertRecord; exports.deepMergeParams = deepMergeParams; exports.parseIdentifier = parseIdentifier; exports.flattenUdfs = flattenUdfs; exports.newCorrelationId = newCorrelationId; exports.redactAuditBody = redactAuditBody; exports.camelKey = camelKey; exports.RELATIONSHIP_ZONE = RELATIONSHIP_ZONE; exports.RELATIONSHIP_MAP = RELATIONSHIP_MAP; exports.BLIND_SURFACE_STAMPS = BLIND_SURFACE_STAMPS; exports.DELETE_BOUNDARY_NOTES = DELETE_BOUNDARY_NOTES; exports.MARKER_FIELDS = MARKER_FIELDS; exports.RESPONSE_DRIFT_MARKERS = RESPONSE_DRIFT_MARKERS; exports.EMPTY_REASON_STAMPS = EMPTY_REASON_STAMPS; exports.POINTER_NOTES = POINTER_NOTES; exports.BLIND_SURFACE_INVENTORY = BLIND_SURFACE_INVENTORY; exports.REACHABILITY_PROBE_DEFAULTS = REACHABILITY_PROBE_DEFAULTS; exports.CREATE_GUIDANCE = CREATE_GUIDANCE; exports.MAX_PAGES = MAX_PAGES; exports.clampPageSize = clampPageSize; exports.totalPagesFor = totalPagesFor; exports.paginate = paginate; exports.paginateItems = paginateItems; exports.collectAll = collectAll; exports.toArray = toArray;
13509
+ //# sourceMappingURL=chunk-IV2Z3JLR.cjs.map