getsmscode2
Advanced tools
Comparing version 1.0.9 to 1.0.10
24
index.js
@@ -215,3 +215,23 @@ 'use strict' | ||
_request (action, params = { }) { | ||
/** | ||
* Adds a number to this account's blacklist for the given service. | ||
* | ||
* You must specify either `opts.service` or `opts.pid`. | ||
* | ||
* @param {object} opts - Config options | ||
* @param {string} opts.number - Mobile number to blacklist | ||
* | ||
* @return {Promise} | ||
*/ | ||
async releaseNumber (opts) { | ||
const { | ||
number | ||
} = opts | ||
if (!number) throw new Error(`number required: "${number}"`) | ||
return this._request('cancelSMSRecv', { mobile: number }, 'GET') | ||
} | ||
_request (action, params = { }, method = 'POST') { | ||
if (!this._isCountryCodeRequired) { | ||
@@ -235,3 +255,3 @@ delete params.cocode | ||
return request({ | ||
method: 'POST', | ||
method, | ||
url: this._url, | ||
@@ -238,0 +258,0 @@ qs |
@@ -0,0 +0,0 @@ 'use strict' |
{ | ||
"name": "getsmscode2", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "API client for getsmscode.com", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -50,3 +50,3 @@ # getsmscode | ||
### [GetSMSCodeClient](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L46-L236) | ||
### [GetSMSCodeClient](https://github.com/gusnips/getsmscode/blob/master/index.js#L46-L236) | ||
@@ -62,3 +62,3 @@ Type: `function (opts)` | ||
#### [login](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L81-L90) | ||
#### [login](https://github.com/gusnips/getsmscode/blob/master/index.js#L81-L90) | ||
@@ -71,3 +71,3 @@ Logs in to test auth and fetches an account summary. | ||
#### [getNumber](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L105-L126) | ||
#### [getNumber](https://github.com/gusnips/getsmscode/blob/master/index.js#L105-L126) | ||
@@ -88,3 +88,3 @@ Acquires a temporary handle on a mobile number usable for the given service. | ||
#### [getNumbers](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L133-L143) | ||
#### [getNumbers](https://github.com/gusnips/getsmscode/blob/master/index.js#L133-L143) | ||
@@ -97,4 +97,12 @@ Returns a list of `{ number, service }` objects currently in use by this account. | ||
#### [getSMS](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L158-L180) | ||
#### [releaseNumber](https://github.com/gusnips/getsmscode/blob/master/index.js#L225-L236) | ||
Release a number `{ number }` currently in use by this account. | ||
Type: `function (): Promise` | ||
* * * | ||
#### [getSMS](https://github.com/gusnips/getsmscode/blob/master/index.js#L158-L180) | ||
You must specify either `opts.service` or `opts.pid`. | ||
@@ -113,3 +121,3 @@ | ||
#### [addNumberToBlacklist](https://github.com/gusnips/getsmscode/blob/1daaae5418b38c08551697fd68c7641382ec8bf7/index.js#L195-L210) | ||
#### [addNumberToBlacklist](https://github.com/gusnips/getsmscode/blob/master/index.js#L195-L210) | ||
@@ -116,0 +124,0 @@ Adds a number to this account's blacklist for the given service. |
@@ -0,0 +0,0 @@ 'use strict' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
589
144
29197