@go-avro/avro-js 0.0.2-beta.23 → 0.0.2-beta.25

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.
@@ -33,5 +33,5 @@ export declare class AvroQueryClient {
33
33
  due_date: number;
34
34
  users: string[];
35
35
  custom_emails: [string, string][];
36
- }): Promise<any>;
36
+ }, cancelToken?: CancelToken): Promise<any>;
37
37
  }
@@ -76,7 +76,7 @@ export class AvroQueryClient {
76
76
  let msg = xhr.statusText;
77
77
  try {
78
78
  const parsed = JSON.parse(xhr.responseText);
79
- msg = parsed.message || msg;
79
+ msg = parsed.msg || msg;
80
80
  }
81
81
  catch {
82
82
  console.warn('Failed to parse error response:', xhr.responseText);
@@ -300,7 +300,7 @@ export class AvroQueryClient {
300
300
  throw new StandardError(500, `Failed to send email: ${error}`);
301
301
  }
302
302
  }
303
- createBill(companyGuid, data) {
303
+ createBill(companyGuid, data, cancelToken) {
304
304
  if (!companyGuid) {
305
305
  return Promise.reject(new StandardError(400, 'Company GUID is required'));
306
306
  }
@@ -313,7 +313,9 @@ export class AvroQueryClient {
313
313
  due_date: data.due_date,
314
314
  };
315
315
  try {
316
- return this._xhr('POST', `/company/${companyGuid}/bill`, JSON.stringify(body));
316
+ return this._xhr('POST', `/company/${companyGuid}/bill`, JSON.stringify(body), cancelToken, {
317
+ 'Content-Type': 'application/json',
318
+ });
317
319
  }
318
320
  catch (error) {
319
321
  throw new StandardError(500, `Failed to create bill: ${error}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.23",
3
+ "version": "0.0.2-beta.25",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",