From 80724e4bdf88571df9b7e1e0cc367dcac0ab52cb Mon Sep 17 00:00:00 2001 From: Yousef Date: Tue, 28 Nov 2023 15:59:39 -0500 Subject: [PATCH 1/5] Add error message for no matching spaces in export-spaces --- src/Explore.Cli/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Explore.Cli/Program.cs b/src/Explore.Cli/Program.cs index 71c4597..ff86545 100644 --- a/src/Explore.Cli/Program.cs +++ b/src/Explore.Cli/Program.cs @@ -305,6 +305,7 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s { if (namesList?.Count > 0 && space.Name != null && !namesList.Contains(space.Name)) { + AnsiConsole.MarkupLine($"[orange3]'Skipped {space.Name}': Name not found in list of names to export[/]"); continue; } @@ -386,6 +387,12 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s } } + if (spacesToExport.Count == 0) + { + AnsiConsole.MarkupLine($"[orange3]No spaces matched the name[/]"); + return; + } + // construct the export object var export = new ExportSpaces() { From 7ba891ba871dce60a0601987dca394aed74a5b28 Mon Sep 17 00:00:00 2001 From: Yousef Date: Thu, 30 Nov 2023 10:43:14 -0500 Subject: [PATCH 2/5] Extend Import-Spaces with the --names option --- src/Explore.Cli/Program.cs | 48 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/Explore.Cli/Program.cs b/src/Explore.Cli/Program.cs index ff86545..ac0b76e 100644 --- a/src/Explore.Cli/Program.cs +++ b/src/Explore.Cli/Program.cs @@ -1,7 +1,6 @@ using System.CommandLine; using System.Net; using System.Net.Http.Json; -using System.Runtime.CompilerServices; using System.Text; using System.Text.Json; using Explore.Cli.Models; @@ -33,7 +32,7 @@ public static async Task Main(string[] args) var exportFileName = new Option(name: "--export-name", description: "The name of the file to export") { IsRequired = false }; exportFileName.AddAlias("-en"); - var names = new Option(name: "--names", description: "The names of the spaces to export") { IsRequired = false }; + var names = new Option(name: "--names", description: "The names of the spaces to export or export") { IsRequired = false }; names.AddAlias("-n"); var verbose = new Option(name: "--verbose", description: "Include verbose output during processing") { IsRequired = false }; @@ -61,12 +60,12 @@ public static async Task Main(string[] args) exportSpacesCommand.SetHandler(async (ec, fp, en, n, v) => { await ExportSpaces(ec, fp, en, n, v); }, exploreCookie, exportFilePath, exportFileName, names, verbose); - var importSpacesCommand = new Command("import-spaces") { exploreCookie, importFilePath, verbose }; + var importSpacesCommand = new Command("import-spaces") { exploreCookie, importFilePath, names, verbose }; importSpacesCommand.Description = "Import SwaggerHub Explore spaces from a file"; rootCommand.Add(importSpacesCommand); - importSpacesCommand.SetHandler(async (ec, fp, v) => - { await ImportSpaces(ec, fp, v); }, exploreCookie, importFilePath, verbose); + importSpacesCommand.SetHandler(async (ec, fp, v, n) => + { await ImportSpaces(ec, fp, v, n); }, exploreCookie, importFilePath, names, verbose); AnsiConsole.Write(new FigletText("Explore.Cli").Color(new Color(133, 234, 45))); @@ -405,10 +404,8 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s string exploreSpacesJson = JsonSerializer.Serialize(export); try { - using (StreamWriter streamWriter = new StreamWriter(filePath)) - { - streamWriter.Write(exploreSpacesJson); - } + using StreamWriter streamWriter = new StreamWriter(filePath); + streamWriter.Write(exploreSpacesJson); } catch (UnauthorizedAccessException) { @@ -425,23 +422,21 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s } } - internal static async Task ImportSpaces(string exploreCookie, string filePath, bool? verboseOutput) + internal static async Task ImportSpaces(string exploreCookie, string filePath, string names, bool? verboseOutput) { //check file existence and read permissions try { - using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)) + using FileStream fs = new(filePath, FileMode.Open, FileAccess.Read); + //let's verify it's a JSON file now + if (!UtilityHelper.IsJsonFile(filePath)) { - //let's verify it's a JSON file now - if (!UtilityHelper.IsJsonFile(filePath)) - { - AnsiConsole.MarkupLine($"[red]The file provided is not a JSON file. Please review.[/]"); - return; - } - - // You can read from the file if this point is reached - AnsiConsole.MarkupLine($"processing ..."); + AnsiConsole.MarkupLine($"[red]The file provided is not a JSON file. Please review.[/]"); + return; } + + // You can read from the file if this point is reached + AnsiConsole.MarkupLine($"processing ..."); } catch (UnauthorizedAccessException) { @@ -459,6 +454,9 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, b return; } + var namesList = names?.Split(',') + .Select(name => name.Trim()) + .ToList(); //Read and serialize try @@ -469,10 +467,9 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, b //validate json against known (high level) schema var validationResult = await UtilityHelper.ValidateSchema(json, "ExploreSpaces.schema.json"); - if (!validationResult.isValid) { - Console.WriteLine($"The provide json does not conform to the expected schema. Errors: {validationResult.Message}"); + Console.WriteLine($"The provided JSON does not conform to the expected schema. Errors: {validationResult.Message}"); return; } @@ -487,6 +484,13 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, b { foreach (var exportedSpace in exportedSpaces.ExploreSpaces) { + // check if the space name is in the list of names to import + if (namesList?.Count > 0 && exportedSpace.Name != null && !namesList.Contains(exportedSpace.Name)) + { + AnsiConsole.MarkupLine($"[orange3]'Skipped {exportedSpace.Name}': Name not found in list of names to import[/]"); + continue; + } + var spaceExists = await CheckSpaceExists(exploreCookie, exportedSpace.Id?.ToString(), verboseOutput); var resultTable = new Table() { Title = new TableTitle(text: $"PROCESSING [green]{exportedSpace.Name}[/]"), Width = 100, UseSafeBorder = true }; From 32367104bc285581a6f000aafbc14a0eac0e48d9 Mon Sep 17 00:00:00 2001 From: Yousef Date: Mon, 4 Dec 2023 13:22:57 -0500 Subject: [PATCH 3/5] Remove import-inspector-collections option --- src/Explore.Cli/Program.cs | 216 +------------------------------------ 1 file changed, 2 insertions(+), 214 deletions(-) diff --git a/src/Explore.Cli/Program.cs b/src/Explore.Cli/Program.cs index ac0b76e..168609f 100644 --- a/src/Explore.Cli/Program.cs +++ b/src/Explore.Cli/Program.cs @@ -14,12 +14,6 @@ public static async Task Main(string[] args) rootCommand.Name = "Explore.CLI"; rootCommand.Description = "Simple utility CLI for importing data into and out of SwaggerHub Explore"; - var username = new Option(name: "--username", description: "Username from Swagger Inspector.") { IsRequired = true }; - username.AddAlias("-u"); - - var inspectorCookie = new Option(name: "--inspector-cookie", description: "A valid and active Swagger Inspector session cookie associated with provided username") { IsRequired = true }; - inspectorCookie.AddAlias("-ic"); - var exploreCookie = new Option(name: "--explore-cookie", description: "A valid and active SwaggerHub Explore session cookie") { IsRequired = true }; exploreCookie.AddAlias("-ec"); @@ -38,21 +32,6 @@ public static async Task Main(string[] args) var verbose = new Option(name: "--verbose", description: "Include verbose output during processing") { IsRequired = false }; verbose.AddAlias("-v"); - var importInspectorCollectionsCommand = new Command("import-inspector-collections") - { - username, - inspectorCookie, - exploreCookie - }; - - importInspectorCollectionsCommand.Description = "Import Swagger Inspector collections into SwaggerHub Explore"; - rootCommand.Add(importInspectorCollectionsCommand); - - importInspectorCollectionsCommand.SetHandler(async (u, ic, ec) => - { - await ImportFromInspector(u, ic, ec); - }, username, inspectorCookie, exploreCookie); - var exportSpacesCommand = new Command("export-spaces") { exploreCookie, exportFilePath, exportFileName, names, verbose }; exportSpacesCommand.Description = "Export SwaggerHub Explore spaces to filesystem"; rootCommand.Add(exportSpacesCommand); @@ -72,172 +51,6 @@ public static async Task Main(string[] args) return await rootCommand.InvokeAsync(args); } - internal static async Task ImportFromInspector(string inspectorUsername, string inspectorCookie, string exploreCookie) - { - - var httpClient = new HttpClient - { - BaseAddress = new Uri("https://inspector-api-proxy.swagger.io") - }; - - var exploreHttpClient = new HttpClient - { - BaseAddress = new Uri("https://api.explore.swaggerhub.com") - }; - - - httpClient.DefaultRequestHeaders.Add("Cookie", inspectorCookie); - var inspectorCollectionsResponse = await httpClient.GetAsync($"/repository/v1/{inspectorUsername}/collections"); - - if (inspectorCollectionsResponse.StatusCode == HttpStatusCode.Unauthorized) - { - AnsiConsole.MarkupLine("[red]Could not authenticate with provided inspector cookie[/]"); - return; - } - - if (inspectorCollectionsResponse.StatusCode == HttpStatusCode.OK) - { - var collections = await inspectorCollectionsResponse.Content.ReadFromJsonAsync>(); - var panel = new Panel($"You have [green]{collections!.Count} collections[/] in inspector"); - panel.Width = 100; - panel.Header = new PanelHeader("Swagger Inspector Data").Centered(); - AnsiConsole.Write(panel); - Console.WriteLine(""); - - - var counter = 0; - foreach (var collection in collections) - { - - - if (MappingHelper.CollectionEntriesNotLimitedToSoap(collection.CollectionEntries)) - { - - var resultTable = new Table() { Title = new TableTitle(text: $"IMPORTING [green]{collection.Name}[/] TO EXPLORE"), Width = 100, UseSafeBorder = true }; - resultTable.AddColumn("Result"); - resultTable.AddColumn(new TableColumn("Details").Centered()); - - //prepare request body - var cleanedCollectionName = UtilityHelper.CleanString(collection.Name); - var spaceContent = new StringContent(JsonSerializer.Serialize(new SpaceRequest() { Name = cleanedCollectionName }), Encoding.UTF8, "application/json"); - - exploreHttpClient.DefaultRequestHeaders.Clear(); - exploreHttpClient.DefaultRequestHeaders.Add("Cookie", exploreCookie); - exploreHttpClient.DefaultRequestHeaders.Add("X-Xsrf-Token", $"{MappingHelper.ExtractXSRFTokenFromCookie(exploreCookie)}"); - var spacesResponse = await exploreHttpClient.PostAsync("/spaces-api/v1/spaces", spaceContent); - //Console.WriteLine(JsonSerializer.Serialize(new SpaceRequest() { Name = collection.Name })); - - if (spacesResponse.StatusCode == HttpStatusCode.Created) - { - var apiImportResults = new Table() { Title = new TableTitle(text: $"SPACE [green]{cleanedCollectionName}[/] CREATED"), Width = 75, UseSafeBorder = true }; - apiImportResults.AddColumn("Result"); - apiImportResults.AddColumn("API Imported"); - apiImportResults.AddColumn("Connection Imported"); - - //grab the space id - var spaceResponse = spacesResponse.Content.ReadFromJsonAsync(); - - if (collection.CollectionEntries != null) - { - foreach (var entry in collection.CollectionEntries) - { - //now let's create an API entry in the space - var cleanedAPIName = UtilityHelper.CleanString(entry.Name); - var apiContent = new StringContent(JsonSerializer.Serialize(new ApiRequest() { Name = cleanedAPIName, Type = "REST", Description = $"imported from inspector on {DateTime.UtcNow.ToShortDateString()}" }), Encoding.UTF8, "application/json"); - - exploreHttpClient.DefaultRequestHeaders.Clear(); - exploreHttpClient.DefaultRequestHeaders.Add("Cookie", exploreCookie); - exploreHttpClient.DefaultRequestHeaders.Add("X-Xsrf-Token", $"{MappingHelper.ExtractXSRFTokenFromCookie(exploreCookie)}"); - var apiResponse = await exploreHttpClient.PostAsync($"/spaces-api/v1/spaces/{spaceResponse.Result?.Id}/apis", apiContent); - - if (apiResponse.StatusCode == HttpStatusCode.Created) - { - - var createdApiResponse = apiResponse.Content.ReadFromJsonAsync(); - var connectionRequestBody = JsonSerializer.Serialize(MappingHelper.MapInspectorCollectionEntryToExploreConnection(entry)); - var connectionContent = new StringContent(connectionRequestBody, Encoding.UTF8, "application/json"); - - //now let's do the work and import the connection - exploreHttpClient.DefaultRequestHeaders.Clear(); - exploreHttpClient.DefaultRequestHeaders.Add("Cookie", exploreCookie); - exploreHttpClient.DefaultRequestHeaders.Add("X-Xsrf-Token", $"{MappingHelper.ExtractXSRFTokenFromCookie(exploreCookie)}"); - var connectionResponse = await exploreHttpClient.PostAsync($"/spaces-api/v1/spaces/{spaceResponse.Result?.Id}/apis/{createdApiResponse.Result?.Id}/connections", connectionContent); - - if (connectionResponse.StatusCode == HttpStatusCode.Created) - { - apiImportResults.AddRow("[green]OK[/]", $"API '{cleanedAPIName}' created", "Connection created"); - } - else - { - apiImportResults.AddRow("[orange3]OK[/]", $"API '{cleanedAPIName}' created", "[orange3]Connection NOT created[/]"); - } - } - else - { - apiImportResults.AddRow("[red]NOK[/]", $"API creation failed. StatusCode {apiResponse.StatusCode}", ""); - } - } - - resultTable.AddRow(new Markup("[green]success[/]"), apiImportResults); - } - - AnsiConsole.Write(resultTable); - Console.WriteLine(""); - } - else - { - switch (spacesResponse.StatusCode) - { - case HttpStatusCode.OK: - // not expecting a 200 OK here - this would be returned for a failed auth and a redirect to SB ID - resultTable.AddRow(new Markup("[red]failure[/]"), new Markup($"[red] Auth failed connecting to SwaggerHub Explore. Please review provided cookie.[/]")); - AnsiConsole.Write(resultTable); - Console.WriteLine(""); - break; - - case HttpStatusCode.Conflict: - var apiImportResults = new Table() { Title = new TableTitle(text: $"[orange3]SPACE[/] {cleanedCollectionName} [orange3]ALREADY EXISTS[/]") }; - apiImportResults.AddColumn("Result"); - apiImportResults.AddColumn("API Imported"); - apiImportResults.AddColumn("Connection Imported"); - apiImportResults.AddRow("skipped", "", ""); - - resultTable.AddRow(new Markup("[orange3]skipped[/]"), apiImportResults); - AnsiConsole.Write(resultTable); - Console.WriteLine(""); - break; - - default: - resultTable.AddRow(new Markup("[red]failure[/]"), new Markup($"[red] StatusCode: {spacesResponse.StatusCode}, Details: {spacesResponse.ReasonPhrase}[/]")); - AnsiConsole.Write(resultTable); - Console.WriteLine(""); - break; - } - } - } - else - { - var resultTable = new Table() { Title = new TableTitle(text: $"IMPORTING [green]{collection.Name}[/] TO EXPLORE"), Width = 100, UseSafeBorder = true }; - resultTable.AddColumn("Result"); - resultTable.AddColumn(new TableColumn("Details").Centered()); - resultTable.AddRow(new Markup("[orange3]skipped[/]"), new Markup("[orange3]No transactions to import[/]")); - AnsiConsole.Write(resultTable); - Console.WriteLine(""); - } - - counter++; - Thread.Sleep(200); - } - - Console.WriteLine(""); - AnsiConsole.MarkupLine("[green] All done! We're finished importing collections[/]"); - } - else - { - AnsiConsole.MarkupLine($"[red]StatusCode {inspectorCollectionsResponse.StatusCode} returned from the Inspector API[/]"); - } - } - internal static async Task ExportSpaces(string exploreCookie, string filePath, string exportFileName, string names, bool? verboseOutput) { var httpClient = new HttpClient @@ -388,7 +201,7 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s if (spacesToExport.Count == 0) { - AnsiConsole.MarkupLine($"[orange3]No spaces matched the name[/]"); + AnsiConsole.MarkupLine($"[orange3]No spaces matched the provided names[/]"); return; } @@ -399,7 +212,6 @@ internal static async Task ExportSpaces(string exploreCookie, string filePath, s ExploreSpaces = spacesToExport }; - // export the file string exploreSpacesJson = JsonSerializer.Serialize(export); try @@ -497,7 +309,6 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, s resultTable.AddColumn("Result"); resultTable.AddColumn(new TableColumn("Details").Centered()); - var importedSpace = await UpsertSpace(exploreCookie, spaceExists, exportedSpace.Name, exportedSpace.Id.ToString()); if (!string.IsNullOrEmpty(importedSpace.Name)) @@ -533,7 +344,6 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, s } } } - } } apiImportResults.AddRow("[orange3]skipped[/]", $"API '{exportedAPI.Name}' skipped", $"Kafka not yet supported by export"); @@ -552,7 +362,6 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, s { AnsiConsole.Write(resultTable); } - } } @@ -570,10 +379,8 @@ internal static async Task ImportSpaces(string exploreCookie, string filePath, s } } - private static async Task CheckSpaceExists(string exploreCookie, string? id, bool? verboseOutput) { - if (string.IsNullOrEmpty(id)) { return false; @@ -600,7 +407,6 @@ private static async Task CheckSpaceExists(string exploreCookie, string? i return true; } - if (verboseOutput != null && verboseOutput == true) { AnsiConsole.MarkupLine($"[orange3]StatusCode {spacesResponse.StatusCode} returned from the GetSpaceById API. New space will be created[/]"); @@ -611,7 +417,6 @@ private static async Task CheckSpaceExists(string exploreCookie, string? i private static async Task CheckApiExists(string exploreCookie, string spaceId, string? id, bool? verboseOutput) { - if (string.IsNullOrEmpty(id)) { return false; @@ -642,7 +447,6 @@ private static async Task CheckApiExists(string exploreCookie, string spac private static async Task CheckConnectionExists(string exploreCookie, string spaceId, string apiId, string? id, bool? verboseOutput) { - if (string.IsNullOrEmpty(id)) { return false; @@ -671,7 +475,6 @@ private static async Task CheckConnectionExists(string exploreCookie, stri return false; } - private static async Task UpsertSpace(string exploreCookie, bool spaceExists, string? name, string? id) { var httpClient = new HttpClient @@ -704,7 +507,6 @@ private static async Task UpsertSpace(string exploreCookie, bool // swallow 409 as server is being overly strict return new SpaceResponse() { Id = Guid.Parse(id), Name = name }; } - } if (spacesResponse.IsSuccessStatusCode) @@ -724,8 +526,6 @@ private static async Task UpsertSpace(string exploreCookie, bool return new SpaceResponse(); } - - private static async Task UpsertApi(string exploreCookie, bool spaceExists, string spaceId, string? id, string? name, string? type, bool? verboseOutput) { var httpClient = new HttpClient @@ -790,7 +590,6 @@ private static async Task UpsertConnection(string exploreCookie, bool spac httpClient.DefaultRequestHeaders.Add("Cookie", exploreCookie); httpClient.DefaultRequestHeaders.Add("X-Xsrf-Token", $"{MappingHelper.ExtractXSRFTokenFromCookie(exploreCookie)}"); - var connectionContent = new StringContent(JsonSerializer.Serialize(MappingHelper.MassageConnectionExportForImport(connection)), Encoding.UTF8, "application/json"); HttpResponseMessage? connectionResponse; @@ -821,18 +620,7 @@ private static async Task UpsertConnection(string exploreCookie, bool spac var message = await connectionResponse.Content.ReadAsStringAsync(); AnsiConsole.WriteLine($"error: {message}"); } - } - return false; } -} - - - - - - - - - +} \ No newline at end of file From 0a18c637b0323296747b0d5894c54c307c195348 Mon Sep 17 00:00:00 2001 From: Yousef Date: Mon, 4 Dec 2023 13:29:13 -0500 Subject: [PATCH 4/5] Update README.md --- README.md | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 909d743..678eb50 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Simple utility CLI for importing data into SwaggerHub Explore. > `-?`, `-h`, `--help` Show help and usage information **Commands:** -> `import-inspector-collections` Import Swagger Inspector collections into SwaggerHub Explore -> > `export-spaces` Export SwaggerHub Explore spaces to filesystem > > `import-spaces` Import SwaggerHub Explore spaces from a file @@ -33,7 +31,6 @@ Simple utility CLI for importing data into SwaggerHub Explore. You will need the following: - .NET 7.0 (or above). Follow instructions for [Windows](https://learn.microsoft.com/en-us/dotnet/core/install/windows?tabs=net70), [Linux](https://learn.microsoft.com/en-us/dotnet/core/install/linux), or [MacOS](https://learn.microsoft.com/en-us/dotnet/core/install/macos). - A SwaggerHub Explore account, register at https://try.smartbear.com/swaggerhub-explore (if required). -- If you want to import data from the legacy Swagger Inspector tool, the you'll also need a Swagger Inspector account, register by clicking the `Sign Up` button at https://inspector.swagger.io/builder (if required). ### Install the CLI @@ -43,9 +40,7 @@ Download and install the CLI tool from Nuget: https://www.nuget.org/packages/Exp ### Session Cookies for CLI command -You will need to obtain certain cookies from an active session in SwaggerHub Explore to invoke the `CLI` commands. For the `import-inspector-collections` CLI command, you will also need to obtain a cookie from an active Swagger Inspector session. - -From Swagger Inspector, navigate to your browser development tools, locate the application cookies and extract the `inspector-token` cookie. +You will need to obtain certain cookies from an active session in SwaggerHub Explore to invoke the `CLI` commands. From SwaggerHub Explore, navigate to your browser development tools, locate the application cookies and extract the `SESSION` and `XSRF-TOKEN` cookies. @@ -74,45 +69,6 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the **Safari** > Develop `>` Show Web Inspector. If you can't see the Develop menu, go to Safari `>` Preferences `>` Advanced, and check the Show Develop menu in menu bar checkbox. -### Running the `import-inspector-collections` command - -**Command Options**: - -``` - _____ _ ____ _ _ - | ____| __ __ _ __ | | ___ _ __ ___ / ___| | | (_) - | _| \ \/ / | '_ \ | | / _ \ | '__| / _ \ | | | | | | - | |___ > < | |_) | | | | (_) | | | | __/ _ | |___ | | | | - |_____| /_/\_\ | .__/ |_| \___/ |_| \___| (_) \____| |_| |_| - |_| -``` - -**Description:** - > Import Swagger Inspector collections into SwaggerHub Explore - -**Usage:** - > `Explore.CLI import-inspector-collections [options]` - -**Options:** - - - > `-u`, `--username` (REQUIRED) Username from Swagger Inspector. - - > `-ic`, `--inspector-cookie` (REQUIRED) A valid and active Swagger Inspector session cookie associated with provided username - - > `-ec`, `--explore-cookie` (REQUIRED) A valid and active SwaggerHub Explore session cookie - - > `-?`, `-h`, `--help` Show help and usage information - - -**Note** - the format for inspector cookie is as follows: `"cookie-name=cookie-value"` - -> Example `"inspector-token=34c5921e-fdf8-4531-8d7a-ed2940076444"` - -**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"` - ->Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"` - ### Running the `export-spaces` command **Command Options** @@ -171,6 +127,8 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the > `-fp`, `--file-path` (REQUIRED) The path to the file used for importing data + > `-n`, `--names` A comma-separated list of space names to import + > `-v`, `--verbose` Include verbose output during processing > `-?`, `-h`, `--help` Show help and usage information From d35e3ba6cb010602e07e68935f1e6e770d63633d Mon Sep 17 00:00:00 2001 From: Yousef Date: Sat, 9 Dec 2023 10:15:40 -0500 Subject: [PATCH 5/5] Fix typo in --names description --- src/Explore.Cli/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Explore.Cli/Program.cs b/src/Explore.Cli/Program.cs index 168609f..89cb7c5 100644 --- a/src/Explore.Cli/Program.cs +++ b/src/Explore.Cli/Program.cs @@ -26,7 +26,7 @@ public static async Task Main(string[] args) var exportFileName = new Option(name: "--export-name", description: "The name of the file to export") { IsRequired = false }; exportFileName.AddAlias("-en"); - var names = new Option(name: "--names", description: "The names of the spaces to export or export") { IsRequired = false }; + var names = new Option(name: "--names", description: "The names of the spaces to export or import") { IsRequired = false }; names.AddAlias("-n"); var verbose = new Option(name: "--verbose", description: "Include verbose output during processing") { IsRequired = false };