1.0.34 • Published 2 years ago
@kolonydev/utils v1.0.34
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();
1.0.34
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.29
2 years ago
1.0.28
2 years ago
1.0.27
2 years ago
1.0.33
2 years ago
1.0.32
2 years ago
1.0.31
2 years ago
1.0.30
2 years ago
1.0.19
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago