@ricado/api-client 2.0.1 → 2.0.2

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.
Files changed (95) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/AccountPolicyController.js +1 -1
  3. package/lib/Controllers/ApiAccountController.js +2 -2
  4. package/lib/Controllers/CompanyController.js +1 -1
  5. package/lib/Controllers/FirebaseTokenController.js +1 -1
  6. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +2 -2
  7. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +2 -2
  8. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +1 -1
  9. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +2 -2
  10. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +2 -2
  11. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +1 -1
  12. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +2 -2
  13. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +2 -2
  14. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +2 -2
  15. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +1 -1
  16. package/lib/Controllers/Packhouse/Site/PackTypeController.js +1 -1
  17. package/lib/Controllers/Packhouse/Site/PackingLineController.js +1 -1
  18. package/lib/Controllers/Packhouse/Site/PackrunController.js +288 -2
  19. package/lib/Controllers/Packhouse/Site/RejectBinController.js +2 -2
  20. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +1 -1
  21. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +2 -2
  22. package/lib/Controllers/Packhouse/Site/ShiftController.js +2 -2
  23. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +2 -2
  24. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +2 -2
  25. package/lib/Controllers/Packhouse/Site/VarietyController.js +1 -1
  26. package/lib/Controllers/RTU/GlobalSettingsController.js +2 -2
  27. package/lib/Controllers/RTU/PluginSettingsController.js +2 -2
  28. package/lib/Controllers/RTUController.js +1 -1
  29. package/lib/Controllers/RTUPluginController.js +1 -1
  30. package/lib/Controllers/Site/AlarmController.js +2 -2
  31. package/lib/Controllers/Site/AlarmGroupController.js +1 -1
  32. package/lib/Controllers/Site/DefinitionController.js +1 -1
  33. package/lib/Controllers/Site/PermanentObjectController.js +1 -1
  34. package/lib/Controllers/Site/PermanentObjectDataController.js +2 -2
  35. package/lib/Controllers/Site/PointController.js +2 -2
  36. package/lib/Controllers/Site/TemporaryObjectController.js +1 -1
  37. package/lib/Controllers/SiteController.js +1 -1
  38. package/lib/Controllers/TokenController.js +2 -2
  39. package/lib/Controllers/ToolsController.js +1 -1
  40. package/lib/Controllers/UserAccountActionTokenController.js +2 -2
  41. package/lib/Controllers/UserAccountController.js +2 -2
  42. package/lib/DataItems/PointValueItem.js +2 -2
  43. package/lib/Errors/BadRequestError.js +7 -3
  44. package/lib/Errors/ForbiddenError.js +7 -3
  45. package/lib/Errors/NetworkError.js +7 -3
  46. package/lib/Errors/NotAllowedError.js +7 -3
  47. package/lib/Errors/NotFoundError.js +7 -3
  48. package/lib/Errors/ServerError.js +7 -3
  49. package/lib/Errors/UnauthorizedError.js +7 -3
  50. package/lib/Models/AccountPolicyModel.js +3 -3
  51. package/lib/Models/ApiAccountModel.js +3 -3
  52. package/lib/Models/BaseModel.js +6 -2
  53. package/lib/Models/CompanyModel.js +3 -3
  54. package/lib/Models/FirebaseTokenModel.js +3 -3
  55. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +3 -3
  56. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +3 -3
  57. package/lib/Models/Packhouse/Site/CompacSizerModel.js +3 -3
  58. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +3 -3
  59. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +3 -3
  60. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +3 -3
  61. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +3 -3
  62. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +3 -3
  63. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +3 -3
  64. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +3 -3
  65. package/lib/Models/Packhouse/Site/PackTypeModel.js +3 -3
  66. package/lib/Models/Packhouse/Site/PackingLineModel.js +3 -3
  67. package/lib/Models/Packhouse/Site/PackrunModel.js +3 -3
  68. package/lib/Models/Packhouse/Site/RejectBinModel.js +3 -3
  69. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +3 -3
  70. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +3 -3
  71. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +3 -3
  72. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +3 -3
  73. package/lib/Models/Packhouse/Site/ShiftModel.js +3 -3
  74. package/lib/Models/Packhouse/Site/VarietyModel.js +3 -3
  75. package/lib/Models/RTUModel.js +3 -3
  76. package/lib/Models/RTUPluginModel.js +3 -3
  77. package/lib/Models/Site/AlarmGroupModel.js +3 -3
  78. package/lib/Models/Site/AlarmModel.js +3 -3
  79. package/lib/Models/Site/DefinitionModel.js +3 -3
  80. package/lib/Models/Site/PermanentObjectDataModel.js +3 -3
  81. package/lib/Models/Site/PermanentObjectModel.js +3 -3
  82. package/lib/Models/Site/PointModel.js +3 -3
  83. package/lib/Models/Site/TemporaryObjectModel.js +3 -3
  84. package/lib/Models/SiteModel.js +3 -3
  85. package/lib/Models/TokenModel.js +3 -3
  86. package/lib/Models/UserAccountActionTokenModel.js +3 -3
  87. package/lib/Models/UserAccountModel.js +3 -3
  88. package/lib/PackageVersion.js +1 -1
  89. package/lib/Points.js +1 -1
  90. package/lib/RequestHelper.js +2 -2
  91. package/lib/WebSocketHelper.js +1 -1
  92. package/lib/index.d.ts +89 -0
  93. package/package.json +2 -2
  94. package/src/Controllers/Packhouse/Site/PackrunController.js +361 -0
  95. package/src/PackageVersion.js +1 -1
@@ -1589,6 +1589,342 @@ class PackrunController
1589
1589
  });
1590
1590
  }
1591
1591
 
1592
+ /**
1593
+ * Retrieve a Packrun Infeed Report [GET /packhouse/sites/{siteId}/packruns/{id}/infeedReport]
1594
+ *
1595
+ * Retrieves an Infeed Report for a Packrun
1596
+ *
1597
+ * @static
1598
+ * @public
1599
+ * @param {number} siteId The Site ID
1600
+ * @param {string} id The Packrun ID
1601
+ * @return {Promise<PackrunController.PackrunInfeedReport>}
1602
+ */
1603
+ static getInfeedReport(siteId, id)
1604
+ {
1605
+ return new Promise((resolve, reject) => {
1606
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/packruns/${id}/infeedReport`)
1607
+ .then((result) => {
1608
+ let resolveValue = (function(){
1609
+ let resultObject = {};
1610
+
1611
+ if(typeof result === 'object' && 'id' in result)
1612
+ {
1613
+ resultObject.id = (function(){
1614
+ if(typeof result.id !== 'string')
1615
+ {
1616
+ return String(result.id);
1617
+ }
1618
+
1619
+ return result.id;
1620
+ }());
1621
+ }
1622
+ else
1623
+ {
1624
+ resultObject.id = "";
1625
+ }
1626
+
1627
+ if(typeof result === 'object' && 'name' in result)
1628
+ {
1629
+ resultObject.name = (function(){
1630
+ if(typeof result.name !== 'string')
1631
+ {
1632
+ return String(result.name);
1633
+ }
1634
+
1635
+ return result.name;
1636
+ }());
1637
+ }
1638
+ else
1639
+ {
1640
+ resultObject.name = "";
1641
+ }
1642
+
1643
+ if(typeof result === 'object' && 'createdTimestamp' in result)
1644
+ {
1645
+ resultObject.createdTimestamp = (function(){
1646
+ if(typeof result.createdTimestamp !== 'string')
1647
+ {
1648
+ return new Date(String(result.createdTimestamp));
1649
+ }
1650
+
1651
+ return new Date(result.createdTimestamp);
1652
+ }());
1653
+ }
1654
+ else
1655
+ {
1656
+ resultObject.createdTimestamp = new Date();
1657
+ }
1658
+
1659
+ if(typeof result === 'object' && 'startTimestamp' in result)
1660
+ {
1661
+ resultObject.startTimestamp = (function(){
1662
+ if(result.startTimestamp === null)
1663
+ {
1664
+ return null;
1665
+ }
1666
+
1667
+ if(typeof result.startTimestamp !== 'string')
1668
+ {
1669
+ return new Date(String(result.startTimestamp));
1670
+ }
1671
+
1672
+ return new Date(result.startTimestamp);
1673
+ }());
1674
+ }
1675
+ else
1676
+ {
1677
+ resultObject.startTimestamp = null;
1678
+ }
1679
+
1680
+ if(typeof result === 'object' && 'finishTimestamp' in result)
1681
+ {
1682
+ resultObject.finishTimestamp = (function(){
1683
+ if(result.finishTimestamp === null)
1684
+ {
1685
+ return null;
1686
+ }
1687
+
1688
+ if(typeof result.finishTimestamp !== 'string')
1689
+ {
1690
+ return new Date(String(result.finishTimestamp));
1691
+ }
1692
+
1693
+ return new Date(result.finishTimestamp);
1694
+ }());
1695
+ }
1696
+ else
1697
+ {
1698
+ resultObject.finishTimestamp = null;
1699
+ }
1700
+
1701
+ if(typeof result === 'object' && 'packingLineId' in result)
1702
+ {
1703
+ resultObject.packingLineId = (function(){
1704
+ if(typeof result.packingLineId !== 'string')
1705
+ {
1706
+ return String(result.packingLineId);
1707
+ }
1708
+
1709
+ return result.packingLineId;
1710
+ }());
1711
+ }
1712
+ else
1713
+ {
1714
+ resultObject.packingLineId = "";
1715
+ }
1716
+
1717
+ if(typeof result === 'object' && 'packingLineName' in result)
1718
+ {
1719
+ resultObject.packingLineName = (function(){
1720
+ if(result.packingLineName === null)
1721
+ {
1722
+ return null;
1723
+ }
1724
+
1725
+ if(typeof result.packingLineName !== 'string')
1726
+ {
1727
+ return String(result.packingLineName);
1728
+ }
1729
+
1730
+ return result.packingLineName;
1731
+ }());
1732
+ }
1733
+ else
1734
+ {
1735
+ resultObject.packingLineName = null;
1736
+ }
1737
+
1738
+ if(typeof result === 'object' && 'growerName' in result)
1739
+ {
1740
+ resultObject.growerName = (function(){
1741
+ if(typeof result.growerName !== 'string')
1742
+ {
1743
+ return String(result.growerName);
1744
+ }
1745
+
1746
+ return result.growerName;
1747
+ }());
1748
+ }
1749
+ else
1750
+ {
1751
+ resultObject.growerName = "";
1752
+ }
1753
+
1754
+ if(typeof result === 'object' && 'growerCode' in result)
1755
+ {
1756
+ resultObject.growerCode = (function(){
1757
+ if(typeof result.growerCode !== 'string')
1758
+ {
1759
+ return String(result.growerCode);
1760
+ }
1761
+
1762
+ return result.growerCode;
1763
+ }());
1764
+ }
1765
+ else
1766
+ {
1767
+ resultObject.growerCode = "";
1768
+ }
1769
+
1770
+ if(typeof result === 'object' && 'maturityArea' in result)
1771
+ {
1772
+ resultObject.maturityArea = (function(){
1773
+ if(result.maturityArea === null)
1774
+ {
1775
+ return null;
1776
+ }
1777
+
1778
+ if(typeof result.maturityArea !== 'string')
1779
+ {
1780
+ return String(result.maturityArea);
1781
+ }
1782
+
1783
+ return result.maturityArea;
1784
+ }());
1785
+ }
1786
+ else
1787
+ {
1788
+ resultObject.maturityArea = null;
1789
+ }
1790
+
1791
+ if(typeof result === 'object' && 'allocatedBins' in result)
1792
+ {
1793
+ resultObject.allocatedBins = (function(){
1794
+ if(typeof result.allocatedBins !== 'number')
1795
+ {
1796
+ return Number.isInteger(Number(result.allocatedBins)) ? Number(result.allocatedBins) : Math.floor(Number(result.allocatedBins));
1797
+ }
1798
+
1799
+ return Number.isInteger(result.allocatedBins) ? result.allocatedBins : Math.floor(result.allocatedBins);
1800
+ }());
1801
+ }
1802
+ else
1803
+ {
1804
+ resultObject.allocatedBins = 0;
1805
+ }
1806
+
1807
+ if(typeof result === 'object' && 'tippedBins' in result)
1808
+ {
1809
+ resultObject.tippedBins = (function(){
1810
+ if(typeof result.tippedBins !== 'number')
1811
+ {
1812
+ return Number.isInteger(Number(result.tippedBins)) ? Number(result.tippedBins) : Math.floor(Number(result.tippedBins));
1813
+ }
1814
+
1815
+ return Number.isInteger(result.tippedBins) ? result.tippedBins : Math.floor(result.tippedBins);
1816
+ }());
1817
+ }
1818
+ else
1819
+ {
1820
+ resultObject.tippedBins = 0;
1821
+ }
1822
+
1823
+ if(typeof result === 'object' && 'softSortRejectWeight' in result)
1824
+ {
1825
+ resultObject.softSortRejectWeight = (function(){
1826
+ if(typeof result.softSortRejectWeight !== 'number')
1827
+ {
1828
+ return Number(result.softSortRejectWeight);
1829
+ }
1830
+
1831
+ return result.softSortRejectWeight;
1832
+ }());
1833
+ }
1834
+ else
1835
+ {
1836
+ resultObject.softSortRejectWeight = 0;
1837
+ }
1838
+
1839
+ if(typeof result === 'object' && 'softSortRejectPercentage' in result)
1840
+ {
1841
+ resultObject.softSortRejectPercentage = (function(){
1842
+ if(typeof result.softSortRejectPercentage !== 'number')
1843
+ {
1844
+ return Number(result.softSortRejectPercentage);
1845
+ }
1846
+
1847
+ return result.softSortRejectPercentage;
1848
+ }());
1849
+ }
1850
+ else
1851
+ {
1852
+ resultObject.softSortRejectPercentage = 0;
1853
+ }
1854
+
1855
+ if(typeof result === 'object' && 'softSortEventsPerBin' in result)
1856
+ {
1857
+ resultObject.softSortEventsPerBin = (function(){
1858
+ if(typeof result.softSortEventsPerBin !== 'number')
1859
+ {
1860
+ return Number(result.softSortEventsPerBin);
1861
+ }
1862
+
1863
+ return result.softSortEventsPerBin;
1864
+ }());
1865
+ }
1866
+ else
1867
+ {
1868
+ resultObject.softSortEventsPerBin = 0;
1869
+ }
1870
+
1871
+ if(typeof result === 'object' && 'totalSoftSortEventsCount' in result)
1872
+ {
1873
+ resultObject.totalSoftSortEventsCount = (function(){
1874
+ if(typeof result.totalSoftSortEventsCount !== 'number')
1875
+ {
1876
+ return Number.isInteger(Number(result.totalSoftSortEventsCount)) ? Number(result.totalSoftSortEventsCount) : Math.floor(Number(result.totalSoftSortEventsCount));
1877
+ }
1878
+
1879
+ return Number.isInteger(result.totalSoftSortEventsCount) ? result.totalSoftSortEventsCount : Math.floor(result.totalSoftSortEventsCount);
1880
+ }());
1881
+ }
1882
+ else
1883
+ {
1884
+ resultObject.totalSoftSortEventsCount = 0;
1885
+ }
1886
+
1887
+ if(typeof result === 'object' && 'averageSoftSortEventsDuration' in result)
1888
+ {
1889
+ resultObject.averageSoftSortEventsDuration = (function(){
1890
+ if(typeof result.averageSoftSortEventsDuration !== 'number')
1891
+ {
1892
+ return Number(result.averageSoftSortEventsDuration);
1893
+ }
1894
+
1895
+ return result.averageSoftSortEventsDuration;
1896
+ }());
1897
+ }
1898
+ else
1899
+ {
1900
+ resultObject.averageSoftSortEventsDuration = 0;
1901
+ }
1902
+
1903
+ if(typeof result === 'object' && 'totalSoftSortEventsDuration' in result)
1904
+ {
1905
+ resultObject.totalSoftSortEventsDuration = (function(){
1906
+ if(typeof result.totalSoftSortEventsDuration !== 'number')
1907
+ {
1908
+ return Number(result.totalSoftSortEventsDuration);
1909
+ }
1910
+
1911
+ return result.totalSoftSortEventsDuration;
1912
+ }());
1913
+ }
1914
+ else
1915
+ {
1916
+ resultObject.totalSoftSortEventsDuration = 0;
1917
+ }
1918
+
1919
+ return resultObject;
1920
+ }());
1921
+
1922
+ resolve(resolveValue);
1923
+ })
1924
+ .catch(error => reject(error));
1925
+ });
1926
+ }
1927
+
1592
1928
  /**
1593
1929
  * List all Packruns [GET /packhouse/sites/{siteId}/packruns]
1594
1930
  *
@@ -1820,4 +2156,29 @@ export default PackrunController;
1820
2156
  * @property {number} class2AverageTrayWeight The Average Class 2 Tray Weight for this Packrun
1821
2157
  * @property {Object[]} class2FreshPackSummary An Array of Class 2 Fruit Summaries by Size from FreshPack for the Packrun
1822
2158
  * @memberof Controllers.Packhouse.Site
2159
+ */
2160
+
2161
+ /**
2162
+ * A **PackrunInfeedReport** Type
2163
+ *
2164
+ * @typedef {Object} PackrunController.PackrunInfeedReport
2165
+ * @property {string} id The Packrun ID
2166
+ * @property {string} name The Packrun Name
2167
+ * @property {Date} createdTimestamp When the Packrun was Created
2168
+ * @property {?Date} startTimestamp When the Packrun was Started
2169
+ * @property {?Date} finishTimestamp When the Packrun was Finished
2170
+ * @property {string} packingLineId The Packing Line ID
2171
+ * @property {?string} packingLineName The Packing Line Name
2172
+ * @property {string} growerName The Grower Name
2173
+ * @property {string} growerCode The Grower Code
2174
+ * @property {?string} maturityArea The Maturity Area
2175
+ * @property {number} allocatedBins The Number of Bins Allocated for the Packrun
2176
+ * @property {number} tippedBins The Number of Bins Tipped for the Packrun
2177
+ * @property {number} softSortRejectWeight The Total Reject Weight for the Soft-Sort category expressed in kilograms
2178
+ * @property {number} softSortRejectPercentage The Percentage of Packrun Weight categorized as Soft-Sort
2179
+ * @property {number} softSortEventsPerBin The Number of Soft-Sort Events per Bin
2180
+ * @property {number} totalSoftSortEventsCount The Number of Soft-Sort Events that occurred for the Packrun
2181
+ * @property {number} averageSoftSortEventsDuration The Average Duration of Soft-Sort Events for the Packrun expressed in Seconds
2182
+ * @property {number} totalSoftSortEventsDuration The Total Duration of all Soft-Sort Events for the Packrun expressed in Seconds
2183
+ * @memberof Controllers.Packhouse.Site
1823
2184
  */
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '2.0.1';
2
+ export const version = '2.0.2';