particle-api-js 11.0.0 → 11.1.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/CHANGELOG.md +3 -0
- package/dist/particle.min.js +1 -1
- package/dist/particle.min.js.map +1 -1
- package/docs/api.md +149 -133
- package/package.json +1 -1
- package/src/Particle.js +16 -0
- package/test/Particle.spec.js +11 -0
package/package.json
CHANGED
package/src/Particle.js
CHANGED
|
@@ -289,6 +289,22 @@ class Particle {
|
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Revoke an access token
|
|
294
|
+
* @param {Object} options Options for this API call
|
|
295
|
+
* @param {String} options.token Access token you wish to revoke
|
|
296
|
+
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
297
|
+
* @param {Object} [options.context] Request context
|
|
298
|
+
* @returns {Promise} A promise
|
|
299
|
+
*/
|
|
300
|
+
deleteAccessToken({ token, headers, context }){
|
|
301
|
+
return this.delete({
|
|
302
|
+
uri: `/v1/access_tokens/${token}`,
|
|
303
|
+
headers,
|
|
304
|
+
context
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
292
308
|
/**
|
|
293
309
|
* Revoke the current session access token
|
|
294
310
|
* @param {Object} options Options for this API call
|
package/test/Particle.spec.js
CHANGED
|
@@ -389,6 +389,17 @@ describe('ParticleAPI', () => {
|
|
|
389
389
|
});
|
|
390
390
|
});
|
|
391
391
|
|
|
392
|
+
describe('.deleteAccessToken', () => {
|
|
393
|
+
it('sends request', () => {
|
|
394
|
+
return api.deleteAccessToken(props).then((results) => {
|
|
395
|
+
results.should.match({
|
|
396
|
+
method: 'delete',
|
|
397
|
+
uri: `/v1/access_tokens/${props.token}`,
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
|
|
392
403
|
describe('.deleteCurrentAccessToken', () => {
|
|
393
404
|
it('sends request', () => {
|
|
394
405
|
return api.deleteCurrentAccessToken(props).then((results) => {
|