@getanyapi/sdk 0.24.0 → 0.26.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/dist/index.cjs CHANGED
@@ -364,8 +364,9 @@ function parseOffer(value, path) {
364
364
  const model = stringField(raw, "model", path);
365
365
  const unit = stringField(raw, "unit", path);
366
366
  const maxUsd = numberField(raw, "maxUsd", path);
367
+ const maxPer1kUsd = numberField(raw, "maxPer1kUsd", path);
367
368
  if (model === "flat") {
368
- return unit === "request" ? { model, unit, maxUsd } : malformed(path);
369
+ return unit === "request" ? { model, unit, maxUsd, maxPer1kUsd } : malformed(path);
369
370
  }
370
371
  if (model !== "linear") return malformed(`${path}.model`);
371
372
  if (unit.length === 0) return malformed(`${path}.unit`);
@@ -374,14 +375,16 @@ function parseOffer(value, path) {
374
375
  unit,
375
376
  baseUsd: numberField(raw, "baseUsd", path),
376
377
  perUnitUsd: numberField(raw, "perUnitUsd", path),
377
- maxUsd
378
+ maxUsd,
379
+ maxPer1kUsd
378
380
  };
379
381
  }
380
382
  function parsePricing(value, path) {
381
383
  const raw = record(value, path);
382
384
  return {
383
385
  from: parseOffer(raw["from"], `${path}.from`),
384
- failoverMaxUsd: numberField(raw, "failoverMaxUsd", path)
386
+ failoverMaxUsd: numberField(raw, "failoverMaxUsd", path),
387
+ failoverMaxPer1kUsd: numberField(raw, "failoverMaxPer1kUsd", path)
385
388
  };
386
389
  }
387
390
  function parseExecution(value, path) {
@@ -5903,6 +5906,64 @@ var TwitterNamespace = class {
5903
5906
  options
5904
5907
  );
5905
5908
  }
5909
+ /**
5910
+ * X / Twitter Community Search
5911
+ *
5912
+ * Search X (Twitter) communities by keyword and get their id, name, topic, and member count with cursor pagination. This is how you find a community URL to pass to twitter.community or twitter.community_tweets.
5913
+ *
5914
+ * Price: $0.00018 per request plus $0.00018 per result (maximum $0.00198).
5915
+ *
5916
+ * @example
5917
+ * const res = await client.twitter.searchCommunities({ query: "artificial intelligence" });
5918
+ */
5919
+ searchCommunities(input, options) {
5920
+ return this._core.run("twitter.search_communities", input, options);
5921
+ }
5922
+ /**
5923
+ * Iterate every result of X / Twitter Community Search across pages.
5924
+ *
5925
+ * Yields items directly; call `.pages()` on the return value to walk whole
5926
+ * result pages instead (each carries its own costUsd).
5927
+ */
5928
+ iterSearchCommunities(input, options) {
5929
+ return paginate(
5930
+ this._core,
5931
+ "twitter.search_communities",
5932
+ input,
5933
+ "communities",
5934
+ false,
5935
+ options
5936
+ );
5937
+ }
5938
+ /**
5939
+ * X / Twitter User Search
5940
+ *
5941
+ * Search X (Twitter) accounts by keyword - the People tab of X search. Matches handles, display names, and profile bios, and returns normalized profile records with follower, following, and post counts plus cursor pagination. Use twitter.search for posts.
5942
+ *
5943
+ * Price: $0.00075 per request.
5944
+ *
5945
+ * @example
5946
+ * const res = await client.twitter.searchUsers({ query: "ai agents" });
5947
+ */
5948
+ searchUsers(input, options) {
5949
+ return this._core.run("twitter.search_users", input, options);
5950
+ }
5951
+ /**
5952
+ * Iterate every result of X / Twitter User Search across pages.
5953
+ *
5954
+ * Yields items directly; call `.pages()` on the return value to walk whole
5955
+ * result pages instead (each carries its own costUsd).
5956
+ */
5957
+ iterSearchUsers(input, options) {
5958
+ return paginate(
5959
+ this._core,
5960
+ "twitter.search_users",
5961
+ input,
5962
+ "users",
5963
+ false,
5964
+ options
5965
+ );
5966
+ }
5906
5967
  /**
5907
5968
  * X / Twitter Tweet Thread
5908
5969
  *