Files
hoppscotch/packages/hoppscotch-app/helpers/import-export/import/myCollections.ts
2022-01-14 20:40:54 +05:30

22 lines
608 B
TypeScript

import * as TE from "fp-ts/TaskEither"
import * as A from "fp-ts/Array"
import { pipe } from "fp-ts/function"
import { step } from "../steps"
import { defineImporter } from "."
import { getRESTCollection } from "~/newstore/collections"
export default defineImporter({
name: "import.from_my_collections",
icon: "user",
applicableTo: ["team-collections"],
steps: [
step({
stepName: "TARGET_MY_COLLECTION",
metadata: {
caption: "import.from_my_collections_description",
},
}),
] as const,
importer: ([content]) => pipe(content, getRESTCollection, A.of, TE.of),
})