FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

api-client-typescript/docs/sdks/verification/README.md at main · gleanwork/api-client-typescript · GitHub

Latest commit

 

History

History
278 lines (200 loc) · 22.6 KB

File metadata and controls

278 lines (200 loc) · 22.6 KB

Client.Verification

Overview

Available Operations

addReminder

Creates a verification reminder for the document. Users can create verification reminders from different product surfaces.

Example Usage

import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
  const result = await glean.client.verification.addReminder({
    documentId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { GleanCore } from "@gleanwork/api-client/core.js";
import { clientVerificationAddReminder } from "@gleanwork/api-client/funcs/clientVerificationAddReminder.js";

// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
  const res = await clientVerificationAddReminder(glean, {
    documentId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clientVerificationAddReminder failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useClientVerificationAddReminderMutation
} from "@gleanwork/api-client/react-query/clientVerificationAddReminder.js";

Parameters

Parameter Type Required Description
reminderRequest components.ReminderRequest ✔️ Details about the reminder.
locale string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
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<components.Verification>

Errors

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

list

Returns the information to be rendered in verification dashboard. Includes information for each document owned by user regarding their verifications.

Example Usage

import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
  const result = await glean.client.verification.list();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { GleanCore } from "@gleanwork/api-client/core.js";
import { clientVerificationList } from "@gleanwork/api-client/funcs/clientVerificationList.js";

// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

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

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useClientVerificationListMutation
} from "@gleanwork/api-client/react-query/clientVerificationList.js";

Parameters

Parameter Type Required Description
count number Maximum number of documents to return
locale string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
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<components.VerificationFeed>

Errors

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

verify

Verify documents to keep the knowledge up to date within customer corpus.

Example Usage

import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
  const result = await glean.client.verification.verify({
    documentId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { GleanCore } from "@gleanwork/api-client/core.js";
import { clientVerificationVerify } from "@gleanwork/api-client/funcs/clientVerificationVerify.js";

// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
  apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
  const res = await clientVerificationVerify(glean, {
    documentId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("clientVerificationVerify failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useClientVerificationVerifyMutation
} from "@gleanwork/api-client/react-query/clientVerificationVerify.js";

Parameters

Parameter Type Required Description
verifyRequest components.VerifyRequest ✔️ Details about the verification request.
locale string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
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<components.Verification>

Errors

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

Back | FazBrowse Home | New Git URL