diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d169c6f..d269fd8 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,7 +2,6 @@ .npmignore docs/BusinessApi.md docs/CarrierApi.md -docs/ESIMsApi.md docs/InformationApi.md docs/PreordersApi.md docs/PricingApi.md @@ -12,7 +11,6 @@ docs/VoucherApi.md package.json src/apis/BusinessApi.ts src/apis/CarrierApi.ts -src/apis/ESIMsApi.ts src/apis/InformationApi.ts src/apis/PreordersApi.ts src/apis/PricingApi.ts diff --git a/docs/ESIMsApi.md b/docs/ESIMsApi.md deleted file mode 100644 index 66aab19..0000000 --- a/docs/ESIMsApi.md +++ /dev/null @@ -1,670 +0,0 @@ -# ESIMsApi - -All URIs are relative to *https://api.smspool.net* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**esimDelete**](ESIMsApi.md#esimdelete) | **POST** /esim/delete | Delete eSIM | -| [**esimHistory**](ESIMsApi.md#esimhistory) | **POST** /esim/history | View eSIM history | -| [**esimLabelUpdate**](ESIMsApi.md#esimlabelupdate) | **POST** /esim/label/update | Update eSIM label | -| [**esimPlans**](ESIMsApi.md#esimplans) | **POST** /esim/plans | View eSIM plans per country | -| [**esimPricing**](ESIMsApi.md#esimpricing) | **POST** /esim/pricing | View eSIM countries | -| [**esimProfile**](ESIMsApi.md#esimprofile) | **POST** /esim/profile | View eSIM profile | -| [**esimPurchase**](ESIMsApi.md#esimpurchase) | **POST** /esim/purchase | Purchase eSIM | -| [**esimTopup**](ESIMsApi.md#esimtopup) | **POST** /esim/topup | Top up eSIM | -| [**esimTopupPlans**](ESIMsApi.md#esimtopupplans) | **POST** /esim/topup_plans | Top Up Plans | - - - -## esimDelete - -> any esimDelete(transactionId) - -Delete eSIM - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimDeleteRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // string | transactionId retrieved from /esim/purchase - transactionId: transactionId_example, - } satisfies EsimDeleteRequest; - - try { - const data = await api.esimDelete(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **transactionId** | `string` | transactionId retrieved from /esim/purchase | [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimHistory - -> any esimHistory(start, length, search) - -View eSIM history - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimHistoryRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // number | Start page (optional) - start: 56, - // number | Amount of rows per page (optional) - length: 56, - // string | Alphanumeric search (optional) - search: search_example, - } satisfies EsimHistoryRequest; - - try { - const data = await api.esimHistory(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **start** | `number` | Start page | [Optional] [Defaults to `undefined`] | -| **length** | `number` | Amount of rows per page | [Optional] [Defaults to `undefined`] | -| **search** | `string` | Alphanumeric search | [Optional] [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimLabelUpdate - -> any esimLabelUpdate(transactionId, label) - -Update eSIM label - -Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimLabelUpdateRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // string | transactionId retrieved from /esim/purchase - transactionId: transactionId_example, - // string | The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. (optional) - label: label_example, - } satisfies EsimLabelUpdateRequest; - - try { - const data = await api.esimLabelUpdate(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **transactionId** | `string` | transactionId retrieved from /esim/purchase | [Defaults to `undefined`] | -| **label** | `string` | The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. | [Optional] [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimPlans - -> any esimPlans(country) - -View eSIM plans per country - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimPlansRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // string | ISO 3166 country code - country: country_example, - } satisfies EsimPlansRequest; - - try { - const data = await api.esimPlans(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **country** | `string` | ISO 3166 country code | [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimPricing - -> any esimPricing(start, length, search) - -View eSIM countries - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimPricingRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // number | Start page (optional) - start: 56, - // number | Amount of rows per page (optional) - length: 56, - // string | Search query for country (optional) - search: search_example, - } satisfies EsimPricingRequest; - - try { - const data = await api.esimPricing(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **start** | `number` | Start page | [Optional] [Defaults to `undefined`] | -| **length** | `number` | Amount of rows per page | [Optional] [Defaults to `undefined`] | -| **search** | `string` | Search query for country | [Optional] [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimProfile - -> any esimProfile(transactionId) - -View eSIM profile - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimProfileRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // string | transactionId retrieved from /esim/purchase (optional) - transactionId: transactionId_example, - } satisfies EsimProfileRequest; - - try { - const data = await api.esimProfile(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **transactionId** | `string` | transactionId retrieved from /esim/purchase | [Optional] [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimPurchase - -> any esimPurchase(plan) - -Purchase eSIM - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimPurchaseRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // number | The plan ID which is obtained from /esim/pricing - plan: 56, - } satisfies EsimPurchaseRequest; - - try { - const data = await api.esimPurchase(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **plan** | `number` | The plan ID which is obtained from /esim/pricing | [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimTopup - -> any esimTopup(transactionId, plan) - -Top up eSIM - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimTopupRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const config = new Configuration({ - // Configure HTTP bearer authorization: bearerAuth - accessToken: "YOUR BEARER TOKEN", - }); - const api = new ESIMsApi(config); - - const body = { - // string | Transaction ID retrieved from eSIM history - transactionId: transactionId_example, - // number | Topup plan retrieved from \\\"Top Up Plans\\\" - plan: 56, - } satisfies EsimTopupRequest; - - try { - const data = await api.esimTopup(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **transactionId** | `string` | Transaction ID retrieved from eSIM history | [Defaults to `undefined`] | -| **plan** | `number` | Topup plan retrieved from \\\"Top Up Plans\\\" | [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **401** | Malformed API key | - | -| **403** | Unknown or revoked API key | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - - -## esimTopupPlans - -> any esimTopupPlans(plan) - -Top Up Plans - -### Example - -```ts -import { - Configuration, - ESIMsApi, -} from '@smspool/sdk'; -import type { EsimTopupPlansRequest } from '@smspool/sdk'; - -async function example() { - console.log("🚀 Testing @smspool/sdk SDK..."); - const api = new ESIMsApi(); - - const body = { - // number | `plan` retrieved from eSIM history - plan: 56, - } satisfies EsimTopupPlansRequest; - - try { - const data = await api.esimTopupPlans(body); - console.log(data); - } catch (error) { - console.error(error); - } -} - -// Run the test -example().catch(console.error); -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **plan** | `number` | `plan` retrieved from eSIM history | [Defaults to `undefined`] | - -### Return type - -**any** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: `application/x-www-form-urlencoded` -- **Accept**: `application/json` - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) - diff --git a/docs/InformationApi.md b/docs/InformationApi.md index 6a6abdb..d469ee1 100644 --- a/docs/InformationApi.md +++ b/docs/InformationApi.md @@ -7,7 +7,9 @@ All URIs are relative to *https://api.smspool.net* | [**countryRetrieveAll**](InformationApi.md#countryretrieveall) | **GET** /country/retrieve_all | Country list | | [**poolRetrieveAll**](InformationApi.md#poolretrieveall) | **POST** /pool/retrieve_all | Pool list | | [**poolRetrieveValid**](InformationApi.md#poolretrievevalid) | **POST** /pool/retrieve_valid | Suggested Pools | +| [**requestAutoCountry**](InformationApi.md#requestautocountry) | **POST** /request/auto_country | Pick the best country for a service | | [**requestBalance**](InformationApi.md#requestbalance) | **POST** /request/balance | Balance | +| [**requestHistorySearch**](InformationApi.md#requesthistorysearch) | **POST** /request/history_search | History search | | [**requestSuccessRate**](InformationApi.md#requestsuccessrate) | **POST** /request/success_rate | Retrieve country success rates per service | | [**requestSuggestedCountries**](InformationApi.md#requestsuggestedcountries) | **POST** /request/suggested_countries | Suggested Countries | | [**serviceRetrieveAll**](InformationApi.md#serviceretrieveall) | **GET** /service/retrieve_all | Service list | @@ -217,6 +219,77 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) +## requestAutoCountry + +> any requestAutoCountry(service, pricingOption) + +Pick the best country for a service + +Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order\'s \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request\'s IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + +### Example + +```ts +import { + Configuration, + InformationApi, +} from '@smspool/sdk'; +import type { RequestAutoCountryRequest } from '@smspool/sdk'; + +async function example() { + console.log("🚀 Testing @smspool/sdk SDK..."); + const api = new InformationApi(); + + const body = { + // string | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + service: service_example, + // number | Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. (optional) + pricingOption: 56, + } satisfies RequestAutoCountryRequest; + + try { + const data = await api.requestAutoCountry(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **service** | `string` | Service name or service ID which can be retrieved at the /service/retrieve_all endpoint | [Defaults to `undefined`] | +| **pricingOption** | `number` | Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. | [Optional] [Defaults to `undefined`] | + +### Return type + +**any** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + ## requestBalance > any requestBalance() @@ -283,6 +356,85 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) +## requestHistorySearch + +> any requestHistorySearch(search, cursor, limit) + +History search + +_Not documented yet: the parameters below come straight from the code._ + +### Example + +```ts +import { + Configuration, + InformationApi, +} from '@smspool/sdk'; +import type { RequestHistorySearchRequest } from '@smspool/sdk'; + +async function example() { + console.log("🚀 Testing @smspool/sdk SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new InformationApi(config); + + const body = { + // string + search: search_example, + // string (optional) + cursor: cursor_example, + // number (optional) + limit: 56, + } satisfies RequestHistorySearchRequest; + + try { + const data = await api.requestHistorySearch(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **search** | `string` | | [Defaults to `undefined`] | +| **cursor** | `string` | | [Optional] [Defaults to `undefined`] | +| **limit** | `number` | | [Optional] [Defaults to `undefined`] | + +### Return type + +**any** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + ## requestSuccessRate > any requestSuccessRate(service, country) diff --git a/docs/RentalApi.md b/docs/RentalApi.md index 716b2d2..532731c 100644 --- a/docs/RentalApi.md +++ b/docs/RentalApi.md @@ -1111,7 +1111,11 @@ import type { RentalStockRequest } from '@smspool/sdk'; async function example() { console.log("🚀 Testing @smspool/sdk SDK..."); - const api = new RentalApi(); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new RentalApi(config); const body = { // number | The rental ID retrieved from `Retrieve Rental IDs` @@ -1149,7 +1153,7 @@ example().catch(console.error); ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -1161,6 +1165,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/docs/SMSApi.md b/docs/SMSApi.md index c9f82ff..461b7fb 100644 --- a/docs/SMSApi.md +++ b/docs/SMSApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.smspool.net* | [**requestHistory**](SMSApi.md#requesthistory) | **POST** /request/history | Order History | | [**smsActivate**](SMSApi.md#smsactivate) | **POST** /sms/activate | Activate SMS | | [**smsAllStock**](SMSApi.md#smsallstock) | **POST** /sms/all_stock | One-time stock for all services | +| [**smsArchive**](SMSApi.md#smsarchive) | **POST** /sms/archive | Archive | | [**smsCancel**](SMSApi.md#smscancel) | **POST** /sms/cancel | Cancel SMS | | [**smsCancelAll**](SMSApi.md#smscancelall) | **POST** /sms/cancel_all | Cancel All SMS | | [**smsCheck**](SMSApi.md#smscheck) | **POST** /sms/check | Check SMS | @@ -26,7 +27,7 @@ All URIs are relative to *https://api.smspool.net* ## purchaseSms -> any purchaseSms(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, software) +> any purchaseSms(service, country, pool, maxPrice, pricingOption, quantity, areacode, exclude, createToken, activationType, carrier, phonenumber, autoCountry, software) Order SMS @@ -72,6 +73,8 @@ async function example() { carrier: 56, // number | In case you want to select a specific phone number to order (optional) phonenumber: 56, + // number | Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request\\\'s IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. (optional) + autoCountry: 56, // number (optional) software: 56, } satisfies PurchaseSmsRequest; @@ -105,6 +108,7 @@ example().catch(console.error); | **activationType** | `string` | Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. | [Optional] [Defaults to `undefined`] | | **carrier** | `number` | Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) | [Optional] [Defaults to `undefined`] | | **phonenumber** | `number` | In case you want to select a specific phone number to order | [Optional] [Defaults to `undefined`] | +| **autoCountry** | `number` | Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request\\\'s IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. | [Optional] [Defaults to `undefined`] | | **software** | `number` | | [Optional] [Defaults to `undefined`] | ### Return type @@ -279,7 +283,11 @@ import type { RequestAreacodesRequest } from '@smspool/sdk'; async function example() { console.log("🚀 Testing @smspool/sdk SDK..."); - const api = new SMSApi(); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new SMSApi(config); const body = { // string | The service or number retrieved from the `Service List` endpoint @@ -317,7 +325,7 @@ example().catch(console.error); ### Authorization -No authorization required +[bearerAuth](../README.md#bearerAuth) ### HTTP request headers @@ -329,6 +337,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) @@ -560,6 +570,79 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) +## smsArchive + +> any smsArchive(orderid) + +Archive + +_Not documented yet: the parameters below come straight from the code._ + +### Example + +```ts +import { + Configuration, + SMSApi, +} from '@smspool/sdk'; +import type { SmsArchiveRequest } from '@smspool/sdk'; + +async function example() { + console.log("🚀 Testing @smspool/sdk SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearerAuth + accessToken: "YOUR BEARER TOKEN", + }); + const api = new SMSApi(config); + + const body = { + // string + orderid: orderid_example, + } satisfies SmsArchiveRequest; + + try { + const data = await api.smsArchive(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderid** | `string` | | [Defaults to `undefined`] | + +### Return type + +**any** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | JSON response | - | +| **401** | Malformed API key | - | +| **403** | Unknown or revoked API key | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + ## smsCancel > any smsCancel(orderid, orderids, expiry, ban) @@ -928,7 +1011,7 @@ This endpoint does not need any parameter. Missed SMS -Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. +Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. ### Example diff --git a/src/apis/ESIMsApi.ts b/src/apis/ESIMsApi.ts deleted file mode 100644 index 75b2156..0000000 --- a/src/apis/ESIMsApi.ts +++ /dev/null @@ -1,1017 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * SMSPool API - * Every endpoint accepts its parameters as form fields (POST) or query parameters (GET). Authenticate with your API key from https://www.smspool.net/my/settings, either as a bearer token (`Authorization: Bearer `) or as a `key` parameter. - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as runtime from '../runtime'; - -export interface EsimDeleteRequest { - /** - * transactionId retrieved from /esim/purchase - */ - transactionId: string; -} - -export interface EsimHistoryRequest { - /** - * Start page - */ - start?: number; - /** - * Amount of rows per page - */ - length?: number; - /** - * Alphanumeric search - */ - search?: string; -} - -export interface EsimLabelUpdateRequest { - /** - * transactionId retrieved from /esim/purchase - */ - transactionId: string; - /** - * The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. - */ - label?: string; -} - -export interface EsimPlansRequest { - /** - * ISO 3166 country code - */ - country: string; -} - -export interface EsimPricingRequest { - /** - * Start page - */ - start?: number; - /** - * Amount of rows per page - */ - length?: number; - /** - * Search query for country - */ - search?: string; -} - -export interface EsimProfileRequest { - /** - * transactionId retrieved from /esim/purchase - */ - transactionId?: string; -} - -export interface EsimPurchaseRequest { - /** - * The plan ID which is obtained from /esim/pricing - */ - plan: number; -} - -export interface EsimTopupRequest { - /** - * Transaction ID retrieved from eSIM history - */ - transactionId: string; - /** - * Topup plan retrieved from \"Top Up Plans\" - */ - plan: number; -} - -export interface EsimTopupPlansRequest { - /** - * `plan` retrieved from eSIM history - */ - plan: number; -} - -/** - * ESIMsApi - interface - * - * @export - * @interface ESIMsApiInterface - */ -export interface ESIMsApiInterface { - /** - * Creates request options for esimDelete without sending the request - * @param {string} transactionId transactionId retrieved from /esim/purchase - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimDeleteRequestOpts(requestParameters: EsimDeleteRequest): Promise; - - /** - * - * @summary Delete eSIM - * @param {string} transactionId transactionId retrieved from /esim/purchase - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimDeleteRaw(requestParameters: EsimDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * Delete eSIM - */ - esimDelete(requestParameters: EsimDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimHistory without sending the request - * @param {number} [start] Start page - * @param {number} [length] Amount of rows per page - * @param {string} [search] Alphanumeric search - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimHistoryRequestOpts(requestParameters: EsimHistoryRequest): Promise; - - /** - * - * @summary View eSIM history - * @param {number} [start] Start page - * @param {number} [length] Amount of rows per page - * @param {string} [search] Alphanumeric search - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimHistoryRaw(requestParameters: EsimHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * View eSIM history - */ - esimHistory(requestParameters: EsimHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimLabelUpdate without sending the request - * @param {string} transactionId transactionId retrieved from /esim/purchase - * @param {string} [label] The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimLabelUpdateRequestOpts(requestParameters: EsimLabelUpdateRequest): Promise; - - /** - * Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - * @summary Update eSIM label - * @param {string} transactionId transactionId retrieved from /esim/purchase - * @param {string} [label] The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimLabelUpdateRaw(requestParameters: EsimLabelUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - * Update eSIM label - */ - esimLabelUpdate(requestParameters: EsimLabelUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimPlans without sending the request - * @param {string} country ISO 3166 country code - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPlansRequestOpts(requestParameters: EsimPlansRequest): Promise; - - /** - * - * @summary View eSIM plans per country - * @param {string} country ISO 3166 country code - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPlansRaw(requestParameters: EsimPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * View eSIM plans per country - */ - esimPlans(requestParameters: EsimPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimPricing without sending the request - * @param {number} [start] Start page - * @param {number} [length] Amount of rows per page - * @param {string} [search] Search query for country - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPricingRequestOpts(requestParameters: EsimPricingRequest): Promise; - - /** - * - * @summary View eSIM countries - * @param {number} [start] Start page - * @param {number} [length] Amount of rows per page - * @param {string} [search] Search query for country - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPricingRaw(requestParameters: EsimPricingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * View eSIM countries - */ - esimPricing(requestParameters: EsimPricingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimProfile without sending the request - * @param {string} [transactionId] transactionId retrieved from /esim/purchase - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimProfileRequestOpts(requestParameters: EsimProfileRequest): Promise; - - /** - * - * @summary View eSIM profile - * @param {string} [transactionId] transactionId retrieved from /esim/purchase - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimProfileRaw(requestParameters: EsimProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * View eSIM profile - */ - esimProfile(requestParameters: EsimProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimPurchase without sending the request - * @param {number} plan The plan ID which is obtained from /esim/pricing - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPurchaseRequestOpts(requestParameters: EsimPurchaseRequest): Promise; - - /** - * - * @summary Purchase eSIM - * @param {number} plan The plan ID which is obtained from /esim/pricing - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimPurchaseRaw(requestParameters: EsimPurchaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * Purchase eSIM - */ - esimPurchase(requestParameters: EsimPurchaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimTopup without sending the request - * @param {string} transactionId Transaction ID retrieved from eSIM history - * @param {number} plan Topup plan retrieved from \\\"Top Up Plans\\\" - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimTopupRequestOpts(requestParameters: EsimTopupRequest): Promise; - - /** - * - * @summary Top up eSIM - * @param {string} transactionId Transaction ID retrieved from eSIM history - * @param {number} plan Topup plan retrieved from \\\"Top Up Plans\\\" - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimTopupRaw(requestParameters: EsimTopupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * Top up eSIM - */ - esimTopup(requestParameters: EsimTopupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - - /** - * Creates request options for esimTopupPlans without sending the request - * @param {number} plan `plan` retrieved from eSIM history - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimTopupPlansRequestOpts(requestParameters: EsimTopupPlansRequest): Promise; - - /** - * - * @summary Top Up Plans - * @param {number} plan `plan` retrieved from eSIM history - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ESIMsApiInterface - */ - esimTopupPlansRaw(requestParameters: EsimTopupPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; - - /** - * Top Up Plans - */ - esimTopupPlans(requestParameters: EsimTopupPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; - -} - -/** - * - */ -export class ESIMsApi extends runtime.BaseAPI implements ESIMsApiInterface { - - /** - * Creates request options for esimDelete without sending the request - */ - async esimDeleteRequestOpts(requestParameters: EsimDeleteRequest): Promise { - if (requestParameters['transactionId'] == null) { - throw new runtime.RequiredError( - 'transactionId', - 'Required parameter "transactionId" was null or undefined when calling esimDelete().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['transactionId'] != null) { - formParams.append('transactionId', requestParameters['transactionId'] as any); - } - - - let urlPath = `/esim/delete`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * Delete eSIM - */ - async esimDeleteRaw(requestParameters: EsimDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimDeleteRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * Delete eSIM - */ - async esimDelete(requestParameters: EsimDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimDeleteRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimHistory without sending the request - */ - async esimHistoryRequestOpts(requestParameters: EsimHistoryRequest): Promise { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['start'] != null) { - formParams.append('start', requestParameters['start'] as any); - } - - if (requestParameters['length'] != null) { - formParams.append('length', requestParameters['length'] as any); - } - - if (requestParameters['search'] != null) { - formParams.append('search', requestParameters['search'] as any); - } - - - let urlPath = `/esim/history`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * View eSIM history - */ - async esimHistoryRaw(requestParameters: EsimHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimHistoryRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * View eSIM history - */ - async esimHistory(requestParameters: EsimHistoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimHistoryRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimLabelUpdate without sending the request - */ - async esimLabelUpdateRequestOpts(requestParameters: EsimLabelUpdateRequest): Promise { - if (requestParameters['transactionId'] == null) { - throw new runtime.RequiredError( - 'transactionId', - 'Required parameter "transactionId" was null or undefined when calling esimLabelUpdate().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['transactionId'] != null) { - formParams.append('transactionId', requestParameters['transactionId'] as any); - } - - if (requestParameters['label'] != null) { - formParams.append('label', requestParameters['label'] as any); - } - - - let urlPath = `/esim/label/update`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - * Update eSIM label - */ - async esimLabelUpdateRaw(requestParameters: EsimLabelUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimLabelUpdateRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label. - * Update eSIM label - */ - async esimLabelUpdate(requestParameters: EsimLabelUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimLabelUpdateRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimPlans without sending the request - */ - async esimPlansRequestOpts(requestParameters: EsimPlansRequest): Promise { - if (requestParameters['country'] == null) { - throw new runtime.RequiredError( - 'country', - 'Required parameter "country" was null or undefined when calling esimPlans().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['country'] != null) { - formParams.append('country', requestParameters['country'] as any); - } - - - let urlPath = `/esim/plans`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * View eSIM plans per country - */ - async esimPlansRaw(requestParameters: EsimPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimPlansRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * View eSIM plans per country - */ - async esimPlans(requestParameters: EsimPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimPlansRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimPricing without sending the request - */ - async esimPricingRequestOpts(requestParameters: EsimPricingRequest): Promise { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['start'] != null) { - formParams.append('start', requestParameters['start'] as any); - } - - if (requestParameters['length'] != null) { - formParams.append('length', requestParameters['length'] as any); - } - - if (requestParameters['search'] != null) { - formParams.append('search', requestParameters['search'] as any); - } - - - let urlPath = `/esim/pricing`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * View eSIM countries - */ - async esimPricingRaw(requestParameters: EsimPricingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimPricingRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * View eSIM countries - */ - async esimPricing(requestParameters: EsimPricingRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimPricingRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimProfile without sending the request - */ - async esimProfileRequestOpts(requestParameters: EsimProfileRequest): Promise { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['transactionId'] != null) { - formParams.append('transactionId', requestParameters['transactionId'] as any); - } - - - let urlPath = `/esim/profile`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * View eSIM profile - */ - async esimProfileRaw(requestParameters: EsimProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimProfileRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * View eSIM profile - */ - async esimProfile(requestParameters: EsimProfileRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimProfileRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimPurchase without sending the request - */ - async esimPurchaseRequestOpts(requestParameters: EsimPurchaseRequest): Promise { - if (requestParameters['plan'] == null) { - throw new runtime.RequiredError( - 'plan', - 'Required parameter "plan" was null or undefined when calling esimPurchase().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['plan'] != null) { - formParams.append('plan', requestParameters['plan'] as any); - } - - - let urlPath = `/esim/purchase`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * Purchase eSIM - */ - async esimPurchaseRaw(requestParameters: EsimPurchaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimPurchaseRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * Purchase eSIM - */ - async esimPurchase(requestParameters: EsimPurchaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimPurchaseRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimTopup without sending the request - */ - async esimTopupRequestOpts(requestParameters: EsimTopupRequest): Promise { - if (requestParameters['transactionId'] == null) { - throw new runtime.RequiredError( - 'transactionId', - 'Required parameter "transactionId" was null or undefined when calling esimTopup().' - ); - } - - if (requestParameters['plan'] == null) { - throw new runtime.RequiredError( - 'plan', - 'Required parameter "plan" was null or undefined when calling esimTopup().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearerAuth", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['transactionId'] != null) { - formParams.append('transactionId', requestParameters['transactionId'] as any); - } - - if (requestParameters['plan'] != null) { - formParams.append('plan', requestParameters['plan'] as any); - } - - - let urlPath = `/esim/topup`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * Top up eSIM - */ - async esimTopupRaw(requestParameters: EsimTopupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimTopupRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * Top up eSIM - */ - async esimTopup(requestParameters: EsimTopupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimTopupRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates request options for esimTopupPlans without sending the request - */ - async esimTopupPlansRequestOpts(requestParameters: EsimTopupPlansRequest): Promise { - if (requestParameters['plan'] == null) { - throw new runtime.RequiredError( - 'plan', - 'Required parameter "plan" was null or undefined when calling esimTopupPlans().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const consumes: runtime.Consume[] = [ - { contentType: 'application/x-www-form-urlencoded' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters['plan'] != null) { - formParams.append('plan', requestParameters['plan'] as any); - } - - - let urlPath = `/esim/topup_plans`; - - return { - path: urlPath, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }; - } - - /** - * Top Up Plans - */ - async esimTopupPlansRaw(requestParameters: EsimTopupPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const requestOptions = await this.esimTopupPlansRequestOpts(requestParameters); - const response = await this.request(requestOptions, initOverrides); - - if (this.isJsonMime(response.headers.get('content-type'))) { - return new runtime.JSONApiResponse(response); - } else { - return new runtime.TextApiResponse(response) as any; - } - } - - /** - * Top Up Plans - */ - async esimTopupPlans(requestParameters: EsimTopupPlansRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.esimTopupPlansRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/apis/InformationApi.ts b/src/apis/InformationApi.ts index 9cc8c2f..dd227ef 100644 --- a/src/apis/InformationApi.ts +++ b/src/apis/InformationApi.ts @@ -40,6 +40,32 @@ export interface PoolRetrieveValidRequest { includeStock?: string; } +export interface RequestAutoCountryRequest { + /** + * Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + */ + service: string; + /** + * Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. + */ + pricingOption?: number; +} + +export interface RequestHistorySearchRequest { + /** + * + */ + search: string; + /** + * + */ + cursor?: string; + /** + * + */ + limit?: number; +} + export interface RequestSuccessRateRequest { /** * Service name or service ID which can be retrieved at the /service/retrieve_all endpoint @@ -148,6 +174,32 @@ export interface InformationApiInterface { */ poolRetrieveValid(requestParameters: PoolRetrieveValidRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Creates request options for requestAutoCountry without sending the request + * @param {string} service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + * @param {number} [pricingOption] Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. + * @throws {RequiredError} + * @memberof InformationApiInterface + */ + requestAutoCountryRequestOpts(requestParameters: RequestAutoCountryRequest): Promise; + + /** + * Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order\'s \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request\'s IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + * @summary Pick the best country for a service + * @param {string} service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint + * @param {number} [pricingOption] Set to 1 to prefer the cheapest country among those close to the best score; 0 (default) picks purely on the score. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InformationApiInterface + */ + requestAutoCountryRaw(requestParameters: RequestAutoCountryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + + /** + * Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order\'s \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request\'s IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + * Pick the best country for a service + */ + requestAutoCountry(requestParameters: RequestAutoCountryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** * Creates request options for requestBalance without sending the request * @throws {RequiredError} @@ -170,6 +222,34 @@ export interface InformationApiInterface { */ requestBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Creates request options for requestHistorySearch without sending the request + * @param {string} search + * @param {string} [cursor] + * @param {number} [limit] + * @throws {RequiredError} + * @memberof InformationApiInterface + */ + requestHistorySearchRequestOpts(requestParameters: RequestHistorySearchRequest): Promise; + + /** + * _Not documented yet: the parameters below come straight from the code._ + * @summary History search + * @param {string} search + * @param {string} [cursor] + * @param {number} [limit] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InformationApiInterface + */ + requestHistorySearchRaw(requestParameters: RequestHistorySearchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + + /** + * _Not documented yet: the parameters below come straight from the code._ + * History search + */ + requestHistorySearch(requestParameters: RequestHistorySearchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** * Creates request options for requestSuccessRate without sending the request * @param {string} service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint @@ -429,6 +509,79 @@ export class InformationApi extends runtime.BaseAPI implements InformationApiInt return await response.value(); } + /** + * Creates request options for requestAutoCountry without sending the request + */ + async requestAutoCountryRequestOpts(requestParameters: RequestAutoCountryRequest): Promise { + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling requestAutoCountry().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['service'] != null) { + formParams.append('service', requestParameters['service'] as any); + } + + if (requestParameters['pricingOption'] != null) { + formParams.append('pricing_option', requestParameters['pricingOption'] as any); + } + + + let urlPath = `/request/auto_country`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order\'s \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request\'s IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + * Pick the best country for a service + */ + async requestAutoCountryRaw(requestParameters: RequestAutoCountryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.requestAutoCountryRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Returns the country SMSPool would order from for this service when you do not want to choose one (the quick order\'s \"Pick for me\"). It sends an HTTP POST request to the URL `https://api.smspool.net/request/auto_country`. Every country with stock is scored on its measured success rate (a country with no order history displays 100% but has nothing to back it up, so it is left out unless no measured country has stock), weighed down when little stock backs it, minus a little per dollar, plus a bonus when it matches the country your request\'s IP resolves to (a local number verifies more often). The IP country is only used for that comparison; it is neither stored nor returned. Ties go to more stock, then the lower price. With `pricing_option=1` the cheapest country within reach of the best score wins instead. Send `auto_country=1` to `/purchase/sms` to order with the same choice in one call. + * Pick the best country for a service + */ + async requestAutoCountry(requestParameters: RequestAutoCountryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.requestAutoCountryRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Creates request options for requestBalance without sending the request */ @@ -480,6 +633,91 @@ export class InformationApi extends runtime.BaseAPI implements InformationApiInt return await response.value(); } + /** + * Creates request options for requestHistorySearch without sending the request + */ + async requestHistorySearchRequestOpts(requestParameters: RequestHistorySearchRequest): Promise { + if (requestParameters['search'] == null) { + throw new runtime.RequiredError( + 'search', + 'Required parameter "search" was null or undefined when calling requestHistorySearch().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['search'] != null) { + formParams.append('search', requestParameters['search'] as any); + } + + if (requestParameters['cursor'] != null) { + formParams.append('cursor', requestParameters['cursor'] as any); + } + + if (requestParameters['limit'] != null) { + formParams.append('limit', requestParameters['limit'] as any); + } + + + let urlPath = `/request/history_search`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * _Not documented yet: the parameters below come straight from the code._ + * History search + */ + async requestHistorySearchRaw(requestParameters: RequestHistorySearchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.requestHistorySearchRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * _Not documented yet: the parameters below come straight from the code._ + * History search + */ + async requestHistorySearch(requestParameters: RequestHistorySearchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.requestHistorySearchRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Creates request options for requestSuccessRate without sending the request */ diff --git a/src/apis/RentalApi.ts b/src/apis/RentalApi.ts index 2086242..c177f39 100644 --- a/src/apis/RentalApi.ts +++ b/src/apis/RentalApi.ts @@ -1660,6 +1660,14 @@ export class RentalApi extends runtime.BaseAPI implements RentalApiInterface { const headerParameters: runtime.HTTPHeaders = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } const consumes: runtime.Consume[] = [ { contentType: 'application/x-www-form-urlencoded' }, ]; diff --git a/src/apis/SMSApi.ts b/src/apis/SMSApi.ts index 4fe779f..6e3c22d 100644 --- a/src/apis/SMSApi.ts +++ b/src/apis/SMSApi.ts @@ -63,6 +63,10 @@ export interface PurchaseSmsRequest { * In case you want to select a specific phone number to order */ phonenumber?: number; + /** + * Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request\'s IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. + */ + autoCountry?: number; /** * */ @@ -121,6 +125,13 @@ export interface SmsAllStockRequest { pool?: string; } +export interface SmsArchiveRequest { + /** + * + */ + orderid: string; +} + export interface SmsCancelRequest { /** * @@ -226,6 +237,7 @@ export interface SMSApiInterface { * @param {string} [activationType] Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. * @param {number} [carrier] Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) * @param {number} [phonenumber] In case you want to select a specific phone number to order + * @param {number} [autoCountry] Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request\\\'s IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. * @param {number} [software] * @throws {RequiredError} * @memberof SMSApiInterface @@ -247,6 +259,7 @@ export interface SMSApiInterface { * @param {string} [activationType] Options: SMS, VOICE, FLASH. SMS will receive regular SMS, VOICE will receive phone calls that mentions the SMS and FLASH is for FLASH calls for verification. * @param {number} [carrier] Options: 1 or 2. Pick a carrier (only works for pool Foxtrot US) * @param {number} [phonenumber] In case you want to select a specific phone number to order + * @param {number} [autoCountry] Set to 1 to let SMSPool pick the country: every country with stock is scored on its measured success rate (weighed down when little stock backs it, minus a little per dollar; countries with no order history are left out unless nothing else has stock) with a bonus for a local number, the country your request\\\'s IP resolves to; with pricing_option=1 the cheapest country close to the best score wins. Ignored when country is sent. The response then carries auto_country with the chosen country and the reason. * @param {number} [software] * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -410,6 +423,30 @@ export interface SMSApiInterface { */ smsAllStock(requestParameters: SmsAllStockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Creates request options for smsArchive without sending the request + * @param {string} orderid + * @throws {RequiredError} + * @memberof SMSApiInterface + */ + smsArchiveRequestOpts(requestParameters: SmsArchiveRequest): Promise; + + /** + * _Not documented yet: the parameters below come straight from the code._ + * @summary Archive + * @param {string} orderid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SMSApiInterface + */ + smsArchiveRaw(requestParameters: SmsArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + + /** + * _Not documented yet: the parameters below come straight from the code._ + * Archive + */ + smsArchive(requestParameters: SmsArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** * Creates request options for smsCancel without sending the request * @param {string} [orderid] @@ -542,7 +579,7 @@ export interface SMSApiInterface { smsMissedRequestOpts(requestParameters: SmsMissedRequest): Promise; /** - * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. * @summary Missed SMS * @param {number} [phonenumber] Only return messages for this number, including the country code. Leave it out for all your numbers. * @param {number} [limit] Maximum number of messages. Defaults to 100, at most 500. @@ -553,7 +590,7 @@ export interface SMSApiInterface { smsMissedRaw(requestParameters: SmsMissedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** - * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. * Missed SMS */ smsMissed(requestParameters: SmsMissedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; @@ -752,6 +789,10 @@ export class SMSApi extends runtime.BaseAPI implements SMSApiInterface { formParams.append('phonenumber', requestParameters['phonenumber'] as any); } + if (requestParameters['autoCountry'] != null) { + formParams.append('auto_country', requestParameters['autoCountry'] as any); + } + if (requestParameters['software'] != null) { formParams.append('software', requestParameters['software'] as any); } @@ -921,6 +962,14 @@ export class SMSApi extends runtime.BaseAPI implements SMSApiInterface { const headerParameters: runtime.HTTPHeaders = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } const consumes: runtime.Consume[] = [ { contentType: 'application/x-www-form-urlencoded' }, ]; @@ -1206,6 +1255,83 @@ export class SMSApi extends runtime.BaseAPI implements SMSApiInterface { return await response.value(); } + /** + * Creates request options for smsArchive without sending the request + */ + async smsArchiveRequestOpts(requestParameters: SmsArchiveRequest): Promise { + if (requestParameters['orderid'] == null) { + throw new runtime.RequiredError( + 'orderid', + 'Required parameter "orderid" was null or undefined when calling smsArchive().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['orderid'] != null) { + formParams.append('orderid', requestParameters['orderid'] as any); + } + + + let urlPath = `/sms/archive`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * _Not documented yet: the parameters below come straight from the code._ + * Archive + */ + async smsArchiveRaw(requestParameters: SmsArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.smsArchiveRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * _Not documented yet: the parameters below come straight from the code._ + * Archive + */ + async smsArchive(requestParameters: SmsArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.smsArchiveRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * Creates request options for smsCancel without sending the request */ @@ -1595,7 +1721,7 @@ export class SMSApi extends runtime.BaseAPI implements SMSApiInterface { } /** - * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. * Missed SMS */ async smsMissedRaw(requestParameters: SmsMissedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -1610,7 +1736,7 @@ export class SMSApi extends runtime.BaseAPI implements SMSApiInterface { } /** - * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes or Hark reward payouts. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. + * Some messages arrive on a number from your one-time orders but cannot finish the order, such as Ticketmaster and Seated codes, Hark reward payouts or Neon Money Talks messages. This returns those messages, the same ones the Missed SMS tool on the website shows. Only numbers from pool Foxtrot are covered. The newest messages come first. `url`, `code` and `email` hold the first link, code and email address found in the message, or an empty string. * Missed SMS */ async smsMissed(requestParameters: SmsMissedRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/src/apis/index.ts b/src/apis/index.ts index 8ef69d4..b300fc4 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -2,7 +2,6 @@ /* eslint-disable */ export * from './BusinessApi'; export * from './CarrierApi'; -export * from './ESIMsApi'; export * from './InformationApi'; export * from './PreordersApi'; export * from './PricingApi';