vanilli-shop-client
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -63,3 +63,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/blog/posts"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/blog/posts"); | ||
return _this; | ||
@@ -70,3 +70,3 @@ } | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "?published=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "?published=true"))]; | ||
}); | ||
@@ -78,3 +78,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "/" + id + "?published=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "/").concat(id, "?published=true"))]; | ||
}); | ||
@@ -81,0 +81,0 @@ }); |
@@ -63,3 +63,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/categories"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/categories"); | ||
return _this; | ||
@@ -70,3 +70,3 @@ } | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "?active=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "?active=true"))]; | ||
}); | ||
@@ -78,3 +78,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "/" + id + "?active=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "/").concat(id, "?active=true"))]; | ||
}); | ||
@@ -81,0 +81,0 @@ }); |
@@ -63,3 +63,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/company/providers/payment?active=true"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/company/providers/payment?active=true"); | ||
return _this; | ||
@@ -66,0 +66,0 @@ } |
@@ -63,4 +63,4 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.countriesEndpoint = _this.RootEndpoint + "/countries"; | ||
_this.shippingEndpoint = _this.RootEndpoint + "/country/shipping/methods"; | ||
_this.countriesEndpoint = "".concat(_this.RootEndpoint, "/countries"); | ||
_this.shippingEndpoint = "".concat(_this.RootEndpoint, "/country/shipping/methods"); | ||
return _this; | ||
@@ -71,3 +71,3 @@ } | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.countriesEndpoint + "?active=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.countriesEndpoint, "?active=true"))]; | ||
}); | ||
@@ -79,3 +79,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostCall(this.shippingEndpoint + "/search", request)]; | ||
return [2 /*return*/, this.makePostCall("".concat(this.shippingEndpoint, "/search"), request)]; | ||
}); | ||
@@ -82,0 +82,0 @@ }); |
@@ -62,3 +62,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/coupons"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/coupons"); | ||
return _this; | ||
@@ -69,3 +69,3 @@ } | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostCall(this.endpoint + "/" + code + "/apply")]; | ||
return [2 /*return*/, this.makePostCall("".concat(this.endpoint, "/").concat(code, "/apply"))]; | ||
}); | ||
@@ -72,0 +72,0 @@ }); |
@@ -62,3 +62,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/discounts/apply/new-customer"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/discounts/apply/new-customer"); | ||
return _this; | ||
@@ -65,0 +65,0 @@ } |
@@ -62,3 +62,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/email/inquiry/client"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/email/inquiry/client"); | ||
return _this; | ||
@@ -65,0 +65,0 @@ } |
@@ -62,3 +62,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/orders"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/orders"); | ||
return _this; | ||
@@ -65,0 +65,0 @@ } |
@@ -63,3 +63,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/products"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/products"); | ||
return _this; | ||
@@ -70,3 +70,3 @@ } | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makePostCall(this.endpoint + "/search", request, queryParams)]; | ||
return [2 /*return*/, this.makePostCall("".concat(this.endpoint, "/search"), request, queryParams)]; | ||
}); | ||
@@ -78,3 +78,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "/groups")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "/groups"))]; | ||
}); | ||
@@ -86,3 +86,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "/" + ref + "?refType=" + refType + "&active=true")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "/").concat(ref, "?refType=").concat(refType, "&active=true"))]; | ||
}); | ||
@@ -94,3 +94,3 @@ }); | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, axios_1.default.get(this.endpoint + "/" + productId + "/parameter-values/groups")]; | ||
return [2 /*return*/, axios_1.default.get("".concat(this.endpoint, "/").concat(productId, "/parameter-values/groups"))]; | ||
}); | ||
@@ -97,0 +97,0 @@ }); |
import { IQueryParams } from "../models/base"; | ||
export default class RootApi { | ||
protected RootEndpoint: string; | ||
protected makePostCall(endpoint: string, request?: any, queryParams?: IQueryParams): Promise<import("axios").AxiosResponse<any>>; | ||
protected makePostCall(endpoint: string, request?: any, queryParams?: IQueryParams): Promise<import("axios").AxiosResponse<any, any>>; | ||
private static initQuery; | ||
} |
@@ -10,4 +10,7 @@ "use strict"; | ||
axios_1.default.interceptors.request.use(function (cfg) { | ||
var language = localStorage.getItem(local_storage_1.LocalStorageEnum.Language); | ||
cfg.headers["Accept-Language"] = language || locale_1.LanguageEnum.Et; | ||
var headers = cfg.headers; | ||
if (headers) { | ||
var language = localStorage.getItem(local_storage_1.LocalStorageEnum.Language); | ||
headers["Accept-Language"] = language || locale_1.LanguageEnum.Et; | ||
} | ||
return cfg; | ||
@@ -29,5 +32,5 @@ }); | ||
if (sortBy) { | ||
endpoint = endpoint + "?sortBy=" + sortBy; | ||
endpoint = "".concat(endpoint, "?sortBy=").concat(sortBy); | ||
if (queryParams.sortDesc) { | ||
endpoint = endpoint + "&sortDesc=true"; | ||
endpoint = "".concat(endpoint, "&sortDesc=true"); | ||
} | ||
@@ -38,6 +41,6 @@ } | ||
if (sortBy) { | ||
endpoint = endpoint + "&limit=" + limit; | ||
endpoint = "".concat(endpoint, "&limit=").concat(limit); | ||
} | ||
else { | ||
endpoint = endpoint + "?limit=" + limit; | ||
endpoint = "".concat(endpoint, "?limit=").concat(limit); | ||
} | ||
@@ -44,0 +47,0 @@ } |
@@ -62,3 +62,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.endpoint = _this.RootEndpoint + "/shipping/pickup-points/search"; | ||
_this.endpoint = "".concat(_this.RootEndpoint, "/shipping/pickup-points/search"); | ||
return _this; | ||
@@ -65,0 +65,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
for (var i = allSuspects.length; i >= 0; i--) { | ||
if (allSuspects[i] && allSuspects[i].getAttribute("src") !== null && ((_a = allSuspects[i].getAttribute("src")) === null || _a === void 0 ? void 0 : _a.indexOf("" + src)) !== -1) { | ||
if (allSuspects[i] && allSuspects[i].getAttribute("src") !== null && ((_a = allSuspects[i].getAttribute("src")) === null || _a === void 0 ? void 0 : _a.indexOf("".concat(src))) !== -1) { | ||
return; | ||
@@ -23,3 +23,3 @@ } | ||
for (var i = allSuspects.length; i >= 0; i--) { | ||
if (allSuspects[i] && allSuspects[i].getAttribute("src") !== null && ((_a = allSuspects[i].getAttribute("src")) === null || _a === void 0 ? void 0 : _a.indexOf("" + src)) !== -1) { | ||
if (allSuspects[i] && allSuspects[i].getAttribute("src") !== null && ((_a = allSuspects[i].getAttribute("src")) === null || _a === void 0 ? void 0 : _a.indexOf("".concat(src))) !== -1) { | ||
(_b = allSuspects[i].parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(allSuspects[i]); | ||
@@ -26,0 +26,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
} | ||
return "/products/" + ref + "?refType=" + refType; | ||
return "/products/".concat(ref, "?refType=").concat(refType); | ||
}; | ||
@@ -18,0 +18,0 @@ CartItem.getCurrentPrice = function (item) { |
@@ -58,3 +58,4 @@ import { IBaseDto, IPropertyDto } from "./base"; | ||
minStock?: number; | ||
source?: string; | ||
additionalProps?: IPropertyDto[]; | ||
} |
@@ -18,3 +18,3 @@ "use strict"; | ||
} | ||
return "/products/" + ref + "?refType=" + refType; | ||
return "/products/".concat(ref, "?refType=").concat(refType); | ||
}; | ||
@@ -28,3 +28,3 @@ Product.getLinkWithCategory = function (product) { | ||
var category = this.parseCategoryName(product); | ||
return "/products/" + category + "/" + ref + "?refType=" + refType; | ||
return "/products/".concat(category, "/").concat(ref, "?refType=").concat(refType); | ||
}; | ||
@@ -31,0 +31,0 @@ Product.parseCategoryName = function (product) { |
@@ -20,9 +20,10 @@ import BaseStore from "./base-store"; | ||
setSearchProp(value: string, key: string): void; | ||
unsetSearchProp(key: string): void; | ||
resetSearch(): void; | ||
resetSelectedCategory(): void; | ||
setProductPrice(price: number): void; | ||
toggleProductList(): void; | ||
private resetProductPrice; | ||
private setProducts; | ||
private setProductGroups; | ||
private toggleProductList; | ||
private setProduct; | ||
@@ -29,0 +30,0 @@ private startLoadingProductGroups; |
@@ -92,3 +92,2 @@ "use strict"; | ||
queryParams = this.initProductSearch(request, queryParams); | ||
this.toggleProductList(); | ||
_a.label = 1; | ||
@@ -271,2 +270,8 @@ case 1: | ||
}; | ||
ProductStore.prototype.unsetSearchProp = function (key) { | ||
var matchingProp = this.searchProps.findIndex(function (x) { return x.key === key; }); | ||
if (matchingProp) { | ||
this.searchProps.splice(matchingProp, 1); | ||
} | ||
}; | ||
ProductStore.prototype.resetSearch = function () { | ||
@@ -291,2 +296,5 @@ this.searchProps = []; | ||
}; | ||
ProductStore.prototype.toggleProductList = function () { | ||
this.showProductList = true; | ||
}; | ||
ProductStore.prototype.resetProductPrice = function () { | ||
@@ -306,5 +314,2 @@ if (this.product) { | ||
}; | ||
ProductStore.prototype.toggleProductList = function () { | ||
this.showProductList = true; | ||
}; | ||
ProductStore.prototype.setProduct = function (product) { | ||
@@ -405,2 +410,5 @@ this.product = { | ||
mobx_1.action | ||
], ProductStore.prototype, "unsetSearchProp", null); | ||
__decorate([ | ||
mobx_1.action | ||
], ProductStore.prototype, "resetSearch", null); | ||
@@ -415,2 +423,5 @@ __decorate([ | ||
mobx_1.action | ||
], ProductStore.prototype, "toggleProductList", null); | ||
__decorate([ | ||
mobx_1.action | ||
], ProductStore.prototype, "resetProductPrice", null); | ||
@@ -425,5 +436,2 @@ __decorate([ | ||
mobx_1.action | ||
], ProductStore.prototype, "toggleProductList", null); | ||
__decorate([ | ||
mobx_1.action | ||
], ProductStore.prototype, "setProduct", null); | ||
@@ -430,0 +438,0 @@ __decorate([ |
@@ -50,3 +50,3 @@ "use strict"; | ||
if (replacedValues[i]) { | ||
translation = translation.replace("{" + i + "}", replacedValues[i]); | ||
translation = translation.replace("{".concat(i, "}"), replacedValues[i]); | ||
} | ||
@@ -53,0 +53,0 @@ } |
{ | ||
"name": "vanilli-shop-client", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Client for Vanilli Shop API", | ||
@@ -21,22 +21,22 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "^14.17.0", | ||
"@types/qs": "^6.9.6", | ||
"@types/react": "^16.14.10", | ||
"@types/react-router-dom": "^5.1.7", | ||
"@types/uuid": "^8.3.0", | ||
"mobx": "^6.3.1", | ||
"@types/node": "^17.0.14", | ||
"@types/qs": "^6.9.7", | ||
"@types/react": "^16.14.23", | ||
"@types/react-router-dom": "^5.3.3", | ||
"@types/uuid": "^8.3.4", | ||
"mobx": "^6.3.13", | ||
"react": "^16.14.0", | ||
"react-router-dom": "^5.2.0", | ||
"react-router-dom": "^5.3.0", | ||
"react-toastify": "^6.2.0" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"axios": "^0.25.0", | ||
"env-cmd": "^10.1.0", | ||
"moment": "^2.29.1", | ||
"qs": "^6.10.1", | ||
"qs": "^6.10.3", | ||
"react-clear-cache": "^1.4.12", | ||
"sitemap": "^6.4.0", | ||
"typescript": "^4.4.2", | ||
"sitemap": "^7.1.1", | ||
"typescript": "^4.5.5", | ||
"uuid": "^8.3.2" | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
# ShopClient | ||
# Shop Client |
@@ -7,4 +7,9 @@ import {IQueryParams} from "../models/base"; | ||
Axios.interceptors.request.use((cfg) => { | ||
const language = localStorage.getItem(LocalStorageEnum.Language); | ||
cfg.headers["Accept-Language"] = language || LanguageEnum.Et; | ||
const headers = cfg.headers; | ||
if (headers) { | ||
const language = localStorage.getItem(LocalStorageEnum.Language); | ||
headers["Accept-Language"] = language || LanguageEnum.Et; | ||
} | ||
return cfg; | ||
@@ -11,0 +16,0 @@ }) |
@@ -119,3 +119,4 @@ import {IBaseDto, IPropertyDto} from "./base"; | ||
minStock?: number, | ||
source?: string, | ||
additionalProps?: IPropertyDto[] | ||
} |
@@ -43,3 +43,2 @@ import BaseStore from "./base-store"; | ||
queryParams = this.initProductSearch(request, queryParams); | ||
this.toggleProductList(); | ||
@@ -164,2 +163,11 @@ try { | ||
@action | ||
unsetSearchProp(key: string) { | ||
const matchingProp = this.searchProps.findIndex(x => x.key === key); | ||
if (matchingProp) { | ||
this.searchProps.splice(matchingProp, 1); | ||
} | ||
} | ||
@action | ||
resetSearch() { | ||
@@ -190,2 +198,7 @@ this.searchProps = []; | ||
@action | ||
toggleProductList() { | ||
this.showProductList = true; | ||
} | ||
@action | ||
private resetProductPrice() { | ||
@@ -212,7 +225,2 @@ if (this.product) { | ||
@action | ||
private toggleProductList() { | ||
this.showProductList = true; | ||
} | ||
@action | ||
private setProduct(product: IProductDetailsDto) { | ||
@@ -219,0 +227,0 @@ this.product = { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
272591
6081
2
2
+ Added@types/node@17.0.45(transitive)
+ Addedaxios@0.25.0(transitive)
+ Addedsitemap@7.1.2(transitive)
- Removed@types/node@14.18.63(transitive)
- Removedaxios@0.21.4(transitive)
- Removedsitemap@6.4.0(transitive)
Updatedaxios@^0.25.0
Updatedqs@^6.10.3
Updatedsitemap@^7.1.1
Updatedtypescript@^4.5.5