@ricado/api-client 2.4.2 → 2.5.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 (29) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Lab/Site/FruitProfileController.js +10 -8
  3. package/lib/Controllers/Lab/Site/RackPositionController.js +2 -2
  4. package/lib/Controllers/Lab/Site/SampleController.js +7 -15
  5. package/lib/Controllers/Lab/Site/SampleResultController.js +29 -27
  6. package/lib/Controllers/Lab/Site/index.js +0 -3
  7. package/lib/Models/Lab/Site/FruitProfileModel.js +22 -4
  8. package/lib/Models/Lab/Site/RackPositionModel.js +67 -15
  9. package/lib/Models/Lab/Site/SampleModel.js +9 -75
  10. package/lib/Models/Lab/Site/SampleResultModel.js +45 -23
  11. package/lib/Models/Lab/Site/index.js +0 -3
  12. package/lib/PackageVersion.js +1 -1
  13. package/lib/index.d.ts +119 -309
  14. package/package.json +1 -1
  15. package/src/Controllers/Lab/Site/FruitProfileController.js +10 -8
  16. package/src/Controllers/Lab/Site/RackPositionController.js +2 -2
  17. package/src/Controllers/Lab/Site/SampleController.js +7 -15
  18. package/src/Controllers/Lab/Site/SampleResultController.js +29 -27
  19. package/src/Controllers/Lab/Site/index.js +0 -2
  20. package/src/Models/Lab/Site/FruitProfileModel.js +24 -4
  21. package/src/Models/Lab/Site/RackPositionModel.js +87 -15
  22. package/src/Models/Lab/Site/SampleModel.js +9 -84
  23. package/src/Models/Lab/Site/SampleResultModel.js +48 -23
  24. package/src/Models/Lab/Site/index.js +0 -2
  25. package/src/PackageVersion.js +1 -1
  26. package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +0 -193
  27. package/lib/Models/Lab/Site/SampleFailureReasonModel.js +0 -195
  28. package/src/Controllers/Lab/Site/SampleFailureReasonController.js +0 -170
  29. package/src/Models/Lab/Site/SampleFailureReasonModel.js +0 -170
@@ -1,195 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
-
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
-
16
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
-
18
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
-
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
-
22
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
-
24
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
-
26
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
-
28
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
-
30
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
-
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
-
34
- /**
35
- * Model Class for a Sample Failure Reason
36
- *
37
- * @class
38
- * @hideconstructor
39
- * @extends BaseModel
40
- */
41
- var SampleFailureReasonModel = /*#__PURE__*/function (_BaseModel) {
42
- _inherits(SampleFailureReasonModel, _BaseModel);
43
-
44
- var _super = _createSuper(SampleFailureReasonModel);
45
-
46
- /**
47
- * SampleFailureReasonModel Constructor
48
- *
49
- * @protected
50
- * @param {number} siteId The Site ID associated with this Sample Failure Reason
51
- */
52
- function SampleFailureReasonModel(siteId) {
53
- var _this;
54
-
55
- _classCallCheck(this, SampleFailureReasonModel);
56
-
57
- _this = _super.call(this);
58
- /**
59
- * The Sample Failure Reason ID
60
- *
61
- * @type {string}
62
- * @public
63
- */
64
-
65
- _this.id = "";
66
- /**
67
- * The Sample Failure Reason Name
68
- *
69
- * @type {string}
70
- * @public
71
- */
72
-
73
- _this.name = "";
74
- /**
75
- * The Sample Failure Reason Description
76
- *
77
- * @type {string}
78
- * @public
79
- */
80
-
81
- _this.description = "";
82
- /**
83
- * Whether the Sample Failure Reason has been deleted
84
- *
85
- * @type {boolean}
86
- * @public
87
- */
88
-
89
- _this.deleted = false;
90
- /**
91
- * When the Sample Failure Reason was last updated
92
- *
93
- * @type {Date}
94
- * @public
95
- */
96
-
97
- _this.updateTimestamp = new Date();
98
- /**
99
- * The Site ID associated with this Sample Failure Reason
100
- *
101
- * @type {number}
102
- * @public
103
- */
104
-
105
- _this.siteId = siteId;
106
- return _this;
107
- }
108
- /**
109
- * Create a new **SampleFailureReasonModel** from a JSON Object or JSON String
110
- *
111
- * @static
112
- * @public
113
- * @param {Object<string, any>|string} json A JSON Object or JSON String
114
- * @param {number} siteId The Site ID associated with this Sample Failure Reason
115
- * @return {SampleFailureReasonModel}
116
- */
117
-
118
-
119
- _createClass(SampleFailureReasonModel, null, [{
120
- key: "fromJSON",
121
- value: function fromJSON(json, siteId) {
122
- var model = new SampleFailureReasonModel(siteId);
123
- /**
124
- * The JSON Object
125
- *
126
- * @type {Object<string, any>}
127
- */
128
-
129
- var jsonObject = {};
130
-
131
- if (typeof json === 'string') {
132
- jsonObject = JSON.parse(json);
133
- } else if (_typeof(json) === 'object') {
134
- jsonObject = json;
135
- }
136
-
137
- if ('id' in jsonObject) {
138
- model.id = function () {
139
- if (typeof jsonObject['id'] !== 'string') {
140
- return String(jsonObject['id']);
141
- }
142
-
143
- return jsonObject['id'];
144
- }();
145
- }
146
-
147
- if ('name' in jsonObject) {
148
- model.name = function () {
149
- if (typeof jsonObject['name'] !== 'string') {
150
- return String(jsonObject['name']);
151
- }
152
-
153
- return jsonObject['name'];
154
- }();
155
- }
156
-
157
- if ('description' in jsonObject) {
158
- model.description = function () {
159
- if (typeof jsonObject['description'] !== 'string') {
160
- return String(jsonObject['description']);
161
- }
162
-
163
- return jsonObject['description'];
164
- }();
165
- }
166
-
167
- if ('deleted' in jsonObject) {
168
- model.deleted = function () {
169
- if (typeof jsonObject['deleted'] !== 'boolean') {
170
- return Boolean(jsonObject['deleted']);
171
- }
172
-
173
- return jsonObject['deleted'];
174
- }();
175
- }
176
-
177
- if ('updateTimestamp' in jsonObject) {
178
- model.updateTimestamp = function () {
179
- if (typeof jsonObject['updateTimestamp'] !== 'string') {
180
- return new Date(String(jsonObject['updateTimestamp']));
181
- }
182
-
183
- return new Date(jsonObject['updateTimestamp']);
184
- }();
185
- }
186
-
187
- return model;
188
- }
189
- }]);
190
-
191
- return SampleFailureReasonModel;
192
- }(_BaseModel2.default);
193
-
194
- var _default = SampleFailureReasonModel;
195
- exports.default = _default;
@@ -1,170 +0,0 @@
1
- /**
2
- * File Auto-Generated by the RICADO Gen 4 PHP API Project
3
- *
4
- * Do Not Edit this File Manually!
5
- */
6
-
7
- import RequestHelper from '../../../RequestHelper';
8
- import SampleFailureReasonModel from '../../../Models/Lab/Site/SampleFailureReasonModel';
9
-
10
- /**
11
- * Controller Class for Sample Failure Reasons
12
- *
13
- * @class
14
- */
15
- class SampleFailureReasonController
16
- {
17
- /**
18
- * Retrieve a Sample Failure Reason [GET /lab/sites/{siteId}/sample-failure-reasons/{id}]
19
- *
20
- * @static
21
- * @public
22
- * @param {number} siteId The Site ID
23
- * @param {string} id The Sample Failure Reason ID
24
- * @return {Promise<SampleFailureReasonModel>}
25
- */
26
- static getOne(siteId, id)
27
- {
28
- return new Promise((resolve, reject) => {
29
- RequestHelper.getRequest(`/lab/sites/${siteId}/sample-failure-reasons/${id}`)
30
- .then((result) => {
31
- let resolveValue = (function(){
32
- return SampleFailureReasonModel.fromJSON(result, siteId);
33
- }());
34
-
35
- resolve(resolveValue);
36
- })
37
- .catch(error => reject(error));
38
- });
39
- }
40
-
41
- /**
42
- * Update a Sample Failure Reason [PATCH /lab/sites/{siteId}/sample-failure-reasons/{id}]
43
- *
44
- * @static
45
- * @public
46
- * @param {number} siteId The Site ID
47
- * @param {string} id The Sample Failure Reason ID
48
- * @param {SampleFailureReasonController.UpdateData} updateData The Sample Failure Reason Update Data
49
- * @return {Promise<SampleFailureReasonModel>}
50
- */
51
- static update(siteId, id, updateData)
52
- {
53
- return new Promise((resolve, reject) => {
54
- RequestHelper.patchRequest(`/lab/sites/${siteId}/sample-failure-reasons/${id}`, updateData)
55
- .then((result) => {
56
- let resolveValue = (function(){
57
- return SampleFailureReasonModel.fromJSON(result, siteId);
58
- }());
59
-
60
- resolve(resolveValue);
61
- })
62
- .catch(error => reject(error));
63
- });
64
- }
65
-
66
- /**
67
- * Delete a Sample Failure Reason [DELETE /lab/sites/{siteId}/sample-failure-reasons/{id}]
68
- *
69
- * @static
70
- * @public
71
- * @param {number} siteId The Site ID
72
- * @param {string} id The Sample Failure Reason ID
73
- * @return {Promise<boolean>}
74
- */
75
- static delete(siteId, id)
76
- {
77
- return new Promise((resolve, reject) => {
78
- RequestHelper.deleteRequest(`/lab/sites/${siteId}/sample-failure-reasons/${id}`)
79
- .then((result) => {
80
- resolve(result ?? true);
81
- })
82
- .catch(error => reject(error));
83
- });
84
- }
85
-
86
- /**
87
- * List all Sample Failure Reasons [GET /lab/sites/{siteId}/sample-failure-reasons]
88
- *
89
- * @static
90
- * @public
91
- * @param {number} siteId The Site ID
92
- * @param {SampleFailureReasonController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
93
- * @return {Promise<SampleFailureReasonModel[]>}
94
- */
95
- static getAll(siteId, queryParameters = {})
96
- {
97
- return new Promise((resolve, reject) => {
98
- RequestHelper.getRequest(`/lab/sites/${siteId}/sample-failure-reasons`, queryParameters)
99
- .then((result) => {
100
- let resolveValue = (function(){
101
- if(Array.isArray(result) !== true)
102
- {
103
- return [];
104
- }
105
-
106
- return result.map((resultItem) => {
107
- return (function(){
108
- return SampleFailureReasonModel.fromJSON(resultItem, siteId);
109
- }());
110
- });
111
- }());
112
-
113
- resolve(resolveValue);
114
- })
115
- .catch(error => reject(error));
116
- });
117
- }
118
-
119
- /**
120
- * Create a Sample Failure Reason [POST /lab/sites/{siteId}/sample-failure-reasons]
121
- *
122
- * @static
123
- * @public
124
- * @param {number} siteId The Site ID
125
- * @param {SampleFailureReasonController.CreateData} createData The Sample Failure Reason Create Data
126
- * @return {Promise<SampleFailureReasonModel>}
127
- */
128
- static create(siteId, createData)
129
- {
130
- return new Promise((resolve, reject) => {
131
- RequestHelper.postRequest(`/lab/sites/${siteId}/sample-failure-reasons`, createData)
132
- .then((result) => {
133
- let resolveValue = (function(){
134
- return SampleFailureReasonModel.fromJSON(result, siteId);
135
- }());
136
-
137
- resolve(resolveValue);
138
- })
139
- .catch(error => reject(error));
140
- });
141
- }
142
- }
143
-
144
- export default SampleFailureReasonController;
145
-
146
- /**
147
- * The Optional Query Parameters for the getAll Function
148
- *
149
- * @typedef {Object} SampleFailureReasonController.GetAllQueryParameters
150
- * @property {string} [name] The Sample Failure Reason Name
151
- * @memberof Controllers.Lab.Site
152
- */
153
-
154
- /**
155
- * The Create Data for a Sample Failure Reason
156
- *
157
- * @typedef {Object} SampleFailureReasonController.CreateData
158
- * @property {string} name The Sample Failure Reason Name
159
- * @property {string} description The Sample Failure Reason Description
160
- * @memberof Controllers.Lab.Site
161
- */
162
-
163
- /**
164
- * The Update Data for a Sample Failure Reason
165
- *
166
- * @typedef {Object} SampleFailureReasonController.UpdateData
167
- * @property {string} [name] The Sample Failure Reason Name
168
- * @property {string} [description] The Sample Failure Reason Description
169
- * @memberof Controllers.Lab.Site
170
- */
@@ -1,170 +0,0 @@
1
- /**
2
- * File Auto-Generated by the RICADO Gen 4 PHP API Project
3
- *
4
- * Do Not Edit this File Manually!
5
- */
6
-
7
- import BaseModel from '../../../Models/BaseModel';
8
-
9
- /**
10
- * Model Class for a Sample Failure Reason
11
- *
12
- * @class
13
- * @hideconstructor
14
- * @extends BaseModel
15
- */
16
- class SampleFailureReasonModel extends BaseModel
17
- {
18
- /**
19
- * SampleFailureReasonModel Constructor
20
- *
21
- * @protected
22
- * @param {number} siteId The Site ID associated with this Sample Failure Reason
23
- */
24
- constructor(siteId)
25
- {
26
- super();
27
-
28
- /**
29
- * The Sample Failure Reason ID
30
- *
31
- * @type {string}
32
- * @public
33
- */
34
- this.id = "";
35
-
36
- /**
37
- * The Sample Failure Reason Name
38
- *
39
- * @type {string}
40
- * @public
41
- */
42
- this.name = "";
43
-
44
- /**
45
- * The Sample Failure Reason Description
46
- *
47
- * @type {string}
48
- * @public
49
- */
50
- this.description = "";
51
-
52
- /**
53
- * Whether the Sample Failure Reason has been deleted
54
- *
55
- * @type {boolean}
56
- * @public
57
- */
58
- this.deleted = false;
59
-
60
- /**
61
- * When the Sample Failure Reason was last updated
62
- *
63
- * @type {Date}
64
- * @public
65
- */
66
- this.updateTimestamp = new Date();
67
-
68
- /**
69
- * The Site ID associated with this Sample Failure Reason
70
- *
71
- * @type {number}
72
- * @public
73
- */
74
- this.siteId = siteId;
75
- }
76
-
77
- /**
78
- * Create a new **SampleFailureReasonModel** from a JSON Object or JSON String
79
- *
80
- * @static
81
- * @public
82
- * @param {Object<string, any>|string} json A JSON Object or JSON String
83
- * @param {number} siteId The Site ID associated with this Sample Failure Reason
84
- * @return {SampleFailureReasonModel}
85
- */
86
- static fromJSON(json, siteId)
87
- {
88
- let model = new SampleFailureReasonModel(siteId);
89
-
90
- /**
91
- * The JSON Object
92
- *
93
- * @type {Object<string, any>}
94
- */
95
- let jsonObject = {};
96
-
97
- if(typeof json === 'string')
98
- {
99
- jsonObject = JSON.parse(json);
100
- }
101
- else if(typeof json === 'object')
102
- {
103
- jsonObject = json;
104
- }
105
-
106
- if('id' in jsonObject)
107
- {
108
- model.id = (function(){
109
- if(typeof jsonObject['id'] !== 'string')
110
- {
111
- return String(jsonObject['id']);
112
- }
113
-
114
- return jsonObject['id'];
115
- }());
116
- }
117
-
118
- if('name' in jsonObject)
119
- {
120
- model.name = (function(){
121
- if(typeof jsonObject['name'] !== 'string')
122
- {
123
- return String(jsonObject['name']);
124
- }
125
-
126
- return jsonObject['name'];
127
- }());
128
- }
129
-
130
- if('description' in jsonObject)
131
- {
132
- model.description = (function(){
133
- if(typeof jsonObject['description'] !== 'string')
134
- {
135
- return String(jsonObject['description']);
136
- }
137
-
138
- return jsonObject['description'];
139
- }());
140
- }
141
-
142
- if('deleted' in jsonObject)
143
- {
144
- model.deleted = (function(){
145
- if(typeof jsonObject['deleted'] !== 'boolean')
146
- {
147
- return Boolean(jsonObject['deleted']);
148
- }
149
-
150
- return jsonObject['deleted'];
151
- }());
152
- }
153
-
154
- if('updateTimestamp' in jsonObject)
155
- {
156
- model.updateTimestamp = (function(){
157
- if(typeof jsonObject['updateTimestamp'] !== 'string')
158
- {
159
- return new Date(String(jsonObject['updateTimestamp']));
160
- }
161
-
162
- return new Date(jsonObject['updateTimestamp']);
163
- }());
164
- }
165
-
166
- return model;
167
- }
168
- }
169
-
170
- export default SampleFailureReasonModel;