testit-js-commons 5.0.6 → 5.0.8-TMS-5.8

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 (74) hide show
  1. package/lib/adapters-api/dist/ApiClient.js +5 -6
  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 -80
  16. package/lib/adapters-api/dist/model/AttachmentPutModelAutoTestStepResultsModel.js +1 -1
  17. package/lib/adapters-api/dist/model/AutoTestApiResult.js +0 -15
  18. package/lib/adapters-api/dist/model/AutoTestCreateApiModel.js +0 -15
  19. package/lib/adapters-api/dist/model/AutoTestStepResult.js +1 -1
  20. package/lib/adapters-api/dist/model/AutoTestStepResultUpdateRequest.js +1 -1
  21. package/lib/adapters-api/dist/model/AutoTestUpdateApiModel.js +4 -30
  22. package/lib/adapters-api/dist/model/CreateEmptyTestRunApiModel.js +2 -2
  23. package/lib/adapters-api/dist/model/CustomAttributeApiResult.js +6 -56
  24. package/lib/adapters-api/dist/model/{CustomAttributeModel.js → CustomAttributeGetModel.js} +39 -89
  25. package/lib/adapters-api/dist/model/CustomAttributePutModel.js +1 -1
  26. package/lib/adapters-api/dist/model/LabelApiModel.js +15 -4
  27. package/lib/adapters-api/dist/model/ProjectsFilterModel.js +13 -13
  28. package/lib/adapters-api/dist/model/TestResultResponse.js +4 -18
  29. package/lib/adapters-api/dist/model/TestResultShortResponse.js +4 -15
  30. package/lib/adapters-api/dist/model/TestResultsFilterApiModel.js +0 -14
  31. package/lib/adapters-api/dist/model/TestRunApiResult.js +4 -45
  32. package/lib/adapters-api/dist/model/UpdateEmptyTestRunApiModel.js +1 -1
  33. package/lib/adapters-api/index.d.ts +204 -758
  34. package/lib/common/index.d.ts +0 -1
  35. package/lib/common/index.js +0 -1
  36. package/lib/common/types/common.type.d.ts +0 -2
  37. package/lib/common/utils/tms-load-test-run-debug.d.ts +0 -2
  38. package/lib/common/utils/tms-load-test-run-debug.js +0 -6
  39. package/lib/services/attachments/attachments.service.d.ts +1 -0
  40. package/lib/services/attachments/attachments.service.js +10 -2
  41. package/lib/services/autotests/autotests.converter.d.ts +2 -6
  42. package/lib/services/autotests/autotests.converter.js +16 -41
  43. package/lib/services/autotests/autotests.service.js +3 -3
  44. package/lib/services/autotests/autotests.type.d.ts +0 -2
  45. package/lib/services/syncstorage/syncstorage.runner.js +5 -6
  46. package/lib/services/syncstorage/syncstorage.runner.test.js +0 -16
  47. package/lib/services/testresults/testresults.converter.d.ts +5 -4
  48. package/lib/services/testresults/testresults.converter.js +8 -0
  49. package/lib/services/testresults/testresults.service.js +18 -1
  50. package/lib/services/testruns/testruns.handler.d.ts +2 -2
  51. package/lib/services/testruns/testruns.handler.js +2 -12
  52. package/lib/services/testruns/testruns.service.d.ts +0 -2
  53. package/lib/services/testruns/testruns.service.js +6 -31
  54. package/lib/services/testruns/testruns.service.test.js +47 -5
  55. package/lib/strategy/base.strategy.d.ts +11 -0
  56. package/lib/strategy/base.strategy.js +73 -4
  57. package/lib/strategy/zero.strategy.js +1 -1
  58. package/lib/sync-storage/dist/ApiClient.js +0 -3
  59. package/package.json +1 -1
  60. package/lib/adapters-api/dist/api/CustomAttributesApi.js +0 -201
  61. package/lib/adapters-api/dist/model/CustomAttributeOptionPostApiModel.js +0 -98
  62. package/lib/adapters-api/dist/model/CustomAttributeOptionUpdateApiModel.js +0 -124
  63. package/lib/adapters-api/dist/model/CustomAttributeSearchApiModel.js +0 -137
  64. package/lib/adapters-api/dist/model/CustomAttributeSearchApiResult.js +0 -281
  65. package/lib/adapters-api/dist/model/GlobalCustomAttributePostApiModel.js +0 -141
  66. package/lib/adapters-api/dist/model/GlobalCustomAttributeUpdateApiModel.js +0 -129
  67. package/lib/adapters-api/dist/model/LayerApiModel.js +0 -102
  68. package/lib/adapters-api/dist/model/LayerApiResult.js +0 -102
  69. package/lib/adapters-api/dist/model/LayerSource.js +0 -61
  70. package/lib/adapters-api/dist/model/ProjectShortestApiResult.js +0 -138
  71. package/lib/common/test-layers.d.ts +0 -11
  72. package/lib/common/test-layers.js +0 -13
  73. package/lib/services/autotests/autotests.converter.test.d.ts +0 -1
  74. package/lib/services/autotests/autotests.converter.test.js +0 -39
@@ -21,6 +21,8 @@ const logger_1 = __importDefault(require("../logger"));
21
21
  class BaseStrategy {
22
22
  constructor(config) {
23
23
  this.config = config;
24
+ /** All attempts (including retries) for deferredExternalId, in order. */
25
+ this.deferredResults = [];
24
26
  this.client = new client_1.Client(config);
25
27
  this.testRunId = Promise.resolve(config.testRunId);
26
28
  }
@@ -38,6 +40,7 @@ class BaseStrategy {
38
40
  return __awaiter(this, void 0, void 0, function* () {
39
41
  var _a, _b;
40
42
  const testRunId = yield this.testRunId;
43
+ yield this.flushDeferredResults(testRunId);
41
44
  yield ((_a = this.syncStorageRunner) === null || _a === void 0 ? void 0 : _a.setWorkerStatus("completed"));
42
45
  yield ((_b = this.syncStorageRunner) === null || _b === void 0 ? void 0 : _b.completeProcessing());
43
46
  // With active sync-storage, run completion is finalized by sync-storage itself.
@@ -49,6 +52,27 @@ class BaseStrategy {
49
52
  //await this.client.testRuns.completeTestRun(testRunId);
50
53
  });
51
54
  }
55
+ flushDeferredResults(testRunId) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ if (this.deferredResults.length === 0) {
58
+ return;
59
+ }
60
+ const results = this.deferredResults.splice(0, this.deferredResults.length);
61
+ (0, utils_1.logTmsLoadTestRun)("flush deferred finals", {
62
+ testRunId,
63
+ autoTestExternalId: this.deferredExternalId,
64
+ count: results.length,
65
+ });
66
+ yield this.client.testRuns.loadAutotests(testRunId, results).catch((err) => {
67
+ var _a;
68
+ logger_1.default.error("[strategy] FAILED to flush deferred results", {
69
+ autoTestExternalId: this.deferredExternalId,
70
+ error: (_a = err === null || err === void 0 ? void 0 : err.body) !== null && _a !== void 0 ? _a : err,
71
+ });
72
+ });
73
+ this.deferredExternalId = undefined;
74
+ });
75
+ }
52
76
  loadAutotest(autotest, status) {
53
77
  return __awaiter(this, void 0, void 0, function* () {
54
78
  var _a, _b, _c, _d, _e, _f;
@@ -93,6 +117,37 @@ class BaseStrategy {
93
117
  });
94
118
  });
95
119
  }
120
+ /**
121
+ * Split batch: attempts for the deferred InProgress autotest go to the queue;
122
+ * everything else is posted as final immediately.
123
+ */
124
+ partitionByDeferred(autotests) {
125
+ if (!this.deferredExternalId) {
126
+ return { deferred: [], immediate: autotests };
127
+ }
128
+ const deferred = [];
129
+ const immediate = [];
130
+ for (const result of autotests) {
131
+ if (result.autoTestExternalId === this.deferredExternalId) {
132
+ deferred.push(result);
133
+ }
134
+ else {
135
+ immediate.push(result);
136
+ }
137
+ }
138
+ return { deferred, immediate };
139
+ }
140
+ enqueueDeferred(results) {
141
+ if (results.length === 0) {
142
+ return;
143
+ }
144
+ this.deferredResults.push(...results);
145
+ (0, utils_1.logTmsLoadTestRun)("enqueue deferred attempts", {
146
+ autoTestExternalId: this.deferredExternalId,
147
+ added: results.length,
148
+ queued: this.deferredResults.length,
149
+ });
150
+ }
96
151
  loadTestRun(autotests) {
97
152
  return __awaiter(this, void 0, void 0, function* () {
98
153
  var _a, _b, _c, _d, _e, _f, _g;
@@ -102,11 +157,21 @@ class BaseStrategy {
102
157
  testRunId,
103
158
  batchSize: autotests.length,
104
159
  firstExternalId: firstResult === null || firstResult === void 0 ? void 0 : firstResult.autoTestExternalId,
160
+ deferredExternalId: this.deferredExternalId,
105
161
  syncRunnerActive: Boolean((_b = (_a = this.syncStorageRunner) === null || _a === void 0 ? void 0 : _a.isActive) === null || _b === void 0 ? void 0 : _b.call(_a)),
106
162
  isMaster: Boolean((_d = (_c = this.syncStorageRunner) === null || _c === void 0 ? void 0 : _c.isMasterWorker) === null || _d === void 0 ? void 0 : _d.call(_c)),
107
163
  });
164
+ // Already holding an InProgress slot: buffer retries of that autotest, post the rest.
165
+ if (this.deferredExternalId) {
166
+ const { deferred, immediate } = this.partitionByDeferred(autotests);
167
+ this.enqueueDeferred(deferred);
168
+ if (immediate.length > 0) {
169
+ yield this.client.testRuns.loadAutotests(testRunId, immediate);
170
+ }
171
+ return;
172
+ }
108
173
  // InProgress is only for the first result (the one used for sync storage cut).
109
- // Its final payload is deferred until teardown, so TMS does not immediately flip to final status.
174
+ // Its final payload (and retries of the same externalId) are deferred until teardown.
110
175
  if (firstResult) {
111
176
  const isMasterWorker = Boolean((_f = (_e = this.syncStorageRunner) === null || _e === void 0 ? void 0 : _e.isMasterWorker) === null || _f === void 0 ? void 0 : _f.call(_e));
112
177
  const published = yield ((_g = this.syncStorageRunner) === null || _g === void 0 ? void 0 : _g.sendInProgressTestResult((0, syncstorage_1.toTestResultCutModel)(firstResult, this.config.projectId)));
@@ -145,10 +210,13 @@ class BaseStrategy {
145
210
  });
146
211
  throw err;
147
212
  }
148
- // For published sync-storage InProgress, finalization of the first result is handled by sync-storage.
213
+ this.deferredExternalId = firstResult.autoTestExternalId;
214
+ this.enqueueDeferred([firstResult]);
149
215
  const rest = autotests.slice(1);
150
- if (rest.length > 0) {
151
- yield this.client.testRuns.loadAutotests(testRunId, rest);
216
+ const { deferred, immediate } = this.partitionByDeferred(rest);
217
+ this.enqueueDeferred(deferred);
218
+ if (immediate.length > 0) {
219
+ yield this.client.testRuns.loadAutotests(testRunId, immediate);
152
220
  }
153
221
  return;
154
222
  }
@@ -158,6 +226,7 @@ class BaseStrategy {
158
226
  }
159
227
  updateSetupTeardown(autotests) {
160
228
  return __awaiter(this, void 0, void 0, function* () {
229
+ yield this.testRunId;
161
230
  yield this.client.testRuns.updateSetupTeardown(autotests);
162
231
  });
163
232
  }
@@ -7,7 +7,7 @@ class ZeroStrategy extends base_strategy_1.BaseStrategy {
7
7
  super(config);
8
8
  if (!config.testRunId)
9
9
  throw new Error("testRunId is required when mode is 0");
10
- this.testsInRun = this.client.testResults.getExternalIdsForRun();
10
+ this.testsInRun = this.testRunId.then(() => this.client.testResults.getExternalIdsForRun());
11
11
  }
12
12
  }
13
13
  exports.ZeroStrategy = ZeroStrategy;
@@ -289,9 +289,6 @@ class ApiClient {
289
289
  applyAuthToRequest(request, authNames) {
290
290
  authNames.forEach(authName => {
291
291
  var auth = this.authentications[authName];
292
- if (!auth) {
293
- return;
294
- }
295
292
  switch (auth.type) {
296
293
  case 'basic':
297
294
  if (auth.username || auth.password) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-js-commons",
3
- "version": "5.0.6",
3
+ "version": "5.0.8-TMS-5.8",
4
4
  "description": "JavaScript commons for Test IT",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,201 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _CustomAttributeApiResult = _interopRequireDefault(require("../model/CustomAttributeApiResult"));
9
- var _CustomAttributeSearchApiModel = _interopRequireDefault(require("../model/CustomAttributeSearchApiModel"));
10
- var _CustomAttributeSearchApiResult = _interopRequireDefault(require("../model/CustomAttributeSearchApiResult"));
11
- var _GlobalCustomAttributePostApiModel = _interopRequireDefault(require("../model/GlobalCustomAttributePostApiModel"));
12
- var _GlobalCustomAttributeUpdateApiModel = _interopRequireDefault(require("../model/GlobalCustomAttributeUpdateApiModel"));
13
- var _ProblemDetails = _interopRequireDefault(require("../model/ProblemDetails"));
14
- var _ValidationProblemDetails = _interopRequireDefault(require("../model/ValidationProblemDetails"));
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- /**
17
- * API
18
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
19
- *
20
- * The version of the OpenAPI document: adapters
21
- *
22
- *
23
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
- * https://openapi-generator.tech
25
- * Do not edit the class manually.
26
- *
27
- */
28
-
29
- /**
30
- * CustomAttributes service.
31
- * @module api/CustomAttributesApi
32
- * @version 1.0.0
33
- */
34
- class CustomAttributesApi {
35
- /**
36
- * Constructs a new CustomAttributesApi.
37
- * @alias module:api/CustomAttributesApi
38
- * @class
39
- * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
40
- * default to {@link module:ApiClient#instance} if unspecified.
41
- */
42
- constructor(apiClient) {
43
- this.apiClient = apiClient || _ApiClient.default.instance;
44
- }
45
-
46
- /**
47
- * Update global attribute
48
- * @param {String} id Unique ID of attribute
49
- * @param {Object} opts Optional parameters
50
- * @param {module:model/GlobalCustomAttributeUpdateApiModel} [globalCustomAttributeUpdateApiModel]
51
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CustomAttributeApiResult} and HTTP response
52
- */
53
- adaptersCustomAttributesGlobalIdPutWithHttpInfo(id, opts) {
54
- opts = opts || {};
55
- let postBody = opts['globalCustomAttributeUpdateApiModel'];
56
- // verify the required parameter 'id' is set
57
- if (id === undefined || id === null) {
58
- throw new Error("Missing the required parameter 'id' when calling adaptersCustomAttributesGlobalIdPut");
59
- }
60
- let pathParams = {
61
- 'id': id
62
- };
63
- let queryParams = {};
64
- let headerParams = {};
65
- let formParams = {};
66
- let authNames = ['PrivateToken', 'Identity.Application'];
67
- let contentTypes = ['application/json'];
68
- let accepts = ['application/json'];
69
- let returnType = _CustomAttributeApiResult.default;
70
- return this.apiClient.callApi('/adapters/customAttributes/global/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
71
- }
72
-
73
- /**
74
- * Update global attribute
75
- * @param {String} id Unique ID of attribute
76
- * @param {Object} opts Optional parameters
77
- * @param {module:model/GlobalCustomAttributeUpdateApiModel} opts.globalCustomAttributeUpdateApiModel
78
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CustomAttributeApiResult}
79
- */
80
- adaptersCustomAttributesGlobalIdPut(id, opts) {
81
- return this.adaptersCustomAttributesGlobalIdPutWithHttpInfo(id, opts).then(function (response_and_data) {
82
- return response_and_data.data;
83
- });
84
- }
85
-
86
- /**
87
- * Create global attribute
88
- * @param {Object} opts Optional parameters
89
- * @param {module:model/GlobalCustomAttributePostApiModel} [globalCustomAttributePostApiModel]
90
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CustomAttributeApiResult} and HTTP response
91
- */
92
- adaptersCustomAttributesGlobalPostWithHttpInfo(opts) {
93
- opts = opts || {};
94
- let postBody = opts['globalCustomAttributePostApiModel'];
95
- let pathParams = {};
96
- let queryParams = {};
97
- let headerParams = {};
98
- let formParams = {};
99
- let authNames = ['PrivateToken', 'Identity.Application'];
100
- let contentTypes = ['application/json'];
101
- let accepts = ['application/json'];
102
- let returnType = _CustomAttributeApiResult.default;
103
- return this.apiClient.callApi('/adapters/customAttributes/global', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
104
- }
105
-
106
- /**
107
- * Create global attribute
108
- * @param {Object} opts Optional parameters
109
- * @param {module:model/GlobalCustomAttributePostApiModel} opts.globalCustomAttributePostApiModel
110
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CustomAttributeApiResult}
111
- */
112
- adaptersCustomAttributesGlobalPost(opts) {
113
- return this.adaptersCustomAttributesGlobalPostWithHttpInfo(opts).then(function (response_and_data) {
114
- return response_and_data.data;
115
- });
116
- }
117
-
118
- /**
119
- * Get attribute by ID
120
- * @param {String} id Unique ID of attribute
121
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CustomAttributeApiResult} and HTTP response
122
- */
123
- adaptersCustomAttributesIdGetWithHttpInfo(id) {
124
- let postBody = null;
125
- // verify the required parameter 'id' is set
126
- if (id === undefined || id === null) {
127
- throw new Error("Missing the required parameter 'id' when calling adaptersCustomAttributesIdGet");
128
- }
129
- let pathParams = {
130
- 'id': id
131
- };
132
- let queryParams = {};
133
- let headerParams = {};
134
- let formParams = {};
135
- let authNames = ['PrivateToken', 'Identity.Application'];
136
- let contentTypes = [];
137
- let accepts = ['application/json'];
138
- let returnType = _CustomAttributeApiResult.default;
139
- return this.apiClient.callApi('/adapters/customAttributes/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
140
- }
141
-
142
- /**
143
- * Get attribute by ID
144
- * @param {String} id Unique ID of attribute
145
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CustomAttributeApiResult}
146
- */
147
- adaptersCustomAttributesIdGet(id) {
148
- return this.adaptersCustomAttributesIdGetWithHttpInfo(id).then(function (response_and_data) {
149
- return response_and_data.data;
150
- });
151
- }
152
-
153
- /**
154
- * Search for attributes
155
- * @param {Object} opts Optional parameters
156
- * @param {Number} [skip] Amount of items to be skipped (offset)
157
- * @param {Number} [take] Amount of items to be taken (limit)
158
- * @param {String} [orderBy] SQL-like ORDER BY statement (column1 ASC|DESC , column2 ASC|DESC)
159
- * @param {String} [searchField] Property name for searching
160
- * @param {String} [searchValue] Value for searching
161
- * @param {module:model/CustomAttributeSearchApiModel} [customAttributeSearchApiModel]
162
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CustomAttributeSearchApiResult>} and HTTP response
163
- */
164
- adaptersCustomAttributesSearchPostWithHttpInfo(opts) {
165
- opts = opts || {};
166
- let postBody = opts['customAttributeSearchApiModel'];
167
- let pathParams = {};
168
- let queryParams = {
169
- 'Skip': opts['skip'],
170
- 'Take': opts['take'],
171
- 'OrderBy': opts['orderBy'],
172
- 'SearchField': opts['searchField'],
173
- 'SearchValue': opts['searchValue']
174
- };
175
- let headerParams = {};
176
- let formParams = {};
177
- let authNames = ['PrivateToken', 'Identity.Application'];
178
- let contentTypes = ['application/json'];
179
- let accepts = ['application/json'];
180
- let returnType = [_CustomAttributeSearchApiResult.default];
181
- return this.apiClient.callApi('/adapters/customAttributes/search', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
182
- }
183
-
184
- /**
185
- * Search for attributes
186
- * @param {Object} opts Optional parameters
187
- * @param {Number} opts.skip Amount of items to be skipped (offset)
188
- * @param {Number} opts.take Amount of items to be taken (limit)
189
- * @param {String} opts.orderBy SQL-like ORDER BY statement (column1 ASC|DESC , column2 ASC|DESC)
190
- * @param {String} opts.searchField Property name for searching
191
- * @param {String} opts.searchValue Value for searching
192
- * @param {module:model/CustomAttributeSearchApiModel} opts.customAttributeSearchApiModel
193
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CustomAttributeSearchApiResult>}
194
- */
195
- adaptersCustomAttributesSearchPost(opts) {
196
- return this.adaptersCustomAttributesSearchPostWithHttpInfo(opts).then(function (response_and_data) {
197
- return response_and_data.data;
198
- });
199
- }
200
- }
201
- exports.default = CustomAttributesApi;
@@ -1,98 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- /**
10
- * API
11
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
12
- *
13
- * The version of the OpenAPI document: adapters
14
- *
15
- *
16
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17
- * https://openapi-generator.tech
18
- * Do not edit the class manually.
19
- *
20
- */
21
-
22
- /**
23
- * The CustomAttributeOptionPostApiModel model module.
24
- * @module model/CustomAttributeOptionPostApiModel
25
- * @version 1.0.0
26
- */
27
- class CustomAttributeOptionPostApiModel {
28
- /**
29
- * Constructs a new <code>CustomAttributeOptionPostApiModel</code>.
30
- * @alias module:model/CustomAttributeOptionPostApiModel
31
- * @param isDefault {Boolean} Indicates if the attribute option is used by default
32
- */
33
- constructor(isDefault) {
34
- CustomAttributeOptionPostApiModel.initialize(this, isDefault);
35
- }
36
-
37
- /**
38
- * Initializes the fields of this object.
39
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
40
- * Only for internal use.
41
- */
42
- static initialize(obj, isDefault) {
43
- obj['isDefault'] = isDefault;
44
- }
45
-
46
- /**
47
- * Constructs a <code>CustomAttributeOptionPostApiModel</code> from a plain JavaScript object, optionally creating a new instance.
48
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
49
- * @param {Object} data The plain JavaScript object bearing properties of interest.
50
- * @param {module:model/CustomAttributeOptionPostApiModel} obj Optional instance to populate.
51
- * @return {module:model/CustomAttributeOptionPostApiModel} The populated <code>CustomAttributeOptionPostApiModel</code> instance.
52
- */
53
- static constructFromObject(data, obj) {
54
- if (data) {
55
- obj = obj || new CustomAttributeOptionPostApiModel();
56
- if (data.hasOwnProperty('value')) {
57
- obj['value'] = _ApiClient.default.convertToType(data['value'], 'String');
58
- }
59
- if (data.hasOwnProperty('isDefault')) {
60
- obj['isDefault'] = _ApiClient.default.convertToType(data['isDefault'], 'Boolean');
61
- }
62
- }
63
- return obj;
64
- }
65
-
66
- /**
67
- * Validates the JSON data with respect to <code>CustomAttributeOptionPostApiModel</code>.
68
- * @param {Object} data The plain JavaScript object bearing properties of interest.
69
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CustomAttributeOptionPostApiModel</code>.
70
- */
71
- static validateJSON(data) {
72
- // check to make sure all required properties are present in the JSON string
73
- for (const property of CustomAttributeOptionPostApiModel.RequiredProperties) {
74
- if (!data.hasOwnProperty(property)) {
75
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
76
- }
77
- }
78
- // ensure the json data is a string
79
- if (data['value'] && !(typeof data['value'] === 'string' || data['value'] instanceof String)) {
80
- throw new Error("Expected the field `value` to be a primitive type in the JSON string but got " + data['value']);
81
- }
82
- return true;
83
- }
84
- }
85
- CustomAttributeOptionPostApiModel.RequiredProperties = ["isDefault"];
86
-
87
- /**
88
- * Value of the attribute option
89
- * @member {String} value
90
- */
91
- CustomAttributeOptionPostApiModel.prototype['value'] = undefined;
92
-
93
- /**
94
- * Indicates if the attribute option is used by default
95
- * @member {Boolean} isDefault
96
- */
97
- CustomAttributeOptionPostApiModel.prototype['isDefault'] = undefined;
98
- var _default = exports.default = CustomAttributeOptionPostApiModel;
@@ -1,124 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- /**
10
- * API
11
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
12
- *
13
- * The version of the OpenAPI document: adapters
14
- *
15
- *
16
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
17
- * https://openapi-generator.tech
18
- * Do not edit the class manually.
19
- *
20
- */
21
-
22
- /**
23
- * The CustomAttributeOptionUpdateApiModel model module.
24
- * @module model/CustomAttributeOptionUpdateApiModel
25
- * @version 1.0.0
26
- */
27
- class CustomAttributeOptionUpdateApiModel {
28
- /**
29
- * Constructs a new <code>CustomAttributeOptionUpdateApiModel</code>.
30
- * @alias module:model/CustomAttributeOptionUpdateApiModel
31
- * @param id {String} Unique ID of the attribute option
32
- * @param isDefault {Boolean} Indicates if the attribute option is used by default
33
- * @param isDeleted {Boolean} Indicates if the attributes option is deleted
34
- */
35
- constructor(id, isDefault, isDeleted) {
36
- CustomAttributeOptionUpdateApiModel.initialize(this, id, isDefault, isDeleted);
37
- }
38
-
39
- /**
40
- * Initializes the fields of this object.
41
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
42
- * Only for internal use.
43
- */
44
- static initialize(obj, id, isDefault, isDeleted) {
45
- obj['id'] = id;
46
- obj['isDefault'] = isDefault;
47
- obj['isDeleted'] = isDeleted;
48
- }
49
-
50
- /**
51
- * Constructs a <code>CustomAttributeOptionUpdateApiModel</code> from a plain JavaScript object, optionally creating a new instance.
52
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
- * @param {Object} data The plain JavaScript object bearing properties of interest.
54
- * @param {module:model/CustomAttributeOptionUpdateApiModel} obj Optional instance to populate.
55
- * @return {module:model/CustomAttributeOptionUpdateApiModel} The populated <code>CustomAttributeOptionUpdateApiModel</code> instance.
56
- */
57
- static constructFromObject(data, obj) {
58
- if (data) {
59
- obj = obj || new CustomAttributeOptionUpdateApiModel();
60
- if (data.hasOwnProperty('id')) {
61
- obj['id'] = _ApiClient.default.convertToType(data['id'], 'String');
62
- }
63
- if (data.hasOwnProperty('value')) {
64
- obj['value'] = _ApiClient.default.convertToType(data['value'], 'String');
65
- }
66
- if (data.hasOwnProperty('isDefault')) {
67
- obj['isDefault'] = _ApiClient.default.convertToType(data['isDefault'], 'Boolean');
68
- }
69
- if (data.hasOwnProperty('isDeleted')) {
70
- obj['isDeleted'] = _ApiClient.default.convertToType(data['isDeleted'], 'Boolean');
71
- }
72
- }
73
- return obj;
74
- }
75
-
76
- /**
77
- * Validates the JSON data with respect to <code>CustomAttributeOptionUpdateApiModel</code>.
78
- * @param {Object} data The plain JavaScript object bearing properties of interest.
79
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CustomAttributeOptionUpdateApiModel</code>.
80
- */
81
- static validateJSON(data) {
82
- // check to make sure all required properties are present in the JSON string
83
- for (const property of CustomAttributeOptionUpdateApiModel.RequiredProperties) {
84
- if (!data.hasOwnProperty(property)) {
85
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
86
- }
87
- }
88
- // ensure the json data is a string
89
- if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
90
- throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
91
- }
92
- // ensure the json data is a string
93
- if (data['value'] && !(typeof data['value'] === 'string' || data['value'] instanceof String)) {
94
- throw new Error("Expected the field `value` to be a primitive type in the JSON string but got " + data['value']);
95
- }
96
- return true;
97
- }
98
- }
99
- CustomAttributeOptionUpdateApiModel.RequiredProperties = ["id", "isDefault", "isDeleted"];
100
-
101
- /**
102
- * Unique ID of the attribute option
103
- * @member {String} id
104
- */
105
- CustomAttributeOptionUpdateApiModel.prototype['id'] = undefined;
106
-
107
- /**
108
- * Value of the attribute option
109
- * @member {String} value
110
- */
111
- CustomAttributeOptionUpdateApiModel.prototype['value'] = undefined;
112
-
113
- /**
114
- * Indicates if the attribute option is used by default
115
- * @member {Boolean} isDefault
116
- */
117
- CustomAttributeOptionUpdateApiModel.prototype['isDefault'] = undefined;
118
-
119
- /**
120
- * Indicates if the attributes option is deleted
121
- * @member {Boolean} isDeleted
122
- */
123
- CustomAttributeOptionUpdateApiModel.prototype['isDeleted'] = undefined;
124
- var _default = exports.default = CustomAttributeOptionUpdateApiModel;