feat: import collections from URL (#2262)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Akash K
2022-05-03 17:54:47 +05:30
committed by GitHub
parent c20339d222
commit 4ef2844a22
13 changed files with 239 additions and 59 deletions

View File

@@ -10,7 +10,7 @@ import { defineImporter, IMPORTER_INVALID_FILE_FORMAT } from "."
// TODO: Add validation to output
const fetchGist = (
url: string
): TO.TaskOption<HoppCollection<HoppRESTRequest>> =>
): TO.TaskOption<HoppCollection<HoppRESTRequest>[]> =>
pipe(
TO.tryCatch(() =>
axios.get(`https://api.github.com/gists/${url.split("/").pop()}`, {
@@ -30,8 +30,10 @@ const fetchGist = (
)
export default defineImporter({
id: "gist",
name: "import.from_gist",
icon: "github",
applicableTo: ["my-collections", "team-collections"],
steps: [
step({
stepName: "URL_IMPORT",