repzo 1.0.74 → 1.0.76
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 +12 -0
- package/lib/index.js +8 -0
- package/lib/types/index.d.ts +24 -3
- package/package.json +1 -1
- package/src/index.ts +10 -0
- package/src/types/index.ts +14 -3
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) {
|
|
@@ -2080,6 +2083,7 @@ Repzo.CommandLog = class {
|
|
|
2080
2083
|
message: error.message,
|
|
2081
2084
|
responseData: error.response?.data,
|
|
2082
2085
|
};
|
|
2086
|
+
this.error_details.push({ timestamp: Date.now(), error: this.error });
|
|
2083
2087
|
} else {
|
|
2084
2088
|
this.error = error;
|
|
2085
2089
|
}
|
|
@@ -2115,6 +2119,8 @@ Repzo.CommandLog = class {
|
|
|
2115
2119
|
}
|
|
2116
2120
|
setBody(body) {
|
|
2117
2121
|
this.body = body;
|
|
2122
|
+
if (!this.sync_details) this.sync_details = [];
|
|
2123
|
+
this.sync_details.push({ timestamp: Date.now(), body: body });
|
|
2118
2124
|
return this;
|
|
2119
2125
|
}
|
|
2120
2126
|
setMeta(meta) {
|
|
@@ -2148,6 +2154,8 @@ Repzo.CommandLog = class {
|
|
|
2148
2154
|
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
2149
2155
|
retries: this.retries !== undefined ? this.retries : undefined,
|
|
2150
2156
|
trigger: this.trigger,
|
|
2157
|
+
sync_details: this.sync_details,
|
|
2158
|
+
error_details: this.error_details,
|
|
2151
2159
|
};
|
|
2152
2160
|
try {
|
|
2153
2161
|
const res = await this.superThis._create(
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6832,6 +6832,11 @@ export declare namespace Service {
|
|
|
6832
6832
|
teams?: string[];
|
|
6833
6833
|
custom_status?: string;
|
|
6834
6834
|
sync_id: string;
|
|
6835
|
+
transaction_processed: boolean;
|
|
6836
|
+
business_day?: string;
|
|
6837
|
+
comment?: string;
|
|
6838
|
+
document_type?: "transfer";
|
|
6839
|
+
process_time?: number;
|
|
6835
6840
|
integration_meta?: {
|
|
6836
6841
|
[key: string]: any;
|
|
6837
6842
|
};
|
|
@@ -6911,8 +6916,9 @@ export declare namespace Service {
|
|
|
6911
6916
|
};
|
|
6912
6917
|
type FindResult = Schema & {
|
|
6913
6918
|
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
6914
|
-
from: Warehouse.WarehouseSchema;
|
|
6915
|
-
to: Warehouse.WarehouseSchema;
|
|
6919
|
+
from: string | Warehouse.WarehouseSchema;
|
|
6920
|
+
to: string | Warehouse.WarehouseSchema;
|
|
6921
|
+
teams: string[] | Team.TeamSchema[];
|
|
6916
6922
|
variants: {
|
|
6917
6923
|
_id: string;
|
|
6918
6924
|
variant_id: string;
|
|
@@ -6949,7 +6955,7 @@ export declare namespace Service {
|
|
|
6949
6955
|
};
|
|
6950
6956
|
};
|
|
6951
6957
|
type TransferType = "load" | "unload";
|
|
6952
|
-
type PopulatedKeys = "custom_status";
|
|
6958
|
+
type PopulatedKeys = "custom_status" | "teams";
|
|
6953
6959
|
type TransferStatus =
|
|
6954
6960
|
| "pending"
|
|
6955
6961
|
| "approved"
|
|
@@ -6967,6 +6973,7 @@ export declare namespace Service {
|
|
|
6967
6973
|
from?: string[] | string;
|
|
6968
6974
|
from_createdAt?: number;
|
|
6969
6975
|
to_createdAt?: number;
|
|
6976
|
+
from_updatedAt?: number;
|
|
6970
6977
|
status?: TransferStatus | TransferStatus[];
|
|
6971
6978
|
custom_status?: string[] | string;
|
|
6972
6979
|
creator?: string[] | string;
|
|
@@ -7163,6 +7170,7 @@ export declare namespace Service {
|
|
|
7163
7170
|
teams?: string[];
|
|
7164
7171
|
sync_id: string;
|
|
7165
7172
|
reason?: string;
|
|
7173
|
+
transaction_processed: boolean;
|
|
7166
7174
|
company_namespace: string[];
|
|
7167
7175
|
createdAt: string;
|
|
7168
7176
|
updatedAt: string;
|
|
@@ -7174,6 +7182,7 @@ export declare namespace Service {
|
|
|
7174
7182
|
creator?: AdminCreator | RepCreator;
|
|
7175
7183
|
to: string;
|
|
7176
7184
|
variants: VariantOfAdjustInventory[];
|
|
7185
|
+
transaction_processed: boolean;
|
|
7177
7186
|
teams?: string[];
|
|
7178
7187
|
sync_id: string;
|
|
7179
7188
|
company_namespace?: string[];
|
|
@@ -7549,6 +7558,18 @@ export declare namespace Service {
|
|
|
7549
7558
|
onGoing?: boolean;
|
|
7550
7559
|
retries?: number;
|
|
7551
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
|
+
}[];
|
|
7552
7573
|
}
|
|
7553
7574
|
export namespace Find {
|
|
7554
7575
|
type Params = DefaultPaginationQueryParams & {
|
package/package.json
CHANGED
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) {
|
|
@@ -2827,6 +2832,7 @@ export default class Repzo {
|
|
|
2827
2832
|
message: error.message,
|
|
2828
2833
|
responseData: error.response?.data,
|
|
2829
2834
|
};
|
|
2835
|
+
this.error_details.push({ timestamp: Date.now(), error: this.error });
|
|
2830
2836
|
} else {
|
|
2831
2837
|
this.error = error;
|
|
2832
2838
|
}
|
|
@@ -2862,6 +2868,8 @@ export default class Repzo {
|
|
|
2862
2868
|
}
|
|
2863
2869
|
setBody(body: any) {
|
|
2864
2870
|
this.body = body;
|
|
2871
|
+
if (!this.sync_details) this.sync_details = [];
|
|
2872
|
+
this.sync_details.push({ timestamp: Date.now(), body: body });
|
|
2865
2873
|
return this;
|
|
2866
2874
|
}
|
|
2867
2875
|
setMeta(meta: any) {
|
|
@@ -2895,6 +2903,8 @@ export default class Repzo {
|
|
|
2895
2903
|
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
2896
2904
|
retries: this.retries !== undefined ? this.retries : undefined,
|
|
2897
2905
|
trigger: this.trigger,
|
|
2906
|
+
sync_details: this.sync_details,
|
|
2907
|
+
error_details: this.error_details,
|
|
2898
2908
|
};
|
|
2899
2909
|
try {
|
|
2900
2910
|
const res: Service.CommandLog.Create.Result = await this.superThis._create(
|
package/src/types/index.ts
CHANGED
|
@@ -6834,6 +6834,11 @@ export namespace Service {
|
|
|
6834
6834
|
teams?: string[];
|
|
6835
6835
|
custom_status?: string;
|
|
6836
6836
|
sync_id: string;
|
|
6837
|
+
transaction_processed: boolean;
|
|
6838
|
+
business_day?: string;
|
|
6839
|
+
comment?: string;
|
|
6840
|
+
document_type?: "transfer";
|
|
6841
|
+
process_time?: number;
|
|
6837
6842
|
integration_meta?: { [key: string]: any };
|
|
6838
6843
|
company_namespace: string[];
|
|
6839
6844
|
createdAt: string;
|
|
@@ -6906,8 +6911,9 @@ export namespace Service {
|
|
|
6906
6911
|
|
|
6907
6912
|
type FindResult = Schema & {
|
|
6908
6913
|
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
6909
|
-
from: Warehouse.WarehouseSchema;
|
|
6910
|
-
to: Warehouse.WarehouseSchema;
|
|
6914
|
+
from: string | Warehouse.WarehouseSchema;
|
|
6915
|
+
to: string | Warehouse.WarehouseSchema;
|
|
6916
|
+
teams: string[] | Team.TeamSchema[];
|
|
6911
6917
|
variants: {
|
|
6912
6918
|
_id: string;
|
|
6913
6919
|
variant_id: string;
|
|
@@ -6944,7 +6950,7 @@ export namespace Service {
|
|
|
6944
6950
|
};
|
|
6945
6951
|
};
|
|
6946
6952
|
type TransferType = "load" | "unload";
|
|
6947
|
-
type PopulatedKeys = "custom_status";
|
|
6953
|
+
type PopulatedKeys = "custom_status" | "teams";
|
|
6948
6954
|
type TransferStatus =
|
|
6949
6955
|
| "pending"
|
|
6950
6956
|
| "approved"
|
|
@@ -6962,6 +6968,7 @@ export namespace Service {
|
|
|
6962
6968
|
from?: string[] | string;
|
|
6963
6969
|
from_createdAt?: number;
|
|
6964
6970
|
to_createdAt?: number;
|
|
6971
|
+
from_updatedAt?: number;
|
|
6965
6972
|
status?: TransferStatus | TransferStatus[];
|
|
6966
6973
|
custom_status?: string[] | string;
|
|
6967
6974
|
creator?: string[] | string;
|
|
@@ -7163,6 +7170,7 @@ export namespace Service {
|
|
|
7163
7170
|
teams?: string[];
|
|
7164
7171
|
sync_id: string;
|
|
7165
7172
|
reason?: string;
|
|
7173
|
+
transaction_processed: boolean;
|
|
7166
7174
|
company_namespace: string[];
|
|
7167
7175
|
createdAt: string;
|
|
7168
7176
|
updatedAt: string;
|
|
@@ -7174,6 +7182,7 @@ export namespace Service {
|
|
|
7174
7182
|
creator?: AdminCreator | RepCreator;
|
|
7175
7183
|
to: string;
|
|
7176
7184
|
variants: VariantOfAdjustInventory[];
|
|
7185
|
+
transaction_processed: boolean;
|
|
7177
7186
|
teams?: string[];
|
|
7178
7187
|
sync_id: string;
|
|
7179
7188
|
company_namespace?: string[];
|
|
@@ -7512,6 +7521,8 @@ export namespace Service {
|
|
|
7512
7521
|
onGoing?: boolean;
|
|
7513
7522
|
retries?: number;
|
|
7514
7523
|
trigger?: string;
|
|
7524
|
+
sync_details: { timestamp: number; body: { [key: string]: any } }[];
|
|
7525
|
+
error_details: { timestamp: number; error: { [key: string]: any } }[];
|
|
7515
7526
|
}
|
|
7516
7527
|
|
|
7517
7528
|
export namespace Find {
|