@builder.io/plugin-sfcc-commerce-api 0.0.14 → 0.0.17-3
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/dist/plugin.system.js +14 -5
- package/dist/plugin.system.js.map +1 -1
- package/package.json +1 -1
package/dist/plugin.system.js
CHANGED
|
@@ -146880,7 +146880,7 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
146880
146880
|
});
|
|
146881
146881
|
|
|
146882
146882
|
var name = "@builder.io/plugin-sfcc-commerce-api";
|
|
146883
|
-
var version = "0.0.
|
|
146883
|
+
var version = "0.0.17-2";
|
|
146884
146884
|
var description = "";
|
|
146885
146885
|
var keywords = [
|
|
146886
146886
|
];
|
|
@@ -147025,8 +147025,17 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147025
147025
|
}
|
|
147026
147026
|
async validateConfig() {
|
|
147027
147027
|
const response = await this.request(`validate-config`);
|
|
147028
|
-
|
|
147029
|
-
|
|
147028
|
+
const errors = Array.isArray(response?.errors) ? response.errors : [];
|
|
147029
|
+
if (errors.length > 0) {
|
|
147030
|
+
const detail = errors[0]?.title;
|
|
147031
|
+
if (detail) {
|
|
147032
|
+
console.error("[SFCommerce] Authentication failed. Salesforce error:", detail);
|
|
147033
|
+
}
|
|
147034
|
+
throw "We failed to authenticate your access to Salesforce Commerce Cloud B2C API. Please review all plugin fields and make sure they are correct.";
|
|
147035
|
+
}
|
|
147036
|
+
if (response?.message && !response.message.includes("Validated")) {
|
|
147037
|
+
console.error("[SFCommerce] Authentication failed. Salesforce error:", response.message);
|
|
147038
|
+
throw "We failed to authenticate your access to Salesforce Commerce Cloud B2C API. Please review all plugin fields and make sure they are correct.";
|
|
147030
147039
|
}
|
|
147031
147040
|
}
|
|
147032
147041
|
getProduct(id) {
|
|
@@ -147135,8 +147144,8 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147135
147144
|
}
|
|
147136
147145
|
}, async (settings) => {
|
|
147137
147146
|
const api = new Api(appState.user.apiKey, pkg.name);
|
|
147138
|
-
const einsteinId = settings.get("einsteinId");
|
|
147139
|
-
const einsteinSiteId = settings.get("einsteinSiteId");
|
|
147147
|
+
const einsteinId = settings.get("einsteinId")?.trim();
|
|
147148
|
+
const einsteinSiteId = settings.get("einsteinSiteId")?.trim();
|
|
147140
147149
|
let recommendersType = {};
|
|
147141
147150
|
if (einsteinId && einsteinSiteId) {
|
|
147142
147151
|
const recommenders = await getRecommenders(einsteinSiteId, einsteinId);
|