node-autotask 0.92.1 → 0.93.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 +5 -0
- package/MCP_TOOL_CATALOG.json +255 -9
- package/README.md +1 -1
- package/capabilities.json +1042 -222
- package/dist/capabilities-data.js +1296 -476
- package/dist/capabilities.cjs +4 -4
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-QC45KFQQ.cjs → chunk-2FM7MRK2.cjs} +32 -30
- package/dist/{chunk-C7KZ7PB3.js → chunk-3SURRIOQ.js} +4 -2
- package/dist/{chunk-2MC3LDZU.js → chunk-DCISF6AG.js} +3 -3
- package/dist/{chunk-QVDXIXY4.js → chunk-FCQPZAIK.js} +2 -2
- package/dist/{chunk-4BICEQ4S.js → chunk-HJKI5VVJ.js} +188 -13
- package/dist/{chunk-QXJQIZCT.cjs → chunk-SBHQIPCJ.cjs} +3 -3
- package/dist/{chunk-JY6BQUPO.cjs → chunk-X7FGWEZ2.cjs} +202 -202
- package/dist/{chunk-LYAHXYZR.cjs → chunk-ZIBH42H3.cjs} +193 -18
- package/dist/{index-B0p5O-2e.d.cts → index-Cbos4Wgx.d.cts} +71 -1
- package/dist/{index-B0p5O-2e.d.ts → index-Cbos4Wgx.d.ts} +71 -1
- package/dist/{index-opnSlg90.d.cts → index-CnNxnu7M.d.cts} +9 -2
- package/dist/{index-it9IqLsM.d.ts → index-coyFHSSF.d.ts} +9 -2
- package/dist/index.cjs +86 -86
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- 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 +4 -2
- package/examples/mcp-server-http.ts +6 -3
- package/package.json +1 -1
package/dist/capabilities.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSBHQIPCJ_cjs = require('./chunk-SBHQIPCJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "CAPABILITY_PLAN_HASHES", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkSBHQIPCJ_cjs.CAPABILITY_PLAN_HASHES; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "loadCapabilities", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkSBHQIPCJ_cjs.loadCapabilities; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "loadCapabilityRecords", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkSBHQIPCJ_cjs.loadCapabilityRecords; }
|
|
18
18
|
});
|
package/dist/capabilities.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-
|
|
1
|
+
export { CAPABILITY_PLAN_HASHES, loadCapabilities, loadCapabilityRecords } from './chunk-DCISF6AG.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkX7FGWEZ2_cjs = require('./chunk-X7FGWEZ2.cjs');
|
|
4
|
+
var chunkZIBH42H3_cjs = require('./chunk-ZIBH42H3.cjs');
|
|
5
5
|
|
|
6
6
|
// src/client.ts
|
|
7
7
|
var AutotaskClient = class {
|
|
@@ -97,6 +97,7 @@ var AutotaskClient = class {
|
|
|
97
97
|
organizationalLevel1s;
|
|
98
98
|
organizationalLevel2s;
|
|
99
99
|
organizationalLevelAssociations;
|
|
100
|
+
organizationalResources;
|
|
100
101
|
phases;
|
|
101
102
|
products;
|
|
102
103
|
productVendors;
|
|
@@ -114,6 +115,7 @@ var AutotaskClient = class {
|
|
|
114
115
|
quotes;
|
|
115
116
|
quoteTemplates;
|
|
116
117
|
resourceAttachments;
|
|
118
|
+
resourceDailyAvailabilities;
|
|
117
119
|
resourceRoleQueues;
|
|
118
120
|
resourceRoles;
|
|
119
121
|
resources;
|
|
@@ -178,34 +180,34 @@ var AutotaskClient = class {
|
|
|
178
180
|
* anything is wired. Construction issues NO request.
|
|
179
181
|
*/
|
|
180
182
|
constructor(options) {
|
|
181
|
-
this.config =
|
|
182
|
-
this.http = new
|
|
183
|
+
this.config = chunkZIBH42H3_cjs.resolveConfig(options);
|
|
184
|
+
this.http = new chunkZIBH42H3_cjs.HttpClient(this.config);
|
|
183
185
|
this.http.client = this;
|
|
184
|
-
for (const entry of
|
|
185
|
-
this[entry.accessor] = new
|
|
186
|
+
for (const entry of chunkZIBH42H3_cjs.SIMPLE_RESOURCES) {
|
|
187
|
+
this[entry.accessor] = new chunkZIBH42H3_cjs.GenericResource(this.http, entry, this.config.pageSize);
|
|
186
188
|
}
|
|
187
|
-
this.companies = new
|
|
188
|
-
this.configurationItems = new
|
|
189
|
-
this.contacts = new
|
|
190
|
-
this.contracts = new
|
|
191
|
-
this.inventoryProducts = new
|
|
192
|
-
this.invoices = new
|
|
193
|
-
this.quotes = new
|
|
194
|
-
this.resourceTimeOffAdditional = new
|
|
195
|
-
this.resourceTimeOffBalances = new
|
|
196
|
-
this.resources = new
|
|
197
|
-
this.serviceCalls = new
|
|
198
|
-
this.ticketCharges = new
|
|
199
|
-
this.tickets = new
|
|
200
|
-
this.timeEntries = new
|
|
201
|
-
this.timeOffRequests = new
|
|
202
|
-
this.authenticateResource = new
|
|
203
|
-
this.entityInformation = new
|
|
204
|
-
this.modules = new
|
|
205
|
-
this.thresholdInformation = new
|
|
206
|
-
this.version = new
|
|
207
|
-
this.versionInformation = new
|
|
208
|
-
this.zoneInformation = new
|
|
189
|
+
this.companies = new chunkZIBH42H3_cjs.CompaniesResource(this.http, this.config.pageSize);
|
|
190
|
+
this.configurationItems = new chunkX7FGWEZ2_cjs.ConfigurationItemsResource(this.http, this.config.pageSize);
|
|
191
|
+
this.contacts = new chunkX7FGWEZ2_cjs.ContactsResource(this.http, this.config.pageSize);
|
|
192
|
+
this.contracts = new chunkZIBH42H3_cjs.ContractsResource(this.http, this.config.pageSize);
|
|
193
|
+
this.inventoryProducts = new chunkX7FGWEZ2_cjs.InventoryProductsResource(this.http, this.config.pageSize);
|
|
194
|
+
this.invoices = new chunkZIBH42H3_cjs.InvoicesResource(this.http, this.config.pageSize);
|
|
195
|
+
this.quotes = new chunkX7FGWEZ2_cjs.QuotesResource(this.http, this.config.pageSize);
|
|
196
|
+
this.resourceTimeOffAdditional = new chunkX7FGWEZ2_cjs.ResourceTimeOffAdditionalResource(this.http, this.config.pageSize);
|
|
197
|
+
this.resourceTimeOffBalances = new chunkX7FGWEZ2_cjs.ResourceTimeOffBalancesResource(this.http, this.config.pageSize);
|
|
198
|
+
this.resources = new chunkX7FGWEZ2_cjs.ResourcesResource(this.http, this.config, this.config.pageSize);
|
|
199
|
+
this.serviceCalls = new chunkX7FGWEZ2_cjs.ServiceCallsResource(this.http, this.config.pageSize);
|
|
200
|
+
this.ticketCharges = new chunkX7FGWEZ2_cjs.TicketChargesResource(this.http, this.config.pageSize);
|
|
201
|
+
this.tickets = new chunkX7FGWEZ2_cjs.TicketsResource(this.http, this.config.pageSize);
|
|
202
|
+
this.timeEntries = new chunkZIBH42H3_cjs.TimeEntriesResource(this.http, this.config.pageSize);
|
|
203
|
+
this.timeOffRequests = new chunkX7FGWEZ2_cjs.TimeOffRequestsResource(this.http, this.config.pageSize);
|
|
204
|
+
this.authenticateResource = new chunkX7FGWEZ2_cjs.AuthenticateResource(this.http);
|
|
205
|
+
this.entityInformation = new chunkX7FGWEZ2_cjs.EntityInformationResource(this.http);
|
|
206
|
+
this.modules = new chunkX7FGWEZ2_cjs.ModulesResource(this.http);
|
|
207
|
+
this.thresholdInformation = new chunkX7FGWEZ2_cjs.ThresholdInformationResource(this.http);
|
|
208
|
+
this.version = new chunkX7FGWEZ2_cjs.VersionResource(this.http);
|
|
209
|
+
this.versionInformation = new chunkX7FGWEZ2_cjs.VersionInformationResource(this.http);
|
|
210
|
+
this.zoneInformation = new chunkX7FGWEZ2_cjs.ZoneInformationResource(this.http);
|
|
209
211
|
}
|
|
210
212
|
/**
|
|
211
213
|
* `GET /V1.0/Authenticate` → `AuthTokenResultModel` (as-is). The SDK does
|
|
@@ -239,10 +241,10 @@ var AutotaskClient = class {
|
|
|
239
241
|
* parameter on each: `await client.withSignal(signal, () => invoke(client, ...))`.
|
|
240
242
|
*/
|
|
241
243
|
withSignal(signal, fn) {
|
|
242
|
-
return
|
|
244
|
+
return chunkZIBH42H3_cjs.runWithSignal(signal, fn);
|
|
243
245
|
}
|
|
244
246
|
async batch(fn, items, opts = {}) {
|
|
245
|
-
return
|
|
247
|
+
return chunkZIBH42H3_cjs.runBounded(fn, items, { ...opts, concurrency: opts.concurrency ?? this.config.maxConcurrent });
|
|
246
248
|
}
|
|
247
249
|
};
|
|
248
250
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-
|
|
2
|
-
import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-
|
|
1
|
+
import { ConfigurationItemsResource, ContactsResource, InventoryProductsResource, QuotesResource, ResourceTimeOffAdditionalResource, ResourceTimeOffBalancesResource, ResourcesResource, ServiceCallsResource, TicketChargesResource, TicketsResource, TimeOffRequestsResource, AuthenticateResource, EntityInformationResource, ModulesResource, ThresholdInformationResource, VersionResource, VersionInformationResource, ZoneInformationResource } from './chunk-FCQPZAIK.js';
|
|
2
|
+
import { resolveConfig, HttpClient, SIMPLE_RESOURCES, GenericResource, CompaniesResource, ContractsResource, InvoicesResource, TimeEntriesResource, runWithSignal, runBounded } from './chunk-HJKI5VVJ.js';
|
|
3
3
|
|
|
4
4
|
// src/client.ts
|
|
5
5
|
var AutotaskClient = class {
|
|
@@ -95,6 +95,7 @@ var AutotaskClient = class {
|
|
|
95
95
|
organizationalLevel1s;
|
|
96
96
|
organizationalLevel2s;
|
|
97
97
|
organizationalLevelAssociations;
|
|
98
|
+
organizationalResources;
|
|
98
99
|
phases;
|
|
99
100
|
products;
|
|
100
101
|
productVendors;
|
|
@@ -112,6 +113,7 @@ var AutotaskClient = class {
|
|
|
112
113
|
quotes;
|
|
113
114
|
quoteTemplates;
|
|
114
115
|
resourceAttachments;
|
|
116
|
+
resourceDailyAvailabilities;
|
|
115
117
|
resourceRoleQueues;
|
|
116
118
|
resourceRoles;
|
|
117
119
|
resources;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/capabilities.ts
|
|
2
2
|
var CAPABILITY_PLAN_HASHES = {
|
|
3
|
-
"B": "
|
|
4
|
-
"A": "
|
|
5
|
-
"operations": "
|
|
3
|
+
"B": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901",
|
|
4
|
+
"A": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901",
|
|
5
|
+
"operations": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901"
|
|
6
6
|
};
|
|
7
7
|
var cached = null;
|
|
8
8
|
function loadCapabilities() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenericResource, readTasks, OperationNotSupportedError, rejectInventoryFactsOption, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-
|
|
2
|
-
import { loadCapabilityRecords } from './chunk-
|
|
1
|
+
import { GenericResource, readTasks, OperationNotSupportedError, rejectInventoryFactsOption, parseIdentifier, AutotaskConfigError, isRecord, isDateYMD, isAutotaskError, RateLimitError, MaintenanceError, AutotaskError, StaleObjectError, buildDryRunResult, createNamePlan, resolveCompositeNames, addNameSibling, NotFoundError, unwrapItems, ConflictError, clientOf, compositePartLimit, invokeRead, compositePart, openTicketsOfPart, unwrapOperation, unwrapItem, ResolutionError, joinedCompositePart, runMove, resolveTicketStatusSemantics, openStatusFilter, isClosedStatus, vendorId, resolveLineOfBusinessChain, cachedRecordGet, uiLinkFor, refuse, queryRows, mergePartialBody, TICKET_LABEL_FIELDS, addLabelSibling, parseVendorErrors, RELATIONSHIP_MAP, cursorToPath } from './chunk-HJKI5VVJ.js';
|
|
2
|
+
import { loadCapabilityRecords } from './chunk-DCISF6AG.js';
|
|
3
3
|
|
|
4
4
|
// src/resources/special/configuration_items.ts
|
|
5
5
|
async function fetchRecord(http, path, label, readOpts) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadCapabilityRecords } from './chunk-
|
|
1
|
+
import { loadCapabilityRecords } from './chunk-DCISF6AG.js';
|
|
2
2
|
import { NoopLogger, REDACTED, deepMarkUntrusted, wrapUntrusted } from './chunk-X6VWD6WW.js';
|
|
3
3
|
import { randomUUID, createHash } from 'crypto';
|
|
4
4
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
@@ -6051,7 +6051,26 @@ var RELATIONSHIP_MAP = {
|
|
|
6051
6051
|
"workflowResource": false,
|
|
6052
6052
|
"group": "B",
|
|
6053
6053
|
"parent": null,
|
|
6054
|
-
"children": [
|
|
6054
|
+
"children": [
|
|
6055
|
+
{
|
|
6056
|
+
"resource": "organizational_resources",
|
|
6057
|
+
"apiEntity": "OrganizationalResource",
|
|
6058
|
+
"parentField": "organizationalLevelAssociationID",
|
|
6059
|
+
"parentSegment": "Resources",
|
|
6060
|
+
"tier": "advanced",
|
|
6061
|
+
"workflowResource": false,
|
|
6062
|
+
"specialOps": [
|
|
6063
|
+
"listByParent"
|
|
6064
|
+
],
|
|
6065
|
+
"searchCovers": null,
|
|
6066
|
+
"scopedOps": {
|
|
6067
|
+
"create": false,
|
|
6068
|
+
"query": true,
|
|
6069
|
+
"update": false,
|
|
6070
|
+
"delete": false
|
|
6071
|
+
}
|
|
6072
|
+
}
|
|
6073
|
+
],
|
|
6055
6074
|
"naturalKeys": {
|
|
6056
6075
|
"hasSearch": false,
|
|
6057
6076
|
"searchCovers": null,
|
|
@@ -7302,6 +7321,24 @@ var RELATIONSHIP_MAP = {
|
|
|
7302
7321
|
"delete": true
|
|
7303
7322
|
}
|
|
7304
7323
|
},
|
|
7324
|
+
{
|
|
7325
|
+
"resource": "resource_daily_availabilities",
|
|
7326
|
+
"apiEntity": "ResourceDailyAvailability",
|
|
7327
|
+
"parentField": "resourceID",
|
|
7328
|
+
"parentSegment": "DailyAvailabilities",
|
|
7329
|
+
"tier": "advanced",
|
|
7330
|
+
"workflowResource": false,
|
|
7331
|
+
"specialOps": [
|
|
7332
|
+
"listByParent"
|
|
7333
|
+
],
|
|
7334
|
+
"searchCovers": null,
|
|
7335
|
+
"scopedOps": {
|
|
7336
|
+
"create": false,
|
|
7337
|
+
"query": true,
|
|
7338
|
+
"update": false,
|
|
7339
|
+
"delete": false
|
|
7340
|
+
}
|
|
7341
|
+
},
|
|
7305
7342
|
{
|
|
7306
7343
|
"resource": "resource_role_queues",
|
|
7307
7344
|
"apiEntity": "ResourceRoleQueue",
|
|
@@ -11125,6 +11162,56 @@ var RELATIONSHIP_MAP = {
|
|
|
11125
11162
|
"zoneFacts": null,
|
|
11126
11163
|
"deleteBoundary": null,
|
|
11127
11164
|
"markerField": null
|
|
11165
|
+
},
|
|
11166
|
+
"resource_daily_availabilities": {
|
|
11167
|
+
"resource": "resource_daily_availabilities",
|
|
11168
|
+
"apiEntity": "ResourceDailyAvailability",
|
|
11169
|
+
"kind": "entity",
|
|
11170
|
+
"path": "ResourceDailyAvailabilities",
|
|
11171
|
+
"parentScoped": true,
|
|
11172
|
+
"tier": "advanced",
|
|
11173
|
+
"workflowResource": false,
|
|
11174
|
+
"group": "B",
|
|
11175
|
+
"parent": {
|
|
11176
|
+
"resource": "resources",
|
|
11177
|
+
"segment": "DailyAvailabilities",
|
|
11178
|
+
"field": "resourceID"
|
|
11179
|
+
},
|
|
11180
|
+
"children": [],
|
|
11181
|
+
"naturalKeys": {
|
|
11182
|
+
"hasSearch": false,
|
|
11183
|
+
"searchCovers": null,
|
|
11184
|
+
"findBy": []
|
|
11185
|
+
},
|
|
11186
|
+
"blindSurfaces": null,
|
|
11187
|
+
"zoneFacts": null,
|
|
11188
|
+
"deleteBoundary": null,
|
|
11189
|
+
"markerField": null
|
|
11190
|
+
},
|
|
11191
|
+
"organizational_resources": {
|
|
11192
|
+
"resource": "organizational_resources",
|
|
11193
|
+
"apiEntity": "OrganizationalResource",
|
|
11194
|
+
"kind": "entity",
|
|
11195
|
+
"path": "OrganizationalResources",
|
|
11196
|
+
"parentScoped": true,
|
|
11197
|
+
"tier": "advanced",
|
|
11198
|
+
"workflowResource": false,
|
|
11199
|
+
"group": "B",
|
|
11200
|
+
"parent": {
|
|
11201
|
+
"resource": "organizational_level_associations",
|
|
11202
|
+
"segment": "Resources",
|
|
11203
|
+
"field": "organizationalLevelAssociationID"
|
|
11204
|
+
},
|
|
11205
|
+
"children": [],
|
|
11206
|
+
"naturalKeys": {
|
|
11207
|
+
"hasSearch": false,
|
|
11208
|
+
"searchCovers": null,
|
|
11209
|
+
"findBy": []
|
|
11210
|
+
},
|
|
11211
|
+
"blindSurfaces": null,
|
|
11212
|
+
"zoneFacts": null,
|
|
11213
|
+
"deleteBoundary": null,
|
|
11214
|
+
"markerField": null
|
|
11128
11215
|
}
|
|
11129
11216
|
};
|
|
11130
11217
|
var BLIND_SURFACE_STAMPS = {
|
|
@@ -16604,6 +16691,9 @@ var UNTRUSTED_FIELDS_BY_RESOURCE = {
|
|
|
16604
16691
|
"shipping_types": [
|
|
16605
16692
|
"description",
|
|
16606
16693
|
"name"
|
|
16694
|
+
],
|
|
16695
|
+
"resource_daily_availabilities": [
|
|
16696
|
+
"travelAvailability"
|
|
16607
16697
|
]
|
|
16608
16698
|
};
|
|
16609
16699
|
|
|
@@ -17062,11 +17152,22 @@ function auditReadTarget(path, operation) {
|
|
|
17062
17152
|
function isKnowledgeBaseRootResource(resource) {
|
|
17063
17153
|
return resource === "knowledge_base_categories" || resource === "knowledge_base_articles";
|
|
17064
17154
|
}
|
|
17155
|
+
var STAFF_COLLECTION_PATHS = {
|
|
17156
|
+
organizational_resources: /^\/v1\.0\/OrganizationalLevelAssociations\/\d+\/Resources\/?$/i,
|
|
17157
|
+
resource_daily_availabilities: /^\/v1\.0\/Resources\/\d+\/DailyAvailabilities\/?$/i
|
|
17158
|
+
};
|
|
17159
|
+
function hasNativeStaffCollection(resource) {
|
|
17160
|
+
return Object.hasOwn(STAFF_COLLECTION_PATHS, resource);
|
|
17161
|
+
}
|
|
17065
17162
|
function isExactRecordResource(resource) {
|
|
17066
|
-
return resource === "inventory_locations" || resource === "inventory_items" || resource === "internal_locations" || resource === "shipping_types" || isKnowledgeBaseRootResource(resource);
|
|
17163
|
+
return hasNativeStaffCollection(resource) || resource === "inventory_locations" || resource === "inventory_items" || resource === "internal_locations" || resource === "shipping_types" || isKnowledgeBaseRootResource(resource);
|
|
17067
17164
|
}
|
|
17068
|
-
var EXACT_RECORD_PATH = /^\/v1\.0\/(?:InventoryLocations|InventoryItems|InternalLocations|ShippingTypes|KnowledgeBaseArticles|KnowledgeBaseCategories(?:\/\d+\/KnowledgeBaseArticles)?)(?:\/(query(?:\/(?:next|previous|count))?|\d+))?\/?$/i;
|
|
17165
|
+
var EXACT_RECORD_PATH = /^\/v1\.0\/(?:OrganizationalResources|ResourceDailyAvailabilities|InventoryLocations|InventoryItems|InternalLocations|ShippingTypes|KnowledgeBaseArticles|KnowledgeBaseCategories(?:\/\d+\/KnowledgeBaseArticles)?)(?:\/(query(?:\/(?:next|previous|count))?|\d+))?\/?$/i;
|
|
17069
17166
|
function exactRecordResponseTarget(path, method, operation) {
|
|
17167
|
+
if (method === "GET" && operation?.endsWith(".listByParent")) {
|
|
17168
|
+
const resource = operation.slice(0, -".listByParent".length);
|
|
17169
|
+
if (hasNativeStaffCollection(resource) && STAFF_COLLECTION_PATHS[resource].test(path)) return "query";
|
|
17170
|
+
}
|
|
17070
17171
|
const match = EXACT_RECORD_PATH.exec(path);
|
|
17071
17172
|
if (match === null) return void 0;
|
|
17072
17173
|
const suffix = match[1]?.toLowerCase();
|
|
@@ -17134,7 +17235,7 @@ function validateExactRecordResponse(body, target, path, method, requestBody, op
|
|
|
17134
17235
|
if (String(id) !== expectedId) {
|
|
17135
17236
|
throw new AutotaskConfigError(`returned ${resource} id must match the requested id`, { operation });
|
|
17136
17237
|
}
|
|
17137
|
-
if (parts.length === 6) {
|
|
17238
|
+
if (entity === "knowledgebasearticles" && parts.length === 6) {
|
|
17138
17239
|
const parent = ownField(item, "articleCategoryID");
|
|
17139
17240
|
if (typeof parent !== "number" || !Number.isInteger(parent) || parent <= 0 || parent > 2147483647) {
|
|
17140
17241
|
invalid("Expected a valid category ID in the Knowledge Base article response");
|
|
@@ -17160,13 +17261,22 @@ function decodeResponseJson(text, auditTarget, recordTarget, path) {
|
|
|
17160
17261
|
}
|
|
17161
17262
|
const idTokens = /* @__PURE__ */ new WeakMap();
|
|
17162
17263
|
const receiptTokens = /* @__PURE__ */ new WeakMap();
|
|
17163
|
-
const
|
|
17164
|
-
const
|
|
17264
|
+
const signedIdTokens = /* @__PURE__ */ new WeakMap();
|
|
17265
|
+
const nativeStaffQuery = recordTarget === "query" && path !== void 0;
|
|
17266
|
+
const organizationalList = nativeStaffQuery && STAFF_COLLECTION_PATHS.organizational_resources.test(path);
|
|
17267
|
+
const nativeParentField = organizationalList ? "organizationalLevelAssociationID" : nativeStaffQuery && STAFF_COLLECTION_PATHS.resource_daily_availabilities.test(path) ? "resourceID" : void 0;
|
|
17268
|
+
const invalidNativeParents = nativeParentField === void 0 ? void 0 : /* @__PURE__ */ new WeakSet();
|
|
17269
|
+
const organizationalRead = organizationalList || path !== void 0 && (target === "query" || target === "item") && /^\/v1\.0\/OrganizationalResources\//i.test(path);
|
|
17270
|
+
const signedIdField = organizationalRead ? "soapParentPropertyId" : path !== void 0 && /^\/v1\.0\/InternalLocations\//i.test(path) ? "holidaySetId" : void 0;
|
|
17165
17271
|
const body = JSON.parse(text, function(key, value, context) {
|
|
17166
17272
|
if (typeof value === "number" && context?.source !== void 0) {
|
|
17167
|
-
|
|
17168
|
-
if (key === "
|
|
17169
|
-
if (
|
|
17273
|
+
const token = context.source;
|
|
17274
|
+
if (key === "id") idTokens.set(this, token);
|
|
17275
|
+
if (key === "itemId" && target === "mutation") receiptTokens.set(this, token);
|
|
17276
|
+
if (key === signedIdField) signedIdTokens.set(this, token);
|
|
17277
|
+
if (key === nativeParentField && (!isAuditDecimalId(token) || value > 2147483647)) {
|
|
17278
|
+
invalidNativeParents?.add(this);
|
|
17279
|
+
}
|
|
17170
17280
|
}
|
|
17171
17281
|
return value;
|
|
17172
17282
|
});
|
|
@@ -17174,9 +17284,12 @@ function decodeResponseJson(text, auditTarget, recordTarget, path) {
|
|
|
17174
17284
|
if (Array.isArray(rows)) {
|
|
17175
17285
|
for (const row of rows) {
|
|
17176
17286
|
if (!isRecord2(row)) continue;
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17287
|
+
if (nativeParentField !== void 0 && invalidNativeParents?.has(row)) {
|
|
17288
|
+
row[nativeParentField] = null;
|
|
17289
|
+
}
|
|
17290
|
+
const signedId = signedIdTokens.get(row);
|
|
17291
|
+
if (signedIdField !== void 0 && signedId !== void 0 && !Number.isSafeInteger(row[signedIdField]) && isSignedInt64Token(signedId)) {
|
|
17292
|
+
row[signedIdField] = signedId;
|
|
17180
17293
|
}
|
|
17181
17294
|
const key = target === "mutation" && ownField(row, "itemId") !== void 0 ? "itemId" : "id";
|
|
17182
17295
|
const value = ownField(row, key);
|
|
@@ -17226,6 +17339,16 @@ function attachEmptyReasonDetails(err) {
|
|
|
17226
17339
|
err.details = { ...err.details ?? {} };
|
|
17227
17340
|
if (stamp !== void 0) {
|
|
17228
17341
|
err.details.emptyReason = stamp;
|
|
17342
|
+
} else if (isGetMiss && hasNativeStaffCollection(resource)) {
|
|
17343
|
+
const remedy = `Verify the ID with ${resource}.query and an exact id filter, or use ${resource}.listByParent with the known parent ID. Check the API user's permissions.`;
|
|
17344
|
+
err.suggestedAction = remedy;
|
|
17345
|
+
err.details.emptyReason = {
|
|
17346
|
+
surface,
|
|
17347
|
+
kind: "not-found",
|
|
17348
|
+
authority: `${resource}.query`,
|
|
17349
|
+
note: "No record at this ID was visible to this API user.",
|
|
17350
|
+
remedy
|
|
17351
|
+
};
|
|
17229
17352
|
} else if (isGetMiss) {
|
|
17230
17353
|
const blind = BLIND_SURFACE_STAMPS[resource]?.query;
|
|
17231
17354
|
err.details.emptyReason = blind !== void 0 ? {
|
|
@@ -20633,6 +20756,7 @@ var MODEL_FIELD_SETS = {
|
|
|
20633
20756
|
"organizational_level1s": ["id", "description", "isActive", "name"],
|
|
20634
20757
|
"organizational_level2s": ["id", "description", "isActive", "name"],
|
|
20635
20758
|
"organizational_level_associations": ["id", "isActive", "organizationalLevel1ID", "organizationalLevel2ID"],
|
|
20759
|
+
"organizational_resources": ["id", "organizationalLevelAssociationID", "resourceID", "soapParentPropertyId"],
|
|
20636
20760
|
"phases": ["id", "createDate", "creatorResourceID", "description", "dueDate", "estimatedHours", "externalID", "isScheduled", "lastActivityDateTime", "parentPhaseID", "phaseNumber", "projectID", "startDate", "title", "soapParentPropertyId"],
|
|
20637
20761
|
"product_vendors": ["id", "isActive", "isDefault", "productID", "vendorCost", "vendorID", "vendorPartNumber", "soapParentPropertyId"],
|
|
20638
20762
|
"products": ["id", "billingType", "chargeBillingCodeID", "createdByResourceID", "createdTime", "defaultVendorID", "description", "doesNotRequireProcurement", "externalProductID", "impersonatorCreatorResourceID", "internalProductID", "isActive", "isEligibleForRma", "isSerialized", "link", "manufacturerName", "manufacturerProductName", "markupRate", "msrp", "name", "periodType", "priceCostMethod", "productBillingCodeID", "productCategory", "sku", "unitCost", "unitPrice", "vendorProductNumber", "defaultInstalledProductCategoryID", "userDefinedFields"],
|
|
@@ -20650,6 +20774,7 @@ var MODEL_FIELD_SETS = {
|
|
|
20650
20774
|
"quote_templates": ["id", "calculateTaxSeparately", "createDate", "createdBy", "currencyNegativeFormat", "currencyPositiveFormat", "dateFormat", "description", "displayTaxCategorySuperscripts", "isActive", "lastActivityBy", "lastActivityDate", "name", "numberFormat", "pageLayout", "pageNumberFormat", "showEachTaxInGroup", "showGridHeader", "showTaxCategory", "showVerticalGridLines"],
|
|
20651
20775
|
"quotes": ["id", "approvalStatus", "approvalStatusChangedByResourceID", "approvalStatusChangedDate", "billToLocationID", "calculateTaxSeparately", "comment", "companyID", "contactID", "createDate", "creatorResourceID", "description", "effectiveDate", "expirationDate", "extApprovalContactResponse", "extApprovalResponseDate", "extApprovalResponseSignature", "externalQuoteNumber", "groupByID", "impersonatorCreatorResourceID", "isActive", "lastActivityDate", "lastModifiedBy", "lastPublishedByResourceID", "lastPublishedDateTime", "name", "opportunityID", "paymentTerm", "paymentType", "primaryQuote", "proposalProjectID", "purchaseOrderNumber", "quoteNumber", "quoteTemplateID", "shippingType", "shipToLocationID", "showEachTaxInGroup", "showTaxCategory", "soldToLocationID", "taxRegionID"],
|
|
20652
20776
|
"resource_attachments": ["id", "attachDate", "attachedByContactID", "attachedByResourceID", "attachmentType", "contentType", "creatorType", "fileSize", "fullPath", "impersonatorCreatorResourceID", "opportunityID", "parentID", "publish", "resourceID", "title", "data", "parentType", "soapParentPropertyId", "isTaskAttachment"],
|
|
20777
|
+
"resource_daily_availabilities": ["id", "resourceID", "sundayAvailableHours", "mondayAvailableHours", "tuesdayAvailableHours", "wednesdayAvailableHours", "thursdayAvailableHours", "fridayAvailableHours", "saturdayAvailableHours", "weeklyBillableHoursGoal", "travelAvailability", "soapParentPropertyId"],
|
|
20653
20778
|
"resource_role_queues": ["id", "queueID", "resourceID", "soapParentPropertyId"],
|
|
20654
20779
|
"resource_roles": ["id", "departmentID", "isActive", "queueID", "resourceID", "roleID", "soapParentPropertyId"],
|
|
20655
20780
|
"resource_skills": ["id", "resourceID", "skillDescription", "skillID", "skillLevel", "soapParentPropertyId"],
|
|
@@ -24519,6 +24644,19 @@ var SIMPLE_RESOURCES = [
|
|
|
24519
24644
|
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
24520
24645
|
opForms: { get: "global", create: "global", update: "global" }
|
|
24521
24646
|
},
|
|
24647
|
+
{
|
|
24648
|
+
key: "organizational_resources",
|
|
24649
|
+
accessor: "organizationalResources",
|
|
24650
|
+
resourcePath: "/V1.0/OrganizationalResources",
|
|
24651
|
+
parentScopedPath: "/V1.0/OrganizationalLevelAssociations/{parentId}/Resources",
|
|
24652
|
+
parentPath: "/V1.0/OrganizationalLevelAssociations",
|
|
24653
|
+
parentField: "organizationalLevelAssociationID",
|
|
24654
|
+
deletable: false,
|
|
24655
|
+
udfCapable: false,
|
|
24656
|
+
ops: { query: true, queryAll: false, count: true, get: true, create: false, update: false, delete: false, getEntityInfo: true, getFieldInfo: true, getUdfInfo: true },
|
|
24657
|
+
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
24658
|
+
opForms: { get: "global" }
|
|
24659
|
+
},
|
|
24522
24660
|
{
|
|
24523
24661
|
key: "phases",
|
|
24524
24662
|
accessor: "phases",
|
|
@@ -24728,6 +24866,19 @@ var SIMPLE_RESOURCES = [
|
|
|
24728
24866
|
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
24729
24867
|
opForms: { get: "scoped", create: "scoped", delete: "scoped" }
|
|
24730
24868
|
},
|
|
24869
|
+
{
|
|
24870
|
+
key: "resource_daily_availabilities",
|
|
24871
|
+
accessor: "resourceDailyAvailabilities",
|
|
24872
|
+
resourcePath: "/V1.0/ResourceDailyAvailabilities",
|
|
24873
|
+
parentScopedPath: "/V1.0/Resources/{parentId}/DailyAvailabilities",
|
|
24874
|
+
parentPath: "/V1.0/Resources",
|
|
24875
|
+
parentField: "resourceID",
|
|
24876
|
+
deletable: false,
|
|
24877
|
+
udfCapable: false,
|
|
24878
|
+
ops: { query: true, queryAll: false, count: true, get: true, create: false, update: false, delete: false, getEntityInfo: true, getFieldInfo: true, getUdfInfo: true },
|
|
24879
|
+
helpers: { search: false, resolve: false, getContext: false, createIfNotExists: false, attachToDocument: false, findBy: [] },
|
|
24880
|
+
opForms: { get: "global" }
|
|
24881
|
+
},
|
|
24731
24882
|
{
|
|
24732
24883
|
key: "resource_role_queues",
|
|
24733
24884
|
accessor: "resourceRoleQueues",
|
|
@@ -25384,6 +25535,23 @@ var GenericResource = class extends BaseResource {
|
|
|
25384
25535
|
this.requireOp("count");
|
|
25385
25536
|
return this.countGlobal(params);
|
|
25386
25537
|
}
|
|
25538
|
+
/** Read one native staff-association page; raw continuations are neither returned nor followed. */
|
|
25539
|
+
async listByParent(parentId) {
|
|
25540
|
+
if (!["organizational_resources", "resource_daily_availabilities"].includes(this.config.key)) throw new OperationNotSupportedError(this.config.key, "listByParent");
|
|
25541
|
+
const operation = `${this.config.key}.listByParent`;
|
|
25542
|
+
const parent = parseIdentifier(parentId, "parentId");
|
|
25543
|
+
if (!isAuditDecimalId(String(parent))) throw new AutotaskConfigError("parentId must be a non-negative signed 64-bit integer", { operation });
|
|
25544
|
+
const page = unwrapItems(await this.http.request({ method: "GET", path: this.scopedCollectionPath(parent), operation }), operation);
|
|
25545
|
+
const next = Object.hasOwn(page.pageDetails, "nextPageUrl") ? page.pageDetails.nextPageUrl : void 0;
|
|
25546
|
+
if (next !== null && (typeof next !== "string" || next.length === 0)) throw new AutotaskError("Expected explicit native page continuation metadata", { code: "INVALID_RESPONSE", category: "server", operation });
|
|
25547
|
+
const field = this.config.parentField;
|
|
25548
|
+
const hasInvalidParent = page.items.some((row) => {
|
|
25549
|
+
const value = isRecord2(row) && Object.hasOwn(row, field) ? row[field] : void 0;
|
|
25550
|
+
return typeof value !== "number" || !Number.isInteger(value) || value > 2147483647 || String(value) !== String(parent);
|
|
25551
|
+
});
|
|
25552
|
+
if (hasInvalidParent) throw new AutotaskError("Native page rows must bind the requested parent through the int32 model field", { code: "INVALID_RESPONSE", category: "server", operation });
|
|
25553
|
+
return { items: page.items, hasMore: next !== null };
|
|
25554
|
+
}
|
|
25387
25555
|
async get(a, b = void 0, c = void 0) {
|
|
25388
25556
|
this.requireOp("get");
|
|
25389
25557
|
if (isIdentifier(b)) {
|
|
@@ -27504,6 +27672,13 @@ function validateFetchManyItems(items, cap, opName = "fetchByIds", capRef = `FET
|
|
|
27504
27672
|
);
|
|
27505
27673
|
continue;
|
|
27506
27674
|
}
|
|
27675
|
+
if (hasNativeStaffCollection(resourceKey)) {
|
|
27676
|
+
const clientResource = `client.${camelKey(resourceKey)}`;
|
|
27677
|
+
problems.push(
|
|
27678
|
+
`${at}.resource: "${resourceKey}" is a parent-scoped child outside ${opName}; use ${clientResource}.get(id) or ${clientResource}.listByParent(parentId)`
|
|
27679
|
+
);
|
|
27680
|
+
continue;
|
|
27681
|
+
}
|
|
27507
27682
|
const rel = RELATIONSHIP_MAP[resourceKey];
|
|
27508
27683
|
const globalRead = resourceKey === "time_off_requests" || resourceKey === "knowledge_base_articles";
|
|
27509
27684
|
if (rel !== void 0 && rel.parentScoped && !globalRead) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/capabilities.ts
|
|
4
4
|
var CAPABILITY_PLAN_HASHES = {
|
|
5
|
-
"B": "
|
|
6
|
-
"A": "
|
|
7
|
-
"operations": "
|
|
5
|
+
"B": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901",
|
|
6
|
+
"A": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901",
|
|
7
|
+
"operations": "51888554f455b96e13c50591342fa516b095065762430b783201ac7a995a0901"
|
|
8
8
|
};
|
|
9
9
|
var cached = null;
|
|
10
10
|
function loadCapabilities() {
|