@ricado/api-client 1.4.1 → 2.1.0

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 (136) 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 +29 -133
  51. package/lib/Models/ApiAccountModel.js +29 -133
  52. package/lib/Models/BaseModel.js +6 -2
  53. package/lib/Models/CompanyModel.js +23 -101
  54. package/lib/Models/FirebaseTokenModel.js +32 -149
  55. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +43 -185
  56. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +40 -169
  57. package/lib/Models/Packhouse/Site/CompacSizerModel.js +58 -265
  58. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +46 -201
  59. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +40 -169
  60. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +34 -137
  61. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +52 -233
  62. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +58 -265
  63. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +40 -169
  64. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +34 -137
  65. package/lib/Models/Packhouse/Site/PackTypeModel.js +40 -169
  66. package/lib/Models/Packhouse/Site/PackingLineModel.js +61 -281
  67. package/lib/Models/Packhouse/Site/PackrunModel.js +61 -281
  68. package/lib/Models/Packhouse/Site/RejectBinModel.js +43 -185
  69. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +52 -233
  70. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +46 -201
  71. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +52 -233
  72. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +127 -633
  73. package/lib/Models/Packhouse/Site/ShiftModel.js +73 -345
  74. package/lib/Models/Packhouse/Site/VarietyModel.js +40 -169
  75. package/lib/Models/RTUModel.js +26 -117
  76. package/lib/Models/RTUPluginModel.js +23 -101
  77. package/lib/Models/Site/AlarmGroupModel.js +37 -153
  78. package/lib/Models/Site/AlarmModel.js +67 -313
  79. package/lib/Models/Site/DefinitionModel.js +34 -137
  80. package/lib/Models/Site/PermanentObjectDataModel.js +40 -169
  81. package/lib/Models/Site/PermanentObjectModel.js +37 -153
  82. package/lib/Models/Site/PointModel.js +49 -217
  83. package/lib/Models/Site/TemporaryObjectModel.js +34 -137
  84. package/lib/Models/Site/index.js +0 -3
  85. package/lib/Models/SiteModel.js +26 -117
  86. package/lib/Models/TokenModel.js +38 -181
  87. package/lib/Models/UserAccountActionTokenModel.js +41 -197
  88. package/lib/Models/UserAccountModel.js +38 -181
  89. package/lib/PackageVersion.js +1 -1
  90. package/lib/Points.js +1 -1
  91. package/lib/RequestHelper.js +2 -2
  92. package/lib/WebSocketHelper.js +1 -1
  93. package/lib/index.d.ts +945 -1206
  94. package/package.json +3 -3
  95. package/src/Controllers/Packhouse/Site/PackrunController.js +361 -0
  96. package/src/Models/AccountPolicyModel.js +21 -117
  97. package/src/Models/ApiAccountModel.js +21 -117
  98. package/src/Models/CompanyModel.js +15 -87
  99. package/src/Models/FirebaseTokenModel.js +24 -132
  100. package/src/Models/Packhouse/Site/BinTipWeightModel.js +32 -163
  101. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +29 -148
  102. package/src/Models/Packhouse/Site/CompacSizerModel.js +47 -238
  103. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +35 -178
  104. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +29 -148
  105. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +23 -118
  106. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +41 -208
  107. package/src/Models/Packhouse/Site/DowntimeEventModel.js +47 -238
  108. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +29 -148
  109. package/src/Models/Packhouse/Site/GrowingMethodModel.js +23 -118
  110. package/src/Models/Packhouse/Site/PackTypeModel.js +29 -148
  111. package/src/Models/Packhouse/Site/PackingLineModel.js +50 -253
  112. package/src/Models/Packhouse/Site/PackrunModel.js +50 -253
  113. package/src/Models/Packhouse/Site/RejectBinModel.js +32 -163
  114. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +41 -208
  115. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +35 -178
  116. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +41 -208
  117. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +116 -583
  118. package/src/Models/Packhouse/Site/ShiftModel.js +62 -313
  119. package/src/Models/Packhouse/Site/VarietyModel.js +29 -148
  120. package/src/Models/RTUModel.js +18 -102
  121. package/src/Models/RTUPluginModel.js +15 -87
  122. package/src/Models/Site/AlarmGroupModel.js +26 -133
  123. package/src/Models/Site/AlarmModel.js +56 -283
  124. package/src/Models/Site/DefinitionModel.js +23 -118
  125. package/src/Models/Site/PermanentObjectDataModel.js +29 -148
  126. package/src/Models/Site/PermanentObjectModel.js +26 -133
  127. package/src/Models/Site/PointModel.js +38 -193
  128. package/src/Models/Site/TemporaryObjectModel.js +23 -118
  129. package/src/Models/Site/index.js +0 -2
  130. package/src/Models/SiteModel.js +18 -102
  131. package/src/Models/TokenModel.js +30 -162
  132. package/src/Models/UserAccountActionTokenModel.js +33 -177
  133. package/src/Models/UserAccountModel.js +30 -162
  134. package/src/PackageVersion.js +1 -1
  135. package/lib/Models/Site/BaseSiteModel.js +0 -58
  136. package/src/Models/Site/BaseSiteModel.js +0 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricado/api-client",
3
- "version": "1.4.1",
3
+ "version": "2.1.0",
4
4
  "description": "RICADO Gen 4 API Client Library for NodeJS and Browsers",
5
5
  "author": {
6
6
  "name": "Ash Neilson"
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "js-base64": "^3.7.2",
45
- "node-fetch": "^2.6.1",
45
+ "node-fetch": "^2.6.6",
46
46
  "socket.io-client": "^2.4.0"
47
47
  },
48
48
  "devDependencies": {
@@ -54,7 +54,7 @@
54
54
  "@types/socket.io-client": "^1.4.36",
55
55
  "cross-env": "^7.0.3",
56
56
  "dts-bundle": "^0.7.3",
57
- "dtslint": "^4.1.1",
57
+ "dtslint": "^4.2.1",
58
58
  "genversion": "^3.0.1",
59
59
  "jsdoc": "^3.6.7",
60
60
  "jsdoc-memberof-namespace": "^2.2.0",
@@ -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
  */
@@ -28,153 +28,57 @@ class AccountPolicyModel extends BaseModel
28
28
  * The Account Policy ID
29
29
  *
30
30
  * @type {string}
31
- * @private
31
+ * @public
32
32
  */
33
- this._id = undefined;
33
+ this.id = undefined;
34
34
 
35
35
  /**
36
36
  * The Policy Name
37
37
  *
38
38
  * @type {string}
39
- * @private
39
+ * @public
40
40
  */
41
- this._name = undefined;
41
+ this.name = undefined;
42
42
 
43
43
  /**
44
44
  * The Company this Policy belongs to
45
45
  *
46
46
  * @type {string}
47
- * @private
47
+ * @public
48
48
  */
49
- this._companyId = undefined;
49
+ this.companyId = undefined;
50
50
 
51
51
  /**
52
52
  * The Resources this Policy provides
53
53
  *
54
54
  * @type {Array<{id: any, type: string, actions: string[], permission: string}>}
55
- * @private
55
+ * @public
56
56
  */
57
- this._resources = undefined;
57
+ this.resources = undefined;
58
58
 
59
59
  /**
60
60
  * The Rules this Policy provides
61
61
  *
62
62
  * @type {Object[]}
63
- * @private
63
+ * @public
64
64
  */
65
- this._rules = undefined;
65
+ this.rules = undefined;
66
66
 
67
67
  /**
68
68
  * Whether the Account Policy has been deleted
69
69
  *
70
70
  * @type {boolean}
71
- * @private
71
+ * @public
72
72
  */
73
- this._deleted = undefined;
73
+ this.deleted = undefined;
74
74
 
75
75
  /**
76
76
  * When the Account Policy was last updated
77
77
  *
78
78
  * @type {Date}
79
- * @private
79
+ * @public
80
80
  */
81
- this._updateTimestamp = undefined;
82
- }
83
-
84
- /**
85
- * The Account Policy ID
86
- *
87
- * @public
88
- * @type {string}
89
- */
90
- get id()
91
- {
92
- return this._id;
93
- }
94
-
95
- /**
96
- * The Policy Name
97
- *
98
- * @public
99
- * @type {string}
100
- */
101
- get name()
102
- {
103
- return this._name;
104
- }
105
-
106
- /**
107
- * The Company this Policy belongs to
108
- *
109
- * @public
110
- * @type {string}
111
- */
112
- get companyId()
113
- {
114
- return this._companyId;
115
- }
116
-
117
- /**
118
- * The Resources this Policy provides
119
- *
120
- * @public
121
- * @type {Array<{id: any, type: string, actions: string[], permission: string}>}
122
- */
123
- get resources()
124
- {
125
- return this._resources;
126
- }
127
-
128
- /**
129
- * The Rules this Policy provides
130
- *
131
- * @public
132
- * @type {Object[]}
133
- */
134
- get rules()
135
- {
136
- return this._rules;
137
- }
138
-
139
- /**
140
- * Whether the Account Policy has been deleted
141
- *
142
- * @public
143
- * @type {boolean}
144
- */
145
- get deleted()
146
- {
147
- return this._deleted;
148
- }
149
-
150
- /**
151
- * When the Account Policy was last updated
152
- *
153
- * @public
154
- * @type {Date}
155
- */
156
- get updateTimestamp()
157
- {
158
- return this._updateTimestamp;
159
- }
160
-
161
- /**
162
- * Convert this **AccountPolicyModel** to a JSON Object
163
- *
164
- * @public
165
- * @return {Object<string, any>}
166
- */
167
- toJSON()
168
- {
169
- return {
170
- id: this._id,
171
- name: this._name,
172
- companyId: this._companyId,
173
- resources: this._resources,
174
- rules: this._rules,
175
- deleted: this._deleted,
176
- updateTimestamp: this._updateTimestamp
177
- };
81
+ this.updateTimestamp = undefined;
178
82
  }
179
83
 
180
84
  /**
@@ -207,7 +111,7 @@ class AccountPolicyModel extends BaseModel
207
111
 
208
112
  if('id' in jsonObject)
209
113
  {
210
- model._id = (function(){
114
+ model.id = (function(){
211
115
  if(typeof jsonObject['id'] !== 'string')
212
116
  {
213
117
  return String(jsonObject['id']);
@@ -219,7 +123,7 @@ class AccountPolicyModel extends BaseModel
219
123
 
220
124
  if('name' in jsonObject)
221
125
  {
222
- model._name = (function(){
126
+ model.name = (function(){
223
127
  if(typeof jsonObject['name'] !== 'string')
224
128
  {
225
129
  return String(jsonObject['name']);
@@ -231,7 +135,7 @@ class AccountPolicyModel extends BaseModel
231
135
 
232
136
  if('companyId' in jsonObject)
233
137
  {
234
- model._companyId = (function(){
138
+ model.companyId = (function(){
235
139
  if(typeof jsonObject['companyId'] !== 'string')
236
140
  {
237
141
  return String(jsonObject['companyId']);
@@ -243,7 +147,7 @@ class AccountPolicyModel extends BaseModel
243
147
 
244
148
  if('resources' in jsonObject)
245
149
  {
246
- model._resources = (function(){
150
+ model.resources = (function(){
247
151
  if(Array.isArray(jsonObject['resources']) !== true)
248
152
  {
249
153
  return [];
@@ -329,7 +233,7 @@ class AccountPolicyModel extends BaseModel
329
233
 
330
234
  if('rules' in jsonObject)
331
235
  {
332
- model._rules = (function(){
236
+ model.rules = (function(){
333
237
  if(Array.isArray(jsonObject['rules']) !== true)
334
238
  {
335
239
  return [];
@@ -350,7 +254,7 @@ class AccountPolicyModel extends BaseModel
350
254
 
351
255
  if('deleted' in jsonObject)
352
256
  {
353
- model._deleted = (function(){
257
+ model.deleted = (function(){
354
258
  if(typeof jsonObject['deleted'] !== 'boolean')
355
259
  {
356
260
  return Boolean(jsonObject['deleted']);
@@ -362,7 +266,7 @@ class AccountPolicyModel extends BaseModel
362
266
 
363
267
  if('updateTimestamp' in jsonObject)
364
268
  {
365
- model._updateTimestamp = (function(){
269
+ model.updateTimestamp = (function(){
366
270
  if(typeof jsonObject['updateTimestamp'] !== 'string')
367
271
  {
368
272
  return new Date(String(jsonObject['updateTimestamp']));