@masonlandcattle/servicetitan-sdk 0.1.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/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/index.cjs +3221 -0
- package/dist/index.d.cts +2377 -0
- package/dist/index.d.ts +2377 -0
- package/dist/index.js +3167 -0
- package/package.json +58 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3167 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/client.ts
|
|
8
|
+
import axios from "axios";
|
|
9
|
+
import Bottleneck from "bottleneck";
|
|
10
|
+
import qs from "qs";
|
|
11
|
+
var ServiceTitanClient = class {
|
|
12
|
+
constructor(opts = {}) {
|
|
13
|
+
this.token = null;
|
|
14
|
+
this.tokenExpiry = null;
|
|
15
|
+
this.refreshing = null;
|
|
16
|
+
const env = opts.environment || process.env.ENVIRONMENT || "production";
|
|
17
|
+
const authUrl = opts.authUrl || (env === "production" ? "https://auth.servicetitan.io/connect/token" : "https://auth-integration.servicetitan.io/connect/token");
|
|
18
|
+
const apiBaseUrl = opts.apiBaseUrl || (env === "production" ? "https://api.servicetitan.io" : "https://api-integration.servicetitan.io");
|
|
19
|
+
const defaults = {
|
|
20
|
+
tenantId: opts.tenantId || process.env.TENANT_ID || "",
|
|
21
|
+
appKey: opts.appKey || process.env.APP_KEY || "",
|
|
22
|
+
clientId: opts.clientId || process.env.CLIENT_ID || "",
|
|
23
|
+
clientSecret: opts.clientSecret || process.env.SECRET_KEY || "",
|
|
24
|
+
environment: env,
|
|
25
|
+
authUrl,
|
|
26
|
+
apiBaseUrl,
|
|
27
|
+
timeoutMs: opts.timeoutMs ?? 3e4,
|
|
28
|
+
retries: opts.retries ?? 3,
|
|
29
|
+
retryInitialDelayMs: opts.retryInitialDelayMs ?? 1e3,
|
|
30
|
+
maxConcurrent: opts.maxConcurrent ?? 5,
|
|
31
|
+
minTimeMs: opts.minTimeMs ?? 100,
|
|
32
|
+
logger: opts.logger || console
|
|
33
|
+
};
|
|
34
|
+
if (!defaults.tenantId || !defaults.appKey || !defaults.clientId || !defaults.clientSecret) {
|
|
35
|
+
throw new Error("Missing required configuration: TENANT_ID, APP_KEY, CLIENT_ID, SECRET_KEY");
|
|
36
|
+
}
|
|
37
|
+
this.options = defaults;
|
|
38
|
+
this.limiter = new Bottleneck({
|
|
39
|
+
maxConcurrent: this.options.maxConcurrent,
|
|
40
|
+
minTime: this.options.minTimeMs
|
|
41
|
+
});
|
|
42
|
+
this.axiosInstance = axios.create({
|
|
43
|
+
baseURL: this.options.apiBaseUrl,
|
|
44
|
+
timeout: this.options.timeoutMs,
|
|
45
|
+
headers: {
|
|
46
|
+
"ST-App-Key": this.options.appKey,
|
|
47
|
+
"Content-Type": "application/json"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
this.axiosInstance.interceptors.request.use((config) => {
|
|
51
|
+
if (this.token) {
|
|
52
|
+
config.headers = config.headers || {};
|
|
53
|
+
config.headers["Authorization"] = `Bearer ${this.token}`;
|
|
54
|
+
}
|
|
55
|
+
return config;
|
|
56
|
+
});
|
|
57
|
+
this.axiosInstance.interceptors.response.use(
|
|
58
|
+
(resp) => resp,
|
|
59
|
+
async (error) => {
|
|
60
|
+
const original = error.config;
|
|
61
|
+
if (error.response?.status === 401 && !original._retry) {
|
|
62
|
+
original._retry = true;
|
|
63
|
+
await this.refreshToken();
|
|
64
|
+
return this.axiosInstance(original);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
async refreshToken() {
|
|
71
|
+
if (this.refreshing) return this.refreshing;
|
|
72
|
+
this.refreshing = (async () => {
|
|
73
|
+
await this.authenticate();
|
|
74
|
+
})().finally(() => {
|
|
75
|
+
this.refreshing = null;
|
|
76
|
+
});
|
|
77
|
+
return this.refreshing;
|
|
78
|
+
}
|
|
79
|
+
async authenticate() {
|
|
80
|
+
if (this.token && this.tokenExpiry && Date.now() < this.tokenExpiry) {
|
|
81
|
+
return this.token;
|
|
82
|
+
}
|
|
83
|
+
const body = qs.stringify({
|
|
84
|
+
grant_type: "client_credentials",
|
|
85
|
+
client_id: this.options.clientId,
|
|
86
|
+
client_secret: this.options.clientSecret
|
|
87
|
+
});
|
|
88
|
+
try {
|
|
89
|
+
const resp = await axios.post(this.options.authUrl, body, {
|
|
90
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
91
|
+
timeout: this.options.timeoutMs
|
|
92
|
+
});
|
|
93
|
+
this.token = String(resp.data.access_token);
|
|
94
|
+
const expiresIn = Number(resp.data.expires_in || 900);
|
|
95
|
+
this.tokenExpiry = Date.now() + expiresIn * 1e3 - 5e3;
|
|
96
|
+
return this.token;
|
|
97
|
+
} catch (err) {
|
|
98
|
+
this.options.logger.error?.("ServiceTitan auth failed", err.response?.status, err.response?.data || err.message);
|
|
99
|
+
throw err;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async delay(ms) {
|
|
103
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
104
|
+
}
|
|
105
|
+
computeBackoff(base, attempt) {
|
|
106
|
+
const exp = base * Math.pow(2, attempt);
|
|
107
|
+
const jitter = Math.random() * base;
|
|
108
|
+
return Math.min(3e4, exp + jitter);
|
|
109
|
+
}
|
|
110
|
+
isRetryable(error) {
|
|
111
|
+
if (!error) return true;
|
|
112
|
+
const status = error.response?.status;
|
|
113
|
+
if (!status) return true;
|
|
114
|
+
if (status === 429) return true;
|
|
115
|
+
if (status >= 500) return true;
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
async schedule(fn) {
|
|
119
|
+
return this.limiter.schedule(fn);
|
|
120
|
+
}
|
|
121
|
+
async request(method, endpoint, options = {}) {
|
|
122
|
+
await this.authenticate();
|
|
123
|
+
const { params, data, headers, retries } = options;
|
|
124
|
+
const maxRetries = retries ?? this.options.retries;
|
|
125
|
+
let attempt = 0;
|
|
126
|
+
while (true) {
|
|
127
|
+
try {
|
|
128
|
+
const result = await this.schedule(async () => {
|
|
129
|
+
const resp = await this.axiosInstance.request({ method, url: endpoint, params, data, headers });
|
|
130
|
+
return resp.data;
|
|
131
|
+
});
|
|
132
|
+
return result;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
this.options.logger.warn?.("ServiceTitan API error", error.response?.status, error.response?.data || error.message);
|
|
135
|
+
if (attempt >= maxRetries || !this.isRetryable(error)) {
|
|
136
|
+
throw error.response?.data || error;
|
|
137
|
+
}
|
|
138
|
+
let delayMs = this.computeBackoff(this.options.retryInitialDelayMs, attempt);
|
|
139
|
+
const retryAfter = error.response?.headers?.["retry-after"];
|
|
140
|
+
if (retryAfter) {
|
|
141
|
+
const parsed = Number(retryAfter);
|
|
142
|
+
if (!Number.isNaN(parsed)) delayMs = Math.max(delayMs, parsed * 1e3);
|
|
143
|
+
}
|
|
144
|
+
await this.delay(delayMs);
|
|
145
|
+
attempt += 1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
buildPath(options) {
|
|
150
|
+
const version = options.version || "v2";
|
|
151
|
+
const tenant = options.tenantScoped !== false ? `/tenant/${this.options.tenantId}` : "";
|
|
152
|
+
const idSeg = options.idOrSubpath ? `/${String(options.idOrSubpath).replace(/^\/+/, "")}` : "";
|
|
153
|
+
return `/${options.category}/${version}${tenant}/${options.subject}${idSeg}`;
|
|
154
|
+
}
|
|
155
|
+
async getAll(path, params = {}, pageSize = 200) {
|
|
156
|
+
const aggregated = [];
|
|
157
|
+
let page = 1;
|
|
158
|
+
let hasMore = true;
|
|
159
|
+
while (hasMore) {
|
|
160
|
+
const resp = await this.request("get", path, {
|
|
161
|
+
params: { ...params, page, pageSize }
|
|
162
|
+
});
|
|
163
|
+
aggregated.push(...resp.data || []);
|
|
164
|
+
hasMore = Boolean(resp.hasMore);
|
|
165
|
+
page += 1;
|
|
166
|
+
}
|
|
167
|
+
return aggregated;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
function createClientFromEnv(overrides = {}) {
|
|
171
|
+
return new ServiceTitanClient(overrides);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// src/resources/accounting/index.ts
|
|
175
|
+
var accounting_exports = {};
|
|
176
|
+
__export(accounting_exports, {
|
|
177
|
+
createAdjustmentInvoice: () => createAdjustmentInvoice,
|
|
178
|
+
createGlAccount: () => createGlAccount,
|
|
179
|
+
deleteInvoiceItem: () => deleteInvoiceItem,
|
|
180
|
+
exportInventoryBills: () => exportInventoryBills,
|
|
181
|
+
getAllInventoryBills: () => getAllInventoryBills,
|
|
182
|
+
getAllInvoices: () => getAllInvoices,
|
|
183
|
+
getAllJournalEntries: () => getAllJournalEntries,
|
|
184
|
+
getAllPaymentTerms: () => getAllPaymentTerms,
|
|
185
|
+
getAllPaymentTypes: () => getAllPaymentTypes,
|
|
186
|
+
getAllPayments: () => getAllPayments,
|
|
187
|
+
getAllTaxZones: () => getAllTaxZones,
|
|
188
|
+
getGlAccount: () => getGlAccount,
|
|
189
|
+
getInventoryBillCustomFieldTypes: () => getInventoryBillCustomFieldTypes,
|
|
190
|
+
getInvoiceCustomFieldTypes: () => getInvoiceCustomFieldTypes,
|
|
191
|
+
getJournalEntriesSummary: () => getJournalEntriesSummary,
|
|
192
|
+
getJournalEntryDetails: () => getJournalEntryDetails,
|
|
193
|
+
getPaymentCustomFieldTypes: () => getPaymentCustomFieldTypes,
|
|
194
|
+
getPaymentTermModel: () => getPaymentTermModel,
|
|
195
|
+
getPaymentType: () => getPaymentType,
|
|
196
|
+
listApCredits: () => listApCredits,
|
|
197
|
+
listApPayments: () => listApPayments,
|
|
198
|
+
listGlAccountTypes: () => listGlAccountTypes,
|
|
199
|
+
listGlAccounts: () => listGlAccounts,
|
|
200
|
+
listInventoryBills: () => listInventoryBills,
|
|
201
|
+
listInvoices: () => listInvoices,
|
|
202
|
+
listJournalEntries: () => listJournalEntries,
|
|
203
|
+
listPaymentTerms: () => listPaymentTerms,
|
|
204
|
+
listPaymentTypes: () => listPaymentTypes,
|
|
205
|
+
listPayments: () => listPayments,
|
|
206
|
+
listTaxZones: () => listTaxZones,
|
|
207
|
+
markApCreditsAsExported: () => markApCreditsAsExported,
|
|
208
|
+
markApPaymentsAsExported: () => markApPaymentsAsExported,
|
|
209
|
+
markInventoryBillsAsExported: () => markInventoryBillsAsExported,
|
|
210
|
+
markInvoicesAsExported: () => markInvoicesAsExported,
|
|
211
|
+
syncUpdateJournalEntries: () => syncUpdateJournalEntries,
|
|
212
|
+
updateGlAccount: () => updateGlAccount,
|
|
213
|
+
updateInventoryBillCustomFields: () => updateInventoryBillCustomFields,
|
|
214
|
+
updateInvoice: () => updateInvoice,
|
|
215
|
+
updateInvoiceCustomFields: () => updateInvoiceCustomFields,
|
|
216
|
+
updateInvoiceItems: () => updateInvoiceItems,
|
|
217
|
+
updateJournalEntry: () => updateJournalEntry,
|
|
218
|
+
updatePayment: () => updatePayment,
|
|
219
|
+
updatePaymentCustomFields: () => updatePaymentCustomFields,
|
|
220
|
+
updatePaymentStatus: () => updatePaymentStatus
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// src/resources/accounting/invoices.ts
|
|
224
|
+
async function listInvoices(client, params = {}) {
|
|
225
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices" });
|
|
226
|
+
return client.request("get", path, { params });
|
|
227
|
+
}
|
|
228
|
+
async function getAllInvoices(client, params = {}, pageSize = 200) {
|
|
229
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices" });
|
|
230
|
+
return client.getAll(path, params, pageSize);
|
|
231
|
+
}
|
|
232
|
+
async function createAdjustmentInvoice(client, data) {
|
|
233
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: "adjustment" });
|
|
234
|
+
return client.request("post", path, { data });
|
|
235
|
+
}
|
|
236
|
+
async function getInvoiceCustomFieldTypes(client) {
|
|
237
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: "custom-field-types" });
|
|
238
|
+
return client.request("get", path);
|
|
239
|
+
}
|
|
240
|
+
async function updateInvoiceCustomFields(client, id, data) {
|
|
241
|
+
if (!id) throw new Error("id is required");
|
|
242
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: `${id}/custom-fields` });
|
|
243
|
+
return client.request("post", path, { data });
|
|
244
|
+
}
|
|
245
|
+
async function markInvoicesAsExported(client, ids) {
|
|
246
|
+
if (!ids?.length) throw new Error("ids are required");
|
|
247
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: "mark-as-exported" });
|
|
248
|
+
return client.request("post", path, { data: { ids } });
|
|
249
|
+
}
|
|
250
|
+
async function updateInvoice(client, id, data) {
|
|
251
|
+
if (!id) throw new Error("id is required");
|
|
252
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: String(id) });
|
|
253
|
+
return client.request("put", path, { data });
|
|
254
|
+
}
|
|
255
|
+
async function updateInvoiceItems(client, id, items) {
|
|
256
|
+
if (!id) throw new Error("id is required");
|
|
257
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: `${id}/items` });
|
|
258
|
+
return client.request("put", path, { data: items });
|
|
259
|
+
}
|
|
260
|
+
async function deleteInvoiceItem(client, invoiceId, itemId) {
|
|
261
|
+
if (!invoiceId || !itemId) throw new Error("invoiceId and itemId are required");
|
|
262
|
+
const path = client.buildPath({ category: "accounting", subject: "invoices", idOrSubpath: `${invoiceId}/items/${itemId}` });
|
|
263
|
+
return client.request("delete", path);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// src/resources/accounting/inventory-bills.ts
|
|
267
|
+
async function listInventoryBills(client, params = {}) {
|
|
268
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills" });
|
|
269
|
+
return client.request("get", path, { params });
|
|
270
|
+
}
|
|
271
|
+
async function getAllInventoryBills(client, params = {}, pageSize = 200) {
|
|
272
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills" });
|
|
273
|
+
return client.getAll(path, params, pageSize);
|
|
274
|
+
}
|
|
275
|
+
async function exportInventoryBills(client, data) {
|
|
276
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills", idOrSubpath: "export" });
|
|
277
|
+
return client.request("post", path, { data });
|
|
278
|
+
}
|
|
279
|
+
async function getInventoryBillCustomFieldTypes(client) {
|
|
280
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills", idOrSubpath: "custom-field-types" });
|
|
281
|
+
return client.request("get", path);
|
|
282
|
+
}
|
|
283
|
+
async function updateInventoryBillCustomFields(client, id, data) {
|
|
284
|
+
if (!id) throw new Error("id is required");
|
|
285
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills", idOrSubpath: `${id}/custom-fields` });
|
|
286
|
+
return client.request("post", path, { data });
|
|
287
|
+
}
|
|
288
|
+
async function markInventoryBillsAsExported(client, ids) {
|
|
289
|
+
if (!ids?.length) throw new Error("ids are required");
|
|
290
|
+
const path = client.buildPath({ category: "accounting", subject: "inventory-bills", idOrSubpath: "mark-as-exported" });
|
|
291
|
+
return client.request("post", path, { data: { ids } });
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// src/resources/accounting/journal-entries.ts
|
|
295
|
+
async function listJournalEntries(client, params = {}) {
|
|
296
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries" });
|
|
297
|
+
return client.request("get", path, { params });
|
|
298
|
+
}
|
|
299
|
+
async function getAllJournalEntries(client, params = {}, pageSize = 200) {
|
|
300
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries" });
|
|
301
|
+
return client.getAll(path, params, pageSize);
|
|
302
|
+
}
|
|
303
|
+
async function getJournalEntryDetails(client, id) {
|
|
304
|
+
if (!id) throw new Error("id is required");
|
|
305
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries", idOrSubpath: String(id) });
|
|
306
|
+
return client.request("get", path);
|
|
307
|
+
}
|
|
308
|
+
async function getJournalEntriesSummary(client, params = {}) {
|
|
309
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries", idOrSubpath: "summary" });
|
|
310
|
+
return client.request("get", path, { params });
|
|
311
|
+
}
|
|
312
|
+
async function updateJournalEntry(client, id, data) {
|
|
313
|
+
if (!id) throw new Error("id is required");
|
|
314
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries", idOrSubpath: String(id) });
|
|
315
|
+
return client.request("put", path, { data });
|
|
316
|
+
}
|
|
317
|
+
async function syncUpdateJournalEntries(client, data) {
|
|
318
|
+
const path = client.buildPath({ category: "accounting", subject: "journal-entries", idOrSubpath: "sync-update" });
|
|
319
|
+
return client.request("post", path, { data });
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// src/resources/accounting/payment-terms.ts
|
|
323
|
+
async function listPaymentTerms(client, params = {}) {
|
|
324
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-terms" });
|
|
325
|
+
return client.request("get", path, { params });
|
|
326
|
+
}
|
|
327
|
+
async function getAllPaymentTerms(client, params = {}, pageSize = 200) {
|
|
328
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-terms" });
|
|
329
|
+
return client.getAll(path, params, pageSize);
|
|
330
|
+
}
|
|
331
|
+
async function getPaymentTermModel(client) {
|
|
332
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-terms", idOrSubpath: "model" });
|
|
333
|
+
return client.request("get", path);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// src/resources/accounting/payment-types.ts
|
|
337
|
+
async function listPaymentTypes(client, params = {}) {
|
|
338
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-types" });
|
|
339
|
+
return client.request("get", path, { params });
|
|
340
|
+
}
|
|
341
|
+
async function getAllPaymentTypes(client, params = {}, pageSize = 200) {
|
|
342
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-types" });
|
|
343
|
+
return client.getAll(path, params, pageSize);
|
|
344
|
+
}
|
|
345
|
+
async function getPaymentType(client, id) {
|
|
346
|
+
if (!id) throw new Error("id is required");
|
|
347
|
+
const path = client.buildPath({ category: "accounting", subject: "payment-types", idOrSubpath: String(id) });
|
|
348
|
+
return client.request("get", path);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// src/resources/accounting/payments.ts
|
|
352
|
+
async function listPayments(client, params = {}) {
|
|
353
|
+
const path = client.buildPath({ category: "accounting", subject: "payments" });
|
|
354
|
+
return client.request("get", path, { params });
|
|
355
|
+
}
|
|
356
|
+
async function getAllPayments(client, params = {}, pageSize = 200) {
|
|
357
|
+
const path = client.buildPath({ category: "accounting", subject: "payments" });
|
|
358
|
+
return client.getAll(path, params, pageSize);
|
|
359
|
+
}
|
|
360
|
+
async function updatePaymentCustomFields(client, id, data) {
|
|
361
|
+
if (!id) throw new Error("id is required");
|
|
362
|
+
const path = client.buildPath({ category: "accounting", subject: "payments", idOrSubpath: `${id}/custom-fields` });
|
|
363
|
+
return client.request("post", path, { data });
|
|
364
|
+
}
|
|
365
|
+
async function getPaymentCustomFieldTypes(client) {
|
|
366
|
+
const path = client.buildPath({ category: "accounting", subject: "payments", idOrSubpath: "custom-field-types" });
|
|
367
|
+
return client.request("get", path);
|
|
368
|
+
}
|
|
369
|
+
async function updatePaymentStatus(client, id, data) {
|
|
370
|
+
if (!id) throw new Error("id is required");
|
|
371
|
+
const path = client.buildPath({ category: "accounting", subject: "payments", idOrSubpath: `${id}/status` });
|
|
372
|
+
return client.request("post", path, { data });
|
|
373
|
+
}
|
|
374
|
+
async function updatePayment(client, id, data) {
|
|
375
|
+
if (!id) throw new Error("id is required");
|
|
376
|
+
const path = client.buildPath({ category: "accounting", subject: "payments", idOrSubpath: String(id) });
|
|
377
|
+
return client.request("put", path, { data });
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// src/resources/accounting/tax-zones.ts
|
|
381
|
+
async function listTaxZones(client, params = {}) {
|
|
382
|
+
const path = client.buildPath({ category: "accounting", subject: "tax-zones" });
|
|
383
|
+
return client.request("get", path, { params });
|
|
384
|
+
}
|
|
385
|
+
async function getAllTaxZones(client, params = {}, pageSize = 200) {
|
|
386
|
+
const path = client.buildPath({ category: "accounting", subject: "tax-zones" });
|
|
387
|
+
return client.getAll(path, params, pageSize);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// src/resources/accounting/ap-credits.ts
|
|
391
|
+
async function listApCredits(client, params = {}) {
|
|
392
|
+
const path = client.buildPath({ category: "accounting", subject: "ap-credits" });
|
|
393
|
+
return client.request("get", path, { params });
|
|
394
|
+
}
|
|
395
|
+
async function markApCreditsAsExported(client, ids) {
|
|
396
|
+
if (!ids?.length) throw new Error("ids are required");
|
|
397
|
+
const path = client.buildPath({ category: "accounting", subject: "ap-credits", idOrSubpath: "mark-as-exported" });
|
|
398
|
+
return client.request("post", path, { data: { ids } });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// src/resources/accounting/ap-payments.ts
|
|
402
|
+
async function listApPayments(client, params = {}) {
|
|
403
|
+
const path = client.buildPath({ category: "accounting", subject: "ap-payments" });
|
|
404
|
+
return client.request("get", path, { params });
|
|
405
|
+
}
|
|
406
|
+
async function markApPaymentsAsExported(client, ids) {
|
|
407
|
+
if (!ids?.length) throw new Error("ids are required");
|
|
408
|
+
const path = client.buildPath({ category: "accounting", subject: "ap-payments", idOrSubpath: "mark-as-exported" });
|
|
409
|
+
return client.request("post", path, { data: { ids } });
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/resources/accounting/gl-accounts.ts
|
|
413
|
+
async function listGlAccounts(client, params = {}) {
|
|
414
|
+
const path = client.buildPath({ category: "accounting", subject: "gl-accounts" });
|
|
415
|
+
return client.request("get", path, { params });
|
|
416
|
+
}
|
|
417
|
+
async function getGlAccount(client, id) {
|
|
418
|
+
if (!id) throw new Error("id is required");
|
|
419
|
+
const path = client.buildPath({ category: "accounting", subject: "gl-accounts", idOrSubpath: String(id) });
|
|
420
|
+
return client.request("get", path);
|
|
421
|
+
}
|
|
422
|
+
async function createGlAccount(client, data) {
|
|
423
|
+
const path = client.buildPath({ category: "accounting", subject: "gl-accounts" });
|
|
424
|
+
return client.request("post", path, { data });
|
|
425
|
+
}
|
|
426
|
+
async function updateGlAccount(client, id, data) {
|
|
427
|
+
if (!id) throw new Error("id is required");
|
|
428
|
+
const path = client.buildPath({ category: "accounting", subject: "gl-accounts", idOrSubpath: String(id) });
|
|
429
|
+
return client.request("put", path, { data });
|
|
430
|
+
}
|
|
431
|
+
async function listGlAccountTypes(client) {
|
|
432
|
+
const path = client.buildPath({ category: "accounting", subject: "gl-account-types" });
|
|
433
|
+
return client.request("get", path);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// src/resources/crm/index.ts
|
|
437
|
+
var crm_exports = {};
|
|
438
|
+
__export(crm_exports, {
|
|
439
|
+
addTagsBulk: () => addTagsBulk,
|
|
440
|
+
createBooking: () => createBooking,
|
|
441
|
+
createBookingContact: () => createBookingContact,
|
|
442
|
+
createBookingProviderTag: () => createBookingProviderTag,
|
|
443
|
+
createContact: () => createContact,
|
|
444
|
+
createContactMethod: () => createContactMethod,
|
|
445
|
+
createContactRelationship: () => createContactRelationship,
|
|
446
|
+
createCustomer: () => createCustomer,
|
|
447
|
+
createCustomerContact: () => createCustomerContact,
|
|
448
|
+
createCustomerNote: () => createCustomerNote,
|
|
449
|
+
createCustomerTag: () => createCustomerTag,
|
|
450
|
+
createLead: () => createLead,
|
|
451
|
+
createLeadFollowUp: () => createLeadFollowUp,
|
|
452
|
+
createLeadNote: () => createLeadNote,
|
|
453
|
+
createLocation: () => createLocation,
|
|
454
|
+
createLocationContact: () => createLocationContact,
|
|
455
|
+
createLocationNote: () => createLocationNote,
|
|
456
|
+
createLocationTag: () => createLocationTag,
|
|
457
|
+
createProviderBooking: () => createProviderBooking,
|
|
458
|
+
createProviderBookingContact: () => createProviderBookingContact,
|
|
459
|
+
deleteBookingProviderTag: () => deleteBookingProviderTag,
|
|
460
|
+
deleteContact: () => deleteContact,
|
|
461
|
+
deleteContactMethod: () => deleteContactMethod,
|
|
462
|
+
deleteContactRelationship: () => deleteContactRelationship,
|
|
463
|
+
deleteCustomerContact: () => deleteCustomerContact,
|
|
464
|
+
deleteCustomerNote: () => deleteCustomerNote,
|
|
465
|
+
deleteCustomerTag: () => deleteCustomerTag,
|
|
466
|
+
deleteLocationContact: () => deleteLocationContact,
|
|
467
|
+
deleteLocationNote: () => deleteLocationNote,
|
|
468
|
+
deleteLocationTag: () => deleteLocationTag,
|
|
469
|
+
deleteProviderBookingContact: () => deleteProviderBookingContact,
|
|
470
|
+
dismissLead: () => dismissLead,
|
|
471
|
+
exportBookings: () => exportBookings,
|
|
472
|
+
exportCustomerContacts: () => exportCustomerContacts,
|
|
473
|
+
exportCustomers: () => exportCustomers,
|
|
474
|
+
exportLeads: () => exportLeads,
|
|
475
|
+
exportLocationContacts: () => exportLocationContacts,
|
|
476
|
+
exportLocations: () => exportLocations,
|
|
477
|
+
getBooking: () => getBooking,
|
|
478
|
+
getBookingContacts: () => getBookingContacts,
|
|
479
|
+
getBookingProviderTag: () => getBookingProviderTag,
|
|
480
|
+
getContact: () => getContact,
|
|
481
|
+
getContactByRelationshipId: () => getContactByRelationshipId,
|
|
482
|
+
getContactMethod: () => getContactMethod,
|
|
483
|
+
getContactMethodPreference: () => getContactMethodPreference,
|
|
484
|
+
getContactRelationshipList: () => getContactRelationshipList,
|
|
485
|
+
getContactsPreferenceMetadataList: () => getContactsPreferenceMetadataList,
|
|
486
|
+
getCustomer: () => getCustomer,
|
|
487
|
+
getCustomerContactList: () => getCustomerContactList,
|
|
488
|
+
getCustomerCustomFieldTypes: () => getCustomerCustomFieldTypes,
|
|
489
|
+
getCustomerNotes: () => getCustomerNotes,
|
|
490
|
+
getLead: () => getLead,
|
|
491
|
+
getLeadNotes: () => getLeadNotes,
|
|
492
|
+
getLocation: () => getLocation,
|
|
493
|
+
getLocationContactList: () => getLocationContactList,
|
|
494
|
+
getLocationCustomFieldTypes: () => getLocationCustomFieldTypes,
|
|
495
|
+
getLocationNotes: () => getLocationNotes,
|
|
496
|
+
getModifiedContactsList: () => getModifiedContactsList,
|
|
497
|
+
getProviderBooking: () => getProviderBooking,
|
|
498
|
+
getProviderBookingContact: () => getProviderBookingContact,
|
|
499
|
+
getProviderBookingContacts: () => getProviderBookingContacts,
|
|
500
|
+
listBookingProviderTags: () => listBookingProviderTags,
|
|
501
|
+
listBookings: () => listBookings,
|
|
502
|
+
listContactMethodPreferences: () => listContactMethodPreferences,
|
|
503
|
+
listContactMethods: () => listContactMethods,
|
|
504
|
+
listContacts: () => listContacts,
|
|
505
|
+
listCustomers: () => listCustomers,
|
|
506
|
+
listLeads: () => listLeads,
|
|
507
|
+
listLocations: () => listLocations,
|
|
508
|
+
listProviderBookings: () => listProviderBookings,
|
|
509
|
+
removeTagsBulk: () => removeTagsBulk,
|
|
510
|
+
replaceContact: () => replaceContact,
|
|
511
|
+
searchContactMethods: () => searchContactMethods,
|
|
512
|
+
submitLeadForm: () => submitLeadForm,
|
|
513
|
+
updateBooking: () => updateBooking,
|
|
514
|
+
updateBookingProviderTag: () => updateBookingProviderTag,
|
|
515
|
+
updateContact: () => updateContact,
|
|
516
|
+
updateContactMethod: () => updateContactMethod,
|
|
517
|
+
updateContactMethodPreference: () => updateContactMethodPreference,
|
|
518
|
+
updateCustomer: () => updateCustomer,
|
|
519
|
+
updateCustomerContact: () => updateCustomerContact,
|
|
520
|
+
updateLead: () => updateLead,
|
|
521
|
+
updateLocation: () => updateLocation,
|
|
522
|
+
updateLocationContact: () => updateLocationContact,
|
|
523
|
+
updateProviderBooking: () => updateProviderBooking,
|
|
524
|
+
updateProviderBookingContact: () => updateProviderBookingContact,
|
|
525
|
+
upsertContactMethod: () => upsertContactMethod
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// src/resources/crm/bulk-tags.ts
|
|
529
|
+
async function addTagsBulk(client, data) {
|
|
530
|
+
const path = client.buildPath({ category: "crm", subject: "bulk-tags", idOrSubpath: "add-tags" });
|
|
531
|
+
return client.request("post", path, { data });
|
|
532
|
+
}
|
|
533
|
+
async function removeTagsBulk(client, data) {
|
|
534
|
+
const path = client.buildPath({ category: "crm", subject: "bulk-tags", idOrSubpath: "remove-tags" });
|
|
535
|
+
return client.request("post", path, { data });
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// src/resources/crm/contact-methods.ts
|
|
539
|
+
async function listContactMethods(client, params = {}) {
|
|
540
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods" });
|
|
541
|
+
return client.request("get", path, { params });
|
|
542
|
+
}
|
|
543
|
+
async function createContactMethod(client, data) {
|
|
544
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods" });
|
|
545
|
+
return client.request("post", path, { data });
|
|
546
|
+
}
|
|
547
|
+
async function updateContactMethod(client, id, data) {
|
|
548
|
+
if (!id) throw new Error("id is required");
|
|
549
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods", idOrSubpath: String(id) });
|
|
550
|
+
return client.request("put", path, { data });
|
|
551
|
+
}
|
|
552
|
+
async function upsertContactMethod(client, data) {
|
|
553
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods", idOrSubpath: "upsert" });
|
|
554
|
+
return client.request("post", path, { data });
|
|
555
|
+
}
|
|
556
|
+
async function getContactMethod(client, id) {
|
|
557
|
+
if (!id) throw new Error("id is required");
|
|
558
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods", idOrSubpath: String(id) });
|
|
559
|
+
return client.request("get", path);
|
|
560
|
+
}
|
|
561
|
+
async function deleteContactMethod(client, id) {
|
|
562
|
+
if (!id) throw new Error("id is required");
|
|
563
|
+
const path = client.buildPath({ category: "crm", subject: "contact-methods", idOrSubpath: String(id) });
|
|
564
|
+
return client.request("delete", path);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// src/resources/crm/contact-preferences.ts
|
|
568
|
+
async function listContactMethodPreferences(client, params = {}) {
|
|
569
|
+
const path = client.buildPath({ category: "crm", subject: "contact-preferences" });
|
|
570
|
+
return client.request("get", path, { params });
|
|
571
|
+
}
|
|
572
|
+
async function getContactMethodPreference(client, id) {
|
|
573
|
+
if (!id) throw new Error("id is required");
|
|
574
|
+
const path = client.buildPath({ category: "crm", subject: "contact-preferences", idOrSubpath: String(id) });
|
|
575
|
+
return client.request("get", path);
|
|
576
|
+
}
|
|
577
|
+
async function updateContactMethodPreference(client, id, data) {
|
|
578
|
+
if (!id) throw new Error("id is required");
|
|
579
|
+
const path = client.buildPath({ category: "crm", subject: "contact-preferences", idOrSubpath: String(id) });
|
|
580
|
+
return client.request("put", path, { data });
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// src/resources/crm/contacts.ts
|
|
584
|
+
async function listContacts(client, params = {}) {
|
|
585
|
+
const path = client.buildPath({ category: "crm", subject: "contacts" });
|
|
586
|
+
return client.request("get", path, { params });
|
|
587
|
+
}
|
|
588
|
+
async function createContact(client, data) {
|
|
589
|
+
const path = client.buildPath({ category: "crm", subject: "contacts" });
|
|
590
|
+
return client.request("post", path, { data });
|
|
591
|
+
}
|
|
592
|
+
async function updateContact(client, id, data) {
|
|
593
|
+
if (!id) throw new Error("id is required");
|
|
594
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: String(id) });
|
|
595
|
+
return client.request("patch", path, { data });
|
|
596
|
+
}
|
|
597
|
+
async function replaceContact(client, id, data) {
|
|
598
|
+
if (!id) throw new Error("id is required");
|
|
599
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: String(id) });
|
|
600
|
+
return client.request("put", path, { data });
|
|
601
|
+
}
|
|
602
|
+
async function getContact(client, id) {
|
|
603
|
+
if (!id) throw new Error("id is required");
|
|
604
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: String(id) });
|
|
605
|
+
return client.request("get", path);
|
|
606
|
+
}
|
|
607
|
+
async function deleteContact(client, id) {
|
|
608
|
+
if (!id) throw new Error("id is required");
|
|
609
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: String(id) });
|
|
610
|
+
return client.request("delete", path);
|
|
611
|
+
}
|
|
612
|
+
async function searchContactMethods(client, params = {}) {
|
|
613
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: "contact-methods:search" });
|
|
614
|
+
return client.request("get", path, { params });
|
|
615
|
+
}
|
|
616
|
+
async function getContactsPreferenceMetadataList(client) {
|
|
617
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: "preference-metadata" });
|
|
618
|
+
return client.request("get", path);
|
|
619
|
+
}
|
|
620
|
+
async function getContactByRelationshipId(client, relationshipId) {
|
|
621
|
+
if (!relationshipId) throw new Error("relationshipId is required");
|
|
622
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: `relationships/${relationshipId}` });
|
|
623
|
+
return client.request("get", path);
|
|
624
|
+
}
|
|
625
|
+
async function getContactRelationshipList(client, id) {
|
|
626
|
+
if (!id) throw new Error("id is required");
|
|
627
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: `${id}/relationships` });
|
|
628
|
+
return client.request("get", path);
|
|
629
|
+
}
|
|
630
|
+
async function deleteContactRelationship(client, id, relationshipId) {
|
|
631
|
+
if (!id || !relationshipId) throw new Error("id and relationshipId are required");
|
|
632
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: `${id}/relationships/${relationshipId}` });
|
|
633
|
+
return client.request("delete", path);
|
|
634
|
+
}
|
|
635
|
+
async function createContactRelationship(client, id, data) {
|
|
636
|
+
if (!id) throw new Error("id is required");
|
|
637
|
+
const path = client.buildPath({ category: "crm", subject: "contacts", idOrSubpath: `${id}/relationships` });
|
|
638
|
+
return client.request("post", path, { data });
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// src/resources/crm/customers.ts
|
|
642
|
+
async function listCustomers(client, params = {}) {
|
|
643
|
+
const path = client.buildPath({ category: "crm", subject: "customers" });
|
|
644
|
+
return client.request("get", path, { params });
|
|
645
|
+
}
|
|
646
|
+
async function createCustomer(client, data) {
|
|
647
|
+
const path = client.buildPath({ category: "crm", subject: "customers" });
|
|
648
|
+
return client.request("post", path, { data });
|
|
649
|
+
}
|
|
650
|
+
async function updateCustomer(client, id, data) {
|
|
651
|
+
if (!id) throw new Error("id is required");
|
|
652
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: String(id) });
|
|
653
|
+
return client.request("patch", path, { data });
|
|
654
|
+
}
|
|
655
|
+
async function getCustomer(client, id) {
|
|
656
|
+
if (!id) throw new Error("id is required");
|
|
657
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: String(id) });
|
|
658
|
+
return client.request("get", path);
|
|
659
|
+
}
|
|
660
|
+
async function getModifiedContactsList(client, id) {
|
|
661
|
+
if (!id) throw new Error("id is required");
|
|
662
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/modified-contacts` });
|
|
663
|
+
return client.request("get", path);
|
|
664
|
+
}
|
|
665
|
+
async function getCustomerCustomFieldTypes(client) {
|
|
666
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: "custom-field-types" });
|
|
667
|
+
return client.request("get", path);
|
|
668
|
+
}
|
|
669
|
+
async function getCustomerContactList(client, id) {
|
|
670
|
+
if (!id) throw new Error("id is required");
|
|
671
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/contacts` });
|
|
672
|
+
return client.request("get", path);
|
|
673
|
+
}
|
|
674
|
+
async function createCustomerContact(client, id, data) {
|
|
675
|
+
if (!id) throw new Error("id is required");
|
|
676
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/contacts` });
|
|
677
|
+
return client.request("post", path, { data });
|
|
678
|
+
}
|
|
679
|
+
async function updateCustomerContact(client, id, contactId, data) {
|
|
680
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
681
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/contacts/${contactId}` });
|
|
682
|
+
return client.request("put", path, { data });
|
|
683
|
+
}
|
|
684
|
+
async function deleteCustomerContact(client, id, contactId) {
|
|
685
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
686
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/contacts/${contactId}` });
|
|
687
|
+
return client.request("delete", path);
|
|
688
|
+
}
|
|
689
|
+
async function getCustomerNotes(client, id) {
|
|
690
|
+
if (!id) throw new Error("id is required");
|
|
691
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/notes` });
|
|
692
|
+
return client.request("get", path);
|
|
693
|
+
}
|
|
694
|
+
async function createCustomerNote(client, id, data) {
|
|
695
|
+
if (!id) throw new Error("id is required");
|
|
696
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/notes` });
|
|
697
|
+
return client.request("post", path, { data });
|
|
698
|
+
}
|
|
699
|
+
async function deleteCustomerNote(client, id, noteId) {
|
|
700
|
+
if (!id || !noteId) throw new Error("id and noteId are required");
|
|
701
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/notes/${noteId}` });
|
|
702
|
+
return client.request("delete", path);
|
|
703
|
+
}
|
|
704
|
+
async function createCustomerTag(client, id, tagId) {
|
|
705
|
+
if (!id || !tagId) throw new Error("id and tagId are required");
|
|
706
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/tags/${tagId}` });
|
|
707
|
+
return client.request("post", path);
|
|
708
|
+
}
|
|
709
|
+
async function deleteCustomerTag(client, id, tagId) {
|
|
710
|
+
if (!id || !tagId) throw new Error("id and tagId are required");
|
|
711
|
+
const path = client.buildPath({ category: "crm", subject: "customers", idOrSubpath: `${id}/tags/${tagId}` });
|
|
712
|
+
return client.request("delete", path);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// src/resources/crm/leads.ts
|
|
716
|
+
async function listLeads(client, params = {}) {
|
|
717
|
+
const path = client.buildPath({ category: "crm", subject: "leads" });
|
|
718
|
+
return client.request("get", path, { params });
|
|
719
|
+
}
|
|
720
|
+
async function createLead(client, data) {
|
|
721
|
+
const path = client.buildPath({ category: "crm", subject: "leads" });
|
|
722
|
+
return client.request("post", path, { data });
|
|
723
|
+
}
|
|
724
|
+
async function submitLeadForm(client, data) {
|
|
725
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: "submit" });
|
|
726
|
+
return client.request("post", path, { data });
|
|
727
|
+
}
|
|
728
|
+
async function updateLead(client, id, data) {
|
|
729
|
+
if (!id) throw new Error("id is required");
|
|
730
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: String(id) });
|
|
731
|
+
return client.request("patch", path, { data });
|
|
732
|
+
}
|
|
733
|
+
async function getLead(client, id) {
|
|
734
|
+
if (!id) throw new Error("id is required");
|
|
735
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: String(id) });
|
|
736
|
+
return client.request("get", path);
|
|
737
|
+
}
|
|
738
|
+
async function dismissLead(client, id, data = {}) {
|
|
739
|
+
if (!id) throw new Error("id is required");
|
|
740
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: `${id}/dismiss` });
|
|
741
|
+
return client.request("post", path, { data });
|
|
742
|
+
}
|
|
743
|
+
async function createLeadFollowUp(client, id, data) {
|
|
744
|
+
if (!id) throw new Error("id is required");
|
|
745
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: `${id}/follow-ups` });
|
|
746
|
+
return client.request("post", path, { data });
|
|
747
|
+
}
|
|
748
|
+
async function getLeadNotes(client, id) {
|
|
749
|
+
if (!id) throw new Error("id is required");
|
|
750
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: `${id}/notes` });
|
|
751
|
+
return client.request("get", path);
|
|
752
|
+
}
|
|
753
|
+
async function createLeadNote(client, id, data) {
|
|
754
|
+
if (!id) throw new Error("id is required");
|
|
755
|
+
const path = client.buildPath({ category: "crm", subject: "leads", idOrSubpath: `${id}/notes` });
|
|
756
|
+
return client.request("post", path, { data });
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// src/resources/crm/locations.ts
|
|
760
|
+
async function listLocations(client, params = {}) {
|
|
761
|
+
const path = client.buildPath({ category: "crm", subject: "locations" });
|
|
762
|
+
return client.request("get", path, { params });
|
|
763
|
+
}
|
|
764
|
+
async function createLocation(client, data) {
|
|
765
|
+
const path = client.buildPath({ category: "crm", subject: "locations" });
|
|
766
|
+
return client.request("post", path, { data });
|
|
767
|
+
}
|
|
768
|
+
async function updateLocation(client, id, data) {
|
|
769
|
+
if (!id) throw new Error("id is required");
|
|
770
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: String(id) });
|
|
771
|
+
return client.request("patch", path, { data });
|
|
772
|
+
}
|
|
773
|
+
async function getLocation(client, id) {
|
|
774
|
+
if (!id) throw new Error("id is required");
|
|
775
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: String(id) });
|
|
776
|
+
return client.request("get", path);
|
|
777
|
+
}
|
|
778
|
+
async function getLocationContactList(client, id) {
|
|
779
|
+
if (!id) throw new Error("id is required");
|
|
780
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/contacts` });
|
|
781
|
+
return client.request("get", path);
|
|
782
|
+
}
|
|
783
|
+
async function createLocationContact(client, id, data) {
|
|
784
|
+
if (!id) throw new Error("id is required");
|
|
785
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/contacts` });
|
|
786
|
+
return client.request("post", path, { data });
|
|
787
|
+
}
|
|
788
|
+
async function updateLocationContact(client, id, contactId, data) {
|
|
789
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
790
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/contacts/${contactId}` });
|
|
791
|
+
return client.request("put", path, { data });
|
|
792
|
+
}
|
|
793
|
+
async function deleteLocationContact(client, id, contactId) {
|
|
794
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
795
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/contacts/${contactId}` });
|
|
796
|
+
return client.request("delete", path);
|
|
797
|
+
}
|
|
798
|
+
async function getLocationCustomFieldTypes(client) {
|
|
799
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: "custom-field-types" });
|
|
800
|
+
return client.request("get", path);
|
|
801
|
+
}
|
|
802
|
+
async function getLocationNotes(client, id) {
|
|
803
|
+
if (!id) throw new Error("id is required");
|
|
804
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/notes` });
|
|
805
|
+
return client.request("get", path);
|
|
806
|
+
}
|
|
807
|
+
async function createLocationNote(client, id, data) {
|
|
808
|
+
if (!id) throw new Error("id is required");
|
|
809
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/notes` });
|
|
810
|
+
return client.request("post", path, { data });
|
|
811
|
+
}
|
|
812
|
+
async function deleteLocationNote(client, id, noteId) {
|
|
813
|
+
if (!id || !noteId) throw new Error("id and noteId are required");
|
|
814
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/notes/${noteId}` });
|
|
815
|
+
return client.request("delete", path);
|
|
816
|
+
}
|
|
817
|
+
async function createLocationTag(client, id, tagId) {
|
|
818
|
+
if (!id || !tagId) throw new Error("id and tagId are required");
|
|
819
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/tags/${tagId}` });
|
|
820
|
+
return client.request("post", path);
|
|
821
|
+
}
|
|
822
|
+
async function deleteLocationTag(client, id, tagId) {
|
|
823
|
+
if (!id || !tagId) throw new Error("id and tagId are required");
|
|
824
|
+
const path = client.buildPath({ category: "crm", subject: "locations", idOrSubpath: `${id}/tags/${tagId}` });
|
|
825
|
+
return client.request("delete", path);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// src/resources/crm/export.ts
|
|
829
|
+
async function exportBookings(client, params = {}) {
|
|
830
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "bookings" });
|
|
831
|
+
return client.request("get", path, { params });
|
|
832
|
+
}
|
|
833
|
+
async function exportCustomers(client, params = {}) {
|
|
834
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "customers" });
|
|
835
|
+
return client.request("get", path, { params });
|
|
836
|
+
}
|
|
837
|
+
async function exportCustomerContacts(client, params = {}) {
|
|
838
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "customers/contacts" });
|
|
839
|
+
return client.request("get", path, { params });
|
|
840
|
+
}
|
|
841
|
+
async function exportLeads(client, params = {}) {
|
|
842
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "leads" });
|
|
843
|
+
return client.request("get", path, { params });
|
|
844
|
+
}
|
|
845
|
+
async function exportLocations(client, params = {}) {
|
|
846
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "locations" });
|
|
847
|
+
return client.request("get", path, { params });
|
|
848
|
+
}
|
|
849
|
+
async function exportLocationContacts(client, params = {}) {
|
|
850
|
+
const path = client.buildPath({ category: "crm", subject: "export", idOrSubpath: "locations/contacts" });
|
|
851
|
+
return client.request("get", path, { params });
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// src/resources/crm/booking-provider-tags.ts
|
|
855
|
+
async function listBookingProviderTags(client, params = {}) {
|
|
856
|
+
const path = client.buildPath({ category: "crm", subject: "booking-provider-tags" });
|
|
857
|
+
return client.request("get", path, { params });
|
|
858
|
+
}
|
|
859
|
+
async function createBookingProviderTag(client, data) {
|
|
860
|
+
const path = client.buildPath({ category: "crm", subject: "booking-provider-tags" });
|
|
861
|
+
return client.request("post", path, { data });
|
|
862
|
+
}
|
|
863
|
+
async function getBookingProviderTag(client, id) {
|
|
864
|
+
if (!id) throw new Error("id is required");
|
|
865
|
+
const path = client.buildPath({ category: "crm", subject: "booking-provider-tags", idOrSubpath: String(id) });
|
|
866
|
+
return client.request("get", path);
|
|
867
|
+
}
|
|
868
|
+
async function updateBookingProviderTag(client, id, data) {
|
|
869
|
+
if (!id) throw new Error("id is required");
|
|
870
|
+
const path = client.buildPath({ category: "crm", subject: "booking-provider-tags", idOrSubpath: String(id) });
|
|
871
|
+
return client.request("patch", path, { data });
|
|
872
|
+
}
|
|
873
|
+
async function deleteBookingProviderTag(client, id) {
|
|
874
|
+
if (!id) throw new Error("id is required");
|
|
875
|
+
const path = client.buildPath({ category: "crm", subject: "booking-provider-tags", idOrSubpath: String(id) });
|
|
876
|
+
return client.request("delete", path);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// src/resources/crm/bookings.ts
|
|
880
|
+
async function listBookings(client, params = {}) {
|
|
881
|
+
const path = client.buildPath({ category: "crm", subject: "bookings" });
|
|
882
|
+
return client.request("get", path, { params });
|
|
883
|
+
}
|
|
884
|
+
async function createBooking(client, data) {
|
|
885
|
+
const path = client.buildPath({ category: "crm", subject: "bookings" });
|
|
886
|
+
return client.request("post", path, { data });
|
|
887
|
+
}
|
|
888
|
+
async function getBooking(client, id) {
|
|
889
|
+
if (!id) throw new Error("id is required");
|
|
890
|
+
const path = client.buildPath({ category: "crm", subject: "bookings", idOrSubpath: String(id) });
|
|
891
|
+
return client.request("get", path);
|
|
892
|
+
}
|
|
893
|
+
async function updateBooking(client, id, data) {
|
|
894
|
+
if (!id) throw new Error("id is required");
|
|
895
|
+
const path = client.buildPath({ category: "crm", subject: "bookings", idOrSubpath: String(id) });
|
|
896
|
+
return client.request("patch", path, { data });
|
|
897
|
+
}
|
|
898
|
+
async function getBookingContacts(client, id, params = {}) {
|
|
899
|
+
if (!id) throw new Error("id is required");
|
|
900
|
+
const path = client.buildPath({ category: "crm", subject: "bookings", idOrSubpath: `${id}/contacts` });
|
|
901
|
+
return client.request("get", path, { params });
|
|
902
|
+
}
|
|
903
|
+
async function createBookingContact(client, id, data) {
|
|
904
|
+
if (!id) throw new Error("id is required");
|
|
905
|
+
const path = client.buildPath({ category: "crm", subject: "bookings", idOrSubpath: `${id}/contacts` });
|
|
906
|
+
return client.request("post", path, { data });
|
|
907
|
+
}
|
|
908
|
+
function buildProviderPath(client, provider, idOrSubpath) {
|
|
909
|
+
const sub = idOrSubpath ? `/${String(idOrSubpath).replace(/^\/+/, "")}` : "";
|
|
910
|
+
return client.buildPath({ category: "crm", subject: `${provider}/bookings${sub}`, tenantScoped: false });
|
|
911
|
+
}
|
|
912
|
+
async function listProviderBookings(client, provider, params = {}) {
|
|
913
|
+
const path = buildProviderPath(client, provider);
|
|
914
|
+
return client.request("get", path, { params });
|
|
915
|
+
}
|
|
916
|
+
async function createProviderBooking(client, provider, data) {
|
|
917
|
+
const path = buildProviderPath(client, provider);
|
|
918
|
+
return client.request("post", path, { data });
|
|
919
|
+
}
|
|
920
|
+
async function getProviderBooking(client, provider, id) {
|
|
921
|
+
if (!id) throw new Error("id is required");
|
|
922
|
+
const path = buildProviderPath(client, provider, String(id));
|
|
923
|
+
return client.request("get", path);
|
|
924
|
+
}
|
|
925
|
+
async function updateProviderBooking(client, provider, id, data) {
|
|
926
|
+
if (!id) throw new Error("id is required");
|
|
927
|
+
const path = buildProviderPath(client, provider, String(id));
|
|
928
|
+
return client.request("patch", path, { data });
|
|
929
|
+
}
|
|
930
|
+
async function getProviderBookingContacts(client, provider, id, params = {}) {
|
|
931
|
+
if (!id) throw new Error("id is required");
|
|
932
|
+
const path = buildProviderPath(client, provider, `${id}/contacts`);
|
|
933
|
+
return client.request("get", path, { params });
|
|
934
|
+
}
|
|
935
|
+
async function createProviderBookingContact(client, provider, id, data) {
|
|
936
|
+
if (!id) throw new Error("id is required");
|
|
937
|
+
const path = buildProviderPath(client, provider, `${id}/contacts`);
|
|
938
|
+
return client.request("post", path, { data });
|
|
939
|
+
}
|
|
940
|
+
async function getProviderBookingContact(client, provider, id, contactId) {
|
|
941
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
942
|
+
const path = buildProviderPath(client, provider, `${id}/contacts/${contactId}`);
|
|
943
|
+
return client.request("get", path);
|
|
944
|
+
}
|
|
945
|
+
async function updateProviderBookingContact(client, provider, id, contactId, data) {
|
|
946
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
947
|
+
const path = buildProviderPath(client, provider, `${id}/contacts/${contactId}`);
|
|
948
|
+
return client.request("patch", path, { data });
|
|
949
|
+
}
|
|
950
|
+
async function deleteProviderBookingContact(client, provider, id, contactId) {
|
|
951
|
+
if (!id || !contactId) throw new Error("id and contactId are required");
|
|
952
|
+
const path = buildProviderPath(client, provider, `${id}/contacts/${contactId}`);
|
|
953
|
+
return client.request("delete", path);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// src/resources/dispatch/index.ts
|
|
957
|
+
var dispatch_exports = {};
|
|
958
|
+
__export(dispatch_exports, {
|
|
959
|
+
activateArrivalWindow: () => activateArrivalWindow,
|
|
960
|
+
assignTechnicians: () => assignTechnicians,
|
|
961
|
+
bulkDeleteTechnicianShifts: () => bulkDeleteTechnicianShifts,
|
|
962
|
+
createArrivalWindow: () => createArrivalWindow,
|
|
963
|
+
createBusinessHour: () => createBusinessHour,
|
|
964
|
+
createGpsPing: () => createGpsPing,
|
|
965
|
+
createNonJobAppointment: () => createNonJobAppointment,
|
|
966
|
+
createTeam: () => createTeam,
|
|
967
|
+
createTechnicianShift: () => createTechnicianShift,
|
|
968
|
+
createZone: () => createZone,
|
|
969
|
+
deleteNonJobAppointment: () => deleteNonJobAppointment,
|
|
970
|
+
deleteTechnicianShift: () => deleteTechnicianShift,
|
|
971
|
+
deleteZone: () => deleteZone,
|
|
972
|
+
exportAppointmentAssignments: () => exportAppointmentAssignments,
|
|
973
|
+
getArrivalWindow: () => getArrivalWindow,
|
|
974
|
+
getArrivalWindowsConfiguration: () => getArrivalWindowsConfiguration,
|
|
975
|
+
getCapacity: () => getCapacity,
|
|
976
|
+
getNonJobAppointment: () => getNonJobAppointment,
|
|
977
|
+
getTeam: () => getTeam,
|
|
978
|
+
getTechnicianShift: () => getTechnicianShift,
|
|
979
|
+
getTechnicianTracking: () => getTechnicianTracking,
|
|
980
|
+
getZone: () => getZone,
|
|
981
|
+
listAppointmentAssignments: () => listAppointmentAssignments,
|
|
982
|
+
listArrivalWindows: () => listArrivalWindows,
|
|
983
|
+
listBusinessHours: () => listBusinessHours,
|
|
984
|
+
listGpsPings: () => listGpsPings,
|
|
985
|
+
listNonJobAppointments: () => listNonJobAppointments,
|
|
986
|
+
listTeams: () => listTeams,
|
|
987
|
+
listTechnicianShifts: () => listTechnicianShifts,
|
|
988
|
+
listZones: () => listZones,
|
|
989
|
+
unassignTechnicians: () => unassignTechnicians,
|
|
990
|
+
updateArrivalWindow: () => updateArrivalWindow,
|
|
991
|
+
updateArrivalWindowsConfiguration: () => updateArrivalWindowsConfiguration,
|
|
992
|
+
updateNonJobAppointment: () => updateNonJobAppointment,
|
|
993
|
+
updateTeam: () => updateTeam,
|
|
994
|
+
updateTechnicianShift: () => updateTechnicianShift,
|
|
995
|
+
updateZone: () => updateZone
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
// src/resources/dispatch/export.ts
|
|
999
|
+
async function exportAppointmentAssignments(client, params = {}) {
|
|
1000
|
+
const path = client.buildPath({ category: "dispatch", subject: "export", idOrSubpath: "appointment-assignments" });
|
|
1001
|
+
return client.request("get", path, { params });
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// src/resources/dispatch/appointment-assignments.ts
|
|
1005
|
+
async function listAppointmentAssignments(client, params = {}) {
|
|
1006
|
+
const path = client.buildPath({ category: "dispatch", subject: "appointment-assignments" });
|
|
1007
|
+
return client.request("get", path, { params });
|
|
1008
|
+
}
|
|
1009
|
+
async function assignTechnicians(client, data) {
|
|
1010
|
+
const path = client.buildPath({ category: "dispatch", subject: "appointment-assignments", idOrSubpath: "assign-technicians" });
|
|
1011
|
+
return client.request("post", path, { data });
|
|
1012
|
+
}
|
|
1013
|
+
async function unassignTechnicians(client, data) {
|
|
1014
|
+
const path = client.buildPath({ category: "dispatch", subject: "appointment-assignments", idOrSubpath: "unassign-technicians" });
|
|
1015
|
+
return client.request("post", path, { data });
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// src/resources/dispatch/arrival-windows.ts
|
|
1019
|
+
async function listArrivalWindows(client, params = {}) {
|
|
1020
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows" });
|
|
1021
|
+
return client.request("get", path, { params });
|
|
1022
|
+
}
|
|
1023
|
+
async function createArrivalWindow(client, data) {
|
|
1024
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows" });
|
|
1025
|
+
return client.request("post", path, { data });
|
|
1026
|
+
}
|
|
1027
|
+
async function getArrivalWindow(client, id) {
|
|
1028
|
+
if (!id) throw new Error("id is required");
|
|
1029
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows", idOrSubpath: String(id) });
|
|
1030
|
+
return client.request("get", path);
|
|
1031
|
+
}
|
|
1032
|
+
async function updateArrivalWindow(client, id, data) {
|
|
1033
|
+
if (!id) throw new Error("id is required");
|
|
1034
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows", idOrSubpath: String(id) });
|
|
1035
|
+
return client.request("patch", path, { data });
|
|
1036
|
+
}
|
|
1037
|
+
async function getArrivalWindowsConfiguration(client) {
|
|
1038
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows", idOrSubpath: "configuration" });
|
|
1039
|
+
return client.request("get", path);
|
|
1040
|
+
}
|
|
1041
|
+
async function updateArrivalWindowsConfiguration(client, data) {
|
|
1042
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows", idOrSubpath: "configuration" });
|
|
1043
|
+
return client.request("put", path, { data });
|
|
1044
|
+
}
|
|
1045
|
+
async function activateArrivalWindow(client, id) {
|
|
1046
|
+
if (!id) throw new Error("id is required");
|
|
1047
|
+
const path = client.buildPath({ category: "dispatch", subject: "arrival-windows", idOrSubpath: `${id}/activated` });
|
|
1048
|
+
return client.request("post", path);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
// src/resources/dispatch/business-hours.ts
|
|
1052
|
+
async function listBusinessHours(client, params = {}) {
|
|
1053
|
+
const path = client.buildPath({ category: "dispatch", subject: "business-hours" });
|
|
1054
|
+
return client.request("get", path, { params });
|
|
1055
|
+
}
|
|
1056
|
+
async function createBusinessHour(client, data) {
|
|
1057
|
+
const path = client.buildPath({ category: "dispatch", subject: "business-hours" });
|
|
1058
|
+
return client.request("post", path, { data });
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// src/resources/dispatch/capacity.ts
|
|
1062
|
+
async function getCapacity(client, params = {}) {
|
|
1063
|
+
const path = client.buildPath({ category: "dispatch", subject: "capacity" });
|
|
1064
|
+
return client.request("get", path, { params });
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// src/resources/dispatch/gps.ts
|
|
1068
|
+
function buildGpsProviderPath(client, provider) {
|
|
1069
|
+
return client.buildPath({ category: "dispatch", subject: `${provider}/gps-pings`, tenantScoped: false });
|
|
1070
|
+
}
|
|
1071
|
+
async function listGpsPings(client, provider, params = {}) {
|
|
1072
|
+
const path = buildGpsProviderPath(client, provider);
|
|
1073
|
+
return client.request("get", path, { params });
|
|
1074
|
+
}
|
|
1075
|
+
async function createGpsPing(client, provider, data) {
|
|
1076
|
+
const path = buildGpsProviderPath(client, provider);
|
|
1077
|
+
return client.request("post", path, { data });
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// src/resources/dispatch/non-job-appointments.ts
|
|
1081
|
+
async function listNonJobAppointments(client, params = {}) {
|
|
1082
|
+
const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments" });
|
|
1083
|
+
return client.request("get", path, { params });
|
|
1084
|
+
}
|
|
1085
|
+
async function createNonJobAppointment(client, data) {
|
|
1086
|
+
const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments" });
|
|
1087
|
+
return client.request("post", path, { data });
|
|
1088
|
+
}
|
|
1089
|
+
async function getNonJobAppointment(client, id) {
|
|
1090
|
+
if (!id) throw new Error("id is required");
|
|
1091
|
+
const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments", idOrSubpath: String(id) });
|
|
1092
|
+
return client.request("get", path);
|
|
1093
|
+
}
|
|
1094
|
+
async function updateNonJobAppointment(client, id, data) {
|
|
1095
|
+
if (!id) throw new Error("id is required");
|
|
1096
|
+
const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments", idOrSubpath: String(id) });
|
|
1097
|
+
return client.request("patch", path, { data });
|
|
1098
|
+
}
|
|
1099
|
+
async function deleteNonJobAppointment(client, id) {
|
|
1100
|
+
if (!id) throw new Error("id is required");
|
|
1101
|
+
const path = client.buildPath({ category: "dispatch", subject: "non-job-appointments", idOrSubpath: String(id) });
|
|
1102
|
+
return client.request("delete", path);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// src/resources/dispatch/teams.ts
|
|
1106
|
+
async function listTeams(client, params = {}) {
|
|
1107
|
+
const path = client.buildPath({ category: "dispatch", subject: "teams" });
|
|
1108
|
+
return client.request("get", path, { params });
|
|
1109
|
+
}
|
|
1110
|
+
async function createTeam(client, data) {
|
|
1111
|
+
const path = client.buildPath({ category: "dispatch", subject: "teams" });
|
|
1112
|
+
return client.request("post", path, { data });
|
|
1113
|
+
}
|
|
1114
|
+
async function getTeam(client, id) {
|
|
1115
|
+
if (!id) throw new Error("id is required");
|
|
1116
|
+
const path = client.buildPath({ category: "dispatch", subject: "teams", idOrSubpath: String(id) });
|
|
1117
|
+
return client.request("get", path);
|
|
1118
|
+
}
|
|
1119
|
+
async function updateTeam(client, id, data) {
|
|
1120
|
+
if (!id) throw new Error("id is required");
|
|
1121
|
+
const path = client.buildPath({ category: "dispatch", subject: "teams", idOrSubpath: String(id) });
|
|
1122
|
+
return client.request("patch", path, { data });
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// src/resources/dispatch/technician-shifts.ts
|
|
1126
|
+
async function listTechnicianShifts(client, params = {}) {
|
|
1127
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts" });
|
|
1128
|
+
return client.request("get", path, { params });
|
|
1129
|
+
}
|
|
1130
|
+
async function createTechnicianShift(client, data) {
|
|
1131
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts" });
|
|
1132
|
+
return client.request("post", path, { data });
|
|
1133
|
+
}
|
|
1134
|
+
async function bulkDeleteTechnicianShifts(client, data) {
|
|
1135
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts", idOrSubpath: "bulk-delete" });
|
|
1136
|
+
return client.request("post", path, { data });
|
|
1137
|
+
}
|
|
1138
|
+
async function getTechnicianShift(client, id) {
|
|
1139
|
+
if (!id) throw new Error("id is required");
|
|
1140
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts", idOrSubpath: String(id) });
|
|
1141
|
+
return client.request("get", path);
|
|
1142
|
+
}
|
|
1143
|
+
async function updateTechnicianShift(client, id, data) {
|
|
1144
|
+
if (!id) throw new Error("id is required");
|
|
1145
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts", idOrSubpath: String(id) });
|
|
1146
|
+
return client.request("patch", path, { data });
|
|
1147
|
+
}
|
|
1148
|
+
async function deleteTechnicianShift(client, id) {
|
|
1149
|
+
if (!id) throw new Error("id is required");
|
|
1150
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-shifts", idOrSubpath: String(id) });
|
|
1151
|
+
return client.request("delete", path);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// src/resources/dispatch/technician-tracking.ts
|
|
1155
|
+
async function getTechnicianTracking(client, params) {
|
|
1156
|
+
const path = client.buildPath({ category: "dispatch", subject: "technician-tracking" });
|
|
1157
|
+
return client.request("get", path, { params });
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
// src/resources/dispatch/zones.ts
|
|
1161
|
+
async function listZones(client, params = {}) {
|
|
1162
|
+
const path = client.buildPath({ category: "dispatch", subject: "zones" });
|
|
1163
|
+
return client.request("get", path, { params });
|
|
1164
|
+
}
|
|
1165
|
+
async function createZone(client, data) {
|
|
1166
|
+
const path = client.buildPath({ category: "dispatch", subject: "zones" });
|
|
1167
|
+
return client.request("post", path, { data });
|
|
1168
|
+
}
|
|
1169
|
+
async function getZone(client, id) {
|
|
1170
|
+
if (!id) throw new Error("id is required");
|
|
1171
|
+
const path = client.buildPath({ category: "dispatch", subject: "zones", idOrSubpath: String(id) });
|
|
1172
|
+
return client.request("get", path);
|
|
1173
|
+
}
|
|
1174
|
+
async function updateZone(client, id, data) {
|
|
1175
|
+
if (!id) throw new Error("id is required");
|
|
1176
|
+
const path = client.buildPath({ category: "dispatch", subject: "zones", idOrSubpath: String(id) });
|
|
1177
|
+
return client.request("patch", path, { data });
|
|
1178
|
+
}
|
|
1179
|
+
async function deleteZone(client, id) {
|
|
1180
|
+
if (!id) throw new Error("id is required");
|
|
1181
|
+
const path = client.buildPath({ category: "dispatch", subject: "zones", idOrSubpath: String(id) });
|
|
1182
|
+
return client.request("delete", path);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// src/resources/equipment-systems/index.ts
|
|
1186
|
+
var equipment_systems_exports = {};
|
|
1187
|
+
__export(equipment_systems_exports, {
|
|
1188
|
+
createInstalledEquipment: () => createInstalledEquipment,
|
|
1189
|
+
createInstalledEquipmentAttachment: () => createInstalledEquipmentAttachment,
|
|
1190
|
+
exportInstalledEquipment: () => exportInstalledEquipment,
|
|
1191
|
+
getInstalledEquipment: () => getInstalledEquipment,
|
|
1192
|
+
listInstalledEquipment: () => listInstalledEquipment,
|
|
1193
|
+
listInstalledEquipmentAttachments: () => listInstalledEquipmentAttachments,
|
|
1194
|
+
listInstalledEquipmentCustomFieldTypes: () => listInstalledEquipmentCustomFieldTypes,
|
|
1195
|
+
updateInstalledEquipment: () => updateInstalledEquipment
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
// src/resources/equipment-systems/export.ts
|
|
1199
|
+
async function exportInstalledEquipment(client, params = {}) {
|
|
1200
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "export", idOrSubpath: "installed-equipment" });
|
|
1201
|
+
return client.request("get", path, { params });
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
// src/resources/equipment-systems/installed-equipment.ts
|
|
1205
|
+
async function listInstalledEquipment(client, params = {}) {
|
|
1206
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment" });
|
|
1207
|
+
return client.request("get", path, { params });
|
|
1208
|
+
}
|
|
1209
|
+
async function createInstalledEquipment(client, data) {
|
|
1210
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment" });
|
|
1211
|
+
return client.request("post", path, { data });
|
|
1212
|
+
}
|
|
1213
|
+
async function listInstalledEquipmentAttachments(client, params = {}) {
|
|
1214
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: "attachments" });
|
|
1215
|
+
return client.request("get", path, { params });
|
|
1216
|
+
}
|
|
1217
|
+
async function createInstalledEquipmentAttachment(client, data) {
|
|
1218
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: "attachments" });
|
|
1219
|
+
return client.request("post", path, { data });
|
|
1220
|
+
}
|
|
1221
|
+
async function listInstalledEquipmentCustomFieldTypes(client, params = {}) {
|
|
1222
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: "custom-field-types" });
|
|
1223
|
+
return client.request("get", path, { params });
|
|
1224
|
+
}
|
|
1225
|
+
async function getInstalledEquipment(client, id) {
|
|
1226
|
+
if (!id) throw new Error("id is required");
|
|
1227
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: String(id) });
|
|
1228
|
+
return client.request("get", path);
|
|
1229
|
+
}
|
|
1230
|
+
async function updateInstalledEquipment(client, id, data) {
|
|
1231
|
+
if (!id) throw new Error("id is required");
|
|
1232
|
+
const path = client.buildPath({ category: "equipment-systems", subject: "installed-equipment", idOrSubpath: String(id) });
|
|
1233
|
+
return client.request("patch", path, { data });
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
// src/resources/jpm/index.ts
|
|
1237
|
+
var jpm_exports = {};
|
|
1238
|
+
__export(jpm_exports, {
|
|
1239
|
+
attachJob: () => attachJob,
|
|
1240
|
+
batchCreateBudgetCodes: () => batchCreateBudgetCodes,
|
|
1241
|
+
batchPartialUpdateBudgetCodes: () => batchPartialUpdateBudgetCodes,
|
|
1242
|
+
cancelJob: () => cancelJob,
|
|
1243
|
+
confirmAppointment: () => confirmAppointment,
|
|
1244
|
+
createBudgetCode: () => createBudgetCode,
|
|
1245
|
+
createJobNote: () => createJobNote,
|
|
1246
|
+
createJobType: () => createJobType,
|
|
1247
|
+
createProjectNote: () => createProjectNote,
|
|
1248
|
+
detachJob: () => detachJob,
|
|
1249
|
+
exportAppointments: () => exportAppointments,
|
|
1250
|
+
exportJobCanceledLogs: () => exportJobCanceledLogs,
|
|
1251
|
+
exportJobHistory: () => exportJobHistory,
|
|
1252
|
+
exportJobNotes: () => exportJobNotes,
|
|
1253
|
+
exportJobs: () => exportJobs,
|
|
1254
|
+
exportProjectNotes: () => exportProjectNotes,
|
|
1255
|
+
exportProjects: () => exportProjects,
|
|
1256
|
+
getAppointment: () => getAppointment,
|
|
1257
|
+
getCancelReasons: () => getCancelReasons,
|
|
1258
|
+
getJob: () => getJob,
|
|
1259
|
+
getJobBookedLog: () => getJobBookedLog,
|
|
1260
|
+
getJobCanceledLog: () => getJobCanceledLog,
|
|
1261
|
+
getJobHistory: () => getJobHistory,
|
|
1262
|
+
getJobType: () => getJobType,
|
|
1263
|
+
getProject: () => getProject,
|
|
1264
|
+
getProjectStatus: () => getProjectStatus,
|
|
1265
|
+
getProjectSubStatus: () => getProjectSubStatus,
|
|
1266
|
+
getProjectType: () => getProjectType,
|
|
1267
|
+
holdAppointment: () => holdAppointment,
|
|
1268
|
+
listAppointments: () => listAppointments,
|
|
1269
|
+
listBudgetCodes: () => listBudgetCodes,
|
|
1270
|
+
listJobCancelReasons: () => listJobCancelReasons,
|
|
1271
|
+
listJobHoldReasons: () => listJobHoldReasons,
|
|
1272
|
+
listJobNotes: () => listJobNotes,
|
|
1273
|
+
listJobTypes: () => listJobTypes,
|
|
1274
|
+
listJobs: () => listJobs,
|
|
1275
|
+
listProjectBudgetCodes: () => listProjectBudgetCodes,
|
|
1276
|
+
listProjectCustomFields: () => listProjectCustomFields,
|
|
1277
|
+
listProjectNotes: () => listProjectNotes,
|
|
1278
|
+
listProjectSegmentItemChildren: () => listProjectSegmentItemChildren,
|
|
1279
|
+
listProjectSegmentItems: () => listProjectSegmentItems,
|
|
1280
|
+
listProjectSegments: () => listProjectSegments,
|
|
1281
|
+
listProjectStatuses: () => listProjectStatuses,
|
|
1282
|
+
listProjectSubStatuses: () => listProjectSubStatuses,
|
|
1283
|
+
listProjectTypes: () => listProjectTypes,
|
|
1284
|
+
listProjects: () => listProjects,
|
|
1285
|
+
listSegmentItemChildren: () => listSegmentItemChildren,
|
|
1286
|
+
listSegmentItems: () => listSegmentItems,
|
|
1287
|
+
listSegments: () => listSegments,
|
|
1288
|
+
partialUpdateBudgetCodes: () => partialUpdateBudgetCodes,
|
|
1289
|
+
removeJobCancellation: () => removeJobCancellation,
|
|
1290
|
+
rescheduleAppointment: () => rescheduleAppointment,
|
|
1291
|
+
unconfirmAppointment: () => unconfirmAppointment,
|
|
1292
|
+
unholdAppointment: () => unholdAppointment,
|
|
1293
|
+
updateJobType: () => updateJobType,
|
|
1294
|
+
updateSpecialInstructions: () => updateSpecialInstructions
|
|
1295
|
+
});
|
|
1296
|
+
|
|
1297
|
+
// src/resources/jpm/export.ts
|
|
1298
|
+
async function exportAppointments(client, params = {}) {
|
|
1299
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "appointments" });
|
|
1300
|
+
return client.request("get", path, { params });
|
|
1301
|
+
}
|
|
1302
|
+
async function exportJobCanceledLogs(client, params = {}) {
|
|
1303
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "job-canceled-logs" });
|
|
1304
|
+
return client.request("get", path, { params });
|
|
1305
|
+
}
|
|
1306
|
+
async function exportJobHistory(client, params = {}) {
|
|
1307
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "job-history" });
|
|
1308
|
+
return client.request("get", path, { params });
|
|
1309
|
+
}
|
|
1310
|
+
async function exportJobNotes(client, params = {}) {
|
|
1311
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "job-notes" });
|
|
1312
|
+
return client.request("get", path, { params });
|
|
1313
|
+
}
|
|
1314
|
+
async function exportJobs(client, params = {}) {
|
|
1315
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "jobs" });
|
|
1316
|
+
return client.request("get", path, { params });
|
|
1317
|
+
}
|
|
1318
|
+
async function exportProjectNotes(client, params = {}) {
|
|
1319
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "project-notes" });
|
|
1320
|
+
return client.request("get", path, { params });
|
|
1321
|
+
}
|
|
1322
|
+
async function exportProjects(client, params = {}) {
|
|
1323
|
+
const path = client.buildPath({ category: "jpm", subject: "export", idOrSubpath: "projects" });
|
|
1324
|
+
return client.request("get", path, { params });
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// src/resources/jpm/appointments.ts
|
|
1328
|
+
async function listAppointments(client, params = {}) {
|
|
1329
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments" });
|
|
1330
|
+
return client.request("get", path, { params });
|
|
1331
|
+
}
|
|
1332
|
+
async function getAppointment(client, id) {
|
|
1333
|
+
if (!id) throw new Error("id is required");
|
|
1334
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: String(id) });
|
|
1335
|
+
return client.request("get", path);
|
|
1336
|
+
}
|
|
1337
|
+
async function confirmAppointment(client, id) {
|
|
1338
|
+
if (!id) throw new Error("id is required");
|
|
1339
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/confirmation` });
|
|
1340
|
+
return client.request("post", path);
|
|
1341
|
+
}
|
|
1342
|
+
async function unconfirmAppointment(client, id) {
|
|
1343
|
+
if (!id) throw new Error("id is required");
|
|
1344
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/confirmation` });
|
|
1345
|
+
return client.request("delete", path);
|
|
1346
|
+
}
|
|
1347
|
+
async function holdAppointment(client, id, data = {}) {
|
|
1348
|
+
if (!id) throw new Error("id is required");
|
|
1349
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/hold` });
|
|
1350
|
+
return client.request("post", path, { data });
|
|
1351
|
+
}
|
|
1352
|
+
async function unholdAppointment(client, id) {
|
|
1353
|
+
if (!id) throw new Error("id is required");
|
|
1354
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/hold` });
|
|
1355
|
+
return client.request("delete", path);
|
|
1356
|
+
}
|
|
1357
|
+
async function rescheduleAppointment(client, id, data) {
|
|
1358
|
+
if (!id) throw new Error("id is required");
|
|
1359
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/reschedule` });
|
|
1360
|
+
return client.request("post", path, { data });
|
|
1361
|
+
}
|
|
1362
|
+
async function updateSpecialInstructions(client, id, data) {
|
|
1363
|
+
if (!id) throw new Error("id is required");
|
|
1364
|
+
const path = client.buildPath({ category: "jpm", subject: "appointments", idOrSubpath: `${id}/special-instructions` });
|
|
1365
|
+
return client.request("put", path, { data });
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
// src/resources/jpm/jobs.ts
|
|
1369
|
+
async function listJobs(client, params = {}) {
|
|
1370
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs" });
|
|
1371
|
+
return client.request("get", path, { params });
|
|
1372
|
+
}
|
|
1373
|
+
async function getJob(client, id, params = {}) {
|
|
1374
|
+
if (!id) throw new Error("id is required");
|
|
1375
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: String(id) });
|
|
1376
|
+
return client.request("get", path, { params });
|
|
1377
|
+
}
|
|
1378
|
+
async function getJobBookedLog(client, id) {
|
|
1379
|
+
if (!id) throw new Error("id is required");
|
|
1380
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/booked-log` });
|
|
1381
|
+
return client.request("get", path);
|
|
1382
|
+
}
|
|
1383
|
+
async function cancelJob(client, id, data = {}) {
|
|
1384
|
+
if (!id) throw new Error("id is required");
|
|
1385
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/cancel` });
|
|
1386
|
+
return client.request("post", path, { data });
|
|
1387
|
+
}
|
|
1388
|
+
async function getJobCanceledLog(client, id) {
|
|
1389
|
+
if (!id) throw new Error("id is required");
|
|
1390
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/canceled-log` });
|
|
1391
|
+
return client.request("get", path);
|
|
1392
|
+
}
|
|
1393
|
+
async function getJobHistory(client, id) {
|
|
1394
|
+
if (!id) throw new Error("id is required");
|
|
1395
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/history` });
|
|
1396
|
+
return client.request("get", path);
|
|
1397
|
+
}
|
|
1398
|
+
async function listJobNotes(client, id) {
|
|
1399
|
+
if (!id) throw new Error("id is required");
|
|
1400
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/notes` });
|
|
1401
|
+
return client.request("get", path);
|
|
1402
|
+
}
|
|
1403
|
+
async function createJobNote(client, id, data) {
|
|
1404
|
+
if (!id) throw new Error("id is required");
|
|
1405
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/notes` });
|
|
1406
|
+
return client.request("post", path, { data });
|
|
1407
|
+
}
|
|
1408
|
+
async function removeJobCancellation(client, id) {
|
|
1409
|
+
if (!id) throw new Error("id is required");
|
|
1410
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: `${id}/remove-cancellation` });
|
|
1411
|
+
return client.request("post", path);
|
|
1412
|
+
}
|
|
1413
|
+
async function getCancelReasons(client, ids) {
|
|
1414
|
+
const params = {};
|
|
1415
|
+
if (ids && ids.length > 0) {
|
|
1416
|
+
params.ids = ids.join(",");
|
|
1417
|
+
}
|
|
1418
|
+
const path = client.buildPath({ category: "jpm", subject: "jobs", idOrSubpath: "cancel-reasons" });
|
|
1419
|
+
return client.request("get", path, { params });
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
// src/resources/jpm/projects.ts
|
|
1423
|
+
async function listProjects(client, params = {}) {
|
|
1424
|
+
const path = client.buildPath({ category: "jpm", subject: "projects" });
|
|
1425
|
+
return client.request("get", path, { params });
|
|
1426
|
+
}
|
|
1427
|
+
async function getProject(client, id) {
|
|
1428
|
+
if (!id) throw new Error("id is required");
|
|
1429
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: String(id) });
|
|
1430
|
+
return client.request("get", path);
|
|
1431
|
+
}
|
|
1432
|
+
async function detachJob(client, jobId) {
|
|
1433
|
+
if (!jobId) throw new Error("jobId is required");
|
|
1434
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: `detach-job/${jobId}` });
|
|
1435
|
+
return client.request("post", path);
|
|
1436
|
+
}
|
|
1437
|
+
async function attachJob(client, id, jobId) {
|
|
1438
|
+
if (!id || !jobId) throw new Error("id and jobId are required");
|
|
1439
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: `${id}/attach-job/${jobId}` });
|
|
1440
|
+
return client.request("post", path);
|
|
1441
|
+
}
|
|
1442
|
+
async function listProjectNotes(client, id) {
|
|
1443
|
+
if (!id) throw new Error("id is required");
|
|
1444
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: `${id}/notes` });
|
|
1445
|
+
return client.request("get", path);
|
|
1446
|
+
}
|
|
1447
|
+
async function createProjectNote(client, id, data) {
|
|
1448
|
+
if (!id) throw new Error("id is required");
|
|
1449
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: `${id}/notes` });
|
|
1450
|
+
return client.request("post", path, { data });
|
|
1451
|
+
}
|
|
1452
|
+
async function listProjectCustomFields(client) {
|
|
1453
|
+
const path = client.buildPath({ category: "jpm", subject: "projects", idOrSubpath: "custom-fields" });
|
|
1454
|
+
return client.request("get", path);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// src/resources/jpm/job-cancel-reasons.ts
|
|
1458
|
+
async function listJobCancelReasons(client) {
|
|
1459
|
+
const path = client.buildPath({ category: "jpm", subject: "job-cancel-reasons" });
|
|
1460
|
+
return client.request("get", path);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
// src/resources/jpm/job-hold-reasons.ts
|
|
1464
|
+
async function listJobHoldReasons(client) {
|
|
1465
|
+
const path = client.buildPath({ category: "jpm", subject: "job-hold-reasons" });
|
|
1466
|
+
return client.request("get", path);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
// src/resources/jpm/job-types.ts
|
|
1470
|
+
async function listJobTypes(client, params = {}) {
|
|
1471
|
+
const path = client.buildPath({ category: "jpm", subject: "job-types" });
|
|
1472
|
+
return client.request("get", path, { params });
|
|
1473
|
+
}
|
|
1474
|
+
async function createJobType(client, data) {
|
|
1475
|
+
const path = client.buildPath({ category: "jpm", subject: "job-types" });
|
|
1476
|
+
return client.request("post", path, { data });
|
|
1477
|
+
}
|
|
1478
|
+
async function getJobType(client, id) {
|
|
1479
|
+
if (!id) throw new Error("id is required");
|
|
1480
|
+
const path = client.buildPath({ category: "jpm", subject: "job-types", idOrSubpath: String(id) });
|
|
1481
|
+
return client.request("get", path);
|
|
1482
|
+
}
|
|
1483
|
+
async function updateJobType(client, id, data) {
|
|
1484
|
+
if (!id) throw new Error("id is required");
|
|
1485
|
+
const path = client.buildPath({ category: "jpm", subject: "job-types", idOrSubpath: String(id) });
|
|
1486
|
+
return client.request("put", path, { data });
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
// src/resources/jpm/project-statuses.ts
|
|
1490
|
+
async function listProjectStatuses(client) {
|
|
1491
|
+
const path = client.buildPath({ category: "jpm", subject: "project-statuses" });
|
|
1492
|
+
return client.request("get", path);
|
|
1493
|
+
}
|
|
1494
|
+
async function getProjectStatus(client, id) {
|
|
1495
|
+
if (!id) throw new Error("id is required");
|
|
1496
|
+
const path = client.buildPath({ category: "jpm", subject: "project-statuses", idOrSubpath: String(id) });
|
|
1497
|
+
return client.request("get", path);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
// src/resources/jpm/project-substatuses.ts
|
|
1501
|
+
async function listProjectSubStatuses(client) {
|
|
1502
|
+
const path = client.buildPath({ category: "jpm", subject: "project-substatuses" });
|
|
1503
|
+
return client.request("get", path);
|
|
1504
|
+
}
|
|
1505
|
+
async function getProjectSubStatus(client, id) {
|
|
1506
|
+
if (!id) throw new Error("id is required");
|
|
1507
|
+
const path = client.buildPath({ category: "jpm", subject: "project-substatuses", idOrSubpath: String(id) });
|
|
1508
|
+
return client.request("get", path);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// src/resources/jpm/project-types.ts
|
|
1512
|
+
async function listProjectTypes(client) {
|
|
1513
|
+
const path = client.buildPath({ category: "jpm", subject: "project-types" });
|
|
1514
|
+
return client.request("get", path);
|
|
1515
|
+
}
|
|
1516
|
+
async function getProjectType(client, id) {
|
|
1517
|
+
if (!id) throw new Error("id is required");
|
|
1518
|
+
const path = client.buildPath({ category: "jpm", subject: "project-types", idOrSubpath: String(id) });
|
|
1519
|
+
return client.request("get", path);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// src/resources/jpm/work-breakdown-structure.ts
|
|
1523
|
+
async function listBudgetCodes(client, params = {}) {
|
|
1524
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes" });
|
|
1525
|
+
return client.request("get", path, { params });
|
|
1526
|
+
}
|
|
1527
|
+
async function createBudgetCode(client, data) {
|
|
1528
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes" });
|
|
1529
|
+
return client.request("post", path, { data });
|
|
1530
|
+
}
|
|
1531
|
+
async function batchCreateBudgetCodes(client, data) {
|
|
1532
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes/batch" });
|
|
1533
|
+
return client.request("post", path, { data });
|
|
1534
|
+
}
|
|
1535
|
+
async function partialUpdateBudgetCodes(client, data) {
|
|
1536
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes/partial" });
|
|
1537
|
+
return client.request("post", path, { data });
|
|
1538
|
+
}
|
|
1539
|
+
async function batchPartialUpdateBudgetCodes(client, data) {
|
|
1540
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/budget-codes/partial/batch" });
|
|
1541
|
+
return client.request("post", path, { data });
|
|
1542
|
+
}
|
|
1543
|
+
async function listProjectBudgetCodes(client, projectId) {
|
|
1544
|
+
if (!projectId) throw new Error("projectId is required");
|
|
1545
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/projects/${projectId}/budget-codes` });
|
|
1546
|
+
return client.request("get", path);
|
|
1547
|
+
}
|
|
1548
|
+
async function listProjectSegments(client, projectId) {
|
|
1549
|
+
if (!projectId) throw new Error("projectId is required");
|
|
1550
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/projects/${projectId}/segments` });
|
|
1551
|
+
return client.request("get", path);
|
|
1552
|
+
}
|
|
1553
|
+
async function listProjectSegmentItems(client, projectId, segmentId) {
|
|
1554
|
+
if (!projectId || !segmentId) throw new Error("projectId and segmentId are required");
|
|
1555
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/projects/${projectId}/segments/${segmentId}/items` });
|
|
1556
|
+
return client.request("get", path);
|
|
1557
|
+
}
|
|
1558
|
+
async function listProjectSegmentItemChildren(client, projectId, segmentId, segmentItemId) {
|
|
1559
|
+
if (!projectId || !segmentId || !segmentItemId) throw new Error("projectId, segmentId and segmentItemId are required");
|
|
1560
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/projects/${projectId}/segments/${segmentId}/items/${segmentItemId}/children` });
|
|
1561
|
+
return client.request("get", path);
|
|
1562
|
+
}
|
|
1563
|
+
async function listSegments(client) {
|
|
1564
|
+
const path = client.buildPath({ category: "jpm", subject: "work-breakdown-structure/segments" });
|
|
1565
|
+
return client.request("get", path);
|
|
1566
|
+
}
|
|
1567
|
+
async function listSegmentItems(client, segmentId) {
|
|
1568
|
+
if (!segmentId) throw new Error("segmentId is required");
|
|
1569
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/segments/${segmentId}/items` });
|
|
1570
|
+
return client.request("get", path);
|
|
1571
|
+
}
|
|
1572
|
+
async function listSegmentItemChildren(client, segmentId, segmentItemId) {
|
|
1573
|
+
if (!segmentId || !segmentItemId) throw new Error("segmentId and segmentItemId are required");
|
|
1574
|
+
const path = client.buildPath({ category: "jpm", subject: `work-breakdown-structure/segments/${segmentId}/items/${segmentItemId}/children` });
|
|
1575
|
+
return client.request("get", path);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
// src/resources/inventory/index.ts
|
|
1579
|
+
var inventory_exports = {};
|
|
1580
|
+
__export(inventory_exports, {
|
|
1581
|
+
approvePurchaseOrderRequest: () => approvePurchaseOrderRequest,
|
|
1582
|
+
cancelPurchaseOrder: () => cancelPurchaseOrder,
|
|
1583
|
+
cancelReceipt: () => cancelReceipt,
|
|
1584
|
+
cancelReturn: () => cancelReturn,
|
|
1585
|
+
createPurchaseOrder: () => createPurchaseOrder,
|
|
1586
|
+
createPurchaseOrderMarkup: () => createPurchaseOrderMarkup,
|
|
1587
|
+
createPurchaseOrderType: () => createPurchaseOrderType,
|
|
1588
|
+
createReceipt: () => createReceipt,
|
|
1589
|
+
createReturn: () => createReturn,
|
|
1590
|
+
createVendor: () => createVendor,
|
|
1591
|
+
deletePurchaseOrderMarkup: () => deletePurchaseOrderMarkup,
|
|
1592
|
+
exportAdjustments: () => exportAdjustments,
|
|
1593
|
+
exportPurchaseOrders: () => exportPurchaseOrders,
|
|
1594
|
+
exportReturns: () => exportReturns,
|
|
1595
|
+
exportTransfers: () => exportTransfers,
|
|
1596
|
+
getAdjustment: () => getAdjustment,
|
|
1597
|
+
getPurchaseOrder: () => getPurchaseOrder,
|
|
1598
|
+
getPurchaseOrderMarkup: () => getPurchaseOrderMarkup,
|
|
1599
|
+
getPurchaseOrderType: () => getPurchaseOrderType,
|
|
1600
|
+
getReturn: () => getReturn,
|
|
1601
|
+
getReturnType: () => getReturnType,
|
|
1602
|
+
getTransfer: () => getTransfer,
|
|
1603
|
+
getTruck: () => getTruck,
|
|
1604
|
+
getVendor: () => getVendor,
|
|
1605
|
+
getWarehouse: () => getWarehouse,
|
|
1606
|
+
listAdjustmentCustomFields: () => listAdjustmentCustomFields,
|
|
1607
|
+
listAdjustments: () => listAdjustments,
|
|
1608
|
+
listPurchaseOrderMarkups: () => listPurchaseOrderMarkups,
|
|
1609
|
+
listPurchaseOrderRequests: () => listPurchaseOrderRequests,
|
|
1610
|
+
listPurchaseOrderTypes: () => listPurchaseOrderTypes,
|
|
1611
|
+
listPurchaseOrders: () => listPurchaseOrders,
|
|
1612
|
+
listReceiptCustomFields: () => listReceiptCustomFields,
|
|
1613
|
+
listReceipts: () => listReceipts,
|
|
1614
|
+
listReturnCustomFields: () => listReturnCustomFields,
|
|
1615
|
+
listReturnTypes: () => listReturnTypes,
|
|
1616
|
+
listReturns: () => listReturns,
|
|
1617
|
+
listTransferCustomFields: () => listTransferCustomFields,
|
|
1618
|
+
listTransfers: () => listTransfers,
|
|
1619
|
+
listTrucks: () => listTrucks,
|
|
1620
|
+
listVendors: () => listVendors,
|
|
1621
|
+
listWarehouses: () => listWarehouses,
|
|
1622
|
+
rejectPurchaseOrderRequest: () => rejectPurchaseOrderRequest,
|
|
1623
|
+
updatePurchaseOrder: () => updatePurchaseOrder,
|
|
1624
|
+
updatePurchaseOrderMarkup: () => updatePurchaseOrderMarkup,
|
|
1625
|
+
updateVendor: () => updateVendor
|
|
1626
|
+
});
|
|
1627
|
+
|
|
1628
|
+
// src/resources/inventory/export.ts
|
|
1629
|
+
async function exportAdjustments(client, params = {}) {
|
|
1630
|
+
const path = client.buildPath({ category: "inventory", subject: "export", idOrSubpath: "adjustments" });
|
|
1631
|
+
return client.request("get", path, { params });
|
|
1632
|
+
}
|
|
1633
|
+
async function exportPurchaseOrders(client, params = {}) {
|
|
1634
|
+
const path = client.buildPath({ category: "inventory", subject: "export", idOrSubpath: "purchase-orders" });
|
|
1635
|
+
return client.request("get", path, { params });
|
|
1636
|
+
}
|
|
1637
|
+
async function exportReturns(client, params = {}) {
|
|
1638
|
+
const path = client.buildPath({ category: "inventory", subject: "export", idOrSubpath: "returns" });
|
|
1639
|
+
return client.request("get", path, { params });
|
|
1640
|
+
}
|
|
1641
|
+
async function exportTransfers(client, params = {}) {
|
|
1642
|
+
const path = client.buildPath({ category: "inventory", subject: "export", idOrSubpath: "transfers" });
|
|
1643
|
+
return client.request("get", path, { params });
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
// src/resources/inventory/adjustments.ts
|
|
1647
|
+
async function listAdjustments(client, params = {}) {
|
|
1648
|
+
const path = client.buildPath({ category: "inventory", subject: "adjustments" });
|
|
1649
|
+
return client.request("get", path, { params });
|
|
1650
|
+
}
|
|
1651
|
+
async function listAdjustmentCustomFields(client) {
|
|
1652
|
+
const path = client.buildPath({ category: "inventory", subject: "adjustments", idOrSubpath: "custom-fields" });
|
|
1653
|
+
return client.request("get", path);
|
|
1654
|
+
}
|
|
1655
|
+
async function getAdjustment(client, id) {
|
|
1656
|
+
if (!id) throw new Error("id is required");
|
|
1657
|
+
const path = client.buildPath({ category: "inventory", subject: "adjustments", idOrSubpath: String(id) });
|
|
1658
|
+
return client.request("get", path);
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
// src/resources/inventory/purchase-orders.ts
|
|
1662
|
+
async function listPurchaseOrders(client, params = {}) {
|
|
1663
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-orders" });
|
|
1664
|
+
return client.request("get", path, { params });
|
|
1665
|
+
}
|
|
1666
|
+
async function createPurchaseOrder(client, data) {
|
|
1667
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-orders" });
|
|
1668
|
+
return client.request("post", path, { data });
|
|
1669
|
+
}
|
|
1670
|
+
async function listPurchaseOrderRequests(client, params = {}) {
|
|
1671
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-orders/requests" });
|
|
1672
|
+
return client.request("get", path, { params });
|
|
1673
|
+
}
|
|
1674
|
+
async function approvePurchaseOrderRequest(client, id) {
|
|
1675
|
+
if (!id) throw new Error("id is required");
|
|
1676
|
+
const path = client.buildPath({ category: "inventory", subject: `purchase-orders/requests/${id}/approve` });
|
|
1677
|
+
return client.request("post", path);
|
|
1678
|
+
}
|
|
1679
|
+
async function rejectPurchaseOrderRequest(client, id) {
|
|
1680
|
+
if (!id) throw new Error("id is required");
|
|
1681
|
+
const path = client.buildPath({ category: "inventory", subject: `purchase-orders/requests/${id}/reject` });
|
|
1682
|
+
return client.request("post", path);
|
|
1683
|
+
}
|
|
1684
|
+
async function getPurchaseOrder(client, id) {
|
|
1685
|
+
if (!id) throw new Error("id is required");
|
|
1686
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-orders", idOrSubpath: String(id) });
|
|
1687
|
+
return client.request("get", path);
|
|
1688
|
+
}
|
|
1689
|
+
async function updatePurchaseOrder(client, id, data) {
|
|
1690
|
+
if (!id) throw new Error("id is required");
|
|
1691
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-orders", idOrSubpath: String(id) });
|
|
1692
|
+
return client.request("put", path, { data });
|
|
1693
|
+
}
|
|
1694
|
+
async function cancelPurchaseOrder(client, id) {
|
|
1695
|
+
if (!id) throw new Error("id is required");
|
|
1696
|
+
const path = client.buildPath({ category: "inventory", subject: `purchase-orders/${id}/cancellation` });
|
|
1697
|
+
return client.request("post", path);
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
// src/resources/inventory/purchase-order-markups.ts
|
|
1701
|
+
async function listPurchaseOrderMarkups(client, params = {}) {
|
|
1702
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-markups" });
|
|
1703
|
+
return client.request("get", path, { params });
|
|
1704
|
+
}
|
|
1705
|
+
async function createPurchaseOrderMarkup(client, data) {
|
|
1706
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-markups" });
|
|
1707
|
+
return client.request("post", path, { data });
|
|
1708
|
+
}
|
|
1709
|
+
async function getPurchaseOrderMarkup(client, id) {
|
|
1710
|
+
if (!id) throw new Error("id is required");
|
|
1711
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-markups", idOrSubpath: String(id) });
|
|
1712
|
+
return client.request("get", path);
|
|
1713
|
+
}
|
|
1714
|
+
async function updatePurchaseOrderMarkup(client, id, data) {
|
|
1715
|
+
if (!id) throw new Error("id is required");
|
|
1716
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-markups", idOrSubpath: String(id) });
|
|
1717
|
+
return client.request("put", path, { data });
|
|
1718
|
+
}
|
|
1719
|
+
async function deletePurchaseOrderMarkup(client, id) {
|
|
1720
|
+
if (!id) throw new Error("id is required");
|
|
1721
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-markups", idOrSubpath: String(id) });
|
|
1722
|
+
return client.request("delete", path);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
// src/resources/inventory/purchase-order-types.ts
|
|
1726
|
+
async function listPurchaseOrderTypes(client, params = {}) {
|
|
1727
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-types" });
|
|
1728
|
+
return client.request("get", path, { params });
|
|
1729
|
+
}
|
|
1730
|
+
async function createPurchaseOrderType(client, data) {
|
|
1731
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-types" });
|
|
1732
|
+
return client.request("post", path, { data });
|
|
1733
|
+
}
|
|
1734
|
+
async function getPurchaseOrderType(client, id) {
|
|
1735
|
+
if (!id) throw new Error("id is required");
|
|
1736
|
+
const path = client.buildPath({ category: "inventory", subject: "purchase-order-types", idOrSubpath: String(id) });
|
|
1737
|
+
return client.request("get", path);
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
// src/resources/inventory/receipts.ts
|
|
1741
|
+
async function listReceipts(client, params = {}) {
|
|
1742
|
+
const path = client.buildPath({ category: "inventory", subject: "receipts" });
|
|
1743
|
+
return client.request("get", path, { params });
|
|
1744
|
+
}
|
|
1745
|
+
async function createReceipt(client, data) {
|
|
1746
|
+
const path = client.buildPath({ category: "inventory", subject: "receipts" });
|
|
1747
|
+
return client.request("post", path, { data });
|
|
1748
|
+
}
|
|
1749
|
+
async function listReceiptCustomFields(client) {
|
|
1750
|
+
const path = client.buildPath({ category: "inventory", subject: "receipts", idOrSubpath: "custom-fields" });
|
|
1751
|
+
return client.request("get", path);
|
|
1752
|
+
}
|
|
1753
|
+
async function cancelReceipt(client, id) {
|
|
1754
|
+
if (!id) throw new Error("id is required");
|
|
1755
|
+
const path = client.buildPath({ category: "inventory", subject: `receipts/${id}/cancellation` });
|
|
1756
|
+
return client.request("post", path);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
// src/resources/inventory/returns.ts
|
|
1760
|
+
async function listReturns(client, params = {}) {
|
|
1761
|
+
const path = client.buildPath({ category: "inventory", subject: "returns" });
|
|
1762
|
+
return client.request("get", path, { params });
|
|
1763
|
+
}
|
|
1764
|
+
async function createReturn(client, data) {
|
|
1765
|
+
const path = client.buildPath({ category: "inventory", subject: "returns" });
|
|
1766
|
+
return client.request("post", path, { data });
|
|
1767
|
+
}
|
|
1768
|
+
async function listReturnCustomFields(client) {
|
|
1769
|
+
const path = client.buildPath({ category: "inventory", subject: "returns", idOrSubpath: "custom-fields" });
|
|
1770
|
+
return client.request("get", path);
|
|
1771
|
+
}
|
|
1772
|
+
async function getReturn(client, id) {
|
|
1773
|
+
if (!id) throw new Error("id is required");
|
|
1774
|
+
const path = client.buildPath({ category: "inventory", subject: "returns", idOrSubpath: String(id) });
|
|
1775
|
+
return client.request("get", path);
|
|
1776
|
+
}
|
|
1777
|
+
async function cancelReturn(client, id) {
|
|
1778
|
+
if (!id) throw new Error("id is required");
|
|
1779
|
+
const path = client.buildPath({ category: "inventory", subject: `returns/${id}/cancellation` });
|
|
1780
|
+
return client.request("post", path);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
// src/resources/inventory/return-types.ts
|
|
1784
|
+
async function listReturnTypes(client, params = {}) {
|
|
1785
|
+
const path = client.buildPath({ category: "inventory", subject: "return-types" });
|
|
1786
|
+
return client.request("get", path, { params });
|
|
1787
|
+
}
|
|
1788
|
+
async function getReturnType(client, id) {
|
|
1789
|
+
if (!id) throw new Error("id is required");
|
|
1790
|
+
const path = client.buildPath({ category: "inventory", subject: "return-types", idOrSubpath: String(id) });
|
|
1791
|
+
return client.request("get", path);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
// src/resources/inventory/transfers.ts
|
|
1795
|
+
async function listTransfers(client, params = {}) {
|
|
1796
|
+
const path = client.buildPath({ category: "inventory", subject: "transfers" });
|
|
1797
|
+
return client.request("get", path, { params });
|
|
1798
|
+
}
|
|
1799
|
+
async function listTransferCustomFields(client) {
|
|
1800
|
+
const path = client.buildPath({ category: "inventory", subject: "transfers", idOrSubpath: "custom-fields" });
|
|
1801
|
+
return client.request("get", path);
|
|
1802
|
+
}
|
|
1803
|
+
async function getTransfer(client, id) {
|
|
1804
|
+
if (!id) throw new Error("id is required");
|
|
1805
|
+
const path = client.buildPath({ category: "inventory", subject: "transfers", idOrSubpath: String(id) });
|
|
1806
|
+
return client.request("get", path);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
// src/resources/inventory/trucks.ts
|
|
1810
|
+
async function listTrucks(client, params = {}) {
|
|
1811
|
+
const path = client.buildPath({ category: "inventory", subject: "trucks" });
|
|
1812
|
+
return client.request("get", path, { params });
|
|
1813
|
+
}
|
|
1814
|
+
async function getTruck(client, id) {
|
|
1815
|
+
if (!id) throw new Error("id is required");
|
|
1816
|
+
const path = client.buildPath({ category: "inventory", subject: "trucks", idOrSubpath: String(id) });
|
|
1817
|
+
return client.request("get", path);
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// src/resources/inventory/vendors.ts
|
|
1821
|
+
async function listVendors(client, params = {}) {
|
|
1822
|
+
const path = client.buildPath({ category: "inventory", subject: "vendors" });
|
|
1823
|
+
return client.request("get", path, { params });
|
|
1824
|
+
}
|
|
1825
|
+
async function createVendor(client, data) {
|
|
1826
|
+
const path = client.buildPath({ category: "inventory", subject: "vendors" });
|
|
1827
|
+
return client.request("post", path, { data });
|
|
1828
|
+
}
|
|
1829
|
+
async function getVendor(client, id) {
|
|
1830
|
+
if (!id) throw new Error("id is required");
|
|
1831
|
+
const path = client.buildPath({ category: "inventory", subject: "vendors", idOrSubpath: String(id) });
|
|
1832
|
+
return client.request("get", path);
|
|
1833
|
+
}
|
|
1834
|
+
async function updateVendor(client, id, data) {
|
|
1835
|
+
if (!id) throw new Error("id is required");
|
|
1836
|
+
const path = client.buildPath({ category: "inventory", subject: "vendors", idOrSubpath: String(id) });
|
|
1837
|
+
return client.request("put", path, { data });
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
// src/resources/inventory/warehouses.ts
|
|
1841
|
+
async function listWarehouses(client, params = {}) {
|
|
1842
|
+
const path = client.buildPath({ category: "inventory", subject: "warehouses" });
|
|
1843
|
+
return client.request("get", path, { params });
|
|
1844
|
+
}
|
|
1845
|
+
async function getWarehouse(client, id) {
|
|
1846
|
+
if (!id) throw new Error("id is required");
|
|
1847
|
+
const path = client.buildPath({ category: "inventory", subject: "warehouses", idOrSubpath: String(id) });
|
|
1848
|
+
return client.request("get", path);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
// src/resources/memberships/index.ts
|
|
1852
|
+
var memberships_exports = {};
|
|
1853
|
+
__export(memberships_exports, {
|
|
1854
|
+
exportInvoiceTemplates: () => exportInvoiceTemplates,
|
|
1855
|
+
exportMembershipStatusChanges: () => exportMembershipStatusChanges,
|
|
1856
|
+
exportMembershipTypes: () => exportMembershipTypes,
|
|
1857
|
+
exportMemberships: () => exportMemberships,
|
|
1858
|
+
exportRecurringServiceEvents: () => exportRecurringServiceEvents,
|
|
1859
|
+
exportRecurringServiceTypes: () => exportRecurringServiceTypes,
|
|
1860
|
+
exportRecurringServices: () => exportRecurringServices,
|
|
1861
|
+
getInvoiceTemplate: () => getInvoiceTemplate,
|
|
1862
|
+
getMembership: () => getMembership,
|
|
1863
|
+
getMembershipType: () => getMembershipType,
|
|
1864
|
+
getRecurringService: () => getRecurringService,
|
|
1865
|
+
getRecurringServiceType: () => getRecurringServiceType,
|
|
1866
|
+
listInvoiceTemplates: () => listInvoiceTemplates,
|
|
1867
|
+
listInvoiceTemplatesByIds: () => listInvoiceTemplatesByIds,
|
|
1868
|
+
listMembershipCustomFields: () => listMembershipCustomFields,
|
|
1869
|
+
listMembershipStatusChanges: () => listMembershipStatusChanges,
|
|
1870
|
+
listMembershipTypeDiscounts: () => listMembershipTypeDiscounts,
|
|
1871
|
+
listMembershipTypeDurationBillingItems: () => listMembershipTypeDurationBillingItems,
|
|
1872
|
+
listMembershipTypeRecurringServiceItems: () => listMembershipTypeRecurringServiceItems,
|
|
1873
|
+
listMembershipTypes: () => listMembershipTypes,
|
|
1874
|
+
listMemberships: () => listMemberships,
|
|
1875
|
+
listRecurringServiceEvents: () => listRecurringServiceEvents,
|
|
1876
|
+
listRecurringServiceTypes: () => listRecurringServiceTypes,
|
|
1877
|
+
listRecurringServices: () => listRecurringServices,
|
|
1878
|
+
markRecurringServiceEventComplete: () => markRecurringServiceEventComplete,
|
|
1879
|
+
markRecurringServiceEventIncomplete: () => markRecurringServiceEventIncomplete,
|
|
1880
|
+
membershipSale: () => membershipSale,
|
|
1881
|
+
updateInvoiceTemplate: () => updateInvoiceTemplate,
|
|
1882
|
+
updateMembership: () => updateMembership,
|
|
1883
|
+
updateRecurringService: () => updateRecurringService
|
|
1884
|
+
});
|
|
1885
|
+
|
|
1886
|
+
// src/resources/memberships/export.ts
|
|
1887
|
+
async function exportInvoiceTemplates(client, params = {}) {
|
|
1888
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "invoice-templates" });
|
|
1889
|
+
return client.request("get", path, { params });
|
|
1890
|
+
}
|
|
1891
|
+
async function exportMembershipStatusChanges(client, params = {}) {
|
|
1892
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "membership-status-changes" });
|
|
1893
|
+
return client.request("get", path, { params });
|
|
1894
|
+
}
|
|
1895
|
+
async function exportMembershipTypes(client, params = {}) {
|
|
1896
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "membership-types" });
|
|
1897
|
+
return client.request("get", path, { params });
|
|
1898
|
+
}
|
|
1899
|
+
async function exportMemberships(client, params = {}) {
|
|
1900
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "memberships" });
|
|
1901
|
+
return client.request("get", path, { params });
|
|
1902
|
+
}
|
|
1903
|
+
async function exportRecurringServiceEvents(client, params = {}) {
|
|
1904
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "recurring-service-events" });
|
|
1905
|
+
return client.request("get", path, { params });
|
|
1906
|
+
}
|
|
1907
|
+
async function exportRecurringServiceTypes(client, params = {}) {
|
|
1908
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "recurring-service-types" });
|
|
1909
|
+
return client.request("get", path, { params });
|
|
1910
|
+
}
|
|
1911
|
+
async function exportRecurringServices(client, params = {}) {
|
|
1912
|
+
const path = client.buildPath({ category: "memberships", subject: "export", idOrSubpath: "recurring-services" });
|
|
1913
|
+
return client.request("get", path, { params });
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
// src/resources/memberships/memberships.ts
|
|
1917
|
+
async function listMemberships(client, params = {}) {
|
|
1918
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships" });
|
|
1919
|
+
return client.request("get", path, { params });
|
|
1920
|
+
}
|
|
1921
|
+
async function listMembershipCustomFields(client) {
|
|
1922
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships", idOrSubpath: "custom-fields" });
|
|
1923
|
+
return client.request("get", path);
|
|
1924
|
+
}
|
|
1925
|
+
async function membershipSale(client, data) {
|
|
1926
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships", idOrSubpath: "sale" });
|
|
1927
|
+
return client.request("post", path, { data });
|
|
1928
|
+
}
|
|
1929
|
+
async function getMembership(client, id) {
|
|
1930
|
+
if (!id) throw new Error("id is required");
|
|
1931
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships", idOrSubpath: String(id) });
|
|
1932
|
+
return client.request("get", path);
|
|
1933
|
+
}
|
|
1934
|
+
async function updateMembership(client, id, data) {
|
|
1935
|
+
if (!id) throw new Error("id is required");
|
|
1936
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships", idOrSubpath: String(id) });
|
|
1937
|
+
return client.request("put", path, { data });
|
|
1938
|
+
}
|
|
1939
|
+
async function listMembershipStatusChanges(client, id) {
|
|
1940
|
+
if (!id) throw new Error("id is required");
|
|
1941
|
+
const path = client.buildPath({ category: "memberships", subject: "memberships", idOrSubpath: `${id}/status-changes` });
|
|
1942
|
+
return client.request("get", path);
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// src/resources/memberships/invoice-templates.ts
|
|
1946
|
+
async function listInvoiceTemplates(client, params = {}) {
|
|
1947
|
+
const path = client.buildPath({ category: "memberships", subject: "invoice-templates" });
|
|
1948
|
+
return client.request("get", path, { params });
|
|
1949
|
+
}
|
|
1950
|
+
async function getInvoiceTemplate(client, id) {
|
|
1951
|
+
if (!id) throw new Error("id is required");
|
|
1952
|
+
const path = client.buildPath({ category: "memberships", subject: "invoice-templates", idOrSubpath: String(id) });
|
|
1953
|
+
return client.request("get", path);
|
|
1954
|
+
}
|
|
1955
|
+
async function updateInvoiceTemplate(client, id, data) {
|
|
1956
|
+
if (!id) throw new Error("id is required");
|
|
1957
|
+
const path = client.buildPath({ category: "memberships", subject: "invoice-templates", idOrSubpath: String(id) });
|
|
1958
|
+
return client.request("put", path, { data });
|
|
1959
|
+
}
|
|
1960
|
+
async function listInvoiceTemplatesByIds(client, ids) {
|
|
1961
|
+
const params = {};
|
|
1962
|
+
if (ids && ids.length > 0) {
|
|
1963
|
+
params.ids = ids.join(",");
|
|
1964
|
+
}
|
|
1965
|
+
const path = client.buildPath({ category: "memberships", subject: "invoice-templates" });
|
|
1966
|
+
return client.request("get", path, { params });
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
// src/resources/memberships/recurring-service-events.ts
|
|
1970
|
+
async function listRecurringServiceEvents(client, params = {}) {
|
|
1971
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-service-events" });
|
|
1972
|
+
return client.request("get", path, { params });
|
|
1973
|
+
}
|
|
1974
|
+
async function markRecurringServiceEventComplete(client, id) {
|
|
1975
|
+
if (!id) throw new Error("id is required");
|
|
1976
|
+
const path = client.buildPath({ category: "memberships", subject: `recurring-service-events/${id}/mark-complete` });
|
|
1977
|
+
return client.request("post", path);
|
|
1978
|
+
}
|
|
1979
|
+
async function markRecurringServiceEventIncomplete(client, id) {
|
|
1980
|
+
if (!id) throw new Error("id is required");
|
|
1981
|
+
const path = client.buildPath({ category: "memberships", subject: `recurring-service-events/${id}/mark-incomplete` });
|
|
1982
|
+
return client.request("post", path);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
// src/resources/memberships/recurring-services.ts
|
|
1986
|
+
async function listRecurringServices(client, params = {}) {
|
|
1987
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-services" });
|
|
1988
|
+
return client.request("get", path, { params });
|
|
1989
|
+
}
|
|
1990
|
+
async function getRecurringService(client, id) {
|
|
1991
|
+
if (!id) throw new Error("id is required");
|
|
1992
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-services", idOrSubpath: String(id) });
|
|
1993
|
+
return client.request("get", path);
|
|
1994
|
+
}
|
|
1995
|
+
async function updateRecurringService(client, id, data) {
|
|
1996
|
+
if (!id) throw new Error("id is required");
|
|
1997
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-services", idOrSubpath: String(id) });
|
|
1998
|
+
return client.request("put", path, { data });
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
// src/resources/memberships/membership-types.ts
|
|
2002
|
+
async function listMembershipTypes(client, params = {}) {
|
|
2003
|
+
const path = client.buildPath({ category: "memberships", subject: "membership-types" });
|
|
2004
|
+
return client.request("get", path, { params });
|
|
2005
|
+
}
|
|
2006
|
+
async function getMembershipType(client, id) {
|
|
2007
|
+
if (!id) throw new Error("id is required");
|
|
2008
|
+
const path = client.buildPath({ category: "memberships", subject: "membership-types", idOrSubpath: String(id) });
|
|
2009
|
+
return client.request("get", path);
|
|
2010
|
+
}
|
|
2011
|
+
async function listMembershipTypeDiscounts(client, id) {
|
|
2012
|
+
if (!id) throw new Error("id is required");
|
|
2013
|
+
const path = client.buildPath({ category: "memberships", subject: `membership-types/${id}/discounts` });
|
|
2014
|
+
return client.request("get", path);
|
|
2015
|
+
}
|
|
2016
|
+
async function listMembershipTypeDurationBillingItems(client, id) {
|
|
2017
|
+
if (!id) throw new Error("id is required");
|
|
2018
|
+
const path = client.buildPath({ category: "memberships", subject: `membership-types/${id}/duration-billing-items` });
|
|
2019
|
+
return client.request("get", path);
|
|
2020
|
+
}
|
|
2021
|
+
async function listMembershipTypeRecurringServiceItems(client, id) {
|
|
2022
|
+
if (!id) throw new Error("id is required");
|
|
2023
|
+
const path = client.buildPath({ category: "memberships", subject: `membership-types/${id}/recurring-service-items` });
|
|
2024
|
+
return client.request("get", path);
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
// src/resources/memberships/recurring-service-types.ts
|
|
2028
|
+
async function listRecurringServiceTypes(client, params = {}) {
|
|
2029
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-service-types" });
|
|
2030
|
+
return client.request("get", path, { params });
|
|
2031
|
+
}
|
|
2032
|
+
async function getRecurringServiceType(client, id) {
|
|
2033
|
+
if (!id) throw new Error("id is required");
|
|
2034
|
+
const path = client.buildPath({ category: "memberships", subject: "recurring-service-types", idOrSubpath: String(id) });
|
|
2035
|
+
return client.request("get", path);
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
// src/resources/payroll/index.ts
|
|
2039
|
+
var payroll_exports = {};
|
|
2040
|
+
__export(payroll_exports, {
|
|
2041
|
+
createGrossPayItem: () => createGrossPayItem,
|
|
2042
|
+
createPayrollAdjustment: () => createPayrollAdjustment,
|
|
2043
|
+
exportActivityCodes: () => exportActivityCodes,
|
|
2044
|
+
exportGrossPayItems: () => exportGrossPayItems,
|
|
2045
|
+
exportJobSplits: () => exportJobSplits,
|
|
2046
|
+
exportJobTimesheets: () => exportJobTimesheets,
|
|
2047
|
+
exportPayrollAdjustments: () => exportPayrollAdjustments,
|
|
2048
|
+
exportPayrollSettings: () => exportPayrollSettings,
|
|
2049
|
+
exportTimesheetCodes: () => exportTimesheetCodes,
|
|
2050
|
+
getActivityCode: () => getActivityCode,
|
|
2051
|
+
getEmployeePayrollSettings: () => getEmployeePayrollSettings,
|
|
2052
|
+
getGrossPayItem: () => getGrossPayItem,
|
|
2053
|
+
getPayrollAdjustment: () => getPayrollAdjustment,
|
|
2054
|
+
getPayrollSettings: () => getPayrollSettings,
|
|
2055
|
+
getTechnicianPayrollSettings: () => getTechnicianPayrollSettings,
|
|
2056
|
+
getTimesheetCode: () => getTimesheetCode,
|
|
2057
|
+
listActivityCodes: () => listActivityCodes,
|
|
2058
|
+
listEmployeePayrolls: () => listEmployeePayrolls,
|
|
2059
|
+
listGrossPayItems: () => listGrossPayItems,
|
|
2060
|
+
listJobSplits: () => listJobSplits,
|
|
2061
|
+
listJobSplitsByJob: () => listJobSplitsByJob,
|
|
2062
|
+
listJobTimesheets: () => listJobTimesheets,
|
|
2063
|
+
listLocationLaborRates: () => listLocationLaborRates,
|
|
2064
|
+
listNonJobTimesheets: () => listNonJobTimesheets,
|
|
2065
|
+
listPayrollAdjustments: () => listPayrollAdjustments,
|
|
2066
|
+
listPayrolls: () => listPayrolls,
|
|
2067
|
+
listTechnicianPayrolls: () => listTechnicianPayrolls,
|
|
2068
|
+
listTimesheetCodes: () => listTimesheetCodes,
|
|
2069
|
+
listTimesheetsForJob: () => listTimesheetsForJob,
|
|
2070
|
+
updateEmployeePayrollSettings: () => updateEmployeePayrollSettings,
|
|
2071
|
+
updateGrossPayItem: () => updateGrossPayItem,
|
|
2072
|
+
updateTechnicianPayrollSettings: () => updateTechnicianPayrollSettings
|
|
2073
|
+
});
|
|
2074
|
+
|
|
2075
|
+
// src/resources/payroll/export.ts
|
|
2076
|
+
async function exportActivityCodes(client, params = {}) {
|
|
2077
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "activity-codes" });
|
|
2078
|
+
return client.request("get", path, { params });
|
|
2079
|
+
}
|
|
2080
|
+
async function exportGrossPayItems(client, params = {}) {
|
|
2081
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "gross-pay-items" });
|
|
2082
|
+
return client.request("get", path, { params });
|
|
2083
|
+
}
|
|
2084
|
+
async function exportJobSplits(client, params = {}) {
|
|
2085
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "jobs/splits" });
|
|
2086
|
+
return client.request("get", path, { params });
|
|
2087
|
+
}
|
|
2088
|
+
async function exportJobTimesheets(client, params = {}) {
|
|
2089
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "jobs/timesheets" });
|
|
2090
|
+
return client.request("get", path, { params });
|
|
2091
|
+
}
|
|
2092
|
+
async function exportPayrollAdjustments(client, params = {}) {
|
|
2093
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "payroll-adjustments" });
|
|
2094
|
+
return client.request("get", path, { params });
|
|
2095
|
+
}
|
|
2096
|
+
async function exportPayrollSettings(client, params = {}) {
|
|
2097
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "payroll-settings" });
|
|
2098
|
+
return client.request("get", path, { params });
|
|
2099
|
+
}
|
|
2100
|
+
async function exportTimesheetCodes(client, params = {}) {
|
|
2101
|
+
const path = client.buildPath({ category: "payroll", subject: "export", idOrSubpath: "timesheet-codes" });
|
|
2102
|
+
return client.request("get", path, { params });
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
// src/resources/payroll/activity-codes.ts
|
|
2106
|
+
async function listActivityCodes(client, params = {}) {
|
|
2107
|
+
const path = client.buildPath({ category: "payroll", subject: "activity-codes" });
|
|
2108
|
+
return client.request("get", path, { params });
|
|
2109
|
+
}
|
|
2110
|
+
async function getActivityCode(client, id) {
|
|
2111
|
+
if (!id) throw new Error("id is required");
|
|
2112
|
+
const path = client.buildPath({ category: "payroll", subject: "activity-codes", idOrSubpath: String(id) });
|
|
2113
|
+
return client.request("get", path);
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// src/resources/payroll/gross-pay-items.ts
|
|
2117
|
+
async function listGrossPayItems(client, params = {}) {
|
|
2118
|
+
const path = client.buildPath({ category: "payroll", subject: "gross-pay-items" });
|
|
2119
|
+
return client.request("get", path, { params });
|
|
2120
|
+
}
|
|
2121
|
+
async function createGrossPayItem(client, data) {
|
|
2122
|
+
const path = client.buildPath({ category: "payroll", subject: "gross-pay-items" });
|
|
2123
|
+
return client.request("post", path, { data });
|
|
2124
|
+
}
|
|
2125
|
+
async function getGrossPayItem(client, id) {
|
|
2126
|
+
if (!id) throw new Error("id is required");
|
|
2127
|
+
const path = client.buildPath({ category: "payroll", subject: "gross-pay-items", idOrSubpath: String(id) });
|
|
2128
|
+
return client.request("get", path);
|
|
2129
|
+
}
|
|
2130
|
+
async function updateGrossPayItem(client, id, data) {
|
|
2131
|
+
if (!id) throw new Error("id is required");
|
|
2132
|
+
const path = client.buildPath({ category: "payroll", subject: "gross-pay-items", idOrSubpath: String(id) });
|
|
2133
|
+
return client.request("put", path, { data });
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
// src/resources/payroll/job-splits.ts
|
|
2137
|
+
async function listJobSplits(client, params = {}) {
|
|
2138
|
+
const path = client.buildPath({ category: "payroll", subject: "jobs/splits" });
|
|
2139
|
+
return client.request("get", path, { params });
|
|
2140
|
+
}
|
|
2141
|
+
async function listJobSplitsByJob(client, jobId) {
|
|
2142
|
+
if (!jobId) throw new Error("job is required");
|
|
2143
|
+
const path = client.buildPath({ category: "payroll", subject: `jobs/${jobId}/splits` });
|
|
2144
|
+
return client.request("get", path);
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
// src/resources/payroll/location-labor-type.ts
|
|
2148
|
+
async function listLocationLaborRates(client, params = {}) {
|
|
2149
|
+
const path = client.buildPath({ category: "payroll", subject: "locations/rates" });
|
|
2150
|
+
return client.request("get", path, { params });
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
// src/resources/payroll/payroll-adjustments.ts
|
|
2154
|
+
async function listPayrollAdjustments(client, params = {}) {
|
|
2155
|
+
const path = client.buildPath({ category: "payroll", subject: "payroll-adjustments" });
|
|
2156
|
+
return client.request("get", path, { params });
|
|
2157
|
+
}
|
|
2158
|
+
async function createPayrollAdjustment(client, data) {
|
|
2159
|
+
const path = client.buildPath({ category: "payroll", subject: "payroll-adjustments" });
|
|
2160
|
+
return client.request("post", path, { data });
|
|
2161
|
+
}
|
|
2162
|
+
async function getPayrollAdjustment(client, id) {
|
|
2163
|
+
if (!id) throw new Error("id is required");
|
|
2164
|
+
const path = client.buildPath({ category: "payroll", subject: "payroll-adjustments", idOrSubpath: String(id) });
|
|
2165
|
+
return client.request("get", path);
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
// src/resources/payroll/payrolls.ts
|
|
2169
|
+
async function listEmployeePayrolls(client, employeeId, params = {}) {
|
|
2170
|
+
if (!employeeId) throw new Error("employee is required");
|
|
2171
|
+
const path = client.buildPath({ category: "payroll", subject: `employees/${employeeId}/payrolls` });
|
|
2172
|
+
return client.request("get", path, { params });
|
|
2173
|
+
}
|
|
2174
|
+
async function listPayrolls(client, params = {}) {
|
|
2175
|
+
const path = client.buildPath({ category: "payroll", subject: "payrolls" });
|
|
2176
|
+
return client.request("get", path, { params });
|
|
2177
|
+
}
|
|
2178
|
+
async function listTechnicianPayrolls(client, technicianId, params = {}) {
|
|
2179
|
+
if (!technicianId) throw new Error("technician is required");
|
|
2180
|
+
const path = client.buildPath({ category: "payroll", subject: `technicians/${technicianId}/payrolls` });
|
|
2181
|
+
return client.request("get", path, { params });
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
// src/resources/payroll/payroll-settings.ts
|
|
2185
|
+
async function getEmployeePayrollSettings(client, employeeId, params = {}) {
|
|
2186
|
+
if (!employeeId) throw new Error("employee is required");
|
|
2187
|
+
const path = client.buildPath({ category: "payroll", subject: `employees/${employeeId}/payroll-settings` });
|
|
2188
|
+
return client.request("get", path, { params });
|
|
2189
|
+
}
|
|
2190
|
+
async function updateEmployeePayrollSettings(client, employeeId, data) {
|
|
2191
|
+
if (!employeeId) throw new Error("employee is required");
|
|
2192
|
+
const path = client.buildPath({ category: "payroll", subject: `employees/${employeeId}/payroll-settings` });
|
|
2193
|
+
return client.request("put", path, { data });
|
|
2194
|
+
}
|
|
2195
|
+
async function getPayrollSettings(client, params = {}) {
|
|
2196
|
+
const path = client.buildPath({ category: "payroll", subject: "payroll-settings" });
|
|
2197
|
+
return client.request("get", path, { params });
|
|
2198
|
+
}
|
|
2199
|
+
async function getTechnicianPayrollSettings(client, technicianId, params = {}) {
|
|
2200
|
+
if (!technicianId) throw new Error("technician is required");
|
|
2201
|
+
const path = client.buildPath({ category: "payroll", subject: `technicians/${technicianId}/payroll-settings` });
|
|
2202
|
+
return client.request("get", path, { params });
|
|
2203
|
+
}
|
|
2204
|
+
async function updateTechnicianPayrollSettings(client, technicianId, data) {
|
|
2205
|
+
if (!technicianId) throw new Error("technician is required");
|
|
2206
|
+
const path = client.buildPath({ category: "payroll", subject: `technicians/${technicianId}/payroll-settings` });
|
|
2207
|
+
return client.request("put", path, { data });
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
// src/resources/payroll/timesheet-codes.ts
|
|
2211
|
+
async function listTimesheetCodes(client, params = {}) {
|
|
2212
|
+
const path = client.buildPath({ category: "payroll", subject: "timesheet-codes" });
|
|
2213
|
+
return client.request("get", path, { params });
|
|
2214
|
+
}
|
|
2215
|
+
async function getTimesheetCode(client, id) {
|
|
2216
|
+
if (!id) throw new Error("id is required");
|
|
2217
|
+
const path = client.buildPath({ category: "payroll", subject: "timesheet-codes", idOrSubpath: String(id) });
|
|
2218
|
+
return client.request("get", path);
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
// src/resources/payroll/timesheets.ts
|
|
2222
|
+
async function listJobTimesheets(client, params = {}) {
|
|
2223
|
+
const path = client.buildPath({ category: "payroll", subject: "jobs/timesheets" });
|
|
2224
|
+
return client.request("get", path, { params });
|
|
2225
|
+
}
|
|
2226
|
+
async function listTimesheetsForJob(client, jobId, params = {}) {
|
|
2227
|
+
if (!jobId) throw new Error("job is required");
|
|
2228
|
+
const path = client.buildPath({ category: "payroll", subject: `jobs/${jobId}/timesheets` });
|
|
2229
|
+
return client.request("get", path, { params });
|
|
2230
|
+
}
|
|
2231
|
+
async function listNonJobTimesheets(client, params = {}) {
|
|
2232
|
+
const path = client.buildPath({ category: "payroll", subject: "non-job-timesheets" });
|
|
2233
|
+
return client.request("get", path, { params });
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
// src/resources/forms/index.ts
|
|
2237
|
+
var forms_exports = {};
|
|
2238
|
+
__export(forms_exports, {
|
|
2239
|
+
getJobAttachment: () => getJobAttachment,
|
|
2240
|
+
listFormSubmissions: () => listFormSubmissions,
|
|
2241
|
+
listForms: () => listForms,
|
|
2242
|
+
listJobAttachments: () => listJobAttachments,
|
|
2243
|
+
listJobAttachmentsByJobId: () => listJobAttachmentsByJobId
|
|
2244
|
+
});
|
|
2245
|
+
|
|
2246
|
+
// src/resources/forms/forms.ts
|
|
2247
|
+
async function listForms(client, params = {}) {
|
|
2248
|
+
const path = client.buildPath({ category: "forms", subject: "forms" });
|
|
2249
|
+
return client.request("get", path, { params });
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
// src/resources/forms/submissions.ts
|
|
2253
|
+
async function listFormSubmissions(client, params = {}) {
|
|
2254
|
+
const path = client.buildPath({ category: "forms", subject: "submissions" });
|
|
2255
|
+
return client.request("get", path, { params });
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
// src/resources/forms/jobs.ts
|
|
2259
|
+
async function getJobAttachment(client, id) {
|
|
2260
|
+
if (!id) throw new Error("id is required");
|
|
2261
|
+
const path = client.buildPath({ category: "forms", subject: `jobs/attachment/${id}` });
|
|
2262
|
+
return client.request("get", path);
|
|
2263
|
+
}
|
|
2264
|
+
async function listJobAttachments(client, id) {
|
|
2265
|
+
if (!id) throw new Error("id is required");
|
|
2266
|
+
const path = client.buildPath({ category: "forms", subject: `jobs/${id}/attachments` });
|
|
2267
|
+
return client.request("get", path);
|
|
2268
|
+
}
|
|
2269
|
+
async function listJobAttachmentsByJobId(client, jobId) {
|
|
2270
|
+
if (!jobId) throw new Error("jobId is required");
|
|
2271
|
+
const path = client.buildPath({ category: "forms", subject: `jobs/${jobId}/attachments` });
|
|
2272
|
+
return client.request("get", path);
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
// src/resources/customer-interactions/index.ts
|
|
2276
|
+
var customer_interactions_exports = {};
|
|
2277
|
+
__export(customer_interactions_exports, {
|
|
2278
|
+
updateTechnicianRating: () => updateTechnicianRating
|
|
2279
|
+
});
|
|
2280
|
+
|
|
2281
|
+
// src/resources/customer-interactions/technician-rating.ts
|
|
2282
|
+
async function updateTechnicianRating(client, technicianId, jobId, data) {
|
|
2283
|
+
if (!technicianId || !jobId) throw new Error("technicianId and jobId are required");
|
|
2284
|
+
const path = client.buildPath({ category: "customer-interactions", subject: `technician-rating/technician/${technicianId}/job/${jobId}` });
|
|
2285
|
+
return client.request("put", path, { data });
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
// src/resources/job-bookings/index.ts
|
|
2289
|
+
var job_bookings_exports = {};
|
|
2290
|
+
__export(job_bookings_exports, {
|
|
2291
|
+
listCallReasons: () => listCallReasons
|
|
2292
|
+
});
|
|
2293
|
+
|
|
2294
|
+
// src/resources/job-bookings/call-reasons.ts
|
|
2295
|
+
async function listCallReasons(client, params = {}) {
|
|
2296
|
+
const path = client.buildPath({ category: "jbce", subject: "call-reasons" });
|
|
2297
|
+
return client.request("get", path, { params });
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
// src/resources/marketing/index.ts
|
|
2301
|
+
var marketing_exports = {};
|
|
2302
|
+
__export(marketing_exports, {
|
|
2303
|
+
createCampaign: () => createCampaign,
|
|
2304
|
+
createCampaignCategory: () => createCampaignCategory,
|
|
2305
|
+
createCampaignCost: () => createCampaignCost,
|
|
2306
|
+
getCampaign: () => getCampaign,
|
|
2307
|
+
getCampaignCategory: () => getCampaignCategory,
|
|
2308
|
+
getCampaignCost: () => getCampaignCost,
|
|
2309
|
+
getSuppressionByEmail: () => getSuppressionByEmail,
|
|
2310
|
+
listCampaignCategories: () => listCampaignCategories,
|
|
2311
|
+
listCampaignCosts: () => listCampaignCosts,
|
|
2312
|
+
listCampaignCostsForCampaign: () => listCampaignCostsForCampaign,
|
|
2313
|
+
listCampaigns: () => listCampaigns,
|
|
2314
|
+
listSuppressions: () => listSuppressions,
|
|
2315
|
+
suppressEmail: () => suppressEmail,
|
|
2316
|
+
unsuppressEmail: () => unsuppressEmail,
|
|
2317
|
+
updateCampaign: () => updateCampaign,
|
|
2318
|
+
updateCampaignCategory: () => updateCampaignCategory,
|
|
2319
|
+
updateCampaignCost: () => updateCampaignCost
|
|
2320
|
+
});
|
|
2321
|
+
|
|
2322
|
+
// src/resources/marketing/categories.ts
|
|
2323
|
+
async function listCampaignCategories(client, params = {}) {
|
|
2324
|
+
const path = client.buildPath({ category: "marketing", subject: "categories" });
|
|
2325
|
+
return client.request("get", path, { params });
|
|
2326
|
+
}
|
|
2327
|
+
async function createCampaignCategory(client, data) {
|
|
2328
|
+
const path = client.buildPath({ category: "marketing", subject: "categories" });
|
|
2329
|
+
return client.request("post", path, { data });
|
|
2330
|
+
}
|
|
2331
|
+
async function getCampaignCategory(client, id) {
|
|
2332
|
+
if (!id) throw new Error("id is required");
|
|
2333
|
+
const path = client.buildPath({ category: "marketing", subject: "categories", idOrSubpath: String(id) });
|
|
2334
|
+
return client.request("get", path);
|
|
2335
|
+
}
|
|
2336
|
+
async function updateCampaignCategory(client, id, data) {
|
|
2337
|
+
if (!id) throw new Error("id is required");
|
|
2338
|
+
const path = client.buildPath({ category: "marketing", subject: "categories", idOrSubpath: String(id) });
|
|
2339
|
+
return client.request("put", path, { data });
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
// src/resources/marketing/costs.ts
|
|
2343
|
+
async function listCampaignCosts(client, params = {}) {
|
|
2344
|
+
const path = client.buildPath({ category: "marketing", subject: "costs" });
|
|
2345
|
+
return client.request("get", path, { params });
|
|
2346
|
+
}
|
|
2347
|
+
async function createCampaignCost(client, data) {
|
|
2348
|
+
const path = client.buildPath({ category: "marketing", subject: "costs" });
|
|
2349
|
+
return client.request("post", path, { data });
|
|
2350
|
+
}
|
|
2351
|
+
async function getCampaignCost(client, id) {
|
|
2352
|
+
if (!id) throw new Error("id is required");
|
|
2353
|
+
const path = client.buildPath({ category: "marketing", subject: "costs", idOrSubpath: String(id) });
|
|
2354
|
+
return client.request("get", path);
|
|
2355
|
+
}
|
|
2356
|
+
async function updateCampaignCost(client, id, data) {
|
|
2357
|
+
if (!id) throw new Error("id is required");
|
|
2358
|
+
const path = client.buildPath({ category: "marketing", subject: "costs", idOrSubpath: String(id) });
|
|
2359
|
+
return client.request("put", path, { data });
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// src/resources/marketing/campaigns.ts
|
|
2363
|
+
async function listCampaigns(client, params = {}) {
|
|
2364
|
+
const path = client.buildPath({ category: "marketing", subject: "campaigns" });
|
|
2365
|
+
return client.request("get", path, { params });
|
|
2366
|
+
}
|
|
2367
|
+
async function createCampaign(client, data) {
|
|
2368
|
+
const path = client.buildPath({ category: "marketing", subject: "campaigns" });
|
|
2369
|
+
return client.request("post", path, { data });
|
|
2370
|
+
}
|
|
2371
|
+
async function getCampaign(client, id) {
|
|
2372
|
+
if (!id) throw new Error("id is required");
|
|
2373
|
+
const path = client.buildPath({ category: "marketing", subject: "campaigns", idOrSubpath: String(id) });
|
|
2374
|
+
return client.request("get", path);
|
|
2375
|
+
}
|
|
2376
|
+
async function updateCampaign(client, id, data) {
|
|
2377
|
+
if (!id) throw new Error("id is required");
|
|
2378
|
+
const path = client.buildPath({ category: "marketing", subject: "campaigns", idOrSubpath: String(id) });
|
|
2379
|
+
return client.request("put", path, { data });
|
|
2380
|
+
}
|
|
2381
|
+
async function listCampaignCostsForCampaign(client, id, params = {}) {
|
|
2382
|
+
if (!id) throw new Error("id is required");
|
|
2383
|
+
const path = client.buildPath({ category: "marketing", subject: `campaigns/${id}/costs` });
|
|
2384
|
+
return client.request("get", path, { params });
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
// src/resources/marketing/suppressions.ts
|
|
2388
|
+
async function listSuppressions(client, params = {}) {
|
|
2389
|
+
const path = client.buildPath({ category: "marketing", subject: "suppressions" });
|
|
2390
|
+
return client.request("get", path, { params });
|
|
2391
|
+
}
|
|
2392
|
+
async function suppressEmail(client, data) {
|
|
2393
|
+
const path = client.buildPath({ category: "marketing", subject: "suppressions/suppress" });
|
|
2394
|
+
return client.request("post", path, { data });
|
|
2395
|
+
}
|
|
2396
|
+
async function unsuppressEmail(client, data) {
|
|
2397
|
+
const path = client.buildPath({ category: "marketing", subject: "suppressions/unsuppress" });
|
|
2398
|
+
return client.request("post", path, { data });
|
|
2399
|
+
}
|
|
2400
|
+
async function getSuppressionByEmail(client, email) {
|
|
2401
|
+
if (!email) throw new Error("email is required");
|
|
2402
|
+
const encoded = encodeURIComponent(email);
|
|
2403
|
+
const path = client.buildPath({ category: "marketing", subject: `suppressions/${encoded}` });
|
|
2404
|
+
return client.request("get", path);
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
// src/resources/marketing-ads/index.ts
|
|
2408
|
+
var marketing_ads_exports = {};
|
|
2409
|
+
__export(marketing_ads_exports, {
|
|
2410
|
+
getPerformance: () => getPerformance,
|
|
2411
|
+
listAttributedLeads: () => listAttributedLeads,
|
|
2412
|
+
listCapacityWarnings: () => listCapacityWarnings,
|
|
2413
|
+
listExternalCallAttributions: () => listExternalCallAttributions,
|
|
2414
|
+
listScheduledJobAttributions: () => listScheduledJobAttributions,
|
|
2415
|
+
listWebBookingAttributions: () => listWebBookingAttributions,
|
|
2416
|
+
listWebLeadFormAttributions: () => listWebLeadFormAttributions
|
|
2417
|
+
});
|
|
2418
|
+
|
|
2419
|
+
// src/resources/marketing-ads/attributed-leads.ts
|
|
2420
|
+
async function listAttributedLeads(client, params) {
|
|
2421
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "attributed-leads" });
|
|
2422
|
+
return client.request("get", path, { params });
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
// src/resources/marketing-ads/capacity-warnings.ts
|
|
2426
|
+
async function listCapacityWarnings(client, params = {}) {
|
|
2427
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "capacity-warnings" });
|
|
2428
|
+
return client.request("get", path, { params });
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
// src/resources/marketing-ads/external-call-attributions.ts
|
|
2432
|
+
async function listExternalCallAttributions(client, params = {}) {
|
|
2433
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "external-call-attributions" });
|
|
2434
|
+
return client.request("get", path, { params });
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
// src/resources/marketing-ads/performance.ts
|
|
2438
|
+
async function getPerformance(client, params) {
|
|
2439
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "performance" });
|
|
2440
|
+
return client.request("get", path, { params });
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
// src/resources/marketing-ads/scheduled-job-attributions.ts
|
|
2444
|
+
async function listScheduledJobAttributions(client, params = {}) {
|
|
2445
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "job-attributions" });
|
|
2446
|
+
return client.request("get", path, { params });
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
// src/resources/marketing-ads/web-booking-attributions.ts
|
|
2450
|
+
async function listWebBookingAttributions(client, params = {}) {
|
|
2451
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "web-booking-attributions" });
|
|
2452
|
+
return client.request("get", path, { params });
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
// src/resources/marketing-ads/web-lead-form-attributions.ts
|
|
2456
|
+
async function listWebLeadFormAttributions(client, params = {}) {
|
|
2457
|
+
const path = client.buildPath({ category: "marketing-ads", subject: "web-lead-form-attributions" });
|
|
2458
|
+
return client.request("get", path, { params });
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
// src/resources/reporting/index.ts
|
|
2462
|
+
var reporting_exports = {};
|
|
2463
|
+
__export(reporting_exports, {
|
|
2464
|
+
getDynamicValueSet: () => getDynamicValueSet,
|
|
2465
|
+
getReport: () => getReport,
|
|
2466
|
+
getReportData: () => getReportData,
|
|
2467
|
+
listReportCategories: () => listReportCategories,
|
|
2468
|
+
listReportsForCategory: () => listReportsForCategory
|
|
2469
|
+
});
|
|
2470
|
+
|
|
2471
|
+
// src/resources/reporting/dynamic-value-sets.ts
|
|
2472
|
+
async function getDynamicValueSet(client, dynamicSetId, params = {}) {
|
|
2473
|
+
if (!dynamicSetId) throw new Error("dynamicSetId is required");
|
|
2474
|
+
const path = client.buildPath({ category: "reporting", subject: `dynamic-value-sets/${dynamicSetId}` });
|
|
2475
|
+
return client.request("get", path, { params });
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
// src/resources/reporting/report-categories.ts
|
|
2479
|
+
async function listReportCategories(client, params = {}) {
|
|
2480
|
+
const path = client.buildPath({ category: "reporting", subject: "report-categories" });
|
|
2481
|
+
return client.request("get", path, { params });
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
// src/resources/reporting/report-category-reports.ts
|
|
2485
|
+
async function listReportsForCategory(client, reportCategory, params = {}) {
|
|
2486
|
+
if (!reportCategory) throw new Error("report_category is required");
|
|
2487
|
+
const path = client.buildPath({ category: "reporting", subject: `${reportCategory}/reports` });
|
|
2488
|
+
return client.request("get", path, { params });
|
|
2489
|
+
}
|
|
2490
|
+
async function getReport(client, reportCategory, reportId) {
|
|
2491
|
+
if (!reportCategory || !reportId) throw new Error("report_category and reportId are required");
|
|
2492
|
+
const path = client.buildPath({ category: "reporting", subject: `${reportCategory}/reports/${reportId}` });
|
|
2493
|
+
return client.request("get", path);
|
|
2494
|
+
}
|
|
2495
|
+
async function getReportData(client, reportCategory, reportId, params = {}) {
|
|
2496
|
+
if (!reportCategory || !reportId) throw new Error("report_category and reportId are required");
|
|
2497
|
+
const path = client.buildPath({ category: "reporting", subject: `${reportCategory}/reports/${reportId}/data` });
|
|
2498
|
+
return client.request("get", path, { params });
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
// src/resources/pricebook/index.ts
|
|
2502
|
+
var pricebook_exports = {};
|
|
2503
|
+
__export(pricebook_exports, {
|
|
2504
|
+
createCategory: () => createCategory,
|
|
2505
|
+
createDiscountOrFee: () => createDiscountOrFee,
|
|
2506
|
+
createEquipment: () => createEquipment,
|
|
2507
|
+
createMaterial: () => createMaterial,
|
|
2508
|
+
createMaterialsMarkup: () => createMaterialsMarkup,
|
|
2509
|
+
createService: () => createService,
|
|
2510
|
+
deleteCategory: () => deleteCategory,
|
|
2511
|
+
deleteDiscountOrFee: () => deleteDiscountOrFee,
|
|
2512
|
+
deleteEquipment: () => deleteEquipment,
|
|
2513
|
+
deleteMaterial: () => deleteMaterial,
|
|
2514
|
+
deleteService: () => deleteService,
|
|
2515
|
+
exportCategories: () => exportCategories,
|
|
2516
|
+
exportEquipment: () => exportEquipment,
|
|
2517
|
+
exportMaterials: () => exportMaterials,
|
|
2518
|
+
exportPricebook: () => exportPricebook,
|
|
2519
|
+
exportServices: () => exportServices,
|
|
2520
|
+
getCategory: () => getCategory,
|
|
2521
|
+
getClientSpecificPricingRateSheet: () => getClientSpecificPricingRateSheet,
|
|
2522
|
+
getDiscountOrFee: () => getDiscountOrFee,
|
|
2523
|
+
getEquipment: () => getEquipment,
|
|
2524
|
+
getMaterial: () => getMaterial,
|
|
2525
|
+
getMaterialsMarkup: () => getMaterialsMarkup,
|
|
2526
|
+
getService: () => getService,
|
|
2527
|
+
importPricebook: () => importPricebook,
|
|
2528
|
+
listCategories: () => listCategories,
|
|
2529
|
+
listClientSpecificPricing: () => listClientSpecificPricing,
|
|
2530
|
+
listDiscountsAndFees: () => listDiscountsAndFees,
|
|
2531
|
+
listEquipment: () => listEquipment,
|
|
2532
|
+
listImages: () => listImages,
|
|
2533
|
+
listMaterialCostTypes: () => listMaterialCostTypes,
|
|
2534
|
+
listMaterials: () => listMaterials,
|
|
2535
|
+
listMaterialsMarkup: () => listMaterialsMarkup,
|
|
2536
|
+
listServices: () => listServices,
|
|
2537
|
+
updateCategory: () => updateCategory,
|
|
2538
|
+
updateDiscountOrFee: () => updateDiscountOrFee,
|
|
2539
|
+
updateEquipment: () => updateEquipment,
|
|
2540
|
+
updateMaterial: () => updateMaterial,
|
|
2541
|
+
updateMaterialsMarkup: () => updateMaterialsMarkup,
|
|
2542
|
+
updateService: () => updateService,
|
|
2543
|
+
uploadImage: () => uploadImage
|
|
2544
|
+
});
|
|
2545
|
+
|
|
2546
|
+
// src/resources/pricebook/export.ts
|
|
2547
|
+
async function exportCategories(client, params = {}) {
|
|
2548
|
+
const path = client.buildPath({ category: "pricebook", subject: "export", idOrSubpath: "categories" });
|
|
2549
|
+
return client.request("get", path, { params });
|
|
2550
|
+
}
|
|
2551
|
+
async function exportEquipment(client, params = {}) {
|
|
2552
|
+
const path = client.buildPath({ category: "pricebook", subject: "export", idOrSubpath: "equipment" });
|
|
2553
|
+
return client.request("get", path, { params });
|
|
2554
|
+
}
|
|
2555
|
+
async function exportMaterials(client, params = {}) {
|
|
2556
|
+
const path = client.buildPath({ category: "pricebook", subject: "export", idOrSubpath: "materials" });
|
|
2557
|
+
return client.request("get", path, { params });
|
|
2558
|
+
}
|
|
2559
|
+
async function exportServices(client, params = {}) {
|
|
2560
|
+
const path = client.buildPath({ category: "pricebook", subject: "export", idOrSubpath: "services" });
|
|
2561
|
+
return client.request("get", path, { params });
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
// src/resources/pricebook/categories.ts
|
|
2565
|
+
async function listCategories(client, params = {}) {
|
|
2566
|
+
const path = client.buildPath({ category: "pricebook", subject: "categories" });
|
|
2567
|
+
return client.request("get", path, { params });
|
|
2568
|
+
}
|
|
2569
|
+
async function createCategory(client, data) {
|
|
2570
|
+
const path = client.buildPath({ category: "pricebook", subject: "categories" });
|
|
2571
|
+
return client.request("post", path, { data });
|
|
2572
|
+
}
|
|
2573
|
+
async function getCategory(client, id) {
|
|
2574
|
+
if (!id) throw new Error("id is required");
|
|
2575
|
+
const path = client.buildPath({ category: "pricebook", subject: "categories", idOrSubpath: String(id) });
|
|
2576
|
+
return client.request("get", path);
|
|
2577
|
+
}
|
|
2578
|
+
async function updateCategory(client, id, data) {
|
|
2579
|
+
if (!id) throw new Error("id is required");
|
|
2580
|
+
const path = client.buildPath({ category: "pricebook", subject: "categories", idOrSubpath: String(id) });
|
|
2581
|
+
return client.request("put", path, { data });
|
|
2582
|
+
}
|
|
2583
|
+
async function deleteCategory(client, id) {
|
|
2584
|
+
if (!id) throw new Error("id is required");
|
|
2585
|
+
const path = client.buildPath({ category: "pricebook", subject: "categories", idOrSubpath: String(id) });
|
|
2586
|
+
return client.request("delete", path);
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
// src/resources/pricebook/client-specific-pricing.ts
|
|
2590
|
+
async function listClientSpecificPricing(client, params = {}) {
|
|
2591
|
+
const path = client.buildPath({ category: "pricebook", subject: "clientspecificpricing" });
|
|
2592
|
+
return client.request("get", path, { params });
|
|
2593
|
+
}
|
|
2594
|
+
async function getClientSpecificPricingRateSheet(client, rateSheetId) {
|
|
2595
|
+
if (!rateSheetId) throw new Error("rateSheetId is required");
|
|
2596
|
+
const path = client.buildPath({ category: "pricebook", subject: `clientspecificpricing/${rateSheetId}` });
|
|
2597
|
+
return client.request("get", path);
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
// src/resources/pricebook/discounts-and-fees.ts
|
|
2601
|
+
async function listDiscountsAndFees(client, params = {}) {
|
|
2602
|
+
const path = client.buildPath({ category: "pricebook", subject: "discounts-and-fees" });
|
|
2603
|
+
return client.request("get", path, { params });
|
|
2604
|
+
}
|
|
2605
|
+
async function createDiscountOrFee(client, data) {
|
|
2606
|
+
const path = client.buildPath({ category: "pricebook", subject: "discounts-and-fees" });
|
|
2607
|
+
return client.request("post", path, { data });
|
|
2608
|
+
}
|
|
2609
|
+
async function getDiscountOrFee(client, id) {
|
|
2610
|
+
if (!id) throw new Error("id is required");
|
|
2611
|
+
const path = client.buildPath({ category: "pricebook", subject: "discounts-and-fees", idOrSubpath: String(id) });
|
|
2612
|
+
return client.request("get", path);
|
|
2613
|
+
}
|
|
2614
|
+
async function updateDiscountOrFee(client, id, data) {
|
|
2615
|
+
if (!id) throw new Error("id is required");
|
|
2616
|
+
const path = client.buildPath({ category: "pricebook", subject: "discounts-and-fees", idOrSubpath: String(id) });
|
|
2617
|
+
return client.request("put", path, { data });
|
|
2618
|
+
}
|
|
2619
|
+
async function deleteDiscountOrFee(client, id) {
|
|
2620
|
+
if (!id) throw new Error("id is required");
|
|
2621
|
+
const path = client.buildPath({ category: "pricebook", subject: "discounts-and-fees", idOrSubpath: String(id) });
|
|
2622
|
+
return client.request("delete", path);
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
// src/resources/pricebook/equipment.ts
|
|
2626
|
+
async function listEquipment(client, params = {}) {
|
|
2627
|
+
const path = client.buildPath({ category: "pricebook", subject: "equipment" });
|
|
2628
|
+
return client.request("get", path, { params });
|
|
2629
|
+
}
|
|
2630
|
+
async function createEquipment(client, data) {
|
|
2631
|
+
const path = client.buildPath({ category: "pricebook", subject: "equipment" });
|
|
2632
|
+
return client.request("post", path, { data });
|
|
2633
|
+
}
|
|
2634
|
+
async function getEquipment(client, id) {
|
|
2635
|
+
if (!id) throw new Error("id is required");
|
|
2636
|
+
const path = client.buildPath({ category: "pricebook", subject: "equipment", idOrSubpath: String(id) });
|
|
2637
|
+
return client.request("get", path);
|
|
2638
|
+
}
|
|
2639
|
+
async function updateEquipment(client, id, data) {
|
|
2640
|
+
if (!id) throw new Error("id is required");
|
|
2641
|
+
const path = client.buildPath({ category: "pricebook", subject: "equipment", idOrSubpath: String(id) });
|
|
2642
|
+
return client.request("put", path, { data });
|
|
2643
|
+
}
|
|
2644
|
+
async function deleteEquipment(client, id) {
|
|
2645
|
+
if (!id) throw new Error("id is required");
|
|
2646
|
+
const path = client.buildPath({ category: "pricebook", subject: "equipment", idOrSubpath: String(id) });
|
|
2647
|
+
return client.request("delete", path);
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
// src/resources/pricebook/images.ts
|
|
2651
|
+
async function listImages(client, params = {}) {
|
|
2652
|
+
const path = client.buildPath({ category: "pricebook", subject: "images" });
|
|
2653
|
+
return client.request("get", path, { params });
|
|
2654
|
+
}
|
|
2655
|
+
async function uploadImage(client, data) {
|
|
2656
|
+
const path = client.buildPath({ category: "pricebook", subject: "images" });
|
|
2657
|
+
return client.request("post", path, { data });
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
// src/resources/pricebook/materials.ts
|
|
2661
|
+
async function listMaterials(client, params = {}) {
|
|
2662
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials" });
|
|
2663
|
+
return client.request("get", path, { params });
|
|
2664
|
+
}
|
|
2665
|
+
async function createMaterial(client, data) {
|
|
2666
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials" });
|
|
2667
|
+
return client.request("post", path, { data });
|
|
2668
|
+
}
|
|
2669
|
+
async function listMaterialCostTypes(client) {
|
|
2670
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials", idOrSubpath: "costtypes" });
|
|
2671
|
+
return client.request("get", path);
|
|
2672
|
+
}
|
|
2673
|
+
async function getMaterial(client, id) {
|
|
2674
|
+
if (!id) throw new Error("id is required");
|
|
2675
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials", idOrSubpath: String(id) });
|
|
2676
|
+
return client.request("get", path);
|
|
2677
|
+
}
|
|
2678
|
+
async function updateMaterial(client, id, data) {
|
|
2679
|
+
if (!id) throw new Error("id is required");
|
|
2680
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials", idOrSubpath: String(id) });
|
|
2681
|
+
return client.request("put", path, { data });
|
|
2682
|
+
}
|
|
2683
|
+
async function deleteMaterial(client, id) {
|
|
2684
|
+
if (!id) throw new Error("id is required");
|
|
2685
|
+
const path = client.buildPath({ category: "pricebook", subject: "materials", idOrSubpath: String(id) });
|
|
2686
|
+
return client.request("delete", path);
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
// src/resources/pricebook/materials-markup.ts
|
|
2690
|
+
async function listMaterialsMarkup(client, params = {}) {
|
|
2691
|
+
const path = client.buildPath({ category: "pricebook", subject: "materialsmarkup" });
|
|
2692
|
+
return client.request("get", path, { params });
|
|
2693
|
+
}
|
|
2694
|
+
async function createMaterialsMarkup(client, data) {
|
|
2695
|
+
const path = client.buildPath({ category: "pricebook", subject: "materialsmarkup" });
|
|
2696
|
+
return client.request("post", path, { data });
|
|
2697
|
+
}
|
|
2698
|
+
async function getMaterialsMarkup(client, id) {
|
|
2699
|
+
if (!id) throw new Error("id is required");
|
|
2700
|
+
const path = client.buildPath({ category: "pricebook", subject: "materialsmarkup", idOrSubpath: String(id) });
|
|
2701
|
+
return client.request("get", path);
|
|
2702
|
+
}
|
|
2703
|
+
async function updateMaterialsMarkup(client, id, data) {
|
|
2704
|
+
if (!id) throw new Error("id is required");
|
|
2705
|
+
const path = client.buildPath({ category: "pricebook", subject: "materialsmarkup", idOrSubpath: String(id) });
|
|
2706
|
+
return client.request("put", path, { data });
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
// src/resources/pricebook/pricebook-bulk.ts
|
|
2710
|
+
async function exportPricebook(client, params = {}) {
|
|
2711
|
+
const path = client.buildPath({ category: "pricebook", subject: "pricebook" });
|
|
2712
|
+
return client.request("get", path, { params });
|
|
2713
|
+
}
|
|
2714
|
+
async function importPricebook(client, data) {
|
|
2715
|
+
const path = client.buildPath({ category: "pricebook", subject: "pricebook" });
|
|
2716
|
+
return client.request("post", path, { data });
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
// src/resources/pricebook/services.ts
|
|
2720
|
+
async function listServices(client, params = {}) {
|
|
2721
|
+
const path = client.buildPath({ category: "pricebook", subject: "services" });
|
|
2722
|
+
return client.request("get", path, { params });
|
|
2723
|
+
}
|
|
2724
|
+
async function createService(client, data) {
|
|
2725
|
+
const path = client.buildPath({ category: "pricebook", subject: "services" });
|
|
2726
|
+
return client.request("post", path, { data });
|
|
2727
|
+
}
|
|
2728
|
+
async function getService(client, id) {
|
|
2729
|
+
if (!id) throw new Error("id is required");
|
|
2730
|
+
const path = client.buildPath({ category: "pricebook", subject: "services", idOrSubpath: String(id) });
|
|
2731
|
+
return client.request("get", path);
|
|
2732
|
+
}
|
|
2733
|
+
async function updateService(client, id, data) {
|
|
2734
|
+
if (!id) throw new Error("id is required");
|
|
2735
|
+
const path = client.buildPath({ category: "pricebook", subject: "services", idOrSubpath: String(id) });
|
|
2736
|
+
return client.request("put", path, { data });
|
|
2737
|
+
}
|
|
2738
|
+
async function deleteService(client, id) {
|
|
2739
|
+
if (!id) throw new Error("id is required");
|
|
2740
|
+
const path = client.buildPath({ category: "pricebook", subject: "services", idOrSubpath: String(id) });
|
|
2741
|
+
return client.request("delete", path);
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
// src/resources/task-management/index.ts
|
|
2745
|
+
var task_management_exports = {};
|
|
2746
|
+
__export(task_management_exports, {
|
|
2747
|
+
createTask: () => createTask,
|
|
2748
|
+
getClientSideData: () => getClientSideData,
|
|
2749
|
+
getTask: () => getTask,
|
|
2750
|
+
listSubtasks: () => listSubtasks,
|
|
2751
|
+
listTasks: () => listTasks
|
|
2752
|
+
});
|
|
2753
|
+
|
|
2754
|
+
// src/resources/task-management/client-side-data.ts
|
|
2755
|
+
async function getClientSideData(client, params = {}) {
|
|
2756
|
+
const path = client.buildPath({ category: "task-management", subject: "data" });
|
|
2757
|
+
return client.request("get", path, { params });
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
// src/resources/task-management/tasks.ts
|
|
2761
|
+
async function listTasks(client, params = {}) {
|
|
2762
|
+
const path = client.buildPath({ category: "task-management", subject: "tasks" });
|
|
2763
|
+
return client.request("get", path, { params });
|
|
2764
|
+
}
|
|
2765
|
+
async function createTask(client, data) {
|
|
2766
|
+
const path = client.buildPath({ category: "task-management", subject: "tasks" });
|
|
2767
|
+
return client.request("post", path, { data });
|
|
2768
|
+
}
|
|
2769
|
+
async function getTask(client, id) {
|
|
2770
|
+
if (!id) throw new Error("id is required");
|
|
2771
|
+
const path = client.buildPath({ category: "task-management", subject: "tasks", idOrSubpath: String(id) });
|
|
2772
|
+
return client.request("get", path);
|
|
2773
|
+
}
|
|
2774
|
+
async function listSubtasks(client, id) {
|
|
2775
|
+
if (!id) throw new Error("id is required");
|
|
2776
|
+
const path = client.buildPath({ category: "task-management", subject: `tasks/${id}/subtasks` });
|
|
2777
|
+
return client.request("get", path);
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
// src/resources/telecom/index.ts
|
|
2781
|
+
var telecom_exports = {};
|
|
2782
|
+
__export(telecom_exports, {
|
|
2783
|
+
exportCalls: () => exportCalls,
|
|
2784
|
+
getCall: () => getCall,
|
|
2785
|
+
getCallRecording: () => getCallRecording,
|
|
2786
|
+
getCallVoicemail: () => getCallVoicemail,
|
|
2787
|
+
listCalls: () => listCalls,
|
|
2788
|
+
updateCall: () => updateCall
|
|
2789
|
+
});
|
|
2790
|
+
|
|
2791
|
+
// src/resources/telecom/export.ts
|
|
2792
|
+
async function exportCalls(client, params = {}) {
|
|
2793
|
+
const path = client.buildPath({ category: "telecom", subject: "export", idOrSubpath: "calls" });
|
|
2794
|
+
return client.request("get", path, { params });
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
// src/resources/telecom/calls.ts
|
|
2798
|
+
async function listCalls(client, params = {}) {
|
|
2799
|
+
const path = client.buildPath({ category: "telecom", subject: "calls" });
|
|
2800
|
+
return client.request("get", path, { params });
|
|
2801
|
+
}
|
|
2802
|
+
async function getCall(client, id) {
|
|
2803
|
+
if (!id) throw new Error("id is required");
|
|
2804
|
+
const path = client.buildPath({ category: "telecom", subject: "calls", idOrSubpath: String(id) });
|
|
2805
|
+
return client.request("get", path);
|
|
2806
|
+
}
|
|
2807
|
+
async function updateCall(client, id, data) {
|
|
2808
|
+
if (!id) throw new Error("id is required");
|
|
2809
|
+
const path = client.buildPath({ category: "telecom", subject: "calls", idOrSubpath: String(id) });
|
|
2810
|
+
return client.request("put", path, { data });
|
|
2811
|
+
}
|
|
2812
|
+
async function getCallRecording(client, id) {
|
|
2813
|
+
if (!id) throw new Error("id is required");
|
|
2814
|
+
const path = client.buildPath({ category: "telecom", subject: `calls/${id}/recording` });
|
|
2815
|
+
return client.request("get", path);
|
|
2816
|
+
}
|
|
2817
|
+
async function getCallVoicemail(client, id) {
|
|
2818
|
+
if (!id) throw new Error("id is required");
|
|
2819
|
+
const path = client.buildPath({ category: "telecom", subject: `calls/${id}/voicemail` });
|
|
2820
|
+
return client.request("get", path);
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
// src/resources/timesheets-v2/index.ts
|
|
2824
|
+
var timesheets_v2_exports = {};
|
|
2825
|
+
__export(timesheets_v2_exports, {
|
|
2826
|
+
exportActivities: () => exportActivities,
|
|
2827
|
+
exportActivityCategories: () => exportActivityCategories,
|
|
2828
|
+
exportActivityTypes: () => exportActivityTypes,
|
|
2829
|
+
getActivity: () => getActivity,
|
|
2830
|
+
getActivityCategory: () => getActivityCategory,
|
|
2831
|
+
getActivityType: () => getActivityType,
|
|
2832
|
+
listActivities: () => listActivities,
|
|
2833
|
+
listActivityCategories: () => listActivityCategories,
|
|
2834
|
+
listActivityTypes: () => listActivityTypes
|
|
2835
|
+
});
|
|
2836
|
+
|
|
2837
|
+
// src/resources/timesheets-v2/export.ts
|
|
2838
|
+
async function exportActivities(client, params = {}) {
|
|
2839
|
+
const path = client.buildPath({ category: "timesheets", subject: "export", idOrSubpath: "activities" });
|
|
2840
|
+
return client.request("get", path, { params });
|
|
2841
|
+
}
|
|
2842
|
+
async function exportActivityCategories(client, params = {}) {
|
|
2843
|
+
const path = client.buildPath({ category: "timesheets", subject: "export", idOrSubpath: "activity-categories" });
|
|
2844
|
+
return client.request("get", path, { params });
|
|
2845
|
+
}
|
|
2846
|
+
async function exportActivityTypes(client, params = {}) {
|
|
2847
|
+
const path = client.buildPath({ category: "timesheets", subject: "export", idOrSubpath: "activity-types" });
|
|
2848
|
+
return client.request("get", path, { params });
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
// src/resources/timesheets-v2/activities.ts
|
|
2852
|
+
async function listActivities(client, params = {}) {
|
|
2853
|
+
const path = client.buildPath({ category: "timesheets", subject: "activities" });
|
|
2854
|
+
return client.request("get", path, { params });
|
|
2855
|
+
}
|
|
2856
|
+
async function getActivity(client, id) {
|
|
2857
|
+
if (!id) throw new Error("id is required");
|
|
2858
|
+
const path = client.buildPath({ category: "timesheets", subject: "activities", idOrSubpath: String(id) });
|
|
2859
|
+
return client.request("get", path);
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
// src/resources/timesheets-v2/activity-categories.ts
|
|
2863
|
+
async function listActivityCategories(client, params = {}) {
|
|
2864
|
+
const path = client.buildPath({ category: "timesheets", subject: "activity-categories" });
|
|
2865
|
+
return client.request("get", path, { params });
|
|
2866
|
+
}
|
|
2867
|
+
async function getActivityCategory(client, id) {
|
|
2868
|
+
if (!id) throw new Error("id is required");
|
|
2869
|
+
const path = client.buildPath({ category: "timesheets", subject: "activity-categories", idOrSubpath: String(id) });
|
|
2870
|
+
return client.request("get", path);
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
// src/resources/timesheets-v2/activity-types.ts
|
|
2874
|
+
async function listActivityTypes(client, params = {}) {
|
|
2875
|
+
const path = client.buildPath({ category: "timesheets", subject: "activity-types" });
|
|
2876
|
+
return client.request("get", path, { params });
|
|
2877
|
+
}
|
|
2878
|
+
async function getActivityType(client, id) {
|
|
2879
|
+
if (!id) throw new Error("id is required");
|
|
2880
|
+
const path = client.buildPath({ category: "timesheets", subject: "activity-types", idOrSubpath: String(id) });
|
|
2881
|
+
return client.request("get", path);
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
// src/resources/settings/index.ts
|
|
2885
|
+
var settings_exports = {};
|
|
2886
|
+
__export(settings_exports, {
|
|
2887
|
+
createEmployee: () => createEmployee,
|
|
2888
|
+
createTagType: () => createTagType,
|
|
2889
|
+
createTechnician: () => createTechnician,
|
|
2890
|
+
exportBusinessUnits: () => exportBusinessUnits,
|
|
2891
|
+
exportEmployees: () => exportEmployees,
|
|
2892
|
+
exportTagTypes: () => exportTagTypes,
|
|
2893
|
+
exportTechnicians: () => exportTechnicians,
|
|
2894
|
+
getBusinessUnit: () => getBusinessUnit,
|
|
2895
|
+
getEmployee: () => getEmployee,
|
|
2896
|
+
getEmployeeAccountActions: () => getEmployeeAccountActions,
|
|
2897
|
+
getTechnician: () => getTechnician,
|
|
2898
|
+
getTechnicianAccountActions: () => getTechnicianAccountActions,
|
|
2899
|
+
listBusinessUnits: () => listBusinessUnits,
|
|
2900
|
+
listEmployees: () => listEmployees,
|
|
2901
|
+
listTagTypes: () => listTagTypes,
|
|
2902
|
+
listTechnicians: () => listTechnicians,
|
|
2903
|
+
listUserRoles: () => listUserRoles,
|
|
2904
|
+
updateBusinessUnit: () => updateBusinessUnit,
|
|
2905
|
+
updateEmployee: () => updateEmployee,
|
|
2906
|
+
updateTechnician: () => updateTechnician
|
|
2907
|
+
});
|
|
2908
|
+
|
|
2909
|
+
// src/resources/settings/export.ts
|
|
2910
|
+
async function exportBusinessUnits(client, params = {}) {
|
|
2911
|
+
const path = client.buildPath({ category: "settings", subject: "export", idOrSubpath: "business-units" });
|
|
2912
|
+
return client.request("get", path, { params });
|
|
2913
|
+
}
|
|
2914
|
+
async function exportEmployees(client, params = {}) {
|
|
2915
|
+
const path = client.buildPath({ category: "settings", subject: "export", idOrSubpath: "employees" });
|
|
2916
|
+
return client.request("get", path, { params });
|
|
2917
|
+
}
|
|
2918
|
+
async function exportTagTypes(client, params = {}) {
|
|
2919
|
+
const path = client.buildPath({ category: "settings", subject: "export", idOrSubpath: "tag-types" });
|
|
2920
|
+
return client.request("get", path, { params });
|
|
2921
|
+
}
|
|
2922
|
+
async function exportTechnicians(client, params = {}) {
|
|
2923
|
+
const path = client.buildPath({ category: "settings", subject: "export", idOrSubpath: "technicians" });
|
|
2924
|
+
return client.request("get", path, { params });
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
// src/resources/settings/business-units.ts
|
|
2928
|
+
async function listBusinessUnits(client, params = {}) {
|
|
2929
|
+
const path = client.buildPath({ category: "settings", subject: "business-units" });
|
|
2930
|
+
return client.request("get", path, { params });
|
|
2931
|
+
}
|
|
2932
|
+
async function getBusinessUnit(client, id) {
|
|
2933
|
+
if (!id) throw new Error("id is required");
|
|
2934
|
+
const path = client.buildPath({ category: "settings", subject: "business-units", idOrSubpath: String(id) });
|
|
2935
|
+
return client.request("get", path);
|
|
2936
|
+
}
|
|
2937
|
+
async function updateBusinessUnit(client, id, data) {
|
|
2938
|
+
if (!id) throw new Error("id is required");
|
|
2939
|
+
const path = client.buildPath({ category: "settings", subject: "business-units", idOrSubpath: String(id) });
|
|
2940
|
+
return client.request("put", path, { data });
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
// src/resources/settings/employees.ts
|
|
2944
|
+
async function listEmployees(client, params = {}) {
|
|
2945
|
+
const path = client.buildPath({ category: "settings", subject: "employees" });
|
|
2946
|
+
return client.request("get", path, { params });
|
|
2947
|
+
}
|
|
2948
|
+
async function createEmployee(client, data) {
|
|
2949
|
+
const path = client.buildPath({ category: "settings", subject: "employees" });
|
|
2950
|
+
return client.request("post", path, { data });
|
|
2951
|
+
}
|
|
2952
|
+
async function getEmployee(client, id) {
|
|
2953
|
+
if (!id) throw new Error("id is required");
|
|
2954
|
+
const path = client.buildPath({ category: "settings", subject: "employees", idOrSubpath: String(id) });
|
|
2955
|
+
return client.request("get", path);
|
|
2956
|
+
}
|
|
2957
|
+
async function updateEmployee(client, id, data) {
|
|
2958
|
+
if (!id) throw new Error("id is required");
|
|
2959
|
+
const path = client.buildPath({ category: "settings", subject: "employees", idOrSubpath: String(id) });
|
|
2960
|
+
return client.request("put", path, { data });
|
|
2961
|
+
}
|
|
2962
|
+
async function getEmployeeAccountActions(client, id) {
|
|
2963
|
+
if (!id) throw new Error("id is required");
|
|
2964
|
+
const path = client.buildPath({ category: "settings", subject: `employees/${id}/account-actions` });
|
|
2965
|
+
return client.request("get", path);
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
// src/resources/settings/tag-types.ts
|
|
2969
|
+
async function listTagTypes(client, params = {}) {
|
|
2970
|
+
const path = client.buildPath({ category: "settings", subject: "tag-types" });
|
|
2971
|
+
return client.request("get", path, { params });
|
|
2972
|
+
}
|
|
2973
|
+
async function createTagType(client, data) {
|
|
2974
|
+
const path = client.buildPath({ category: "settings", subject: "tag-types" });
|
|
2975
|
+
return client.request("post", path, { data });
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
// src/resources/settings/technicians.ts
|
|
2979
|
+
async function listTechnicians(client, params = {}) {
|
|
2980
|
+
const path = client.buildPath({ category: "settings", subject: "technicians" });
|
|
2981
|
+
return client.request("get", path, { params });
|
|
2982
|
+
}
|
|
2983
|
+
async function createTechnician(client, data) {
|
|
2984
|
+
const path = client.buildPath({ category: "settings", subject: "technicians" });
|
|
2985
|
+
return client.request("post", path, { data });
|
|
2986
|
+
}
|
|
2987
|
+
async function getTechnician(client, id) {
|
|
2988
|
+
if (!id) throw new Error("id is required");
|
|
2989
|
+
const path = client.buildPath({ category: "settings", subject: "technicians", idOrSubpath: String(id) });
|
|
2990
|
+
return client.request("get", path);
|
|
2991
|
+
}
|
|
2992
|
+
async function updateTechnician(client, id, data) {
|
|
2993
|
+
if (!id) throw new Error("id is required");
|
|
2994
|
+
const path = client.buildPath({ category: "settings", subject: "technicians", idOrSubpath: String(id) });
|
|
2995
|
+
return client.request("put", path, { data });
|
|
2996
|
+
}
|
|
2997
|
+
async function getTechnicianAccountActions(client, id) {
|
|
2998
|
+
if (!id) throw new Error("id is required");
|
|
2999
|
+
const path = client.buildPath({ category: "settings", subject: `technicians/${id}/account-actions` });
|
|
3000
|
+
return client.request("get", path);
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
// src/resources/settings/user-roles.ts
|
|
3004
|
+
async function listUserRoles(client, params = {}) {
|
|
3005
|
+
const path = client.buildPath({ category: "settings", subject: "user-roles" });
|
|
3006
|
+
return client.request("get", path, { params });
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
// src/resources/sales-estimates/index.ts
|
|
3010
|
+
var sales_estimates_exports = {};
|
|
3011
|
+
__export(sales_estimates_exports, {
|
|
3012
|
+
createEstimate: () => createEstimate,
|
|
3013
|
+
dismissEstimate: () => dismissEstimate,
|
|
3014
|
+
exportEstimates: () => exportEstimates,
|
|
3015
|
+
getEstimate: () => getEstimate,
|
|
3016
|
+
getEstimateItem: () => getEstimateItem,
|
|
3017
|
+
listEstimateItems: () => listEstimateItems,
|
|
3018
|
+
listEstimateItemsByEstimate: () => listEstimateItemsByEstimate,
|
|
3019
|
+
listEstimates: () => listEstimates,
|
|
3020
|
+
sellEstimate: () => sellEstimate,
|
|
3021
|
+
unsellEstimate: () => unsellEstimate,
|
|
3022
|
+
updateEstimate: () => updateEstimate
|
|
3023
|
+
});
|
|
3024
|
+
|
|
3025
|
+
// src/resources/sales-estimates/estimates.ts
|
|
3026
|
+
async function listEstimates(client, params = {}) {
|
|
3027
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates" });
|
|
3028
|
+
return client.request("get", path, { params });
|
|
3029
|
+
}
|
|
3030
|
+
async function createEstimate(client, data) {
|
|
3031
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates" });
|
|
3032
|
+
return client.request("post", path, { data });
|
|
3033
|
+
}
|
|
3034
|
+
async function listEstimateItems(client, params = {}) {
|
|
3035
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates/items" });
|
|
3036
|
+
return client.request("get", path, { params });
|
|
3037
|
+
}
|
|
3038
|
+
async function getEstimate(client, id) {
|
|
3039
|
+
if (!id) throw new Error("id is required");
|
|
3040
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: String(id) });
|
|
3041
|
+
return client.request("get", path);
|
|
3042
|
+
}
|
|
3043
|
+
async function updateEstimate(client, id, data) {
|
|
3044
|
+
if (!id) throw new Error("id is required");
|
|
3045
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: String(id) });
|
|
3046
|
+
return client.request("put", path, { data });
|
|
3047
|
+
}
|
|
3048
|
+
async function dismissEstimate(client, id) {
|
|
3049
|
+
if (!id) throw new Error("id is required");
|
|
3050
|
+
const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/dismiss` });
|
|
3051
|
+
return client.request("post", path);
|
|
3052
|
+
}
|
|
3053
|
+
async function listEstimateItemsByEstimate(client, id) {
|
|
3054
|
+
if (!id) throw new Error("id is required");
|
|
3055
|
+
const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/items` });
|
|
3056
|
+
return client.request("get", path);
|
|
3057
|
+
}
|
|
3058
|
+
async function getEstimateItem(client, id, itemId) {
|
|
3059
|
+
if (!id || !itemId) throw new Error("id and itemId are required");
|
|
3060
|
+
const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/items/${itemId}` });
|
|
3061
|
+
return client.request("get", path);
|
|
3062
|
+
}
|
|
3063
|
+
async function sellEstimate(client, id) {
|
|
3064
|
+
if (!id) throw new Error("id is required");
|
|
3065
|
+
const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/sell` });
|
|
3066
|
+
return client.request("post", path);
|
|
3067
|
+
}
|
|
3068
|
+
async function unsellEstimate(client, id) {
|
|
3069
|
+
if (!id) throw new Error("id is required");
|
|
3070
|
+
const path = client.buildPath({ category: "salestech", subject: `estimates/${id}/unsell` });
|
|
3071
|
+
return client.request("post", path);
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
// src/resources/sales-estimates/estimates-export.ts
|
|
3075
|
+
async function exportEstimates(client, params = {}) {
|
|
3076
|
+
const path = client.buildPath({ category: "salestech", subject: "estimates", idOrSubpath: "export" });
|
|
3077
|
+
return client.request("get", path, { params });
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
// src/resources/scheduling-pro/index.ts
|
|
3081
|
+
var scheduling_pro_exports = {};
|
|
3082
|
+
__export(scheduling_pro_exports, {
|
|
3083
|
+
getRouterPerformance: () => getRouterPerformance,
|
|
3084
|
+
getSchedulerPerformance: () => getSchedulerPerformance,
|
|
3085
|
+
listRouterSessions: () => listRouterSessions,
|
|
3086
|
+
listSchedulerSessions: () => listSchedulerSessions,
|
|
3087
|
+
listSchedulers: () => listSchedulers
|
|
3088
|
+
});
|
|
3089
|
+
|
|
3090
|
+
// src/resources/scheduling-pro/routers.ts
|
|
3091
|
+
async function getRouterPerformance(client, id, params = {}) {
|
|
3092
|
+
if (!id) throw new Error("id is required");
|
|
3093
|
+
const path = client.buildPath({ category: "scheduling-pro", subject: `routers/${id}/performance` });
|
|
3094
|
+
return client.request("get", path, { params });
|
|
3095
|
+
}
|
|
3096
|
+
async function listRouterSessions(client, id, params = {}) {
|
|
3097
|
+
if (!id) throw new Error("id is required");
|
|
3098
|
+
const path = client.buildPath({ category: "scheduling-pro", subject: `routers/${id}/sessions` });
|
|
3099
|
+
return client.request("get", path, { params });
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
// src/resources/scheduling-pro/schedulers.ts
|
|
3103
|
+
async function listSchedulers(client, params = {}) {
|
|
3104
|
+
const path = client.buildPath({ category: "scheduling-pro", subject: "schedulers" });
|
|
3105
|
+
return client.request("get", path, { params });
|
|
3106
|
+
}
|
|
3107
|
+
async function getSchedulerPerformance(client, id, params = {}) {
|
|
3108
|
+
if (!id) throw new Error("id is required");
|
|
3109
|
+
const path = client.buildPath({ category: "scheduling-pro", subject: `schedulers/${id}/performance` });
|
|
3110
|
+
return client.request("get", path, { params });
|
|
3111
|
+
}
|
|
3112
|
+
async function listSchedulerSessions(client, id, params = {}) {
|
|
3113
|
+
if (!id) throw new Error("id is required");
|
|
3114
|
+
const path = client.buildPath({ category: "scheduling-pro", subject: `schedulers/${id}/sessions` });
|
|
3115
|
+
return client.request("get", path, { params });
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
// src/resources/service-agreements/index.ts
|
|
3119
|
+
var service_agreements_exports = {};
|
|
3120
|
+
__export(service_agreements_exports, {
|
|
3121
|
+
exportServiceAgreements: () => exportServiceAgreements,
|
|
3122
|
+
getServiceAgreement: () => getServiceAgreement,
|
|
3123
|
+
listServiceAgreements: () => listServiceAgreements
|
|
3124
|
+
});
|
|
3125
|
+
|
|
3126
|
+
// src/resources/service-agreements/export.ts
|
|
3127
|
+
async function exportServiceAgreements(client, params = {}) {
|
|
3128
|
+
const path = client.buildPath({ category: "service-agreements", subject: "export", idOrSubpath: "service-agreements" });
|
|
3129
|
+
return client.request("get", path, { params });
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
// src/resources/service-agreements/service-agreements.ts
|
|
3133
|
+
async function listServiceAgreements(client, params = {}) {
|
|
3134
|
+
const path = client.buildPath({ category: "service-agreements", subject: "service-agreements" });
|
|
3135
|
+
return client.request("get", path, { params });
|
|
3136
|
+
}
|
|
3137
|
+
async function getServiceAgreement(client, id) {
|
|
3138
|
+
if (!id) throw new Error("id is required");
|
|
3139
|
+
const path = client.buildPath({ category: "service-agreements", subject: "service-agreements", idOrSubpath: String(id) });
|
|
3140
|
+
return client.request("get", path);
|
|
3141
|
+
}
|
|
3142
|
+
export {
|
|
3143
|
+
accounting_exports as Accounting,
|
|
3144
|
+
crm_exports as CRM,
|
|
3145
|
+
customer_interactions_exports as CustomerInteractions,
|
|
3146
|
+
dispatch_exports as Dispatch,
|
|
3147
|
+
equipment_systems_exports as EquipmentSystems,
|
|
3148
|
+
forms_exports as Forms,
|
|
3149
|
+
inventory_exports as Inventory,
|
|
3150
|
+
job_bookings_exports as JBCE,
|
|
3151
|
+
jpm_exports as JPM,
|
|
3152
|
+
marketing_exports as Marketing,
|
|
3153
|
+
marketing_ads_exports as MarketingAds,
|
|
3154
|
+
memberships_exports as Memberships,
|
|
3155
|
+
payroll_exports as Payroll,
|
|
3156
|
+
pricebook_exports as Pricebook,
|
|
3157
|
+
reporting_exports as Reporting,
|
|
3158
|
+
sales_estimates_exports as SalesEstimates,
|
|
3159
|
+
scheduling_pro_exports as SchedulingPro,
|
|
3160
|
+
service_agreements_exports as ServiceAgreements,
|
|
3161
|
+
ServiceTitanClient,
|
|
3162
|
+
settings_exports as Settings,
|
|
3163
|
+
task_management_exports as TaskManagement,
|
|
3164
|
+
telecom_exports as Telecom,
|
|
3165
|
+
timesheets_v2_exports as TimesheetsV2,
|
|
3166
|
+
createClientFromEnv
|
|
3167
|
+
};
|