UNPKG

@tensorify.io/cli

Version:

Official CLI for Tensorify.io - Build, test, and deploy machine learning plugins

31 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.urlGenerator = void 0; class UrlGenerator { getBaseUrl(isDev) { return isDev ? "http://localhost:3004" : "https://plugins.tensorify.io"; } getSignInUrl(isDev, redirectUrl) { const baseUrl = this.getBaseUrl(isDev); const encodedRedirectUrl = encodeURIComponent(redirectUrl); return `${baseUrl}/api/cli/auth/callback?redirect_url=${encodedRedirectUrl}`; } getCallbackUrl(isDev, port) { if (isDev) { return `http://localhost:${port}/callback`; } else { // In production, CLI runs locally, so we always use localhost for the callback return `http://localhost:${port}/callback`; } } getApiUrl(isDev) { return isDev ? "http://localhost:3004" : "https://plugins.tensorify.io"; } getUserProfileUrl(isDev) { const baseUrl = this.getApiUrl(isDev); return `${baseUrl}/api/user/profile`; } } exports.urlGenerator = new UrlGenerator(); //# sourceMappingURL=url-generator.js.map