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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "particle-api-js",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "Particle API Client",
5
5
  "main": "src/Particle.js",
6
6
  "scripts": {
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
@@ -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) => {