testit-js-commons 5.0.3 → 5.0.5

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 (46) hide show
  1. package/lib/adapters-api/dist/ApiClient.js +6 -5
  2. package/lib/adapters-api/dist/api/AttachmentsApi.js +5 -5
  3. package/lib/adapters-api/dist/api/AutoTestsApi.js +11 -11
  4. package/lib/adapters-api/dist/api/ConfigurationsApi.js +1 -1
  5. package/lib/adapters-api/dist/api/ParametersApi.js +3 -3
  6. package/lib/adapters-api/dist/api/ProjectAttributesApi.js +6 -6
  7. package/lib/adapters-api/dist/api/ProjectSectionsApi.js +1 -1
  8. package/lib/adapters-api/dist/api/ProjectWorkItemsApi.js +1 -1
  9. package/lib/adapters-api/dist/api/ProjectsApi.js +4 -4
  10. package/lib/adapters-api/dist/api/SectionsApi.js +2 -2
  11. package/lib/adapters-api/dist/api/TestResultsApi.js +3 -3
  12. package/lib/adapters-api/dist/api/TestRunsApi.js +8 -8
  13. package/lib/adapters-api/dist/api/WorkItemsApi.js +3 -3
  14. package/lib/adapters-api/dist/api/WorkflowsApi.js +1 -1
  15. package/lib/adapters-api/dist/index.js +3 -3
  16. package/lib/adapters-api/dist/model/AttachmentPutModelAutoTestStepResultsModel.js +1 -1
  17. package/lib/adapters-api/dist/model/AutoTestStepResult.js +1 -1
  18. package/lib/adapters-api/dist/model/AutoTestStepResultUpdateRequest.js +1 -1
  19. package/lib/adapters-api/dist/model/CreateEmptyTestRunApiModel.js +2 -2
  20. package/lib/adapters-api/dist/model/CustomAttributeApiResult.js +2 -2
  21. package/lib/adapters-api/dist/model/{CustomAttributeGetModel.js → CustomAttributeModel.js} +89 -39
  22. package/lib/adapters-api/dist/model/CustomAttributePutModel.js +1 -1
  23. package/lib/adapters-api/dist/model/LabelApiModel.js +4 -15
  24. package/lib/adapters-api/dist/model/TestResultResponse.js +18 -4
  25. package/lib/adapters-api/dist/model/UpdateEmptyTestRunApiModel.js +1 -1
  26. package/lib/adapters-api/index.d.ts +40 -196
  27. package/lib/common/utils/tms-load-test-run-debug.d.ts +2 -0
  28. package/lib/common/utils/tms-load-test-run-debug.js +6 -0
  29. package/lib/services/syncstorage/syncstorage.runner.js +6 -5
  30. package/lib/services/syncstorage/syncstorage.runner.test.js +16 -0
  31. package/lib/services/testruns/testruns.converter.d.ts +3 -0
  32. package/lib/services/testruns/testruns.converter.js +12 -0
  33. package/lib/services/testruns/testruns.converter.test.d.ts +1 -0
  34. package/lib/services/testruns/testruns.converter.test.js +30 -0
  35. package/lib/services/testruns/testruns.handler.d.ts +2 -2
  36. package/lib/services/testruns/testruns.handler.js +12 -2
  37. package/lib/services/testruns/testruns.service.d.ts +5 -2
  38. package/lib/services/testruns/testruns.service.js +80 -33
  39. package/lib/services/testruns/testruns.service.test.d.ts +1 -0
  40. package/lib/services/testruns/testruns.service.test.js +83 -0
  41. package/lib/services/testruns/testruns.type.d.ts +2 -0
  42. package/lib/strategy/base.strategy.d.ts +1 -0
  43. package/lib/strategy/base.strategy.js +5 -0
  44. package/lib/strategy/strategy.type.d.ts +1 -0
  45. package/lib/sync-storage/dist/ApiClient.js +3 -0
  46. package/package.json +1 -1
@@ -22,25 +22,28 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
22
22
  */
23
23
 
24
24
  /**
25
- * The CustomAttributeGetModel model module.
26
- * @module model/CustomAttributeGetModel
25
+ * The CustomAttributeModel model module.
26
+ * @module model/CustomAttributeModel
27
27
  * @version 1.0.0
28
28
  */
29
- class CustomAttributeGetModel {
29
+ class CustomAttributeModel {
30
30
  /**
31
- * Constructs a new <code>CustomAttributeGetModel</code>.
32
- * @alias module:model/CustomAttributeGetModel
33
- * @param id {String} Unique ID of the attribute
34
- * @param options {Array.<module:model/CustomAttributeOptionModel>} Collection of the attribute options
35
- * @param type {module:model/CustomAttributeTypesEnum} Type of the attribute
36
- * @param isDeleted {Boolean} Indicates if the attribute is deleted
31
+ * Constructs a new <code>CustomAttributeModel</code>.
32
+ * @alias module:model/CustomAttributeModel
33
+ * @param id {String} Unique ID of the attribute.
34
+ * @param type {module:model/CustomAttributeTypesEnum} Type of the attribute.
35
+ * @param options {Array.<module:model/CustomAttributeOptionModel>} Collection of the attribute options.
36
+ * @param targets {Array.<String>} Collection of the attribute targets. Defines where the attribute can be used (e.g., TestCases, AutoTestCases, TestPlans).
37
+ * @param isReadOnly {Boolean} Indicates if the attribute is read-only.
38
+ * @param isDeleted {Boolean} Indicates if the attribute is deleted.
39
+ * @param isSystem {Boolean} Indicates if the attribute is system.
37
40
  * @param name {String} Name of the attribute
38
41
  * @param isEnabled {Boolean} Indicates if the attribute is enabled
39
- * @param isRequired {Boolean} Indicates if the attribute is mandatory to specify
42
+ * @param isRequired {Boolean} Indicates if the attribute value is mandatory to specify
40
43
  * @param isGlobal {Boolean} Indicates if the attribute is available across all projects
41
44
  */
42
- constructor(id, options, type, isDeleted, name, isEnabled, isRequired, isGlobal) {
43
- CustomAttributeGetModel.initialize(this, id, options, type, isDeleted, name, isEnabled, isRequired, isGlobal);
45
+ constructor(id, type, options, targets, isReadOnly, isDeleted, isSystem, name, isEnabled, isRequired, isGlobal) {
46
+ CustomAttributeModel.initialize(this, id, type, options, targets, isReadOnly, isDeleted, isSystem, name, isEnabled, isRequired, isGlobal);
44
47
  }
45
48
 
46
49
  /**
@@ -48,11 +51,14 @@ class CustomAttributeGetModel {
48
51
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
52
  * Only for internal use.
50
53
  */
51
- static initialize(obj, id, options, type, isDeleted, name, isEnabled, isRequired, isGlobal) {
54
+ static initialize(obj, id, type, options, targets, isReadOnly, isDeleted, isSystem, name, isEnabled, isRequired, isGlobal) {
52
55
  obj['id'] = id;
53
- obj['options'] = options;
54
56
  obj['type'] = type;
57
+ obj['options'] = options;
58
+ obj['targets'] = targets;
59
+ obj['isReadOnly'] = isReadOnly;
55
60
  obj['isDeleted'] = isDeleted;
61
+ obj['isSystem'] = isSystem;
56
62
  obj['name'] = name;
57
63
  obj['isEnabled'] = isEnabled;
58
64
  obj['isRequired'] = isRequired;
@@ -60,27 +66,39 @@ class CustomAttributeGetModel {
60
66
  }
61
67
 
62
68
  /**
63
- * Constructs a <code>CustomAttributeGetModel</code> from a plain JavaScript object, optionally creating a new instance.
69
+ * Constructs a <code>CustomAttributeModel</code> from a plain JavaScript object, optionally creating a new instance.
64
70
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
71
  * @param {Object} data The plain JavaScript object bearing properties of interest.
66
- * @param {module:model/CustomAttributeGetModel} obj Optional instance to populate.
67
- * @return {module:model/CustomAttributeGetModel} The populated <code>CustomAttributeGetModel</code> instance.
72
+ * @param {module:model/CustomAttributeModel} obj Optional instance to populate.
73
+ * @return {module:model/CustomAttributeModel} The populated <code>CustomAttributeModel</code> instance.
68
74
  */
69
75
  static constructFromObject(data, obj) {
70
76
  if (data) {
71
- obj = obj || new CustomAttributeGetModel();
77
+ obj = obj || new CustomAttributeModel();
72
78
  if (data.hasOwnProperty('id')) {
73
79
  obj['id'] = _ApiClient.default.convertToType(data['id'], 'String');
74
80
  }
75
- if (data.hasOwnProperty('options')) {
76
- obj['options'] = _ApiClient.default.convertToType(data['options'], [_CustomAttributeOptionModel.default]);
81
+ if (data.hasOwnProperty('code')) {
82
+ obj['code'] = _ApiClient.default.convertToType(data['code'], 'String');
77
83
  }
78
84
  if (data.hasOwnProperty('type')) {
79
85
  obj['type'] = _ApiClient.default.convertToType(data['type'], _CustomAttributeTypesEnum.default);
80
86
  }
87
+ if (data.hasOwnProperty('options')) {
88
+ obj['options'] = _ApiClient.default.convertToType(data['options'], [_CustomAttributeOptionModel.default]);
89
+ }
90
+ if (data.hasOwnProperty('targets')) {
91
+ obj['targets'] = _ApiClient.default.convertToType(data['targets'], ['String']);
92
+ }
93
+ if (data.hasOwnProperty('isReadOnly')) {
94
+ obj['isReadOnly'] = _ApiClient.default.convertToType(data['isReadOnly'], 'Boolean');
95
+ }
81
96
  if (data.hasOwnProperty('isDeleted')) {
82
97
  obj['isDeleted'] = _ApiClient.default.convertToType(data['isDeleted'], 'Boolean');
83
98
  }
99
+ if (data.hasOwnProperty('isSystem')) {
100
+ obj['isSystem'] = _ApiClient.default.convertToType(data['isSystem'], 'Boolean');
101
+ }
84
102
  if (data.hasOwnProperty('name')) {
85
103
  obj['name'] = _ApiClient.default.convertToType(data['name'], 'String');
86
104
  }
@@ -98,13 +116,13 @@ class CustomAttributeGetModel {
98
116
  }
99
117
 
100
118
  /**
101
- * Validates the JSON data with respect to <code>CustomAttributeGetModel</code>.
119
+ * Validates the JSON data with respect to <code>CustomAttributeModel</code>.
102
120
  * @param {Object} data The plain JavaScript object bearing properties of interest.
103
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CustomAttributeGetModel</code>.
121
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CustomAttributeModel</code>.
104
122
  */
105
123
  static validateJSON(data) {
106
124
  // check to make sure all required properties are present in the JSON string
107
- for (const property of CustomAttributeGetModel.RequiredProperties) {
125
+ for (const property of CustomAttributeModel.RequiredProperties) {
108
126
  if (!data.hasOwnProperty(property)) {
109
127
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
110
128
  }
@@ -113,6 +131,10 @@ class CustomAttributeGetModel {
113
131
  if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
114
132
  throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
115
133
  }
134
+ // ensure the json data is a string
135
+ if (data['code'] && !(typeof data['code'] === 'string' || data['code'] instanceof String)) {
136
+ throw new Error("Expected the field `code` to be a primitive type in the JSON string but got " + data['code']);
137
+ }
116
138
  if (data['options']) {
117
139
  // data not null
118
140
  // ensure the json data is an array
@@ -125,6 +147,10 @@ class CustomAttributeGetModel {
125
147
  }
126
148
  ;
127
149
  }
150
+ // ensure the json data is an array
151
+ if (!Array.isArray(data['targets'])) {
152
+ throw new Error("Expected the field `targets` to be an array in the JSON data but got " + data['targets']);
153
+ }
128
154
  // ensure the json data is a string
129
155
  if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
130
156
  throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
@@ -132,53 +158,77 @@ class CustomAttributeGetModel {
132
158
  return true;
133
159
  }
134
160
  }
135
- CustomAttributeGetModel.RequiredProperties = ["id", "options", "type", "isDeleted", "name", "isEnabled", "isRequired", "isGlobal"];
161
+ CustomAttributeModel.RequiredProperties = ["id", "type", "options", "targets", "isReadOnly", "isDeleted", "isSystem", "name", "isEnabled", "isRequired", "isGlobal"];
136
162
 
137
163
  /**
138
- * Unique ID of the attribute
164
+ * Unique ID of the attribute.
139
165
  * @member {String} id
140
166
  */
141
- CustomAttributeGetModel.prototype['id'] = undefined;
167
+ CustomAttributeModel.prototype['id'] = undefined;
142
168
 
143
169
  /**
144
- * Collection of the attribute options
145
- * @member {Array.<module:model/CustomAttributeOptionModel>} options
170
+ * Optional code identifier for the attribute.
171
+ * @member {String} code
146
172
  */
147
- CustomAttributeGetModel.prototype['options'] = undefined;
173
+ CustomAttributeModel.prototype['code'] = undefined;
148
174
 
149
175
  /**
150
- * Type of the attribute
176
+ * Type of the attribute.
151
177
  * @member {module:model/CustomAttributeTypesEnum} type
152
178
  */
153
- CustomAttributeGetModel.prototype['type'] = undefined;
179
+ CustomAttributeModel.prototype['type'] = undefined;
154
180
 
155
181
  /**
156
- * Indicates if the attribute is deleted
182
+ * Collection of the attribute options.
183
+ * @member {Array.<module:model/CustomAttributeOptionModel>} options
184
+ */
185
+ CustomAttributeModel.prototype['options'] = undefined;
186
+
187
+ /**
188
+ * Collection of the attribute targets. Defines where the attribute can be used (e.g., TestCases, AutoTestCases, TestPlans).
189
+ * @member {Array.<String>} targets
190
+ */
191
+ CustomAttributeModel.prototype['targets'] = undefined;
192
+
193
+ /**
194
+ * Indicates if the attribute is read-only.
195
+ * @member {Boolean} isReadOnly
196
+ */
197
+ CustomAttributeModel.prototype['isReadOnly'] = undefined;
198
+
199
+ /**
200
+ * Indicates if the attribute is deleted.
157
201
  * @member {Boolean} isDeleted
158
202
  */
159
- CustomAttributeGetModel.prototype['isDeleted'] = undefined;
203
+ CustomAttributeModel.prototype['isDeleted'] = undefined;
204
+
205
+ /**
206
+ * Indicates if the attribute is system.
207
+ * @member {Boolean} isSystem
208
+ */
209
+ CustomAttributeModel.prototype['isSystem'] = undefined;
160
210
 
161
211
  /**
162
212
  * Name of the attribute
163
213
  * @member {String} name
164
214
  */
165
- CustomAttributeGetModel.prototype['name'] = undefined;
215
+ CustomAttributeModel.prototype['name'] = undefined;
166
216
 
167
217
  /**
168
218
  * Indicates if the attribute is enabled
169
219
  * @member {Boolean} isEnabled
170
220
  */
171
- CustomAttributeGetModel.prototype['isEnabled'] = undefined;
221
+ CustomAttributeModel.prototype['isEnabled'] = undefined;
172
222
 
173
223
  /**
174
- * Indicates if the attribute is mandatory to specify
224
+ * Indicates if the attribute value is mandatory to specify
175
225
  * @member {Boolean} isRequired
176
226
  */
177
- CustomAttributeGetModel.prototype['isRequired'] = undefined;
227
+ CustomAttributeModel.prototype['isRequired'] = undefined;
178
228
 
179
229
  /**
180
230
  * Indicates if the attribute is available across all projects
181
231
  * @member {Boolean} isGlobal
182
232
  */
183
- CustomAttributeGetModel.prototype['isGlobal'] = undefined;
184
- var _default = exports.default = CustomAttributeGetModel;
233
+ CustomAttributeModel.prototype['isGlobal'] = undefined;
234
+ var _default = exports.default = CustomAttributeModel;
@@ -139,7 +139,7 @@ CustomAttributePutModel.RequiredProperties = ["id", "type", "isDeleted", "name",
139
139
  CustomAttributePutModel.prototype['id'] = undefined;
140
140
 
141
141
  /**
142
- * Collection of the attribute options Available for attributes of type `options` and `multiple options` only
142
+ * Collection of the attribute options Available for attributes of type `options` and `multiple options` only
143
143
  * @member {Array.<module:model/CustomAttributeOptionModel>} options
144
144
  */
145
145
  CustomAttributePutModel.prototype['options'] = undefined;
@@ -29,10 +29,9 @@ class LabelApiModel {
29
29
  * Constructs a new <code>LabelApiModel</code>.
30
30
  * @alias module:model/LabelApiModel
31
31
  * @param name {String} Name of the label
32
- * @param globalId {Number} Global ID of the label
33
32
  */
34
- constructor(name, globalId) {
35
- LabelApiModel.initialize(this, name, globalId);
33
+ constructor(name) {
34
+ LabelApiModel.initialize(this, name);
36
35
  }
37
36
 
38
37
  /**
@@ -40,9 +39,8 @@ class LabelApiModel {
40
39
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
40
  * Only for internal use.
42
41
  */
43
- static initialize(obj, name, globalId) {
42
+ static initialize(obj, name) {
44
43
  obj['name'] = name;
45
- obj['globalId'] = globalId;
46
44
  }
47
45
 
48
46
  /**
@@ -58,9 +56,6 @@ class LabelApiModel {
58
56
  if (data.hasOwnProperty('name')) {
59
57
  obj['name'] = _ApiClient.default.convertToType(data['name'], 'String');
60
58
  }
61
- if (data.hasOwnProperty('globalId')) {
62
- obj['globalId'] = _ApiClient.default.convertToType(data['globalId'], 'Number');
63
- }
64
59
  }
65
60
  return obj;
66
61
  }
@@ -84,17 +79,11 @@ class LabelApiModel {
84
79
  return true;
85
80
  }
86
81
  }
87
- LabelApiModel.RequiredProperties = ["name", "globalId"];
82
+ LabelApiModel.RequiredProperties = ["name"];
88
83
 
89
84
  /**
90
85
  * Name of the label
91
86
  * @member {String} name
92
87
  */
93
88
  LabelApiModel.prototype['name'] = undefined;
94
-
95
- /**
96
- * Global ID of the label
97
- * @member {Number} globalId
98
- */
99
- LabelApiModel.prototype['globalId'] = undefined;
100
89
  var _default = exports.default = LabelApiModel;
@@ -39,10 +39,11 @@ class TestResultResponse {
39
39
  * @param id {String}
40
40
  * @param failureClassIds {Array.<String>}
41
41
  * @param configurationId {String}
42
+ * @param testPointId {String}
42
43
  * @param testRunId {String}
43
44
  */
44
- constructor(id, failureClassIds, configurationId, testRunId) {
45
- TestResultResponse.initialize(this, id, failureClassIds, configurationId, testRunId);
45
+ constructor(id, failureClassIds, configurationId, testPointId, testRunId) {
46
+ TestResultResponse.initialize(this, id, failureClassIds, configurationId, testPointId, testRunId);
46
47
  }
47
48
 
48
49
  /**
@@ -50,10 +51,11 @@ class TestResultResponse {
50
51
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
52
  * Only for internal use.
52
53
  */
53
- static initialize(obj, id, failureClassIds, configurationId, testRunId) {
54
+ static initialize(obj, id, failureClassIds, configurationId, testPointId, testRunId) {
54
55
  obj['id'] = id;
55
56
  obj['failureClassIds'] = failureClassIds;
56
57
  obj['configurationId'] = configurationId;
58
+ obj['testPointId'] = testPointId;
57
59
  obj['testRunId'] = testRunId;
58
60
  }
59
61
 
@@ -100,6 +102,9 @@ class TestResultResponse {
100
102
  if (data.hasOwnProperty('configurationId')) {
101
103
  obj['configurationId'] = _ApiClient.default.convertToType(data['configurationId'], 'String');
102
104
  }
105
+ if (data.hasOwnProperty('testPointId')) {
106
+ obj['testPointId'] = _ApiClient.default.convertToType(data['testPointId'], 'String');
107
+ }
103
108
  if (data.hasOwnProperty('durationInMs')) {
104
109
  obj['durationInMs'] = _ApiClient.default.convertToType(data['durationInMs'], 'Number');
105
110
  }
@@ -227,6 +232,10 @@ class TestResultResponse {
227
232
  throw new Error("Expected the field `configurationId` to be a primitive type in the JSON string but got " + data['configurationId']);
228
233
  }
229
234
  // ensure the json data is a string
235
+ if (data['testPointId'] && !(typeof data['testPointId'] === 'string' || data['testPointId'] instanceof String)) {
236
+ throw new Error("Expected the field `testPointId` to be a primitive type in the JSON string but got " + data['testPointId']);
237
+ }
238
+ // ensure the json data is a string
230
239
  if (data['traces'] && !(typeof data['traces'] === 'string' || data['traces'] instanceof String)) {
231
240
  throw new Error("Expected the field `traces` to be a primitive type in the JSON string but got " + data['traces']);
232
241
  }
@@ -286,7 +295,7 @@ class TestResultResponse {
286
295
  return true;
287
296
  }
288
297
  }
289
- TestResultResponse.RequiredProperties = ["id", "failureClassIds", "configurationId", "testRunId"];
298
+ TestResultResponse.RequiredProperties = ["id", "failureClassIds", "configurationId", "testPointId", "testRunId"];
290
299
 
291
300
  /**
292
301
  * @member {String} id
@@ -343,6 +352,11 @@ TestResultResponse.prototype['autoTestId'] = undefined;
343
352
  */
344
353
  TestResultResponse.prototype['configurationId'] = undefined;
345
354
 
355
+ /**
356
+ * @member {String} testPointId
357
+ */
358
+ TestResultResponse.prototype['testPointId'] = undefined;
359
+
346
360
  /**
347
361
  * @member {Number} durationInMs
348
362
  */
@@ -162,7 +162,7 @@ UpdateEmptyTestRunApiModel.prototype['name'] = undefined;
162
162
  UpdateEmptyTestRunApiModel.prototype['description'] = undefined;
163
163
 
164
164
  /**
165
- * Test run launch source Once launch source is specified it cannot be updated
165
+ * Test run launch source Once launch source is specified it cannot be updated
166
166
  * @member {String} launchSource
167
167
  */
168
168
  UpdateEmptyTestRunApiModel.prototype['launchSource'] = undefined;