123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- export interface IdsConfig {
- endpoint: string;
- accessKeyId: string;
- accessKeySecret: string;
- }
- export declare enum IdsChannel {
- Csdn = 1,
- Wechat = 2,
- Zhihu = 3,
- Juejin = 4
- }
- export declare type IdsCrawlRule = 'fulldata' | 'extdata';
- export interface IdsArticle {
- code: IdsChannel;
- author_id: string | number;
- cover_url?: string;
- title: string;
- author_name?: string;
- sn_code: string;
- original_url?: string;
- source_address: string;
- is_headline?: 0 | 1;
- is_original: 0 | 1;
- body: string;
- label?: string;
- published_at: Date;
- external_read_num?: number;
- external_see_num?: number;
- external_like_num?: number;
- external_comment_num?: number;
- }
- export declare enum IdsSource {
- Manual = 0,
- User = 1,
- AliyunMarket = 2,
- TencentCloudMarket = 3,
- HuaweiCloudMarket = 4,
- Xiniu = 6,
- Website = 7
- }
- export interface IdsProvider {
- name: string;
- short_name?: string;
- tel?: string;
- email?: string;
- logo?: string;
- description?: string;
- service_time?: string;
- source: IdsSource;
- source_pid: string | number;
- source_url?: string;
- }
- export interface IdsSolutionExtra {
- api_gateway: {
- service_id: string;
- api_id: string;
- dep_api_id?: string[];
- };
- icon_padding?: number;
- }
- export interface IdsSolution {
- uid: number;
- title: string;
- description: string;
- images: string;
- details: string;
- plain_text?: string;
- service_type?: string[];
- dimension: 1 | 2;
- status: number;
- source: IdsSource;
- source_id: string;
- source_pid: string;
- source_dt?: string;
- source_url: string;
- source_tags?: string[];
- source_labels?: string;
- ext_sold?: number;
- ext_score?: number;
- skus?: any[];
- api?: any[];
- doc_path?: string;
- is_signed?: 1 | 0;
- type?: 'gateway';
- min_price?: number;
- max_price?: number;
- extra?: IdsSolutionExtra | string;
- }
- export declare const randomtail: () => string;
- export declare class Ids {
- config: IdsConfig;
- constructor(config: IdsConfig);
- private request;
- getCrawlAuthors(channel: IdsChannel): Promise<any>;
- getCrawlArticleRules(params: {
- ids: string[];
- channel: IdsChannel;
- }): Promise<any>;
- putArticle(data: IdsArticle, rule: IdsCrawlRule): Promise<any>;
- putProvider(data: IdsProvider): Promise<any>;
- putSolution(data: IdsSolution): Promise<any>;
- }
|