@masonlandcattle/servicetitan-sdk 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -235,11 +235,6 @@ __export(accounting_exports, {
235
235
  createGlAccount: () => createGlAccount,
236
236
  deleteInvoiceItem: () => deleteInvoiceItem,
237
237
  exportInventoryBills: () => exportInventoryBills,
238
- getAllInventoryBills: () => getAllInventoryBills,
239
- getAllInvoices: () => getAllInvoices,
240
- getAllJournalEntries: () => getAllJournalEntries,
241
- getAllPaymentTerms: () => getAllPaymentTerms,
242
- getAllPaymentTypes: () => getAllPaymentTypes,
243
238
  getAllPayments: () => getAllPayments,
244
239
  getAllTaxZones: () => getAllTaxZones,
245
240
  getGlAccount: () => getGlAccount,
@@ -278,14 +273,11 @@ __export(accounting_exports, {
278
273
  });
279
274
 
280
275
  // src/resources/accounting/invoices.ts
281
- async function listInvoices(client, params = {}) {
276
+ async function listInvoices(client, params = {}, options) {
282
277
  const path = client.buildPath({ category: "accounting", subject: "invoices" });
278
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
283
279
  return client.request("get", path, { params });
284
280
  }
285
- async function getAllInvoices(client, params = {}, pageSize = 200) {
286
- const path = client.buildPath({ category: "accounting", subject: "invoices" });
287
- return client.getAll(path, params, pageSize);
288
- }
289
281
  async function createAdjustmentInvoice(client, data) {
290
282
  const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: "adjustment" });
291
283
  return client.request("post", path, { data });
@@ -321,14 +313,11 @@ async function deleteInvoiceItem(client, invoiceId, itemId) {
321
313
  }
322
314
 
323
315
  // src/resources/accounting/inventory-bills.ts
324
- async function listInventoryBills(client, params = {}) {
316
+ async function listInventoryBills(client, params = {}, options) {
325
317
  const path = client.buildPath({ category: "accounting", subject: "inventory-bills" });
318
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
326
319
  return client.request("get", path, { params });
327
320
  }
328
- async function getAllInventoryBills(client, params = {}, pageSize = 200) {
329
- const path = client.buildPath({ category: "accounting", subject: "inventory-bills" });
330
- return client.getAll(path, params, pageSize);
331
- }
332
321
  async function exportInventoryBills(client, data) {
333
322
  const path = client.buildPath({ category: "accounting", subject: "inventory-bills", idOrSubpath: "export" });
334
323
  return client.request("post", path, { data });
@@ -349,14 +338,11 @@ async function markInventoryBillsAsExported(client, ids) {
349
338
  }
350
339
 
351
340
  // src/resources/accounting/journal-entries.ts
352
- async function listJournalEntries(client, params = {}) {
341
+ async function listJournalEntries(client, params = {}, options) {
353
342
  const path = client.buildPath({ category: "accounting", subject: "journal-entries" });
343
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
354
344
  return client.request("get", path, { params });
355
345
  }
356
- async function getAllJournalEntries(client, params = {}, pageSize = 200) {
357
- const path = client.buildPath({ category: "accounting", subject: "journal-entries" });
358
- return client.getAll(path, params, pageSize);
359
- }
360
346
  async function getJournalEntryDetails(client, id) {
361
347
  if (!id) throw new Error("id is required");
362
348
  const path = client.buildPath({ category: "accounting", subject: "journal-entries", idOrSubpath: String(id) });
@@ -377,28 +363,22 @@ async function syncUpdateJournalEntries(client, data) {
377
363
  }
378
364
 
379
365
  // src/resources/accounting/payment-terms.ts
380
- async function listPaymentTerms(client, params = {}) {
366
+ async function listPaymentTerms(client, params = {}, options) {
381
367
  const path = client.buildPath({ category: "accounting", subject: "payment-terms" });
368
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
382
369
  return client.request("get", path, { params });
383
370
  }
384
- async function getAllPaymentTerms(client, params = {}, pageSize = 200) {
385
- const path = client.buildPath({ category: "accounting", subject: "payment-terms" });
386
- return client.getAll(path, params, pageSize);
387
- }
388
371
  async function getPaymentTermModel(client) {
389
372
  const path = client.buildPath({ category: "accounting", subject: "payment-terms", idOrSubpath: "model" });
390
373
  return client.request("get", path);
391
374
  }
392
375
 
393
376
  // src/resources/accounting/payment-types.ts
394
- async function listPaymentTypes(client, params = {}) {
377
+ async function listPaymentTypes(client, params = {}, options) {
395
378
  const path = client.buildPath({ category: "accounting", subject: "payment-types" });
379
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
396
380
  return client.request("get", path, { params });
397
381
  }
398
- async function getAllPaymentTypes(client, params = {}, pageSize = 200) {
399
- const path = client.buildPath({ category: "accounting", subject: "payment-types" });
400
- return client.getAll(path, params, pageSize);
401
- }
402
382
  async function getPaymentType(client, id) {
403
383
  if (!id) throw new Error("id is required");
404
384
  const path = client.buildPath({ category: "accounting", subject: "payment-types", idOrSubpath: String(id) });
@@ -406,8 +386,9 @@ async function getPaymentType(client, id) {
406
386
  }
407
387
 
408
388
  // src/resources/accounting/payments.ts
409
- async function listPayments(client, params = {}) {
389
+ async function listPayments(client, params = {}, options) {
410
390
  const path = client.buildPath({ category: "accounting", subject: "payments" });
391
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
411
392
  return client.request("get", path, { params });
412
393
  }
413
394
  async function getAllPayments(client, params = {}, pageSize = 200) {
@@ -435,8 +416,9 @@ async function updatePayment(client, id, data) {
435
416
  }
436
417
 
437
418
  // src/resources/accounting/tax-zones.ts
438
- async function listTaxZones(client, params = {}) {
419
+ async function listTaxZones(client, params = {}, options) {
439
420
  const path = client.buildPath({ category: "accounting", subject: "tax-zones" });
421
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
440
422
  return client.request("get", path, { params });
441
423
  }
442
424
  async function getAllTaxZones(client, params = {}, pageSize = 200) {
@@ -445,8 +427,9 @@ async function getAllTaxZones(client, params = {}, pageSize = 200) {
445
427
  }
446
428
 
447
429
  // src/resources/accounting/ap-credits.ts
448
- async function listApCredits(client, params = {}) {
430
+ async function listApCredits(client, params = {}, options) {
449
431
  const path = client.buildPath({ category: "accounting", subject: "ap-credits" });
432
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
450
433
  return client.request("get", path, { params });
451
434
  }
452
435
  async function markApCreditsAsExported(client, ids) {
@@ -456,8 +439,9 @@ async function markApCreditsAsExported(client, ids) {
456
439
  }
457
440
 
458
441
  // src/resources/accounting/ap-payments.ts
459
- async function listApPayments(client, params = {}) {
442
+ async function listApPayments(client, params = {}, options) {
460
443
  const path = client.buildPath({ category: "accounting", subject: "ap-payments" });
444
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
461
445
  return client.request("get", path, { params });
462
446
  }
463
447
  async function markApPaymentsAsExported(client, ids) {
@@ -467,8 +451,9 @@ async function markApPaymentsAsExported(client, ids) {
467
451
  }
468
452
 
469
453
  // src/resources/accounting/gl-accounts.ts
470
- async function listGlAccounts(client, params = {}) {
454
+ async function listGlAccounts(client, params = {}, options) {
471
455
  const path = client.buildPath({ category: "accounting", subject: "gl-accounts" });
456
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
472
457
  return client.request("get", path, { params });
473
458
  }
474
459
  async function getGlAccount(client, id) {
@@ -593,8 +578,9 @@ async function removeTagsBulk(client, data) {
593
578
  }
594
579
 
595
580
  // src/resources/crm/contact-methods.ts
596
- async function listContactMethods(client, params = {}) {
581
+ async function listContactMethods(client, params = {}, options) {
597
582
  const path = client.buildPath({ category: "crm", subject: "contact-methods" });
583
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
598
584
  return client.request("get", path, { params });
599
585
  }
600
586
  async function createContactMethod(client, data) {
@@ -622,8 +608,9 @@ async function deleteContactMethod(client, id) {
622
608
  }
623
609
 
624
610
  // src/resources/crm/contact-preferences.ts
625
- async function listContactMethodPreferences(client, params = {}) {
611
+ async function listContactMethodPreferences(client, params = {}, options) {
626
612
  const path = client.buildPath({ category: "crm", subject: "contact-preferences" });
613
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
627
614
  return client.request("get", path, { params });
628
615
  }
629
616
  async function getContactMethodPreference(client, id) {
@@ -817,8 +804,9 @@ async function createLeadNote(client, id, data) {
817
804
  }
818
805
 
819
806
  // src/resources/crm/locations.ts
820
- async function listLocations(client, params = {}) {
807
+ async function listLocations(client, params = {}, options) {
821
808
  const path = client.buildPath({ category: "crm", subject: "locations" });
809
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
822
810
  return client.request("get", path, { params });
823
811
  }
824
812
  async function createLocation(client, data) {
@@ -912,8 +900,9 @@ async function exportLocationContacts(client, params = {}) {
912
900
  }
913
901
 
914
902
  // src/resources/crm/booking-provider-tags.ts
915
- async function listBookingProviderTags(client, params = {}) {
903
+ async function listBookingProviderTags(client, params = {}, options) {
916
904
  const path = client.buildPath({ category: "crm", subject: "booking-provider-tags" });
905
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
917
906
  return client.request("get", path, { params });
918
907
  }
919
908
  async function createBookingProviderTag(client, data) {
@@ -937,8 +926,9 @@ async function deleteBookingProviderTag(client, id) {
937
926
  }
938
927
 
939
928
  // src/resources/crm/bookings.ts
940
- async function listBookings(client, params = {}) {
929
+ async function listBookings(client, params = {}, options) {
941
930
  const path = client.buildPath({ category: "crm", subject: "bookings" });
931
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
942
932
  return client.request("get", path, { params });
943
933
  }
944
934
  async function createBooking(client, data) {
@@ -969,8 +959,9 @@ function buildProviderPath(client, provider, idOrSubpath) {
969
959
  const sub = idOrSubpath ? `/${String(idOrSubpath).replace(/^\/+/, "")}` : "";
970
960
  return client.buildPath({ category: "crm", subject: `${provider}/bookings${sub}`, tenantScoped: false });
971
961
  }
972
- async function listProviderBookings(client, provider, params = {}) {
962
+ async function listProviderBookings(client, provider, params = {}, options) {
973
963
  const path = buildProviderPath(client, provider);
964
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
974
965
  return client.request("get", path, { params });
975
966
  }
976
967
  async function createProviderBooking(client, provider, data) {
@@ -1032,7 +1023,6 @@ __export(dispatch_exports, {
1032
1023
  exportAppointmentAssignments: () => exportAppointmentAssignments,
1033
1024
  getArrivalWindow: () => getArrivalWindow,
1034
1025
  getArrivalWindowsConfiguration: () => getArrivalWindowsConfiguration,
1035
- getCapacity: () => getCapacity,
1036
1026
  getNonJobAppointment: () => getNonJobAppointment,
1037
1027
  getTeam: () => getTeam,
1038
1028
  getTechnicianShift: () => getTechnicianShift,
@@ -1041,11 +1031,11 @@ __export(dispatch_exports, {
1041
1031
  listAppointmentAssignments: () => listAppointmentAssignments,
1042
1032
  listArrivalWindows: () => listArrivalWindows,
1043
1033
  listBusinessHours: () => listBusinessHours,
1044
- listGpsPings: () => listGpsPings,
1045
1034
  listNonJobAppointments: () => listNonJobAppointments,
1046
1035
  listTeams: () => listTeams,
1047
1036
  listTechnicianShifts: () => listTechnicianShifts,
1048
1037
  listZones: () => listZones,
1038
+ queryCapacity: () => queryCapacity,
1049
1039
  unassignTechnicians: () => unassignTechnicians,
1050
1040
  updateArrivalWindow: () => updateArrivalWindow,
1051
1041
  updateArrivalWindowsConfiguration: () => updateArrivalWindowsConfiguration,
@@ -1062,8 +1052,9 @@ async function exportAppointmentAssignments(client, params = {}) {
1062
1052
  }
1063
1053
 
1064
1054
  // src/resources/dispatch/appointment-assignments.ts
1065
- async function listAppointmentAssignments(client, params = {}) {
1055
+ async function listAppointmentAssignments(client, params = {}, options) {
1066
1056
  const path = client.buildPath({ category: "dispatch", subject: "appointment-assignments" });
1057
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1067
1058
  return client.request("get", path, { params });
1068
1059
  }
1069
1060
  async function assignTechnicians(client, data) {
@@ -1076,8 +1067,9 @@ async function unassignTechnicians(client, data) {
1076
1067
  }
1077
1068
 
1078
1069
  // src/resources/dispatch/arrival-windows.ts
1079
- async function listArrivalWindows(client, params = {}) {
1070
+ async function listArrivalWindows(client, params = {}, options) {
1080
1071
  const path = client.buildPath({ category: "dispatch", subject: "arrival-windows" });
1072
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1081
1073
  return client.request("get", path, { params });
1082
1074
  }
1083
1075
  async function createArrivalWindow(client, data) {
@@ -1109,8 +1101,9 @@ async function activateArrivalWindow(client, id) {
1109
1101
  }
1110
1102
 
1111
1103
  // src/resources/dispatch/business-hours.ts
1112
- async function listBusinessHours(client, params = {}) {
1104
+ async function listBusinessHours(client, params = {}, options) {
1113
1105
  const path = client.buildPath({ category: "dispatch", subject: "business-hours" });
1106
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1114
1107
  return client.request("get", path, { params });
1115
1108
  }
1116
1109
  async function createBusinessHour(client, data) {
@@ -1119,27 +1112,24 @@ async function createBusinessHour(client, data) {
1119
1112
  }
1120
1113
 
1121
1114
  // src/resources/dispatch/capacity.ts
1122
- async function getCapacity(client, params = {}) {
1115
+ async function queryCapacity(client, data) {
1123
1116
  const path = client.buildPath({ category: "dispatch", subject: "capacity" });
1124
- return client.request("get", path, { params });
1117
+ return client.request("post", path, { data });
1125
1118
  }
1126
1119
 
1127
1120
  // src/resources/dispatch/gps.ts
1128
1121
  function buildGpsProviderPath(client, provider) {
1129
1122
  return client.buildPath({ category: "dispatch", subject: `${provider}/gps-pings`, tenantScoped: false });
1130
1123
  }
1131
- async function listGpsPings(client, provider, params = {}) {
1132
- const path = buildGpsProviderPath(client, provider);
1133
- return client.request("get", path, { params });
1134
- }
1135
1124
  async function createGpsPing(client, provider, data) {
1136
1125
  const path = buildGpsProviderPath(client, provider);
1137
1126
  return client.request("post", path, { data });
1138
1127
  }
1139
1128
 
1140
1129
  // src/resources/dispatch/non-job-appointments.ts
1141
- async function listNonJobAppointments(client, params = {}) {
1130
+ async function listNonJobAppointments(client, params = {}, options) {
1142
1131
  const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments" });
1132
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1143
1133
  return client.request("get", path, { params });
1144
1134
  }
1145
1135
  async function createNonJobAppointment(client, data) {
@@ -1163,8 +1153,9 @@ async function deleteNonJobAppointment(client, id) {
1163
1153
  }
1164
1154
 
1165
1155
  // src/resources/dispatch/teams.ts
1166
- async function listTeams(client, params = {}) {
1156
+ async function listTeams(client, params = {}, options) {
1167
1157
  const path = client.buildPath({ category: "dispatch", subject: "teams" });
1158
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1168
1159
  return client.request("get", path, { params });
1169
1160
  }
1170
1161
  async function createTeam(client, data) {
@@ -1183,8 +1174,9 @@ async function updateTeam(client, id, data) {
1183
1174
  }
1184
1175
 
1185
1176
  // src/resources/dispatch/technician-shifts.ts
1186
- async function listTechnicianShifts(client, params = {}) {
1177
+ async function listTechnicianShifts(client, params = {}, options) {
1187
1178
  const path = client.buildPath({ category: "dispatch", subject: "technician-shifts" });
1179
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1188
1180
  return client.request("get", path, { params });
1189
1181
  }
1190
1182
  async function createTechnicianShift(client, data) {
@@ -1218,8 +1210,9 @@ async function getTechnicianTracking(client, params) {
1218
1210
  }
1219
1211
 
1220
1212
  // src/resources/dispatch/zones.ts
1221
- async function listZones(client, params = {}) {
1213
+ async function listZones(client, params = {}, options) {
1222
1214
  const path = client.buildPath({ category: "dispatch", subject: "zones" });
1215
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1223
1216
  return client.request("get", path, { params });
1224
1217
  }
1225
1218
  async function createZone(client, data) {
@@ -1262,8 +1255,9 @@ async function exportInstalledEquipment(client, params = {}) {
1262
1255
  }
1263
1256
 
1264
1257
  // src/resources/equipment-systems/installed-equipment.ts
1265
- async function listInstalledEquipment(client, params = {}) {
1258
+ async function listInstalledEquipment(client, params = {}, options) {
1266
1259
  const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment" });
1260
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1267
1261
  return client.request("get", path, { params });
1268
1262
  }
1269
1263
  async function createInstalledEquipment(client, data) {
@@ -1278,8 +1272,9 @@ async function createInstalledEquipmentAttachment(client, data) {
1278
1272
  const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: "attachments" });
1279
1273
  return client.request("post", path, { data });
1280
1274
  }
1281
- async function listInstalledEquipmentCustomFieldTypes(client, params = {}) {
1275
+ async function listInstalledEquipmentCustomFieldTypes(client, params = {}, options) {
1282
1276
  const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: "custom-field-types" });
1277
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? (params.pageSize ?? 200));
1283
1278
  return client.request("get", path, { params });
1284
1279
  }
1285
1280
  async function getInstalledEquipment(client, id) {
@@ -1328,6 +1323,7 @@ __export(jpm_exports, {
1328
1323
  listAppointments: () => listAppointments,
1329
1324
  listBudgetCodes: () => listBudgetCodes,
1330
1325
  listJobCancelReasons: () => listJobCancelReasons,
1326
+ listJobCustomFieldTypes: () => listJobCustomFieldTypes,
1331
1327
  listJobHoldReasons: () => listJobHoldReasons,
1332
1328
  listJobNotes: () => listJobNotes,
1333
1329
  listJobTypes: () => listJobTypes,
@@ -1385,8 +1381,9 @@ async function exportProjects(client, params = {}) {
1385
1381
  }
1386
1382
 
1387
1383
  // src/resources/jpm/appointments.ts
1388
- async function listAppointments(client, params = {}) {
1384
+ async function listAppointments(client, params = {}, options) {
1389
1385
  const path = client.buildPath({ category: "jpm", subject: "appointments" });
1386
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1390
1387
  return client.request("get", path, { params });
1391
1388
  }
1392
1389
  async function getAppointment(client, id) {
@@ -1425,6 +1422,40 @@ async function updateSpecialInstructions(client, id, data) {
1425
1422
  return client.request("put", path, { data });
1426
1423
  }
1427
1424
 
1425
+ // src/utils/batch.ts
1426
+ function chunkArray(items, chunkSize) {
1427
+ if (chunkSize <= 0) throw new Error("chunkSize must be > 0");
1428
+ const chunks = [];
1429
+ for (let i = 0; i < items.length; i += chunkSize) {
1430
+ chunks.push(items.slice(i, i + chunkSize));
1431
+ }
1432
+ return chunks;
1433
+ }
1434
+ async function fetchInIdChunks(client, path, ids, options = {}) {
1435
+ const {
1436
+ idParamName = "ids",
1437
+ otherParams = {},
1438
+ chunkSize = 50,
1439
+ paginateEachChunk = false,
1440
+ pageSize = 200
1441
+ } = options;
1442
+ if (!ids?.length) return [];
1443
+ const aggregated = [];
1444
+ const idChunks = chunkArray(ids, chunkSize);
1445
+ for (const chunk of idChunks) {
1446
+ const params = { ...otherParams, [idParamName]: chunk.join(",") };
1447
+ if (paginateEachChunk) {
1448
+ const items = await client.getAll(path, params, pageSize);
1449
+ aggregated.push(...items);
1450
+ } else {
1451
+ const resp = await client.request("get", path, { params });
1452
+ const data = Array.isArray(resp) ? resp : resp?.data || [];
1453
+ aggregated.push(...data);
1454
+ }
1455
+ }
1456
+ return aggregated;
1457
+ }
1458
+
1428
1459
  // src/resources/jpm/jobs.ts
1429
1460
  async function listJobs(client, params = {}, options) {
1430
1461
  const path = client.buildPath({ category: "jpm", subject: "jobs" });
@@ -1446,7 +1477,7 @@ async function cancelJob(client, id, data = {}) {
1446
1477
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/cancel` });
1447
1478
  return client.request("post", path, { data });
1448
1479
  }
1449
- async function getJobCanceledLog(client, id) {
1480
+ async function getJobCanceledLog(client, id, options) {
1450
1481
  if (!id) throw new Error("id is required");
1451
1482
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/canceled-log` });
1452
1483
  return client.request("get", path);
@@ -1456,10 +1487,16 @@ async function getJobHistory(client, id) {
1456
1487
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/history` });
1457
1488
  return client.request("get", path);
1458
1489
  }
1459
- async function listJobNotes(client, id) {
1490
+ async function listJobCustomFieldTypes(client, params = {}, options) {
1491
+ const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: "custom-fields" });
1492
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1493
+ return client.request("get", path, { params });
1494
+ }
1495
+ async function listJobNotes(client, id, params = {}, options) {
1460
1496
  if (!id) throw new Error("id is required");
1461
1497
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/notes` });
1462
- return client.request("get", path);
1498
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1499
+ return client.request("get", path, { params });
1463
1500
  }
1464
1501
  async function createJobNote(client, id, data) {
1465
1502
  if (!id) throw new Error("id is required");
@@ -1471,18 +1508,23 @@ async function removeJobCancellation(client, id) {
1471
1508
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/remove-cancellation` });
1472
1509
  return client.request("post", path);
1473
1510
  }
1474
- async function getCancelReasons(client, ids) {
1475
- const params = {};
1476
- if (ids && ids.length > 0) {
1477
- params.ids = ids.join(",");
1478
- }
1511
+ async function getCancelReasons(client, ids, options) {
1479
1512
  const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: "cancel-reasons" });
1480
- return client.request("get", path, { params });
1513
+ const paginateEach = Boolean(options?.all);
1514
+ const pageSize = options?.pageSize ?? 200;
1515
+ return fetchInIdChunks(client, path, ids, {
1516
+ idParamName: "ids",
1517
+ otherParams: {},
1518
+ chunkSize: 50,
1519
+ paginateEachChunk: paginateEach,
1520
+ pageSize
1521
+ });
1481
1522
  }
1482
1523
 
1483
1524
  // src/resources/jpm/projects.ts
1484
- async function listProjects(client, params = {}) {
1525
+ async function listProjects(client, params = {}, options) {
1485
1526
  const path = client.buildPath({ category: "jpm", subject: "projects" });
1527
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1486
1528
  return client.request("get", path, { params });
1487
1529
  }
1488
1530
  async function getProject(client, id) {
@@ -1516,20 +1558,23 @@ async function listProjectCustomFields(client) {
1516
1558
  }
1517
1559
 
1518
1560
  // src/resources/jpm/job-cancel-reasons.ts
1519
- async function listJobCancelReasons(client) {
1561
+ async function listJobCancelReasons(client, params = {}, options) {
1520
1562
  const path = client.buildPath({ category: "jpm", subject: "job-cancel-reasons" });
1521
- return client.request("get", path);
1563
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1564
+ return client.request("get", path, { params });
1522
1565
  }
1523
1566
 
1524
1567
  // src/resources/jpm/job-hold-reasons.ts
1525
- async function listJobHoldReasons(client) {
1568
+ async function listJobHoldReasons(client, params = {}, options) {
1526
1569
  const path = client.buildPath({ category: "jpm", subject: "job-hold-reasons" });
1527
- return client.request("get", path);
1570
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1571
+ return client.request("get", path, { params });
1528
1572
  }
1529
1573
 
1530
1574
  // src/resources/jpm/job-types.ts
1531
- async function listJobTypes(client, params = {}) {
1575
+ async function listJobTypes(client, params = {}, options) {
1532
1576
  const path = client.buildPath({ category: "jpm", subject: "job-types" });
1577
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1533
1578
  return client.request("get", path, { params });
1534
1579
  }
1535
1580
  async function createJobType(client, data) {
@@ -1548,9 +1593,10 @@ async function updateJobType(client, id, data) {
1548
1593
  }
1549
1594
 
1550
1595
  // src/resources/jpm/project-statuses.ts
1551
- async function listProjectStatuses(client) {
1596
+ async function listProjectStatuses(client, params = {}, options) {
1552
1597
  const path = client.buildPath({ category: "jpm", subject: "project-statuses" });
1553
- return client.request("get", path);
1598
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1599
+ return client.request("get", path, { params });
1554
1600
  }
1555
1601
  async function getProjectStatus(client, id) {
1556
1602
  if (!id) throw new Error("id is required");
@@ -1559,9 +1605,10 @@ async function getProjectStatus(client, id) {
1559
1605
  }
1560
1606
 
1561
1607
  // src/resources/jpm/project-substatuses.ts
1562
- async function listProjectSubStatuses(client) {
1608
+ async function listProjectSubStatuses(client, params = {}, options) {
1563
1609
  const path = client.buildPath({ category: "jpm", subject: "project-substatuses" });
1564
- return client.request("get", path);
1610
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1611
+ return client.request("get", path, { params });
1565
1612
  }
1566
1613
  async function getProjectSubStatus(client, id) {
1567
1614
  if (!id) throw new Error("id is required");
@@ -1570,9 +1617,10 @@ async function getProjectSubStatus(client, id) {
1570
1617
  }
1571
1618
 
1572
1619
  // src/resources/jpm/project-types.ts
1573
- async function listProjectTypes(client) {
1620
+ async function listProjectTypes(client, params = {}, options) {
1574
1621
  const path = client.buildPath({ category: "jpm", subject: "project-types" });
1575
- return client.request("get", path);
1622
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1623
+ return client.request("get", path, { params });
1576
1624
  }
1577
1625
  async function getProjectType(client, id) {
1578
1626
  if (!id) throw new Error("id is required");
@@ -1581,8 +1629,9 @@ async function getProjectType(client, id) {
1581
1629
  }
1582
1630
 
1583
1631
  // src/resources/jpm/work-breakdown-structure.ts
1584
- async function listBudgetCodes(client, params = {}) {
1632
+ async function listBudgetCodes(client, params = {}, options) {
1585
1633
  const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes" });
1634
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1586
1635
  return client.request("get", path, { params });
1587
1636
  }
1588
1637
  async function createBudgetCode(client, data) {
@@ -1621,9 +1670,10 @@ async function listProjectSegmentItemChildren(client, projectId, segmentId, segm
1621
1670
  const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/projects/${projectId}/segments/${segmentId}/items/${segmentItemId}/children` });
1622
1671
  return client.request("get", path);
1623
1672
  }
1624
- async function listSegments(client) {
1673
+ async function listSegments(client, params = {}, options) {
1625
1674
  const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/segments" });
1626
- return client.request("get", path);
1675
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1676
+ return client.request("get", path, { params });
1627
1677
  }
1628
1678
  async function listSegmentItems(client, segmentId) {
1629
1679
  if (!segmentId) throw new Error("segmentId is required");
@@ -1987,8 +2037,9 @@ async function exportRecurringServices(client, params = {}) {
1987
2037
  }
1988
2038
 
1989
2039
  // src/resources/memberships/memberships.ts
1990
- async function listMemberships(client, params = {}) {
2040
+ async function listMemberships(client, params = {}, options) {
1991
2041
  const path = client.buildPath({ category: "memberships", subject: "memberships" });
2042
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
1992
2043
  return client.request("get", path, { params });
1993
2044
  }
1994
2045
  async function listMembershipCustomFields(client) {
@@ -2016,8 +2067,9 @@ async function listMembershipStatusChanges(client, id) {
2016
2067
  }
2017
2068
 
2018
2069
  // src/resources/memberships/invoice-templates.ts
2019
- async function listInvoiceTemplates(client, params = {}) {
2070
+ async function listInvoiceTemplates(client, params = {}, options) {
2020
2071
  const path = client.buildPath({ category: "memberships", subject: "invoice-templates" });
2072
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2021
2073
  return client.request("get", path, { params });
2022
2074
  }
2023
2075
  async function getInvoiceTemplate(client, id) {
@@ -2030,18 +2082,23 @@ async function updateInvoiceTemplate(client, id, data) {
2030
2082
  const path = client.buildPath({ category: "memberships", subject: "invoice-templates", idOrSubpath: String(id) });
2031
2083
  return client.request("put", path, { data });
2032
2084
  }
2033
- async function listInvoiceTemplatesByIds(client, ids) {
2034
- const params = {};
2035
- if (ids && ids.length > 0) {
2036
- params.ids = ids.join(",");
2037
- }
2085
+ async function listInvoiceTemplatesByIds(client, ids, options) {
2038
2086
  const path = client.buildPath({ category: "memberships", subject: "invoice-templates" });
2039
- return client.request("get", path, { params });
2087
+ const paginateEach = Boolean(options?.all);
2088
+ const pageSize = options?.pageSize ?? 200;
2089
+ return fetchInIdChunks(client, path, ids, {
2090
+ idParamName: "ids",
2091
+ otherParams: {},
2092
+ chunkSize: 50,
2093
+ paginateEachChunk: paginateEach,
2094
+ pageSize
2095
+ });
2040
2096
  }
2041
2097
 
2042
2098
  // src/resources/memberships/recurring-service-events.ts
2043
- async function listRecurringServiceEvents(client, params = {}) {
2099
+ async function listRecurringServiceEvents(client, params = {}, options) {
2044
2100
  const path = client.buildPath({ category: "memberships", subject: "recurring-service-events" });
2101
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2045
2102
  return client.request("get", path, { params });
2046
2103
  }
2047
2104
  async function markRecurringServiceEventComplete(client, id) {
@@ -2056,8 +2113,9 @@ async function markRecurringServiceEventIncomplete(client, id) {
2056
2113
  }
2057
2114
 
2058
2115
  // src/resources/memberships/recurring-services.ts
2059
- async function listRecurringServices(client, params = {}) {
2116
+ async function listRecurringServices(client, params = {}, options) {
2060
2117
  const path = client.buildPath({ category: "memberships", subject: "recurring-services" });
2118
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2061
2119
  return client.request("get", path, { params });
2062
2120
  }
2063
2121
  async function getRecurringService(client, id) {
@@ -2072,8 +2130,9 @@ async function updateRecurringService(client, id, data) {
2072
2130
  }
2073
2131
 
2074
2132
  // src/resources/memberships/membership-types.ts
2075
- async function listMembershipTypes(client, params = {}) {
2133
+ async function listMembershipTypes(client, params = {}, options) {
2076
2134
  const path = client.buildPath({ category: "memberships", subject: "membership-types" });
2135
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2077
2136
  return client.request("get", path, { params });
2078
2137
  }
2079
2138
  async function getMembershipType(client, id) {
@@ -2098,8 +2157,9 @@ async function listMembershipTypeRecurringServiceItems(client, id) {
2098
2157
  }
2099
2158
 
2100
2159
  // src/resources/memberships/recurring-service-types.ts
2101
- async function listRecurringServiceTypes(client, params = {}) {
2160
+ async function listRecurringServiceTypes(client, params = {}, options) {
2102
2161
  const path = client.buildPath({ category: "memberships", subject: "recurring-service-types" });
2162
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2103
2163
  return client.request("get", path, { params });
2104
2164
  }
2105
2165
  async function getRecurringServiceType(client, id) {
@@ -2176,8 +2236,9 @@ async function exportTimesheetCodes(client, params = {}) {
2176
2236
  }
2177
2237
 
2178
2238
  // src/resources/payroll/activity-codes.ts
2179
- async function listActivityCodes(client, params = {}) {
2239
+ async function listActivityCodes(client, params = {}, options) {
2180
2240
  const path = client.buildPath({ category: "payroll", subject: "activity-codes" });
2241
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2181
2242
  return client.request("get", path, { params });
2182
2243
  }
2183
2244
  async function getActivityCode(client, id) {
@@ -2208,25 +2269,29 @@ async function updateGrossPayItem(client, id, data) {
2208
2269
  }
2209
2270
 
2210
2271
  // src/resources/payroll/job-splits.ts
2211
- async function listJobSplits(client, params = {}) {
2272
+ async function listJobSplits(client, params = {}, options) {
2212
2273
  const path = client.buildPath({ category: "payroll", subject: "jobs/splits" });
2274
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2213
2275
  return client.request("get", path, { params });
2214
2276
  }
2215
- async function listJobSplitsByJob(client, jobId) {
2277
+ async function listJobSplitsByJob(client, jobId, params = {}, options) {
2216
2278
  if (!jobId) throw new Error("job is required");
2217
2279
  const path = client.buildPath({ category: "payroll", subject: `jobs/${jobId}/splits` });
2218
- return client.request("get", path);
2280
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2281
+ return client.request("get", path, { params });
2219
2282
  }
2220
2283
 
2221
2284
  // src/resources/payroll/location-labor-type.ts
2222
- async function listLocationLaborRates(client, params = {}) {
2285
+ async function listLocationLaborRates(client, params = {}, options) {
2223
2286
  const path = client.buildPath({ category: "payroll", subject: "locations/rates" });
2287
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2224
2288
  return client.request("get", path, { params });
2225
2289
  }
2226
2290
 
2227
2291
  // src/resources/payroll/payroll-adjustments.ts
2228
- async function listPayrollAdjustments(client, params = {}) {
2292
+ async function listPayrollAdjustments(client, params = {}, options) {
2229
2293
  const path = client.buildPath({ category: "payroll", subject: "payroll-adjustments" });
2294
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2230
2295
  return client.request("get", path, { params });
2231
2296
  }
2232
2297
  async function createPayrollAdjustment(client, data) {
@@ -2240,18 +2305,21 @@ async function getPayrollAdjustment(client, id) {
2240
2305
  }
2241
2306
 
2242
2307
  // src/resources/payroll/payrolls.ts
2243
- async function listEmployeePayrolls(client, employeeId, params = {}) {
2308
+ async function listEmployeePayrolls(client, employeeId, params = {}, options) {
2244
2309
  if (!employeeId) throw new Error("employee is required");
2245
2310
  const path = client.buildPath({ category: "payroll", subject: `employees/${employeeId}/payrolls` });
2311
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2246
2312
  return client.request("get", path, { params });
2247
2313
  }
2248
- async function listPayrolls(client, params = {}) {
2314
+ async function listPayrolls(client, params = {}, options) {
2249
2315
  const path = client.buildPath({ category: "payroll", subject: "payrolls" });
2316
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2250
2317
  return client.request("get", path, { params });
2251
2318
  }
2252
- async function listTechnicianPayrolls(client, technicianId, params = {}) {
2319
+ async function listTechnicianPayrolls(client, technicianId, params = {}, options) {
2253
2320
  if (!technicianId) throw new Error("technician is required");
2254
2321
  const path = client.buildPath({ category: "payroll", subject: `technicians/${technicianId}/payrolls` });
2322
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2255
2323
  return client.request("get", path, { params });
2256
2324
  }
2257
2325
 
@@ -2282,8 +2350,9 @@ async function updateTechnicianPayrollSettings(client, technicianId, data) {
2282
2350
  }
2283
2351
 
2284
2352
  // src/resources/payroll/timesheet-codes.ts
2285
- async function listTimesheetCodes(client, params = {}) {
2353
+ async function listTimesheetCodes(client, params = {}, options) {
2286
2354
  const path = client.buildPath({ category: "payroll", subject: "timesheet-codes" });
2355
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2287
2356
  return client.request("get", path, { params });
2288
2357
  }
2289
2358
  async function getTimesheetCode(client, id) {
@@ -2293,17 +2362,20 @@ async function getTimesheetCode(client, id) {
2293
2362
  }
2294
2363
 
2295
2364
  // src/resources/payroll/timesheets.ts
2296
- async function listJobTimesheets(client, params = {}) {
2365
+ async function listJobTimesheets(client, params = {}, options) {
2297
2366
  const path = client.buildPath({ category: "payroll", subject: "jobs/timesheets" });
2367
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2298
2368
  return client.request("get", path, { params });
2299
2369
  }
2300
- async function listTimesheetsForJob(client, jobId, params = {}) {
2370
+ async function listTimesheetsForJob(client, jobId, params = {}, options) {
2301
2371
  if (!jobId) throw new Error("job is required");
2302
2372
  const path = client.buildPath({ category: "payroll", subject: `jobs/${jobId}/timesheets` });
2373
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2303
2374
  return client.request("get", path, { params });
2304
2375
  }
2305
- async function listNonJobTimesheets(client, params = {}) {
2376
+ async function listNonJobTimesheets(client, params = {}, options) {
2306
2377
  const path = client.buildPath({ category: "payroll", subject: "non-job-timesheets" });
2378
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2307
2379
  return client.request("get", path, { params });
2308
2380
  }
2309
2381
 
@@ -2318,8 +2390,9 @@ __export(forms_exports, {
2318
2390
  });
2319
2391
 
2320
2392
  // src/resources/forms/forms.ts
2321
- async function listForms(client, params = {}) {
2393
+ async function listForms(client, params = {}, options) {
2322
2394
  const path = client.buildPath({ category: "forms", subject: "forms" });
2395
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2323
2396
  return client.request("get", path, { params });
2324
2397
  }
2325
2398
 
@@ -2366,8 +2439,9 @@ __export(job_bookings_exports, {
2366
2439
  });
2367
2440
 
2368
2441
  // src/resources/job-bookings/call-reasons.ts
2369
- async function listCallReasons(client, params = {}) {
2442
+ async function listCallReasons(client, params = {}, options) {
2370
2443
  const path = client.buildPath({ category: "jbce", subject: "call-reasons" });
2444
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2371
2445
  return client.request("get", path, { params });
2372
2446
  }
2373
2447
 
@@ -2394,8 +2468,9 @@ __export(marketing_exports, {
2394
2468
  });
2395
2469
 
2396
2470
  // src/resources/marketing/categories.ts
2397
- async function listCampaignCategories(client, params = {}) {
2471
+ async function listCampaignCategories(client, params = {}, options) {
2398
2472
  const path = client.buildPath({ category: "marketing", subject: "categories" });
2473
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2399
2474
  return client.request("get", path, { params });
2400
2475
  }
2401
2476
  async function createCampaignCategory(client, data) {
@@ -2414,8 +2489,9 @@ async function updateCampaignCategory(client, id, data) {
2414
2489
  }
2415
2490
 
2416
2491
  // src/resources/marketing/costs.ts
2417
- async function listCampaignCosts(client, params = {}) {
2492
+ async function listCampaignCosts(client, params = {}, options) {
2418
2493
  const path = client.buildPath({ category: "marketing", subject: "costs" });
2494
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2419
2495
  return client.request("get", path, { params });
2420
2496
  }
2421
2497
  async function createCampaignCost(client, data) {
@@ -2434,8 +2510,9 @@ async function updateCampaignCost(client, id, data) {
2434
2510
  }
2435
2511
 
2436
2512
  // src/resources/marketing/campaigns.ts
2437
- async function listCampaigns(client, params = {}) {
2513
+ async function listCampaigns(client, params = {}, options) {
2438
2514
  const path = client.buildPath({ category: "marketing", subject: "campaigns" });
2515
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2439
2516
  return client.request("get", path, { params });
2440
2517
  }
2441
2518
  async function createCampaign(client, data) {
@@ -2452,15 +2529,17 @@ async function updateCampaign(client, id, data) {
2452
2529
  const path = client.buildPath({ category: "marketing", subject: "campaigns", idOrSubpath: String(id) });
2453
2530
  return client.request("put", path, { data });
2454
2531
  }
2455
- async function listCampaignCostsForCampaign(client, id, params = {}) {
2532
+ async function listCampaignCostsForCampaign(client, id, params = {}, options) {
2456
2533
  if (!id) throw new Error("id is required");
2457
2534
  const path = client.buildPath({ category: "marketing", subject: `campaigns/${id}/costs` });
2535
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2458
2536
  return client.request("get", path, { params });
2459
2537
  }
2460
2538
 
2461
2539
  // src/resources/marketing/suppressions.ts
2462
- async function listSuppressions(client, params = {}) {
2540
+ async function listSuppressions(client, params = {}, options) {
2463
2541
  const path = client.buildPath({ category: "marketing", subject: "suppressions" });
2542
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2464
2543
  return client.request("get", path, { params });
2465
2544
  }
2466
2545
  async function suppressEmail(client, data) {
@@ -2481,55 +2560,57 @@ async function getSuppressionByEmail(client, email) {
2481
2560
  // src/resources/marketing-ads/index.ts
2482
2561
  var marketing_ads_exports = {};
2483
2562
  __export(marketing_ads_exports, {
2563
+ createExternalCallAttribution: () => createExternalCallAttribution,
2564
+ createScheduledJobAttribution: () => createScheduledJobAttribution,
2565
+ createWebBookingAttribution: () => createWebBookingAttribution,
2566
+ createWebLeadFormAttribution: () => createWebLeadFormAttribution,
2484
2567
  getPerformance: () => getPerformance,
2485
2568
  listAttributedLeads: () => listAttributedLeads,
2486
- listCapacityWarnings: () => listCapacityWarnings,
2487
- listExternalCallAttributions: () => listExternalCallAttributions,
2488
- listScheduledJobAttributions: () => listScheduledJobAttributions,
2489
- listWebBookingAttributions: () => listWebBookingAttributions,
2490
- listWebLeadFormAttributions: () => listWebLeadFormAttributions
2569
+ listCapacityWarnings: () => listCapacityWarnings
2491
2570
  });
2492
2571
 
2493
2572
  // src/resources/marketing-ads/attributed-leads.ts
2494
- async function listAttributedLeads(client, params) {
2495
- const path = client.buildPath({ category: "marketing-ads", subject: "attributed-leads" });
2573
+ async function listAttributedLeads(client, params, options) {
2574
+ const path = client.buildPath({ category: "marketingads", subject: "attributed-leads" });
2575
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2496
2576
  return client.request("get", path, { params });
2497
2577
  }
2498
2578
 
2499
2579
  // src/resources/marketing-ads/capacity-warnings.ts
2500
2580
  async function listCapacityWarnings(client, params = {}) {
2501
- const path = client.buildPath({ category: "marketing-ads", subject: "capacity-warnings" });
2581
+ const path = client.buildPath({ category: "marketingads", subject: "capacity-warnings" });
2502
2582
  return client.request("get", path, { params });
2503
2583
  }
2504
2584
 
2505
2585
  // src/resources/marketing-ads/external-call-attributions.ts
2506
- async function listExternalCallAttributions(client, params = {}) {
2507
- const path = client.buildPath({ category: "marketing-ads", subject: "external-call-attributions" });
2508
- return client.request("get", path, { params });
2586
+ async function createExternalCallAttribution(client, data) {
2587
+ const path = client.buildPath({ category: "marketingads", subject: "external-call-attributions" });
2588
+ return client.request("post", path, { data });
2509
2589
  }
2510
2590
 
2511
2591
  // src/resources/marketing-ads/performance.ts
2512
- async function getPerformance(client, params) {
2513
- const path = client.buildPath({ category: "marketing-ads", subject: "performance" });
2592
+ async function getPerformance(client, params, options) {
2593
+ const path = client.buildPath({ category: "marketingads", subject: "performance" });
2594
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2514
2595
  return client.request("get", path, { params });
2515
2596
  }
2516
2597
 
2517
2598
  // src/resources/marketing-ads/scheduled-job-attributions.ts
2518
- async function listScheduledJobAttributions(client, params = {}) {
2519
- const path = client.buildPath({ category: "marketing-ads", subject: "job-attributions" });
2520
- return client.request("get", path, { params });
2599
+ async function createScheduledJobAttribution(client, data) {
2600
+ const path = client.buildPath({ category: "marketingads", subject: "job-attributions" });
2601
+ return client.request("post", path, { data });
2521
2602
  }
2522
2603
 
2523
2604
  // src/resources/marketing-ads/web-booking-attributions.ts
2524
- async function listWebBookingAttributions(client, params = {}) {
2525
- const path = client.buildPath({ category: "marketing-ads", subject: "web-booking-attributions" });
2526
- return client.request("get", path, { params });
2605
+ async function createWebBookingAttribution(client, data) {
2606
+ const path = client.buildPath({ category: "marketingads", subject: "web-booking-attributions" });
2607
+ return client.request("post", path, { data });
2527
2608
  }
2528
2609
 
2529
2610
  // src/resources/marketing-ads/web-lead-form-attributions.ts
2530
- async function listWebLeadFormAttributions(client, params = {}) {
2531
- const path = client.buildPath({ category: "marketing-ads", subject: "web-lead-form-attributions" });
2532
- return client.request("get", path, { params });
2611
+ async function createWebLeadFormAttribution(client, data) {
2612
+ const path = client.buildPath({ category: "marketingads", subject: "web-lead-form-attributions" });
2613
+ return client.request("post", path, { data });
2533
2614
  }
2534
2615
 
2535
2616
  // src/resources/reporting/index.ts
@@ -2596,6 +2677,7 @@ __export(pricebook_exports, {
2596
2677
  getClientSpecificPricingRateSheet: () => getClientSpecificPricingRateSheet,
2597
2678
  getDiscountOrFee: () => getDiscountOrFee,
2598
2679
  getEquipment: () => getEquipment,
2680
+ getImage: () => getImage,
2599
2681
  getMaterial: () => getMaterial,
2600
2682
  getMaterialsMarkup: () => getMaterialsMarkup,
2601
2683
  getService: () => getService,
@@ -2604,7 +2686,6 @@ __export(pricebook_exports, {
2604
2686
  listClientSpecificPricing: () => listClientSpecificPricing,
2605
2687
  listDiscountsAndFees: () => listDiscountsAndFees,
2606
2688
  listEquipment: () => listEquipment,
2607
- listImages: () => listImages,
2608
2689
  listMaterialCostTypes: () => listMaterialCostTypes,
2609
2690
  listMaterials: () => listMaterials,
2610
2691
  listMaterialsMarkup: () => listMaterialsMarkup,
@@ -2614,8 +2695,7 @@ __export(pricebook_exports, {
2614
2695
  updateEquipment: () => updateEquipment,
2615
2696
  updateMaterial: () => updateMaterial,
2616
2697
  updateMaterialsMarkup: () => updateMaterialsMarkup,
2617
- updateService: () => updateService,
2618
- uploadImage: () => uploadImage
2698
+ updateService: () => updateService
2619
2699
  });
2620
2700
 
2621
2701
  // src/resources/pricebook/export.ts
@@ -2637,8 +2717,9 @@ async function exportServices(client, params = {}) {
2637
2717
  }
2638
2718
 
2639
2719
  // src/resources/pricebook/categories.ts
2640
- async function listCategories(client, params = {}) {
2720
+ async function listCategories(client, params = {}, options) {
2641
2721
  const path = client.buildPath({ category: "pricebook", subject: "categories" });
2722
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2642
2723
  return client.request("get", path, { params });
2643
2724
  }
2644
2725
  async function createCategory(client, data) {
@@ -2662,8 +2743,9 @@ async function deleteCategory(client, id) {
2662
2743
  }
2663
2744
 
2664
2745
  // src/resources/pricebook/client-specific-pricing.ts
2665
- async function listClientSpecificPricing(client, params = {}) {
2746
+ async function listClientSpecificPricing(client, params = {}, options) {
2666
2747
  const path = client.buildPath({ category: "pricebook", subject: "clientspecificpricing" });
2748
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2667
2749
  return client.request("get", path, { params });
2668
2750
  }
2669
2751
  async function getClientSpecificPricingRateSheet(client, rateSheetId) {
@@ -2725,15 +2807,10 @@ async function deleteEquipment(client, id) {
2725
2807
  }
2726
2808
 
2727
2809
  // src/resources/pricebook/images.ts
2728
- async function listImages(client, params = {}, options) {
2810
+ async function getImage(client, params = {}) {
2729
2811
  const path = client.buildPath({ category: "pricebook", subject: "images" });
2730
- if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2731
2812
  return client.request("get", path, { params });
2732
2813
  }
2733
- async function uploadImage(client, data) {
2734
- const path = client.buildPath({ category: "pricebook", subject: "images" });
2735
- return client.request("post", path, { data });
2736
- }
2737
2814
 
2738
2815
  // src/resources/pricebook/materials.ts
2739
2816
  async function listMaterials(client, params = {}, options) {
@@ -2745,8 +2822,9 @@ async function createMaterial(client, data) {
2745
2822
  const path = client.buildPath({ category: "pricebook", subject: "materials" });
2746
2823
  return client.request("post", path, { data });
2747
2824
  }
2748
- async function listMaterialCostTypes(client) {
2825
+ async function listMaterialCostTypes(client, options) {
2749
2826
  const path = client.buildPath({ category: "pricebook", subject: "materials", idOrSubpath: "costtypes" });
2827
+ if (options?.all) return client.getAll(path, {}, options.pageSize ?? 200);
2750
2828
  return client.request("get", path);
2751
2829
  }
2752
2830
  async function getMaterial(client, id) {
@@ -2766,8 +2844,9 @@ async function deleteMaterial(client, id) {
2766
2844
  }
2767
2845
 
2768
2846
  // src/resources/pricebook/materials-markup.ts
2769
- async function listMaterialsMarkup(client, params = {}) {
2847
+ async function listMaterialsMarkup(client, params = {}, options) {
2770
2848
  const path = client.buildPath({ category: "pricebook", subject: "materialsmarkup" });
2849
+ if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
2771
2850
  return client.request("get", path, { params });
2772
2851
  }
2773
2852
  async function createMaterialsMarkup(client, data) {
@@ -3103,9 +3182,7 @@ __export(sales_estimates_exports, {
3103
3182
  dismissEstimate: () => dismissEstimate,
3104
3183
  exportEstimates: () => exportEstimates,
3105
3184
  getEstimate: () => getEstimate,
3106
- getEstimateItem: () => getEstimateItem,
3107
3185
  listEstimateItems: () => listEstimateItems,
3108
- listEstimateItemsByEstimate: () => listEstimateItemsByEstimate,
3109
3186
  listEstimates: () => listEstimates,
3110
3187
  sellEstimate: () => sellEstimate,
3111
3188
  unsellEstimate: () => unsellEstimate,
@@ -3114,58 +3191,48 @@ __export(sales_estimates_exports, {
3114
3191
 
3115
3192
  // src/resources/sales-estimates/estimates.ts
3116
3193
  async function listEstimates(client, params = {}, options) {
3117
- const path = client.buildPath({ category: "salestech", subject: "estimates" });
3194
+ const path = client.buildPath({ category: "sales", subject: "estimates" });
3118
3195
  if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
3119
3196
  return client.request("get", path, { params });
3120
3197
  }
3121
3198
  async function createEstimate(client, data) {
3122
- const path = client.buildPath({ category: "salestech", subject: "estimates" });
3199
+ const path = client.buildPath({ category: "sales", subject: "estimates" });
3123
3200
  return client.request("post", path, { data });
3124
3201
  }
3125
3202
  async function listEstimateItems(client, params = {}, options) {
3126
- const path = client.buildPath({ category: "salestech", subject: "estimates/items" });
3203
+ const path = client.buildPath({ category: "sales", subject: "estimates/items" });
3127
3204
  if (options?.all) return client.getAll(path, params, options.pageSize ?? 200);
3128
3205
  return client.request("get", path, { params });
3129
3206
  }
3130
3207
  async function getEstimate(client, id) {
3131
3208
  if (!id) throw new Error("id is required");
3132
- const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: String(id) });
3209
+ const path = client.buildPath({ category: "sales", subject: "estimates", idOrSubpath: String(id) });
3133
3210
  return client.request("get", path);
3134
3211
  }
3135
3212
  async function updateEstimate(client, id, data) {
3136
3213
  if (!id) throw new Error("id is required");
3137
- const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: String(id) });
3214
+ const path = client.buildPath({ category: "sales", subject: "estimates", idOrSubpath: String(id) });
3138
3215
  return client.request("put", path, { data });
3139
3216
  }
3140
3217
  async function dismissEstimate(client, id) {
3141
3218
  if (!id) throw new Error("id is required");
3142
- const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/dismiss` });
3219
+ const path = client.buildPath({ category: "sales", subject: `estimates/${id}/dismiss` });
3143
3220
  return client.request("post", path);
3144
3221
  }
3145
- async function listEstimateItemsByEstimate(client, id) {
3146
- if (!id) throw new Error("id is required");
3147
- const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/items` });
3148
- return client.request("get", path);
3149
- }
3150
- async function getEstimateItem(client, id, itemId) {
3151
- if (!id || !itemId) throw new Error("id and itemId are required");
3152
- const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/items/${itemId}` });
3153
- return client.request("get", path);
3154
- }
3155
3222
  async function sellEstimate(client, id) {
3156
3223
  if (!id) throw new Error("id is required");
3157
- const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/sell` });
3224
+ const path = client.buildPath({ category: "sales", subject: `estimates/${id}/sell` });
3158
3225
  return client.request("post", path);
3159
3226
  }
3160
3227
  async function unsellEstimate(client, id) {
3161
3228
  if (!id) throw new Error("id is required");
3162
- const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/unsell` });
3229
+ const path = client.buildPath({ category: "sales", subject: `estimates/${id}/unsell` });
3163
3230
  return client.request("post", path);
3164
3231
  }
3165
3232
 
3166
3233
  // src/resources/sales-estimates/estimates-export.ts
3167
3234
  async function exportEstimates(client, params = {}) {
3168
- const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: "export" });
3235
+ const path = client.buildPath({ category: "sales", subject: "estimates", idOrSubpath: "export" });
3169
3236
  return client.request("get", path, { params });
3170
3237
  }
3171
3238