@proxyrequest/sdk 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 4.1.0 (2026-09-25)
6
+
7
+ - Add provider data balances with typed pagination, byte strings, calculation status, and checkpoint history. Access requires a superuser JWT or a superuser-owned API key.
8
+ - Add optional `include_asns` to country, region, and city methods. Request `true` to include nested ASNs; the current API returns empty nested ASN arrays by default.
9
+ - Preserve existing public methods and argument compatibility, and regenerate SDK reference documentation from the latest public API contract.
10
+
5
11
  ## [Unreleased]
6
12
 
7
13
  ## [4.0.0] - 2026-09-22
package/README.md CHANGED
@@ -87,8 +87,8 @@ Never embed a Static API key or webhook secret in frontend JavaScript. Browser s
87
87
 
88
88
  ## Resource API
89
89
 
90
- The client exposes 80 supported operations through 17 resource groups. The pinned
91
- public schema contains 82 operations; the disabled `sessions_list` and
90
+ The client exposes 81 supported operations through 18 resource groups. The pinned
91
+ public schema contains 83 operations; the disabled `sessions_list` and
92
92
  `sessions_destroy` operations are intentionally excluded from the SDK. Sticky
93
93
  session options in proxy generation remain supported.
94
94
 
@@ -107,6 +107,7 @@ client.news;
107
107
  client.orders;
108
108
  client.packages;
109
109
  client.profile;
110
+ client.providers;
110
111
  client.proxies;
111
112
  client.rewards;
112
113
  client.settings;
@@ -312,7 +313,7 @@ It reuses base URL, authentication, language, timeout, cancellation, and `ApiErr
312
313
 
313
314
  ## Types and generated code
314
315
 
315
- All 127 OpenAPI model types are exported from both the package root and `@proxyrequest/sdk/models`:
316
+ All public OpenAPI model types are exported from both the package root and `@proxyrequest/sdk/models`:
316
317
 
317
318
  ```ts
318
319
  import type { User, InvoiceCreateRequestRequest } from "@proxyrequest/sdk/models";
@@ -370,3 +371,18 @@ Send only `package_id`, without `data`. A system administrator can reset any use
370
371
  Persist one operation ID and reuse it when retrying the same reset, including after a process restart. This prevents a repeated request from clearing a later top-up. Use subtraction when an explicit amount should be removed from a child quota. The backend must support the reset endpoint before calling it.
371
372
 
372
373
  Version 2.1 retains legacy user and invoice models from 2.0 for compatibility with older deployments. These compatibility types do not change the current public API contract.
374
+
375
+ ## Provider data balances
376
+
377
+ Available since 4.1.0. Authenticate with a superuser JWT or an API key owned by an active superuser.
378
+
379
+ ```ts
380
+ const page = await client.providers.listDataBalances({ limit: 20 });
381
+ for (const balance of page.results) {
382
+ console.log(balance.provider_name, balance.remaining_bytes, balance.history);
383
+ }
384
+ ```
385
+
386
+ Provider byte amounts are exact decimal **strings**, including history entries; calculated usage and remaining amounts can be `null`. The response includes observation and calculation times, freshness, errors, and recent checkpoint history. History is limited by the server's `PROVIDER_DATA_BALANCE_HISTORY_LIMIT` setting (default 10). Standard pagination applies to providers.
387
+
388
+ Country, region, and city methods also support `includeAsns`. Set it to `true` to populate nested ASN arrays; omitted or false uses the API's empty-array default.
package/dist/index.cjs CHANGED
@@ -1813,6 +1813,7 @@ var LocationsResource = class {
1813
1813
  query: {
1814
1814
  code: options.code,
1815
1815
  country__code: options.countryCode,
1816
+ include_asns: options.includeAsns,
1816
1817
  limit: options.limit,
1817
1818
  name: options.name,
1818
1819
  offset: options.offset,
@@ -1837,7 +1838,10 @@ var LocationsResource = class {
1837
1838
  path: "/locations/cities/{id}"
1838
1839
  }, {
1839
1840
  path: { id: options.id },
1840
- query: { package_id: options.packageId },
1841
+ query: {
1842
+ include_asns: options.includeAsns,
1843
+ package_id: options.packageId
1844
+ },
1841
1845
  headers: { "Accept-Language": options.acceptLanguage },
1842
1846
  ...options.request === void 0 ? {} : { request: options.request }
1843
1847
  });
@@ -1896,6 +1900,7 @@ var LocationsResource = class {
1896
1900
  }, {
1897
1901
  query: {
1898
1902
  code: options.code,
1903
+ include_asns: options.includeAsns,
1899
1904
  limit: options.limit,
1900
1905
  name: options.name,
1901
1906
  offset: options.offset,
@@ -1919,7 +1924,10 @@ var LocationsResource = class {
1919
1924
  path: "/locations/countries/{id}"
1920
1925
  }, {
1921
1926
  path: { id: options.id },
1922
- query: { package_id: options.packageId },
1927
+ query: {
1928
+ include_asns: options.includeAsns,
1929
+ package_id: options.packageId
1930
+ },
1923
1931
  headers: { "Accept-Language": options.acceptLanguage },
1924
1932
  ...options.request === void 0 ? {} : { request: options.request }
1925
1933
  });
@@ -1963,6 +1971,7 @@ var LocationsResource = class {
1963
1971
  query: {
1964
1972
  code: options.code,
1965
1973
  country__code: options.countryCode,
1974
+ include_asns: options.includeAsns,
1966
1975
  limit: options.limit,
1967
1976
  name: options.name,
1968
1977
  offset: options.offset,
@@ -1986,7 +1995,10 @@ var LocationsResource = class {
1986
1995
  path: "/locations/regions/{id}"
1987
1996
  }, {
1988
1997
  path: { id: options.id },
1989
- query: { package_id: options.packageId },
1998
+ query: {
1999
+ include_asns: options.includeAsns,
2000
+ package_id: options.packageId
2001
+ },
1990
2002
  headers: { "Accept-Language": options.acceptLanguage },
1991
2003
  ...options.request === void 0 ? {} : { request: options.request }
1992
2004
  });
@@ -2314,6 +2326,31 @@ var ProfileResource = class {
2314
2326
  });
2315
2327
  }
2316
2328
  };
2329
+ var ProvidersResource = class {
2330
+ #client;
2331
+ constructor(client) {
2332
+ this.#client = client;
2333
+ }
2334
+ /** List provider data balances */
2335
+ async listDataBalances(options = {}) {
2336
+ return (await this.listDataBalancesWithResponse(options)).data;
2337
+ }
2338
+ /** List provider data balances; include response metadata. */
2339
+ async listDataBalancesWithResponse(options = {}) {
2340
+ return this.#client._callWithResponse({
2341
+ operationId: "providers_data_balances_list",
2342
+ method: "GET",
2343
+ path: "/providers/data-balances"
2344
+ }, {
2345
+ query: {
2346
+ limit: options.limit,
2347
+ offset: options.offset
2348
+ },
2349
+ headers: { "Accept-Language": options.acceptLanguage },
2350
+ ...options.request === void 0 ? {} : { request: options.request }
2351
+ });
2352
+ }
2353
+ };
2317
2354
  var ProxiesResource = class {
2318
2355
  #client;
2319
2356
  constructor(client) {
@@ -2776,6 +2813,7 @@ function createResourceCollection(client) {
2776
2813
  orders: new OrdersResource(client),
2777
2814
  packages: new PackagesResource(client),
2778
2815
  profile: new ProfileResource(client),
2816
+ providers: new ProvidersResource(client),
2779
2817
  proxies: new ProxiesResource(client),
2780
2818
  rewards: new RewardsResource(client),
2781
2819
  settings: new SettingsResource(client),
@@ -2823,7 +2861,7 @@ function offsetFromUrl(url) {
2823
2861
  //#endregion
2824
2862
  //#region src/client.ts
2825
2863
  const DEFAULT_BASE_URL = "https://api.proxyrequest.com/api/v1";
2826
- const SDK_VERSION = "4.0.0";
2864
+ const SDK_VERSION = "4.1.0";
2827
2865
  var ProxyRequestClient = class ProxyRequestClient {
2828
2866
  apiKeys;
2829
2867
  affiliates;
@@ -2836,6 +2874,7 @@ var ProxyRequestClient = class ProxyRequestClient {
2836
2874
  orders;
2837
2875
  packages;
2838
2876
  profile;
2877
+ providers;
2839
2878
  proxies;
2840
2879
  rewards;
2841
2880
  settings;
@@ -2886,6 +2925,7 @@ var ProxyRequestClient = class ProxyRequestClient {
2886
2925
  this.orders = resources.orders;
2887
2926
  this.packages = resources.packages;
2888
2927
  this.profile = resources.profile;
2928
+ this.providers = resources.providers;
2889
2929
  this.proxies = resources.proxies;
2890
2930
  this.rewards = resources.rewards;
2891
2931
  this.settings = resources.settings;
@@ -3129,6 +3169,7 @@ exports.OrdersResource = OrdersResource;
3129
3169
  exports.PackagesResource = PackagesResource;
3130
3170
  exports.PaginationError = PaginationError;
3131
3171
  exports.ProfileResource = ProfileResource;
3172
+ exports.ProvidersResource = ProvidersResource;
3132
3173
  exports.ProxiesResource = ProxiesResource;
3133
3174
  exports.ProxyRequestClient = ProxyRequestClient;
3134
3175
  exports.ProxyRequestError = ProxyRequestError;