node-autotask 0.76.0 → 0.77.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 +6 -0
- package/MCP_TOOL_CATALOG.json +137 -9
- package/README.md +1 -1
- package/capabilities.json +483 -7
- package/dist/capabilities-data.js +482 -6
- package/dist/capabilities.cjs +4 -4
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-C4S3EKIK.cjs → chunk-3FZJJX5B.cjs} +3 -3
- package/dist/{chunk-55BQEFBO.cjs → chunk-5MH3MPLB.cjs} +31 -30
- package/dist/{chunk-Y4BH5N6R.cjs → chunk-6VBOBCWA.cjs} +186 -27
- package/dist/{chunk-3SFIKG2R.js → chunk-F5Y7WBWY.js} +181 -22
- package/dist/{chunk-ECSE6B3U.js → chunk-G2U6NHPO.js} +3 -3
- package/dist/{chunk-YRTOAPWD.cjs → chunk-NAI7XIX4.cjs} +199 -199
- package/dist/{chunk-UFK7JYYC.js → chunk-QTFK2HAO.js} +3 -2
- package/dist/{chunk-S7QPD6TR.js → chunk-RLXUY4VM.js} +2 -2
- package/dist/{index-BbAzrm2i.d.cts → index-B-vNyiD_.d.cts} +47 -1
- package/dist/{index-BbAzrm2i.d.ts → index-B-vNyiD_.d.ts} +47 -1
- package/dist/{index-MY7qYY5d.d.cts → index-PLdAoAFJ.d.cts} +3 -2
- package/dist/{index-CY7exGOe.d.ts → index-ecr6unv3.d.ts} +3 -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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkNAI7XIX4_cjs = require('./chunk-NAI7XIX4.cjs');
|
|
4
|
+
var chunk6VBOBCWA_cjs = require('./chunk-6VBOBCWA.cjs');
|
|
5
5
|
|
|
6
6
|
// src/client.ts
|
|
7
7
|
var AutotaskClient = class {
|
|
@@ -28,6 +28,7 @@ var AutotaskClient = class {
|
|
|
28
28
|
companyNotes;
|
|
29
29
|
companySiteConfigurations;
|
|
30
30
|
companyWebhooks;
|
|
31
|
+
configurationItemAttachments;
|
|
31
32
|
configurationItemBillingProductAssociations;
|
|
32
33
|
configurationItemCategories;
|
|
33
34
|
configurationItemCategoryUdfAssociations;
|
|
@@ -161,34 +162,34 @@ var AutotaskClient = class {
|
|
|
161
162
|
* anything is wired. Construction issues NO request.
|
|
162
163
|
*/
|
|
163
164
|
constructor(options) {
|
|
164
|
-
this.config =
|
|
165
|
-
this.http = new
|
|
165
|
+
this.config = chunk6VBOBCWA_cjs.resolveConfig(options);
|
|
166
|
+
this.http = new chunk6VBOBCWA_cjs.HttpClient(this.config);
|
|
166
167
|
this.http.client = this;
|
|
167
|
-
for (const entry of
|
|
168
|
-
this[entry.accessor] = new
|
|
168
|
+
for (const entry of chunk6VBOBCWA_cjs.SIMPLE_RESOURCES) {
|
|
169
|
+
this[entry.accessor] = new chunk6VBOBCWA_cjs.GenericResource(this.http, entry, this.config.pageSize);
|
|
169
170
|
}
|
|
170
|
-
this.companies = new
|
|
171
|
-
this.configurationItems = new
|
|
172
|
-
this.contacts = new
|
|
173
|
-
this.contracts = new
|
|
174
|
-
this.inventoryProducts = new
|
|
175
|
-
this.invoices = new
|
|
176
|
-
this.quotes = new
|
|
177
|
-
this.resourceTimeOffAdditional = new
|
|
178
|
-
this.resourceTimeOffBalances = new
|
|
179
|
-
this.resources = new
|
|
180
|
-
this.serviceCalls = new
|
|
181
|
-
this.ticketCharges = new
|
|
182
|
-
this.tickets = new
|
|
183
|
-
this.timeEntries = new
|
|
184
|
-
this.timeOffRequests = new
|
|
185
|
-
this.authenticateResource = new
|
|
186
|
-
this.entityInformation = new
|
|
187
|
-
this.modules = new
|
|
188
|
-
this.thresholdInformation = new
|
|
189
|
-
this.version = new
|
|
190
|
-
this.versionInformation = new
|
|
191
|
-
this.zoneInformation = new
|
|
171
|
+
this.companies = new chunk6VBOBCWA_cjs.CompaniesResource(this.http, this.config.pageSize);
|
|
172
|
+
this.configurationItems = new chunkNAI7XIX4_cjs.ConfigurationItemsResource(this.http, this.config.pageSize);
|
|
173
|
+
this.contacts = new chunkNAI7XIX4_cjs.ContactsResource(this.http, this.config.pageSize);
|
|
174
|
+
this.contracts = new chunk6VBOBCWA_cjs.ContractsResource(this.http, this.config.pageSize);
|
|
175
|
+
this.inventoryProducts = new chunkNAI7XIX4_cjs.InventoryProductsResource(this.http, this.config.pageSize);
|
|
176
|
+
this.invoices = new chunk6VBOBCWA_cjs.InvoicesResource(this.http, this.config.pageSize);
|
|
177
|
+
this.quotes = new chunkNAI7XIX4_cjs.QuotesResource(this.http, this.config.pageSize);
|
|
178
|
+
this.resourceTimeOffAdditional = new chunkNAI7XIX4_cjs.ResourceTimeOffAdditionalResource(this.http, this.config.pageSize);
|
|
179
|
+
this.resourceTimeOffBalances = new chunkNAI7XIX4_cjs.ResourceTimeOffBalancesResource(this.http, this.config.pageSize);
|
|
180
|
+
this.resources = new chunkNAI7XIX4_cjs.ResourcesResource(this.http, this.config, this.config.pageSize);
|
|
181
|
+
this.serviceCalls = new chunkNAI7XIX4_cjs.ServiceCallsResource(this.http, this.config.pageSize);
|
|
182
|
+
this.ticketCharges = new chunkNAI7XIX4_cjs.TicketChargesResource(this.http, this.config.pageSize);
|
|
183
|
+
this.tickets = new chunkNAI7XIX4_cjs.TicketsResource(this.http, this.config.pageSize);
|
|
184
|
+
this.timeEntries = new chunk6VBOBCWA_cjs.TimeEntriesResource(this.http, this.config.pageSize);
|
|
185
|
+
this.timeOffRequests = new chunkNAI7XIX4_cjs.TimeOffRequestsResource(this.http, this.config.pageSize);
|
|
186
|
+
this.authenticateResource = new chunkNAI7XIX4_cjs.AuthenticateResource(this.http);
|
|
187
|
+
this.entityInformation = new chunkNAI7XIX4_cjs.EntityInformationResource(this.http);
|
|
188
|
+
this.modules = new chunkNAI7XIX4_cjs.ModulesResource(this.http);
|
|
189
|
+
this.thresholdInformation = new chunkNAI7XIX4_cjs.ThresholdInformationResource(this.http);
|
|
190
|
+
this.version = new chunkNAI7XIX4_cjs.VersionResource(this.http);
|
|
191
|
+
this.versionInformation = new chunkNAI7XIX4_cjs.VersionInformationResource(this.http);
|
|
192
|
+
this.zoneInformation = new chunkNAI7XIX4_cjs.ZoneInformationResource(this.http);
|
|
192
193
|
}
|
|
193
194
|
/**
|
|
194
195
|
* `GET /V1.0/Authenticate` → `AuthTokenResultModel` (as-is). The SDK does
|
|
@@ -222,10 +223,10 @@ var AutotaskClient = class {
|
|
|
222
223
|
* parameter on each: `await client.withSignal(signal, () => invoke(client, ...))`.
|
|
223
224
|
*/
|
|
224
225
|
withSignal(signal, fn) {
|
|
225
|
-
return
|
|
226
|
+
return chunk6VBOBCWA_cjs.runWithSignal(signal, fn);
|
|
226
227
|
}
|
|
227
228
|
async batch(fn, items, opts = {}) {
|
|
228
|
-
return
|
|
229
|
+
return chunk6VBOBCWA_cjs.runBounded(fn, items, { ...opts, concurrency: opts.concurrency ?? this.config.maxConcurrent });
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
232
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3FZJJX5B_cjs = require('./chunk-3FZJJX5B.cjs');
|
|
4
4
|
var chunkBD4AUGCJ_cjs = require('./chunk-BD4AUGCJ.cjs');
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var async_hooks = require('async_hooks');
|
|
@@ -3249,6 +3249,22 @@ var RELATIONSHIP_MAP = {
|
|
|
3249
3249
|
"group": "A",
|
|
3250
3250
|
"parent": null,
|
|
3251
3251
|
"children": [
|
|
3252
|
+
{
|
|
3253
|
+
"resource": "configuration_item_attachments",
|
|
3254
|
+
"apiEntity": "ConfigurationItemAttachment",
|
|
3255
|
+
"parentField": "configurationItemID",
|
|
3256
|
+
"parentSegment": "Attachments",
|
|
3257
|
+
"tier": "extended",
|
|
3258
|
+
"workflowResource": false,
|
|
3259
|
+
"specialOps": [],
|
|
3260
|
+
"searchCovers": null,
|
|
3261
|
+
"scopedOps": {
|
|
3262
|
+
"create": true,
|
|
3263
|
+
"query": true,
|
|
3264
|
+
"update": false,
|
|
3265
|
+
"delete": true
|
|
3266
|
+
}
|
|
3267
|
+
},
|
|
3252
3268
|
{
|
|
3253
3269
|
"resource": "configuration_item_billing_product_associations",
|
|
3254
3270
|
"apiEntity": "ConfigurationItemBillingProductAssociations",
|
|
@@ -9989,6 +10005,75 @@ var RELATIONSHIP_MAP = {
|
|
|
9989
10005
|
},
|
|
9990
10006
|
"deleteBoundary": null,
|
|
9991
10007
|
"markerField": null
|
|
10008
|
+
},
|
|
10009
|
+
"configuration_item_attachments": {
|
|
10010
|
+
"resource": "configuration_item_attachments",
|
|
10011
|
+
"apiEntity": "ConfigurationItemAttachment",
|
|
10012
|
+
"kind": "entity",
|
|
10013
|
+
"path": "ConfigurationItemAttachments",
|
|
10014
|
+
"parentScoped": true,
|
|
10015
|
+
"tier": "extended",
|
|
10016
|
+
"workflowResource": false,
|
|
10017
|
+
"group": "A",
|
|
10018
|
+
"parent": {
|
|
10019
|
+
"resource": "configuration_items",
|
|
10020
|
+
"segment": "Attachments",
|
|
10021
|
+
"field": "configurationItemID"
|
|
10022
|
+
},
|
|
10023
|
+
"children": [],
|
|
10024
|
+
"naturalKeys": {
|
|
10025
|
+
"hasSearch": false,
|
|
10026
|
+
"searchCovers": null,
|
|
10027
|
+
"findBy": []
|
|
10028
|
+
},
|
|
10029
|
+
"blindSurfaces": null,
|
|
10030
|
+
"zoneFacts": {
|
|
10031
|
+
"createGuidance": {
|
|
10032
|
+
"createOp": "configuration_item_attachments.create",
|
|
10033
|
+
"parentScoped": true,
|
|
10034
|
+
"liveProvenPrefix": [],
|
|
10035
|
+
"unproven": true,
|
|
10036
|
+
"blocker": {
|
|
10037
|
+
"kind": "unknown",
|
|
10038
|
+
"message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
|
|
10039
|
+
"remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
|
|
10040
|
+
"requires": {
|
|
10041
|
+
"allOf": [
|
|
10042
|
+
"attachmentType",
|
|
10043
|
+
"fullPath",
|
|
10044
|
+
"title",
|
|
10045
|
+
"publish",
|
|
10046
|
+
"data"
|
|
10047
|
+
]
|
|
10048
|
+
}
|
|
10049
|
+
},
|
|
10050
|
+
"requiresByValue": [
|
|
10051
|
+
{
|
|
10052
|
+
"field": "attachmentType",
|
|
10053
|
+
"value": "FILE_ATTACHMENT",
|
|
10054
|
+
"requires": {
|
|
10055
|
+
"allOf": [
|
|
10056
|
+
"data"
|
|
10057
|
+
]
|
|
10058
|
+
}
|
|
10059
|
+
}
|
|
10060
|
+
],
|
|
10061
|
+
"vendorEvidence": [
|
|
10062
|
+
"Official ConfigurationItemAttachmentsEntity.htm and REST_Attachments.htm: required file creation inputs; ConfigurationItems parent; separate read-only configurationItemNoteID; no update or UDF metadata. Static contract only; no live create."
|
|
10063
|
+
],
|
|
10064
|
+
"deleteBoundary": {
|
|
10065
|
+
"available": true,
|
|
10066
|
+
"note": null
|
|
10067
|
+
},
|
|
10068
|
+
"parentCompany": {
|
|
10069
|
+
"via": "configurationItemID",
|
|
10070
|
+
"resource": "configuration_items",
|
|
10071
|
+
"field": "companyID"
|
|
10072
|
+
}
|
|
10073
|
+
}
|
|
10074
|
+
},
|
|
10075
|
+
"deleteBoundary": null,
|
|
10076
|
+
"markerField": null
|
|
9992
10077
|
}
|
|
9993
10078
|
};
|
|
9994
10079
|
var BLIND_SURFACE_STAMPS = {
|
|
@@ -11827,6 +11912,50 @@ var CREATE_GUIDANCE = {
|
|
|
11827
11912
|
"note": null
|
|
11828
11913
|
}
|
|
11829
11914
|
},
|
|
11915
|
+
{
|
|
11916
|
+
"resource": "configuration_item_attachments",
|
|
11917
|
+
"createOp": "configuration_item_attachments.create",
|
|
11918
|
+
"parentScoped": true,
|
|
11919
|
+
"liveProvenPrefix": [],
|
|
11920
|
+
"unproven": true,
|
|
11921
|
+
"blocker": {
|
|
11922
|
+
"kind": "unknown",
|
|
11923
|
+
"message": "Attachment creation is documented; valid input remains subject to API-user permissions and vendor validation.",
|
|
11924
|
+
"remedy": "Read the current field and picklist metadata, supply the named parent id, and preview the attachment before applying.",
|
|
11925
|
+
"requires": {
|
|
11926
|
+
"allOf": [
|
|
11927
|
+
"attachmentType",
|
|
11928
|
+
"fullPath",
|
|
11929
|
+
"title",
|
|
11930
|
+
"publish",
|
|
11931
|
+
"data"
|
|
11932
|
+
]
|
|
11933
|
+
}
|
|
11934
|
+
},
|
|
11935
|
+
"vendorEvidence": [
|
|
11936
|
+
"Official ConfigurationItemAttachmentsEntity.htm and REST_Attachments.htm: required file creation inputs; ConfigurationItems parent; separate read-only configurationItemNoteID; no update or UDF metadata. Static contract only; no live create."
|
|
11937
|
+
],
|
|
11938
|
+
"deleteBoundary": {
|
|
11939
|
+
"available": true,
|
|
11940
|
+
"note": null
|
|
11941
|
+
},
|
|
11942
|
+
"requiresByValue": [
|
|
11943
|
+
{
|
|
11944
|
+
"field": "attachmentType",
|
|
11945
|
+
"value": "FILE_ATTACHMENT",
|
|
11946
|
+
"requires": {
|
|
11947
|
+
"allOf": [
|
|
11948
|
+
"data"
|
|
11949
|
+
]
|
|
11950
|
+
}
|
|
11951
|
+
}
|
|
11952
|
+
],
|
|
11953
|
+
"parentCompany": {
|
|
11954
|
+
"via": "configurationItemID",
|
|
11955
|
+
"resource": "configuration_items",
|
|
11956
|
+
"field": "companyID"
|
|
11957
|
+
}
|
|
11958
|
+
},
|
|
11830
11959
|
{
|
|
11831
11960
|
"resource": "configuration_item_billing_product_associations",
|
|
11832
11961
|
"createOp": "configuration_item_billing_product_associations.create",
|
|
@@ -14210,7 +14339,7 @@ var CREATE_GUIDANCE = {
|
|
|
14210
14339
|
}
|
|
14211
14340
|
],
|
|
14212
14341
|
"counts": {
|
|
14213
|
-
"total":
|
|
14342
|
+
"total": 107,
|
|
14214
14343
|
"byKind": {
|
|
14215
14344
|
"ok": 41,
|
|
14216
14345
|
"blind-reference": 16,
|
|
@@ -14220,7 +14349,7 @@ var CREATE_GUIDANCE = {
|
|
|
14220
14349
|
"resource-role-pair": 2,
|
|
14221
14350
|
"delete-absent": 0,
|
|
14222
14351
|
"non-mutable": 0,
|
|
14223
|
-
"unknown":
|
|
14352
|
+
"unknown": 31
|
|
14224
14353
|
}
|
|
14225
14354
|
}
|
|
14226
14355
|
};
|
|
@@ -14956,6 +15085,9 @@ var UNTRUSTED_FIELDS_BY_RESOURCE = {
|
|
|
14956
15085
|
],
|
|
14957
15086
|
"task_note_attachments": [
|
|
14958
15087
|
"title"
|
|
15088
|
+
],
|
|
15089
|
+
"configuration_item_attachments": [
|
|
15090
|
+
"title"
|
|
14959
15091
|
]
|
|
14960
15092
|
};
|
|
14961
15093
|
|
|
@@ -16830,7 +16962,7 @@ async function capabilitySets() {
|
|
|
16830
16962
|
const fieldOps = /* @__PURE__ */ new Map();
|
|
16831
16963
|
const udfCapable = /* @__PURE__ */ new Set();
|
|
16832
16964
|
const resources = /* @__PURE__ */ new Set();
|
|
16833
|
-
for (const rec of await
|
|
16965
|
+
for (const rec of await chunk3FZJJX5B_cjs.loadCapabilityRecords()) {
|
|
16834
16966
|
if (rec.resource === "operations") continue;
|
|
16835
16967
|
resources.add(rec.resource);
|
|
16836
16968
|
if (rec.operation === "getFieldInfo") fieldOps.set(rec.resource, rec);
|
|
@@ -16841,7 +16973,7 @@ async function capabilitySets() {
|
|
|
16841
16973
|
var derivedIndexPromise = null;
|
|
16842
16974
|
function derivedIndexLoad() {
|
|
16843
16975
|
if (derivedIndexPromise === null) {
|
|
16844
|
-
derivedIndexPromise =
|
|
16976
|
+
derivedIndexPromise = chunk3FZJJX5B_cjs.loadCapabilityRecords().then((records) => {
|
|
16845
16977
|
const index = /* @__PURE__ */ new Map();
|
|
16846
16978
|
for (const rec of records) {
|
|
16847
16979
|
const declared = rec.metadata?.derivedFields;
|
|
@@ -17960,6 +18092,7 @@ var MODEL_FIELD_SETS = {
|
|
|
17960
18092
|
"company_notes": ["id", "actionType", "assignedResourceID", "companyID", "completedDateTime", "contactID", "createDateTime", "endDateTime", "impersonatorCreatorResourceID", "impersonatorUpdaterResourceID", "lastModifiedDate", "name", "note", "opportunityID", "startDateTime", "soapParentPropertyId"],
|
|
17961
18093
|
"company_site_configurations": ["id", "companyID", "locationName", "soapParentPropertyId", "userDefinedFields"],
|
|
17962
18094
|
"company_webhooks": ["id", "deactivationUrl", "isActive", "isReady", "isSubscribedToCreateEvents", "isSubscribedToDeleteEvents", "isSubscribedToUpdateEvents", "name", "notificationEmailAddress", "ownerResourceID", "secretKey", "sendThresholdExceededNotification", "webhookGUID", "webhookUrl"],
|
|
18095
|
+
"configuration_item_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "configurationItemID", "configurationItemNoteID", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentAttachmentID", "parentID", "publish", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
|
|
17963
18096
|
"configuration_item_billing_product_associations": ["id", "billingProductID", "configurationItemID", "effectiveDate", "expirationDate", "soapParentPropertyId"],
|
|
17964
18097
|
"configuration_item_categories": ["id", "displayColorRGB", "isActive", "isClientPortalDefault", "isGlobalDefault", "name", "nickname"],
|
|
17965
18098
|
"configuration_item_category_udf_associations": ["id", "configurationItemCategoryID", "isRequired", "userDefinedFieldDefinitionID", "soapParentPropertyId"],
|
|
@@ -18087,6 +18220,7 @@ var MODEL_DATE_FIELDS = {
|
|
|
18087
18220
|
"company_attachments": ["attachDate"],
|
|
18088
18221
|
"company_note_attachments": ["attachDate"],
|
|
18089
18222
|
"company_notes": ["completedDateTime", "createDateTime", "endDateTime", "lastModifiedDate", "startDateTime"],
|
|
18223
|
+
"configuration_item_attachments": ["attachDate"],
|
|
18090
18224
|
"configuration_item_billing_product_associations": ["effectiveDate", "expirationDate"],
|
|
18091
18225
|
"configuration_item_dns_records": ["createDateTime"],
|
|
18092
18226
|
"configuration_item_notes": ["createDateTime", "lastActivityDate"],
|
|
@@ -20485,10 +20619,18 @@ async function findUnknownFieldNames(record, holder, lists) {
|
|
|
20485
20619
|
return { known: resolved.known, authority: resolved.authority, unknown };
|
|
20486
20620
|
}
|
|
20487
20621
|
|
|
20488
|
-
// src/resources/special/
|
|
20622
|
+
// src/resources/special/scopedAttachments.ts
|
|
20489
20623
|
var WRITABLE2 = /* @__PURE__ */ new Set(["attachmentType", "contentType", "data", "fullPath", "parentAttachmentID", "publish", "taskID", "title"]);
|
|
20490
|
-
var
|
|
20624
|
+
var FILE_WRITABLE = /* @__PURE__ */ new Set(["attachmentType", "data", "fullPath", "publish", "title"]);
|
|
20491
20625
|
var NON_QUERYABLE = /* @__PURE__ */ new Set(["creatortype", "data", "filesize"]);
|
|
20626
|
+
var SCOPED_ATTACHMENT_PARENTS = {
|
|
20627
|
+
task_attachments: { field: "taskID", name: "task" },
|
|
20628
|
+
task_note_attachments: { field: "taskNoteID", name: "task note" },
|
|
20629
|
+
configuration_item_attachments: { field: "configurationItemID", name: "configuration item" }
|
|
20630
|
+
};
|
|
20631
|
+
function isScopedAttachmentResource(resource) {
|
|
20632
|
+
return Object.hasOwn(SCOPED_ATTACHMENT_PARENTS, resource);
|
|
20633
|
+
}
|
|
20492
20634
|
function isBase64(value) {
|
|
20493
20635
|
return value.length % 4 === 0 && /^[A-Za-z0-9+/]+={0,2}$/.test(value);
|
|
20494
20636
|
}
|
|
@@ -20520,32 +20662,33 @@ function admitTaskAttachment(data, parentId) {
|
|
|
20520
20662
|
parseIdentifier(body.parentAttachmentID, "parentAttachmentID");
|
|
20521
20663
|
}
|
|
20522
20664
|
}
|
|
20523
|
-
function
|
|
20665
|
+
function admitFileAttachment(resource, data, parentId) {
|
|
20524
20666
|
parseIdentifier(parentId, "parentId");
|
|
20525
20667
|
const fail2 = (message) => {
|
|
20526
|
-
throw new AutotaskConfigError(
|
|
20668
|
+
throw new AutotaskConfigError(`${resource}: ${message}`);
|
|
20527
20669
|
};
|
|
20528
20670
|
if (data === null || typeof data !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(data))) fail2("data must be a plain record");
|
|
20529
20671
|
const body = data;
|
|
20530
|
-
|
|
20672
|
+
const reference = resource === "task_note_attachments" ? "attachedByContactID" : "parentAttachmentID";
|
|
20673
|
+
for (const field of Object.keys(body)) if (!FILE_WRITABLE.has(field) && field !== reference) fail2(`${field} is not a supported create field`);
|
|
20531
20674
|
if (body.attachmentType !== "FILE_ATTACHMENT") fail2("attachmentType must explicitly be FILE_ATTACHMENT; other attachment types are unsupported");
|
|
20532
20675
|
for (const field of ["fullPath", "title"]) {
|
|
20533
20676
|
if (typeof body[field] !== "string" || body[field].trim() === "" || body[field].length > 255) fail2(`${field} is required and must be a nonblank string of at most 255 characters`);
|
|
20534
20677
|
}
|
|
20535
20678
|
if (typeof body.publish !== "number" || !Number.isSafeInteger(body.publish)) fail2("publish must be an integer from current field metadata");
|
|
20536
20679
|
if (typeof body.data !== "string" || !isBase64(body.data)) fail2("FILE_ATTACHMENT requires nonempty base64 data");
|
|
20537
|
-
if (body
|
|
20538
|
-
if (typeof body
|
|
20539
|
-
if (parseIdentifier(body
|
|
20680
|
+
if (body[reference] !== void 0) {
|
|
20681
|
+
if (typeof body[reference] !== "number") fail2(`${reference} must be a numeric identifier`);
|
|
20682
|
+
if (parseIdentifier(body[reference], reference) === 0) fail2(`${reference} must be positive`);
|
|
20540
20683
|
}
|
|
20541
20684
|
}
|
|
20542
|
-
function
|
|
20685
|
+
function admitScopedAttachmentQuery(resource, params) {
|
|
20543
20686
|
const fields = collectFilterFieldNames(normalizedConditions(params?.filter) ?? [], resource);
|
|
20544
20687
|
for (const field of fields) {
|
|
20545
20688
|
if (NON_QUERYABLE.has(field.toLowerCase())) throw new AutotaskConfigError(`${resource}: ${field} is not queryable`);
|
|
20546
20689
|
}
|
|
20547
20690
|
}
|
|
20548
|
-
function
|
|
20691
|
+
function assertScopedAttachmentIdentity(resource, model, parentId, id) {
|
|
20549
20692
|
const matches = (value, expected) => {
|
|
20550
20693
|
try {
|
|
20551
20694
|
return parseIdentifier(value) === parseIdentifier(expected);
|
|
@@ -20553,9 +20696,8 @@ function assertTaskAttachmentIdentity(resource, model, parentId, id) {
|
|
|
20553
20696
|
return false;
|
|
20554
20697
|
}
|
|
20555
20698
|
};
|
|
20556
|
-
const
|
|
20699
|
+
const { field: parentField, name: parentName } = SCOPED_ATTACHMENT_PARENTS[resource];
|
|
20557
20700
|
if (!isRecord2(model) || !matches(model.id, id) || model[parentField] != null && !matches(model[parentField], parentId)) {
|
|
20558
|
-
const parentName = resource === "task_attachments" ? "task" : "task note";
|
|
20559
20701
|
throw new AutotaskError(`Returned attachment identifiers contradict the requested ${parentName} or attachment`, {
|
|
20560
20702
|
code: "INVALID_RESPONSE",
|
|
20561
20703
|
category: "server",
|
|
@@ -20763,6 +20905,20 @@ var SIMPLE_RESOURCES = [
|
|
|
20763
20905
|
helpers: { search: true, resolve: true, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
20764
20906
|
opForms: { get: "global", create: "global", update: "global", delete: "global" }
|
|
20765
20907
|
},
|
|
20908
|
+
{
|
|
20909
|
+
key: "configuration_item_attachments",
|
|
20910
|
+
accessor: "configurationItemAttachments",
|
|
20911
|
+
resourcePath: "/V1.0/ConfigurationItemAttachments",
|
|
20912
|
+
parentScopedPath: "/V1.0/ConfigurationItems/{parentId}/Attachments",
|
|
20913
|
+
parentPath: "/V1.0/ConfigurationItems",
|
|
20914
|
+
parentField: "configurationItemID",
|
|
20915
|
+
deletable: true,
|
|
20916
|
+
udfCapable: false,
|
|
20917
|
+
attachmentGet: true,
|
|
20918
|
+
ops: { query: true, queryAll: false, count: true, get: true, create: true, update: false, delete: true, getEntityInfo: true, getFieldInfo: true, getUdfInfo: false, download: false },
|
|
20919
|
+
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
20920
|
+
opForms: { get: "scoped", create: "scoped", delete: "scoped" }
|
|
20921
|
+
},
|
|
20766
20922
|
{
|
|
20767
20923
|
key: "configuration_item_billing_product_associations",
|
|
20768
20924
|
accessor: "configurationItemBillingProductAssociations",
|
|
@@ -22111,10 +22267,10 @@ var SIMPLE_RESOURCES = [
|
|
|
22111
22267
|
var GenericResource = class extends BaseResource {
|
|
22112
22268
|
constructor(http, config, pageSize) {
|
|
22113
22269
|
super(http, config, pageSize);
|
|
22114
|
-
if (["company_attachments", "company_note_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
|
|
22270
|
+
if (["company_attachments", "company_note_attachments", "configuration_item_attachments", "task_attachments", "task_note_attachments"].includes(config.key)) this.getUdfInfo = async () => {
|
|
22115
22271
|
throw new OperationNotSupportedError(config.key, "getUdfInfo");
|
|
22116
22272
|
};
|
|
22117
|
-
if (config.ops?.create === false || ["company_attachments", "
|
|
22273
|
+
if (config.ops?.create === false || isScopedAttachmentResource(config.key) || ["company_attachments", "task_predecessors"].includes(config.key)) this.createIfNotExists = async () => {
|
|
22118
22274
|
throw new OperationNotSupportedError(config.key, "createIfNotExists");
|
|
22119
22275
|
};
|
|
22120
22276
|
if (config.key === "task_notes") {
|
|
@@ -22147,17 +22303,17 @@ var GenericResource = class extends BaseResource {
|
|
|
22147
22303
|
async getScopedModel(parentId, id, fresh = false) {
|
|
22148
22304
|
const model = await super.getScopedModel(parentId, id, fresh);
|
|
22149
22305
|
const key = this.config.key;
|
|
22150
|
-
if (key
|
|
22306
|
+
if (isScopedAttachmentResource(key)) assertScopedAttachmentIdentity(key, model, parentId, id);
|
|
22151
22307
|
return model;
|
|
22152
22308
|
}
|
|
22153
22309
|
async fetchPage(params, page, pageSize, state2) {
|
|
22154
22310
|
const key = this.config.key;
|
|
22155
|
-
if (key
|
|
22311
|
+
if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
|
|
22156
22312
|
return super.fetchPage(params, page, pageSize, state2);
|
|
22157
22313
|
}
|
|
22158
22314
|
async countGlobal(params) {
|
|
22159
22315
|
const key = this.config.key;
|
|
22160
|
-
if (key
|
|
22316
|
+
if (isScopedAttachmentResource(key)) admitScopedAttachmentQuery(key, params);
|
|
22161
22317
|
return super.countGlobal(params);
|
|
22162
22318
|
}
|
|
22163
22319
|
/** Query records with the G3 filter surface (server-side JSON filter). */
|
|
@@ -22199,8 +22355,11 @@ var GenericResource = class extends BaseResource {
|
|
|
22199
22355
|
const data2 = this.config.key === "task_predecessors" ? admitTaskPredecessor(b, parentId, true) : b;
|
|
22200
22356
|
const opts2 = this.config.key === "task_predecessors" ? { ...c } : c ?? {};
|
|
22201
22357
|
if (this.config.key === "task_notes") admitTaskNote(data2, parentId, true);
|
|
22202
|
-
|
|
22203
|
-
if (
|
|
22358
|
+
const key = this.config.key;
|
|
22359
|
+
if (isScopedAttachmentResource(key)) {
|
|
22360
|
+
if (key === "task_attachments") admitTaskAttachment(data2, parentId);
|
|
22361
|
+
else admitFileAttachment(key, data2, parentId);
|
|
22362
|
+
}
|
|
22204
22363
|
if (this.config.key === "task_predecessors") await guardTaskPredecessor(this.http, parentId, void 0, data2);
|
|
22205
22364
|
if (opts2.dryRun === true) return this.runCreateDryRun(data2, parentId);
|
|
22206
22365
|
return this.createScopedRaw(parentId, data2, opts2);
|
|
@@ -23991,7 +24150,7 @@ function dateBucketLabel(value, bucket) {
|
|
|
23991
24150
|
var queryResourceKeysPromise = null;
|
|
23992
24151
|
function queryResourceKeys() {
|
|
23993
24152
|
if (queryResourceKeysPromise === null) {
|
|
23994
|
-
queryResourceKeysPromise =
|
|
24153
|
+
queryResourceKeysPromise = chunk3FZJJX5B_cjs.loadCapabilityRecords().then((records) => {
|
|
23995
24154
|
const s = /* @__PURE__ */ new Set();
|
|
23996
24155
|
for (const rec of records) if (rec.operation === "query") s.add(rec.resource);
|
|
23997
24156
|
return s;
|
|
@@ -24113,7 +24272,7 @@ function parseTopAndLimit(opts, problems) {
|
|
|
24113
24272
|
return { top, limit };
|
|
24114
24273
|
}
|
|
24115
24274
|
async function checkFieldNames(resourceKey, conditions, opts, problems) {
|
|
24116
|
-
const records = resourceKey === void 0 ? [] : await
|
|
24275
|
+
const records = resourceKey === void 0 ? [] : await chunk3FZJJX5B_cjs.loadCapabilityRecords();
|
|
24117
24276
|
const record = resourceKey === void 0 ? void 0 : records.find((r) => r.resource === resourceKey && r.operation === "query");
|
|
24118
24277
|
if (record === void 0) return void 0;
|
|
24119
24278
|
const strings = (v) => Array.isArray(v) ? v.filter((f) => typeof f === "string" && f.trim() !== "") : [];
|
|
@@ -24758,7 +24917,7 @@ async function uiLink(client, input) {
|
|
|
24758
24917
|
var indexPromise = null;
|
|
24759
24918
|
function operationIndex() {
|
|
24760
24919
|
if (indexPromise === null) {
|
|
24761
|
-
indexPromise =
|
|
24920
|
+
indexPromise = chunk3FZJJX5B_cjs.loadCapabilityRecords().then((records) => new Map(records.map((r) => [r.id, r])));
|
|
24762
24921
|
}
|
|
24763
24922
|
return indexPromise;
|
|
24764
24923
|
}
|