public MyGetPackageListFinder(CliHttpClientFactory cliHttpClientFactory, ICancellationTokenProvider cancellationTokenProvider) { _cliHttpClientFactory = cliHttpClientFactory; CancellationTokenProvider = cancellationTokenProvider; Logger = NullLogger <MyGetPackageListFinder> .Instance; }
private async Task LogoutAsync(string accessToken) { try { var client = CliHttpClientFactory.CreateClient(); var content = new StringContent( JsonSerializer.Serialize(new { token = accessToken }), Encoding.UTF8, "application/json" ); using (var response = await client.PostAsync(CliConsts.LogoutUrl, content, CancellationTokenProvider.Token)) { if (!response.IsSuccessStatusCode) { Logger.LogWarning( $"Cannot logout from remote service! Response: {response.StatusCode}-{response.ReasonPhrase}" ); } } } catch (Exception e) { Logger.LogWarning($"Error occured while logging out from remote service. {e.Message}"); } }
public SolutionModuleAdder( IJsonSerializer jsonSerializer, ProjectNugetPackageAdder projectNugetPackageAdder, DbContextFileBuilderConfigureAdder dbContextFileBuilderConfigureAdder, EfCoreMigrationManager efCoreMigrationManager, DerivedClassFinder derivedClassFinder, ProjectNpmPackageAdder projectNpmPackageAdder, NpmGlobalPackagesChecker npmGlobalPackagesChecker, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, SourceCodeDownloadService sourceCodeDownloadService, SolutionFileModifier solutionFileModifier, NugetPackageToLocalReferenceConverter nugetPackageToLocalReferenceConverter, AngularSourceCodeAdder angularSourceCodeAdder, NewCommand newCommand, BundleCommand bundleCommand, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; ProjectNugetPackageAdder = projectNugetPackageAdder; DbContextFileBuilderConfigureAdder = dbContextFileBuilderConfigureAdder; EfCoreMigrationManager = efCoreMigrationManager; DerivedClassFinder = derivedClassFinder; ProjectNpmPackageAdder = projectNpmPackageAdder; NpmGlobalPackagesChecker = npmGlobalPackagesChecker; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; SourceCodeDownloadService = sourceCodeDownloadService; SolutionFileModifier = solutionFileModifier; NugetPackageToLocalReferenceConverter = nugetPackageToLocalReferenceConverter; AngularSourceCodeAdder = angularSourceCodeAdder; NewCommand = newCommand; BundleCommand = bundleCommand; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <SolutionModuleAdder> .Instance; }
public async Task <LoginInfo> GetLoginInfoAsync() { if (!IsLoggedIn()) { return(null); } var url = $"{CliUrls.WwwAbpIo}api/license/login-info"; var client = CliHttpClientFactory.CreateClient(); using (var response = await client.GetHttpResponseMessageWithRetryAsync(url, CancellationTokenProvider.Token, Logger)) { if (!response.IsSuccessStatusCode) { Logger.LogError("Remote server returns '{response.StatusCode}'"); return(null); } await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response); var responseContent = await response.Content.ReadAsStringAsync(); return(JsonSerializer.Deserialize <LoginInfo>(responseContent)); } }
public JavaScriptServiceProxyGenerator( CliHttpClientFactory cliHttpClientFactory, IJsonSerializer jsonSerializer, JQueryProxyScriptGenerator jQueryProxyScriptGenerator) : base(cliHttpClientFactory, jsonSerializer) { _jQueryProxyScriptGenerator = jQueryProxyScriptGenerator; }
public AngularServiceProxyGenerator( CliHttpClientFactory cliHttpClientFactory, IJsonSerializer jsonSerializer, ICmdHelper cmdhelper, CliService cliService) : base(cliHttpClientFactory, jsonSerializer) { _cmdhelper = cmdhelper; _cliService = cliService; }
public ModuleInfoProvider( IJsonSerializer jsonSerializer, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; _cliHttpClientFactory = cliHttpClientFactory; }
public LoginCommand(AuthService authService, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, CliHttpClientFactory cliHttpClientFactory) { AuthService = authService; CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <LoginCommand> .Instance; }
public SuiteCommand( AbpNuGetIndexUrlService nuGetIndexUrlService, NuGetService nuGetService, ICmdHelper cmdHelper, CliHttpClientFactory cliHttpClientFactory) { CmdHelper = cmdHelper; _nuGetIndexUrlService = nuGetIndexUrlService; _nuGetService = nuGetService; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <SuiteCommand> .Instance; }
public AuthService( IIdentityModelAuthenticationService authenticationService, ILogger <NewCommand> logger, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory ) { AuthenticationService = authenticationService; Logger = logger; CancellationTokenProvider = cancellationTokenProvider; CliHttpClientFactory = cliHttpClientFactory; }
public CliAnalyticsCollect( ICancellationTokenProvider cancellationTokenProvider, IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, CliHttpClientFactory cliHttpClientFactory) { _cancellationTokenProvider = cancellationTokenProvider; _jsonSerializer = jsonSerializer; _remoteServiceExceptionHandler = remoteServiceExceptionHandler; _cliHttpClientFactory = cliHttpClientFactory; _logger = NullLogger <CliAnalyticsCollect> .Instance; }
public NpmPackagesUpdater( PackageJsonFileFinder packageJsonFileFinder, NpmGlobalPackagesChecker npmGlobalPackagesChecker, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory) { _packageJsonFileFinder = packageJsonFileFinder; _npmGlobalPackagesChecker = npmGlobalPackagesChecker; CancellationTokenProvider = cancellationTokenProvider; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <NpmPackagesUpdater> .Instance; }
public TemplateInfoProvider(ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, AuthService authService, CliHttpClientFactory cliHttpClientFactory) { CancellationTokenProvider = cancellationTokenProvider; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; AuthService = authService; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger<TemplateInfoProvider>.Instance; }
public ListTemplatesCommand( CliHttpClientFactory cliHttpClientFactory, IJsonSerializer jsonSerializer, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler) { _cliHttpClientFactory = cliHttpClientFactory; _jsonSerializer = jsonSerializer; _cancellationTokenProvider = cancellationTokenProvider; _remoteServiceExceptionHandler = remoteServiceExceptionHandler; Logger = NullLogger <ListTemplatesCommand> .Instance; }
public ProjectNpmPackageAdder(CliHttpClientFactory cliHttpClientFactory, IJsonSerializer jsonSerializer, SourceCodeDownloadService sourceCodeDownloadService, AngularSourceCodeAdder angularSourceCodeAdder, IRemoteServiceExceptionHandler remoteServiceExceptionHandler) { JsonSerializer = jsonSerializer; SourceCodeDownloadService = sourceCodeDownloadService; AngularSourceCodeAdder = angularSourceCodeAdder; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <ProjectNpmPackageAdder> .Instance; }
public AbpIoApiKeyService( IJsonSerializer jsonSerializer, ICancellationTokenProvider cancellationTokenProvider, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, ILogger <AbpIoApiKeyService> logger, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; _logger = logger; _cliHttpClientFactory = cliHttpClientFactory; CancellationTokenProvider = cancellationTokenProvider; }
public NuGetService( IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, ICancellationTokenProvider cancellationTokenProvider, IApiKeyService apiKeyService, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; CancellationTokenProvider = cancellationTokenProvider; _apiKeyService = apiKeyService; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <VoloNugetPackagesVersionUpdater> .Instance; }
public AbpIoSourceCodeStore( IOptions <AbpCliOptions> options, IJsonSerializer jsonSerializer, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; CancellationTokenProvider = cancellationTokenProvider; _cliHttpClientFactory = cliHttpClientFactory; Options = options.Value; Logger = NullLogger <AbpIoSourceCodeStore> .Instance; }
public AuthService( IIdentityModelAuthenticationService authenticationService, ILogger <AuthService> logger, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory, RemoteServiceExceptionHandler remoteServiceExceptionHandler, IJsonSerializer jsonSerializer ) { AuthenticationService = authenticationService; Logger = logger; CancellationTokenProvider = cancellationTokenProvider; CliHttpClientFactory = cliHttpClientFactory; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; JsonSerializer = jsonSerializer; }
public NpmPackagesUpdater( PackageJsonFileFinder packageJsonFileFinder, NpmGlobalPackagesChecker npmGlobalPackagesChecker, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory, IInstallLibsService installLibsService, ICmdHelper cmdHelper) { _packageJsonFileFinder = packageJsonFileFinder; _npmGlobalPackagesChecker = npmGlobalPackagesChecker; CancellationTokenProvider = cancellationTokenProvider; InstallLibsService = installLibsService; CmdHelper = cmdHelper; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <NpmPackagesUpdater> .Instance; }
public ProjectNugetPackageAdder( IJsonSerializer jsonSerializer, ProjectNpmPackageAdder npmPackageAdder, DerivedClassFinder moduleClassFinder, ModuleClassDependcyAdder moduleClassDependcyAdder, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, BundleCommand bundleCommand, CliHttpClientFactory cliHttpClientFactory) { JsonSerializer = jsonSerializer; NpmPackageAdder = npmPackageAdder; ModuleClassFinder = moduleClassFinder; ModuleClassDependcyAdder = moduleClassDependcyAdder; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; BundleCommand = bundleCommand; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <ProjectNugetPackageAdder> .Instance; }
public ProjectNugetPackageAdder( IJsonSerializer jsonSerializer, ProjectNpmPackageAdder npmPackageAdder, DerivedClassFinder moduleClassFinder, ModuleClassDependcyAdder moduleClassDependcyAdder, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, BundleCommand bundleCommand, CliHttpClientFactory cliHttpClientFactory, SourceCodeDownloadService sourceCodeDownloadService, SolutionFileModifier solutionFileModifier) { JsonSerializer = jsonSerializer; NpmPackageAdder = npmPackageAdder; ModuleClassFinder = moduleClassFinder; ModuleClassDependcyAdder = moduleClassDependcyAdder; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; BundleCommand = bundleCommand; SourceCodeDownloadService = sourceCodeDownloadService; SolutionFileModifier = solutionFileModifier; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger <ProjectNugetPackageAdder> .Instance; }
protected virtual async Task <ApplicationApiDescriptionModel> GetApplicationApiDescriptionModelAsync(GenerateProxyArgs args) { Check.NotNull(args.Url, nameof(args.Url)); var client = CliHttpClientFactory.CreateClient(); var apiDefinitionResult = await client.GetStringAsync(CliUrls.GetApiDefinitionUrl(args.Url)); var apiDefinition = JsonSerializer.Deserialize <ApplicationApiDescriptionModel>(apiDefinitionResult); var moduleDefinition = apiDefinition.Modules.FirstOrDefault(x => string.Equals(x.Key, args.Module, StringComparison.CurrentCultureIgnoreCase)).Value; if (moduleDefinition == null) { throw new CliUsageException($"Module name: {args.Module} is invalid"); } var apiDescriptionModel = ApplicationApiDescriptionModel.Create(); apiDescriptionModel.AddModule(moduleDefinition); return(apiDescriptionModel); }
protected ServiceProxyGeneratorBase(CliHttpClientFactory cliHttpClientFactory, IJsonSerializer jsonSerializer) { CliHttpClientFactory = cliHttpClientFactory; JsonSerializer = jsonSerializer; Logger = NullLogger <T> .Instance; }