UNPKG

sp-rest-proxy

Version:

SharePoint REST API Proxy for Node.js and Express local serve

22 lines (21 loc) 735 B
import { RequestInit, Response, Headers } from 'node-fetch'; import { IProxyContext, IProxySettings } from '../core/interfaces'; export declare type SPFetch = (url: string, init?: RequestInit) => Promise<Response>; export declare type SPResponse = Response; export interface FetchError { response: SPResponse; status: number; statusText: string; body?: string; } export interface FetchOptions extends RequestInit { headers?: Headers; } export declare class SPClient { private ctx; private settings; private agent; constructor(ctx: IProxyContext, settings: IProxySettings); fetch: (url: string, init?: FetchOptions) => Promise<Response>; requestDigest: (webUrl: string) => Promise<string>; }