myCollections.ts 631 B

12345678910111213141516171819202122
  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. id: "myCollections",
  9. name: "import.from_my_collections",
  10. icon: "user",
  11. applicableTo: ["team-collections"],
  12. steps: [
  13. step({
  14. stepName: "TARGET_MY_COLLECTION",
  15. metadata: {
  16. caption: "import.from_my_collections_description",
  17. },
  18. }),
  19. ] as const,
  20. importer: ([content]) => pipe(content, getRESTCollection, A.of, TE.of),
  21. })