Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@craftercms/models
Advanced tools
This package contains data model definitions of different structures of Crafter CMS. This interfaces are useful when developing in typescript.
yarn
or npm
yarn add @craftercms/models
npm install @craftercms/models
Crafter configuration model for modules to work
{
site: "editorial",
baseUrl: "http://localhost:8080"
}
import { CrafterConfig } from "@craftercms/models";
const config: CrafterConfig = {
site: "editorial",
baseUrl: "http://localhost:8090"
};
Crafter item model with its base properties
import { Item } from "@craftercms/models";
const item: Item = {
name: "index.xml",
url: "/site/website/index.xml",
descriptorUrl: "/site/website/index.xml",
descriptorDom: { ... },
folder: false
};
Crafter descriptor model with its base properties
import { Descriptor } from "@craftercms/models";
const item: Descriptor = {
page: { ... }
};
Crafter navigation item model with its base properties
import { NavigationItem } from "@craftercms/models";
const item: NavigationItem = {
url: "/site/website",
active: boolean,
subItems: [
{
//Each Item is a NavigationItem
}
]
};
Describes the container of a redux state, with entries and optional childIds.
import { StateContainer } from "@craftercms/models";
const item: StateContainer = {
entries: { /* type = LookupTable */ },
loading: { /* type = LookupTable */ }
childIds: { /* type = LookupTable */ }
};
Every property value in a state container is a LookupTable
Describes the crafter state, each entry is as StateContainer
import { CrafterState } from "@craftercms/models";
const item: CrafterState = {
items: { /* type = StateContainer */ }
};
Describes a namespaced state, with a CrafterState under the namespace
import { CrafterNamespacedState } from "@craftercms/models";
const item: CrafterNamespacedState = {
craftercms: { /* type = CrafterState */ }
};
Describes an object consisting on keys (item id property) and values (content itself)
import { LookupTable } from "@craftercms/models";
const item: LookupTable = {
/site/website/index.xml: {
name: "index.xml",
url: "/site/website/index.xml",
descriptorUrl: "/site/website/index.xml",
descriptorDom: { ... },
folder: false
}
};
Creates a lookup table based on an array of items (of a type) and the items id identifier.
import { createLookupTable } from "@craftercms/models";
import { Item } from "@craftercms/models";
// item (type Item) - Defined on previous example
const channelsTable = createLookupTable<Item>([item], 'url');
The lookupTable will look like this:
{
/site/website/index.xml: {
name: "index.xml",
url: "/site/website/index.xml",
descriptorUrl: "/site/website/index.xml",
descriptorDom: { ... },
folder: false
}
}
FAQs
Crafter CMS data model definitions
The npm package @craftercms/models receives a total of 128 weekly downloads. As such, @craftercms/models popularity was classified as not popular.
We found that @craftercms/models demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.