@colijnit/ioneconnector 1.0.122 → 1.0.126
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 +2 -2
- package/build/connector-auth.js +5 -4
- package/build/connector-public.d.ts +2 -2
- package/build/connector-public.js +6 -5
- package/build/connector.d.ts +17 -13
- package/build/connector.js +127 -84
- package/build/enum/article-method.enum.d.ts +1 -0
- package/build/enum/article-method.enum.js +1 -0
- package/build/enum/hd-service-method.d.ts +3 -1
- package/build/enum/hd-service-method.js +2 -0
- package/build/enum/internal-param.enum.d.ts +2 -1
- package/build/enum/internal-param.enum.js +2 -1
- package/build/enum/refcode/configuration-display-option.enum.d.ts +14 -0
- package/build/enum/refcode/configuration-display-option.enum.js +17 -0
- package/build/ione-api-connection.d.ts +2 -2
- package/build/model/answer.d.ts +53 -7
- package/build/model/answer.js +39 -12
- package/build/model/article-list-object-extended.d.ts +1 -0
- package/build/model/article-list-object-extended.js +0 -5
- package/build/model/color.js +0 -1
- package/build/model/question-and-answer.d.ts +6 -0
- package/build/model/question-and-answer.js +8 -0
- package/build/model/selection.d.ts +46 -0
- package/build/model/selection.js +42 -0
- package/build/model/tag.js +0 -1
- package/build/provider/ajax.service.js +1 -1
- package/build/provider/base-backend-connection.service.d.ts +0 -1
- package/build/provider/base-backend-connection.service.js +0 -1
- package/build/provider/data-repository.service.d.ts +3 -2
- package/build/provider/data-repository.service.js +142 -28
- package/build/provider/hd-ajax.service.d.ts +0 -1
- package/build/provider/hd-ajax.service.js +2 -3
- package/build/service/business-object-factory.js +8 -3
- package/build/service/encrypt.service.js +1 -1
- package/build/service/hd-data.service.d.ts +4 -1
- package/build/service/hd-data.service.js +162 -31
- package/build/service/hd-session.service.js +20 -28
- package/build/service/login.service.d.ts +1 -1
- package/build/tests/int/connector-auth.int.test.js +7 -1
- package/build/tests/int/connector-public.int.test.js +6 -0
- package/package.json +10 -17
|
@@ -29,7 +29,6 @@ import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
|
29
29
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
30
30
|
export declare class ConnectorAuth implements IoneApiConnection {
|
|
31
31
|
readonly showLoader: Subject<boolean>;
|
|
32
|
-
readonly connectionAborted: Subject<void>;
|
|
33
32
|
readonly connectionResetInactivity: Subject<void>;
|
|
34
33
|
private readonly useWebsocket;
|
|
35
34
|
private readonly url;
|
|
@@ -70,7 +69,8 @@ export declare class ConnectorAuth implements IoneApiConnection {
|
|
|
70
69
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
71
70
|
getMatchTable(): Promise<any>;
|
|
72
71
|
getFrozenArticle(): Promise<any>;
|
|
73
|
-
|
|
72
|
+
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
73
|
+
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
74
74
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|
|
75
75
|
getArticlePrice(goodId: number): Promise<ArticlePrice>;
|
|
76
76
|
getArticleCategories(publicationCode: number): Promise<ArticleCategory[]>;
|
package/build/connector-auth.js
CHANGED
|
@@ -14,7 +14,6 @@ const rxjs_1 = require("rxjs");
|
|
|
14
14
|
class ConnectorAuth {
|
|
15
15
|
constructor(options, externalStorage = undefined) {
|
|
16
16
|
this.showLoader = new rxjs_1.Subject();
|
|
17
|
-
this.connectionAborted = new rxjs_1.Subject();
|
|
18
17
|
this.connectionResetInactivity = new rxjs_1.Subject();
|
|
19
18
|
this.useWebsocket = false;
|
|
20
19
|
this.useGroups = false;
|
|
@@ -33,7 +32,6 @@ class ConnectorAuth {
|
|
|
33
32
|
this.dataRepository = new data_repository_service_1.DataRepositoryService(this.url, this.branch, this.currencyId, this.useGroups, options, this.session, externalStorage);
|
|
34
33
|
this.session = this.dataRepository.connection.session;
|
|
35
34
|
this.dataRepository.showLoader.subscribe(value => this.showLoader.next(value));
|
|
36
|
-
this.dataRepository.connectionAborted.subscribe(() => this.connectionAborted.next());
|
|
37
35
|
this.dataRepository.connectionResetInactivity.subscribe(() => this.connectionResetInactivity.next());
|
|
38
36
|
}
|
|
39
37
|
saveConfigurations() {
|
|
@@ -125,8 +123,11 @@ class ConnectorAuth {
|
|
|
125
123
|
getFrozenArticle() {
|
|
126
124
|
return this.dataRepository.getFrozenArticle();
|
|
127
125
|
}
|
|
128
|
-
|
|
129
|
-
return this.dataRepository.
|
|
126
|
+
getJsonArticleFlatTree(goodId) {
|
|
127
|
+
return this.dataRepository.getJsonArticleFlatTree(goodId);
|
|
128
|
+
}
|
|
129
|
+
getSkipButtonImageAndText(goodId) {
|
|
130
|
+
return this.dataRepository.getSkipButtonImageAndText(goodId);
|
|
130
131
|
}
|
|
131
132
|
getArticlesForCatalog(params, paging, showLoader) {
|
|
132
133
|
return this.dataRepository.getArticlesForCatalog(params, paging, showLoader);
|
|
@@ -27,7 +27,6 @@ import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
|
27
27
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
28
28
|
export declare class ConnectorPublic implements IoneApiConnection {
|
|
29
29
|
readonly showLoader: Subject<boolean>;
|
|
30
|
-
readonly connectionAborted: Subject<void>;
|
|
31
30
|
readonly connectionResetInactivity: Subject<void>;
|
|
32
31
|
private readonly dataService;
|
|
33
32
|
private _schema;
|
|
@@ -65,7 +64,8 @@ export declare class ConnectorPublic implements IoneApiConnection {
|
|
|
65
64
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
66
65
|
getMatchTable(): Promise<any>;
|
|
67
66
|
getFrozenArticle(): Promise<any>;
|
|
68
|
-
|
|
67
|
+
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
68
|
+
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
69
69
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|
|
70
70
|
getArticlePrice(goodId: number): Promise<ArticlePrice>;
|
|
71
71
|
getArticleCategories(publicationCode: number): Promise<ArticleCategory[]>;
|
|
@@ -6,7 +6,6 @@ const validation_result_1 = require("./model/validation-result");
|
|
|
6
6
|
class ConnectorPublic {
|
|
7
7
|
constructor(dataService) {
|
|
8
8
|
this.showLoader = new rxjs_1.Subject();
|
|
9
|
-
this.connectionAborted = new rxjs_1.Subject();
|
|
10
9
|
this.connectionResetInactivity = new rxjs_1.Subject();
|
|
11
10
|
this.dataService = dataService;
|
|
12
11
|
}
|
|
@@ -109,8 +108,11 @@ class ConnectorPublic {
|
|
|
109
108
|
getFrozenArticle() {
|
|
110
109
|
return this.dataService.getFrozenArticle();
|
|
111
110
|
}
|
|
112
|
-
|
|
113
|
-
return this.dataService.
|
|
111
|
+
getJsonArticleFlatTree(goodId) {
|
|
112
|
+
return this.dataService.getJsonArticleFlatTree(goodId);
|
|
113
|
+
}
|
|
114
|
+
getSkipButtonImageAndText(goodId) {
|
|
115
|
+
return this.dataService.getSkipButtonImageAndText(goodId);
|
|
114
116
|
}
|
|
115
117
|
getArticlesForCatalog(params, paging, showLoader) {
|
|
116
118
|
return this.dataService.getArticlesForCatalog(params, paging);
|
|
@@ -165,8 +167,7 @@ class ConnectorPublic {
|
|
|
165
167
|
return this.dataService.closeSession();
|
|
166
168
|
}
|
|
167
169
|
getInternalParameter(parameter) {
|
|
168
|
-
|
|
169
|
-
return null;
|
|
170
|
+
return this.dataService.getInternalParameter(parameter);
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
exports.ConnectorPublic = ConnectorPublic;
|
package/build/connector.d.ts
CHANGED
|
@@ -36,9 +36,9 @@ import { Concept } from "./model/concept";
|
|
|
36
36
|
import { ArticleGroup } from "./model/article-group";
|
|
37
37
|
import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
38
38
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
39
|
+
import { QuestionAndAnswer } from "./model/question-and-answer";
|
|
39
40
|
export declare class Connector {
|
|
40
41
|
goodId: number;
|
|
41
|
-
sku: string;
|
|
42
42
|
useWebsocket: boolean;
|
|
43
43
|
url: string;
|
|
44
44
|
version: string;
|
|
@@ -68,9 +68,9 @@ export declare class Connector {
|
|
|
68
68
|
private stepBackNode;
|
|
69
69
|
private combNode;
|
|
70
70
|
private readonly subs;
|
|
71
|
+
private boFactory;
|
|
71
72
|
private connection;
|
|
72
73
|
readonly showLoader: Subject<boolean>;
|
|
73
|
-
readonly connectionAborted: Subject<void>;
|
|
74
74
|
readonly connectionResetInactivity: Subject<void>;
|
|
75
75
|
constructor(options?: Options, externalStorage?: ExternalStorage);
|
|
76
76
|
saveConfigurations(): Promise<boolean>;
|
|
@@ -82,7 +82,8 @@ export declare class Connector {
|
|
|
82
82
|
getSuperArticle(id: string): Promise<SuperArticle>;
|
|
83
83
|
getFullArticle(skuOrId: string): Promise<ArticleFullObject>;
|
|
84
84
|
getQuestionAndAnswers(): void;
|
|
85
|
-
|
|
85
|
+
getQuestionAndAnswersAsync(): Promise<QuestionAndAnswer>;
|
|
86
|
+
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
86
87
|
getDeliveryPrognosisForArticle(goodId: number): Promise<{}>;
|
|
87
88
|
getAnswersPrices(): Promise<AnswerPrice[]>;
|
|
88
89
|
getAnswerInfo(answer: Answer): void;
|
|
@@ -91,13 +92,16 @@ export declare class Connector {
|
|
|
91
92
|
getImageForAnswerOrSelection(answerOrSelection: Answer | Selection, publication?: number, thumbNail?: boolean, showLoader?: boolean): Promise<string>;
|
|
92
93
|
getMoodImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
|
|
93
94
|
getSelections(): void;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
getSelectionsAsync(): Promise<Selection[]>;
|
|
96
|
+
getDecosAsync(): Promise<DecoNode[]>;
|
|
97
|
+
selectAnswer(answer: Answer, userInput?: string): Promise<DataServiceResponseRoot>;
|
|
98
|
+
deleteSelection(selection: Selection): Promise<DataServiceResponseRoot>;
|
|
99
|
+
replaceSelection(selection: Selection): Promise<DataServiceResponseRoot>;
|
|
100
|
+
selectSelection(selection: Selection, forceBackToNode?: boolean, after?: boolean, connector?: string): Promise<DataServiceResponseRoot>;
|
|
101
|
+
cancelAnswer(): Promise<DataServiceResponseRoot>;
|
|
99
102
|
getAnswerStock(answer: Answer): Promise<StockStatus>;
|
|
100
103
|
getJsonConfiguredArticles(): Promise<any>;
|
|
104
|
+
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
101
105
|
getJsonMatchTableArticles(): Promise<any>;
|
|
102
106
|
getInternalParameter(parameter: InternalParam): Promise<string>;
|
|
103
107
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging?: PagingParameters, showLoader?: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|
|
@@ -118,12 +122,12 @@ export declare class Connector {
|
|
|
118
122
|
getArticleGroups(): Promise<ArticleGroup[]>;
|
|
119
123
|
handleSelectionsReceived(data: any): void;
|
|
120
124
|
handleDecoNodesReceived(data: any): void;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
private _nextCombNode;
|
|
126
|
+
private _nextNode;
|
|
127
|
+
private _cancelBack2node;
|
|
128
|
+
private _navigateTo;
|
|
125
129
|
getDeliveryDateDescription(date: Date): string;
|
|
126
|
-
checkSkuOrId(skuOrId: string): Promise<
|
|
130
|
+
checkSkuOrId(skuOrId: string): Promise<number>;
|
|
127
131
|
getSelectionsToDisplay(allSelections: Selection[]): Selection[];
|
|
128
132
|
getMappedMatchTable(data: any): MatchArticle[];
|
|
129
133
|
getMappedFrozenArticle(data: any): FrozenArticle;
|
package/build/connector.js
CHANGED
|
@@ -30,6 +30,10 @@ const hd_session_service_1 = require("./service/hd-session.service");
|
|
|
30
30
|
const business_object_factory_1 = require("./service/business-object-factory");
|
|
31
31
|
const hd_data_service_1 = require("./service/hd-data.service");
|
|
32
32
|
const frozen_article_simple_1 = require("./model/frozen-article-simple");
|
|
33
|
+
const db_boolean_value_type_enum_1 = require("./enum/db-boolean-value-type.enum");
|
|
34
|
+
const not_nill_function_1 = require("./utils/function/not-nill.function");
|
|
35
|
+
const is_nill_function_1 = require("./utils/function/is-nill.function");
|
|
36
|
+
const question_and_answer_1 = require("./model/question-and-answer");
|
|
33
37
|
class Connector {
|
|
34
38
|
constructor(options, externalStorage = undefined) {
|
|
35
39
|
this.useWebsocket = false;
|
|
@@ -44,8 +48,8 @@ class Connector {
|
|
|
44
48
|
this.stepBackNode = "";
|
|
45
49
|
this.combNode = false;
|
|
46
50
|
this.subs = [];
|
|
51
|
+
this.boFactory = new business_object_factory_1.BusinessObjectFactory();
|
|
47
52
|
this.showLoader = new rxjs_1.Subject();
|
|
48
|
-
this.connectionAborted = new rxjs_1.Subject();
|
|
49
53
|
this.connectionResetInactivity = new rxjs_1.Subject();
|
|
50
54
|
this._applicationClose = () => {
|
|
51
55
|
this.connection.close();
|
|
@@ -83,7 +87,7 @@ class Connector {
|
|
|
83
87
|
if (!this.session && this.connection.hasOwnProperty('session')) {
|
|
84
88
|
this.session = this.connection['session'];
|
|
85
89
|
}
|
|
86
|
-
this.subs.push(this.connection.showLoader.subscribe(value => this.showLoader.next(value)), this.connection.
|
|
90
|
+
this.subs.push(this.connection.showLoader.subscribe(value => this.showLoader.next(value)), this.connection.connectionResetInactivity.subscribe(() => this._handleConnectionReset()));
|
|
87
91
|
window.addEventListener('beforeunload', this._applicationClose);
|
|
88
92
|
}
|
|
89
93
|
saveConfigurations() {
|
|
@@ -96,30 +100,24 @@ class Connector {
|
|
|
96
100
|
return this.connection.copyInstance(instanceId, shouldSaveCurrentInstanceId);
|
|
97
101
|
}
|
|
98
102
|
getArticle(skuOrId) {
|
|
99
|
-
return this
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (response && response.data && response.data.resultObject) {
|
|
104
|
-
yield this.setInstanceToConfigure(response.data.resultObject);
|
|
105
|
-
article.sku = this.sku;
|
|
106
|
-
article.instanceId = response.data.resultObject;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
console.error("Error retrieving instance id");
|
|
110
|
-
}
|
|
111
|
-
if (this.handleArticle !== void 0) {
|
|
112
|
-
this.handleArticle(article);
|
|
113
|
-
}
|
|
114
|
-
resolve(article);
|
|
115
|
-
}));
|
|
116
|
-
});
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
const goodId = yield this.checkSkuOrId(skuOrId)
|
|
105
|
+
.catch((e) => {
|
|
106
|
+
return Promise.reject(e);
|
|
117
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;
|
|
118
114
|
});
|
|
119
115
|
}
|
|
120
116
|
initNodeInstance(skuOrId) {
|
|
121
|
-
return this
|
|
122
|
-
|
|
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);
|
|
123
121
|
});
|
|
124
122
|
}
|
|
125
123
|
getArticleQuickSel(id) {
|
|
@@ -129,12 +127,10 @@ class Connector {
|
|
|
129
127
|
return this.connection.getSuperArticleQuickSel(id);
|
|
130
128
|
}
|
|
131
129
|
getFullArticle(skuOrId) {
|
|
132
|
-
return this
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}));
|
|
137
|
-
});
|
|
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);
|
|
138
134
|
});
|
|
139
135
|
}
|
|
140
136
|
getQuestionAndAnswers() {
|
|
@@ -155,17 +151,19 @@ class Connector {
|
|
|
155
151
|
const answers = [];
|
|
156
152
|
const len = rawAnswers ? rawAnswers.length : 0;
|
|
157
153
|
for (let i = 0; i < len; i++) {
|
|
158
|
-
const answer =
|
|
154
|
+
const answer = this.boFactory.makeWithRawBackendData(answer_1.Answer, rawAnswers[i]);
|
|
155
|
+
answer.isGroupHeader = rawAnswers[i].hasChildren === db_boolean_value_type_enum_1.DbBooleanValueType.True;
|
|
156
|
+
answer.treeLevel = answer.treeLevel - nodeHierarchyLevelOffset;
|
|
159
157
|
answer.instanceId = this.connection.currentInstanceId;
|
|
160
|
-
const shouldHide = ((answer.hierarchicalPublicationCode
|
|
161
|
-
(answer.type === node_type_enum_1.NodeType.Question && (answer.questionPublicationCode & 2) === 0 && answer.questionPublicationCode
|
|
162
|
-
(answer.type === node_type_enum_1.NodeType.Answer && (answer.publicationCode & 2) === 0 && answer.publicationCode
|
|
158
|
+
const shouldHide = (not_nill_function_1.notNill(answer.hierarchicalPublicationCode) && (answer.hierarchicalPublicationCode & 2) === 0) ||
|
|
159
|
+
(answer.type === node_type_enum_1.NodeType.Question && (answer.questionPublicationCode & 2) === 0 && not_nill_function_1.notNill(answer.questionPublicationCode)) ||
|
|
160
|
+
(answer.type === node_type_enum_1.NodeType.Answer && (answer.publicationCode & 2) === 0 && not_nill_function_1.notNill(answer.publicationCode));
|
|
163
161
|
if (!shouldHide) {
|
|
164
162
|
answers.push(answer);
|
|
165
163
|
}
|
|
166
164
|
}
|
|
167
165
|
const rawQuestion = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data[0] : null;
|
|
168
|
-
const question = rawQuestion ?
|
|
166
|
+
const question = rawQuestion ? this.boFactory.makeWithRawBackendData(question_1.Question, rawQuestion) : null;
|
|
169
167
|
const grouped = question && question.grouped;
|
|
170
168
|
if (this.handleQuestion !== void 0) {
|
|
171
169
|
this.handleQuestion(question);
|
|
@@ -176,7 +174,7 @@ class Connector {
|
|
|
176
174
|
if (answers.length === 0) {
|
|
177
175
|
this.getSelections();
|
|
178
176
|
}
|
|
179
|
-
if ((rawQuestion
|
|
177
|
+
if (is_nill_function_1.isNill(rawQuestion) && this.handleDeliveryPrognosis !== void 0) {
|
|
180
178
|
this.connection.getDeliveryPrognosis(this.goodId, this.branch).then((data) => {
|
|
181
179
|
const deliveryDate = new Date(data.returnValue);
|
|
182
180
|
const deliveryDateDescription = this.getDeliveryDateDescription(deliveryDate);
|
|
@@ -186,8 +184,38 @@ class Connector {
|
|
|
186
184
|
}
|
|
187
185
|
});
|
|
188
186
|
}
|
|
189
|
-
|
|
190
|
-
return this
|
|
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
|
+
}
|
|
208
|
+
}
|
|
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
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
getSkipButtonImageAndText(goodId) {
|
|
218
|
+
return this.connection.getSkipButtonImageAndText(goodId);
|
|
191
219
|
}
|
|
192
220
|
getDeliveryPrognosisForArticle(goodId) {
|
|
193
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -269,6 +297,32 @@ class Connector {
|
|
|
269
297
|
});
|
|
270
298
|
}
|
|
271
299
|
}
|
|
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
|
+
});
|
|
312
|
+
}
|
|
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
|
+
});
|
|
325
|
+
}
|
|
272
326
|
selectAnswer(answer, userInput) {
|
|
273
327
|
return __awaiter(this, void 0, void 0, function* () {
|
|
274
328
|
if (!answer) {
|
|
@@ -278,9 +332,9 @@ class Connector {
|
|
|
278
332
|
yield this.connection.changeInstance(answer.instanceId);
|
|
279
333
|
}
|
|
280
334
|
const params = {};
|
|
281
|
-
if (answer.treeHierarchy !== null) {
|
|
335
|
+
if (answer.treeHierarchy !== null && answer.treeHierarchy !== undefined) {
|
|
282
336
|
params.treeHierarchie = answer.treeHierarchy;
|
|
283
|
-
this.
|
|
337
|
+
return this._navigateTo(params);
|
|
284
338
|
}
|
|
285
339
|
else {
|
|
286
340
|
this.stepBackNode = this.use3D ? -1 : answer.node.node;
|
|
@@ -292,11 +346,11 @@ class Connector {
|
|
|
292
346
|
}
|
|
293
347
|
if (this.combNode || answer.useNextCombNode) {
|
|
294
348
|
params.nodeId = answer.node.node ? answer.node.node : answer.node;
|
|
295
|
-
this.
|
|
349
|
+
return this._nextCombNode(params);
|
|
296
350
|
}
|
|
297
351
|
else {
|
|
298
352
|
params.opvId = answer.id;
|
|
299
|
-
this.
|
|
353
|
+
return this._nextNode(params);
|
|
300
354
|
}
|
|
301
355
|
}
|
|
302
356
|
});
|
|
@@ -309,11 +363,8 @@ class Connector {
|
|
|
309
363
|
const params = {
|
|
310
364
|
nodeId: selection.node
|
|
311
365
|
};
|
|
312
|
-
this.connection.back2Node(params)
|
|
313
|
-
|
|
314
|
-
this.getQuestionAndAnswers();
|
|
315
|
-
});
|
|
316
|
-
});
|
|
366
|
+
yield this.connection.back2Node(params);
|
|
367
|
+
return this.connection.nextNode({ opvId: 0 });
|
|
317
368
|
});
|
|
318
369
|
}
|
|
319
370
|
replaceSelection(selection) {
|
|
@@ -324,9 +375,7 @@ class Connector {
|
|
|
324
375
|
const params = {
|
|
325
376
|
nodeId: selection.node
|
|
326
377
|
};
|
|
327
|
-
this.connection.back2Node(params)
|
|
328
|
-
this.getQuestionAndAnswers();
|
|
329
|
-
});
|
|
378
|
+
return this.connection.back2Node(params);
|
|
330
379
|
});
|
|
331
380
|
}
|
|
332
381
|
selectSelection(selection, forceBackToNode, after, connector) {
|
|
@@ -352,20 +401,16 @@ class Connector {
|
|
|
352
401
|
if (!selection.optCycle || forceBackToNode) {
|
|
353
402
|
params.nodeId = selection.node;
|
|
354
403
|
params.useCombinationNodes = this.combNode ? 'T' : 'F';
|
|
355
|
-
this.connection.back2Node(params)
|
|
356
|
-
this.getQuestionAndAnswers();
|
|
357
|
-
});
|
|
404
|
+
return this.connection.back2Node(params);
|
|
358
405
|
}
|
|
359
406
|
else {
|
|
360
407
|
params.optCycle = selection.optCycle;
|
|
361
|
-
this.connection.repeatOption(params)
|
|
362
|
-
this.getQuestionAndAnswers();
|
|
363
|
-
});
|
|
408
|
+
return this.connection.repeatOption(params);
|
|
364
409
|
}
|
|
365
410
|
});
|
|
366
411
|
}
|
|
367
|
-
cancelAnswer(
|
|
368
|
-
return this.
|
|
412
|
+
cancelAnswer() {
|
|
413
|
+
return this._cancelBack2node();
|
|
369
414
|
}
|
|
370
415
|
getAnswerStock(answer) {
|
|
371
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -389,6 +434,17 @@ class Connector {
|
|
|
389
434
|
});
|
|
390
435
|
});
|
|
391
436
|
}
|
|
437
|
+
getJsonArticleFlatTree(goodId) {
|
|
438
|
+
return new Promise((resolve) => {
|
|
439
|
+
this.connection.getJsonArticleFlatTree(goodId)
|
|
440
|
+
.then((result) => {
|
|
441
|
+
resolve(JSON.stringify(result));
|
|
442
|
+
})
|
|
443
|
+
.catch((error) => {
|
|
444
|
+
console.error(error);
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
}
|
|
392
448
|
getJsonMatchTableArticles() {
|
|
393
449
|
return new Promise((resolve) => {
|
|
394
450
|
this.connection.getMatchTable()
|
|
@@ -482,27 +538,17 @@ class Connector {
|
|
|
482
538
|
this.handleDecoNodes(decoNodes);
|
|
483
539
|
}
|
|
484
540
|
}
|
|
485
|
-
|
|
486
|
-
this.connection.nextCombNode(params)
|
|
487
|
-
this.getQuestionAndAnswers();
|
|
488
|
-
});
|
|
541
|
+
_nextCombNode(params) {
|
|
542
|
+
return this.connection.nextCombNode(params);
|
|
489
543
|
}
|
|
490
|
-
|
|
491
|
-
this.connection.nextNode(params)
|
|
492
|
-
this.getQuestionAndAnswers();
|
|
493
|
-
});
|
|
544
|
+
_nextNode(params) {
|
|
545
|
+
return this.connection.nextNode(params);
|
|
494
546
|
}
|
|
495
|
-
|
|
496
|
-
return this.connection.cancelBack2Node({})
|
|
497
|
-
if (getQuestionAndAnswers) {
|
|
498
|
-
this.getQuestionAndAnswers();
|
|
499
|
-
}
|
|
500
|
-
});
|
|
547
|
+
_cancelBack2node() {
|
|
548
|
+
return this.connection.cancelBack2Node({});
|
|
501
549
|
}
|
|
502
|
-
|
|
503
|
-
this.connection.navigateTo(params)
|
|
504
|
-
this.getQuestionAndAnswers();
|
|
505
|
-
});
|
|
550
|
+
_navigateTo(params) {
|
|
551
|
+
return this.connection.navigateTo(params);
|
|
506
552
|
}
|
|
507
553
|
getDeliveryDateDescription(date) {
|
|
508
554
|
if (date) {
|
|
@@ -532,21 +578,19 @@ class Connector {
|
|
|
532
578
|
}
|
|
533
579
|
}
|
|
534
580
|
checkSkuOrId(skuOrId) {
|
|
535
|
-
return new Promise((resolve) => {
|
|
581
|
+
return new Promise((resolve, reject) => {
|
|
536
582
|
if (!this.useArticleIds) {
|
|
537
583
|
this.connection.getGoodIdFromArticleNr(skuOrId)
|
|
538
584
|
.then((goodId) => {
|
|
539
585
|
this.goodId = goodId;
|
|
540
|
-
|
|
541
|
-
resolve();
|
|
586
|
+
resolve(goodId);
|
|
542
587
|
})
|
|
543
588
|
.catch((error) => {
|
|
544
|
-
|
|
589
|
+
reject(error);
|
|
545
590
|
});
|
|
546
591
|
}
|
|
547
592
|
else {
|
|
548
|
-
|
|
549
|
-
resolve();
|
|
593
|
+
resolve(parseInt(skuOrId));
|
|
550
594
|
}
|
|
551
595
|
});
|
|
552
596
|
}
|
|
@@ -555,9 +599,9 @@ class Connector {
|
|
|
555
599
|
if (allSelections) {
|
|
556
600
|
this._prepareAnswersAndImages(allSelections);
|
|
557
601
|
allSelections = allSelections.filter((s) => {
|
|
558
|
-
return ((s.hierarchicalPublicationCode
|
|
559
|
-
((s.nodeType === node_type_enum_1.NodeType.Question && (((s.questionPublicationCode & 2) > 0) || s.questionPublicationCode
|
|
560
|
-
(s.nodeType === node_type_enum_1.NodeType.Answer && (((s.answerPublicationCode & 2) > 0) || s.answerPublicationCode
|
|
602
|
+
return (is_nill_function_1.isNill(s.hierarchicalPublicationCode) || ((s.hierarchicalPublicationCode & 2) > 0)) &&
|
|
603
|
+
((s.nodeType === node_type_enum_1.NodeType.Question && (((s.questionPublicationCode & 2) > 0) || is_nill_function_1.isNill(s.questionPublicationCode))) ||
|
|
604
|
+
(s.nodeType === node_type_enum_1.NodeType.Answer && (((s.answerPublicationCode & 2) > 0) || is_nill_function_1.isNill(s.answerPublicationCode))));
|
|
561
605
|
});
|
|
562
606
|
selectionsToDisplay = allSelections.filter(s => s.nodeType !== node_type_enum_1.NodeType.Article && s.presentationLevel === 1);
|
|
563
607
|
}
|
|
@@ -607,7 +651,6 @@ class Connector {
|
|
|
607
651
|
connector.branch = options.branch;
|
|
608
652
|
connector.currency = options.currencyId;
|
|
609
653
|
ajaxService.showLoader.subscribe(value => connector.showLoader.next(value));
|
|
610
|
-
ajaxService.connectionAborted.subscribe(value => connector.connectionAborted.next());
|
|
611
654
|
ajaxService.connectionResetInactivity.subscribe(value => connector.connectionResetInactivity.next());
|
|
612
655
|
return connector;
|
|
613
656
|
}
|
|
@@ -24,6 +24,7 @@ export declare enum ArticleMethod {
|
|
|
24
24
|
CheckUsedInTransaction = "checkUsedInTransaction",
|
|
25
25
|
ArticleNrExists = "articleNrExists",
|
|
26
26
|
GenerateFrozenArticle = "generateFrozenArticle",
|
|
27
|
+
GetArticleTree = "getArticleTree",
|
|
27
28
|
GetLastFrozenArticle = "getLastFrozenArticle",
|
|
28
29
|
GetLastFrozenArticleArray = "getLastFrozenArticleArray",
|
|
29
30
|
GetCompositionArticles = "getCompositionArticles",
|
|
@@ -27,6 +27,7 @@ var ArticleMethod;
|
|
|
27
27
|
ArticleMethod["CheckUsedInTransaction"] = "checkUsedInTransaction";
|
|
28
28
|
ArticleMethod["ArticleNrExists"] = "articleNrExists";
|
|
29
29
|
ArticleMethod["GenerateFrozenArticle"] = "generateFrozenArticle";
|
|
30
|
+
ArticleMethod["GetArticleTree"] = "getArticleTree";
|
|
30
31
|
ArticleMethod["GetLastFrozenArticle"] = "getLastFrozenArticle";
|
|
31
32
|
ArticleMethod["GetLastFrozenArticleArray"] = "getLastFrozenArticleArray";
|
|
32
33
|
ArticleMethod["GetCompositionArticles"] = "getCompositionArticles";
|
|
@@ -11,6 +11,7 @@ export declare enum HdServiceMethod {
|
|
|
11
11
|
NavigateTo = "navigateTo",
|
|
12
12
|
SelectorMatchTable = "selectorMatchTable",
|
|
13
13
|
GenerateFrozenArticle = "generateFrozenArticle",
|
|
14
|
+
GetArticleTree = "getArticleTree",
|
|
14
15
|
GetLastFrozenArticle = "getLastFrozenArticle",
|
|
15
16
|
GetSkipButtonImageAndText = "getSkipButtonImageAndText",
|
|
16
17
|
ArticleQuickSel = "articleQuickSel",
|
|
@@ -38,5 +39,6 @@ export declare enum HdServiceMethod {
|
|
|
38
39
|
GetConcepts = "getConcepts",
|
|
39
40
|
GetMaterials = "getMaterials",
|
|
40
41
|
GetAtmospheres = "getAtmospheres",
|
|
41
|
-
GetArticleGroups = "getArticleGroups"
|
|
42
|
+
GetArticleGroups = "getArticleGroups",
|
|
43
|
+
GetPublicParamValue = "getPublicParamValue"
|
|
42
44
|
}
|
|
@@ -14,6 +14,7 @@ var HdServiceMethod;
|
|
|
14
14
|
HdServiceMethod["NavigateTo"] = "navigateTo";
|
|
15
15
|
HdServiceMethod["SelectorMatchTable"] = "selectorMatchTable";
|
|
16
16
|
HdServiceMethod["GenerateFrozenArticle"] = "generateFrozenArticle";
|
|
17
|
+
HdServiceMethod["GetArticleTree"] = "getArticleTree";
|
|
17
18
|
HdServiceMethod["GetLastFrozenArticle"] = "getLastFrozenArticle";
|
|
18
19
|
HdServiceMethod["GetSkipButtonImageAndText"] = "getSkipButtonImageAndText";
|
|
19
20
|
HdServiceMethod["ArticleQuickSel"] = "articleQuickSel";
|
|
@@ -42,4 +43,5 @@ var HdServiceMethod;
|
|
|
42
43
|
HdServiceMethod["GetMaterials"] = "getMaterials";
|
|
43
44
|
HdServiceMethod["GetAtmospheres"] = "getAtmospheres";
|
|
44
45
|
HdServiceMethod["GetArticleGroups"] = "getArticleGroups";
|
|
46
|
+
HdServiceMethod["GetPublicParamValue"] = "getPublicParamValue";
|
|
45
47
|
})(HdServiceMethod = exports.HdServiceMethod || (exports.HdServiceMethod = {}));
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var InternalParam;
|
|
4
4
|
(function (InternalParam) {
|
|
5
|
-
InternalParam["GeneralAssetUrl"] = "3D_GENERAL_ASSET_URL
|
|
5
|
+
InternalParam["GeneralAssetUrl"] = "3D_GENERAL_ASSET_URL";
|
|
6
|
+
InternalParam["AssetUrl"] = "3D_ASSET_URL";
|
|
6
7
|
})(InternalParam = exports.InternalParam || (exports.InternalParam = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum ConfigurationDisplayOption {
|
|
2
|
+
Toggle = "00",
|
|
3
|
+
Button = "01",
|
|
4
|
+
ListOfValues = "02",
|
|
5
|
+
Tab = "03",
|
|
6
|
+
Card = "04",
|
|
7
|
+
DropDown = "05",
|
|
8
|
+
TileSmall = "06",
|
|
9
|
+
TileLarge = "07",
|
|
10
|
+
TileRounded = "08",
|
|
11
|
+
HorizontalTiles = "09",
|
|
12
|
+
SlideOut = "10",
|
|
13
|
+
OnPage = "11"
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ConfigurationDisplayOption;
|
|
4
|
+
(function (ConfigurationDisplayOption) {
|
|
5
|
+
ConfigurationDisplayOption["Toggle"] = "00";
|
|
6
|
+
ConfigurationDisplayOption["Button"] = "01";
|
|
7
|
+
ConfigurationDisplayOption["ListOfValues"] = "02";
|
|
8
|
+
ConfigurationDisplayOption["Tab"] = "03";
|
|
9
|
+
ConfigurationDisplayOption["Card"] = "04";
|
|
10
|
+
ConfigurationDisplayOption["DropDown"] = "05";
|
|
11
|
+
ConfigurationDisplayOption["TileSmall"] = "06";
|
|
12
|
+
ConfigurationDisplayOption["TileLarge"] = "07";
|
|
13
|
+
ConfigurationDisplayOption["TileRounded"] = "08";
|
|
14
|
+
ConfigurationDisplayOption["HorizontalTiles"] = "09";
|
|
15
|
+
ConfigurationDisplayOption["SlideOut"] = "10";
|
|
16
|
+
ConfigurationDisplayOption["OnPage"] = "11";
|
|
17
|
+
})(ConfigurationDisplayOption = exports.ConfigurationDisplayOption || (exports.ConfigurationDisplayOption = {}));
|