UNPKG

@mindconnect/mindconnect-nodejs

Version:

NodeJS Library for Siemens Insights Hub Connectivity - TypeScript SDK for Insights Hub and Industrial IoT - Command Line Interface - Insights Hub Development Proxy (Siemens Insights Hub was formerly known as MindSphere)

101 lines (100 loc) 2.9 kB
import { MindConnectBase, TokenRotation } from "./mindconnect-base"; /** * Frontend Auth for Backend (only used from CLI) * * @export * @class BrowserAuth * @implements {TokenRotation} */ export declare class FrontendAuth extends MindConnectBase implements TokenRotation { private _gateway; private _sesionCookie; private _xsrfToken; /** * perform http action * * @param {({ * verb: "GET" | "POST" | "PATCH" | "PUT" | "DELETE"; * gateway: string; * baseUrl: string; * authorization: string; * body?: Object; * message?: string; * octetStream?: boolean; * multiPartFormData?: boolean; * additionalHeaders?: Object; * noResponse?: boolean; * rawResponse?: boolean; * returnHeaders?: boolean; * ignoreCodes?: number[]; * })} { * verb, * gateway, * baseUrl, * authorization, * body, * message, * octetStream, * multiPartFormData, * additionalHeaders, * noResponse, * rawResponse, * returnHeaders, * ignoreCodes, * } * @returns {Promise<Object>} * * @memberOf MindConnectBase */ HttpAction({ verb, gateway, baseUrl, authorization, body, message, octetStream, multiPartFormData, additionalHeaders, noResponse, rawResponse, returnHeaders, ignoreCodes, }: { verb: "GET" | "POST" | "PATCH" | "PUT" | "DELETE"; gateway: string; baseUrl: string; authorization: string; body?: Object; message?: string; octetStream?: boolean; multiPartFormData?: boolean; additionalHeaders?: Object; noResponse?: boolean; rawResponse?: boolean; returnHeaders?: boolean; ignoreCodes?: number[]; }): Promise<Object | undefined>; private isNodeOrCliCall; /** * * Returns true; MindSphere Gateway is taking care of this * * @returns {Promise<boolean>} * * @memberOf BrowserAuth */ RenewToken(): Promise<boolean>; /** * * Returns ""; MindSphere Gateway is taking care of this * * @returns {Promise<string>} * * @memberOf BrowserAuth */ GetToken(): Promise<string>; /** * * Returns ""; MindSphere Gateway is taking care of this * * @returns {string} * * @memberOf BrowserAuth */ GetGateway(): string; /** * * * Returns ""; MindSphere Gateway is taking care of this * * @returns {string} * * @memberOf BrowserAuth */ GetTenant(): string; private getCookieValue; constructor(_gateway: string, _sesionCookie: string, _xsrfToken: string); }