@scrypted/client
Advanced tools
Comparing version 1.0.36 to 1.0.37
@@ -49,2 +49,3 @@ import { ScryptedStatic } from "@scrypted/types"; | ||
} | ||
export declare function redirectScryptedLogin(baseUrl?: string): void; | ||
export declare function connectScryptedClient(options: ScryptedClientOptions): Promise<ScryptedClientStatic>; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.connectScryptedClient = exports.ScryptedClientLoginError = exports.checkScryptedClientLogin = exports.loginScryptedClient = void 0; | ||
exports.connectScryptedClient = exports.redirectScryptedLogin = exports.ScryptedClientLoginError = exports.checkScryptedClientLogin = exports.loginScryptedClient = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
@@ -106,2 +106,7 @@ const eio = __importStar(require("engine.io-client")); | ||
exports.ScryptedClientLoginError = ScryptedClientLoginError; | ||
function redirectScryptedLogin(baseUrl) { | ||
baseUrl = baseUrl || ''; | ||
window.location.href = `${baseUrl}/endpoint/@scrypted/core/public/?redirect_uri=${encodeURIComponent(window.location.href)}`; | ||
} | ||
exports.redirectScryptedLogin = redirectScryptedLogin; | ||
async function connectScryptedClient(options) { | ||
@@ -108,0 +113,0 @@ let { baseUrl, pluginId, clientName, username, password } = options; |
{ | ||
"name": "@scrypted/client", | ||
"version": "1.0.36", | ||
"version": "1.0.37", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/packages/client/src/index.js", |
@@ -116,2 +116,7 @@ import { ScryptedStatic } from "@scrypted/types"; | ||
export function redirectScryptedLogin(baseUrl?: string) { | ||
baseUrl = baseUrl || ''; | ||
window.location.href = `${baseUrl}/endpoint/@scrypted/core/public/?redirect_uri=${encodeURIComponent(window.location.href)}`; | ||
} | ||
export async function connectScryptedClient(options: ScryptedClientOptions): Promise<ScryptedClientStatic> { | ||
@@ -118,0 +123,0 @@ let { baseUrl, pluginId, clientName, username, password } = options; |
Sorry, the diff of this file is not supported yet
310626
3241