node-autotask 0.73.0 → 0.74.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/CHANGELOG.md +10 -0
- package/MCP_TOOL_CATALOG.json +175 -9
- package/README.md +1 -1
- package/capabilities.json +532 -7
- package/dist/capabilities-data.js +531 -6
- package/dist/capabilities.cjs +4 -4
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-CWSXFVF2.cjs → chunk-AMB54GOO.cjs} +244 -86
- package/dist/{chunk-VHNWLON6.cjs → chunk-ASL3BIW2.cjs} +3 -3
- package/dist/{chunk-CKIKNZEB.cjs → chunk-DSQJTGXK.cjs} +31 -30
- package/dist/{chunk-VHN5B7OQ.js → chunk-HJKY7LUL.js} +239 -81
- package/dist/{chunk-RFH4VBMX.js → chunk-IFE5FWS7.js} +9 -7
- package/dist/{chunk-PNMEXWYR.js → chunk-IWTTCBCS.js} +3 -3
- package/dist/{chunk-L4J5EDCU.js → chunk-PGSDJS52.js} +3 -2
- package/dist/{chunk-STUQU7AX.cjs → chunk-QZY5LAOG.cjs} +206 -204
- package/dist/{index-CGp16Cdm.d.cts → index-CH65Ftmy.d.cts} +30 -1
- package/dist/{index-CGp16Cdm.d.ts → index-CH65Ftmy.d.ts} +30 -1
- package/dist/{index-MUM-uBX1.d.cts → index-CkBDlaSS.d.cts} +4 -2
- package/dist/{index-Dv8d9p_J.d.ts → index-ColCzIyw.d.ts} +4 -2
- package/dist/index.cjs +84 -84
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/operations/index.cjs +51 -51
- package/dist/operations/index.d.cts +4 -4
- package/dist/operations/index.d.ts +4 -4
- package/dist/operations/index.js +2 -2
- package/dist/pool.cjs +12 -12
- 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 +27 -27
- package/dist/resources/index.d.cts +2 -2
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +3 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/docs/API.md +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkASL3BIW2_cjs = require('./chunk-ASL3BIW2.cjs');
|
|
4
4
|
var chunkBD4AUGCJ_cjs = require('./chunk-BD4AUGCJ.cjs');
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var async_hooks = require('async_hooks');
|
|
@@ -6217,6 +6217,22 @@ var RELATIONSHIP_MAP = {
|
|
|
6217
6217
|
"delete": false
|
|
6218
6218
|
}
|
|
6219
6219
|
},
|
|
6220
|
+
{
|
|
6221
|
+
"resource": "task_predecessors",
|
|
6222
|
+
"apiEntity": "TaskPredecessor",
|
|
6223
|
+
"parentField": "successorTaskID",
|
|
6224
|
+
"parentSegment": "Predecessors",
|
|
6225
|
+
"tier": "extended",
|
|
6226
|
+
"workflowResource": false,
|
|
6227
|
+
"specialOps": [],
|
|
6228
|
+
"searchCovers": null,
|
|
6229
|
+
"scopedOps": {
|
|
6230
|
+
"create": true,
|
|
6231
|
+
"query": true,
|
|
6232
|
+
"update": true,
|
|
6233
|
+
"delete": true
|
|
6234
|
+
}
|
|
6235
|
+
},
|
|
6220
6236
|
{
|
|
6221
6237
|
"resource": "task_secondary_resources",
|
|
6222
6238
|
"apiEntity": "TaskSecondaryResource",
|
|
@@ -9775,6 +9791,50 @@ var RELATIONSHIP_MAP = {
|
|
|
9775
9791
|
"proof": "spec-derived"
|
|
9776
9792
|
},
|
|
9777
9793
|
"markerField": "title"
|
|
9794
|
+
},
|
|
9795
|
+
"task_predecessors": {
|
|
9796
|
+
"resource": "task_predecessors",
|
|
9797
|
+
"apiEntity": "TaskPredecessor",
|
|
9798
|
+
"kind": "entity",
|
|
9799
|
+
"path": "TaskPredecessors",
|
|
9800
|
+
"parentScoped": true,
|
|
9801
|
+
"tier": "extended",
|
|
9802
|
+
"workflowResource": false,
|
|
9803
|
+
"group": "A",
|
|
9804
|
+
"parent": {
|
|
9805
|
+
"resource": "tasks",
|
|
9806
|
+
"segment": "Predecessors",
|
|
9807
|
+
"field": "successorTaskID"
|
|
9808
|
+
},
|
|
9809
|
+
"children": [],
|
|
9810
|
+
"naturalKeys": {
|
|
9811
|
+
"hasSearch": false,
|
|
9812
|
+
"searchCovers": null,
|
|
9813
|
+
"findBy": []
|
|
9814
|
+
},
|
|
9815
|
+
"blindSurfaces": null,
|
|
9816
|
+
"zoneFacts": {
|
|
9817
|
+
"createGuidance": {
|
|
9818
|
+
"createOp": "task_predecessors.create",
|
|
9819
|
+
"parentScoped": true,
|
|
9820
|
+
"liveProvenPrefix": [],
|
|
9821
|
+
"unproven": true,
|
|
9822
|
+
"blocker": {
|
|
9823
|
+
"kind": "unknown",
|
|
9824
|
+
"message": "TaskPredecessors mutations are not verified; module, task permissions and project state can restrict them.",
|
|
9825
|
+
"remedy": "Use preview and verify both task references; baseline relationships are read-only and predecessor phases are unsupported."
|
|
9826
|
+
},
|
|
9827
|
+
"vendorEvidence": [
|
|
9828
|
+
"https://autotask.net/help/developerhelp/Content/APIs/REST/Entities/TaskPredecessorsEntity.htm"
|
|
9829
|
+
],
|
|
9830
|
+
"deleteBoundary": {
|
|
9831
|
+
"available": true,
|
|
9832
|
+
"note": null
|
|
9833
|
+
}
|
|
9834
|
+
}
|
|
9835
|
+
},
|
|
9836
|
+
"deleteBoundary": null,
|
|
9837
|
+
"markerField": null
|
|
9778
9838
|
}
|
|
9779
9839
|
};
|
|
9780
9840
|
var BLIND_SURFACE_STAMPS = {
|
|
@@ -13351,6 +13411,25 @@ var CREATE_GUIDANCE = {
|
|
|
13351
13411
|
"note": "The vendor defines no DELETE for task_notes (spec-derived); a created task note cannot be removed through the public API."
|
|
13352
13412
|
}
|
|
13353
13413
|
},
|
|
13414
|
+
{
|
|
13415
|
+
"resource": "task_predecessors",
|
|
13416
|
+
"createOp": "task_predecessors.create",
|
|
13417
|
+
"parentScoped": true,
|
|
13418
|
+
"liveProvenPrefix": [],
|
|
13419
|
+
"unproven": true,
|
|
13420
|
+
"blocker": {
|
|
13421
|
+
"kind": "unknown",
|
|
13422
|
+
"message": "TaskPredecessors mutations are not verified; module, task permissions and project state can restrict them.",
|
|
13423
|
+
"remedy": "Use preview and verify both task references; baseline relationships are read-only and predecessor phases are unsupported."
|
|
13424
|
+
},
|
|
13425
|
+
"vendorEvidence": [
|
|
13426
|
+
"https://autotask.net/help/developerhelp/Content/APIs/REST/Entities/TaskPredecessorsEntity.htm"
|
|
13427
|
+
],
|
|
13428
|
+
"deleteBoundary": {
|
|
13429
|
+
"available": true,
|
|
13430
|
+
"note": null
|
|
13431
|
+
}
|
|
13432
|
+
},
|
|
13354
13433
|
{
|
|
13355
13434
|
"resource": "task_secondary_resources",
|
|
13356
13435
|
"createOp": "task_secondary_resources.create",
|
|
@@ -13906,7 +13985,7 @@ var CREATE_GUIDANCE = {
|
|
|
13906
13985
|
}
|
|
13907
13986
|
],
|
|
13908
13987
|
"counts": {
|
|
13909
|
-
"total":
|
|
13988
|
+
"total": 104,
|
|
13910
13989
|
"byKind": {
|
|
13911
13990
|
"ok": 41,
|
|
13912
13991
|
"blind-reference": 16,
|
|
@@ -13916,7 +13995,7 @@ var CREATE_GUIDANCE = {
|
|
|
13916
13995
|
"resource-role-pair": 2,
|
|
13917
13996
|
"delete-absent": 0,
|
|
13918
13997
|
"non-mutable": 0,
|
|
13919
|
-
"unknown":
|
|
13998
|
+
"unknown": 28
|
|
13920
13999
|
}
|
|
13921
14000
|
}
|
|
13922
14001
|
};
|
|
@@ -16448,13 +16527,13 @@ async function runBounded(fn, items, opts) {
|
|
|
16448
16527
|
const results = new Array(items.length);
|
|
16449
16528
|
let next = 0;
|
|
16450
16529
|
let failure;
|
|
16451
|
-
const
|
|
16530
|
+
const fail2 = (error, index) => {
|
|
16452
16531
|
if (failure === void 0 || opts.orderedErrors === true && index < failure.index) failure = { error, index };
|
|
16453
16532
|
};
|
|
16454
16533
|
const worker = async () => {
|
|
16455
16534
|
while (failure === void 0 && next < items.length) {
|
|
16456
16535
|
if (signal?.aborted) {
|
|
16457
|
-
|
|
16536
|
+
fail2(signal.reason, -1);
|
|
16458
16537
|
return;
|
|
16459
16538
|
}
|
|
16460
16539
|
const i = next++;
|
|
@@ -16464,7 +16543,7 @@ async function runBounded(fn, items, opts) {
|
|
|
16464
16543
|
results[i] = settle ? { status: "fulfilled", value } : value;
|
|
16465
16544
|
} catch (error) {
|
|
16466
16545
|
if (settle) results[i] = { status: "rejected", reason: error };
|
|
16467
|
-
else
|
|
16546
|
+
else fail2(error, i);
|
|
16468
16547
|
}
|
|
16469
16548
|
}
|
|
16470
16549
|
};
|
|
@@ -16520,7 +16599,7 @@ async function capabilitySets() {
|
|
|
16520
16599
|
const fieldOps = /* @__PURE__ */ new Map();
|
|
16521
16600
|
const udfCapable = /* @__PURE__ */ new Set();
|
|
16522
16601
|
const resources = /* @__PURE__ */ new Set();
|
|
16523
|
-
for (const rec of await
|
|
16602
|
+
for (const rec of await chunkASL3BIW2_cjs.loadCapabilityRecords()) {
|
|
16524
16603
|
if (rec.resource === "operations") continue;
|
|
16525
16604
|
resources.add(rec.resource);
|
|
16526
16605
|
if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
|
|
@@ -16531,7 +16610,7 @@ async function capabilitySets() {
|
|
|
16531
16610
|
var derivedIndexPromise = null;
|
|
16532
16611
|
function derivedIndexLoad() {
|
|
16533
16612
|
if (derivedIndexPromise === null) {
|
|
16534
|
-
derivedIndexPromise =
|
|
16613
|
+
derivedIndexPromise = chunkASL3BIW2_cjs.loadCapabilityRecords().then((records) => {
|
|
16535
16614
|
const index = /* @__PURE__ */ new Map();
|
|
16536
16615
|
for (const rec of records) {
|
|
16537
16616
|
const declared = rec.metadata?.derivedFields;
|
|
@@ -17741,6 +17820,7 @@ var MODEL_FIELD_SETS = {
|
|
|
17741
17820
|
"tag_groups": ["id", "displayColor", "isActive", "isSystem", "label"],
|
|
17742
17821
|
"tags": ["id", "createDateTime", "isActive", "isExcludedFromAutomaticTagging", "isSystem", "label", "lastModifiedDateTime", "tagGroupID"],
|
|
17743
17822
|
"task_notes": ["id", "createDateTime", "creatorResourceID", "createdByContactID", "description", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastActivityDate", "noteType", "publish", "taskID", "title", "soapParentPropertyId"],
|
|
17823
|
+
"task_predecessors": ["id", "lagDays", "predecessorTaskID", "successorTaskID", "soapParentPropertyId"],
|
|
17744
17824
|
"task_secondary_resources": ["id", "resourceID", "roleID", "taskID", "soapParentPropertyId"],
|
|
17745
17825
|
"tasks": ["id", "assignedResourceID", "assignedResourceRoleID", "billingCodeID", "canClientPortalUserCompleteTask", "companyLocationID", "completedByResourceID", "completedByType", "completedDateTime", "createDateTime", "creatorResourceID", "creatorType", "departmentID", "description", "endDateTime", "estimatedHours", "externalID", "hoursToBeScheduled", "isTaskBillable", "isVisibleInClientPortal", "lastActivityDateTime", "lastActivityPersonType", "lastActivityResourceID", "phaseID", "priority", "priorityLabel", "projectID", "purchaseOrderNumber", "remainingHours", "startDateTime", "status", "taskCategoryID", "taskNumber", "taskType", "title", "soapParentPropertyId", "userDefinedFields"],
|
|
17746
17826
|
"tax_regions": ["id", "isActive", "name"],
|
|
@@ -17909,21 +17989,21 @@ function validateRelationLeaves(resourceKey, conditions, op) {
|
|
|
17909
17989
|
assertUndottedUdfField(c, op);
|
|
17910
17990
|
const field = c.field;
|
|
17911
17991
|
const [rel, sub, ...rest] = field.split(".");
|
|
17912
|
-
const
|
|
17992
|
+
const fail2 = (why) => {
|
|
17913
17993
|
throw new AutotaskConfigError(`${op}: relation filter "${field}" ${why} \u2014 the request was not issued`, {
|
|
17914
17994
|
operation: op,
|
|
17915
17995
|
suggestedAction: valid.length > 0 ? `Use ${valid.map((r) => `${r}.<${RELATION_TARGETS[r].resource} field>`).join(" or ")} (one hop; field names from operations.fieldCatalog).` : `${resourceKey} has no relation filters; filter on its own fields.`
|
|
17916
17996
|
});
|
|
17917
17997
|
};
|
|
17918
17998
|
if (selfPrefixes(resourceKey).includes(rel)) {
|
|
17919
|
-
if (rest.length > 0 || !sub)
|
|
17999
|
+
if (rest.length > 0 || !sub) fail2("is not <resource>.<field> (multi-hop relations are not supported)");
|
|
17920
18000
|
continue;
|
|
17921
18001
|
}
|
|
17922
|
-
if (rest.length > 0 || !sub)
|
|
17923
|
-
if (!valid.includes(rel))
|
|
18002
|
+
if (rest.length > 0 || !sub) fail2("is not <relation>.<field> (multi-hop relations are not supported)");
|
|
18003
|
+
if (!valid.includes(rel)) fail2(`names an unknown relation for ${resourceKey} (valid: ${valid.join(", ") || "none"})`);
|
|
17924
18004
|
const parentFields = MODEL_FIELD_SETS[RELATION_TARGETS[rel].resource];
|
|
17925
18005
|
if (parentFields !== void 0 && modelFieldLookup(RELATION_TARGETS[rel].resource)?.(sub) !== true) {
|
|
17926
|
-
|
|
18006
|
+
fail2(`names a field unknown on ${RELATION_TARGETS[rel].resource}`);
|
|
17927
18007
|
}
|
|
17928
18008
|
}
|
|
17929
18009
|
};
|
|
@@ -18769,9 +18849,9 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
18769
18849
|
}
|
|
18770
18850
|
/** `GET /V1.0/<E>/{id}` → `{ item }` unwrapped (`item: null` → NotFoundError). */
|
|
18771
18851
|
async getGlobal(id, fresh = false) {
|
|
18772
|
-
const
|
|
18773
|
-
const res = await this.cachedGet(`${this.resourcePath}/${
|
|
18774
|
-
return unwrapItem(res,
|
|
18852
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
18853
|
+
const res = await this.cachedGet(`${this.resourcePath}/${numeric2}`, `${this.config.key}.get`, fresh);
|
|
18854
|
+
return unwrapItem(res, numeric2, `${this.config.key}.get`, this.entityName);
|
|
18775
18855
|
}
|
|
18776
18856
|
/**
|
|
18777
18857
|
* V2 merge read: a FRESH single-record GET that skips response redaction
|
|
@@ -18785,15 +18865,15 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
18785
18865
|
* (redacted-view) read cache.
|
|
18786
18866
|
*/
|
|
18787
18867
|
async getGlobalUnredacted(id, readOpts) {
|
|
18788
|
-
const
|
|
18868
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
18789
18869
|
const res = await this.http.request({
|
|
18790
18870
|
method: "GET",
|
|
18791
|
-
path: `${this.resourcePath}/${
|
|
18871
|
+
path: `${this.resourcePath}/${numeric2}`,
|
|
18792
18872
|
operation: `${this.config.key}.get`,
|
|
18793
18873
|
skipResponseRedaction: true,
|
|
18794
18874
|
maxRetries: readOpts?.maxRetries
|
|
18795
18875
|
});
|
|
18796
|
-
return unwrapItem(res,
|
|
18876
|
+
return unwrapItem(res, numeric2, `${this.config.key}.get`, this.entityName);
|
|
18797
18877
|
}
|
|
18798
18878
|
/**
|
|
18799
18879
|
* Issue #34 fallback merge read: a FRESH parent-scoped single-record GET
|
|
@@ -18804,21 +18884,21 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
18804
18884
|
* '[REDACTED]' markers into the fallback PUT (corruption on live records).
|
|
18805
18885
|
*/
|
|
18806
18886
|
async getScopedUnredacted(parentId, id, readOpts) {
|
|
18807
|
-
const
|
|
18887
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
18808
18888
|
const res = await this.http.request({
|
|
18809
18889
|
method: "GET",
|
|
18810
|
-
path: this.scopedItemPath(parentId,
|
|
18890
|
+
path: this.scopedItemPath(parentId, numeric2),
|
|
18811
18891
|
operation: `${this.config.key}.get`,
|
|
18812
18892
|
skipResponseRedaction: true,
|
|
18813
18893
|
maxRetries: readOpts?.maxRetries
|
|
18814
18894
|
});
|
|
18815
|
-
return unwrapItem(res,
|
|
18895
|
+
return unwrapItem(res, numeric2, `${this.config.key}.get`, this.entityName);
|
|
18816
18896
|
}
|
|
18817
18897
|
/** Parent-scoped `GET .../{parentId}/<Child>/{id}` → `{ item }` unwrapped. */
|
|
18818
18898
|
async getScopedRaw(parentId, id, fresh = false) {
|
|
18819
|
-
const
|
|
18899
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
18820
18900
|
const res = await this.cachedGet(this.scopedItemPath(parentId, id), `${this.config.key}.get`, fresh);
|
|
18821
|
-
return unwrapItem(res,
|
|
18901
|
+
return unwrapItem(res, numeric2, `${this.config.key}.get`, this.entityName);
|
|
18822
18902
|
}
|
|
18823
18903
|
/**
|
|
18824
18904
|
* Attachment single-read: the vendor answers the model DIRECTLY (swagger),
|
|
@@ -18826,9 +18906,9 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
18826
18906
|
* accept all three shapes; empty/null → NotFoundError.
|
|
18827
18907
|
*/
|
|
18828
18908
|
async getScopedModel(parentId, id, fresh = false) {
|
|
18829
|
-
const
|
|
18909
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
18830
18910
|
const res = await this.cachedGet(this.scopedItemPath(parentId, id), `${this.config.key}.get`, fresh);
|
|
18831
|
-
return this.unwrapModelLike(res,
|
|
18911
|
+
return this.unwrapModelLike(res, numeric2, this.entityName);
|
|
18832
18912
|
}
|
|
18833
18913
|
/** @internal */
|
|
18834
18914
|
unwrapModelLike(body, id, entity) {
|
|
@@ -18969,12 +19049,12 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
18969
19049
|
* the composite ROOT of a hot resource (issue #36) must see the live
|
|
18970
19050
|
* record, never a snapshot. */
|
|
18971
19051
|
async fetchRecordRaw(entityPath, id, fresh = false) {
|
|
18972
|
-
const
|
|
18973
|
-
const res = await this.cachedGet(`${entityPath}/${
|
|
19052
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19053
|
+
const res = await this.cachedGet(`${entityPath}/${numeric2}`, `${this.config.key}.fetchRecord`, fresh);
|
|
18974
19054
|
if (this.config.attachmentGet) {
|
|
18975
|
-
return this.unwrapModelLike(res,
|
|
19055
|
+
return this.unwrapModelLike(res, numeric2, entityNameFromPath(entityPath));
|
|
18976
19056
|
}
|
|
18977
|
-
return unwrapItem(res,
|
|
19057
|
+
return unwrapItem(res, numeric2, `${this.config.key}.fetchRecord`, entityNameFromPath(entityPath));
|
|
18978
19058
|
}
|
|
18979
19059
|
/**
|
|
18980
19060
|
* `getContext` part fetch: a single-record read that degrades to `null`
|
|
@@ -19050,12 +19130,12 @@ var MetaBase = class _MetaBase extends QueryBase {
|
|
|
19050
19130
|
* - bare value on an id-only resource → AutotaskConfigError (CONFIG_ERROR).
|
|
19051
19131
|
*/
|
|
19052
19132
|
async resolveDetailed(identifier) {
|
|
19053
|
-
let
|
|
19133
|
+
let numeric2 = null;
|
|
19054
19134
|
if (isIdentifierCandidate(identifier)) {
|
|
19055
|
-
|
|
19135
|
+
numeric2 = parseIdentifier(identifier, "id");
|
|
19056
19136
|
}
|
|
19057
|
-
if (
|
|
19058
|
-
const record = await this.fetchRecordRaw(this.resourcePath,
|
|
19137
|
+
if (numeric2 !== null) {
|
|
19138
|
+
const record = await this.fetchRecordRaw(this.resourcePath, numeric2);
|
|
19059
19139
|
return { value: record, resolutionCost: "direct", scanned: 0, scanTruncated: false };
|
|
19060
19140
|
}
|
|
19061
19141
|
if (typeof identifier !== "string" || identifier.trim() === "") {
|
|
@@ -19483,7 +19563,7 @@ var MutationBase = class extends MetaBase {
|
|
|
19483
19563
|
}
|
|
19484
19564
|
}
|
|
19485
19565
|
async updateGlobal(id, data, opts = {}, method = "PUT") {
|
|
19486
|
-
const
|
|
19566
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19487
19567
|
const operation = `${this.config.key}.update`;
|
|
19488
19568
|
let body = this.normalizeMutationBody(data);
|
|
19489
19569
|
const collectionUpdate = this.config.collectionUpdate === true;
|
|
@@ -19491,7 +19571,7 @@ var MutationBase = class extends MetaBase {
|
|
|
19491
19571
|
if (opts.raw !== true) {
|
|
19492
19572
|
let current;
|
|
19493
19573
|
try {
|
|
19494
|
-
current = await this.getGlobalUnredacted(
|
|
19574
|
+
current = await this.getGlobalUnredacted(numeric2, { maxRetries: opts.maxRetries });
|
|
19495
19575
|
} catch (err) {
|
|
19496
19576
|
if (err instanceof NotFoundError) attachUpdateTargetMissReason(err, this.config.key);
|
|
19497
19577
|
throw err;
|
|
@@ -19499,16 +19579,16 @@ var MutationBase = class extends MetaBase {
|
|
|
19499
19579
|
this.staleObjectCheck(current, opts, operation);
|
|
19500
19580
|
body = mergePartialBody(current, body);
|
|
19501
19581
|
} else {
|
|
19502
|
-
await this.guardStaleBeforeMutation(
|
|
19582
|
+
await this.guardStaleBeforeMutation(numeric2, opts, operation);
|
|
19503
19583
|
}
|
|
19504
|
-
body.id =
|
|
19584
|
+
body.id = numeric2;
|
|
19505
19585
|
}
|
|
19506
|
-
const route = `${method} ${collectionUpdate ? this.resourcePath : `${this.resourcePath}/${
|
|
19586
|
+
const route = `${method} ${collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric2}`}`;
|
|
19507
19587
|
let res;
|
|
19508
19588
|
try {
|
|
19509
19589
|
res = await this.http.request({
|
|
19510
19590
|
method,
|
|
19511
|
-
path: collectionUpdate ? this.resourcePath : `${this.resourcePath}/${
|
|
19591
|
+
path: collectionUpdate ? this.resourcePath : `${this.resourcePath}/${numeric2}`,
|
|
19512
19592
|
body,
|
|
19513
19593
|
operation,
|
|
19514
19594
|
maxRetries: opts.maxRetries
|
|
@@ -19519,15 +19599,15 @@ var MutationBase = class extends MetaBase {
|
|
|
19519
19599
|
throw this.putFallbackDeclined(err, route, false);
|
|
19520
19600
|
}
|
|
19521
19601
|
const merged = await this.putFallbackMergedBody(
|
|
19522
|
-
() => this.getGlobalUnredacted(
|
|
19602
|
+
() => this.getGlobalUnredacted(numeric2, { maxRetries: opts.maxRetries }),
|
|
19523
19603
|
body,
|
|
19524
|
-
|
|
19604
|
+
numeric2
|
|
19525
19605
|
);
|
|
19526
19606
|
let retry;
|
|
19527
19607
|
try {
|
|
19528
19608
|
retry = await this.http.request({
|
|
19529
19609
|
method: "PUT",
|
|
19530
|
-
path: `${this.resourcePath}/${
|
|
19610
|
+
path: `${this.resourcePath}/${numeric2}`,
|
|
19531
19611
|
body: merged,
|
|
19532
19612
|
operation,
|
|
19533
19613
|
maxRetries: opts.maxRetries
|
|
@@ -19536,23 +19616,23 @@ var MutationBase = class extends MetaBase {
|
|
|
19536
19616
|
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, route, true);
|
|
19537
19617
|
throw rerr;
|
|
19538
19618
|
}
|
|
19539
|
-
return this.withPersistedCheck(unwrapOperation(retry, operation), data, opts,
|
|
19619
|
+
return this.withPersistedCheck(unwrapOperation(retry, operation), data, opts, numeric2);
|
|
19540
19620
|
}
|
|
19541
|
-
return this.withPersistedCheck(unwrapOperation(res, operation), data, opts,
|
|
19621
|
+
return this.withPersistedCheck(unwrapOperation(res, operation), data, opts, numeric2);
|
|
19542
19622
|
}
|
|
19543
19623
|
/** `DELETE /V1.0/<E>/{id}` → `{ id }` (OperationResultModel). A blank 2xx
|
|
19544
19624
|
* (204 / empty body) is a valid vendor delete answer — synthesize the
|
|
19545
19625
|
* result from the path id (issue #25: the transport returns undefined
|
|
19546
19626
|
* for it; a non-blank wrong shape still throws via unwrapOperation). */
|
|
19547
19627
|
async deleteGlobal(id, opts = {}) {
|
|
19548
|
-
const
|
|
19628
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19549
19629
|
const res = await this.http.request({
|
|
19550
19630
|
method: "DELETE",
|
|
19551
|
-
path: `${this.resourcePath}/${
|
|
19631
|
+
path: `${this.resourcePath}/${numeric2}`,
|
|
19552
19632
|
operation: `${this.config.key}.delete`,
|
|
19553
19633
|
maxRetries: opts.maxRetries
|
|
19554
19634
|
});
|
|
19555
|
-
return res === void 0 ? { id:
|
|
19635
|
+
return res === void 0 ? { id: numeric2 } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
19556
19636
|
}
|
|
19557
19637
|
/** Parent-scoped create: `POST .../{parentId}/<Child>` (issue #13: a drifted 2xx runs the bounded marker recovery where the plan pins a marker field). */
|
|
19558
19638
|
async createScopedRaw(parentId, data, opts = {}) {
|
|
@@ -19571,9 +19651,9 @@ var MutationBase = class extends MetaBase {
|
|
|
19571
19651
|
* the item path anywhere in the spec; the node strips the id from the path and
|
|
19572
19652
|
* PATCHes the collection, and the vendor keys the record by the id in the body. */
|
|
19573
19653
|
async updateScopedRaw(parentId, id, data, opts = {}) {
|
|
19574
|
-
const
|
|
19654
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19575
19655
|
const body = this.normalizeMutationBody(data);
|
|
19576
|
-
body.id =
|
|
19656
|
+
body.id = numeric2;
|
|
19577
19657
|
const path = this.scopedCollectionPath(parentId);
|
|
19578
19658
|
const operation = `${this.config.key}.update`;
|
|
19579
19659
|
let res;
|
|
@@ -19588,45 +19668,45 @@ var MutationBase = class extends MetaBase {
|
|
|
19588
19668
|
} catch (err) {
|
|
19589
19669
|
if (!this.putFallbackEligible(err)) throw err;
|
|
19590
19670
|
const merged = await this.putFallbackMergedBody(
|
|
19591
|
-
() => this.getScopedUnredacted(parentId,
|
|
19671
|
+
() => this.getScopedUnredacted(parentId, numeric2, { maxRetries: opts.maxRetries }),
|
|
19592
19672
|
body,
|
|
19593
|
-
|
|
19673
|
+
numeric2
|
|
19594
19674
|
);
|
|
19595
19675
|
let retry;
|
|
19596
19676
|
try {
|
|
19597
19677
|
retry = await this.http.request({
|
|
19598
19678
|
method: "PUT",
|
|
19599
|
-
path: `${path}/${
|
|
19679
|
+
path: `${path}/${numeric2}`,
|
|
19600
19680
|
body: merged,
|
|
19601
19681
|
operation,
|
|
19602
19682
|
maxRetries: opts.maxRetries
|
|
19603
19683
|
});
|
|
19604
19684
|
} catch (rerr) {
|
|
19605
|
-
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, `PUT ${path}/${
|
|
19685
|
+
if (this.putFallbackEligible(rerr)) throw this.putFallbackDeclined(rerr, `PUT ${path}/${numeric2}`, true);
|
|
19606
19686
|
throw rerr;
|
|
19607
19687
|
}
|
|
19608
|
-
return this.withPersistedCheck(unwrapOperation(retry, operation), data, opts,
|
|
19688
|
+
return this.withPersistedCheck(unwrapOperation(retry, operation), data, opts, numeric2, parentId);
|
|
19609
19689
|
}
|
|
19610
|
-
return this.withPersistedCheck(unwrapOperation(res, operation), data, opts,
|
|
19690
|
+
return this.withPersistedCheck(unwrapOperation(res, operation), data, opts, numeric2, parentId);
|
|
19611
19691
|
}
|
|
19612
19692
|
/** Parent-scoped delete: `DELETE .../{parentId}/<Child>/{id}` → `{ id }`
|
|
19613
19693
|
* (a blank 2xx synthesizes `{ id }` from the path id — issue #25). */
|
|
19614
19694
|
async deleteScopedRaw(parentId, id, opts = {}) {
|
|
19615
|
-
const
|
|
19695
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19616
19696
|
const res = await this.http.request({
|
|
19617
19697
|
method: "DELETE",
|
|
19618
19698
|
path: this.scopedItemPath(parentId, id),
|
|
19619
19699
|
operation: `${this.config.key}.delete`,
|
|
19620
19700
|
maxRetries: opts.maxRetries
|
|
19621
19701
|
});
|
|
19622
|
-
return res === void 0 ? { id:
|
|
19702
|
+
return res === void 0 ? { id: numeric2 } : unwrapOperation(res, `${this.config.key}.delete`);
|
|
19623
19703
|
}
|
|
19624
19704
|
/**
|
|
19625
19705
|
* Attachment delete: the vendor returns the deleted attachment MODEL, not
|
|
19626
19706
|
* OperationResultModel (G1 envelope.md) — pass it through typed.
|
|
19627
19707
|
*/
|
|
19628
19708
|
async deleteScopedModel(parentId, id, opts = {}) {
|
|
19629
|
-
const
|
|
19709
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
19630
19710
|
const res = await this.http.request({
|
|
19631
19711
|
method: "DELETE",
|
|
19632
19712
|
path: this.scopedItemPath(parentId, id),
|
|
@@ -19636,8 +19716,8 @@ var MutationBase = class extends MetaBase {
|
|
|
19636
19716
|
if (res === void 0) return {};
|
|
19637
19717
|
if (!isRecord2(res)) {
|
|
19638
19718
|
throw new AutotaskError(
|
|
19639
|
-
`Expected the deleted attachment model for ID ${
|
|
19640
|
-
{ code: "INVALID_RESPONSE", category: "server", resourceIds: [
|
|
19719
|
+
`Expected the deleted attachment model for ID ${numeric2}; got a different shape`,
|
|
19720
|
+
{ code: "INVALID_RESPONSE", category: "server", resourceIds: [numeric2], details: { idRefs: [{ entity: this.entityName, id: numeric2 }] } }
|
|
19641
19721
|
);
|
|
19642
19722
|
}
|
|
19643
19723
|
return res;
|
|
@@ -19945,34 +20025,87 @@ var BaseResource = class extends MutationBase {
|
|
|
19945
20025
|
}
|
|
19946
20026
|
};
|
|
19947
20027
|
|
|
20028
|
+
// src/resources/special/taskPredecessors.ts
|
|
20029
|
+
function fail(detail) {
|
|
20030
|
+
throw new AutotaskConfigError(`task_predecessors: ${detail}`);
|
|
20031
|
+
}
|
|
20032
|
+
function numeric(value, field) {
|
|
20033
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0) fail(`${field} must be a positive numeric identifier`);
|
|
20034
|
+
return value;
|
|
20035
|
+
}
|
|
20036
|
+
function predecessorParent(value) {
|
|
20037
|
+
const parent = parseIdentifier(value, "parentId");
|
|
20038
|
+
if (parent === 0) fail("parentId must name a successor task");
|
|
20039
|
+
return parent;
|
|
20040
|
+
}
|
|
20041
|
+
function assertPredecessorBinding(value, parentId, id) {
|
|
20042
|
+
if (!isRecord2(value)) fail("the returned record must establish id and successorTaskID parent");
|
|
20043
|
+
if (String(parseIdentifier(value.id, "record.id")) !== String(parseIdentifier(id, "id")) || String(parseIdentifier(value.successorTaskID, "record.successorTaskID")) !== String(predecessorParent(parentId))) fail("the returned record must match id and successorTaskID parent");
|
|
20044
|
+
}
|
|
20045
|
+
function admitTaskPredecessor(data, parentId, creating) {
|
|
20046
|
+
const parent = predecessorParent(parentId);
|
|
20047
|
+
if (!isRecord2(data) || ![Object.prototype, null].includes(Object.getPrototypeOf(data))) fail("data must be a plain record");
|
|
20048
|
+
const payload = { ...data };
|
|
20049
|
+
const allowed = creating ? ["predecessorTaskID", "successorTaskID", "lagDays"] : ["lagDays"];
|
|
20050
|
+
if (Object.keys(payload).some((key) => !allowed.includes(key))) fail(creating ? "only predecessorTaskID, successorTaskID and lagDays are writable on create" : "only lagDays can be updated");
|
|
20051
|
+
if ((!creating || payload.lagDays !== void 0) && (typeof payload.lagDays !== "number" || !Number.isInteger(payload.lagDays) || payload.lagDays < -2147483648 || payload.lagDays > 2147483647)) fail("lagDays must be an int32 integer");
|
|
20052
|
+
if (creating) {
|
|
20053
|
+
const successor = numeric(payload.successorTaskID, "successorTaskID");
|
|
20054
|
+
const predecessor = numeric(payload.predecessorTaskID, "predecessorTaskID");
|
|
20055
|
+
if (String(successor) !== String(parent)) fail("successorTaskID must match parentId");
|
|
20056
|
+
if (predecessor === successor) fail("predecessorTaskID and successorTaskID must be distinct");
|
|
20057
|
+
}
|
|
20058
|
+
return payload;
|
|
20059
|
+
}
|
|
20060
|
+
async function guardTaskPredecessor(http, parentId, id, data) {
|
|
20061
|
+
const parent = predecessorParent(parentId);
|
|
20062
|
+
let row = data;
|
|
20063
|
+
if (id !== void 0) {
|
|
20064
|
+
const target = parseIdentifier(id, "id");
|
|
20065
|
+
if (target === 0) fail("id must name a predecessor relationship");
|
|
20066
|
+
row = unwrapItem(await http.request({ method: "GET", path: `/V1.0/Tasks/${parent}/Predecessors/${target}`, operation: "task_predecessors.get" }), target, "task_predecessors.get", "task_predecessor");
|
|
20067
|
+
assertPredecessorBinding(row, parent, target);
|
|
20068
|
+
}
|
|
20069
|
+
const predecessor = numeric(row?.predecessorTaskID, "predecessorTaskID");
|
|
20070
|
+
const successor = numeric(row?.successorTaskID, "successorTaskID");
|
|
20071
|
+
if (predecessor === successor) fail("predecessorTaskID and successorTaskID must be distinct");
|
|
20072
|
+
const projects = [];
|
|
20073
|
+
for (const taskId of [predecessor, successor]) {
|
|
20074
|
+
const task = unwrapItem(await http.request({ method: "GET", path: `/V1.0/Tasks/${taskId}`, operation: "tasks.get" }), taskId, "tasks.get", "task");
|
|
20075
|
+
if (String(parseIdentifier(task.id, "task.id")) !== String(taskId)) fail("the returned task must match its requested id");
|
|
20076
|
+
projects.push(numeric(task.projectID, "task.projectID"));
|
|
20077
|
+
}
|
|
20078
|
+
if (projects[0] !== projects[1]) fail("predecessor and successor tasks must belong to the same project");
|
|
20079
|
+
}
|
|
20080
|
+
|
|
19948
20081
|
// src/resources/special/taskNotes.ts
|
|
19949
20082
|
var WRITABLE = /* @__PURE__ */ new Set(["id", "itemId", "createdByContactID", "description", "noteType", "publish", "taskID", "title"]);
|
|
19950
20083
|
function admitTaskNote(data, parentId, creating) {
|
|
19951
20084
|
const parent = parseIdentifier(parentId, "parentId");
|
|
19952
|
-
const
|
|
20085
|
+
const fail2 = (message) => {
|
|
19953
20086
|
throw new AutotaskConfigError(`task_notes: ${message}`);
|
|
19954
20087
|
};
|
|
19955
|
-
if (data === null || typeof data !== "object" || Array.isArray(data))
|
|
20088
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) fail2("data must be a record");
|
|
19956
20089
|
const body = data;
|
|
19957
|
-
for (const key of Object.keys(body)) if (!WRITABLE.has(key))
|
|
20090
|
+
for (const key of Object.keys(body)) if (!WRITABLE.has(key)) fail2(`${key} is not a writable TaskNotes field`);
|
|
19958
20091
|
for (const [field, maximum] of [["description", 3200], ["title", 250]]) {
|
|
19959
20092
|
const value = body[field];
|
|
19960
|
-
if (value !== void 0 && (typeof value !== "string" || value.length > maximum))
|
|
20093
|
+
if (value !== void 0 && (typeof value !== "string" || value.length > maximum)) fail2(`${field} must be a string of at most ${maximum} characters`);
|
|
19961
20094
|
}
|
|
19962
|
-
if (creating && (typeof body.description !== "string" || body.description.trim() === ""))
|
|
20095
|
+
if (creating && (typeof body.description !== "string" || body.description.trim() === "")) fail2("description is required");
|
|
19963
20096
|
for (const field of ["noteType", "publish"]) {
|
|
19964
20097
|
const value = body[field];
|
|
19965
|
-
if ((creating || value !== void 0) && (typeof value !== "number" || !Number.isSafeInteger(value)))
|
|
20098
|
+
if ((creating || value !== void 0) && (typeof value !== "number" || !Number.isSafeInteger(value))) fail2(`${field} must be an integer from the current field metadata`);
|
|
19966
20099
|
}
|
|
19967
|
-
if (creating && body.taskID === void 0)
|
|
20100
|
+
if (creating && body.taskID === void 0) fail2("taskID is required in the create body and must match parentId");
|
|
19968
20101
|
for (const field of ["createdByContactID", "taskID"]) {
|
|
19969
20102
|
if (body[field] !== void 0) {
|
|
19970
|
-
if (typeof body[field] !== "number")
|
|
20103
|
+
if (typeof body[field] !== "number") fail2(`${field} must be a numeric identifier`);
|
|
19971
20104
|
const id = parseIdentifier(body[field], field);
|
|
19972
|
-
if (field === "taskID" && String(id) !== String(parent))
|
|
20105
|
+
if (field === "taskID" && String(id) !== String(parent)) fail2("taskID must match the parentId path argument");
|
|
19973
20106
|
}
|
|
19974
20107
|
}
|
|
19975
|
-
if (!creating && !Object.keys(body).some((key) => key !== "id" && key !== "itemId"))
|
|
20108
|
+
if (!creating && !Object.keys(body).some((key) => key !== "id" && key !== "itemId")) fail2("update must contain a writable field");
|
|
19976
20109
|
}
|
|
19977
20110
|
|
|
19978
20111
|
// src/resources/simple.ts
|
|
@@ -21219,6 +21352,19 @@ var SIMPLE_RESOURCES = [
|
|
|
21219
21352
|
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
21220
21353
|
opForms: { get: "scoped", create: "scoped", update: "scoped" }
|
|
21221
21354
|
},
|
|
21355
|
+
{
|
|
21356
|
+
key: "task_predecessors",
|
|
21357
|
+
accessor: "taskPredecessors",
|
|
21358
|
+
resourcePath: "/V1.0/TaskPredecessors",
|
|
21359
|
+
parentScopedPath: "/V1.0/Tasks/{parentId}/Predecessors",
|
|
21360
|
+
parentPath: "/V1.0/Tasks",
|
|
21361
|
+
parentField: "successorTaskID",
|
|
21362
|
+
deletable: true,
|
|
21363
|
+
udfCapable: false,
|
|
21364
|
+
ops: { query: true, queryAll: false, count: true, get: true, create: true, update: true, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: true },
|
|
21365
|
+
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
21366
|
+
opForms: { get: "scoped", create: "scoped", update: "scoped", delete: "scoped" }
|
|
21367
|
+
},
|
|
21222
21368
|
{
|
|
21223
21369
|
key: "task_secondary_resources",
|
|
21224
21370
|
accessor: "taskSecondaryResources",
|
|
@@ -21484,7 +21630,7 @@ var GenericResource = class extends BaseResource {
|
|
|
21484
21630
|
if (["company_attachments", "company_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
|
|
21485
21631
|
throw new OperationNotSupportedError(config.key, "getUdfInfo");
|
|
21486
21632
|
};
|
|
21487
|
-
if (config.ops?.create === false || config.key === "company_attachments") this.createIfNotExists = async () => {
|
|
21633
|
+
if (config.ops?.create === false || config.key === "company_attachments" || config.key === "task_predecessors") this.createIfNotExists = async () => {
|
|
21488
21634
|
throw new OperationNotSupportedError(config.key, "createIfNotExists");
|
|
21489
21635
|
};
|
|
21490
21636
|
if (config.key === "task_notes") {
|
|
@@ -21495,6 +21641,9 @@ var GenericResource = class extends BaseResource {
|
|
|
21495
21641
|
};
|
|
21496
21642
|
}
|
|
21497
21643
|
}
|
|
21644
|
+
putFallbackEligible(err) {
|
|
21645
|
+
return this.config.key !== "task_predecessors" && super.putFallbackEligible(err);
|
|
21646
|
+
}
|
|
21498
21647
|
/** #293 QA F2: the superset exposes every generic method, but a row whose ops/helpers
|
|
21499
21648
|
* flags mark an op absent (the plain entities) refuses it client-side, pre-wire — the
|
|
21500
21649
|
* pre-#293 per-key shell simply did not carry the method. Rows without flags (the
|
|
@@ -21531,6 +21680,12 @@ var GenericResource = class extends BaseResource {
|
|
|
21531
21680
|
if (isIdentifier(b)) {
|
|
21532
21681
|
if (this.config.opForms?.get === "global") throw new OperationNotSupportedError(this.config.key, "get");
|
|
21533
21682
|
const fresh = (c ?? null)?.fresh === true;
|
|
21683
|
+
if (this.config.key === "task_predecessors") {
|
|
21684
|
+
predecessorParent(a);
|
|
21685
|
+
const record = await this.getScopedRaw(a, b, fresh);
|
|
21686
|
+
assertPredecessorBinding(record, a, b);
|
|
21687
|
+
return record;
|
|
21688
|
+
}
|
|
21534
21689
|
return this.config.attachmentGet === true ? this.getScopedModel(a, b, fresh) : this.getScopedRaw(a, b, fresh);
|
|
21535
21690
|
}
|
|
21536
21691
|
if (this.config.opForms?.get === "scoped") throw new OperationNotSupportedError(this.config.key, "get");
|
|
@@ -21541,9 +21696,10 @@ var GenericResource = class extends BaseResource {
|
|
|
21541
21696
|
if (isIdentifier(a)) {
|
|
21542
21697
|
if (this.config.opForms?.create === "global") throw new OperationNotSupportedError(this.config.key, "create");
|
|
21543
21698
|
const parentId = a;
|
|
21544
|
-
const data2 = b;
|
|
21545
|
-
const opts2 = c ?? {};
|
|
21699
|
+
const data2 = this.config.key === "task_predecessors" ? admitTaskPredecessor(b, parentId, true) : b;
|
|
21700
|
+
const opts2 = this.config.key === "task_predecessors" ? { ...c } : c ?? {};
|
|
21546
21701
|
if (this.config.key === "task_notes") admitTaskNote(data2, parentId, true);
|
|
21702
|
+
if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, void 0, data2);
|
|
21547
21703
|
if (opts2.dryRun === true) return this.runCreateDryRun(data2, parentId);
|
|
21548
21704
|
return this.createScopedRaw(parentId, data2, opts2);
|
|
21549
21705
|
}
|
|
@@ -21559,9 +21715,10 @@ var GenericResource = class extends BaseResource {
|
|
|
21559
21715
|
if (this.config.opForms?.update === "global") throw new OperationNotSupportedError(this.config.key, "update");
|
|
21560
21716
|
const parentId = a;
|
|
21561
21717
|
const id2 = b;
|
|
21562
|
-
const data2 = c;
|
|
21563
|
-
const opts2 = d ?? {};
|
|
21718
|
+
const data2 = this.config.key === "task_predecessors" ? admitTaskPredecessor(c, parentId, false) : c;
|
|
21719
|
+
const opts2 = this.config.key === "task_predecessors" ? { ...d } : d ?? {};
|
|
21564
21720
|
if (this.config.key === "task_notes") admitTaskNote(data2, parentId, false);
|
|
21721
|
+
if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, id2);
|
|
21565
21722
|
if (opts2.dryRun === true) return this.runUpdateDryRun(id2, data2, opts2, parentId);
|
|
21566
21723
|
if (this.config.collectionUpdate !== true) {
|
|
21567
21724
|
await this.guardStaleBeforeMutation(id2, opts2, `${this.config.key}.update`, parentId);
|
|
@@ -21584,7 +21741,8 @@ var GenericResource = class extends BaseResource {
|
|
|
21584
21741
|
if (this.config.opForms?.delete === "global") throw new OperationNotSupportedError(this.config.key, "delete");
|
|
21585
21742
|
const parentId = a;
|
|
21586
21743
|
const id2 = b;
|
|
21587
|
-
const opts2 = c ?? {};
|
|
21744
|
+
const opts2 = this.config.key === "task_predecessors" ? { ...c } : c ?? {};
|
|
21745
|
+
if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, id2);
|
|
21588
21746
|
if (opts2.dryRun === true) return this.runDeleteDryRun(id2, opts2, parentId);
|
|
21589
21747
|
await this.guardStaleBeforeMutation(id2, opts2, `${this.config.key}.delete`, parentId);
|
|
21590
21748
|
return this.config.attachmentGet === true ? this.deleteScopedModel(parentId, id2, opts2) : this.deleteScopedRaw(parentId, id2, opts2);
|
|
@@ -23473,7 +23631,7 @@ function dateBucketLabel(value, bucket) {
|
|
|
23473
23631
|
var queryResourceKeysPromise = null;
|
|
23474
23632
|
function queryResourceKeys() {
|
|
23475
23633
|
if (queryResourceKeysPromise === null) {
|
|
23476
|
-
queryResourceKeysPromise =
|
|
23634
|
+
queryResourceKeysPromise = chunkASL3BIW2_cjs.loadCapabilityRecords().then((records) => {
|
|
23477
23635
|
const s = /* @__PURE__ */ new Set();
|
|
23478
23636
|
for (const rec of records) if (rec.operation === "query") s.add(rec.resource);
|
|
23479
23637
|
return s;
|
|
@@ -23595,7 +23753,7 @@ function parseTopAndLimit(opts, problems) {
|
|
|
23595
23753
|
return { top, limit };
|
|
23596
23754
|
}
|
|
23597
23755
|
async function checkFieldNames(resourceKey, conditions, opts, problems) {
|
|
23598
|
-
const records = resourceKey === void 0 ? [] : await
|
|
23756
|
+
const records = resourceKey === void 0 ? [] : await chunkASL3BIW2_cjs.loadCapabilityRecords();
|
|
23599
23757
|
const record = resourceKey === void 0 ? void 0 : records.find((r) => r.resource === resourceKey && r.operation === "query");
|
|
23600
23758
|
if (record === void 0) return void 0;
|
|
23601
23759
|
const strings = (v) => Array.isArray(v) ? v.filter((f) => typeof f === "string" && f.trim() !== "") : [];
|
|
@@ -24240,7 +24398,7 @@ async function uiLink(client, input) {
|
|
|
24240
24398
|
var indexPromise = null;
|
|
24241
24399
|
function operationIndex() {
|
|
24242
24400
|
if (indexPromise === null) {
|
|
24243
|
-
indexPromise =
|
|
24401
|
+
indexPromise = chunkASL3BIW2_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
|
|
24244
24402
|
}
|
|
24245
24403
|
return indexPromise;
|
|
24246
24404
|
}
|
|
@@ -26576,16 +26734,16 @@ function latchingHttp(raw, spend) {
|
|
|
26576
26734
|
}
|
|
26577
26735
|
};
|
|
26578
26736
|
observeRecordReadFailures(http, latch);
|
|
26579
|
-
const
|
|
26737
|
+
const fail2 = (err) => {
|
|
26580
26738
|
latch(err);
|
|
26581
26739
|
throw err;
|
|
26582
26740
|
};
|
|
26583
26741
|
http.request = (o) => {
|
|
26584
26742
|
if (fatal) throw fatal;
|
|
26585
26743
|
try {
|
|
26586
|
-
return counted.request({ ...o, signal: o.signal ?? signal }).catch(
|
|
26744
|
+
return counted.request({ ...o, signal: o.signal ?? signal }).catch(fail2);
|
|
26587
26745
|
} catch (err) {
|
|
26588
|
-
return
|
|
26746
|
+
return fail2(err);
|
|
26589
26747
|
}
|
|
26590
26748
|
};
|
|
26591
26749
|
return { http, fatal: () => fatal, signal };
|
|
@@ -27783,12 +27941,12 @@ var TimeEntriesResource = class extends GenericResource {
|
|
|
27783
27941
|
/** Only four review fields; collection PATCH preserves every omitted field. */
|
|
27784
27942
|
async updateReviewFields(id, data, opts = {}) {
|
|
27785
27943
|
return updateReviewFields(this, id, data, async (payload) => {
|
|
27786
|
-
const
|
|
27944
|
+
const numeric2 = parseIdentifier(id, "id");
|
|
27787
27945
|
if (opts.dryRun === true) {
|
|
27788
|
-
const preview2 = await this.runUpdateDryRun(
|
|
27946
|
+
const preview2 = await this.runUpdateDryRun(numeric2, payload, { ...opts, raw: true });
|
|
27789
27947
|
return { ...preview2, request: { ...preview2.request, method: "PATCH" } };
|
|
27790
27948
|
}
|
|
27791
|
-
return this.updateGlobal(
|
|
27949
|
+
return this.updateGlobal(numeric2, payload, { ...opts, raw: true }, "PATCH");
|
|
27792
27950
|
}, opts);
|
|
27793
27951
|
}
|
|
27794
27952
|
dateWorkedWindow(from, to, opts) {
|