@colijnit/catalog 255.1.8 → 255.1.10
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/bundles/colijnit-catalog.umd.js +58 -43
- package/bundles/colijnit-catalog.umd.js.map +1 -1
- package/colijnit-catalog-255.1.9.tgz +0 -0
- package/colijnit-catalog.metadata.json +1 -1
- package/esm2015/lib/catalog-version.js +3 -3
- package/esm2015/lib/component/catalog-external-source/catalog-external-source.component.js +55 -33
- package/fesm2015/colijnit-catalog.js +56 -34
- package/fesm2015/colijnit-catalog.js.map +1 -1
- package/lib/component/catalog-external-source/catalog-external-source.component.d.ts +1 -0
- package/package.json +1 -1
- package/colijnit-catalog-255.1.7.tgz +0 -0
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
function Version() {
|
|
31
31
|
this.name = "@colijnit/catalog";
|
|
32
32
|
this.description = "iOne Catalog module based on Angular 12";
|
|
33
|
-
this.symVer = "255.1.
|
|
34
|
-
this.publishDate = "
|
|
33
|
+
this.symVer = "255.1.10";
|
|
34
|
+
this.publishDate = "20-9-2024 11:08:40";
|
|
35
35
|
}
|
|
36
36
|
return Version;
|
|
37
37
|
}());
|
|
@@ -5867,58 +5867,73 @@
|
|
|
5867
5867
|
};
|
|
5868
5868
|
CatalogExternalSourceComponent.prototype.fetchAndCombineThreeDimerseData = function (hash) {
|
|
5869
5869
|
return __awaiter(this, void 0, void 0, function () {
|
|
5870
|
-
var customerName, configurationUrl, priceDataUrl,
|
|
5870
|
+
var customerName, configurationUrl, priceDataUrl, configurationData_1, priceData_1;
|
|
5871
|
+
var _this = this;
|
|
5871
5872
|
return __generator(this, function (_a) {
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
case 2:
|
|
5887
|
-
apiResponses = _a.sent();
|
|
5888
|
-
configurationResponse = apiResponses[0];
|
|
5889
|
-
priceDataResponse = apiResponses[1];
|
|
5890
|
-
if (configurationResponse && configurationResponse.ok) {
|
|
5891
|
-
configurationResponse.json().then(function (result) {
|
|
5892
|
-
console.log(result);
|
|
5873
|
+
customerName = this._externalSource.username;
|
|
5874
|
+
configurationUrl = this._externalSource.domain + '/configurationData/' + hash;
|
|
5875
|
+
priceDataUrl = this._externalSource.domain + '/rules/api/' + customerName.toLowerCase() + '/' + hash;
|
|
5876
|
+
//test setup for local testing
|
|
5877
|
+
//const configurationUrl: string = "https://bertplantagie.platformapi-accept.3dimerce.com/configurationData/8eb5b35697c96716d3e253294344d98e4dcdcb68969c288189d45829164e3177";
|
|
5878
|
+
//console.log(configurationUrl);
|
|
5879
|
+
//const priceDataUrl: string = "https://bertplantagie.platformapi-accept.3dimerce.com/rules/api/bertplantagie/8eb5b35697c96716d3e253294344d98e4dcdcb68969c288189d45829164e3177";
|
|
5880
|
+
//console.log(priceDataUrl);
|
|
5881
|
+
try {
|
|
5882
|
+
//first fetch the configuration data
|
|
5883
|
+
this.fetchJsonFile(configurationUrl).then(function (configResponse) {
|
|
5884
|
+
if (configResponse && configResponse.ok) {
|
|
5885
|
+
configResponse.json().then(function (result) {
|
|
5886
|
+
//console.log(result);
|
|
5893
5887
|
configurationData_1 = result;
|
|
5888
|
+
//if we have config data continue to fetch price data
|
|
5889
|
+
_this.fetchJsonFile(priceDataUrl).then(function (priceResponse) {
|
|
5890
|
+
if (priceResponse && priceResponse.ok) {
|
|
5891
|
+
priceResponse.json().then(function (result) {
|
|
5892
|
+
//console.log(result);
|
|
5893
|
+
priceData_1 = result;
|
|
5894
|
+
//If we have config and price data. Create the necessary data object and pass it along.
|
|
5895
|
+
_this.create3DimerseFeedback(configurationData_1, priceData_1);
|
|
5896
|
+
}).catch(function (e) {
|
|
5897
|
+
//If there is no price data, make that object null and pass data along
|
|
5898
|
+
_this.create3DimerseFeedback(configurationData_1, null);
|
|
5899
|
+
console.log(e);
|
|
5900
|
+
});
|
|
5901
|
+
}
|
|
5902
|
+
else {
|
|
5903
|
+
//If there is no valid price data, make that object null and pass data along
|
|
5904
|
+
_this.create3DimerseFeedback(configurationData_1, null);
|
|
5905
|
+
}
|
|
5906
|
+
}).catch(function (e) {
|
|
5907
|
+
//If we cannot fetch price data
|
|
5908
|
+
_this.create3DimerseFeedback(configurationData_1, null);
|
|
5909
|
+
console.log(e);
|
|
5910
|
+
});
|
|
5894
5911
|
}).catch(function (e) {
|
|
5912
|
+
//If there is an error fetching config data do not continue. just log the error.
|
|
5895
5913
|
console.log(e);
|
|
5896
5914
|
configurationData_1 = {};
|
|
5897
5915
|
});
|
|
5898
5916
|
}
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
console.log(e);
|
|
5905
|
-
priceData_1 = {};
|
|
5906
|
-
});
|
|
5907
|
-
}
|
|
5908
|
-
resultObject = {};
|
|
5909
|
-
resultObject['configuratie-data'] = configurationData_1;
|
|
5910
|
-
resultObject['prijs-data'] = priceData_1;
|
|
5911
|
-
this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
|
|
5912
|
-
return [3 /*break*/, 4];
|
|
5913
|
-
case 3:
|
|
5914
|
-
error_1 = _a.sent();
|
|
5915
|
-
console.error('Error fetching data:', error_1);
|
|
5916
|
-
return [3 /*break*/, 4];
|
|
5917
|
-
case 4: return [2 /*return*/];
|
|
5917
|
+
}).catch(function (e) {
|
|
5918
|
+
//If there is an error fetching config dat. just log the error.
|
|
5919
|
+
console.log(e);
|
|
5920
|
+
configurationData_1 = {};
|
|
5921
|
+
});
|
|
5918
5922
|
}
|
|
5923
|
+
catch (error) {
|
|
5924
|
+
console.error('Error fetching data:', error);
|
|
5925
|
+
}
|
|
5926
|
+
return [2 /*return*/];
|
|
5919
5927
|
});
|
|
5920
5928
|
});
|
|
5921
5929
|
};
|
|
5930
|
+
CatalogExternalSourceComponent.prototype.create3DimerseFeedback = function (configurationData, priceData) {
|
|
5931
|
+
var resultObject = {};
|
|
5932
|
+
resultObject['configuratie-data'] = configurationData;
|
|
5933
|
+
resultObject['prijs-data'] = priceData;
|
|
5934
|
+
console.log(resultObject);
|
|
5935
|
+
this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
|
|
5936
|
+
};
|
|
5922
5937
|
CatalogExternalSourceComponent.prototype.fetchJsonFile = function (url) {
|
|
5923
5938
|
return __awaiter(this, void 0, void 0, function () {
|
|
5924
5939
|
return __generator(this, function (_a) {
|