@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.
- package/build/connector-auth.d.ts +1 -0
- package/build/connector-auth.js +16 -26
- package/build/connector-public.d.ts +1 -0
- package/build/connector-public.js +9 -17
- package/build/connector.d.ts +1 -0
- package/build/connector.js +170 -204
- package/build/connector.unit.test.js +11 -1
- package/build/enum/general-method.enum.d.ts +1 -0
- package/build/enum/general-method.enum.js +1 -0
- package/build/enum/general-object-name.enum.d.ts +2 -1
- package/build/enum/general-object-name.enum.js +1 -0
- package/build/enum/hd-service-method.d.ts +1 -0
- package/build/enum/hd-service-method.js +1 -0
- package/build/ione-api-connection.d.ts +1 -0
- package/build/model/catalog-definition.d.ts +24 -0
- package/build/model/catalog-definition.js +66 -0
- package/build/model/external-source-translation.d.ts +7 -0
- package/build/model/external-source-translation.js +6 -0
- package/build/provider/ajax.service.js +20 -30
- package/build/provider/base-backend-connection.service.js +2 -13
- package/build/provider/data-repository.service.d.ts +1 -0
- package/build/provider/data-repository.service.js +191 -236
- package/build/provider/hd-ajax.service.js +31 -39
- package/build/provider/hd-ajax.service.unit.test.js +15 -21
- package/build/service/datasession.service.js +2 -13
- package/build/service/encrypt.service.js +5 -2
- package/build/service/hd-data.service.d.ts +1 -0
- package/build/service/hd-data.service.js +557 -615
- package/build/service/hd-session.service.js +29 -44
- package/build/service/hd-session.service.unit.test.js +19 -28
- package/build/tests/int/connector-auth.int.test.js +7 -16
- package/build/tests/int/connector-public.int.test.js +10 -19
- package/build/tests/int/connector.int.test.js +9 -18
- package/build/utils/promise-utils.js +3 -12
- package/build/websocket/socket.js +2 -13
- 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>;
|
package/build/connector-auth.js
CHANGED
|
@@ -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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
}
|
package/build/connector.d.ts
CHANGED
|
@@ -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;
|
package/build/connector.js
CHANGED
|
@@ -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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
117
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (data) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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.
|
|
332
|
-
|
|
321
|
+
if (answer.userInput && userInput !== undefined) {
|
|
322
|
+
params.inqString = userInput;
|
|
333
323
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
|
|
341
|
-
|
|
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
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
|
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
|
});
|
|
@@ -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 = {}));
|
|
@@ -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 = {}));
|