borders-rest-client
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -21,2 +21,4 @@ 'use strict'; | ||
var _get = require('../commands/get'); | ||
var _post = require('../commands/post'); | ||
@@ -26,6 +28,6 @@ | ||
var _get = require('../commands/get'); | ||
var _put = require('../commands/put'); | ||
var _patch = require('../commands/patch'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -82,2 +84,5 @@ | ||
return performRequest('PUT', request); | ||
}, | ||
async [_patch.PATCH]({ request }) { | ||
return performRequest('PATCH', request); | ||
} | ||
@@ -84,0 +89,0 @@ }; |
@@ -67,2 +67,17 @@ 'use strict'; | ||
var _patch = require('./patch'); | ||
Object.defineProperty(exports, 'patch', { | ||
enumerable: true, | ||
get: function () { | ||
return _interopRequireDefault(_patch).default; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'PATCH', { | ||
enumerable: true, | ||
get: function () { | ||
return _patch.PATCH; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -48,2 +48,3 @@ 'use strict'; | ||
sandbox.stub(backend, _commands.PUT); | ||
sandbox.stub(backend, _commands.PATCH); | ||
}); | ||
@@ -102,4 +103,16 @@ | ||
})); | ||
it('should handle "PATCH" command', execute(function* test() { | ||
yield (0, _commands.patch)({ | ||
path: '/some/path/entity' | ||
}); | ||
expect(backend[_commands.PATCH]).to.have.been.calledWith({ | ||
request: { | ||
path: '/some/path/entity' | ||
} | ||
}); | ||
})); | ||
}; | ||
module.exports = exports.default; |
@@ -19,5 +19,7 @@ 'use strict'; | ||
var _delete = require('../commands/delete'); | ||
var _put = require('../commands/put'); | ||
var _delete = require('../commands/delete'); | ||
var _patch = require('../commands/patch'); | ||
@@ -105,7 +107,10 @@ var _stubCall = require('../test-commands/stub-call'); | ||
}, | ||
async [_delete.DELETE]({ request }) { | ||
return getStubbedResponse('delete', request); | ||
}, | ||
async [_put.PUT]({ request }) { | ||
return getStubbedResponse('put', request); | ||
}, | ||
async [_delete.DELETE]({ request }) { | ||
return getStubbedResponse('delete', request); | ||
async [_patch.PATCH]({ request }) { | ||
return getStubbedResponse('patch', request); | ||
} | ||
@@ -112,0 +117,0 @@ }; |
{ | ||
"name": "borders-rest-client", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "Specification for system border rest-client", | ||
@@ -5,0 +5,0 @@ "author": "Actano GmbH (https://rplan.com/)", |
@@ -5,6 +5,7 @@ import client from 'request-promise' | ||
import RestStatusError from '../error/rest-status-error' | ||
import { GET } from '../commands/get' | ||
import { POST } from '../commands/post' | ||
import { DELETE } from '../commands/delete' | ||
import { GET } from '../commands/get' | ||
import { PUT } from '../commands/put' | ||
import { PATCH } from '../commands/patch' | ||
@@ -62,2 +63,5 @@ async function performRequest(method, request) { | ||
}, | ||
async [PATCH]({ request }) { | ||
return performRequest('PATCH', request) | ||
}, | ||
} | ||
@@ -64,0 +68,0 @@ |
@@ -5,1 +5,2 @@ export { default as get, GET } from './get' | ||
export { default as put, PUT } from './put' | ||
export { default as patch, PATCH } from './patch' |
@@ -12,6 +12,8 @@ /* eslint-env mocha */ | ||
POST, | ||
del, | ||
DELETE, | ||
put, | ||
PUT, | ||
del, | ||
DELETE, | ||
patch, | ||
PATCH, | ||
} from '../commands' | ||
@@ -39,2 +41,3 @@ | ||
sandbox.stub(backend, PUT) | ||
sandbox.stub(backend, PATCH) | ||
}) | ||
@@ -93,2 +96,14 @@ | ||
})) | ||
it('should handle "PATCH" command', execute(function* test() { | ||
yield patch({ | ||
path: '/some/path/entity', | ||
}) | ||
expect(backend[PATCH]).to.have.been.calledWith({ | ||
request: { | ||
path: '/some/path/entity', | ||
}, | ||
}) | ||
})) | ||
} |
@@ -6,4 +6,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
import { POST } from '../commands/post' | ||
import { DELETE } from '../commands/delete' | ||
import { PUT } from '../commands/put' | ||
import { DELETE } from '../commands/delete' | ||
import { PATCH } from '../commands/patch' | ||
import { STUB_CALL } from '../test-commands/stub-call' | ||
@@ -93,7 +94,10 @@ import { RestError, RestStatusError } from '../error' | ||
}, | ||
async [DELETE]({ request }) { | ||
return getStubbedResponse('delete', request) | ||
}, | ||
async [PUT]({ request }) { | ||
return getStubbedResponse('put', request) | ||
}, | ||
async [DELETE]({ request }) { | ||
return getStubbedResponse('delete', request) | ||
async [PATCH]({ request }) { | ||
return getStubbedResponse('patch', request) | ||
}, | ||
@@ -100,0 +104,0 @@ } |
44843
45
1337