node-autotask 0.12.1 → 0.14.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.
- package/ARCHITECTURE.md +36 -7
- package/MCP_TOOL_CATALOG.json +4 -3
- package/MCP_TOOL_MANIFEST.md +5 -5
- package/N8N_MCP_MANIFEST.json +2 -2
- package/N8N_MCP_MANIFEST.md +3 -3
- package/README.md +6 -5
- package/capabilities.json +3537 -4144
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.d.cts +8 -4
- package/dist/capabilities.d.ts +8 -4
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-PPTAMCFA.js → chunk-2ZZOTJ2C.js} +2 -2
- package/dist/{chunk-36PG2IU2.cjs → chunk-5QMXECLN.cjs} +594 -574
- package/dist/{chunk-CSRCMBZ2.cjs → chunk-EWMG3HHU.cjs} +3536 -4143
- package/dist/{chunk-PGQIGE63.cjs → chunk-FCJUM42E.cjs} +135 -135
- package/dist/{chunk-P35GFG2H.js → chunk-IYN2BHVW.js} +172 -152
- package/dist/{chunk-NACI2NDF.js → chunk-JIDR3NPV.js} +3536 -4143
- package/dist/{chunk-ZOA5HUFX.js → chunk-KA6UU26H.js} +35 -23
- package/dist/{chunk-IHRXVIUU.cjs → chunk-XSIY3WRR.cjs} +40 -28
- package/dist/{index-DZfd9Gt7.d.cts → index-oiwPuJOG.d.cts} +100 -36
- package/dist/{index-UilX3PFL.d.ts → index-zt1KXThi.d.ts} +100 -36
- package/dist/index.cjs +62 -20
- package/dist/index.d.cts +83 -3
- package/dist/index.d.ts +83 -3
- package/dist/index.js +47 -5
- package/dist/operations/index.cjs +110 -107
- package/dist/operations/index.d.cts +9 -2
- package/dist/operations/index.d.ts +9 -2
- package/dist/operations/index.js +9 -6
- package/dist/pool.cjs +8 -8
- package/dist/pool.d.cts +1 -1
- package/dist/pool.d.ts +1 -1
- package/dist/pool.js +4 -4
- package/dist/resources/index.cjs +4 -4
- package/dist/resources/index.d.cts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +3 -3
- package/dist/untrusted.cjs +3 -1
- package/dist/untrusted.d.cts +9 -4
- package/dist/untrusted.d.ts +9 -4
- package/dist/untrusted.js +3 -1
- package/docs/API.md +146 -28
- package/docs/LIVE-TESTING.md +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAPABILITIES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JIDR3NPV.js";
|
|
4
4
|
|
|
5
5
|
// src/auth.ts
|
|
6
6
|
var AUTH_HEADERS = {
|
|
@@ -15188,6 +15188,7 @@ var HttpClient = class {
|
|
|
15188
15188
|
);
|
|
15189
15189
|
const auditBody = opts.body !== void 0 ? redactAuditBody(opts.body) : void 0;
|
|
15190
15190
|
const retriable = opts.idempotent ?? IDEMPOTENT_METHODS.includes(method);
|
|
15191
|
+
const retriable5xx = opts.idempotent ?? method === "GET";
|
|
15191
15192
|
const expectBody = opts.expectBody ?? method !== "DELETE";
|
|
15192
15193
|
const ctx = { operation: opts.operation, url, correlationId };
|
|
15193
15194
|
let lastStatus;
|
|
@@ -15313,7 +15314,7 @@ var HttpClient = class {
|
|
|
15313
15314
|
this.release();
|
|
15314
15315
|
if (signal.aborted || isAbortLike(err2)) throw interrupted();
|
|
15315
15316
|
const delay = backoffDelay(attempt);
|
|
15316
|
-
if (attempt < maxRetries &&
|
|
15317
|
+
if (attempt < maxRetries && retriable5xx && canWait(delay)) {
|
|
15317
15318
|
this.logger.warn?.(
|
|
15318
15319
|
`[autotask] network error on ${method} ${opts.path}; retrying in ${delay}ms (attempt ${attempt + 1}/${maxRetries})`,
|
|
15319
15320
|
correlationId
|
|
@@ -15425,7 +15426,7 @@ var HttpClient = class {
|
|
|
15425
15426
|
}
|
|
15426
15427
|
const deterministic500 = status >= 500 && isDeterministicVendor500(parseVendorErrors(body));
|
|
15427
15428
|
const retryableStatus = status === 429 || status >= 500;
|
|
15428
|
-
if (retryableStatus && !deterministic500 && attempt < maxRetries && retriable) {
|
|
15429
|
+
if (retryableStatus && !deterministic500 && attempt < maxRetries && (status === 429 ? retriable : retriable5xx)) {
|
|
15429
15430
|
const retryAfter = parseRetryAfter(res.headers.get("Retry-After"));
|
|
15430
15431
|
const delay = retryAfter !== void 0 ? retryAfter * 1e3 : backoffDelay(attempt);
|
|
15431
15432
|
if (canWait(delay)) {
|
|
@@ -17458,13 +17459,14 @@ var BaseResource = class {
|
|
|
17458
17459
|
* see the live record, and an unredacted body must not enter the
|
|
17459
17460
|
* (redacted-view) read cache.
|
|
17460
17461
|
*/
|
|
17461
|
-
async getGlobalUnredacted(id) {
|
|
17462
|
+
async getGlobalUnredacted(id, readOpts) {
|
|
17462
17463
|
const numeric = parseIdentifier(id, "id");
|
|
17463
17464
|
const res = await this.http.request({
|
|
17464
17465
|
method: "GET",
|
|
17465
17466
|
path: `${this.resourcePath}/${numeric}`,
|
|
17466
17467
|
operation: `${this.config.key}.get`,
|
|
17467
|
-
skipResponseRedaction: true
|
|
17468
|
+
skipResponseRedaction: true,
|
|
17469
|
+
maxRetries: readOpts?.maxRetries
|
|
17468
17470
|
});
|
|
17469
17471
|
return unwrapItem(res, numeric, `${this.config.key}.get`);
|
|
17470
17472
|
}
|
|
@@ -17476,13 +17478,14 @@ var BaseResource = class {
|
|
|
17476
17478
|
* record's own current values: a redacted read would write literal
|
|
17477
17479
|
* '[REDACTED]' markers into the fallback PUT (corruption on live records).
|
|
17478
17480
|
*/
|
|
17479
|
-
async getScopedUnredacted(parentId, id) {
|
|
17481
|
+
async getScopedUnredacted(parentId, id, readOpts) {
|
|
17480
17482
|
const numeric = parseIdentifier(id, "id");
|
|
17481
17483
|
const res = await this.http.request({
|
|
17482
17484
|
method: "GET",
|
|
17483
17485
|
path: this.scopedItemPath(parentId, numeric),
|
|
17484
17486
|
operation: `${this.config.key}.get`,
|
|
17485
|
-
skipResponseRedaction: true
|
|
17487
|
+
skipResponseRedaction: true,
|
|
17488
|
+
maxRetries: readOpts?.maxRetries
|
|
17486
17489
|
});
|
|
17487
17490
|
return unwrapItem(res, numeric, `${this.config.key}.get`);
|
|
17488
17491
|
}
|
|
@@ -17544,7 +17547,8 @@ var BaseResource = class {
|
|
|
17544
17547
|
method: "POST",
|
|
17545
17548
|
path: this.resourcePath,
|
|
17546
17549
|
body,
|
|
17547
|
-
operation: `${this.config.key}.create
|
|
17550
|
+
operation: `${this.config.key}.create`,
|
|
17551
|
+
maxRetries: opts.maxRetries
|
|
17548
17552
|
});
|
|
17549
17553
|
return this.unwrapCreateOperation(res, body, opts);
|
|
17550
17554
|
}
|
|
@@ -17707,7 +17711,7 @@ var BaseResource = class {
|
|
|
17707
17711
|
if (opts.raw !== true) {
|
|
17708
17712
|
let current;
|
|
17709
17713
|
try {
|
|
17710
|
-
current = await this.getGlobalUnredacted(numeric);
|
|
17714
|
+
current = await this.getGlobalUnredacted(numeric, { maxRetries: opts.maxRetries });
|
|
17711
17715
|
} catch (err) {
|
|
17712
17716
|
if (err instanceof NotFoundError) attachUpdateTargetMissReason(err, this.config.key);
|
|
17713
17717
|
throw err;
|
|
@@ -17726,7 +17730,8 @@ var BaseResource = class {
|
|
|
17726
17730
|
method: "PUT",
|
|
17727
17731
|
path: collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric}`,
|
|
17728
17732
|
body,
|
|
17729
|
-
operation
|
|
17733
|
+
operation,
|
|
17734
|
+
maxRetries: opts.maxRetries
|
|
17730
17735
|
});
|
|
17731
17736
|
} catch (err) {
|
|
17732
17737
|
if (!this.putFallbackEligible(err)) throw err;
|
|
@@ -17734,7 +17739,7 @@ var BaseResource = class {
|
|
|
17734
17739
|
throw this.putFallbackDeclined(err, route, false);
|
|
17735
17740
|
}
|
|
17736
17741
|
const merged = await this.putFallbackMergedBody(
|
|
17737
|
-
() => this.getGlobalUnredacted(numeric),
|
|
17742
|
+
() => this.getGlobalUnredacted(numeric, { maxRetries: opts.maxRetries }),
|
|
17738
17743
|
body,
|
|
17739
17744
|
numeric
|
|
17740
17745
|
);
|
|
@@ -17744,7 +17749,8 @@ var BaseResource = class {
|
|
|
17744
17749
|
method: "PUT",
|
|
17745
17750
|
path: `${this.resourcePath}/${numeric}`,
|
|
17746
17751
|
body: merged,
|
|
17747
|
-
operation
|
|
17752
|
+
operation,
|
|
17753
|
+
maxRetries: opts.maxRetries
|
|
17748
17754
|
});
|
|
17749
17755
|
} catch (rerr) {
|
|
17750
17756
|
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, route, true);
|
|
@@ -17758,12 +17764,13 @@ var BaseResource = class {
|
|
|
17758
17764
|
* (204 / empty body) is a valid vendor delete answer — synthesize the
|
|
17759
17765
|
* result from the path id (issue #25: the transport returns undefined
|
|
17760
17766
|
* for it; a non-blank wrong shape still throws via unwrapOperation). */
|
|
17761
|
-
async deleteGlobal(id) {
|
|
17767
|
+
async deleteGlobal(id, opts = {}) {
|
|
17762
17768
|
const numeric = parseIdentifier(id, "id");
|
|
17763
17769
|
const res = await this.http.request({
|
|
17764
17770
|
method: "DELETE",
|
|
17765
17771
|
path: `${this.resourcePath}/${numeric}`,
|
|
17766
|
-
operation: `${this.config.key}.delete
|
|
17772
|
+
operation: `${this.config.key}.delete`,
|
|
17773
|
+
maxRetries: opts.maxRetries
|
|
17767
17774
|
});
|
|
17768
17775
|
return res === void 0 ? { id: numeric } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
17769
17776
|
}
|
|
@@ -17784,7 +17791,8 @@ var BaseResource = class {
|
|
|
17784
17791
|
method: "POST",
|
|
17785
17792
|
path: this.scopedCollectionPath(parentId),
|
|
17786
17793
|
body,
|
|
17787
|
-
operation: `${this.config.key}.create
|
|
17794
|
+
operation: `${this.config.key}.create`,
|
|
17795
|
+
maxRetries: opts.maxRetries
|
|
17788
17796
|
});
|
|
17789
17797
|
return this.unwrapCreateOperation(res, body, opts);
|
|
17790
17798
|
}
|
|
@@ -17792,7 +17800,7 @@ var BaseResource = class {
|
|
|
17792
17800
|
* Swagger documents put+patch on the scoped collection and has NO put/patch on
|
|
17793
17801
|
* the item path anywhere in the spec; the node strips the id from the path and
|
|
17794
17802
|
* PATCHes the collection, and the vendor keys the record by the id in the body. */
|
|
17795
|
-
async updateScopedRaw(parentId, id, data) {
|
|
17803
|
+
async updateScopedRaw(parentId, id, data, opts = {}) {
|
|
17796
17804
|
const numeric = parseIdentifier(id, "id");
|
|
17797
17805
|
const body = this.normalizeMutationBody(data);
|
|
17798
17806
|
body.id = numeric;
|
|
@@ -17804,12 +17812,13 @@ var BaseResource = class {
|
|
|
17804
17812
|
method: "PATCH",
|
|
17805
17813
|
path,
|
|
17806
17814
|
body,
|
|
17807
|
-
operation
|
|
17815
|
+
operation,
|
|
17816
|
+
maxRetries: opts.maxRetries
|
|
17808
17817
|
});
|
|
17809
17818
|
} catch (err) {
|
|
17810
17819
|
if (!this.putFallbackEligible(err)) throw err;
|
|
17811
17820
|
const merged = await this.putFallbackMergedBody(
|
|
17812
|
-
() => this.getScopedUnredacted(parentId, numeric),
|
|
17821
|
+
() => this.getScopedUnredacted(parentId, numeric, { maxRetries: opts.maxRetries }),
|
|
17813
17822
|
body,
|
|
17814
17823
|
numeric
|
|
17815
17824
|
);
|
|
@@ -17819,7 +17828,8 @@ var BaseResource = class {
|
|
|
17819
17828
|
method: "PUT",
|
|
17820
17829
|
path: `${path}/${numeric}`,
|
|
17821
17830
|
body: merged,
|
|
17822
|
-
operation
|
|
17831
|
+
operation,
|
|
17832
|
+
maxRetries: opts.maxRetries
|
|
17823
17833
|
});
|
|
17824
17834
|
} catch (rerr) {
|
|
17825
17835
|
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, `PUT ${path}/${numeric}`, true);
|
|
@@ -17831,12 +17841,13 @@ var BaseResource = class {
|
|
|
17831
17841
|
}
|
|
17832
17842
|
/** Parent-scoped delete: `DELETE .../{parentId}/<Child>/{id}` → `{ id }`
|
|
17833
17843
|
* (a blank 2xx synthesizes `{ id }` from the path id — issue #25). */
|
|
17834
|
-
async deleteScopedRaw(parentId, id) {
|
|
17844
|
+
async deleteScopedRaw(parentId, id, opts = {}) {
|
|
17835
17845
|
const numeric = parseIdentifier(id, "id");
|
|
17836
17846
|
const res = await this.http.request({
|
|
17837
17847
|
method: "DELETE",
|
|
17838
17848
|
path: this.scopedItemPath(parentId, id),
|
|
17839
|
-
operation: `${this.config.key}.delete
|
|
17849
|
+
operation: `${this.config.key}.delete`,
|
|
17850
|
+
maxRetries: opts.maxRetries
|
|
17840
17851
|
});
|
|
17841
17852
|
return res === void 0 ? { id: numeric } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
17842
17853
|
}
|
|
@@ -17844,12 +17855,13 @@ var BaseResource = class {
|
|
|
17844
17855
|
* Attachment delete: the vendor returns the deleted attachment MODEL, not
|
|
17845
17856
|
* OperationResultModel (G1 envelope.md) — pass it through typed.
|
|
17846
17857
|
*/
|
|
17847
|
-
async deleteScopedModel(parentId, id) {
|
|
17858
|
+
async deleteScopedModel(parentId, id, opts = {}) {
|
|
17848
17859
|
const numeric = parseIdentifier(id, "id");
|
|
17849
17860
|
const res = await this.http.request({
|
|
17850
17861
|
method: "DELETE",
|
|
17851
17862
|
path: this.scopedItemPath(parentId, id),
|
|
17852
|
-
operation: `${this.config.key}.delete
|
|
17863
|
+
operation: `${this.config.key}.delete`,
|
|
17864
|
+
maxRetries: opts.maxRetries
|
|
17853
17865
|
});
|
|
17854
17866
|
if (res === void 0) return {};
|
|
17855
17867
|
if (!isRecord2(res)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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; var _class5; var _class6;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEWMG3HHUcjs = require('./chunk-EWMG3HHU.cjs');
|
|
4
4
|
|
|
5
5
|
// src/auth.ts
|
|
6
6
|
var AUTH_HEADERS = {
|
|
@@ -15188,6 +15188,7 @@ var HttpClient = (_class6 = class {
|
|
|
15188
15188
|
);
|
|
15189
15189
|
const auditBody = opts.body !== void 0 ? redactAuditBody(opts.body) : void 0;
|
|
15190
15190
|
const retriable = _nullishCoalesce(opts.idempotent, () => ( IDEMPOTENT_METHODS.includes(method)));
|
|
15191
|
+
const retriable5xx = _nullishCoalesce(opts.idempotent, () => ( method === "GET"));
|
|
15191
15192
|
const expectBody = _nullishCoalesce(opts.expectBody, () => ( method !== "DELETE"));
|
|
15192
15193
|
const ctx = { operation: opts.operation, url, correlationId };
|
|
15193
15194
|
let lastStatus;
|
|
@@ -15313,7 +15314,7 @@ var HttpClient = (_class6 = class {
|
|
|
15313
15314
|
this.release();
|
|
15314
15315
|
if (signal.aborted || isAbortLike(err2)) throw interrupted();
|
|
15315
15316
|
const delay = backoffDelay(attempt);
|
|
15316
|
-
if (attempt < maxRetries &&
|
|
15317
|
+
if (attempt < maxRetries && retriable5xx && canWait(delay)) {
|
|
15317
15318
|
_optionalChain([this, 'access', _86 => _86.logger, 'access', _87 => _87.warn, 'optionalCall', _88 => _88(
|
|
15318
15319
|
`[autotask] network error on ${method} ${opts.path}; retrying in ${delay}ms (attempt ${attempt + 1}/${maxRetries})`,
|
|
15319
15320
|
correlationId
|
|
@@ -15425,7 +15426,7 @@ var HttpClient = (_class6 = class {
|
|
|
15425
15426
|
}
|
|
15426
15427
|
const deterministic500 = status >= 500 && isDeterministicVendor500(parseVendorErrors(body));
|
|
15427
15428
|
const retryableStatus = status === 429 || status >= 500;
|
|
15428
|
-
if (retryableStatus && !deterministic500 && attempt < maxRetries && retriable) {
|
|
15429
|
+
if (retryableStatus && !deterministic500 && attempt < maxRetries && (status === 429 ? retriable : retriable5xx)) {
|
|
15429
15430
|
const retryAfter = parseRetryAfter(res.headers.get("Retry-After"));
|
|
15430
15431
|
const delay = retryAfter !== void 0 ? retryAfter * 1e3 : backoffDelay(attempt);
|
|
15431
15432
|
if (canWait(delay)) {
|
|
@@ -15929,7 +15930,7 @@ function capabilitySets() {
|
|
|
15929
15930
|
const fieldOps = /* @__PURE__ */ new Map();
|
|
15930
15931
|
const udfOps = /* @__PURE__ */ new Map();
|
|
15931
15932
|
const resources = /* @__PURE__ */ new Set();
|
|
15932
|
-
for (const rec of
|
|
15933
|
+
for (const rec of _chunkEWMG3HHUcjs.CAPABILITIES) {
|
|
15933
15934
|
if (rec.resource === "operations") continue;
|
|
15934
15935
|
resources.add(rec.resource);
|
|
15935
15936
|
if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
|
|
@@ -17458,13 +17459,14 @@ var BaseResource = class {
|
|
|
17458
17459
|
* see the live record, and an unredacted body must not enter the
|
|
17459
17460
|
* (redacted-view) read cache.
|
|
17460
17461
|
*/
|
|
17461
|
-
async getGlobalUnredacted(id) {
|
|
17462
|
+
async getGlobalUnredacted(id, readOpts) {
|
|
17462
17463
|
const numeric = parseIdentifier(id, "id");
|
|
17463
17464
|
const res = await this.http.request({
|
|
17464
17465
|
method: "GET",
|
|
17465
17466
|
path: `${this.resourcePath}/${numeric}`,
|
|
17466
17467
|
operation: `${this.config.key}.get`,
|
|
17467
|
-
skipResponseRedaction: true
|
|
17468
|
+
skipResponseRedaction: true,
|
|
17469
|
+
maxRetries: _optionalChain([readOpts, 'optionalAccess', _167 => _167.maxRetries])
|
|
17468
17470
|
});
|
|
17469
17471
|
return unwrapItem(res, numeric, `${this.config.key}.get`);
|
|
17470
17472
|
}
|
|
@@ -17476,13 +17478,14 @@ var BaseResource = class {
|
|
|
17476
17478
|
* record's own current values: a redacted read would write literal
|
|
17477
17479
|
* '[REDACTED]' markers into the fallback PUT (corruption on live records).
|
|
17478
17480
|
*/
|
|
17479
|
-
async getScopedUnredacted(parentId, id) {
|
|
17481
|
+
async getScopedUnredacted(parentId, id, readOpts) {
|
|
17480
17482
|
const numeric = parseIdentifier(id, "id");
|
|
17481
17483
|
const res = await this.http.request({
|
|
17482
17484
|
method: "GET",
|
|
17483
17485
|
path: this.scopedItemPath(parentId, numeric),
|
|
17484
17486
|
operation: `${this.config.key}.get`,
|
|
17485
|
-
skipResponseRedaction: true
|
|
17487
|
+
skipResponseRedaction: true,
|
|
17488
|
+
maxRetries: _optionalChain([readOpts, 'optionalAccess', _168 => _168.maxRetries])
|
|
17486
17489
|
});
|
|
17487
17490
|
return unwrapItem(res, numeric, `${this.config.key}.get`);
|
|
17488
17491
|
}
|
|
@@ -17544,7 +17547,8 @@ var BaseResource = class {
|
|
|
17544
17547
|
method: "POST",
|
|
17545
17548
|
path: this.resourcePath,
|
|
17546
17549
|
body,
|
|
17547
|
-
operation: `${this.config.key}.create
|
|
17550
|
+
operation: `${this.config.key}.create`,
|
|
17551
|
+
maxRetries: opts.maxRetries
|
|
17548
17552
|
});
|
|
17549
17553
|
return this.unwrapCreateOperation(res, body, opts);
|
|
17550
17554
|
}
|
|
@@ -17707,7 +17711,7 @@ var BaseResource = class {
|
|
|
17707
17711
|
if (opts.raw !== true) {
|
|
17708
17712
|
let current;
|
|
17709
17713
|
try {
|
|
17710
|
-
current = await this.getGlobalUnredacted(numeric);
|
|
17714
|
+
current = await this.getGlobalUnredacted(numeric, { maxRetries: opts.maxRetries });
|
|
17711
17715
|
} catch (err) {
|
|
17712
17716
|
if (err instanceof NotFoundError) attachUpdateTargetMissReason(err, this.config.key);
|
|
17713
17717
|
throw err;
|
|
@@ -17726,7 +17730,8 @@ var BaseResource = class {
|
|
|
17726
17730
|
method: "PUT",
|
|
17727
17731
|
path: collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric}`,
|
|
17728
17732
|
body,
|
|
17729
|
-
operation
|
|
17733
|
+
operation,
|
|
17734
|
+
maxRetries: opts.maxRetries
|
|
17730
17735
|
});
|
|
17731
17736
|
} catch (err) {
|
|
17732
17737
|
if (!this.putFallbackEligible(err)) throw err;
|
|
@@ -17734,7 +17739,7 @@ var BaseResource = class {
|
|
|
17734
17739
|
throw this.putFallbackDeclined(err, route, false);
|
|
17735
17740
|
}
|
|
17736
17741
|
const merged = await this.putFallbackMergedBody(
|
|
17737
|
-
() => this.getGlobalUnredacted(numeric),
|
|
17742
|
+
() => this.getGlobalUnredacted(numeric, { maxRetries: opts.maxRetries }),
|
|
17738
17743
|
body,
|
|
17739
17744
|
numeric
|
|
17740
17745
|
);
|
|
@@ -17744,7 +17749,8 @@ var BaseResource = class {
|
|
|
17744
17749
|
method: "PUT",
|
|
17745
17750
|
path: `${this.resourcePath}/${numeric}`,
|
|
17746
17751
|
body: merged,
|
|
17747
|
-
operation
|
|
17752
|
+
operation,
|
|
17753
|
+
maxRetries: opts.maxRetries
|
|
17748
17754
|
});
|
|
17749
17755
|
} catch (rerr) {
|
|
17750
17756
|
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, route, true);
|
|
@@ -17758,12 +17764,13 @@ var BaseResource = class {
|
|
|
17758
17764
|
* (204 / empty body) is a valid vendor delete answer — synthesize the
|
|
17759
17765
|
* result from the path id (issue #25: the transport returns undefined
|
|
17760
17766
|
* for it; a non-blank wrong shape still throws via unwrapOperation). */
|
|
17761
|
-
async deleteGlobal(id) {
|
|
17767
|
+
async deleteGlobal(id, opts = {}) {
|
|
17762
17768
|
const numeric = parseIdentifier(id, "id");
|
|
17763
17769
|
const res = await this.http.request({
|
|
17764
17770
|
method: "DELETE",
|
|
17765
17771
|
path: `${this.resourcePath}/${numeric}`,
|
|
17766
|
-
operation: `${this.config.key}.delete
|
|
17772
|
+
operation: `${this.config.key}.delete`,
|
|
17773
|
+
maxRetries: opts.maxRetries
|
|
17767
17774
|
});
|
|
17768
17775
|
return res === void 0 ? { id: numeric } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
17769
17776
|
}
|
|
@@ -17784,7 +17791,8 @@ var BaseResource = class {
|
|
|
17784
17791
|
method: "POST",
|
|
17785
17792
|
path: this.scopedCollectionPath(parentId),
|
|
17786
17793
|
body,
|
|
17787
|
-
operation: `${this.config.key}.create
|
|
17794
|
+
operation: `${this.config.key}.create`,
|
|
17795
|
+
maxRetries: opts.maxRetries
|
|
17788
17796
|
});
|
|
17789
17797
|
return this.unwrapCreateOperation(res, body, opts);
|
|
17790
17798
|
}
|
|
@@ -17792,7 +17800,7 @@ var BaseResource = class {
|
|
|
17792
17800
|
* Swagger documents put+patch on the scoped collection and has NO put/patch on
|
|
17793
17801
|
* the item path anywhere in the spec; the node strips the id from the path and
|
|
17794
17802
|
* PATCHes the collection, and the vendor keys the record by the id in the body. */
|
|
17795
|
-
async updateScopedRaw(parentId, id, data) {
|
|
17803
|
+
async updateScopedRaw(parentId, id, data, opts = {}) {
|
|
17796
17804
|
const numeric = parseIdentifier(id, "id");
|
|
17797
17805
|
const body = this.normalizeMutationBody(data);
|
|
17798
17806
|
body.id = numeric;
|
|
@@ -17804,12 +17812,13 @@ var BaseResource = class {
|
|
|
17804
17812
|
method: "PATCH",
|
|
17805
17813
|
path,
|
|
17806
17814
|
body,
|
|
17807
|
-
operation
|
|
17815
|
+
operation,
|
|
17816
|
+
maxRetries: opts.maxRetries
|
|
17808
17817
|
});
|
|
17809
17818
|
} catch (err) {
|
|
17810
17819
|
if (!this.putFallbackEligible(err)) throw err;
|
|
17811
17820
|
const merged = await this.putFallbackMergedBody(
|
|
17812
|
-
() => this.getScopedUnredacted(parentId, numeric),
|
|
17821
|
+
() => this.getScopedUnredacted(parentId, numeric, { maxRetries: opts.maxRetries }),
|
|
17813
17822
|
body,
|
|
17814
17823
|
numeric
|
|
17815
17824
|
);
|
|
@@ -17819,7 +17828,8 @@ var BaseResource = class {
|
|
|
17819
17828
|
method: "PUT",
|
|
17820
17829
|
path: `${path}/${numeric}`,
|
|
17821
17830
|
body: merged,
|
|
17822
|
-
operation
|
|
17831
|
+
operation,
|
|
17832
|
+
maxRetries: opts.maxRetries
|
|
17823
17833
|
});
|
|
17824
17834
|
} catch (rerr) {
|
|
17825
17835
|
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, `PUT ${path}/${numeric}`, true);
|
|
@@ -17831,12 +17841,13 @@ var BaseResource = class {
|
|
|
17831
17841
|
}
|
|
17832
17842
|
/** Parent-scoped delete: `DELETE .../{parentId}/<Child>/{id}` → `{ id }`
|
|
17833
17843
|
* (a blank 2xx synthesizes `{ id }` from the path id — issue #25). */
|
|
17834
|
-
async deleteScopedRaw(parentId, id) {
|
|
17844
|
+
async deleteScopedRaw(parentId, id, opts = {}) {
|
|
17835
17845
|
const numeric = parseIdentifier(id, "id");
|
|
17836
17846
|
const res = await this.http.request({
|
|
17837
17847
|
method: "DELETE",
|
|
17838
17848
|
path: this.scopedItemPath(parentId, id),
|
|
17839
|
-
operation: `${this.config.key}.delete
|
|
17849
|
+
operation: `${this.config.key}.delete`,
|
|
17850
|
+
maxRetries: opts.maxRetries
|
|
17840
17851
|
});
|
|
17841
17852
|
return res === void 0 ? { id: numeric } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
17842
17853
|
}
|
|
@@ -17844,12 +17855,13 @@ var BaseResource = class {
|
|
|
17844
17855
|
* Attachment delete: the vendor returns the deleted attachment MODEL, not
|
|
17845
17856
|
* OperationResultModel (G1 envelope.md) — pass it through typed.
|
|
17846
17857
|
*/
|
|
17847
|
-
async deleteScopedModel(parentId, id) {
|
|
17858
|
+
async deleteScopedModel(parentId, id, opts = {}) {
|
|
17848
17859
|
const numeric = parseIdentifier(id, "id");
|
|
17849
17860
|
const res = await this.http.request({
|
|
17850
17861
|
method: "DELETE",
|
|
17851
17862
|
path: this.scopedItemPath(parentId, id),
|
|
17852
|
-
operation: `${this.config.key}.delete
|
|
17863
|
+
operation: `${this.config.key}.delete`,
|
|
17864
|
+
maxRetries: opts.maxRetries
|
|
17853
17865
|
});
|
|
17854
17866
|
if (res === void 0) return {};
|
|
17855
17867
|
if (!isRecord2(res)) {
|
|
@@ -18132,7 +18144,7 @@ var BaseResource = class {
|
|
|
18132
18144
|
current = parentId === void 0 ? await this.getGlobal(id, true) : this.config.attachmentGet ? await this.getScopedModel(parentId, id, true) : await this.getScopedRaw(parentId, id, true);
|
|
18133
18145
|
} catch (err) {
|
|
18134
18146
|
if (err instanceof NotFoundError) {
|
|
18135
|
-
const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access',
|
|
18147
|
+
const updateReason = _optionalChain([EMPTY_REASON_STAMPS, 'access', _169 => _169[this.config.key], 'optionalAccess', _170 => _170.update]);
|
|
18136
18148
|
checks.push({
|
|
18137
18149
|
name: "current-record-exists",
|
|
18138
18150
|
ok: false,
|
|
@@ -18290,12 +18302,12 @@ var BaseResource = class {
|
|
|
18290
18302
|
return null;
|
|
18291
18303
|
}
|
|
18292
18304
|
}
|
|
18293
|
-
const epoch = _optionalChain([cache, 'optionalAccess',
|
|
18305
|
+
const epoch = _optionalChain([cache, 'optionalAccess', _171 => _171.epoch]);
|
|
18294
18306
|
try {
|
|
18295
18307
|
return await this.fetchRecordRaw(entityPath, referenceId);
|
|
18296
18308
|
} catch (err) {
|
|
18297
18309
|
if (err instanceof NotFoundError) {
|
|
18298
|
-
_optionalChain([cache, 'optionalAccess',
|
|
18310
|
+
_optionalChain([cache, 'optionalAccess', _172 => _172.set, 'call', _173 => _173(absentKey, CONTEXT_ABSENT_MARKER, RESOURCE_KEY_BY_PATH[entityPath], epoch)]);
|
|
18299
18311
|
return null;
|
|
18300
18312
|
}
|
|
18301
18313
|
throw err;
|
|
@@ -18411,7 +18423,7 @@ var BaseResource = class {
|
|
|
18411
18423
|
missDetail(operator, fields) {
|
|
18412
18424
|
const key = this.config.key;
|
|
18413
18425
|
const probe = fields.map((field) => ({ field, op: operator, value: "" }));
|
|
18414
|
-
const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access',
|
|
18426
|
+
const blind = blindStampFor(_optionalChain([BLIND_SURFACE_STAMPS, 'access', _174 => _174[key], 'optionalAccess', _175 => _175.query]), probe);
|
|
18415
18427
|
const next = [];
|
|
18416
18428
|
if (blind !== void 0) {
|
|
18417
18429
|
next.push(`This surface is blind to records the API user does not own, so a miss is not proof of absence: ${blind.authority} returns the record when the id is known.`);
|