UNPKG

sb-mig

Version:

CLI to rule the world. (and handle stuff related to Storyblok CMS)

28 lines (27 loc) 981 B
import { managementApi } from "../../api/managementApi.js"; import Logger from "../../utils/logger.js"; import { apiConfig } from "../api-config.js"; const INIT_COMMANDS = { stories: "stories", resolvers: "resolvers", }; export const testCommand = async (props) => { const { input, flags } = props; const command = input[1]; switch (command) { case INIT_COMMANDS.stories: Logger.warning(`test sb-mig... with command: ${command}`); console.log("This is api config"); console.log(apiConfig); const allStories = await managementApi.stories.getAllStories({ options: { language: "de-de", }, }, apiConfig); console.log("these are all stories"); console.log(JSON.stringify(allStories[0].story.content.body, null, 2)); break; default: console.log(`no command like that: ${command}`); } };