Skip to content

Commit

Permalink
Merge pull request #3 from dashhudson/merge-latest-upstream
Browse files Browse the repository at this point in the history
Merge latest upstream
  • Loading branch information
pmdarrow authored Aug 18, 2022
2 parents c587e9b + d0b7ee3 commit 92e66b6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dist/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
10 changes: 5 additions & 5 deletions dist/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
});
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}());
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
1 change: 0 additions & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"removeComments": false,
"declaration": true,
"lib": [
"es2015"
"es2018",
"DOM"
]
},
"include": [
Expand Down

0 comments on commit 92e66b6

Please sign in to comment.