smspva-sdk 0.1.0-alpha.2 → 0.1.0-alpha.4
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/METHODS.md +6 -1
- package/README.md +20 -1
- package/dist/cjs/contracts.cjs +120 -0
- package/dist/cjs/contracts.cjs.map +1 -1
- package/dist/cjs/resources.cjs +15 -0
- package/dist/cjs/resources.cjs.map +1 -1
- package/dist/cjs/resources.d.cts +5 -0
- package/dist/cjs/transport.cjs +1 -1
- package/dist/cjs/transport.cjs.map +1 -1
- package/dist/cjs/transport.d.cts +1 -0
- package/dist/cjs/types.cjs.map +1 -1
- package/dist/cjs/types.d.cts +71 -0
- package/dist/esm/contracts.js +120 -0
- package/dist/esm/contracts.js.map +1 -1
- package/dist/esm/resources.d.ts +5 -0
- package/dist/esm/resources.js +15 -0
- package/dist/esm/resources.js.map +1 -1
- package/dist/esm/transport.d.ts +1 -0
- package/dist/esm/transport.js +1 -1
- package/dist/esm/transport.js.map +1 -1
- package/dist/esm/types.d.ts +71 -0
- package/dist/esm/types.js.map +1 -1
- package/package.json +1 -1
package/METHODS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SDK method index
|
|
2
2
|
|
|
3
|
-
All six packages cover these same
|
|
3
|
+
All six packages cover these same 61 methods. Both Python clients use the Python names. PHP and Java use the JavaScript camelCase method names, with their own resource access syntax. Go capitalizes the first letter (for example, `GetBalance`); C# also appends `Async` (`GetBalanceAsync`). See each package README for request types and working usage. Parameters retain their API spelling.
|
|
4
4
|
|
|
5
5
|
## activation
|
|
6
6
|
|
|
@@ -13,12 +13,17 @@ All six packages cover these same 56 methods. Both Python clients use the Python
|
|
|
13
13
|
| `client.activation.get_message_type_settings` | `client.activation.getMessageTypeSettings` | `GET /activation/countryservicesettings` |
|
|
14
14
|
| `client.activation.get_all_number_counts` | `client.activation.getAllNumberCounts` | `GET /activation/countnumbers` |
|
|
15
15
|
| `client.activation.get_country_number_counts` | `client.activation.getCountryNumberCounts` | `GET /activation/countnumbers/{country}` |
|
|
16
|
+
| `client.activation.get_all_number_counts_compact` | `client.activation.getAllNumberCountsCompact` | `GET /activation/countnumberscompact` |
|
|
17
|
+
| `client.activation.get_country_number_counts_compact` | `client.activation.getCountryNumberCountsCompact` | `GET /activation/countnumberscompact/{country}` |
|
|
16
18
|
| `client.activation.get_service_price` | `client.activation.getServicePrice` | `GET /activation/serviceprice/{country}/{service}` |
|
|
17
19
|
| `client.activation.get_country_operator_prices` | `client.activation.getCountryOperatorPrices` | `GET /activation/serviceprice/{country}` |
|
|
18
20
|
| `client.activation.get_service_prices` | `client.activation.getServicePrices` | `GET /activation/serviceprices/{service}` |
|
|
19
21
|
| `client.activation.get_all_service_prices` | `client.activation.getAllServicePrices` | `GET /activation/servicesprices` |
|
|
20
22
|
| `client.activation.get_number` | `client.activation.getNumber` | `GET /activation/number/{country}/{service}` |
|
|
21
23
|
| `client.activation.get_number_by_operator` | `client.activation.getNumberByOperator` | `GET /activation/number/{country}/{service}/{operator}` |
|
|
24
|
+
| `client.activation.repeat_number` | `client.activation.repeatNumber` | `POST /activation/repeatnumber/{number}/{service}` |
|
|
25
|
+
| `client.activation.get_phone_status` | `client.activation.getPhoneStatus` | `GET /activation/statusphone/{orderid}` |
|
|
26
|
+
| `client.activation.start_sms` | `client.activation.startSms` | `PUT /activation/startsms/{orderid}` |
|
|
22
27
|
| `client.activation.receive_sms` | `client.activation.receiveSms` | `GET /activation/sms/{orderid}` |
|
|
23
28
|
| `client.activation.get_orders` | `client.activation.getOrders` | `GET /activation/orders` |
|
|
24
29
|
| `client.activation.get_number_status` | `client.activation.getNumberStatus` | `GET /activation/numberstatus/{number}/{service}` |
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install smspva-sdk@0.1.0-alpha.2
|
|
|
16
16
|
|
|
17
17
|
## API coverage
|
|
18
18
|
|
|
19
|
-
The SDK provides
|
|
19
|
+
The SDK provides 61 methods across three APIs:
|
|
20
20
|
|
|
21
21
|
| API | Methods | Use it to |
|
|
22
22
|
| --- | --- | --- |
|
|
@@ -139,3 +139,22 @@ For account, billing or service questions, visit the [SMSPVA help center](https:
|
|
|
139
139
|
## License
|
|
140
140
|
|
|
141
141
|
MIT. See [LICENSE](https://github.com/SMSPVA/smspva-js/blob/main/LICENSE).
|
|
142
|
+
|
|
143
|
+
## Compact number counts and operator ratings
|
|
144
|
+
|
|
145
|
+
Using an already configured client:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const allCounts = await client.activation.getAllNumberCountsCompact();
|
|
149
|
+
const uaCounts = await client.activation.getCountryNumberCountsCompact({ country: "ua" });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Both requests use GET and the account API key in the `apikey` header. Country codes are case-insensitive; an unknown country returns `data: []`. No extra query parameters are required. Results are cached by the API for 60 seconds, independently for all countries and for each country.
|
|
153
|
+
|
|
154
|
+
The SDK preserves `Operator`, `Country`, `Services`, `Rating` and `ServiceRatings` exactly as returned, including negative counts and missing or invalid ratings. It does not insert computed rating fields. For non-`Donor*` operators, the effective rating is 1. For `Donor*` operators, use a service rating if it is an integer from 1 to 10, then a valid overall rating; otherwise the rating is undefined. Lower is better.
|
|
155
|
+
|
|
156
|
+
## Receive another SMS on a previously used number
|
|
157
|
+
|
|
158
|
+
Call the Activation methods in this order: `repeatNumber`, `getPhoneStatus`, `startSms`, `receiveSms`. Use a number previously paid for on the same service and carry the new order ID through the remaining calls. Request a new code in the target service after starting SMS reception.
|
|
159
|
+
|
|
160
|
+
HTTP 202 with NUMBER_NOT_READY includes retryAfter in seconds. For PHONE_NOT_READY, wait five seconds. Wait 30 seconds between SMS checks while the order is active. Receiving a new paid SMS can incur a charge. If the number request has an uncertain outcome, inspect current orders before retrying.
|
package/dist/cjs/contracts.cjs
CHANGED
|
@@ -127,6 +127,43 @@ exports.operations = {
|
|
|
127
127
|
"noStock": false,
|
|
128
128
|
"stateful": false
|
|
129
129
|
},
|
|
130
|
+
"activation.getAllNumberCountsCompact": {
|
|
131
|
+
"family": "activation",
|
|
132
|
+
"jsName": "getAllNumberCountsCompact",
|
|
133
|
+
"pyName": "get_all_number_counts_compact",
|
|
134
|
+
"slug": "countnumberscompact",
|
|
135
|
+
"path": "/activation/countnumberscompact",
|
|
136
|
+
"method": "GET",
|
|
137
|
+
"baseUrl": "https://api.smspva.com",
|
|
138
|
+
"auth": "required",
|
|
139
|
+
"params": [],
|
|
140
|
+
"pending": false,
|
|
141
|
+
"noStock": false,
|
|
142
|
+
"stateful": false
|
|
143
|
+
},
|
|
144
|
+
"activation.getCountryNumberCountsCompact": {
|
|
145
|
+
"family": "activation",
|
|
146
|
+
"jsName": "getCountryNumberCountsCompact",
|
|
147
|
+
"pyName": "get_country_number_counts_compact",
|
|
148
|
+
"slug": "country-countnumberscompact",
|
|
149
|
+
"path": "/activation/countnumberscompact/{country}",
|
|
150
|
+
"method": "GET",
|
|
151
|
+
"baseUrl": "https://api.smspva.com",
|
|
152
|
+
"auth": "required",
|
|
153
|
+
"params": [
|
|
154
|
+
{
|
|
155
|
+
"name": "country",
|
|
156
|
+
"in": "path",
|
|
157
|
+
"required": true,
|
|
158
|
+
"schema": {
|
|
159
|
+
"type": "string"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"pending": false,
|
|
164
|
+
"noStock": false,
|
|
165
|
+
"stateful": false
|
|
166
|
+
},
|
|
130
167
|
"activation.getServicePrice": {
|
|
131
168
|
"family": "activation",
|
|
132
169
|
"jsName": "getServicePrice",
|
|
@@ -374,6 +411,89 @@ exports.operations = {
|
|
|
374
411
|
"noStock": false,
|
|
375
412
|
"stateful": true
|
|
376
413
|
},
|
|
414
|
+
"activation.repeatNumber": {
|
|
415
|
+
"family": "activation",
|
|
416
|
+
"jsName": "repeatNumber",
|
|
417
|
+
"pyName": "repeat_number",
|
|
418
|
+
"slug": "repeat-number",
|
|
419
|
+
"path": "/activation/repeatnumber/{number}/{service}",
|
|
420
|
+
"method": "POST",
|
|
421
|
+
"baseUrl": "https://api.smspva.com",
|
|
422
|
+
"auth": "required",
|
|
423
|
+
"params": [
|
|
424
|
+
{
|
|
425
|
+
"name": "number",
|
|
426
|
+
"in": "path",
|
|
427
|
+
"required": true,
|
|
428
|
+
"schema": {
|
|
429
|
+
"type": "string",
|
|
430
|
+
"pattern": "^[0-9]{5,15}$",
|
|
431
|
+
"minLength": 5,
|
|
432
|
+
"maxLength": 15
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "service",
|
|
437
|
+
"in": "path",
|
|
438
|
+
"required": true,
|
|
439
|
+
"schema": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"minLength": 1
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
"pending": true,
|
|
446
|
+
"pendingType": "NUMBER_NOT_READY",
|
|
447
|
+
"noStock": false,
|
|
448
|
+
"stateful": true
|
|
449
|
+
},
|
|
450
|
+
"activation.getPhoneStatus": {
|
|
451
|
+
"family": "activation",
|
|
452
|
+
"jsName": "getPhoneStatus",
|
|
453
|
+
"pyName": "get_phone_status",
|
|
454
|
+
"slug": "phone-readiness",
|
|
455
|
+
"path": "/activation/statusphone/{orderid}",
|
|
456
|
+
"method": "GET",
|
|
457
|
+
"baseUrl": "https://api.smspva.com",
|
|
458
|
+
"auth": "required",
|
|
459
|
+
"params": [
|
|
460
|
+
{
|
|
461
|
+
"name": "orderid",
|
|
462
|
+
"in": "path",
|
|
463
|
+
"required": true,
|
|
464
|
+
"schema": {
|
|
465
|
+
"type": "integer"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"pending": true,
|
|
470
|
+
"pendingType": "PHONE_NOT_READY",
|
|
471
|
+
"noStock": false,
|
|
472
|
+
"stateful": false
|
|
473
|
+
},
|
|
474
|
+
"activation.startSms": {
|
|
475
|
+
"family": "activation",
|
|
476
|
+
"jsName": "startSms",
|
|
477
|
+
"pyName": "start_sms",
|
|
478
|
+
"slug": "start-sms",
|
|
479
|
+
"path": "/activation/startsms/{orderid}",
|
|
480
|
+
"method": "PUT",
|
|
481
|
+
"baseUrl": "https://api.smspva.com",
|
|
482
|
+
"auth": "required",
|
|
483
|
+
"params": [
|
|
484
|
+
{
|
|
485
|
+
"name": "orderid",
|
|
486
|
+
"in": "path",
|
|
487
|
+
"required": true,
|
|
488
|
+
"schema": {
|
|
489
|
+
"type": "integer"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
"pending": false,
|
|
494
|
+
"noStock": false,
|
|
495
|
+
"stateful": true
|
|
496
|
+
},
|
|
377
497
|
"activation.receiveSms": {
|
|
378
498
|
"family": "activation",
|
|
379
499
|
"jsName": "receiveSms",
|