repzo 1.0.21 → 1.0.23
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/changelog.md +2 -0
- package/lib/index.d.ts +50 -45
- package/lib/index.js +11 -0
- package/lib/types/index.d.ts +89 -3
- package/package.json +1 -1
- package/src/index.ts +27 -0
- package/src/types/index.ts +128 -1
package/changelog.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Data, Service, Options, Headers, StringId, NameSpaces } from "./types/index";
|
|
1
|
+
import { Params, Data, Service, Options, Headers, StringId, NameSpaces } from "./types/index";
|
|
2
2
|
export default class Repzo {
|
|
3
3
|
private svAPIEndpoint;
|
|
4
4
|
headers: Headers;
|
|
@@ -9,31 +9,31 @@ export default class Repzo {
|
|
|
9
9
|
private _delete;
|
|
10
10
|
client: {
|
|
11
11
|
_path: string;
|
|
12
|
-
find: (params?: Service.Client.Find.Params
|
|
13
|
-
get: (id: Service.Client.Get.ID, params?: Service.Client.Get.Params
|
|
12
|
+
find: (params?: Service.Client.Find.Params) => Promise<Service.Client.Find.Result>;
|
|
13
|
+
get: (id: Service.Client.Get.ID, params?: Service.Client.Get.Params) => Promise<Service.Client.Get.Result>;
|
|
14
14
|
create: (body: Service.Client.Create.Body) => Promise<Service.Client.Create.Result>;
|
|
15
15
|
update: (id: Service.Client.Update.ID, body: Service.Client.Update.Body) => Promise<Service.Client.Update.Result>;
|
|
16
16
|
remove: (id: Service.Client.Remove.ID) => Promise<Service.Client.Remove.Result>;
|
|
17
17
|
};
|
|
18
18
|
product: {
|
|
19
19
|
_path: string;
|
|
20
|
-
find: (params?: Service.Product.Find.Params
|
|
21
|
-
get: (id: Service.Product.Get.ID, params?: Service.Product.Get.Params
|
|
20
|
+
find: (params?: Service.Product.Find.Params) => Promise<Service.Product.Find.Result>;
|
|
21
|
+
get: (id: Service.Product.Get.ID, params?: Service.Product.Get.Params) => Promise<Service.Product.Get.Result>;
|
|
22
22
|
create: (body: Service.Product.Create.Body) => Promise<Service.Product.Create.Result>;
|
|
23
23
|
update: (id: Service.Product.Update.ID, body: Service.Product.Update.Body) => Promise<Service.Product.Update.Result>;
|
|
24
24
|
remove: (id: Service.Product.Remove.ID) => Promise<Service.Product.Remove.Result>;
|
|
25
25
|
};
|
|
26
26
|
variant: {
|
|
27
27
|
_path: string;
|
|
28
|
-
find: (params?: Service.Variant.Find.Params
|
|
29
|
-
get: (id: Service.Variant.Get.ID, params?: Service.Variant.Get.Params
|
|
28
|
+
find: (params?: Service.Variant.Find.Params) => Promise<Service.Variant.Find.Result>;
|
|
29
|
+
get: (id: Service.Variant.Get.ID, params?: Service.Variant.Get.Params) => Promise<Service.Variant.Get.Result>;
|
|
30
30
|
create: (body: Service.Variant.Create.Body) => Promise<Service.Variant.Create.Result>;
|
|
31
31
|
update: (id: Service.Variant.Update.ID, body: Service.Variant.Update.Body) => Promise<Service.Variant.Update.Result>;
|
|
32
32
|
remove: (id: Service.Variant.Remove.ID) => Promise<Service.Variant.Remove.Result>;
|
|
33
33
|
};
|
|
34
34
|
category: {
|
|
35
35
|
_path: string;
|
|
36
|
-
find: (params?: Service.Category.Find.Params
|
|
36
|
+
find: (params?: Service.Category.Find.Params) => Promise<Service.Category.Find.Result>;
|
|
37
37
|
get: (id: Service.Category.Get.ID) => Promise<Service.Category.Get.Result>;
|
|
38
38
|
create: (body: Service.Category.Create.Body) => Promise<Service.Category.Create.Result>;
|
|
39
39
|
update: (id: Service.Category.Update.ID, body: Service.Category.Update.Body) => Promise<Service.Category.Update.Result>;
|
|
@@ -41,15 +41,15 @@ export default class Repzo {
|
|
|
41
41
|
};
|
|
42
42
|
sub_category: {
|
|
43
43
|
_path: string;
|
|
44
|
-
find: (params?: Service.SubCategory.Find.Params
|
|
45
|
-
get: (id: Service.SubCategory.Get.ID, params?: Service.SubCategory.Get.Params
|
|
44
|
+
find: (params?: Service.SubCategory.Find.Params) => Promise<Service.SubCategory.Find.Result>;
|
|
45
|
+
get: (id: Service.SubCategory.Get.ID, params?: Service.SubCategory.Get.Params) => Promise<Service.SubCategory.Get.Result>;
|
|
46
46
|
create: (body: Service.SubCategory.Create.Body) => Promise<Service.SubCategory.Create.Result>;
|
|
47
47
|
update: (id: Service.SubCategory.Update.ID, body: Service.SubCategory.Update.Body) => Promise<Service.SubCategory.Update.Result>;
|
|
48
48
|
remove: (id: Service.SubCategory.Remove.ID) => Promise<Service.SubCategory.Remove.Result>;
|
|
49
49
|
};
|
|
50
50
|
brand: {
|
|
51
51
|
_path: string;
|
|
52
|
-
find: (params?: Service.Brand.Find.Params
|
|
52
|
+
find: (params?: Service.Brand.Find.Params) => Promise<Service.Brand.Find.Result>;
|
|
53
53
|
get: (id: Service.Brand.Get.ID) => Promise<Service.Brand.Get.Result>;
|
|
54
54
|
create: (body: Service.Brand.Create.Body) => Promise<Service.Brand.Create.Result>;
|
|
55
55
|
update: (id: Service.Brand.Update.ID, body: Service.Brand.Update.Body) => Promise<Service.Brand.Update.Result>;
|
|
@@ -57,7 +57,7 @@ export default class Repzo {
|
|
|
57
57
|
};
|
|
58
58
|
product_group: {
|
|
59
59
|
_path: string;
|
|
60
|
-
find: (params?: Service.ProductGroup.Find.Params
|
|
60
|
+
find: (params?: Service.ProductGroup.Find.Params) => Promise<Service.ProductGroup.Find.Result>;
|
|
61
61
|
get: (id: Service.ProductGroup.Get.ID) => Promise<Service.ProductGroup.Get.Result>;
|
|
62
62
|
create: (body: Service.ProductGroup.Create.Body) => Promise<Service.ProductGroup.Create.Result>;
|
|
63
63
|
update: (id: Service.ProductGroup.Update.ID, body: Service.ProductGroup.Update.Body) => Promise<Service.ProductGroup.Update.Result>;
|
|
@@ -65,7 +65,7 @@ export default class Repzo {
|
|
|
65
65
|
};
|
|
66
66
|
tax: {
|
|
67
67
|
_path: string;
|
|
68
|
-
find: (params?: Service.Tax.Find.Params
|
|
68
|
+
find: (params?: Service.Tax.Find.Params) => Promise<Service.Tax.Find.Result>;
|
|
69
69
|
get: (id: Service.Tax.Get.ID) => Promise<Service.Tax.Get.Result>;
|
|
70
70
|
create: (body: Service.Tax.Create.Body) => Promise<Service.Tax.Create.Result>;
|
|
71
71
|
update: (id: Service.Tax.Update.ID, body: Service.Tax.Update.Body) => Promise<Service.Tax.Update.Result>;
|
|
@@ -73,7 +73,7 @@ export default class Repzo {
|
|
|
73
73
|
};
|
|
74
74
|
measureunit: {
|
|
75
75
|
_path: string;
|
|
76
|
-
find: (params?: Service.MeasureUnit.Find.Params
|
|
76
|
+
find: (params?: Service.MeasureUnit.Find.Params) => Promise<Service.MeasureUnit.Find.Result>;
|
|
77
77
|
get: (id: Service.MeasureUnit.Get.ID) => Promise<Service.MeasureUnit.Get.Result>;
|
|
78
78
|
create: (body: Service.MeasureUnit.Create.Body) => Promise<Service.MeasureUnit.Create.Result>;
|
|
79
79
|
update: (id: Service.MeasureUnit.Update.ID, body: Service.MeasureUnit.Update.Body) => Promise<Service.MeasureUnit.Update.Result>;
|
|
@@ -81,7 +81,7 @@ export default class Repzo {
|
|
|
81
81
|
};
|
|
82
82
|
measureunitFamily: {
|
|
83
83
|
_path: string;
|
|
84
|
-
find: (params?: Service.MeasureUnitFamily.Find.Params
|
|
84
|
+
find: (params?: Service.MeasureUnitFamily.Find.Params) => Promise<Service.MeasureUnitFamily.Find.Result>;
|
|
85
85
|
get: (id: Service.MeasureUnitFamily.Get.ID) => Promise<Service.MeasureUnitFamily.Get.Result>;
|
|
86
86
|
create: (body: Service.MeasureUnitFamily.Create.Body) => Promise<Service.MeasureUnitFamily.Create.Result>;
|
|
87
87
|
update: (id: Service.MeasureUnitFamily.Update.ID, body: Service.MeasureUnitFamily.Update.Body) => Promise<Service.MeasureUnitFamily.Update.Result>;
|
|
@@ -89,7 +89,7 @@ export default class Repzo {
|
|
|
89
89
|
};
|
|
90
90
|
media: {
|
|
91
91
|
_path: string;
|
|
92
|
-
find: (params?: Service.Media.Find.Params
|
|
92
|
+
find: (params?: Service.Media.Find.Params) => Promise<Service.Media.Find.Result>;
|
|
93
93
|
get: (id: Service.Media.Get.ID) => Promise<Service.Media.Get.Result>;
|
|
94
94
|
create: (body: Service.Media.Create.Body) => Promise<Service.Media.Create.Result>;
|
|
95
95
|
update: (id: Service.Media.Update.ID, body: Service.Media.Update.Body) => Promise<Service.Media.Update.Result>;
|
|
@@ -97,7 +97,7 @@ export default class Repzo {
|
|
|
97
97
|
};
|
|
98
98
|
priceList: {
|
|
99
99
|
_path: string;
|
|
100
|
-
find: (params?: Service.PriceList.Find.Params
|
|
100
|
+
find: (params?: Service.PriceList.Find.Params) => Promise<Service.PriceList.Find.Result>;
|
|
101
101
|
get: (id: Service.PriceList.Get.ID) => Promise<Service.PriceList.Get.Result>;
|
|
102
102
|
create: (body: Service.PriceList.Create.Body) => Promise<Service.PriceList.Create.Result>;
|
|
103
103
|
update: (id: Service.PriceList.Update.ID, body: Service.PriceList.Update.Body) => Promise<Service.PriceList.Update.Result>;
|
|
@@ -105,7 +105,7 @@ export default class Repzo {
|
|
|
105
105
|
};
|
|
106
106
|
priceListItem: {
|
|
107
107
|
_path: string;
|
|
108
|
-
find: (params?: Service.PriceListItem.Find.Params
|
|
108
|
+
find: (params?: Service.PriceListItem.Find.Params) => Promise<Service.PriceListItem.Find.Result>;
|
|
109
109
|
get: (id: Service.PriceListItem.Get.ID) => Promise<Service.PriceListItem.Get.Result>;
|
|
110
110
|
create: (body: Service.PriceListItem.Create.Body) => Promise<Service.PriceListItem.Create.Result>;
|
|
111
111
|
update: (id: Service.PriceListItem.Update.ID, body: Service.PriceListItem.Update.Body) => Promise<Service.PriceListItem.Update.Result>;
|
|
@@ -113,7 +113,7 @@ export default class Repzo {
|
|
|
113
113
|
};
|
|
114
114
|
team: {
|
|
115
115
|
_path: string;
|
|
116
|
-
find: (params?: Service.Team.Find.Params
|
|
116
|
+
find: (params?: Service.Team.Find.Params) => Promise<Service.Team.Find.Result>;
|
|
117
117
|
get: (id: Service.Team.Get.ID) => Promise<Service.Team.Get.Result>;
|
|
118
118
|
create: (body: Service.Team.Create.Body) => Promise<Service.Team.Create.Result>;
|
|
119
119
|
update: (id: Service.Team.Update.ID, body: Service.Team.Update.Body) => Promise<Service.Team.Update.Result>;
|
|
@@ -121,15 +121,15 @@ export default class Repzo {
|
|
|
121
121
|
};
|
|
122
122
|
rep: {
|
|
123
123
|
_path: string;
|
|
124
|
-
find: (params?: Service.Rep.Find.Params
|
|
125
|
-
get: (id: Service.Rep.Get.ID, params?: Service.Client.Get.Params
|
|
124
|
+
find: (params?: Service.Rep.Find.Params) => Promise<Service.Rep.Find.Result>;
|
|
125
|
+
get: (id: Service.Rep.Get.ID, params?: Service.Client.Get.Params) => Promise<Service.Rep.Get.Result>;
|
|
126
126
|
create: (body: Service.Rep.Create.Body) => Promise<Service.Rep.Create.Result>;
|
|
127
127
|
update: (id: Service.Rep.Update.ID, body: Service.Rep.Update.Body) => Promise<Service.Rep.Update.Result>;
|
|
128
128
|
remove: (id: Service.Rep.Remove.ID) => Promise<Service.Rep.Remove.Result>;
|
|
129
129
|
};
|
|
130
130
|
tag: {
|
|
131
131
|
_path: string;
|
|
132
|
-
find: (params?: Service.Tag.Find.Params
|
|
132
|
+
find: (params?: Service.Tag.Find.Params) => Promise<Service.Tag.Find.Result>;
|
|
133
133
|
get: (id: Service.Tag.Get.ID) => Promise<Service.Tag.Get.Result>;
|
|
134
134
|
create: (body: Service.Tag.Create.Body) => Promise<Service.Tag.Create.Result>;
|
|
135
135
|
update: (id: Service.Tag.Update.ID, body: Service.Tag.Update.Body) => Promise<Service.Tag.Update.Result>;
|
|
@@ -137,7 +137,7 @@ export default class Repzo {
|
|
|
137
137
|
};
|
|
138
138
|
warehouse: {
|
|
139
139
|
_path: string;
|
|
140
|
-
find: (params?: Service.Warehouse.Find.Params
|
|
140
|
+
find: (params?: Service.Warehouse.Find.Params) => Promise<Service.Warehouse.Find.Result>;
|
|
141
141
|
get: (id: Service.Warehouse.Get.ID) => Promise<Service.Warehouse.Get.Result>;
|
|
142
142
|
create: (body: Service.Warehouse.Create.Body) => Promise<Service.Warehouse.Create.Result>;
|
|
143
143
|
update: (id: Service.Warehouse.Update.ID, body: Service.Warehouse.Update.Body) => Promise<Service.Warehouse.Update.Result>;
|
|
@@ -145,7 +145,7 @@ export default class Repzo {
|
|
|
145
145
|
};
|
|
146
146
|
channel: {
|
|
147
147
|
_path: string;
|
|
148
|
-
find: (params?: Service.Channel.Find.Params
|
|
148
|
+
find: (params?: Service.Channel.Find.Params) => Promise<Service.Channel.Find.Result>;
|
|
149
149
|
get: (id: Service.Channel.Get.ID) => Promise<Service.Channel.Get.Result>;
|
|
150
150
|
create: (body: Service.Channel.Create.Body) => Promise<Service.Channel.Create.Result>;
|
|
151
151
|
update: (id: Service.Channel.Update.ID, body: Service.Channel.Update.Body) => Promise<Service.Channel.Update.Result>;
|
|
@@ -153,7 +153,7 @@ export default class Repzo {
|
|
|
153
153
|
};
|
|
154
154
|
paymentTerm: {
|
|
155
155
|
_path: string;
|
|
156
|
-
find: (params?: Service.PaymentTerm.Find.Params
|
|
156
|
+
find: (params?: Service.PaymentTerm.Find.Params) => Promise<Service.PaymentTerm.Find.Result>;
|
|
157
157
|
get: (id: Service.PaymentTerm.Get.ID) => Promise<Service.PaymentTerm.Get.Result>;
|
|
158
158
|
create: (body: Service.PaymentTerm.Create.Body) => Promise<Service.PaymentTerm.Create.Result>;
|
|
159
159
|
update: (id: Service.PaymentTerm.Update.ID, body: Service.PaymentTerm.Update.Body) => Promise<Service.PaymentTerm.Update.Result>;
|
|
@@ -161,21 +161,21 @@ export default class Repzo {
|
|
|
161
161
|
};
|
|
162
162
|
bank: {
|
|
163
163
|
_path: string;
|
|
164
|
-
find: (params?: Service.Bank.Find.Params
|
|
164
|
+
find: (params?: Service.Bank.Find.Params) => Promise<Service.Bank.Find.Result>;
|
|
165
165
|
get: (id: Service.Bank.Get.ID) => Promise<Service.Bank.Get.Result>;
|
|
166
166
|
create: (body: Service.Bank.Create.Body) => Promise<Service.Bank.Create.Result>;
|
|
167
167
|
update: (id: Service.Bank.Update.ID, body: Service.Bank.Update.Body) => Promise<Service.Bank.Update.Result>;
|
|
168
168
|
};
|
|
169
169
|
bank_list: {
|
|
170
170
|
_path: string;
|
|
171
|
-
find: (params?: Service.BankList.Find.Params
|
|
171
|
+
find: (params?: Service.BankList.Find.Params) => Promise<Service.BankList.Find.Result>;
|
|
172
172
|
get: (id: Service.BankList.Get.ID) => Promise<Service.BankList.Get.Result>;
|
|
173
173
|
create: (body: Service.BankList.Create.Body) => Promise<Service.BankList.Create.Result>;
|
|
174
174
|
update: (id: Service.BankList.Update.ID, body: Service.BankList.Update.Body) => Promise<Service.BankList.Update.Result>;
|
|
175
175
|
};
|
|
176
176
|
customStatus: {
|
|
177
177
|
_path: string;
|
|
178
|
-
find: (params?: Service.CustomStatus.Find.Params
|
|
178
|
+
find: (params?: Service.CustomStatus.Find.Params) => Promise<Service.CustomStatus.Find.Result>;
|
|
179
179
|
get: (id: Service.CustomStatus.Get.ID) => Promise<Service.CustomStatus.Get.Result>;
|
|
180
180
|
create: (body: Service.CustomStatus.Create.Body) => Promise<Service.CustomStatus.Create.Result>;
|
|
181
181
|
update: (id: Service.CustomStatus.Update.ID, body: Service.CustomStatus.Update.Body) => Promise<Service.CustomStatus.Update.Result>;
|
|
@@ -183,53 +183,53 @@ export default class Repzo {
|
|
|
183
183
|
};
|
|
184
184
|
invoice: {
|
|
185
185
|
_path: string;
|
|
186
|
-
find: (params?: Service.FullInvoice.Find.Params
|
|
187
|
-
get: (id: Service.FullInvoice.Get.ID, params?: Service.FullInvoice.Get.Params
|
|
186
|
+
find: (params?: Service.FullInvoice.Find.Params) => Promise<Service.FullInvoice.Find.Result>;
|
|
187
|
+
get: (id: Service.FullInvoice.Get.ID, params?: Service.FullInvoice.Get.Params) => Promise<Service.FullInvoice.Get.Result>;
|
|
188
188
|
create: (body: Service.FullInvoice.Create.Body) => Promise<Service.FullInvoice.Create.Result>;
|
|
189
189
|
update: (id: Service.FullInvoice.Update.ID, body: Service.FullInvoice.Update.Body) => Promise<Service.FullInvoice.Update.Result>;
|
|
190
190
|
};
|
|
191
191
|
proforma: {
|
|
192
192
|
_path: string;
|
|
193
|
-
find: (params?: Service.Proforma.Find.Params
|
|
194
|
-
get: (id: Service.Proforma.Get.ID, params?: Service.Proforma.Get.Params
|
|
193
|
+
find: (params?: Service.Proforma.Find.Params) => Promise<Service.Proforma.Find.Result>;
|
|
194
|
+
get: (id: Service.Proforma.Get.ID, params?: Service.Proforma.Get.Params) => Promise<Service.Proforma.Get.Result>;
|
|
195
195
|
create: (body: Service.Proforma.Create.Body) => Promise<Service.Proforma.Create.Result>;
|
|
196
196
|
update: (id: Service.Proforma.Update.ID, body: Service.Proforma.Update.Body) => Promise<Service.Proforma.Update.Result>;
|
|
197
197
|
};
|
|
198
198
|
payment: {
|
|
199
199
|
_path: string;
|
|
200
|
-
find: (params?: Service.Payment.Find.Params
|
|
201
|
-
get: (id: Service.Payment.Get.ID, params?: Service.Payment.Get.Params
|
|
200
|
+
find: (params?: Service.Payment.Find.Params) => Promise<Service.Payment.Find.Result>;
|
|
201
|
+
get: (id: Service.Payment.Get.ID, params?: Service.Payment.Get.Params) => Promise<Service.Payment.Get.Result>;
|
|
202
202
|
create: (body: Service.Payment.Create.Body) => Promise<Service.Payment.Create.Result>;
|
|
203
203
|
update: (id: Service.Payment.Update.ID, body: Service.Payment.Update.Body) => Promise<Service.Payment.Update.Result>;
|
|
204
204
|
};
|
|
205
205
|
refund: {
|
|
206
206
|
_path: string;
|
|
207
|
-
find: (params?: Service.Refund.Find.Params
|
|
208
|
-
get: (id: Service.Refund.Get.ID, params?: Service.Refund.Get.Params
|
|
207
|
+
find: (params?: Service.Refund.Find.Params) => Promise<Service.Refund.Find.Result>;
|
|
208
|
+
get: (id: Service.Refund.Get.ID, params?: Service.Refund.Get.Params) => Promise<Service.Refund.Get.Result>;
|
|
209
209
|
create: (body: Service.Refund.Create.Body) => Promise<Service.Refund.Create.Result>;
|
|
210
210
|
update: (id: Service.Refund.Update.ID, body: Service.Refund.Update.Body) => Promise<Service.Refund.Update.Result>;
|
|
211
211
|
};
|
|
212
212
|
transfer: {
|
|
213
213
|
_path: string;
|
|
214
|
-
find: (params?: Service.Transfer.Find.Params
|
|
215
|
-
get: (id: Service.Transfer.Get.ID, params?: Service.Transfer.Get.Params
|
|
214
|
+
find: (params?: Service.Transfer.Find.Params) => Promise<Service.Transfer.Find.Result>;
|
|
215
|
+
get: (id: Service.Transfer.Get.ID, params?: Service.Transfer.Get.Params) => Promise<Service.Transfer.Get.Result>;
|
|
216
216
|
create: (body: Service.Transfer.Create.Body) => Promise<Service.Transfer.Create.Result>;
|
|
217
217
|
update: (id: Service.Transfer.Update.ID, body: Service.Transfer.Update.Body) => Promise<Service.Transfer.Update.Result>;
|
|
218
218
|
};
|
|
219
219
|
adjustInventory: {
|
|
220
220
|
_path: string;
|
|
221
|
-
find: (params?: Service.AdjustInventory.Find.Params
|
|
222
|
-
get: (id: Service.AdjustInventory.Get.ID, params?: Service.AdjustInventory.Get.Params
|
|
221
|
+
find: (params?: Service.AdjustInventory.Find.Params) => Promise<Service.AdjustInventory.Find.Result>;
|
|
222
|
+
get: (id: Service.AdjustInventory.Get.ID, params?: Service.AdjustInventory.Get.Params) => Promise<Service.AdjustInventory.Get.Result>;
|
|
223
223
|
create: (body: Service.AdjustInventory.Create.Body) => Promise<Service.AdjustInventory.Create.Result>;
|
|
224
224
|
};
|
|
225
225
|
inventory: {
|
|
226
226
|
_path: string;
|
|
227
|
-
find: (params?: Service.Inventory.Find.Params
|
|
227
|
+
find: (params?: Service.Inventory.Find.Params) => Promise<Service.Inventory.Find.Result>;
|
|
228
228
|
};
|
|
229
229
|
integrationApp: {
|
|
230
230
|
_path: string;
|
|
231
|
-
find: (params?: Service.App.Find.Params
|
|
232
|
-
get: (id: Service.App.Get.ID, params?: Service.App.Find.Params
|
|
231
|
+
find: (params?: Service.App.Find.Params) => Promise<Service.App.Find.Result>;
|
|
232
|
+
get: (id: Service.App.Get.ID, params?: Service.App.Find.Params) => Promise<Service.App.Get.Result>;
|
|
233
233
|
create: (body: Service.App.Create.Body) => Promise<Service.App.Create.Result>;
|
|
234
234
|
update: (id: Service.App.Update.ID, body: Service.App.Update.Body) => Promise<Service.App.Update.Result>;
|
|
235
235
|
};
|
|
@@ -266,7 +266,7 @@ export default class Repzo {
|
|
|
266
266
|
};
|
|
267
267
|
};
|
|
268
268
|
static CommandLog: {
|
|
269
|
-
new (superThis: Repzo, app: Service.App.Schema_with_populated_AvailableApp, command: string, trigger?: string
|
|
269
|
+
new (superThis: Repzo, app: Service.App.Schema_with_populated_AvailableApp, command: string, trigger?: string): {
|
|
270
270
|
_path: string;
|
|
271
271
|
available_app_name: string;
|
|
272
272
|
available_app_id: StringId;
|
|
@@ -296,7 +296,7 @@ export default class Repzo {
|
|
|
296
296
|
onGoing: boolean;
|
|
297
297
|
trigger?: string | undefined;
|
|
298
298
|
superThis: Repzo;
|
|
299
|
-
load(sync_id?: string
|
|
299
|
+
load(sync_id?: string, retries?: number): Promise<any>;
|
|
300
300
|
setStatus(status: Service.CommandLog.Status, error?: any): any;
|
|
301
301
|
setBody(body: any): any;
|
|
302
302
|
setMeta(meta: any): any;
|
|
@@ -304,4 +304,9 @@ export default class Repzo {
|
|
|
304
304
|
addDetail(detail: string, meta?: any): any;
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
|
+
patchAction: {
|
|
308
|
+
_path: string;
|
|
309
|
+
create: (body: Service.PatchAction.Create.Body, params?: Service.PatchAction.Create.Params) => Promise<Service.PatchAction.Create.Result>;
|
|
310
|
+
update: (body: Service.PatchAction.Update.Body) => Promise<Service.PatchAction.Update.Result>;
|
|
311
|
+
};
|
|
307
312
|
}
|
package/lib/index.js
CHANGED
|
@@ -614,6 +614,17 @@ export default class Repzo {
|
|
|
614
614
|
return res;
|
|
615
615
|
},
|
|
616
616
|
};
|
|
617
|
+
this.patchAction = {
|
|
618
|
+
_path: "/patch-action",
|
|
619
|
+
create: async (body, params) => {
|
|
620
|
+
const res = await this._create(this.svAPIEndpoint, this.patchAction._path, body, params);
|
|
621
|
+
return res;
|
|
622
|
+
},
|
|
623
|
+
update: async (body) => {
|
|
624
|
+
const res = await this._update(this.svAPIEndpoint, this.patchAction._path, body);
|
|
625
|
+
return res;
|
|
626
|
+
},
|
|
627
|
+
};
|
|
617
628
|
this.svAPIEndpoint =
|
|
618
629
|
!options?.env || options?.env == "production"
|
|
619
630
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2871,11 +2871,14 @@ export declare namespace Service {
|
|
|
2871
2871
|
origin_warehouse?: string[] | string;
|
|
2872
2872
|
custom_status?: string[] | string;
|
|
2873
2873
|
status?: InvoiceStatus | InvoiceStatus[];
|
|
2874
|
-
is_void
|
|
2874
|
+
is_void?: false;
|
|
2875
2875
|
has_return?: boolean;
|
|
2876
2876
|
[key: string]: any;
|
|
2877
2877
|
populatedKeys?: PopulatedKeys[];
|
|
2878
2878
|
sortPage?: SortingKeys;
|
|
2879
|
+
"serial_number.formatted"?: string[] | string;
|
|
2880
|
+
"return_serial_number.formatted"?: string[] | string;
|
|
2881
|
+
returned_from?: string[] | string;
|
|
2879
2882
|
};
|
|
2880
2883
|
interface Result extends DefaultPaginationResult {
|
|
2881
2884
|
data: InvoiceSchemaWithPopulatedKeys[];
|
|
@@ -4160,6 +4163,7 @@ export declare namespace Service {
|
|
|
4160
4163
|
namespace JoinActionsWeHook {
|
|
4161
4164
|
interface JoinData {
|
|
4162
4165
|
app: string;
|
|
4166
|
+
app_id: string;
|
|
4163
4167
|
action: string;
|
|
4164
4168
|
event: string;
|
|
4165
4169
|
join: boolean;
|
|
@@ -4260,7 +4264,89 @@ export declare namespace Service {
|
|
|
4260
4264
|
};
|
|
4261
4265
|
app_category: string;
|
|
4262
4266
|
}
|
|
4267
|
+
namespace PatchAction {
|
|
4268
|
+
type ReadOperator = "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin" | "search";
|
|
4269
|
+
type WriteOperator = "set" | "addToSet" | "pull";
|
|
4270
|
+
type Slug = "client" | "product" | "availability-msl" | "product-category" | "product-sub-category" | "product-brand" | "variant" | "product-group" | "msl" | "rep" | "line-classification" | "line" | "activity-storecheck" | "measureunits" | "promotions" | "tax" | "tag" | "warehouse" | "client-channel" | "measureunit-family" | "paymentterms";
|
|
4271
|
+
interface ReadQuery {
|
|
4272
|
+
/**
|
|
4273
|
+
* @type {string} filed to filter by
|
|
4274
|
+
*/
|
|
4275
|
+
key: string;
|
|
4276
|
+
value: string | string[] | [] | null | number | boolean | number[] | boolean[] | null[];
|
|
4277
|
+
/**
|
|
4278
|
+
* @type {string} Operator value set according to filter document and of enum type set according to each corresponding key
|
|
4279
|
+
* @example {<"eq">}
|
|
4280
|
+
*/
|
|
4281
|
+
operator: ReadOperator;
|
|
4282
|
+
}
|
|
4283
|
+
interface WriteQuery {
|
|
4284
|
+
/**
|
|
4285
|
+
* @type {string} filed to filter by
|
|
4286
|
+
*/
|
|
4287
|
+
key: string;
|
|
4288
|
+
value: any;
|
|
4289
|
+
/**
|
|
4290
|
+
* @type {string} command value set according to filter document and of enum type set according to each corresponding key
|
|
4291
|
+
* @example {<"addToSet">}
|
|
4292
|
+
*/
|
|
4293
|
+
command: WriteOperator;
|
|
4294
|
+
}
|
|
4295
|
+
interface FormattedWriteQuery {
|
|
4296
|
+
/**
|
|
4297
|
+
* @type {string} update $command key
|
|
4298
|
+
*/
|
|
4299
|
+
[key: string]: {
|
|
4300
|
+
/**
|
|
4301
|
+
* @type {string } update field key and update value
|
|
4302
|
+
*/
|
|
4303
|
+
[key: string]: any;
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
interface CreateBody {
|
|
4307
|
+
/**
|
|
4308
|
+
* @type {string} name of model (an enum value) as specified in patch-filter schema
|
|
4309
|
+
*/
|
|
4310
|
+
slug: Slug;
|
|
4311
|
+
/**
|
|
4312
|
+
* @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
|
|
4313
|
+
* @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
|
|
4314
|
+
*/
|
|
4315
|
+
readQuery: ReadQuery[];
|
|
4316
|
+
}
|
|
4317
|
+
interface UpdateBody {
|
|
4318
|
+
/**
|
|
4319
|
+
* @type {string} name of model (an enum value) as specified in patch-filter schema
|
|
4320
|
+
*/
|
|
4321
|
+
slug: Slug;
|
|
4322
|
+
/**
|
|
4323
|
+
* @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
|
|
4324
|
+
* @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
|
|
4325
|
+
*/
|
|
4326
|
+
readQuery: ReadQuery[];
|
|
4327
|
+
/**
|
|
4328
|
+
* @type {WriteQuery} an object sent in body to include write-filter key, value and an update command accordingly
|
|
4329
|
+
* @example {<{ key: "field_test", value: "ex_1", "command": "set" }>}
|
|
4330
|
+
*/
|
|
4331
|
+
writeQuery: WriteQuery | FormattedWriteQuery;
|
|
4332
|
+
}
|
|
4333
|
+
export namespace Create {
|
|
4334
|
+
type Params = DefaultPaginationQueryParams & {
|
|
4335
|
+
[key: string]: any;
|
|
4336
|
+
};
|
|
4337
|
+
type Body = CreateBody;
|
|
4338
|
+
type Result = DefaultPaginationResult;
|
|
4339
|
+
}
|
|
4340
|
+
export namespace Update {
|
|
4341
|
+
type Body = UpdateBody;
|
|
4342
|
+
type Result = {
|
|
4343
|
+
nFound: number;
|
|
4344
|
+
nModified: number;
|
|
4345
|
+
};
|
|
4346
|
+
}
|
|
4347
|
+
export {};
|
|
4348
|
+
}
|
|
4263
4349
|
}
|
|
4264
|
-
export
|
|
4265
|
-
export
|
|
4350
|
+
export type StringId = string;
|
|
4351
|
+
export type NameSpaces = string[];
|
|
4266
4352
|
export {};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1907,4 +1907,31 @@ export default class Repzo {
|
|
|
1907
1907
|
return this;
|
|
1908
1908
|
}
|
|
1909
1909
|
};
|
|
1910
|
+
|
|
1911
|
+
patchAction = {
|
|
1912
|
+
_path: "/patch-action",
|
|
1913
|
+
create: async (
|
|
1914
|
+
body: Service.PatchAction.Create.Body,
|
|
1915
|
+
params?: Service.PatchAction.Create.Params
|
|
1916
|
+
): Promise<Service.PatchAction.Create.Result> => {
|
|
1917
|
+
const res: Service.PatchAction.Create.Result = await this._create(
|
|
1918
|
+
this.svAPIEndpoint,
|
|
1919
|
+
this.patchAction._path,
|
|
1920
|
+
body,
|
|
1921
|
+
params
|
|
1922
|
+
);
|
|
1923
|
+
return res;
|
|
1924
|
+
},
|
|
1925
|
+
|
|
1926
|
+
update: async (
|
|
1927
|
+
body: Service.PatchAction.Update.Body
|
|
1928
|
+
): Promise<Service.PatchAction.Update.Result> => {
|
|
1929
|
+
const res: Service.PatchAction.Update.Result = await this._update(
|
|
1930
|
+
this.svAPIEndpoint,
|
|
1931
|
+
this.patchAction._path,
|
|
1932
|
+
body
|
|
1933
|
+
);
|
|
1934
|
+
return res;
|
|
1935
|
+
},
|
|
1936
|
+
};
|
|
1910
1937
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -2962,11 +2962,14 @@ export namespace Service {
|
|
|
2962
2962
|
origin_warehouse?: string[] | string;
|
|
2963
2963
|
custom_status?: string[] | string;
|
|
2964
2964
|
status?: InvoiceStatus | InvoiceStatus[];
|
|
2965
|
-
is_void
|
|
2965
|
+
is_void?: false;
|
|
2966
2966
|
has_return?: boolean;
|
|
2967
2967
|
[key: string]: any; // integration_meta.
|
|
2968
2968
|
populatedKeys?: PopulatedKeys[];
|
|
2969
2969
|
sortPage?: SortingKeys;
|
|
2970
|
+
"serial_number.formatted"?: string[] | string;
|
|
2971
|
+
"return_serial_number.formatted"?: string[] | string;
|
|
2972
|
+
returned_from?: string[] | string;
|
|
2970
2973
|
};
|
|
2971
2974
|
export interface Result extends DefaultPaginationResult {
|
|
2972
2975
|
data: InvoiceSchemaWithPopulatedKeys[];
|
|
@@ -4231,6 +4234,7 @@ export namespace Service {
|
|
|
4231
4234
|
export namespace JoinActionsWeHook {
|
|
4232
4235
|
interface JoinData {
|
|
4233
4236
|
app: string;
|
|
4237
|
+
app_id: string;
|
|
4234
4238
|
action: string;
|
|
4235
4239
|
event: string;
|
|
4236
4240
|
join: boolean;
|
|
@@ -4332,6 +4336,129 @@ export namespace Service {
|
|
|
4332
4336
|
app_settings: { repo: string; serviceEndPoint: string; meta: {} };
|
|
4333
4337
|
app_category: string;
|
|
4334
4338
|
}
|
|
4339
|
+
|
|
4340
|
+
export namespace PatchAction {
|
|
4341
|
+
type ReadOperator =
|
|
4342
|
+
| "lte"
|
|
4343
|
+
| "lt"
|
|
4344
|
+
| "gte"
|
|
4345
|
+
| "gt"
|
|
4346
|
+
| "eq"
|
|
4347
|
+
| "ne"
|
|
4348
|
+
| "in"
|
|
4349
|
+
| "nin"
|
|
4350
|
+
| "search";
|
|
4351
|
+
type WriteOperator = "set" | "addToSet" | "pull";
|
|
4352
|
+
type Slug =
|
|
4353
|
+
| "client"
|
|
4354
|
+
| "product"
|
|
4355
|
+
| "availability-msl"
|
|
4356
|
+
| "product-category"
|
|
4357
|
+
| "product-sub-category"
|
|
4358
|
+
| "product-brand"
|
|
4359
|
+
| "variant"
|
|
4360
|
+
| "product-group"
|
|
4361
|
+
| "msl"
|
|
4362
|
+
| "rep"
|
|
4363
|
+
| "line-classification"
|
|
4364
|
+
| "line"
|
|
4365
|
+
| "activity-storecheck"
|
|
4366
|
+
| "measureunits"
|
|
4367
|
+
| "promotions"
|
|
4368
|
+
| "tax"
|
|
4369
|
+
| "tag"
|
|
4370
|
+
| "warehouse"
|
|
4371
|
+
| "client-channel"
|
|
4372
|
+
| "measureunit-family"
|
|
4373
|
+
| "paymentterms";
|
|
4374
|
+
|
|
4375
|
+
interface ReadQuery {
|
|
4376
|
+
/**
|
|
4377
|
+
* @type {string} filed to filter by
|
|
4378
|
+
*/
|
|
4379
|
+
key: string;
|
|
4380
|
+
value:
|
|
4381
|
+
| string
|
|
4382
|
+
| string[]
|
|
4383
|
+
| []
|
|
4384
|
+
| null
|
|
4385
|
+
| number
|
|
4386
|
+
| boolean
|
|
4387
|
+
| number[]
|
|
4388
|
+
| boolean[]
|
|
4389
|
+
| null[];
|
|
4390
|
+
/**
|
|
4391
|
+
* @type {string} Operator value set according to filter document and of enum type set according to each corresponding key
|
|
4392
|
+
* @example {<"eq">}
|
|
4393
|
+
*/
|
|
4394
|
+
operator: ReadOperator;
|
|
4395
|
+
}
|
|
4396
|
+
interface WriteQuery {
|
|
4397
|
+
/**
|
|
4398
|
+
* @type {string} filed to filter by
|
|
4399
|
+
*/
|
|
4400
|
+
key: string;
|
|
4401
|
+
value: any;
|
|
4402
|
+
/**
|
|
4403
|
+
* @type {string} command value set according to filter document and of enum type set according to each corresponding key
|
|
4404
|
+
* @example {<"addToSet">}
|
|
4405
|
+
*/
|
|
4406
|
+
command: WriteOperator;
|
|
4407
|
+
}
|
|
4408
|
+
interface FormattedWriteQuery {
|
|
4409
|
+
/**
|
|
4410
|
+
* @type {string} update $command key
|
|
4411
|
+
*/
|
|
4412
|
+
[key: string]: {
|
|
4413
|
+
/**
|
|
4414
|
+
* @type {string } update field key and update value
|
|
4415
|
+
*/
|
|
4416
|
+
[key: string]: any;
|
|
4417
|
+
};
|
|
4418
|
+
}
|
|
4419
|
+
interface CreateBody {
|
|
4420
|
+
/**
|
|
4421
|
+
* @type {string} name of model (an enum value) as specified in patch-filter schema
|
|
4422
|
+
*/
|
|
4423
|
+
slug: Slug;
|
|
4424
|
+
/**
|
|
4425
|
+
* @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
|
|
4426
|
+
* @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
|
|
4427
|
+
*/
|
|
4428
|
+
readQuery: ReadQuery[];
|
|
4429
|
+
}
|
|
4430
|
+
interface UpdateBody {
|
|
4431
|
+
/**
|
|
4432
|
+
* @type {string} name of model (an enum value) as specified in patch-filter schema
|
|
4433
|
+
*/
|
|
4434
|
+
slug: Slug;
|
|
4435
|
+
/**
|
|
4436
|
+
* @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
|
|
4437
|
+
* @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
|
|
4438
|
+
*/
|
|
4439
|
+
readQuery: ReadQuery[];
|
|
4440
|
+
/**
|
|
4441
|
+
* @type {WriteQuery} an object sent in body to include write-filter key, value and an update command accordingly
|
|
4442
|
+
* @example {<{ key: "field_test", value: "ex_1", "command": "set" }>}
|
|
4443
|
+
*/
|
|
4444
|
+
writeQuery: WriteQuery | FormattedWriteQuery;
|
|
4445
|
+
}
|
|
4446
|
+
|
|
4447
|
+
export namespace Create {
|
|
4448
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
4449
|
+
[key: string]: any;
|
|
4450
|
+
};
|
|
4451
|
+
export type Body = CreateBody;
|
|
4452
|
+
export type Result = DefaultPaginationResult;
|
|
4453
|
+
}
|
|
4454
|
+
export namespace Update {
|
|
4455
|
+
export type Body = UpdateBody;
|
|
4456
|
+
export type Result = {
|
|
4457
|
+
nFound: number;
|
|
4458
|
+
nModified: number;
|
|
4459
|
+
};
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4335
4462
|
}
|
|
4336
4463
|
|
|
4337
4464
|
export type StringId = string;
|