@go-avro/avro-js 0.0.2-beta.7 → 0.0.2-beta.8
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.
|
@@ -24,4 +24,5 @@ export declare class AvroQueryClient {
|
|
|
24
24
|
logout(cancelToken?: CancelToken): Promise<void>;
|
|
25
25
|
fetchJobs(companyGuid: string, amt?: number, knownIds?: string[], unknownIds?: string[], keyword?: string, offset?: number, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
26
26
|
fetchEvents(companyGuid: string, amt?: number, known_ids?: string[], unknown_ids?: string[], keyword?: string, offset?: number, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
27
|
+
fetchBills(companyGuid: string, amt?: number, known_ids?: string[], unknown_ids?: string[], keyword?: string, offset?: number, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
|
|
27
28
|
}
|
|
@@ -241,4 +241,26 @@ export class AvroQueryClient {
|
|
|
241
241
|
throw new StandardError(500, 'Failed to fetch events');
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
+
fetchBills(companyGuid, amt = 50, known_ids = [], unknown_ids = [], keyword = '', offset = 0, cancelToken, headers = {}) {
|
|
245
|
+
const body = {
|
|
246
|
+
amt,
|
|
247
|
+
known_ids,
|
|
248
|
+
unknown_ids,
|
|
249
|
+
query: keyword,
|
|
250
|
+
};
|
|
251
|
+
if (!companyGuid) {
|
|
252
|
+
return Promise.reject(new StandardError(400, 'Company GUID is required'));
|
|
253
|
+
}
|
|
254
|
+
return this._fetch('POST', `/company/${companyGuid}/bills?amt=${amt}&offset=${offset}`, body, cancelToken, headers)
|
|
255
|
+
.then(response => {
|
|
256
|
+
if (!response || !Array.isArray(response)) {
|
|
257
|
+
throw new StandardError(400, 'Invalid bills response');
|
|
258
|
+
}
|
|
259
|
+
return response;
|
|
260
|
+
})
|
|
261
|
+
.catch(err => {
|
|
262
|
+
console.error('Failed to fetch bills:', err);
|
|
263
|
+
throw new StandardError(500, 'Failed to fetch bills');
|
|
264
|
+
});
|
|
265
|
+
}
|
|
244
266
|
}
|