@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
164 lines (163 loc) • 6.56 kB
TypeScript
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.22
* Contact: contact@emergentmethods.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type { Continent, Offset1, StoriesResponse, StoryResponse } from '../models/index';
export interface GetStoriesRequest {
query?: string;
categories?: Array<GetStoriesCategoriesEnum>;
uuids?: Array<string>;
startTimestamp?: number;
endTimestamp?: number;
sortBy?: GetStoriesSortByEnum;
sortType?: GetStoriesSortTypeEnum;
continent?: Continent;
offset?: Offset1;
limit?: number;
expandUpdates?: boolean;
maxUpdates?: number;
maxArticles?: number;
method?: GetStoriesMethodEnum;
objType?: Array<GetStoriesObjTypeEnum>;
reddit?: number;
citationMethod?: GetStoriesCitationMethodEnum;
similarityScoreThreshold?: number;
provocative?: GetStoriesProvocativeEnum;
strategy?: GetStoriesStrategyEnum;
}
export interface GetStoryRequest {
storyId: string;
expandUpdates?: boolean;
maxUpdates?: number;
maxArticles?: number;
reddit?: number;
citationMethod?: GetStoryCitationMethodEnum;
condenseAuxillaryUpdates?: boolean;
}
/**
*
*/
export declare class StoriesApi extends runtime.BaseAPI {
/**
* Filter on our custom, in-house written, stories/events/narratives. These stories are based on clusters of articles (which come through this endpoint as well, so you can consider this a clustering endpoint). We write stories and track them through time. The enrichments include a full Reddit overview (including all the thread metadata), as well as descriptions of the reporting voice, the key takeaways, contradictions, all the entities, and much, much more. You can see this data in action, and filter it similarly at `https://asknews.app/stories`
* Filter and search for top news narratives
*/
getStoriesRaw(requestParameters: GetStoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StoriesResponse>>;
/**
* Filter on our custom, in-house written, stories/events/narratives. These stories are based on clusters of articles (which come through this endpoint as well, so you can consider this a clustering endpoint). We write stories and track them through time. The enrichments include a full Reddit overview (including all the thread metadata), as well as descriptions of the reporting voice, the key takeaways, contradictions, all the entities, and much, much more. You can see this data in action, and filter it similarly at `https://asknews.app/stories`
* Filter and search for top news narratives
*/
getStories(requestParameters?: GetStoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StoriesResponse>;
/**
* Get a single news story given its UUID.
* Get a story containing updates
*/
getStoryRaw(requestParameters: GetStoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StoryResponse>>;
/**
* Get a single news story given its UUID.
* Get a story containing updates
*/
getStory(requestParameters: GetStoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StoryResponse>;
}
/**
* @export
*/
export declare const GetStoriesCategoriesEnum: {
readonly Politics: "Politics";
readonly Economy: "Economy";
readonly Finance: "Finance";
readonly Science: "Science";
readonly Technology: "Technology";
readonly Sports: "Sports";
readonly Climate: "Climate";
readonly Environment: "Environment";
readonly Culture: "Culture";
readonly Entertainment: "Entertainment";
readonly Business: "Business";
readonly Health: "Health";
readonly International: "International";
};
export type GetStoriesCategoriesEnum = typeof GetStoriesCategoriesEnum[keyof typeof GetStoriesCategoriesEnum];
/**
* @export
*/
export declare const GetStoriesSortByEnum: {
readonly Published: "published";
readonly Coverage: "coverage";
readonly Sentiment: "sentiment";
readonly Relevance: "relevance";
readonly Confidence: "confidence";
};
export type GetStoriesSortByEnum = typeof GetStoriesSortByEnum[keyof typeof GetStoriesSortByEnum];
/**
* @export
*/
export declare const GetStoriesSortTypeEnum: {
readonly Asc: "asc";
readonly Desc: "desc";
};
export type GetStoriesSortTypeEnum = typeof GetStoriesSortTypeEnum[keyof typeof GetStoriesSortTypeEnum];
/**
* @export
*/
export declare const GetStoriesMethodEnum: {
readonly Nl: "nl";
readonly Kw: "kw";
readonly Both: "both";
};
export type GetStoriesMethodEnum = typeof GetStoriesMethodEnum[keyof typeof GetStoriesMethodEnum];
/**
* @export
*/
export declare const GetStoriesObjTypeEnum: {
readonly Story: "story";
readonly StoryUpdate: "story_update";
};
export type GetStoriesObjTypeEnum = typeof GetStoriesObjTypeEnum[keyof typeof GetStoriesObjTypeEnum];
/**
* @export
*/
export declare const GetStoriesCitationMethodEnum: {
readonly Brackets: "brackets";
readonly Urls: "urls";
readonly None: "none";
};
export type GetStoriesCitationMethodEnum = typeof GetStoriesCitationMethodEnum[keyof typeof GetStoriesCitationMethodEnum];
/**
* @export
*/
export declare const GetStoriesProvocativeEnum: {
readonly Unknown: "unknown";
readonly Low: "low";
readonly Medium: "medium";
readonly High: "high";
readonly All: "all";
};
export type GetStoriesProvocativeEnum = typeof GetStoriesProvocativeEnum[keyof typeof GetStoriesProvocativeEnum];
/**
* @export
*/
export declare const GetStoriesStrategyEnum: {
readonly Default: "default";
readonly Topstories: "topstories";
readonly TopstoriesCategories: "topstories_categories";
readonly TopstoriesContinents: "topstories_continents";
};
export type GetStoriesStrategyEnum = typeof GetStoriesStrategyEnum[keyof typeof GetStoriesStrategyEnum];
/**
* @export
*/
export declare const GetStoryCitationMethodEnum: {
readonly Brackets: "brackets";
readonly Urls: "urls";
readonly None: "none";
};
export type GetStoryCitationMethodEnum = typeof GetStoryCitationMethodEnum[keyof typeof GetStoryCitationMethodEnum];