Skip to content

Commit ecf6880

Browse files
feat(repo): migrate to new space-api (#51)
* feat(repo): migrate to new space-api * chore(repo): remove pact checks until APIs are documented
1 parent 71a426f commit ecf6880

File tree

16 files changed

+901
-280
lines changed

16 files changed

+901
-280
lines changed

.github/gitversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 0.8.2
1+
next-version: 0.9.0
22
assembly-versioning-scheme: MajorMinorPatch
33
assembly-file-versioning-scheme: MajorMinorPatchTag
44
assembly-informational-format: '{InformationalVersion}'

.github/workflows/build-test-cross.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ jobs:
123123
useConfigFile: true
124124
configFilePath: ./.github/gitversion.yml
125125

126-
- uses: pactflow/actions/can-i-deploy@v2
127-
with:
128-
to_environment: production
129-
application_name: explore-cli
130-
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
131-
token: ${{ secrets.PACT_BROKER_TOKEN }}
132-
retry_while_unknown: 5
133-
retry_interval: 10
126+
# - uses: pactflow/actions/can-i-deploy@v2
127+
# with:
128+
# to_environment: production
129+
# application_name: explore-cli
130+
# broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
131+
# token: ${{ secrets.PACT_BROKER_TOKEN }}
132+
# retry_while_unknown: 5
133+
# retry_interval: 10
134134
- name: Download artifacts
135135
uses: actions/download-artifact@v4
136136

@@ -142,9 +142,9 @@ jobs:
142142
file_glob: true
143143
tag: ${{ steps.gitversion.outputs.MajorMinorPatch }}
144144

145-
- uses: pactflow/actions/record-release@v2
146-
with:
147-
environment: production
148-
application_name: explore-cli
149-
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
150-
token: ${{ secrets.PACT_BROKER_TOKEN }}
145+
# - uses: pactflow/actions/record-release@v2
146+
# with:
147+
# environment: production
148+
# application_name: explore-cli
149+
# broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
150+
# token: ${{ secrets.PACT_BROKER_TOKEN }}

.github/workflows/build-test-package.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,20 @@ jobs:
6565
dotnet test
6666
working-directory: test/Explore.Cli.Tests
6767

68-
- uses: pactflow/actions/publish-pact-files@v2
69-
with:
70-
pactfiles: test/Explore.Cli.Tests/pacts
71-
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
72-
token: ${{ secrets.PACT_BROKER_TOKEN }}
68+
# - uses: pactflow/actions/publish-pact-files@v2
69+
# with:
70+
# pactfiles: test/Explore.Cli.Tests/pacts
71+
# broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
72+
# token: ${{ secrets.PACT_BROKER_TOKEN }}
7373

74-
- uses: pactflow/actions/can-i-deploy@v2
75-
with:
76-
to_environment: production
77-
application_name: explore-cli
78-
broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
79-
token: ${{ secrets.PACT_BROKER_TOKEN }}
80-
retry_while_unknown: 5
81-
retry_interval: 10
74+
# - uses: pactflow/actions/can-i-deploy@v2
75+
# with:
76+
# to_environment: production
77+
# application_name: explore-cli
78+
# broker_url: ${{ secrets.PACT_BROKER_BASE_URL }}
79+
# token: ${{ secrets.PACT_BROKER_TOKEN }}
80+
# retry_while_unknown: 5
81+
# retry_interval: 10
8282

8383
- name: Create Package
8484
run: dotnet pack --configuration $BUILD_CONFIG -o:package /p:PackageVersion=${{ steps.gitVersion.outputs.assemblySemVer }}

README.md

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# explore-cli
22

3-
Simple utility CLI for importing data into SwaggerHub Explore.
3+
Simple utility CLI for importing data into API Hub Explore.
44

55
![Can I Deploy](https://smartbear.pactflow.io/pacticipants/explore-cli/branches/main/latest-version/can-i-deploy/to-environment/production/badge)
66

@@ -13,7 +13,7 @@ Simple utility CLI for importing data into SwaggerHub Explore.
1313
|_|
1414
```
1515
**Description:**
16-
> Simple utility CLI for importing data into and out of SwaggerHub Explore
16+
> Simple utility CLI for importing data into and out of API Hub Explore
1717
1818
**Usage:**
1919
> Explore.CLI [command] [options]
@@ -24,20 +24,22 @@ Simple utility CLI for importing data into SwaggerHub Explore.
2424
> `-?`, `-h`, `--help` Show help and usage information
2525
2626
**Commands:**
27-
> `export-spaces` Export SwaggerHub Explore spaces to filesystem
27+
> `export-spaces` Export API Hub Explore spaces to filesystem
2828
>
29-
> `import-spaces` Import SwaggerHub Explore spaces from a file
29+
> `import-spaces` Import API Hub Explore spaces from a file
3030
>
31-
> `import-postman-collection` Import Postman Collection (v2.1) from a file into SwaggerHub Explore
31+
> `import-postman-collection` Import Postman Collection (v2.1) from a file into API Hub Explore
3232
>
33-
> `import-insomnia-collection` Import Insomnia Collection (v4) from a file into SwaggerHub Explore
33+
> `import-insomnia-collection` Import Insomnia Collection (v4) from a file into API Hub Explore
3434
>
35-
> `import-pact-file` Import a Pact file (v2/v3/v4) into SwaggerHub Explore (HTTP interactions only)
35+
> `import-pact-file` Import a Pact file (v2/v3/v4) into API Hub Explore (HTTP interactions only)
3636
3737
### Prerequisites
38+
3839
You will need the following:
40+
3941
- .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).
40-
- A SwaggerHub Explore account, register at https://try.smartbear.com/swaggerhub-explore (if required).
42+
- A API Hub Explore account, register at https://try.smartbear.com/swaggerhub-explore (if required).
4143

4244
### Install the CLI
4345

@@ -128,18 +130,20 @@ docker run --platform=linux/amd64 \
128130

129131
### Session Cookies for CLI command
130132

131-
You will need to obtain certain cookies from an active session in SwaggerHub Explore to invoke the `CLI` commands.
133+
You will need to obtain certain cookies from an active session in API Hub Explore to invoke the `CLI` commands.
132134

133-
From SwaggerHub Explore, navigate to your browser development tools, locate the application cookies and extract the `SESSION` and `XSRF-TOKEN` cookies.
135+
From API Hub Explore, navigate to your browser development tools, locate the application cookies and extract the `SESSION` and `XSRF-TOKEN` cookies.
134136

135137
#### How to get cookie values from your browser
136138

137139
##### Keyboard
140+
138141
- Windows/Linux: Ctrl + Shift + I or F12
139142
- macOS: ⌘ + ⌥ + I
140143

141144
##### Other Options
142-
**Chrome**
145+
146+
**Chrome**
143147
> Use one of the following methods:
144148
> - click the three-dots icon in the upper-right-hand corner of the browser window `>` click More tools `>` Developer Tools
145149
> - F12 (on Windows/Linux), and Option + ⌘ + J (on macOS)
@@ -169,13 +173,13 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
169173
|_|
170174
```
171175
**Description:**
172-
> Export SwaggerHub Explore spaces to filesystem
176+
> Export API Hub Explore spaces to filesystem
173177
174178
**Usage:**
175179
> Explore.CLI export-spaces [options]
176180
177181
**Options:**
178-
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active SwaggerHub Explore session cookie
182+
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active API Hub Explore session cookie
179183
180184
> `-fp`, `--file-path` <file-path> The path to the directory used for exporting data. It can be either relative or absolute
181185
@@ -187,7 +191,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
187191
188192
> `-?`, `-h`, `--help` Show help and usage information
189193
190-
**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
194+
**Note** - the format for API Hub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
191195

192196
>Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"`
193197
@@ -196,6 +200,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
196200
### Running the `import-spaces` command
197201

198202
**Command Options**
203+
199204
```
200205
_____ _ ____ _ _
201206
| ____| __ __ _ __ | | ___ _ __ ___ / ___| | | (_)
@@ -204,14 +209,15 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
204209
|_____| /_/\_\ | .__/ |_| \___/ |_| \___| (_) \____| |_| |_|
205210
|_|
206211
```
212+
207213
**Description:**
208-
> Import SwaggerHub Explore spaces from a file
214+
> Import API Hub Explore spaces from a file
209215
210216
**Usage:**
211217
> Explore.CLI import-spaces [options]
212218
213219
**Options:**
214-
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active SwaggerHub Explore session cookie
220+
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active API Hub Explore session cookie
215221
216222
> `-fp`, `--file-path` <file-path> (REQUIRED) The path to the file used for importing data
217223
@@ -221,7 +227,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
221227
222228
> `-?`, `-h`, `--help` Show help and usage information
223229
224-
**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
230+
**Note** - the format for API Hub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
225231

226232
>Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"`
227233
@@ -230,6 +236,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
230236
### Running the `import-postman-collection` command
231237

232238
**Command Options**
239+
233240
```
234241
_____ _ ____ _ _
235242
| ____| __ __ _ __ | | ___ _ __ ___ / ___| | | (_)
@@ -238,26 +245,28 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
238245
|_____| /_/\_\ | .__/ |_| \___/ |_| \___| (_) \____| |_| |_|
239246
|_|
240247
```
248+
241249
**Description:**
242250
> Import Postman collections (v2.1) from a file
243251
244252
**Usage:**
245253
> Explore.CLI import-postman-collection [options]
246254
247255
**Options:**
248-
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active SwaggerHub Explore session cookie
256+
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active API Hub Explore session cookie
249257
250258
> `-fp`, `--file-path` <file-path> (REQUIRED) The path to the Postman collection
251259
252260
> `-v`, `--verbose` Include verbose output during processing
253261
254262
> `-?`, `-h`, `--help` Show help and usage information
255263
256-
**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
264+
**Note** - the format for API Hub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
257265

258266
>Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"`
259267
260268
> **Notes:**
269+
261270
> - Compatible with Postman Collections v2.1
262271
> - Root level request get bundled into API folder with same name as collection
263272
> - Nested collections get added to an API folder with naming format (`parent folder - nested folder`)
@@ -267,6 +276,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
267276
### Running the `import-insomnia-collection` command
268277

269278
**Command Options**
279+
270280
```
271281
_____ _ ____ _ _
272282
| ____| __ __ _ __ | | ___ _ __ ___ / ___| | | (_)
@@ -275,26 +285,28 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
275285
|_____| /_/\_\ | .__/ |_| \___/ |_| \___| (_) \____| |_| |_|
276286
|_|
277287
```
288+
278289
**Description:**
279290
> Import Insomnia collections (v4) from a file
280291
281292
**Usage:**
282293
> Explore.CLI import-insomnia-collection [options]
283294
284295
**Options:**
285-
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active SwaggerHub Explore session cookie
296+
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active API Hub Explore session cookie
286297
287298
> `-fp`, `--file-path` <file-path> (REQUIRED) The path to the Insomnia collection
288299
289300
> `-v`, `--verbose` Include verbose output during processing
290301
291302
> `-?`, `-h`, `--help` Show help and usage information
292303
293-
**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
304+
**Note** - the format for API Hub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
294305

295306
>Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"`
296307
297308
> **Notes:**
309+
298310
> - Compatible with Insomnia Collection Exports v4
299311
> - GraphQL collections/requests not supported
300312
> - gRPC collections/requests are not supported
@@ -304,6 +316,7 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
304316
### Running the `import-pact-file` command
305317

306318
**Command Options**
319+
307320
```
308321
_____ _ ____ _ _
309322
| ____| __ __ _ __ | | ___ _ __ ___ / ___| | | (_)
@@ -312,14 +325,15 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
312325
|_____| /_/\_\ | .__/ |_| \___/ |_| \___| (_) \____| |_| |_|
313326
|_|
314327
```
328+
315329
**Description:**
316-
> Import a Pact file (v2/v3/v4) into SwaggerHub Explore (HTTP interactions only)
330+
> Import a Pact file (v2/v3/v4) into API Hub Explore (HTTP interactions only)
317331
318332
**Usage:**
319333
> Explore.CLI import-pact-file [options]
320334
321335
**Options:**
322-
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active SwaggerHub Explore session cookie
336+
> `-ec`, `--explore-cookie` <explore-cookie> (REQUIRED) A valid and active API Hub Explore session cookie
323337
324338
> `-fp`, `--file-path` <file-path> (REQUIRED) The path to the Insomnia collection
325339
@@ -329,42 +343,45 @@ From SwaggerHub Explore, navigate to your browser development tools, locate the
329343
330344
> `-?`, `-h`, `--help` Show help and usage information
331345
332-
**Note** - the format for SwaggerHub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
346+
**Note** - the format for API Hub Explore cookies is as follows: `"cookie-name=cookie-value; cookie-name=cookie-value"`
333347

334348
>Example: `"SESSION=5a0a2e2f-97c6-4405-b72a-299fa8ce07c8; XSRF-TOKEN=3310cb20-2ec1-4655-b1e3-4ab76a2ac2c8"`
335349
336350
> **Notes:**
351+
337352
> - Compatible with valid Pact v2 / v3 / v4 specification files
338353
> - Users are advised to provide the base url when importing pact files with `--base-uri` / `-b`, to the required server you wish to explore.
339354
> Pact files do not contain this information
340355
> - Currently only supports HTTP interactions.
341356
> - V3 message based pacts are unsupported
342357
> - V4 interactions other than synchronous/http will be ignored
343358
344-
## More Information on SwaggerHub Explore
345-
346-
- For SwaggerHub Explore info, see - https://swagger.io/tools/swaggerhub-explore/
347-
- For SwaggerHub Explore docs, see - https://support.smartbear.com/swaggerhub-explore/docs
348-
- Try SwaggerHub Explore - https://try.smartbear.com/swaggerhub-explore
359+
## More Information on API Hub Explore
349360

361+
- For API Hub Explore info, see - https://swagger.io/api-hub/explore/
362+
- For API Hub Explore docs, see - https://support.smartbear.com/api-hub/explore/docs/?lang=en
363+
- Try API Hub Explore - https://try.smartbear.com/swaggerhub-explore
350364

351365
## Development
352366

353-
### Prerequisites
367+
### Prerequisites
354368

355369
You will need the following:
370+
356371
- .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).
357372

358373
### Setting up
359374

360375
Run the following commands to setup the repository for local development:
361376

362-
```
377+
```text
378+
363379
$ git clone https://github.com/SmartBear-DevRel/explore-cli.git
364380
$ cd explore-cli/src/explore.cli
365381
$ dotnet add package System.CommandLine --prerelease
366382
$ dotnet add package Microsoft.AspNetCore.StaticFiles
367383
$ dotnet add package NJsonSchema
384+
368385
```
369386

370387
### Build

0 commit comments

Comments
 (0)