@go-avro/avro-js 0.0.2-beta.6 → 0.0.2-beta.7

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,5 @@ 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>;
26
27
  }
@@ -219,4 +219,26 @@ 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
+ }
222
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.6",
3
+ "version": "0.0.2-beta.7",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",