import { MindConnectBase , TokenRotation } from "./mindconnect-base" ; import { isUrl } from "./utils" ; see https export class extends MindConnectBase implements TokenRotation export class UserAuth extends MindConnectBase implements TokenRotation { private _token : string ; private _gateway : string ; param { string } token param { string } gateway see https memberOf constructor ( token , gateway ) { super ( ) ; if ( ! isUrl ( gateway ) ) { throw new Error ( "the gateway must be an URL (e.g. https://gateway.eu1.mindsphere.io" ) ; } this . _token = token . replace ( "Bearer" , "" ) . trim ( ) ; this . _gateway = gateway ; } returns { Promise < boolean > } memberOf async RenewToken ( ) { return true ; } returns { Promise < string > } memberOf async GetToken ( ) { return this . _token ; } returns { string } memberOf GetGateway ( ) { return this . _gateway ; } returns { string } memberOf GetTenant ( ) { return "" ; } }