@colijnit/ioneconnector 1.0.136 → 1.0.137

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 (36) hide show
  1. package/build/connector-auth.d.ts +1 -0
  2. package/build/connector-auth.js +16 -26
  3. package/build/connector-public.d.ts +1 -0
  4. package/build/connector-public.js +9 -17
  5. package/build/connector.d.ts +1 -0
  6. package/build/connector.js +170 -204
  7. package/build/connector.unit.test.js +11 -1
  8. package/build/enum/general-method.enum.d.ts +1 -0
  9. package/build/enum/general-method.enum.js +1 -0
  10. package/build/enum/general-object-name.enum.d.ts +2 -1
  11. package/build/enum/general-object-name.enum.js +1 -0
  12. package/build/enum/hd-service-method.d.ts +1 -0
  13. package/build/enum/hd-service-method.js +1 -0
  14. package/build/ione-api-connection.d.ts +1 -0
  15. package/build/model/catalog-definition.d.ts +24 -0
  16. package/build/model/catalog-definition.js +66 -0
  17. package/build/model/external-source-translation.d.ts +7 -0
  18. package/build/model/external-source-translation.js +6 -0
  19. package/build/provider/ajax.service.js +20 -30
  20. package/build/provider/base-backend-connection.service.js +2 -13
  21. package/build/provider/data-repository.service.d.ts +1 -0
  22. package/build/provider/data-repository.service.js +191 -236
  23. package/build/provider/hd-ajax.service.js +31 -39
  24. package/build/provider/hd-ajax.service.unit.test.js +15 -21
  25. package/build/service/datasession.service.js +2 -13
  26. package/build/service/encrypt.service.js +5 -2
  27. package/build/service/hd-data.service.d.ts +1 -0
  28. package/build/service/hd-data.service.js +557 -615
  29. package/build/service/hd-session.service.js +29 -44
  30. package/build/service/hd-session.service.unit.test.js +19 -28
  31. package/build/tests/int/connector-auth.int.test.js +7 -16
  32. package/build/tests/int/connector-public.int.test.js +10 -19
  33. package/build/tests/int/connector.int.test.js +9 -18
  34. package/build/utils/promise-utils.js +3 -12
  35. package/build/websocket/socket.js +2 -13
  36. package/package.json +7 -4
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const hd_service_method_1 = require("../enum/hd-service-method");
13
4
  const color_1 = require("../model/color");
@@ -52,707 +43,658 @@ class HdDataService {
52
43
  if (branch) {
53
44
  params.branchNr = branch;
54
45
  }
55
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
46
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
56
47
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.InitNodeInstance, data);
57
48
  }
58
49
  copyInstance(instanceId) {
59
50
  const params = { instanceId: instanceId };
60
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
51
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
61
52
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.CopyInstance, data);
62
53
  }
63
54
  nextNode(params) {
64
55
  params.instanceId = this._instanceId;
65
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
56
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
66
57
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.NextNode, data);
67
58
  }
68
59
  nextCombNode(params) {
69
60
  params.instanceId = this._instanceId;
70
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
61
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
71
62
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.NextCombNode, data);
72
63
  }
73
64
  back2Node(params) {
74
65
  params.instanceId = this._instanceId;
75
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
66
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
76
67
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.Back2Node, data);
77
68
  }
78
69
  repeatOption(params) {
79
70
  params.instanceId = this._instanceId;
80
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
71
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
81
72
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.RepeatOption, data);
82
73
  }
83
74
  cancelBack2Node(params) {
84
75
  params.instanceId = this._instanceId;
85
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
76
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
86
77
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.CancelBack2Node, data);
87
78
  }
88
79
  navigateTo(params) {
89
80
  params.instanceId = this._instanceId;
90
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
81
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
91
82
  return this._sessionService.call(hd_service_method_1.HdServiceMethod.NavigateTo, data);
92
83
  }
93
- getMatchTable() {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- const params = { instanceId: this._instanceId };
96
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
97
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorMatchTable, data)
98
- .catch((e) => {
99
- return Promise.reject(e);
100
- });
101
- const result = response.data;
102
- if (result.validationResult && result.validationResult.success) {
103
- return result.resultObject ? result.resultObject["oMatchTable"] : null;
104
- }
105
- else {
106
- console.error("Error retrieving match table data (" + response.message + ")");
107
- return null;
108
- }
84
+ async getMatchTable() {
85
+ const params = { instanceId: this._instanceId };
86
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
87
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorMatchTable, data)
88
+ .catch((e) => {
89
+ return Promise.reject(e);
109
90
  });
91
+ const result = response.data;
92
+ if (result.validationResult && result.validationResult.success) {
93
+ return result.resultObject ? result.resultObject["oMatchTable"] : null;
94
+ }
95
+ else {
96
+ console.error("Error retrieving match table data (" + response.message + ")");
97
+ return null;
98
+ }
110
99
  }
111
- getFrozenArticle(configuratorStatistics) {
112
- return __awaiter(this, void 0, void 0, function* () {
113
- const params = { instanceId: this._instanceId };
114
- if (configuratorStatistics) {
115
- params.configuratorStatisticsEnvironment = configuratorStatistics;
116
- }
117
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
118
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GenerateFrozenArticle, data)
119
- .catch((e) => {
120
- return Promise.reject(e);
121
- });
122
- if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
123
- const articles = this._boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, response.data.resultObject);
124
- const composedArticle = !!articles[0].compositionArticleNo;
125
- let frozenart;
126
- frozenart = this._boFactory.makeWithRawBackendData(selector_article_1.SelectorArticle, articles[0]);
127
- if (composedArticle) {
128
- frozenart.compositions = [];
129
- frozenart.compositions.push(articles);
130
- }
131
- return frozenart;
132
- }
133
- else {
134
- return Promise.reject(response);
135
- }
136
- });
100
+ async getFrozenArticle(configuratorStatistics) {
101
+ const params = { instanceId: this._instanceId };
102
+ if (configuratorStatistics) {
103
+ params.configuratorStatisticsEnvironment = configuratorStatistics;
104
+ }
105
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
106
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GenerateFrozenArticle, data)
107
+ .catch((e) => {
108
+ return Promise.reject(e);
109
+ });
110
+ if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
111
+ const articles = this._boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, response.data.resultObject);
112
+ const composedArticle = !!articles[0].compositionArticleNo;
113
+ let frozenart;
114
+ frozenart = this._boFactory.makeWithRawBackendData(selector_article_1.SelectorArticle, articles[0]);
115
+ if (composedArticle) {
116
+ frozenart.compositions = [];
117
+ frozenart.compositions.push(articles);
118
+ }
119
+ return frozenart;
120
+ }
121
+ else {
122
+ return Promise.reject(response);
123
+ }
137
124
  }
138
- getJsonArticleFlatTree(goodId) {
139
- return __awaiter(this, void 0, void 0, function* () {
140
- const params = { goodId: goodId };
141
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
142
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleTree, data)
143
- .catch((e) => {
144
- return Promise.reject(e);
145
- });
146
- const result = response.data;
147
- if (result.validationResult && result.validationResult.success) {
148
- return result.resultObject;
149
- }
150
- else {
151
- console.error("Error getting article tree");
152
- return null;
153
- }
125
+ async getJsonArticleFlatTree(goodId) {
126
+ const params = { goodId: goodId };
127
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
128
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleTree, data)
129
+ .catch((e) => {
130
+ return Promise.reject(e);
154
131
  });
132
+ const result = response.data;
133
+ if (result.validationResult && result.validationResult.success) {
134
+ return result.resultObject;
135
+ }
136
+ else {
137
+ console.error("Error getting article tree");
138
+ return null;
139
+ }
155
140
  }
156
- getLastFrozenArticle() {
157
- return __awaiter(this, void 0, void 0, function* () {
158
- const params = { instanceId: this._instanceId };
159
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
160
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetLastFrozenArticle, data)
161
- .catch((e) => {
162
- return Promise.reject(e);
163
- });
164
- const result = response.data;
165
- if (result.validationResult && result.validationResult.success) {
166
- return result.resultObject;
167
- }
168
- else {
169
- console.error("Error creating article (" + response.message + ")");
170
- return null;
171
- }
141
+ async getLastFrozenArticle() {
142
+ const params = { instanceId: this._instanceId };
143
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
144
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetLastFrozenArticle, data)
145
+ .catch((e) => {
146
+ return Promise.reject(e);
172
147
  });
148
+ const result = response.data;
149
+ if (result.validationResult && result.validationResult.success) {
150
+ return result.resultObject;
151
+ }
152
+ else {
153
+ console.error("Error creating article (" + response.message + ")");
154
+ return null;
155
+ }
173
156
  }
174
- getSkipButtonImageAndText(goodId) {
175
- return __awaiter(this, void 0, void 0, function* () {
176
- const params = { instanceId: this._instanceId };
177
- if (goodId) {
178
- params.goodId = goodId;
179
- }
180
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
181
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSkipButtonImageAndText, data)
182
- .catch((e) => {
183
- return Promise.reject(e);
184
- });
185
- const result = response.data;
186
- if (result.validationResult && result.validationResult.success) {
187
- return this._boFactory.makeWithRawBackendData(skip_button_info_1.SkipButtonInfo, result.resultObject);
188
- }
189
- else {
190
- console.error("Error retrieving skip button image and text (" + response.message + ")");
191
- return null;
192
- }
193
- });
157
+ async getSkipButtonImageAndText(goodId) {
158
+ const params = { instanceId: this._instanceId };
159
+ if (goodId) {
160
+ params.goodId = goodId;
161
+ }
162
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
163
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSkipButtonImageAndText, data)
164
+ .catch((e) => {
165
+ return Promise.reject(e);
166
+ });
167
+ const result = response.data;
168
+ if (result.validationResult && result.validationResult.success) {
169
+ return this._boFactory.makeWithRawBackendData(skip_button_info_1.SkipButtonInfo, result.resultObject);
170
+ }
171
+ else {
172
+ console.error("Error retrieving skip button image and text (" + response.message + ")");
173
+ return null;
174
+ }
194
175
  }
195
- getArticleQuickSel(goodId, branch) {
196
- return __awaiter(this, void 0, void 0, function* () {
197
- const params = { goodId: goodId };
198
- if (branch) {
199
- params.branchNr = branch;
200
- }
201
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
202
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.ArticleQuickSel, data)
203
- .catch((e) => {
204
- return Promise.reject(e);
205
- });
206
- const result = response.data;
207
- if (result.validationResult && result.validationResult.success) {
208
- if (!result.resultObject) {
209
- console.error("Article not found!");
210
- return null;
211
- }
212
- return new article_1.Article(result.resultObject.oArticle[0]);
213
- }
214
- else {
215
- console.error("Error retrieving article data");
176
+ async getArticleQuickSel(goodId, branch) {
177
+ const params = { goodId: goodId };
178
+ if (branch) {
179
+ params.branchNr = branch;
180
+ }
181
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
182
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.ArticleQuickSel, data)
183
+ .catch((e) => {
184
+ return Promise.reject(e);
185
+ });
186
+ const result = response.data;
187
+ if (result.validationResult && result.validationResult.success) {
188
+ if (!result.resultObject) {
189
+ console.error("Article not found!");
216
190
  return null;
217
191
  }
218
- });
192
+ return new article_1.Article(result.resultObject.oArticle[0]);
193
+ }
194
+ else {
195
+ console.error("Error retrieving article data");
196
+ return null;
197
+ }
219
198
  }
220
- getSuperArticleQuickSel(id, branch) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- const params = { superArtId: id };
223
- if (branch) {
224
- params.branchNr = branch;
225
- }
226
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
227
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SuperArticleQuickSel, data)
228
- .catch((e) => {
229
- return Promise.reject(e);
230
- });
231
- const result = response.data;
232
- if (result.validationResult && result.validationResult.success) {
233
- if (!result.resultObject) {
234
- console.error("Super article not found!");
235
- return null;
236
- }
237
- return new super_article_1.SuperArticle(result.resultObject.oArticle[0]);
238
- }
239
- else {
240
- console.error("Error retrieving article data");
199
+ async getSuperArticleQuickSel(id, branch) {
200
+ const params = { superArtId: id };
201
+ if (branch) {
202
+ params.branchNr = branch;
203
+ }
204
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
205
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SuperArticleQuickSel, data)
206
+ .catch((e) => {
207
+ return Promise.reject(e);
208
+ });
209
+ const result = response.data;
210
+ if (result.validationResult && result.validationResult.success) {
211
+ if (!result.resultObject) {
212
+ console.error("Super article not found!");
241
213
  return null;
242
214
  }
243
- });
215
+ return new super_article_1.SuperArticle(result.resultObject.oArticle[0]);
216
+ }
217
+ else {
218
+ console.error("Error retrieving article data");
219
+ return null;
220
+ }
244
221
  }
245
- getGoodIdFromArticleNr(sku) {
246
- return __awaiter(this, void 0, void 0, function* () {
247
- const params = { artikelnr: sku };
248
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
249
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetGoodIdFromArticleNr, data)
250
- .catch((e) => {
251
- return Promise.reject(e);
252
- });
253
- const result = response.data;
254
- if (result.validationResult && result.validationResult.success) {
255
- return result.resultObject;
256
- }
257
- else {
258
- console.error("Error retrieving article (" + response.message + ")");
259
- return null;
260
- }
222
+ async getGoodIdFromArticleNr(sku) {
223
+ const params = { artikelnr: sku };
224
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
225
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetGoodIdFromArticleNr, data)
226
+ .catch((e) => {
227
+ return Promise.reject(e);
261
228
  });
229
+ const result = response.data;
230
+ if (result.validationResult && result.validationResult.success) {
231
+ return result.resultObject;
232
+ }
233
+ else {
234
+ console.error("Error retrieving article (" + response.message + ")");
235
+ return null;
236
+ }
262
237
  }
263
- getDecos() {
264
- return __awaiter(this, void 0, void 0, function* () {
265
- const params = { instanceId: this._instanceId };
266
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
267
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorDecos, data)
268
- .catch((e) => {
269
- return Promise.reject(e);
270
- });
271
- const result = response.data;
272
- if (result.validationResult && result.validationResult.success) {
273
- if (!result.resultObject) {
274
- return [];
275
- }
276
- return result.resultObject["oDeco"];
277
- }
278
- else {
279
- console.error("Error getting decoNodes (" + response.message + ")");
280
- return null;
281
- }
238
+ async getDecos() {
239
+ const params = { instanceId: this._instanceId };
240
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
241
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorDecos, data)
242
+ .catch((e) => {
243
+ return Promise.reject(e);
282
244
  });
283
- }
284
- getSelections() {
285
- return __awaiter(this, void 0, void 0, function* () {
286
- const params = { instanceId: this._instanceId };
287
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
288
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorSelections, data)
289
- .catch((e) => {
290
- return Promise.reject(e);
291
- });
292
- const result = response.data;
293
- if (result.validationResult && result.validationResult.success) {
294
- if (!result.resultObject) {
295
- return [];
296
- }
297
- return result.resultObject["selections"];
298
- }
299
- else {
300
- console.error("Error getting selections (" + response.message + ")");
301
- return null;
245
+ const result = response.data;
246
+ if (result.validationResult && result.validationResult.success) {
247
+ if (!result.resultObject) {
248
+ return [];
302
249
  }
303
- });
250
+ return result.resultObject["oDeco"];
251
+ }
252
+ else {
253
+ console.error("Error getting decoNodes (" + response.message + ")");
254
+ return null;
255
+ }
304
256
  }
305
- getSelectorActiveOptionValues() {
306
- return __awaiter(this, void 0, void 0, function* () {
307
- const params = { instanceId: this._instanceId };
308
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
309
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodes, data)
310
- .catch((e) => {
311
- return Promise.reject(e);
312
- });
313
- const result = response.data;
314
- if (result.validationResult && result.validationResult.success) {
315
- const match = result.resultObject["matchTableActive"] === "T";
316
- const activeNodes = result.resultObject['activeNodes'];
317
- const question = activeNodes[0];
318
- const isShowGrouped = question && question.showGrouped === "T";
319
- if (isShowGrouped && this._useGroups) {
320
- const data = yield this.getSelectorStructure();
321
- return { match: match, data: [question, ...data.resultObject.structures] };
322
- }
323
- else {
324
- return { match: match, data: activeNodes };
325
- }
326
- }
327
- else {
328
- return null;
329
- }
257
+ async getSelections() {
258
+ const params = { instanceId: this._instanceId };
259
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
260
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorSelections, data)
261
+ .catch((e) => {
262
+ return Promise.reject(e);
330
263
  });
331
- }
332
- getSelectorActiveOptionValuesPrices() {
333
- return __awaiter(this, void 0, void 0, function* () {
334
- const params = { instanceId: this._instanceId };
335
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
336
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodesPr, data)
337
- .catch((e) => {
338
- return Promise.reject(e);
339
- });
340
- const result = response.data;
341
- if (result.validationResult && result.validationResult.success) {
342
- return result;
264
+ const result = response.data;
265
+ if (result.validationResult && result.validationResult.success) {
266
+ if (!result.resultObject) {
267
+ return [];
343
268
  }
344
- else {
345
- console.error("Error getting selector action prices (" + response.message + ")");
346
- return null;
347
- }
348
- });
269
+ return result.resultObject["selections"];
270
+ }
271
+ else {
272
+ console.error("Error getting selections (" + response.message + ")");
273
+ return null;
274
+ }
349
275
  }
350
- getSelectorStructure() {
351
- return __awaiter(this, void 0, void 0, function* () {
352
- const params = { instanceId: this._instanceId };
353
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
354
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorStructure, data)
355
- .catch((e) => {
356
- return Promise.reject(e);
357
- });
358
- const result = response.data;
359
- if (result.validationResult && result.validationResult.success) {
360
- return result;
361
- }
362
- else {
363
- console.error("Error getting selector structure (" + response.message + ")");
364
- return null;
365
- }
276
+ async getSelectorActiveOptionValues() {
277
+ const params = { instanceId: this._instanceId };
278
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
279
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodes, data)
280
+ .catch((e) => {
281
+ return Promise.reject(e);
366
282
  });
367
- }
368
- getDeliveryPrognosis(goodId, branchNr) {
369
- return __awaiter(this, void 0, void 0, function* () {
370
- const params = { instanceId: this._instanceId };
371
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
372
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSelectorDeliveryDate, data)
373
- .catch((e) => {
374
- return Promise.reject(e);
375
- });
376
- const result = response.data;
377
- if (result.validationResult && result.validationResult.success) {
378
- return result.resultObject;
283
+ const result = response.data;
284
+ if (result.validationResult && result.validationResult.success) {
285
+ const match = result.resultObject["matchTableActive"] === "T";
286
+ const activeNodes = result.resultObject['activeNodes'];
287
+ const question = activeNodes[0];
288
+ const isShowGrouped = question && question.showGrouped === "T";
289
+ if (isShowGrouped && this._useGroups) {
290
+ const data = await this.getSelectorStructure();
291
+ return { match: match, data: [question, ...data.resultObject.structures] };
379
292
  }
380
293
  else {
381
- const params = { goodId: goodId };
382
- return this.getDeliveryDate2(params, branchNr);
294
+ return { match: match, data: activeNodes };
383
295
  }
384
- });
296
+ }
297
+ else {
298
+ return null;
299
+ }
385
300
  }
386
- getDeliveryDate2(params, branchNr) {
387
- return __awaiter(this, void 0, void 0, function* () {
388
- if (branchNr) {
389
- params.branchNo = branchNr;
390
- }
391
- params.transId = null;
392
- params.lineNr = null;
393
- params.commCode = "1";
394
- params.amount = 1;
395
- params.transactionKind = "V";
396
- params.purchasePlanDays = "T";
397
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
398
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDeliveryDate2, data)
399
- .catch((e) => {
400
- return Promise.reject(e);
401
- });
402
- const result = response.data;
403
- if (result.validationResult && result.validationResult.success) {
404
- return result.resultObject;
405
- }
406
- else {
407
- console.error("Error getting delivery prognosis (" + response.message + ")");
408
- return null;
409
- }
301
+ async getSelectorActiveOptionValuesPrices() {
302
+ const params = { instanceId: this._instanceId };
303
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
304
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorActiveNodesPr, data)
305
+ .catch((e) => {
306
+ return Promise.reject(e);
410
307
  });
308
+ const result = response.data;
309
+ if (result.validationResult && result.validationResult.success) {
310
+ return result;
311
+ }
312
+ else {
313
+ console.error("Error getting selector action prices (" + response.message + ")");
314
+ return null;
315
+ }
411
316
  }
412
- getStockForArtNode(branchNo, selNodeId) {
413
- return __awaiter(this, void 0, void 0, function* () {
414
- const params = {
415
- instanceId: this._instanceId,
416
- selectionId: selNodeId
417
- };
418
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
419
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetStockForArtNode, data)
420
- .catch((e) => {
421
- return Promise.reject(e);
422
- });
423
- const result = response.data;
424
- if (result.validationResult && result.validationResult.success) {
425
- return result.resultObject;
426
- }
427
- else {
428
- console.error("Error getting StockForArtNode (" + response.message + ")");
429
- return null;
430
- }
317
+ async getSelectorStructure() {
318
+ const params = { instanceId: this._instanceId };
319
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
320
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorStructure, data)
321
+ .catch((e) => {
322
+ return Promise.reject(e);
431
323
  });
324
+ const result = response.data;
325
+ if (result.validationResult && result.validationResult.success) {
326
+ return result;
327
+ }
328
+ else {
329
+ console.error("Error getting selector structure (" + response.message + ")");
330
+ return null;
331
+ }
432
332
  }
433
- getArticleFullObject(goodId) {
434
- return __awaiter(this, void 0, void 0, function* () {
435
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { objectId: goodId });
436
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleFullObject, data)
437
- .catch((e) => {
438
- return Promise.reject(e);
439
- });
440
- const result = response.data;
441
- if (result.validationResult && result.validationResult.success) {
442
- return this._boFactory.makeWithRawBackendData(article_full_object_1.ArticleFullObject, result.resultObject);
443
- }
444
- else {
445
- console.error("Error retrieving article data (" + response.message + ")");
446
- return null;
447
- }
333
+ async getDeliveryPrognosis(goodId, branchNr) {
334
+ const params = { instanceId: this._instanceId };
335
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
336
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSelectorDeliveryDate, data)
337
+ .catch((e) => {
338
+ return Promise.reject(e);
448
339
  });
340
+ const result = response.data;
341
+ if (result.validationResult && result.validationResult.success) {
342
+ return result.resultObject;
343
+ }
344
+ else {
345
+ const params = { goodId: goodId };
346
+ return this.getDeliveryDate2(params, branchNr);
347
+ }
449
348
  }
450
- getArticlesForCatalog(params, paging) {
451
- return __awaiter(this, void 0, void 0, function* () {
452
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params, pagingParameters: paging });
453
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.SearchArticles, data)
454
- .catch((e) => {
455
- return Promise.reject(e);
456
- });
457
- const result = response.data;
458
- if (result.validationResult && result.validationResult.success) {
459
- if (this._versionHigherThan249) {
460
- return this._boFactory.makeBOArrayFromRawBackendDataArray(article_extended_dto_1.ArticleExtendedDto, result.resultObjects);
461
- }
462
- else {
463
- return this._boFactory.makeBOArrayFromRawBackendDataArray(article_list_object_extended_1.ArticleListObjectExtended, result.resultObjects);
464
- }
465
- }
466
- else {
467
- console.error("Error getting articles (" + response.message + ")");
468
- return null;
469
- }
470
- });
349
+ async getDeliveryDate2(params, branchNr) {
350
+ if (branchNr) {
351
+ params.branchNo = branchNr;
352
+ }
353
+ params.transId = null;
354
+ params.lineNr = null;
355
+ params.commCode = "1";
356
+ params.amount = 1;
357
+ params.transactionKind = "V";
358
+ params.purchasePlanDays = "T";
359
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
360
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDeliveryDate2, data)
361
+ .catch((e) => {
362
+ return Promise.reject(e);
363
+ });
364
+ const result = response.data;
365
+ if (result.validationResult && result.validationResult.success) {
366
+ return result.resultObject;
367
+ }
368
+ else {
369
+ console.error("Error getting delivery prognosis (" + response.message + ")");
370
+ return null;
371
+ }
471
372
  }
472
- getArticlePrice(goodId, branchNr, currencyId) {
473
- return __awaiter(this, void 0, void 0, function* () {
474
- const request = new get_article_price_request_1.GetArticlePriceRequest();
475
- request.goodId = goodId;
476
- if (branchNr) {
477
- request.branch = branchNr;
478
- }
479
- if (currencyId) {
480
- request.currency = currencyId;
481
- }
482
- request.number = 1;
483
- request.type = transaction_kind_1.TransactionKind.SalesOrder;
484
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: request });
485
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticlePrice, data)
486
- .catch((e) => {
487
- return Promise.reject(e);
488
- });
489
- const result = response.data;
490
- if (result.validationResult && result.validationResult.success) {
491
- return this._boFactory.makeWithRawBackendData(article_price_1.ArticlePrice, result.resultObject);
492
- }
493
- else {
494
- console.error("Error getting article price (" + response.message + ")");
495
- return null;
496
- }
497
- });
373
+ async getStockForArtNode(branchNo, selNodeId) {
374
+ const params = {
375
+ instanceId: this._instanceId,
376
+ selectionId: selNodeId
377
+ };
378
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
379
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetStockForArtNode, data)
380
+ .catch((e) => {
381
+ return Promise.reject(e);
382
+ });
383
+ const result = response.data;
384
+ if (result.validationResult && result.validationResult.success) {
385
+ return result.resultObject;
386
+ }
387
+ else {
388
+ console.error("Error getting StockForArtNode (" + response.message + ")");
389
+ return null;
390
+ }
498
391
  }
499
- getArticleCategories(publicationCode) {
500
- return __awaiter(this, void 0, void 0, function* () {
501
- const params = { publicationCode: publicationCode };
502
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
503
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleCategories, data)
504
- .catch((e) => {
505
- return Promise.reject(e);
506
- });
507
- const result = response.data;
508
- if (result.validationResult && result.validationResult.success) {
509
- return this._boFactory.makeBOArrayFromRawBackendDataArray(article_category_1.ArticleCategory, result.resultObjects);
510
- }
511
- else {
512
- console.error("Error getting article categories (" + response.message + ")");
513
- return null;
514
- }
392
+ async getArticleFullObject(goodId) {
393
+ const data = { ...this.createServiceRequestData(), objectId: goodId };
394
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleFullObject, data)
395
+ .catch((e) => {
396
+ return Promise.reject(e);
515
397
  });
398
+ const result = response.data;
399
+ if (result.validationResult && result.validationResult.success) {
400
+ return this._boFactory.makeWithRawBackendData(article_full_object_1.ArticleFullObject, result.resultObject);
401
+ }
402
+ else {
403
+ console.error("Error retrieving article data (" + response.message + ")");
404
+ return null;
405
+ }
516
406
  }
517
- getTurnoverGroupImages(category) {
518
- return __awaiter(this, void 0, void 0, function* () {
519
- const params = {};
520
- if (category) {
521
- params.category = category;
522
- }
523
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
524
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetTurnoverGroupImages, data)
525
- .catch((e) => {
526
- return Promise.reject(e);
527
- });
528
- const result = response.data;
529
- if (result.validationResult && result.validationResult.success) {
530
- return this._boFactory.makeBOArrayFromRawBackendDataArray(turnover_group_image_1.TurnoverGroupImage, result.resultObjects);
407
+ async getArticlesForCatalog(params, paging) {
408
+ const data = { ...this.createServiceRequestData(), parameterValues: params, pagingParameters: paging };
409
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SearchArticles, data)
410
+ .catch((e) => {
411
+ return Promise.reject(e);
412
+ });
413
+ const result = response.data;
414
+ if (result.validationResult && result.validationResult.success) {
415
+ if (this._versionHigherThan249) {
416
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(article_extended_dto_1.ArticleExtendedDto, result.resultObjects);
531
417
  }
532
418
  else {
533
- console.error("Error getting turnover group images (" + response.message + ")");
534
- return null;
419
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(article_list_object_extended_1.ArticleListObjectExtended, result.resultObjects);
535
420
  }
421
+ }
422
+ else {
423
+ console.error("Error getting articles (" + response.message + ")");
424
+ return null;
425
+ }
426
+ }
427
+ async getArticlePrice(goodId, branchNr, currencyId) {
428
+ const request = new get_article_price_request_1.GetArticlePriceRequest();
429
+ request.goodId = goodId;
430
+ if (branchNr) {
431
+ request.branch = branchNr;
432
+ }
433
+ if (currencyId) {
434
+ request.currency = currencyId;
435
+ }
436
+ request.number = 1;
437
+ request.type = transaction_kind_1.TransactionKind.SalesOrder;
438
+ const data = { ...this.createServiceRequestData(), parameterValues: request };
439
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticlePrice, data)
440
+ .catch((e) => {
441
+ return Promise.reject(e);
442
+ });
443
+ const result = response.data;
444
+ if (result.validationResult && result.validationResult.success) {
445
+ return this._boFactory.makeWithRawBackendData(article_price_1.ArticlePrice, result.resultObject);
446
+ }
447
+ else {
448
+ console.error("Error getting article price (" + response.message + ")");
449
+ return null;
450
+ }
451
+ }
452
+ async getArticleCategories(publicationCode) {
453
+ const params = { publicationCode: publicationCode };
454
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
455
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleCategories, data)
456
+ .catch((e) => {
457
+ return Promise.reject(e);
536
458
  });
459
+ const result = response.data;
460
+ if (result.validationResult && result.validationResult.success) {
461
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(article_category_1.ArticleCategory, result.resultObjects);
462
+ }
463
+ else {
464
+ console.error("Error getting article categories (" + response.message + ")");
465
+ return null;
466
+ }
537
467
  }
538
- getAnswerTexts(params) {
539
- return __awaiter(this, void 0, void 0, function* () {
540
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
541
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAnswerTexts, data)
542
- .catch((e) => {
543
- return Promise.reject(e);
544
- });
545
- const result = response.data;
546
- if (result.validationResult && result.validationResult.success) {
547
- return result.resultObject;
548
- }
549
- else {
550
- console.error("Error getting answer info (" + response.message + ")");
551
- return null;
552
- }
468
+ async getTurnoverGroupImages(category) {
469
+ const params = {};
470
+ if (category) {
471
+ params.category = category;
472
+ }
473
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
474
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetTurnoverGroupImages, data)
475
+ .catch((e) => {
476
+ return Promise.reject(e);
477
+ });
478
+ const result = response.data;
479
+ if (result.validationResult && result.validationResult.success) {
480
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(turnover_group_image_1.TurnoverGroupImage, result.resultObjects);
481
+ }
482
+ else {
483
+ console.error("Error getting turnover group images (" + response.message + ")");
484
+ return null;
485
+ }
486
+ }
487
+ async getAnswerTexts(params) {
488
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
489
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAnswerTexts, data)
490
+ .catch((e) => {
491
+ return Promise.reject(e);
553
492
  });
493
+ const result = response.data;
494
+ if (result.validationResult && result.validationResult.success) {
495
+ return result.resultObject;
496
+ }
497
+ else {
498
+ console.error("Error getting answer info (" + response.message + ")");
499
+ return null;
500
+ }
554
501
  }
555
- getDocumentContent(id, thumbnail = true) {
556
- return __awaiter(this, void 0, void 0, function* () {
557
- const params = {
558
- documentId: id,
559
- thumbnail: thumbnail
560
- };
561
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
562
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDocumentContent, data)
563
- .catch((e) => {
564
- return Promise.reject(e);
565
- });
566
- const result = response.data;
567
- if (result.validationResult && result.validationResult.success) {
568
- return result.resultObject.documentContent;
569
- }
570
- else {
571
- console.error("Error retrieving article data (" + response.message + ")");
572
- return null;
573
- }
502
+ async getDocumentContent(id, thumbnail = true) {
503
+ const params = {
504
+ documentId: id,
505
+ thumbnail: thumbnail
506
+ };
507
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
508
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDocumentContent, data)
509
+ .catch((e) => {
510
+ return Promise.reject(e);
511
+ });
512
+ const result = response.data;
513
+ if (result.validationResult && result.validationResult.success) {
514
+ return result.resultObject.documentContent;
515
+ }
516
+ else {
517
+ console.error("Error retrieving article data (" + response.message + ")");
518
+ return null;
519
+ }
520
+ }
521
+ async getCatalogDefinitions(showLoader = true) {
522
+ const data = { ...this.createServiceRequestData(), parameterValues: {} };
523
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDocumentContent, data, showLoader)
524
+ .catch((e) => {
525
+ return Promise.reject(e);
574
526
  });
527
+ const result = response.data;
528
+ if (result.validationResult && result.validationResult.success) {
529
+ return result.resultObject;
530
+ }
531
+ else {
532
+ console.error("Error retrieving catalog definitions (" + response.message + ")");
533
+ return null;
534
+ }
575
535
  }
576
- getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, showLoader = true) {
577
- return __awaiter(this, void 0, void 0, function* () {
578
- if (!nodeId) {
579
- return;
580
- }
581
- const params = {
582
- table: "GOEDEREN",
583
- key: nodeId.toString(),
584
- includeBody: thumb === undefined || thumb === false,
585
- includeThumbnail: thumb === true,
586
- publication: publication
587
- };
588
- const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
589
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSingleImage, data, showLoader)
590
- .catch((e) => {
591
- return Promise.reject(e);
592
- });
593
- const result = response.data;
594
- if (result.validationResult && result.validationResult.success) {
595
- if (!result.resultObject) {
596
- return "";
597
- }
598
- const image = result.resultObject;
599
- if (image.filePath) {
600
- return image_utils_1.ImageUtils.getFixedImageFilepathUrl(image.filePath);
536
+ async getSingleImage(nodeId, publication = 4, includeMimetype = false, thumb = true, showLoader = true) {
537
+ if (!nodeId) {
538
+ return;
539
+ }
540
+ const params = {
541
+ table: "GOEDEREN",
542
+ key: nodeId.toString(),
543
+ includeBody: thumb === undefined || thumb === false,
544
+ includeThumbnail: thumb === true,
545
+ publication: publication
546
+ };
547
+ const data = { ...this.createServiceRequestData(), parameterValues: params };
548
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetSingleImage, data, showLoader)
549
+ .catch((e) => {
550
+ return Promise.reject(e);
551
+ });
552
+ const result = response.data;
553
+ if (result.validationResult && result.validationResult.success) {
554
+ if (!result.resultObject) {
555
+ return "";
556
+ }
557
+ const image = result.resultObject;
558
+ if (image.filePath) {
559
+ return image_utils_1.ImageUtils.getFixedImageFilepathUrl(image.filePath);
560
+ }
561
+ else {
562
+ const documentBody = thumb ? image.thumbnailBody : image.documentBody;
563
+ if (includeMimetype) {
564
+ return image_utils_1.ImageUtils.getDocBodyWithMimeTypeDefinition(image.fileName, documentBody);
601
565
  }
602
566
  else {
603
- const documentBody = thumb ? image.thumbnailBody : image.documentBody;
604
- if (includeMimetype) {
605
- return image_utils_1.ImageUtils.getDocBodyWithMimeTypeDefinition(image.fileName, documentBody);
606
- }
607
- else {
608
- return documentBody;
609
- }
567
+ return documentBody;
610
568
  }
611
569
  }
612
- else {
613
- console.error("Error getting single image (" + response.message + ")");
614
- return null;
615
- }
616
- });
570
+ }
571
+ else {
572
+ console.error("Error getting single image (" + response.message + ")");
573
+ return null;
574
+ }
617
575
  }
618
- getColors() {
619
- return __awaiter(this, void 0, void 0, function* () {
620
- const data = Object.assign({}, this.createServiceRequestData());
621
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetColors, data)
622
- .catch((e) => {
623
- return Promise.reject(e);
624
- });
625
- const result = response.data;
626
- if (result.validationResult && result.validationResult.success) {
627
- return this._boFactory.makeBOArrayFromRawBackendDataArray(color_1.Color, result.resultObjects);
628
- }
629
- else {
630
- console.error("Error getting colors (" + response.message + ")");
631
- return null;
632
- }
576
+ async getColors() {
577
+ const data = { ...this.createServiceRequestData() };
578
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetColors, data)
579
+ .catch((e) => {
580
+ return Promise.reject(e);
633
581
  });
582
+ const result = response.data;
583
+ if (result.validationResult && result.validationResult.success) {
584
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(color_1.Color, result.resultObjects);
585
+ }
586
+ else {
587
+ console.error("Error getting colors (" + response.message + ")");
588
+ return null;
589
+ }
634
590
  }
635
- getBrands() {
636
- return __awaiter(this, void 0, void 0, function* () {
637
- const data = Object.assign({}, this.createServiceRequestData());
638
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetBrands, data)
639
- .catch((e) => {
640
- return Promise.reject(e);
641
- });
642
- const result = response.data;
643
- if (result.validationResult && result.validationResult.success) {
644
- return this._boFactory.makeBOArrayFromRawBackendDataArray(brand_1.Brand, result.resultObjects);
645
- }
646
- else {
647
- console.error("Error getting brands (" + response.message + ")");
648
- return null;
649
- }
591
+ async getBrands() {
592
+ const data = { ...this.createServiceRequestData() };
593
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetBrands, data)
594
+ .catch((e) => {
595
+ return Promise.reject(e);
650
596
  });
597
+ const result = response.data;
598
+ if (result.validationResult && result.validationResult.success) {
599
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(brand_1.Brand, result.resultObjects);
600
+ }
601
+ else {
602
+ console.error("Error getting brands (" + response.message + ")");
603
+ return null;
604
+ }
651
605
  }
652
- getDesigns() {
653
- return __awaiter(this, void 0, void 0, function* () {
654
- const data = Object.assign({}, this.createServiceRequestData());
655
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDesigns, data)
656
- .catch((e) => {
657
- return Promise.reject(e);
658
- });
659
- const result = response.data;
660
- if (result.validationResult && result.validationResult.success) {
661
- return this._boFactory.makeBOArrayFromRawBackendDataArray(design_1.Design, result.resultObjects);
662
- }
663
- else {
664
- console.error("Error getting designs (" + response.message + ")");
665
- return null;
666
- }
606
+ async getDesigns() {
607
+ const data = { ...this.createServiceRequestData() };
608
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetDesigns, data)
609
+ .catch((e) => {
610
+ return Promise.reject(e);
667
611
  });
612
+ const result = response.data;
613
+ if (result.validationResult && result.validationResult.success) {
614
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(design_1.Design, result.resultObjects);
615
+ }
616
+ else {
617
+ console.error("Error getting designs (" + response.message + ")");
618
+ return null;
619
+ }
668
620
  }
669
- getConcepts() {
670
- return __awaiter(this, void 0, void 0, function* () {
671
- const data = Object.assign({}, this.createServiceRequestData());
672
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetConcepts, data)
673
- .catch((e) => {
674
- return Promise.reject(e);
675
- });
676
- const result = response.data;
677
- if (result.validationResult && result.validationResult.success) {
678
- return this._boFactory.makeBOArrayFromRawBackendDataArray(concept_1.Concept, result.resultObjects);
679
- }
680
- else {
681
- console.error("Error getting concepts (" + response.message + ")");
682
- return null;
683
- }
621
+ async getConcepts() {
622
+ const data = { ...this.createServiceRequestData() };
623
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetConcepts, data)
624
+ .catch((e) => {
625
+ return Promise.reject(e);
684
626
  });
627
+ const result = response.data;
628
+ if (result.validationResult && result.validationResult.success) {
629
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(concept_1.Concept, result.resultObjects);
630
+ }
631
+ else {
632
+ console.error("Error getting concepts (" + response.message + ")");
633
+ return null;
634
+ }
685
635
  }
686
- getMaterials() {
687
- return __awaiter(this, void 0, void 0, function* () {
688
- const data = Object.assign({}, this.createServiceRequestData());
689
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetMaterials, data)
690
- .catch((e) => {
691
- return Promise.reject(e);
692
- });
693
- const result = response.data;
694
- if (result.validationResult && result.validationResult.success) {
695
- return this._boFactory.makeBOArrayFromRawBackendDataArray(material_1.Material, result.resultObjects);
696
- }
697
- else {
698
- console.error("Error getting materials (" + response.message + ")");
699
- return null;
700
- }
636
+ async getMaterials() {
637
+ const data = { ...this.createServiceRequestData() };
638
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetMaterials, data)
639
+ .catch((e) => {
640
+ return Promise.reject(e);
701
641
  });
642
+ const result = response.data;
643
+ if (result.validationResult && result.validationResult.success) {
644
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(material_1.Material, result.resultObjects);
645
+ }
646
+ else {
647
+ console.error("Error getting materials (" + response.message + ")");
648
+ return null;
649
+ }
702
650
  }
703
- getAtmospheres() {
704
- return __awaiter(this, void 0, void 0, function* () {
705
- const data = Object.assign({}, this.createServiceRequestData());
706
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAtmospheres, data)
707
- .catch((e) => {
708
- return Promise.reject(e);
709
- });
710
- const result = response.data;
711
- if (result.validationResult && result.validationResult.success) {
712
- return this._boFactory.makeBOArrayFromRawBackendDataArray(atmosphere_1.Atmosphere, result.resultObjects);
713
- }
714
- else {
715
- console.error("Error getting atmospheres (" + response.message + ")");
716
- return null;
717
- }
651
+ async getAtmospheres() {
652
+ const data = { ...this.createServiceRequestData() };
653
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetAtmospheres, data)
654
+ .catch((e) => {
655
+ return Promise.reject(e);
718
656
  });
657
+ const result = response.data;
658
+ if (result.validationResult && result.validationResult.success) {
659
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(atmosphere_1.Atmosphere, result.resultObjects);
660
+ }
661
+ else {
662
+ console.error("Error getting atmospheres (" + response.message + ")");
663
+ return null;
664
+ }
719
665
  }
720
- getArticleGroups() {
721
- return __awaiter(this, void 0, void 0, function* () {
722
- const data = Object.assign({}, this.createServiceRequestData());
723
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleGroups, data)
724
- .catch((e) => {
725
- return Promise.reject(e);
726
- });
727
- const result = response.data;
728
- if (result.validationResult && result.validationResult.success) {
729
- return this._boFactory.makeBOArrayFromRawBackendDataArray(article_group_1.ArticleGroup, result.resultObjects);
730
- }
731
- else {
732
- console.error("Error getting article groups (" + response.message + ")");
733
- return null;
734
- }
666
+ async getArticleGroups() {
667
+ const data = { ...this.createServiceRequestData() };
668
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleGroups, data)
669
+ .catch((e) => {
670
+ return Promise.reject(e);
735
671
  });
672
+ const result = response.data;
673
+ if (result.validationResult && result.validationResult.success) {
674
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(article_group_1.ArticleGroup, result.resultObjects);
675
+ }
676
+ else {
677
+ console.error("Error getting article groups (" + response.message + ")");
678
+ return null;
679
+ }
736
680
  }
737
- getInternalParameter(parameter) {
738
- return __awaiter(this, void 0, void 0, function* () {
739
- const data = Object.assign({}, this.createServiceRequestData());
740
- const params = {
741
- parameter: parameter
742
- };
743
- data.parameterValues = params;
744
- const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetPublicParamValue, data)
745
- .catch((e) => {
746
- return Promise.reject(e);
747
- });
748
- const result = response.data;
749
- if (result.validationResult && result.validationResult.success) {
750
- return result.resultObject;
751
- }
752
- else {
753
- return null;
754
- }
755
- });
681
+ async getInternalParameter(parameter) {
682
+ const data = { ...this.createServiceRequestData() };
683
+ const params = {
684
+ parameter: parameter
685
+ };
686
+ data.parameterValues = params;
687
+ const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.GetPublicParamValue, data)
688
+ .catch((e) => {
689
+ return Promise.reject(e);
690
+ });
691
+ const result = response.data;
692
+ if (result.validationResult && result.validationResult.success) {
693
+ return result.resultObject;
694
+ }
695
+ else {
696
+ return null;
697
+ }
756
698
  }
757
699
  closeSession() {
758
700
  return this._sessionService.closePublicSession();