repzo 1.0.96 → 1.0.98
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 +125 -120
- package/lib/index.js +1672 -2685
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/types/index.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -1,2700 +1,1687 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { v4 as uuid } from "uuid";
|
|
3
3
|
class Repzo {
|
|
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
|
-
let res = await
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
},
|
|
1395
|
-
get: async (id, params) => {
|
|
1396
|
-
return await this._fetch(
|
|
1397
|
-
this.svAPIEndpoint,
|
|
1398
|
-
this.proforma._path + `/${id}`,
|
|
1399
|
-
params
|
|
1400
|
-
);
|
|
1401
|
-
},
|
|
1402
|
-
create: async (body) => {
|
|
1403
|
-
let res = await this._create(
|
|
1404
|
-
this.svAPIEndpoint,
|
|
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) => {
|
|
2006
|
-
return await this._fetch(
|
|
2007
|
-
this.svAPIEndpoint,
|
|
2008
|
-
this.assetPart._path + `/${id}`
|
|
2009
|
-
);
|
|
2010
|
-
},
|
|
2011
|
-
create: async (body) => {
|
|
2012
|
-
let res = await this._create(
|
|
2013
|
-
this.svAPIEndpoint,
|
|
2014
|
-
this.assetPart._path,
|
|
2015
|
-
body
|
|
2016
|
-
);
|
|
2017
|
-
return res;
|
|
2018
|
-
},
|
|
2019
|
-
update: async (id, body) => {
|
|
2020
|
-
let res = await this._update(
|
|
2021
|
-
this.svAPIEndpoint,
|
|
2022
|
-
this.assetPart._path + `/${id}`,
|
|
2023
|
-
body
|
|
2024
|
-
);
|
|
2025
|
-
return res;
|
|
2026
|
-
},
|
|
2027
|
-
remove: async (id) => {
|
|
2028
|
-
let res = await this._delete(
|
|
2029
|
-
this.svAPIEndpoint,
|
|
2030
|
-
this.assetPart._path + `/${id}`
|
|
2031
|
-
);
|
|
2032
|
-
return res;
|
|
2033
|
-
},
|
|
2034
|
-
};
|
|
2035
|
-
this.assetPartUnit = {
|
|
2036
|
-
_path: this._end_points.ASSET_PART_UNIT,
|
|
2037
|
-
find: async (params) => {
|
|
2038
|
-
let res = await this._fetch(
|
|
2039
|
-
this.svAPIEndpoint,
|
|
2040
|
-
this.assetPartUnit._path,
|
|
2041
|
-
params
|
|
2042
|
-
);
|
|
2043
|
-
return res;
|
|
2044
|
-
},
|
|
2045
|
-
get: async (id) => {
|
|
2046
|
-
return await this._fetch(
|
|
2047
|
-
this.svAPIEndpoint,
|
|
2048
|
-
this.assetPartUnit._path + `/${id}`
|
|
2049
|
-
);
|
|
2050
|
-
},
|
|
2051
|
-
update: async (id, body) => {
|
|
2052
|
-
let res = await this._update(
|
|
2053
|
-
this.svAPIEndpoint,
|
|
2054
|
-
this.assetPartUnit._path + `/${id}`,
|
|
2055
|
-
body
|
|
2056
|
-
);
|
|
2057
|
-
return res;
|
|
2058
|
-
},
|
|
2059
|
-
};
|
|
2060
|
-
this.assetPartReceival = {
|
|
2061
|
-
_path: this._end_points.ASSET_PART_RECEIVAL,
|
|
2062
|
-
find: async (params) => {
|
|
2063
|
-
let res = await this._fetch(
|
|
2064
|
-
this.svAPIEndpoint,
|
|
2065
|
-
this.assetPartReceival._path,
|
|
2066
|
-
params
|
|
2067
|
-
);
|
|
2068
|
-
return res;
|
|
2069
|
-
},
|
|
2070
|
-
get: async (id) => {
|
|
2071
|
-
return await this._fetch(
|
|
2072
|
-
this.svAPIEndpoint,
|
|
2073
|
-
this.assetPartReceival._path + `/${id}`
|
|
2074
|
-
);
|
|
2075
|
-
},
|
|
2076
|
-
create: async (body) => {
|
|
2077
|
-
let res = await this._create(
|
|
2078
|
-
this.svAPIEndpoint,
|
|
2079
|
-
this.assetPartReceival._path,
|
|
2080
|
-
body
|
|
2081
|
-
);
|
|
2082
|
-
return res;
|
|
2083
|
-
},
|
|
2084
|
-
update: async (id, body) => {
|
|
2085
|
-
let res = await this._update(
|
|
2086
|
-
this.svAPIEndpoint,
|
|
2087
|
-
this.assetPartReceival._path + `/${id}`,
|
|
2088
|
-
body
|
|
2089
|
-
);
|
|
2090
|
-
return res;
|
|
2091
|
-
},
|
|
2092
|
-
patch: async (params, body) => {
|
|
2093
|
-
let res = await this._patch(
|
|
2094
|
-
this.svAPIEndpoint,
|
|
2095
|
-
this.assetPartReceival._path,
|
|
2096
|
-
body,
|
|
2097
|
-
params
|
|
2098
|
-
);
|
|
2099
|
-
return res;
|
|
2100
|
-
},
|
|
2101
|
-
};
|
|
2102
|
-
this.assetPartTransfer = {
|
|
2103
|
-
_path: this._end_points.ASSET_PART_TRANSFER,
|
|
2104
|
-
find: async (params) => {
|
|
2105
|
-
let res = await this._fetch(
|
|
2106
|
-
this.svAPIEndpoint,
|
|
2107
|
-
this.assetPartTransfer._path,
|
|
2108
|
-
params
|
|
2109
|
-
);
|
|
2110
|
-
return res;
|
|
2111
|
-
},
|
|
2112
|
-
get: async (id) => {
|
|
2113
|
-
return await this._fetch(
|
|
2114
|
-
this.svAPIEndpoint,
|
|
2115
|
-
this.assetPartTransfer._path + `/${id}`
|
|
2116
|
-
);
|
|
2117
|
-
},
|
|
2118
|
-
create: async (body) => {
|
|
2119
|
-
let res = await this._create(
|
|
2120
|
-
this.svAPIEndpoint,
|
|
2121
|
-
this.assetPartTransfer._path,
|
|
2122
|
-
body
|
|
2123
|
-
);
|
|
2124
|
-
return res;
|
|
2125
|
-
},
|
|
2126
|
-
update: async (id, body) => {
|
|
2127
|
-
let res = await this._update(
|
|
2128
|
-
this.svAPIEndpoint,
|
|
2129
|
-
this.assetPartTransfer._path + `/${id}`,
|
|
2130
|
-
body
|
|
2131
|
-
);
|
|
2132
|
-
return res;
|
|
2133
|
-
},
|
|
2134
|
-
patch: async (params, body) => {
|
|
2135
|
-
let res = await this._patch(
|
|
2136
|
-
this.svAPIEndpoint,
|
|
2137
|
-
this.assetPartTransfer._path,
|
|
2138
|
-
body,
|
|
2139
|
-
params
|
|
2140
|
-
);
|
|
2141
|
-
return res;
|
|
2142
|
-
},
|
|
2143
|
-
};
|
|
2144
|
-
this.returnAssetPartUnit = {
|
|
2145
|
-
_path: this._end_points.RETURN_ASSET_PART_UNIT,
|
|
2146
|
-
find: async (params) => {
|
|
2147
|
-
let res = await this._fetch(
|
|
2148
|
-
this.svAPIEndpoint,
|
|
2149
|
-
this.returnAssetPartUnit._path,
|
|
2150
|
-
params
|
|
2151
|
-
);
|
|
2152
|
-
return res;
|
|
2153
|
-
},
|
|
2154
|
-
get: async (id) => {
|
|
2155
|
-
return await this._fetch(
|
|
2156
|
-
this.svAPIEndpoint,
|
|
2157
|
-
this.returnAssetPartUnit._path + `/${id}`
|
|
2158
|
-
);
|
|
2159
|
-
},
|
|
2160
|
-
create: async (body) => {
|
|
2161
|
-
let res = await this._create(
|
|
2162
|
-
this.svAPIEndpoint,
|
|
2163
|
-
this.returnAssetPartUnit._path,
|
|
2164
|
-
body
|
|
2165
|
-
);
|
|
2166
|
-
return res;
|
|
2167
|
-
},
|
|
2168
|
-
update: async (id, body) => {
|
|
2169
|
-
let res = await this._update(
|
|
2170
|
-
this.svAPIEndpoint,
|
|
2171
|
-
this.returnAssetPartUnit._path + `/${id}`,
|
|
2172
|
-
body
|
|
2173
|
-
);
|
|
2174
|
-
return res;
|
|
2175
|
-
},
|
|
2176
|
-
patch: async (params, body) => {
|
|
2177
|
-
let res = await this._patch(
|
|
2178
|
-
this.svAPIEndpoint,
|
|
2179
|
-
this.returnAssetPartUnit._path,
|
|
2180
|
-
body,
|
|
2181
|
-
params
|
|
2182
|
-
);
|
|
2183
|
-
return res;
|
|
2184
|
-
},
|
|
2185
|
-
};
|
|
2186
|
-
this.storeAssetPartUnit = {
|
|
2187
|
-
_path: this._end_points.STORE_ASSET_PART_UNIT,
|
|
2188
|
-
find: async (params) => {
|
|
2189
|
-
let res = await this._fetch(
|
|
2190
|
-
this.svAPIEndpoint,
|
|
2191
|
-
this.storeAssetPartUnit._path,
|
|
2192
|
-
params
|
|
2193
|
-
);
|
|
2194
|
-
return res;
|
|
2195
|
-
},
|
|
2196
|
-
get: async (id) => {
|
|
2197
|
-
return await this._fetch(
|
|
2198
|
-
this.svAPIEndpoint,
|
|
2199
|
-
this.storeAssetPartUnit._path + `/${id}`
|
|
2200
|
-
);
|
|
2201
|
-
},
|
|
2202
|
-
create: async (body) => {
|
|
2203
|
-
let res = await this._create(
|
|
2204
|
-
this.svAPIEndpoint,
|
|
2205
|
-
this.storeAssetPartUnit._path,
|
|
2206
|
-
body
|
|
2207
|
-
);
|
|
2208
|
-
return res;
|
|
2209
|
-
},
|
|
2210
|
-
update: async (id, body) => {
|
|
2211
|
-
let res = await this._update(
|
|
2212
|
-
this.svAPIEndpoint,
|
|
2213
|
-
this.storeAssetPartUnit._path + `/${id}`,
|
|
2214
|
-
body
|
|
2215
|
-
);
|
|
2216
|
-
return res;
|
|
2217
|
-
},
|
|
2218
|
-
patch: async (params, body) => {
|
|
2219
|
-
let res = await this._patch(
|
|
2220
|
-
this.svAPIEndpoint,
|
|
2221
|
-
this.storeAssetPartUnit._path,
|
|
2222
|
-
body,
|
|
2223
|
-
params
|
|
2224
|
-
);
|
|
2225
|
-
return res;
|
|
2226
|
-
},
|
|
2227
|
-
};
|
|
2228
|
-
this.ocrInvoiceJobTemplate = {
|
|
2229
|
-
_path: this._end_points.OCR_INVOICE_JOB_TEMPLATE,
|
|
2230
|
-
find: async (params) => {
|
|
2231
|
-
let res = await this._fetch(
|
|
2232
|
-
this.svAPIEndpoint,
|
|
2233
|
-
this.ocrInvoiceJobTemplate._path,
|
|
2234
|
-
params
|
|
2235
|
-
);
|
|
2236
|
-
return res;
|
|
2237
|
-
},
|
|
2238
|
-
get: async (id) => {
|
|
2239
|
-
return await this._fetch(
|
|
2240
|
-
this.svAPIEndpoint,
|
|
2241
|
-
this.ocrInvoiceJobTemplate._path + `/${id}`
|
|
2242
|
-
);
|
|
2243
|
-
},
|
|
2244
|
-
create: async (body) => {
|
|
2245
|
-
let res = await this._create(
|
|
2246
|
-
this.svAPIEndpoint,
|
|
2247
|
-
this.ocrInvoiceJobTemplate._path,
|
|
2248
|
-
body
|
|
2249
|
-
);
|
|
2250
|
-
return res;
|
|
2251
|
-
},
|
|
2252
|
-
update: async (id, body) => {
|
|
2253
|
-
let res = await this._update(
|
|
2254
|
-
this.svAPIEndpoint,
|
|
2255
|
-
this.ocrInvoiceJobTemplate._path + `/${id}`,
|
|
2256
|
-
body
|
|
2257
|
-
);
|
|
2258
|
-
return res;
|
|
2259
|
-
},
|
|
2260
|
-
};
|
|
2261
|
-
this.ocrInvoiceJobGroup = {
|
|
2262
|
-
_path: this._end_points.OCR_INVOICE_JOB_GROUP,
|
|
2263
|
-
find: async (params) => {
|
|
2264
|
-
let res = await this._fetch(
|
|
2265
|
-
this.svAPIEndpoint,
|
|
2266
|
-
this.ocrInvoiceJobGroup._path,
|
|
2267
|
-
params
|
|
2268
|
-
);
|
|
2269
|
-
return res;
|
|
2270
|
-
},
|
|
2271
|
-
get: async (id) => {
|
|
2272
|
-
return await this._fetch(
|
|
2273
|
-
this.svAPIEndpoint,
|
|
2274
|
-
this.ocrInvoiceJobGroup._path + `/${id}`
|
|
2275
|
-
);
|
|
2276
|
-
},
|
|
2277
|
-
create: async (body) => {
|
|
2278
|
-
let res = await this._create(
|
|
2279
|
-
this.svAPIEndpoint,
|
|
2280
|
-
this.ocrInvoiceJobGroup._path,
|
|
2281
|
-
body
|
|
2282
|
-
);
|
|
2283
|
-
return res;
|
|
2284
|
-
},
|
|
2285
|
-
};
|
|
2286
|
-
this.activityAiSalesOrder = {
|
|
2287
|
-
_path: this._end_points.ACTIVITY_AI_SALES_ORDER,
|
|
2288
|
-
find: async (params) => {
|
|
2289
|
-
let res = await this._fetch(
|
|
2290
|
-
this.svAPIEndpoint,
|
|
2291
|
-
this.activityAiSalesOrder._path,
|
|
2292
|
-
params
|
|
2293
|
-
);
|
|
2294
|
-
return res;
|
|
2295
|
-
},
|
|
2296
|
-
get: async (id) => {
|
|
2297
|
-
return await this._fetch(
|
|
2298
|
-
this.svAPIEndpoint,
|
|
2299
|
-
this.activityAiSalesOrder._path + `/${id}`
|
|
2300
|
-
);
|
|
2301
|
-
},
|
|
2302
|
-
create: async (body) => {
|
|
2303
|
-
let res = await this._create(
|
|
2304
|
-
this.svAPIEndpoint,
|
|
2305
|
-
this.activityAiSalesOrder._path,
|
|
2306
|
-
body
|
|
2307
|
-
);
|
|
2308
|
-
return res;
|
|
2309
|
-
},
|
|
2310
|
-
};
|
|
2311
|
-
this.ocrInvoiceJob = {
|
|
2312
|
-
_path: this._end_points.OCR_INVOICE_JOB,
|
|
2313
|
-
find: async (params) => {
|
|
2314
|
-
let res = await this._fetch(
|
|
2315
|
-
this.svAPIEndpoint,
|
|
2316
|
-
this.ocrInvoiceJob._path,
|
|
2317
|
-
params
|
|
2318
|
-
);
|
|
2319
|
-
return res;
|
|
2320
|
-
},
|
|
2321
|
-
get: async (id) => {
|
|
2322
|
-
return await this._fetch(
|
|
2323
|
-
this.svAPIEndpoint,
|
|
2324
|
-
this.ocrInvoiceJob._path + `/${id}`
|
|
2325
|
-
);
|
|
2326
|
-
},
|
|
2327
|
-
};
|
|
2328
|
-
this.ocrInvoiceJobPage = {
|
|
2329
|
-
_path: this._end_points.OCR_INVOICE_JOB_PAGE,
|
|
2330
|
-
find: async (params) => {
|
|
2331
|
-
let res = await this._fetch(
|
|
2332
|
-
this.svAPIEndpoint,
|
|
2333
|
-
this.ocrInvoiceJobPage._path,
|
|
2334
|
-
params
|
|
2335
|
-
);
|
|
2336
|
-
return res;
|
|
2337
|
-
},
|
|
2338
|
-
get: async (id) => {
|
|
2339
|
-
return await this._fetch(
|
|
2340
|
-
this.svAPIEndpoint,
|
|
2341
|
-
this.ocrInvoiceJobPage._path + `/${id}`
|
|
2342
|
-
);
|
|
2343
|
-
},
|
|
2344
|
-
update: async (id, body) => {
|
|
2345
|
-
let res = await this._update(
|
|
2346
|
-
this.svAPIEndpoint,
|
|
2347
|
-
this.ocrInvoiceJobPage._path + `/${id}`,
|
|
2348
|
-
body
|
|
2349
|
-
);
|
|
2350
|
-
return res;
|
|
2351
|
-
},
|
|
2352
|
-
};
|
|
2353
|
-
this.svAPIEndpoint =
|
|
2354
|
-
!options?.env || options?.env == "production"
|
|
2355
|
-
? "https://sv.api.repzo.me"
|
|
2356
|
-
: options?.env == "staging"
|
|
2357
|
-
? "https://staging.sv.api.repzo.me"
|
|
2358
|
-
: options?.env == "local"
|
|
2359
|
-
? "http://localhost:3030"
|
|
2360
|
-
: "";
|
|
2361
|
-
this.headers = {
|
|
2362
|
-
"api-key": apiKey,
|
|
2363
|
-
"Content-Type": "application/json",
|
|
2364
|
-
Accept: "application/json",
|
|
2365
|
-
};
|
|
2366
|
-
if (options?.headers) Object.assign(this.headers, options.headers);
|
|
2367
|
-
}
|
|
2368
|
-
async _fetch(baseUrl, path, params) {
|
|
2369
|
-
let res = await axios.get(`${baseUrl}/${path}`, {
|
|
2370
|
-
params,
|
|
2371
|
-
headers: this.headers,
|
|
2372
|
-
});
|
|
2373
|
-
return res.data;
|
|
2374
|
-
}
|
|
2375
|
-
async _create(baseUrl, path, body, params) {
|
|
2376
|
-
let res = await axios.post(`${baseUrl}/${path}`, body, {
|
|
2377
|
-
params,
|
|
2378
|
-
headers: this.headers,
|
|
2379
|
-
});
|
|
2380
|
-
return res.data;
|
|
2381
|
-
}
|
|
2382
|
-
async _update(baseUrl, path, body, params) {
|
|
2383
|
-
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
2384
|
-
params,
|
|
2385
|
-
headers: this.headers,
|
|
2386
|
-
});
|
|
2387
|
-
return res.data;
|
|
2388
|
-
}
|
|
2389
|
-
async _patch(baseUrl, path, body, params) {
|
|
2390
|
-
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
2391
|
-
params,
|
|
2392
|
-
headers: this.headers,
|
|
2393
|
-
});
|
|
2394
|
-
return res.data;
|
|
2395
|
-
}
|
|
2396
|
-
async _delete(baseUrl, path, params) {
|
|
2397
|
-
let res = await axios.delete(`${baseUrl}/${path}`, {
|
|
2398
|
-
params,
|
|
2399
|
-
headers: this.headers,
|
|
2400
|
-
});
|
|
2401
|
-
return res.data;
|
|
2402
|
-
}
|
|
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) => {
|
|
1156
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPart._path + `/${id}`);
|
|
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) => {
|
|
1178
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartUnit._path + `/${id}`);
|
|
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) => {
|
|
1192
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartReceival._path + `/${id}`);
|
|
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) => {
|
|
1214
|
+
return await this._fetch(this.svAPIEndpoint, this.assetPartTransfer._path + `/${id}`);
|
|
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) => {
|
|
1236
|
+
return await this._fetch(this.svAPIEndpoint, this.returnAssetPartUnit._path + `/${id}`);
|
|
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) => {
|
|
1258
|
+
return await this._fetch(this.svAPIEndpoint, this.storeAssetPartUnit._path + `/${id}`);
|
|
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
|
+
}
|
|
1359
|
+
async _fetch(baseUrl, path, params) {
|
|
1360
|
+
let res = await axios.get(`${baseUrl}/${path}`, {
|
|
1361
|
+
params,
|
|
1362
|
+
headers: this.headers,
|
|
1363
|
+
});
|
|
1364
|
+
return res.data;
|
|
1365
|
+
}
|
|
1366
|
+
async _create(baseUrl, path, body, params) {
|
|
1367
|
+
let res = await axios.post(`${baseUrl}/${path}`, body, {
|
|
1368
|
+
params,
|
|
1369
|
+
headers: this.headers,
|
|
1370
|
+
});
|
|
1371
|
+
return res.data;
|
|
1372
|
+
}
|
|
1373
|
+
async _update(baseUrl, path, body, params) {
|
|
1374
|
+
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
1375
|
+
params,
|
|
1376
|
+
headers: this.headers,
|
|
1377
|
+
});
|
|
1378
|
+
return res.data;
|
|
1379
|
+
}
|
|
1380
|
+
async _patch(baseUrl, path, body, params) {
|
|
1381
|
+
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
1382
|
+
params,
|
|
1383
|
+
headers: this.headers,
|
|
1384
|
+
});
|
|
1385
|
+
return res.data;
|
|
1386
|
+
}
|
|
1387
|
+
async _delete(baseUrl, path, params) {
|
|
1388
|
+
let res = await axios.delete(`${baseUrl}/${path}`, {
|
|
1389
|
+
params,
|
|
1390
|
+
headers: this.headers,
|
|
1391
|
+
});
|
|
1392
|
+
return res.data;
|
|
1393
|
+
}
|
|
2403
1394
|
}
|
|
2404
1395
|
Repzo.ActionLogs = class {
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
}
|
|
2419
|
-
async load(sync_id) {
|
|
2420
|
-
const params = { sync_id: sync_id };
|
|
2421
|
-
const res = await this.superThis._fetch(
|
|
2422
|
-
this.superThis.svAPIEndpoint,
|
|
2423
|
-
this._path,
|
|
2424
|
-
params
|
|
2425
|
-
);
|
|
2426
|
-
if (!res?.data?.length)
|
|
2427
|
-
throw new Error(`Action Log Not found, sync_id: ${sync_id}`);
|
|
2428
|
-
const action_log = res.data[0];
|
|
2429
|
-
this.sync_id = sync_id;
|
|
2430
|
-
this.details = action_log.details;
|
|
2431
|
-
this.status = action_log.status;
|
|
2432
|
-
this.error = action_log.error;
|
|
2433
|
-
this.start_time = action_log.start_time;
|
|
2434
|
-
this.body = action_log.body;
|
|
2435
|
-
this.meta = action_log.meta;
|
|
2436
|
-
this.message = action_log.message;
|
|
2437
|
-
this.app_id = action_log.app_id;
|
|
2438
|
-
this.available_app_id = action_log.available_app_id;
|
|
2439
|
-
this.available_app_name = action_log.available_app_name;
|
|
2440
|
-
this.company_namespace = action_log.company_namespace;
|
|
2441
|
-
this.action = action_log.action;
|
|
2442
|
-
this.isOld = true;
|
|
2443
|
-
return this;
|
|
2444
|
-
}
|
|
2445
|
-
setStatus(status, error) {
|
|
2446
|
-
this.details.push({
|
|
2447
|
-
timestamp: Date.now(),
|
|
2448
|
-
content: `status was changed from ${this.status} to ${status}`,
|
|
2449
|
-
});
|
|
2450
|
-
this.status = status;
|
|
2451
|
-
if (error) {
|
|
2452
|
-
if (typeof error == "string") {
|
|
2453
|
-
this.error = { message: error };
|
|
2454
|
-
} else if (error.message || error.response?.data) {
|
|
2455
|
-
this.error = {
|
|
2456
|
-
// json: error.toJSON ? error.toJSON() : undefined,
|
|
2457
|
-
message: error.message,
|
|
2458
|
-
responseData: error.response?.data,
|
|
2459
|
-
};
|
|
2460
|
-
} else {
|
|
2461
|
-
this.error = error;
|
|
2462
|
-
}
|
|
2463
|
-
return this;
|
|
2464
|
-
}
|
|
2465
|
-
return this;
|
|
2466
|
-
}
|
|
2467
|
-
setBody(body) {
|
|
2468
|
-
this.body = body;
|
|
2469
|
-
return this;
|
|
2470
|
-
}
|
|
2471
|
-
setMeta(meta) {
|
|
2472
|
-
this.meta = meta;
|
|
2473
|
-
return this;
|
|
2474
|
-
}
|
|
2475
|
-
async commit() {
|
|
2476
|
-
let doc = {
|
|
2477
|
-
available_app_name: this.available_app_name,
|
|
2478
|
-
available_app_id: this.available_app_id,
|
|
2479
|
-
app_id: this.app_id,
|
|
2480
|
-
action: this.action,
|
|
2481
|
-
company_namespace: this.company_namespace,
|
|
2482
|
-
status: this.status,
|
|
2483
|
-
error: this.error ? this.error : undefined,
|
|
2484
|
-
start_time: this.start_time,
|
|
2485
|
-
end_time: Date.now(),
|
|
2486
|
-
total_time: Date.now() - this.start_time,
|
|
2487
|
-
body: this.body,
|
|
2488
|
-
meta: this.meta,
|
|
2489
|
-
message: this.message,
|
|
2490
|
-
details: this.details,
|
|
2491
|
-
sync_id: this.sync_id,
|
|
2492
|
-
};
|
|
2493
|
-
try {
|
|
2494
|
-
const res = await this.superThis._create(
|
|
2495
|
-
this.superThis.svAPIEndpoint,
|
|
2496
|
-
this._path,
|
|
2497
|
-
doc
|
|
2498
|
-
);
|
|
2499
|
-
} catch (e) {
|
|
2500
|
-
console.error(e);
|
|
1396
|
+
constructor(superThis, sync_id) {
|
|
1397
|
+
this.superThis = superThis;
|
|
1398
|
+
this._path = "integration-action-log";
|
|
1399
|
+
this.available_app_name = "";
|
|
1400
|
+
this.available_app_id = "";
|
|
1401
|
+
this.app_id = "";
|
|
1402
|
+
this.action = "";
|
|
1403
|
+
this.start_time = Date.now();
|
|
1404
|
+
this.status = "processing";
|
|
1405
|
+
this.message = "Log Created";
|
|
1406
|
+
this.details = [];
|
|
1407
|
+
this.sync_id = sync_id;
|
|
1408
|
+
this.isOld = true;
|
|
2501
1409
|
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
};
|
|
2509
|
-
this.message = detail;
|
|
2510
|
-
if (meta) d.meta = meta;
|
|
2511
|
-
this.details.push(d);
|
|
2512
|
-
return this;
|
|
2513
|
-
}
|
|
2514
|
-
};
|
|
2515
|
-
Repzo.CommandLog = class {
|
|
2516
|
-
constructor(superThis, app, command, trigger) {
|
|
2517
|
-
this.superThis = superThis;
|
|
2518
|
-
this._path = "/integration-command-log";
|
|
2519
|
-
this.app_id = app._id;
|
|
2520
|
-
this.available_app_id = app.available_app._id;
|
|
2521
|
-
this.available_app_name = app.available_app.name;
|
|
2522
|
-
this.company_namespace = app.company_namespace;
|
|
2523
|
-
this.start_time = Date.now();
|
|
2524
|
-
this.status = "received";
|
|
2525
|
-
this.message = "Request received";
|
|
2526
|
-
this.command = command;
|
|
2527
|
-
this.details = [{ timestamp: Date.now(), content: "Request received" }];
|
|
2528
|
-
this.sync_id = uuid();
|
|
2529
|
-
this.isOld = false;
|
|
2530
|
-
this.isPrioritized = false;
|
|
2531
|
-
this.retries = 1;
|
|
2532
|
-
this.trigger = trigger;
|
|
2533
|
-
this.onGoing = true;
|
|
2534
|
-
this.sync_details = [];
|
|
2535
|
-
this.error_details = [];
|
|
2536
|
-
}
|
|
2537
|
-
async load(sync_id, retries) {
|
|
2538
|
-
if (sync_id) {
|
|
2539
|
-
const params = { sync_id: sync_id };
|
|
2540
|
-
const res = await this.superThis._fetch(
|
|
2541
|
-
this.superThis.svAPIEndpoint,
|
|
2542
|
-
this._path,
|
|
2543
|
-
params
|
|
2544
|
-
);
|
|
2545
|
-
if (!res?.data?.length)
|
|
2546
|
-
throw new Error(`Command Log Not found, sync_id: ${sync_id}`);
|
|
2547
|
-
const command_log = res.data[0];
|
|
2548
|
-
if (command_log) {
|
|
1410
|
+
async load(sync_id) {
|
|
1411
|
+
const params = { sync_id: sync_id };
|
|
1412
|
+
const res = await this.superThis._fetch(this.superThis.svAPIEndpoint, this._path, params);
|
|
1413
|
+
if (!res?.data?.length)
|
|
1414
|
+
throw new Error(`Action Log Not found, sync_id: ${sync_id}`);
|
|
1415
|
+
const action_log = res.data[0];
|
|
2549
1416
|
this.sync_id = sync_id;
|
|
2550
|
-
this.details =
|
|
2551
|
-
this.status =
|
|
2552
|
-
this.error =
|
|
2553
|
-
this.start_time =
|
|
2554
|
-
this.body =
|
|
2555
|
-
this.meta =
|
|
2556
|
-
this.message =
|
|
2557
|
-
this.
|
|
2558
|
-
|
|
1417
|
+
this.details = action_log.details;
|
|
1418
|
+
this.status = action_log.status;
|
|
1419
|
+
this.error = action_log.error;
|
|
1420
|
+
this.start_time = action_log.start_time;
|
|
1421
|
+
this.body = action_log.body;
|
|
1422
|
+
this.meta = action_log.meta;
|
|
1423
|
+
this.message = action_log.message;
|
|
1424
|
+
this.app_id = action_log.app_id;
|
|
1425
|
+
this.available_app_id = action_log.available_app_id;
|
|
1426
|
+
this.available_app_name = action_log.available_app_name;
|
|
1427
|
+
this.company_namespace = action_log.company_namespace;
|
|
1428
|
+
this.action = action_log.action;
|
|
2559
1429
|
this.isOld = true;
|
|
2560
|
-
this
|
|
2561
|
-
this.succeededAt = command_log.succeededAt;
|
|
2562
|
-
this.skippedAt = command_log.skippedAt;
|
|
2563
|
-
this.receivedAt = command_log.receivedAt;
|
|
2564
|
-
this.processedAt = command_log.processedAt;
|
|
2565
|
-
this.onGoing = command_log.onGoing || false;
|
|
2566
|
-
this.trigger = command_log.trigger;
|
|
2567
|
-
this.sync_details = command_log.sync_details;
|
|
2568
|
-
this.error_details = command_log.error_details;
|
|
2569
|
-
// this.priority = command_log.priority
|
|
2570
|
-
// ? command_log.priority
|
|
2571
|
-
// : this.priority
|
|
2572
|
-
// ? this.priority
|
|
2573
|
-
// : undefined;
|
|
2574
|
-
}
|
|
1430
|
+
return this;
|
|
2575
1431
|
}
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
];
|
|
2600
|
-
return this;
|
|
1432
|
+
setStatus(status, error) {
|
|
1433
|
+
this.details.push({
|
|
1434
|
+
timestamp: Date.now(),
|
|
1435
|
+
content: `status was changed from ${this.status} to ${status}`,
|
|
1436
|
+
});
|
|
1437
|
+
this.status = status;
|
|
1438
|
+
if (error) {
|
|
1439
|
+
if (typeof error == "string") {
|
|
1440
|
+
this.error = { message: error };
|
|
1441
|
+
}
|
|
1442
|
+
else if (error.message || error.response?.data) {
|
|
1443
|
+
this.error = {
|
|
1444
|
+
// json: error.toJSON ? error.toJSON() : undefined,
|
|
1445
|
+
message: error.message,
|
|
1446
|
+
responseData: error.response?.data,
|
|
1447
|
+
};
|
|
1448
|
+
}
|
|
1449
|
+
else {
|
|
1450
|
+
this.error = error;
|
|
1451
|
+
}
|
|
1452
|
+
return this;
|
|
1453
|
+
}
|
|
1454
|
+
return this;
|
|
2601
1455
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
this
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
this
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
1456
|
+
setBody(body) {
|
|
1457
|
+
this.body = body;
|
|
1458
|
+
return this;
|
|
1459
|
+
}
|
|
1460
|
+
setMeta(meta) {
|
|
1461
|
+
this.meta = meta;
|
|
1462
|
+
return this;
|
|
1463
|
+
}
|
|
1464
|
+
async commit() {
|
|
1465
|
+
let doc = {
|
|
1466
|
+
available_app_name: this.available_app_name,
|
|
1467
|
+
available_app_id: this.available_app_id,
|
|
1468
|
+
app_id: this.app_id,
|
|
1469
|
+
action: this.action,
|
|
1470
|
+
company_namespace: this.company_namespace,
|
|
1471
|
+
status: this.status,
|
|
1472
|
+
error: this.error ? this.error : undefined,
|
|
1473
|
+
start_time: this.start_time,
|
|
1474
|
+
end_time: Date.now(),
|
|
1475
|
+
total_time: Date.now() - this.start_time,
|
|
1476
|
+
body: this.body,
|
|
1477
|
+
meta: this.meta,
|
|
1478
|
+
message: this.message,
|
|
1479
|
+
details: this.details,
|
|
1480
|
+
sync_id: this.sync_id,
|
|
1481
|
+
};
|
|
1482
|
+
try {
|
|
1483
|
+
const res = await this.superThis._create(this.superThis.svAPIEndpoint, this._path, doc);
|
|
1484
|
+
}
|
|
1485
|
+
catch (e) {
|
|
1486
|
+
console.error(e);
|
|
1487
|
+
}
|
|
1488
|
+
return this;
|
|
1489
|
+
}
|
|
1490
|
+
addDetail(detail, meta) {
|
|
1491
|
+
let d = {
|
|
1492
|
+
timestamp: Date.now(),
|
|
1493
|
+
content: detail,
|
|
1494
|
+
};
|
|
1495
|
+
this.message = detail;
|
|
1496
|
+
if (meta)
|
|
1497
|
+
d.meta = meta;
|
|
1498
|
+
this.details.push(d);
|
|
1499
|
+
return this;
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
Repzo.CommandLog = class {
|
|
1503
|
+
constructor(superThis, app, command, trigger) {
|
|
1504
|
+
this.superThis = superThis;
|
|
1505
|
+
this._path = "integration-command-log";
|
|
1506
|
+
this.app_id = app._id;
|
|
1507
|
+
this.available_app_id = app.available_app._id;
|
|
1508
|
+
this.available_app_name = app.available_app.name;
|
|
1509
|
+
this.company_namespace = app.company_namespace;
|
|
1510
|
+
this.start_time = Date.now();
|
|
1511
|
+
this.status = "received";
|
|
1512
|
+
this.message = "Request received";
|
|
1513
|
+
this.command = command;
|
|
1514
|
+
this.details = [{ timestamp: Date.now(), content: "Request received" }];
|
|
1515
|
+
this.sync_id = uuid();
|
|
1516
|
+
this.isOld = false;
|
|
1517
|
+
this.isPrioritized = false;
|
|
1518
|
+
this.retries = 1;
|
|
1519
|
+
this.trigger = trigger;
|
|
2617
1520
|
this.onGoing = true;
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
1521
|
+
this.sync_details = [];
|
|
1522
|
+
this.error_details = [];
|
|
1523
|
+
}
|
|
1524
|
+
async load(sync_id, retries) {
|
|
1525
|
+
if (sync_id) {
|
|
1526
|
+
const params = { sync_id: sync_id };
|
|
1527
|
+
const res = await this.superThis._fetch(this.superThis.svAPIEndpoint, this._path, params);
|
|
1528
|
+
if (!res?.data?.length)
|
|
1529
|
+
throw new Error(`Command Log Not found, sync_id: ${sync_id}`);
|
|
1530
|
+
const command_log = res.data[0];
|
|
1531
|
+
if (command_log) {
|
|
1532
|
+
this.sync_id = sync_id;
|
|
1533
|
+
this.details = command_log.details;
|
|
1534
|
+
this.status = command_log.status;
|
|
1535
|
+
this.error = command_log.error;
|
|
1536
|
+
this.start_time = command_log.start_time;
|
|
1537
|
+
this.body = command_log.body;
|
|
1538
|
+
this.meta = command_log.meta;
|
|
1539
|
+
this.message = command_log.message;
|
|
1540
|
+
this.retries =
|
|
1541
|
+
retries !== undefined
|
|
1542
|
+
? retries
|
|
1543
|
+
: command_log.retries || this.retries; // retries !== undefined ? retries : command_log.retries;
|
|
1544
|
+
this.isOld = true;
|
|
1545
|
+
this.failedAt = command_log.failedAt;
|
|
1546
|
+
this.succeededAt = command_log.succeededAt;
|
|
1547
|
+
this.skippedAt = command_log.skippedAt;
|
|
1548
|
+
this.receivedAt = command_log.receivedAt;
|
|
1549
|
+
this.processedAt = command_log.processedAt;
|
|
1550
|
+
this.onGoing = command_log.onGoing || false;
|
|
1551
|
+
this.trigger = command_log.trigger;
|
|
1552
|
+
this.sync_details = command_log.sync_details;
|
|
1553
|
+
this.error_details = command_log.error_details;
|
|
1554
|
+
// this.priority = command_log.priority
|
|
1555
|
+
// ? command_log.priority
|
|
1556
|
+
// : this.priority
|
|
1557
|
+
// ? this.priority
|
|
1558
|
+
// : undefined;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
return this;
|
|
1562
|
+
}
|
|
1563
|
+
setStatus(status, error) {
|
|
1564
|
+
this.addDetail(`status was changed from ${this.status} to ${status}`);
|
|
1565
|
+
this.status = status;
|
|
1566
|
+
if (error) {
|
|
1567
|
+
if (!this.error_details)
|
|
1568
|
+
this.error_details = [];
|
|
1569
|
+
if (typeof error == "string") {
|
|
1570
|
+
this.error = { message: error };
|
|
1571
|
+
}
|
|
1572
|
+
else if (error.message || error.response?.data) {
|
|
1573
|
+
this.error = {
|
|
1574
|
+
// json: error.toJSON ? error.toJSON() : undefined,
|
|
1575
|
+
message: error.message,
|
|
1576
|
+
responseData: error.response?.data,
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
else {
|
|
1580
|
+
this.error = error;
|
|
1581
|
+
}
|
|
1582
|
+
this.error_details = [
|
|
1583
|
+
{
|
|
1584
|
+
timestamp: Date.now(),
|
|
1585
|
+
error: this.error,
|
|
1586
|
+
},
|
|
1587
|
+
];
|
|
1588
|
+
return this;
|
|
1589
|
+
}
|
|
1590
|
+
switch (status) {
|
|
1591
|
+
case "fail":
|
|
1592
|
+
this.failedAt = new Date();
|
|
1593
|
+
this.onGoing = false;
|
|
1594
|
+
break;
|
|
1595
|
+
case "processing":
|
|
1596
|
+
this.processedAt = new Date();
|
|
1597
|
+
this.onGoing = true;
|
|
1598
|
+
break;
|
|
1599
|
+
case "queued":
|
|
1600
|
+
this.queuedAt = new Date();
|
|
1601
|
+
this.onGoing = true;
|
|
1602
|
+
break;
|
|
1603
|
+
case "received":
|
|
1604
|
+
this.receivedAt = new Date();
|
|
1605
|
+
this.onGoing = true;
|
|
1606
|
+
break;
|
|
1607
|
+
case "skipped":
|
|
1608
|
+
this.skippedAt = new Date();
|
|
1609
|
+
this.onGoing = false;
|
|
1610
|
+
break;
|
|
1611
|
+
case "success":
|
|
1612
|
+
this.succeededAt = new Date();
|
|
1613
|
+
this.onGoing = false;
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
return this;
|
|
1617
|
+
}
|
|
1618
|
+
setBody(body) {
|
|
1619
|
+
this.body = body;
|
|
1620
|
+
if (!this.sync_details)
|
|
1621
|
+
this.sync_details = [];
|
|
1622
|
+
this.sync_details = [
|
|
1623
|
+
{
|
|
1624
|
+
timestamp: Date.now(),
|
|
1625
|
+
body: this.body,
|
|
1626
|
+
},
|
|
1627
|
+
];
|
|
1628
|
+
return this;
|
|
1629
|
+
}
|
|
1630
|
+
setMeta(meta) {
|
|
1631
|
+
this.meta = meta;
|
|
1632
|
+
return this;
|
|
1633
|
+
}
|
|
1634
|
+
async commit() {
|
|
1635
|
+
let doc = {
|
|
1636
|
+
available_app_name: this.available_app_name,
|
|
1637
|
+
available_app_id: this.available_app_id,
|
|
1638
|
+
app_id: this.app_id,
|
|
1639
|
+
command: this.command,
|
|
1640
|
+
status: this.status,
|
|
1641
|
+
error: this.error ? this.error : undefined,
|
|
1642
|
+
start_time: this.start_time,
|
|
1643
|
+
end_time: Date.now(),
|
|
1644
|
+
total_time: Date.now() - this.start_time,
|
|
1645
|
+
company_namespace: this.company_namespace,
|
|
1646
|
+
body: this.body,
|
|
1647
|
+
meta: this.meta,
|
|
1648
|
+
message: this.message,
|
|
1649
|
+
details: this.details,
|
|
1650
|
+
sync_id: this.sync_id,
|
|
1651
|
+
// priority: this.priority ? this.priority : undefined,
|
|
1652
|
+
queuedAt: this.queuedAt ? this.queuedAt : undefined,
|
|
1653
|
+
failedAt: this.failedAt ? this.failedAt : undefined,
|
|
1654
|
+
succeededAt: this.succeededAt ? this.succeededAt : undefined,
|
|
1655
|
+
skippedAt: this.skippedAt ? this.skippedAt : undefined,
|
|
1656
|
+
receivedAt: this.receivedAt ? this.receivedAt : undefined,
|
|
1657
|
+
processedAt: this.processedAt ? this.processedAt : undefined,
|
|
1658
|
+
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
1659
|
+
retries: this.retries !== undefined ? this.retries : undefined,
|
|
1660
|
+
trigger: this.trigger,
|
|
1661
|
+
sync_details: this.sync_details,
|
|
1662
|
+
error_details: this.error_details,
|
|
1663
|
+
};
|
|
1664
|
+
try {
|
|
1665
|
+
const res = await this.superThis._create(this.superThis.svAPIEndpoint, this._path, doc);
|
|
1666
|
+
this.isOld = true;
|
|
1667
|
+
}
|
|
1668
|
+
catch (e) {
|
|
1669
|
+
console.error(e);
|
|
1670
|
+
}
|
|
1671
|
+
return this;
|
|
2627
1672
|
}
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
}
|
|
2641
|
-
setMeta(meta) {
|
|
2642
|
-
this.meta = meta;
|
|
2643
|
-
return this;
|
|
2644
|
-
}
|
|
2645
|
-
async commit() {
|
|
2646
|
-
let doc = {
|
|
2647
|
-
available_app_name: this.available_app_name,
|
|
2648
|
-
available_app_id: this.available_app_id,
|
|
2649
|
-
app_id: this.app_id,
|
|
2650
|
-
command: this.command,
|
|
2651
|
-
status: this.status,
|
|
2652
|
-
error: this.error ? this.error : undefined,
|
|
2653
|
-
start_time: this.start_time,
|
|
2654
|
-
end_time: Date.now(),
|
|
2655
|
-
total_time: Date.now() - this.start_time,
|
|
2656
|
-
company_namespace: this.company_namespace,
|
|
2657
|
-
body: this.body,
|
|
2658
|
-
meta: this.meta,
|
|
2659
|
-
message: this.message,
|
|
2660
|
-
details: this.details,
|
|
2661
|
-
sync_id: this.sync_id,
|
|
2662
|
-
// priority: this.priority ? this.priority : undefined,
|
|
2663
|
-
queuedAt: this.queuedAt ? this.queuedAt : undefined,
|
|
2664
|
-
failedAt: this.failedAt ? this.failedAt : undefined,
|
|
2665
|
-
succeededAt: this.succeededAt ? this.succeededAt : undefined,
|
|
2666
|
-
skippedAt: this.skippedAt ? this.skippedAt : undefined,
|
|
2667
|
-
receivedAt: this.receivedAt ? this.receivedAt : undefined,
|
|
2668
|
-
processedAt: this.processedAt ? this.processedAt : undefined,
|
|
2669
|
-
onGoing: this.onGoing !== undefined ? this.onGoing : undefined,
|
|
2670
|
-
retries: this.retries !== undefined ? this.retries : undefined,
|
|
2671
|
-
trigger: this.trigger,
|
|
2672
|
-
sync_details: this.sync_details,
|
|
2673
|
-
error_details: this.error_details,
|
|
2674
|
-
};
|
|
2675
|
-
try {
|
|
2676
|
-
const res = await this.superThis._create(
|
|
2677
|
-
this.superThis.svAPIEndpoint,
|
|
2678
|
-
this._path,
|
|
2679
|
-
doc
|
|
2680
|
-
);
|
|
2681
|
-
this.isOld = true;
|
|
2682
|
-
} catch (e) {
|
|
2683
|
-
console.error(e);
|
|
1673
|
+
addDetail(detail, meta) {
|
|
1674
|
+
if (!this.details)
|
|
1675
|
+
this.details = [];
|
|
1676
|
+
this.details = [
|
|
1677
|
+
{
|
|
1678
|
+
timestamp: Date.now(),
|
|
1679
|
+
content: detail,
|
|
1680
|
+
meta,
|
|
1681
|
+
},
|
|
1682
|
+
];
|
|
1683
|
+
this.message = detail;
|
|
1684
|
+
return this;
|
|
2684
1685
|
}
|
|
2685
|
-
return this;
|
|
2686
|
-
}
|
|
2687
|
-
addDetail(detail, meta) {
|
|
2688
|
-
if (!this.details) this.details = [];
|
|
2689
|
-
this.details = [
|
|
2690
|
-
{
|
|
2691
|
-
timestamp: Date.now(),
|
|
2692
|
-
content: detail,
|
|
2693
|
-
meta,
|
|
2694
|
-
},
|
|
2695
|
-
];
|
|
2696
|
-
this.message = detail;
|
|
2697
|
-
return this;
|
|
2698
|
-
}
|
|
2699
1686
|
};
|
|
2700
1687
|
export default Repzo;
|