diff --git a/CHANGELOG.md b/CHANGELOG.md index 09eccad..07d077c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ (format is `dd.mm.yyyy` ) +### 2.15.0 (24.05.2022) + +* updated axios peer dependency to version `^0.27` +* updated typescript dev dependency to `^4.6` +* updated typescript lib configuration from es2015 to es2018 and DOM + +### 2.14.0 (13.07.2021) + +* updated axios peer dependency to version `^0.21` + ### 2.13.0 (19.07.2020) * allow all HTTP request methods to set a payload (contributed by @dries007, see https://github.com/christianmalek/vuex-rest-api/pull/103) diff --git a/dist/Resource.js b/dist/Resource.js index 354700a..8d653fe 100644 --- a/dist/Resource.js +++ b/dist/Resource.js @@ -20,7 +20,7 @@ var Resource = /** @class */ (function () { var headersFn = this.getHeadersFn(options); if (this.HTTPMethod.indexOf(options.method) === -1) { var methods = this.HTTPMethod.join(", "); - throw new Error("Illegal HTTP method set. Following methods are allowed: " + methods + ". You chose \"" + options.method + "\"."); + throw new Error("Illegal HTTP method set. Following methods are allowed: ".concat(methods, ". You chose \"").concat(options.method, "\".")); } var urlFn; if (typeof options.path === "function") { diff --git a/dist/Store.js b/dist/Store.js index 4e3fdf1..8bca586 100644 --- a/dist/Store.js +++ b/dist/Store.js @@ -119,7 +119,7 @@ var StoreCreator = /** @class */ (function () { var actions = this.resource.actions; Object.keys(actions).forEach(function (action) { var _a = actions[action], property = _a.property, commitString = _a.commitString, autoCancel = _a.autoCancel, beforeRequest = _a.beforeRequest, onSuccess = _a.onSuccess, onCancel = _a.onCancel, onError = _a.onError, axios = _a.axios; - mutations["" + commitString] = function (state, requestConfig) { + mutations["".concat(commitString)] = function (state, requestConfig) { if (property !== null) { state.pending[property] = true; state.error[property] = null; @@ -139,7 +139,7 @@ var StoreCreator = /** @class */ (function () { beforeRequest(state, requestConfig); } }; - mutations[commitString + "_" + _this.successSuffix] = function (state, _a) { + mutations["".concat(commitString, "_").concat(_this.successSuffix)] = function (state, _a) { var payload = _a.payload, requestConfig = _a.requestConfig; if (property !== null) { state.pending[property] = false; @@ -153,7 +153,7 @@ var StoreCreator = /** @class */ (function () { state[property] = payload.data; } }; - mutations[commitString + "_" + _this.errorSuffix] = function (state, _a) { + mutations["".concat(commitString, "_").concat(_this.errorSuffix)] = function (state, _a) { var payload = _a.payload, requestConfig = _a.requestConfig, isCancellationErr = _a.isCancellationErr; if (property !== null) { state.pending[property] = false; @@ -192,7 +192,7 @@ var StoreCreator = /** @class */ (function () { commit(commitString, requestConfig); return [2 /*return*/, requestFn(requestConfig) .then(function (response) { - commit(commitString + "_" + _this.successSuffix, { + commit("".concat(commitString, "_").concat(_this.successSuffix), { payload: response, requestConfig: requestConfig }); @@ -202,7 +202,7 @@ var StoreCreator = /** @class */ (function () { var isCancellationErr = axios_1.default.isCancel(error); var shouldHandleErr = !autoCancel || !isCancellationErr; if (shouldHandleErr) { - commit(commitString + "_" + _this.errorSuffix, { payload: error, requestConfig: requestConfig, isCancellationErr: isCancellationErr }); + commit("".concat(commitString, "_").concat(_this.errorSuffix), { payload: error, requestConfig: requestConfig, isCancellationErr: isCancellationErr }); return Promise.reject(error); } else { diff --git a/dist/index.js b/dist/index.js index cf252b9..684a554 100644 --- a/dist/index.js +++ b/dist/index.js @@ -35,7 +35,7 @@ var Vapi = /** @class */ (function () { }; Vapi.prototype.getStore = function (options) { if (options === void 0) { options = {}; } - return Store_1.createStore(this.resource, options); + return (0, Store_1.createStore)(this.resource, options); }; return Vapi; }()); diff --git a/package.json b/package.json index 60e46d2..7077aca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuex-rest-api", - "version": "2.13.0", + "version": "2.15.0", "description": "A helper utility to simplify the usage of REST APIs with Vuex. Based on axios.", "author": "Christian Malek", "license": "MIT", @@ -12,13 +12,13 @@ "lodash.clonedeep": "^4.5" }, "peerDependencies": { - "axios": "^0.21.1" + "axios": "^0.27" }, "scripts": { "build": "tsc -p ." }, "devDependencies": { - "typescript": "^3.6" + "typescript": "^4.6" }, "files": [ "dist", diff --git a/tests/package.json b/tests/package.json index 5bcaee2..8c42301 100644 --- a/tests/package.json +++ b/tests/package.json @@ -14,7 +14,6 @@ "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs" }, "dependencies": { - "axios": "^0.21.1", "vue": "^2.2.6", "vue-router": "^2.3.1", "vuex": "^2.3.1" diff --git a/tsconfig.json b/tsconfig.json index d53a140..ac4ad38 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "removeComments": false, "declaration": true, "lib": [ - "es2015" + "es2018", + "DOM" ] }, "include": [