repzo 1.0.103 → 1.0.105
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 +642 -1282
- package/lib/index.js +1685 -2692
- package/lib/types/index.d.ts +10259 -11141
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/types/index.ts +13 -12
package/lib/index.js
CHANGED
|
@@ -1,2705 +1,1698 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { v4 as uuid } from "uuid";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
)
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
this.proforma._path,
|
|
1406
|
-
body
|
|
1407
|
-
);
|
|
1408
|
-
return res;
|
|
1409
|
-
},
|
|
1410
|
-
update: async (id, body) => {
|
|
1411
|
-
let res = await this._update(
|
|
1412
|
-
this.svAPIEndpoint,
|
|
1413
|
-
this.proforma._path + `/${id}`,
|
|
1414
|
-
body
|
|
1415
|
-
);
|
|
1416
|
-
return res;
|
|
1417
|
-
},
|
|
1418
|
-
};
|
|
1419
|
-
this.payment = {
|
|
1420
|
-
_path: this._end_points.PAYMENT,
|
|
1421
|
-
find: async (params) => {
|
|
1422
|
-
let res = await this._fetch(
|
|
1423
|
-
this.svAPIEndpoint,
|
|
1424
|
-
this.payment._path,
|
|
1425
|
-
params
|
|
1426
|
-
);
|
|
1427
|
-
return res;
|
|
1428
|
-
},
|
|
1429
|
-
get: async (id, params) => {
|
|
1430
|
-
return await this._fetch(
|
|
1431
|
-
this.svAPIEndpoint,
|
|
1432
|
-
this.payment._path + `/${id}`,
|
|
1433
|
-
params
|
|
1434
|
-
);
|
|
1435
|
-
},
|
|
1436
|
-
create: async (body) => {
|
|
1437
|
-
let res = await this._create(
|
|
1438
|
-
this.svAPIEndpoint,
|
|
1439
|
-
this.payment._path,
|
|
1440
|
-
body
|
|
1441
|
-
);
|
|
1442
|
-
return res;
|
|
1443
|
-
},
|
|
1444
|
-
update: async (id, body) => {
|
|
1445
|
-
let res = await this._update(
|
|
1446
|
-
this.svAPIEndpoint,
|
|
1447
|
-
this.payment._path + `/${id}`,
|
|
1448
|
-
body
|
|
1449
|
-
);
|
|
1450
|
-
return res;
|
|
1451
|
-
},
|
|
1452
|
-
};
|
|
1453
|
-
this.refund = {
|
|
1454
|
-
_path: this._end_points.REFUND,
|
|
1455
|
-
find: async (params) => {
|
|
1456
|
-
let res = await this._fetch(
|
|
1457
|
-
this.svAPIEndpoint,
|
|
1458
|
-
this.refund._path,
|
|
1459
|
-
params
|
|
1460
|
-
);
|
|
1461
|
-
return res;
|
|
1462
|
-
},
|
|
1463
|
-
get: async (id, params) => {
|
|
1464
|
-
return await this._fetch(
|
|
1465
|
-
this.svAPIEndpoint,
|
|
1466
|
-
this.refund._path + `/${id}`,
|
|
1467
|
-
params
|
|
1468
|
-
);
|
|
1469
|
-
},
|
|
1470
|
-
create: async (body) => {
|
|
1471
|
-
let res = await this._create(
|
|
1472
|
-
this.svAPIEndpoint,
|
|
1473
|
-
this.refund._path,
|
|
1474
|
-
body
|
|
1475
|
-
);
|
|
1476
|
-
return res;
|
|
1477
|
-
},
|
|
1478
|
-
update: async (id, body) => {
|
|
1479
|
-
let res = await this._update(
|
|
1480
|
-
this.svAPIEndpoint,
|
|
1481
|
-
this.refund._path + `/${id}`,
|
|
1482
|
-
body
|
|
1483
|
-
);
|
|
1484
|
-
return res;
|
|
1485
|
-
},
|
|
1486
|
-
};
|
|
1487
|
-
this.settlement = {
|
|
1488
|
-
_path: this._end_points.SETTLEMENT,
|
|
1489
|
-
find: async (params) => {
|
|
1490
|
-
let res = await this._fetch(
|
|
1491
|
-
this.svAPIEndpoint,
|
|
1492
|
-
this.settlement._path,
|
|
1493
|
-
params
|
|
1494
|
-
);
|
|
1495
|
-
return res;
|
|
1496
|
-
},
|
|
1497
|
-
get: async (id, params) => {
|
|
1498
|
-
return await this._fetch(
|
|
1499
|
-
this.svAPIEndpoint,
|
|
1500
|
-
this.settlement._path + `/${id}`,
|
|
1501
|
-
params
|
|
1502
|
-
);
|
|
1503
|
-
},
|
|
1504
|
-
create: async (body) => {
|
|
1505
|
-
let res = await this._create(
|
|
1506
|
-
this.svAPIEndpoint,
|
|
1507
|
-
this.settlement._path,
|
|
1508
|
-
body
|
|
1509
|
-
);
|
|
1510
|
-
return res;
|
|
1511
|
-
},
|
|
1512
|
-
};
|
|
1513
|
-
this.check = {
|
|
1514
|
-
_path: this._end_points.CHECK,
|
|
1515
|
-
find: async (params) => {
|
|
1516
|
-
let res = await this._fetch(
|
|
1517
|
-
this.svAPIEndpoint,
|
|
1518
|
-
this.check._path,
|
|
1519
|
-
params
|
|
1520
|
-
);
|
|
1521
|
-
return res;
|
|
1522
|
-
},
|
|
1523
|
-
get: async (id, params) => {
|
|
1524
|
-
return await this._fetch(
|
|
1525
|
-
this.svAPIEndpoint,
|
|
1526
|
-
this.check._path + `/${id}`,
|
|
1527
|
-
params
|
|
1528
|
-
);
|
|
1529
|
-
},
|
|
1530
|
-
create: async (body) => {
|
|
1531
|
-
let res = await this._create(
|
|
1532
|
-
this.svAPIEndpoint,
|
|
1533
|
-
this.check._path,
|
|
1534
|
-
body
|
|
1535
|
-
);
|
|
1536
|
-
return res;
|
|
1537
|
-
},
|
|
1538
|
-
};
|
|
1539
|
-
this.day = {
|
|
1540
|
-
_path: this._end_points.DAY,
|
|
1541
|
-
find: async (params) => {
|
|
1542
|
-
let res = await this._fetch(this.svAPIEndpoint, this.day._path, params);
|
|
1543
|
-
return res;
|
|
1544
|
-
},
|
|
1545
|
-
get: async (id, params) => {
|
|
1546
|
-
return await this._fetch(
|
|
1547
|
-
this.svAPIEndpoint,
|
|
1548
|
-
this.day._path + `/${id}`,
|
|
1549
|
-
params
|
|
1550
|
-
);
|
|
1551
|
-
},
|
|
1552
|
-
create: async (body) => {
|
|
1553
|
-
let res = await this._create(this.svAPIEndpoint, this.day._path, body);
|
|
1554
|
-
return res;
|
|
1555
|
-
},
|
|
1556
|
-
};
|
|
1557
|
-
this.receivingMaterial = {
|
|
1558
|
-
_path: this._end_points.RECEIVING_MATERIAL,
|
|
1559
|
-
find: async (params) => {
|
|
1560
|
-
let res = await this._fetch(
|
|
1561
|
-
this.svAPIEndpoint,
|
|
1562
|
-
this.receivingMaterial._path,
|
|
1563
|
-
params
|
|
1564
|
-
);
|
|
1565
|
-
return res;
|
|
1566
|
-
},
|
|
1567
|
-
get: async (id, params) => {
|
|
1568
|
-
return await this._fetch(
|
|
1569
|
-
this.svAPIEndpoint,
|
|
1570
|
-
this.receivingMaterial._path + `/${id}`,
|
|
1571
|
-
params
|
|
1572
|
-
);
|
|
1573
|
-
},
|
|
1574
|
-
create: async (body) => {
|
|
1575
|
-
let res = await this._create(
|
|
1576
|
-
this.svAPIEndpoint,
|
|
1577
|
-
this.receivingMaterial._path,
|
|
1578
|
-
body
|
|
1579
|
-
);
|
|
1580
|
-
return res;
|
|
1581
|
-
},
|
|
1582
|
-
update: async (id, body) => {
|
|
1583
|
-
let res = await this._update(
|
|
1584
|
-
this.svAPIEndpoint,
|
|
1585
|
-
this.receivingMaterial._path + `/${id}`,
|
|
1586
|
-
body
|
|
1587
|
-
);
|
|
1588
|
-
return res;
|
|
1589
|
-
},
|
|
1590
|
-
};
|
|
1591
|
-
this.adjustAccount = {
|
|
1592
|
-
_path: this._end_points.ADJUST_ACCOUNT,
|
|
1593
|
-
find: async (params) => {
|
|
1594
|
-
let res = await this._fetch(
|
|
1595
|
-
this.svAPIEndpoint,
|
|
1596
|
-
this.adjustAccount._path,
|
|
1597
|
-
params
|
|
1598
|
-
);
|
|
1599
|
-
return res;
|
|
1600
|
-
},
|
|
1601
|
-
get: async (id, params) => {
|
|
1602
|
-
return await this._fetch(
|
|
1603
|
-
this.svAPIEndpoint,
|
|
1604
|
-
this.adjustAccount._path + `/${id}`,
|
|
1605
|
-
params
|
|
1606
|
-
);
|
|
1607
|
-
},
|
|
1608
|
-
create: async (body) => {
|
|
1609
|
-
let res = await this._create(
|
|
1610
|
-
this.svAPIEndpoint,
|
|
1611
|
-
this.adjustAccount._path,
|
|
1612
|
-
body
|
|
1613
|
-
);
|
|
1614
|
-
return res;
|
|
1615
|
-
},
|
|
1616
|
-
};
|
|
1617
|
-
this.transfer = {
|
|
1618
|
-
_path: this._end_points.TRANSFER,
|
|
1619
|
-
find: async (params) => {
|
|
1620
|
-
let res = await this._fetch(
|
|
1621
|
-
this.svAPIEndpoint,
|
|
1622
|
-
this.transfer._path,
|
|
1623
|
-
params
|
|
1624
|
-
);
|
|
1625
|
-
return res;
|
|
1626
|
-
},
|
|
1627
|
-
get: async (id, params) => {
|
|
1628
|
-
return await this._fetch(
|
|
1629
|
-
this.svAPIEndpoint,
|
|
1630
|
-
this.transfer._path + `/${id}`,
|
|
1631
|
-
params
|
|
1632
|
-
);
|
|
1633
|
-
},
|
|
1634
|
-
create: async (body) => {
|
|
1635
|
-
let res = await this._create(
|
|
1636
|
-
this.svAPIEndpoint,
|
|
1637
|
-
this.transfer._path,
|
|
1638
|
-
body
|
|
1639
|
-
);
|
|
1640
|
-
return res;
|
|
1641
|
-
},
|
|
1642
|
-
update: async (id, body) => {
|
|
1643
|
-
let res = await this._update(
|
|
1644
|
-
this.svAPIEndpoint,
|
|
1645
|
-
this.transfer._path + `/${id}`,
|
|
1646
|
-
body
|
|
1647
|
-
);
|
|
1648
|
-
return res;
|
|
1649
|
-
},
|
|
1650
|
-
};
|
|
1651
|
-
this.msl = {
|
|
1652
|
-
_path: this._end_points.MSL,
|
|
1653
|
-
find: async (params) => {
|
|
1654
|
-
let res = await this._fetch(this.svAPIEndpoint, this.msl._path, params);
|
|
1655
|
-
return res;
|
|
1656
|
-
},
|
|
1657
|
-
get: async (id, params) => {
|
|
1658
|
-
return await this._fetch(
|
|
1659
|
-
this.svAPIEndpoint,
|
|
1660
|
-
this.msl._path + `/${id}`,
|
|
1661
|
-
params
|
|
1662
|
-
);
|
|
1663
|
-
},
|
|
1664
|
-
create: async (body) => {
|
|
1665
|
-
let res = await this._create(this.svAPIEndpoint, this.msl._path, body);
|
|
1666
|
-
return res;
|
|
1667
|
-
},
|
|
1668
|
-
update: async (id, body) => {
|
|
1669
|
-
let res = await this._update(
|
|
1670
|
-
this.svAPIEndpoint,
|
|
1671
|
-
this.msl._path + `/${id}`,
|
|
1672
|
-
body
|
|
1673
|
-
);
|
|
1674
|
-
return res;
|
|
1675
|
-
},
|
|
1676
|
-
remove: async (id) => {
|
|
1677
|
-
let res = await this._delete(
|
|
1678
|
-
this.svAPIEndpoint,
|
|
1679
|
-
this.msl._path + `/${id}`
|
|
1680
|
-
);
|
|
1681
|
-
return res;
|
|
1682
|
-
},
|
|
1683
|
-
};
|
|
1684
|
-
this.mslProduct = {
|
|
1685
|
-
_path: this._end_points.MSL_PRODUCT,
|
|
1686
|
-
find: async (params) => {
|
|
1687
|
-
let res = await this._fetch(
|
|
1688
|
-
this.svAPIEndpoint,
|
|
1689
|
-
this.mslProduct._path,
|
|
1690
|
-
params
|
|
1691
|
-
);
|
|
1692
|
-
return res;
|
|
1693
|
-
},
|
|
1694
|
-
get: async (id, params) => {
|
|
1695
|
-
return await this._fetch(
|
|
1696
|
-
this.svAPIEndpoint,
|
|
1697
|
-
this.mslProduct._path + `/${id}`,
|
|
1698
|
-
params
|
|
1699
|
-
);
|
|
1700
|
-
},
|
|
1701
|
-
create: async (body) => {
|
|
1702
|
-
let res = await this._create(
|
|
1703
|
-
this.svAPIEndpoint,
|
|
1704
|
-
this.mslProduct._path,
|
|
1705
|
-
body
|
|
1706
|
-
);
|
|
1707
|
-
return res;
|
|
1708
|
-
},
|
|
1709
|
-
update: async (id, body) => {
|
|
1710
|
-
let res = await this._update(
|
|
1711
|
-
this.svAPIEndpoint,
|
|
1712
|
-
this.mslProduct._path + `/${id}`,
|
|
1713
|
-
body
|
|
1714
|
-
);
|
|
1715
|
-
return res;
|
|
1716
|
-
},
|
|
1717
|
-
remove: async (id) => {
|
|
1718
|
-
let res = await this._delete(
|
|
1719
|
-
this.svAPIEndpoint,
|
|
1720
|
-
this.mslProduct._path + `/${id}`
|
|
1721
|
-
);
|
|
1722
|
-
return res;
|
|
1723
|
-
},
|
|
1724
|
-
};
|
|
1725
|
-
this.mediaStorage = {
|
|
1726
|
-
_path: this._end_points.MEDIA_STORAGE,
|
|
1727
|
-
find: async (params) => {
|
|
1728
|
-
let res = await this._fetch(
|
|
1729
|
-
this.svAPIEndpoint,
|
|
1730
|
-
this.mediaStorage._path,
|
|
1731
|
-
params
|
|
1732
|
-
);
|
|
1733
|
-
return res;
|
|
1734
|
-
},
|
|
1735
|
-
get: async (id, params) => {
|
|
1736
|
-
return await this._fetch(
|
|
1737
|
-
this.svAPIEndpoint,
|
|
1738
|
-
this.mediaStorage._path + `/${id}`,
|
|
1739
|
-
params
|
|
1740
|
-
);
|
|
1741
|
-
},
|
|
1742
|
-
create: async (body) => {
|
|
1743
|
-
let res = await this._create(
|
|
1744
|
-
this.svAPIEndpoint,
|
|
1745
|
-
this.mediaStorage._path,
|
|
1746
|
-
body
|
|
1747
|
-
);
|
|
1748
|
-
return res;
|
|
1749
|
-
},
|
|
1750
|
-
update: async (id, body) => {
|
|
1751
|
-
let res = await this._update(
|
|
1752
|
-
this.svAPIEndpoint,
|
|
1753
|
-
this.mediaStorage._path + `/${id}`,
|
|
1754
|
-
body
|
|
1755
|
-
);
|
|
1756
|
-
return res;
|
|
1757
|
-
},
|
|
1758
|
-
remove: async (id) => {
|
|
1759
|
-
let res = await this._delete(
|
|
1760
|
-
this.svAPIEndpoint,
|
|
1761
|
-
this.mediaStorage._path + `/${id}`
|
|
1762
|
-
);
|
|
1763
|
-
return res;
|
|
1764
|
-
},
|
|
1765
|
-
};
|
|
1766
|
-
this.storecheckTemplate = {
|
|
1767
|
-
_path: this._end_points.STORECHECK_TEMPLATE,
|
|
1768
|
-
find: async (params) => {
|
|
1769
|
-
let res = await this._fetch(
|
|
1770
|
-
this.svAPIEndpoint,
|
|
1771
|
-
this.storecheckTemplate._path,
|
|
1772
|
-
params
|
|
1773
|
-
);
|
|
1774
|
-
return res;
|
|
1775
|
-
},
|
|
1776
|
-
get: async (id, params) => {
|
|
1777
|
-
return await this._fetch(
|
|
1778
|
-
this.svAPIEndpoint,
|
|
1779
|
-
this.storecheckTemplate._path + `/${id}`,
|
|
1780
|
-
params
|
|
1781
|
-
);
|
|
1782
|
-
},
|
|
1783
|
-
create: async (body) => {
|
|
1784
|
-
let res = await this._create(
|
|
1785
|
-
this.svAPIEndpoint,
|
|
1786
|
-
this.storecheckTemplate._path,
|
|
1787
|
-
body
|
|
1788
|
-
);
|
|
1789
|
-
return res;
|
|
1790
|
-
},
|
|
1791
|
-
update: async (id, body) => {
|
|
1792
|
-
let res = await this._update(
|
|
1793
|
-
this.svAPIEndpoint,
|
|
1794
|
-
this.storecheckTemplate._path + `/${id}`,
|
|
1795
|
-
body
|
|
1796
|
-
);
|
|
1797
|
-
return res;
|
|
1798
|
-
},
|
|
1799
|
-
remove: async (id) => {
|
|
1800
|
-
let res = await this._delete(
|
|
1801
|
-
this.svAPIEndpoint,
|
|
1802
|
-
this.storecheckTemplate._path + `/${id}`
|
|
1803
|
-
);
|
|
1804
|
-
return res;
|
|
1805
|
-
},
|
|
1806
|
-
};
|
|
1807
|
-
this.activityStorecheck = {
|
|
1808
|
-
_path: this._end_points.ACTIVITY_STORECHECK,
|
|
1809
|
-
find: async (params) => {
|
|
1810
|
-
let res = await this._fetch(
|
|
1811
|
-
this.svAPIEndpoint,
|
|
1812
|
-
this.activityStorecheck._path,
|
|
1813
|
-
params
|
|
1814
|
-
);
|
|
1815
|
-
return res;
|
|
1816
|
-
},
|
|
1817
|
-
get: async (id, params) => {
|
|
1818
|
-
return await this._fetch(
|
|
1819
|
-
this.svAPIEndpoint,
|
|
1820
|
-
this.activityStorecheck._path + `/${id}`,
|
|
1821
|
-
params
|
|
1822
|
-
);
|
|
1823
|
-
},
|
|
1824
|
-
create: async (body) => {
|
|
1825
|
-
let res = await this._create(
|
|
1826
|
-
this.svAPIEndpoint,
|
|
1827
|
-
this.activityStorecheck._path,
|
|
1828
|
-
body
|
|
1829
|
-
);
|
|
1830
|
-
return res;
|
|
1831
|
-
},
|
|
1832
|
-
update: async (id, body) => {
|
|
1833
|
-
let res = await this._update(
|
|
1834
|
-
this.svAPIEndpoint,
|
|
1835
|
-
this.activityStorecheck._path + `/${id}`,
|
|
1836
|
-
body
|
|
1837
|
-
);
|
|
1838
|
-
return res;
|
|
1839
|
-
},
|
|
1840
|
-
};
|
|
1841
|
-
this.adjustInventory = {
|
|
1842
|
-
_path: this._end_points.ADJUST_INVENTORY,
|
|
1843
|
-
find: async (params) => {
|
|
1844
|
-
let res = await this._fetch(
|
|
1845
|
-
this.svAPIEndpoint,
|
|
1846
|
-
this.adjustInventory._path,
|
|
1847
|
-
params
|
|
1848
|
-
);
|
|
1849
|
-
return res;
|
|
1850
|
-
},
|
|
1851
|
-
get: async (id, params) => {
|
|
1852
|
-
return await this._fetch(
|
|
1853
|
-
this.svAPIEndpoint,
|
|
1854
|
-
this.adjustInventory._path + `/${id}`,
|
|
1855
|
-
params
|
|
1856
|
-
);
|
|
1857
|
-
},
|
|
1858
|
-
create: async (body) => {
|
|
1859
|
-
let res = await this._create(
|
|
1860
|
-
this.svAPIEndpoint,
|
|
1861
|
-
this.adjustInventory._path,
|
|
1862
|
-
body
|
|
1863
|
-
);
|
|
1864
|
-
return res;
|
|
1865
|
-
},
|
|
1866
|
-
};
|
|
1867
|
-
this.inventory = {
|
|
1868
|
-
_path: this._end_points.INVENTORY,
|
|
1869
|
-
find: async (params) => {
|
|
1870
|
-
let res = await this._fetch(
|
|
1871
|
-
this.svAPIEndpoint,
|
|
1872
|
-
this.inventory._path,
|
|
1873
|
-
params
|
|
1874
|
-
);
|
|
1875
|
-
return res;
|
|
1876
|
-
},
|
|
1877
|
-
};
|
|
1878
|
-
this.integrationApp = {
|
|
1879
|
-
_path: this._end_points.INTEGRATION_APP,
|
|
1880
|
-
find: async (params) => {
|
|
1881
|
-
let res = await this._fetch(
|
|
1882
|
-
this.svAPIEndpoint,
|
|
1883
|
-
this.integrationApp._path,
|
|
1884
|
-
params
|
|
1885
|
-
);
|
|
1886
|
-
return res;
|
|
1887
|
-
},
|
|
1888
|
-
get: async (id, params) => {
|
|
1889
|
-
return await this._fetch(
|
|
1890
|
-
this.svAPIEndpoint,
|
|
1891
|
-
this.integrationApp._path + `/${id}`,
|
|
1892
|
-
params
|
|
1893
|
-
);
|
|
1894
|
-
},
|
|
1895
|
-
create: async (body) => {
|
|
1896
|
-
let res = await this._create(
|
|
1897
|
-
this.svAPIEndpoint,
|
|
1898
|
-
this.integrationApp._path,
|
|
1899
|
-
body
|
|
1900
|
-
);
|
|
1901
|
-
return res;
|
|
1902
|
-
},
|
|
1903
|
-
update: async (id, body) => {
|
|
1904
|
-
let res = await this._update(
|
|
1905
|
-
this.svAPIEndpoint,
|
|
1906
|
-
this.integrationApp._path + `/${id}`,
|
|
1907
|
-
body
|
|
1908
|
-
);
|
|
1909
|
-
return res;
|
|
1910
|
-
},
|
|
1911
|
-
};
|
|
1912
|
-
this.joinActionsWebHook = {
|
|
1913
|
-
_path: this._end_points.JOIN_ACTIONS_WEBHOOK,
|
|
1914
|
-
update: async (id, body) => {
|
|
1915
|
-
let res = await this._update(
|
|
1916
|
-
this.svAPIEndpoint,
|
|
1917
|
-
this.joinActionsWebHook._path,
|
|
1918
|
-
body
|
|
1919
|
-
);
|
|
1920
|
-
return res;
|
|
1921
|
-
},
|
|
1922
|
-
};
|
|
1923
|
-
this.patchAction = {
|
|
1924
|
-
_path: this._end_points.PATCH_ACTION,
|
|
1925
|
-
create: async (body, params) => {
|
|
1926
|
-
const res = await this._create(
|
|
1927
|
-
this.svAPIEndpoint,
|
|
1928
|
-
this.patchAction._path,
|
|
1929
|
-
body,
|
|
1930
|
-
params
|
|
1931
|
-
);
|
|
1932
|
-
return res;
|
|
1933
|
-
},
|
|
1934
|
-
update: async (body) => {
|
|
1935
|
-
const res = await this._update(
|
|
1936
|
-
this.svAPIEndpoint,
|
|
1937
|
-
this.patchAction._path,
|
|
1938
|
-
body
|
|
1939
|
-
);
|
|
1940
|
-
return res;
|
|
1941
|
-
},
|
|
1942
|
-
};
|
|
1943
|
-
this.updateIntegrationMeta = {
|
|
1944
|
-
_path: this._end_points.UPDATE_INTEGRATION_META,
|
|
1945
|
-
create: async (body, params) => {
|
|
1946
|
-
let res = await this._create(
|
|
1947
|
-
this.svAPIEndpoint,
|
|
1948
|
-
this.updateIntegrationMeta._path,
|
|
1949
|
-
body,
|
|
1950
|
-
params
|
|
1951
|
-
);
|
|
1952
|
-
return res;
|
|
1953
|
-
},
|
|
1954
|
-
};
|
|
1955
|
-
this.assetPartType = {
|
|
1956
|
-
_path: this._end_points.ASSET_PART_TYPE,
|
|
1957
|
-
find: async (params) => {
|
|
1958
|
-
let res = await this._fetch(
|
|
1959
|
-
this.svAPIEndpoint,
|
|
1960
|
-
this.assetPartType._path,
|
|
1961
|
-
params
|
|
1962
|
-
);
|
|
1963
|
-
return res;
|
|
1964
|
-
},
|
|
1965
|
-
get: async (id) => {
|
|
1966
|
-
return await this._fetch(
|
|
1967
|
-
this.svAPIEndpoint,
|
|
1968
|
-
this.assetPartType._path + `/${id}`
|
|
1969
|
-
);
|
|
1970
|
-
},
|
|
1971
|
-
create: async (body) => {
|
|
1972
|
-
let res = await this._create(
|
|
1973
|
-
this.svAPIEndpoint,
|
|
1974
|
-
this.assetPartType._path,
|
|
1975
|
-
body
|
|
1976
|
-
);
|
|
1977
|
-
return res;
|
|
1978
|
-
},
|
|
1979
|
-
update: async (id, body) => {
|
|
1980
|
-
let res = await this._update(
|
|
1981
|
-
this.svAPIEndpoint,
|
|
1982
|
-
this.assetPartType._path + `/${id}`,
|
|
1983
|
-
body
|
|
1984
|
-
);
|
|
1985
|
-
return res;
|
|
1986
|
-
},
|
|
1987
|
-
remove: async (id) => {
|
|
1988
|
-
let res = await this._delete(
|
|
1989
|
-
this.svAPIEndpoint,
|
|
1990
|
-
this.assetPartType._path + `/${id}`
|
|
1991
|
-
);
|
|
1992
|
-
return res;
|
|
1993
|
-
},
|
|
1994
|
-
};
|
|
1995
|
-
this.assetPart = {
|
|
1996
|
-
_path: this._end_points.ASSET_PART,
|
|
1997
|
-
find: async (params) => {
|
|
1998
|
-
let res = await this._fetch(
|
|
1999
|
-
this.svAPIEndpoint,
|
|
2000
|
-
this.assetPart._path,
|
|
2001
|
-
params
|
|
2002
|
-
);
|
|
2003
|
-
return res;
|
|
2004
|
-
},
|
|
2005
|
-
get: async (id, params) => {
|
|
2006
|
-
return await this._fetch(
|
|
2007
|
-
this.svAPIEndpoint,
|
|
2008
|
-
this.assetPart._path + `/${id}`,
|
|
2009
|
-
params
|
|
2010
|
-
);
|
|
2011
|
-
},
|
|
2012
|
-
create: async (body) => {
|
|
2013
|
-
let res = await this._create(
|
|
2014
|
-
this.svAPIEndpoint,
|
|
2015
|
-
this.assetPart._path,
|
|
2016
|
-
body
|
|
2017
|
-
);
|
|
2018
|
-
return res;
|
|
2019
|
-
},
|
|
2020
|
-
update: async (id, body) => {
|
|
2021
|
-
let res = await this._update(
|
|
2022
|
-
this.svAPIEndpoint,
|
|
2023
|
-
this.assetPart._path + `/${id}`,
|
|
2024
|
-
body
|
|
2025
|
-
);
|
|
2026
|
-
return res;
|
|
2027
|
-
},
|
|
2028
|
-
remove: async (id) => {
|
|
2029
|
-
let res = await this._delete(
|
|
2030
|
-
this.svAPIEndpoint,
|
|
2031
|
-
this.assetPart._path + `/${id}`
|
|
2032
|
-
);
|
|
2033
|
-
return res;
|
|
2034
|
-
},
|
|
2035
|
-
};
|
|
2036
|
-
this.assetPartUnit = {
|
|
2037
|
-
_path: this._end_points.ASSET_PART_UNIT,
|
|
2038
|
-
find: async (params) => {
|
|
2039
|
-
let res = await this._fetch(
|
|
2040
|
-
this.svAPIEndpoint,
|
|
2041
|
-
this.assetPartUnit._path,
|
|
2042
|
-
params
|
|
2043
|
-
);
|
|
2044
|
-
return res;
|
|
2045
|
-
},
|
|
2046
|
-
get: async (id, params) => {
|
|
2047
|
-
return await this._fetch(
|
|
2048
|
-
this.svAPIEndpoint,
|
|
2049
|
-
this.assetPartUnit._path + `/${id}`,
|
|
2050
|
-
params
|
|
2051
|
-
);
|
|
2052
|
-
},
|
|
2053
|
-
update: async (id, body) => {
|
|
2054
|
-
let res = await this._update(
|
|
2055
|
-
this.svAPIEndpoint,
|
|
2056
|
-
this.assetPartUnit._path + `/${id}`,
|
|
2057
|
-
body
|
|
2058
|
-
);
|
|
2059
|
-
return res;
|
|
2060
|
-
},
|
|
2061
|
-
};
|
|
2062
|
-
this.assetPartReceival = {
|
|
2063
|
-
_path: this._end_points.ASSET_PART_RECEIVAL,
|
|
2064
|
-
find: async (params) => {
|
|
2065
|
-
let res = await this._fetch(
|
|
2066
|
-
this.svAPIEndpoint,
|
|
2067
|
-
this.assetPartReceival._path,
|
|
2068
|
-
params
|
|
2069
|
-
);
|
|
2070
|
-
return res;
|
|
2071
|
-
},
|
|
2072
|
-
get: async (id, params) => {
|
|
2073
|
-
return await this._fetch(
|
|
2074
|
-
this.svAPIEndpoint,
|
|
2075
|
-
this.assetPartReceival._path + `/${id}`,
|
|
2076
|
-
params
|
|
2077
|
-
);
|
|
2078
|
-
},
|
|
2079
|
-
create: async (body) => {
|
|
2080
|
-
let res = await this._create(
|
|
2081
|
-
this.svAPIEndpoint,
|
|
2082
|
-
this.assetPartReceival._path,
|
|
2083
|
-
body
|
|
2084
|
-
);
|
|
2085
|
-
return res;
|
|
2086
|
-
},
|
|
2087
|
-
update: async (id, body) => {
|
|
2088
|
-
let res = await this._update(
|
|
2089
|
-
this.svAPIEndpoint,
|
|
2090
|
-
this.assetPartReceival._path + `/${id}`,
|
|
2091
|
-
body
|
|
2092
|
-
);
|
|
2093
|
-
return res;
|
|
2094
|
-
},
|
|
2095
|
-
patch: async (params, body) => {
|
|
2096
|
-
let res = await this._patch(
|
|
2097
|
-
this.svAPIEndpoint,
|
|
2098
|
-
this.assetPartReceival._path,
|
|
2099
|
-
body,
|
|
2100
|
-
params
|
|
2101
|
-
);
|
|
2102
|
-
return res;
|
|
2103
|
-
},
|
|
2104
|
-
};
|
|
2105
|
-
this.assetPartTransfer = {
|
|
2106
|
-
_path: this._end_points.ASSET_PART_TRANSFER,
|
|
2107
|
-
find: async (params) => {
|
|
2108
|
-
let res = await this._fetch(
|
|
2109
|
-
this.svAPIEndpoint,
|
|
2110
|
-
this.assetPartTransfer._path,
|
|
2111
|
-
params
|
|
2112
|
-
);
|
|
2113
|
-
return res;
|
|
2114
|
-
},
|
|
2115
|
-
get: async (id, params) => {
|
|
2116
|
-
return await this._fetch(
|
|
2117
|
-
this.svAPIEndpoint,
|
|
2118
|
-
this.assetPartTransfer._path + `/${id}`,
|
|
2119
|
-
params
|
|
2120
|
-
);
|
|
2121
|
-
},
|
|
2122
|
-
create: async (body) => {
|
|
2123
|
-
let res = await this._create(
|
|
2124
|
-
this.svAPIEndpoint,
|
|
2125
|
-
this.assetPartTransfer._path,
|
|
2126
|
-
body
|
|
2127
|
-
);
|
|
2128
|
-
return res;
|
|
2129
|
-
},
|
|
2130
|
-
update: async (id, body) => {
|
|
2131
|
-
let res = await this._update(
|
|
2132
|
-
this.svAPIEndpoint,
|
|
2133
|
-
this.assetPartTransfer._path + `/${id}`,
|
|
2134
|
-
body
|
|
2135
|
-
);
|
|
2136
|
-
return res;
|
|
2137
|
-
},
|
|
2138
|
-
patch: async (params, body) => {
|
|
2139
|
-
let res = await this._patch(
|
|
2140
|
-
this.svAPIEndpoint,
|
|
2141
|
-
this.assetPartTransfer._path,
|
|
2142
|
-
body,
|
|
2143
|
-
params
|
|
2144
|
-
);
|
|
2145
|
-
return res;
|
|
2146
|
-
},
|
|
2147
|
-
};
|
|
2148
|
-
this.returnAssetPartUnit = {
|
|
2149
|
-
_path: this._end_points.RETURN_ASSET_PART_UNIT,
|
|
2150
|
-
find: async (params) => {
|
|
2151
|
-
let res = await this._fetch(
|
|
2152
|
-
this.svAPIEndpoint,
|
|
2153
|
-
this.returnAssetPartUnit._path,
|
|
2154
|
-
params
|
|
2155
|
-
);
|
|
2156
|
-
return res;
|
|
2157
|
-
},
|
|
2158
|
-
get: async (id, params) => {
|
|
2159
|
-
return await this._fetch(
|
|
2160
|
-
this.svAPIEndpoint,
|
|
2161
|
-
this.returnAssetPartUnit._path + `/${id}`,
|
|
2162
|
-
params
|
|
2163
|
-
);
|
|
2164
|
-
},
|
|
2165
|
-
create: async (body) => {
|
|
2166
|
-
let res = await this._create(
|
|
2167
|
-
this.svAPIEndpoint,
|
|
2168
|
-
this.returnAssetPartUnit._path,
|
|
2169
|
-
body
|
|
2170
|
-
);
|
|
2171
|
-
return res;
|
|
2172
|
-
},
|
|
2173
|
-
update: async (id, body) => {
|
|
2174
|
-
let res = await this._update(
|
|
2175
|
-
this.svAPIEndpoint,
|
|
2176
|
-
this.returnAssetPartUnit._path + `/${id}`,
|
|
2177
|
-
body
|
|
2178
|
-
);
|
|
2179
|
-
return res;
|
|
2180
|
-
},
|
|
2181
|
-
patch: async (params, body) => {
|
|
2182
|
-
let res = await this._patch(
|
|
2183
|
-
this.svAPIEndpoint,
|
|
2184
|
-
this.returnAssetPartUnit._path,
|
|
2185
|
-
body,
|
|
2186
|
-
params
|
|
2187
|
-
);
|
|
2188
|
-
return res;
|
|
2189
|
-
},
|
|
2190
|
-
};
|
|
2191
|
-
this.storeAssetPartUnit = {
|
|
2192
|
-
_path: this._end_points.STORE_ASSET_PART_UNIT,
|
|
2193
|
-
find: async (params) => {
|
|
2194
|
-
let res = await this._fetch(
|
|
2195
|
-
this.svAPIEndpoint,
|
|
2196
|
-
this.storeAssetPartUnit._path,
|
|
2197
|
-
params
|
|
2198
|
-
);
|
|
2199
|
-
return res;
|
|
2200
|
-
},
|
|
2201
|
-
get: async (id, params) => {
|
|
2202
|
-
return await this._fetch(
|
|
2203
|
-
this.svAPIEndpoint,
|
|
2204
|
-
this.storeAssetPartUnit._path + `/${id}`,
|
|
2205
|
-
params
|
|
2206
|
-
);
|
|
2207
|
-
},
|
|
2208
|
-
create: async (body) => {
|
|
2209
|
-
let res = await this._create(
|
|
2210
|
-
this.svAPIEndpoint,
|
|
2211
|
-
this.storeAssetPartUnit._path,
|
|
2212
|
-
body
|
|
2213
|
-
);
|
|
2214
|
-
return res;
|
|
2215
|
-
},
|
|
2216
|
-
update: async (id, body) => {
|
|
2217
|
-
let res = await this._update(
|
|
2218
|
-
this.svAPIEndpoint,
|
|
2219
|
-
this.storeAssetPartUnit._path + `/${id}`,
|
|
2220
|
-
body
|
|
2221
|
-
);
|
|
2222
|
-
return res;
|
|
2223
|
-
},
|
|
2224
|
-
patch: async (params, body) => {
|
|
2225
|
-
let res = await this._patch(
|
|
2226
|
-
this.svAPIEndpoint,
|
|
2227
|
-
this.storeAssetPartUnit._path,
|
|
2228
|
-
body,
|
|
2229
|
-
params
|
|
2230
|
-
);
|
|
2231
|
-
return res;
|
|
2232
|
-
},
|
|
2233
|
-
};
|
|
2234
|
-
this.ocrInvoiceJobTemplate = {
|
|
2235
|
-
_path: this._end_points.OCR_INVOICE_JOB_TEMPLATE,
|
|
2236
|
-
find: async (params) => {
|
|
2237
|
-
let res = await this._fetch(
|
|
2238
|
-
this.svAPIEndpoint,
|
|
2239
|
-
this.ocrInvoiceJobTemplate._path,
|
|
2240
|
-
params
|
|
2241
|
-
);
|
|
2242
|
-
return res;
|
|
2243
|
-
},
|
|
2244
|
-
get: async (id) => {
|
|
2245
|
-
return await this._fetch(
|
|
2246
|
-
this.svAPIEndpoint,
|
|
2247
|
-
this.ocrInvoiceJobTemplate._path + `/${id}`
|
|
2248
|
-
);
|
|
2249
|
-
},
|
|
2250
|
-
create: async (body) => {
|
|
2251
|
-
let res = await this._create(
|
|
2252
|
-
this.svAPIEndpoint,
|
|
2253
|
-
this.ocrInvoiceJobTemplate._path,
|
|
2254
|
-
body
|
|
2255
|
-
);
|
|
2256
|
-
return res;
|
|
2257
|
-
},
|
|
2258
|
-
update: async (id, body) => {
|
|
2259
|
-
let res = await this._update(
|
|
2260
|
-
this.svAPIEndpoint,
|
|
2261
|
-
this.ocrInvoiceJobTemplate._path + `/${id}`,
|
|
2262
|
-
body
|
|
2263
|
-
);
|
|
2264
|
-
return res;
|
|
2265
|
-
},
|
|
2266
|
-
};
|
|
2267
|
-
this.ocrInvoiceJobGroup = {
|
|
2268
|
-
_path: this._end_points.OCR_INVOICE_JOB_GROUP,
|
|
2269
|
-
find: async (params) => {
|
|
2270
|
-
let res = await this._fetch(
|
|
2271
|
-
this.svAPIEndpoint,
|
|
2272
|
-
this.ocrInvoiceJobGroup._path,
|
|
2273
|
-
params
|
|
2274
|
-
);
|
|
2275
|
-
return res;
|
|
2276
|
-
},
|
|
2277
|
-
get: async (id) => {
|
|
2278
|
-
return await this._fetch(
|
|
2279
|
-
this.svAPIEndpoint,
|
|
2280
|
-
this.ocrInvoiceJobGroup._path + `/${id}`
|
|
2281
|
-
);
|
|
2282
|
-
},
|
|
2283
|
-
create: async (body) => {
|
|
2284
|
-
let res = await this._create(
|
|
2285
|
-
this.svAPIEndpoint,
|
|
2286
|
-
this.ocrInvoiceJobGroup._path,
|
|
2287
|
-
body
|
|
2288
|
-
);
|
|
2289
|
-
return res;
|
|
2290
|
-
},
|
|
2291
|
-
};
|
|
2292
|
-
this.activityAiSalesOrder = {
|
|
2293
|
-
_path: this._end_points.ACTIVITY_AI_SALES_ORDER,
|
|
2294
|
-
find: async (params) => {
|
|
2295
|
-
let res = await this._fetch(
|
|
2296
|
-
this.svAPIEndpoint,
|
|
2297
|
-
this.activityAiSalesOrder._path,
|
|
2298
|
-
params
|
|
2299
|
-
);
|
|
2300
|
-
return res;
|
|
2301
|
-
},
|
|
2302
|
-
get: async (id) => {
|
|
2303
|
-
return await this._fetch(
|
|
2304
|
-
this.svAPIEndpoint,
|
|
2305
|
-
this.activityAiSalesOrder._path + `/${id}`
|
|
2306
|
-
);
|
|
2307
|
-
},
|
|
2308
|
-
create: async (body) => {
|
|
2309
|
-
let res = await this._create(
|
|
2310
|
-
this.svAPIEndpoint,
|
|
2311
|
-
this.activityAiSalesOrder._path,
|
|
2312
|
-
body
|
|
2313
|
-
);
|
|
2314
|
-
return res;
|
|
2315
|
-
},
|
|
2316
|
-
};
|
|
2317
|
-
this.ocrInvoiceJob = {
|
|
2318
|
-
_path: this._end_points.OCR_INVOICE_JOB,
|
|
2319
|
-
find: async (params) => {
|
|
2320
|
-
let res = await this._fetch(
|
|
2321
|
-
this.svAPIEndpoint,
|
|
2322
|
-
this.ocrInvoiceJob._path,
|
|
2323
|
-
params
|
|
2324
|
-
);
|
|
2325
|
-
return res;
|
|
2326
|
-
},
|
|
2327
|
-
get: async (id) => {
|
|
2328
|
-
return await this._fetch(
|
|
2329
|
-
this.svAPIEndpoint,
|
|
2330
|
-
this.ocrInvoiceJob._path + `/${id}`
|
|
2331
|
-
);
|
|
2332
|
-
},
|
|
2333
|
-
};
|
|
2334
|
-
this.ocrInvoiceJobPage = {
|
|
2335
|
-
_path: this._end_points.OCR_INVOICE_JOB_PAGE,
|
|
2336
|
-
find: async (params) => {
|
|
2337
|
-
let res = await this._fetch(
|
|
2338
|
-
this.svAPIEndpoint,
|
|
2339
|
-
this.ocrInvoiceJobPage._path,
|
|
2340
|
-
params
|
|
2341
|
-
);
|
|
2342
|
-
return res;
|
|
2343
|
-
},
|
|
2344
|
-
get: async (id) => {
|
|
2345
|
-
return await this._fetch(
|
|
2346
|
-
this.svAPIEndpoint,
|
|
2347
|
-
this.ocrInvoiceJobPage._path + `/${id}`
|
|
2348
|
-
);
|
|
2349
|
-
},
|
|
2350
|
-
update: async (id, body) => {
|
|
2351
|
-
let res = await this._update(
|
|
2352
|
-
this.svAPIEndpoint,
|
|
2353
|
-
this.ocrInvoiceJobPage._path + `/${id}`,
|
|
2354
|
-
body
|
|
2355
|
-
);
|
|
2356
|
-
return res;
|
|
2357
|
-
},
|
|
2358
|
-
};
|
|
2359
|
-
this.svAPIEndpoint =
|
|
2360
|
-
!options?.env || options?.env == "production"
|
|
2361
|
-
? "https://sv.api.repzo.me"
|
|
2362
|
-
: options?.env == "staging"
|
|
2363
|
-
? "https://staging.sv.api.repzo.me"
|
|
2364
|
-
: options?.env == "local"
|
|
2365
|
-
? "http://localhost:3030"
|
|
2366
|
-
: "";
|
|
2367
|
-
this.headers = {
|
|
2368
|
-
"api-key": apiKey,
|
|
2369
|
-
"Content-Type": "application/json",
|
|
2370
|
-
Accept: "application/json",
|
|
2371
|
-
};
|
|
2372
|
-
if (options?.headers) Object.assign(this.headers, options.headers);
|
|
2373
|
-
}
|
|
2374
|
-
async _fetch(baseUrl, path, params) {
|
|
2375
|
-
let res = await axios.get(`${baseUrl}/${path}`, {
|
|
2376
|
-
params,
|
|
2377
|
-
headers: this.headers,
|
|
2378
|
-
});
|
|
2379
|
-
return res.data;
|
|
2380
|
-
}
|
|
2381
|
-
async _create(baseUrl, path, body, params) {
|
|
2382
|
-
let res = await axios.post(`${baseUrl}/${path}`, body, {
|
|
2383
|
-
params,
|
|
2384
|
-
headers: this.headers,
|
|
2385
|
-
});
|
|
2386
|
-
return res.data;
|
|
2387
|
-
}
|
|
2388
|
-
async _update(baseUrl, path, body, params) {
|
|
2389
|
-
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
2390
|
-
params,
|
|
2391
|
-
headers: this.headers,
|
|
2392
|
-
});
|
|
2393
|
-
return res.data;
|
|
2394
|
-
}
|
|
2395
|
-
async _patch(baseUrl, path, body, params) {
|
|
2396
|
-
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
2397
|
-
params,
|
|
2398
|
-
headers: this.headers,
|
|
2399
|
-
});
|
|
2400
|
-
return res.data;
|
|
2401
|
-
}
|
|
2402
|
-
async _delete(baseUrl, path, params) {
|
|
2403
|
-
let res = await axios.delete(`${baseUrl}/${path}`, {
|
|
2404
|
-
params,
|
|
2405
|
-
headers: this.headers,
|
|
2406
|
-
});
|
|
2407
|
-
return res.data;
|
|
2408
|
-
}
|
|
3
|
+
class Repzo {
|
|
4
|
+
constructor(apiKey, options) {
|
|
5
|
+
this._end_points = {
|
|
6
|
+
CLIENT: "client",
|
|
7
|
+
PRODUCT: "product",
|
|
8
|
+
VARIANT: "variant",
|
|
9
|
+
CATEGORY: "product-category",
|
|
10
|
+
SUB_CATEGORY: "product-sub-category",
|
|
11
|
+
BRAND: "product-brand",
|
|
12
|
+
PRODUCT_GROUP: "product-group",
|
|
13
|
+
TAX: "tax",
|
|
14
|
+
MEASUREUNIT: "measureunits",
|
|
15
|
+
MEASUREUNIT_FAMILY: "measureunit-family",
|
|
16
|
+
MEDIA: "media",
|
|
17
|
+
PRICELIST: "pricelists",
|
|
18
|
+
PRICELIST_ITEM: "pricelistsitems",
|
|
19
|
+
TEAM: "teams",
|
|
20
|
+
RETURN_REASON: "return-reason",
|
|
21
|
+
REP: "rep",
|
|
22
|
+
TAG: "tag",
|
|
23
|
+
WAREHOUSE: "warehouse",
|
|
24
|
+
ROUTE: "route",
|
|
25
|
+
PRODUCT_MODIFIERS_GROUP: "product-modifiers-group",
|
|
26
|
+
CHANNEL: "client-channel",
|
|
27
|
+
SPECIALITY: "speciality",
|
|
28
|
+
CLIENT_CONTACT: "client-contact",
|
|
29
|
+
PAYMENT_TERM: "paymentterms",
|
|
30
|
+
BANK: "banks",
|
|
31
|
+
BANK_LIST: "bankslists",
|
|
32
|
+
CUSTOM_STATUS: "custom-status",
|
|
33
|
+
CUSTOM_LIST: "custom-list",
|
|
34
|
+
CUSTOM_LIST_ITEM: "custom-list-item",
|
|
35
|
+
INVENTORY_ADJUSTMENT_REASON: "inventory-adjustment-reason",
|
|
36
|
+
WORKORDER: "workorder",
|
|
37
|
+
SUPPLIER: "supplier",
|
|
38
|
+
QUICK_CONVERT_TO_PDF: "quick-convert-to-pdf",
|
|
39
|
+
VISIT: "visit",
|
|
40
|
+
INVOICE: "fullinvoices",
|
|
41
|
+
PROFORMA: "proforma",
|
|
42
|
+
PAYMENT: "payments",
|
|
43
|
+
REFUND: "refund",
|
|
44
|
+
SETTLEMENT: "settlement",
|
|
45
|
+
CHECK: "checks",
|
|
46
|
+
DAY: "day",
|
|
47
|
+
RECEIVING_MATERIAL: "receiving-material",
|
|
48
|
+
ADJUST_ACCOUNT: "adjust-account",
|
|
49
|
+
TRANSFER: "transfer",
|
|
50
|
+
MSL: "msl",
|
|
51
|
+
MSL_PRODUCT: "msl-products",
|
|
52
|
+
MEDIA_STORAGE: "media-storage",
|
|
53
|
+
STORECHECK_TEMPLATE: "storecheck-template",
|
|
54
|
+
ACTIVITY_STORECHECK: "activity-storecheck",
|
|
55
|
+
ADJUST_INVENTORY: "adjust-inventory",
|
|
56
|
+
INVENTORY: "inventory",
|
|
57
|
+
INTEGRATION_APP: "integration-app",
|
|
58
|
+
JOIN_ACTIONS_WEBHOOK: "svix-integration",
|
|
59
|
+
INTEGRATION_ACTION_LOG: "integration-action-log",
|
|
60
|
+
INTEGRATION_COMMAND_LOG: "integration-command-log",
|
|
61
|
+
PATCH_ACTION: "patch-action",
|
|
62
|
+
UPDATE_INTEGRATION_META: "update-integration-meta",
|
|
63
|
+
ASSET_PART_TYPE: "asset-part-type",
|
|
64
|
+
ASSET_PART: "asset-part",
|
|
65
|
+
ASSET_PART_UNIT: "asset-part-unit",
|
|
66
|
+
ASSET_PART_RECEIVAL: "asset-part-receival",
|
|
67
|
+
ASSET_PART_TRANSFER: "asset-part-transfer",
|
|
68
|
+
RETURN_ASSET_PART_UNIT: "return-asset-part-unit",
|
|
69
|
+
STORE_ASSET_PART_UNIT: "store-asset-part-unit",
|
|
70
|
+
OCR_INVOICE_JOB_TEMPLATE: "ocr-invoice-job-template",
|
|
71
|
+
OCR_INVOICE_JOB_GROUP: "ocr-invoice-job-group",
|
|
72
|
+
ACTIVITY_AI_SALES_ORDER: "activity-ai-sales-order",
|
|
73
|
+
OCR_INVOICE_JOB: "ocr-invoice-job",
|
|
74
|
+
OCR_INVOICE_JOB_PAGE: "ocr-invoice-job-page",
|
|
75
|
+
};
|
|
76
|
+
this.END_POINTS = this._end_points;
|
|
77
|
+
this.client = {
|
|
78
|
+
_path: this._end_points.CLIENT,
|
|
79
|
+
find: async (params) => {
|
|
80
|
+
let res = await this._fetch(this.svAPIEndpoint, this.client._path, params);
|
|
81
|
+
return res;
|
|
82
|
+
},
|
|
83
|
+
get: async (id, params) => {
|
|
84
|
+
return await this._fetch(this.svAPIEndpoint, this.client._path + `/${id}`, params);
|
|
85
|
+
},
|
|
86
|
+
create: async (body) => {
|
|
87
|
+
let res = await this._create(this.svAPIEndpoint, this.client._path, body);
|
|
88
|
+
return res;
|
|
89
|
+
},
|
|
90
|
+
update: async (id, body) => {
|
|
91
|
+
let res = await this._update(this.svAPIEndpoint, this.client._path + `/${id}`, body);
|
|
92
|
+
return res;
|
|
93
|
+
},
|
|
94
|
+
remove: async (id) => {
|
|
95
|
+
let res = await this._delete(this.svAPIEndpoint, this.client._path + `/${id}`);
|
|
96
|
+
return res;
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
this.product = {
|
|
100
|
+
_path: this._end_points.PRODUCT,
|
|
101
|
+
find: async (params) => {
|
|
102
|
+
let res = await this._fetch(this.svAPIEndpoint, this.product._path, params);
|
|
103
|
+
return res;
|
|
104
|
+
},
|
|
105
|
+
get: async (id, params) => {
|
|
106
|
+
return await this._fetch(this.svAPIEndpoint, this.product._path + `/${id}`, params);
|
|
107
|
+
},
|
|
108
|
+
create: async (body) => {
|
|
109
|
+
let res = await this._create(this.svAPIEndpoint, this.product._path, body);
|
|
110
|
+
return res;
|
|
111
|
+
},
|
|
112
|
+
update: async (id, body) => {
|
|
113
|
+
let res = await this._update(this.svAPIEndpoint, this.product._path + `/${id}`, body);
|
|
114
|
+
return res;
|
|
115
|
+
},
|
|
116
|
+
remove: async (id) => {
|
|
117
|
+
let res = await this._delete(this.svAPIEndpoint, this.product._path + `/${id}`);
|
|
118
|
+
return res;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
this.variant = {
|
|
122
|
+
_path: this._end_points.VARIANT,
|
|
123
|
+
find: async (params) => {
|
|
124
|
+
let res = await this._fetch(this.svAPIEndpoint, this.variant._path, params);
|
|
125
|
+
return res;
|
|
126
|
+
},
|
|
127
|
+
get: async (id, params) => {
|
|
128
|
+
return await this._fetch(this.svAPIEndpoint, this.variant._path + `/${id}`, params);
|
|
129
|
+
},
|
|
130
|
+
create: async (body) => {
|
|
131
|
+
let res = await this._create(this.svAPIEndpoint, this.variant._path, body);
|
|
132
|
+
return res;
|
|
133
|
+
},
|
|
134
|
+
update: async (id, body) => {
|
|
135
|
+
let res = await this._update(this.svAPIEndpoint, this.variant._path + `/${id}`, body);
|
|
136
|
+
return res;
|
|
137
|
+
},
|
|
138
|
+
remove: async (id) => {
|
|
139
|
+
let res = await this._delete(this.svAPIEndpoint, this.variant._path + `/${id}`);
|
|
140
|
+
return res;
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
this.category = {
|
|
144
|
+
_path: this._end_points.CATEGORY,
|
|
145
|
+
find: async (params) => {
|
|
146
|
+
let res = await this._fetch(this.svAPIEndpoint, this.category._path, params);
|
|
147
|
+
return res;
|
|
148
|
+
},
|
|
149
|
+
get: async (id) => {
|
|
150
|
+
return await this._fetch(this.svAPIEndpoint, this.category._path + `/${id}`);
|
|
151
|
+
},
|
|
152
|
+
create: async (body) => {
|
|
153
|
+
let res = await this._create(this.svAPIEndpoint, this.category._path, body);
|
|
154
|
+
return res;
|
|
155
|
+
},
|
|
156
|
+
update: async (id, body) => {
|
|
157
|
+
let res = await this._update(this.svAPIEndpoint, this.category._path + `/${id}`, body);
|
|
158
|
+
return res;
|
|
159
|
+
},
|
|
160
|
+
remove: async (id) => {
|
|
161
|
+
let res = await this._delete(this.svAPIEndpoint, this.category._path + `/${id}`);
|
|
162
|
+
return res;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
this.sub_category = {
|
|
166
|
+
_path: this._end_points.SUB_CATEGORY,
|
|
167
|
+
find: async (params) => {
|
|
168
|
+
let res = await this._fetch(this.svAPIEndpoint, this.sub_category._path, params);
|
|
169
|
+
return res;
|
|
170
|
+
},
|
|
171
|
+
get: async (id, params) => {
|
|
172
|
+
return await this._fetch(this.svAPIEndpoint, this.sub_category._path + `/${id}`, params);
|
|
173
|
+
},
|
|
174
|
+
create: async (body) => {
|
|
175
|
+
let res = await this._create(this.svAPIEndpoint, this.sub_category._path, body);
|
|
176
|
+
return res;
|
|
177
|
+
},
|
|
178
|
+
update: async (id, body) => {
|
|
179
|
+
let res = await this._update(this.svAPIEndpoint, this.sub_category._path + `/${id}`, body);
|
|
180
|
+
return res;
|
|
181
|
+
},
|
|
182
|
+
remove: async (id) => {
|
|
183
|
+
let res = await this._delete(this.svAPIEndpoint, this.sub_category._path + `/${id}`);
|
|
184
|
+
return res;
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
this.brand = {
|
|
188
|
+
_path: this._end_points.BRAND,
|
|
189
|
+
find: async (params) => {
|
|
190
|
+
let res = await this._fetch(this.svAPIEndpoint, this.brand._path, params);
|
|
191
|
+
return res;
|
|
192
|
+
},
|
|
193
|
+
get: async (id) => {
|
|
194
|
+
return await this._fetch(this.svAPIEndpoint, this.brand._path + `/${id}`);
|
|
195
|
+
},
|
|
196
|
+
create: async (body) => {
|
|
197
|
+
let res = await this._create(this.svAPIEndpoint, this.brand._path, body);
|
|
198
|
+
return res;
|
|
199
|
+
},
|
|
200
|
+
update: async (id, body) => {
|
|
201
|
+
let res = await this._update(this.svAPIEndpoint, this.brand._path + `/${id}`, body);
|
|
202
|
+
return res;
|
|
203
|
+
},
|
|
204
|
+
remove: async (id) => {
|
|
205
|
+
let res = await this._delete(this.svAPIEndpoint, this.brand._path + `/${id}`);
|
|
206
|
+
return res;
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
this.product_group = {
|
|
210
|
+
_path: this._end_points.PRODUCT_GROUP,
|
|
211
|
+
find: async (params) => {
|
|
212
|
+
let res = await this._fetch(this.svAPIEndpoint, this.product_group._path, params);
|
|
213
|
+
return res;
|
|
214
|
+
},
|
|
215
|
+
get: async (id) => {
|
|
216
|
+
return await this._fetch(this.svAPIEndpoint, this.product_group._path + `/${id}`);
|
|
217
|
+
},
|
|
218
|
+
create: async (body) => {
|
|
219
|
+
let res = await this._create(this.svAPIEndpoint, this.product_group._path, body);
|
|
220
|
+
return res;
|
|
221
|
+
},
|
|
222
|
+
update: async (id, body) => {
|
|
223
|
+
let res = await this._update(this.svAPIEndpoint, this.product_group._path + `/${id}`, body);
|
|
224
|
+
return res;
|
|
225
|
+
},
|
|
226
|
+
remove: async (id) => {
|
|
227
|
+
let res = await this._delete(this.svAPIEndpoint, this.product_group._path + `/${id}`);
|
|
228
|
+
return res;
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
this.tax = {
|
|
232
|
+
_path: this._end_points.TAX,
|
|
233
|
+
find: async (params) => {
|
|
234
|
+
let res = await this._fetch(this.svAPIEndpoint, this.tax._path, params);
|
|
235
|
+
return res;
|
|
236
|
+
},
|
|
237
|
+
get: async (id) => {
|
|
238
|
+
return await this._fetch(this.svAPIEndpoint, this.tax._path + `/${id}`);
|
|
239
|
+
},
|
|
240
|
+
create: async (body) => {
|
|
241
|
+
let res = await this._create(this.svAPIEndpoint, this.tax._path, body);
|
|
242
|
+
return res;
|
|
243
|
+
},
|
|
244
|
+
update: async (id, body) => {
|
|
245
|
+
let res = await this._update(this.svAPIEndpoint, this.tax._path + `/${id}`, body);
|
|
246
|
+
return res;
|
|
247
|
+
},
|
|
248
|
+
remove: async (id) => {
|
|
249
|
+
let res = await this._delete(this.svAPIEndpoint, this.tax._path + `/${id}`);
|
|
250
|
+
return res;
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
this.measureunit = {
|
|
254
|
+
_path: this._end_points.MEASUREUNIT,
|
|
255
|
+
find: async (params) => {
|
|
256
|
+
let res = await this._fetch(this.svAPIEndpoint, this.measureunit._path, params);
|
|
257
|
+
return res;
|
|
258
|
+
},
|
|
259
|
+
get: async (id) => {
|
|
260
|
+
return await this._fetch(this.svAPIEndpoint, this.measureunit._path + `/${id}`);
|
|
261
|
+
},
|
|
262
|
+
create: async (body) => {
|
|
263
|
+
let res = await this._create(this.svAPIEndpoint, this.measureunit._path, body);
|
|
264
|
+
return res;
|
|
265
|
+
},
|
|
266
|
+
update: async (id, body) => {
|
|
267
|
+
let res = await this._update(this.svAPIEndpoint, this.measureunit._path + `/${id}`, body);
|
|
268
|
+
return res;
|
|
269
|
+
},
|
|
270
|
+
remove: async (id) => {
|
|
271
|
+
let res = await this._delete(this.svAPIEndpoint, this.measureunit._path + `/${id}`);
|
|
272
|
+
return res;
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
this.measureunitFamily = {
|
|
276
|
+
_path: this._end_points.MEASUREUNIT_FAMILY,
|
|
277
|
+
find: async (params) => {
|
|
278
|
+
let res = await this._fetch(this.svAPIEndpoint, this.measureunitFamily._path, params);
|
|
279
|
+
return res;
|
|
280
|
+
},
|
|
281
|
+
get: async (id) => {
|
|
282
|
+
return await this._fetch(this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`);
|
|
283
|
+
},
|
|
284
|
+
create: async (body) => {
|
|
285
|
+
let res = await this._create(this.svAPIEndpoint, this.measureunitFamily._path, body);
|
|
286
|
+
return res;
|
|
287
|
+
},
|
|
288
|
+
update: async (id, body) => {
|
|
289
|
+
let res = await this._update(this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`, body);
|
|
290
|
+
return res;
|
|
291
|
+
},
|
|
292
|
+
remove: async (id) => {
|
|
293
|
+
let res = await this._delete(this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`);
|
|
294
|
+
return res;
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
this.media = {
|
|
298
|
+
_path: this._end_points.MEDIA,
|
|
299
|
+
find: async (params) => {
|
|
300
|
+
let res = await this._fetch(this.svAPIEndpoint, this.media._path, params);
|
|
301
|
+
return res;
|
|
302
|
+
},
|
|
303
|
+
get: async (id) => {
|
|
304
|
+
return await this._fetch(this.svAPIEndpoint, this.media._path + `/${id}`);
|
|
305
|
+
},
|
|
306
|
+
create: async (body) => {
|
|
307
|
+
let res = await this._create(this.svAPIEndpoint, this.media._path, body);
|
|
308
|
+
return res;
|
|
309
|
+
},
|
|
310
|
+
update: async (id, body) => {
|
|
311
|
+
let res = await this._update(this.svAPIEndpoint, this.media._path + `/${id}`, body);
|
|
312
|
+
return res;
|
|
313
|
+
},
|
|
314
|
+
remove: async (id) => {
|
|
315
|
+
let res = await this._delete(this.svAPIEndpoint, this.media._path + `/${id}`);
|
|
316
|
+
return res;
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
this.priceList = {
|
|
320
|
+
_path: this._end_points.PRICELIST,
|
|
321
|
+
find: async (params) => {
|
|
322
|
+
let res = await this._fetch(this.svAPIEndpoint, this.priceList._path, params);
|
|
323
|
+
return res;
|
|
324
|
+
},
|
|
325
|
+
get: async (id) => {
|
|
326
|
+
return await this._fetch(this.svAPIEndpoint, this.priceList._path + `/${id}`);
|
|
327
|
+
},
|
|
328
|
+
create: async (body) => {
|
|
329
|
+
let res = await this._create(this.svAPIEndpoint, this.priceList._path, body);
|
|
330
|
+
return res;
|
|
331
|
+
},
|
|
332
|
+
update: async (id, body) => {
|
|
333
|
+
let res = await this._update(this.svAPIEndpoint, this.priceList._path + `/${id}`, body);
|
|
334
|
+
return res;
|
|
335
|
+
},
|
|
336
|
+
remove: async (id) => {
|
|
337
|
+
let res = await this._delete(this.svAPIEndpoint, this.priceList._path + `/${id}`);
|
|
338
|
+
return res;
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
this.priceListItem = {
|
|
342
|
+
_path: this._end_points.PRICELIST_ITEM,
|
|
343
|
+
find: async (params) => {
|
|
344
|
+
let res = await this._fetch(this.svAPIEndpoint, this.priceListItem._path, params);
|
|
345
|
+
return res;
|
|
346
|
+
},
|
|
347
|
+
get: async (id) => {
|
|
348
|
+
return await this._fetch(this.svAPIEndpoint, this.priceListItem._path + `/${id}`);
|
|
349
|
+
},
|
|
350
|
+
create: async (body) => {
|
|
351
|
+
let res = await this._create(this.svAPIEndpoint, this.priceListItem._path, body);
|
|
352
|
+
return res;
|
|
353
|
+
},
|
|
354
|
+
update: async (id, body) => {
|
|
355
|
+
let res = await this._update(this.svAPIEndpoint, this.priceListItem._path + `/${id}`, body);
|
|
356
|
+
return res;
|
|
357
|
+
},
|
|
358
|
+
remove: async (id) => {
|
|
359
|
+
let res = await this._delete(this.svAPIEndpoint, this.priceListItem._path + `/${id}`);
|
|
360
|
+
return res;
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
this.team = {
|
|
364
|
+
_path: this._end_points.TEAM,
|
|
365
|
+
find: async (params) => {
|
|
366
|
+
let res = await this._fetch(this.svAPIEndpoint, this.team._path, params);
|
|
367
|
+
return res;
|
|
368
|
+
},
|
|
369
|
+
get: async (id) => {
|
|
370
|
+
return await this._fetch(this.svAPIEndpoint, this.team._path + `/${id}`);
|
|
371
|
+
},
|
|
372
|
+
create: async (body) => {
|
|
373
|
+
let res = await this._create(this.svAPIEndpoint, this.team._path, body);
|
|
374
|
+
return res;
|
|
375
|
+
},
|
|
376
|
+
update: async (id, body) => {
|
|
377
|
+
let res = await this._update(this.svAPIEndpoint, this.team._path + `/${id}`, body);
|
|
378
|
+
return res;
|
|
379
|
+
},
|
|
380
|
+
remove: async (id) => {
|
|
381
|
+
let res = await this._delete(this.svAPIEndpoint, this.team._path + `/${id}`);
|
|
382
|
+
return res;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
this.returnReason = {
|
|
386
|
+
_path: this._end_points.RETURN_REASON,
|
|
387
|
+
find: async (params) => {
|
|
388
|
+
let res = await this._fetch(this.svAPIEndpoint, this.returnReason._path, params);
|
|
389
|
+
return res;
|
|
390
|
+
},
|
|
391
|
+
get: async (id) => {
|
|
392
|
+
return await this._fetch(this.svAPIEndpoint, this.returnReason._path + `/${id}`);
|
|
393
|
+
},
|
|
394
|
+
create: async (body) => {
|
|
395
|
+
let res = await this._create(this.svAPIEndpoint, this.returnReason._path, body);
|
|
396
|
+
return res;
|
|
397
|
+
},
|
|
398
|
+
update: async (id, body) => {
|
|
399
|
+
let res = await this._update(this.svAPIEndpoint, this.returnReason._path + `/${id}`, body);
|
|
400
|
+
return res;
|
|
401
|
+
},
|
|
402
|
+
remove: async (id) => {
|
|
403
|
+
let res = await this._delete(this.svAPIEndpoint, this.returnReason._path + `/${id}`);
|
|
404
|
+
return res;
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
this.rep = {
|
|
408
|
+
_path: this._end_points.REP,
|
|
409
|
+
find: async (params) => {
|
|
410
|
+
let res = await this._fetch(this.svAPIEndpoint, this.rep._path, params);
|
|
411
|
+
return res;
|
|
412
|
+
},
|
|
413
|
+
get: async (id, params) => {
|
|
414
|
+
return await this._fetch(this.svAPIEndpoint, this.rep._path + `/${id}`, params);
|
|
415
|
+
},
|
|
416
|
+
create: async (body) => {
|
|
417
|
+
let res = await this._create(this.svAPIEndpoint, this.rep._path, body);
|
|
418
|
+
return res;
|
|
419
|
+
},
|
|
420
|
+
update: async (id, body) => {
|
|
421
|
+
let res = await this._update(this.svAPIEndpoint, this.rep._path + `/${id}`, body);
|
|
422
|
+
return res;
|
|
423
|
+
},
|
|
424
|
+
remove: async (id) => {
|
|
425
|
+
let res = await this._delete(this.svAPIEndpoint, this.rep._path + `/${id}`);
|
|
426
|
+
return res;
|
|
427
|
+
},
|
|
428
|
+
};
|
|
429
|
+
this.tag = {
|
|
430
|
+
_path: this._end_points.TAG,
|
|
431
|
+
find: async (params) => {
|
|
432
|
+
let res = await this._fetch(this.svAPIEndpoint, this.tag._path, params);
|
|
433
|
+
return res;
|
|
434
|
+
},
|
|
435
|
+
get: async (id) => {
|
|
436
|
+
return await this._fetch(this.svAPIEndpoint, this.tag._path + `/${id}`);
|
|
437
|
+
},
|
|
438
|
+
create: async (body) => {
|
|
439
|
+
let res = await this._create(this.svAPIEndpoint, this.tag._path, body);
|
|
440
|
+
return res;
|
|
441
|
+
},
|
|
442
|
+
update: async (id, body) => {
|
|
443
|
+
let res = await this._update(this.svAPIEndpoint, this.tag._path + `/${id}`, body);
|
|
444
|
+
return res;
|
|
445
|
+
},
|
|
446
|
+
remove: async (id) => {
|
|
447
|
+
let res = await this._delete(this.svAPIEndpoint, this.tag._path + `/${id}`);
|
|
448
|
+
return res;
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
this.warehouse = {
|
|
452
|
+
_path: this._end_points.WAREHOUSE,
|
|
453
|
+
find: async (params) => {
|
|
454
|
+
let res = await this._fetch(this.svAPIEndpoint, this.warehouse._path, params);
|
|
455
|
+
return res;
|
|
456
|
+
},
|
|
457
|
+
get: async (id) => {
|
|
458
|
+
return await this._fetch(this.svAPIEndpoint, this.warehouse._path + `/${id}`);
|
|
459
|
+
},
|
|
460
|
+
create: async (body) => {
|
|
461
|
+
let res = await this._create(this.svAPIEndpoint, this.warehouse._path, body);
|
|
462
|
+
return res;
|
|
463
|
+
},
|
|
464
|
+
update: async (id, body) => {
|
|
465
|
+
let res = await this._update(this.svAPIEndpoint, this.warehouse._path + `/${id}`, body);
|
|
466
|
+
return res;
|
|
467
|
+
},
|
|
468
|
+
remove: async (id) => {
|
|
469
|
+
let res = await this._delete(this.svAPIEndpoint, this.warehouse._path + `/${id}`);
|
|
470
|
+
return res;
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
this.route = {
|
|
474
|
+
_path: this._end_points.ROUTE,
|
|
475
|
+
find: async (params) => {
|
|
476
|
+
let res = await this._fetch(this.svAPIEndpoint, this.route._path, params);
|
|
477
|
+
return res;
|
|
478
|
+
},
|
|
479
|
+
get: async (id) => {
|
|
480
|
+
return await this._fetch(this.svAPIEndpoint, this.route._path + `/${id}`);
|
|
481
|
+
},
|
|
482
|
+
create: async (body) => {
|
|
483
|
+
let res = await this._create(this.svAPIEndpoint, this.route._path, body);
|
|
484
|
+
return res;
|
|
485
|
+
},
|
|
486
|
+
update: async (id, body) => {
|
|
487
|
+
let res = await this._update(this.svAPIEndpoint, this.route._path + `/${id}`, body);
|
|
488
|
+
return res;
|
|
489
|
+
},
|
|
490
|
+
remove: async (id) => {
|
|
491
|
+
let res = await this._delete(this.svAPIEndpoint, this.route._path + `/${id}`);
|
|
492
|
+
return res;
|
|
493
|
+
},
|
|
494
|
+
};
|
|
495
|
+
this.productModifiersGroup = {
|
|
496
|
+
_path: this._end_points.PRODUCT_MODIFIERS_GROUP,
|
|
497
|
+
find: async (params) => {
|
|
498
|
+
let res = await this._fetch(this.svAPIEndpoint, this.productModifiersGroup._path, params);
|
|
499
|
+
return res;
|
|
500
|
+
},
|
|
501
|
+
get: async (id) => {
|
|
502
|
+
return await this._fetch(this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`);
|
|
503
|
+
},
|
|
504
|
+
create: async (body) => {
|
|
505
|
+
let res = await this._create(this.svAPIEndpoint, this.productModifiersGroup._path, body);
|
|
506
|
+
return res;
|
|
507
|
+
},
|
|
508
|
+
update: async (id, body) => {
|
|
509
|
+
let res = await this._update(this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`, body);
|
|
510
|
+
return res;
|
|
511
|
+
},
|
|
512
|
+
remove: async (id) => {
|
|
513
|
+
let res = await this._delete(this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`);
|
|
514
|
+
return res;
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
this.channel = {
|
|
518
|
+
_path: this._end_points.CHANNEL,
|
|
519
|
+
find: async (params) => {
|
|
520
|
+
let res = await this._fetch(this.svAPIEndpoint, this.channel._path, params);
|
|
521
|
+
return res;
|
|
522
|
+
},
|
|
523
|
+
get: async (id) => {
|
|
524
|
+
return await this._fetch(this.svAPIEndpoint, this.channel._path + `/${id}`);
|
|
525
|
+
},
|
|
526
|
+
create: async (body) => {
|
|
527
|
+
let res = await this._create(this.svAPIEndpoint, this.channel._path, body);
|
|
528
|
+
return res;
|
|
529
|
+
},
|
|
530
|
+
update: async (id, body) => {
|
|
531
|
+
let res = await this._update(this.svAPIEndpoint, this.channel._path + `/${id}`, body);
|
|
532
|
+
return res;
|
|
533
|
+
},
|
|
534
|
+
remove: async (id) => {
|
|
535
|
+
let res = await this._delete(this.svAPIEndpoint, this.channel._path + `/${id}`);
|
|
536
|
+
return res;
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
this.speciality = {
|
|
540
|
+
_path: this._end_points.SPECIALITY,
|
|
541
|
+
find: async (params) => {
|
|
542
|
+
let res = await this._fetch(this.svAPIEndpoint, this.speciality._path, params);
|
|
543
|
+
return res;
|
|
544
|
+
},
|
|
545
|
+
get: async (id) => {
|
|
546
|
+
return await this._fetch(this.svAPIEndpoint, this.speciality._path + `/${id}`);
|
|
547
|
+
},
|
|
548
|
+
create: async (body) => {
|
|
549
|
+
let res = await this._create(this.svAPIEndpoint, this.speciality._path, body);
|
|
550
|
+
return res;
|
|
551
|
+
},
|
|
552
|
+
update: async (id, body) => {
|
|
553
|
+
let res = await this._update(this.svAPIEndpoint, this.speciality._path + `/${id}`, body);
|
|
554
|
+
return res;
|
|
555
|
+
},
|
|
556
|
+
remove: async (id) => {
|
|
557
|
+
let res = await this._delete(this.svAPIEndpoint, this.speciality._path + `/${id}`);
|
|
558
|
+
return res;
|
|
559
|
+
},
|
|
560
|
+
};
|
|
561
|
+
this.clientContact = {
|
|
562
|
+
_path: this._end_points.CLIENT_CONTACT,
|
|
563
|
+
find: async (params) => {
|
|
564
|
+
let res = await this._fetch(this.svAPIEndpoint, this.clientContact._path, params);
|
|
565
|
+
return res;
|
|
566
|
+
},
|
|
567
|
+
get: async (id) => {
|
|
568
|
+
return await this._fetch(this.svAPIEndpoint, this.clientContact._path + `/${id}`);
|
|
569
|
+
},
|
|
570
|
+
create: async (body) => {
|
|
571
|
+
let res = await this._create(this.svAPIEndpoint, this.clientContact._path, body);
|
|
572
|
+
return res;
|
|
573
|
+
},
|
|
574
|
+
update: async (id, body) => {
|
|
575
|
+
let res = await this._update(this.svAPIEndpoint, this.clientContact._path + `/${id}`, body);
|
|
576
|
+
return res;
|
|
577
|
+
},
|
|
578
|
+
remove: async (id) => {
|
|
579
|
+
let res = await this._delete(this.svAPIEndpoint, this.clientContact._path + `/${id}`);
|
|
580
|
+
return res;
|
|
581
|
+
},
|
|
582
|
+
};
|
|
583
|
+
this.paymentTerm = {
|
|
584
|
+
_path: this._end_points.PAYMENT_TERM,
|
|
585
|
+
find: async (params) => {
|
|
586
|
+
let res = await this._fetch(this.svAPIEndpoint, this.paymentTerm._path, params);
|
|
587
|
+
return res;
|
|
588
|
+
},
|
|
589
|
+
get: async (id) => {
|
|
590
|
+
return await this._fetch(this.svAPIEndpoint, this.paymentTerm._path + `/${id}`);
|
|
591
|
+
},
|
|
592
|
+
create: async (body) => {
|
|
593
|
+
let res = await this._create(this.svAPIEndpoint, this.paymentTerm._path, body);
|
|
594
|
+
return res;
|
|
595
|
+
},
|
|
596
|
+
update: async (id, body) => {
|
|
597
|
+
let res = await this._update(this.svAPIEndpoint, this.paymentTerm._path + `/${id}`, body);
|
|
598
|
+
return res;
|
|
599
|
+
},
|
|
600
|
+
remove: async (id) => {
|
|
601
|
+
let res = await this._delete(this.svAPIEndpoint, this.paymentTerm._path + `/${id}`);
|
|
602
|
+
return res;
|
|
603
|
+
},
|
|
604
|
+
};
|
|
605
|
+
this.bank = {
|
|
606
|
+
_path: this._end_points.BANK,
|
|
607
|
+
find: async (params) => {
|
|
608
|
+
let res = await this._fetch(this.svAPIEndpoint, this.bank._path, params);
|
|
609
|
+
return res;
|
|
610
|
+
},
|
|
611
|
+
get: async (id) => {
|
|
612
|
+
return await this._fetch(this.svAPIEndpoint, this.bank._path + `/${id}`);
|
|
613
|
+
},
|
|
614
|
+
create: async (body) => {
|
|
615
|
+
let res = await this._create(this.svAPIEndpoint, this.bank._path, body);
|
|
616
|
+
return res;
|
|
617
|
+
},
|
|
618
|
+
update: async (id, body) => {
|
|
619
|
+
let res = await this._update(this.svAPIEndpoint, this.bank._path + `/${id}`, body);
|
|
620
|
+
return res;
|
|
621
|
+
},
|
|
622
|
+
};
|
|
623
|
+
this.bank_list = {
|
|
624
|
+
_path: this._end_points.BANK_LIST,
|
|
625
|
+
find: async (params) => {
|
|
626
|
+
let res = await this._fetch(this.svAPIEndpoint, this.bank_list._path, params);
|
|
627
|
+
return res;
|
|
628
|
+
},
|
|
629
|
+
get: async (id) => {
|
|
630
|
+
return await this._fetch(this.svAPIEndpoint, this.bank_list._path + `/${id}`);
|
|
631
|
+
},
|
|
632
|
+
create: async (body) => {
|
|
633
|
+
let res = await this._create(this.svAPIEndpoint, this.bank_list._path, body);
|
|
634
|
+
return res;
|
|
635
|
+
},
|
|
636
|
+
update: async (id, body) => {
|
|
637
|
+
let res = await this._update(this.svAPIEndpoint, this.bank_list._path + `/${id}`, body);
|
|
638
|
+
return res;
|
|
639
|
+
},
|
|
640
|
+
};
|
|
641
|
+
this.customStatus = {
|
|
642
|
+
_path: this._end_points.CUSTOM_STATUS,
|
|
643
|
+
find: async (params) => {
|
|
644
|
+
let res = await this._fetch(this.svAPIEndpoint, this.customStatus._path, params);
|
|
645
|
+
return res;
|
|
646
|
+
},
|
|
647
|
+
get: async (id) => {
|
|
648
|
+
return await this._fetch(this.svAPIEndpoint, this.customStatus._path + `/${id}`);
|
|
649
|
+
},
|
|
650
|
+
create: async (body) => {
|
|
651
|
+
let res = await this._create(this.svAPIEndpoint, this.customStatus._path, body);
|
|
652
|
+
return res;
|
|
653
|
+
},
|
|
654
|
+
update: async (id, body) => {
|
|
655
|
+
let res = await this._update(this.svAPIEndpoint, this.customStatus._path + `/${id}`, body);
|
|
656
|
+
return res;
|
|
657
|
+
},
|
|
658
|
+
remove: async (id) => {
|
|
659
|
+
let res = await this._delete(this.svAPIEndpoint, this.customStatus._path + `/${id}`);
|
|
660
|
+
return res;
|
|
661
|
+
},
|
|
662
|
+
};
|
|
663
|
+
this.customList = {
|
|
664
|
+
_path: this._end_points.CUSTOM_LIST,
|
|
665
|
+
find: async (params) => {
|
|
666
|
+
let res = await this._fetch(this.svAPIEndpoint, this.customList._path, params);
|
|
667
|
+
return res;
|
|
668
|
+
},
|
|
669
|
+
get: async (id, params) => {
|
|
670
|
+
return await this._fetch(this.svAPIEndpoint, this.customList._path + `/${id}`, params);
|
|
671
|
+
},
|
|
672
|
+
create: async (body) => {
|
|
673
|
+
let res = await this._create(this.svAPIEndpoint, this.customList._path, body);
|
|
674
|
+
return res;
|
|
675
|
+
},
|
|
676
|
+
update: async (id, body) => {
|
|
677
|
+
let res = await this._update(this.svAPIEndpoint, this.customList._path + `/${id}`, body);
|
|
678
|
+
return res;
|
|
679
|
+
},
|
|
680
|
+
remove: async (id) => {
|
|
681
|
+
let res = await this._delete(this.svAPIEndpoint, this.customList._path + `/${id}`);
|
|
682
|
+
return res;
|
|
683
|
+
},
|
|
684
|
+
};
|
|
685
|
+
this.customListItem = {
|
|
686
|
+
_path: this._end_points.CUSTOM_LIST_ITEM,
|
|
687
|
+
find: async (params) => {
|
|
688
|
+
let res = await this._fetch(this.svAPIEndpoint, this.customListItem._path, params);
|
|
689
|
+
return res;
|
|
690
|
+
},
|
|
691
|
+
get: async (id, params) => {
|
|
692
|
+
return await this._fetch(this.svAPIEndpoint, this.customListItem._path + `/${id}`, params);
|
|
693
|
+
},
|
|
694
|
+
create: async (body) => {
|
|
695
|
+
let res = await this._create(this.svAPIEndpoint, this.customListItem._path, body);
|
|
696
|
+
return res;
|
|
697
|
+
},
|
|
698
|
+
update: async (id, body) => {
|
|
699
|
+
let res = await this._update(this.svAPIEndpoint, this.customListItem._path + `/${id}`, body);
|
|
700
|
+
return res;
|
|
701
|
+
},
|
|
702
|
+
remove: async (id) => {
|
|
703
|
+
let res = await this._delete(this.svAPIEndpoint, this.customListItem._path + `/${id}`);
|
|
704
|
+
return res;
|
|
705
|
+
},
|
|
706
|
+
};
|
|
707
|
+
this.inventoryAdjustmentReason = {
|
|
708
|
+
_path: this._end_points.INVENTORY_ADJUSTMENT_REASON,
|
|
709
|
+
find: async (params) => {
|
|
710
|
+
let res = await this._fetch(this.svAPIEndpoint, this.inventoryAdjustmentReason._path, params);
|
|
711
|
+
return res;
|
|
712
|
+
},
|
|
713
|
+
get: async (id) => {
|
|
714
|
+
return await this._fetch(this.svAPIEndpoint, this.inventoryAdjustmentReason._path + `/${id}`);
|
|
715
|
+
},
|
|
716
|
+
create: async (body) => {
|
|
717
|
+
let res = await this._create(this.svAPIEndpoint, this.inventoryAdjustmentReason._path, body);
|
|
718
|
+
return res;
|
|
719
|
+
},
|
|
720
|
+
update: async (id, body) => {
|
|
721
|
+
let res = await this._update(this.svAPIEndpoint, this.customListItem._path + `/${id}`, body);
|
|
722
|
+
return res;
|
|
723
|
+
},
|
|
724
|
+
remove: async (id) => {
|
|
725
|
+
let res = await this._delete(this.svAPIEndpoint, this.inventoryAdjustmentReason._path + `/${id}`);
|
|
726
|
+
return res;
|
|
727
|
+
},
|
|
728
|
+
};
|
|
729
|
+
this.workorder = {
|
|
730
|
+
_path: this._end_points.WORKORDER,
|
|
731
|
+
find: async (params) => {
|
|
732
|
+
let res = await this._fetch(this.svAPIEndpoint, this.workorder._path, params);
|
|
733
|
+
return res;
|
|
734
|
+
},
|
|
735
|
+
get: async (id, params) => {
|
|
736
|
+
return await this._fetch(this.svAPIEndpoint, this.workorder._path + `/${id}`, params);
|
|
737
|
+
},
|
|
738
|
+
};
|
|
739
|
+
this.supplier = {
|
|
740
|
+
_path: this._end_points.SUPPLIER,
|
|
741
|
+
find: async (params) => {
|
|
742
|
+
let res = await this._fetch(this.svAPIEndpoint, this.supplier._path, params);
|
|
743
|
+
return res;
|
|
744
|
+
},
|
|
745
|
+
get: async (id, params) => {
|
|
746
|
+
return await this._fetch(this.svAPIEndpoint, this.supplier._path + `/${id}`, params);
|
|
747
|
+
},
|
|
748
|
+
create: async (body) => {
|
|
749
|
+
let res = await this._create(this.svAPIEndpoint, this.supplier._path, body);
|
|
750
|
+
return res;
|
|
751
|
+
},
|
|
752
|
+
update: async (id, body) => {
|
|
753
|
+
let res = await this._update(this.svAPIEndpoint, this.supplier._path + `/${id}`, body);
|
|
754
|
+
return res;
|
|
755
|
+
},
|
|
756
|
+
};
|
|
757
|
+
this.quickConvertToPdf = {
|
|
758
|
+
_path: this._end_points.QUICK_CONVERT_TO_PDF,
|
|
759
|
+
find: async (params) => {
|
|
760
|
+
let res = await this._fetch(this.svAPIEndpoint, this.quickConvertToPdf._path, params);
|
|
761
|
+
return res;
|
|
762
|
+
},
|
|
763
|
+
get: async (id, params) => {
|
|
764
|
+
return await this._fetch(this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`, params);
|
|
765
|
+
},
|
|
766
|
+
create: async (body) => {
|
|
767
|
+
let res = await this._create(this.svAPIEndpoint, this.quickConvertToPdf._path, body);
|
|
768
|
+
return res;
|
|
769
|
+
},
|
|
770
|
+
remove: async (id) => {
|
|
771
|
+
let res = await this._delete(this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`);
|
|
772
|
+
return res;
|
|
773
|
+
},
|
|
774
|
+
};
|
|
775
|
+
this.visit = {
|
|
776
|
+
_path: this._end_points.VISIT,
|
|
777
|
+
find: async (params) => {
|
|
778
|
+
let res = await this._fetch(this.svAPIEndpoint, this.visit._path, params);
|
|
779
|
+
return res;
|
|
780
|
+
},
|
|
781
|
+
get: async (id, params) => {
|
|
782
|
+
return await this._fetch(this.svAPIEndpoint, this.visit._path + `/${id}`, params);
|
|
783
|
+
},
|
|
784
|
+
create: async (body) => {
|
|
785
|
+
let res = await this._create(this.svAPIEndpoint, this.visit._path, body);
|
|
786
|
+
return res;
|
|
787
|
+
},
|
|
788
|
+
update: async (id, body) => {
|
|
789
|
+
let res = await this._update(this.svAPIEndpoint, this.visit._path + `/${id}`, body);
|
|
790
|
+
return res;
|
|
791
|
+
},
|
|
792
|
+
};
|
|
793
|
+
this.invoice = {
|
|
794
|
+
_path: this._end_points.INVOICE,
|
|
795
|
+
find: async (params) => {
|
|
796
|
+
let res = await this._fetch(this.svAPIEndpoint, this.invoice._path, params);
|
|
797
|
+
return res;
|
|
798
|
+
},
|
|
799
|
+
get: async (id, params) => {
|
|
800
|
+
return await this._fetch(this.svAPIEndpoint, this.invoice._path + `/${id}`, params);
|
|
801
|
+
},
|
|
802
|
+
create: async (body) => {
|
|
803
|
+
let res = await this._create(this.svAPIEndpoint, this.invoice._path, body);
|
|
804
|
+
return res;
|
|
805
|
+
},
|
|
806
|
+
update: async (id, body) => {
|
|
807
|
+
let res = await this._update(this.svAPIEndpoint, this.invoice._path + `/${id}`, body);
|
|
808
|
+
return res;
|
|
809
|
+
},
|
|
810
|
+
};
|
|
811
|
+
this.proforma = {
|
|
812
|
+
_path: this._end_points.PROFORMA,
|
|
813
|
+
find: async (params) => {
|
|
814
|
+
let res = await this._fetch(this.svAPIEndpoint, this.proforma._path, params);
|
|
815
|
+
return res;
|
|
816
|
+
},
|
|
817
|
+
get: async (id, params) => {
|
|
818
|
+
return await this._fetch(this.svAPIEndpoint, this.proforma._path + `/${id}`, params);
|
|
819
|
+
},
|
|
820
|
+
create: async (body) => {
|
|
821
|
+
let res = await this._create(this.svAPIEndpoint, this.proforma._path, body);
|
|
822
|
+
return res;
|
|
823
|
+
},
|
|
824
|
+
update: async (id, body) => {
|
|
825
|
+
let res = await this._update(this.svAPIEndpoint, this.proforma._path + `/${id}`, body);
|
|
826
|
+
return res;
|
|
827
|
+
},
|
|
828
|
+
};
|
|
829
|
+
this.payment = {
|
|
830
|
+
_path: this._end_points.PAYMENT,
|
|
831
|
+
find: async (params) => {
|
|
832
|
+
let res = await this._fetch(this.svAPIEndpoint, this.payment._path, params);
|
|
833
|
+
return res;
|
|
834
|
+
},
|
|
835
|
+
get: async (id, params) => {
|
|
836
|
+
return await this._fetch(this.svAPIEndpoint, this.payment._path + `/${id}`, params);
|
|
837
|
+
},
|
|
838
|
+
create: async (body) => {
|
|
839
|
+
let res = await this._create(this.svAPIEndpoint, this.payment._path, body);
|
|
840
|
+
return res;
|
|
841
|
+
},
|
|
842
|
+
update: async (id, body) => {
|
|
843
|
+
let res = await this._update(this.svAPIEndpoint, this.payment._path + `/${id}`, body);
|
|
844
|
+
return res;
|
|
845
|
+
},
|
|
846
|
+
};
|
|
847
|
+
this.refund = {
|
|
848
|
+
_path: this._end_points.REFUND,
|
|
849
|
+
find: async (params) => {
|
|
850
|
+
let res = await this._fetch(this.svAPIEndpoint, this.refund._path, params);
|
|
851
|
+
return res;
|
|
852
|
+
},
|
|
853
|
+
get: async (id, params) => {
|
|
854
|
+
return await this._fetch(this.svAPIEndpoint, this.refund._path + `/${id}`, params);
|
|
855
|
+
},
|
|
856
|
+
create: async (body) => {
|
|
857
|
+
let res = await this._create(this.svAPIEndpoint, this.refund._path, body);
|
|
858
|
+
return res;
|
|
859
|
+
},
|
|
860
|
+
update: async (id, body) => {
|
|
861
|
+
let res = await this._update(this.svAPIEndpoint, this.refund._path + `/${id}`, body);
|
|
862
|
+
return res;
|
|
863
|
+
},
|
|
864
|
+
};
|
|
865
|
+
this.settlement = {
|
|
866
|
+
_path: this._end_points.SETTLEMENT,
|
|
867
|
+
find: async (params) => {
|
|
868
|
+
let res = await this._fetch(this.svAPIEndpoint, this.settlement._path, params);
|
|
869
|
+
return res;
|
|
870
|
+
},
|
|
871
|
+
get: async (id, params) => {
|
|
872
|
+
return await this._fetch(this.svAPIEndpoint, this.settlement._path + `/${id}`, params);
|
|
873
|
+
},
|
|
874
|
+
create: async (body) => {
|
|
875
|
+
let res = await this._create(this.svAPIEndpoint, this.settlement._path, body);
|
|
876
|
+
return res;
|
|
877
|
+
},
|
|
878
|
+
};
|
|
879
|
+
this.check = {
|
|
880
|
+
_path: this._end_points.CHECK,
|
|
881
|
+
find: async (params) => {
|
|
882
|
+
let res = await this._fetch(this.svAPIEndpoint, this.check._path, params);
|
|
883
|
+
return res;
|
|
884
|
+
},
|
|
885
|
+
get: async (id, params) => {
|
|
886
|
+
return await this._fetch(this.svAPIEndpoint, this.check._path + `/${id}`, params);
|
|
887
|
+
},
|
|
888
|
+
create: async (body) => {
|
|
889
|
+
let res = await this._create(this.svAPIEndpoint, this.check._path, body);
|
|
890
|
+
return res;
|
|
891
|
+
},
|
|
892
|
+
};
|
|
893
|
+
this.day = {
|
|
894
|
+
_path: this._end_points.DAY,
|
|
895
|
+
find: async (params) => {
|
|
896
|
+
let res = await this._fetch(this.svAPIEndpoint, this.day._path, params);
|
|
897
|
+
return res;
|
|
898
|
+
},
|
|
899
|
+
get: async (id, params) => {
|
|
900
|
+
return await this._fetch(this.svAPIEndpoint, this.day._path + `/${id}`, params);
|
|
901
|
+
},
|
|
902
|
+
create: async (body) => {
|
|
903
|
+
let res = await this._create(this.svAPIEndpoint, this.day._path, body);
|
|
904
|
+
return res;
|
|
905
|
+
},
|
|
906
|
+
};
|
|
907
|
+
this.receivingMaterial = {
|
|
908
|
+
_path: this._end_points.RECEIVING_MATERIAL,
|
|
909
|
+
find: async (params) => {
|
|
910
|
+
let res = await this._fetch(this.svAPIEndpoint, this.receivingMaterial._path, params);
|
|
911
|
+
return res;
|
|
912
|
+
},
|
|
913
|
+
get: async (id, params) => {
|
|
914
|
+
return await this._fetch(this.svAPIEndpoint, this.receivingMaterial._path + `/${id}`, params);
|
|
915
|
+
},
|
|
916
|
+
create: async (body) => {
|
|
917
|
+
let res = await this._create(this.svAPIEndpoint, this.receivingMaterial._path, body);
|
|
918
|
+
return res;
|
|
919
|
+
},
|
|
920
|
+
update: async (id, body) => {
|
|
921
|
+
let res = await this._update(this.svAPIEndpoint, this.receivingMaterial._path + `/${id}`, body);
|
|
922
|
+
return res;
|
|
923
|
+
},
|
|
924
|
+
};
|
|
925
|
+
this.adjustAccount = {
|
|
926
|
+
_path: this._end_points.ADJUST_ACCOUNT,
|
|
927
|
+
find: async (params) => {
|
|
928
|
+
let res = await this._fetch(this.svAPIEndpoint, this.adjustAccount._path, params);
|
|
929
|
+
return res;
|
|
930
|
+
},
|
|
931
|
+
get: async (id, params) => {
|
|
932
|
+
return await this._fetch(this.svAPIEndpoint, this.adjustAccount._path + `/${id}`, params);
|
|
933
|
+
},
|
|
934
|
+
create: async (body) => {
|
|
935
|
+
let res = await this._create(this.svAPIEndpoint, this.adjustAccount._path, body);
|
|
936
|
+
return res;
|
|
937
|
+
},
|
|
938
|
+
};
|
|
939
|
+
this.transfer = {
|
|
940
|
+
_path: this._end_points.TRANSFER,
|
|
941
|
+
find: async (params) => {
|
|
942
|
+
let res = await this._fetch(this.svAPIEndpoint, this.transfer._path, params);
|
|
943
|
+
return res;
|
|
944
|
+
},
|
|
945
|
+
get: async (id, params) => {
|
|
946
|
+
return await this._fetch(this.svAPIEndpoint, this.transfer._path + `/${id}`, params);
|
|
947
|
+
},
|
|
948
|
+
create: async (body) => {
|
|
949
|
+
let res = await this._create(this.svAPIEndpoint, this.transfer._path, body);
|
|
950
|
+
return res;
|
|
951
|
+
},
|
|
952
|
+
update: async (id, body) => {
|
|
953
|
+
let res = await this._update(this.svAPIEndpoint, this.transfer._path + `/${id}`, body);
|
|
954
|
+
return res;
|
|
955
|
+
},
|
|
956
|
+
};
|
|
957
|
+
this.msl = {
|
|
958
|
+
_path: this._end_points.MSL,
|
|
959
|
+
find: async (params) => {
|
|
960
|
+
let res = await this._fetch(this.svAPIEndpoint, this.msl._path, params);
|
|
961
|
+
return res;
|
|
962
|
+
},
|
|
963
|
+
get: async (id, params) => {
|
|
964
|
+
return await this._fetch(this.svAPIEndpoint, this.msl._path + `/${id}`, params);
|
|
965
|
+
},
|
|
966
|
+
create: async (body) => {
|
|
967
|
+
let res = await this._create(this.svAPIEndpoint, this.msl._path, body);
|
|
968
|
+
return res;
|
|
969
|
+
},
|
|
970
|
+
update: async (id, body) => {
|
|
971
|
+
let res = await this._update(this.svAPIEndpoint, this.msl._path + `/${id}`, body);
|
|
972
|
+
return res;
|
|
973
|
+
},
|
|
974
|
+
remove: async (id) => {
|
|
975
|
+
let res = await this._delete(this.svAPIEndpoint, this.msl._path + `/${id}`);
|
|
976
|
+
return res;
|
|
977
|
+
},
|
|
978
|
+
};
|
|
979
|
+
this.mslProduct = {
|
|
980
|
+
_path: this._end_points.MSL_PRODUCT,
|
|
981
|
+
find: async (params) => {
|
|
982
|
+
let res = await this._fetch(this.svAPIEndpoint, this.mslProduct._path, params);
|
|
983
|
+
return res;
|
|
984
|
+
},
|
|
985
|
+
get: async (id, params) => {
|
|
986
|
+
return await this._fetch(this.svAPIEndpoint, this.mslProduct._path + `/${id}`, params);
|
|
987
|
+
},
|
|
988
|
+
create: async (body) => {
|
|
989
|
+
let res = await this._create(this.svAPIEndpoint, this.mslProduct._path, body);
|
|
990
|
+
return res;
|
|
991
|
+
},
|
|
992
|
+
update: async (id, body) => {
|
|
993
|
+
let res = await this._update(this.svAPIEndpoint, this.mslProduct._path + `/${id}`, body);
|
|
994
|
+
return res;
|
|
995
|
+
},
|
|
996
|
+
remove: async (id) => {
|
|
997
|
+
let res = await this._delete(this.svAPIEndpoint, this.mslProduct._path + `/${id}`);
|
|
998
|
+
return res;
|
|
999
|
+
},
|
|
1000
|
+
};
|
|
1001
|
+
this.mediaStorage = {
|
|
1002
|
+
_path: this._end_points.MEDIA_STORAGE,
|
|
1003
|
+
find: async (params) => {
|
|
1004
|
+
let res = await this._fetch(this.svAPIEndpoint, this.mediaStorage._path, params);
|
|
1005
|
+
return res;
|
|
1006
|
+
},
|
|
1007
|
+
get: async (id, params) => {
|
|
1008
|
+
return await this._fetch(this.svAPIEndpoint, this.mediaStorage._path + `/${id}`, params);
|
|
1009
|
+
},
|
|
1010
|
+
create: async (body) => {
|
|
1011
|
+
let res = await this._create(this.svAPIEndpoint, this.mediaStorage._path, body);
|
|
1012
|
+
return res;
|
|
1013
|
+
},
|
|
1014
|
+
update: async (id, body) => {
|
|
1015
|
+
let res = await this._update(this.svAPIEndpoint, this.mediaStorage._path + `/${id}`, body);
|
|
1016
|
+
return res;
|
|
1017
|
+
},
|
|
1018
|
+
remove: async (id) => {
|
|
1019
|
+
let res = await this._delete(this.svAPIEndpoint, this.mediaStorage._path + `/${id}`);
|
|
1020
|
+
return res;
|
|
1021
|
+
},
|
|
1022
|
+
};
|
|
1023
|
+
this.storecheckTemplate = {
|
|
1024
|
+
_path: this._end_points.STORECHECK_TEMPLATE,
|
|
1025
|
+
find: async (params) => {
|
|
1026
|
+
let res = await this._fetch(this.svAPIEndpoint, this.storecheckTemplate._path, params);
|
|
1027
|
+
return res;
|
|
1028
|
+
},
|
|
1029
|
+
get: async (id, params) => {
|
|
1030
|
+
return await this._fetch(this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`, params);
|
|
1031
|
+
},
|
|
1032
|
+
create: async (body) => {
|
|
1033
|
+
let res = await this._create(this.svAPIEndpoint, this.storecheckTemplate._path, body);
|
|
1034
|
+
return res;
|
|
1035
|
+
},
|
|
1036
|
+
update: async (id, body) => {
|
|
1037
|
+
let res = await this._update(this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`, body);
|
|
1038
|
+
return res;
|
|
1039
|
+
},
|
|
1040
|
+
remove: async (id) => {
|
|
1041
|
+
let res = await this._delete(this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`);
|
|
1042
|
+
return res;
|
|
1043
|
+
},
|
|
1044
|
+
};
|
|
1045
|
+
this.activityStorecheck = {
|
|
1046
|
+
_path: this._end_points.ACTIVITY_STORECHECK,
|
|
1047
|
+
find: async (params) => {
|
|
1048
|
+
let res = await this._fetch(this.svAPIEndpoint, this.activityStorecheck._path, params);
|
|
1049
|
+
return res;
|
|
1050
|
+
},
|
|
1051
|
+
get: async (id, params) => {
|
|
1052
|
+
return await this._fetch(this.svAPIEndpoint, this.activityStorecheck._path + `/${id}`, params);
|
|
1053
|
+
},
|
|
1054
|
+
create: async (body) => {
|
|
1055
|
+
let res = await this._create(this.svAPIEndpoint, this.activityStorecheck._path, body);
|
|
1056
|
+
return res;
|
|
1057
|
+
},
|
|
1058
|
+
update: async (id, body) => {
|
|
1059
|
+
let res = await this._update(this.svAPIEndpoint, this.activityStorecheck._path + `/${id}`, body);
|
|
1060
|
+
return res;
|
|
1061
|
+
},
|
|
1062
|
+
};
|
|
1063
|
+
this.adjustInventory = {
|
|
1064
|
+
_path: this._end_points.ADJUST_INVENTORY,
|
|
1065
|
+
find: async (params) => {
|
|
1066
|
+
let res = await this._fetch(this.svAPIEndpoint, this.adjustInventory._path, params);
|
|
1067
|
+
return res;
|
|
1068
|
+
},
|
|
1069
|
+
get: async (id, params) => {
|
|
1070
|
+
return await this._fetch(this.svAPIEndpoint, this.adjustInventory._path + `/${id}`, params);
|
|
1071
|
+
},
|
|
1072
|
+
create: async (body) => {
|
|
1073
|
+
let res = await this._create(this.svAPIEndpoint, this.adjustInventory._path, body);
|
|
1074
|
+
return res;
|
|
1075
|
+
},
|
|
1076
|
+
};
|
|
1077
|
+
this.inventory = {
|
|
1078
|
+
_path: this._end_points.INVENTORY,
|
|
1079
|
+
find: async (params) => {
|
|
1080
|
+
let res = await this._fetch(this.svAPIEndpoint, this.inventory._path, params);
|
|
1081
|
+
return res;
|
|
1082
|
+
},
|
|
1083
|
+
};
|
|
1084
|
+
this.integrationApp = {
|
|
1085
|
+
_path: this._end_points.INTEGRATION_APP,
|
|
1086
|
+
find: async (params) => {
|
|
1087
|
+
let res = await this._fetch(this.svAPIEndpoint, this.integrationApp._path, params);
|
|
1088
|
+
return res;
|
|
1089
|
+
},
|
|
1090
|
+
get: async (id, params) => {
|
|
1091
|
+
return await this._fetch(this.svAPIEndpoint, this.integrationApp._path + `/${id}`, params);
|
|
1092
|
+
},
|
|
1093
|
+
create: async (body) => {
|
|
1094
|
+
let res = await this._create(this.svAPIEndpoint, this.integrationApp._path, body);
|
|
1095
|
+
return res;
|
|
1096
|
+
},
|
|
1097
|
+
update: async (id, body) => {
|
|
1098
|
+
let res = await this._update(this.svAPIEndpoint, this.integrationApp._path + `/${id}`, body);
|
|
1099
|
+
return res;
|
|
1100
|
+
},
|
|
1101
|
+
};
|
|
1102
|
+
this.joinActionsWebHook = {
|
|
1103
|
+
_path: this._end_points.JOIN_ACTIONS_WEBHOOK,
|
|
1104
|
+
update: async (id, body) => {
|
|
1105
|
+
let res = await this._update(this.svAPIEndpoint, this.joinActionsWebHook._path, body);
|
|
1106
|
+
return res;
|
|
1107
|
+
},
|
|
1108
|
+
};
|
|
1109
|
+
this.patchAction = {
|
|
1110
|
+
_path: this._end_points.PATCH_ACTION,
|
|
1111
|
+
create: async (body, params) => {
|
|
1112
|
+
const res = await this._create(this.svAPIEndpoint, this.patchAction._path, body, params);
|
|
1113
|
+
return res;
|
|
1114
|
+
},
|
|
1115
|
+
update: async (body) => {
|
|
1116
|
+
const res = await this._update(this.svAPIEndpoint, this.patchAction._path, body);
|
|
1117
|
+
return res;
|
|
1118
|
+
},
|
|
1119
|
+
};
|
|
1120
|
+
this.updateIntegrationMeta = {
|
|
1121
|
+
_path: this._end_points.UPDATE_INTEGRATION_META,
|
|
1122
|
+
create: async (body, params) => {
|
|
1123
|
+
let res = await this._create(this.svAPIEndpoint, this.updateIntegrationMeta._path, body, params);
|
|
1124
|
+
return res;
|
|
1125
|
+
},
|
|
1126
|
+
};
|
|
1127
|
+
this.assetPartType = {
|
|
1128
|
+
_path: this._end_points.ASSET_PART_TYPE,
|
|
1129
|
+
find: async (params) => {
|
|
1130
|
+
let res = await this._fetch(this.svAPIEndpoint, this.assetPartType._path, params);
|
|
1131
|
+
return res;
|
|
1132
|
+
},
|
|
1133
|
+
get: async (id) => {
|
|
1134
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartType._path + `/${id}`);
|
|
1135
|
+
},
|
|
1136
|
+
create: async (body) => {
|
|
1137
|
+
let res = await this._create(this.svAPIEndpoint, this.assetPartType._path, body);
|
|
1138
|
+
return res;
|
|
1139
|
+
},
|
|
1140
|
+
update: async (id, body) => {
|
|
1141
|
+
let res = await this._update(this.svAPIEndpoint, this.assetPartType._path + `/${id}`, body);
|
|
1142
|
+
return res;
|
|
1143
|
+
},
|
|
1144
|
+
remove: async (id) => {
|
|
1145
|
+
let res = await this._delete(this.svAPIEndpoint, this.assetPartType._path + `/${id}`);
|
|
1146
|
+
return res;
|
|
1147
|
+
},
|
|
1148
|
+
};
|
|
1149
|
+
this.assetPart = {
|
|
1150
|
+
_path: this._end_points.ASSET_PART,
|
|
1151
|
+
find: async (params) => {
|
|
1152
|
+
let res = await this._fetch(this.svAPIEndpoint, this.assetPart._path, params);
|
|
1153
|
+
return res;
|
|
1154
|
+
},
|
|
1155
|
+
get: async (id, params) => {
|
|
1156
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPart._path + `/${id}`, params);
|
|
1157
|
+
},
|
|
1158
|
+
create: async (body) => {
|
|
1159
|
+
let res = await this._create(this.svAPIEndpoint, this.assetPart._path, body);
|
|
1160
|
+
return res;
|
|
1161
|
+
},
|
|
1162
|
+
update: async (id, body) => {
|
|
1163
|
+
let res = await this._update(this.svAPIEndpoint, this.assetPart._path + `/${id}`, body);
|
|
1164
|
+
return res;
|
|
1165
|
+
},
|
|
1166
|
+
remove: async (id) => {
|
|
1167
|
+
let res = await this._delete(this.svAPIEndpoint, this.assetPart._path + `/${id}`);
|
|
1168
|
+
return res;
|
|
1169
|
+
},
|
|
1170
|
+
};
|
|
1171
|
+
this.assetPartUnit = {
|
|
1172
|
+
_path: this._end_points.ASSET_PART_UNIT,
|
|
1173
|
+
find: async (params) => {
|
|
1174
|
+
let res = await this._fetch(this.svAPIEndpoint, this.assetPartUnit._path, params);
|
|
1175
|
+
return res;
|
|
1176
|
+
},
|
|
1177
|
+
get: async (id, params) => {
|
|
1178
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartUnit._path + `/${id}`, params);
|
|
1179
|
+
},
|
|
1180
|
+
update: async (id, body) => {
|
|
1181
|
+
let res = await this._update(this.svAPIEndpoint, this.assetPartUnit._path + `/${id}`, body);
|
|
1182
|
+
return res;
|
|
1183
|
+
},
|
|
1184
|
+
};
|
|
1185
|
+
this.assetPartReceival = {
|
|
1186
|
+
_path: this._end_points.ASSET_PART_RECEIVAL,
|
|
1187
|
+
find: async (params) => {
|
|
1188
|
+
let res = await this._fetch(this.svAPIEndpoint, this.assetPartReceival._path, params);
|
|
1189
|
+
return res;
|
|
1190
|
+
},
|
|
1191
|
+
get: async (id, params) => {
|
|
1192
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartReceival._path + `/${id}`, params);
|
|
1193
|
+
},
|
|
1194
|
+
create: async (body) => {
|
|
1195
|
+
let res = await this._create(this.svAPIEndpoint, this.assetPartReceival._path, body);
|
|
1196
|
+
return res;
|
|
1197
|
+
},
|
|
1198
|
+
update: async (id, body) => {
|
|
1199
|
+
let res = await this._update(this.svAPIEndpoint, this.assetPartReceival._path + `/${id}`, body);
|
|
1200
|
+
return res;
|
|
1201
|
+
},
|
|
1202
|
+
patch: async (params, body) => {
|
|
1203
|
+
let res = await this._patch(this.svAPIEndpoint, this.assetPartReceival._path, body, params);
|
|
1204
|
+
return res;
|
|
1205
|
+
},
|
|
1206
|
+
};
|
|
1207
|
+
this.assetPartTransfer = {
|
|
1208
|
+
_path: this._end_points.ASSET_PART_TRANSFER,
|
|
1209
|
+
find: async (params) => {
|
|
1210
|
+
let res = await this._fetch(this.svAPIEndpoint, this.assetPartTransfer._path, params);
|
|
1211
|
+
return res;
|
|
1212
|
+
},
|
|
1213
|
+
get: async (id, params) => {
|
|
1214
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartTransfer._path + `/${id}`, params);
|
|
1215
|
+
},
|
|
1216
|
+
create: async (body) => {
|
|
1217
|
+
let res = await this._create(this.svAPIEndpoint, this.assetPartTransfer._path, body);
|
|
1218
|
+
return res;
|
|
1219
|
+
},
|
|
1220
|
+
update: async (id, body) => {
|
|
1221
|
+
let res = await this._update(this.svAPIEndpoint, this.assetPartTransfer._path + `/${id}`, body);
|
|
1222
|
+
return res;
|
|
1223
|
+
},
|
|
1224
|
+
patch: async (params, body) => {
|
|
1225
|
+
let res = await this._patch(this.svAPIEndpoint, this.assetPartTransfer._path, body, params);
|
|
1226
|
+
return res;
|
|
1227
|
+
},
|
|
1228
|
+
};
|
|
1229
|
+
this.returnAssetPartUnit = {
|
|
1230
|
+
_path: this._end_points.RETURN_ASSET_PART_UNIT,
|
|
1231
|
+
find: async (params) => {
|
|
1232
|
+
let res = await this._fetch(this.svAPIEndpoint, this.returnAssetPartUnit._path, params);
|
|
1233
|
+
return res;
|
|
1234
|
+
},
|
|
1235
|
+
get: async (id, params) => {
|
|
1236
|
+
return await this._fetch(this.svAPIEndpoint, this.returnAssetPartUnit._path + `/${id}`, params);
|
|
1237
|
+
},
|
|
1238
|
+
create: async (body) => {
|
|
1239
|
+
let res = await this._create(this.svAPIEndpoint, this.returnAssetPartUnit._path, body);
|
|
1240
|
+
return res;
|
|
1241
|
+
},
|
|
1242
|
+
update: async (id, body) => {
|
|
1243
|
+
let res = await this._update(this.svAPIEndpoint, this.returnAssetPartUnit._path + `/${id}`, body);
|
|
1244
|
+
return res;
|
|
1245
|
+
},
|
|
1246
|
+
patch: async (params, body) => {
|
|
1247
|
+
let res = await this._patch(this.svAPIEndpoint, this.returnAssetPartUnit._path, body, params);
|
|
1248
|
+
return res;
|
|
1249
|
+
},
|
|
1250
|
+
};
|
|
1251
|
+
this.storeAssetPartUnit = {
|
|
1252
|
+
_path: this._end_points.STORE_ASSET_PART_UNIT,
|
|
1253
|
+
find: async (params) => {
|
|
1254
|
+
let res = await this._fetch(this.svAPIEndpoint, this.storeAssetPartUnit._path, params);
|
|
1255
|
+
return res;
|
|
1256
|
+
},
|
|
1257
|
+
get: async (id, params) => {
|
|
1258
|
+
return await this._fetch(this.svAPIEndpoint, this.storeAssetPartUnit._path + `/${id}`, params);
|
|
1259
|
+
},
|
|
1260
|
+
create: async (body) => {
|
|
1261
|
+
let res = await this._create(this.svAPIEndpoint, this.storeAssetPartUnit._path, body);
|
|
1262
|
+
return res;
|
|
1263
|
+
},
|
|
1264
|
+
update: async (id, body) => {
|
|
1265
|
+
let res = await this._update(this.svAPIEndpoint, this.storeAssetPartUnit._path + `/${id}`, body);
|
|
1266
|
+
return res;
|
|
1267
|
+
},
|
|
1268
|
+
patch: async (params, body) => {
|
|
1269
|
+
let res = await this._patch(this.svAPIEndpoint, this.storeAssetPartUnit._path, body, params);
|
|
1270
|
+
return res;
|
|
1271
|
+
},
|
|
1272
|
+
};
|
|
1273
|
+
this.ocrInvoiceJobTemplate = {
|
|
1274
|
+
_path: this._end_points.OCR_INVOICE_JOB_TEMPLATE,
|
|
1275
|
+
find: async (params) => {
|
|
1276
|
+
let res = await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path, params);
|
|
1277
|
+
return res;
|
|
1278
|
+
},
|
|
1279
|
+
get: async (id) => {
|
|
1280
|
+
return await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path + `/${id}`);
|
|
1281
|
+
},
|
|
1282
|
+
create: async (body) => {
|
|
1283
|
+
let res = await this._create(this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path, body);
|
|
1284
|
+
return res;
|
|
1285
|
+
},
|
|
1286
|
+
update: async (id, body) => {
|
|
1287
|
+
let res = await this._update(this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path + `/${id}`, body);
|
|
1288
|
+
return res;
|
|
1289
|
+
},
|
|
1290
|
+
};
|
|
1291
|
+
this.ocrInvoiceJobGroup = {
|
|
1292
|
+
_path: this._end_points.OCR_INVOICE_JOB_GROUP,
|
|
1293
|
+
find: async (params) => {
|
|
1294
|
+
let res = await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobGroup._path, params);
|
|
1295
|
+
return res;
|
|
1296
|
+
},
|
|
1297
|
+
get: async (id) => {
|
|
1298
|
+
return await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobGroup._path + `/${id}`);
|
|
1299
|
+
},
|
|
1300
|
+
create: async (body) => {
|
|
1301
|
+
let res = await this._create(this.svAPIEndpoint, this.ocrInvoiceJobGroup._path, body);
|
|
1302
|
+
return res;
|
|
1303
|
+
},
|
|
1304
|
+
};
|
|
1305
|
+
this.activityAiSalesOrder = {
|
|
1306
|
+
_path: this._end_points.ACTIVITY_AI_SALES_ORDER,
|
|
1307
|
+
find: async (params) => {
|
|
1308
|
+
let res = await this._fetch(this.svAPIEndpoint, this.activityAiSalesOrder._path, params);
|
|
1309
|
+
return res;
|
|
1310
|
+
},
|
|
1311
|
+
get: async (id) => {
|
|
1312
|
+
return await this._fetch(this.svAPIEndpoint, this.activityAiSalesOrder._path + `/${id}`);
|
|
1313
|
+
},
|
|
1314
|
+
create: async (body) => {
|
|
1315
|
+
let res = await this._create(this.svAPIEndpoint, this.activityAiSalesOrder._path, body);
|
|
1316
|
+
return res;
|
|
1317
|
+
},
|
|
1318
|
+
};
|
|
1319
|
+
this.ocrInvoiceJob = {
|
|
1320
|
+
_path: this._end_points.OCR_INVOICE_JOB,
|
|
1321
|
+
find: async (params) => {
|
|
1322
|
+
let res = await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJob._path, params);
|
|
1323
|
+
return res;
|
|
1324
|
+
},
|
|
1325
|
+
get: async (id) => {
|
|
1326
|
+
return await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJob._path + `/${id}`);
|
|
1327
|
+
},
|
|
1328
|
+
};
|
|
1329
|
+
this.ocrInvoiceJobPage = {
|
|
1330
|
+
_path: this._end_points.OCR_INVOICE_JOB_PAGE,
|
|
1331
|
+
find: async (params) => {
|
|
1332
|
+
let res = await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobPage._path, params);
|
|
1333
|
+
return res;
|
|
1334
|
+
},
|
|
1335
|
+
get: async (id) => {
|
|
1336
|
+
return await this._fetch(this.svAPIEndpoint, this.ocrInvoiceJobPage._path + `/${id}`);
|
|
1337
|
+
},
|
|
1338
|
+
update: async (id, body) => {
|
|
1339
|
+
let res = await this._update(this.svAPIEndpoint, this.ocrInvoiceJobPage._path + `/${id}`, body);
|
|
1340
|
+
return res;
|
|
1341
|
+
},
|
|
1342
|
+
};
|
|
1343
|
+
this.svAPIEndpoint =
|
|
1344
|
+
!options?.env || options?.env == "production"
|
|
1345
|
+
? "https://sv.api.repzo.me"
|
|
1346
|
+
: options?.env == "staging"
|
|
1347
|
+
? "https://staging.sv.api.repzo.me"
|
|
1348
|
+
: options?.env == "local"
|
|
1349
|
+
? "http://localhost:3030"
|
|
1350
|
+
: "";
|
|
1351
|
+
this.headers = {
|
|
1352
|
+
"api-key": apiKey,
|
|
1353
|
+
"Content-Type": "application/json",
|
|
1354
|
+
Accept: "application/json",
|
|
1355
|
+
};
|
|
1356
|
+
if (options?.headers)
|
|
1357
|
+
Object.assign(this.headers, options.headers);
|
|
1358
|
+
if (options?.timeout) {
|
|
1359
|
+
this.timeout = options.timeout;
|
|
1360
|
+
}
|
|
1361
|
+
else {
|
|
1362
|
+
this.timeout = 180000;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
async _fetch(baseUrl, path, params) {
|
|
1366
|
+
let res = await axios.get(`${baseUrl}/${path}`, {
|
|
1367
|
+
params,
|
|
1368
|
+
headers: this.headers,
|
|
1369
|
+
timeout: this.timeout,
|
|
1370
|
+
});
|
|
1371
|
+
return res.data;
|
|
1372
|
+
}
|
|
1373
|
+
async _create(baseUrl, path, body, params) {
|
|
1374
|
+
let res = await axios.post(`${baseUrl}/${path}`, body, {
|
|
1375
|
+
params,
|
|
1376
|
+
headers: this.headers,
|
|
1377
|
+
timeout: this.timeout,
|
|
1378
|
+
});
|
|
1379
|
+
return res.data;
|
|
1380
|
+
}
|
|
1381
|
+
async _update(baseUrl, path, body, params) {
|
|
1382
|
+
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
1383
|
+
params,
|
|
1384
|
+
headers: this.headers,
|
|
1385
|
+
timeout: this.timeout,
|
|
1386
|
+
});
|
|
1387
|
+
return res.data;
|
|
1388
|
+
}
|
|
1389
|
+
async _patch(baseUrl, path, body, params) {
|
|
1390
|
+
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
1391
|
+
params,
|
|
1392
|
+
headers: this.headers,
|
|
1393
|
+
timeout: this.timeout,
|
|
1394
|
+
});
|
|
1395
|
+
return res.data;
|
|
1396
|
+
}
|
|
1397
|
+
async _delete(baseUrl, path, params) {
|
|
1398
|
+
let res = await axios.delete(`${baseUrl}/${path}`, {
|
|
1399
|
+
params,
|
|
1400
|
+
headers: this.headers,
|
|
1401
|
+
timeout: this.timeout,
|
|
1402
|
+
});
|
|
1403
|
+
return res.data;
|
|
1404
|
+
}
|
|
2409
1405
|
}
|
|
2410
1406
|
Repzo.ActionLogs = class {
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
}
|
|
2425
|
-
async load(sync_id) {
|
|
2426
|
-
const params = { sync_id: sync_id };
|
|
2427
|
-
const res = await this.superThis._fetch(
|
|
2428
|
-
this.superThis.svAPIEndpoint,
|
|
2429
|
-
this._path,
|
|
2430
|
-
params
|
|
2431
|
-
);
|
|
2432
|
-
if (!res?.data?.length)
|
|
2433
|
-
throw new Error(`Action Log Not found, sync_id: ${sync_id}`);
|
|
2434
|
-
const action_log = res.data[0];
|
|
2435
|
-
this.sync_id = sync_id;
|
|
2436
|
-
this.details = action_log.details;
|
|
2437
|
-
this.status = action_log.status;
|
|
2438
|
-
this.error = action_log.error;
|
|
2439
|
-
this.start_time = action_log.start_time;
|
|
2440
|
-
this.body = action_log.body;
|
|
2441
|
-
this.meta = action_log.meta;
|
|
2442
|
-
this.message = action_log.message;
|
|
2443
|
-
this.app_id = action_log.app_id;
|
|
2444
|
-
this.available_app_id = action_log.available_app_id;
|
|
2445
|
-
this.available_app_name = action_log.available_app_name;
|
|
2446
|
-
this.company_namespace = action_log.company_namespace;
|
|
2447
|
-
this.action = action_log.action;
|
|
2448
|
-
this.isOld = true;
|
|
2449
|
-
return this;
|
|
2450
|
-
}
|
|
2451
|
-
setStatus(status, error) {
|
|
2452
|
-
this.details.push({
|
|
2453
|
-
timestamp: Date.now(),
|
|
2454
|
-
content: `status was changed from ${this.status} to ${status}`,
|
|
2455
|
-
});
|
|
2456
|
-
this.status = status;
|
|
2457
|
-
if (error) {
|
|
2458
|
-
if (typeof error == "string") {
|
|
2459
|
-
this.error = { message: error };
|
|
2460
|
-
} else if (error.message || error.response?.data) {
|
|
2461
|
-
this.error = {
|
|
2462
|
-
// json: error.toJSON ? error.toJSON() : undefined,
|
|
2463
|
-
message: error.message,
|
|
2464
|
-
responseData: error.response?.data,
|
|
2465
|
-
};
|
|
2466
|
-
} else {
|
|
2467
|
-
this.error = error;
|
|
2468
|
-
}
|
|
2469
|
-
return this;
|
|
2470
|
-
}
|
|
2471
|
-
return this;
|
|
2472
|
-
}
|
|
2473
|
-
setBody(body) {
|
|
2474
|
-
this.body = body;
|
|
2475
|
-
return this;
|
|
2476
|
-
}
|
|
2477
|
-
setMeta(meta) {
|
|
2478
|
-
this.meta = meta;
|
|
2479
|
-
return this;
|
|
2480
|
-
}
|
|
2481
|
-
async commit() {
|
|
2482
|
-
let doc = {
|
|
2483
|
-
available_app_name: this.available_app_name,
|
|
2484
|
-
available_app_id: this.available_app_id,
|
|
2485
|
-
app_id: this.app_id,
|
|
2486
|
-
action: this.action,
|
|
2487
|
-
company_namespace: this.company_namespace,
|
|
2488
|
-
status: this.status,
|
|
2489
|
-
error: this.error ? this.error : undefined,
|
|
2490
|
-
start_time: this.start_time,
|
|
2491
|
-
end_time: Date.now(),
|
|
2492
|
-
total_time: Date.now() - this.start_time,
|
|
2493
|
-
body: this.body,
|
|
2494
|
-
meta: this.meta,
|
|
2495
|
-
message: this.message,
|
|
2496
|
-
details: this.details,
|
|
2497
|
-
sync_id: this.sync_id,
|
|
2498
|
-
};
|
|
2499
|
-
try {
|
|
2500
|
-
const res = await this.superThis._create(
|
|
2501
|
-
this.superThis.svAPIEndpoint,
|
|
2502
|
-
this._path,
|
|
2503
|
-
doc
|
|
2504
|
-
);
|
|
2505
|
-
} catch (e) {
|
|
2506
|
-
console.error(e);
|
|
1407
|
+
constructor(superThis, sync_id) {
|
|
1408
|
+
this.superThis = superThis;
|
|
1409
|
+
this._path = "integration-action-log";
|
|
1410
|
+
this.available_app_name = "";
|
|
1411
|
+
this.available_app_id = "";
|
|
1412
|
+
this.app_id = "";
|
|
1413
|
+
this.action = "";
|
|
1414
|
+
this.start_time = Date.now();
|
|
1415
|
+
this.status = "processing";
|
|
1416
|
+
this.message = "Log Created";
|
|
1417
|
+
this.details = [];
|
|
1418
|
+
this.sync_id = sync_id;
|
|
1419
|
+
this.isOld = true;
|
|
2507
1420
|
}
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
};
|
|
2515
|
-
this.message = detail;
|
|
2516
|
-
if (meta) d.meta = meta;
|
|
2517
|
-
this.details.push(d);
|
|
2518
|
-
return this;
|
|
2519
|
-
}
|
|
2520
|
-
};
|
|
2521
|
-
Repzo.CommandLog = class {
|
|
2522
|
-
constructor(superThis, app, command, trigger) {
|
|
2523
|
-
this.superThis = superThis;
|
|
2524
|
-
this._path = "integration-command-log";
|
|
2525
|
-
this.app_id = app._id;
|
|
2526
|
-
this.available_app_id = app.available_app._id;
|
|
2527
|
-
this.available_app_name = app.available_app.name;
|
|
2528
|
-
this.company_namespace = app.company_namespace;
|
|
2529
|
-
this.start_time = Date.now();
|
|
2530
|
-
this.status = "received";
|
|
2531
|
-
this.message = "Request received";
|
|
2532
|
-
this.command = command;
|
|
2533
|
-
this.details = [{ timestamp: Date.now(), content: "Request received" }];
|
|
2534
|
-
this.sync_id = uuid();
|
|
2535
|
-
this.isOld = false;
|
|
2536
|
-
this.isPrioritized = false;
|
|
2537
|
-
this.retries = 1;
|
|
2538
|
-
this.trigger = trigger;
|
|
2539
|
-
this.onGoing = true;
|
|
2540
|
-
this.sync_details = [];
|
|
2541
|
-
this.error_details = [];
|
|
2542
|
-
}
|
|
2543
|
-
async load(sync_id, retries) {
|
|
2544
|
-
if (sync_id) {
|
|
2545
|
-
const params = { sync_id: sync_id };
|
|
2546
|
-
const res = await this.superThis._fetch(
|
|
2547
|
-
this.superThis.svAPIEndpoint,
|
|
2548
|
-
this._path,
|
|
2549
|
-
params
|
|
2550
|
-
);
|
|
2551
|
-
if (!res?.data?.length)
|
|
2552
|
-
throw new Error(`Command Log Not found, sync_id: ${sync_id}`);
|
|
2553
|
-
const command_log = res.data[0];
|
|
2554
|
-
if (command_log) {
|
|
1421
|
+
async load(sync_id) {
|
|
1422
|
+
const params = { sync_id: sync_id };
|
|
1423
|
+
const res = await this.superThis._fetch(this.superThis.svAPIEndpoint, this._path, params);
|
|
1424
|
+
if (!res?.data?.length)
|
|
1425
|
+
throw new Error(`Action Log Not found, sync_id: ${sync_id}`);
|
|
1426
|
+
const action_log = res.data[0];
|
|
2555
1427
|
this.sync_id = sync_id;
|
|
2556
|
-
this.details =
|
|
2557
|
-
this.status =
|
|
2558
|
-
this.error =
|
|
2559
|
-
this.start_time =
|
|
2560
|
-
this.body =
|
|
2561
|
-
this.meta =
|
|
2562
|
-
this.message =
|
|
2563
|
-
this.
|
|
2564
|
-
|
|
1428
|
+
this.details = action_log.details;
|
|
1429
|
+
this.status = action_log.status;
|
|
1430
|
+
this.error = action_log.error;
|
|
1431
|
+
this.start_time = action_log.start_time;
|
|
1432
|
+
this.body = action_log.body;
|
|
1433
|
+
this.meta = action_log.meta;
|
|
1434
|
+
this.message = action_log.message;
|
|
1435
|
+
this.app_id = action_log.app_id;
|
|
1436
|
+
this.available_app_id = action_log.available_app_id;
|
|
1437
|
+
this.available_app_name = action_log.available_app_name;
|
|
1438
|
+
this.company_namespace = action_log.company_namespace;
|
|
1439
|
+
this.action = action_log.action;
|
|
2565
1440
|
this.isOld = true;
|
|
2566
|
-
this
|
|
2567
|
-
this.succeededAt = command_log.succeededAt;
|
|
2568
|
-
this.skippedAt = command_log.skippedAt;
|
|
2569
|
-
this.receivedAt = command_log.receivedAt;
|
|
2570
|
-
this.processedAt = command_log.processedAt;
|
|
2571
|
-
this.onGoing = command_log.onGoing || false;
|
|
2572
|
-
this.trigger = command_log.trigger;
|
|
2573
|
-
this.sync_details = command_log.sync_details;
|
|
2574
|
-
this.error_details = command_log.error_details;
|
|
2575
|
-
// this.priority = command_log.priority
|
|
2576
|
-
// ? command_log.priority
|
|
2577
|
-
// : this.priority
|
|
2578
|
-
// ? this.priority
|
|
2579
|
-
// : undefined;
|
|
2580
|
-
}
|
|
1441
|
+
return this;
|
|
2581
1442
|
}
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
];
|
|
2606
|
-
return this;
|
|
1443
|
+
setStatus(status, error) {
|
|
1444
|
+
this.details.push({
|
|
1445
|
+
timestamp: Date.now(),
|
|
1446
|
+
content: `status was changed from ${this.status} to ${status}`,
|
|
1447
|
+
});
|
|
1448
|
+
this.status = status;
|
|
1449
|
+
if (error) {
|
|
1450
|
+
if (typeof error == "string") {
|
|
1451
|
+
this.error = { message: error };
|
|
1452
|
+
}
|
|
1453
|
+
else if (error.message || error.response?.data) {
|
|
1454
|
+
this.error = {
|
|
1455
|
+
// json: error.toJSON ? error.toJSON() : undefined,
|
|
1456
|
+
message: error.message,
|
|
1457
|
+
responseData: error.response?.data,
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
this.error = error;
|
|
1462
|
+
}
|
|
1463
|
+
return this;
|
|
1464
|
+
}
|
|
1465
|
+
return this;
|
|
2607
1466
|
}
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
this
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
this
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
1467
|
+
setBody(body) {
|
|
1468
|
+
this.body = body;
|
|
1469
|
+
return this;
|
|
1470
|
+
}
|
|
1471
|
+
setMeta(meta) {
|
|
1472
|
+
this.meta = meta;
|
|
1473
|
+
return this;
|
|
1474
|
+
}
|
|
1475
|
+
async commit() {
|
|
1476
|
+
let doc = {
|
|
1477
|
+
available_app_name: this.available_app_name,
|
|
1478
|
+
available_app_id: this.available_app_id,
|
|
1479
|
+
app_id: this.app_id,
|
|
1480
|
+
action: this.action,
|
|
1481
|
+
company_namespace: this.company_namespace,
|
|
1482
|
+
status: this.status,
|
|
1483
|
+
error: this.error ? this.error : undefined,
|
|
1484
|
+
start_time: this.start_time,
|
|
1485
|
+
end_time: Date.now(),
|
|
1486
|
+
total_time: Date.now() - this.start_time,
|
|
1487
|
+
body: this.body,
|
|
1488
|
+
meta: this.meta,
|
|
1489
|
+
message: this.message,
|
|
1490
|
+
details: this.details,
|
|
1491
|
+
sync_id: this.sync_id,
|
|
1492
|
+
};
|
|
1493
|
+
try {
|
|
1494
|
+
const res = await this.superThis._create(this.superThis.svAPIEndpoint, this._path, doc);
|
|
1495
|
+
}
|
|
1496
|
+
catch (e) {
|
|
1497
|
+
console.error(e);
|
|
1498
|
+
}
|
|
1499
|
+
return this;
|
|
1500
|
+
}
|
|
1501
|
+
addDetail(detail, meta) {
|
|
1502
|
+
let d = {
|
|
1503
|
+
timestamp: Date.now(),
|
|
1504
|
+
content: detail,
|
|
1505
|
+
};
|
|
1506
|
+
this.message = detail;
|
|
1507
|
+
if (meta)
|
|
1508
|
+
d.meta = meta;
|
|
1509
|
+
this.details.push(d);
|
|
1510
|
+
return this;
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
Repzo.CommandLog = class {
|
|
1514
|
+
constructor(superThis, app, command, trigger) {
|
|
1515
|
+
this.superThis = superThis;
|
|
1516
|
+
this._path = "integration-command-log";
|
|
1517
|
+
this.app_id = app._id;
|
|
1518
|
+
this.available_app_id = app.available_app._id;
|
|
1519
|
+
this.available_app_name = app.available_app.name;
|
|
1520
|
+
this.company_namespace = app.company_namespace;
|
|
1521
|
+
this.start_time = Date.now();
|
|
1522
|
+
this.status = "received";
|
|
1523
|
+
this.message = "Request received";
|
|
1524
|
+
this.command = command;
|
|
1525
|
+
this.details = [{ timestamp: Date.now(), content: "Request received" }];
|
|
1526
|
+
this.sync_id = uuid();
|
|
1527
|
+
this.isOld = false;
|
|
1528
|
+
this.isPrioritized = false;
|
|
1529
|
+
this.retries = 1;
|
|
1530
|
+
this.trigger = trigger;
|
|
2623
1531
|
this.onGoing = true;
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
1532
|
+
this.sync_details = [];
|
|
1533
|
+
this.error_details = [];
|
|
1534
|
+
}
|
|
1535
|
+
async load(sync_id, retries) {
|
|
1536
|
+
if (sync_id) {
|
|
1537
|
+
const params = { sync_id: sync_id };
|
|
1538
|
+
const res = await this.superThis._fetch(this.superThis.svAPIEndpoint, this._path, params);
|
|
1539
|
+
if (!res?.data?.length)
|
|
1540
|
+
throw new Error(`Command Log Not found, sync_id: ${sync_id}`);
|
|
1541
|
+
const command_log = res.data[0];
|
|
1542
|
+
if (command_log) {
|
|
1543
|
+
this.sync_id = sync_id;
|
|
1544
|
+
this.details = command_log.details;
|
|
1545
|
+
this.status = command_log.status;
|
|
1546
|
+
this.error = command_log.error;
|
|
1547
|
+
this.start_time = command_log.start_time;
|
|
1548
|
+
this.body = command_log.body;
|
|
1549
|
+
this.meta = command_log.meta;
|
|
1550
|
+
this.message = command_log.message;
|
|
1551
|
+
this.retries =
|
|
1552
|
+
retries !== undefined
|
|
1553
|
+
? retries
|
|
1554
|
+
: command_log.retries || this.retries; // retries !== undefined ? retries : command_log.retries;
|
|
1555
|
+
this.isOld = true;
|
|
1556
|
+
this.failedAt = command_log.failedAt;
|
|
1557
|
+
this.succeededAt = command_log.succeededAt;
|
|
1558
|
+
this.skippedAt = command_log.skippedAt;
|
|
1559
|
+
this.receivedAt = command_log.receivedAt;
|
|
1560
|
+
this.processedAt = command_log.processedAt;
|
|
1561
|
+
this.onGoing = command_log.onGoing || false;
|
|
1562
|
+
this.trigger = command_log.trigger;
|
|
1563
|
+
this.sync_details = command_log.sync_details;
|
|
1564
|
+
this.error_details = command_log.error_details;
|
|
1565
|
+
// this.priority = command_log.priority
|
|
1566
|
+
// ? command_log.priority
|
|
1567
|
+
// : this.priority
|
|
1568
|
+
// ? this.priority
|
|
1569
|
+
// : undefined;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
return this;
|
|
1573
|
+
}
|
|
1574
|
+
setStatus(status, error) {
|
|
1575
|
+
this.addDetail(`status was changed from ${this.status} to ${status}`);
|
|
1576
|
+
this.status = status;
|
|
1577
|
+
if (error) {
|
|
1578
|
+
if (!this.error_details)
|
|
1579
|
+
this.error_details = [];
|
|
1580
|
+
if (typeof error == "string") {
|
|
1581
|
+
this.error = { message: error };
|
|
1582
|
+
}
|
|
1583
|
+
else if (error.message || error.response?.data) {
|
|
1584
|
+
this.error = {
|
|
1585
|
+
// json: error.toJSON ? error.toJSON() : undefined,
|
|
1586
|
+
message: error.message,
|
|
1587
|
+
responseData: error.response?.data,
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
this.error = error;
|
|
1592
|
+
}
|
|
1593
|
+
this.error_details = [
|
|
1594
|
+
{
|
|
1595
|
+
timestamp: Date.now(),
|
|
1596
|
+
error: this.error,
|
|
1597
|
+
},
|
|
1598
|
+
];
|
|
1599
|
+
return this;
|
|
1600
|
+
}
|
|
1601
|
+
switch (status) {
|
|
1602
|
+
case "fail":
|
|
1603
|
+
this.failedAt = new Date();
|
|
1604
|
+
this.onGoing = false;
|
|
1605
|
+
break;
|
|
1606
|
+
case "processing":
|
|
1607
|
+
this.processedAt = new Date();
|
|
1608
|
+
this.onGoing = true;
|
|
1609
|
+
break;
|
|
1610
|
+
case "queued":
|
|
1611
|
+
this.queuedAt = new Date();
|
|
1612
|
+
this.onGoing = true;
|
|
1613
|
+
break;
|
|
1614
|
+
case "received":
|
|
1615
|
+
this.receivedAt = new Date();
|
|
1616
|
+
this.onGoing = true;
|
|
1617
|
+
break;
|
|
1618
|
+
case "skipped":
|
|
1619
|
+
this.skippedAt = new Date();
|
|
1620
|
+
this.onGoing = false;
|
|
1621
|
+
break;
|
|
1622
|
+
case "success":
|
|
1623
|
+
this.succeededAt = new Date();
|
|
1624
|
+
this.onGoing = false;
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
return this;
|
|
1628
|
+
}
|
|
1629
|
+
setBody(body) {
|
|
1630
|
+
this.body = body;
|
|
1631
|
+
if (!this.sync_details)
|
|
1632
|
+
this.sync_details = [];
|
|
1633
|
+
this.sync_details = [
|
|
1634
|
+
{
|
|
1635
|
+
timestamp: Date.now(),
|
|
1636
|
+
body: this.body,
|
|
1637
|
+
},
|
|
1638
|
+
];
|
|
1639
|
+
return this;
|
|
1640
|
+
}
|
|
1641
|
+
setMeta(meta) {
|
|
1642
|
+
this.meta = meta;
|
|
1643
|
+
return this;
|
|
1644
|
+
}
|
|
1645
|
+
async commit() {
|
|
1646
|
+
let doc = {
|
|
1647
|
+
available_app_name: this.available_app_name,
|
|
1648
|
+
available_app_id: this.available_app_id,
|
|
1649
|
+
app_id: this.app_id,
|
|
1650
|
+
command: this.command,
|
|
1651
|
+
status: this.status,
|
|
1652
|
+
error: this.error ? this.error : undefined,
|
|
1653
|
+
start_time: this.start_time,
|
|
1654
|
+
end_time: Date.now(),
|
|
1655
|
+
total_time: Date.now() - this.start_time,
|
|
1656
|
+
company_namespace: this.company_namespace,
|
|
1657
|
+
body: this.body,
|
|
1658
|
+
meta: this.meta,
|
|
1659
|
+
message: this.message,
|
|
1660
|
+
details: this.details,
|
|
1661
|
+
sync_id: this.sync_id,
|
|
1662
|
+
// priority: this.priority ? this.priority : undefined,
|
|
1663
|
+
queuedAt: this.queuedAt ? this.queuedAt : undefined,
|
|
1664
|
+
failedAt: this.failedAt ? this.failedAt : undefined,
|
|
1665
|
+
succeededAt: this.succeededAt ? this.succeededAt : undefined,
|
|
1666
|
+
skippedAt: this.skippedAt ? this.skippedAt : undefined,
|
|
1667
|
+
receivedAt: this.receivedAt ? this.receivedAt : undefined,
|
|
1668
|
+
processedAt: this.processedAt ? this.processedAt : undefined,
|
|
1669
|
+
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
1670
|
+
retries: this.retries !== undefined ? this.retries : undefined,
|
|
1671
|
+
trigger: this.trigger,
|
|
1672
|
+
sync_details: this.sync_details,
|
|
1673
|
+
error_details: this.error_details,
|
|
1674
|
+
};
|
|
1675
|
+
try {
|
|
1676
|
+
const res = await this.superThis._create(this.superThis.svAPIEndpoint, this._path, doc);
|
|
1677
|
+
this.isOld = true;
|
|
1678
|
+
}
|
|
1679
|
+
catch (e) {
|
|
1680
|
+
console.error(e);
|
|
1681
|
+
}
|
|
1682
|
+
return this;
|
|
2633
1683
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
}
|
|
2647
|
-
setMeta(meta) {
|
|
2648
|
-
this.meta = meta;
|
|
2649
|
-
return this;
|
|
2650
|
-
}
|
|
2651
|
-
async commit() {
|
|
2652
|
-
let doc = {
|
|
2653
|
-
available_app_name: this.available_app_name,
|
|
2654
|
-
available_app_id: this.available_app_id,
|
|
2655
|
-
app_id: this.app_id,
|
|
2656
|
-
command: this.command,
|
|
2657
|
-
status: this.status,
|
|
2658
|
-
error: this.error ? this.error : undefined,
|
|
2659
|
-
start_time: this.start_time,
|
|
2660
|
-
end_time: Date.now(),
|
|
2661
|
-
total_time: Date.now() - this.start_time,
|
|
2662
|
-
company_namespace: this.company_namespace,
|
|
2663
|
-
body: this.body,
|
|
2664
|
-
meta: this.meta,
|
|
2665
|
-
message: this.message,
|
|
2666
|
-
details: this.details,
|
|
2667
|
-
sync_id: this.sync_id,
|
|
2668
|
-
// priority: this.priority ? this.priority : undefined,
|
|
2669
|
-
queuedAt: this.queuedAt ? this.queuedAt : undefined,
|
|
2670
|
-
failedAt: this.failedAt ? this.failedAt : undefined,
|
|
2671
|
-
succeededAt: this.succeededAt ? this.succeededAt : undefined,
|
|
2672
|
-
skippedAt: this.skippedAt ? this.skippedAt : undefined,
|
|
2673
|
-
receivedAt: this.receivedAt ? this.receivedAt : undefined,
|
|
2674
|
-
processedAt: this.processedAt ? this.processedAt : undefined,
|
|
2675
|
-
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
2676
|
-
retries: this.retries !== undefined ? this.retries : undefined,
|
|
2677
|
-
trigger: this.trigger,
|
|
2678
|
-
sync_details: this.sync_details,
|
|
2679
|
-
error_details: this.error_details,
|
|
2680
|
-
};
|
|
2681
|
-
try {
|
|
2682
|
-
const res = await this.superThis._create(
|
|
2683
|
-
this.superThis.svAPIEndpoint,
|
|
2684
|
-
this._path,
|
|
2685
|
-
doc
|
|
2686
|
-
);
|
|
2687
|
-
this.isOld = true;
|
|
2688
|
-
} catch (e) {
|
|
2689
|
-
console.error(e);
|
|
1684
|
+
addDetail(detail, meta) {
|
|
1685
|
+
if (!this.details)
|
|
1686
|
+
this.details = [];
|
|
1687
|
+
this.details = [
|
|
1688
|
+
{
|
|
1689
|
+
timestamp: Date.now(),
|
|
1690
|
+
content: detail,
|
|
1691
|
+
meta,
|
|
1692
|
+
},
|
|
1693
|
+
];
|
|
1694
|
+
this.message = detail;
|
|
1695
|
+
return this;
|
|
2690
1696
|
}
|
|
2691
|
-
return this;
|
|
2692
|
-
}
|
|
2693
|
-
addDetail(detail, meta) {
|
|
2694
|
-
if (!this.details) this.details = [];
|
|
2695
|
-
this.details = [
|
|
2696
|
-
{
|
|
2697
|
-
timestamp: Date.now(),
|
|
2698
|
-
content: detail,
|
|
2699
|
-
meta,
|
|
2700
|
-
},
|
|
2701
|
-
];
|
|
2702
|
-
this.message = detail;
|
|
2703
|
-
return this;
|
|
2704
|
-
}
|
|
2705
1697
|
};
|
|
1698
|
+
export default Repzo;
|