@simpleapps-com/augur-server 2.0.3 → 2.0.4

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.
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  batchFetch
3
3
  } from "./chunk-XGRQ53P2.js";
4
+ import {
5
+ toListResult
6
+ } from "./chunk-OHBOKJCW.js";
4
7
 
5
8
  // src/environment.ts
6
9
  function getEnvironment() {
@@ -260,6 +263,8 @@ function createItemActions(api, config = {}) {
260
263
  const cat = category;
261
264
  return {
262
265
  ...cat,
266
+ // Normalize PHP-style `false` to `null` for categoryImage
267
+ categoryImage: cat.categoryImage || null,
263
268
  children: sortCategoryChildren(cat.children)
264
269
  };
265
270
  }
@@ -338,7 +343,7 @@ function createItemActions(api, config = {}) {
338
343
  categoryUid,
339
344
  { edgeCache }
340
345
  );
341
- return response.data.attributes;
346
+ return { attributes: response.data.attributes };
342
347
  },
343
348
  categoryUid
344
349
  );
@@ -395,7 +400,7 @@ function createItemActions(api, config = {}) {
395
400
  const response = await api.items.invMast.stock.get(invMastUid, {
396
401
  edgeCache
397
402
  });
398
- return response.data?.stockData ?? [];
403
+ return response.data ?? { stockData: [], companySummary: {} };
399
404
  },
400
405
  invMastUid
401
406
  );
@@ -423,7 +428,7 @@ function createItemActions(api, config = {}) {
423
428
  const response = await api.items.invMast.faq.list(invMastUid, {
424
429
  edgeCache: longEdgeCache
425
430
  });
426
- return response.data;
431
+ return toListResult(response);
427
432
  },
428
433
  invMastUid
429
434
  );
@@ -437,7 +442,7 @@ function createItemActions(api, config = {}) {
437
442
  const response = await api.items.invMast.invSub.list(invMastUid, {
438
443
  edgeCache: longEdgeCache
439
444
  });
440
- return response.data;
445
+ return toListResult(response);
441
446
  },
442
447
  invMastUid
443
448
  );
@@ -452,7 +457,7 @@ function createItemActions(api, config = {}) {
452
457
  invMastUid,
453
458
  { edgeCache }
454
459
  );
455
- return response.data;
460
+ return toListResult(response);
456
461
  },
457
462
  invMastUid
458
463
  );
@@ -466,7 +471,7 @@ function createItemActions(api, config = {}) {
466
471
  const response = await api.items.invMast.similar.list(invMastUid, {
467
472
  edgeCache: longEdgeCache
468
473
  });
469
- return response.data;
474
+ return toListResult(response);
470
475
  },
471
476
  invMastUid
472
477
  );
@@ -516,7 +521,7 @@ function createCommerceActions(api, config = {}) {
516
521
  }
517
522
  async function getCartLines(cartHdrUid) {
518
523
  const response = await api.commerce.cartLine.get(cartHdrUid);
519
- return response.data;
524
+ return toListResult(response);
520
525
  }
521
526
  async function addToCart(cartHdrUid, items) {
522
527
  try {
@@ -556,7 +561,7 @@ function createCommerceActions(api, config = {}) {
556
561
  }
557
562
  async function getCartAlsoBought(cartHdrUid) {
558
563
  const response = await api.commerce.cartHdr.alsoBought.get(cartHdrUid);
559
- return response.data;
564
+ return toListResult(response);
560
565
  }
561
566
  async function checkoutOrder(cartHdrUid, data) {
562
567
  try {
@@ -622,7 +627,7 @@ function createSearchActions(api, config = {}) {
622
627
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
623
628
  await openSearch.itemSearch.attributes.list(params)
624
629
  );
625
- return response.data.attributes;
630
+ return { attributes: response.data.attributes };
626
631
  },
627
632
  q
628
633
  );
@@ -739,7 +744,7 @@ function createShippingActions(api, config) {
739
744
  "ups.ratesShop.get",
740
745
  async () => {
741
746
  const response = await api.ups.ratesShop.get(params);
742
- return response.data;
747
+ return toListResult(response);
743
748
  },
744
749
  params
745
750
  );
@@ -792,7 +797,7 @@ function createJoomlaActions(api, config = {}) {
792
797
  ...params,
793
798
  edgeCache
794
799
  });
795
- return response.data;
800
+ return toListResult(response);
796
801
  },
797
802
  params
798
803
  );
@@ -806,7 +811,7 @@ function createJoomlaActions(api, config = {}) {
806
811
  published: 1,
807
812
  limit: 100
808
813
  };
809
- const items = await withServerCache(
814
+ const result = await withServerCache(
810
815
  cachePrefix,
811
816
  redisTtl,
812
817
  "joomla.menu.list",
@@ -815,12 +820,13 @@ function createJoomlaActions(api, config = {}) {
815
820
  ...sdkParams,
816
821
  edgeCache
817
822
  });
818
- return response.data;
823
+ return toListResult(response);
819
824
  },
820
825
  sdkParams
821
826
  );
822
827
  const pid = String(parentId);
823
- return items.filter((item) => String(item.parent_id) === pid);
828
+ const filtered = result.data.filter((item) => String(item.parent_id) === pid);
829
+ return { ...result, data: filtered, total: filtered.length };
824
830
  }
825
831
  return withServerCache(
826
832
  cachePrefix,
@@ -831,7 +837,7 @@ function createJoomlaActions(api, config = {}) {
831
837
  ...paramsOrParentId,
832
838
  edgeCache
833
839
  });
834
- return response.data;
840
+ return toListResult(response);
835
841
  },
836
842
  paramsOrParentId
837
843
  );
@@ -920,7 +926,7 @@ function createLegacyActions(api, config = {}) {
920
926
  invMastUid,
921
927
  { edgeCache }
922
928
  );
923
- return response.data;
929
+ return toListResult(response);
924
930
  },
925
931
  invMastUid
926
932
  );
@@ -934,7 +940,7 @@ function createLegacyActions(api, config = {}) {
934
940
  const response = await api.legacy.invMast.tags.list(invMastUid, {
935
941
  edgeCache
936
942
  });
937
- return response.data;
943
+ return toListResult(response);
938
944
  },
939
945
  invMastUid
940
946
  );
@@ -949,7 +955,7 @@ function createLegacyActions(api, config = {}) {
949
955
  ...params,
950
956
  edgeCache: longEdgeCache
951
957
  });
952
- return response.data;
958
+ return toListResult(response);
953
959
  },
954
960
  params?.twoLetterCode
955
961
  );
@@ -990,7 +996,7 @@ function createCustomersActions(api, config = {}) {
990
996
  edgeCache
991
997
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
992
998
  });
993
- return response.data;
999
+ return toListResult(response);
994
1000
  },
995
1001
  params
996
1002
  );
@@ -1019,7 +1025,7 @@ function createCustomersActions(api, config = {}) {
1019
1025
  ...params,
1020
1026
  edgeCache
1021
1027
  });
1022
- return { data: response.data, total: response.total };
1028
+ return toListResult(response);
1023
1029
  },
1024
1030
  customerId,
1025
1031
  params
@@ -1053,7 +1059,7 @@ function createCustomersActions(api, config = {}) {
1053
1059
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1054
1060
  { ...params, edgeCache }
1055
1061
  );
1056
- return { data: response.data, total: response.total };
1062
+ return toListResult(response);
1057
1063
  },
1058
1064
  customerId,
1059
1065
  params
@@ -1086,7 +1092,7 @@ function createCustomersActions(api, config = {}) {
1086
1092
  ...params,
1087
1093
  edgeCache
1088
1094
  });
1089
- return { data: response.data, total: response.total };
1095
+ return toListResult(response);
1090
1096
  },
1091
1097
  customerId,
1092
1098
  params
@@ -1119,7 +1125,7 @@ function createCustomersActions(api, config = {}) {
1119
1125
  ...params,
1120
1126
  edgeCache
1121
1127
  });
1122
- return response.data;
1128
+ return toListResult(response);
1123
1129
  },
1124
1130
  params
1125
1131
  );
@@ -1133,7 +1139,7 @@ function createCustomersActions(api, config = {}) {
1133
1139
  const response = await api.customers.customer.shipTo.list(customerId, {
1134
1140
  edgeCache
1135
1141
  });
1136
- return response.data;
1142
+ return toListResult(response);
1137
1143
  },
1138
1144
  customerId
1139
1145
  );
@@ -1199,7 +1205,7 @@ function createP21PimActions(api, config = {}) {
1199
1205
  ...params,
1200
1206
  edgeCache
1201
1207
  });
1202
- return response.data;
1208
+ return toListResult(response);
1203
1209
  },
1204
1210
  params
1205
1211
  );
@@ -1228,7 +1234,7 @@ function createAgrSiteActions(api, config = {}) {
1228
1234
  edgeCache: longEdgeCache
1229
1235
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1230
1236
  });
1231
- return response.data;
1237
+ return toListResult(response);
1232
1238
  },
1233
1239
  serviceName
1234
1240
  );
@@ -1243,7 +1249,7 @@ function createAgrSiteActions(api, config = {}) {
1243
1249
  ...params,
1244
1250
  edgeCache: longEdgeCache
1245
1251
  });
1246
- return response.data;
1252
+ return toListResult(response);
1247
1253
  },
1248
1254
  params
1249
1255
  );
@@ -1354,7 +1360,7 @@ function createUpsActions(api, config = {}) {
1354
1360
  async function getRates(params) {
1355
1361
  try {
1356
1362
  const response = await api.ups.ratesShop.get(params);
1357
- return response.data;
1363
+ return toListResult(response);
1358
1364
  } catch {
1359
1365
  return void 0;
1360
1366
  }
@@ -1390,7 +1396,7 @@ function createLogisticsActions(api, config = {}) {
1390
1396
  edgeCache: longEdgeCache
1391
1397
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1392
1398
  });
1393
- return response.data;
1399
+ return toListResult(response);
1394
1400
  },
1395
1401
  params ? JSON.stringify(params) : void 0
1396
1402
  );
@@ -1442,7 +1448,7 @@ function createNexusActions(api, config = {}) {
1442
1448
  ...params,
1443
1449
  edgeCache
1444
1450
  });
1445
- return response.data;
1451
+ return toListResult(response);
1446
1452
  },
1447
1453
  params ? JSON.stringify(params) : void 0
1448
1454
  );
@@ -1457,7 +1463,7 @@ function createNexusActions(api, config = {}) {
1457
1463
  ...params,
1458
1464
  edgeCache
1459
1465
  });
1460
- return response.data;
1466
+ return toListResult(response);
1461
1467
  },
1462
1468
  params ? JSON.stringify(params) : void 0
1463
1469
  );
@@ -1472,7 +1478,7 @@ function createNexusActions(api, config = {}) {
1472
1478
  ...params,
1473
1479
  edgeCache
1474
1480
  });
1475
- return response.data;
1481
+ return toListResult(response);
1476
1482
  },
1477
1483
  params ? JSON.stringify(params) : void 0
1478
1484
  );
@@ -1505,7 +1511,7 @@ function createVmiActions(api, config = {}) {
1505
1511
  ...params,
1506
1512
  edgeCache
1507
1513
  });
1508
- return response.data;
1514
+ return toListResult(response);
1509
1515
  },
1510
1516
  params ? JSON.stringify(params) : void 0
1511
1517
  );
@@ -1521,7 +1527,7 @@ function createVmiActions(api, config = {}) {
1521
1527
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1522
1528
  { ...params, edgeCache }
1523
1529
  );
1524
- return response.data;
1530
+ return toListResult(response);
1525
1531
  },
1526
1532
  warehouseUid,
1527
1533
  params ? JSON.stringify(params) : void 0
@@ -1537,7 +1543,7 @@ function createVmiActions(api, config = {}) {
1537
1543
  ...params,
1538
1544
  edgeCache
1539
1545
  });
1540
- return response.data;
1546
+ return toListResult(response);
1541
1547
  },
1542
1548
  params ? JSON.stringify(params) : void 0
1543
1549
  );
@@ -1552,7 +1558,7 @@ function createVmiActions(api, config = {}) {
1552
1558
  ...params,
1553
1559
  edgeCache
1554
1560
  });
1555
- return response.data;
1561
+ return toListResult(response);
1556
1562
  },
1557
1563
  params ? JSON.stringify(params) : void 0
1558
1564
  );
@@ -1568,7 +1574,7 @@ function createVmiActions(api, config = {}) {
1568
1574
  edgeCache
1569
1575
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1570
1576
  });
1571
- return response.data;
1577
+ return toListResult(response);
1572
1578
  },
1573
1579
  params ? JSON.stringify(params) : void 0
1574
1580
  );
@@ -1584,7 +1590,7 @@ function createVmiActions(api, config = {}) {
1584
1590
  edgeCache
1585
1591
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1586
1592
  });
1587
- return response.data;
1593
+ return toListResult(response);
1588
1594
  },
1589
1595
  params ? JSON.stringify(params) : void 0
1590
1596
  );
@@ -1600,7 +1606,7 @@ function createVmiActions(api, config = {}) {
1600
1606
  edgeCache
1601
1607
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1602
1608
  });
1603
- return response.data;
1609
+ return toListResult(response);
1604
1610
  },
1605
1611
  params ? JSON.stringify(params) : void 0
1606
1612
  );
@@ -1635,7 +1641,7 @@ function createP21CoreActions(api, config = {}) {
1635
1641
  ...params,
1636
1642
  edgeCache
1637
1643
  });
1638
- return response.data;
1644
+ return toListResult(response);
1639
1645
  },
1640
1646
  params
1641
1647
  );
@@ -1650,7 +1656,7 @@ function createP21CoreActions(api, config = {}) {
1650
1656
  ...params,
1651
1657
  edgeCache: longEdgeCache
1652
1658
  });
1653
- return response.data;
1659
+ return toListResult(response);
1654
1660
  },
1655
1661
  params
1656
1662
  );
@@ -1680,7 +1686,7 @@ function createP21CoreActions(api, config = {}) {
1680
1686
  ...params,
1681
1687
  edgeCache: longEdgeCache
1682
1688
  });
1683
- return response.data;
1689
+ return toListResult(response);
1684
1690
  },
1685
1691
  params
1686
1692
  );
@@ -1695,7 +1701,7 @@ function createP21CoreActions(api, config = {}) {
1695
1701
  ...params,
1696
1702
  edgeCache: longEdgeCache
1697
1703
  });
1698
- return response.data;
1704
+ return toListResult(response);
1699
1705
  },
1700
1706
  params
1701
1707
  );
@@ -1710,7 +1716,7 @@ function createP21CoreActions(api, config = {}) {
1710
1716
  ...params,
1711
1717
  edgeCache
1712
1718
  });
1713
- return response.data;
1719
+ return toListResult(response);
1714
1720
  },
1715
1721
  params
1716
1722
  );
@@ -1726,7 +1732,7 @@ function createP21CoreActions(api, config = {}) {
1726
1732
  edgeCache: longEdgeCache
1727
1733
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1728
1734
  });
1729
- return response.data;
1735
+ return toListResult(response);
1730
1736
  },
1731
1737
  params
1732
1738
  );
@@ -1759,7 +1765,7 @@ function createP21ApisActions(api, config = {}) {
1759
1765
  ...params,
1760
1766
  edgeCache
1761
1767
  });
1762
- return response.data;
1768
+ return toListResult(response);
1763
1769
  },
1764
1770
  params
1765
1771
  );
@@ -1789,7 +1795,7 @@ function createP21ApisActions(api, config = {}) {
1789
1795
  ...params,
1790
1796
  edgeCache
1791
1797
  });
1792
- return response.data;
1798
+ return toListResult(response);
1793
1799
  },
1794
1800
  params
1795
1801
  );
@@ -1804,7 +1810,7 @@ function createP21ApisActions(api, config = {}) {
1804
1810
  ...params,
1805
1811
  edgeCache
1806
1812
  });
1807
- return response.data;
1813
+ return toListResult(response);
1808
1814
  },
1809
1815
  params
1810
1816
  );
@@ -1819,7 +1825,7 @@ function createP21ApisActions(api, config = {}) {
1819
1825
  ...params,
1820
1826
  edgeCache
1821
1827
  });
1822
- return response.data;
1828
+ return toListResult(response);
1823
1829
  },
1824
1830
  params
1825
1831
  );
@@ -1890,7 +1896,7 @@ function createP21SismActions(api, config = {}) {
1890
1896
  ...params,
1891
1897
  edgeCache
1892
1898
  });
1893
- return response.data;
1899
+ return toListResult(response);
1894
1900
  },
1895
1901
  params
1896
1902
  );
@@ -1918,7 +1924,7 @@ function createP21SismActions(api, config = {}) {
1918
1924
  importUid: importId,
1919
1925
  edgeCache
1920
1926
  });
1921
- return response.data;
1927
+ return toListResult(response);
1922
1928
  },
1923
1929
  importId,
1924
1930
  params
@@ -1934,7 +1940,7 @@ function createP21SismActions(api, config = {}) {
1934
1940
  ...params,
1935
1941
  edgeCache
1936
1942
  });
1937
- return response.data;
1943
+ return toListResult(response);
1938
1944
  },
1939
1945
  params
1940
1946
  );
@@ -1991,7 +1997,7 @@ function createAgrInfoActions(api, config = {}) {
1991
1997
  ...params,
1992
1998
  edgeCache
1993
1999
  });
1994
- return Array.isArray(response.data) ? response.data : [response.data];
2000
+ return toListResult(response);
1995
2001
  },
1996
2002
  params
1997
2003
  );
@@ -2006,7 +2012,7 @@ function createAgrInfoActions(api, config = {}) {
2006
2012
  ...params,
2007
2013
  edgeCache
2008
2014
  });
2009
- return response.data;
2015
+ return toListResult(response);
2010
2016
  },
2011
2017
  params
2012
2018
  );
@@ -2021,7 +2027,7 @@ function createAgrInfoActions(api, config = {}) {
2021
2027
  ...params,
2022
2028
  edgeCache: longEdgeCache
2023
2029
  });
2024
- return response.data;
2030
+ return toListResult(response);
2025
2031
  },
2026
2032
  params
2027
2033
  );
@@ -2071,7 +2077,7 @@ function createBasecamp2Actions(api, config = {}) {
2071
2077
  edgeCache
2072
2078
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2073
2079
  });
2074
- return response.data;
2080
+ return toListResult(response);
2075
2081
  },
2076
2082
  params
2077
2083
  );
@@ -2099,7 +2105,7 @@ function createBasecamp2Actions(api, config = {}) {
2099
2105
  edgeCache
2100
2106
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2101
2107
  });
2102
- return response.data;
2108
+ return toListResult(response);
2103
2109
  },
2104
2110
  params
2105
2111
  );
@@ -2115,7 +2121,7 @@ function createBasecamp2Actions(api, config = {}) {
2115
2121
  edgeCache
2116
2122
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2117
2123
  });
2118
- return response.data;
2124
+ return toListResult(response);
2119
2125
  },
2120
2126
  params
2121
2127
  );
@@ -2131,7 +2137,7 @@ function createBasecamp2Actions(api, config = {}) {
2131
2137
  edgeCache: longEdgeCache
2132
2138
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2133
2139
  });
2134
- return response.data;
2140
+ return toListResult(response);
2135
2141
  },
2136
2142
  params
2137
2143
  );
@@ -2147,7 +2153,7 @@ function createBasecamp2Actions(api, config = {}) {
2147
2153
  edgeCache
2148
2154
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2149
2155
  });
2150
- return response.data;
2156
+ return toListResult(response);
2151
2157
  },
2152
2158
  params
2153
2159
  );
@@ -2163,7 +2169,7 @@ function createBasecamp2Actions(api, config = {}) {
2163
2169
  edgeCache
2164
2170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2165
2171
  });
2166
- return response.data;
2172
+ return toListResult(response);
2167
2173
  },
2168
2174
  params
2169
2175
  );
@@ -2179,7 +2185,7 @@ function createBasecamp2Actions(api, config = {}) {
2179
2185
  edgeCache
2180
2186
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2181
2187
  });
2182
- return response.data;
2188
+ return toListResult(response);
2183
2189
  },
2184
2190
  params
2185
2191
  );
@@ -2195,7 +2201,7 @@ function createBasecamp2Actions(api, config = {}) {
2195
2201
  edgeCache
2196
2202
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2197
2203
  });
2198
- return response.data;
2204
+ return toListResult(response);
2199
2205
  },
2200
2206
  params
2201
2207
  );
@@ -2226,7 +2232,7 @@ function createBrandFolderActions(api, config = {}) {
2226
2232
  ...params,
2227
2233
  edgeCache
2228
2234
  });
2229
- return response.data;
2235
+ return toListResult(response);
2230
2236
  },
2231
2237
  params
2232
2238
  );
@@ -2281,7 +2287,7 @@ function createGregorovichActions(api, config = {}) {
2281
2287
  "gregorovich.documents.list",
2282
2288
  async () => {
2283
2289
  const response = await api.gregorovich.documents.list();
2284
- return response.data;
2290
+ return toListResult(response);
2285
2291
  },
2286
2292
  params
2287
2293
  );
@@ -2331,7 +2337,7 @@ function createSlackActions(api, config = {}) {
2331
2337
  ...params,
2332
2338
  edgeCache
2333
2339
  });
2334
- return response.data;
2340
+ return toListResult(response);
2335
2341
  },
2336
2342
  params
2337
2343
  );
@@ -2352,8 +2358,9 @@ function createSiteActions(api, config = {}) {
2352
2358
  redisTtl,
2353
2359
  longEdgeCache,
2354
2360
  longRedisTtl,
2355
- defaultContactId,
2356
- defaultCustomerId,
2361
+ defaultContactId = process.env.DEFAULT_CONTACT_ID,
2362
+ defaultCustomerId = process.env.DEFAULT_CUSTOMER_ID,
2363
+ defaultCompanyId: _defaultCompanyId = process.env.DEFAULT_COMPANY_ID,
2357
2364
  convertUnitOfMeasure
2358
2365
  } = config;
2359
2366
  const cache = { cachePrefix, edgeCache, redisTtl };
@@ -2645,4 +2652,4 @@ export {
2645
2652
  createSlackActions,
2646
2653
  createSiteActions
2647
2654
  };
2648
- //# sourceMappingURL=chunk-XHI7OYKV.js.map
2655
+ //# sourceMappingURL=chunk-PN526XCA.js.map