@go-avro/avro-js 0.0.2-beta.33 → 0.0.2-beta.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.
@@ -60,6 +60,13 @@ export declare class AvroQueryClient {
60
60
  offset?: number;
61
61
  paid?: boolean;
62
62
  }, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
63
+ fetchRoutes(companyGuid: string, body?: {
64
+ amt?: number;
65
+ known_ids?: string[];
66
+ unknown_ids?: string[];
67
+ query?: string;
68
+ offset?: number;
69
+ }, cancelToken?: CancelToken, headers?: Record<string, string>): Promise<any>;
63
70
  sendEmail(emailId: string, formData: FormData): Promise<void>;
64
71
  createBill(companyGuid: string, data: {
65
72
  line_items: LineItem[];
@@ -266,6 +266,22 @@ export class AvroQueryClient {
266
266
  throw new StandardError(500, 'Failed to fetch bills');
267
267
  });
268
268
  }
269
+ fetchRoutes(companyGuid, body = {}, cancelToken, headers = {}) {
270
+ if (!companyGuid || companyGuid.trim() === '') {
271
+ return Promise.reject(new StandardError(400, 'Company GUID is required'));
272
+ }
273
+ return this._fetch('POST', `/company/${companyGuid}/routes`, body, cancelToken, headers)
274
+ .then(response => {
275
+ if (!response || !Array.isArray(response)) {
276
+ throw new StandardError(400, 'Invalid routes response');
277
+ }
278
+ return response;
279
+ })
280
+ .catch(err => {
281
+ console.error('Failed to fetch routes:', err);
282
+ throw new StandardError(500, 'Failed to fetch routes');
283
+ });
284
+ }
269
285
  sendEmail(emailId, formData) {
270
286
  try {
271
287
  return this._xhr('POST', `/email/${emailId}`, formData);
@@ -443,6 +443,7 @@ export interface Task {
443
443
  created_by: UserCompanyAssociation | null;
444
444
  overdueness: number | null;
445
445
  overdue_time: number;
446
+ last_completed_event: _Event | null;
446
447
  last_event: _Event | null;
447
448
  delay: number;
448
449
  skills: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.33",
3
+ "version": "0.0.2-beta.35",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",