@fabriktor/client 0.0.33 → 0.0.35
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 +1 -25
- package/dist/src/billable/billable.js +0 -36
- package/dist/src/calls/calls.d.ts +1 -3
- package/dist/src/calls/calls.js +0 -3
- package/dist/src/chat/chat.d.ts +6 -23
- package/dist/src/chat/chat.js +2 -34
- package/dist/src/core/crud.d.ts +0 -5
- package/dist/src/core/crud.js +0 -14
- package/dist/src/core/err.d.ts +6 -0
- package/dist/src/core/err.js +8 -0
- package/dist/src/feed/feed.d.ts +1 -7
- package/dist/src/feed/feed.js +0 -9
- package/dist/src/fulfillments/fulfillments.d.ts +1 -3
- package/dist/src/fulfillments/fulfillments.js +0 -3
- package/dist/src/jobs/jobs.d.ts +1 -7
- package/dist/src/jobs/jobs.js +0 -9
- package/dist/src/marketplace/marketplace.d.ts +1 -5
- package/dist/src/marketplace/marketplace.js +0 -6
- package/dist/src/memos/memos.d.ts +1 -5
- package/dist/src/memos/memos.js +0 -6
- package/dist/src/payments/payments.d.ts +1 -17
- package/dist/src/payments/payments.js +0 -24
- package/dist/src/payrolls/payrolls.d.ts +1 -21
- package/dist/src/payrolls/payrolls.js +0 -30
- package/dist/src/preferences/preferences.d.ts +1 -19
- package/dist/src/preferences/preferences.js +0 -27
- package/dist/src/privacy/privacy.d.ts +1 -5
- package/dist/src/privacy/privacy.js +0 -6
- package/dist/src/routes/routes.d.ts +1 -11
- package/dist/src/routes/routes.js +0 -15
- package/dist/src/storage/storage.d.ts +1 -23
- package/dist/src/storage/storage.js +10 -36
- package/dist/src/timesheets/timesheets.d.ts +1 -5
- package/dist/src/timesheets/timesheets.js +0 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
export type GenerateBillOptions = InBill;
|
|
6
6
|
export type YearSpanOptions = PLBillableYearSpan;
|
|
@@ -18,84 +18,72 @@ export interface BillableOperator {
|
|
|
18
18
|
findOneBill(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Bill>>;
|
|
19
19
|
replaceOneBill(opts: ReplaceOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
20
20
|
deleteOneBill(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
21
|
-
deleteManyBills(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
22
21
|
searchManyBills(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Bill>>>;
|
|
23
22
|
queryBillableFolders(opts?: QueryOptionsCRUD): Promise<OperationResultOf<BillableFolder[]>>;
|
|
24
23
|
insertOneBillableFolder(opts: InsertOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
25
24
|
findOneBillableFolder(opts: FindOneOptionsCRUD): Promise<OperationResultOf<BillableFolder>>;
|
|
26
25
|
replaceOneBillableFolder(opts: ReplaceOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
27
26
|
deleteOneBillableFolder(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
28
|
-
deleteManyBillableFolders(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
29
27
|
searchManyBillableFolders(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<BillableFolder>>>;
|
|
30
28
|
queryCharges(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Charge[]>>;
|
|
31
29
|
insertOneCharge(opts: InsertOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
32
30
|
findOneCharge(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Charge>>;
|
|
33
31
|
replaceOneCharge(opts: ReplaceOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
34
32
|
deleteOneCharge(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
35
|
-
deleteManyCharges(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
36
33
|
searchManyCharges(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Charge>>>;
|
|
37
34
|
queryEquipments(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Equipment[]>>;
|
|
38
35
|
insertOneEquipment(opts: InsertOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
39
36
|
findOneEquipment(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Equipment>>;
|
|
40
37
|
replaceOneEquipment(opts: ReplaceOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
41
38
|
deleteOneEquipment(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
42
|
-
deleteManyEquipments(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
43
39
|
searchManyEquipments(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Equipment>>>;
|
|
44
40
|
queryItems(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Item[]>>;
|
|
45
41
|
insertOneItem(opts: InsertOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
46
42
|
findOneItem(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Item>>;
|
|
47
43
|
replaceOneItem(opts: ReplaceOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
48
44
|
deleteOneItem(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
49
|
-
deleteManyItems(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
50
45
|
searchManyItems(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Item>>>;
|
|
51
46
|
queryLaborRates(opts?: QueryOptionsCRUD): Promise<OperationResultOf<LaborRate[]>>;
|
|
52
47
|
insertOneLaborRate(opts: InsertOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
53
48
|
findOneLaborRate(opts: FindOneOptionsCRUD): Promise<OperationResultOf<LaborRate>>;
|
|
54
49
|
replaceOneLaborRate(opts: ReplaceOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
55
50
|
deleteOneLaborRate(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
56
|
-
deleteManyLaborRates(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
57
51
|
searchManyLaborRates(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<LaborRate>>>;
|
|
58
52
|
queryMeterReadings(opts?: QueryOptionsCRUD): Promise<OperationResultOf<MeterReading[]>>;
|
|
59
53
|
insertOneMeterReading(opts: InsertOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
60
54
|
findOneMeterReading(opts: FindOneOptionsCRUD): Promise<OperationResultOf<MeterReading>>;
|
|
61
55
|
replaceOneMeterReading(opts: ReplaceOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
62
56
|
deleteOneMeterReading(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
63
|
-
deleteManyMeterReadings(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
64
57
|
searchManyMeterReadings(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<MeterReading>>>;
|
|
65
58
|
queryQuantifiers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Quantifier[]>>;
|
|
66
59
|
insertOneQuantifier(opts: InsertOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
67
60
|
findOneQuantifier(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Quantifier>>;
|
|
68
61
|
replaceOneQuantifier(opts: ReplaceOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
69
62
|
deleteOneQuantifier(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
70
|
-
deleteManyQuantifiers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
71
63
|
searchManyQuantifiers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Quantifier>>>;
|
|
72
64
|
queryTaxes(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Tax[]>>;
|
|
73
65
|
insertOneTax(opts: InsertOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
74
66
|
findOneTax(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Tax>>;
|
|
75
67
|
replaceOneTax(opts: ReplaceOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
76
68
|
deleteOneTax(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
77
|
-
deleteManyTaxes(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
78
69
|
searchManyTaxes(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Tax>>>;
|
|
79
70
|
queryTmpBillNumbers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<TmpBillNumber[]>>;
|
|
80
71
|
insertOneTmpBillNumber(opts: InsertOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
81
72
|
findOneTmpBillNumber(opts: FindOneOptionsCRUD): Promise<OperationResultOf<TmpBillNumber>>;
|
|
82
73
|
replaceOneTmpBillNumber(opts: ReplaceOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
83
74
|
deleteOneTmpBillNumber(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
84
|
-
deleteManyTmpBillNumbers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
85
75
|
searchManyTmpBillNumbers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<TmpBillNumber>>>;
|
|
86
76
|
queryVendorInvoices(opts?: QueryOptionsCRUD): Promise<OperationResultOf<VendorInvoice[]>>;
|
|
87
77
|
insertOneVendorInvoice(opts: InsertOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
88
78
|
findOneVendorInvoice(opts: FindOneOptionsCRUD): Promise<OperationResultOf<VendorInvoice>>;
|
|
89
79
|
replaceOneVendorInvoice(opts: ReplaceOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
90
80
|
deleteOneVendorInvoice(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
91
|
-
deleteManyVendorInvoices(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
92
81
|
searchManyVendorInvoices(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<VendorInvoice>>>;
|
|
93
82
|
queryWarehouses(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Warehouse[]>>;
|
|
94
83
|
insertOneWarehouse(opts: InsertOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
95
84
|
findOneWarehouse(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Warehouse>>;
|
|
96
85
|
replaceOneWarehouse(opts: ReplaceOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
97
86
|
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
98
|
-
deleteManyWarehouses(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
99
87
|
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
100
88
|
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
101
89
|
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
@@ -125,84 +113,72 @@ export declare class BillableClient implements BillableOperator {
|
|
|
125
113
|
findOneBill(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Bill>>;
|
|
126
114
|
replaceOneBill(opts: ReplaceOneOptionsCRUD<InBill>): Promise<OperationResult>;
|
|
127
115
|
deleteOneBill(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
128
|
-
deleteManyBills(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
129
116
|
searchManyBills(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Bill>>>;
|
|
130
117
|
queryBillableFolders(opts?: QueryOptionsCRUD): Promise<OperationResultOf<BillableFolder[]>>;
|
|
131
118
|
insertOneBillableFolder(opts: InsertOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
132
119
|
findOneBillableFolder(opts: FindOneOptionsCRUD): Promise<OperationResultOf<BillableFolder>>;
|
|
133
120
|
replaceOneBillableFolder(opts: ReplaceOneOptionsCRUD<InBillableFolder>): Promise<OperationResult>;
|
|
134
121
|
deleteOneBillableFolder(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
135
|
-
deleteManyBillableFolders(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
136
122
|
searchManyBillableFolders(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<BillableFolder>>>;
|
|
137
123
|
queryCharges(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Charge[]>>;
|
|
138
124
|
insertOneCharge(opts: InsertOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
139
125
|
findOneCharge(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Charge>>;
|
|
140
126
|
replaceOneCharge(opts: ReplaceOneOptionsCRUD<InCharge>): Promise<OperationResult>;
|
|
141
127
|
deleteOneCharge(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
142
|
-
deleteManyCharges(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
143
128
|
searchManyCharges(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Charge>>>;
|
|
144
129
|
queryEquipments(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Equipment[]>>;
|
|
145
130
|
insertOneEquipment(opts: InsertOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
146
131
|
findOneEquipment(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Equipment>>;
|
|
147
132
|
replaceOneEquipment(opts: ReplaceOneOptionsCRUD<InEquipment>): Promise<OperationResult>;
|
|
148
133
|
deleteOneEquipment(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
149
|
-
deleteManyEquipments(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
150
134
|
searchManyEquipments(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Equipment>>>;
|
|
151
135
|
queryItems(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Item[]>>;
|
|
152
136
|
insertOneItem(opts: InsertOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
153
137
|
findOneItem(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Item>>;
|
|
154
138
|
replaceOneItem(opts: ReplaceOneOptionsCRUD<InItem>): Promise<OperationResult>;
|
|
155
139
|
deleteOneItem(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
156
|
-
deleteManyItems(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
157
140
|
searchManyItems(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Item>>>;
|
|
158
141
|
queryLaborRates(opts?: QueryOptionsCRUD): Promise<OperationResultOf<LaborRate[]>>;
|
|
159
142
|
insertOneLaborRate(opts: InsertOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
160
143
|
findOneLaborRate(opts: FindOneOptionsCRUD): Promise<OperationResultOf<LaborRate>>;
|
|
161
144
|
replaceOneLaborRate(opts: ReplaceOneOptionsCRUD<InLaborRate>): Promise<OperationResult>;
|
|
162
145
|
deleteOneLaborRate(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
163
|
-
deleteManyLaborRates(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
164
146
|
searchManyLaborRates(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<LaborRate>>>;
|
|
165
147
|
queryMeterReadings(opts?: QueryOptionsCRUD): Promise<OperationResultOf<MeterReading[]>>;
|
|
166
148
|
insertOneMeterReading(opts: InsertOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
167
149
|
findOneMeterReading(opts: FindOneOptionsCRUD): Promise<OperationResultOf<MeterReading>>;
|
|
168
150
|
replaceOneMeterReading(opts: ReplaceOneOptionsCRUD<InMeterReading>): Promise<OperationResult>;
|
|
169
151
|
deleteOneMeterReading(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
170
|
-
deleteManyMeterReadings(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
171
152
|
searchManyMeterReadings(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<MeterReading>>>;
|
|
172
153
|
queryQuantifiers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Quantifier[]>>;
|
|
173
154
|
insertOneQuantifier(opts: InsertOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
174
155
|
findOneQuantifier(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Quantifier>>;
|
|
175
156
|
replaceOneQuantifier(opts: ReplaceOneOptionsCRUD<InQuantifier>): Promise<OperationResult>;
|
|
176
157
|
deleteOneQuantifier(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
177
|
-
deleteManyQuantifiers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
178
158
|
searchManyQuantifiers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Quantifier>>>;
|
|
179
159
|
queryTaxes(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Tax[]>>;
|
|
180
160
|
insertOneTax(opts: InsertOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
181
161
|
findOneTax(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Tax>>;
|
|
182
162
|
replaceOneTax(opts: ReplaceOneOptionsCRUD<InTax>): Promise<OperationResult>;
|
|
183
163
|
deleteOneTax(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
184
|
-
deleteManyTaxes(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
185
164
|
searchManyTaxes(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Tax>>>;
|
|
186
165
|
queryTmpBillNumbers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<TmpBillNumber[]>>;
|
|
187
166
|
insertOneTmpBillNumber(opts: InsertOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
188
167
|
findOneTmpBillNumber(opts: FindOneOptionsCRUD): Promise<OperationResultOf<TmpBillNumber>>;
|
|
189
168
|
replaceOneTmpBillNumber(opts: ReplaceOneOptionsCRUD<InTmpBillNumber>): Promise<OperationResult>;
|
|
190
169
|
deleteOneTmpBillNumber(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
191
|
-
deleteManyTmpBillNumbers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
192
170
|
searchManyTmpBillNumbers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<TmpBillNumber>>>;
|
|
193
171
|
queryVendorInvoices(opts?: QueryOptionsCRUD): Promise<OperationResultOf<VendorInvoice[]>>;
|
|
194
172
|
insertOneVendorInvoice(opts: InsertOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
195
173
|
findOneVendorInvoice(opts: FindOneOptionsCRUD): Promise<OperationResultOf<VendorInvoice>>;
|
|
196
174
|
replaceOneVendorInvoice(opts: ReplaceOneOptionsCRUD<InVendorInvoice>): Promise<OperationResult>;
|
|
197
175
|
deleteOneVendorInvoice(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
198
|
-
deleteManyVendorInvoices(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
199
176
|
searchManyVendorInvoices(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<VendorInvoice>>>;
|
|
200
177
|
queryWarehouses(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Warehouse[]>>;
|
|
201
178
|
insertOneWarehouse(opts: InsertOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
202
179
|
findOneWarehouse(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Warehouse>>;
|
|
203
180
|
replaceOneWarehouse(opts: ReplaceOneOptionsCRUD<InWarehouse>): Promise<OperationResult>;
|
|
204
181
|
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
205
|
-
deleteManyWarehouses(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
206
182
|
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
207
183
|
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
208
184
|
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
@@ -127,9 +127,6 @@ export class BillableClient {
|
|
|
127
127
|
async deleteOneBill(opts) {
|
|
128
128
|
return await this.bills.deleteOne(opts);
|
|
129
129
|
}
|
|
130
|
-
async deleteManyBills(opts) {
|
|
131
|
-
return await this.bills.deleteMany(opts);
|
|
132
|
-
}
|
|
133
130
|
async searchManyBills(opts) {
|
|
134
131
|
return await this.bills.searchMany(opts);
|
|
135
132
|
}
|
|
@@ -148,9 +145,6 @@ export class BillableClient {
|
|
|
148
145
|
async deleteOneBillableFolder(opts) {
|
|
149
146
|
return await this.billable_folders.deleteOne(opts);
|
|
150
147
|
}
|
|
151
|
-
async deleteManyBillableFolders(opts) {
|
|
152
|
-
return await this.billable_folders.deleteMany(opts);
|
|
153
|
-
}
|
|
154
148
|
async searchManyBillableFolders(opts) {
|
|
155
149
|
return await this.billable_folders.searchMany(opts);
|
|
156
150
|
}
|
|
@@ -169,9 +163,6 @@ export class BillableClient {
|
|
|
169
163
|
async deleteOneCharge(opts) {
|
|
170
164
|
return await this.charges.deleteOne(opts);
|
|
171
165
|
}
|
|
172
|
-
async deleteManyCharges(opts) {
|
|
173
|
-
return await this.charges.deleteMany(opts);
|
|
174
|
-
}
|
|
175
166
|
async searchManyCharges(opts) {
|
|
176
167
|
return await this.charges.searchMany(opts);
|
|
177
168
|
}
|
|
@@ -190,9 +181,6 @@ export class BillableClient {
|
|
|
190
181
|
async deleteOneEquipment(opts) {
|
|
191
182
|
return await this.equipments.deleteOne(opts);
|
|
192
183
|
}
|
|
193
|
-
async deleteManyEquipments(opts) {
|
|
194
|
-
return await this.equipments.deleteMany(opts);
|
|
195
|
-
}
|
|
196
184
|
async searchManyEquipments(opts) {
|
|
197
185
|
return await this.equipments.searchMany(opts);
|
|
198
186
|
}
|
|
@@ -211,9 +199,6 @@ export class BillableClient {
|
|
|
211
199
|
async deleteOneItem(opts) {
|
|
212
200
|
return await this.items.deleteOne(opts);
|
|
213
201
|
}
|
|
214
|
-
async deleteManyItems(opts) {
|
|
215
|
-
return await this.items.deleteMany(opts);
|
|
216
|
-
}
|
|
217
202
|
async searchManyItems(opts) {
|
|
218
203
|
return await this.items.searchMany(opts);
|
|
219
204
|
}
|
|
@@ -232,9 +217,6 @@ export class BillableClient {
|
|
|
232
217
|
async deleteOneLaborRate(opts) {
|
|
233
218
|
return await this.labor_rates.deleteOne(opts);
|
|
234
219
|
}
|
|
235
|
-
async deleteManyLaborRates(opts) {
|
|
236
|
-
return await this.labor_rates.deleteMany(opts);
|
|
237
|
-
}
|
|
238
220
|
async searchManyLaborRates(opts) {
|
|
239
221
|
return await this.labor_rates.searchMany(opts);
|
|
240
222
|
}
|
|
@@ -253,9 +235,6 @@ export class BillableClient {
|
|
|
253
235
|
async deleteOneMeterReading(opts) {
|
|
254
236
|
return await this.meter_readings.deleteOne(opts);
|
|
255
237
|
}
|
|
256
|
-
async deleteManyMeterReadings(opts) {
|
|
257
|
-
return await this.meter_readings.deleteMany(opts);
|
|
258
|
-
}
|
|
259
238
|
async searchManyMeterReadings(opts) {
|
|
260
239
|
return await this.meter_readings.searchMany(opts);
|
|
261
240
|
}
|
|
@@ -274,9 +253,6 @@ export class BillableClient {
|
|
|
274
253
|
async deleteOneQuantifier(opts) {
|
|
275
254
|
return await this.quantifiers.deleteOne(opts);
|
|
276
255
|
}
|
|
277
|
-
async deleteManyQuantifiers(opts) {
|
|
278
|
-
return await this.quantifiers.deleteMany(opts);
|
|
279
|
-
}
|
|
280
256
|
async searchManyQuantifiers(opts) {
|
|
281
257
|
return await this.quantifiers.searchMany(opts);
|
|
282
258
|
}
|
|
@@ -295,9 +271,6 @@ export class BillableClient {
|
|
|
295
271
|
async deleteOneTax(opts) {
|
|
296
272
|
return await this.taxes.deleteOne(opts);
|
|
297
273
|
}
|
|
298
|
-
async deleteManyTaxes(opts) {
|
|
299
|
-
return await this.taxes.deleteMany(opts);
|
|
300
|
-
}
|
|
301
274
|
async searchManyTaxes(opts) {
|
|
302
275
|
return await this.taxes.searchMany(opts);
|
|
303
276
|
}
|
|
@@ -316,9 +289,6 @@ export class BillableClient {
|
|
|
316
289
|
async deleteOneTmpBillNumber(opts) {
|
|
317
290
|
return await this.tmp_bill_numbers.deleteOne(opts);
|
|
318
291
|
}
|
|
319
|
-
async deleteManyTmpBillNumbers(opts) {
|
|
320
|
-
return await this.tmp_bill_numbers.deleteMany(opts);
|
|
321
|
-
}
|
|
322
292
|
async searchManyTmpBillNumbers(opts) {
|
|
323
293
|
return await this.tmp_bill_numbers.searchMany(opts);
|
|
324
294
|
}
|
|
@@ -337,9 +307,6 @@ export class BillableClient {
|
|
|
337
307
|
async deleteOneVendorInvoice(opts) {
|
|
338
308
|
return await this.vendor_invoices.deleteOne(opts);
|
|
339
309
|
}
|
|
340
|
-
async deleteManyVendorInvoices(opts) {
|
|
341
|
-
return await this.vendor_invoices.deleteMany(opts);
|
|
342
|
-
}
|
|
343
310
|
async searchManyVendorInvoices(opts) {
|
|
344
311
|
return await this.vendor_invoices.searchMany(opts);
|
|
345
312
|
}
|
|
@@ -358,9 +325,6 @@ export class BillableClient {
|
|
|
358
325
|
async deleteOneWarehouse(opts) {
|
|
359
326
|
return await this.warehouses.deleteOne(opts);
|
|
360
327
|
}
|
|
361
|
-
async deleteManyWarehouses(opts) {
|
|
362
|
-
return await this.warehouses.deleteMany(opts);
|
|
363
|
-
}
|
|
364
328
|
async searchManyWarehouses(opts) {
|
|
365
329
|
return await this.warehouses.searchMany(opts);
|
|
366
330
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Event, type InEvent, type OperationResult, type PLCallsMintVideoToken } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
export type MintVideoTokenOptions = PLCallsMintVideoToken;
|
|
6
6
|
export type CallsClientOptions = {
|
|
@@ -14,7 +14,6 @@ export interface CallsOperator {
|
|
|
14
14
|
findOneEvent(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Event>>;
|
|
15
15
|
replaceOneEvent(opts: ReplaceOneOptionsCRUD<InEvent>): Promise<OperationResult>;
|
|
16
16
|
deleteOneEvent(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
17
|
-
deleteManyEvents(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
18
17
|
mintVideoToken(opts: MintVideoTokenOptions): Promise<OperationResultOf<string>>;
|
|
19
18
|
}
|
|
20
19
|
export declare class CallsClient implements CallsOperator {
|
|
@@ -28,7 +27,6 @@ export declare class CallsClient implements CallsOperator {
|
|
|
28
27
|
findOneEvent(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Event>>;
|
|
29
28
|
replaceOneEvent(opts: ReplaceOneOptionsCRUD<InEvent>): Promise<OperationResult>;
|
|
30
29
|
deleteOneEvent(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
31
|
-
deleteManyEvents(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
32
30
|
mintVideoToken(opts: MintVideoTokenOptions): Promise<OperationResultOf<string>>;
|
|
33
31
|
}
|
|
34
32
|
export declare function newCallsClient(opts: CallsClientOptions): CallsClient;
|
package/dist/src/calls/calls.js
CHANGED
|
@@ -39,9 +39,6 @@ export class CallsClient {
|
|
|
39
39
|
async deleteOneEvent(opts) {
|
|
40
40
|
return await this.events.deleteOne(opts);
|
|
41
41
|
}
|
|
42
|
-
async deleteManyEvents(opts) {
|
|
43
|
-
return await this.events.deleteMany(opts);
|
|
44
|
-
}
|
|
45
42
|
async mintVideoToken(opts) {
|
|
46
43
|
const token = await requiredToken(this.get_token);
|
|
47
44
|
return await this.http.do({
|
package/dist/src/chat/chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Chat, type ChatRoom, type ChatRoomMember, type ID, type InChat, type
|
|
1
|
+
import { type Chat, type ChatRoom, type ChatRoomMember, type ID, type InChat, type InChatRoomMember, type OperationResult, type PLChatEnsure, type PLChatReact } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
import { type WSCloseHandler, type WSConnection, type WSErrorHandler, type WSMessageHandler } from "../core/ws.js";
|
|
6
6
|
export type ReactChatOptions = PLChatReact;
|
|
@@ -12,13 +12,13 @@ export type WSChatsOptions = {
|
|
|
12
12
|
on_error?: WSErrorHandler;
|
|
13
13
|
on_close?: WSCloseHandler;
|
|
14
14
|
};
|
|
15
|
-
export type
|
|
15
|
+
export type WSChatRoomOptions = {
|
|
16
16
|
id: string;
|
|
17
17
|
on_message: WSMessageHandler<ChatRoom>;
|
|
18
18
|
on_error?: WSErrorHandler;
|
|
19
19
|
on_close?: WSCloseHandler;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type WSMineChatRoomsOptions = {
|
|
22
22
|
owner_id: string;
|
|
23
23
|
on_message: WSMessageHandler<ChatRoom>;
|
|
24
24
|
on_error?: WSErrorHandler;
|
|
@@ -31,61 +31,44 @@ export type ChatClientOptions = {
|
|
|
31
31
|
};
|
|
32
32
|
export interface ChatOperator {
|
|
33
33
|
queryChats(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Chat[]>>;
|
|
34
|
-
queryChatRooms(opts?: QueryOptionsCRUD): Promise<OperationResultOf<ChatRoom[]>>;
|
|
35
34
|
queryChatRoomMembers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<ChatRoomMember[]>>;
|
|
36
35
|
insertOneChat(opts: InsertOneOptionsCRUD<InChat>): Promise<OperationResult>;
|
|
37
36
|
findOneChat(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Chat>>;
|
|
38
|
-
findOneChatRoom(opts: FindOneOptionsCRUD): Promise<OperationResultOf<ChatRoom>>;
|
|
39
37
|
findOneChatRoomMember(opts: FindOneOptionsCRUD): Promise<OperationResultOf<ChatRoomMember>>;
|
|
40
38
|
replaceOneChat(opts: ReplaceOneOptionsCRUD<InChat>): Promise<OperationResult>;
|
|
41
|
-
replaceOneChatRoom(opts: ReplaceOneOptionsCRUD<InChatRoom>): Promise<OperationResult>;
|
|
42
39
|
replaceOneChatRoomMember(opts: ReplaceOneOptionsCRUD<InChatRoomMember>): Promise<OperationResult>;
|
|
43
40
|
deleteOneChat(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
44
|
-
deleteOneChatRoom(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
45
41
|
deleteOneChatRoomMember(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
46
|
-
deleteManyChats(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
47
|
-
deleteManyChatRooms(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
48
|
-
deleteManyChatRoomMembers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
49
42
|
searchManyChats(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Chat>>>;
|
|
50
|
-
searchManyChatRooms(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<ChatRoom>>>;
|
|
51
43
|
searchManyChatRoomMembers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<ChatRoomMember>>>;
|
|
52
44
|
reactChat(opts: ReactChatOptions): Promise<void>;
|
|
53
45
|
ensureChatRoom(opts: EnsureChatRoomOptions): Promise<ID>;
|
|
54
46
|
wsChats(opts: WSChatsOptions): Promise<WSConnection>;
|
|
55
|
-
wsChatRooms(opts: WSChatRoomsOptions): Promise<WSConnection>;
|
|
56
47
|
wsChatRoom(opts: WSChatRoomOptions): Promise<WSConnection>;
|
|
48
|
+
wsMineChatRooms(opts: WSMineChatRoomsOptions): Promise<WSConnection>;
|
|
57
49
|
}
|
|
58
50
|
export declare class ChatClient implements ChatOperator {
|
|
59
51
|
private chats;
|
|
60
|
-
private chat_rooms;
|
|
61
52
|
private chat_room_members;
|
|
62
53
|
private http;
|
|
63
54
|
private base_url;
|
|
64
55
|
private get_token?;
|
|
65
56
|
constructor(opts: ChatClientOptions);
|
|
66
57
|
queryChats(opts?: QueryOptionsCRUD): Promise<OperationResultOf<Chat[]>>;
|
|
67
|
-
queryChatRooms(opts?: QueryOptionsCRUD): Promise<OperationResultOf<ChatRoom[]>>;
|
|
68
58
|
queryChatRoomMembers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<ChatRoomMember[]>>;
|
|
69
59
|
insertOneChat(opts: InsertOneOptionsCRUD<InChat>): Promise<OperationResult>;
|
|
70
60
|
findOneChat(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Chat>>;
|
|
71
|
-
findOneChatRoom(opts: FindOneOptionsCRUD): Promise<OperationResultOf<ChatRoom>>;
|
|
72
61
|
findOneChatRoomMember(opts: FindOneOptionsCRUD): Promise<OperationResultOf<ChatRoomMember>>;
|
|
73
62
|
replaceOneChat(opts: ReplaceOneOptionsCRUD<InChat>): Promise<OperationResult>;
|
|
74
|
-
replaceOneChatRoom(opts: ReplaceOneOptionsCRUD<InChatRoom>): Promise<OperationResult>;
|
|
75
63
|
replaceOneChatRoomMember(opts: ReplaceOneOptionsCRUD<InChatRoomMember>): Promise<OperationResult>;
|
|
76
64
|
deleteOneChat(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
77
|
-
deleteOneChatRoom(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
78
65
|
deleteOneChatRoomMember(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
79
|
-
deleteManyChats(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
80
|
-
deleteManyChatRooms(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
81
|
-
deleteManyChatRoomMembers(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
82
66
|
searchManyChats(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Chat>>>;
|
|
83
|
-
searchManyChatRooms(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<ChatRoom>>>;
|
|
84
67
|
searchManyChatRoomMembers(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<ChatRoomMember>>>;
|
|
85
68
|
reactChat(opts: ReactChatOptions): Promise<void>;
|
|
86
69
|
ensureChatRoom(opts: EnsureChatRoomOptions): Promise<ID>;
|
|
87
70
|
wsChats(opts: WSChatsOptions): Promise<WSConnection>;
|
|
88
|
-
wsChatRooms(opts: WSChatRoomsOptions): Promise<WSConnection>;
|
|
89
71
|
wsChatRoom(opts: WSChatRoomOptions): Promise<WSConnection>;
|
|
72
|
+
wsMineChatRooms(opts: WSMineChatRoomsOptions): Promise<WSConnection>;
|
|
90
73
|
}
|
|
91
74
|
export declare function newChatClient(opts: ChatClientOptions): ChatClient;
|
package/dist/src/chat/chat.js
CHANGED
|
@@ -11,7 +11,6 @@ import { buildPath } from "../core/path.js";
|
|
|
11
11
|
import { openWS, } from "../core/ws.js";
|
|
12
12
|
export class ChatClient {
|
|
13
13
|
chats;
|
|
14
|
-
chat_rooms;
|
|
15
14
|
chat_room_members;
|
|
16
15
|
http;
|
|
17
16
|
base_url;
|
|
@@ -24,13 +23,6 @@ export class ChatClient {
|
|
|
24
23
|
col: ColChatChats,
|
|
25
24
|
get_token: opts.get_token,
|
|
26
25
|
});
|
|
27
|
-
this.chat_rooms = newCRUDClient({
|
|
28
|
-
http: opts.http,
|
|
29
|
-
base_url: opts.base_url,
|
|
30
|
-
svc: SvcChat,
|
|
31
|
-
col: ColChatChatRooms,
|
|
32
|
-
get_token: opts.get_token,
|
|
33
|
-
});
|
|
34
26
|
this.chat_room_members = newCRUDClient({
|
|
35
27
|
http: opts.http,
|
|
36
28
|
base_url: opts.base_url,
|
|
@@ -45,9 +37,6 @@ export class ChatClient {
|
|
|
45
37
|
async queryChats(opts) {
|
|
46
38
|
return await this.chats.query(opts);
|
|
47
39
|
}
|
|
48
|
-
async queryChatRooms(opts) {
|
|
49
|
-
return await this.chat_rooms.query(opts);
|
|
50
|
-
}
|
|
51
40
|
async queryChatRoomMembers(opts) {
|
|
52
41
|
return await this.chat_room_members.query(opts);
|
|
53
42
|
}
|
|
@@ -57,45 +46,24 @@ export class ChatClient {
|
|
|
57
46
|
async findOneChat(opts) {
|
|
58
47
|
return await this.chats.findOne(opts);
|
|
59
48
|
}
|
|
60
|
-
async findOneChatRoom(opts) {
|
|
61
|
-
return await this.chat_rooms.findOne(opts);
|
|
62
|
-
}
|
|
63
49
|
async findOneChatRoomMember(opts) {
|
|
64
50
|
return await this.chat_room_members.findOne(opts);
|
|
65
51
|
}
|
|
66
52
|
async replaceOneChat(opts) {
|
|
67
53
|
return await this.chats.replaceOne(opts);
|
|
68
54
|
}
|
|
69
|
-
async replaceOneChatRoom(opts) {
|
|
70
|
-
return await this.chat_rooms.replaceOne(opts);
|
|
71
|
-
}
|
|
72
55
|
async replaceOneChatRoomMember(opts) {
|
|
73
56
|
return await this.chat_room_members.replaceOne(opts);
|
|
74
57
|
}
|
|
75
58
|
async deleteOneChat(opts) {
|
|
76
59
|
return await this.chats.deleteOne(opts);
|
|
77
60
|
}
|
|
78
|
-
async deleteOneChatRoom(opts) {
|
|
79
|
-
return await this.chat_rooms.deleteOne(opts);
|
|
80
|
-
}
|
|
81
61
|
async deleteOneChatRoomMember(opts) {
|
|
82
62
|
return await this.chat_room_members.deleteOne(opts);
|
|
83
63
|
}
|
|
84
|
-
async deleteManyChats(opts) {
|
|
85
|
-
return await this.chats.deleteMany(opts);
|
|
86
|
-
}
|
|
87
|
-
async deleteManyChatRooms(opts) {
|
|
88
|
-
return await this.chat_rooms.deleteMany(opts);
|
|
89
|
-
}
|
|
90
|
-
async deleteManyChatRoomMembers(opts) {
|
|
91
|
-
return await this.chat_room_members.deleteMany(opts);
|
|
92
|
-
}
|
|
93
64
|
async searchManyChats(opts) {
|
|
94
65
|
return await this.chats.searchMany(opts);
|
|
95
66
|
}
|
|
96
|
-
async searchManyChatRooms(opts) {
|
|
97
|
-
return await this.chat_rooms.searchMany(opts);
|
|
98
|
-
}
|
|
99
67
|
async searchManyChatRoomMembers(opts) {
|
|
100
68
|
return await this.chat_room_members.searchMany(opts);
|
|
101
69
|
}
|
|
@@ -135,7 +103,7 @@ export class ChatClient {
|
|
|
135
103
|
on_close: opts.on_close,
|
|
136
104
|
});
|
|
137
105
|
}
|
|
138
|
-
async
|
|
106
|
+
async wsChatRoom(opts) {
|
|
139
107
|
const token = await requiredToken(this.get_token);
|
|
140
108
|
return openWS({
|
|
141
109
|
base_url: this.base_url,
|
|
@@ -148,7 +116,7 @@ export class ChatClient {
|
|
|
148
116
|
on_close: opts.on_close,
|
|
149
117
|
});
|
|
150
118
|
}
|
|
151
|
-
async
|
|
119
|
+
async wsMineChatRooms(opts) {
|
|
152
120
|
const token = await requiredToken(this.get_token);
|
|
153
121
|
return openWS({
|
|
154
122
|
base_url: this.base_url,
|
package/dist/src/core/crud.d.ts
CHANGED
|
@@ -35,9 +35,6 @@ export type ReplaceOneOptionsCRUD<In> = {
|
|
|
35
35
|
export type DeleteOneOptionsCRUD = {
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
38
|
-
export type DeleteManyOptionsCRUD = {
|
|
39
|
-
query?: QueryOptions;
|
|
40
|
-
};
|
|
41
38
|
export type SearchManyOptionsCRUD = {
|
|
42
39
|
query?: QueryOptions;
|
|
43
40
|
};
|
|
@@ -48,7 +45,6 @@ export interface CRUDOperator<In, Out> {
|
|
|
48
45
|
findOne(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Out>>;
|
|
49
46
|
replaceOne(opts: ReplaceOneOptionsCRUD<In>): Promise<OperationResult>;
|
|
50
47
|
deleteOne(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
51
|
-
deleteMany(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
52
48
|
searchMany(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Out>>>;
|
|
53
49
|
}
|
|
54
50
|
export declare class CRUDClient<In, Out> implements CRUDOperator<In, Out> {
|
|
@@ -64,7 +60,6 @@ export declare class CRUDClient<In, Out> implements CRUDOperator<In, Out> {
|
|
|
64
60
|
findOne(opts: FindOneOptionsCRUD): Promise<OperationResultOf<Out>>;
|
|
65
61
|
replaceOne(opts: ReplaceOneOptionsCRUD<In>): Promise<OperationResult>;
|
|
66
62
|
deleteOne(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
67
|
-
deleteMany(opts?: DeleteManyOptionsCRUD): Promise<OperationResultOf<number>>;
|
|
68
63
|
searchMany(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Out>>>;
|
|
69
64
|
}
|
|
70
65
|
export declare function newCRUDClient<In, Out>(opts: CRUDClientOptions): CRUDClient<In, Out>;
|
package/dist/src/core/crud.js
CHANGED
|
@@ -102,20 +102,6 @@ export class CRUDClient {
|
|
|
102
102
|
token,
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
async deleteMany(opts) {
|
|
106
|
-
const token = await requiredToken(this.get_token);
|
|
107
|
-
return await this.http.do({
|
|
108
|
-
base_url: this.base_url,
|
|
109
|
-
path: withQuery(collectionPath({
|
|
110
|
-
svc: this.svc,
|
|
111
|
-
col: this.col,
|
|
112
|
-
}), {
|
|
113
|
-
query: opts?.query,
|
|
114
|
-
}),
|
|
115
|
-
method: HTTPMethodDelete,
|
|
116
|
-
token,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
105
|
async searchMany(opts) {
|
|
120
106
|
const token = await requiredToken(this.get_token);
|
|
121
107
|
return await this.http.do({
|
package/dist/src/core/err.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { HTTPErr, WrenchErr } from "@fabriktor/schema";
|
|
|
2
2
|
export declare const ClientErrKind: {
|
|
3
3
|
readonly AuthTokenProviderMissing: "auth_token_provider_missing";
|
|
4
4
|
readonly AuthTokenEmpty: "auth_token_empty";
|
|
5
|
+
readonly InvalidArgument: "invalid_argument";
|
|
5
6
|
readonly HTTPError: "http_error";
|
|
6
7
|
readonly HTTPRequestFailed: "http_request_failed";
|
|
7
8
|
readonly HTTPResponseInvalid: "http_response_invalid";
|
|
@@ -15,6 +16,10 @@ export type ClientErrOptions = {
|
|
|
15
16
|
app_err?: WrenchErr;
|
|
16
17
|
cause?: unknown;
|
|
17
18
|
};
|
|
19
|
+
export type InvalidArgumentClientErrOptions = {
|
|
20
|
+
msg: string;
|
|
21
|
+
cause?: unknown;
|
|
22
|
+
};
|
|
18
23
|
export declare class ClientErr extends Error {
|
|
19
24
|
readonly kind: ClientErrKind;
|
|
20
25
|
readonly status?: number;
|
|
@@ -23,6 +28,7 @@ export declare class ClientErr extends Error {
|
|
|
23
28
|
constructor(opts: ClientErrOptions);
|
|
24
29
|
}
|
|
25
30
|
export declare function errClient(opts: ClientErrOptions): ClientErr;
|
|
31
|
+
export declare function errInvalidArgument(opts: InvalidArgumentClientErrOptions): ClientErr;
|
|
26
32
|
export declare function errFromHTTP(err: HTTPErr): ClientErr;
|
|
27
33
|
export declare function errAuthTokenProviderMissing(): ClientErr;
|
|
28
34
|
export declare function errAuthTokenEmpty(): ClientErr;
|
package/dist/src/core/err.js
CHANGED
|
@@ -7,6 +7,7 @@ const msgUnknownClientErr = "Unknown client error.";
|
|
|
7
7
|
export const ClientErrKind = {
|
|
8
8
|
AuthTokenProviderMissing: "auth_token_provider_missing",
|
|
9
9
|
AuthTokenEmpty: "auth_token_empty",
|
|
10
|
+
InvalidArgument: "invalid_argument",
|
|
10
11
|
HTTPError: "http_error",
|
|
11
12
|
HTTPRequestFailed: "http_request_failed",
|
|
12
13
|
HTTPResponseInvalid: "http_response_invalid",
|
|
@@ -29,6 +30,13 @@ export class ClientErr extends Error {
|
|
|
29
30
|
export function errClient(opts) {
|
|
30
31
|
return new ClientErr(opts);
|
|
31
32
|
}
|
|
33
|
+
export function errInvalidArgument(opts) {
|
|
34
|
+
return errClient({
|
|
35
|
+
kind: ClientErrKind.InvalidArgument,
|
|
36
|
+
msg: opts.msg,
|
|
37
|
+
cause: opts.cause,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
32
40
|
export function errFromHTTP(err) {
|
|
33
41
|
return errClient({
|
|
34
42
|
kind: ClientErrKind.HTTPError,
|