@colijnit/ioneconnector 1.0.125 → 1.0.129
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 +3 -3
- package/build/connector-auth.js +9 -6
- package/build/connector-public.d.ts +3 -3
- package/build/connector-public.js +20 -7
- package/build/connector.d.ts +17 -14
- package/build/connector.js +102 -76
- package/build/enum/hd-service-method.d.ts +2 -1
- package/build/enum/hd-service-method.js +1 -0
- package/build/enum/internal-param.enum.d.ts +1 -1
- package/build/enum/internal-param.enum.js +1 -1
- package/build/ione-api-connection.d.ts +3 -3
- package/build/model/configurator-statistics-environment.d.ts +8 -0
- package/build/model/configurator-statistics-environment.js +5 -0
- 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 +1 -0
- package/build/model/selection.js +1 -0
- 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 +2 -2
- package/build/provider/data-repository.service.js +122 -30
- package/build/provider/hd-ajax.service.d.ts +0 -1
- package/build/provider/hd-ajax.service.js +2 -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 +148 -32
- 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 +7 -1
- package/package.json +10 -17
|
@@ -27,9 +27,9 @@ import { Concept } from "./model/concept";
|
|
|
27
27
|
import { ArticleGroup } from "./model/article-group";
|
|
28
28
|
import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
29
29
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
30
|
+
import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
|
|
30
31
|
export declare class ConnectorAuth implements IoneApiConnection {
|
|
31
32
|
readonly showLoader: Subject<boolean>;
|
|
32
|
-
readonly connectionAborted: Subject<void>;
|
|
33
33
|
readonly connectionResetInactivity: Subject<void>;
|
|
34
34
|
private readonly useWebsocket;
|
|
35
35
|
private readonly url;
|
|
@@ -44,7 +44,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
|
|
|
44
44
|
session: Session;
|
|
45
45
|
constructor(options?: Options, externalStorage?: ExternalStorage);
|
|
46
46
|
saveConfigurations(): Promise<boolean>;
|
|
47
|
-
setInstanceToConfigure(instanceId: string): Promise<DataServiceResponseRoot>;
|
|
47
|
+
setInstanceToConfigure(instanceId: string, changeInstance?: boolean): Promise<DataServiceResponseRoot>;
|
|
48
48
|
initNodeInstance(goodId: number): Promise<any>;
|
|
49
49
|
copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
|
|
50
50
|
getArticleQuickSel(goodId: number): Promise<Article>;
|
|
@@ -69,7 +69,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
|
|
|
69
69
|
navigateTo(params: any): Promise<DataServiceResponseRoot>;
|
|
70
70
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
71
71
|
getMatchTable(): Promise<any>;
|
|
72
|
-
getFrozenArticle(): Promise<any>;
|
|
72
|
+
getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
|
|
73
73
|
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
74
74
|
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
75
75
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|
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() {
|
|
@@ -42,11 +40,16 @@ class ConnectorAuth {
|
|
|
42
40
|
return result.data.validationResult.success;
|
|
43
41
|
});
|
|
44
42
|
}
|
|
45
|
-
setInstanceToConfigure(instanceId) {
|
|
43
|
+
setInstanceToConfigure(instanceId, changeInstance = true) {
|
|
46
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
45
|
if (this.currentInstanceId !== instanceId) {
|
|
48
46
|
this.currentInstanceId = instanceId;
|
|
49
|
-
|
|
47
|
+
if (changeInstance) {
|
|
48
|
+
return yield this.dataRepository.changeInstance(instanceId);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
});
|
|
52
55
|
}
|
|
@@ -122,8 +125,8 @@ class ConnectorAuth {
|
|
|
122
125
|
getMatchTable() {
|
|
123
126
|
return this.dataRepository.getMatchTable();
|
|
124
127
|
}
|
|
125
|
-
getFrozenArticle() {
|
|
126
|
-
return this.dataRepository.getFrozenArticle();
|
|
128
|
+
getFrozenArticle(configuratorStatistics) {
|
|
129
|
+
return this.dataRepository.getFrozenArticle(configuratorStatistics);
|
|
127
130
|
}
|
|
128
131
|
getJsonArticleFlatTree(goodId) {
|
|
129
132
|
return this.dataRepository.getJsonArticleFlatTree(goodId);
|
|
@@ -25,9 +25,9 @@ import { Concept } from "./model/concept";
|
|
|
25
25
|
import { ArticleGroup } from "./model/article-group";
|
|
26
26
|
import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
27
27
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
28
|
+
import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
|
|
28
29
|
export declare class ConnectorPublic implements IoneApiConnection {
|
|
29
30
|
readonly showLoader: Subject<boolean>;
|
|
30
|
-
readonly connectionAborted: Subject<void>;
|
|
31
31
|
readonly connectionResetInactivity: Subject<void>;
|
|
32
32
|
private readonly dataService;
|
|
33
33
|
private _schema;
|
|
@@ -39,7 +39,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
|
|
|
39
39
|
set currency(value: number);
|
|
40
40
|
constructor(dataService: HdDataService);
|
|
41
41
|
saveConfigurations(): Promise<boolean>;
|
|
42
|
-
setInstanceToConfigure(instanceId: string): Promise<DataServiceResponseRoot>;
|
|
42
|
+
setInstanceToConfigure(instanceId: string, changeInstance?: boolean): Promise<DataServiceResponseRoot>;
|
|
43
43
|
initNodeInstance(goodId: number): Promise<any>;
|
|
44
44
|
copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
|
|
45
45
|
getArticleQuickSel(goodId: number): Promise<Article>;
|
|
@@ -64,7 +64,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
|
|
|
64
64
|
navigateTo(params: any): Promise<DataServiceResponseRoot>;
|
|
65
65
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
66
66
|
getMatchTable(): Promise<any>;
|
|
67
|
-
getFrozenArticle(): Promise<any>;
|
|
67
|
+
getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
|
|
68
68
|
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
69
69
|
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
70
70
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|
|
@@ -1,4 +1,13 @@
|
|
|
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
const rxjs_1 = require("rxjs");
|
|
4
13
|
const data_service_response_data_1 = require("./model/data-service-response-data");
|
|
@@ -6,7 +15,6 @@ const validation_result_1 = require("./model/validation-result");
|
|
|
6
15
|
class ConnectorPublic {
|
|
7
16
|
constructor(dataService) {
|
|
8
17
|
this.showLoader = new rxjs_1.Subject();
|
|
9
|
-
this.connectionAborted = new rxjs_1.Subject();
|
|
10
18
|
this.connectionResetInactivity = new rxjs_1.Subject();
|
|
11
19
|
this.dataService = dataService;
|
|
12
20
|
}
|
|
@@ -22,7 +30,7 @@ class ConnectorPublic {
|
|
|
22
30
|
saveConfigurations() {
|
|
23
31
|
return new Promise((resolve) => { resolve(true); });
|
|
24
32
|
}
|
|
25
|
-
setInstanceToConfigure(instanceId) {
|
|
33
|
+
setInstanceToConfigure(instanceId, changeInstance = true) {
|
|
26
34
|
this.dataService.instanceId = instanceId;
|
|
27
35
|
let validationResult = new validation_result_1.ValidationResult();
|
|
28
36
|
validationResult.success = true;
|
|
@@ -34,7 +42,13 @@ class ConnectorPublic {
|
|
|
34
42
|
return Promise.resolve(responseRoot);
|
|
35
43
|
}
|
|
36
44
|
initNodeInstance(goodId) {
|
|
37
|
-
return this
|
|
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
|
+
});
|
|
38
52
|
}
|
|
39
53
|
copyInstance(instanceId, shouldSaveCurrentInstanceId) {
|
|
40
54
|
return this.dataService.copyInstance(instanceId);
|
|
@@ -106,8 +120,8 @@ class ConnectorPublic {
|
|
|
106
120
|
getMatchTable() {
|
|
107
121
|
return this.dataService.getMatchTable();
|
|
108
122
|
}
|
|
109
|
-
getFrozenArticle() {
|
|
110
|
-
return this.dataService.getFrozenArticle();
|
|
123
|
+
getFrozenArticle(configuratorStatistics) {
|
|
124
|
+
return this.dataService.getFrozenArticle(configuratorStatistics);
|
|
111
125
|
}
|
|
112
126
|
getJsonArticleFlatTree(goodId) {
|
|
113
127
|
return this.dataService.getJsonArticleFlatTree(goodId);
|
|
@@ -168,8 +182,7 @@ class ConnectorPublic {
|
|
|
168
182
|
return this.dataService.closeSession();
|
|
169
183
|
}
|
|
170
184
|
getInternalParameter(parameter) {
|
|
171
|
-
|
|
172
|
-
return null;
|
|
185
|
+
return this.dataService.getInternalParameter(parameter);
|
|
173
186
|
}
|
|
174
187
|
}
|
|
175
188
|
exports.ConnectorPublic = ConnectorPublic;
|
package/build/connector.d.ts
CHANGED
|
@@ -36,9 +36,10 @@ 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";
|
|
40
|
+
import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
|
|
39
41
|
export declare class Connector {
|
|
40
42
|
goodId: number;
|
|
41
|
-
sku: string;
|
|
42
43
|
useWebsocket: boolean;
|
|
43
44
|
url: string;
|
|
44
45
|
version: string;
|
|
@@ -71,11 +72,10 @@ export declare class Connector {
|
|
|
71
72
|
private boFactory;
|
|
72
73
|
private connection;
|
|
73
74
|
readonly showLoader: Subject<boolean>;
|
|
74
|
-
readonly connectionAborted: Subject<void>;
|
|
75
75
|
readonly connectionResetInactivity: Subject<void>;
|
|
76
76
|
constructor(options?: Options, externalStorage?: ExternalStorage);
|
|
77
77
|
saveConfigurations(): Promise<boolean>;
|
|
78
|
-
setInstanceToConfigure(id: string): Promise<DataServiceResponseRoot>;
|
|
78
|
+
setInstanceToConfigure(id: string, changeInstance?: boolean): Promise<DataServiceResponseRoot>;
|
|
79
79
|
copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
|
|
80
80
|
getArticle(skuOrId: string): Promise<Article>;
|
|
81
81
|
initNodeInstance(skuOrId: string): Promise<any>;
|
|
@@ -83,6 +83,7 @@ export declare class Connector {
|
|
|
83
83
|
getSuperArticle(id: string): Promise<SuperArticle>;
|
|
84
84
|
getFullArticle(skuOrId: string): Promise<ArticleFullObject>;
|
|
85
85
|
getQuestionAndAnswers(): void;
|
|
86
|
+
getQuestionAndAnswersAsync(): Promise<QuestionAndAnswer>;
|
|
86
87
|
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
87
88
|
getDeliveryPrognosisForArticle(goodId: number): Promise<{}>;
|
|
88
89
|
getAnswersPrices(): Promise<AnswerPrice[]>;
|
|
@@ -92,13 +93,15 @@ export declare class Connector {
|
|
|
92
93
|
getImageForAnswerOrSelection(answerOrSelection: Answer | Selection, publication?: number, thumbNail?: boolean, showLoader?: boolean): Promise<string>;
|
|
93
94
|
getMoodImageForAnswerSelection(answerOrSelection: Answer | Selection, thumbNail?: boolean, showLoader?: boolean): void;
|
|
94
95
|
getSelections(): void;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
getSelectionsAsync(): Promise<Selection[]>;
|
|
97
|
+
getDecosAsync(): Promise<DecoNode[]>;
|
|
98
|
+
selectAnswer(answer: Answer, userInput?: string): Promise<DataServiceResponseRoot>;
|
|
99
|
+
deleteSelection(selection: Selection): Promise<DataServiceResponseRoot>;
|
|
100
|
+
replaceSelection(selection: Selection): Promise<DataServiceResponseRoot>;
|
|
101
|
+
selectSelection(selection: Selection, forceBackToNode?: boolean, after?: boolean, connector?: string): Promise<DataServiceResponseRoot>;
|
|
102
|
+
cancelAnswer(): Promise<DataServiceResponseRoot>;
|
|
100
103
|
getAnswerStock(answer: Answer): Promise<StockStatus>;
|
|
101
|
-
getJsonConfiguredArticles(): Promise<any>;
|
|
104
|
+
getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
|
|
102
105
|
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
103
106
|
getJsonMatchTableArticles(): Promise<any>;
|
|
104
107
|
getInternalParameter(parameter: InternalParam): Promise<string>;
|
|
@@ -120,12 +123,12 @@ export declare class Connector {
|
|
|
120
123
|
getArticleGroups(): Promise<ArticleGroup[]>;
|
|
121
124
|
handleSelectionsReceived(data: any): void;
|
|
122
125
|
handleDecoNodesReceived(data: any): void;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
private _nextCombNode;
|
|
127
|
+
private _nextNode;
|
|
128
|
+
private _cancelBack2node;
|
|
129
|
+
private _navigateTo;
|
|
127
130
|
getDeliveryDateDescription(date: Date): string;
|
|
128
|
-
checkSkuOrId(skuOrId: string): Promise<
|
|
131
|
+
checkSkuOrId(skuOrId: string): Promise<number>;
|
|
129
132
|
getSelectionsToDisplay(allSelections: Selection[]): Selection[];
|
|
130
133
|
getMappedMatchTable(data: any): MatchArticle[];
|
|
131
134
|
getMappedFrozenArticle(data: any): FrozenArticle;
|
package/build/connector.js
CHANGED
|
@@ -33,6 +33,7 @@ const frozen_article_simple_1 = require("./model/frozen-article-simple");
|
|
|
33
33
|
const db_boolean_value_type_enum_1 = require("./enum/db-boolean-value-type.enum");
|
|
34
34
|
const not_nill_function_1 = require("./utils/function/not-nill.function");
|
|
35
35
|
const is_nill_function_1 = require("./utils/function/is-nill.function");
|
|
36
|
+
const question_and_answer_1 = require("./model/question-and-answer");
|
|
36
37
|
class Connector {
|
|
37
38
|
constructor(options, externalStorage = undefined) {
|
|
38
39
|
this.useWebsocket = false;
|
|
@@ -49,7 +50,6 @@ class Connector {
|
|
|
49
50
|
this.subs = [];
|
|
50
51
|
this.boFactory = new business_object_factory_1.BusinessObjectFactory();
|
|
51
52
|
this.showLoader = new rxjs_1.Subject();
|
|
52
|
-
this.connectionAborted = new rxjs_1.Subject();
|
|
53
53
|
this.connectionResetInactivity = new rxjs_1.Subject();
|
|
54
54
|
this._applicationClose = () => {
|
|
55
55
|
this.connection.close();
|
|
@@ -87,43 +87,37 @@ class Connector {
|
|
|
87
87
|
if (!this.session && this.connection.hasOwnProperty('session')) {
|
|
88
88
|
this.session = this.connection['session'];
|
|
89
89
|
}
|
|
90
|
-
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()));
|
|
91
91
|
window.addEventListener('beforeunload', this._applicationClose);
|
|
92
92
|
}
|
|
93
93
|
saveConfigurations() {
|
|
94
94
|
return this.connection.saveConfigurations();
|
|
95
95
|
}
|
|
96
|
-
setInstanceToConfigure(id) {
|
|
97
|
-
return this.connection.setInstanceToConfigure(id);
|
|
96
|
+
setInstanceToConfigure(id, changeInstance = true) {
|
|
97
|
+
return this.connection.setInstanceToConfigure(id, changeInstance);
|
|
98
98
|
}
|
|
99
99
|
copyInstance(instanceId, shouldSaveCurrentInstanceId) {
|
|
100
100
|
return this.connection.copyInstance(instanceId, shouldSaveCurrentInstanceId);
|
|
101
101
|
}
|
|
102
102
|
getArticle(skuOrId) {
|
|
103
|
-
return this
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (response && response.data && response.data.resultObject) {
|
|
108
|
-
yield this.setInstanceToConfigure(response.data.resultObject);
|
|
109
|
-
article.sku = this.sku;
|
|
110
|
-
article.instanceId = response.data.resultObject;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
console.error("Error retrieving instance id");
|
|
114
|
-
}
|
|
115
|
-
if (this.handleArticle !== void 0) {
|
|
116
|
-
this.handleArticle(article);
|
|
117
|
-
}
|
|
118
|
-
resolve(article);
|
|
119
|
-
}));
|
|
120
|
-
});
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
const goodId = yield this.checkSkuOrId(skuOrId)
|
|
105
|
+
.catch((e) => {
|
|
106
|
+
return Promise.reject(e);
|
|
121
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;
|
|
122
114
|
});
|
|
123
115
|
}
|
|
124
116
|
initNodeInstance(skuOrId) {
|
|
125
|
-
return this
|
|
126
|
-
|
|
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);
|
|
127
121
|
});
|
|
128
122
|
}
|
|
129
123
|
getArticleQuickSel(id) {
|
|
@@ -133,12 +127,10 @@ class Connector {
|
|
|
133
127
|
return this.connection.getSuperArticleQuickSel(id);
|
|
134
128
|
}
|
|
135
129
|
getFullArticle(skuOrId) {
|
|
136
|
-
return this
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}));
|
|
141
|
-
});
|
|
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);
|
|
142
134
|
});
|
|
143
135
|
}
|
|
144
136
|
getQuestionAndAnswers() {
|
|
@@ -192,6 +184,36 @@ class Connector {
|
|
|
192
184
|
}
|
|
193
185
|
});
|
|
194
186
|
}
|
|
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
|
+
}
|
|
195
217
|
getSkipButtonImageAndText(goodId) {
|
|
196
218
|
return this.connection.getSkipButtonImageAndText(goodId);
|
|
197
219
|
}
|
|
@@ -275,6 +297,32 @@ class Connector {
|
|
|
275
297
|
});
|
|
276
298
|
}
|
|
277
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
|
+
}
|
|
278
326
|
selectAnswer(answer, userInput) {
|
|
279
327
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
328
|
if (!answer) {
|
|
@@ -286,7 +334,7 @@ class Connector {
|
|
|
286
334
|
const params = {};
|
|
287
335
|
if (answer.treeHierarchy !== null && answer.treeHierarchy !== undefined) {
|
|
288
336
|
params.treeHierarchie = answer.treeHierarchy;
|
|
289
|
-
this.
|
|
337
|
+
return this._navigateTo(params);
|
|
290
338
|
}
|
|
291
339
|
else {
|
|
292
340
|
this.stepBackNode = this.use3D ? -1 : answer.node.node;
|
|
@@ -298,11 +346,11 @@ class Connector {
|
|
|
298
346
|
}
|
|
299
347
|
if (this.combNode || answer.useNextCombNode) {
|
|
300
348
|
params.nodeId = answer.node.node ? answer.node.node : answer.node;
|
|
301
|
-
this.
|
|
349
|
+
return this._nextCombNode(params);
|
|
302
350
|
}
|
|
303
351
|
else {
|
|
304
352
|
params.opvId = answer.id;
|
|
305
|
-
this.
|
|
353
|
+
return this._nextNode(params);
|
|
306
354
|
}
|
|
307
355
|
}
|
|
308
356
|
});
|
|
@@ -315,11 +363,8 @@ class Connector {
|
|
|
315
363
|
const params = {
|
|
316
364
|
nodeId: selection.node
|
|
317
365
|
};
|
|
318
|
-
this.connection.back2Node(params)
|
|
319
|
-
|
|
320
|
-
this.getQuestionAndAnswers();
|
|
321
|
-
});
|
|
322
|
-
});
|
|
366
|
+
yield this.connection.back2Node(params);
|
|
367
|
+
return this.connection.nextNode({ opvId: 0 });
|
|
323
368
|
});
|
|
324
369
|
}
|
|
325
370
|
replaceSelection(selection) {
|
|
@@ -330,9 +375,7 @@ class Connector {
|
|
|
330
375
|
const params = {
|
|
331
376
|
nodeId: selection.node
|
|
332
377
|
};
|
|
333
|
-
this.connection.back2Node(params)
|
|
334
|
-
this.getQuestionAndAnswers();
|
|
335
|
-
});
|
|
378
|
+
return this.connection.back2Node(params);
|
|
336
379
|
});
|
|
337
380
|
}
|
|
338
381
|
selectSelection(selection, forceBackToNode, after, connector) {
|
|
@@ -358,20 +401,16 @@ class Connector {
|
|
|
358
401
|
if (!selection.optCycle || forceBackToNode) {
|
|
359
402
|
params.nodeId = selection.node;
|
|
360
403
|
params.useCombinationNodes = this.combNode ? 'T' : 'F';
|
|
361
|
-
this.connection.back2Node(params)
|
|
362
|
-
this.getQuestionAndAnswers();
|
|
363
|
-
});
|
|
404
|
+
return this.connection.back2Node(params);
|
|
364
405
|
}
|
|
365
406
|
else {
|
|
366
407
|
params.optCycle = selection.optCycle;
|
|
367
|
-
this.connection.repeatOption(params)
|
|
368
|
-
this.getQuestionAndAnswers();
|
|
369
|
-
});
|
|
408
|
+
return this.connection.repeatOption(params);
|
|
370
409
|
}
|
|
371
410
|
});
|
|
372
411
|
}
|
|
373
|
-
cancelAnswer(
|
|
374
|
-
return this.
|
|
412
|
+
cancelAnswer() {
|
|
413
|
+
return this._cancelBack2node();
|
|
375
414
|
}
|
|
376
415
|
getAnswerStock(answer) {
|
|
377
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -384,9 +423,9 @@ class Connector {
|
|
|
384
423
|
}
|
|
385
424
|
});
|
|
386
425
|
}
|
|
387
|
-
getJsonConfiguredArticles() {
|
|
426
|
+
getJsonConfiguredArticles(configuratorStatistics) {
|
|
388
427
|
return new Promise((resolve) => {
|
|
389
|
-
this.connection.getFrozenArticle()
|
|
428
|
+
this.connection.getFrozenArticle(configuratorStatistics)
|
|
390
429
|
.then((result) => {
|
|
391
430
|
resolve(JSON.stringify(this.getMappedFrozenArticle(result)));
|
|
392
431
|
})
|
|
@@ -499,27 +538,17 @@ class Connector {
|
|
|
499
538
|
this.handleDecoNodes(decoNodes);
|
|
500
539
|
}
|
|
501
540
|
}
|
|
502
|
-
|
|
503
|
-
this.connection.nextCombNode(params)
|
|
504
|
-
this.getQuestionAndAnswers();
|
|
505
|
-
});
|
|
541
|
+
_nextCombNode(params) {
|
|
542
|
+
return this.connection.nextCombNode(params);
|
|
506
543
|
}
|
|
507
|
-
|
|
508
|
-
this.connection.nextNode(params)
|
|
509
|
-
this.getQuestionAndAnswers();
|
|
510
|
-
});
|
|
544
|
+
_nextNode(params) {
|
|
545
|
+
return this.connection.nextNode(params);
|
|
511
546
|
}
|
|
512
|
-
|
|
513
|
-
return this.connection.cancelBack2Node({})
|
|
514
|
-
if (getQuestionAndAnswers) {
|
|
515
|
-
this.getQuestionAndAnswers();
|
|
516
|
-
}
|
|
517
|
-
});
|
|
547
|
+
_cancelBack2node() {
|
|
548
|
+
return this.connection.cancelBack2Node({});
|
|
518
549
|
}
|
|
519
|
-
|
|
520
|
-
this.connection.navigateTo(params)
|
|
521
|
-
this.getQuestionAndAnswers();
|
|
522
|
-
});
|
|
550
|
+
_navigateTo(params) {
|
|
551
|
+
return this.connection.navigateTo(params);
|
|
523
552
|
}
|
|
524
553
|
getDeliveryDateDescription(date) {
|
|
525
554
|
if (date) {
|
|
@@ -549,21 +578,19 @@ class Connector {
|
|
|
549
578
|
}
|
|
550
579
|
}
|
|
551
580
|
checkSkuOrId(skuOrId) {
|
|
552
|
-
return new Promise((resolve) => {
|
|
581
|
+
return new Promise((resolve, reject) => {
|
|
553
582
|
if (!this.useArticleIds) {
|
|
554
583
|
this.connection.getGoodIdFromArticleNr(skuOrId)
|
|
555
584
|
.then((goodId) => {
|
|
556
585
|
this.goodId = goodId;
|
|
557
|
-
|
|
558
|
-
resolve();
|
|
586
|
+
resolve(goodId);
|
|
559
587
|
})
|
|
560
588
|
.catch((error) => {
|
|
561
|
-
|
|
589
|
+
reject(error);
|
|
562
590
|
});
|
|
563
591
|
}
|
|
564
592
|
else {
|
|
565
|
-
|
|
566
|
-
resolve();
|
|
593
|
+
resolve(parseInt(skuOrId));
|
|
567
594
|
}
|
|
568
595
|
});
|
|
569
596
|
}
|
|
@@ -624,7 +651,6 @@ class Connector {
|
|
|
624
651
|
connector.branch = options.branch;
|
|
625
652
|
connector.currency = options.currencyId;
|
|
626
653
|
ajaxService.showLoader.subscribe(value => connector.showLoader.next(value));
|
|
627
|
-
ajaxService.connectionAborted.subscribe(value => connector.connectionAborted.next());
|
|
628
654
|
ajaxService.connectionResetInactivity.subscribe(value => connector.connectionResetInactivity.next());
|
|
629
655
|
return connector;
|
|
630
656
|
}
|
|
@@ -39,5 +39,6 @@ export declare enum HdServiceMethod {
|
|
|
39
39
|
GetConcepts = "getConcepts",
|
|
40
40
|
GetMaterials = "getMaterials",
|
|
41
41
|
GetAtmospheres = "getAtmospheres",
|
|
42
|
-
GetArticleGroups = "getArticleGroups"
|
|
42
|
+
GetArticleGroups = "getArticleGroups",
|
|
43
|
+
GetPublicParamValue = "getPublicParamValue"
|
|
43
44
|
}
|
|
@@ -43,4 +43,5 @@ var HdServiceMethod;
|
|
|
43
43
|
HdServiceMethod["GetMaterials"] = "getMaterials";
|
|
44
44
|
HdServiceMethod["GetAtmospheres"] = "getAtmospheres";
|
|
45
45
|
HdServiceMethod["GetArticleGroups"] = "getArticleGroups";
|
|
46
|
+
HdServiceMethod["GetPublicParamValue"] = "getPublicParamValue";
|
|
46
47
|
})(HdServiceMethod = exports.HdServiceMethod || (exports.HdServiceMethod = {}));
|
|
@@ -2,6 +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
6
|
InternalParam["AssetUrl"] = "3D_ASSET_URL";
|
|
7
7
|
})(InternalParam = exports.InternalParam || (exports.InternalParam = {}));
|
|
@@ -23,13 +23,13 @@ import { Concept } from "./model/concept";
|
|
|
23
23
|
import { ArticleGroup } from "./model/article-group";
|
|
24
24
|
import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
25
25
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
26
|
+
import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
|
|
26
27
|
export interface IoneApiConnection {
|
|
27
28
|
showLoader: Subject<boolean>;
|
|
28
|
-
connectionAborted: Subject<void>;
|
|
29
29
|
connectionResetInactivity: Subject<void>;
|
|
30
30
|
currentInstanceId: string;
|
|
31
31
|
saveConfigurations(): Promise<boolean>;
|
|
32
|
-
setInstanceToConfigure(instanceId: string): Promise<DataServiceResponseRoot>;
|
|
32
|
+
setInstanceToConfigure(instanceId: string, changeInstance: boolean): Promise<DataServiceResponseRoot>;
|
|
33
33
|
initNodeInstance(goodId: number): Promise<any>;
|
|
34
34
|
copyInstance(instanceId: string, shouldSaveCurrentInstanceId: boolean): Promise<DataServiceResponseRoot>;
|
|
35
35
|
getArticleQuickSel(goodId: number): Promise<Article>;
|
|
@@ -55,7 +55,7 @@ export interface IoneApiConnection {
|
|
|
55
55
|
navigateTo(params: any): Promise<DataServiceResponseRoot>;
|
|
56
56
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
57
57
|
getMatchTable(): Promise<any>;
|
|
58
|
-
getFrozenArticle(): Promise<any>;
|
|
58
|
+
getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
|
|
59
59
|
getJsonArticleFlatTree(goodId: number): Promise<any>;
|
|
60
60
|
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
61
61
|
getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
|