@colijnit/ioneconnector 1.0.134 → 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 (39) 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/model/question.d.ts +1 -0
  20. package/build/model/question.js +1 -0
  21. package/build/model/selection.js +37 -0
  22. package/build/provider/ajax.service.js +20 -30
  23. package/build/provider/base-backend-connection.service.js +2 -13
  24. package/build/provider/data-repository.service.d.ts +1 -0
  25. package/build/provider/data-repository.service.js +191 -236
  26. package/build/provider/hd-ajax.service.js +31 -39
  27. package/build/provider/hd-ajax.service.unit.test.js +15 -21
  28. package/build/service/datasession.service.js +2 -13
  29. package/build/service/encrypt.service.js +5 -2
  30. package/build/service/hd-data.service.d.ts +1 -0
  31. package/build/service/hd-data.service.js +557 -615
  32. package/build/service/hd-session.service.js +29 -44
  33. package/build/service/hd-session.service.unit.test.js +19 -28
  34. package/build/tests/int/connector-auth.int.test.js +7 -16
  35. package/build/tests/int/connector-public.int.test.js +10 -19
  36. package/build/tests/int/connector.int.test.js +9 -18
  37. package/build/utils/promise-utils.js +3 -12
  38. package/build/websocket/socket.js +2 -13
  39. package/package.json +7 -4
@@ -57,6 +57,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
57
57
  getSelectorActiveOptionValuesPrices(): Promise<any>;
58
58
  getAnswerTexts(params: any): Promise<any>;
59
59
  getDocumentContent(id: number, thumbnail: boolean): Promise<any>;
60
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
60
61
  getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, showLoader: boolean): Promise<string>;
61
62
  getDecos(): Promise<any>;
62
63
  getSelections(): Promise<any>;
@@ -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 data_repository_service_1 = require("./provider/data-repository.service");
13
4
  const rxjs_1 = require("rxjs");
@@ -34,24 +25,20 @@ class ConnectorAuth {
34
25
  this.dataRepository.showLoader.subscribe(value => this.showLoader.next(value));
35
26
  this.dataRepository.connectionResetInactivity.subscribe(() => this.connectionResetInactivity.next());
36
27
  }
37
- saveConfigurations() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const result = yield this.dataRepository.storeInstance();
40
- return result.data.validationResult.success;
41
- });
42
- }
43
- setInstanceToConfigure(instanceId, changeInstance = true) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (this.currentInstanceId !== instanceId) {
46
- this.currentInstanceId = instanceId;
47
- if (changeInstance) {
48
- return yield this.dataRepository.changeInstance(instanceId);
49
- }
50
- else {
51
- return;
52
- }
28
+ async saveConfigurations() {
29
+ const result = await this.dataRepository.storeInstance();
30
+ return result.data.validationResult.success;
31
+ }
32
+ async setInstanceToConfigure(instanceId, changeInstance = true) {
33
+ if (this.currentInstanceId !== instanceId) {
34
+ this.currentInstanceId = instanceId;
35
+ if (changeInstance) {
36
+ return await this.dataRepository.changeInstance(instanceId);
37
+ }
38
+ else {
39
+ return;
53
40
  }
54
- });
41
+ }
55
42
  }
56
43
  initNodeInstance(goodId) {
57
44
  return this.dataRepository.initNodeInstance(goodId);
@@ -89,6 +76,9 @@ class ConnectorAuth {
89
76
  getDocumentContent(id, thumbnail) {
90
77
  return this.dataRepository.getDocumentContent(id, thumbnail);
91
78
  }
79
+ getCatalogDefinitions(showLoader = true) {
80
+ return this.dataRepository.getCatalogDefinitions(showLoader);
81
+ }
92
82
  getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
93
83
  return this.dataRepository.getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader);
94
84
  }
@@ -52,6 +52,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
52
52
  getSelectorActiveOptionValuesPrices(): Promise<any>;
53
53
  getAnswerTexts(params: any): Promise<any>;
54
54
  getDocumentContent(id: number, thumbnail: boolean): Promise<any>;
55
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
55
56
  getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, showLoader: boolean): Promise<string>;
56
57
  getDecos(): Promise<any>;
57
58
  getSelections(): Promise<any>;
@@ -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 rxjs_1 = require("rxjs");
13
4
  const data_service_response_data_1 = require("./model/data-service-response-data");
@@ -41,14 +32,12 @@ class ConnectorPublic {
41
32
  };
42
33
  return Promise.resolve(responseRoot);
43
34
  }
44
- initNodeInstance(goodId) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const response = yield this.dataService.initNodeInstance(goodId, this._branch);
47
- if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
48
- this.setInstanceToConfigure(response.data.resultObject);
49
- }
50
- return response;
51
- });
35
+ async initNodeInstance(goodId) {
36
+ const response = await this.dataService.initNodeInstance(goodId, this._branch);
37
+ if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
38
+ this.setInstanceToConfigure(response.data.resultObject);
39
+ }
40
+ return response;
52
41
  }
53
42
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
54
43
  return this.dataService.copyInstance(instanceId);
@@ -84,6 +73,9 @@ class ConnectorPublic {
84
73
  getDocumentContent(id, thumbnail) {
85
74
  return this.dataService.getDocumentContent(id, thumbnail);
86
75
  }
76
+ getCatalogDefinitions(showLoader = true) {
77
+ return this.dataService.getCatalogDefinitions(showLoader);
78
+ }
87
79
  getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader) {
88
80
  return this.dataService.getSingleImage(nodeId, publication, includeMimetype, thumb, showLoader);
89
81
  }
@@ -89,6 +89,7 @@ export declare class Connector {
89
89
  getAnswersPrices(): Promise<AnswerPrice[]>;
90
90
  getAnswerInfo(answer: Answer): void;
91
91
  getDocumentContent(docId: number, thumbnail?: boolean): Promise<any>;
92
+ getCatalogDefinitions(showLoader?: boolean): Promise<any>;
92
93
  getImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
93
94
  getImageForAnswerOrSelection(answerOrSelection: Answer | Selection, publication?: number, thumbNail?: boolean, showLoader?: boolean): Promise<string>;
94
95
  getMoodImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
@@ -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 answer_1 = require("./model/answer");
13
4
  const selection_1 = require("./model/selection");
@@ -99,26 +90,22 @@ class Connector {
99
90
  copyInstance(instanceId, shouldSaveCurrentInstanceId) {
100
91
  return this.connection.copyInstance(instanceId, shouldSaveCurrentInstanceId);
101
92
  }
102
- getArticle(skuOrId) {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- const goodId = yield this.checkSkuOrId(skuOrId)
105
- .catch((e) => {
106
- return Promise.reject(e);
107
- });
108
- const article = yield this.connection.getArticleQuickSel(goodId)
109
- .catch((e) => {
110
- return Promise.reject(e);
111
- });
112
- article.sku = skuOrId;
113
- return article;
93
+ async getArticle(skuOrId) {
94
+ const goodId = await this.checkSkuOrId(skuOrId)
95
+ .catch((e) => {
96
+ return Promise.reject(e);
114
97
  });
115
- }
116
- initNodeInstance(skuOrId) {
117
- return __awaiter(this, void 0, void 0, function* () {
118
- const goodId = yield this.checkSkuOrId(skuOrId)
119
- .catch((e) => Promise.reject(e));
120
- return this.connection.initNodeInstance(goodId);
98
+ const article = await this.connection.getArticleQuickSel(goodId)
99
+ .catch((e) => {
100
+ return Promise.reject(e);
121
101
  });
102
+ article.sku = skuOrId;
103
+ return article;
104
+ }
105
+ async initNodeInstance(skuOrId) {
106
+ const goodId = await this.checkSkuOrId(skuOrId)
107
+ .catch((e) => Promise.reject(e));
108
+ return this.connection.initNodeInstance(goodId);
122
109
  }
123
110
  getArticleQuickSel(id) {
124
111
  return this.connection.getArticleQuickSel(id);
@@ -126,12 +113,10 @@ class Connector {
126
113
  getSuperArticle(id) {
127
114
  return this.connection.getSuperArticleQuickSel(id);
128
115
  }
129
- getFullArticle(skuOrId) {
130
- return __awaiter(this, void 0, void 0, function* () {
131
- const goodId = yield this.checkSkuOrId(skuOrId)
132
- .catch((e) => Promise.reject(e));
133
- return this.connection.getArticleFullObject(goodId);
134
- });
116
+ async getFullArticle(skuOrId) {
117
+ const goodId = await this.checkSkuOrId(skuOrId)
118
+ .catch((e) => Promise.reject(e));
119
+ return this.connection.getArticleFullObject(goodId);
135
120
  }
136
121
  getQuestionAndAnswers() {
137
122
  this.connection.getQuestionAndAnswers().then((rawDatas) => {
@@ -184,69 +169,63 @@ class Connector {
184
169
  }
185
170
  });
186
171
  }
187
- getQuestionAndAnswersAsync() {
188
- return __awaiter(this, void 0, void 0, function* () {
189
- const rawDatas = yield this.connection.getQuestionAndAnswers();
190
- const result = new question_and_answer_1.QuestionAndAnswer();
191
- if (rawDatas && (rawDatas && rawDatas.data && rawDatas.data.length > 0)) {
192
- this.match = rawDatas.match;
193
- const rawAnswers = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data.slice(1, rawDatas.data.length) : null;
194
- const nodeHierarchyLevelOffset = rawAnswers && rawAnswers[0] ? rawAnswers[0].treeLevel - 1 : 0;
195
- const answers = [];
196
- const len = rawAnswers ? rawAnswers.length : 0;
197
- for (let i = 0; i < len; i++) {
198
- const answer = this.boFactory.makeWithRawBackendData(answer_1.Answer, rawAnswers[i]);
199
- answer.isGroupHeader = rawAnswers[i].hasChildren === db_boolean_value_type_enum_1.DbBooleanValueType.True;
200
- answer.treeLevel = answer.treeLevel - nodeHierarchyLevelOffset;
201
- answer.instanceId = this.connection.currentInstanceId;
202
- const shouldHide = (not_nill_function_1.notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & 2) === 0) ||
203
- (answer.type === node_type_enum_1.NodeType.Question && (answer.questionPublicationCode & 2) === 0 && not_nill_function_1.notNill(answer.questionPublicationCode)) ||
204
- (answer.type === node_type_enum_1.NodeType.Answer && (answer.publicationCode & 2) === 0 && not_nill_function_1.notNill(answer.publicationCode));
205
- if (!shouldHide) {
206
- answers.push(answer);
207
- }
172
+ async getQuestionAndAnswersAsync() {
173
+ const rawDatas = await this.connection.getQuestionAndAnswers();
174
+ const result = new question_and_answer_1.QuestionAndAnswer();
175
+ if (rawDatas && (rawDatas && rawDatas.data && rawDatas.data.length > 0)) {
176
+ this.match = rawDatas.match;
177
+ const rawAnswers = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data.slice(1, rawDatas.data.length) : null;
178
+ const nodeHierarchyLevelOffset = rawAnswers && rawAnswers[0] ? rawAnswers[0].treeLevel - 1 : 0;
179
+ const answers = [];
180
+ const len = rawAnswers ? rawAnswers.length : 0;
181
+ for (let i = 0; i < len; i++) {
182
+ const answer = this.boFactory.makeWithRawBackendData(answer_1.Answer, rawAnswers[i]);
183
+ answer.isGroupHeader = rawAnswers[i].hasChildren === db_boolean_value_type_enum_1.DbBooleanValueType.True;
184
+ answer.treeLevel = answer.treeLevel - nodeHierarchyLevelOffset;
185
+ answer.instanceId = this.connection.currentInstanceId;
186
+ const shouldHide = (not_nill_function_1.notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & 2) === 0) ||
187
+ (answer.type === node_type_enum_1.NodeType.Question && (answer.questionPublicationCode & 2) === 0 && not_nill_function_1.notNill(answer.questionPublicationCode)) ||
188
+ (answer.type === node_type_enum_1.NodeType.Answer && (answer.publicationCode & 2) === 0 && not_nill_function_1.notNill(answer.publicationCode));
189
+ if (!shouldHide) {
190
+ answers.push(answer);
208
191
  }
209
- const rawQuestion = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data[0] : null;
210
- const question = rawQuestion ? this.boFactory.makeWithRawBackendData(question_1.Question, rawQuestion) : null;
211
- result.question = question;
212
- result.answers = answers;
213
192
  }
214
- return result;
215
- });
193
+ const rawQuestion = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data[0] : null;
194
+ const question = rawQuestion ? this.boFactory.makeWithRawBackendData(question_1.Question, rawQuestion) : null;
195
+ result.question = question;
196
+ result.answers = answers;
197
+ }
198
+ return result;
216
199
  }
217
200
  getSkipButtonImageAndText(goodId) {
218
201
  return this.connection.getSkipButtonImageAndText(goodId);
219
202
  }
220
- getDeliveryPrognosisForArticle(goodId) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- const data = yield this.connection.getDeliveryPrognosis(goodId, this.branch);
223
- let result = { stock: 0, deliveryDescription: '' };
224
- if (data) {
225
- if (data.hasOwnProperty('dateExplanation')) {
226
- let dateExplanation = data.dateExplanation;
227
- dateExplanation = dateExplanation.substr(dateExplanation.search('in voorraad'));
228
- dateExplanation = dateExplanation.substr(0, dateExplanation.indexOf(','));
229
- const stock = dateExplanation.split(':');
230
- result.stock = parseInt(stock[1]);
231
- }
232
- const deliveryDate = new Date(data.returnValue);
233
- result.deliveryDescription = this.getDeliveryDateDescription(deliveryDate);
234
- }
235
- return result;
236
- });
203
+ async getDeliveryPrognosisForArticle(goodId) {
204
+ const data = await this.connection.getDeliveryPrognosis(goodId, this.branch);
205
+ let result = { stock: 0, deliveryDescription: '' };
206
+ if (data) {
207
+ if (data.hasOwnProperty('dateExplanation')) {
208
+ let dateExplanation = data.dateExplanation;
209
+ dateExplanation = dateExplanation.substr(dateExplanation.search('in voorraad'));
210
+ dateExplanation = dateExplanation.substr(0, dateExplanation.indexOf(','));
211
+ const stock = dateExplanation.split(':');
212
+ result.stock = parseInt(stock[1]);
213
+ }
214
+ const deliveryDate = new Date(data.returnValue);
215
+ result.deliveryDescription = this.getDeliveryDateDescription(deliveryDate);
216
+ }
217
+ return result;
237
218
  }
238
- getAnswersPrices() {
239
- return __awaiter(this, void 0, void 0, function* () {
240
- const rawDatas = yield this.connection.getSelectorActiveOptionValuesPrices();
241
- const pricesArr = rawDatas && rawDatas.length > 0 ? rawDatas : null;
242
- const prices = [];
243
- const len = pricesArr ? pricesArr.length : 0;
244
- for (let i = 0; i < len; i++) {
245
- const price = new answer_price_1.AnswerPrice(pricesArr[i]);
246
- prices.push(price);
247
- }
248
- return prices;
249
- });
219
+ async getAnswersPrices() {
220
+ const rawDatas = await this.connection.getSelectorActiveOptionValuesPrices();
221
+ const pricesArr = rawDatas && rawDatas.length > 0 ? rawDatas : null;
222
+ const prices = [];
223
+ const len = pricesArr ? pricesArr.length : 0;
224
+ for (let i = 0; i < len; i++) {
225
+ const price = new answer_price_1.AnswerPrice(pricesArr[i]);
226
+ prices.push(price);
227
+ }
228
+ return prices;
250
229
  }
251
230
  getAnswerInfo(answer) {
252
231
  this.connection.getAnswerTexts({ goodId: answer.nodeId }).then((data) => {
@@ -265,6 +244,9 @@ class Connector {
265
244
  getDocumentContent(docId, thumbnail = true) {
266
245
  return this.connection.getDocumentContent(docId, thumbnail);
267
246
  }
247
+ getCatalogDefinitions(showLoader = true) {
248
+ return this.connection.getCatalogDefinitions(showLoader);
249
+ }
268
250
  getImageForAnswerSelection(answerOrSelection, thumbNail = true, showLoader = true) {
269
251
  this.connection.getSingleImage(answerOrSelection.nodeId, 4, true, thumbNail, showLoader).then((data) => {
270
252
  if (this.handleImages !== void 0) {
@@ -297,131 +279,117 @@ class Connector {
297
279
  });
298
280
  }
299
281
  }
300
- getSelectionsAsync() {
301
- return __awaiter(this, void 0, void 0, function* () {
302
- const rawData = yield this.connection.getSelections();
303
- const selections = [];
304
- const len = rawData ? rawData.length : 0;
305
- for (let i = 0; i < len; i++) {
306
- const selection = new selection_1.Selection(rawData[i]);
307
- selection.instanceId = this.connection.currentInstanceId;
308
- selections.push(selection);
309
- }
310
- return selections;
311
- });
282
+ async getSelectionsAsync() {
283
+ const rawData = await this.connection.getSelections();
284
+ const selections = [];
285
+ const len = rawData ? rawData.length : 0;
286
+ for (let i = 0; i < len; i++) {
287
+ const selection = new selection_1.Selection(rawData[i]);
288
+ selection.instanceId = this.connection.currentInstanceId;
289
+ selections.push(selection);
290
+ }
291
+ return selections;
312
292
  }
313
- getDecosAsync() {
314
- return __awaiter(this, void 0, void 0, function* () {
315
- const rawData = yield this.connection.getDecos();
316
- const decoNodes = [];
317
- const len = rawData ? rawData.length : 0;
318
- for (let i = 0; i < len; i++) {
319
- const deco = new deco_node_1.DecoNode(rawData[i]);
320
- deco.instanceId = this.connection.currentInstanceId;
321
- decoNodes.push(deco);
322
- }
323
- return decoNodes;
324
- });
293
+ async getDecosAsync() {
294
+ const rawData = await this.connection.getDecos();
295
+ const decoNodes = [];
296
+ const len = rawData ? rawData.length : 0;
297
+ for (let i = 0; i < len; i++) {
298
+ const deco = new deco_node_1.DecoNode(rawData[i]);
299
+ deco.instanceId = this.connection.currentInstanceId;
300
+ decoNodes.push(deco);
301
+ }
302
+ return decoNodes;
325
303
  }
326
- selectAnswer(answer, userInput) {
327
- return __awaiter(this, void 0, void 0, function* () {
328
- if (!answer) {
329
- return;
304
+ async selectAnswer(answer, userInput) {
305
+ if (!answer) {
306
+ return;
307
+ }
308
+ if (answer.instanceId !== this.connection.currentInstanceId) {
309
+ await this.connection.changeInstance(answer.instanceId);
310
+ }
311
+ const params = {};
312
+ if (answer.treeHierarchy !== null && answer.treeHierarchy !== undefined) {
313
+ params.treeHierarchie = answer.treeHierarchy;
314
+ return this._navigateTo(params);
315
+ }
316
+ else {
317
+ this.stepBackNode = this.use3D ? -1 : answer.node.node;
318
+ if (this.connectorName) {
319
+ params.decoConnection = this.connectorName;
330
320
  }
331
- if (answer.instanceId !== this.connection.currentInstanceId) {
332
- yield this.connection.changeInstance(answer.instanceId);
321
+ if (answer.userInput && userInput !== undefined) {
322
+ params.inqString = userInput;
333
323
  }
334
- const params = {};
335
- if (answer.treeHierarchy !== null && answer.treeHierarchy !== undefined) {
336
- params.treeHierarchie = answer.treeHierarchy;
337
- return this._navigateTo(params);
324
+ if (this.combNode || answer.useNextCombNode) {
325
+ params.nodeId = answer.node.node ? answer.node.node : answer.node;
326
+ return this._nextCombNode(params);
338
327
  }
339
328
  else {
340
- this.stepBackNode = this.use3D ? -1 : answer.node.node;
341
- if (this.connectorName) {
342
- params.decoConnection = this.connectorName;
343
- }
344
- if (answer.userInput && userInput !== undefined) {
345
- params.inqString = userInput;
346
- }
347
- if (this.combNode || answer.useNextCombNode) {
348
- params.nodeId = answer.node.node ? answer.node.node : answer.node;
349
- return this._nextCombNode(params);
350
- }
351
- else {
352
- params.opvId = answer.id;
353
- return this._nextNode(params);
354
- }
329
+ params.opvId = answer.id;
330
+ return this._nextNode(params);
355
331
  }
356
- });
332
+ }
357
333
  }
358
- deleteSelection(selection) {
359
- return __awaiter(this, void 0, void 0, function* () {
360
- if (!selection) {
361
- return;
362
- }
363
- const params = {
364
- nodeId: selection.node
365
- };
366
- yield this.connection.back2Node(params);
367
- return this.connection.nextNode({ opvId: 0 });
368
- });
334
+ async deleteSelection(selection) {
335
+ if (!selection) {
336
+ return;
337
+ }
338
+ const params = {
339
+ nodeId: selection.node
340
+ };
341
+ await this.connection.back2Node(params);
342
+ return this.connection.nextNode({ opvId: 0 });
369
343
  }
370
- replaceSelection(selection) {
371
- return __awaiter(this, void 0, void 0, function* () {
372
- if (!selection) {
373
- return;
374
- }
375
- const params = {
376
- nodeId: selection.node
377
- };
378
- return this.connection.back2Node(params);
379
- });
344
+ async replaceSelection(selection) {
345
+ if (!selection) {
346
+ return;
347
+ }
348
+ const params = {
349
+ nodeId: selection.node
350
+ };
351
+ return this.connection.back2Node(params);
380
352
  }
381
- selectSelection(selection, forceBackToNode, after, connector) {
382
- return __awaiter(this, void 0, void 0, function* () {
383
- if (!selection) {
384
- return;
385
- }
386
- if (forceBackToNode === undefined) {
387
- forceBackToNode = true;
388
- }
389
- if (selection.instanceId !== this.connection.currentInstanceId) {
390
- yield this.connection.changeInstance(selection.instanceId);
391
- }
392
- this.connectorName = connector;
393
- this.combNode = after !== undefined;
394
- const params = {};
395
- if (after !== undefined) {
396
- params.copyAfter = after ? 'T' : 'F';
397
- }
398
- if (connector !== undefined) {
399
- params.selectedConnector = connector;
400
- }
401
- if (!selection.optCycle || forceBackToNode) {
402
- params.nodeId = selection.node;
403
- params.useCombinationNodes = this.combNode ? 'T' : 'F';
404
- return this.connection.back2Node(params);
405
- }
406
- else {
407
- params.optCycle = selection.optCycle;
408
- return this.connection.repeatOption(params);
409
- }
410
- });
353
+ async selectSelection(selection, forceBackToNode, after, connector) {
354
+ if (!selection) {
355
+ return;
356
+ }
357
+ if (forceBackToNode === undefined) {
358
+ forceBackToNode = true;
359
+ }
360
+ if (selection.instanceId !== this.connection.currentInstanceId) {
361
+ await this.connection.changeInstance(selection.instanceId);
362
+ }
363
+ this.connectorName = connector;
364
+ this.combNode = after !== undefined;
365
+ const params = {};
366
+ if (after !== undefined) {
367
+ params.copyAfter = after ? 'T' : 'F';
368
+ }
369
+ if (connector !== undefined) {
370
+ params.selectedConnector = connector;
371
+ }
372
+ if (!selection.optCycle || forceBackToNode) {
373
+ params.nodeId = selection.node;
374
+ params.useCombinationNodes = this.combNode ? 'T' : 'F';
375
+ return this.connection.back2Node(params);
376
+ }
377
+ else {
378
+ params.optCycle = selection.optCycle;
379
+ return this.connection.repeatOption(params);
380
+ }
411
381
  }
412
382
  cancelAnswer() {
413
383
  return this._cancelBack2node();
414
384
  }
415
- getAnswerStock(answer) {
416
- return __awaiter(this, void 0, void 0, function* () {
417
- if (answer) {
418
- const stockStatusNr = yield this.connection.getStockForArtNode(this.branch, answer.id);
419
- return stock_status_enum_1.NumberToStockStatus(stockStatusNr);
420
- }
421
- else {
422
- return stock_status_enum_1.StockStatus.None;
423
- }
424
- });
385
+ async getAnswerStock(answer) {
386
+ if (answer) {
387
+ const stockStatusNr = await this.connection.getStockForArtNode(this.branch, answer.id);
388
+ return stock_status_enum_1.NumberToStockStatus(stockStatusNr);
389
+ }
390
+ else {
391
+ return stock_status_enum_1.StockStatus.None;
392
+ }
425
393
  }
426
394
  getJsonConfiguredArticles(configuratorStatistics) {
427
395
  return new Promise((resolve, reject) => {
@@ -459,10 +427,8 @@ class Connector {
459
427
  getInternalParameter(parameter) {
460
428
  return this.connection.getInternalParameter(parameter);
461
429
  }
462
- getArticlesForCatalog(params, paging = paging_parameters_1.PagingParameters.DEFAULTS, showLoader = true) {
463
- return __awaiter(this, void 0, void 0, function* () {
464
- return this.connection.getArticlesForCatalog(params, paging, showLoader);
465
- });
430
+ async getArticlesForCatalog(params, paging = paging_parameters_1.PagingParameters.DEFAULTS, showLoader = true) {
431
+ return this.connection.getArticlesForCatalog(params, paging, showLoader);
466
432
  }
467
433
  getArticlePrice(goodId) {
468
434
  return this.connection.getArticlePrice(goodId);
@@ -7,12 +7,18 @@ const selector_article_1 = require("./model/selector-article");
7
7
  const business_object_factory_1 = require("./service/business-object-factory");
8
8
  const map_property_decorator_1 = require("./factory/decorators/map-property.decorator");
9
9
  const options = {
10
- url: 'http'
10
+ url: 'http://localhost:8080/ione',
11
+ schema: "815",
12
+ version: "252",
13
+ username: "patrick",
14
+ password: "patrick",
15
+ useLoginEncryption: true
11
16
  };
12
17
  describe("Connector", () => {
13
18
  let connector;
14
19
  beforeEach(() => {
15
20
  connector = new connector_1.Connector(options);
21
+ jest.setTimeout(30000);
16
22
  });
17
23
  it('checkMapProperty', () => {
18
24
  const raw = {
@@ -126,4 +132,8 @@ describe("Connector", () => {
126
132
  const selectionsToDisplay = connector.getSelectionsToDisplay(selections);
127
133
  expect(selectionsToDisplay.length).toBe(0);
128
134
  });
135
+ it('getCatalogDefinitions', async () => {
136
+ const catalogDefinitions = await connector.getCatalogDefinitions();
137
+ expect(catalogDefinitions).toBeDefined();
138
+ });
129
139
  });
@@ -1,4 +1,5 @@
1
1
  export declare enum GeneralMethod {
2
2
  GetDocumentContent = "getDocumentContent",
3
+ GetCatalogDefinitions = "getCatalogDefinitions",
3
4
  GetParamValue = "getParamValue"
4
5
  }
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var GeneralMethod;
4
4
  (function (GeneralMethod) {
5
5
  GeneralMethod["GetDocumentContent"] = "getDocumentContent";
6
+ GeneralMethod["GetCatalogDefinitions"] = "getCatalogDefinitions";
6
7
  GeneralMethod["GetParamValue"] = "getParamValue";
7
8
  })(GeneralMethod = exports.GeneralMethod || (exports.GeneralMethod = {}));
@@ -1,3 +1,4 @@
1
1
  export declare enum GeneralObjectName {
2
- CoDocument = "CoDocument"
2
+ CoDocument = "CoDocument",
3
+ CatalogDefinition = "CatalogDefinition"
3
4
  }
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var GeneralObjectName;
4
4
  (function (GeneralObjectName) {
5
5
  GeneralObjectName["CoDocument"] = "CoDocument";
6
+ GeneralObjectName["CatalogDefinition"] = "CatalogDefinition";
6
7
  })(GeneralObjectName = exports.GeneralObjectName || (exports.GeneralObjectName = {}));