repzo 1.0.75 → 1.0.77

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.d.ts CHANGED
@@ -944,6 +944,18 @@ export default class Repzo {
944
944
  total_time?: number | undefined;
945
945
  company_namespace: NameSpaces;
946
946
  body?: any;
947
+ sync_details: {
948
+ timestamp: number;
949
+ body: {
950
+ [key: string]: any;
951
+ };
952
+ }[];
953
+ error_details: {
954
+ timestamp: number;
955
+ error: {
956
+ [key: string]: any;
957
+ };
958
+ }[];
947
959
  meta?: any;
948
960
  message: string;
949
961
  details: Service.CommandLog.Detail[];
package/lib/index.js CHANGED
@@ -2028,6 +2028,8 @@ Repzo.CommandLog = class {
2028
2028
  this.retries = 1;
2029
2029
  this.trigger = trigger;
2030
2030
  this.onGoing = true;
2031
+ this.sync_details = [];
2032
+ this.error_details = [];
2031
2033
  }
2032
2034
  async load(sync_id, retries) {
2033
2035
  if (sync_id) {
@@ -2072,6 +2074,7 @@ Repzo.CommandLog = class {
2072
2074
  this.addDetail(`status was changed from ${this.status} to ${status}`);
2073
2075
  this.status = status;
2074
2076
  if (error) {
2077
+ if (!this.error_details) this.error_details = [];
2075
2078
  if (typeof error == "string") {
2076
2079
  this.error = { message: error };
2077
2080
  } else if (error.message || error.response?.data) {
@@ -2082,6 +2085,10 @@ Repzo.CommandLog = class {
2082
2085
  };
2083
2086
  } else {
2084
2087
  this.error = error;
2088
+ this.error_details.push({
2089
+ timestamp: Date.now(),
2090
+ error: this.error,
2091
+ });
2085
2092
  }
2086
2093
  return this;
2087
2094
  }
@@ -2115,6 +2122,8 @@ Repzo.CommandLog = class {
2115
2122
  }
2116
2123
  setBody(body) {
2117
2124
  this.body = body;
2125
+ if (!this.sync_details) this.sync_details = [];
2126
+ this.sync_details.push({ timestamp: Date.now(), body: body });
2118
2127
  return this;
2119
2128
  }
2120
2129
  setMeta(meta) {
@@ -2148,6 +2157,8 @@ Repzo.CommandLog = class {
2148
2157
  onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
2149
2158
  retries: this.retries !== undefined ? this.retries : undefined,
2150
2159
  trigger: this.trigger,
2160
+ sync_details: this.sync_details,
2161
+ error_details: this.error_details,
2151
2162
  };
2152
2163
  try {
2153
2164
  const res = await this.superThis._create(
@@ -7558,6 +7558,18 @@ export declare namespace Service {
7558
7558
  onGoing?: boolean;
7559
7559
  retries?: number;
7560
7560
  trigger?: string;
7561
+ sync_details: {
7562
+ timestamp: number;
7563
+ body: {
7564
+ [key: string]: any;
7565
+ };
7566
+ }[];
7567
+ error_details: {
7568
+ timestamp: number;
7569
+ error: {
7570
+ [key: string]: any;
7571
+ };
7572
+ }[];
7561
7573
  }
7562
7574
  export namespace Find {
7563
7575
  type Params = DefaultPaginationQueryParams & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -2735,6 +2735,8 @@ export default class Repzo {
2735
2735
  total_time?: number;
2736
2736
  company_namespace: NameSpaces;
2737
2737
  body?: any;
2738
+ sync_details: { timestamp: number; body: { [key: string]: any } }[];
2739
+ error_details: { timestamp: number; error: { [key: string]: any } }[];
2738
2740
  meta?: any;
2739
2741
  message: string;
2740
2742
  details: Service.CommandLog.Detail[];
@@ -2772,6 +2774,8 @@ export default class Repzo {
2772
2774
  this.retries = 1;
2773
2775
  this.trigger = trigger;
2774
2776
  this.onGoing = true;
2777
+ this.sync_details = [];
2778
+ this.error_details = [];
2775
2779
  }
2776
2780
  async load(sync_id?: string, retries?: number) {
2777
2781
  if (sync_id) {
@@ -2819,6 +2823,7 @@ export default class Repzo {
2819
2823
  this.addDetail(`status was changed from ${this.status} to ${status}`);
2820
2824
  this.status = status;
2821
2825
  if (error) {
2826
+ if (!this.error_details) this.error_details = [];
2822
2827
  if (typeof error == "string") {
2823
2828
  this.error = { message: error };
2824
2829
  } else if (error.message || error.response?.data) {
@@ -2829,6 +2834,10 @@ export default class Repzo {
2829
2834
  };
2830
2835
  } else {
2831
2836
  this.error = error;
2837
+ this.error_details.push({
2838
+ timestamp: Date.now(),
2839
+ error: this.error,
2840
+ });
2832
2841
  }
2833
2842
  return this;
2834
2843
  }
@@ -2862,6 +2871,8 @@ export default class Repzo {
2862
2871
  }
2863
2872
  setBody(body: any) {
2864
2873
  this.body = body;
2874
+ if (!this.sync_details) this.sync_details = [];
2875
+ this.sync_details.push({ timestamp: Date.now(), body: body });
2865
2876
  return this;
2866
2877
  }
2867
2878
  setMeta(meta: any) {
@@ -2895,6 +2906,8 @@ export default class Repzo {
2895
2906
  onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
2896
2907
  retries: this.retries !== undefined ? this.retries : undefined,
2897
2908
  trigger: this.trigger,
2909
+ sync_details: this.sync_details,
2910
+ error_details: this.error_details,
2898
2911
  };
2899
2912
  try {
2900
2913
  const res: Service.CommandLog.Create.Result = await this.superThis._create(
@@ -7521,6 +7521,8 @@ export namespace Service {
7521
7521
  onGoing?: boolean;
7522
7522
  retries?: number;
7523
7523
  trigger?: string;
7524
+ sync_details: { timestamp: number; body: { [key: string]: any } }[];
7525
+ error_details: { timestamp: number; error: { [key: string]: any } }[];
7524
7526
  }
7525
7527
 
7526
7528
  export namespace Find {