repzo 1.0.2 → 1.0.5

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/src/index.ts CHANGED
@@ -17,7 +17,7 @@ export default class Repzo {
17
17
  this.headers = {
18
18
  "api-key": apiKey,
19
19
  "Content-Type": "application/json",
20
- Accept: "application/json"
20
+ Accept: "application/json",
21
21
  };
22
22
  if (options?.headers) Object.assign(this.headers, options.headers);
23
23
  }
@@ -25,7 +25,7 @@ export default class Repzo {
25
25
  private async _fetch(baseUrl: string, path: string, params?: Params) {
26
26
  let res = await axios.get(baseUrl + path, {
27
27
  params,
28
- headers: this.headers
28
+ headers: this.headers,
29
29
  });
30
30
  return res.data;
31
31
  }
@@ -38,7 +38,7 @@ export default class Repzo {
38
38
  ) {
39
39
  let res = await axios.post(baseUrl + path, body, {
40
40
  params,
41
- headers: this.headers
41
+ headers: this.headers,
42
42
  });
43
43
  return res.data;
44
44
  }
@@ -51,7 +51,7 @@ export default class Repzo {
51
51
  ) {
52
52
  let res = await axios.put(baseUrl + path, body, {
53
53
  params,
54
- headers: this.headers
54
+ headers: this.headers,
55
55
  });
56
56
  return res.data;
57
57
  }
@@ -59,7 +59,7 @@ export default class Repzo {
59
59
  private async _delete(baseUrl: string, path: string, params?: Params) {
60
60
  let res = await axios.delete(baseUrl + path, {
61
61
  params,
62
- headers: this.headers
62
+ headers: this.headers,
63
63
  });
64
64
  return res.data;
65
65
  }
@@ -115,6 +115,1312 @@ export default class Repzo {
115
115
  this.client._path + `/${id}`
116
116
  );
117
117
  return res;
118
- }
118
+ },
119
+ };
120
+
121
+ product = {
122
+ _path: "/product",
123
+ find: async (
124
+ params?: Service.Product.Find.Params
125
+ ): Promise<Service.Product.Find.Result> => {
126
+ let res: Service.Product.Find.Result = await this._fetch(
127
+ this.svAPIEndpoint,
128
+ this.product._path,
129
+ params
130
+ );
131
+ return res;
132
+ },
133
+
134
+ get: async (
135
+ id: Service.Product.Get.ID,
136
+ params?: Service.Product.Get.Params
137
+ ): Promise<Service.Product.Get.Result> => {
138
+ return await this._fetch(
139
+ this.svAPIEndpoint,
140
+ this.product._path + `/${id}`,
141
+ params
142
+ );
143
+ },
144
+
145
+ create: async (
146
+ body: Service.Product.Create.Body
147
+ ): Promise<Service.Product.Create.Result> => {
148
+ let res = await this._create(
149
+ this.svAPIEndpoint,
150
+ this.product._path,
151
+ body
152
+ );
153
+ return res;
154
+ },
155
+
156
+ update: async (
157
+ id: Service.Product.Update.ID,
158
+ body: Service.Product.Update.Body
159
+ ): Promise<Service.Product.Update.Result> => {
160
+ let res: Service.Product.Update.Result = await this._update(
161
+ this.svAPIEndpoint,
162
+ this.product._path + `/${id}`,
163
+ body
164
+ );
165
+ return res;
166
+ },
167
+
168
+ remove: async (
169
+ id: Service.Product.Remove.ID
170
+ ): Promise<Service.Product.Remove.Result> => {
171
+ let res: Service.Product.Remove.Result = await this._delete(
172
+ this.svAPIEndpoint,
173
+ this.product._path + `/${id}`
174
+ );
175
+ return res;
176
+ },
177
+ };
178
+
179
+ variant = {
180
+ _path: "/variant",
181
+ find: async (
182
+ params?: Service.Variant.Find.Params
183
+ ): Promise<Service.Variant.Find.Result> => {
184
+ let res: Service.Variant.Find.Result = await this._fetch(
185
+ this.svAPIEndpoint,
186
+ this.variant._path,
187
+ params
188
+ );
189
+ return res;
190
+ },
191
+
192
+ get: async (
193
+ id: Service.Variant.Get.ID,
194
+ params?: Service.Variant.Get.Params
195
+ ): Promise<Service.Variant.Get.Result> => {
196
+ return await this._fetch(
197
+ this.svAPIEndpoint,
198
+ this.variant._path + `/${id}`,
199
+ params
200
+ );
201
+ },
202
+
203
+ create: async (
204
+ body: Service.Variant.Create.Body
205
+ ): Promise<Service.Variant.Create.Result> => {
206
+ let res = await this._create(
207
+ this.svAPIEndpoint,
208
+ this.variant._path,
209
+ body
210
+ );
211
+ return res;
212
+ },
213
+
214
+ update: async (
215
+ id: Service.Variant.Update.ID,
216
+ body: Service.Variant.Update.Body
217
+ ): Promise<Service.Variant.Update.Result> => {
218
+ let res: Service.Variant.Update.Result = await this._update(
219
+ this.svAPIEndpoint,
220
+ this.variant._path + `/${id}`,
221
+ body
222
+ );
223
+ return res;
224
+ },
225
+
226
+ remove: async (
227
+ id: Service.Variant.Remove.ID
228
+ ): Promise<Service.Variant.Remove.Result> => {
229
+ let res: Service.Variant.Remove.Result = await this._delete(
230
+ this.svAPIEndpoint,
231
+ this.variant._path + `/${id}`
232
+ );
233
+ return res;
234
+ },
235
+ };
236
+
237
+ category = {
238
+ _path: "/product-category",
239
+ find: async (
240
+ params?: Service.Category.Find.Params
241
+ ): Promise<Service.Category.Find.Result> => {
242
+ let res: Service.Category.Find.Result = await this._fetch(
243
+ this.svAPIEndpoint,
244
+ this.category._path,
245
+ params
246
+ );
247
+ return res;
248
+ },
249
+
250
+ get: async (
251
+ id: Service.Category.Get.ID
252
+ ): Promise<Service.Category.Get.Result> => {
253
+ return await this._fetch(
254
+ this.svAPIEndpoint,
255
+ this.category._path + `/${id}`
256
+ );
257
+ },
258
+
259
+ create: async (
260
+ body: Service.Category.Create.Body
261
+ ): Promise<Service.Category.Create.Result> => {
262
+ let res = await this._create(
263
+ this.svAPIEndpoint,
264
+ this.category._path,
265
+ body
266
+ );
267
+ return res;
268
+ },
269
+
270
+ update: async (
271
+ id: Service.Category.Update.ID,
272
+ body: Service.Category.Update.Body
273
+ ): Promise<Service.Category.Update.Result> => {
274
+ let res: Service.Category.Update.Result = await this._update(
275
+ this.svAPIEndpoint,
276
+ this.category._path + `/${id}`,
277
+ body
278
+ );
279
+ return res;
280
+ },
281
+
282
+ remove: async (
283
+ id: Service.Category.Remove.ID
284
+ ): Promise<Service.Category.Remove.Result> => {
285
+ let res: Service.Category.Remove.Result = await this._delete(
286
+ this.svAPIEndpoint,
287
+ this.category._path + `/${id}`
288
+ );
289
+ return res;
290
+ },
291
+ };
292
+
293
+ sub_category = {
294
+ _path: "/product-sub-category",
295
+ find: async (
296
+ params?: Service.SubCategory.Find.Params
297
+ ): Promise<Service.SubCategory.Find.Result> => {
298
+ let res: Service.SubCategory.Find.Result = await this._fetch(
299
+ this.svAPIEndpoint,
300
+ this.sub_category._path,
301
+ params
302
+ );
303
+ return res;
304
+ },
305
+
306
+ get: async (
307
+ id: Service.SubCategory.Get.ID,
308
+ params?: Service.SubCategory.Get.Params
309
+ ): Promise<Service.SubCategory.Get.Result> => {
310
+ return await this._fetch(
311
+ this.svAPIEndpoint,
312
+ this.sub_category._path + `/${id}`,
313
+ params
314
+ );
315
+ },
316
+
317
+ create: async (
318
+ body: Service.SubCategory.Create.Body
319
+ ): Promise<Service.SubCategory.Create.Result> => {
320
+ let res = await this._create(
321
+ this.svAPIEndpoint,
322
+ this.sub_category._path,
323
+ body
324
+ );
325
+ return res;
326
+ },
327
+
328
+ update: async (
329
+ id: Service.SubCategory.Update.ID,
330
+ body: Service.SubCategory.Update.Body
331
+ ): Promise<Service.SubCategory.Update.Result> => {
332
+ let res: Service.SubCategory.Update.Result = await this._update(
333
+ this.svAPIEndpoint,
334
+ this.sub_category._path + `/${id}`,
335
+ body
336
+ );
337
+ return res;
338
+ },
339
+
340
+ remove: async (
341
+ id: Service.SubCategory.Remove.ID
342
+ ): Promise<Service.SubCategory.Remove.Result> => {
343
+ let res: Service.SubCategory.Remove.Result = await this._delete(
344
+ this.svAPIEndpoint,
345
+ this.sub_category._path + `/${id}`
346
+ );
347
+ return res;
348
+ },
349
+ };
350
+
351
+ brand = {
352
+ _path: "/product-brand",
353
+ find: async (
354
+ params?: Service.Brand.Find.Params
355
+ ): Promise<Service.Brand.Find.Result> => {
356
+ let res: Service.Brand.Find.Result = await this._fetch(
357
+ this.svAPIEndpoint,
358
+ this.brand._path,
359
+ params
360
+ );
361
+ return res;
362
+ },
363
+
364
+ get: async (
365
+ id: Service.Brand.Get.ID
366
+ ): Promise<Service.Brand.Get.Result> => {
367
+ return await this._fetch(this.svAPIEndpoint, this.brand._path + `/${id}`);
368
+ },
369
+
370
+ create: async (
371
+ body: Service.Brand.Create.Body
372
+ ): Promise<Service.Brand.Create.Result> => {
373
+ let res = await this._create(this.svAPIEndpoint, this.brand._path, body);
374
+ return res;
375
+ },
376
+
377
+ update: async (
378
+ id: Service.Brand.Update.ID,
379
+ body: Service.Brand.Update.Body
380
+ ): Promise<Service.Brand.Update.Result> => {
381
+ let res: Service.Brand.Update.Result = await this._update(
382
+ this.svAPIEndpoint,
383
+ this.brand._path + `/${id}`,
384
+ body
385
+ );
386
+ return res;
387
+ },
388
+
389
+ remove: async (
390
+ id: Service.Brand.Remove.ID
391
+ ): Promise<Service.Brand.Remove.Result> => {
392
+ let res: Service.Brand.Remove.Result = await this._delete(
393
+ this.svAPIEndpoint,
394
+ this.brand._path + `/${id}`
395
+ );
396
+ return res;
397
+ },
398
+ };
399
+
400
+ product_group = {
401
+ _path: "/product-group",
402
+ find: async (
403
+ params?: Service.ProductGroup.Find.Params
404
+ ): Promise<Service.ProductGroup.Find.Result> => {
405
+ let res: Service.ProductGroup.Find.Result = await this._fetch(
406
+ this.svAPIEndpoint,
407
+ this.product_group._path,
408
+ params
409
+ );
410
+ return res;
411
+ },
412
+
413
+ get: async (
414
+ id: Service.ProductGroup.Get.ID
415
+ ): Promise<Service.ProductGroup.Get.Result> => {
416
+ return await this._fetch(
417
+ this.svAPIEndpoint,
418
+ this.product_group._path + `/${id}`
419
+ );
420
+ },
421
+
422
+ create: async (
423
+ body: Service.ProductGroup.Create.Body
424
+ ): Promise<Service.ProductGroup.Create.Result> => {
425
+ let res = await this._create(
426
+ this.svAPIEndpoint,
427
+ this.product_group._path,
428
+ body
429
+ );
430
+ return res;
431
+ },
432
+
433
+ update: async (
434
+ id: Service.ProductGroup.Update.ID,
435
+ body: Service.ProductGroup.Update.Body
436
+ ): Promise<Service.ProductGroup.Update.Result> => {
437
+ let res: Service.ProductGroup.Update.Result = await this._update(
438
+ this.svAPIEndpoint,
439
+ this.product_group._path + `/${id}`,
440
+ body
441
+ );
442
+ return res;
443
+ },
444
+
445
+ remove: async (
446
+ id: Service.ProductGroup.Remove.ID
447
+ ): Promise<Service.ProductGroup.Remove.Result> => {
448
+ let res: Service.ProductGroup.Remove.Result = await this._delete(
449
+ this.svAPIEndpoint,
450
+ this.product_group._path + `/${id}`
451
+ );
452
+ return res;
453
+ },
454
+ };
455
+
456
+ tax = {
457
+ _path: "/tax",
458
+ find: async (
459
+ params?: Service.Tax.Find.Params
460
+ ): Promise<Service.Tax.Find.Result> => {
461
+ let res: Service.Tax.Find.Result = await this._fetch(
462
+ this.svAPIEndpoint,
463
+ this.tax._path,
464
+ params
465
+ );
466
+ return res;
467
+ },
468
+
469
+ get: async (id: Service.Tax.Get.ID): Promise<Service.Tax.Get.Result> => {
470
+ return await this._fetch(this.svAPIEndpoint, this.tax._path + `/${id}`);
471
+ },
472
+
473
+ create: async (
474
+ body: Service.Tax.Create.Body
475
+ ): Promise<Service.Tax.Create.Result> => {
476
+ let res = await this._create(this.svAPIEndpoint, this.tax._path, body);
477
+ return res;
478
+ },
479
+
480
+ update: async (
481
+ id: Service.Tax.Update.ID,
482
+ body: Service.Tax.Update.Body
483
+ ): Promise<Service.Tax.Update.Result> => {
484
+ let res: Service.Tax.Update.Result = await this._update(
485
+ this.svAPIEndpoint,
486
+ this.tax._path + `/${id}`,
487
+ body
488
+ );
489
+ return res;
490
+ },
491
+
492
+ remove: async (
493
+ id: Service.Tax.Remove.ID
494
+ ): Promise<Service.Tax.Remove.Result> => {
495
+ let res: Service.Tax.Remove.Result = await this._delete(
496
+ this.svAPIEndpoint,
497
+ this.tax._path + `/${id}`
498
+ );
499
+ return res;
500
+ },
501
+ };
502
+
503
+ measureunit = {
504
+ _path: "/measureunits",
505
+ find: async (
506
+ params?: Service.MeasureUnit.Find.Params
507
+ ): Promise<Service.MeasureUnit.Find.Result> => {
508
+ let res: Service.MeasureUnit.Find.Result = await this._fetch(
509
+ this.svAPIEndpoint,
510
+ this.measureunit._path,
511
+ params
512
+ );
513
+ return res;
514
+ },
515
+
516
+ get: async (
517
+ id: Service.MeasureUnit.Get.ID
518
+ ): Promise<Service.MeasureUnit.Get.Result> => {
519
+ return await this._fetch(
520
+ this.svAPIEndpoint,
521
+ this.measureunit._path + `/${id}`
522
+ );
523
+ },
524
+
525
+ create: async (
526
+ body: Service.MeasureUnit.Create.Body
527
+ ): Promise<Service.MeasureUnit.Create.Result> => {
528
+ let res = await this._create(
529
+ this.svAPIEndpoint,
530
+ this.measureunit._path,
531
+ body
532
+ );
533
+ return res;
534
+ },
535
+
536
+ update: async (
537
+ id: Service.MeasureUnit.Update.ID,
538
+ body: Service.MeasureUnit.Update.Body
539
+ ): Promise<Service.MeasureUnit.Update.Result> => {
540
+ let res: Service.MeasureUnit.Update.Result = await this._update(
541
+ this.svAPIEndpoint,
542
+ this.measureunit._path + `/${id}`,
543
+ body
544
+ );
545
+ return res;
546
+ },
547
+
548
+ remove: async (
549
+ id: Service.MeasureUnit.Remove.ID
550
+ ): Promise<Service.MeasureUnit.Remove.Result> => {
551
+ let res: Service.MeasureUnit.Remove.Result = await this._delete(
552
+ this.svAPIEndpoint,
553
+ this.measureunit._path + `/${id}`
554
+ );
555
+ return res;
556
+ },
557
+ };
558
+
559
+ measureunitFamily = {
560
+ _path: "/measureunit-family",
561
+ find: async (
562
+ params?: Service.MeasureUnitFamily.Find.Params
563
+ ): Promise<Service.MeasureUnitFamily.Find.Result> => {
564
+ let res: Service.MeasureUnitFamily.Find.Result = await this._fetch(
565
+ this.svAPIEndpoint,
566
+ this.measureunitFamily._path,
567
+ params
568
+ );
569
+ return res;
570
+ },
571
+
572
+ get: async (
573
+ id: Service.MeasureUnitFamily.Get.ID
574
+ ): Promise<Service.MeasureUnitFamily.Get.Result> => {
575
+ return await this._fetch(
576
+ this.svAPIEndpoint,
577
+ this.measureunitFamily._path + `/${id}`
578
+ );
579
+ },
580
+
581
+ create: async (
582
+ body: Service.MeasureUnitFamily.Create.Body
583
+ ): Promise<Service.MeasureUnitFamily.Create.Result> => {
584
+ let res = await this._create(
585
+ this.svAPIEndpoint,
586
+ this.measureunitFamily._path,
587
+ body
588
+ );
589
+ return res;
590
+ },
591
+
592
+ update: async (
593
+ id: Service.MeasureUnitFamily.Update.ID,
594
+ body: Service.MeasureUnitFamily.Update.Body
595
+ ): Promise<Service.MeasureUnitFamily.Update.Result> => {
596
+ let res: Service.MeasureUnitFamily.Update.Result = await this._update(
597
+ this.svAPIEndpoint,
598
+ this.measureunitFamily._path + `/${id}`,
599
+ body
600
+ );
601
+ return res;
602
+ },
603
+
604
+ remove: async (
605
+ id: Service.MeasureUnitFamily.Remove.ID
606
+ ): Promise<Service.MeasureUnitFamily.Remove.Result> => {
607
+ let res: Service.MeasureUnitFamily.Remove.Result = await this._delete(
608
+ this.svAPIEndpoint,
609
+ this.measureunitFamily._path + `/${id}`
610
+ );
611
+ return res;
612
+ },
613
+ };
614
+
615
+ media = {
616
+ _path: "/media",
617
+ find: async (
618
+ params?: Service.Media.Find.Params
619
+ ): Promise<Service.Media.Find.Result> => {
620
+ let res: Service.Media.Find.Result = await this._fetch(
621
+ this.svAPIEndpoint,
622
+ this.media._path,
623
+ params
624
+ );
625
+ return res;
626
+ },
627
+
628
+ get: async (
629
+ id: Service.Media.Get.ID
630
+ ): Promise<Service.Media.Get.Result> => {
631
+ return await this._fetch(this.svAPIEndpoint, this.media._path + `/${id}`);
632
+ },
633
+
634
+ create: async (
635
+ body: Service.Media.Create.Body
636
+ ): Promise<Service.Media.Create.Result> => {
637
+ let res = await this._create(this.svAPIEndpoint, this.media._path, body);
638
+ return res;
639
+ },
640
+
641
+ update: async (
642
+ id: Service.Media.Update.ID,
643
+ body: Service.Media.Update.Body
644
+ ): Promise<Service.Media.Update.Result> => {
645
+ let res: Service.Media.Update.Result = await this._update(
646
+ this.svAPIEndpoint,
647
+ this.media._path + `/${id}`,
648
+ body
649
+ );
650
+ return res;
651
+ },
652
+
653
+ remove: async (
654
+ id: Service.Media.Remove.ID
655
+ ): Promise<Service.Media.Remove.Result> => {
656
+ let res: Service.Media.Remove.Result = await this._delete(
657
+ this.svAPIEndpoint,
658
+ this.media._path + `/${id}`
659
+ );
660
+ return res;
661
+ },
662
+ };
663
+
664
+ priceList = {
665
+ _path: "/pricelists",
666
+ find: async (
667
+ params?: Service.PriceList.Find.Params
668
+ ): Promise<Service.PriceList.Find.Result> => {
669
+ let res: Service.PriceList.Find.Result = await this._fetch(
670
+ this.svAPIEndpoint,
671
+ this.priceList._path,
672
+ params
673
+ );
674
+ return res;
675
+ },
676
+
677
+ get: async (
678
+ id: Service.PriceList.Get.ID
679
+ ): Promise<Service.PriceList.Get.Result> => {
680
+ return await this._fetch(
681
+ this.svAPIEndpoint,
682
+ this.priceList._path + `/${id}`
683
+ );
684
+ },
685
+
686
+ create: async (
687
+ body: Service.PriceList.Create.Body
688
+ ): Promise<Service.PriceList.Create.Result> => {
689
+ let res = await this._create(
690
+ this.svAPIEndpoint,
691
+ this.priceList._path,
692
+ body
693
+ );
694
+ return res;
695
+ },
696
+
697
+ update: async (
698
+ id: Service.PriceList.Update.ID,
699
+ body: Service.PriceList.Update.Body
700
+ ): Promise<Service.PriceList.Update.Result> => {
701
+ let res: Service.PriceList.Update.Result = await this._update(
702
+ this.svAPIEndpoint,
703
+ this.priceList._path + `/${id}`,
704
+ body
705
+ );
706
+ return res;
707
+ },
708
+
709
+ remove: async (
710
+ id: Service.PriceList.Remove.ID
711
+ ): Promise<Service.PriceList.Remove.Result> => {
712
+ let res: Service.PriceList.Remove.Result = await this._delete(
713
+ this.svAPIEndpoint,
714
+ this.priceList._path + `/${id}`
715
+ );
716
+ return res;
717
+ },
718
+ };
719
+
720
+ priceListItem = {
721
+ _path: "/pricelists",
722
+ find: async (
723
+ params?: Service.PriceListItem.Find.Params
724
+ ): Promise<Service.PriceListItem.Find.Result> => {
725
+ let res: Service.PriceListItem.Find.Result = await this._fetch(
726
+ this.svAPIEndpoint,
727
+ this.priceListItem._path,
728
+ params
729
+ );
730
+ return res;
731
+ },
732
+
733
+ get: async (
734
+ id: Service.PriceListItem.Get.ID
735
+ ): Promise<Service.PriceListItem.Get.Result> => {
736
+ return await this._fetch(
737
+ this.svAPIEndpoint,
738
+ this.priceListItem._path + `/${id}`
739
+ );
740
+ },
741
+
742
+ create: async (
743
+ body: Service.PriceListItem.Create.Body
744
+ ): Promise<Service.PriceListItem.Create.Result> => {
745
+ let res = await this._create(
746
+ this.svAPIEndpoint,
747
+ this.priceListItem._path,
748
+ body
749
+ );
750
+ return res;
751
+ },
752
+
753
+ update: async (
754
+ id: Service.PriceListItem.Update.ID,
755
+ body: Service.PriceListItem.Update.Body
756
+ ): Promise<Service.PriceListItem.Update.Result> => {
757
+ let res: Service.PriceListItem.Update.Result = await this._update(
758
+ this.svAPIEndpoint,
759
+ this.priceListItem._path + `/${id}`,
760
+ body
761
+ );
762
+ return res;
763
+ },
764
+
765
+ remove: async (
766
+ id: Service.PriceListItem.Remove.ID
767
+ ): Promise<Service.PriceListItem.Remove.Result> => {
768
+ let res: Service.PriceListItem.Remove.Result = await this._delete(
769
+ this.svAPIEndpoint,
770
+ this.priceListItem._path + `/${id}`
771
+ );
772
+ return res;
773
+ },
774
+ };
775
+
776
+ team = {
777
+ _path: "/teams",
778
+ find: async (
779
+ params?: Service.Team.Find.Params
780
+ ): Promise<Service.Team.Find.Result> => {
781
+ let res: Service.Team.Find.Result = await this._fetch(
782
+ this.svAPIEndpoint,
783
+ this.team._path,
784
+ params
785
+ );
786
+ return res;
787
+ },
788
+
789
+ get: async (id: Service.Team.Get.ID): Promise<Service.Team.Get.Result> => {
790
+ return await this._fetch(this.svAPIEndpoint, this.team._path + `/${id}`);
791
+ },
792
+
793
+ create: async (
794
+ body: Service.Team.Create.Body
795
+ ): Promise<Service.Team.Create.Result> => {
796
+ let res = await this._create(this.svAPIEndpoint, this.team._path, body);
797
+ return res;
798
+ },
799
+
800
+ update: async (
801
+ id: Service.Team.Update.ID,
802
+ body: Service.Team.Update.Body
803
+ ): Promise<Service.Team.Update.Result> => {
804
+ let res: Service.Team.Update.Result = await this._update(
805
+ this.svAPIEndpoint,
806
+ this.team._path + `/${id}`,
807
+ body
808
+ );
809
+ return res;
810
+ },
811
+
812
+ remove: async (
813
+ id: Service.Team.Remove.ID
814
+ ): Promise<Service.Team.Remove.Result> => {
815
+ let res: Service.Team.Remove.Result = await this._delete(
816
+ this.svAPIEndpoint,
817
+ this.team._path + `/${id}`
818
+ );
819
+ return res;
820
+ },
821
+ };
822
+
823
+ rep = {
824
+ _path: "/rep",
825
+ find: async (
826
+ params?: Service.Rep.Find.Params
827
+ ): Promise<Service.Rep.Find.Result> => {
828
+ let res: Service.Rep.Find.Result = await this._fetch(
829
+ this.svAPIEndpoint,
830
+ this.rep._path,
831
+ params
832
+ );
833
+ return res;
834
+ },
835
+
836
+ get: async (
837
+ id: Service.Rep.Get.ID,
838
+ params?: Service.Client.Get.Params
839
+ ): Promise<Service.Rep.Get.Result> => {
840
+ return await this._fetch(
841
+ this.svAPIEndpoint,
842
+ this.rep._path + `/${id}`,
843
+ params
844
+ );
845
+ },
846
+
847
+ create: async (
848
+ body: Service.Rep.Create.Body
849
+ ): Promise<Service.Rep.Create.Result> => {
850
+ let res = await this._create(this.svAPIEndpoint, this.rep._path, body);
851
+ return res;
852
+ },
853
+
854
+ update: async (
855
+ id: Service.Rep.Update.ID,
856
+ body: Service.Rep.Update.Body
857
+ ): Promise<Service.Rep.Update.Result> => {
858
+ let res: Service.Rep.Update.Result = await this._update(
859
+ this.svAPIEndpoint,
860
+ this.rep._path + `/${id}`,
861
+ body
862
+ );
863
+ return res;
864
+ },
865
+
866
+ remove: async (
867
+ id: Service.Rep.Remove.ID
868
+ ): Promise<Service.Rep.Remove.Result> => {
869
+ let res: Service.Rep.Remove.Result = await this._delete(
870
+ this.svAPIEndpoint,
871
+ this.rep._path + `/${id}`
872
+ );
873
+ return res;
874
+ },
875
+ };
876
+
877
+ tag = {
878
+ _path: "/tag",
879
+ find: async (
880
+ params?: Service.Tag.Find.Params
881
+ ): Promise<Service.Tag.Find.Result> => {
882
+ let res: Service.Tag.Find.Result = await this._fetch(
883
+ this.svAPIEndpoint,
884
+ this.tag._path,
885
+ params
886
+ );
887
+ return res;
888
+ },
889
+
890
+ get: async (id: Service.Tag.Get.ID): Promise<Service.Tag.Get.Result> => {
891
+ return await this._fetch(this.svAPIEndpoint, this.tag._path + `/${id}`);
892
+ },
893
+
894
+ create: async (
895
+ body: Service.Tag.Create.Body
896
+ ): Promise<Service.Tag.Create.Result> => {
897
+ let res = await this._create(this.svAPIEndpoint, this.tag._path, body);
898
+ return res;
899
+ },
900
+
901
+ update: async (
902
+ id: Service.Tag.Update.ID,
903
+ body: Service.Tag.Update.Body
904
+ ): Promise<Service.Tag.Update.Result> => {
905
+ let res: Service.Tag.Update.Result = await this._update(
906
+ this.svAPIEndpoint,
907
+ this.tag._path + `/${id}`,
908
+ body
909
+ );
910
+ return res;
911
+ },
912
+
913
+ remove: async (
914
+ id: Service.Tag.Remove.ID
915
+ ): Promise<Service.Tag.Remove.Result> => {
916
+ let res: Service.Tag.Remove.Result = await this._delete(
917
+ this.svAPIEndpoint,
918
+ this.tag._path + `/${id}`
919
+ );
920
+ return res;
921
+ },
922
+ };
923
+
924
+ warehouse = {
925
+ _path: "/warehouse",
926
+ find: async (
927
+ params?: Service.Warehouse.Find.Params
928
+ ): Promise<Service.Warehouse.Find.Result> => {
929
+ let res: Service.Warehouse.Find.Result = await this._fetch(
930
+ this.svAPIEndpoint,
931
+ this.warehouse._path,
932
+ params
933
+ );
934
+ return res;
935
+ },
936
+
937
+ get: async (
938
+ id: Service.Warehouse.Get.ID
939
+ ): Promise<Service.Warehouse.Get.Result> => {
940
+ return await this._fetch(
941
+ this.svAPIEndpoint,
942
+ this.warehouse._path + `/${id}`
943
+ );
944
+ },
945
+
946
+ create: async (
947
+ body: Service.Warehouse.Create.Body
948
+ ): Promise<Service.Warehouse.Create.Result> => {
949
+ let res = await this._create(
950
+ this.svAPIEndpoint,
951
+ this.warehouse._path,
952
+ body
953
+ );
954
+ return res;
955
+ },
956
+
957
+ update: async (
958
+ id: Service.Warehouse.Update.ID,
959
+ body: Service.Warehouse.Update.Body
960
+ ): Promise<Service.Warehouse.Update.Result> => {
961
+ let res: Service.Warehouse.Update.Result = await this._update(
962
+ this.svAPIEndpoint,
963
+ this.warehouse._path + `/${id}`,
964
+ body
965
+ );
966
+ return res;
967
+ },
968
+
969
+ remove: async (
970
+ id: Service.Warehouse.Remove.ID
971
+ ): Promise<Service.Warehouse.Remove.Result> => {
972
+ let res: Service.Warehouse.Remove.Result = await this._delete(
973
+ this.svAPIEndpoint,
974
+ this.warehouse._path + `/${id}`
975
+ );
976
+ return res;
977
+ },
978
+ };
979
+
980
+ channel = {
981
+ _path: "/client-channel",
982
+ find: async (
983
+ params?: Service.Channel.Find.Params
984
+ ): Promise<Service.Channel.Find.Result> => {
985
+ let res: Service.Channel.Find.Result = await this._fetch(
986
+ this.svAPIEndpoint,
987
+ this.channel._path,
988
+ params
989
+ );
990
+ return res;
991
+ },
992
+
993
+ get: async (
994
+ id: Service.Channel.Get.ID
995
+ ): Promise<Service.Channel.Get.Result> => {
996
+ return await this._fetch(
997
+ this.svAPIEndpoint,
998
+ this.channel._path + `/${id}`
999
+ );
1000
+ },
1001
+
1002
+ create: async (
1003
+ body: Service.Channel.Create.Body
1004
+ ): Promise<Service.Channel.Create.Result> => {
1005
+ let res = await this._create(
1006
+ this.svAPIEndpoint,
1007
+ this.channel._path,
1008
+ body
1009
+ );
1010
+ return res;
1011
+ },
1012
+
1013
+ update: async (
1014
+ id: Service.Channel.Update.ID,
1015
+ body: Service.Channel.Update.Body
1016
+ ): Promise<Service.Channel.Update.Result> => {
1017
+ let res: Service.Channel.Update.Result = await this._update(
1018
+ this.svAPIEndpoint,
1019
+ this.channel._path + `/${id}`,
1020
+ body
1021
+ );
1022
+ return res;
1023
+ },
1024
+
1025
+ remove: async (
1026
+ id: Service.Channel.Remove.ID
1027
+ ): Promise<Service.Channel.Remove.Result> => {
1028
+ let res: Service.Channel.Remove.Result = await this._delete(
1029
+ this.svAPIEndpoint,
1030
+ this.channel._path + `/${id}`
1031
+ );
1032
+ return res;
1033
+ },
1034
+ };
1035
+
1036
+ paymentTerm = {
1037
+ _path: "/paymentterms",
1038
+ find: async (
1039
+ params?: Service.PaymentTerm.Find.Params
1040
+ ): Promise<Service.PaymentTerm.Find.Result> => {
1041
+ let res: Service.PaymentTerm.Find.Result = await this._fetch(
1042
+ this.svAPIEndpoint,
1043
+ this.paymentTerm._path,
1044
+ params
1045
+ );
1046
+ return res;
1047
+ },
1048
+
1049
+ get: async (
1050
+ id: Service.PaymentTerm.Get.ID
1051
+ ): Promise<Service.PaymentTerm.Get.Result> => {
1052
+ return await this._fetch(
1053
+ this.svAPIEndpoint,
1054
+ this.paymentTerm._path + `/${id}`
1055
+ );
1056
+ },
1057
+
1058
+ create: async (
1059
+ body: Service.PaymentTerm.Create.Body
1060
+ ): Promise<Service.PaymentTerm.Create.Result> => {
1061
+ let res = await this._create(
1062
+ this.svAPIEndpoint,
1063
+ this.paymentTerm._path,
1064
+ body
1065
+ );
1066
+ return res;
1067
+ },
1068
+
1069
+ update: async (
1070
+ id: Service.PaymentTerm.Update.ID,
1071
+ body: Service.PaymentTerm.Update.Body
1072
+ ): Promise<Service.PaymentTerm.Update.Result> => {
1073
+ let res: Service.PaymentTerm.Update.Result = await this._update(
1074
+ this.svAPIEndpoint,
1075
+ this.paymentTerm._path + `/${id}`,
1076
+ body
1077
+ );
1078
+ return res;
1079
+ },
1080
+
1081
+ remove: async (
1082
+ id: Service.PaymentTerm.Remove.ID
1083
+ ): Promise<Service.PaymentTerm.Remove.Result> => {
1084
+ let res: Service.PaymentTerm.Remove.Result = await this._delete(
1085
+ this.svAPIEndpoint,
1086
+ this.paymentTerm._path + `/${id}`
1087
+ );
1088
+ return res;
1089
+ },
1090
+ };
1091
+
1092
+ bank = {
1093
+ _path: "/banks",
1094
+ find: async (
1095
+ params?: Service.Bank.Find.Params
1096
+ ): Promise<Service.Bank.Find.Result> => {
1097
+ let res: Service.Bank.Find.Result = await this._fetch(
1098
+ this.svAPIEndpoint,
1099
+ this.bank._path,
1100
+ params
1101
+ );
1102
+ return res;
1103
+ },
1104
+
1105
+ get: async (id: Service.Bank.Get.ID): Promise<Service.Bank.Get.Result> => {
1106
+ return await this._fetch(this.svAPIEndpoint, this.bank._path + `/${id}`);
1107
+ },
1108
+
1109
+ create: async (
1110
+ body: Service.Bank.Create.Body
1111
+ ): Promise<Service.Bank.Create.Result> => {
1112
+ let res = await this._create(this.svAPIEndpoint, this.bank._path, body);
1113
+ return res;
1114
+ },
1115
+
1116
+ update: async (
1117
+ id: Service.Bank.Update.ID,
1118
+ body: Service.Bank.Update.Body
1119
+ ): Promise<Service.Bank.Update.Result> => {
1120
+ let res: Service.Bank.Update.Result = await this._update(
1121
+ this.svAPIEndpoint,
1122
+ this.bank._path + `/${id}`,
1123
+ body
1124
+ );
1125
+ return res;
1126
+ },
1127
+ };
1128
+
1129
+ customStatus = {
1130
+ _path: "/custom-status",
1131
+ find: async (
1132
+ params?: Service.CustomStatus.Find.Params
1133
+ ): Promise<Service.CustomStatus.Find.Result> => {
1134
+ let res: Service.CustomStatus.Find.Result = await this._fetch(
1135
+ this.svAPIEndpoint,
1136
+ this.customStatus._path,
1137
+ params
1138
+ );
1139
+ return res;
1140
+ },
1141
+
1142
+ get: async (
1143
+ id: Service.CustomStatus.Get.ID
1144
+ ): Promise<Service.CustomStatus.Get.Result> => {
1145
+ return await this._fetch(
1146
+ this.svAPIEndpoint,
1147
+ this.customStatus._path + `/${id}`
1148
+ );
1149
+ },
1150
+
1151
+ create: async (
1152
+ body: Service.CustomStatus.Create.Body
1153
+ ): Promise<Service.CustomStatus.Create.Result> => {
1154
+ let res = await this._create(
1155
+ this.svAPIEndpoint,
1156
+ this.customStatus._path,
1157
+ body
1158
+ );
1159
+ return res;
1160
+ },
1161
+
1162
+ update: async (
1163
+ id: Service.CustomStatus.Update.ID,
1164
+ body: Service.CustomStatus.Update.Body
1165
+ ): Promise<Service.CustomStatus.Update.Result> => {
1166
+ let res: Service.CustomStatus.Update.Result = await this._update(
1167
+ this.svAPIEndpoint,
1168
+ this.customStatus._path + `/${id}`,
1169
+ body
1170
+ );
1171
+ return res;
1172
+ },
1173
+
1174
+ remove: async (
1175
+ id: Service.CustomStatus.Remove.ID
1176
+ ): Promise<Service.CustomStatus.Remove.Result> => {
1177
+ let res: Service.CustomStatus.Remove.Result = await this._delete(
1178
+ this.svAPIEndpoint,
1179
+ this.customStatus._path + `/${id}`
1180
+ );
1181
+ return res;
1182
+ },
1183
+ };
1184
+
1185
+ invoice = {
1186
+ _path: "/fullinvoices",
1187
+ find: async (
1188
+ params?: Service.FullInvoice.Find.Params
1189
+ ): Promise<Service.FullInvoice.Find.Result> => {
1190
+ let res: Service.FullInvoice.Find.Result = await this._fetch(
1191
+ this.svAPIEndpoint,
1192
+ this.invoice._path,
1193
+ params
1194
+ );
1195
+ return res;
1196
+ },
1197
+
1198
+ get: async (
1199
+ id: Service.FullInvoice.Get.ID,
1200
+ params?: Service.FullInvoice.Get.Params
1201
+ ): Promise<Service.FullInvoice.Get.Result> => {
1202
+ return await this._fetch(
1203
+ this.svAPIEndpoint,
1204
+ this.invoice._path + `/${id}`,
1205
+ params
1206
+ );
1207
+ },
1208
+
1209
+ create: async (
1210
+ body: Service.FullInvoice.Create.Body
1211
+ ): Promise<Service.FullInvoice.Create.Result> => {
1212
+ let res = await this._create(
1213
+ this.svAPIEndpoint,
1214
+ this.invoice._path,
1215
+ body
1216
+ );
1217
+ return res;
1218
+ },
1219
+
1220
+ update: async (
1221
+ id: Service.FullInvoice.Update.ID,
1222
+ body: Service.FullInvoice.Update.Body
1223
+ ): Promise<Service.FullInvoice.Update.Result> => {
1224
+ let res: Service.FullInvoice.Update.Result = await this._update(
1225
+ this.svAPIEndpoint,
1226
+ this.invoice._path + `/${id}`,
1227
+ body
1228
+ );
1229
+ return res;
1230
+ },
1231
+ };
1232
+
1233
+ proforma = {
1234
+ _path: "/proforma",
1235
+ find: async (
1236
+ params?: Service.Proforma.Find.Params
1237
+ ): Promise<Service.Proforma.Find.Result> => {
1238
+ let res: Service.Proforma.Find.Result = await this._fetch(
1239
+ this.svAPIEndpoint,
1240
+ this.proforma._path,
1241
+ params
1242
+ );
1243
+ return res;
1244
+ },
1245
+
1246
+ get: async (
1247
+ id: Service.Proforma.Get.ID,
1248
+ params?: Service.Proforma.Get.Params
1249
+ ): Promise<Service.Proforma.Get.Result> => {
1250
+ return await this._fetch(
1251
+ this.svAPIEndpoint,
1252
+ this.proforma._path + `/${id}`,
1253
+ params
1254
+ );
1255
+ },
1256
+
1257
+ create: async (
1258
+ body: Service.Proforma.Create.Body
1259
+ ): Promise<Service.Proforma.Create.Result> => {
1260
+ let res = await this._create(
1261
+ this.svAPIEndpoint,
1262
+ this.proforma._path,
1263
+ body
1264
+ );
1265
+ return res;
1266
+ },
1267
+
1268
+ update: async (
1269
+ id: Service.Proforma.Update.ID,
1270
+ body: Service.Proforma.Update.Body
1271
+ ): Promise<Service.Proforma.Update.Result> => {
1272
+ let res: Service.Proforma.Update.Result = await this._update(
1273
+ this.svAPIEndpoint,
1274
+ this.proforma._path + `/${id}`,
1275
+ body
1276
+ );
1277
+ return res;
1278
+ },
1279
+ };
1280
+
1281
+ payment = {
1282
+ _path: "/payments",
1283
+ find: async (
1284
+ params?: Service.Payment.Find.Params
1285
+ ): Promise<Service.Payment.Find.Result> => {
1286
+ let res: Service.Payment.Find.Result = await this._fetch(
1287
+ this.svAPIEndpoint,
1288
+ this.payment._path,
1289
+ params
1290
+ );
1291
+ return res;
1292
+ },
1293
+
1294
+ get: async (
1295
+ id: Service.Payment.Get.ID,
1296
+ params?: Service.Payment.Get.Params
1297
+ ): Promise<Service.Payment.Get.Result> => {
1298
+ return await this._fetch(
1299
+ this.svAPIEndpoint,
1300
+ this.payment._path + `/${id}`,
1301
+ params
1302
+ );
1303
+ },
1304
+
1305
+ create: async (
1306
+ body: Service.Payment.Create.Body
1307
+ ): Promise<Service.Payment.Create.Result> => {
1308
+ let res = await this._create(
1309
+ this.svAPIEndpoint,
1310
+ this.payment._path,
1311
+ body
1312
+ );
1313
+ return res;
1314
+ },
1315
+
1316
+ update: async (
1317
+ id: Service.Payment.Update.ID,
1318
+ body: Service.Payment.Update.Body
1319
+ ): Promise<Service.Payment.Update.Result> => {
1320
+ let res: Service.Payment.Update.Result = await this._update(
1321
+ this.svAPIEndpoint,
1322
+ this.payment._path + `/${id}`,
1323
+ body
1324
+ );
1325
+ return res;
1326
+ },
1327
+ };
1328
+
1329
+ transfer = {
1330
+ _path: "/transfer",
1331
+ find: async (
1332
+ params?: Service.Transfer.Find.Params
1333
+ ): Promise<Service.Transfer.Find.Result> => {
1334
+ let res: Service.Transfer.Find.Result = await this._fetch(
1335
+ this.svAPIEndpoint,
1336
+ this.transfer._path,
1337
+ params
1338
+ );
1339
+ return res;
1340
+ },
1341
+
1342
+ get: async (
1343
+ id: Service.Transfer.Get.ID,
1344
+ params?: Service.Transfer.Get.Params
1345
+ ): Promise<Service.Transfer.Get.Result> => {
1346
+ return await this._fetch(
1347
+ this.svAPIEndpoint,
1348
+ this.transfer._path + `/${id}`,
1349
+ params
1350
+ );
1351
+ },
1352
+
1353
+ create: async (
1354
+ body: Service.Transfer.Create.Body
1355
+ ): Promise<Service.Transfer.Create.Result> => {
1356
+ let res = await this._create(
1357
+ this.svAPIEndpoint,
1358
+ this.transfer._path,
1359
+ body
1360
+ );
1361
+ return res;
1362
+ },
1363
+
1364
+ update: async (
1365
+ id: Service.Transfer.Update.ID,
1366
+ body: Service.Transfer.Update.Body
1367
+ ): Promise<Service.Transfer.Update.Result> => {
1368
+ let res: Service.Transfer.Update.Result = await this._update(
1369
+ this.svAPIEndpoint,
1370
+ this.transfer._path + `/${id}`,
1371
+ body
1372
+ );
1373
+ return res;
1374
+ },
1375
+ };
1376
+
1377
+ adjustInventory = {
1378
+ _path: "/adjust-inventory",
1379
+ find: async (
1380
+ params?: Service.AdjustAccount.Find.Params
1381
+ ): Promise<Service.AdjustAccount.Find.Result> => {
1382
+ let res: Service.AdjustAccount.Find.Result = await this._fetch(
1383
+ this.svAPIEndpoint,
1384
+ this.adjustInventory._path,
1385
+ params
1386
+ );
1387
+ return res;
1388
+ },
1389
+
1390
+ get: async (
1391
+ id: Service.AdjustAccount.Get.ID,
1392
+ params?: Service.AdjustAccount.Get.Params
1393
+ ): Promise<Service.AdjustAccount.Get.Result> => {
1394
+ return await this._fetch(
1395
+ this.svAPIEndpoint,
1396
+ this.adjustInventory._path + `/${id}`,
1397
+ params
1398
+ );
1399
+ },
1400
+
1401
+ create: async (
1402
+ body: Service.AdjustAccount.Create.Body
1403
+ ): Promise<Service.AdjustAccount.Create.Result> => {
1404
+ let res = await this._create(
1405
+ this.svAPIEndpoint,
1406
+ this.adjustInventory._path,
1407
+ body
1408
+ );
1409
+ return res;
1410
+ },
1411
+ };
1412
+
1413
+ inventory = {
1414
+ _path: "/inventory",
1415
+ find: async (
1416
+ params?: Service.Inventory.Find.Params
1417
+ ): Promise<Service.Inventory.Find.Result> => {
1418
+ let res: Service.Inventory.Find.Result = await this._fetch(
1419
+ this.svAPIEndpoint,
1420
+ this.inventory._path,
1421
+ params
1422
+ );
1423
+ return res;
1424
+ },
119
1425
  };
120
1426
  }