repzo 1.0.12 → 1.0.15

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.
package/lib/index.js CHANGED
@@ -1112,7 +1112,16 @@ Repzo.ActionLogs = class {
1112
1112
  });
1113
1113
  this.status = status;
1114
1114
  if (error) {
1115
- this.error = error;
1115
+ if (typeof error == "string") {
1116
+ this.error = { message: error };
1117
+ } else {
1118
+ this.error = {
1119
+ json: error.toJSON ? error.toJSON : undefined,
1120
+ message: error.message,
1121
+ responseData: error.response?.data,
1122
+ };
1123
+ }
1124
+ return this;
1116
1125
  }
1117
1126
  return this;
1118
1127
  }
@@ -1227,7 +1236,16 @@ Repzo.CommandLog = class {
1227
1236
  this.addDetail(`status was changed from ${this.status} to ${status}`);
1228
1237
  this.status = status;
1229
1238
  if (error) {
1230
- this.error = error;
1239
+ if (typeof error == "string") {
1240
+ this.error = { message: error };
1241
+ } else {
1242
+ this.error = {
1243
+ json: error.toJSON ? error.toJSON : undefined,
1244
+ message: error.message,
1245
+ responseData: error.response?.data,
1246
+ };
1247
+ }
1248
+ return this;
1231
1249
  }
1232
1250
  switch (status) {
1233
1251
  case "fail":
@@ -3528,7 +3528,7 @@ export declare namespace Service {
3528
3528
  export {};
3529
3529
  }
3530
3530
  namespace Transfer {
3531
- interface VariantTransfer {
3531
+ export interface VariantTransfer {
3532
3532
  variant_id: string;
3533
3533
  variant_name?: string;
3534
3534
  product_id?: string;
@@ -3539,7 +3539,7 @@ export declare namespace Service {
3539
3539
  measure_unit_qty?: number;
3540
3540
  measure_unit_factor?: number;
3541
3541
  }
3542
- interface Schema {
3542
+ export interface Schema {
3543
3543
  _id: string;
3544
3544
  serial_number: SerialNumber;
3545
3545
  time: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.12",
3
+ "version": "1.0.15",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1556,7 +1556,16 @@ export default class Repzo {
1556
1556
  });
1557
1557
  this.status = status;
1558
1558
  if (error) {
1559
- this.error = error;
1559
+ if (typeof error == "string") {
1560
+ this.error = { message: error };
1561
+ } else {
1562
+ this.error = {
1563
+ json: error.toJSON ? error.toJSON : undefined,
1564
+ message: error.message,
1565
+ responseData: error.response?.data,
1566
+ };
1567
+ }
1568
+ return this;
1560
1569
  }
1561
1570
  return this;
1562
1571
  }
@@ -1706,7 +1715,16 @@ export default class Repzo {
1706
1715
  this.addDetail(`status was changed from ${this.status} to ${status}`);
1707
1716
  this.status = status;
1708
1717
  if (error) {
1709
- this.error = error;
1718
+ if (typeof error == "string") {
1719
+ this.error = { message: error };
1720
+ } else {
1721
+ this.error = {
1722
+ json: error.toJSON ? error.toJSON : undefined,
1723
+ message: error.message,
1724
+ responseData: error.response?.data,
1725
+ };
1726
+ }
1727
+ return this;
1710
1728
  }
1711
1729
  switch (status) {
1712
1730
  case "fail":
@@ -3492,7 +3492,7 @@ export namespace Service {
3492
3492
  }
3493
3493
 
3494
3494
  export namespace Transfer {
3495
- interface VariantTransfer {
3495
+ export interface VariantTransfer {
3496
3496
  variant_id: string;
3497
3497
  variant_name?: string;
3498
3498
  product_id?: string;
@@ -3503,7 +3503,7 @@ export namespace Service {
3503
3503
  measure_unit_qty?: number;
3504
3504
  measure_unit_factor?: number;
3505
3505
  }
3506
- interface Schema {
3506
+ export interface Schema {
3507
3507
  _id: string;
3508
3508
  serial_number: SerialNumber;
3509
3509
  time: number;