repzo 1.0.92 → 1.0.94

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.js CHANGED
@@ -1,9 +1,81 @@
1
1
  import axios from "axios";
2
2
  import { v4 as uuid } from "uuid";
3
- export default class Repzo {
3
+ class Repzo {
4
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;
5
77
  this.client = {
6
- _path: "/client",
78
+ _path: this._end_points.CLIENT,
7
79
  find: async (params) => {
8
80
  let res = await this._fetch(
9
81
  this.svAPIEndpoint,
@@ -44,7 +116,7 @@ export default class Repzo {
44
116
  },
45
117
  };
46
118
  this.product = {
47
- _path: "/product",
119
+ _path: this._end_points.PRODUCT,
48
120
  find: async (params) => {
49
121
  let res = await this._fetch(
50
122
  this.svAPIEndpoint,
@@ -85,7 +157,7 @@ export default class Repzo {
85
157
  },
86
158
  };
87
159
  this.variant = {
88
- _path: "/variant",
160
+ _path: this._end_points.VARIANT,
89
161
  find: async (params) => {
90
162
  let res = await this._fetch(
91
163
  this.svAPIEndpoint,
@@ -126,7 +198,7 @@ export default class Repzo {
126
198
  },
127
199
  };
128
200
  this.category = {
129
- _path: "/product-category",
201
+ _path: this._end_points.CATEGORY,
130
202
  find: async (params) => {
131
203
  let res = await this._fetch(
132
204
  this.svAPIEndpoint,
@@ -166,7 +238,7 @@ export default class Repzo {
166
238
  },
167
239
  };
168
240
  this.sub_category = {
169
- _path: "/product-sub-category",
241
+ _path: this._end_points.SUB_CATEGORY,
170
242
  find: async (params) => {
171
243
  let res = await this._fetch(
172
244
  this.svAPIEndpoint,
@@ -207,7 +279,7 @@ export default class Repzo {
207
279
  },
208
280
  };
209
281
  this.brand = {
210
- _path: "/product-brand",
282
+ _path: this._end_points.BRAND,
211
283
  find: async (params) => {
212
284
  let res = await this._fetch(
213
285
  this.svAPIEndpoint,
@@ -247,7 +319,7 @@ export default class Repzo {
247
319
  },
248
320
  };
249
321
  this.product_group = {
250
- _path: "/product-group",
322
+ _path: this._end_points.PRODUCT_GROUP,
251
323
  find: async (params) => {
252
324
  let res = await this._fetch(
253
325
  this.svAPIEndpoint,
@@ -287,7 +359,7 @@ export default class Repzo {
287
359
  },
288
360
  };
289
361
  this.tax = {
290
- _path: "/tax",
362
+ _path: this._end_points.TAX,
291
363
  find: async (params) => {
292
364
  let res = await this._fetch(this.svAPIEndpoint, this.tax._path, params);
293
365
  return res;
@@ -316,7 +388,7 @@ export default class Repzo {
316
388
  },
317
389
  };
318
390
  this.measureunit = {
319
- _path: "/measureunits",
391
+ _path: this._end_points.MEASUREUNIT,
320
392
  find: async (params) => {
321
393
  let res = await this._fetch(
322
394
  this.svAPIEndpoint,
@@ -356,7 +428,7 @@ export default class Repzo {
356
428
  },
357
429
  };
358
430
  this.measureunitFamily = {
359
- _path: "/measureunit-family",
431
+ _path: this._end_points.MEASUREUNIT_FAMILY,
360
432
  find: async (params) => {
361
433
  let res = await this._fetch(
362
434
  this.svAPIEndpoint,
@@ -396,7 +468,7 @@ export default class Repzo {
396
468
  },
397
469
  };
398
470
  this.media = {
399
- _path: "/media",
471
+ _path: this._end_points.MEDIA,
400
472
  find: async (params) => {
401
473
  let res = await this._fetch(
402
474
  this.svAPIEndpoint,
@@ -436,7 +508,7 @@ export default class Repzo {
436
508
  },
437
509
  };
438
510
  this.priceList = {
439
- _path: "/pricelists",
511
+ _path: this._end_points.PRICELIST,
440
512
  find: async (params) => {
441
513
  let res = await this._fetch(
442
514
  this.svAPIEndpoint,
@@ -476,7 +548,7 @@ export default class Repzo {
476
548
  },
477
549
  };
478
550
  this.priceListItem = {
479
- _path: "/pricelistsitems",
551
+ _path: this._end_points.PRICELIST_ITEM,
480
552
  find: async (params) => {
481
553
  let res = await this._fetch(
482
554
  this.svAPIEndpoint,
@@ -516,7 +588,7 @@ export default class Repzo {
516
588
  },
517
589
  };
518
590
  this.team = {
519
- _path: "/teams",
591
+ _path: this._end_points.TEAM,
520
592
  find: async (params) => {
521
593
  let res = await this._fetch(
522
594
  this.svAPIEndpoint,
@@ -552,7 +624,7 @@ export default class Repzo {
552
624
  },
553
625
  };
554
626
  this.returnReason = {
555
- _path: "/return-reason",
627
+ _path: this._end_points.RETURN_REASON,
556
628
  find: async (params) => {
557
629
  let res = await this._fetch(
558
630
  this.svAPIEndpoint,
@@ -592,7 +664,7 @@ export default class Repzo {
592
664
  },
593
665
  };
594
666
  this.rep = {
595
- _path: "/rep",
667
+ _path: this._end_points.REP,
596
668
  find: async (params) => {
597
669
  let res = await this._fetch(this.svAPIEndpoint, this.rep._path, params);
598
670
  return res;
@@ -625,7 +697,7 @@ export default class Repzo {
625
697
  },
626
698
  };
627
699
  this.tag = {
628
- _path: "/tag",
700
+ _path: this._end_points.TAG,
629
701
  find: async (params) => {
630
702
  let res = await this._fetch(this.svAPIEndpoint, this.tag._path, params);
631
703
  return res;
@@ -654,7 +726,7 @@ export default class Repzo {
654
726
  },
655
727
  };
656
728
  this.warehouse = {
657
- _path: "/warehouse",
729
+ _path: this._end_points.WAREHOUSE,
658
730
  find: async (params) => {
659
731
  let res = await this._fetch(
660
732
  this.svAPIEndpoint,
@@ -694,7 +766,7 @@ export default class Repzo {
694
766
  },
695
767
  };
696
768
  this.route = {
697
- _path: "/route",
769
+ _path: this._end_points.ROUTE,
698
770
  find: async (params) => {
699
771
  let res = await this._fetch(
700
772
  this.svAPIEndpoint,
@@ -734,7 +806,7 @@ export default class Repzo {
734
806
  },
735
807
  };
736
808
  this.productModifiersGroup = {
737
- _path: "/product-modifiers-group",
809
+ _path: this._end_points.PRODUCT_MODIFIERS_GROUP,
738
810
  find: async (params) => {
739
811
  let res = await this._fetch(
740
812
  this.svAPIEndpoint,
@@ -774,7 +846,7 @@ export default class Repzo {
774
846
  },
775
847
  };
776
848
  this.channel = {
777
- _path: "/client-channel",
849
+ _path: this._end_points.CHANNEL,
778
850
  find: async (params) => {
779
851
  let res = await this._fetch(
780
852
  this.svAPIEndpoint,
@@ -814,7 +886,7 @@ export default class Repzo {
814
886
  },
815
887
  };
816
888
  this.speciality = {
817
- _path: "/speciality",
889
+ _path: this._end_points.SPECIALITY,
818
890
  find: async (params) => {
819
891
  let res = await this._fetch(
820
892
  this.svAPIEndpoint,
@@ -854,7 +926,7 @@ export default class Repzo {
854
926
  },
855
927
  };
856
928
  this.clientContact = {
857
- _path: "/client-contact",
929
+ _path: this._end_points.CLIENT_CONTACT,
858
930
  find: async (params) => {
859
931
  let res = await this._fetch(
860
932
  this.svAPIEndpoint,
@@ -894,7 +966,7 @@ export default class Repzo {
894
966
  },
895
967
  };
896
968
  this.paymentTerm = {
897
- _path: "/paymentterms",
969
+ _path: this._end_points.PAYMENT_TERM,
898
970
  find: async (params) => {
899
971
  let res = await this._fetch(
900
972
  this.svAPIEndpoint,
@@ -934,7 +1006,7 @@ export default class Repzo {
934
1006
  },
935
1007
  };
936
1008
  this.bank = {
937
- _path: "/banks",
1009
+ _path: this._end_points.BANK,
938
1010
  find: async (params) => {
939
1011
  let res = await this._fetch(
940
1012
  this.svAPIEndpoint,
@@ -963,7 +1035,7 @@ export default class Repzo {
963
1035
  },
964
1036
  };
965
1037
  this.bank_list = {
966
- _path: "/bankslists",
1038
+ _path: this._end_points.BANK_LIST,
967
1039
  find: async (params) => {
968
1040
  let res = await this._fetch(
969
1041
  this.svAPIEndpoint,
@@ -996,7 +1068,7 @@ export default class Repzo {
996
1068
  },
997
1069
  };
998
1070
  this.customStatus = {
999
- _path: "/custom-status",
1071
+ _path: this._end_points.CUSTOM_STATUS,
1000
1072
  find: async (params) => {
1001
1073
  let res = await this._fetch(
1002
1074
  this.svAPIEndpoint,
@@ -1036,7 +1108,7 @@ export default class Repzo {
1036
1108
  },
1037
1109
  };
1038
1110
  this.customList = {
1039
- _path: "/custom-list",
1111
+ _path: this._end_points.CUSTOM_LIST,
1040
1112
  find: async (params) => {
1041
1113
  let res = await this._fetch(
1042
1114
  this.svAPIEndpoint,
@@ -1077,7 +1149,7 @@ export default class Repzo {
1077
1149
  },
1078
1150
  };
1079
1151
  this.customListItem = {
1080
- _path: "/custom-list-item",
1152
+ _path: this._end_points.CUSTOM_LIST_ITEM,
1081
1153
  find: async (params) => {
1082
1154
  let res = await this._fetch(
1083
1155
  this.svAPIEndpoint,
@@ -1118,7 +1190,7 @@ export default class Repzo {
1118
1190
  },
1119
1191
  };
1120
1192
  this.inventoryAdjustmentReason = {
1121
- _path: "/inventory-adjustment-reason",
1193
+ _path: this._end_points.INVENTORY_ADJUSTMENT_REASON,
1122
1194
  find: async (params) => {
1123
1195
  let res = await this._fetch(
1124
1196
  this.svAPIEndpoint,
@@ -1158,7 +1230,7 @@ export default class Repzo {
1158
1230
  },
1159
1231
  };
1160
1232
  this.workorder = {
1161
- _path: "/workorder",
1233
+ _path: this._end_points.WORKORDER,
1162
1234
  find: async (params) => {
1163
1235
  let res = await this._fetch(
1164
1236
  this.svAPIEndpoint,
@@ -1176,7 +1248,7 @@ export default class Repzo {
1176
1248
  },
1177
1249
  };
1178
1250
  this.supplier = {
1179
- _path: "/supplier",
1251
+ _path: this._end_points.SUPPLIER,
1180
1252
  find: async (params) => {
1181
1253
  let res = await this._fetch(
1182
1254
  this.svAPIEndpoint,
@@ -1210,7 +1282,7 @@ export default class Repzo {
1210
1282
  },
1211
1283
  };
1212
1284
  this.quickConvertToPdf = {
1213
- _path: "/quick-convert-to-pdf",
1285
+ _path: this._end_points.QUICK_CONVERT_TO_PDF,
1214
1286
  find: async (params) => {
1215
1287
  let res = await this._fetch(
1216
1288
  this.svAPIEndpoint,
@@ -1243,7 +1315,7 @@ export default class Repzo {
1243
1315
  },
1244
1316
  };
1245
1317
  this.visit = {
1246
- _path: "/visit",
1318
+ _path: this._end_points.VISIT,
1247
1319
  find: async (params) => {
1248
1320
  let res = await this._fetch(
1249
1321
  this.svAPIEndpoint,
@@ -1277,7 +1349,7 @@ export default class Repzo {
1277
1349
  },
1278
1350
  };
1279
1351
  this.invoice = {
1280
- _path: "/fullinvoices",
1352
+ _path: this._end_points.INVOICE,
1281
1353
  find: async (params) => {
1282
1354
  let res = await this._fetch(
1283
1355
  this.svAPIEndpoint,
@@ -1311,7 +1383,7 @@ export default class Repzo {
1311
1383
  },
1312
1384
  };
1313
1385
  this.proforma = {
1314
- _path: "/proforma",
1386
+ _path: this._end_points.PROFORMA,
1315
1387
  find: async (params) => {
1316
1388
  let res = await this._fetch(
1317
1389
  this.svAPIEndpoint,
@@ -1345,7 +1417,7 @@ export default class Repzo {
1345
1417
  },
1346
1418
  };
1347
1419
  this.payment = {
1348
- _path: "/payments",
1420
+ _path: this._end_points.PAYMENT,
1349
1421
  find: async (params) => {
1350
1422
  let res = await this._fetch(
1351
1423
  this.svAPIEndpoint,
@@ -1379,7 +1451,7 @@ export default class Repzo {
1379
1451
  },
1380
1452
  };
1381
1453
  this.refund = {
1382
- _path: "/refund",
1454
+ _path: this._end_points.REFUND,
1383
1455
  find: async (params) => {
1384
1456
  let res = await this._fetch(
1385
1457
  this.svAPIEndpoint,
@@ -1413,7 +1485,7 @@ export default class Repzo {
1413
1485
  },
1414
1486
  };
1415
1487
  this.settlement = {
1416
- _path: "/settlement",
1488
+ _path: this._end_points.SETTLEMENT,
1417
1489
  find: async (params) => {
1418
1490
  let res = await this._fetch(
1419
1491
  this.svAPIEndpoint,
@@ -1439,7 +1511,7 @@ export default class Repzo {
1439
1511
  },
1440
1512
  };
1441
1513
  this.check = {
1442
- _path: "/checks",
1514
+ _path: this._end_points.CHECK,
1443
1515
  find: async (params) => {
1444
1516
  let res = await this._fetch(
1445
1517
  this.svAPIEndpoint,
@@ -1465,7 +1537,7 @@ export default class Repzo {
1465
1537
  },
1466
1538
  };
1467
1539
  this.day = {
1468
- _path: "/day",
1540
+ _path: this._end_points.DAY,
1469
1541
  find: async (params) => {
1470
1542
  let res = await this._fetch(this.svAPIEndpoint, this.day._path, params);
1471
1543
  return res;
@@ -1483,7 +1555,7 @@ export default class Repzo {
1483
1555
  },
1484
1556
  };
1485
1557
  this.receivingMaterial = {
1486
- _path: "/receiving-material",
1558
+ _path: this._end_points.RECEIVING_MATERIAL,
1487
1559
  find: async (params) => {
1488
1560
  let res = await this._fetch(
1489
1561
  this.svAPIEndpoint,
@@ -1517,7 +1589,7 @@ export default class Repzo {
1517
1589
  },
1518
1590
  };
1519
1591
  this.adjustAccount = {
1520
- _path: "/adjust-account",
1592
+ _path: this._end_points.ADJUST_ACCOUNT,
1521
1593
  find: async (params) => {
1522
1594
  let res = await this._fetch(
1523
1595
  this.svAPIEndpoint,
@@ -1543,7 +1615,7 @@ export default class Repzo {
1543
1615
  },
1544
1616
  };
1545
1617
  this.transfer = {
1546
- _path: "/transfer",
1618
+ _path: this._end_points.TRANSFER,
1547
1619
  find: async (params) => {
1548
1620
  let res = await this._fetch(
1549
1621
  this.svAPIEndpoint,
@@ -1577,7 +1649,7 @@ export default class Repzo {
1577
1649
  },
1578
1650
  };
1579
1651
  this.msl = {
1580
- _path: "/msl",
1652
+ _path: this._end_points.MSL,
1581
1653
  find: async (params) => {
1582
1654
  let res = await this._fetch(this.svAPIEndpoint, this.msl._path, params);
1583
1655
  return res;
@@ -1610,7 +1682,7 @@ export default class Repzo {
1610
1682
  },
1611
1683
  };
1612
1684
  this.mslProduct = {
1613
- _path: "/msl-products",
1685
+ _path: this._end_points.MSL_PRODUCT,
1614
1686
  find: async (params) => {
1615
1687
  let res = await this._fetch(
1616
1688
  this.svAPIEndpoint,
@@ -1651,7 +1723,7 @@ export default class Repzo {
1651
1723
  },
1652
1724
  };
1653
1725
  this.mediaStorage = {
1654
- _path: "/media-storage",
1726
+ _path: this._end_points.MEDIA_STORAGE,
1655
1727
  find: async (params) => {
1656
1728
  let res = await this._fetch(
1657
1729
  this.svAPIEndpoint,
@@ -1692,7 +1764,7 @@ export default class Repzo {
1692
1764
  },
1693
1765
  };
1694
1766
  this.storecheckTemplate = {
1695
- _path: "/storecheck-template",
1767
+ _path: this._end_points.STORECHECK_TEMPLATE,
1696
1768
  find: async (params) => {
1697
1769
  let res = await this._fetch(
1698
1770
  this.svAPIEndpoint,
@@ -1733,7 +1805,7 @@ export default class Repzo {
1733
1805
  },
1734
1806
  };
1735
1807
  this.activityStorecheck = {
1736
- _path: "/activity-storecheck",
1808
+ _path: this._end_points.ACTIVITY_STORECHECK,
1737
1809
  find: async (params) => {
1738
1810
  let res = await this._fetch(
1739
1811
  this.svAPIEndpoint,
@@ -1767,7 +1839,7 @@ export default class Repzo {
1767
1839
  },
1768
1840
  };
1769
1841
  this.adjustInventory = {
1770
- _path: "/adjust-inventory",
1842
+ _path: this._end_points.ADJUST_INVENTORY,
1771
1843
  find: async (params) => {
1772
1844
  let res = await this._fetch(
1773
1845
  this.svAPIEndpoint,
@@ -1793,7 +1865,7 @@ export default class Repzo {
1793
1865
  },
1794
1866
  };
1795
1867
  this.inventory = {
1796
- _path: "/inventory",
1868
+ _path: this._end_points.INVENTORY,
1797
1869
  find: async (params) => {
1798
1870
  let res = await this._fetch(
1799
1871
  this.svAPIEndpoint,
@@ -1804,7 +1876,7 @@ export default class Repzo {
1804
1876
  },
1805
1877
  };
1806
1878
  this.integrationApp = {
1807
- _path: "/integration-app",
1879
+ _path: this._end_points.INTEGRATION_APP,
1808
1880
  find: async (params) => {
1809
1881
  let res = await this._fetch(
1810
1882
  this.svAPIEndpoint,
@@ -1838,7 +1910,7 @@ export default class Repzo {
1838
1910
  },
1839
1911
  };
1840
1912
  this.joinActionsWebHook = {
1841
- _path: "/svix-integration",
1913
+ _path: this._end_points.JOIN_ACTIONS_WEBHOOK,
1842
1914
  update: async (id, body) => {
1843
1915
  let res = await this._update(
1844
1916
  this.svAPIEndpoint,
@@ -1849,7 +1921,7 @@ export default class Repzo {
1849
1921
  },
1850
1922
  };
1851
1923
  this.patchAction = {
1852
- _path: "/patch-action",
1924
+ _path: this._end_points.PATCH_ACTION,
1853
1925
  create: async (body, params) => {
1854
1926
  const res = await this._create(
1855
1927
  this.svAPIEndpoint,
@@ -1869,7 +1941,7 @@ export default class Repzo {
1869
1941
  },
1870
1942
  };
1871
1943
  this.updateIntegrationMeta = {
1872
- _path: "/update-integration-meta",
1944
+ _path: this._end_points.UPDATE_INTEGRATION_META,
1873
1945
  create: async (body, params) => {
1874
1946
  let res = await this._create(
1875
1947
  this.svAPIEndpoint,
@@ -1881,7 +1953,7 @@ export default class Repzo {
1881
1953
  },
1882
1954
  };
1883
1955
  this.assetPartType = {
1884
- _path: "/asset-part-type",
1956
+ _path: this._end_points.ASSET_PART_TYPE,
1885
1957
  find: async (params) => {
1886
1958
  let res = await this._fetch(
1887
1959
  this.svAPIEndpoint,
@@ -1921,7 +1993,7 @@ export default class Repzo {
1921
1993
  },
1922
1994
  };
1923
1995
  this.assetPart = {
1924
- _path: "/asset-part",
1996
+ _path: this._end_points.ASSET_PART,
1925
1997
  find: async (params) => {
1926
1998
  let res = await this._fetch(
1927
1999
  this.svAPIEndpoint,
@@ -1961,7 +2033,7 @@ export default class Repzo {
1961
2033
  },
1962
2034
  };
1963
2035
  this.assetPartUnit = {
1964
- _path: "/asset-part-unit",
2036
+ _path: this._end_points.ASSET_PART_UNIT,
1965
2037
  find: async (params) => {
1966
2038
  let res = await this._fetch(
1967
2039
  this.svAPIEndpoint,
@@ -1986,7 +2058,7 @@ export default class Repzo {
1986
2058
  },
1987
2059
  };
1988
2060
  this.assetPartReceival = {
1989
- _path: "/asset-part-receival",
2061
+ _path: this._end_points.ASSET_PART_RECEIVAL,
1990
2062
  find: async (params) => {
1991
2063
  let res = await this._fetch(
1992
2064
  this.svAPIEndpoint,
@@ -2028,7 +2100,7 @@ export default class Repzo {
2028
2100
  },
2029
2101
  };
2030
2102
  this.assetPartTransfer = {
2031
- _path: "/asset-part-transfer",
2103
+ _path: this._end_points.ASSET_PART_TRANSFER,
2032
2104
  find: async (params) => {
2033
2105
  let res = await this._fetch(
2034
2106
  this.svAPIEndpoint,
@@ -2070,7 +2142,7 @@ export default class Repzo {
2070
2142
  },
2071
2143
  };
2072
2144
  this.returnAssetPartUnit = {
2073
- _path: "/return-asset-part-unit",
2145
+ _path: this._end_points.RETURN_ASSET_PART_UNIT,
2074
2146
  find: async (params) => {
2075
2147
  let res = await this._fetch(
2076
2148
  this.svAPIEndpoint,
@@ -2112,7 +2184,7 @@ export default class Repzo {
2112
2184
  },
2113
2185
  };
2114
2186
  this.storeAssetPartUnit = {
2115
- _path: "/store-asset-part-unit",
2187
+ _path: this._end_points.STORE_ASSET_PART_UNIT,
2116
2188
  find: async (params) => {
2117
2189
  let res = await this._fetch(
2118
2190
  this.svAPIEndpoint,
@@ -2154,7 +2226,7 @@ export default class Repzo {
2154
2226
  },
2155
2227
  };
2156
2228
  this.ocrInvoiceJobTemplate = {
2157
- _path: "/ocr-invoice-job-template",
2229
+ _path: this._end_points.OCR_INVOICE_JOB_TEMPLATE,
2158
2230
  find: async (params) => {
2159
2231
  let res = await this._fetch(
2160
2232
  this.svAPIEndpoint,
@@ -2187,7 +2259,7 @@ export default class Repzo {
2187
2259
  },
2188
2260
  };
2189
2261
  this.ocrInvoiceJobGroup = {
2190
- _path: "/ocr-invoice-job-group",
2262
+ _path: this._end_points.OCR_INVOICE_JOB_GROUP,
2191
2263
  find: async (params) => {
2192
2264
  let res = await this._fetch(
2193
2265
  this.svAPIEndpoint,
@@ -2212,7 +2284,7 @@ export default class Repzo {
2212
2284
  },
2213
2285
  };
2214
2286
  this.activityAiSalesOrder = {
2215
- _path: "/activity-ai-sales-order",
2287
+ _path: this._end_points.ACTIVITY_AI_SALES_ORDER,
2216
2288
  find: async (params) => {
2217
2289
  let res = await this._fetch(
2218
2290
  this.svAPIEndpoint,
@@ -2237,7 +2309,7 @@ export default class Repzo {
2237
2309
  },
2238
2310
  };
2239
2311
  this.ocrInvoiceJob = {
2240
- _path: "/ocr-invoice-job",
2312
+ _path: this._end_points.OCR_INVOICE_JOB,
2241
2313
  find: async (params) => {
2242
2314
  let res = await this._fetch(
2243
2315
  this.svAPIEndpoint,
@@ -2254,7 +2326,7 @@ export default class Repzo {
2254
2326
  },
2255
2327
  };
2256
2328
  this.ocrInvoiceJobPage = {
2257
- _path: "/ocr-invoice-job-page",
2329
+ _path: this._end_points.OCR_INVOICE_JOB_PAGE,
2258
2330
  find: async (params) => {
2259
2331
  let res = await this._fetch(
2260
2332
  this.svAPIEndpoint,
@@ -2294,35 +2366,35 @@ export default class Repzo {
2294
2366
  if (options?.headers) Object.assign(this.headers, options.headers);
2295
2367
  }
2296
2368
  async _fetch(baseUrl, path, params) {
2297
- let res = await axios.get(baseUrl + path, {
2369
+ let res = await axios.get(`${baseUrl}/${path}`, {
2298
2370
  params,
2299
2371
  headers: this.headers,
2300
2372
  });
2301
2373
  return res.data;
2302
2374
  }
2303
2375
  async _create(baseUrl, path, body, params) {
2304
- let res = await axios.post(baseUrl + path, body, {
2376
+ let res = await axios.post(`${baseUrl}/${path}`, body, {
2305
2377
  params,
2306
2378
  headers: this.headers,
2307
2379
  });
2308
2380
  return res.data;
2309
2381
  }
2310
2382
  async _update(baseUrl, path, body, params) {
2311
- let res = await axios.put(baseUrl + path, body, {
2383
+ let res = await axios.put(`${baseUrl}/${path}`, body, {
2312
2384
  params,
2313
2385
  headers: this.headers,
2314
2386
  });
2315
2387
  return res.data;
2316
2388
  }
2317
2389
  async _patch(baseUrl, path, body, params) {
2318
- let res = await axios.put(baseUrl + path, body, {
2390
+ let res = await axios.put(`${baseUrl}/${path}`, body, {
2319
2391
  params,
2320
2392
  headers: this.headers,
2321
2393
  });
2322
2394
  return res.data;
2323
2395
  }
2324
2396
  async _delete(baseUrl, path, params) {
2325
- let res = await axios.delete(baseUrl + path, {
2397
+ let res = await axios.delete(`${baseUrl}/${path}`, {
2326
2398
  params,
2327
2399
  headers: this.headers,
2328
2400
  });
@@ -2625,3 +2697,4 @@ Repzo.CommandLog = class {
2625
2697
  return this;
2626
2698
  }
2627
2699
  };
2700
+ export default Repzo;