Skip to main content

Module: common

CromwellCMS Shared SDK

Exports common type definitions and helpers used by frontend and backend.

Install#

npm i @cromwell/core

Use#

Example of usage

import { getStoreItem, TCmsSettings } from '@cromwell/core';
const settings: TCmsSettings | undefined = getStoreItem('cmsSettings');

Table of contents#

Enumerations#

Type aliases#

Variables#

Functions#

Type aliases#

GraphQLPathsType#

Ƭ GraphQLPathsType: { [K in TDBEntity]: TGraphQLNode}

Defined in#

system/core/common/src/types/data.ts:160


TAdditionalExports#

Ƭ TAdditionalExports: Object

Type declaration#

NameType
importType?"default" | "named"
namestring
path?string
saveAsModules?string[]

Defined in#

system/core/common/src/types/data.ts:449


TAdminCustomEntity#

Ƭ TAdminCustomEntity: Object

Type declaration#

NameType
columns?TCustomEntityColumn[]
entityBaseRoute?string
entityLabel?string
entityListRoute?string
entityTypestring
icon?string
listLabelstring
route?string

Defined in#

system/core/common/src/types/entities.ts:769


TAdminCustomField#

Ƭ TAdminCustomField: Object

Type declaration#

NameType
column?TCustomEntityColumn
entityTypeEDBEntity | string
fieldTypeTCustomFieldType
idstring
keystring
label?string
options?string[]
order?number

Defined in#

system/core/common/src/types/entities.ts:758


TAttribute#

Ƭ TAttribute: TBasePageEntity & { icon?: string | null ; key?: string | null ; required?: boolean | null ; title?: string | null ; type?: "radio" | "checkbox" | null ; values?: TAttributeValue[] | null }

Attribute

Defined in#

system/core/common/src/types/entities.ts:366


TAttributeInput#

Ƭ TAttributeInput: Omit<TAttribute, TDBAuxiliaryColumns>

Defined in#

system/core/common/src/types/entities.ts:375


TAttributeInstance#

Ƭ TAttributeInstance: Object

Type declaration#

NameType
keystring
valuesTAttributeInstanceValue[]

Defined in#

system/core/common/src/types/entities.ts:383


TAttributeInstanceValue#

Ƭ TAttributeInstanceValue: Object

Type declaration#

NameType
valuestring

Defined in#

system/core/common/src/types/entities.ts:388


TAttributeValue#

Ƭ TAttributeValue: Object

Type declaration#

NameType
icon?string
title?string
valuestring

Defined in#

system/core/common/src/types/entities.ts:377


TAuthRole#

Ƭ TAuthRole: TUserRole | "self" | "all"

Defined in#

system/core/common/src/types/entities.ts:346


TBaseFilter#

Ƭ TBaseFilter: Object

Type declaration#

NameType
filters?{ exact?: boolean ; from?: string ; inMeta?: boolean ; key?: string ; to?: string ; value?: string | number | boolean | null }[]
sorts?{ inMeta?: boolean ; key?: string ; sort?: "ASC" | "DESC" }[]

Defined in#

system/core/common/src/types/entities.ts:55


TBaseModuleConfig#

Ƭ TBaseModuleConfig: Object

Base config for Theme / Plugin in cromwell.config.js

Type declaration#

NameType
rollupConfig?() => TRollupConfig | Promise<TRollupConfig>

Defined in#

system/core/common/src/types/data.ts:239


TBasePageEntity#

Ƭ TBasePageEntity: Object

Type declaration#

NameTypeDescription
createDate?Date | nullDB createDate
customMeta?Record<string, string | null> | nullEntity meta data from "{Entity}Meta" table
idnumberDB id
isEnabled?boolean | nullIs displaying at frontend
meta?TBasePageMeta | nullOther meta (SEO) data
pageDescription?string | nullPage meta description (SEO)
pageTitle?string | nullPage meta title (SEO)
slug?string | nullSlug for page route
updateDate?Date | nullDB updateDate
views?number | nullQnt of page requests

Defined in#

system/core/common/src/types/entities.ts:3


TBasePageEntityInput#

Ƭ TBasePageEntityInput: Omit<TBasePageEntity, TDBAuxiliaryColumns>

Defined in#

system/core/common/src/types/entities.ts:53


TBasePageMeta#

Ƭ TBasePageMeta: Object

Type declaration#

NameType
keywords?string[]
socialImage?string

Defined in#

system/core/common/src/types/entities.ts:46


TBlockContentProvider#

Ƭ TBlockContentProvider: Object

Type declaration#

NameTypeDescription
blockClass?stringAdditional CSS class to apply for block wrapper
componentDidUpdate?() => void-
getter(block: TCromwellBlock<Component<TCromwellBlockProps<Component<Object, Object, any>>, Object, any>>) => ReactNode-

Defined in#

system/core/common/src/types/blocks.ts:306


TBlockStoreProvider#

Ƭ TBlockStoreProvider: Object

Type declaration#

NameType
instancesRecord<string, TCromwellBlock | undefined>

Defined in#

system/core/common/src/types/blocks.ts:317


TCCSModuleInfo#

Ƭ TCCSModuleInfo: Object

Type declaration#

NameType
authorstring
authorLink?string
betaPackageVersionstring
betaVersionstring
createdAtDate
description?string
excerpt?string
icon?string
image?string
images?string[]
link?string
namestring
packageNamestring
packageVersionstring
slug?string
tags?string[]
title?string
updatedAtDate
versionstring

Defined in#

system/core/common/src/types/data.ts:541


TCCSModuleShortInfo#

Ƭ TCCSModuleShortInfo: Object

Type declaration#

NameType
betaPackageVersion?string
betaVersion?string
packageVersionstring
versionstring

Defined in#

system/core/common/src/types/data.ts:534


TCCSVersion#

Ƭ TCCSVersion: Object

Version of a CMS module. CCS - Cromwell Central Server

Type declaration#

NameType
betaboolean
changelog?string
createdAtDate
description?string
image?string
namestring
onlyManualUpdate?boolean
packageVersionstring
restartServiceskeyof TServiceVersions[]
versionstring

Defined in#

system/core/common/src/types/data.ts:521


TCmsAdminSettings#

Ƭ TCmsAdminSettings: Object

Admin (private) CMS settings

Type declaration#

NameTypeDescription
customEntities?TAdminCustomEntity[]Custom fields data
customFields?TAdminCustomField[]Custom fields data
sendFromEmail?stringE-mail to send mails from
smtpConnectionString?stringSMTP connection string to e-mail service provider

Defined in#

system/core/common/src/types/entities.ts:701


TCmsConfig#

Ƭ TCmsConfig: Object

cmsconfig.json

Type declaration#

NameType
accessTokenExpirationTime?number
accessTokenSecret?string
adminUrl?string
apiUrl?string
centralServerUrl?string
cmsInfo?TCmsInfo
cookieSecret?string
defaultSettings?TCmsEntityCore
domain?string
env?"dev" | "prod"
frontendUrl?string
monolith?boolean
orm?ConnectionOptions
pm?"yarn" | "cromwella"
redirects?TCmsRedirect[]
refreshTokenExpirationTime?number
refreshTokenSecret?string
rewrites?TCmsRedirect[]
serviceSecret?string
url?string
useWatch?boolean
watchPoll?number

Defined in#

system/core/common/src/types/data.ts:197


TCmsEntity#

Ƭ TCmsEntity: TCmsEntityCore & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:803


TCmsEntityCore#

Ƭ TCmsEntityCore: Object

DB CMS entity

Type declaration#

NameTypeDescription
adminSettings?TCmsAdminSettingsAdmin settings. Available from REST API endpoint with administrator role authorization
internalSettings?TCmsInternalSettingsInternal settings.
publicSettings?TCmsPublicSettingsPubic settings. Available from REST API endpoint without authentication.

Defined in#

system/core/common/src/types/entities.ts:614


TCmsInfo#

Ƭ TCmsInfo: Object

Type declaration#

NameType
packagesPartial<Record<typeof systemPackages[number], string>>

Defined in#

system/core/common/src/types/data.ts:588


TCmsInternalSettings#

Ƭ TCmsInternalSettings: Object

Internal CMS settings

Type declaration#

NameTypeDescription
beta?booleanInternal. Receive unstable beta-updates
installed?booleanInternal. If false or not set, will launch installation at first Admin Panel visit.
isUpdating?booleanInternal. Is currently under update
version?stringInternal. CMS version, used for updates
versions?TServiceVersionsInternal. https://github.com/CromwellCMS/Cromwell/blob/55046c48d9da0a44e4b11e7918c73876fcd1cfc1/system/manager/src/managers/baseManager.ts#L194:L206

Defined in#

system/core/common/src/types/entities.ts:725


TCmsModuleEntity#

Ƭ TCmsModuleEntity: Object

Type declaration#

NameType
defaultSettings?string | null
hasAdminBundle?boolean | null
isInstalled?boolean | null
isUpdating?boolean | null
moduleInfo?string | null
name?string | null
settings?string | null
title?string | null
version?string | null

Defined in#

system/core/common/src/types/entities.ts:584


TCmsPublicSettings#

Ƭ TCmsPublicSettings: Object

Public CMS settings

Type declaration#

NameTypeDescription
currencies?TCurrency[]Available currencies in the store and rates between them to convert
customMeta?Record<string, string>Data of custom fields
defaultPageSize?numberPage size to use in lists, eg. at Product Category page
defaultShippingPrice?numberStandard shipping price if no shipment methods specified
disablePayLater?booleanEnable "pay later" option (by default) or a customer must use one of payment services to finish order checkout
favicon?stringWebsite favicon
footerHtml?string-
headHtml?stringCustom HTML code injection
language?stringDefault language
logo?stringWebsite logo
redirects?TCmsRedirect[]HTTP Redirects for Next.js server
rewrites?TCmsRedirect[]HTTP rewrites for Next.js server
themeName?stringPackage name of currently used theme
timezone?numberDefault timezone in GMT, number +-
url?stringWebsite's URL

Defined in#

system/core/common/src/types/entities.ts:634


TCmsRedirect#

Ƭ TCmsRedirect: TCmsRedirectObject | TCmsRedirectFunction

Defined in#

system/core/common/src/types/entities.ts:830


TCmsRedirectFunction#

Ƭ TCmsRedirectFunction: (pathname: string, search?: string | null) => TCmsRedirectObject | undefined | void

Type declaration#

▸ (pathname, search?): TCmsRedirectObject | undefined | void

Parameters#
NameType
pathnamestring
search?string | null
Returns#

TCmsRedirectObject | undefined | void

Defined in#

system/core/common/src/types/entities.ts:828


TCmsRedirectObject#

Ƭ TCmsRedirectObject: Object

Type declaration#

NameType
from?string
permanent?boolean
statusCode?number
to?string

Defined in#

system/core/common/src/types/entities.ts:821


TCmsSettings#

Ƭ TCmsSettings: TCmsConfig & TCmsPublicSettings & TCmsAdminSettings & TCmsInternalSettings

Merged info form cmsconfig.json and settings from DB

Defined in#

system/core/common/src/types/data.ts:225


TCmsStats#

Ƭ TCmsStats: Object

Type declaration#

NameType
averageRatingnumber
customersnumber
ordersnumber
pageViewsnumber
pagesnumber
reviewsnumber
salesPerDayTSalePerDay[]
salesValuenumber
topPageViewsTPageStats[]

Defined in#

system/core/common/src/types/data.ts:462


TCmsStatus#

Ƭ TCmsStatus: Object

Type declaration#

NameType
currentVersion?string
isUpdating?boolean
notifications?TNotification[]
updateAvailableboolean
updateInfo?TUpdateInfo

Defined in#

system/core/common/src/types/data.ts:489


TCmsTheme#

Ƭ TCmsTheme: Object

Type declaration#

NameType
mode?"default" | "light" | "dark"
palette?TPalette

Defined in#

system/core/common/src/types/data.ts:579


TContentComponentProps#

Ƭ TContentComponentProps: Object

Type declaration#

NameType
children?React.ReactNode
config?TCromwellBlockData
idstring

Defined in#

system/core/common/src/types/blocks.ts:127


TCoupon#

Ƭ TCoupon: TCouponCore & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:579


TCouponCore#

Ƭ TCouponCore: Object

Store discount coupon

Type declaration#

NameTypeDescription
allowFreeShipping?boolean | nullSet zero shipping price
categoryIds?number[] | nullSpecific categories where coupon can be applied. Applied to all if not set
code?string | nullA secret code that customer will use to apply coupon
description?string | nullDescribe coupon
discountType?"fixed" | "percentage" | nullHow to apply coupon: subtract a fixed value from cart/product price or a percent of it.
expiryDate?Date | nullDate after which coupon will no longer be applicable
maximumSpend?number | nullMaximum cart total to apply this coupon
minimumSpend?number | nullMinimum cart total to apply this coupon
productIds?number[] | nullSpecific products on what coupon can be applied. Applied to all if not set
usageLimit?number | nullLimit usage times of this coupon
usedTimes?number | nullHow many time this coupon was applied to orders
value?number | nullHow much to subtract

Defined in#

system/core/common/src/types/entities.ts:528


TCouponInput#

Ƭ TCouponInput: TCouponCore & TBasePageEntityInput

Defined in#

system/core/common/src/types/entities.ts:581


TCreateUser#

Ƭ TCreateUser: Omit<TUser, TDBAuxiliaryColumns> & { password?: string }

Defined in#

system/core/common/src/types/entities.ts:348


TCromwellBlock#

Ƭ TCromwellBlock<TContentBlock>: React.Component<TCromwellBlockProps<TContentBlock>> & { addDidUpdateListener: (id: string, func: () => void) => void ; consumerRender: (jsxParentId?: string) => null | Element ; contentRender: (getContent?: null | (block: TCromwellBlock<Component<TCromwellBlockProps<Component<Object, Object, any>>, Object, any>>) => ReactNode) => ReactNode ; getBlockRef: () => RefObject<HTMLDivElement> ; getContentInstance: () => undefined | Component<Object, Object, any> & TContentBlock ; getData: () => undefined | TCromwellBlockData ; getDefaultContent: (setClasses?: (classes: string) => void) => ReactNode ; getInstanceId: () => string ; movedCompForceUpdate?: () => void ; notifyChildRegistered: (childInst: TCromwellBlock<any>) => void ; rerender: () => void | Promise<void> ; setContentInstance: (contentInstance: Component<Object, Object, any> & TContentBlock) => void }

Type parameters#

NameType
TContentBlockReact.Component<TCromwellBlockProps>

Defined in#

system/core/common/src/types/blocks.ts:84


TCromwellBlockData#

Ƭ TCromwellBlockData: Object

Modification for a Block. Used in the Theme Editor to store user's changes.

Type declaration#

NameTypeDescription
editor?ObjectFor editor block
editor.data?string-
editor.html?string-
editorHidden?booleanHide this block in Theme editor
editorStyles?ObjectStyles applied from PageBuilder's UI
editorStyles.align?"left" | "right" | "center"-
editorStyles.maxWidth?number-
editorStyles.offsetBottom?number-
editorStyles.offsetLeft?number-
editorStyles.offsetRight?number-
editorStyles.offsetTop?number-
gallery?TGallerySettingsFor gallery block
global?booleanPersist on all pages, all inner modifications will be saved as global
html?ObjectFor "HTML" block
html.innerHTML?string-
idstringComponent's id, must be unique in a page.
image?ObjectFor "image" block
image.alt?string-
image.height?number | string-
image.link?string-
image.objectFit?"contain" | "cover"-
image.src?string-
image.width?number | string-
image.withEffect?boolean-
index?numberIndex inside children array of parent element
isConstant?booleanIf true, user can't delete or modify this block in Theme editor
isDeleted?booleanNon-virtual blocks that exist in JSX cannot be deleted (or moved) in theme's source code by user but user can set isDeleted flag that will tell Blocks to render null instead
isVirtual?booleanIf true, indicates that this Block was created in Theme Editor and it doesn't exist in source files as React component. Exists only in page's config.
link?ObjectFor link block
link.href?string-
link.text?string-
parentId?stringId of Destination Component where this component will be displayed.
plugin?ObjectFor plugin block
plugin.blockName?stringPlugin's block name
plugin.instanceSettings?Record<string, any>Plugin's local settings
plugin.pluginName?stringPlugin's name to render inside component. Same name must be in module.config.js
style?string | React.CSSPropertiesCSS styles to apply to this block's wrapper
text?ObjectFor text block
text.content?string-
text.href?string-
text.textElementType?keyof React.ReactHTML-
type?TCromwellBlockTypeComponent's type

Defined in#

system/core/common/src/types/blocks.ts:147


TCromwellBlockProps#

Ƭ TCromwellBlockProps<TContentBlock>: { className?: string ; id: string ; jsxParentId?: string ; type?: TCromwellBlockType ; blockRef?: (block: TCromwellBlock<TContentBlock>) => void ; content?: (data: undefined | TCromwellBlockData, blockRef: RefObject<HTMLDivElement>, setContentInstance: (contentInstance: Component<Object, Object, any> & TContentBlock) => void, setClasses?: (classes: string) => void) => ReactNode ; onClick?: (event: MouseEvent<HTMLDivElement, MouseEvent>) => any } & TCromwellBlockData

Basic props for Blocks. Used in JSX by Theme authors

Type parameters#

NameType
TContentBlockReact.Component

Defined in#

system/core/common/src/types/blocks.ts:107


TCromwellBlockType#

Ƭ TCromwellBlockType: "container" | "plugin" | "text" | "HTML" | "image" | "gallery" | "list" | "editor" | "link"

Defined in#

system/core/common/src/types/blocks.ts:133


TCromwellNodeModules#

Ƭ TCromwellNodeModules: Object

Internal. Store for reusable Frontend dependencies.

Type declaration#

NameType
hasBeenExecuted?boolean
importStatuses?Record<string, "failed" | "ready" | "default" | Promise<"failed" | "ready" | "default">>
imports?Record<string, fn>
moduleExternals?Record<string, string[]>
modules?Record<string, any>
prefix?string
scriptStatuses?Record<string, "failed" | "ready" | Promise<"failed" | "ready">>
importModule?(moduleName: string, namedExports?: string[]) => boolean | Promise<boolean>
importScriptExternals?(metaInfo: TScriptMetaInfo) => Promise<boolean>
setPrefix?(prefix: string) => void

Defined in#

system/core/common/src/types/data.ts:333


TCromwellNotify#

Ƭ TCromwellNotify<TOptions>: Object

UI Notification service. In Admin panel it's react-toastify, for example.

Type parameters#

NameType
TOptionsany

Type declaration#

NameType
error?(message: string, options?: TOptions) => void
info?(message: string, options?: TOptions) => void
success?(message: string, options?: TOptions) => void
warning?(message: string, options?: TOptions) => void

Defined in#

system/core/common/src/types/data.ts:380


TCromwellPage#

Ƭ TCromwellPage<Props>: NextPage<Props & TCromwellPageCoreProps>

Type parameters#

NameType
PropsRecord<string, unknown> | undefined

Defined in#

system/core/common/src/types/blocks.ts:76


TCromwellPageCoreProps#

Ƭ TCromwellPageCoreProps: Object

Type declaration#

NameType
cmsPropsTPageCmsProps

Defined in#

system/core/common/src/types/blocks.ts:74


TCromwellStore#

Ƭ TCromwellStore: Object

Global store mostly for internal usage. If you need Redux interactivity, use onStoreChange.

Type declaration#

NameTypeDescription
apiClients?ObjectInternal
apiClients.graphQLClient?any-
apiClients.restAPIClient?any-
blockInstances?Record<string, TCromwellBlock | undefined>Internal. References to all instances of Cromwell Blocks at the page { [CromwellBlockId]: Instance}
cmsSettings?TCmsSettingsPublic CMS Settings
components?TSharedComponentsInternal. Shared component storage. E.g. product cards to be reused by Plugins { [ComponentName]: (Class/function) }
cstore?any-
currency?stringActive currency
dbInfo?TDBInfoInfo about current DB for backend usage
defaultPages?Partial<Record<TDefaultPageName, string>>See defaultPages in TThemeConfig
environment?Object-
environment.isAdminPanel?boolean-
environment.mode?"dev" | "prod"-
nodeModules?TCromwellNodeModules-
notifier?TCromwellNotify-
pageConfig?TPageConfigConfig of currently opened Theme's page
pagesInfo?TPageInfo[]Short pages info of current Theme
plugins?Record<string, Object>Internal. Plugins data
redirects?Record<string, TCmsRedirect>HTTP Redirects for Next.js server
rendererComponents?Partial<Record<"root" | "pageWrapper", React.ComponentType>>Custom components to inject by renderer into Theme
rewrites?Record<string, TCmsRedirect>HTTP rewrites for Next.js server
storeChangeCallbacks?Record<string, Record<string, fn>>-
theme?TCmsTheme-
themeCustomConfig?Record<string, any>-
userInfo?TUser-
webSocketClient?any-
forceUpdatePage?() => void-
fsRequire?(path: string) => Promise<any>-

Defined in#

system/core/common/src/types/data.ts:22


TCromwellaConfig#

Ƭ TCromwellaConfig: Object

Type declaration#

NameType
frontendDependencies?(string | TFrontendDependency)[]
packagesstring[]

Defined in#

system/core/common/src/types/data.ts:427


TCurrency#

Ƭ TCurrency: Object

Type declaration#

NameTypeDescription
idstring-
ratio?numberRatio for currencies to compare: "USD": 1,"EURO": 0.83, "GBP": 0.72 etc.
symbol?stringLocal currency symbols that will be added to price in getPriceWithCurrency method
tagstring-
title?string-

Defined in#

system/core/common/src/types/entities.ts:806


TCustomEntity#

Ƭ TCustomEntity: TBasePageEntity & { entityType: string ; name?: string | null }

Defined in#

system/core/common/src/types/entities.ts:832


TCustomEntityColumn#

Ƭ TCustomEntityColumn: Object

Type declaration#

NameType
customGraphQlFragment?string
disableSort?boolean
exactSearch?boolean
labelstring
maxWidth?string
meta?boolean
minWidth?string
multipleOptions?boolean
namestring
order?number
searchOptions?{ label: string ; value: any }[]
type?TCustomFieldType
visible?boolean
width?string
applyFilter?<TFilter>(value: any, filter: TFilter) => TFilter
getTooltipValueView?(value: any) => ReactNode
getValueView?(value: any) => ReactNode

Defined in#

system/core/common/src/types/entities.ts:780


TCustomEntityFilter#

Ƭ TCustomEntityFilter: TBaseFilter & { entityType?: string ; name?: string }

Defined in#

system/core/common/src/types/entities.ts:839


TCustomEntityInput#

Ƭ TCustomEntityInput: Omit<TCustomEntity, TDBAuxiliaryColumns>

Defined in#

system/core/common/src/types/entities.ts:837


TCustomFieldType#

Ƭ TCustomFieldType: "Simple text" | "Text editor" | "Select" | "Image" | "Gallery" | "Color" | "Date" | "Time" | "Datetime" | "Currency" | "Rating" | "Checkbox"

Defined in#

system/core/common/src/types/entities.ts:755


TDBAuxiliaryColumns#

Ƭ TDBAuxiliaryColumns: "id" | "createDate" | "updateDate"

Defined in#

system/core/common/src/types/entities.ts:51


TDBEntity#

Ƭ TDBEntity: keyof { Attribute: any ; CMS: any ; Coupon: any ; CustomEntity: any ; Generic: any ; Order: any ; Plugin: any ; Post: any ; PostComment: any ; Product: any ; ProductCategory: any ; ProductReview: any ; ProductVariant: any ; Tag: any ; Theme: any ; User: any }

Defined in#

system/core/common/src/types/data.ts:122


TDBInfo#

Ƭ TDBInfo: Object

Type declaration#

NameType
dbType?string

Defined in#

system/core/common/src/types/data.ts:584


TDataComponentProps#

Ƭ TDataComponentProps<Data>: Object

Type parameters#

Name
Data

Type declaration#

NameType
componentReact.ComponentType<Data>
pluginNamestring

Defined in#

system/core/common/src/types/blocks.ts:99


TDefaultPageName#

Ƭ TDefaultPageName: "index" | "category" | "product" | "post" | "tag" | "pages" | "account" | "checkout" | "blog"

Defined in#

system/core/common/src/types/data.ts:286


TDeleteManyInput#

Ƭ TDeleteManyInput: Object

Type declaration#

NameType
all?boolean
idsnumber[]

Defined in#

system/core/common/src/types/entities.ts:816


TExternal#

Ƭ TExternal: Object

Type declaration#

NameType
importName?string
moduleName?string
usedNamestring

Defined in#

system/core/common/src/types/data.ts:443


TFilteredProductList#

Ƭ TFilteredProductList: TPagedList<TProduct> & { filterMeta: TProductFilterMeta }

Defined in#

system/core/common/src/types/entities.ts:234


TFrontendBundle#

Ƭ TFrontendBundle: Object

Type declaration#

NameType
cjsPath?string
meta?TScriptMetaInfo
source?string

Defined in#

system/core/common/src/types/data.ts:367


TFrontendDependency#

Ƭ TFrontendDependency: Object

Type declaration#

NameType
addExports?TAdditionalExports[]
builtins?string[]
bundledCss?string[]
excludeExports?string[]
externals?TExternal[]
ignore?string[]
namestring
version?string

Defined in#

system/core/common/src/types/data.ts:432


TFrontendPluginProps#

Ƭ TFrontendPluginProps<TData, TInstanceSettings>: { blockId?: string ; blockName: string ; data?: TData ; instanceSettings?: TInstanceSettings ; pluginName: string } & Record<string, any>

Type parameters#

NameType
TDataany
TInstanceSettingsany

Defined in#

system/core/common/src/types/data.ts:571


TGallerySettings#

Ƭ TGallerySettings: Object

Type declaration#

NameTypeDescription
autoHeight?boolean-
autoPlay?boolean-
backgroundSize?"contain" | "cover"-
breakpoints?any-
classes?Object-
classes.navBtn?string-
components?Object-
components.backButton?React.ComponentType-
components.imgWrapper?React.ComponentType<Object>-
components.nextButton?React.ComponentType-
effect?"slide" | "fade" | "cube" | "coverflow" | "flip"-
fullscreen?boolean-
height?number-
images?TImageSettings[]-
interval?number-
lazy?boolean-
loop?boolean-
navigation?{ showOnHover?: boolean } | boolean-
orientation?"horizontal" | "vertical"-
pagination?boolean-
ratio?numberratio = width / height
responsive?Record<number, TGallerySettings>-
slideMaxWidth?number-
slideMinWidth?number-
slides?React.ReactNode[]-
spaceBetween?number-
speed?number-
thumbs?boolean | { backgroundSize?: "contain" | "cover" ; height?: number ; loop?: boolean ; width?: number }-
visibleSlides?number-
width?number-
zoom?boolean-

Defined in#

system/core/common/src/types/blocks.ts:262


TGetPluginStaticProps#

Ƭ TGetPluginStaticProps<TResult, TPluginSettings, Q>: (ctx: TStaticPagePluginContext<TPluginSettings, Q>) => Promise<TGetStaticPropsResult<TResult>> | TGetStaticPropsResult<TResult>

Type parameters#

NameType
TResultany
TPluginSettingsany
Qextends ParsedUrlQuery``ParsedUrlQuery

Type declaration#

▸ (ctx): Promise<TGetStaticPropsResult<TResult>> | TGetStaticPropsResult<TResult>

Parameters#
NameType
ctxTStaticPagePluginContext<TPluginSettings, Q>
Returns#

Promise<TGetStaticPropsResult<TResult>> | TGetStaticPropsResult<TResult>

Defined in#

system/core/common/src/types/blocks.ts:42


TGetStaticProps#

Ƭ TGetStaticProps<P, Q>: (ctx: TStaticPageContext<Q>) => Promise<TGetStaticPropsResult<P>> | TGetStaticPropsResult<P>

Type parameters#

NameType
Pany
Qextends ParsedUrlQuery``ParsedUrlQuery

Type declaration#

▸ (ctx): Promise<TGetStaticPropsResult<P>> | TGetStaticPropsResult<P>

Parameters#
NameType
ctxTStaticPageContext<Q>
Returns#

Promise<TGetStaticPropsResult<P>> | TGetStaticPropsResult<P>

Defined in#

system/core/common/src/types/blocks.ts:31


TGetStaticPropsResult#

Ƭ TGetStaticPropsResult<P>: GetStaticPropsResult<P> & { extraPlugins?: (TRegisteredPluginInfo | string)[] }

Type parameters#

Name
P

Defined in#

system/core/common/src/types/blocks.ts:23


TGraphQLNode#

Ƭ TGraphQLNode: Object

Index signature#

▪ [x: string]: string

Type declaration#

NameType
createstring
deletestring
deleteManystring
getFilteredstring
getManystring
getOneByIdstring
getOneBySlugstring
updatestring

Defined in#

system/core/common/src/types/data.ts:162


TImageSettings#

Ƭ TImageSettings: Object

Type declaration#

NameType
alt?string
href?string
id?string | number
srcstring
thumb?string

Defined in#

system/core/common/src/types/blocks.ts:254


TModuleConfig#

Ƭ TModuleConfig: TThemeConfig & TPluginConfig

Defined in#

system/core/common/src/types/data.ts:284


TNextDocumentContext#

Ƭ TNextDocumentContext: Partial<DocumentContext> & { cmsConfig?: TCmsConfig ; fullUrl?: string ; origin?: string }

Defined in#

system/core/common/src/types/blocks.ts:78


TNotification#

Ƭ TNotification: Object

Type declaration#

NameType
documentationLink?string
messagestring
pageLink?string
type"info" | "warning" | "error"

Defined in#

system/core/common/src/types/data.ts:509


TOrder#

Ƭ TOrder: TOrderCore & { coupons?: TCoupon[] | null }

Defined in#

system/core/common/src/types/entities.ts:465


TOrderCore#

Ƭ TOrderCore: Object

Store order

Type declaration#

NameType
cart?string | TStoreListItem[] | null
cartOldTotalPrice?number | null
cartTotalPrice?number | null
createDate?Date | null
currency?string | null
customMeta?Record<string, string | null> | null
customerAddress?string | null
customerComment?string | null
customerEmail?string | null
customerName?string | null
customerPhone?string | null
fromUrl?string | null
id?number | null
orderTotalPrice?number | null
paymentMethod?string | null
shippingMethod?string | null
shippingPrice?number | null
status?TOrderStatus | null
totalQnt?number | null
updateDate?Date | null
userId?number | null

Defined in#

system/core/common/src/types/entities.ts:441


TOrderFilter#

Ƭ TOrderFilter: TBaseFilter & { customerEmail?: string ; customerName?: string ; customerPhone?: string ; dateFrom?: string ; dateTo?: string ; orderId?: string ; status?: string }

Defined in#

system/core/common/src/types/entities.ts:475


TOrderInput#

Ƭ TOrderInput: TOrderCore & { couponCodes?: string[] | null }

Defined in#

system/core/common/src/types/entities.ts:471


TOrderPaymentSession#

Ƭ TOrderPaymentSession: TOrderInput & { appliedCoupons?: string[] ; cancelUrl?: string ; paymentOptions?: TPaymentOption[] ; paymentSessionId?: string ; shippingOptions?: TShippingOption[] ; successUrl?: string }

Defined in#

system/core/common/src/types/entities.ts:498


TOrderStatus#

Ƭ TOrderStatus: "Pending" | "Awaiting shipment" | "Shipped" | "Refunded" | "Cancelled" | "Completed"

Defined in#

system/core/common/src/types/entities.ts:469


TPackageCromwellConfig#

Ƭ TPackageCromwellConfig: Object

Module info in package.json under "cromwell" property

Type declaration#

NameTypeDescription
author?string-
authorLink?string-
bundledDependencies?string[]-
description?string-
excerpt?string-
firstLoadedDependencies?string[]-
frontendDependencies?(string | TFrontendDependency)[]-
icon?string-
image?string-
images?string[]-
link?string-
minCmsVersion?stringMinimal CMS version since when this module available to install
name?string-
packageName?string-
plugins?string[]-
tags?string[]-
themes?string[]-
title?string-
type?"plugin" | "theme"-
version?string-

Defined in#

system/core/common/src/types/data.ts:403


TPackageJson#

Ƭ TPackageJson: Object

package.json definition with cromwell info

Type declaration#

NameType
cromwell?TPackageCromwellConfig
dependencies?Record<string, string>
devDependencies?Record<string, string>
module?string
name?string
peerDependencies?Record<string, string>
version?string

Defined in#

system/core/common/src/types/data.ts:390


TPageCmsProps#

Ƭ TPageCmsProps: Object

Type declaration#

NameType
cmsSettings?TCmsSettings | null
defaultPages?Partial<Record<TDefaultPageName, string>>
documentContext?TNextDocumentContext
pageConfig?TPageConfig | null
pageConfigRoute?string
palette?TPalette | null
plugins?Record<string, Object>
resolvedPageRoute?string
router?NextRouter
slug?string | string[] | null
themeCustomConfig?Record<string, any> | null
themeFooterHtml?string | null
themeHeadHtml?string | null

Defined in#

system/core/common/src/types/blocks.ts:55


TPageConfig#

Ƭ TPageConfig: TPageInfo & { footerHtml?: string ; headHtml?: string ; modifications: TCromwellBlockData[] ; pageCustomConfig?: Record<string, any> }

Defined in#

system/core/common/src/types/data.ts:321


TPageInfo#

Ƭ TPageInfo: Object

Type declaration#

NameTypeDescription
description?stringMeta description (SEO)
idstringUnique ID of a page
isVirtual?booleanIf true, this page created in PageBuilder or manually in config and does not have a corresponding source file with React component
keywords?string[]Meta keywords (SEO)
layoutRoute?stringIf page is generic and theme has multiple layouts specify route to responsible Next.js page
namestringName
routestringPage's url/slug. Can be: 1. Filesystem relative path of page's react component without extension. If file name is "./post/[slug].tsx" then route must be "post/[slug]" 2. Route of a virtual page (generic page). Responsible component is "pages/[slug].js" , route must in format: "pages/any-slug"
title?stringMeta title (SEO)

Defined in#

system/core/common/src/types/data.ts:294


TPageStats#

Ƭ TPageStats: Object

Type declaration#

NameType
entityType?EDBEntity | string
pageId?string
pageName?string
pageRoute?string
slug?string | null
views?number

Defined in#

system/core/common/src/types/data.ts:474


TPagedList#

Ƭ TPagedList<Entity>: Object

Type parameters#

Name
Entity

Type declaration#

NameType
elements?Entity[]
pagedMeta?TPagedMeta

Defined in#

system/core/common/src/types/data.ts:175


TPagedMeta#

Ƭ TPagedMeta: Object

Type declaration#

NameType
pageNumber?number
pageSize?number
totalElements?number
totalPages?number

Defined in#

system/core/common/src/types/data.ts:187


TPagedParams#

Ƭ TPagedParams<Entity>: Object

Type parameters#

Name
Entity

Type declaration#

NameType
order?"ASC" | "DESC"
orderBy?keyof Entity
pageNumber?number
pageSize?number

Defined in#

system/core/common/src/types/data.ts:180


TPagesMetaInfo#

Ƭ TPagesMetaInfo: Object

Type declaration#

NameType
basePath?string
buildDir?string
paths{ basePath?: string ; importedStyles?: string[] ; localDepsBundle?: string ; localPath?: string ; pageName: string ; srcFullPath?: string }[]
rootBuildDir?string

Defined in#

system/core/common/src/types/data.ts:353


TPalette#

Ƭ TPalette: Object

Type declaration#

NameType
mode?"light" | "dark"
primaryColor?string
secondaryColor?string

Defined in#

system/core/common/src/types/data.ts:288


TPaymentOption#

Ƭ TPaymentOption: Object

Type declaration#

NameType
key?string
link?string
name?string

Defined in#

system/core/common/src/types/entities.ts:485


TPluginConfig#

Ƭ TPluginConfig: TBaseModuleConfig & { adminInputFile?: string ; backend?: string ; defaultSettings?: any ; frontendInputFile?: string ; frontendModule?: string }

Plugin module config, part of cromwell.config.js

Defined in#

system/core/common/src/types/data.ts:276


TPluginEntity#

Ƭ TPluginEntity: TCmsModuleEntity & TBasePageEntity

Plugin entity

Defined in#

system/core/common/src/types/entities.ts:606


TPluginEntityInput#

Ƭ TPluginEntityInput: TCmsModuleEntity & TBasePageEntityInput

Defined in#

system/core/common/src/types/entities.ts:608


TPluginInfo#

Ƭ TPluginInfo: Object

Type declaration#

NameType
namestring

Defined in#

system/core/common/src/types/data.ts:373


TPluginSettingsProps#

Ƭ TPluginSettingsProps<TSettings>: Object

Type parameters#

NameType
TSettingsany

Type declaration#

NameType
pluginInfo?TPackageCromwellConfig
pluginNamestring
pluginSettings?TSettings

Defined in#

system/core/common/src/types/data.ts:565


TPost#

Ƭ TPost: { author?: TUser | null ; authorId?: number | null ; content?: string | null ; delta?: string | null ; excerpt?: string | null ; featured?: boolean | null ; mainImage?: string | null ; publishDate?: Date | null ; published?: boolean | null ; readTime?: string | null ; tags?: TTag[] | null ; title?: string | null } & TBasePageEntity

POST

Defined in#

system/core/common/src/types/entities.ts:247


TPostComment#

Ƭ TPostComment: TPostCommentCore & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:521


TPostCommentCore#

Ƭ TPostCommentCore: Object

Blog comment

Type declaration#

NameType
approved?boolean
comment?string
postIdnumber
title?string
userEmail?string
userId?number
userName?string

Defined in#

system/core/common/src/types/entities.ts:511


TPostCommentInput#

Ƭ TPostCommentInput: TPostCommentCore & TBasePageEntityInput

Defined in#

system/core/common/src/types/entities.ts:523


TPostFilter#

Ƭ TPostFilter: TBaseFilter & { authorId?: number ; featured?: boolean | null ; published?: boolean ; tagIds?: number[] ; titleSearch?: string }

Defined in#

system/core/common/src/types/entities.ts:304


TPostInput#

Ƭ TPostInput: Omit<TPost, TDBAuxiliaryColumns | "author" | "tags"> & { authorId?: number | null ; tagIds?: number[] | null }

Defined in#

system/core/common/src/types/entities.ts:299


TProduct#

Ƭ TProduct: TBasePageEntity & { attributes?: TAttributeInstance[] | null ; categories?: TProductCategory[] | null ; description?: string | null ; descriptionDelta?: string | null ; images?: string[] | null ; mainCategoryId?: number | null ; mainImage?: string | null ; manageStock?: boolean | null ; name?: string | null ; oldPrice?: number | null ; price?: number | null ; rating?: TProductRating | null ; reviews?: TProductReview[] | null ; sku?: string | null ; stockAmount?: number | null ; stockStatus?: TStockStatus | null ; variants?: TProductVariant[] | null ; views?: number | null }

PRODUCT

Defined in#

system/core/common/src/types/entities.ts:128


TProductCategory#

Ƭ TProductCategory: TProductCategoryCore & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:114


TProductCategoryCore#

Ƭ TProductCategoryCore: Object

ProductCategory

Type declaration#

NameTypeDescription
children?TProductCategory[] | nullDB children
description?string | nullDescription (HTML allowed)
descriptionDelta?string | nullDescription in JSON format
mainImage?string | nullHref of main image
name?string | nullName of the category (h1)
nestedLevel?number | nullLevel in category tree counting from top (root category)
parent?TProductCategory | nullDB parent
products?TPagedList<TProduct> | nullProducts in category
views?number | nullQnt of page requests

Defined in#

system/core/common/src/types/entities.ts:75


TProductCategoryFilter#

Ƭ TProductCategoryFilter: TBaseFilter & { nameSearch?: string }

Defined in#

system/core/common/src/types/entities.ts:120


TProductCategoryInput#

Ƭ TProductCategoryInput: TBasePageEntityInput & Omit<TProductCategoryCore, "children" | "parent" | "products"> & { parentId?: number | null }

Defined in#

system/core/common/src/types/entities.ts:116


TProductFilter#

Ƭ TProductFilter: TBaseFilter & { attributes?: TProductFilterAttribute[] ; categoryId?: number ; maxPrice?: number ; minPrice?: number ; nameSearch?: string }

Defined in#

system/core/common/src/types/entities.ts:222


TProductFilterAttribute#

Ƭ TProductFilterAttribute: TBaseFilter & { key: string ; values: string[] }

Defined in#

system/core/common/src/types/entities.ts:229


TProductFilterMeta#

Ƭ TProductFilterMeta: Object

Type declaration#

NameType
maxPrice?number
minPrice?number

Defined in#

system/core/common/src/types/entities.ts:238


TProductInput#

Ƭ TProductInput: Omit<TProduct, TDBAuxiliaryColumns | "categories" | "rating" | "reviews" | "variants"> & { categoryIds?: number[] | null ; variants?: TProductVariantInput[] | null }

Defined in#

system/core/common/src/types/entities.ts:216


TProductRating#

Ƭ TProductRating: Object

Type declaration#

NameTypeDescription
average?number | nullRating 1-5
reviewsNumber?number | nullNumber of customer reviews

Defined in#

system/core/common/src/types/entities.ts:205


TProductReview#

Ƭ TProductReview: TProductReviewCore & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:426


TProductReviewCore#

Ƭ TProductReviewCore: Object

ProductReview

Type declaration#

NameType
approved?boolean | null
description?string | null
productId?number | null
rating?number | null
title?string | null
userEmail?string | null
userId?number | null
userName?string | null

Defined in#

system/core/common/src/types/entities.ts:415


TProductReviewFilter#

Ƭ TProductReviewFilter: TBaseFilter & { approved?: boolean ; productId?: number ; userId?: number ; userName?: string }

Defined in#

system/core/common/src/types/entities.ts:430


TProductReviewInput#

Ƭ TProductReviewInput: TProductReviewCore & TBasePageEntityInput

Defined in#

system/core/common/src/types/entities.ts:428


TProductVariant#

Ƭ TProductVariant: TBasePageEntity & { attributes?: Record<string, string | number | "any"> | null ; description?: string | null ; descriptionDelta?: string | null ; images?: string[] | null ; mainImage?: string | null ; manageStock?: boolean | null ; name?: string | null ; oldPrice?: number | null ; price?: number | null ; sku?: string | null ; stockAmount?: number | null ; stockStatus?: TStockStatus | null }

Defined in#

system/core/common/src/types/entities.ts:392


TProductVariantInput#

Ƭ TProductVariantInput: Omit<TProductVariant, TDBAuxiliaryColumns> & { id?: number | null ; productId?: number | null }

Defined in#

system/core/common/src/types/entities.ts:407


TRegisteredPluginInfo#

Ƭ TRegisteredPluginInfo: Object

Type declaration#

NameType
globalSettings?any | null
pluginInstances?any | null
pluginNamestring
version?string | null

Defined in#

system/core/common/src/types/blocks.ts:48


TRollupConfig#

Ƭ TRollupConfig: Object

Type declaration#

NameType
adminPanel?Record<string, any>
backend?Record<string, any>
frontend?Record<string, any>
frontendCjs?Record<string, any>
mainRecord<string, any>
themePages?Record<string, any>

Defined in#

system/core/common/src/types/data.ts:227


TSalePerDay#

Ƭ TSalePerDay: Object

Type declaration#

NameType
dateDate
ordersnumber
salesValuenumber

Defined in#

system/core/common/src/types/data.ts:483


TScriptMetaInfo#

Ƭ TScriptMetaInfo: Object

Type declaration#

NameType
externalDependenciesRecord<string, string[]>
import?"chunks" | "lib"
namestring

Defined in#

system/core/common/src/types/data.ts:346


TServiceVersions#

Ƭ TServiceVersions: Object

Type declaration#

NameType
admin?number
api-server?number
renderer?number
server?number

Defined in#

system/core/common/src/types/entities.ts:748


TSharedComponents#

Ƭ TSharedComponents: Partial<Object>

Defined in#

system/core/common/src/types/data.ts:624


TShippingOption#

Ƭ TShippingOption: Object

Type declaration#

NameType
keystring
label?string
name?string
price?number

Defined in#

system/core/common/src/types/entities.ts:491


TStaticPageContext#

Ƭ TStaticPageContext<Q>: Object

Type parameters#

NameType
Qextends ParsedUrlQuery``ParsedUrlQuery

Type declaration#

NameType
cmsSettings?TCmsConfig
pageConfig?TPageConfig
pagesInfo?TPageInfo[]
params?Q
preview?boolean
previewData?any
themeConfig?TThemeConfig
themeCustomConfig?any
userConfig?TThemeConfig

Defined in#

system/core/common/src/types/blocks.ts:11


TStaticPagePluginContext#

Ƭ TStaticPagePluginContext<TPluginSettings, Q>: TStaticPageContext<Q> & { pluginInstances?: Record<string, any> ; pluginSettings?: TPluginSettings }

Type parameters#

NameType
TPluginSettingsany
Qextends ParsedUrlQuery``ParsedUrlQuery

Defined in#

system/core/common/src/types/blocks.ts:34


TStockStatus#

Ƭ TStockStatus: "In stock" | "Out of stock" | "On backorder"

Defined in#

system/core/common/src/types/entities.ts:203


TStoreListItem#

Ƭ TStoreListItem: Object

Type declaration#

NameType
amount?number
pickedAttributes?Record<string, string[]>
product?TProduct

Defined in#

system/core/common/src/types/data.ts:456


TSystemUsage#

Ƭ TSystemUsage: Object

Type declaration#

NameType
cpuInfoObject
cpuInfo.brandstring
cpuInfo.coresnumber
cpuInfo.manufacturerstring
cpuInfo.speedstring
cpuUsageObject
cpuUsage.currentLoadnumber
cpuUsage.currentLoadIdlenumber
cpuUsage.previousLoads{ load: number ; time: Date }[]
diskUsageObject
diskUsage.availablenumber
diskUsage.sizenumber
diskUsage.usednumber
memoryUsageObject
memoryUsage.availablenumber
memoryUsage.totalnumber
memoryUsage.usednumber
osInfoObject
osInfo.archstring
osInfo.distrostring
osInfo.platformstring

Defined in#

system/core/common/src/types/data.ts:592


TTag#

Ƭ TTag: TBasePageEntity & { color?: string | null ; description?: string | null ; descriptionDelta?: string | null ; image?: string | null ; name?: string | null ; views?: number | null }

Defined in#

system/core/common/src/types/entities.ts:312


TTagInput#

Ƭ TTagInput: Omit<TTag, TDBAuxiliaryColumns>

Defined in#

system/core/common/src/types/entities.ts:321


TThemeConfig#

Ƭ TThemeConfig: TBaseModuleConfig & { defaultPages?: Record<TDefaultPageName, string> ; footerHtml?: string ; genericPages?: { name: string ; route: string }[] ; globalCss?: string[] ; globalModifications?: TCromwellBlockData[] ; headHtml?: string ; pages?: TPageConfig[] ; palette?: TPalette ; themeCustomConfig?: Record<string, any> ; nextConfig?: () => any }

Theme module config, part of cromwell.config.js

Defined in#

system/core/common/src/types/data.ts:247


TThemeEntity#

Ƭ TThemeEntity: TCmsModuleEntity & TBasePageEntity

Defined in#

system/core/common/src/types/entities.ts:596


TThemeEntityInput#

Ƭ TThemeEntityInput: TCmsModuleEntity & TBasePageEntityInput

Defined in#

system/core/common/src/types/entities.ts:598


TUpdateInfo#

Ƭ TUpdateInfo: Object

Type declaration#

NameType
betaboolean
changelog?string
createdAtDate
description?string
image?string
namestring
onlyManualUpdate?boolean
packageVersionstring
versionstring

Defined in#

system/core/common/src/types/data.ts:497


TUpdateUser#

Ƭ TUpdateUser: Omit<TUser, TDBAuxiliaryColumns>

Defined in#

system/core/common/src/types/entities.ts:352


TUser#

Ƭ TUser: TBasePageEntity & { address?: string | null ; avatar?: string | null ; bio?: string | null ; email?: string | null ; fullName?: string | null ; phone?: string | null ; role?: TUserRole | null }

USER / AUTHOR

Defined in#

system/core/common/src/types/entities.ts:327


TUserFilter#

Ƭ TUserFilter: TBaseFilter & { address?: string ; email?: string ; fullName?: string ; phone?: string ; role?: TUserRole }

Defined in#

system/core/common/src/types/entities.ts:354


TUserRole#

Ƭ TUserRole: "administrator" | "author" | "customer" | "guest"

Defined in#

system/core/common/src/types/entities.ts:345

Variables#

GraphQLPaths#

Const GraphQLPaths: { [K in Exclude<TDBEntity, "Theme" | "Plugin" | "PostComment" | "CMS">]: TGraphQLNode}

Defined in#

system/core/common/src/constants.ts:4


bundledModulesDirName#

Const bundledModulesDirName: "bundled-modules"

Defined in#

system/core/common/src/constants.ts:157


genericPageName#

Const genericPageName: "pages/[slug]"

Defined in#

system/core/common/src/constants.ts:149


moduleArchiveFileName#

Const moduleArchiveFileName: "module.zip"

Defined in#

system/core/common/src/constants.ts:156


moduleBundleInfoFileName#

Const moduleBundleInfoFileName: "bundle.info.json"

Defined in#

system/core/common/src/constants.ts:155


moduleChunksBuildDirChunk#

Const moduleChunksBuildDirChunk: "chunks"

Defined in#

system/core/common/src/constants.ts:162


moduleExportsDirChunk#

Const moduleExportsDirChunk: "generated"

Defined in#

system/core/common/src/constants.ts:161


moduleGeneratedFileName#

Const moduleGeneratedFileName: "generated.js"

Defined in#

system/core/common/src/constants.ts:158


moduleLibBuildFileName#

Const moduleLibBuildFileName: "lib.bundle.js"

Defined in#

system/core/common/src/constants.ts:152


moduleMainBuildFileName#

Const moduleMainBuildFileName: "main.bundle.js"

Defined in#

system/core/common/src/constants.ts:151


moduleMetaInfoFileName#

Const moduleMetaInfoFileName: "meta.json"

Defined in#

system/core/common/src/constants.ts:154


moduleNodeBuildFileName#

Const moduleNodeBuildFileName: "node.bundle.js"

Defined in#

system/core/common/src/constants.ts:153


moduleNodeGeneratedFileName#

Const moduleNodeGeneratedFileName: "generated.node.js"

Defined in#

system/core/common/src/constants.ts:160


moduleOneChunkGeneratedFileName#

Const moduleOneChunkGeneratedFileName: "generated.lib.js"

Defined in#

system/core/common/src/constants.ts:159


nodeRequire#

Const nodeRequire: NodeRequire

Defined in#

system/core/common/src/constants.ts:176


payLaterOption#

Const payLaterOption: TPaymentOption

Defined in#

system/core/common/src/constants.ts:183


serviceLocator#

Const serviceLocator: Object

Get base url of a CMS Service

Type declaration#

NameType
defaultLocationsTCmsConfig
getAdminUrl() => undefined | string | number | true | ConnectionOptions | TCmsRedirect[] | TCmsEntityCore | TCmsInfo
getApiUrl() => undefined | string | number | true | ConnectionOptions | TCmsRedirect[] | TCmsEntityCore | TCmsInfo
getFrontendUrl() => undefined | string | number | true | ConnectionOptions | TCmsRedirect[] | TCmsEntityCore | TCmsInfo

Defined in#

system/core/common/src/service-locator.ts:27


standardShipping#

Const standardShipping: TShippingOption

Defined in#

system/core/common/src/constants.ts:178


systemPackages#

Const systemPackages: readonly ["@cromwell/core", "@cromwell/admin-panel", "@cromwell/cli", "@cromwell/core-backend", "@cromwell/core-frontend", "@cromwell/cms", "@cromwell/renderer", "@cromwell/server", "@cromwell/utils"]

Defined in#

system/core/common/src/constants.ts:164

Functions#

findRedirect#

Const findRedirect(pathname, search?): undefined | TCmsRedirectObject & { type: "redirect" | "rewrite" }

Parameters#

NameType
pathnamestring
search?null | string

Returns#

undefined | TCmsRedirectObject & { type: "redirect" | "rewrite" }

Defined in#

system/core/common/src/redirects.ts:4


getBlockInstance#

Const getBlockInstance<TContentBlock>(blockId): undefined | TCromwellBlock<TContentBlock>

Type parameters#

NameType
TContentBlockComponent<Object, Object, any>

Parameters#

NameType
blockIdstring

Returns#

undefined | TCromwellBlock<TContentBlock>

Defined in#

system/core/common/src/global-store.ts:113


getCmsSettings#

Const getCmsSettings(): undefined | TCmsSettings

Returns#

undefined | TCmsSettings

Defined in#

system/core/common/src/global-store.ts:73


getPageCustomConfig#

Const getPageCustomConfig(): undefined | Record<string, any>

Returns#

undefined | Record<string, any>

Defined in#

system/core/common/src/global-store.ts:68


getRandStr#

Const getRandStr(length?): string

Parameters#

NameTypeDefault value
lengthnumber12

Returns#

string

Defined in#

system/core/common/src/helpers.ts:7


getSharedComponent#

Const getSharedComponent<K>(componentName): Partial<Object>[K]

Type parameters#

NameType
Kextends ESharedComponentNames

Parameters#

NameType
componentNameK

Returns#

Partial<Object>[K]

Defined in#

system/core/common/src/global-store.ts:97


getStore#

Const getStore(): TCromwellStore

Returns#

TCromwellStore

Defined in#

system/core/common/src/global-store.ts:19


getStoreItem#

Const getStoreItem<K>(itemName): TCromwellStore[K]

Type parameters#

NameType
Kextends keyof TCromwellStore

Parameters#

NameType
itemNameK

Returns#

TCromwellStore[K]

Defined in#

system/core/common/src/global-store.ts:28


getThemeCustomConfig#

Const getThemeCustomConfig(): undefined | Record<string, any>

Returns#

undefined | Record<string, any>

Defined in#

system/core/common/src/global-store.ts:78


getThemeCustomConfigProp#

Const getThemeCustomConfigProp(propPath): any

Parameters#

NameType
propPathstring

Returns#

any

Defined in#

system/core/common/src/global-store.ts:82


isServer#

Const isServer(): boolean

Returns#

boolean

Defined in#

system/core/common/src/helpers.ts:4


onStoreChange#

Const onStoreChange<K>(itemName, callback, callbackId?): string

Type parameters#

NameType
Kextends keyof TCromwellStore

Parameters#

NameType
itemNameK
callback(itemValue: TCromwellStore[K]) => any
callbackId?string

Returns#

string

Defined in#

system/core/common/src/global-store.ts:45


registerRedirect#

Const registerRedirect(ruleName, redirect): void

Parameters#

NameType
ruleNamestring
redirectTCmsRedirect

Returns#

void

Defined in#

system/core/common/src/global-store.ts:120


registerRewrite#

Const registerRewrite(ruleName, rewrite): void

Parameters#

NameType
ruleNamestring
rewriteTCmsRedirect

Returns#

void

Defined in#

system/core/common/src/global-store.ts:129


registerSharedComponent#

Const registerSharedComponent<K>(componentName, component): void

Type parameters#

NameType
Kextends ESharedComponentNames

Parameters#

NameType
componentNameK
componentPartial<Object>[K]

Returns#

void

Defined in#

system/core/common/src/global-store.ts:103


removeOnStoreChange#

Const removeOnStoreChange<K>(itemName, callbackId): void

Type parameters#

NameType
Kextends keyof TCromwellStore

Parameters#

NameType
itemNameK
callbackIdstring

Returns#

void

Defined in#

system/core/common/src/global-store.ts:61


resolvePageRoute#

Const resolvePageRoute(pageName, routeOptions?): string

Resolves page name to target page route

Parameters#

NameTypeDescription
pageNamestringCan be: 1. TDefaultPageName (eg. product), 2. Resolved default page name (eg. product/[slug]), 3. Target page name (eg. product/my-product)
routeOptions?ObjectOptions for resolving page route - slug - Page slug (URL) to resolve inputs in form of: product/[slug]
routeOptions.id?string-
routeOptions.slug?string | number-

Returns#

string

Defined in#

system/core/common/src/helpers.ts:23


setStoreItem#

Const setStoreItem<K>(itemName, item): void

Type parameters#

NameType
Kextends keyof TCromwellStore

Parameters#

NameType
itemNameK
itemTCromwellStore[K]

Returns#

void

Defined in#

system/core/common/src/global-store.ts:32


sleep#

Const sleep(time): Promise<unknown>

Parameters#

NameType
timenumber

Returns#

Promise<unknown>

Defined in#

system/core/common/src/helpers.ts:11