@kolonydev/utils
v1.0.34
Published
## To publish this utility to npm
Downloads
3
Readme
kolonydev-utils
To publish this utility to npm
- run
yarn pub
- run
npm publish
Content manager temporary Documentation
import { ContentManager, ErrorLogger, Translation } from "@kolonydev/utils";
const logger = new ErrorLogger("");
const manager = new ContentManager(logger);
const contentBox = async () => {
const workspaces = (await manager.getWorkspaces()).results;
//alternative way of getting a workspace, with the exact name
const [kolonyWorkspace] = (
await manager.getWorkspaceWithName(workspaces[0].name)
).results;
//get all containers for a workspace using the workspaceId
const containers = (
await manager.getContainersForWorkspace(kolonyWorkspace.id)
).results;
//get all screens for a container using the containerId
const screens = (await manager.getScreensForContainer(containers[3].id))
.results;
//get all contents for a screen using the screenId and a specific translation. the default translation is English
const contents = (
await manager.getContentsForScreen(screens[2].id, Translation.enUs)
).results;
//swap template content variables for actual values
const content = (
await manager.getContentWithTitle(
contents[0].title,
{
translation: Translation.yoruba,
parameters: {
developer: "Daniel",
FAQ: "https://kolony.africa.com",
},
},
3
)
).results;
};
contentBox();