myCollections.ts 608 B

123456789101112131415161718192021
  1. import * as TE from "fp-ts/TaskEither"
  2. import * as A from "fp-ts/Array"
  3. import { pipe } from "fp-ts/function"
  4. import { step } from "../steps"
  5. import { defineImporter } from "."
  6. import { getRESTCollection } from "~/newstore/collections"
  7. export default defineImporter({
  8. name: "import.from_my_collections",
  9. icon: "user",
  10. applicableTo: ["team-collections"],
  11. steps: [
  12. step({
  13. stepName: "TARGET_MY_COLLECTION",
  14. metadata: {
  15. caption: "import.from_my_collections_description",
  16. },
  17. }),
  18. ] as const,
  19. importer: ([content]) => pipe(content, getRESTCollection, A.of, TE.of),
  20. })