@builder.io/plugin-sfcc-commerce-api 0.0.10 → 0.0.11-0
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 +23 -14
- package/dist/plugin.system.js.map +1 -1
- package/package.json +2 -2
package/dist/plugin.system.js
CHANGED
|
@@ -146875,7 +146875,7 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
146875
146875
|
});
|
|
146876
146876
|
|
|
146877
146877
|
var name = "@builder.io/plugin-sfcc-commerce-api";
|
|
146878
|
-
var version = "0.0.
|
|
146878
|
+
var version = "0.0.10";
|
|
146879
146879
|
var description = "";
|
|
146880
146880
|
var keywords = [
|
|
146881
146881
|
];
|
|
@@ -146929,7 +146929,7 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
146929
146929
|
};
|
|
146930
146930
|
var dependencies = {
|
|
146931
146931
|
"@builder.io/plugin-tools": "^0.0.3",
|
|
146932
|
-
"commerce-sdk-isomorphic": "
|
|
146932
|
+
"commerce-sdk-isomorphic": "2.1.0"
|
|
146933
146933
|
};
|
|
146934
146934
|
var pkg = {
|
|
146935
146935
|
name: name,
|
|
@@ -147005,13 +147005,18 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147005
147005
|
baseUrl.search = params.toString();
|
|
147006
147006
|
return baseUrl.toString();
|
|
147007
147007
|
}
|
|
147008
|
-
request(path, config, search = {}) {
|
|
147009
|
-
|
|
147010
|
-
|
|
147011
|
-
|
|
147012
|
-
|
|
147013
|
-
|
|
147014
|
-
|
|
147008
|
+
async request(path, config, search = {}) {
|
|
147009
|
+
try {
|
|
147010
|
+
const response = await fetch(`${this.getBaseUrl(path, search)}`, {
|
|
147011
|
+
...config,
|
|
147012
|
+
headers: {
|
|
147013
|
+
"Content-Type": "application/json"
|
|
147014
|
+
}
|
|
147015
|
+
});
|
|
147016
|
+
return await response.json();
|
|
147017
|
+
} catch (error) {
|
|
147018
|
+
throw error;
|
|
147019
|
+
}
|
|
147015
147020
|
}
|
|
147016
147021
|
getProduct(id) {
|
|
147017
147022
|
if (basicCache.get(id)) {
|
|
@@ -147040,12 +147045,15 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147040
147045
|
return resource;
|
|
147041
147046
|
});
|
|
147042
147047
|
}
|
|
147043
|
-
searchCategories(search) {
|
|
147044
|
-
|
|
147048
|
+
async searchCategories(search) {
|
|
147049
|
+
try {
|
|
147050
|
+
const categories = await this.request("categories-search", { method: "GET" }, { q: search });
|
|
147045
147051
|
const resources = categories?.map(transformCategory) || [];
|
|
147046
147052
|
resources.forEach((r) => basicCache.set(r.id, r));
|
|
147047
147053
|
return resources;
|
|
147048
|
-
})
|
|
147054
|
+
} catch (e) {
|
|
147055
|
+
throw e;
|
|
147056
|
+
}
|
|
147049
147057
|
}
|
|
147050
147058
|
}
|
|
147051
147059
|
|
|
@@ -147057,7 +147065,8 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147057
147065
|
{
|
|
147058
147066
|
name: "clientId",
|
|
147059
147067
|
type: "string",
|
|
147060
|
-
required: true
|
|
147068
|
+
required: true,
|
|
147069
|
+
friendlyName: "Public Client ID"
|
|
147061
147070
|
},
|
|
147062
147071
|
{
|
|
147063
147072
|
name: "organizationId",
|
|
@@ -147124,7 +147133,7 @@ System.register(['@builder.io/sdk', '@emotion/core', '@material-ui/core', 'react
|
|
|
147124
147133
|
return await api.getProduct(id);
|
|
147125
147134
|
},
|
|
147126
147135
|
async search(search) {
|
|
147127
|
-
return await api.search(search || "
|
|
147136
|
+
return await api.search(search || "");
|
|
147128
147137
|
},
|
|
147129
147138
|
getRequestObject(id) {
|
|
147130
147139
|
return {
|