@go-avro/avro-js 0.0.2-beta.6 → 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.
|
@@ -23,4 +23,6 @@ export declare class AvroQueryClient {
|
|
|
23
23
|
}, cancelToken?: CancelToken): Promise<Boolean>;
|
|
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
|
+
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>;
|
|
26
28
|
}
|
|
@@ -219,4 +219,48 @@ export class AvroQueryClient {
|
|
|
219
219
|
throw new StandardError(500, 'Failed to fetch jobs');
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
+
fetchEvents(companyGuid, amt = 50, known_ids = [], unknown_ids = [], keyword = '', offset = 0, cancelToken, headers = {}) {
|
|
223
|
+
const body = {
|
|
224
|
+
amt,
|
|
225
|
+
known_ids,
|
|
226
|
+
unknown_ids,
|
|
227
|
+
query: keyword,
|
|
228
|
+
};
|
|
229
|
+
if (!companyGuid) {
|
|
230
|
+
return Promise.reject(new StandardError(400, 'Company GUID is required'));
|
|
231
|
+
}
|
|
232
|
+
return this._fetch('POST', `/company/${companyGuid}/events?amt=${amt}&offset=${offset}`, body, cancelToken, headers)
|
|
233
|
+
.then(response => {
|
|
234
|
+
if (!response || !Array.isArray(response)) {
|
|
235
|
+
throw new StandardError(400, 'Invalid events response');
|
|
236
|
+
}
|
|
237
|
+
return response;
|
|
238
|
+
})
|
|
239
|
+
.catch(err => {
|
|
240
|
+
console.error('Failed to fetch events:', err);
|
|
241
|
+
throw new StandardError(500, 'Failed to fetch events');
|
|
242
|
+
});
|
|
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
|
+
}
|
|
222
266
|
}
|