@colijnit/ioneconnector 1.0.139 → 1.0.141
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 +3 -0
- package/build/connector-public.d.ts +1 -0
- package/build/connector-public.js +3 -0
- package/build/connector.d.ts +3 -0
- package/build/connector.js +20 -0
- package/build/connector.unit.test.js +12 -0
- package/build/enum/article-object-name.enum.d.ts +1 -0
- package/build/enum/article-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/selector-structure-price.d.ts +5 -0
- package/build/model/selector-structure-price.js +6 -0
- package/build/provider/data-repository.service.d.ts +1 -0
- package/build/provider/data-repository.service.js +11 -0
- package/build/service/hd-data.service.d.ts +1 -0
- package/build/service/hd-data.service.js +17 -2
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
|
|
|
53
53
|
getArticleFullObject(goodId: number): Promise<ArticleFullObject>;
|
|
54
54
|
getGoodIdFromArticleNr(skuOrId: string): Promise<number>;
|
|
55
55
|
getQuestionAndAnswers(): Promise<any>;
|
|
56
|
+
getSelectorStructurePrices(): Promise<any>;
|
|
56
57
|
getDeliveryPrognosis(goodId: number, branchNr: string): Promise<any>;
|
|
57
58
|
getDeliveryPrognosisForArticle(goodId: number): Promise<any>;
|
|
58
59
|
getSelectorActiveOptionValuesPrices(): Promise<any>;
|
package/build/connector-auth.js
CHANGED
|
@@ -64,6 +64,9 @@ class ConnectorAuth {
|
|
|
64
64
|
getQuestionAndAnswers() {
|
|
65
65
|
return this.dataRepository.getQuestionAndAnswers();
|
|
66
66
|
}
|
|
67
|
+
getSelectorStructurePrices() {
|
|
68
|
+
return this.dataRepository.getSelectorStructurePrices();
|
|
69
|
+
}
|
|
67
70
|
getDeliveryPrognosis(goodId, branchNr) {
|
|
68
71
|
return this.dataRepository.getDeliveryPrognosis(goodId);
|
|
69
72
|
}
|
|
@@ -48,6 +48,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
|
|
|
48
48
|
getArticleFullObject(goodId: number): Promise<ArticleFullObject>;
|
|
49
49
|
getGoodIdFromArticleNr(skuOrId: string): Promise<number>;
|
|
50
50
|
getQuestionAndAnswers(): Promise<any>;
|
|
51
|
+
getSelectorStructurePrices(): Promise<any>;
|
|
51
52
|
getDeliveryPrognosis(goodId: number, branchNr: string): Promise<any>;
|
|
52
53
|
getDeliveryPrognosisForArticle(goodId: number): Promise<any>;
|
|
53
54
|
getSelectorActiveOptionValuesPrices(): Promise<any>;
|
|
@@ -60,6 +60,9 @@ class ConnectorPublic {
|
|
|
60
60
|
getQuestionAndAnswers() {
|
|
61
61
|
return this.dataService.getSelectorActiveOptionValues();
|
|
62
62
|
}
|
|
63
|
+
getSelectorStructurePrices() {
|
|
64
|
+
return this.dataService.getSelectorStructurePrices();
|
|
65
|
+
}
|
|
63
66
|
getDeliveryPrognosis(goodId, branchNr) {
|
|
64
67
|
return this.dataService.getDeliveryPrognosis(goodId, branchNr);
|
|
65
68
|
}
|
package/build/connector.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { ArticleExtendedDto } from "./model/article-extended-dto";
|
|
|
36
36
|
import { InternalParam } from "./enum/internal-param.enum";
|
|
37
37
|
import { QuestionAndAnswer } from "./model/question-and-answer";
|
|
38
38
|
import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
|
|
39
|
+
import { SelectorStructurePrice } from "./model/selector-structure-price";
|
|
39
40
|
export declare class Connector {
|
|
40
41
|
goodId: number;
|
|
41
42
|
useWebsocket: boolean;
|
|
@@ -83,6 +84,7 @@ export declare class Connector {
|
|
|
83
84
|
getFullArticle(skuOrId: string): Promise<ArticleFullObject>;
|
|
84
85
|
getQuestionAndAnswers(): void;
|
|
85
86
|
getQuestionAndAnswersAsync(): Promise<QuestionAndAnswer>;
|
|
87
|
+
getSelectorStructurePrices(): Promise<SelectorStructurePrice[]>;
|
|
86
88
|
getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
|
|
87
89
|
getDeliveryPrognosisForArticle(goodId: number): Promise<{}>;
|
|
88
90
|
getAnswersPrices(): Promise<AnswerPrice[]>;
|
|
@@ -137,4 +139,5 @@ export declare class Connector {
|
|
|
137
139
|
private _prepareAnswersAndImages;
|
|
138
140
|
private _handleSelectionAnswers;
|
|
139
141
|
private _applicationClose;
|
|
142
|
+
private _handleSeparatePrices;
|
|
140
143
|
}
|
package/build/connector.js
CHANGED
|
@@ -193,6 +193,7 @@ class Connector {
|
|
|
193
193
|
answers.push(answer);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
this._handleSeparatePrices(answers);
|
|
196
197
|
const rawQuestion = rawDatas.data && rawDatas.data.length > 0 ? rawDatas.data[0] : null;
|
|
197
198
|
const question = rawQuestion ? this.boFactory.makeWithRawBackendData(question_1.Question, rawQuestion) : null;
|
|
198
199
|
result.question = question;
|
|
@@ -200,6 +201,18 @@ class Connector {
|
|
|
200
201
|
}
|
|
201
202
|
return result;
|
|
202
203
|
}
|
|
204
|
+
async getSelectorStructurePrices() {
|
|
205
|
+
const rawData = await this.connection.getSelectorStructurePrices();
|
|
206
|
+
if (rawData) {
|
|
207
|
+
if (rawData.data && rawData.data.resultObjects && rawData.data.resultObjects.length > 0) {
|
|
208
|
+
return rawData.data.resultObjects;
|
|
209
|
+
}
|
|
210
|
+
else if (rawData[''] && rawData[''].length > 0) {
|
|
211
|
+
return rawData[''];
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return [];
|
|
215
|
+
}
|
|
203
216
|
getSkipButtonImageAndText(goodId) {
|
|
204
217
|
return this.connection.getSkipButtonImageAndText(goodId);
|
|
205
218
|
}
|
|
@@ -645,5 +658,12 @@ class Connector {
|
|
|
645
658
|
});
|
|
646
659
|
selection.answerTree = JSON.stringify(answerTree);
|
|
647
660
|
}
|
|
661
|
+
_handleSeparatePrices(answers) {
|
|
662
|
+
this.getSelectorStructurePrices().then((results) => {
|
|
663
|
+
results.forEach((price) => {
|
|
664
|
+
answers.find((node) => node.id === price.id).price = price.salesAdditionalPrice;
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
}
|
|
648
668
|
}
|
|
649
669
|
exports.Connector = Connector;
|
|
@@ -14,6 +14,14 @@ const options = {
|
|
|
14
14
|
password: "patrick",
|
|
15
15
|
useLoginEncryption: true
|
|
16
16
|
};
|
|
17
|
+
const developRemoteOptions = {
|
|
18
|
+
url: "http://130.62.7.55:8888/ione/",
|
|
19
|
+
schema: "815",
|
|
20
|
+
version: "252",
|
|
21
|
+
username: "patrick",
|
|
22
|
+
password: "patrick",
|
|
23
|
+
useLoginEncryption: true
|
|
24
|
+
};
|
|
17
25
|
describe("Connector", () => {
|
|
18
26
|
let connector;
|
|
19
27
|
beforeEach(() => {
|
|
@@ -136,4 +144,8 @@ describe("Connector", () => {
|
|
|
136
144
|
const catalogDefinitions = await connector.getCatalogDefinitions();
|
|
137
145
|
expect(catalogDefinitions).toBeDefined();
|
|
138
146
|
});
|
|
147
|
+
it('getSelectorStructurePrices', async () => {
|
|
148
|
+
const prices = await connector.getSelectorStructurePrices();
|
|
149
|
+
expect(prices).toBeDefined();
|
|
150
|
+
});
|
|
139
151
|
});
|
|
@@ -2,6 +2,7 @@ export declare enum ArticledObjectName {
|
|
|
2
2
|
SelectorStructure = "SelectorStructure",
|
|
3
3
|
SelectorDeco = "SelectorDeco",
|
|
4
4
|
SelectorSelections = "SelectorSelections",
|
|
5
|
+
SelectorStructurePrices = "SelectorStructurePrices",
|
|
5
6
|
SelectorActiveOptionValuesPrices = "SelectorActiveOptionValuesPrices",
|
|
6
7
|
CoText = "CoText",
|
|
7
8
|
ArticleListObjectExtended = "ArticleListObjectExtended",
|
|
@@ -5,6 +5,7 @@ var ArticledObjectName;
|
|
|
5
5
|
ArticledObjectName["SelectorStructure"] = "SelectorStructure";
|
|
6
6
|
ArticledObjectName["SelectorDeco"] = "SelectorDeco";
|
|
7
7
|
ArticledObjectName["SelectorSelections"] = "SelectorSelections";
|
|
8
|
+
ArticledObjectName["SelectorStructurePrices"] = "SelectorStructurePrices";
|
|
8
9
|
ArticledObjectName["SelectorActiveOptionValuesPrices"] = "SelectorActiveOptionValuesPrices";
|
|
9
10
|
ArticledObjectName["CoText"] = "CoText";
|
|
10
11
|
ArticledObjectName["ArticleListObjectExtended"] = "ArticleListObjectExtended";
|
|
@@ -22,6 +22,7 @@ export declare enum HdServiceMethod {
|
|
|
22
22
|
SelectorActiveNodes = "selectorActiveNodes",
|
|
23
23
|
SelectorActiveNodesPr = "selectorActiveNodesPr",
|
|
24
24
|
SelectorStructure = "selectorStructure",
|
|
25
|
+
SelectorStructurePrices = "SelectorStructurePrices",
|
|
25
26
|
GetSelectorDeliveryDate = "getSelectorDeliveryDate",
|
|
26
27
|
GetDeliveryDate2 = "getDeliveryDate2",
|
|
27
28
|
GetStockForArtNode = "getStockForArtNode",
|
|
@@ -25,6 +25,7 @@ var HdServiceMethod;
|
|
|
25
25
|
HdServiceMethod["SelectorActiveNodes"] = "selectorActiveNodes";
|
|
26
26
|
HdServiceMethod["SelectorActiveNodesPr"] = "selectorActiveNodesPr";
|
|
27
27
|
HdServiceMethod["SelectorStructure"] = "selectorStructure";
|
|
28
|
+
HdServiceMethod["SelectorStructurePrices"] = "SelectorStructurePrices";
|
|
28
29
|
HdServiceMethod["GetSelectorDeliveryDate"] = "getSelectorDeliveryDate";
|
|
29
30
|
HdServiceMethod["GetDeliveryDate2"] = "getDeliveryDate2";
|
|
30
31
|
HdServiceMethod["GetStockForArtNode"] = "getStockForArtNode";
|
|
@@ -38,6 +38,7 @@ export interface IoneApiConnection {
|
|
|
38
38
|
getGoodIdFromArticleNr(skuOrId: string): Promise<number>;
|
|
39
39
|
getArticleFullObject(goodId: number): Promise<ArticleFullObject>;
|
|
40
40
|
getQuestionAndAnswers(): Promise<any>;
|
|
41
|
+
getSelectorStructurePrices(): Promise<any>;
|
|
41
42
|
getDeliveryPrognosis(goodId: number, branchNr: string): Promise<any>;
|
|
42
43
|
getDeliveryPrognosisForArticle(goodId: number): Promise<any>;
|
|
43
44
|
getSelectorActiveOptionValuesPrices(): Promise<any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const business_object_1 = require("./business-object");
|
|
4
|
+
class SelectorStructurePrice extends business_object_1.BusinessObject {
|
|
5
|
+
}
|
|
6
|
+
exports.SelectorStructurePrice = SelectorStructurePrice;
|
|
@@ -54,6 +54,7 @@ export declare class DataRepositoryService {
|
|
|
54
54
|
getCatalogDefinitions(showLoader?: boolean): Promise<any>;
|
|
55
55
|
getInternalParameter(parameter: InternalParam): Promise<string>;
|
|
56
56
|
getQuestionAndAnswers(): Promise<any>;
|
|
57
|
+
getSelectorStructurePrices(): Promise<DataServiceResponseRoot>;
|
|
57
58
|
initNode(id: any): Promise<any>;
|
|
58
59
|
initNodeInstance(id: any): Promise<any>;
|
|
59
60
|
changeConnection(oldConnection: string, newConnection: string): Promise<any>;
|
|
@@ -331,6 +331,14 @@ class DataRepositoryService {
|
|
|
331
331
|
getQuestionAndAnswers() {
|
|
332
332
|
return this.getSelectorActiveOptionValues();
|
|
333
333
|
}
|
|
334
|
+
getSelectorStructurePrices() {
|
|
335
|
+
const data = {
|
|
336
|
+
objectName: article_object_name_enum_1.ArticledObjectName.SelectorStructurePrices,
|
|
337
|
+
moduleName: module_name_enum_1.ModuleName.Articles,
|
|
338
|
+
refCursorAsArray: true
|
|
339
|
+
};
|
|
340
|
+
return this.call(data, data_service_method_enum_1.DataServiceMethod.SelectMultipleObjects);
|
|
341
|
+
}
|
|
334
342
|
initNode(id) {
|
|
335
343
|
return new Promise((resolve, reject) => {
|
|
336
344
|
const params = { goodId: id, pubicationCode: 4 };
|
|
@@ -841,6 +849,9 @@ class DataRepositoryService {
|
|
|
841
849
|
moduleName: module_name_enum_1.ModuleName.Articles,
|
|
842
850
|
refCursorAsArray: true
|
|
843
851
|
};
|
|
852
|
+
data.parameterValues = {
|
|
853
|
+
doCalculatePrices: false
|
|
854
|
+
};
|
|
844
855
|
return this.call(data, data_service_method_enum_1.DataServiceMethod.SelectMultipleObjects);
|
|
845
856
|
}
|
|
846
857
|
callSelectorSelections() {
|
|
@@ -57,6 +57,7 @@ export declare class HdDataService {
|
|
|
57
57
|
getSelectorActiveOptionValues(): Promise<any>;
|
|
58
58
|
getSelectorActiveOptionValuesPrices(): Promise<any>;
|
|
59
59
|
private getSelectorStructure;
|
|
60
|
+
getSelectorStructurePrices(): Promise<string>;
|
|
60
61
|
getDeliveryPrognosis(goodId: number, branchNr?: string): Promise<any>;
|
|
61
62
|
getDeliveryDate2(params: any, branchNr?: string): Promise<any>;
|
|
62
63
|
getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
|
|
@@ -312,7 +312,7 @@ class HdDataService {
|
|
|
312
312
|
});
|
|
313
313
|
const result = response.data;
|
|
314
314
|
if (result.validationResult && result.validationResult.success) {
|
|
315
|
-
return result;
|
|
315
|
+
return result.resultObject['activeNodesPr'];
|
|
316
316
|
}
|
|
317
317
|
else {
|
|
318
318
|
console.error("Error getting selector action prices (" + response.message + ")");
|
|
@@ -320,7 +320,7 @@ class HdDataService {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
async getSelectorStructure() {
|
|
323
|
-
const params = { instanceId: this._instanceId };
|
|
323
|
+
const params = { instanceId: this._instanceId, doCalculatePrices: false };
|
|
324
324
|
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
325
325
|
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorStructure, data)
|
|
326
326
|
.catch((e) => {
|
|
@@ -335,6 +335,21 @@ class HdDataService {
|
|
|
335
335
|
return null;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
+
async getSelectorStructurePrices() {
|
|
339
|
+
const params = { instanceId: this._instanceId };
|
|
340
|
+
const data = { ...this.createServiceRequestData(), parameterValues: params };
|
|
341
|
+
const response = await this._sessionService.call(hd_service_method_1.HdServiceMethod.SelectorStructurePrices, data)
|
|
342
|
+
.catch((e) => {
|
|
343
|
+
return Promise.reject(e);
|
|
344
|
+
});
|
|
345
|
+
const result = response.data;
|
|
346
|
+
if (result.validationResult && result.validationResult.success) {
|
|
347
|
+
return result.resultObject;
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
338
353
|
async getDeliveryPrognosis(goodId, branchNr) {
|
|
339
354
|
const params = { instanceId: this._instanceId };
|
|
340
355
|
const data = { ...this.createServiceRequestData(), parameterValues: params };
|