@servicetitan/moneyout-api-client 0.0.0-BuildCorrectly.6915a25d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ap-bill-approval-settings-v2.api.d.ts +96 -0
- package/dist/ap-bill-approval-settings-v2.api.d.ts.map +1 -0
- package/dist/ap-bill-approval-settings-v2.api.js +157 -0
- package/dist/ap-bill-approval-settings-v2.api.js.map +1 -0
- package/dist/ap-bill-approval-settings.api.d.ts +116 -0
- package/dist/ap-bill-approval-settings.api.d.ts.map +1 -0
- package/dist/ap-bill-approval-settings.api.js +164 -0
- package/dist/ap-bill-approval-settings.api.js.map +1 -0
- package/dist/ap-bill-approval-v2.api.d.ts +261 -0
- package/dist/ap-bill-approval-v2.api.d.ts.map +1 -0
- package/dist/ap-bill-approval-v2.api.js +314 -0
- package/dist/ap-bill-approval-v2.api.js.map +1 -0
- package/dist/ap-bill-approval.api.d.ts +163 -0
- package/dist/ap-bill-approval.api.d.ts.map +1 -0
- package/dist/ap-bill-approval.api.js +218 -0
- package/dist/ap-bill-approval.api.js.map +1 -0
- package/dist/bill-payments.api.d.ts +68 -0
- package/dist/bill-payments.api.d.ts.map +1 -0
- package/dist/bill-payments.api.js +124 -0
- package/dist/bill-payments.api.js.map +1 -0
- package/dist/expense-management.api.d.ts +384 -0
- package/dist/expense-management.api.d.ts.map +1 -0
- package/dist/expense-management.api.js +323 -0
- package/dist/expense-management.api.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +37 -0
- package/dist/utils.js.map +1 -0
- package/dist/vendor-sync.api.d.ts +229 -0
- package/dist/vendor-sync.api.d.ts.map +1 -0
- package/dist/vendor-sync.api.js +301 -0
- package/dist/vendor-sync.api.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
function _ts_param(paramIndex, decorator) {
|
|
24
|
+
return function(target, key) {
|
|
25
|
+
decorator(target, key, paramIndex);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/* tslint:disable */ /* eslint-disable */ //----------------------
|
|
29
|
+
// <auto-generated>
|
|
30
|
+
// Generated with ApiClientGenerator, using the NSwag toolchain
|
|
31
|
+
// </auto-generated>
|
|
32
|
+
//----------------------
|
|
33
|
+
// ReSharper disable InconsistentNaming
|
|
34
|
+
import axios from 'axios';
|
|
35
|
+
import { injectable, inject, optional, symbolToken } from '@servicetitan/react-ioc';
|
|
36
|
+
import { makeCodedException } from './utils';
|
|
37
|
+
export const BASE_URL_TOKEN_ExpenseManagement = symbolToken('BASE_URL_TOKEN', false);
|
|
38
|
+
export class ExpenseManagement {
|
|
39
|
+
/**
|
|
40
|
+
* List expense transactions with optional filters.
|
|
41
|
+
* @ids (optional) Filter by specific expense IDs.
|
|
42
|
+
* @vendorIds (optional) Filter by vendor IDs.
|
|
43
|
+
* @jobIds (optional) Filter by job IDs.
|
|
44
|
+
* @projectIds (optional) Filter by project IDs.
|
|
45
|
+
* @syncStatuses (optional) Filter by sync statuses (e.g. "Pending", "Posted", "Exported").
|
|
46
|
+
* @transactionStatuses (optional) Filter by transaction statuses (e.g. "Pending", "Complete", "Declined").
|
|
47
|
+
* @dateFrom (optional) Filter by transaction date (inclusive start).
|
|
48
|
+
* @dateTo (optional) Filter by transaction date (inclusive end).
|
|
49
|
+
* @creditCardAccountIds (optional) Filter by credit card GL account IDs.
|
|
50
|
+
* @businessUnitIds (optional) Filter by business unit IDs.
|
|
51
|
+
* @batchId (optional) Filter by batch ID.
|
|
52
|
+
* @totalMin (optional) Filter by minimum total cost.
|
|
53
|
+
* @totalMax (optional) Filter by maximum total cost.
|
|
54
|
+
* @page (optional) Page number (1-based). Defaults to 1.
|
|
55
|
+
* @pageSize (optional) Number of items per page. Defaults to 50.
|
|
56
|
+
* @sortBy (optional) Property name to sort by (e.g. "transactionDate", "total", "syncStatus"). Defaults to "transactionDate".
|
|
57
|
+
* @sortDirection (optional) Sort direction: "asc" or "desc". Defaults to "desc".
|
|
58
|
+
*/ list(tenantId, ids, vendorIds, jobIds, projectIds, syncStatuses, transactionStatuses, dateFrom, dateTo, creditCardAccountIds, businessUnitIds, batchId, totalMin, totalMax, page, pageSize, sortBy, sortDirection, cancelToken) {
|
|
59
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions?";
|
|
60
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
61
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
62
|
+
if (ids !== undefined && ids !== null) ids && ids.forEach((item)=>{
|
|
63
|
+
url_ += "ids=" + encodeURIComponent("" + item) + "&";
|
|
64
|
+
});
|
|
65
|
+
if (vendorIds !== undefined && vendorIds !== null) vendorIds && vendorIds.forEach((item)=>{
|
|
66
|
+
url_ += "vendorIds=" + encodeURIComponent("" + item) + "&";
|
|
67
|
+
});
|
|
68
|
+
if (jobIds !== undefined && jobIds !== null) jobIds && jobIds.forEach((item)=>{
|
|
69
|
+
url_ += "jobIds=" + encodeURIComponent("" + item) + "&";
|
|
70
|
+
});
|
|
71
|
+
if (projectIds !== undefined && projectIds !== null) projectIds && projectIds.forEach((item)=>{
|
|
72
|
+
url_ += "projectIds=" + encodeURIComponent("" + item) + "&";
|
|
73
|
+
});
|
|
74
|
+
if (syncStatuses !== undefined && syncStatuses !== null) syncStatuses && syncStatuses.forEach((item)=>{
|
|
75
|
+
url_ += "syncStatuses=" + encodeURIComponent("" + item) + "&";
|
|
76
|
+
});
|
|
77
|
+
if (transactionStatuses !== undefined && transactionStatuses !== null) transactionStatuses && transactionStatuses.forEach((item)=>{
|
|
78
|
+
url_ += "transactionStatuses=" + encodeURIComponent("" + item) + "&";
|
|
79
|
+
});
|
|
80
|
+
if (dateFrom !== undefined && dateFrom !== null) url_ += "dateFrom=" + encodeURIComponent(dateFrom ? "" + dateFrom.toJSON() : "") + "&";
|
|
81
|
+
if (dateTo !== undefined && dateTo !== null) url_ += "dateTo=" + encodeURIComponent(dateTo ? "" + dateTo.toJSON() : "") + "&";
|
|
82
|
+
if (creditCardAccountIds !== undefined && creditCardAccountIds !== null) creditCardAccountIds && creditCardAccountIds.forEach((item)=>{
|
|
83
|
+
url_ += "creditCardAccountIds=" + encodeURIComponent("" + item) + "&";
|
|
84
|
+
});
|
|
85
|
+
if (businessUnitIds !== undefined && businessUnitIds !== null) businessUnitIds && businessUnitIds.forEach((item)=>{
|
|
86
|
+
url_ += "businessUnitIds=" + encodeURIComponent("" + item) + "&";
|
|
87
|
+
});
|
|
88
|
+
if (batchId !== undefined && batchId !== null) url_ += "batchId=" + encodeURIComponent("" + batchId) + "&";
|
|
89
|
+
if (totalMin !== undefined && totalMin !== null) url_ += "totalMin=" + encodeURIComponent("" + totalMin) + "&";
|
|
90
|
+
if (totalMax !== undefined && totalMax !== null) url_ += "totalMax=" + encodeURIComponent("" + totalMax) + "&";
|
|
91
|
+
if (page === null) throw new Error("The parameter 'page' cannot be null.");
|
|
92
|
+
else if (page !== undefined) url_ += "page=" + encodeURIComponent("" + page) + "&";
|
|
93
|
+
if (pageSize === null) throw new Error("The parameter 'pageSize' cannot be null.");
|
|
94
|
+
else if (pageSize !== undefined) url_ += "pageSize=" + encodeURIComponent("" + pageSize) + "&";
|
|
95
|
+
if (sortBy !== undefined && sortBy !== null) url_ += "sortBy=" + encodeURIComponent("" + sortBy) + "&";
|
|
96
|
+
if (sortDirection !== undefined && sortDirection !== null) url_ += "sortDirection=" + encodeURIComponent("" + sortDirection) + "&";
|
|
97
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
98
|
+
let options_ = {
|
|
99
|
+
baseURL: this.baseUrl,
|
|
100
|
+
cancelToken,
|
|
101
|
+
url: url_,
|
|
102
|
+
method: "GET",
|
|
103
|
+
headers: {
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
"Accept": "application/json"
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return makeCodedException(axios.request(options_));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create a new expense transaction
|
|
112
|
+
*/ create(tenantId, request, cancelToken) {
|
|
113
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions";
|
|
114
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
115
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
116
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
117
|
+
const content_ = request;
|
|
118
|
+
let options_ = {
|
|
119
|
+
baseURL: this.baseUrl,
|
|
120
|
+
cancelToken,
|
|
121
|
+
data: content_,
|
|
122
|
+
url: url_,
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: {
|
|
125
|
+
"Content-Type": "application/json",
|
|
126
|
+
"Accept": "application/json"
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
return makeCodedException(axios.request(options_));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get a single expense transaction by ID
|
|
133
|
+
*/ get(tenantId, id, cancelToken) {
|
|
134
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{id}";
|
|
135
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
136
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
137
|
+
if (id === undefined || id === null) throw new Error("The parameter 'id' must be defined.");
|
|
138
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
139
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
140
|
+
let options_ = {
|
|
141
|
+
baseURL: this.baseUrl,
|
|
142
|
+
cancelToken,
|
|
143
|
+
url: url_,
|
|
144
|
+
method: "GET",
|
|
145
|
+
headers: {
|
|
146
|
+
"Content-Type": "application/json",
|
|
147
|
+
"Accept": "application/json"
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
return makeCodedException(axios.request(options_));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Update an existing expense transaction
|
|
154
|
+
*/ update(tenantId, id, request, cancelToken) {
|
|
155
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{id}";
|
|
156
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
157
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
158
|
+
if (id === undefined || id === null) throw new Error("The parameter 'id' must be defined.");
|
|
159
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
160
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
161
|
+
const content_ = request;
|
|
162
|
+
let options_ = {
|
|
163
|
+
baseURL: this.baseUrl,
|
|
164
|
+
cancelToken,
|
|
165
|
+
data: content_,
|
|
166
|
+
url: url_,
|
|
167
|
+
method: "PUT",
|
|
168
|
+
headers: {
|
|
169
|
+
"Content-Type": "application/json",
|
|
170
|
+
"Accept": "application/json"
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
return makeCodedException(axios.request(options_));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Delete an expense transaction (only if Pending)
|
|
177
|
+
*/ delete(tenantId, id, cancelToken) {
|
|
178
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{id}";
|
|
179
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
180
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
181
|
+
if (id === undefined || id === null) throw new Error("The parameter 'id' must be defined.");
|
|
182
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
183
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
184
|
+
let options_ = {
|
|
185
|
+
baseURL: this.baseUrl,
|
|
186
|
+
cancelToken,
|
|
187
|
+
url: url_,
|
|
188
|
+
method: "DELETE",
|
|
189
|
+
headers: {
|
|
190
|
+
"Content-Type": "application/json"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return makeCodedException(axios.request(options_));
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Update sync status for one or more expense transactions (used by monolith batch posting)
|
|
197
|
+
*/ updateSyncStatus(tenantId, request, cancelToken) {
|
|
198
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/sync-status";
|
|
199
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
200
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
201
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
202
|
+
const content_ = request;
|
|
203
|
+
let options_ = {
|
|
204
|
+
baseURL: this.baseUrl,
|
|
205
|
+
cancelToken,
|
|
206
|
+
data: content_,
|
|
207
|
+
url: url_,
|
|
208
|
+
method: "PATCH",
|
|
209
|
+
headers: {
|
|
210
|
+
"Content-Type": "application/json",
|
|
211
|
+
"Accept": "application/json"
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return makeCodedException(axios.request(options_));
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Upload a file attachment to an expense transaction
|
|
218
|
+
* @file (optional)
|
|
219
|
+
*/ uploadAttachment(tenantId, expenseId, file, cancelToken) {
|
|
220
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments";
|
|
221
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
222
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
223
|
+
if (expenseId === undefined || expenseId === null) throw new Error("The parameter 'expenseId' must be defined.");
|
|
224
|
+
url_ = url_.replace("{expenseId}", encodeURIComponent("" + expenseId));
|
|
225
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
226
|
+
const content_ = new FormData();
|
|
227
|
+
if (file === null || file === undefined) throw new Error("The parameter 'file' cannot be null.");
|
|
228
|
+
else content_.append("file", file.data, file.fileName ? file.fileName : "file");
|
|
229
|
+
let options_ = {
|
|
230
|
+
baseURL: this.baseUrl,
|
|
231
|
+
cancelToken,
|
|
232
|
+
data: content_,
|
|
233
|
+
url: url_,
|
|
234
|
+
method: "POST",
|
|
235
|
+
headers: {
|
|
236
|
+
"Accept": "application/json"
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
return makeCodedException(axios.request(options_));
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* List attachments for an expense transaction
|
|
243
|
+
*/ listAttachments(tenantId, expenseId, cancelToken) {
|
|
244
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments";
|
|
245
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
246
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
247
|
+
if (expenseId === undefined || expenseId === null) throw new Error("The parameter 'expenseId' must be defined.");
|
|
248
|
+
url_ = url_.replace("{expenseId}", encodeURIComponent("" + expenseId));
|
|
249
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
250
|
+
let options_ = {
|
|
251
|
+
baseURL: this.baseUrl,
|
|
252
|
+
cancelToken,
|
|
253
|
+
url: url_,
|
|
254
|
+
method: "GET",
|
|
255
|
+
headers: {
|
|
256
|
+
"Content-Type": "application/json",
|
|
257
|
+
"Accept": "application/json"
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
return makeCodedException(axios.request(options_));
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Download an attachment file
|
|
264
|
+
*/ downloadAttachment(tenantId, expenseId, attachmentId, cancelToken) {
|
|
265
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments/{attachmentId}";
|
|
266
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
267
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
268
|
+
if (expenseId === undefined || expenseId === null) throw new Error("The parameter 'expenseId' must be defined.");
|
|
269
|
+
url_ = url_.replace("{expenseId}", encodeURIComponent("" + expenseId));
|
|
270
|
+
if (attachmentId === undefined || attachmentId === null) throw new Error("The parameter 'attachmentId' must be defined.");
|
|
271
|
+
url_ = url_.replace("{attachmentId}", encodeURIComponent("" + attachmentId));
|
|
272
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
273
|
+
let options_ = {
|
|
274
|
+
baseURL: this.baseUrl,
|
|
275
|
+
cancelToken,
|
|
276
|
+
url: url_,
|
|
277
|
+
method: "GET",
|
|
278
|
+
headers: {
|
|
279
|
+
"Content-Type": "application/json"
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
return makeCodedException(axios.request(options_));
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Delete an attachment from an expense transaction
|
|
286
|
+
*/ deleteAttachment(tenantId, expenseId, attachmentId, cancelToken) {
|
|
287
|
+
let url_ = "/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments/{attachmentId}";
|
|
288
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
289
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
290
|
+
if (expenseId === undefined || expenseId === null) throw new Error("The parameter 'expenseId' must be defined.");
|
|
291
|
+
url_ = url_.replace("{expenseId}", encodeURIComponent("" + expenseId));
|
|
292
|
+
if (attachmentId === undefined || attachmentId === null) throw new Error("The parameter 'attachmentId' must be defined.");
|
|
293
|
+
url_ = url_.replace("{attachmentId}", encodeURIComponent("" + attachmentId));
|
|
294
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
295
|
+
let options_ = {
|
|
296
|
+
baseURL: this.baseUrl,
|
|
297
|
+
cancelToken,
|
|
298
|
+
url: url_,
|
|
299
|
+
method: "DELETE",
|
|
300
|
+
headers: {
|
|
301
|
+
"Content-Type": "application/json"
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
return makeCodedException(axios.request(options_));
|
|
305
|
+
}
|
|
306
|
+
constructor(baseUrl = ""){
|
|
307
|
+
_define_property(this, "baseUrl", void 0);
|
|
308
|
+
_define_property(this, "jsonParseReviver", void 0);
|
|
309
|
+
this.baseUrl = baseUrl;
|
|
310
|
+
this.jsonParseReviver = undefined;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
ExpenseManagement = _ts_decorate([
|
|
314
|
+
injectable(),
|
|
315
|
+
_ts_param(0, inject(BASE_URL_TOKEN_ExpenseManagement)),
|
|
316
|
+
_ts_param(0, optional()),
|
|
317
|
+
_ts_metadata("design:type", Function),
|
|
318
|
+
_ts_metadata("design:paramtypes", [
|
|
319
|
+
void 0
|
|
320
|
+
])
|
|
321
|
+
], ExpenseManagement);
|
|
322
|
+
|
|
323
|
+
//# sourceMappingURL=expense-management.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/expense-management.api.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n//----------------------\n// <auto-generated>\n// Generated with ApiClientGenerator, using the NSwag toolchain\n// </auto-generated>\n//----------------------\n// ReSharper disable InconsistentNaming\n\nimport axios, { AxiosRequestConfig, AxiosPromise, CancelToken } from 'axios';\nimport { injectable, inject, optional, symbolToken } from '@servicetitan/react-ioc';\nimport { makeCodedException, makeContent } from './utils';\n// @ts-ignore: needed for Date serialization if a DateTime parameter has an Unspecified attribute on it\nimport moment from 'moment';\n\nexport interface IExpenseManagement {\n /**\n * List expense transactions with optional filters.\n * @ids (optional) Filter by specific expense IDs.\n * @vendorIds (optional) Filter by vendor IDs.\n * @jobIds (optional) Filter by job IDs.\n * @projectIds (optional) Filter by project IDs.\n * @syncStatuses (optional) Filter by sync statuses (e.g. \"Pending\", \"Posted\", \"Exported\").\n * @transactionStatuses (optional) Filter by transaction statuses (e.g. \"Pending\", \"Complete\", \"Declined\").\n * @dateFrom (optional) Filter by transaction date (inclusive start).\n * @dateTo (optional) Filter by transaction date (inclusive end).\n * @creditCardAccountIds (optional) Filter by credit card GL account IDs.\n * @businessUnitIds (optional) Filter by business unit IDs.\n * @batchId (optional) Filter by batch ID.\n * @totalMin (optional) Filter by minimum total cost.\n * @totalMax (optional) Filter by maximum total cost.\n * @page (optional) Page number (1-based). Defaults to 1.\n * @pageSize (optional) Number of items per page. Defaults to 50.\n * @sortBy (optional) Property name to sort by (e.g. \"transactionDate\", \"total\", \"syncStatus\"). Defaults to \"transactionDate\".\n * @sortDirection (optional) Sort direction: \"asc\" or \"desc\". Defaults to \"desc\".\n */\n list(tenantId: number, ids: string[] | null | undefined, vendorIds: number[] | null | undefined, jobIds: number[] | null | undefined, projectIds: number[] | null | undefined, syncStatuses: string[] | null | undefined, transactionStatuses: string[] | null | undefined, dateFrom: Date | null | undefined, dateTo: Date | null | undefined, creditCardAccountIds: number[] | null | undefined, businessUnitIds: number[] | null | undefined, batchId: number | null | undefined, totalMin: number | null | undefined, totalMax: number | null | undefined, page: number | undefined, pageSize: number | undefined, sortBy: string | null | undefined, sortDirection: string | null | undefined, cancelToken?: CancelToken): AxiosPromise<PagedResponseOfExpenseTransactionResponse>;\n /**\n * Create a new expense transaction\n */\n create(tenantId: number, request: CreateExpenseTransactionRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse>;\n /**\n * Get a single expense transaction by ID\n */\n get(tenantId: number, id: string, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse>;\n /**\n * Update an existing expense transaction\n */\n update(tenantId: number, id: string, request: UpdateExpenseTransactionRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse>;\n /**\n * Delete an expense transaction (only if Pending)\n */\n delete(tenantId: number, id: string, cancelToken?: CancelToken): AxiosPromise<void>;\n /**\n * Update sync status for one or more expense transactions (used by monolith batch posting)\n */\n updateSyncStatus(tenantId: number, request: UpdateExpenseSyncStatusRequest, cancelToken?: CancelToken): AxiosPromise<UpdateExpenseSyncStatusResponse>;\n /**\n * Upload a file attachment to an expense transaction\n * @file (optional) \n */\n uploadAttachment(tenantId: number, expenseId: string, file: FileParameter | undefined, cancelToken?: CancelToken): AxiosPromise<ExpenseAttachmentResponse>;\n /**\n * List attachments for an expense transaction\n */\n listAttachments(tenantId: number, expenseId: string, cancelToken?: CancelToken): AxiosPromise<ExpenseAttachmentResponse[]>;\n /**\n * Download an attachment file\n */\n downloadAttachment(tenantId: number, expenseId: string, attachmentId: string, cancelToken?: CancelToken): AxiosPromise<void>;\n /**\n * Delete an attachment from an expense transaction\n */\n deleteAttachment(tenantId: number, expenseId: string, attachmentId: string, cancelToken?: CancelToken): AxiosPromise<void>;\n}\n\nexport const BASE_URL_TOKEN_ExpenseManagement = symbolToken<string>('BASE_URL_TOKEN', false);\n\n@injectable()\nexport class ExpenseManagement implements IExpenseManagement {\n protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;\n\n constructor(@inject(BASE_URL_TOKEN_ExpenseManagement) @optional() private readonly baseUrl = \"\") {\n }\n\n /**\n * List expense transactions with optional filters.\n * @ids (optional) Filter by specific expense IDs.\n * @vendorIds (optional) Filter by vendor IDs.\n * @jobIds (optional) Filter by job IDs.\n * @projectIds (optional) Filter by project IDs.\n * @syncStatuses (optional) Filter by sync statuses (e.g. \"Pending\", \"Posted\", \"Exported\").\n * @transactionStatuses (optional) Filter by transaction statuses (e.g. \"Pending\", \"Complete\", \"Declined\").\n * @dateFrom (optional) Filter by transaction date (inclusive start).\n * @dateTo (optional) Filter by transaction date (inclusive end).\n * @creditCardAccountIds (optional) Filter by credit card GL account IDs.\n * @businessUnitIds (optional) Filter by business unit IDs.\n * @batchId (optional) Filter by batch ID.\n * @totalMin (optional) Filter by minimum total cost.\n * @totalMax (optional) Filter by maximum total cost.\n * @page (optional) Page number (1-based). Defaults to 1.\n * @pageSize (optional) Number of items per page. Defaults to 50.\n * @sortBy (optional) Property name to sort by (e.g. \"transactionDate\", \"total\", \"syncStatus\"). Defaults to \"transactionDate\".\n * @sortDirection (optional) Sort direction: \"asc\" or \"desc\". Defaults to \"desc\".\n */\n list(tenantId: number, ids: string[] | null | undefined, vendorIds: number[] | null | undefined, jobIds: number[] | null | undefined, projectIds: number[] | null | undefined, syncStatuses: string[] | null | undefined, transactionStatuses: string[] | null | undefined, dateFrom: Date | null | undefined, dateTo: Date | null | undefined, creditCardAccountIds: number[] | null | undefined, businessUnitIds: number[] | null | undefined, batchId: number | null | undefined, totalMin: number | null | undefined, totalMax: number | null | undefined, page: number | undefined, pageSize: number | undefined, sortBy: string | null | undefined, sortDirection: string | null | undefined, cancelToken?: CancelToken): AxiosPromise<PagedResponseOfExpenseTransactionResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions?\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (ids !== undefined && ids !== null)\n ids && ids.forEach(item => { url_ += \"ids=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (vendorIds !== undefined && vendorIds !== null)\n vendorIds && vendorIds.forEach(item => { url_ += \"vendorIds=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (jobIds !== undefined && jobIds !== null)\n jobIds && jobIds.forEach(item => { url_ += \"jobIds=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (projectIds !== undefined && projectIds !== null)\n projectIds && projectIds.forEach(item => { url_ += \"projectIds=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (syncStatuses !== undefined && syncStatuses !== null)\n syncStatuses && syncStatuses.forEach(item => { url_ += \"syncStatuses=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (transactionStatuses !== undefined && transactionStatuses !== null)\n transactionStatuses && transactionStatuses.forEach(item => { url_ += \"transactionStatuses=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (dateFrom !== undefined && dateFrom !== null)\n url_ += \"dateFrom=\" + encodeURIComponent(dateFrom ? \"\" + dateFrom.toJSON() : \"\") + \"&\";\n if (dateTo !== undefined && dateTo !== null)\n url_ += \"dateTo=\" + encodeURIComponent(dateTo ? \"\" + dateTo.toJSON() : \"\") + \"&\";\n if (creditCardAccountIds !== undefined && creditCardAccountIds !== null)\n creditCardAccountIds && creditCardAccountIds.forEach(item => { url_ += \"creditCardAccountIds=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (businessUnitIds !== undefined && businessUnitIds !== null)\n businessUnitIds && businessUnitIds.forEach(item => { url_ += \"businessUnitIds=\" + encodeURIComponent(\"\" + item) + \"&\"; });\n if (batchId !== undefined && batchId !== null)\n url_ += \"batchId=\" + encodeURIComponent(\"\" + batchId) + \"&\";\n if (totalMin !== undefined && totalMin !== null)\n url_ += \"totalMin=\" + encodeURIComponent(\"\" + totalMin) + \"&\";\n if (totalMax !== undefined && totalMax !== null)\n url_ += \"totalMax=\" + encodeURIComponent(\"\" + totalMax) + \"&\";\n if (page === null)\n throw new Error(\"The parameter 'page' cannot be null.\");\n else if (page !== undefined)\n url_ += \"page=\" + encodeURIComponent(\"\" + page) + \"&\";\n if (pageSize === null)\n throw new Error(\"The parameter 'pageSize' cannot be null.\");\n else if (pageSize !== undefined)\n url_ += \"pageSize=\" + encodeURIComponent(\"\" + pageSize) + \"&\";\n if (sortBy !== undefined && sortBy !== null)\n url_ += \"sortBy=\" + encodeURIComponent(\"\" + sortBy) + \"&\";\n if (sortDirection !== undefined && sortDirection !== null)\n url_ += \"sortDirection=\" + encodeURIComponent(\"\" + sortDirection) + \"&\";\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<PagedResponseOfExpenseTransactionResponse>(options_));\n }\n\n /**\n * Create a new expense transaction\n */\n create(tenantId: number, request: CreateExpenseTransactionRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTransactionResponse>(options_));\n }\n\n /**\n * Get a single expense transaction by ID\n */\n get(tenantId: number, id: string, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{id}\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (id === undefined || id === null)\n throw new Error(\"The parameter 'id' must be defined.\");\n url_ = url_.replace(\"{id}\", encodeURIComponent(\"\" + id));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTransactionResponse>(options_));\n }\n\n /**\n * Update an existing expense transaction\n */\n update(tenantId: number, id: string, request: UpdateExpenseTransactionRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTransactionResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{id}\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (id === undefined || id === null)\n throw new Error(\"The parameter 'id' must be defined.\");\n url_ = url_.replace(\"{id}\", encodeURIComponent(\"\" + id));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTransactionResponse>(options_));\n }\n\n /**\n * Delete an expense transaction (only if Pending)\n */\n delete(tenantId: number, id: string, cancelToken?: CancelToken): AxiosPromise<void> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{id}\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (id === undefined || id === null)\n throw new Error(\"The parameter 'id' must be defined.\");\n url_ = url_.replace(\"{id}\", encodeURIComponent(\"\" + id));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n }\n };\n\n return makeCodedException(axios.request<void>(options_));\n }\n\n /**\n * Update sync status for one or more expense transactions (used by monolith batch posting)\n */\n updateSyncStatus(tenantId: number, request: UpdateExpenseSyncStatusRequest, cancelToken?: CancelToken): AxiosPromise<UpdateExpenseSyncStatusResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/sync-status\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<UpdateExpenseSyncStatusResponse>(options_));\n }\n\n /**\n * Upload a file attachment to an expense transaction\n * @file (optional) \n */\n uploadAttachment(tenantId: number, expenseId: string, file: FileParameter | undefined, cancelToken?: CancelToken): AxiosPromise<ExpenseAttachmentResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (expenseId === undefined || expenseId === null)\n throw new Error(\"The parameter 'expenseId' must be defined.\");\n url_ = url_.replace(\"{expenseId}\", encodeURIComponent(\"\" + expenseId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = new FormData();\n if (file === null || file === undefined)\n throw new Error(\"The parameter 'file' cannot be null.\");\n else\n content_.append(\"file\", file.data, file.fileName ? file.fileName : \"file\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseAttachmentResponse>(options_));\n }\n\n /**\n * List attachments for an expense transaction\n */\n listAttachments(tenantId: number, expenseId: string, cancelToken?: CancelToken): AxiosPromise<ExpenseAttachmentResponse[]> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (expenseId === undefined || expenseId === null)\n throw new Error(\"The parameter 'expenseId' must be defined.\");\n url_ = url_.replace(\"{expenseId}\", encodeURIComponent(\"\" + expenseId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseAttachmentResponse[]>(options_));\n }\n\n /**\n * Download an attachment file\n */\n downloadAttachment(tenantId: number, expenseId: string, attachmentId: string, cancelToken?: CancelToken): AxiosPromise<void> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments/{attachmentId}\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (expenseId === undefined || expenseId === null)\n throw new Error(\"The parameter 'expenseId' must be defined.\");\n url_ = url_.replace(\"{expenseId}\", encodeURIComponent(\"\" + expenseId));\n if (attachmentId === undefined || attachmentId === null)\n throw new Error(\"The parameter 'attachmentId' must be defined.\");\n url_ = url_.replace(\"{attachmentId}\", encodeURIComponent(\"\" + attachmentId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n }\n };\n\n return makeCodedException(axios.request<void>(options_));\n }\n\n /**\n * Delete an attachment from an expense transaction\n */\n deleteAttachment(tenantId: number, expenseId: string, attachmentId: string, cancelToken?: CancelToken): AxiosPromise<void> {\n let url_ = \"/v1/tenant/{tenantId}/expense-transactions/{expenseId}/attachments/{attachmentId}\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n if (expenseId === undefined || expenseId === null)\n throw new Error(\"The parameter 'expenseId' must be defined.\");\n url_ = url_.replace(\"{expenseId}\", encodeURIComponent(\"\" + expenseId));\n if (attachmentId === undefined || attachmentId === null)\n throw new Error(\"The parameter 'attachmentId' must be defined.\");\n url_ = url_.replace(\"{attachmentId}\", encodeURIComponent(\"\" + attachmentId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n }\n };\n\n return makeCodedException(axios.request<void>(options_));\n }\n}\n\n/** Generic paged response wrapper with total count for pagination support. */\nexport interface PagedResponseOfExpenseTransactionResponse {\n /** Data collection */\n data: ExpenseTransactionResponse[];\n /** Current page number */\n page: number;\n /** Page size */\n pageSize: number;\n /** Total count of items (null if pagination not required) */\n totalCount?: number | undefined;\n /** Whether there are more pages */\n hasMore: boolean;\n}\n\nexport interface BaseEntityApiModel {\n id: string;\n createdOn: Date;\n modifiedOn: Date;\n}\n\nexport interface ExpenseTransactionResponse extends BaseEntityApiModel {\n /** Tenant that owns this expense. */\n tenantId: number;\n /** Tenant-scoped expense transaction display number. */\n number: string;\n /** Free-text summary or notes for the expense. */\n summary?: string | undefined;\n /** The date the transaction occurred (from card statement). */\n transactionDate?: Date | undefined;\n /** Computed total: sum of line item amounts + tax + shipping. */\n total: number;\n /** Tax portion of the total. */\n tax: number;\n /** Shipping portion of the total. */\n shipping: number;\n /** Vendor where the expense was incurred. */\n vendorId: number;\n /** Business unit this expense is charged to. */\n businessUnitId?: number | undefined;\n /** Job this expense is associated with, if any. */\n jobId?: number | undefined;\n /** Project this expense is associated with, if any. */\n projectId?: number | undefined;\n /** Purchase order linked to this expense for two-way matching. */\n purchaseOrderId?: number | undefined;\n /** Employee (cardholder) who made the purchase. */\n employeeId?: number | undefined;\n /** Credit card GL account (Liability:Credit Card) this expense was charged to. */\n creditCardAccountId?: number | undefined;\n /** Merchant processing status (e.g. Pending, Complete, Error, Declined). */\n transactionStatus: string;\n /** Provider-supplied context for the transaction status — e.g. decline reason, error message, or status-specific note. */\n transactionStatusDetails?: string | undefined;\n /** Status of receipt documentation (e.g. Pending, Received). */\n receiptStatus: string;\n /** Last 4 digits of the card number. */\n cardNumberLast4?: string | undefined;\n /** Accounting sync/export status (e.g. Pending, Posted, Exported). */\n syncStatus: string;\n /** Batch this expense was posted in, if any. */\n batchId?: number | undefined;\n /** Identifier from the external expense provider (e.g. Ramp transaction ID). */\n externalId?: string | undefined;\n /** Name of the external provider (e.g. \"Ramp\"). */\n externalSource?: string | undefined;\n /** Card identifier from the external provider (e.g. Ramp card_id). */\n externalCardId?: string | undefined;\n /** Merchant Category Code (MCC) — a payment-brand classification of the merchant\nby the type of goods or services provided (e.g., \"5411\" for grocery stores).\nPopulated from the card network via the expense source (e.g., Ramp). */\n merchantCategory?: string | undefined;\n /** Default debit GL account for the expense. Line items may override with their own GeneralLedgerAccountId. */\n debitAccountId?: number | undefined;\n /** Default budget code for the expense. Line items may override with their own BudgetCodeId. */\n budgetCodeId?: number | undefined;\n /** Denormalized project label(s) for display/export. */\n projectLabels?: string | undefined;\n /** Line items with expense GL accounts. */\n lineItems: ExpenseTransactionLineItemResponse[];\n /** Receipt attachments. File content is in Azure Blob Storage; these are metadata records. */\n attachments: ExpenseAttachmentResponse[];\n}\n\nexport interface ExpenseTransactionLineItemResponse extends BaseEntityApiModel {\n /** Description of the line item. */\n description: string;\n /** Total dollar amount for this line item (Quantity × UnitPrice). */\n amount: number;\n /** Number of units purchased. */\n quantity: number;\n /** Dollar amount per unit. */\n unitPrice: number;\n /** Optional debit GL account override at the line level (defaults to header DebitAccountId if null). */\n generalLedgerAccountId?: number | undefined;\n /** Optional job override at the line level (defaults to header job if null). */\n jobId?: number | undefined;\n /** Optional project override at the line level (defaults to header project if null). */\n projectId?: number | undefined;\n /** Optional business unit override at the line level (defaults to header BU if null). */\n businessUnitId?: number | undefined;\n /** Optional budget code override at the line level (defaults to header BudgetCodeId if null). */\n budgetCodeId?: number | undefined;\n /** Denormalized project label for this line item. */\n projectLabels?: string | undefined;\n}\n\nexport interface ExpenseAttachmentResponse extends BaseEntityApiModel {\n /** Sanitized file name for display and download. */\n filename: string;\n /** Original file name as uploaded by the user. */\n originalFilename: string;\n /** MIME content type. */\n contentType: string;\n /** File size in bytes. */\n fileSize: number;\n}\n\nexport interface CreateExpenseTransactionRequest {\n /** Tenant-scoped expense transaction display number. */\n number: string;\n /** The date the transaction occurred (from card statement). */\n transactionDate?: Date | undefined;\n /** Tax portion of the total. */\n tax: number;\n /** Shipping portion of the total. */\n shipping: number;\n /** Vendor where the expense was incurred. */\n vendorId: number;\n /** Business unit this expense is charged to. */\n businessUnitId?: number | undefined;\n /** Job this expense is associated with, if any. */\n jobId?: number | undefined;\n /** Project this expense is associated with, if any. */\n projectId?: number | undefined;\n /** Purchase order linked to this expense for two-way matching. */\n purchaseOrderId?: number | undefined;\n /** Employee (cardholder) who made the purchase. */\n employeeId?: number | undefined;\n /** Credit card GL account (Liability:Credit Card) this expense was charged to. */\n creditCardAccountId?: number | undefined;\n /** Last 4 digits of the card number. */\n cardNumberLast4?: string | undefined;\n /** Merchant Category Code (MCC) — a payment-brand classification of the merchant\nby the type of goods or services provided (e.g., \"5411\" for grocery stores). */\n merchantCategory?: string | undefined;\n /** Merchant processing status (e.g. \"Pending\", \"Complete\", \"Error\", \"Declined\"). Defaults to \"Complete\" for manual input. */\n transactionStatus?: string | undefined;\n /** Provider-supplied context for the transaction status — e.g. decline reason, error message, or status-specific note. */\n transactionStatusDetails?: string | undefined;\n /** Free-text summary or notes for the expense. */\n summary?: string | undefined;\n /** Default debit GL account for the expense. Line items may override with their own GeneralLedgerAccountId. */\n debitAccountId?: number | undefined;\n /** Default budget code for the expense. Line items may override with their own BudgetCodeId. */\n budgetCodeId?: number | undefined;\n /** Denormalized project label(s) for display/export. */\n projectLabels?: string | undefined;\n /** Line items with expense GL accounts. */\n lineItems: ExpenseTransactionLineItemRequest[];\n}\n\nexport interface ExpenseTransactionLineItemRequest {\n /** Description of the line item. */\n description: string;\n /** Number of units purchased. */\n quantity: number;\n /** Dollar amount per unit. */\n unitPrice: number;\n /** Optional debit GL account override at the line level (defaults to header DebitAccountId if null). */\n generalLedgerAccountId?: number | undefined;\n /** Optional job override at the line level (defaults to header job if null). */\n jobId?: number | undefined;\n /** Optional project override at the line level (defaults to header project if null). */\n projectId?: number | undefined;\n /** Optional business unit override at the line level (defaults to header BU if null). */\n businessUnitId?: number | undefined;\n /** Optional budget code override at the line level (defaults to header BudgetCodeId if null). */\n budgetCodeId?: number | undefined;\n /** Denormalized project label for this line item. */\n projectLabels?: string | undefined;\n}\n\nexport interface UpdateExpenseTransactionRequest {\n /** Tenant-scoped expense transaction display number. */\n number: string;\n /** The date the transaction occurred (from card statement). */\n transactionDate?: Date | undefined;\n /** Tax portion of the total. */\n tax: number;\n /** Shipping portion of the total. */\n shipping: number;\n /** Vendor where the expense was incurred. */\n vendorId: number;\n /** Business unit this expense is charged to. */\n businessUnitId?: number | undefined;\n /** Job this expense is associated with, if any. */\n jobId?: number | undefined;\n /** Project this expense is associated with, if any. */\n projectId?: number | undefined;\n /** Purchase order linked to this expense for two-way matching. */\n purchaseOrderId?: number | undefined;\n /** Employee (cardholder) who made the purchase. */\n employeeId?: number | undefined;\n /** Credit card GL account (Liability:Credit Card) this expense was charged to. */\n creditCardAccountId?: number | undefined;\n /** Last 4 digits of the card number. */\n cardNumberLast4?: string | undefined;\n /** Merchant Category Code (MCC) — a payment-brand classification of the merchant\nby the type of goods or services provided (e.g., \"5411\" for grocery stores). */\n merchantCategory?: string | undefined;\n /** Merchant processing status (e.g. \"Pending\", \"Complete\", \"Error\", \"Declined\"). */\n transactionStatus?: string | undefined;\n /** Provider-supplied context for the transaction status — e.g. decline reason, error message, or status-specific note. */\n transactionStatusDetails?: string | undefined;\n /** Free-text summary or notes for the expense. */\n summary?: string | undefined;\n /** Default debit GL account for the expense. Line items may override with their own GeneralLedgerAccountId. */\n debitAccountId?: number | undefined;\n /** Default budget code for the expense. Line items may override with their own BudgetCodeId. */\n budgetCodeId?: number | undefined;\n /** Denormalized project label(s) for display/export. */\n projectLabels?: string | undefined;\n /** Line items with expense GL accounts. Include Id for existing items, omit for new. */\n lineItems: UpdateExpenseTransactionLineItemRequest[];\n}\n\nexport interface UpdateExpenseTransactionLineItemRequest {\n /** ID of an existing line item to update. Null for new line items. */\n id?: string | undefined;\n /** Description of the line item. */\n description: string;\n /** Number of units purchased. */\n quantity: number;\n /** Dollar amount per unit. */\n unitPrice: number;\n /** Optional debit GL account override at the line level (defaults to header DebitAccountId if null). */\n generalLedgerAccountId?: number | undefined;\n /** Optional job override at the line level (defaults to header job if null). */\n jobId?: number | undefined;\n /** Optional project override at the line level (defaults to header project if null). */\n projectId?: number | undefined;\n /** Optional business unit override at the line level (defaults to header BU if null). */\n businessUnitId?: number | undefined;\n /** Optional budget code override at the line level (defaults to header BudgetCodeId if null). */\n budgetCodeId?: number | undefined;\n /** Denormalized project label for this line item. */\n projectLabels?: string | undefined;\n}\n\nexport interface UpdateExpenseSyncStatusResponse {\n /** Whether any expenses were updated. */\n updated: boolean;\n /** Number of expense transactions that were updated. */\n updatedCount: number;\n}\n\nexport interface UpdateExpenseSyncStatusRequest {\n /** IDs of the expense transactions to update. Maximum 500. */\n expenseIds: string[];\n /** Target sync status (e.g. \"Pending\", \"Posted\", \"Exported\"). */\n targetStatus: string;\n /** Batch ID. Required when transitioning to Posted. */\n batchId?: number | undefined;\n}\n\nexport interface FileParameter {\n data: any;\n fileName: string;\n}\n"],"names":["axios","injectable","inject","optional","symbolToken","makeCodedException","BASE_URL_TOKEN_ExpenseManagement","ExpenseManagement","list","tenantId","ids","vendorIds","jobIds","projectIds","syncStatuses","transactionStatuses","dateFrom","dateTo","creditCardAccountIds","businessUnitIds","batchId","totalMin","totalMax","page","pageSize","sortBy","sortDirection","cancelToken","url_","undefined","Error","replace","encodeURIComponent","forEach","item","toJSON","options_","baseURL","baseUrl","url","method","headers","request","create","content_","data","get","id","update","delete","updateSyncStatus","uploadAttachment","expenseId","file","FormData","append","fileName","listAttachments","downloadAttachment","attachmentId","deleteAttachment","jsonParseReviver"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB,GAClB,kBAAkB,GAClB,wBAAwB;AACxB,mBAAmB;AACnB,mEAAmE;AACnE,oBAAoB;AACpB,wBAAwB;AACxB,uCAAuC;AAEvC,OAAOA,WAA8D,QAAQ;AAC7E,SAASC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,0BAA0B;AACpF,SAASC,kBAAkB,QAAqB,UAAU;AAiE1D,OAAO,MAAMC,mCAAmCF,YAAoB,kBAAkB,OAAO;AAG7F,OAAO,MAAMG;IAMT;;;;;;;;;;;;;;;;;;;KAmBC,GACDC,KAAKC,QAAgB,EAAEC,GAAgC,EAAEC,SAAsC,EAAEC,MAAmC,EAAEC,UAAuC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G,OAAO,CAAC,cAAcC,mBAAmB,KAAKvB;QAC1D,IAAI2C,cAAcvB,aAAauB,cAAc,MACzC,MAAM,IAAItB,MAAM;QACpBF,OAAOA,KAAKG,OAAO,CAAC,eAAeC,mBAAmB,KAAKoB;QAC3D,IAAIO,iBAAiB9B,aAAa8B,iBAAiB,MAC/C,MAAM,IAAI7B,MAAM;QACpBF,OAAOA,KAAKG,OAAO,CAAC,kBAAkBC,mBAAmB,KAAK2B;QAC9D/B,OAAOA,KAAKG,OAAO,CAAC,SAAS;QAE7B,IAAIK,WAA+B;YAC/BC,SAAS,IAAI,CAACC,OAAO;YACrBX;YACAY,KAAKX;YACLY,QAAQ;YACRC,SAAS;gBACL,gBAAgB;YACpB;QACJ;QAEA,OAAOpC,mBAAmBL,MAAM0C,OAAO,CAAON;IAClD;IAhVA,YAAY,AAAuEE,UAAU,EAAE,CAAE;;QAFjG,uBAAUuB,oBAAV,KAAA;aAEmFvB,UAAAA;aAFzEuB,mBAAmEhC;IAG7E;AAgVJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as ApBillApprovalSettingsV2 from './ap-bill-approval-settings-v2.api';
|
|
2
|
+
export * as ApBillApprovalV2 from './ap-bill-approval-v2.api';
|
|
3
|
+
export * as ExpenseManagement from './expense-management.api';
|
|
4
|
+
export * as VendorSync from './vendor-sync.api';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,wBAAwB,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _ApBillApprovalSettingsV2 from './ap-bill-approval-settings-v2.api';
|
|
2
|
+
export { _ApBillApprovalSettingsV2 as ApBillApprovalSettingsV2 };
|
|
3
|
+
import * as _ApBillApprovalV2 from './ap-bill-approval-v2.api';
|
|
4
|
+
export { _ApBillApprovalV2 as ApBillApprovalV2 };
|
|
5
|
+
import * as _ExpenseManagement from './expense-management.api';
|
|
6
|
+
export { _ExpenseManagement as ExpenseManagement };
|
|
7
|
+
import * as _VendorSync from './vendor-sync.api';
|
|
8
|
+
export { _VendorSync as VendorSync };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * as ApBillApprovalSettingsV2 from './ap-bill-approval-settings-v2.api';\nexport * as ApBillApprovalV2 from './ap-bill-approval-v2.api';\nexport * as ExpenseManagement from './expense-management.api';\nexport * as VendorSync from './vendor-sync.api';\n"],"names":["ApBillApprovalSettingsV2","ApBillApprovalV2","ExpenseManagement","VendorSync"],"mappings":"AAAA,2CAA0C,qCAAqC;AAA/E,SAAO,6BAAKA,wBAAwB,GAA2C;AAC/E,mCAAkC,4BAA4B;AAA9D,SAAO,qBAAKC,gBAAgB,GAAkC;AAC9D,oCAAmC,2BAA2B;AAA9D,SAAO,sBAAKC,iBAAiB,GAAiC;AAC9D,6BAA4B,oBAAoB;AAAhD,SAAO,eAAKC,UAAU,GAA0B"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosPromise, AxiosError } from 'axios';
|
|
2
|
+
export { AxiosError };
|
|
3
|
+
export interface ExceptionData {
|
|
4
|
+
Message?: string;
|
|
5
|
+
FieldErrors?: Record<string, string[]>;
|
|
6
|
+
}
|
|
7
|
+
export interface ExceptionResponse {
|
|
8
|
+
Error: ExceptionData;
|
|
9
|
+
}
|
|
10
|
+
export declare const makeCodedException: <T>(request: AxiosPromise<T>) => Promise<AxiosResponse<T, any, {}>>;
|
|
11
|
+
export declare const makeContent: (content: any, unspecifiedPaths: string[]) => string;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,aAAa,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,GAAU,CAAC,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,uCAWnE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,GAAG,EAAE,kBAAkB,MAAM,EAAE,WAgBnE,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* tslint:disable */ /* eslint-disable */ // Bundled utilities for the @servicetitan/moneyout-api-client package.
|
|
2
|
+
// These are used by the auto-generated API client files and are sourced
|
|
3
|
+
// from packages/utils in the monolith.
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import { AxiosError } from 'axios';
|
|
6
|
+
export { AxiosError };
|
|
7
|
+
export const makeCodedException = async (request)=>{
|
|
8
|
+
try {
|
|
9
|
+
return await request;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
const error = e;
|
|
12
|
+
if (error.response && typeof error.response.data !== 'string') {
|
|
13
|
+
error.response.data = error.response.data || {};
|
|
14
|
+
error.response.data.Error = error.response.data.Error || {};
|
|
15
|
+
}
|
|
16
|
+
return Promise.reject(error);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const makeContent = (content, unspecifiedPaths)=>{
|
|
20
|
+
const paths = new Map();
|
|
21
|
+
const pathsSegments = unspecifiedPaths.map((p)=>splitPath(p));
|
|
22
|
+
return JSON.stringify(content, function(key, value) {
|
|
23
|
+
const path = (paths.get(this) || '$') + (Array.isArray(this) ? '[*]' : key ? '.' + key : '');
|
|
24
|
+
const originalValue = this[key];
|
|
25
|
+
if (originalValue !== null && typeof originalValue === 'object') {
|
|
26
|
+
paths.set(originalValue, path);
|
|
27
|
+
}
|
|
28
|
+
return matchPath(path, pathsSegments) && originalValue != null ? moment(originalValue).format('YYYY-MM-DDTHH:mm:ss') : value;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const splitPath = (path)=>path.split(/\.|(?=\[\*\])/);
|
|
32
|
+
const matchPath = (path, pathsSegments)=>{
|
|
33
|
+
const pathSegments = splitPath(path);
|
|
34
|
+
return pathsSegments.some((segments)=>segments.length === pathSegments.length && segments.every((s, i)=>s === '*' || s === pathSegments[i]));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n// Bundled utilities for the @servicetitan/moneyout-api-client package.\n// These are used by the auto-generated API client files and are sourced\n// from packages/utils in the monolith.\n\nimport moment from 'moment';\nimport { AxiosResponse, AxiosPromise, AxiosError } from 'axios';\nexport { AxiosError };\n\nexport interface ExceptionData {\n Message?: string;\n FieldErrors?: Record<string, string[]>;\n}\n\nexport interface ExceptionResponse {\n Error: ExceptionData;\n}\n\nexport const makeCodedException = async <T>(request: AxiosPromise<T>) => {\n try {\n return await request;\n } catch (e) {\n const error = e as AxiosError<ExceptionResponse | string>;\n if (error.response && typeof error.response.data !== 'string') {\n error.response.data = error.response.data || {};\n error.response.data.Error = error.response.data.Error || {};\n }\n return Promise.reject(error);\n }\n};\n\nexport const makeContent = (content: any, unspecifiedPaths: string[]) => {\n const paths = new Map<any, string>();\n const pathsSegments = unspecifiedPaths.map(p => splitPath(p));\n\n return JSON.stringify(content, function (key, value) {\n const path =\n (paths.get(this) || '$') + (Array.isArray(this) ? '[*]' : key ? '.' + key : '');\n const originalValue = this[key];\n if (originalValue !== null && typeof originalValue === 'object') {\n paths.set(originalValue, path);\n }\n\n return matchPath(path, pathsSegments) && originalValue != null\n ? moment(originalValue).format('YYYY-MM-DDTHH:mm:ss')\n : value;\n });\n};\n\nconst splitPath = (path: string) => path.split(/\\.|(?=\\[\\*\\])/);\n\nconst matchPath = (path: string, pathsSegments: string[][]) => {\n const pathSegments = splitPath(path);\n return pathsSegments.some(segments =>\n segments.length === pathSegments.length &&\n segments.every((s, i) => s === '*' || s === pathSegments[i])\n );\n};\n"],"names":["moment","AxiosError","makeCodedException","request","e","error","response","data","Error","Promise","reject","makeContent","content","unspecifiedPaths","paths","Map","pathsSegments","map","p","splitPath","JSON","stringify","key","value","path","get","Array","isArray","originalValue","set","matchPath","format","split","pathSegments","some","segments","length","every","s","i"],"mappings":"AAAA,kBAAkB,GAClB,kBAAkB,GAClB,uEAAuE;AACvE,wEAAwE;AACxE,uCAAuC;AAEvC,OAAOA,YAAY,SAAS;AAC5B,SAAsCC,UAAU,QAAQ,QAAQ;AAChE,SAASA,UAAU,GAAG;AAWtB,OAAO,MAAMC,qBAAqB,OAAUC;IACxC,IAAI;QACA,OAAO,MAAMA;IACjB,EAAE,OAAOC,GAAG;QACR,MAAMC,QAAQD;QACd,IAAIC,MAAMC,QAAQ,IAAI,OAAOD,MAAMC,QAAQ,CAACC,IAAI,KAAK,UAAU;YAC3DF,MAAMC,QAAQ,CAACC,IAAI,GAAGF,MAAMC,QAAQ,CAACC,IAAI,IAAI,CAAC;YAC9CF,MAAMC,QAAQ,CAACC,IAAI,CAACC,KAAK,GAAGH,MAAMC,QAAQ,CAACC,IAAI,CAACC,KAAK,IAAI,CAA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