Skip to content

Latest commit

 

History

History
312 lines (228 loc) · 23.5 KB

File metadata and controls

312 lines (228 loc) · 23.5 KB

Bans

Overview

Global Ban Database

Available Operations

getRecent

Cost 2

Example Usage

import { WaveShield } from "waveshield";

const waveShield = new WaveShield({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const result = await waveShield.bans.getRecent({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { WaveShieldCore } from "waveshield/core.js";
import { bansGetRecent } from "waveshield/funcs/bansGetRecent.js";

// Use `WaveShieldCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const waveShield = new WaveShieldCore({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const res = await bansGetRecent(waveShield, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("bansGetRecent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetV1BansRecentRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetV1BansRecentResponse>

Errors

Error Type Status Code Content Type
errors.WaveShieldDefaultError 4XX, 5XX */*

search

Cost 5

Example Usage

import { WaveShield } from "waveshield";

const waveShield = new WaveShield({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const result = await waveShield.bans.search();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { WaveShieldCore } from "waveshield/core.js";
import { bansSearch } from "waveshield/funcs/bansSearch.js";

// Use `WaveShieldCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const waveShield = new WaveShieldCore({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const res = await bansSearch(waveShield);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("bansSearch failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetV1BansSearchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetV1BansSearchResponse>

Errors

Error Type Status Code Content Type
errors.WaveShieldDefaultError 4XX, 5XX */*

getStats

Cost 5

Example Usage

import { WaveShield } from "waveshield";

const waveShield = new WaveShield({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const result = await waveShield.bans.getStats();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { WaveShieldCore } from "waveshield/core.js";
import { bansGetStats } from "waveshield/funcs/bansGetStats.js";

// Use `WaveShieldCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const waveShield = new WaveShieldCore({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const res = await bansGetStats(waveShield);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("bansGetStats failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetV1BansStatsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetV1BansStatsResponse>

Errors

Error Type Status Code Content Type
errors.WaveShieldDefaultError 4XX, 5XX */*

getTrends

Cost 10

Example Usage

import { WaveShield } from "waveshield";

const waveShield = new WaveShield({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const result = await waveShield.bans.getTrends();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { WaveShieldCore } from "waveshield/core.js";
import { bansGetTrends } from "waveshield/funcs/bansGetTrends.js";

// Use `WaveShieldCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const waveShield = new WaveShieldCore({
  security: {
    apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
    apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
  },
});

async function run() {
  const res = await bansGetTrends(waveShield);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("bansGetTrends failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetV1BansTrendsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetV1BansTrendsResponse>

Errors

Error Type Status Code Content Type
errors.WaveShieldDefaultError 4XX, 5XX */*