@fabriktor/client 0.0.28 → 0.0.31
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/src/billable/billable.d.ts +213 -0
- package/dist/src/billable/billable.js +441 -0
- package/dist/src/calls/calls.d.ts +34 -0
- package/dist/src/calls/calls.js +65 -0
- package/dist/src/chat/chat.d.ts +97 -0
- package/dist/src/chat/chat.js +224 -0
- package/dist/src/contacts/contacts.d.ts +37 -0
- package/dist/src/contacts/contacts.js +94 -0
- package/dist/src/core/col.d.ts +7 -1
- package/dist/src/core/col.js +29 -14
- package/dist/src/core/crud.d.ts +1 -1
- package/dist/src/core/crud.js +1 -1
- package/dist/src/core/http.d.ts +3 -4
- package/dist/src/core/http.js +3 -3
- package/dist/src/core/idempotency.js +1 -1
- package/dist/src/core/multipart.d.ts +25 -0
- package/dist/src/core/multipart.js +93 -0
- package/dist/src/feed/feed.d.ts +65 -0
- package/dist/src/feed/feed.js +130 -0
- package/dist/src/fulfillments/fulfillments.d.ts +36 -0
- package/dist/src/fulfillments/fulfillments.js +68 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +14 -0
- package/dist/src/jobs/jobs.d.ts +69 -0
- package/dist/src/jobs/jobs.js +143 -0
- package/dist/src/marketplace/marketplace.d.ts +49 -0
- package/dist/src/marketplace/marketplace.js +94 -0
- package/dist/src/payments/payments.d.ts +154 -0
- package/dist/src/payments/payments.js +328 -0
- package/dist/src/payrolls/payrolls.d.ts +179 -0
- package/dist/src/payrolls/payrolls.js +380 -0
- package/dist/src/processes/processes.d.ts +3 -3
- package/dist/src/routes/routes.d.ts +93 -0
- package/dist/src/routes/routes.js +185 -0
- package/dist/src/storage/storage.d.ts +124 -0
- package/dist/src/storage/storage.js +242 -0
- package/dist/src/timesheets/timesheets.d.ts +49 -0
- package/dist/src/timesheets/timesheets.js +105 -0
- package/dist/src/users/tmp_phones.d.ts +1 -1
- package/dist/src/users/tmp_usernames.d.ts +5 -4
- package/dist/src/users/users.d.ts +13 -12
- package/dist/src/users/users.js +4 -1
- package/package.json +3 -2
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { type Bill, type BillableFolder, type Charge, type Equipment, type InBill, type InBillableFolder, type InCharge, type InEquipment, type InItem, type InLaborRate, type InMeterReading, type InQuantifier, type InTax, type InTmpBillNumber, type InVendorInvoice, type InWarehouse, type Item, type LaborRate, type MeterReading, type OperationResult, type PLBillablePeriodsFromDates, type PLBillableSetItemQuantity, type PLBillableVendorInvoiceFromBill, type PLBillableYearSpan, type Quantifier, type RPBillablePeriodsFromDates, type Tax, type TmpBillNumber, type VendorInvoice, type Warehouse, type YearSpan } from "@fabriktor/schema";
|
|
2
|
+
import type { TokenProvider } from "../core/auth.js";
|
|
3
|
+
import type { DeleteManyOptionsCRUD, DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
|
+
import type { HTTPDoer } from "../core/http.js";
|
|
5
|
+
export type GenerateBillOptions = InBill;
|
|
6
|
+
export type YearSpanOptions = PLBillableYearSpan;
|
|
7
|
+
export type PeriodsFromDatesOptions = PLBillablePeriodsFromDates;
|
|
8
|
+
export type VendorInvoiceFromBillOptions = PLBillableVendorInvoiceFromBill;
|
|
9
|
+
export type SetItemQuantityOptions = PLBillableSetItemQuantity;
|
|
10
|
+
export type BillableClientOptions = {
|
|
11
|
+
http: HTTPDoer;
|
|
12
|
+
base_url: string;
|
|
13
|
+
get_token?: TokenProvider;
|
|
14
|
+
};
|
|
15
|
+
export interface BillableOperator {
|
|
16
|
+
queryBills(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Bill[]>>;
|
|
17
|
+
insertOneBill(opts: InsertOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
18
|
+
findOneBill(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Bill>>;
|
|
19
|
+
replaceOneBill(opts: ReplaceOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
20
|
+
deleteOneBill(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
21
|
+
deleteManyBills(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
22
|
+
searchManyBills(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Bill>>>;
|
|
23
|
+
queryBillableFolders(opts?: QueryOptionsCRUD): Promise<OperationResultOf<BillableFolder[]>>;
|
|
24
|
+
insertOneBillableFolder(opts: InsertOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
25
|
+
findOneBillableFolder(opts: FindOneOptionsCRUD): Promise<OperationResultOf<BillableFolder>>;
|
|
26
|
+
replaceOneBillableFolder(opts: ReplaceOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
27
|
+
deleteOneBillableFolder(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
28
|
+
deleteManyBillableFolders(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
29
|
+
searchManyBillableFolders(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<BillableFolder>>>;
|
|
30
|
+
queryCharges(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Charge[]>>;
|
|
31
|
+
insertOneCharge(opts: InsertOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
32
|
+
findOneCharge(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Charge>>;
|
|
33
|
+
replaceOneCharge(opts: ReplaceOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
34
|
+
deleteOneCharge(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
35
|
+
deleteManyCharges(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
36
|
+
searchManyCharges(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Charge>>>;
|
|
37
|
+
queryEquipments(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Equipment[]>>;
|
|
38
|
+
insertOneEquipment(opts: InsertOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
39
|
+
findOneEquipment(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Equipment>>;
|
|
40
|
+
replaceOneEquipment(opts: ReplaceOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
41
|
+
deleteOneEquipment(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
42
|
+
deleteManyEquipments(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
43
|
+
searchManyEquipments(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Equipment>>>;
|
|
44
|
+
queryItems(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Item[]>>;
|
|
45
|
+
insertOneItem(opts: InsertOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
46
|
+
findOneItem(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Item>>;
|
|
47
|
+
replaceOneItem(opts: ReplaceOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
48
|
+
deleteOneItem(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
49
|
+
deleteManyItems(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
50
|
+
searchManyItems(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Item>>>;
|
|
51
|
+
queryLaborRates(opts?: QueryOptionsCRUD): Promise<OperationResultOf<LaborRate[]>>;
|
|
52
|
+
insertOneLaborRate(opts: InsertOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
53
|
+
findOneLaborRate(opts: FindOneOptionsCRUD): Promise<OperationResultOf<LaborRate>>;
|
|
54
|
+
replaceOneLaborRate(opts: ReplaceOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
55
|
+
deleteOneLaborRate(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
56
|
+
deleteManyLaborRates(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
57
|
+
searchManyLaborRates(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<LaborRate>>>;
|
|
58
|
+
queryMeterReadings(opts?: QueryOptionsCRUD): Promise<OperationResultOf<MeterReading[]>>;
|
|
59
|
+
insertOneMeterReading(opts: InsertOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
60
|
+
findOneMeterReading(opts: FindOneOptionsCRUD): Promise<OperationResultOf<MeterReading>>;
|
|
61
|
+
replaceOneMeterReading(opts: ReplaceOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
62
|
+
deleteOneMeterReading(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
63
|
+
deleteManyMeterReadings(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
64
|
+
searchManyMeterReadings(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<MeterReading>>>;
|
|
65
|
+
queryQuantifiers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Quantifier[]>>;
|
|
66
|
+
insertOneQuantifier(opts: InsertOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
67
|
+
findOneQuantifier(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Quantifier>>;
|
|
68
|
+
replaceOneQuantifier(opts: ReplaceOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
69
|
+
deleteOneQuantifier(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
70
|
+
deleteManyQuantifiers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
71
|
+
searchManyQuantifiers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Quantifier>>>;
|
|
72
|
+
queryTaxes(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Tax[]>>;
|
|
73
|
+
insertOneTax(opts: InsertOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
74
|
+
findOneTax(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Tax>>;
|
|
75
|
+
replaceOneTax(opts: ReplaceOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
76
|
+
deleteOneTax(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
77
|
+
deleteManyTaxes(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
78
|
+
searchManyTaxes(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Tax>>>;
|
|
79
|
+
queryTmpBillNumbers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<TmpBillNumber[]>>;
|
|
80
|
+
insertOneTmpBillNumber(opts: InsertOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
81
|
+
findOneTmpBillNumber(opts: FindOneOptionsCRUD): Promise<OperationResultOf<TmpBillNumber>>;
|
|
82
|
+
replaceOneTmpBillNumber(opts: ReplaceOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
83
|
+
deleteOneTmpBillNumber(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
84
|
+
deleteManyTmpBillNumbers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
85
|
+
searchManyTmpBillNumbers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<TmpBillNumber>>>;
|
|
86
|
+
queryVendorInvoices(opts?: QueryOptionsCRUD): Promise<OperationResultOf<VendorInvoice[]>>;
|
|
87
|
+
insertOneVendorInvoice(opts: InsertOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
88
|
+
findOneVendorInvoice(opts: FindOneOptionsCRUD): Promise<OperationResultOf<VendorInvoice>>;
|
|
89
|
+
replaceOneVendorInvoice(opts: ReplaceOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
90
|
+
deleteOneVendorInvoice(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
91
|
+
deleteManyVendorInvoices(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
92
|
+
searchManyVendorInvoices(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<VendorInvoice>>>;
|
|
93
|
+
queryWarehouses(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Warehouse[]>>;
|
|
94
|
+
insertOneWarehouse(opts: InsertOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
95
|
+
findOneWarehouse(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Warehouse>>;
|
|
96
|
+
replaceOneWarehouse(opts: ReplaceOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
97
|
+
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
98
|
+
deleteManyWarehouses(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
99
|
+
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
100
|
+
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
101
|
+
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
102
|
+
periodsFromDates(opts: PeriodsFromDatesOptions): Promise<OperationResultOf<RPBillablePeriodsFromDates>>;
|
|
103
|
+
vendorInvoiceFromBill(opts: VendorInvoiceFromBillOptions): Promise<OperationResult>;
|
|
104
|
+
setItemQuantity(opts: SetItemQuantityOptions): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
export declare class BillableClient implements BillableOperator {
|
|
107
|
+
private bills;
|
|
108
|
+
private billable_folders;
|
|
109
|
+
private charges;
|
|
110
|
+
private equipments;
|
|
111
|
+
private items;
|
|
112
|
+
private labor_rates;
|
|
113
|
+
private meter_readings;
|
|
114
|
+
private quantifiers;
|
|
115
|
+
private taxes;
|
|
116
|
+
private tmp_bill_numbers;
|
|
117
|
+
private vendor_invoices;
|
|
118
|
+
private warehouses;
|
|
119
|
+
private http;
|
|
120
|
+
private base_url;
|
|
121
|
+
private get_token?;
|
|
122
|
+
constructor(opts: BillableClientOptions);
|
|
123
|
+
queryBills(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Bill[]>>;
|
|
124
|
+
insertOneBill(opts: InsertOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
125
|
+
findOneBill(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Bill>>;
|
|
126
|
+
replaceOneBill(opts: ReplaceOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
127
|
+
deleteOneBill(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
128
|
+
deleteManyBills(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
129
|
+
searchManyBills(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Bill>>>;
|
|
130
|
+
queryBillableFolders(opts?: QueryOptionsCRUD): Promise<OperationResultOf<BillableFolder[]>>;
|
|
131
|
+
insertOneBillableFolder(opts: InsertOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
132
|
+
findOneBillableFolder(opts: FindOneOptionsCRUD): Promise<OperationResultOf<BillableFolder>>;
|
|
133
|
+
replaceOneBillableFolder(opts: ReplaceOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
134
|
+
deleteOneBillableFolder(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
135
|
+
deleteManyBillableFolders(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
136
|
+
searchManyBillableFolders(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<BillableFolder>>>;
|
|
137
|
+
queryCharges(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Charge[]>>;
|
|
138
|
+
insertOneCharge(opts: InsertOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
139
|
+
findOneCharge(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Charge>>;
|
|
140
|
+
replaceOneCharge(opts: ReplaceOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
141
|
+
deleteOneCharge(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
142
|
+
deleteManyCharges(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
143
|
+
searchManyCharges(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Charge>>>;
|
|
144
|
+
queryEquipments(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Equipment[]>>;
|
|
145
|
+
insertOneEquipment(opts: InsertOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
146
|
+
findOneEquipment(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Equipment>>;
|
|
147
|
+
replaceOneEquipment(opts: ReplaceOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
148
|
+
deleteOneEquipment(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
149
|
+
deleteManyEquipments(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
150
|
+
searchManyEquipments(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Equipment>>>;
|
|
151
|
+
queryItems(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Item[]>>;
|
|
152
|
+
insertOneItem(opts: InsertOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
153
|
+
findOneItem(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Item>>;
|
|
154
|
+
replaceOneItem(opts: ReplaceOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
155
|
+
deleteOneItem(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
156
|
+
deleteManyItems(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
157
|
+
searchManyItems(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Item>>>;
|
|
158
|
+
queryLaborRates(opts?: QueryOptionsCRUD): Promise<OperationResultOf<LaborRate[]>>;
|
|
159
|
+
insertOneLaborRate(opts: InsertOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
160
|
+
findOneLaborRate(opts: FindOneOptionsCRUD): Promise<OperationResultOf<LaborRate>>;
|
|
161
|
+
replaceOneLaborRate(opts: ReplaceOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
162
|
+
deleteOneLaborRate(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
163
|
+
deleteManyLaborRates(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
164
|
+
searchManyLaborRates(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<LaborRate>>>;
|
|
165
|
+
queryMeterReadings(opts?: QueryOptionsCRUD): Promise<OperationResultOf<MeterReading[]>>;
|
|
166
|
+
insertOneMeterReading(opts: InsertOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
167
|
+
findOneMeterReading(opts: FindOneOptionsCRUD): Promise<OperationResultOf<MeterReading>>;
|
|
168
|
+
replaceOneMeterReading(opts: ReplaceOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
169
|
+
deleteOneMeterReading(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
170
|
+
deleteManyMeterReadings(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
171
|
+
searchManyMeterReadings(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<MeterReading>>>;
|
|
172
|
+
queryQuantifiers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Quantifier[]>>;
|
|
173
|
+
insertOneQuantifier(opts: InsertOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
174
|
+
findOneQuantifier(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Quantifier>>;
|
|
175
|
+
replaceOneQuantifier(opts: ReplaceOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
176
|
+
deleteOneQuantifier(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
177
|
+
deleteManyQuantifiers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
178
|
+
searchManyQuantifiers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Quantifier>>>;
|
|
179
|
+
queryTaxes(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Tax[]>>;
|
|
180
|
+
insertOneTax(opts: InsertOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
181
|
+
findOneTax(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Tax>>;
|
|
182
|
+
replaceOneTax(opts: ReplaceOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
183
|
+
deleteOneTax(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
184
|
+
deleteManyTaxes(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
185
|
+
searchManyTaxes(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Tax>>>;
|
|
186
|
+
queryTmpBillNumbers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<TmpBillNumber[]>>;
|
|
187
|
+
insertOneTmpBillNumber(opts: InsertOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
188
|
+
findOneTmpBillNumber(opts: FindOneOptionsCRUD): Promise<OperationResultOf<TmpBillNumber>>;
|
|
189
|
+
replaceOneTmpBillNumber(opts: ReplaceOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
190
|
+
deleteOneTmpBillNumber(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
191
|
+
deleteManyTmpBillNumbers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
192
|
+
searchManyTmpBillNumbers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<TmpBillNumber>>>;
|
|
193
|
+
queryVendorInvoices(opts?: QueryOptionsCRUD): Promise<OperationResultOf<VendorInvoice[]>>;
|
|
194
|
+
insertOneVendorInvoice(opts: InsertOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
195
|
+
findOneVendorInvoice(opts: FindOneOptionsCRUD): Promise<OperationResultOf<VendorInvoice>>;
|
|
196
|
+
replaceOneVendorInvoice(opts: ReplaceOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
197
|
+
deleteOneVendorInvoice(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
198
|
+
deleteManyVendorInvoices(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
199
|
+
searchManyVendorInvoices(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<VendorInvoice>>>;
|
|
200
|
+
queryWarehouses(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Warehouse[]>>;
|
|
201
|
+
insertOneWarehouse(opts: InsertOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
202
|
+
findOneWarehouse(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Warehouse>>;
|
|
203
|
+
replaceOneWarehouse(opts: ReplaceOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
204
|
+
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
205
|
+
deleteManyWarehouses(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
206
|
+
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
207
|
+
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
208
|
+
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
209
|
+
periodsFromDates(opts: PeriodsFromDatesOptions): Promise<OperationResultOf<RPBillablePeriodsFromDates>>;
|
|
210
|
+
vendorInvoiceFromBill(opts: VendorInvoiceFromBillOptions): Promise<OperationResult>;
|
|
211
|
+
setItemQuantity(opts: SetItemQuantityOptions): Promise<void>;
|
|
212
|
+
}
|
|
213
|
+
export declare function newBillableClient(opts: BillableClientOptions): BillableClient;
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
// Copyright (C) Fabriktor, Inc. 2025-present.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
4
|
+
// not use this file except in compliance with the License. You may obtain
|
|
5
|
+
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
import { ColBillableBills, ColBillableCharges, ColBillableEquipments, ColBillableFolders, ColBillableItems, ColBillableLaborRates, ColBillableMeterReadings, ColBillableQuantifiers, ColBillableTaxes, ColBillableTmpBillNumbers, ColBillableVendorInvoices, ColBillableWarehouses, HTTPMethodPost, PathBillableFromBill, PathBillableGenerate, PathBillablePeriodsFromDates, PathBillableSetQuantity, PathBillableYearSpan, SvcBillable, } from "@fabriktor/schema";
|
|
7
|
+
import { requiredToken } from "../core/auth.js";
|
|
8
|
+
import { newCRUDClient } from "../core/crud.js";
|
|
9
|
+
import { buildPath } from "../core/path.js";
|
|
10
|
+
export class BillableClient {
|
|
11
|
+
bills;
|
|
12
|
+
billable_folders;
|
|
13
|
+
charges;
|
|
14
|
+
equipments;
|
|
15
|
+
items;
|
|
16
|
+
labor_rates;
|
|
17
|
+
meter_readings;
|
|
18
|
+
quantifiers;
|
|
19
|
+
taxes;
|
|
20
|
+
tmp_bill_numbers;
|
|
21
|
+
vendor_invoices;
|
|
22
|
+
warehouses;
|
|
23
|
+
http;
|
|
24
|
+
base_url;
|
|
25
|
+
get_token;
|
|
26
|
+
constructor(opts) {
|
|
27
|
+
this.bills = newCRUDClient({
|
|
28
|
+
http: opts.http,
|
|
29
|
+
base_url: opts.base_url,
|
|
30
|
+
svc: SvcBillable,
|
|
31
|
+
col: ColBillableBills,
|
|
32
|
+
get_token: opts.get_token,
|
|
33
|
+
});
|
|
34
|
+
this.billable_folders = newCRUDClient({
|
|
35
|
+
http: opts.http,
|
|
36
|
+
base_url: opts.base_url,
|
|
37
|
+
svc: SvcBillable,
|
|
38
|
+
col: ColBillableFolders,
|
|
39
|
+
get_token: opts.get_token,
|
|
40
|
+
});
|
|
41
|
+
this.charges = newCRUDClient({
|
|
42
|
+
http: opts.http,
|
|
43
|
+
base_url: opts.base_url,
|
|
44
|
+
svc: SvcBillable,
|
|
45
|
+
col: ColBillableCharges,
|
|
46
|
+
get_token: opts.get_token,
|
|
47
|
+
});
|
|
48
|
+
this.equipments = newCRUDClient({
|
|
49
|
+
http: opts.http,
|
|
50
|
+
base_url: opts.base_url,
|
|
51
|
+
svc: SvcBillable,
|
|
52
|
+
col: ColBillableEquipments,
|
|
53
|
+
get_token: opts.get_token,
|
|
54
|
+
});
|
|
55
|
+
this.items = newCRUDClient({
|
|
56
|
+
http: opts.http,
|
|
57
|
+
base_url: opts.base_url,
|
|
58
|
+
svc: SvcBillable,
|
|
59
|
+
col: ColBillableItems,
|
|
60
|
+
get_token: opts.get_token,
|
|
61
|
+
});
|
|
62
|
+
this.labor_rates = newCRUDClient({
|
|
63
|
+
http: opts.http,
|
|
64
|
+
base_url: opts.base_url,
|
|
65
|
+
svc: SvcBillable,
|
|
66
|
+
col: ColBillableLaborRates,
|
|
67
|
+
get_token: opts.get_token,
|
|
68
|
+
});
|
|
69
|
+
this.meter_readings = newCRUDClient({
|
|
70
|
+
http: opts.http,
|
|
71
|
+
base_url: opts.base_url,
|
|
72
|
+
svc: SvcBillable,
|
|
73
|
+
col: ColBillableMeterReadings,
|
|
74
|
+
get_token: opts.get_token,
|
|
75
|
+
});
|
|
76
|
+
this.quantifiers = newCRUDClient({
|
|
77
|
+
http: opts.http,
|
|
78
|
+
base_url: opts.base_url,
|
|
79
|
+
svc: SvcBillable,
|
|
80
|
+
col: ColBillableQuantifiers,
|
|
81
|
+
get_token: opts.get_token,
|
|
82
|
+
});
|
|
83
|
+
this.taxes = newCRUDClient({
|
|
84
|
+
http: opts.http,
|
|
85
|
+
base_url: opts.base_url,
|
|
86
|
+
svc: SvcBillable,
|
|
87
|
+
col: ColBillableTaxes,
|
|
88
|
+
get_token: opts.get_token,
|
|
89
|
+
});
|
|
90
|
+
this.tmp_bill_numbers = newCRUDClient({
|
|
91
|
+
http: opts.http,
|
|
92
|
+
base_url: opts.base_url,
|
|
93
|
+
svc: SvcBillable,
|
|
94
|
+
col: ColBillableTmpBillNumbers,
|
|
95
|
+
get_token: opts.get_token,
|
|
96
|
+
});
|
|
97
|
+
this.vendor_invoices = newCRUDClient({
|
|
98
|
+
http: opts.http,
|
|
99
|
+
base_url: opts.base_url,
|
|
100
|
+
svc: SvcBillable,
|
|
101
|
+
col: ColBillableVendorInvoices,
|
|
102
|
+
get_token: opts.get_token,
|
|
103
|
+
});
|
|
104
|
+
this.warehouses = newCRUDClient({
|
|
105
|
+
http: opts.http,
|
|
106
|
+
base_url: opts.base_url,
|
|
107
|
+
svc: SvcBillable,
|
|
108
|
+
col: ColBillableWarehouses,
|
|
109
|
+
get_token: opts.get_token,
|
|
110
|
+
});
|
|
111
|
+
this.http = opts.http;
|
|
112
|
+
this.base_url = opts.base_url;
|
|
113
|
+
this.get_token = opts.get_token;
|
|
114
|
+
}
|
|
115
|
+
async queryBills(opts) {
|
|
116
|
+
return await this.bills.query(opts);
|
|
117
|
+
}
|
|
118
|
+
async insertOneBill(opts) {
|
|
119
|
+
return await this.bills.insertOne(opts);
|
|
120
|
+
}
|
|
121
|
+
async findOneBill(opts) {
|
|
122
|
+
return await this.bills.findOne(opts);
|
|
123
|
+
}
|
|
124
|
+
async replaceOneBill(opts) {
|
|
125
|
+
return await this.bills.replaceOne(opts);
|
|
126
|
+
}
|
|
127
|
+
async deleteOneBill(opts) {
|
|
128
|
+
return await this.bills.deleteOne(opts);
|
|
129
|
+
}
|
|
130
|
+
async deleteManyBills(opts) {
|
|
131
|
+
return await this.bills.deleteMany(opts);
|
|
132
|
+
}
|
|
133
|
+
async searchManyBills(opts) {
|
|
134
|
+
return await this.bills.searchMany(opts);
|
|
135
|
+
}
|
|
136
|
+
async queryBillableFolders(opts) {
|
|
137
|
+
return await this.billable_folders.query(opts);
|
|
138
|
+
}
|
|
139
|
+
async insertOneBillableFolder(opts) {
|
|
140
|
+
return await this.billable_folders.insertOne(opts);
|
|
141
|
+
}
|
|
142
|
+
async findOneBillableFolder(opts) {
|
|
143
|
+
return await this.billable_folders.findOne(opts);
|
|
144
|
+
}
|
|
145
|
+
async replaceOneBillableFolder(opts) {
|
|
146
|
+
return await this.billable_folders.replaceOne(opts);
|
|
147
|
+
}
|
|
148
|
+
async deleteOneBillableFolder(opts) {
|
|
149
|
+
return await this.billable_folders.deleteOne(opts);
|
|
150
|
+
}
|
|
151
|
+
async deleteManyBillableFolders(opts) {
|
|
152
|
+
return await this.billable_folders.deleteMany(opts);
|
|
153
|
+
}
|
|
154
|
+
async searchManyBillableFolders(opts) {
|
|
155
|
+
return await this.billable_folders.searchMany(opts);
|
|
156
|
+
}
|
|
157
|
+
async queryCharges(opts) {
|
|
158
|
+
return await this.charges.query(opts);
|
|
159
|
+
}
|
|
160
|
+
async insertOneCharge(opts) {
|
|
161
|
+
return await this.charges.insertOne(opts);
|
|
162
|
+
}
|
|
163
|
+
async findOneCharge(opts) {
|
|
164
|
+
return await this.charges.findOne(opts);
|
|
165
|
+
}
|
|
166
|
+
async replaceOneCharge(opts) {
|
|
167
|
+
return await this.charges.replaceOne(opts);
|
|
168
|
+
}
|
|
169
|
+
async deleteOneCharge(opts) {
|
|
170
|
+
return await this.charges.deleteOne(opts);
|
|
171
|
+
}
|
|
172
|
+
async deleteManyCharges(opts) {
|
|
173
|
+
return await this.charges.deleteMany(opts);
|
|
174
|
+
}
|
|
175
|
+
async searchManyCharges(opts) {
|
|
176
|
+
return await this.charges.searchMany(opts);
|
|
177
|
+
}
|
|
178
|
+
async queryEquipments(opts) {
|
|
179
|
+
return await this.equipments.query(opts);
|
|
180
|
+
}
|
|
181
|
+
async insertOneEquipment(opts) {
|
|
182
|
+
return await this.equipments.insertOne(opts);
|
|
183
|
+
}
|
|
184
|
+
async findOneEquipment(opts) {
|
|
185
|
+
return await this.equipments.findOne(opts);
|
|
186
|
+
}
|
|
187
|
+
async replaceOneEquipment(opts) {
|
|
188
|
+
return await this.equipments.replaceOne(opts);
|
|
189
|
+
}
|
|
190
|
+
async deleteOneEquipment(opts) {
|
|
191
|
+
return await this.equipments.deleteOne(opts);
|
|
192
|
+
}
|
|
193
|
+
async deleteManyEquipments(opts) {
|
|
194
|
+
return await this.equipments.deleteMany(opts);
|
|
195
|
+
}
|
|
196
|
+
async searchManyEquipments(opts) {
|
|
197
|
+
return await this.equipments.searchMany(opts);
|
|
198
|
+
}
|
|
199
|
+
async queryItems(opts) {
|
|
200
|
+
return await this.items.query(opts);
|
|
201
|
+
}
|
|
202
|
+
async insertOneItem(opts) {
|
|
203
|
+
return await this.items.insertOne(opts);
|
|
204
|
+
}
|
|
205
|
+
async findOneItem(opts) {
|
|
206
|
+
return await this.items.findOne(opts);
|
|
207
|
+
}
|
|
208
|
+
async replaceOneItem(opts) {
|
|
209
|
+
return await this.items.replaceOne(opts);
|
|
210
|
+
}
|
|
211
|
+
async deleteOneItem(opts) {
|
|
212
|
+
return await this.items.deleteOne(opts);
|
|
213
|
+
}
|
|
214
|
+
async deleteManyItems(opts) {
|
|
215
|
+
return await this.items.deleteMany(opts);
|
|
216
|
+
}
|
|
217
|
+
async searchManyItems(opts) {
|
|
218
|
+
return await this.items.searchMany(opts);
|
|
219
|
+
}
|
|
220
|
+
async queryLaborRates(opts) {
|
|
221
|
+
return await this.labor_rates.query(opts);
|
|
222
|
+
}
|
|
223
|
+
async insertOneLaborRate(opts) {
|
|
224
|
+
return await this.labor_rates.insertOne(opts);
|
|
225
|
+
}
|
|
226
|
+
async findOneLaborRate(opts) {
|
|
227
|
+
return await this.labor_rates.findOne(opts);
|
|
228
|
+
}
|
|
229
|
+
async replaceOneLaborRate(opts) {
|
|
230
|
+
return await this.labor_rates.replaceOne(opts);
|
|
231
|
+
}
|
|
232
|
+
async deleteOneLaborRate(opts) {
|
|
233
|
+
return await this.labor_rates.deleteOne(opts);
|
|
234
|
+
}
|
|
235
|
+
async deleteManyLaborRates(opts) {
|
|
236
|
+
return await this.labor_rates.deleteMany(opts);
|
|
237
|
+
}
|
|
238
|
+
async searchManyLaborRates(opts) {
|
|
239
|
+
return await this.labor_rates.searchMany(opts);
|
|
240
|
+
}
|
|
241
|
+
async queryMeterReadings(opts) {
|
|
242
|
+
return await this.meter_readings.query(opts);
|
|
243
|
+
}
|
|
244
|
+
async insertOneMeterReading(opts) {
|
|
245
|
+
return await this.meter_readings.insertOne(opts);
|
|
246
|
+
}
|
|
247
|
+
async findOneMeterReading(opts) {
|
|
248
|
+
return await this.meter_readings.findOne(opts);
|
|
249
|
+
}
|
|
250
|
+
async replaceOneMeterReading(opts) {
|
|
251
|
+
return await this.meter_readings.replaceOne(opts);
|
|
252
|
+
}
|
|
253
|
+
async deleteOneMeterReading(opts) {
|
|
254
|
+
return await this.meter_readings.deleteOne(opts);
|
|
255
|
+
}
|
|
256
|
+
async deleteManyMeterReadings(opts) {
|
|
257
|
+
return await this.meter_readings.deleteMany(opts);
|
|
258
|
+
}
|
|
259
|
+
async searchManyMeterReadings(opts) {
|
|
260
|
+
return await this.meter_readings.searchMany(opts);
|
|
261
|
+
}
|
|
262
|
+
async queryQuantifiers(opts) {
|
|
263
|
+
return await this.quantifiers.query(opts);
|
|
264
|
+
}
|
|
265
|
+
async insertOneQuantifier(opts) {
|
|
266
|
+
return await this.quantifiers.insertOne(opts);
|
|
267
|
+
}
|
|
268
|
+
async findOneQuantifier(opts) {
|
|
269
|
+
return await this.quantifiers.findOne(opts);
|
|
270
|
+
}
|
|
271
|
+
async replaceOneQuantifier(opts) {
|
|
272
|
+
return await this.quantifiers.replaceOne(opts);
|
|
273
|
+
}
|
|
274
|
+
async deleteOneQuantifier(opts) {
|
|
275
|
+
return await this.quantifiers.deleteOne(opts);
|
|
276
|
+
}
|
|
277
|
+
async deleteManyQuantifiers(opts) {
|
|
278
|
+
return await this.quantifiers.deleteMany(opts);
|
|
279
|
+
}
|
|
280
|
+
async searchManyQuantifiers(opts) {
|
|
281
|
+
return await this.quantifiers.searchMany(opts);
|
|
282
|
+
}
|
|
283
|
+
async queryTaxes(opts) {
|
|
284
|
+
return await this.taxes.query(opts);
|
|
285
|
+
}
|
|
286
|
+
async insertOneTax(opts) {
|
|
287
|
+
return await this.taxes.insertOne(opts);
|
|
288
|
+
}
|
|
289
|
+
async findOneTax(opts) {
|
|
290
|
+
return await this.taxes.findOne(opts);
|
|
291
|
+
}
|
|
292
|
+
async replaceOneTax(opts) {
|
|
293
|
+
return await this.taxes.replaceOne(opts);
|
|
294
|
+
}
|
|
295
|
+
async deleteOneTax(opts) {
|
|
296
|
+
return await this.taxes.deleteOne(opts);
|
|
297
|
+
}
|
|
298
|
+
async deleteManyTaxes(opts) {
|
|
299
|
+
return await this.taxes.deleteMany(opts);
|
|
300
|
+
}
|
|
301
|
+
async searchManyTaxes(opts) {
|
|
302
|
+
return await this.taxes.searchMany(opts);
|
|
303
|
+
}
|
|
304
|
+
async queryTmpBillNumbers(opts) {
|
|
305
|
+
return await this.tmp_bill_numbers.query(opts);
|
|
306
|
+
}
|
|
307
|
+
async insertOneTmpBillNumber(opts) {
|
|
308
|
+
return await this.tmp_bill_numbers.insertOne(opts);
|
|
309
|
+
}
|
|
310
|
+
async findOneTmpBillNumber(opts) {
|
|
311
|
+
return await this.tmp_bill_numbers.findOne(opts);
|
|
312
|
+
}
|
|
313
|
+
async replaceOneTmpBillNumber(opts) {
|
|
314
|
+
return await this.tmp_bill_numbers.replaceOne(opts);
|
|
315
|
+
}
|
|
316
|
+
async deleteOneTmpBillNumber(opts) {
|
|
317
|
+
return await this.tmp_bill_numbers.deleteOne(opts);
|
|
318
|
+
}
|
|
319
|
+
async deleteManyTmpBillNumbers(opts) {
|
|
320
|
+
return await this.tmp_bill_numbers.deleteMany(opts);
|
|
321
|
+
}
|
|
322
|
+
async searchManyTmpBillNumbers(opts) {
|
|
323
|
+
return await this.tmp_bill_numbers.searchMany(opts);
|
|
324
|
+
}
|
|
325
|
+
async queryVendorInvoices(opts) {
|
|
326
|
+
return await this.vendor_invoices.query(opts);
|
|
327
|
+
}
|
|
328
|
+
async insertOneVendorInvoice(opts) {
|
|
329
|
+
return await this.vendor_invoices.insertOne(opts);
|
|
330
|
+
}
|
|
331
|
+
async findOneVendorInvoice(opts) {
|
|
332
|
+
return await this.vendor_invoices.findOne(opts);
|
|
333
|
+
}
|
|
334
|
+
async replaceOneVendorInvoice(opts) {
|
|
335
|
+
return await this.vendor_invoices.replaceOne(opts);
|
|
336
|
+
}
|
|
337
|
+
async deleteOneVendorInvoice(opts) {
|
|
338
|
+
return await this.vendor_invoices.deleteOne(opts);
|
|
339
|
+
}
|
|
340
|
+
async deleteManyVendorInvoices(opts) {
|
|
341
|
+
return await this.vendor_invoices.deleteMany(opts);
|
|
342
|
+
}
|
|
343
|
+
async searchManyVendorInvoices(opts) {
|
|
344
|
+
return await this.vendor_invoices.searchMany(opts);
|
|
345
|
+
}
|
|
346
|
+
async queryWarehouses(opts) {
|
|
347
|
+
return await this.warehouses.query(opts);
|
|
348
|
+
}
|
|
349
|
+
async insertOneWarehouse(opts) {
|
|
350
|
+
return await this.warehouses.insertOne(opts);
|
|
351
|
+
}
|
|
352
|
+
async findOneWarehouse(opts) {
|
|
353
|
+
return await this.warehouses.findOne(opts);
|
|
354
|
+
}
|
|
355
|
+
async replaceOneWarehouse(opts) {
|
|
356
|
+
return await this.warehouses.replaceOne(opts);
|
|
357
|
+
}
|
|
358
|
+
async deleteOneWarehouse(opts) {
|
|
359
|
+
return await this.warehouses.deleteOne(opts);
|
|
360
|
+
}
|
|
361
|
+
async deleteManyWarehouses(opts) {
|
|
362
|
+
return await this.warehouses.deleteMany(opts);
|
|
363
|
+
}
|
|
364
|
+
async searchManyWarehouses(opts) {
|
|
365
|
+
return await this.warehouses.searchMany(opts);
|
|
366
|
+
}
|
|
367
|
+
async generateBill(opts) {
|
|
368
|
+
const token = await requiredToken(this.get_token);
|
|
369
|
+
return await this.http.do({
|
|
370
|
+
base_url: this.base_url,
|
|
371
|
+
path: billPath(PathBillableGenerate),
|
|
372
|
+
method: HTTPMethodPost,
|
|
373
|
+
token,
|
|
374
|
+
body: opts,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
async yearSpan(opts) {
|
|
378
|
+
const token = await requiredToken(this.get_token);
|
|
379
|
+
return await this.http.do({
|
|
380
|
+
base_url: this.base_url,
|
|
381
|
+
path: billPath(PathBillableYearSpan),
|
|
382
|
+
method: HTTPMethodPost,
|
|
383
|
+
token,
|
|
384
|
+
body: opts,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
async periodsFromDates(opts) {
|
|
388
|
+
const token = await requiredToken(this.get_token);
|
|
389
|
+
return await this.http.do({
|
|
390
|
+
base_url: this.base_url,
|
|
391
|
+
path: billPath(PathBillablePeriodsFromDates),
|
|
392
|
+
method: HTTPMethodPost,
|
|
393
|
+
token,
|
|
394
|
+
body: opts,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
async vendorInvoiceFromBill(opts) {
|
|
398
|
+
const token = await requiredToken(this.get_token);
|
|
399
|
+
return await this.http.do({
|
|
400
|
+
base_url: this.base_url,
|
|
401
|
+
path: vendorInvoicePath(PathBillableFromBill),
|
|
402
|
+
method: HTTPMethodPost,
|
|
403
|
+
token,
|
|
404
|
+
body: opts,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
async setItemQuantity(opts) {
|
|
408
|
+
const token = await requiredToken(this.get_token);
|
|
409
|
+
return await this.http.do({
|
|
410
|
+
base_url: this.base_url,
|
|
411
|
+
path: itemPath(PathBillableSetQuantity),
|
|
412
|
+
method: HTTPMethodPost,
|
|
413
|
+
token,
|
|
414
|
+
body: opts,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
export function newBillableClient(opts) {
|
|
419
|
+
return new BillableClient(opts);
|
|
420
|
+
}
|
|
421
|
+
function billPath(action) {
|
|
422
|
+
return buildPath({
|
|
423
|
+
svc: SvcBillable,
|
|
424
|
+
col: ColBillableBills,
|
|
425
|
+
action,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
function vendorInvoicePath(action) {
|
|
429
|
+
return buildPath({
|
|
430
|
+
svc: SvcBillable,
|
|
431
|
+
col: ColBillableVendorInvoices,
|
|
432
|
+
action,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function itemPath(action) {
|
|
436
|
+
return buildPath({
|
|
437
|
+
svc: SvcBillable,
|
|
438
|
+
col: ColBillableItems,
|
|
439
|
+
action,
|
|
440
|
+
});
|
|
441
|
+
}
|