node-autotask 0.39.1 → 0.39.3
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 +28 -0
- package/README.md +1 -1
- package/dist/{chunk-CQXB7KAO.js → chunk-5JAS6CAN.js} +2 -2
- package/dist/{chunk-LB34VFQY.cjs → chunk-BPRDYT5L.cjs} +47 -25
- package/dist/{chunk-GIVYTQ6R.cjs → chunk-F4YDKUGY.cjs} +283 -283
- package/dist/{chunk-LN3HQQBR.js → chunk-GSMFRPYB.js} +40 -18
- package/dist/{chunk-LDTJNLX7.js → chunk-K6RZDRWX.js} +1 -1
- package/dist/{chunk-73QNAEAF.cjs → chunk-MBI24PEF.cjs} +143 -143
- package/dist/{index-C-Oqef4y.d.cts → index-DkZVRMeW.d.cts} +18 -5
- package/dist/{index-C-Oqef4y.d.ts → index-DkZVRMeW.d.ts} +18 -5
- package/dist/index.cjs +21 -21
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/operations/index.cjs +173 -173
- package/dist/operations/index.d.cts +2 -2
- package/dist/operations/index.d.ts +2 -2
- package/dist/operations/index.js +1 -1
- package/dist/pool.cjs +8 -8
- package/dist/pool.d.cts +1 -1
- package/dist/pool.d.ts +1 -1
- package/dist/pool.js +3 -3
- package/dist/resources/index.cjs +3 -3
- package/dist/resources/index.d.cts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +2 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/docs/API.md +16 -7
- package/package.json +1 -1
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkBPRDYT5Lcjs = require('./chunk-BPRDYT5L.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkVR6RYXTDcjs = require('./chunk-VR6RYXTD.cjs');
|
|
37
37
|
|
|
38
38
|
// src/resources/appointments.ts
|
|
39
|
-
var AppointmentsResource = class extends
|
|
39
|
+
var AppointmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
40
40
|
constructor(http, pageSize) {
|
|
41
41
|
super(http, {
|
|
42
42
|
key: "appointments",
|
|
@@ -121,7 +121,7 @@ var AuthenticateResource = class {
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
// src/resources/billing_item_approval_levels.ts
|
|
124
|
-
var BillingItemApprovalLevelsResource = class extends
|
|
124
|
+
var BillingItemApprovalLevelsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
125
125
|
constructor(http, pageSize) {
|
|
126
126
|
super(http, {
|
|
127
127
|
key: "billing_item_approval_levels",
|
|
@@ -157,7 +157,7 @@ var BillingItemApprovalLevelsResource = class extends _chunkLB34VFQYcjs.BaseReso
|
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
// src/resources/change_request_links.ts
|
|
160
|
-
var ChangeRequestLinksResource = class extends
|
|
160
|
+
var ChangeRequestLinksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
161
161
|
constructor(http, pageSize) {
|
|
162
162
|
super(http, {
|
|
163
163
|
key: "change_request_links",
|
|
@@ -211,7 +211,7 @@ var ChangeRequestLinksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
// src/resources/checklist_libraries.ts
|
|
214
|
-
var ChecklistLibrariesResource = class extends
|
|
214
|
+
var ChecklistLibrariesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
215
215
|
constructor(http, pageSize) {
|
|
216
216
|
super(http, {
|
|
217
217
|
key: "checklist_libraries",
|
|
@@ -285,7 +285,7 @@ var ChecklistLibrariesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
285
285
|
};
|
|
286
286
|
|
|
287
287
|
// src/resources/checklist_library_checklist_items.ts
|
|
288
|
-
var ChecklistLibraryChecklistItemsResource = class extends
|
|
288
|
+
var ChecklistLibraryChecklistItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
289
289
|
constructor(http, pageSize) {
|
|
290
290
|
super(http, {
|
|
291
291
|
key: "checklist_library_checklist_items",
|
|
@@ -351,7 +351,7 @@ var ChecklistLibraryChecklistItemsResource = class extends _chunkLB34VFQYcjs.Bas
|
|
|
351
351
|
};
|
|
352
352
|
|
|
353
353
|
// src/resources/classification_icons.ts
|
|
354
|
-
var ClassificationIconsResource = class extends
|
|
354
|
+
var ClassificationIconsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
355
355
|
constructor(http, pageSize) {
|
|
356
356
|
super(http, {
|
|
357
357
|
key: "classification_icons",
|
|
@@ -395,7 +395,7 @@ var ClassificationIconsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
395
395
|
};
|
|
396
396
|
|
|
397
397
|
// src/resources/company_alerts.ts
|
|
398
|
-
var CompanyAlertsResource = class extends
|
|
398
|
+
var CompanyAlertsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
399
399
|
constructor(http, pageSize) {
|
|
400
400
|
super(http, {
|
|
401
401
|
key: "company_alerts",
|
|
@@ -461,7 +461,7 @@ var CompanyAlertsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
461
461
|
};
|
|
462
462
|
|
|
463
463
|
// src/resources/company_locations.ts
|
|
464
|
-
var CompanyLocationsResource = class extends
|
|
464
|
+
var CompanyLocationsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
465
465
|
constructor(http, pageSize) {
|
|
466
466
|
super(http, {
|
|
467
467
|
key: "company_locations",
|
|
@@ -532,7 +532,7 @@ var CompanyLocationsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
532
532
|
};
|
|
533
533
|
|
|
534
534
|
// src/resources/company_notes.ts
|
|
535
|
-
var CompanyNotesResource = class extends
|
|
535
|
+
var CompanyNotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
536
536
|
constructor(http, pageSize) {
|
|
537
537
|
super(http, {
|
|
538
538
|
key: "company_notes",
|
|
@@ -597,7 +597,7 @@ var CompanyNotesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
597
597
|
};
|
|
598
598
|
|
|
599
599
|
// src/resources/company_site_configurations.ts
|
|
600
|
-
var CompanySiteConfigurationsResource = class extends
|
|
600
|
+
var CompanySiteConfigurationsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
601
601
|
constructor(http, pageSize) {
|
|
602
602
|
super(http, {
|
|
603
603
|
key: "company_site_configurations",
|
|
@@ -648,7 +648,7 @@ var CompanySiteConfigurationsResource = class extends _chunkLB34VFQYcjs.BaseReso
|
|
|
648
648
|
};
|
|
649
649
|
|
|
650
650
|
// src/resources/company_webhooks.ts
|
|
651
|
-
var CompanyWebhooksResource = class extends
|
|
651
|
+
var CompanyWebhooksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
652
652
|
constructor(http, pageSize) {
|
|
653
653
|
super(http, {
|
|
654
654
|
key: "company_webhooks",
|
|
@@ -724,7 +724,7 @@ var CompanyWebhooksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
724
724
|
};
|
|
725
725
|
|
|
726
726
|
// src/resources/configuration_item_billing_product_associations.ts
|
|
727
|
-
var ConfigurationItemBillingProductAssociationsResource = class extends
|
|
727
|
+
var ConfigurationItemBillingProductAssociationsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
728
728
|
constructor(http, pageSize) {
|
|
729
729
|
super(http, {
|
|
730
730
|
key: "configuration_item_billing_product_associations",
|
|
@@ -790,7 +790,7 @@ var ConfigurationItemBillingProductAssociationsResource = class extends _chunkLB
|
|
|
790
790
|
};
|
|
791
791
|
|
|
792
792
|
// src/resources/configuration_item_categories.ts
|
|
793
|
-
var ConfigurationItemCategoriesResource = class extends
|
|
793
|
+
var ConfigurationItemCategoriesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
794
794
|
constructor(http, pageSize) {
|
|
795
795
|
super(http, {
|
|
796
796
|
key: "configuration_item_categories",
|
|
@@ -857,7 +857,7 @@ var ConfigurationItemCategoriesResource = class extends _chunkLB34VFQYcjs.BaseRe
|
|
|
857
857
|
};
|
|
858
858
|
|
|
859
859
|
// src/resources/configuration_item_category_udf_associations.ts
|
|
860
|
-
var ConfigurationItemCategoryUdfAssociationsResource = class extends
|
|
860
|
+
var ConfigurationItemCategoryUdfAssociationsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
861
861
|
constructor(http, pageSize) {
|
|
862
862
|
super(http, {
|
|
863
863
|
key: "configuration_item_category_udf_associations",
|
|
@@ -923,7 +923,7 @@ var ConfigurationItemCategoryUdfAssociationsResource = class extends _chunkLB34V
|
|
|
923
923
|
};
|
|
924
924
|
|
|
925
925
|
// src/resources/configuration_item_dns_records.ts
|
|
926
|
-
var ConfigurationItemDnsRecordsResource = class extends
|
|
926
|
+
var ConfigurationItemDnsRecordsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
927
927
|
constructor(http, pageSize) {
|
|
928
928
|
super(http, {
|
|
929
929
|
key: "configuration_item_dns_records",
|
|
@@ -972,7 +972,7 @@ var ConfigurationItemDnsRecordsResource = class extends _chunkLB34VFQYcjs.BaseRe
|
|
|
972
972
|
};
|
|
973
973
|
|
|
974
974
|
// src/resources/configuration_item_notes.ts
|
|
975
|
-
var ConfigurationItemNotesResource = class extends
|
|
975
|
+
var ConfigurationItemNotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
976
976
|
constructor(http, pageSize) {
|
|
977
977
|
super(http, {
|
|
978
978
|
key: "configuration_item_notes",
|
|
@@ -1031,7 +1031,7 @@ var ConfigurationItemNotesResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
1031
1031
|
};
|
|
1032
1032
|
|
|
1033
1033
|
// src/resources/configuration_item_related_items.ts
|
|
1034
|
-
var ConfigurationItemRelatedItemsResource = class extends
|
|
1034
|
+
var ConfigurationItemRelatedItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1035
1035
|
constructor(http, pageSize) {
|
|
1036
1036
|
super(http, {
|
|
1037
1037
|
key: "configuration_item_related_items",
|
|
@@ -1092,16 +1092,16 @@ async function fetchRecord(http, path, label, readOpts) {
|
|
|
1092
1092
|
const res = await http.request({ method: "GET", path, operation: "configuration_items.moveConfigurationItem", maxRetries: _optionalChain([readOpts, 'optionalAccess', _24 => _24.maxRetries]) });
|
|
1093
1093
|
const body = res;
|
|
1094
1094
|
if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
|
|
1095
|
-
throw new (0,
|
|
1095
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
|
|
1096
1096
|
}
|
|
1097
1097
|
return body.item;
|
|
1098
1098
|
}
|
|
1099
1099
|
async function moveConfigurationItem(_resource, sourceId, opts, http) {
|
|
1100
|
-
const numericSource =
|
|
1100
|
+
const numericSource = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, sourceId, "sourceId");
|
|
1101
1101
|
if (_optionalChain([opts, 'optionalAccess', _25 => _25.destinationCompanyId]) === void 0) {
|
|
1102
|
-
throw new (0,
|
|
1102
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("moveConfigurationItem: destinationCompanyId is required");
|
|
1103
1103
|
}
|
|
1104
|
-
const destId =
|
|
1104
|
+
const destId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, opts.destinationCompanyId, "destinationCompanyId");
|
|
1105
1105
|
const source = await fetchRecord(http, `/V1.0/ConfigurationItems/${numericSource}`, `Configuration item ${numericSource}`, { maxRetries: opts.maxRetries });
|
|
1106
1106
|
await fetchRecord(http, `/V1.0/Companies/${destId}`, `Company ${destId}`, { maxRetries: opts.maxRetries });
|
|
1107
1107
|
const body = { ...source };
|
|
@@ -1111,20 +1111,20 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
|
|
|
1111
1111
|
body.companyID = destId;
|
|
1112
1112
|
body.isActive = true;
|
|
1113
1113
|
if (opts.newReferenceTitle !== void 0) {
|
|
1114
|
-
if (opts.newReferenceTitle.trim() === "") throw new (0,
|
|
1114
|
+
if (opts.newReferenceTitle.trim() === "") throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("moveConfigurationItem: newReferenceTitle must be non-empty");
|
|
1115
1115
|
body.referenceTitle = opts.newReferenceTitle.trim();
|
|
1116
1116
|
}
|
|
1117
1117
|
if (opts.lastModifiedDate !== void 0) {
|
|
1118
1118
|
const current = source.lastModifiedDate;
|
|
1119
1119
|
if (current !== opts.lastModifiedDate) {
|
|
1120
|
-
throw new (0,
|
|
1120
|
+
throw new (0, _chunkBPRDYT5Lcjs.StaleObjectError)(
|
|
1121
1121
|
`moveConfigurationItem: source item ${numericSource} was modified since the snapshot (expected lastModifiedDate ${opts.lastModifiedDate}, current ${_nullishCoalesce(current, () => ( "unknown"))})`,
|
|
1122
1122
|
{ operation: "configuration_items.moveConfigurationItem", resourceIds: [numericSource], details: { idRefs: [{ entity: "configuration_item", id: numericSource }] } }
|
|
1123
1123
|
);
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
1126
|
if (opts.dryRun === true) {
|
|
1127
|
-
return
|
|
1127
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
1128
1128
|
operation: "configuration_items.moveConfigurationItem",
|
|
1129
1129
|
method: "POST",
|
|
1130
1130
|
path: "/V1.0/ConfigurationItems",
|
|
@@ -1149,7 +1149,7 @@ async function moveConfigurationItem(_resource, sourceId, opts, http) {
|
|
|
1149
1149
|
const createdBody = created;
|
|
1150
1150
|
const newId = createdBody !== null ? _nullishCoalesce(createdBody.itemId, () => ( createdBody.id)) : void 0;
|
|
1151
1151
|
if (typeof newId !== "number") {
|
|
1152
|
-
throw new (0,
|
|
1152
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("moveConfigurationItem: vendor create response has no itemId");
|
|
1153
1153
|
}
|
|
1154
1154
|
let sourceDeactivated = false;
|
|
1155
1155
|
if (opts.deactivateSource !== false) {
|
|
@@ -1168,7 +1168,7 @@ var PROFILE_PART_LIMIT = 50;
|
|
|
1168
1168
|
function profilePartLimit(value, name) {
|
|
1169
1169
|
const n = value === void 0 ? PROFILE_PART_LIMIT : Math.trunc(value);
|
|
1170
1170
|
if (!Number.isInteger(n) || n < 1) {
|
|
1171
|
-
throw new (0,
|
|
1171
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`profile: ${name} must be an integer >= 1 (got ${String(value)})`);
|
|
1172
1172
|
}
|
|
1173
1173
|
return n;
|
|
1174
1174
|
}
|
|
@@ -1184,14 +1184,14 @@ async function contextFetchPart(http, entityPath, referenceId, entity) {
|
|
|
1184
1184
|
});
|
|
1185
1185
|
const body = res;
|
|
1186
1186
|
if (body === null || !("item" in body)) {
|
|
1187
|
-
throw new (0,
|
|
1187
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`context part not found (unexpected envelope shape)`, { resourceIds: [referenceId], details: { idRefs: [{ entity, id: referenceId }] } });
|
|
1188
1188
|
}
|
|
1189
1189
|
if (body.item === null || body.item === void 0) {
|
|
1190
|
-
throw new (0,
|
|
1190
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)("context part not found", { resourceIds: [referenceId], details: { idRefs: [{ entity, id: referenceId }] } });
|
|
1191
1191
|
}
|
|
1192
1192
|
return body.item;
|
|
1193
1193
|
} catch (err) {
|
|
1194
|
-
if (err instanceof
|
|
1194
|
+
if (err instanceof _chunkBPRDYT5Lcjs.NotFoundError) return null;
|
|
1195
1195
|
throw err;
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
@@ -1203,7 +1203,7 @@ async function ciScopedQuery(http, path, itemID, limit) {
|
|
|
1203
1203
|
body: { MaxRecords: limit, filter: [{ field: "configurationItemID", op: "eq", value: itemID }] },
|
|
1204
1204
|
operation: "configuration_items.profile"
|
|
1205
1205
|
});
|
|
1206
|
-
return
|
|
1206
|
+
return _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res).items;
|
|
1207
1207
|
}
|
|
1208
1208
|
async function profile(resource, id, opts = {}, http) {
|
|
1209
1209
|
const noteLimit = profilePartLimit(opts.noteLimit, "noteLimit");
|
|
@@ -1215,7 +1215,7 @@ async function profile(resource, id, opts = {}, http) {
|
|
|
1215
1215
|
const notes = await ciScopedQuery(http, "/V1.0/ConfigurationItemNotes/query", id, noteLimit);
|
|
1216
1216
|
const relatedItems = await ciScopedQuery(http, "/V1.0/ConfigurationItemRelatedItems/query", id, relatedLimit);
|
|
1217
1217
|
const associations = await ciScopedQuery(http, "/V1.0/ConfigurationItemBillingProductAssociations/query", id, PROFILE_PART_LIMIT);
|
|
1218
|
-
const wallQuirk = _optionalChain([
|
|
1218
|
+
const wallQuirk = _optionalChain([_chunkBPRDYT5Lcjs.RELATIONSHIP_MAP, 'access', _26 => _26["configuration_items"], 'optionalAccess', _27 => _27.zoneFacts, 'optionalAccess', _28 => _28.quirks, 'optionalAccess', _29 => _29.find, 'call', _30 => _30(
|
|
1219
1219
|
(q) => q.kind === "field-constraint" && q.ops.includes("create") && (_nullishCoalesce(q.fields, () => ( []))).includes("productID")
|
|
1220
1220
|
)]);
|
|
1221
1221
|
const productAssociations = {
|
|
@@ -1241,11 +1241,11 @@ async function profile(resource, id, opts = {}, http) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
};
|
|
1243
1243
|
if (opts.names === true) {
|
|
1244
|
-
const builder =
|
|
1244
|
+
const builder = _chunkBPRDYT5Lcjs.createNamePlan.call(void 0, );
|
|
1245
1245
|
builder.addFk("contract", root["contractID"]);
|
|
1246
|
-
const names = await
|
|
1246
|
+
const names = await _chunkBPRDYT5Lcjs.resolveCompositeNames.call(void 0, http, builder.plan(), { maxNameReads: opts.maxNameReads });
|
|
1247
1247
|
const ciRow = { ...ci };
|
|
1248
|
-
|
|
1248
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, ciRow, "contractID", (v) => names.recordName("contract", v));
|
|
1249
1249
|
result.ci = ciRow;
|
|
1250
1250
|
result.names = names.section;
|
|
1251
1251
|
}
|
|
@@ -1253,7 +1253,7 @@ async function profile(resource, id, opts = {}, http) {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
1255
|
// src/resources/configuration_items.ts
|
|
1256
|
-
var ConfigurationItemsResource = class extends
|
|
1256
|
+
var ConfigurationItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1257
1257
|
constructor(http, pageSize) {
|
|
1258
1258
|
super(http, {
|
|
1259
1259
|
key: "configuration_items",
|
|
@@ -1342,7 +1342,7 @@ var ConfigurationItemsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
1342
1342
|
};
|
|
1343
1343
|
|
|
1344
1344
|
// src/resources/configuration_item_ssl_subject_alternative_names.ts
|
|
1345
|
-
var ConfigurationItemSslSubjectAlternativeNamesResource = class extends
|
|
1345
|
+
var ConfigurationItemSslSubjectAlternativeNamesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1346
1346
|
constructor(http, pageSize) {
|
|
1347
1347
|
super(http, {
|
|
1348
1348
|
key: "configuration_item_ssl_subject_alternative_names",
|
|
@@ -1405,7 +1405,7 @@ var ConfigurationItemSslSubjectAlternativeNamesResource = class extends _chunkLB
|
|
|
1405
1405
|
};
|
|
1406
1406
|
|
|
1407
1407
|
// src/resources/configuration_item_types.ts
|
|
1408
|
-
var ConfigurationItemTypesResource = class extends
|
|
1408
|
+
var ConfigurationItemTypesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1409
1409
|
constructor(http, pageSize) {
|
|
1410
1410
|
super(http, {
|
|
1411
1411
|
key: "configuration_item_types",
|
|
@@ -1479,7 +1479,7 @@ var ConfigurationItemTypesResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
1479
1479
|
};
|
|
1480
1480
|
|
|
1481
1481
|
// src/resources/configuration_item_webhooks.ts
|
|
1482
|
-
var ConfigurationItemWebhooksResource = class extends
|
|
1482
|
+
var ConfigurationItemWebhooksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1483
1483
|
constructor(http, pageSize) {
|
|
1484
1484
|
super(http, {
|
|
1485
1485
|
key: "configuration_item_webhooks",
|
|
@@ -1555,7 +1555,7 @@ var ConfigurationItemWebhooksResource = class extends _chunkLB34VFQYcjs.BaseReso
|
|
|
1555
1555
|
};
|
|
1556
1556
|
|
|
1557
1557
|
// src/resources/contact_group_contacts.ts
|
|
1558
|
-
var ContactGroupContactsResource = class extends
|
|
1558
|
+
var ContactGroupContactsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1559
1559
|
constructor(http, pageSize) {
|
|
1560
1560
|
super(http, {
|
|
1561
1561
|
key: "contact_group_contacts",
|
|
@@ -1609,7 +1609,7 @@ var ContactGroupContactsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
1609
1609
|
};
|
|
1610
1610
|
|
|
1611
1611
|
// src/resources/contact_groups.ts
|
|
1612
|
-
var ContactGroupsResource = class extends
|
|
1612
|
+
var ContactGroupsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1613
1613
|
constructor(http, pageSize) {
|
|
1614
1614
|
super(http, {
|
|
1615
1615
|
key: "contact_groups",
|
|
@@ -1687,22 +1687,22 @@ async function fetchRecord2(http, path, label, readOpts) {
|
|
|
1687
1687
|
const res = await http.request({ method: "GET", path, operation: "contacts.moveToCompany", maxRetries: _optionalChain([readOpts, 'optionalAccess', _42 => _42.maxRetries]) });
|
|
1688
1688
|
const body = res;
|
|
1689
1689
|
if (body === null || !("item" in body) || body.item === null || body.item === void 0) {
|
|
1690
|
-
throw new (0,
|
|
1690
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`${label} not found`, { code: "NOT_FOUND", category: "not_found" });
|
|
1691
1691
|
}
|
|
1692
1692
|
return body.item;
|
|
1693
1693
|
}
|
|
1694
1694
|
async function moveToCompany(_resource, sourceContactId, destinationCompanyId, opts = {}, http) {
|
|
1695
|
-
const sourceId =
|
|
1696
|
-
const destId =
|
|
1695
|
+
const sourceId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, sourceContactId, "sourceContactId");
|
|
1696
|
+
const destId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, destinationCompanyId, "destinationCompanyId");
|
|
1697
1697
|
const source = await fetchRecord2(http, `/V1.0/Contacts/${sourceId}`, `Contact ${sourceId}`, { maxRetries: opts.maxRetries });
|
|
1698
1698
|
const companyID = source.companyID;
|
|
1699
1699
|
if (typeof companyID !== "number" || companyID < 0) {
|
|
1700
|
-
throw new (0,
|
|
1700
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`Contact ${sourceId} has no companyID (cannot scope the source delete)`);
|
|
1701
1701
|
}
|
|
1702
1702
|
if (opts.lastModifiedDate !== void 0) {
|
|
1703
1703
|
const current = source.lastModifiedDate;
|
|
1704
1704
|
if (current !== opts.lastModifiedDate) {
|
|
1705
|
-
throw new (0,
|
|
1705
|
+
throw new (0, _chunkBPRDYT5Lcjs.StaleObjectError)(
|
|
1706
1706
|
`moveToCompany: source contact ${sourceId} was modified since the snapshot (expected lastModifiedDate ${opts.lastModifiedDate}, current ${typeof current === "string" ? current : "unknown"})`,
|
|
1707
1707
|
{ operation: "contacts.moveToCompany", resourceIds: [sourceId, destId], details: { idRefs: [{ entity: "contact", id: sourceId }, { entity: "company", id: destId }] } }
|
|
1708
1708
|
);
|
|
@@ -1724,10 +1724,10 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
|
|
|
1724
1724
|
},
|
|
1725
1725
|
operation: "contacts.moveToCompany"
|
|
1726
1726
|
});
|
|
1727
|
-
const items =
|
|
1727
|
+
const items = _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res).items;
|
|
1728
1728
|
const clash = items.find((c) => String(c.id) !== String(sourceId));
|
|
1729
1729
|
if (clash !== void 0) {
|
|
1730
|
-
throw new (0,
|
|
1730
|
+
throw new (0, _chunkBPRDYT5Lcjs.ConflictError)(
|
|
1731
1731
|
`Contact email "${email}" already exists under company ${destId} (contact ${String(clash.id)}); aborting the move`,
|
|
1732
1732
|
{ resourceIds: [sourceId, destId], details: { idRefs: [{ entity: "contact", id: sourceId }, { entity: "company", id: destId }] } }
|
|
1733
1733
|
);
|
|
@@ -1741,7 +1741,7 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
|
|
|
1741
1741
|
if (opts.dryRun === true) {
|
|
1742
1742
|
const warnings = [];
|
|
1743
1743
|
if (opts.deleteSource === true) warnings.push("the source contact will be deleted after the move");
|
|
1744
|
-
return
|
|
1744
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
1745
1745
|
operation: "contacts.moveToCompany",
|
|
1746
1746
|
method: "POST",
|
|
1747
1747
|
path: `/V1.0/Companies/${destId}/Contacts`,
|
|
@@ -1767,7 +1767,7 @@ async function moveToCompany(_resource, sourceContactId, destinationCompanyId, o
|
|
|
1767
1767
|
const createdBody = created;
|
|
1768
1768
|
const newId = createdBody !== null ? _nullishCoalesce(createdBody.itemId, () => ( createdBody.id)) : void 0;
|
|
1769
1769
|
if (typeof newId !== "number") {
|
|
1770
|
-
throw new (0,
|
|
1770
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("contacts.moveToCompany: vendor create response has no itemId");
|
|
1771
1771
|
}
|
|
1772
1772
|
let sourceDeleted = false;
|
|
1773
1773
|
if (opts.deleteSource === true) {
|
|
@@ -1786,7 +1786,7 @@ var UPSERT_MAX_DISCOVERY_MERGES = 3;
|
|
|
1786
1786
|
var EMAIL_SHAPE = /^.+@.+/;
|
|
1787
1787
|
var SAFE_CONTACT_CREATE_DEFAULTS = {};
|
|
1788
1788
|
var DEDUP_LIMIT = 10;
|
|
1789
|
-
var CompanyNotFoundError = class extends
|
|
1789
|
+
var CompanyNotFoundError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
1790
1790
|
constructor(message, options = {}) {
|
|
1791
1791
|
super(message, {
|
|
1792
1792
|
code: "COMPANY_NOT_FOUND",
|
|
@@ -1797,7 +1797,7 @@ var CompanyNotFoundError = class extends _chunkLB34VFQYcjs.AutotaskError {
|
|
|
1797
1797
|
this.name = "CompanyNotFoundError";
|
|
1798
1798
|
}
|
|
1799
1799
|
};
|
|
1800
|
-
var ContactCreateFailedError = class extends
|
|
1800
|
+
var ContactCreateFailedError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
1801
1801
|
/** The vendor-named fields (empty when the 500 body named nothing parseable). */
|
|
1802
1802
|
|
|
1803
1803
|
constructor(message, vendorFields, options = {}) {
|
|
@@ -1807,25 +1807,25 @@ var ContactCreateFailedError = class extends _chunkLB34VFQYcjs.AutotaskError {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
};
|
|
1809
1809
|
async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
1810
|
-
const cid =
|
|
1810
|
+
const cid = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, companyID, "companyID");
|
|
1811
1811
|
if (typeof email !== "string" || !EMAIL_SHAPE.test(email)) {
|
|
1812
|
-
throw new (0,
|
|
1812
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(
|
|
1813
1813
|
`upsertByEmail: email must be a non-empty string with the @ shape (a non-empty local part + a non-empty domain; got ${JSON.stringify(email)})`,
|
|
1814
1814
|
{ operation: OP_UPSERT_EMAIL }
|
|
1815
1815
|
);
|
|
1816
1816
|
}
|
|
1817
1817
|
if (extra !== void 0) {
|
|
1818
1818
|
if (extra.isActive !== void 0 && typeof extra.isActive !== "boolean" && extra.isActive !== 0 && extra.isActive !== 1) {
|
|
1819
|
-
throw new (0,
|
|
1819
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(
|
|
1820
1820
|
`upsertByEmail: extra.isActive must be a boolean (mapped to the zone-correct number 1/0) or a raw 0/1 number (got ${String(extra.isActive)})`,
|
|
1821
1821
|
{ operation: OP_UPSERT_EMAIL }
|
|
1822
1822
|
);
|
|
1823
1823
|
}
|
|
1824
1824
|
if (extra.firstName !== void 0 && (typeof extra.firstName !== "string" || extra.firstName === "")) {
|
|
1825
|
-
throw new (0,
|
|
1825
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("upsertByEmail: extra.firstName must be a non-empty string (or omitted \u2014 the node defaults it to the email local-part)", { operation: OP_UPSERT_EMAIL });
|
|
1826
1826
|
}
|
|
1827
1827
|
if (extra.lastName !== void 0 && typeof extra.lastName !== "string") {
|
|
1828
|
-
throw new (0,
|
|
1828
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("upsertByEmail: extra.lastName must be a string (or omitted \u2014 the node defaults it to the non-empty neutral value Unknown)", { operation: OP_UPSERT_EMAIL });
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
const parentRes = await http.request({ method: "GET", path: `/V1.0/Companies/${cid}`, operation: OP_UPSERT_EMAIL, maxRetries: opts.maxRetries });
|
|
@@ -1846,7 +1846,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
|
1846
1846
|
const match = q.items[0];
|
|
1847
1847
|
if (match !== void 0) {
|
|
1848
1848
|
if (opts.dryRun === true) {
|
|
1849
|
-
return
|
|
1849
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0,
|
|
1850
1850
|
{
|
|
1851
1851
|
operation: OP_UPSERT_EMAIL,
|
|
1852
1852
|
method: "POST",
|
|
@@ -1876,7 +1876,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
|
1876
1876
|
isActive: typeof isActive === "boolean" ? isActive ? 1 : 0 : isActive
|
|
1877
1877
|
};
|
|
1878
1878
|
if (opts.dryRun === true) {
|
|
1879
|
-
return
|
|
1879
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0,
|
|
1880
1880
|
{
|
|
1881
1881
|
operation: OP_UPSERT_EMAIL,
|
|
1882
1882
|
method: "POST",
|
|
@@ -1899,8 +1899,8 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
|
1899
1899
|
const created = await resource.create(cid, body, { maxRetries: opts.maxRetries });
|
|
1900
1900
|
return { id: created.id, created: true };
|
|
1901
1901
|
} catch (err) {
|
|
1902
|
-
if (!
|
|
1903
|
-
const named = (_nullishCoalesce(
|
|
1902
|
+
if (!_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) throw err;
|
|
1903
|
+
const named = (_nullishCoalesce(_chunkBPRDYT5Lcjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []))).map((e) => e.field).filter((f) => f !== void 0);
|
|
1904
1904
|
const seen = /* @__PURE__ */ new Set();
|
|
1905
1905
|
const unique = [...named].filter((f) => seen.has(f) ? false : (seen.add(f), true));
|
|
1906
1906
|
const hasDefault = unique.some((f) => SAFE_CONTACT_CREATE_DEFAULTS[f] !== void 0);
|
|
@@ -1914,7 +1914,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
continue;
|
|
1916
1916
|
}
|
|
1917
|
-
const detail =
|
|
1917
|
+
const detail = _chunkBPRDYT5Lcjs.formatVendorDetail.call(void 0, err.vendorError);
|
|
1918
1918
|
throw new ContactCreateFailedError(
|
|
1919
1919
|
`upsertByEmail: the vendor rejected the contact create${unique.length > 0 ? ` naming field(s) ${unique.join(", ")}` : ""} (no proven-safe default \u2014 the required set is fully filled by the node)${detail ? ` \u2014 ${detail}` : ""}`,
|
|
1920
1920
|
unique,
|
|
@@ -1931,7 +1931,7 @@ async function upsertByEmail(resource, companyID, email, extra, opts, http) {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
|
|
1933
1933
|
// src/resources/contacts.ts
|
|
1934
|
-
var ContactsResource = class extends
|
|
1934
|
+
var ContactsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
1935
1935
|
constructor(http, pageSize) {
|
|
1936
1936
|
super(http, {
|
|
1937
1937
|
key: "contacts",
|
|
@@ -2023,7 +2023,7 @@ var ContactsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2023
2023
|
};
|
|
2024
2024
|
|
|
2025
2025
|
// src/resources/contact_webhooks.ts
|
|
2026
|
-
var ContactWebhooksResource = class extends
|
|
2026
|
+
var ContactWebhooksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2027
2027
|
constructor(http, pageSize) {
|
|
2028
2028
|
super(http, {
|
|
2029
2029
|
key: "contact_webhooks",
|
|
@@ -2099,7 +2099,7 @@ var ContactWebhooksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2099
2099
|
};
|
|
2100
2100
|
|
|
2101
2101
|
// src/resources/contract_billing_rules.ts
|
|
2102
|
-
var ContractBillingRulesResource = class extends
|
|
2102
|
+
var ContractBillingRulesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2103
2103
|
constructor(http, pageSize) {
|
|
2104
2104
|
super(http, {
|
|
2105
2105
|
key: "contract_billing_rules",
|
|
@@ -2165,7 +2165,7 @@ var ContractBillingRulesResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
2165
2165
|
};
|
|
2166
2166
|
|
|
2167
2167
|
// src/resources/contract_block_hour_factors.ts
|
|
2168
|
-
var ContractBlockHourFactorsResource = class extends
|
|
2168
|
+
var ContractBlockHourFactorsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2169
2169
|
constructor(http, pageSize) {
|
|
2170
2170
|
super(http, {
|
|
2171
2171
|
key: "contract_block_hour_factors",
|
|
@@ -2224,7 +2224,7 @@ var ContractBlockHourFactorsResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
2224
2224
|
};
|
|
2225
2225
|
|
|
2226
2226
|
// src/resources/contract_blocks.ts
|
|
2227
|
-
var ContractBlocksResource = class extends
|
|
2227
|
+
var ContractBlocksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2228
2228
|
constructor(http, pageSize) {
|
|
2229
2229
|
super(http, {
|
|
2230
2230
|
key: "contract_blocks",
|
|
@@ -2283,7 +2283,7 @@ var ContractBlocksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2283
2283
|
};
|
|
2284
2284
|
|
|
2285
2285
|
// src/resources/contract_charges.ts
|
|
2286
|
-
var ContractChargesResource = class extends
|
|
2286
|
+
var ContractChargesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2287
2287
|
constructor(http, pageSize) {
|
|
2288
2288
|
super(http, {
|
|
2289
2289
|
key: "contract_charges",
|
|
@@ -2354,7 +2354,7 @@ var ContractChargesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2354
2354
|
};
|
|
2355
2355
|
|
|
2356
2356
|
// src/resources/contract_exclusion_billing_codes.ts
|
|
2357
|
-
var ContractExclusionBillingCodesResource = class extends
|
|
2357
|
+
var ContractExclusionBillingCodesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2358
2358
|
constructor(http, pageSize) {
|
|
2359
2359
|
super(http, {
|
|
2360
2360
|
key: "contract_exclusion_billing_codes",
|
|
@@ -2411,7 +2411,7 @@ var ContractExclusionBillingCodesResource = class extends _chunkLB34VFQYcjs.Base
|
|
|
2411
2411
|
};
|
|
2412
2412
|
|
|
2413
2413
|
// src/resources/contract_exclusion_roles.ts
|
|
2414
|
-
var ContractExclusionRolesResource = class extends
|
|
2414
|
+
var ContractExclusionRolesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2415
2415
|
constructor(http, pageSize) {
|
|
2416
2416
|
super(http, {
|
|
2417
2417
|
key: "contract_exclusion_roles",
|
|
@@ -2468,7 +2468,7 @@ var ContractExclusionRolesResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
2468
2468
|
};
|
|
2469
2469
|
|
|
2470
2470
|
// src/resources/contract_exclusion_set_excluded_roles.ts
|
|
2471
|
-
var ContractExclusionSetExcludedRolesResource = class extends
|
|
2471
|
+
var ContractExclusionSetExcludedRolesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2472
2472
|
constructor(http, pageSize) {
|
|
2473
2473
|
super(http, {
|
|
2474
2474
|
key: "contract_exclusion_set_excluded_roles",
|
|
@@ -2525,7 +2525,7 @@ var ContractExclusionSetExcludedRolesResource = class extends _chunkLB34VFQYcjs.
|
|
|
2525
2525
|
};
|
|
2526
2526
|
|
|
2527
2527
|
// src/resources/contract_exclusion_set_excluded_work_types.ts
|
|
2528
|
-
var ContractExclusionSetExcludedWorkTypesResource = class extends
|
|
2528
|
+
var ContractExclusionSetExcludedWorkTypesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2529
2529
|
constructor(http, pageSize) {
|
|
2530
2530
|
super(http, {
|
|
2531
2531
|
key: "contract_exclusion_set_excluded_work_types",
|
|
@@ -2582,7 +2582,7 @@ var ContractExclusionSetExcludedWorkTypesResource = class extends _chunkLB34VFQY
|
|
|
2582
2582
|
};
|
|
2583
2583
|
|
|
2584
2584
|
// src/resources/contract_exclusion_sets.ts
|
|
2585
|
-
var ContractExclusionSetsResource = class extends
|
|
2585
|
+
var ContractExclusionSetsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2586
2586
|
constructor(http, pageSize) {
|
|
2587
2587
|
super(http, {
|
|
2588
2588
|
key: "contract_exclusion_sets",
|
|
@@ -2656,7 +2656,7 @@ var ContractExclusionSetsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
2656
2656
|
};
|
|
2657
2657
|
|
|
2658
2658
|
// src/resources/contract_milestones.ts
|
|
2659
|
-
var ContractMilestonesResource = class extends
|
|
2659
|
+
var ContractMilestonesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2660
2660
|
constructor(http, pageSize) {
|
|
2661
2661
|
super(http, {
|
|
2662
2662
|
key: "contract_milestones",
|
|
@@ -2715,7 +2715,7 @@ var ContractMilestonesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2715
2715
|
};
|
|
2716
2716
|
|
|
2717
2717
|
// src/resources/contract_notes.ts
|
|
2718
|
-
var ContractNotesResource = class extends
|
|
2718
|
+
var ContractNotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2719
2719
|
constructor(http, pageSize) {
|
|
2720
2720
|
super(http, {
|
|
2721
2721
|
key: "contract_notes",
|
|
@@ -2774,7 +2774,7 @@ var ContractNotesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2774
2774
|
};
|
|
2775
2775
|
|
|
2776
2776
|
// src/resources/contract_rates.ts
|
|
2777
|
-
var ContractRatesResource = class extends
|
|
2777
|
+
var ContractRatesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2778
2778
|
constructor(http, pageSize) {
|
|
2779
2779
|
super(http, {
|
|
2780
2780
|
key: "contract_rates",
|
|
@@ -2833,7 +2833,7 @@ var ContractRatesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2833
2833
|
};
|
|
2834
2834
|
|
|
2835
2835
|
// src/resources/contract_retainers.ts
|
|
2836
|
-
var ContractRetainersResource = class extends
|
|
2836
|
+
var ContractRetainersResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2837
2837
|
constructor(http, pageSize) {
|
|
2838
2838
|
super(http, {
|
|
2839
2839
|
key: "contract_retainers",
|
|
@@ -2892,7 +2892,7 @@ var ContractRetainersResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2892
2892
|
};
|
|
2893
2893
|
|
|
2894
2894
|
// src/resources/contract_role_costs.ts
|
|
2895
|
-
var ContractRoleCostsResource = class extends
|
|
2895
|
+
var ContractRoleCostsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2896
2896
|
constructor(http, pageSize) {
|
|
2897
2897
|
super(http, {
|
|
2898
2898
|
key: "contract_role_costs",
|
|
@@ -2951,7 +2951,7 @@ var ContractRoleCostsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
2951
2951
|
};
|
|
2952
2952
|
|
|
2953
2953
|
// src/resources/contract_service_adjustments.ts
|
|
2954
|
-
var ContractServiceAdjustmentsResource = class extends
|
|
2954
|
+
var ContractServiceAdjustmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2955
2955
|
constructor(http, pageSize) {
|
|
2956
2956
|
super(http, {
|
|
2957
2957
|
key: "contract_service_adjustments",
|
|
@@ -2985,7 +2985,7 @@ var ContractServiceAdjustmentsResource = class extends _chunkLB34VFQYcjs.BaseRes
|
|
|
2985
2985
|
};
|
|
2986
2986
|
|
|
2987
2987
|
// src/resources/contract_service_bundle_adjustments.ts
|
|
2988
|
-
var ContractServiceBundleAdjustmentsResource = class extends
|
|
2988
|
+
var ContractServiceBundleAdjustmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
2989
2989
|
constructor(http, pageSize) {
|
|
2990
2990
|
super(http, {
|
|
2991
2991
|
key: "contract_service_bundle_adjustments",
|
|
@@ -3019,7 +3019,7 @@ var ContractServiceBundleAdjustmentsResource = class extends _chunkLB34VFQYcjs.B
|
|
|
3019
3019
|
};
|
|
3020
3020
|
|
|
3021
3021
|
// src/resources/contract_service_bundles.ts
|
|
3022
|
-
var ContractServiceBundlesResource = class extends
|
|
3022
|
+
var ContractServiceBundlesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3023
3023
|
constructor(http, pageSize) {
|
|
3024
3024
|
super(http, {
|
|
3025
3025
|
key: "contract_service_bundles",
|
|
@@ -3078,7 +3078,7 @@ var ContractServiceBundlesResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
3078
3078
|
};
|
|
3079
3079
|
|
|
3080
3080
|
// src/resources/contract_service_bundle_units.ts
|
|
3081
|
-
var ContractServiceBundleUnitsResource = class extends
|
|
3081
|
+
var ContractServiceBundleUnitsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3082
3082
|
constructor(http, pageSize) {
|
|
3083
3083
|
super(http, {
|
|
3084
3084
|
key: "contract_service_bundle_units",
|
|
@@ -3120,7 +3120,7 @@ var ContractServiceBundleUnitsResource = class extends _chunkLB34VFQYcjs.BaseRes
|
|
|
3120
3120
|
};
|
|
3121
3121
|
|
|
3122
3122
|
// src/resources/contract_services.ts
|
|
3123
|
-
var ContractServicesResource = class extends
|
|
3123
|
+
var ContractServicesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3124
3124
|
constructor(http, pageSize) {
|
|
3125
3125
|
super(http, {
|
|
3126
3126
|
key: "contract_services",
|
|
@@ -3179,7 +3179,7 @@ var ContractServicesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3179
3179
|
};
|
|
3180
3180
|
|
|
3181
3181
|
// src/resources/contract_service_units.ts
|
|
3182
|
-
var ContractServiceUnitsResource = class extends
|
|
3182
|
+
var ContractServiceUnitsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3183
3183
|
constructor(http, pageSize) {
|
|
3184
3184
|
super(http, {
|
|
3185
3185
|
key: "contract_service_units",
|
|
@@ -3221,7 +3221,7 @@ var ContractServiceUnitsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
3221
3221
|
};
|
|
3222
3222
|
|
|
3223
3223
|
// src/resources/contract_ticket_purchases.ts
|
|
3224
|
-
var ContractTicketPurchasesResource = class extends
|
|
3224
|
+
var ContractTicketPurchasesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3225
3225
|
constructor(http, pageSize) {
|
|
3226
3226
|
super(http, {
|
|
3227
3227
|
key: "contract_ticket_purchases",
|
|
@@ -3280,7 +3280,7 @@ var ContractTicketPurchasesResource = class extends _chunkLB34VFQYcjs.BaseResour
|
|
|
3280
3280
|
};
|
|
3281
3281
|
|
|
3282
3282
|
// src/resources/countries.ts
|
|
3283
|
-
var CountriesResource = class extends
|
|
3283
|
+
var CountriesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3284
3284
|
constructor(http, pageSize) {
|
|
3285
3285
|
super(http, {
|
|
3286
3286
|
key: "countries",
|
|
@@ -3339,7 +3339,7 @@ var CountriesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3339
3339
|
};
|
|
3340
3340
|
|
|
3341
3341
|
// src/resources/currencies.ts
|
|
3342
|
-
var CurrenciesResource = class extends
|
|
3342
|
+
var CurrenciesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3343
3343
|
constructor(http, pageSize) {
|
|
3344
3344
|
super(http, {
|
|
3345
3345
|
key: "currencies",
|
|
@@ -3383,7 +3383,7 @@ var CurrenciesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3383
3383
|
};
|
|
3384
3384
|
|
|
3385
3385
|
// src/resources/departments.ts
|
|
3386
|
-
var DepartmentsResource = class extends
|
|
3386
|
+
var DepartmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3387
3387
|
constructor(http, pageSize) {
|
|
3388
3388
|
super(http, {
|
|
3389
3389
|
key: "departments",
|
|
@@ -3450,7 +3450,7 @@ var DepartmentsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3450
3450
|
};
|
|
3451
3451
|
|
|
3452
3452
|
// src/resources/domain_registrars.ts
|
|
3453
|
-
var DomainRegistrarsResource = class extends
|
|
3453
|
+
var DomainRegistrarsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3454
3454
|
constructor(http, pageSize) {
|
|
3455
3455
|
super(http, {
|
|
3456
3456
|
key: "domain_registrars",
|
|
@@ -3533,7 +3533,7 @@ var EntityInformationResource = class {
|
|
|
3533
3533
|
};
|
|
3534
3534
|
|
|
3535
3535
|
// src/resources/expense_item_attachments.ts
|
|
3536
|
-
var ExpenseItemAttachmentsResource = class extends
|
|
3536
|
+
var ExpenseItemAttachmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3537
3537
|
constructor(http, pageSize) {
|
|
3538
3538
|
super(http, {
|
|
3539
3539
|
key: "expense_item_attachments",
|
|
@@ -3595,7 +3595,7 @@ var ExpenseItemAttachmentsResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
3595
3595
|
};
|
|
3596
3596
|
|
|
3597
3597
|
// src/resources/expense_items.ts
|
|
3598
|
-
var ExpenseItemsResource = class extends
|
|
3598
|
+
var ExpenseItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3599
3599
|
constructor(http, pageSize) {
|
|
3600
3600
|
super(http, {
|
|
3601
3601
|
key: "expense_items",
|
|
@@ -3654,7 +3654,7 @@ var ExpenseItemsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3654
3654
|
};
|
|
3655
3655
|
|
|
3656
3656
|
// src/resources/expense_reports.ts
|
|
3657
|
-
var ExpenseReportsResource = class extends
|
|
3657
|
+
var ExpenseReportsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3658
3658
|
constructor(http, pageSize) {
|
|
3659
3659
|
super(http, {
|
|
3660
3660
|
key: "expense_reports",
|
|
@@ -3721,7 +3721,7 @@ var ExpenseReportsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3721
3721
|
};
|
|
3722
3722
|
|
|
3723
3723
|
// src/resources/holiday_sets.ts
|
|
3724
|
-
var HolidaySetsResource = class extends
|
|
3724
|
+
var HolidaySetsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3725
3725
|
constructor(http, pageSize) {
|
|
3726
3726
|
super(http, {
|
|
3727
3727
|
key: "holiday_sets",
|
|
@@ -3790,7 +3790,7 @@ var HolidaySetsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3790
3790
|
};
|
|
3791
3791
|
|
|
3792
3792
|
// src/resources/holidays.ts
|
|
3793
|
-
var HolidaysResource = class extends
|
|
3793
|
+
var HolidaysResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3794
3794
|
constructor(http, pageSize) {
|
|
3795
3795
|
super(http, {
|
|
3796
3796
|
key: "holidays",
|
|
@@ -3862,10 +3862,10 @@ var PATH_SUFFIX = {
|
|
|
3862
3862
|
transfer: "StockedItemsTransfer"
|
|
3863
3863
|
};
|
|
3864
3864
|
async function stockedItems(_resource, kind, parentId, data, opts = {}, http) {
|
|
3865
|
-
const numericParent =
|
|
3865
|
+
const numericParent = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, parentId, "parentId");
|
|
3866
3866
|
const suffix = PATH_SUFFIX[kind];
|
|
3867
3867
|
if (opts.dryRun === true) {
|
|
3868
|
-
return
|
|
3868
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
3869
3869
|
operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`,
|
|
3870
3870
|
method: "POST",
|
|
3871
3871
|
path: `/V1.0/InventoryProducts/${numericParent}/${suffix}`,
|
|
@@ -3882,11 +3882,11 @@ async function stockedItems(_resource, kind, parentId, data, opts = {}, http) {
|
|
|
3882
3882
|
operation: `inventory_products.stockedItems${suffix.slice("StockedItems".length)}`,
|
|
3883
3883
|
maxRetries: opts.maxRetries
|
|
3884
3884
|
});
|
|
3885
|
-
return
|
|
3885
|
+
return _chunkBPRDYT5Lcjs.unwrapOperation.call(void 0, res);
|
|
3886
3886
|
}
|
|
3887
3887
|
|
|
3888
3888
|
// src/resources/inventory_products.ts
|
|
3889
|
-
var InventoryProductsResource = class extends
|
|
3889
|
+
var InventoryProductsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3890
3890
|
constructor(http, pageSize) {
|
|
3891
3891
|
super(http, {
|
|
3892
3892
|
key: "inventory_products",
|
|
@@ -3967,7 +3967,7 @@ var InventoryProductsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
3967
3967
|
};
|
|
3968
3968
|
|
|
3969
3969
|
// src/resources/invoice_templates.ts
|
|
3970
|
-
var InvoiceTemplatesResource = class extends
|
|
3970
|
+
var InvoiceTemplatesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
3971
3971
|
constructor(http, pageSize) {
|
|
3972
3972
|
super(http, {
|
|
3973
3973
|
key: "invoice_templates",
|
|
@@ -4011,7 +4011,7 @@ var ModulesResource = class {
|
|
|
4011
4011
|
};
|
|
4012
4012
|
|
|
4013
4013
|
// src/resources/notification_history.ts
|
|
4014
|
-
var NotificationHistoryResource = class extends
|
|
4014
|
+
var NotificationHistoryResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4015
4015
|
constructor(http, pageSize) {
|
|
4016
4016
|
super(http, {
|
|
4017
4017
|
key: "notification_history",
|
|
@@ -4050,7 +4050,7 @@ var NotificationHistoryResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4050
4050
|
};
|
|
4051
4051
|
|
|
4052
4052
|
// src/resources/opportunities.ts
|
|
4053
|
-
var OpportunitiesResource = class extends
|
|
4053
|
+
var OpportunitiesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4054
4054
|
constructor(http, pageSize) {
|
|
4055
4055
|
super(http, {
|
|
4056
4056
|
key: "opportunities",
|
|
@@ -4112,7 +4112,7 @@ var OpportunitiesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4112
4112
|
};
|
|
4113
4113
|
|
|
4114
4114
|
// src/resources/opportunity_attachments.ts
|
|
4115
|
-
var OpportunityAttachmentsResource = class extends
|
|
4115
|
+
var OpportunityAttachmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4116
4116
|
constructor(http, pageSize) {
|
|
4117
4117
|
super(http, {
|
|
4118
4118
|
key: "opportunity_attachments",
|
|
@@ -4174,7 +4174,7 @@ var OpportunityAttachmentsResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
4174
4174
|
};
|
|
4175
4175
|
|
|
4176
4176
|
// src/resources/opportunity_categories.ts
|
|
4177
|
-
var OpportunityCategoriesResource = class extends
|
|
4177
|
+
var OpportunityCategoriesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4178
4178
|
constructor(http, pageSize) {
|
|
4179
4179
|
super(http, {
|
|
4180
4180
|
key: "opportunity_categories",
|
|
@@ -4233,7 +4233,7 @@ var OpportunityCategoriesResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
4233
4233
|
};
|
|
4234
4234
|
|
|
4235
4235
|
// src/resources/phases.ts
|
|
4236
|
-
var PhasesResource = class extends
|
|
4236
|
+
var PhasesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4237
4237
|
constructor(http, pageSize) {
|
|
4238
4238
|
super(http, {
|
|
4239
4239
|
key: "phases",
|
|
@@ -4292,7 +4292,7 @@ var PhasesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4292
4292
|
};
|
|
4293
4293
|
|
|
4294
4294
|
// src/resources/products.ts
|
|
4295
|
-
var ProductsResource = class extends
|
|
4295
|
+
var ProductsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4296
4296
|
constructor(http, pageSize) {
|
|
4297
4297
|
super(http, {
|
|
4298
4298
|
key: "products",
|
|
@@ -4359,7 +4359,7 @@ var ProductsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4359
4359
|
};
|
|
4360
4360
|
|
|
4361
4361
|
// src/resources/product_vendors.ts
|
|
4362
|
-
var ProductVendorsResource = class extends
|
|
4362
|
+
var ProductVendorsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4363
4363
|
constructor(http, pageSize) {
|
|
4364
4364
|
super(http, {
|
|
4365
4365
|
key: "product_vendors",
|
|
@@ -4418,7 +4418,7 @@ var ProductVendorsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4418
4418
|
};
|
|
4419
4419
|
|
|
4420
4420
|
// src/resources/project_charges.ts
|
|
4421
|
-
var ProjectChargesResource = class extends
|
|
4421
|
+
var ProjectChargesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4422
4422
|
constructor(http, pageSize) {
|
|
4423
4423
|
super(http, {
|
|
4424
4424
|
key: "project_charges",
|
|
@@ -4489,7 +4489,7 @@ var ProjectChargesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4489
4489
|
};
|
|
4490
4490
|
|
|
4491
4491
|
// src/resources/project_notes.ts
|
|
4492
|
-
var ProjectNotesResource = class extends
|
|
4492
|
+
var ProjectNotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4493
4493
|
constructor(http, pageSize) {
|
|
4494
4494
|
super(http, {
|
|
4495
4495
|
key: "project_notes",
|
|
@@ -4548,7 +4548,7 @@ var ProjectNotesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4548
4548
|
};
|
|
4549
4549
|
|
|
4550
4550
|
// src/resources/projects.ts
|
|
4551
|
-
var ProjectsResource = class extends
|
|
4551
|
+
var ProjectsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4552
4552
|
constructor(http, pageSize) {
|
|
4553
4553
|
super(http, {
|
|
4554
4554
|
key: "projects",
|
|
@@ -4625,13 +4625,13 @@ var ProjectsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4625
4625
|
const leadResource = await this.contextFetch("/V1.0/Resources", root["projectLeadResourceID"]);
|
|
4626
4626
|
const result = { project, company, opportunity, leadResource };
|
|
4627
4627
|
if (opts.names === true) {
|
|
4628
|
-
const builder =
|
|
4628
|
+
const builder = _chunkBPRDYT5Lcjs.createNamePlan.call(void 0, );
|
|
4629
4629
|
builder.addResource(root["creatorResourceID"]);
|
|
4630
4630
|
builder.addFk("contract", root["contractID"]);
|
|
4631
|
-
const names = await
|
|
4631
|
+
const names = await _chunkBPRDYT5Lcjs.resolveCompositeNames.call(void 0, this.http, builder.plan(), { maxNameReads: opts.maxNameReads });
|
|
4632
4632
|
const row = { ...project };
|
|
4633
|
-
|
|
4634
|
-
|
|
4633
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "creatorResourceID", (v) => names.resourceName(v));
|
|
4634
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "contractID", (v) => names.recordName("contract", v));
|
|
4635
4635
|
result.project = row;
|
|
4636
4636
|
result.names = names.section;
|
|
4637
4637
|
}
|
|
@@ -4640,7 +4640,7 @@ var ProjectsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4640
4640
|
};
|
|
4641
4641
|
|
|
4642
4642
|
// src/resources/purchase_approvals.ts
|
|
4643
|
-
var PurchaseApprovalsResource = class extends
|
|
4643
|
+
var PurchaseApprovalsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4644
4644
|
constructor(http, pageSize) {
|
|
4645
4645
|
super(http, {
|
|
4646
4646
|
key: "purchase_approvals",
|
|
@@ -4694,7 +4694,7 @@ var PurchaseApprovalsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4694
4694
|
};
|
|
4695
4695
|
|
|
4696
4696
|
// src/resources/purchase_order_item_receiving.ts
|
|
4697
|
-
var PurchaseOrderItemReceivingResource = class extends
|
|
4697
|
+
var PurchaseOrderItemReceivingResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4698
4698
|
constructor(http, pageSize) {
|
|
4699
4699
|
super(http, {
|
|
4700
4700
|
key: "purchase_order_item_receiving",
|
|
@@ -4744,7 +4744,7 @@ var PurchaseOrderItemReceivingResource = class extends _chunkLB34VFQYcjs.BaseRes
|
|
|
4744
4744
|
};
|
|
4745
4745
|
|
|
4746
4746
|
// src/resources/purchase_order_items.ts
|
|
4747
|
-
var PurchaseOrderItemsResource = class extends
|
|
4747
|
+
var PurchaseOrderItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4748
4748
|
constructor(http, pageSize) {
|
|
4749
4749
|
super(http, {
|
|
4750
4750
|
key: "purchase_order_items",
|
|
@@ -4803,7 +4803,7 @@ var PurchaseOrderItemsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4803
4803
|
};
|
|
4804
4804
|
|
|
4805
4805
|
// src/resources/purchase_orders.ts
|
|
4806
|
-
var PurchaseOrdersResource = class extends
|
|
4806
|
+
var PurchaseOrdersResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4807
4807
|
constructor(http, pageSize) {
|
|
4808
4808
|
super(http, {
|
|
4809
4809
|
key: "purchase_orders",
|
|
@@ -4865,7 +4865,7 @@ var PurchaseOrdersResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4865
4865
|
};
|
|
4866
4866
|
|
|
4867
4867
|
// src/resources/quote_items.ts
|
|
4868
|
-
var QuoteItemsResource = class extends
|
|
4868
|
+
var QuoteItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4869
4869
|
constructor(http, pageSize) {
|
|
4870
4870
|
super(http, {
|
|
4871
4871
|
key: "quote_items",
|
|
@@ -4936,7 +4936,7 @@ var QuoteItemsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
4936
4936
|
};
|
|
4937
4937
|
|
|
4938
4938
|
// src/resources/quote_locations.ts
|
|
4939
|
-
var QuoteLocationsResource = class extends
|
|
4939
|
+
var QuoteLocationsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
4940
4940
|
constructor(http, pageSize) {
|
|
4941
4941
|
super(http, {
|
|
4942
4942
|
key: "quote_locations",
|
|
@@ -5001,7 +5001,7 @@ var QuoteLocationsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5001
5001
|
};
|
|
5002
5002
|
|
|
5003
5003
|
// src/resources/quotes.ts
|
|
5004
|
-
var QuotesResource = class extends
|
|
5004
|
+
var QuotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5005
5005
|
constructor(http, pageSize) {
|
|
5006
5006
|
super(http, {
|
|
5007
5007
|
key: "quotes",
|
|
@@ -5068,7 +5068,7 @@ var QuotesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5068
5068
|
};
|
|
5069
5069
|
|
|
5070
5070
|
// src/resources/quote_templates.ts
|
|
5071
|
-
var QuoteTemplatesResource = class extends
|
|
5071
|
+
var QuoteTemplatesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5072
5072
|
constructor(http, pageSize) {
|
|
5073
5073
|
super(http, {
|
|
5074
5074
|
key: "quote_templates",
|
|
@@ -5112,7 +5112,7 @@ var QuoteTemplatesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5112
5112
|
};
|
|
5113
5113
|
|
|
5114
5114
|
// src/resources/resource_role_queues.ts
|
|
5115
|
-
var ResourceRoleQueuesResource = class extends
|
|
5115
|
+
var ResourceRoleQueuesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5116
5116
|
constructor(http, pageSize) {
|
|
5117
5117
|
super(http, {
|
|
5118
5118
|
key: "resource_role_queues",
|
|
@@ -5171,7 +5171,7 @@ var ResourceRoleQueuesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5171
5171
|
};
|
|
5172
5172
|
|
|
5173
5173
|
// src/resources/resource_roles.ts
|
|
5174
|
-
var ResourceRolesResource = class extends
|
|
5174
|
+
var ResourceRolesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5175
5175
|
constructor(http, pageSize) {
|
|
5176
5176
|
super(http, {
|
|
5177
5177
|
key: "resource_roles",
|
|
@@ -5213,7 +5213,7 @@ var ResourceRolesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5213
5213
|
};
|
|
5214
5214
|
|
|
5215
5215
|
// src/resources/resource_skills.ts
|
|
5216
|
-
var ResourceSkillsResource = class extends
|
|
5216
|
+
var ResourceSkillsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5217
5217
|
constructor(http, pageSize) {
|
|
5218
5218
|
super(http, {
|
|
5219
5219
|
key: "resource_skills",
|
|
@@ -5265,7 +5265,7 @@ var ResourceSkillsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5265
5265
|
|
|
5266
5266
|
// src/resources/special/resource_time_off_additional.ts
|
|
5267
5267
|
async function getByResource(_resource, resourceId, http) {
|
|
5268
|
-
const numericResource =
|
|
5268
|
+
const numericResource = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, resourceId, "resourceId");
|
|
5269
5269
|
const res = await http.request({
|
|
5270
5270
|
method: "GET",
|
|
5271
5271
|
path: `/V1.0/Resources/${numericResource}/TimeOffAdditional`,
|
|
@@ -5279,11 +5279,11 @@ async function getByResource(_resource, resourceId, http) {
|
|
|
5279
5279
|
if (typeof item === "object" && !Array.isArray(item)) return [item];
|
|
5280
5280
|
}
|
|
5281
5281
|
}
|
|
5282
|
-
return
|
|
5282
|
+
return _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res, "resource_time_off_additional.getByResource").items;
|
|
5283
5283
|
}
|
|
5284
5284
|
|
|
5285
5285
|
// src/resources/resource_time_off_additional.ts
|
|
5286
|
-
var ResourceTimeOffAdditionalResource = class extends
|
|
5286
|
+
var ResourceTimeOffAdditionalResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5287
5287
|
constructor(http, pageSize) {
|
|
5288
5288
|
super(http, {
|
|
5289
5289
|
key: "resource_time_off_additional",
|
|
@@ -5322,7 +5322,7 @@ var ResourceTimeOffAdditionalResource = class extends _chunkLB34VFQYcjs.BaseReso
|
|
|
5322
5322
|
};
|
|
5323
5323
|
|
|
5324
5324
|
// src/resources/resource_time_off_approvers.ts
|
|
5325
|
-
var ResourceTimeOffApproversResource = class extends
|
|
5325
|
+
var ResourceTimeOffApproversResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5326
5326
|
constructor(http, pageSize) {
|
|
5327
5327
|
super(http, {
|
|
5328
5328
|
key: "resource_time_off_approvers",
|
|
@@ -5365,29 +5365,29 @@ var ResourceTimeOffApproversResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
5365
5365
|
|
|
5366
5366
|
// src/resources/special/resource_time_off_balances.ts
|
|
5367
5367
|
async function getByResource2(_resource, resourceId, http) {
|
|
5368
|
-
const numericResource =
|
|
5368
|
+
const numericResource = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, resourceId, "resourceId");
|
|
5369
5369
|
const res = await http.request({
|
|
5370
5370
|
method: "GET",
|
|
5371
5371
|
path: `/V1.0/Resources/${numericResource}/TimeOffBalances`,
|
|
5372
5372
|
operation: "resource_time_off_balances.getByResource"
|
|
5373
5373
|
});
|
|
5374
|
-
return
|
|
5374
|
+
return _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res, "resource_time_off_balances.getByResource").items;
|
|
5375
5375
|
}
|
|
5376
5376
|
async function getByYear(_resource, resourceId, year, http) {
|
|
5377
|
-
const numericResource =
|
|
5377
|
+
const numericResource = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, resourceId, "resourceId");
|
|
5378
5378
|
if (!Number.isSafeInteger(year) || year < 1) {
|
|
5379
|
-
throw new (0,
|
|
5379
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("getByYear: year must be a positive integer");
|
|
5380
5380
|
}
|
|
5381
5381
|
const res = await http.request({
|
|
5382
5382
|
method: "GET",
|
|
5383
5383
|
path: `/V1.0/Resources/${numericResource}/TimeOffBalances/${year}`,
|
|
5384
5384
|
operation: "resource_time_off_balances.getByYear"
|
|
5385
5385
|
});
|
|
5386
|
-
return
|
|
5386
|
+
return _chunkBPRDYT5Lcjs.unwrapItem.call(void 0, res, year, "resource_time_off_balances.getByYear", "resource_time_off_balance");
|
|
5387
5387
|
}
|
|
5388
5388
|
|
|
5389
5389
|
// src/resources/resource_time_off_balances.ts
|
|
5390
|
-
var ResourceTimeOffBalancesResource = class extends
|
|
5390
|
+
var ResourceTimeOffBalancesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5391
5391
|
constructor(http, pageSize) {
|
|
5392
5392
|
super(http, {
|
|
5393
5393
|
key: "resource_time_off_balances",
|
|
@@ -5425,7 +5425,7 @@ var ResourceTimeOffBalancesResource = class extends _chunkLB34VFQYcjs.BaseResour
|
|
|
5425
5425
|
};
|
|
5426
5426
|
|
|
5427
5427
|
// src/resources/roles.ts
|
|
5428
|
-
var RolesResource = class extends
|
|
5428
|
+
var RolesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5429
5429
|
constructor(http, pageSize) {
|
|
5430
5430
|
super(http, {
|
|
5431
5431
|
key: "roles",
|
|
@@ -5492,7 +5492,7 @@ var RolesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5492
5492
|
};
|
|
5493
5493
|
|
|
5494
5494
|
// src/resources/sales_orders.ts
|
|
5495
|
-
var SalesOrdersResource = class extends
|
|
5495
|
+
var SalesOrdersResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5496
5496
|
constructor(http, pageSize) {
|
|
5497
5497
|
super(http, {
|
|
5498
5498
|
key: "sales_orders",
|
|
@@ -5535,7 +5535,7 @@ var SalesOrdersResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5535
5535
|
};
|
|
5536
5536
|
|
|
5537
5537
|
// src/resources/service_calls.ts
|
|
5538
|
-
var ServiceCallsResource = class extends
|
|
5538
|
+
var ServiceCallsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5539
5539
|
constructor(http, pageSize) {
|
|
5540
5540
|
super(http, {
|
|
5541
5541
|
key: "service_calls",
|
|
@@ -5604,7 +5604,7 @@ var ServiceCallsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5604
5604
|
};
|
|
5605
5605
|
|
|
5606
5606
|
// src/resources/service_call_task_resources.ts
|
|
5607
|
-
var ServiceCallTaskResourcesResource = class extends
|
|
5607
|
+
var ServiceCallTaskResourcesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5608
5608
|
constructor(http, pageSize) {
|
|
5609
5609
|
super(http, {
|
|
5610
5610
|
key: "service_call_task_resources",
|
|
@@ -5661,7 +5661,7 @@ var ServiceCallTaskResourcesResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
5661
5661
|
};
|
|
5662
5662
|
|
|
5663
5663
|
// src/resources/service_call_tasks.ts
|
|
5664
|
-
var ServiceCallTasksResource = class extends
|
|
5664
|
+
var ServiceCallTasksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5665
5665
|
constructor(http, pageSize) {
|
|
5666
5666
|
super(http, {
|
|
5667
5667
|
key: "service_call_tasks",
|
|
@@ -5718,7 +5718,7 @@ var ServiceCallTasksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5718
5718
|
};
|
|
5719
5719
|
|
|
5720
5720
|
// src/resources/service_call_ticket_resources.ts
|
|
5721
|
-
var ServiceCallTicketResourcesResource = class extends
|
|
5721
|
+
var ServiceCallTicketResourcesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5722
5722
|
constructor(http, pageSize) {
|
|
5723
5723
|
super(http, {
|
|
5724
5724
|
key: "service_call_ticket_resources",
|
|
@@ -5775,7 +5775,7 @@ var ServiceCallTicketResourcesResource = class extends _chunkLB34VFQYcjs.BaseRes
|
|
|
5775
5775
|
};
|
|
5776
5776
|
|
|
5777
5777
|
// src/resources/service_call_tickets.ts
|
|
5778
|
-
var ServiceCallTicketsResource = class extends
|
|
5778
|
+
var ServiceCallTicketsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5779
5779
|
constructor(http, pageSize) {
|
|
5780
5780
|
super(http, {
|
|
5781
5781
|
key: "service_call_tickets",
|
|
@@ -5832,7 +5832,7 @@ var ServiceCallTicketsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5832
5832
|
};
|
|
5833
5833
|
|
|
5834
5834
|
// src/resources/service_level_agreement_results.ts
|
|
5835
|
-
var ServiceLevelAgreementResultsResource = class extends
|
|
5835
|
+
var ServiceLevelAgreementResultsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5836
5836
|
constructor(http, pageSize) {
|
|
5837
5837
|
super(http, {
|
|
5838
5838
|
key: "service_level_agreement_results",
|
|
@@ -5871,7 +5871,7 @@ var ServiceLevelAgreementResultsResource = class extends _chunkLB34VFQYcjs.BaseR
|
|
|
5871
5871
|
};
|
|
5872
5872
|
|
|
5873
5873
|
// src/resources/services.ts
|
|
5874
|
-
var ServicesResource = class extends
|
|
5874
|
+
var ServicesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5875
5875
|
constructor(http, pageSize) {
|
|
5876
5876
|
super(http, {
|
|
5877
5877
|
key: "services",
|
|
@@ -5939,7 +5939,7 @@ var ServicesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5939
5939
|
};
|
|
5940
5940
|
|
|
5941
5941
|
// src/resources/skills.ts
|
|
5942
|
-
var SkillsResource = class extends
|
|
5942
|
+
var SkillsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5943
5943
|
constructor(http, pageSize) {
|
|
5944
5944
|
super(http, {
|
|
5945
5945
|
key: "skills",
|
|
@@ -5983,7 +5983,7 @@ var SkillsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
5983
5983
|
};
|
|
5984
5984
|
|
|
5985
5985
|
// src/resources/subscription_periods.ts
|
|
5986
|
-
var SubscriptionPeriodsResource = class extends
|
|
5986
|
+
var SubscriptionPeriodsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
5987
5987
|
constructor(http, pageSize) {
|
|
5988
5988
|
super(http, {
|
|
5989
5989
|
key: "subscription_periods",
|
|
@@ -6022,7 +6022,7 @@ var SubscriptionPeriodsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6022
6022
|
};
|
|
6023
6023
|
|
|
6024
6024
|
// src/resources/subscriptions.ts
|
|
6025
|
-
var SubscriptionsResource = class extends
|
|
6025
|
+
var SubscriptionsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6026
6026
|
constructor(http, pageSize) {
|
|
6027
6027
|
super(http, {
|
|
6028
6028
|
key: "subscriptions",
|
|
@@ -6091,7 +6091,7 @@ var SubscriptionsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6091
6091
|
};
|
|
6092
6092
|
|
|
6093
6093
|
// src/resources/survey_results.ts
|
|
6094
|
-
var SurveyResultsResource = class extends
|
|
6094
|
+
var SurveyResultsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6095
6095
|
constructor(http, pageSize) {
|
|
6096
6096
|
super(http, {
|
|
6097
6097
|
key: "survey_results",
|
|
@@ -6130,7 +6130,7 @@ var SurveyResultsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6130
6130
|
};
|
|
6131
6131
|
|
|
6132
6132
|
// src/resources/surveys.ts
|
|
6133
|
-
var SurveysResource = class extends
|
|
6133
|
+
var SurveysResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6134
6134
|
constructor(http, pageSize) {
|
|
6135
6135
|
super(http, {
|
|
6136
6136
|
key: "surveys",
|
|
@@ -6174,7 +6174,7 @@ var SurveysResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6174
6174
|
};
|
|
6175
6175
|
|
|
6176
6176
|
// src/resources/tag_aliases.ts
|
|
6177
|
-
var TagAliasesResource = class extends
|
|
6177
|
+
var TagAliasesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6178
6178
|
constructor(http, pageSize) {
|
|
6179
6179
|
super(http, {
|
|
6180
6180
|
key: "tag_aliases",
|
|
@@ -6231,7 +6231,7 @@ var TagAliasesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6231
6231
|
};
|
|
6232
6232
|
|
|
6233
6233
|
// src/resources/tag_groups.ts
|
|
6234
|
-
var TagGroupsResource = class extends
|
|
6234
|
+
var TagGroupsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6235
6235
|
constructor(http, pageSize) {
|
|
6236
6236
|
super(http, {
|
|
6237
6237
|
key: "tag_groups",
|
|
@@ -6300,7 +6300,7 @@ var TagGroupsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6300
6300
|
};
|
|
6301
6301
|
|
|
6302
6302
|
// src/resources/tags.ts
|
|
6303
|
-
var TagsResource = class extends
|
|
6303
|
+
var TagsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6304
6304
|
constructor(http, pageSize) {
|
|
6305
6305
|
super(http, {
|
|
6306
6306
|
key: "tags",
|
|
@@ -6369,7 +6369,7 @@ var TagsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6369
6369
|
};
|
|
6370
6370
|
|
|
6371
6371
|
// src/resources/task_secondary_resources.ts
|
|
6372
|
-
var TaskSecondaryResourcesResource = class extends
|
|
6372
|
+
var TaskSecondaryResourcesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6373
6373
|
constructor(http, pageSize) {
|
|
6374
6374
|
super(http, {
|
|
6375
6375
|
key: "task_secondary_resources",
|
|
@@ -6426,7 +6426,7 @@ var TaskSecondaryResourcesResource = class extends _chunkLB34VFQYcjs.BaseResourc
|
|
|
6426
6426
|
};
|
|
6427
6427
|
|
|
6428
6428
|
// src/resources/tasks.ts
|
|
6429
|
-
var TasksResource = class extends
|
|
6429
|
+
var TasksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6430
6430
|
constructor(http, pageSize) {
|
|
6431
6431
|
super(http, {
|
|
6432
6432
|
key: "tasks",
|
|
@@ -6490,7 +6490,7 @@ var TasksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6490
6490
|
};
|
|
6491
6491
|
|
|
6492
6492
|
// src/resources/tax_regions.ts
|
|
6493
|
-
var TaxRegionsResource = class extends
|
|
6493
|
+
var TaxRegionsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6494
6494
|
constructor(http, pageSize) {
|
|
6495
6495
|
super(http, {
|
|
6496
6496
|
key: "tax_regions",
|
|
@@ -6565,7 +6565,7 @@ var ThresholdInformationResource = class {
|
|
|
6565
6565
|
};
|
|
6566
6566
|
|
|
6567
6567
|
// src/resources/ticket_additional_configuration_items.ts
|
|
6568
|
-
var TicketAdditionalConfigurationItemsResource = class extends
|
|
6568
|
+
var TicketAdditionalConfigurationItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6569
6569
|
constructor(http, pageSize) {
|
|
6570
6570
|
super(http, {
|
|
6571
6571
|
key: "ticket_additional_configuration_items",
|
|
@@ -6622,7 +6622,7 @@ var TicketAdditionalConfigurationItemsResource = class extends _chunkLB34VFQYcjs
|
|
|
6622
6622
|
};
|
|
6623
6623
|
|
|
6624
6624
|
// src/resources/ticket_additional_contacts.ts
|
|
6625
|
-
var TicketAdditionalContactsResource = class extends
|
|
6625
|
+
var TicketAdditionalContactsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6626
6626
|
constructor(http, pageSize) {
|
|
6627
6627
|
super(http, {
|
|
6628
6628
|
key: "ticket_additional_contacts",
|
|
@@ -6679,7 +6679,7 @@ var TicketAdditionalContactsResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
6679
6679
|
};
|
|
6680
6680
|
|
|
6681
6681
|
// src/resources/ticket_attachments.ts
|
|
6682
|
-
var TicketAttachmentsResource = class extends
|
|
6682
|
+
var TicketAttachmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6683
6683
|
constructor(http, pageSize) {
|
|
6684
6684
|
super(http, {
|
|
6685
6685
|
key: "ticket_attachments",
|
|
@@ -6741,7 +6741,7 @@ var TicketAttachmentsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6741
6741
|
};
|
|
6742
6742
|
|
|
6743
6743
|
// src/resources/ticket_categories.ts
|
|
6744
|
-
var TicketCategoriesResource = class extends
|
|
6744
|
+
var TicketCategoriesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6745
6745
|
constructor(http, pageSize) {
|
|
6746
6746
|
super(http, {
|
|
6747
6747
|
key: "ticket_categories",
|
|
@@ -6800,7 +6800,7 @@ var TicketCategoriesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
6800
6800
|
};
|
|
6801
6801
|
|
|
6802
6802
|
// src/resources/ticket_category_field_defaults.ts
|
|
6803
|
-
var TicketCategoryFieldDefaultsResource = class extends
|
|
6803
|
+
var TicketCategoryFieldDefaultsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6804
6804
|
constructor(http, pageSize) {
|
|
6805
6805
|
super(http, {
|
|
6806
6806
|
key: "ticket_category_field_defaults",
|
|
@@ -6842,7 +6842,7 @@ var TicketCategoryFieldDefaultsResource = class extends _chunkLB34VFQYcjs.BaseRe
|
|
|
6842
6842
|
};
|
|
6843
6843
|
|
|
6844
6844
|
// src/resources/ticket_change_request_approvals.ts
|
|
6845
|
-
var TicketChangeRequestApprovalsResource = class extends
|
|
6845
|
+
var TicketChangeRequestApprovalsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6846
6846
|
constructor(http, pageSize) {
|
|
6847
6847
|
super(http, {
|
|
6848
6848
|
key: "ticket_change_request_approvals",
|
|
@@ -6903,13 +6903,13 @@ var OP = "ticket_charges.moveToTicket";
|
|
|
6903
6903
|
var COPY = ["name", "description", "chargeType", "billingCodeID", "productID", "unitQuantity", "unitCost", "unitPrice", "datePurchased", "isBillableToCompany", "notes", "purchaseOrderNumber", "internalPurchaseOrderNumber"];
|
|
6904
6904
|
var CONTRACT_SCOPED = ["contractServiceID", "contractServiceBundleID"];
|
|
6905
6905
|
async function readCharge(http, id, retries) {
|
|
6906
|
-
const rows = await
|
|
6906
|
+
const rows = await _chunkBPRDYT5Lcjs.queryRows.call(void 0, http, "TicketCharges", [{ field: "id", op: "eq", value: id }], OP, retries);
|
|
6907
6907
|
return _nullishCoalesce(rows[0], () => ( null));
|
|
6908
6908
|
}
|
|
6909
6909
|
async function checkSource({ http, source, sourceId, sourceTicketId, toTicketId }) {
|
|
6910
6910
|
if (source.isBilled === true) {
|
|
6911
|
-
throw
|
|
6912
|
-
manualAction: { action: "delete_source", uiLink:
|
|
6911
|
+
throw _chunkBPRDYT5Lcjs.refuse.call(void 0, "MOVE_BLOCKED_BILLED", `${OP}: ticket charge ${sourceId} is billed \u2014 move it in the Autotask UI`, { sourceId, toTicketId }, OP, {
|
|
6912
|
+
manualAction: { action: "delete_source", uiLink: _chunkBPRDYT5Lcjs.uiLinkFor.call(void 0, http, "tickets", sourceTicketId), reason: "billed charges are not moved by the API (the ticket link opens its charges)" }
|
|
6913
6913
|
});
|
|
6914
6914
|
}
|
|
6915
6915
|
}
|
|
@@ -6943,14 +6943,14 @@ var SPEC = {
|
|
|
6943
6943
|
]
|
|
6944
6944
|
}),
|
|
6945
6945
|
// charges have no ExecuteCommand code: the parent ticket is the closest clickable target
|
|
6946
|
-
manualLink: (http, source) => typeof source.ticketID === "number" ?
|
|
6946
|
+
manualLink: (http, source) => typeof source.ticketID === "number" ? _chunkBPRDYT5Lcjs.uiLinkFor.call(void 0, http, "tickets", source.ticketID) : null
|
|
6947
6947
|
};
|
|
6948
6948
|
function moveToTicket(_resource, sourceId, toTicketId, opts, http) {
|
|
6949
|
-
return
|
|
6949
|
+
return _chunkBPRDYT5Lcjs.runMove.call(void 0, http, SPEC, sourceId, toTicketId, opts);
|
|
6950
6950
|
}
|
|
6951
6951
|
|
|
6952
6952
|
// src/resources/ticket_charges.ts
|
|
6953
|
-
var TicketChargesResource = class extends
|
|
6953
|
+
var TicketChargesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
6954
6954
|
constructor(http, pageSize) {
|
|
6955
6955
|
super(http, {
|
|
6956
6956
|
key: "ticket_charges",
|
|
@@ -7025,7 +7025,7 @@ var TicketChargesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
7025
7025
|
};
|
|
7026
7026
|
|
|
7027
7027
|
// src/resources/ticket_checklist_items.ts
|
|
7028
|
-
var TicketChecklistItemsResource = class extends
|
|
7028
|
+
var TicketChecklistItemsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7029
7029
|
constructor(http, pageSize) {
|
|
7030
7030
|
super(http, {
|
|
7031
7031
|
key: "ticket_checklist_items",
|
|
@@ -7091,7 +7091,7 @@ var TicketChecklistItemsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
7091
7091
|
};
|
|
7092
7092
|
|
|
7093
7093
|
// src/resources/ticket_checklist_libraries.ts
|
|
7094
|
-
var TicketChecklistLibrariesResource = class extends
|
|
7094
|
+
var TicketChecklistLibrariesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7095
7095
|
constructor(http, pageSize) {
|
|
7096
7096
|
super(http, {
|
|
7097
7097
|
key: "ticket_checklist_libraries",
|
|
@@ -7115,9 +7115,9 @@ var TicketChecklistLibrariesResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
7115
7115
|
* `dryRun: true` returns the pinned envelope (document existence is unverifiable in the MVP
|
|
7116
7116
|
* surface — no documents read op — and never issues the POST). */
|
|
7117
7117
|
async attachToDocument(documentID, data, opts = {}) {
|
|
7118
|
-
const n =
|
|
7118
|
+
const n = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, documentID, "documentID");
|
|
7119
7119
|
if (opts.dryRun === true) {
|
|
7120
|
-
return
|
|
7120
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
7121
7121
|
operation: "ticket_checklist_libraries.attachToDocument",
|
|
7122
7122
|
method: "POST",
|
|
7123
7123
|
path: `/V1.0/Documents/${n}/ChecklistLibraries`,
|
|
@@ -7135,7 +7135,7 @@ var TicketChecklistLibrariesResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
7135
7135
|
operation: "ticket_checklist_libraries.attachToDocument",
|
|
7136
7136
|
maxRetries: opts.maxRetries
|
|
7137
7137
|
});
|
|
7138
|
-
return
|
|
7138
|
+
return _chunkBPRDYT5Lcjs.unwrapOperation.call(void 0, res);
|
|
7139
7139
|
}
|
|
7140
7140
|
/** Resolve a TicketChecklistLibrary from a numeric id (or, where the vendor indexes a primary text field,
|
|
7141
7141
|
* from a numeric id — this resource has no primary text field). A numeric id miss throws NOT_FOUND;
|
|
@@ -7151,7 +7151,7 @@ var TicketChecklistLibrariesResource = class extends _chunkLB34VFQYcjs.BaseResou
|
|
|
7151
7151
|
};
|
|
7152
7152
|
|
|
7153
7153
|
// src/resources/ticket_history.ts
|
|
7154
|
-
var TicketHistoryResource = class extends
|
|
7154
|
+
var TicketHistoryResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7155
7155
|
constructor(http, pageSize) {
|
|
7156
7156
|
super(http, {
|
|
7157
7157
|
key: "ticket_history",
|
|
@@ -7190,7 +7190,7 @@ var TicketHistoryResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
7190
7190
|
};
|
|
7191
7191
|
|
|
7192
7192
|
// src/resources/ticket_note_attachments.ts
|
|
7193
|
-
var TicketNoteAttachmentsResource = class extends
|
|
7193
|
+
var TicketNoteAttachmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7194
7194
|
constructor(http, pageSize) {
|
|
7195
7195
|
super(http, {
|
|
7196
7196
|
key: "ticket_note_attachments",
|
|
@@ -7252,7 +7252,7 @@ var TicketNoteAttachmentsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
7252
7252
|
};
|
|
7253
7253
|
|
|
7254
7254
|
// src/resources/ticket_notes.ts
|
|
7255
|
-
var TicketNotesResource = class extends
|
|
7255
|
+
var TicketNotesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7256
7256
|
constructor(http, pageSize) {
|
|
7257
7257
|
super(http, {
|
|
7258
7258
|
key: "ticket_notes",
|
|
@@ -7311,7 +7311,7 @@ var TicketNotesResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
7311
7311
|
};
|
|
7312
7312
|
|
|
7313
7313
|
// src/resources/ticket_note_webhooks.ts
|
|
7314
|
-
var TicketNoteWebhooksResource = class extends
|
|
7314
|
+
var TicketNoteWebhooksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7315
7315
|
constructor(http, pageSize) {
|
|
7316
7316
|
super(http, {
|
|
7317
7317
|
key: "ticket_note_webhooks",
|
|
@@ -7387,7 +7387,7 @@ var TicketNoteWebhooksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
7387
7387
|
};
|
|
7388
7388
|
|
|
7389
7389
|
// src/resources/ticket_secondary_resources.ts
|
|
7390
|
-
var TicketSecondaryResourcesResource = class extends
|
|
7390
|
+
var TicketSecondaryResourcesResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
7391
7391
|
constructor(http, pageSize) {
|
|
7392
7392
|
super(http, {
|
|
7393
7393
|
key: "ticket_secondary_resources",
|
|
@@ -7452,9 +7452,9 @@ async function fetchTicket(http, id, operation) {
|
|
|
7452
7452
|
});
|
|
7453
7453
|
const body = res;
|
|
7454
7454
|
if (body === null || !("item" in body)) {
|
|
7455
|
-
throw new (0,
|
|
7455
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`Ticket ${id} not found (unexpected envelope shape)`, { resourceIds: [id], details: { idRefs: [{ entity: "ticket", id }] } });
|
|
7456
7456
|
}
|
|
7457
|
-
if (body.item === null || body.item === void 0) throw new (0,
|
|
7457
|
+
if (body.item === null || body.item === void 0) throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`Ticket ${id} not found`, { resourceIds: [id], details: { idRefs: [{ entity: "ticket", id }] } });
|
|
7458
7458
|
return body.item;
|
|
7459
7459
|
}
|
|
7460
7460
|
async function ticketQueryItems(http, path, filter, maxRecords, operation) {
|
|
@@ -7465,7 +7465,7 @@ async function ticketQueryItems(http, path, filter, maxRecords, operation) {
|
|
|
7465
7465
|
body: { MaxRecords: maxRecords, filter },
|
|
7466
7466
|
operation
|
|
7467
7467
|
});
|
|
7468
|
-
return
|
|
7468
|
+
return _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res).items;
|
|
7469
7469
|
}
|
|
7470
7470
|
function truncate(text, limit) {
|
|
7471
7471
|
const full = _nullishCoalesce(text, () => ( ""));
|
|
@@ -7475,13 +7475,13 @@ function truncate(text, limit) {
|
|
|
7475
7475
|
|
|
7476
7476
|
// src/resources/special/tickets/childRead.ts
|
|
7477
7477
|
function isRouteUnavailable(err) {
|
|
7478
|
-
return
|
|
7478
|
+
return _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) && (err.httpStatus === 404 || err.httpStatus === 500);
|
|
7479
7479
|
}
|
|
7480
7480
|
function routeFact(route, path, err) {
|
|
7481
7481
|
return {
|
|
7482
7482
|
route,
|
|
7483
7483
|
path,
|
|
7484
|
-
httpStatus:
|
|
7484
|
+
httpStatus: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) && typeof err.httpStatus === "number" ? err.httpStatus : null
|
|
7485
7485
|
};
|
|
7486
7486
|
}
|
|
7487
7487
|
function childDeclaresQuery(resourceKey) {
|
|
@@ -7491,10 +7491,10 @@ function childDeclaresQuery(resourceKey) {
|
|
|
7491
7491
|
}
|
|
7492
7492
|
function planScopedPath(resourceKey, ticketId) {
|
|
7493
7493
|
if (!childDeclaresQuery(resourceKey)) return null;
|
|
7494
|
-
const entry =
|
|
7494
|
+
const entry = _chunkBPRDYT5Lcjs.RELATIONSHIP_MAP[resourceKey];
|
|
7495
7495
|
const parent = entry === void 0 ? null : entry.parent;
|
|
7496
7496
|
if (parent === null || parent.resource !== "tickets" || parent.segment === null || parent.field === null) return null;
|
|
7497
|
-
const parentPath = _optionalChain([
|
|
7497
|
+
const parentPath = _optionalChain([_chunkBPRDYT5Lcjs.RELATIONSHIP_MAP, 'access', _158 => _158[parent.resource], 'optionalAccess', _159 => _159.path]);
|
|
7498
7498
|
if (parentPath === null || parentPath === void 0) return null;
|
|
7499
7499
|
return `/V1.0/${parentPath}/${ticketId}/${parent.segment}`;
|
|
7500
7500
|
}
|
|
@@ -7533,14 +7533,14 @@ async function scopedCollectionRead(http, startPath, limit, operation, accept) {
|
|
|
7533
7533
|
break;
|
|
7534
7534
|
}
|
|
7535
7535
|
const body = await http.request({ method: "GET", path: target, operation });
|
|
7536
|
-
const { items: pageItems, pageDetails } =
|
|
7536
|
+
const { items: pageItems, pageDetails } = _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, body, operation);
|
|
7537
7537
|
nextCursor = pageDetails.nextPageUrl;
|
|
7538
7538
|
pages += 1;
|
|
7539
7539
|
const window = pageItems.slice(0, Math.max(0, limit - items.length));
|
|
7540
7540
|
for (const row of window) if (accept(row)) items.push(row);
|
|
7541
7541
|
if (items.length >= limit) break;
|
|
7542
7542
|
if (nextCursor === null || pageItems.length === 0) break;
|
|
7543
|
-
target =
|
|
7543
|
+
target = _chunkBPRDYT5Lcjs.cursorToPath.call(void 0, http.baseUrl, nextCursor);
|
|
7544
7544
|
}
|
|
7545
7545
|
const capped = items.length >= limit || guard && nextCursor !== null;
|
|
7546
7546
|
return { items, capped };
|
|
@@ -7573,7 +7573,7 @@ var MS = 864e5;
|
|
|
7573
7573
|
var SLA_PAGE = 100;
|
|
7574
7574
|
async function slaHealthCheck(_resource, id, opts = {}, http) {
|
|
7575
7575
|
void opts;
|
|
7576
|
-
const ticketId =
|
|
7576
|
+
const ticketId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
7577
7577
|
await fetchTicket(http, ticketId, "tickets.slaHealthCheck");
|
|
7578
7578
|
const rows = await ticketQueryItems(
|
|
7579
7579
|
http,
|
|
@@ -7598,9 +7598,9 @@ async function slaHealthCheck(_resource, id, opts = {}, http) {
|
|
|
7598
7598
|
async function summary(_resource, id, opts = {}, http) {
|
|
7599
7599
|
const limit = opts.summaryTextLimit === void 0 ? 500 : Math.trunc(opts.summaryTextLimit);
|
|
7600
7600
|
if (!Number.isInteger(limit) || limit < 1) {
|
|
7601
|
-
throw new (0,
|
|
7601
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`summaryTextLimit must be an integer >= 1 (got ${String(opts.summaryTextLimit)})`);
|
|
7602
7602
|
}
|
|
7603
|
-
const ticketId =
|
|
7603
|
+
const ticketId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
7604
7604
|
const ticket = await fetchTicket(http, ticketId, "tickets.summary");
|
|
7605
7605
|
const desc = truncate(ticket.description, limit);
|
|
7606
7606
|
const now = _nullishCoalesce(opts.now, () => ( /* @__PURE__ */ new Date()));
|
|
@@ -7629,11 +7629,11 @@ async function summary(_resource, id, opts = {}, http) {
|
|
|
7629
7629
|
// src/resources/special/tickets/timeline.ts
|
|
7630
7630
|
function validateTimelineLimits(opts) {
|
|
7631
7631
|
const limit = opts.limit === void 0 ? 100 : Math.trunc(opts.limit);
|
|
7632
|
-
if (!Number.isInteger(limit) || limit < 1) throw new (0,
|
|
7632
|
+
if (!Number.isInteger(limit) || limit < 1) throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`limit must be an integer >= 1 (got ${String(opts.limit)})`);
|
|
7633
7633
|
const bounded = Math.min(limit, 500);
|
|
7634
7634
|
const textLimit = opts.textLimit === void 0 ? 500 : Math.trunc(opts.textLimit);
|
|
7635
7635
|
if (!Number.isInteger(textLimit) || textLimit < 1) {
|
|
7636
|
-
throw new (0,
|
|
7636
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`textLimit must be an integer >= 1 (got ${String(opts.textLimit)})`);
|
|
7637
7637
|
}
|
|
7638
7638
|
return { bounded, textLimit };
|
|
7639
7639
|
}
|
|
@@ -7685,7 +7685,7 @@ function compareEventDates(a, b) {
|
|
|
7685
7685
|
}
|
|
7686
7686
|
async function timeline(_resource, id, opts = {}, http) {
|
|
7687
7687
|
const { bounded, textLimit } = validateTimelineLimits(opts);
|
|
7688
|
-
const ticketId =
|
|
7688
|
+
const ticketId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
7689
7689
|
await fetchTicket(http, ticketId, "tickets.timeline");
|
|
7690
7690
|
const dateFilters = (field) => {
|
|
7691
7691
|
const f = [{ field: "ticketID", op: "eq", value: ticketId }];
|
|
@@ -7725,7 +7725,7 @@ async function timeline(_resource, id, opts = {}, http) {
|
|
|
7725
7725
|
}
|
|
7726
7726
|
|
|
7727
7727
|
// src/resources/special/tickets/errors.ts
|
|
7728
|
-
var QueueRequiredError = class extends
|
|
7728
|
+
var QueueRequiredError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
7729
7729
|
constructor(message, options = {}) {
|
|
7730
7730
|
super(message, {
|
|
7731
7731
|
code: "QUEUE_REQUIRED",
|
|
@@ -7736,13 +7736,13 @@ var QueueRequiredError = class extends _chunkLB34VFQYcjs.AutotaskError {
|
|
|
7736
7736
|
this.name = "QueueRequiredError";
|
|
7737
7737
|
}
|
|
7738
7738
|
};
|
|
7739
|
-
var TicketResourceInvalidError = class extends
|
|
7739
|
+
var TicketResourceInvalidError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
7740
7740
|
constructor(message, options = {}) {
|
|
7741
7741
|
super(message, { code: "RESOURCE_INVALID", category: "validation", ...options });
|
|
7742
7742
|
this.name = "TicketResourceInvalidError";
|
|
7743
7743
|
}
|
|
7744
7744
|
};
|
|
7745
|
-
var TicketCreateValidationFailedError = class extends
|
|
7745
|
+
var TicketCreateValidationFailedError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
7746
7746
|
/** The vendor-named fields (empty when the 500 body named nothing parseable). */
|
|
7747
7747
|
|
|
7748
7748
|
constructor(message, vendorFields, options = {}) {
|
|
@@ -7751,7 +7751,7 @@ var TicketCreateValidationFailedError = class extends _chunkLB34VFQYcjs.Autotask
|
|
|
7751
7751
|
this.vendorFields = vendorFields;
|
|
7752
7752
|
}
|
|
7753
7753
|
};
|
|
7754
|
-
var StatusUnknownError = class extends
|
|
7754
|
+
var StatusUnknownError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
7755
7755
|
/** The live picklist size (the message names it; the values + labels are via operations.fieldCatalog with labels: true). */
|
|
7756
7756
|
|
|
7757
7757
|
constructor(message, options = {}) {
|
|
@@ -7765,7 +7765,7 @@ var StatusUnknownError = class extends _chunkLB34VFQYcjs.AutotaskError {
|
|
|
7765
7765
|
this.picklistCount = _nullishCoalesce(options.picklistCount, () => ( 0));
|
|
7766
7766
|
}
|
|
7767
7767
|
};
|
|
7768
|
-
var StatusFieldsRequiredError = class extends
|
|
7768
|
+
var StatusFieldsRequiredError = class extends _chunkBPRDYT5Lcjs.AutotaskError {
|
|
7769
7769
|
|
|
7770
7770
|
|
|
7771
7771
|
|
|
@@ -7788,14 +7788,14 @@ function isPositiveInt(v) {
|
|
|
7788
7788
|
return typeof v === "number" && Number.isInteger(v) && v > 0;
|
|
7789
7789
|
}
|
|
7790
7790
|
function namedVendorFields(err) {
|
|
7791
|
-
if (!
|
|
7792
|
-
const entries = _nullishCoalesce(
|
|
7791
|
+
if (!_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return [];
|
|
7792
|
+
const entries = _nullishCoalesce(_chunkBPRDYT5Lcjs.parseVendorErrors.call(void 0, err.vendorError), () => ( []));
|
|
7793
7793
|
const out = /* @__PURE__ */ new Set();
|
|
7794
7794
|
for (const e of entries) if (e.field !== void 0) out.add(e.field);
|
|
7795
7795
|
return [...out];
|
|
7796
7796
|
}
|
|
7797
7797
|
function vendorDetailOf(err) {
|
|
7798
|
-
return
|
|
7798
|
+
return _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? _chunkBPRDYT5Lcjs.formatVendorDetail.call(void 0, err.vendorError) : void 0;
|
|
7799
7799
|
}
|
|
7800
7800
|
async function fetchItem(http, path, operation, readOpts) {
|
|
7801
7801
|
const res = await http.request({ method: "GET", path, operation, maxRetries: _optionalChain([readOpts, 'optionalAccess', _160 => _160.maxRetries]) });
|
|
@@ -7816,8 +7816,8 @@ function operationId(res) {
|
|
|
7816
7816
|
return typeof body.itemId === "number" ? body.itemId : typeof body.id === "number" ? body.id : void 0;
|
|
7817
7817
|
}
|
|
7818
7818
|
function discoveryMerge(err, body, defaults) {
|
|
7819
|
-
if (!
|
|
7820
|
-
const entries =
|
|
7819
|
+
if (!_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) || err.vendorError === void 0) return null;
|
|
7820
|
+
const entries = _chunkBPRDYT5Lcjs.parseVendorErrors.call(void 0, err.vendorError);
|
|
7821
7821
|
if (entries === void 0) return null;
|
|
7822
7822
|
for (const entry of entries) {
|
|
7823
7823
|
const field = entry.field;
|
|
@@ -7829,7 +7829,7 @@ function discoveryMerge(err, body, defaults) {
|
|
|
7829
7829
|
}
|
|
7830
7830
|
function stepErrorText(code, err) {
|
|
7831
7831
|
const detail = vendorDetailOf(err);
|
|
7832
|
-
const base =
|
|
7832
|
+
const base = _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.message : String(err);
|
|
7833
7833
|
return detail ? `${code}: ${detail}` : `${code}: ${base}`;
|
|
7834
7834
|
}
|
|
7835
7835
|
|
|
@@ -7841,43 +7841,43 @@ var DEFAULT_PUBLISH = 1;
|
|
|
7841
7841
|
var PUBLISH_VALUES = /* @__PURE__ */ new Set([1, 2, 4]);
|
|
7842
7842
|
var SAFE_TICKET_CREATE_DEFAULTS = {};
|
|
7843
7843
|
function validateOpenInput(params, note, assign) {
|
|
7844
|
-
const companyID =
|
|
7844
|
+
const companyID = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, _optionalChain([params, 'optionalAccess', _162 => _162.companyID]), "params.companyID");
|
|
7845
7845
|
const title = _optionalChain([params, 'optionalAccess', _163 => _163.title]);
|
|
7846
7846
|
if (typeof title !== "string" || title.trim() === "") {
|
|
7847
|
-
throw new (0,
|
|
7847
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("openWithNoteAndAssign: params.title is required (a non-empty string)", { operation: OP_OPEN });
|
|
7848
7848
|
}
|
|
7849
7849
|
const priority = _nullishCoalesce(params.priority, () => ( DEFAULT_TICKET_PRIORITY));
|
|
7850
7850
|
const status = _nullishCoalesce(params.status, () => ( DEFAULT_TICKET_STATUS));
|
|
7851
7851
|
if (!isPositiveInt(priority)) {
|
|
7852
|
-
throw new (0,
|
|
7852
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: params.priority must be a positive integer (got ${String(params.priority)})`, { operation: OP_OPEN });
|
|
7853
7853
|
}
|
|
7854
7854
|
if (!isPositiveInt(status)) {
|
|
7855
|
-
throw new (0,
|
|
7855
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: params.status must be a positive integer (got ${String(params.status)})`, { operation: OP_OPEN });
|
|
7856
7856
|
}
|
|
7857
7857
|
if (params.queueID !== void 0 && !isPositiveInt(params.queueID)) {
|
|
7858
|
-
throw new (0,
|
|
7858
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: params.queueID must be a positive integer (got ${String(params.queueID)})`, { operation: OP_OPEN });
|
|
7859
7859
|
}
|
|
7860
7860
|
if (note !== void 0) {
|
|
7861
7861
|
if (typeof note.description !== "string" || note.description.trim() === "") {
|
|
7862
|
-
throw new (0,
|
|
7862
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("openWithNoteAndAssign: note.description is required (a non-empty string)", { operation: OP_OPEN });
|
|
7863
7863
|
}
|
|
7864
7864
|
if (typeof note.title !== "string" || note.title.trim() === "") {
|
|
7865
|
-
throw new (0,
|
|
7865
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("openWithNoteAndAssign: note.title is required (a non-empty string) \u2014 the ww29 scoped note create 500s without it (S12-A live-verified: Missing Required Field: title; the S11-B proven note body is { title, description, noteType: 1, publish: 1 })", { operation: OP_OPEN });
|
|
7866
7866
|
}
|
|
7867
7867
|
if (note.noteType !== void 0 && !isPositiveInt(note.noteType)) {
|
|
7868
|
-
throw new (0,
|
|
7868
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: note.noteType must be a positive integer (got ${String(note.noteType)})`, { operation: OP_OPEN });
|
|
7869
7869
|
}
|
|
7870
7870
|
if (note.publish !== void 0 && !PUBLISH_VALUES.has(note.publish)) {
|
|
7871
|
-
throw new (0,
|
|
7871
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: note.publish must be an integer picklist value 1/2/4 (got ${String(note.publish)} \u2014 NOT a boolean)`, { operation: OP_OPEN });
|
|
7872
7872
|
}
|
|
7873
7873
|
}
|
|
7874
|
-
const assignee = assign === void 0 ? void 0 :
|
|
7874
|
+
const assignee = assign === void 0 ? void 0 : _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, assign.resourceID, "assign.resourceID");
|
|
7875
7875
|
if (assign !== void 0 && assignee !== void 0 && (typeof assignee === "number" ? assignee < 1 : false)) {
|
|
7876
|
-
throw new (0,
|
|
7876
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`openWithNoteAndAssign: assign.resourceID must be a positive integer (got ${String(assignee)})`, { operation: OP_OPEN });
|
|
7877
7877
|
}
|
|
7878
7878
|
const roleID = _optionalChain([assign, 'optionalAccess', _164 => _164.roleID]);
|
|
7879
7879
|
if (assign !== void 0 && !isPositiveInt(roleID)) {
|
|
7880
|
-
throw new (0,
|
|
7880
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("openWithNoteAndAssign: assign.roleID is required (a positive integer) \u2014 the ww29 vendor requires BOTH assignedResourceID and assignedResourceRoleID when assigning a resource (S12-A live-verified: Data violation: When assigning a Resource, you must assign both a assignedResourceID and assignedResourceRoleID)", { operation: OP_OPEN });
|
|
7881
7881
|
}
|
|
7882
7882
|
return { companyID, title, priority, status, assignee, roleID };
|
|
7883
7883
|
}
|
|
@@ -7906,7 +7906,7 @@ function openDryRun(http, v, params, assign, body, noteBody) {
|
|
|
7906
7906
|
if (assign !== void 0) {
|
|
7907
7907
|
warnings.push(`the assignment is the v0.6.0 MERGE update (unredacted GET + collection PUT, 2 wire) setting assignedResourceID ${String(assignee)} + assignedResourceRoleID ${String(roleID)} (the vendor requires both \u2014 S12-A live-verified); a failure lands in steps[] as ASSIGN_FAILED (the applied ticketId is still returned).`);
|
|
7908
7908
|
}
|
|
7909
|
-
return
|
|
7909
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0,
|
|
7910
7910
|
{
|
|
7911
7911
|
operation: OP_OPEN,
|
|
7912
7912
|
method: "POST",
|
|
@@ -7946,8 +7946,8 @@ async function createTicketWithDiscovery(resource, params, companyID, body, step
|
|
|
7946
7946
|
`openWithNoteAndAssign: the vendor rejected the ticket create naming 'queueID' (the ww29 live-required set is { title, status, priority, companyID, queueID }) and the node never guesses a queue${detail ? ` \u2014 ${detail}` : ""}`,
|
|
7947
7947
|
{
|
|
7948
7948
|
operation: OP_OPEN,
|
|
7949
|
-
httpStatus:
|
|
7950
|
-
vendorError:
|
|
7949
|
+
httpStatus: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
|
|
7950
|
+
vendorError: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0
|
|
7951
7951
|
}
|
|
7952
7952
|
);
|
|
7953
7953
|
}
|
|
@@ -7962,8 +7962,8 @@ async function createTicketWithDiscovery(resource, params, companyID, body, step
|
|
|
7962
7962
|
named,
|
|
7963
7963
|
{
|
|
7964
7964
|
operation: OP_OPEN,
|
|
7965
|
-
httpStatus:
|
|
7966
|
-
vendorError:
|
|
7965
|
+
httpStatus: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
|
|
7966
|
+
vendorError: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
|
|
7967
7967
|
resourceIds: [companyID],
|
|
7968
7968
|
details: { idRefs: [{ entity: "company", id: companyID }] }
|
|
7969
7969
|
}
|
|
@@ -7988,10 +7988,10 @@ async function assignStep(http, ticketId, assignee, roleID, opts, steps) {
|
|
|
7988
7988
|
try {
|
|
7989
7989
|
const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_OPEN, { maxRetries: opts.maxRetries });
|
|
7990
7990
|
if (current === null) {
|
|
7991
|
-
throw new (0,
|
|
7991
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`openWithNoteAndAssign: ticket ${ticketId} vanished between the create and the assign merge read`, { operation: OP_OPEN, resourceIds: [ticketId], details: { idRefs: [{ entity: "ticket", id: ticketId }] } });
|
|
7992
7992
|
}
|
|
7993
7993
|
ticketNumber = typeof current.ticketNumber === "string" ? current.ticketNumber : null;
|
|
7994
|
-
const merged =
|
|
7994
|
+
const merged = _chunkBPRDYT5Lcjs.mergePartialBody.call(void 0, current, { id: ticketId, assignedResourceID: assignee, assignedResourceRoleID: roleID });
|
|
7995
7995
|
merged.id = ticketId;
|
|
7996
7996
|
await http.request({ method: "PUT", path: "/V1.0/Tickets", body: merged, operation: OP_OPEN, maxRetries: opts.maxRetries });
|
|
7997
7997
|
assigned = true;
|
|
@@ -8055,7 +8055,7 @@ async function guardTargetStatus(resource, http, targetStatus) {
|
|
|
8055
8055
|
const ids = await readLiveStatusSet(resource);
|
|
8056
8056
|
if (ids.size > 0) liveStatus = ids;
|
|
8057
8057
|
} catch (err) {
|
|
8058
|
-
if (!
|
|
8058
|
+
if (!_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
|
|
8059
8059
|
}
|
|
8060
8060
|
if (liveStatus !== null && !liveStatus.has(targetStatus)) {
|
|
8061
8061
|
_optionalChain([http, 'access', _165 => _165.fieldCache, 'optionalAccess', _166 => _166.invalidate, 'call', _167 => _167("tickets")]);
|
|
@@ -8065,7 +8065,7 @@ async function guardTargetStatus(resource, http, targetStatus) {
|
|
|
8065
8065
|
const freshIds = await readLiveStatusSet(resource);
|
|
8066
8066
|
if (freshIds.size > 0) freshStatus = freshIds;
|
|
8067
8067
|
} catch (err) {
|
|
8068
|
-
if (!
|
|
8068
|
+
if (!_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) || err.code === "ABORTED") throw err;
|
|
8069
8069
|
freshStatus = null;
|
|
8070
8070
|
reReadFailed = true;
|
|
8071
8071
|
}
|
|
@@ -8083,7 +8083,7 @@ async function guardTargetStatus(resource, http, targetStatus) {
|
|
|
8083
8083
|
return { guardDegraded: liveStatus === null };
|
|
8084
8084
|
}
|
|
8085
8085
|
function noChangeDryRun(http, ticketId, targetStatus, guardDegraded) {
|
|
8086
|
-
return
|
|
8086
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0,
|
|
8087
8087
|
{
|
|
8088
8088
|
operation: OP_STATUS,
|
|
8089
8089
|
method: "PUT",
|
|
@@ -8137,7 +8137,7 @@ function mergeDryRun(http, ticketId, targetStatus, guardDegraded, filled, mapEnt
|
|
|
8137
8137
|
if (mapEntry === void 0) {
|
|
8138
8138
|
warnings.push(`status ${targetStatus} has no entry in the live-discovered required-field map yet \u2014 if the vendor 500 names a required field without a safe default, the apply throws the typed STATUS_FIELDS_REQUIRED (the caller supplies the value; never a blind retry).`);
|
|
8139
8139
|
}
|
|
8140
|
-
return
|
|
8140
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0,
|
|
8141
8141
|
{
|
|
8142
8142
|
operation: OP_STATUS,
|
|
8143
8143
|
method: "PUT",
|
|
@@ -8157,7 +8157,7 @@ function mergeDryRun(http, ticketId, targetStatus, guardDegraded, filled, mapEnt
|
|
|
8157
8157
|
}
|
|
8158
8158
|
async function putStatusWithDiscovery(http, ticketId, targetStatus, previousStatus, current, mergeData, mapEntry, filled, opts) {
|
|
8159
8159
|
const safeDefaults = _nullishCoalesce(_optionalChain([mapEntry, 'optionalAccess', _170 => _170.safeDefaults]), () => ( {}));
|
|
8160
|
-
const body =
|
|
8160
|
+
const body = _chunkBPRDYT5Lcjs.mergePartialBody.call(void 0, current, mergeData);
|
|
8161
8161
|
body.id = ticketId;
|
|
8162
8162
|
let merges = 0;
|
|
8163
8163
|
for (; ; ) {
|
|
@@ -8181,8 +8181,8 @@ async function putStatusWithDiscovery(http, ticketId, targetStatus, previousStat
|
|
|
8181
8181
|
{ vendorFields: named, currentStatus: previousStatus, targetStatus, currentValues },
|
|
8182
8182
|
{
|
|
8183
8183
|
operation: OP_STATUS,
|
|
8184
|
-
httpStatus:
|
|
8185
|
-
vendorError:
|
|
8184
|
+
httpStatus: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.httpStatus : void 0,
|
|
8185
|
+
vendorError: _chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, err) ? err.vendorError : void 0,
|
|
8186
8186
|
resourceIds: [ticketId],
|
|
8187
8187
|
details: { idRefs: [{ entity: "ticket", id: ticketId }] }
|
|
8188
8188
|
}
|
|
@@ -8195,7 +8195,7 @@ async function putStatusWithDiscovery(http, ticketId, targetStatus, previousStat
|
|
|
8195
8195
|
async function verifyStatusApplied(http, ticketId, targetStatus, opts) {
|
|
8196
8196
|
const verify = await fetchItem(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS, { maxRetries: opts.maxRetries });
|
|
8197
8197
|
if (verify === null) {
|
|
8198
|
-
throw new (0,
|
|
8198
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskError)(`changeStatus: the post-PUT read-back found no ticket ${ticketId} (the PUT 200ed but the record is gone)`, {
|
|
8199
8199
|
code: "INVALID_RESPONSE",
|
|
8200
8200
|
category: "server",
|
|
8201
8201
|
operation: OP_STATUS,
|
|
@@ -8205,7 +8205,7 @@ async function verifyStatusApplied(http, ticketId, targetStatus, opts) {
|
|
|
8205
8205
|
}
|
|
8206
8206
|
const finalStatus = typeof verify.status === "number" ? verify.status : null;
|
|
8207
8207
|
if (finalStatus !== targetStatus) {
|
|
8208
|
-
throw new (0,
|
|
8208
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskError)(
|
|
8209
8209
|
`changeStatus: the post-PUT read-back shows status ${_nullishCoalesce(finalStatus, () => ( "unknown"))} (the vendor 200ed the PUT but did not apply ${targetStatus} \u2014 the F-A1 lesson: the 200 proves nothing)`,
|
|
8210
8210
|
{
|
|
8211
8211
|
code: "INVALID_RESPONSE",
|
|
@@ -8220,17 +8220,17 @@ async function verifyStatusApplied(http, ticketId, targetStatus, opts) {
|
|
|
8220
8220
|
}
|
|
8221
8221
|
}
|
|
8222
8222
|
async function changeStatus(resource, id, targetStatus, fields, opts, http) {
|
|
8223
|
-
const ticketId =
|
|
8223
|
+
const ticketId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
8224
8224
|
if (!isPositiveInt(targetStatus)) {
|
|
8225
|
-
throw new (0,
|
|
8225
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`changeStatus: targetStatus must be a positive integer (got ${String(targetStatus)})`, { operation: OP_STATUS });
|
|
8226
8226
|
}
|
|
8227
8227
|
const { guardDegraded } = await guardTargetStatus(resource, http, targetStatus);
|
|
8228
8228
|
if (fields !== void 0 && (typeof fields !== "object" || fields === null || Array.isArray(fields))) {
|
|
8229
|
-
throw new (0,
|
|
8229
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("changeStatus: fields must be a plain object of ticket fields (or omitted)", { operation: OP_STATUS });
|
|
8230
8230
|
}
|
|
8231
8231
|
const current = await fetchItemUnredacted(http, `/V1.0/Tickets/${ticketId}`, OP_STATUS, { maxRetries: opts.maxRetries });
|
|
8232
8232
|
if (current === null) {
|
|
8233
|
-
throw new (0,
|
|
8233
|
+
throw new (0, _chunkBPRDYT5Lcjs.NotFoundError)(`changeStatus: ticket ${ticketId} was not found (tickets.get returned item: null)`, { operation: OP_STATUS, resourceIds: [ticketId], details: { idRefs: [{ entity: "ticket", id: ticketId }] } });
|
|
8234
8234
|
}
|
|
8235
8235
|
const previousStatus = typeof current.status === "number" ? current.status : null;
|
|
8236
8236
|
if (previousStatus === targetStatus) {
|
|
@@ -8250,7 +8250,7 @@ var DEFAULT_PART_LIMIT = 50;
|
|
|
8250
8250
|
function partLimit(value, name) {
|
|
8251
8251
|
const n = value === void 0 ? DEFAULT_PART_LIMIT : Math.trunc(value);
|
|
8252
8252
|
if (!Number.isInteger(n) || n < 1) {
|
|
8253
|
-
throw new (0,
|
|
8253
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`fullContext: ${name} must be an integer >= 1 (got ${String(value)})`);
|
|
8254
8254
|
}
|
|
8255
8255
|
return n;
|
|
8256
8256
|
}
|
|
@@ -8263,13 +8263,13 @@ function servedTextRecord(row, textField, limit) {
|
|
|
8263
8263
|
return out;
|
|
8264
8264
|
}
|
|
8265
8265
|
async function addCompositeNames(http, ctx, entriesPart, result, opts) {
|
|
8266
|
-
const builder =
|
|
8266
|
+
const builder = _chunkBPRDYT5Lcjs.createNamePlan.call(void 0, _chunkBPRDYT5Lcjs.TICKET_LABEL_FIELDS);
|
|
8267
8267
|
const t = ctx.ticket;
|
|
8268
8268
|
builder.addResource(t["creatorResourceID"]);
|
|
8269
8269
|
builder.addFk("contract", t["contractID"]);
|
|
8270
8270
|
builder.addFk("billingCode", t["billingCodeID"]);
|
|
8271
8271
|
builder.addFk("role", t["assignedResourceRoleID"]);
|
|
8272
|
-
const ticketLobPointer =
|
|
8272
|
+
const ticketLobPointer = _chunkBPRDYT5Lcjs.vendorId.call(void 0, t["organizationalLevelAssociationID"]);
|
|
8273
8273
|
if (ticketLobPointer !== void 0) {
|
|
8274
8274
|
builder.addLineOfBusiness(ticketLobPointer, { source: "ticket" });
|
|
8275
8275
|
} else {
|
|
@@ -8281,20 +8281,20 @@ async function addCompositeNames(http, ctx, entriesPart, result, opts) {
|
|
|
8281
8281
|
builder.addFk("billingCode", e["billingCodeID"]);
|
|
8282
8282
|
builder.addFk("contract", e["contractID"]);
|
|
8283
8283
|
}
|
|
8284
|
-
const names = await
|
|
8284
|
+
const names = await _chunkBPRDYT5Lcjs.resolveCompositeNames.call(void 0, http, builder.plan(), { maxNameReads: opts.maxNameReads });
|
|
8285
8285
|
const ticketRow = { ...ctx.ticket };
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
for (const f of
|
|
8286
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, ticketRow, "creatorResourceID", (v) => names.resourceName(v));
|
|
8287
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, ticketRow, "contractID", (v) => names.recordName("contract", v));
|
|
8288
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, ticketRow, "billingCodeID", (v) => names.recordName("billingCode", v));
|
|
8289
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, ticketRow, "assignedResourceRoleID", (v) => names.recordName("role", v));
|
|
8290
|
+
for (const f of _chunkBPRDYT5Lcjs.TICKET_LABEL_FIELDS) _chunkBPRDYT5Lcjs.addLabelSibling.call(void 0, ticketRow, f, names);
|
|
8291
8291
|
result.ticket = ticketRow;
|
|
8292
8292
|
result.timeEntries.items = entriesPart.items.map((e) => {
|
|
8293
8293
|
const row = { ...e };
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8294
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "resourceID", (v) => names.resourceName(v));
|
|
8295
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "roleID", (v) => names.recordName("role", v));
|
|
8296
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "billingCodeID", (v) => names.recordName("billingCode", v));
|
|
8297
|
+
_chunkBPRDYT5Lcjs.addNameSibling.call(void 0, row, "contractID", (v) => names.recordName("contract", v));
|
|
8298
8298
|
return row;
|
|
8299
8299
|
});
|
|
8300
8300
|
result.names = names.section;
|
|
@@ -8310,7 +8310,7 @@ async function fullContext(resource, id, opts = {}, http) {
|
|
|
8310
8310
|
const noteLimit = partLimit(opts.noteLimit, "noteLimit");
|
|
8311
8311
|
const timeEntryLimit = partLimit(opts.timeEntryLimit, "timeEntryLimit");
|
|
8312
8312
|
const textLimit = partLimit(opts.textLimit, "textLimit");
|
|
8313
|
-
const ticketId =
|
|
8313
|
+
const ticketId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
8314
8314
|
const ctx = await resource.getContext(ticketId);
|
|
8315
8315
|
const op = "tickets.fullContext";
|
|
8316
8316
|
const ticketFilter = [{ field: "ticketID", op: "eq", value: ticketId }];
|
|
@@ -8378,7 +8378,7 @@ var TICKET_FIELDS = ["id", "ticketNumber", "title", "status", "assignedResourceI
|
|
|
8378
8378
|
function positiveId(value, name) {
|
|
8379
8379
|
const n = typeof value === "string" && /^\d+$/.test(value.trim()) ? Number(value) : value;
|
|
8380
8380
|
if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 1) {
|
|
8381
|
-
throw new (0,
|
|
8381
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: ${name} must be a positive integer id (got ${String(value)})`, { operation: OP2 });
|
|
8382
8382
|
}
|
|
8383
8383
|
return n;
|
|
8384
8384
|
}
|
|
@@ -8390,7 +8390,7 @@ async function ticketPage(http, filter, maxRecords, fields) {
|
|
|
8390
8390
|
body: { MaxRecords: maxRecords, filter, IncludeFields: fields },
|
|
8391
8391
|
operation: OP2
|
|
8392
8392
|
});
|
|
8393
|
-
const page =
|
|
8393
|
+
const page = _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res, OP2);
|
|
8394
8394
|
return { rows: page.items, more: page.pageDetails.nextPageUrl !== null };
|
|
8395
8395
|
}
|
|
8396
8396
|
async function readLinkIds(http, resourceID, maxPages = 1) {
|
|
@@ -8400,11 +8400,11 @@ async function readLinkIds(http, resourceID, maxPages = 1) {
|
|
|
8400
8400
|
const res = await http.request({
|
|
8401
8401
|
method: "POST",
|
|
8402
8402
|
idempotent: true,
|
|
8403
|
-
path: cursor === null ? "/V1.0/TicketSecondaryResources/query" :
|
|
8403
|
+
path: cursor === null ? "/V1.0/TicketSecondaryResources/query" : _chunkBPRDYT5Lcjs.cursorToPath.call(void 0, http.baseUrl, cursor),
|
|
8404
8404
|
body: { MaxRecords: LINK_READ_CAP, filter: [{ field: "resourceID", op: "eq", value: resourceID }], IncludeFields: ["ticketID"] },
|
|
8405
8405
|
operation: OP2
|
|
8406
8406
|
});
|
|
8407
|
-
const page =
|
|
8407
|
+
const page = _chunkBPRDYT5Lcjs.unwrapItems.call(void 0, res, OP2);
|
|
8408
8408
|
for (const row of page.items) if (typeof row.ticketID === "number") ids.add(row.ticketID);
|
|
8409
8409
|
cursor = page.pageDetails.nextPageUrl;
|
|
8410
8410
|
if (cursor === null || page.items.length === 0) return { ids: [...ids], capped: false };
|
|
@@ -8412,35 +8412,35 @@ async function readLinkIds(http, resourceID, maxPages = 1) {
|
|
|
8412
8412
|
return { ids: [...ids], capped: true };
|
|
8413
8413
|
}
|
|
8414
8414
|
async function forResource(_resource, resourceIDIn, http, opts = {}) {
|
|
8415
|
-
if (opts === null || typeof opts !== "object") throw new (0,
|
|
8415
|
+
if (opts === null || typeof opts !== "object") throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: opts must be an object`, { operation: OP2 });
|
|
8416
8416
|
const resourceID = positiveId(resourceIDIn, "resourceID");
|
|
8417
8417
|
const scope = _nullishCoalesce(opts.scope, () => ( "both"));
|
|
8418
8418
|
if (scope !== "primary" && scope !== "secondary" && scope !== "both") {
|
|
8419
|
-
throw new (0,
|
|
8419
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: scope must be 'primary', 'secondary' or 'both' (got ${JSON.stringify(opts.scope)})`, { operation: OP2 });
|
|
8420
8420
|
}
|
|
8421
8421
|
if (opts.openOnly !== void 0 && typeof opts.openOnly !== "boolean") {
|
|
8422
|
-
throw new (0,
|
|
8422
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: openOnly must be a boolean`, { operation: OP2 });
|
|
8423
8423
|
}
|
|
8424
8424
|
const limit = opts.limit === void 0 ? LIMIT_DEFAULT : opts.limit;
|
|
8425
8425
|
if (opts.countOnly !== true && (!Number.isInteger(limit) || limit < 1 || limit > LIMIT_MAX)) {
|
|
8426
|
-
throw new (0,
|
|
8426
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: limit must be an integer 1-${LIMIT_MAX} (got ${String(opts.limit)})`, { operation: OP2 });
|
|
8427
8427
|
}
|
|
8428
8428
|
const includeFields = _nullishCoalesce(opts.includeFields, () => ( []));
|
|
8429
8429
|
if (!Array.isArray(includeFields) || includeFields.some((f) => typeof f !== "string" || f.length === 0)) {
|
|
8430
|
-
throw new (0,
|
|
8430
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: includeFields must be a list of field names`, { operation: OP2 });
|
|
8431
8431
|
}
|
|
8432
8432
|
const openOnly = opts.openOnly === true;
|
|
8433
8433
|
const fields = [.../* @__PURE__ */ new Set([...TICKET_FIELDS, ...includeFields])];
|
|
8434
8434
|
if (opts.countOnly !== void 0 && typeof opts.countOnly !== "boolean") {
|
|
8435
|
-
throw new (0,
|
|
8435
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(`${OP2}: countOnly must be a boolean`, { operation: OP2 });
|
|
8436
8436
|
}
|
|
8437
|
-
const closed = await
|
|
8437
|
+
const closed = await _chunkBPRDYT5Lcjs.resolveTicketStatusSemantics.call(void 0,
|
|
8438
8438
|
http,
|
|
8439
8439
|
{ ...opts.excludeStatusIds === void 0 ? {} : { excludeStatusIds: opts.excludeStatusIds }, ...opts.allowAssumed === void 0 ? {} : { allowAssumed: opts.allowAssumed } },
|
|
8440
8440
|
OP2
|
|
8441
8441
|
);
|
|
8442
8442
|
const closedStatus = { closedIds: closed.closedIds, source: closed.source, note: closed.note };
|
|
8443
|
-
const openLeaf = openOnly || opts.countOnly === true ? [
|
|
8443
|
+
const openLeaf = openOnly || opts.countOnly === true ? [_chunkBPRDYT5Lcjs.openStatusFilter.call(void 0, closed.closedIds)] : [];
|
|
8444
8444
|
if (opts.countOnly === true) {
|
|
8445
8445
|
const primaryCount = scope === "secondary" ? 0 : await _resource.count({ filter: [{ field: "assignedResourceID", op: "eq", value: resourceID }, ...openLeaf] });
|
|
8446
8446
|
let secondaryCount = 0;
|
|
@@ -8454,7 +8454,7 @@ async function forResource(_resource, resourceIDIn, http, opts = {}) {
|
|
|
8454
8454
|
const page = await ticketPage(http, [{ field: "id", op: "in", value: chunk }, ...openLeaf], chunk.length, ["id", "status", "assignedResourceID"]);
|
|
8455
8455
|
const seen = /* @__PURE__ */ new Set();
|
|
8456
8456
|
for (const t of page.rows) {
|
|
8457
|
-
if (typeof t.id !== "number" || seen.has(t.id) ||
|
|
8457
|
+
if (typeof t.id !== "number" || seen.has(t.id) || _chunkBPRDYT5Lcjs.isClosedStatus.call(void 0, t.status, closed.closedIds)) continue;
|
|
8458
8458
|
seen.add(t.id);
|
|
8459
8459
|
if (scope === "both" && t.assignedResourceID === resourceID) bothCount++;
|
|
8460
8460
|
}
|
|
@@ -8500,13 +8500,13 @@ async function forResource(_resource, resourceIDIn, http, opts = {}) {
|
|
|
8500
8500
|
for (const [id, t] of primary) merged.set(id, t);
|
|
8501
8501
|
for (const [id, t] of secondary) if (!merged.has(id)) merged.set(id, t);
|
|
8502
8502
|
let tickets = [...merged.values()];
|
|
8503
|
-
if (openOnly) tickets = tickets.filter((t) => !
|
|
8503
|
+
if (openOnly) tickets = tickets.filter((t) => !_chunkBPRDYT5Lcjs.isClosedStatus.call(void 0, t.status, closed.closedIds));
|
|
8504
8504
|
tickets.sort((a, b) => Number(a.id) - Number(b.id));
|
|
8505
8505
|
if (tickets.length > limit) {
|
|
8506
8506
|
tickets = tickets.slice(0, limit);
|
|
8507
8507
|
capped = true;
|
|
8508
8508
|
}
|
|
8509
|
-
const openCount = tickets.filter((t) => !
|
|
8509
|
+
const openCount = tickets.filter((t) => !_chunkBPRDYT5Lcjs.isClosedStatus.call(void 0, t.status, closed.closedIds)).length;
|
|
8510
8510
|
const primaryIds = [...primary.keys()].sort((a, b) => a - b);
|
|
8511
8511
|
const secondaryIds = [...secondary.keys()].sort((a, b) => a - b);
|
|
8512
8512
|
const both = primaryIds.filter((id) => secondary.has(id));
|
|
@@ -8530,7 +8530,7 @@ var OP3 = "tickets.lineOfBusiness";
|
|
|
8530
8530
|
function positiveId2(value, name) {
|
|
8531
8531
|
const n = typeof value === "string" && /^[0-9]+$/.test(value.trim()) ? Number(value) : value;
|
|
8532
8532
|
if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 1) {
|
|
8533
|
-
throw new (0,
|
|
8533
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(OP3 + ": " + name + " must be a positive integer id (got " + String(value) + ")", { operation: OP3 });
|
|
8534
8534
|
}
|
|
8535
8535
|
return n;
|
|
8536
8536
|
}
|
|
@@ -8545,25 +8545,25 @@ async function lineOfBusiness(resource, ticketIdIn, http, associationIdIn) {
|
|
|
8545
8545
|
associationSource = "argument";
|
|
8546
8546
|
} else {
|
|
8547
8547
|
const ticket = await resource.get(ticketId);
|
|
8548
|
-
associationId =
|
|
8548
|
+
associationId = _chunkBPRDYT5Lcjs.vendorId.call(void 0, ticket.organizationalLevelAssociationID);
|
|
8549
8549
|
if (associationId !== void 0) {
|
|
8550
8550
|
associationSource = "ticket";
|
|
8551
8551
|
} else {
|
|
8552
|
-
const contractRef =
|
|
8552
|
+
const contractRef = _chunkBPRDYT5Lcjs.vendorId.call(void 0, ticket.contractID);
|
|
8553
8553
|
if (contractRef !== void 0) {
|
|
8554
8554
|
const client = http.client;
|
|
8555
8555
|
if (client === void 0) {
|
|
8556
|
-
throw new (0,
|
|
8556
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)(OP3 + ": the transport is not wired to an AutotaskClient (the composite must run through the client)", { operation: OP3 });
|
|
8557
8557
|
}
|
|
8558
8558
|
try {
|
|
8559
8559
|
const contract = await client.contracts.get(contractRef);
|
|
8560
8560
|
contractId = contractRef;
|
|
8561
|
-
associationId =
|
|
8561
|
+
associationId = _chunkBPRDYT5Lcjs.vendorId.call(void 0, contract.organizationalLevelAssociationID);
|
|
8562
8562
|
if (associationId !== void 0) associationSource = "contract";
|
|
8563
8563
|
} catch (e) {
|
|
8564
|
-
if (e instanceof
|
|
8564
|
+
if (e instanceof _chunkBPRDYT5Lcjs.NotFoundError) {
|
|
8565
8565
|
contractId = contractRef;
|
|
8566
|
-
} else if (
|
|
8566
|
+
} else if (_chunkBPRDYT5Lcjs.isAutotaskError.call(void 0, e) && e.code !== "ABORTED") {
|
|
8567
8567
|
contractId = contractRef;
|
|
8568
8568
|
contractUnread = true;
|
|
8569
8569
|
} else {
|
|
@@ -8584,18 +8584,18 @@ async function lineOfBusiness(resource, ticketIdIn, http, associationIdIn) {
|
|
|
8584
8584
|
markers: { association: contractUnread ? "unresolved" : "missing", organizationalLevel2: "missing", organizationalLevel1: "missing" }
|
|
8585
8585
|
};
|
|
8586
8586
|
}
|
|
8587
|
-
const chain = await
|
|
8587
|
+
const chain = await _chunkBPRDYT5Lcjs.resolveLineOfBusinessChain.call(void 0, http, associationId, { budget: 3, operation: OP3, onError: "propagate" });
|
|
8588
8588
|
const { association, organizationalLevel2, organizationalLevel1, markers } = chain.lineOfBusiness;
|
|
8589
8589
|
return { ticketId, associationSource, contractId, association, organizationalLevel2, organizationalLevel1, markers };
|
|
8590
8590
|
}
|
|
8591
8591
|
|
|
8592
8592
|
// src/resources/special/tickets/statusSemantics.ts
|
|
8593
8593
|
async function statusSemantics(_resource, opts = {}, http) {
|
|
8594
|
-
return
|
|
8594
|
+
return _chunkBPRDYT5Lcjs.resolveTicketStatusSemantics.call(void 0, http, opts);
|
|
8595
8595
|
}
|
|
8596
8596
|
|
|
8597
8597
|
// src/resources/tickets.ts
|
|
8598
|
-
var TicketsResource = class extends
|
|
8598
|
+
var TicketsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
8599
8599
|
constructor(http, pageSize) {
|
|
8600
8600
|
super(http, {
|
|
8601
8601
|
key: "tickets",
|
|
@@ -8713,7 +8713,7 @@ var TicketsResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
8713
8713
|
};
|
|
8714
8714
|
|
|
8715
8715
|
// src/resources/ticket_webhooks.ts
|
|
8716
|
-
var TicketWebhooksResource = class extends
|
|
8716
|
+
var TicketWebhooksResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
8717
8717
|
constructor(http, pageSize) {
|
|
8718
8718
|
super(http, {
|
|
8719
8719
|
key: "ticket_webhooks",
|
|
@@ -8789,7 +8789,7 @@ var TicketWebhooksResource = class extends _chunkLB34VFQYcjs.BaseResource {
|
|
|
8789
8789
|
};
|
|
8790
8790
|
|
|
8791
8791
|
// src/resources/time_entry_attachments.ts
|
|
8792
|
-
var TimeEntryAttachmentsResource = class extends
|
|
8792
|
+
var TimeEntryAttachmentsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
8793
8793
|
constructor(http, pageSize) {
|
|
8794
8794
|
super(http, {
|
|
8795
8795
|
key: "time_entry_attachments",
|
|
@@ -8852,9 +8852,9 @@ var TimeEntryAttachmentsResource = class extends _chunkLB34VFQYcjs.BaseResource
|
|
|
8852
8852
|
|
|
8853
8853
|
// src/resources/special/time_off_requests.ts
|
|
8854
8854
|
async function approve(_resource, id, opts = {}, http) {
|
|
8855
|
-
const numericId =
|
|
8855
|
+
const numericId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
8856
8856
|
if (opts.dryRun === true) {
|
|
8857
|
-
return
|
|
8857
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
8858
8858
|
operation: "time_off_requests.approve",
|
|
8859
8859
|
method: "GET",
|
|
8860
8860
|
path: `/V1.0/TimeOffRequests/${numericId}/Approve`,
|
|
@@ -8870,16 +8870,16 @@ async function approve(_resource, id, opts = {}, http) {
|
|
|
8870
8870
|
operation: "time_off_requests.approve",
|
|
8871
8871
|
maxRetries: opts.maxRetries
|
|
8872
8872
|
});
|
|
8873
|
-
return
|
|
8873
|
+
return _chunkBPRDYT5Lcjs.unwrapOperation.call(void 0, res);
|
|
8874
8874
|
}
|
|
8875
8875
|
async function reject(_resource, id, reason, opts = {}, http) {
|
|
8876
|
-
const numericId =
|
|
8876
|
+
const numericId = _chunkBPRDYT5Lcjs.parseIdentifier.call(void 0, id, "id");
|
|
8877
8877
|
const text = reason.trim();
|
|
8878
8878
|
if (text === "") {
|
|
8879
|
-
throw new (0,
|
|
8879
|
+
throw new (0, _chunkBPRDYT5Lcjs.AutotaskConfigError)("reject: a non-empty reason is required (vendor TimeOffRequestRejectModel)");
|
|
8880
8880
|
}
|
|
8881
8881
|
if (opts.dryRun === true) {
|
|
8882
|
-
return
|
|
8882
|
+
return _chunkBPRDYT5Lcjs.buildDryRunResult.call(void 0, {
|
|
8883
8883
|
operation: "time_off_requests.reject",
|
|
8884
8884
|
method: "POST",
|
|
8885
8885
|
path: `/V1.0/TimeOffRequests/${numericId}/Reject`,
|
|
@@ -8897,11 +8897,11 @@ async function reject(_resource, id, reason, opts = {}, http) {
|
|
|
8897
8897
|
operation: "time_off_requests.reject",
|
|
8898
8898
|
maxRetries: opts.maxRetries
|
|
8899
8899
|
});
|
|
8900
|
-
return
|
|
8900
|
+
return _chunkBPRDYT5Lcjs.unwrapOperation.call(void 0, res);
|
|
8901
8901
|
}
|
|
8902
8902
|
|
|
8903
8903
|
// src/resources/time_off_requests.ts
|
|
8904
|
-
var TimeOffRequestsResource = class extends
|
|
8904
|
+
var TimeOffRequestsResource = class extends _chunkBPRDYT5Lcjs.BaseResource {
|
|
8905
8905
|
constructor(http, pageSize) {
|
|
8906
8906
|
super(http, {
|
|
8907
8907
|
key: "time_off_requests",
|