@plastic-ant/lightcast-api
Version:
An unofficial helper package for accessing the Lightcast API endpoints
123 lines (122 loc) • 5.16 kB
TypeScript
/// <reference types="node" />
import { LightcastAPIClient } from "../..";
import type { Status, Response } from "../common-types";
/**
* @see API docs {@link https://docs.lightcast.dev/apis/skills}
*/
declare const _default: (client: LightcastAPIClient) => {
baseUrl: string;
/**
* Health check endpoint
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-get-service-status}
*/
status: () => Promise<import("axios").AxiosResponse<Response<Status>, any>>;
/**
* Get service metadata, including latest version, and attribution text. Caching is encouraged, but the metadata can change weekly.
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-get-service-metadata}
*/
meta: () => Promise<import("axios").AxiosResponse<Response, any>>;
/**
* Version latest can be used as an alias to the latest skill version. See our Skills Taxonomy Changelog for the updates in each version.
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-list-all-versions}
*/
versions: () => Promise<import("axios").AxiosResponse<Response<string[]>, any>>;
/**
*
* @param version
* @returns
*/
version: (version?: string) => {
/**
* Get version specific metadata including available fields, types, skill counts and removed skill counts.
* @param params
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-get-version-metadata}
*/
meta: <R = Response>() => Promise<import("axios").AxiosResponse<R, any>>;
/**
* Get version specific changes.
* @param params
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-get-version-changes}
*/
changes: <R_1 = Response>() => Promise<import("axios").AxiosResponse<R_1, any>>;
/**
* Returns a list of all skills in {version} sorted by skill name
* @param params
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-list-all-skills}
*/
listAll: <R_2 = Response, Q = {
q?: string | undefined;
limit?: number | undefined;
typeIds?: string | undefined;
fields?: string | undefined;
}>(params?: Q | undefined) => Promise<import("axios").AxiosResponse<R_2, any>>;
/**
* Returns a list of requested skills in {version}
* @param params
* @param body
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#post-list-requested-skills}
*/
listRequested: <R_3 = Response, B = {
ids: string[];
}>(body: B, params?: {
typeIds?: string;
fields?: string;
}) => Promise<import("axios").AxiosResponse<R_3, any>>;
/**
* Returns information about a specific skill.
* @param params
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#get-get-a-skill-by-id}
*/
byId: <R_4 = Response>(id: string) => Promise<import("axios").AxiosResponse<R_4, any>>;
/**
* Returns a list of skills that are related to the requested skills.
* @param params
* @param body
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#post-find-related-skills}
*/
findRelated: <R_5 = Response, B_1 = {
ids: string[];
limit?: number | undefined;
typeIds?: string | undefined;
fields?: string | undefined;
}>(body: B_1) => Promise<import("axios").AxiosResponse<R_5, any>>;
/**
* Returns a list of skills found in a document.
* @param params
* @param body
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#versions-version-extract}
*/
extract: <R_6 = Response, B_2 = string | Buffer | {
text: string;
confidenceThreshold?: number | undefined;
}>(body: B_2, params?: {
language?: string;
confidenceThreshold?: number;
}) => Promise<import("axios").AxiosResponse<R_6, any>>;
/**
* Returns a list of skills found in a document with its trace information, including contextual classification data found in the document that resulted in a skill match, and optionally the normalized text from the document used to extract skills.
* @param params
* @param body
* @returns
* @See API docs {@link https://docs.lightcast.dev/apis/skills#versions-version-extract-trace}
*/
extractTrace: <R_7 = Response, B_3 = string | Buffer | {
text: string;
confidenceThreshold?: number | undefined;
}>(body: B_3, params?: {
language?: string;
includeNormalizedText: boolean;
}) => Promise<import("axios").AxiosResponse<R_7, any>>;
};
};
export default _default;