Module: common
CromwellCMS Shared SDK
Exports common type definitions and helpers used by frontend and backend.
Install#
npm i @cromwell/coreUse#
Example of usage
import { getStoreItem, TCmsSettings } from '@cromwell/core';
const settings: TCmsSettings | undefined = getStoreItem('cmsSettings');Table of contents#
Enumerations#
Type aliases#
- GraphQLPathsType
- TAdditionalExports
- TAdminCustomEntity
- TAdminCustomField
- TAttribute
- TAttributeInput
- TAttributeInstance
- TAttributeInstanceValue
- TAttributeValue
- TAuthRole
- TBaseFilter
- TBaseModuleConfig
- TBasePageEntity
- TBasePageEntityInput
- TBasePageMeta
- TBlockContentProvider
- TBlockStoreProvider
- TCCSModuleInfo
- TCCSModuleShortInfo
- TCCSVersion
- TCmsAdminSettings
- TCmsConfig
- TCmsEntity
- TCmsEntityCore
- TCmsInfo
- TCmsInternalSettings
- TCmsModuleEntity
- TCmsPublicSettings
- TCmsRedirect
- TCmsRedirectFunction
- TCmsRedirectObject
- TCmsSettings
- TCmsStats
- TCmsStatus
- TCmsTheme
- TContentComponentProps
- TCoupon
- TCouponCore
- TCouponInput
- TCreateUser
- TCromwellBlock
- TCromwellBlockData
- TCromwellBlockProps
- TCromwellBlockType
- TCromwellNodeModules
- TCromwellNotify
- TCromwellPage
- TCromwellPageCoreProps
- TCromwellStore
- TCromwellaConfig
- TCurrency
- TCustomEntity
- TCustomEntityColumn
- TCustomEntityFilter
- TCustomEntityInput
- TCustomFieldType
- TDBAuxiliaryColumns
- TDBEntity
- TDBInfo
- TDataComponentProps
- TDefaultPageName
- TDeleteManyInput
- TExternal
- TFilteredProductList
- TFrontendBundle
- TFrontendDependency
- TFrontendPluginProps
- TGallerySettings
- TGetPluginStaticProps
- TGetStaticProps
- TGetStaticPropsResult
- TGraphQLNode
- TImageSettings
- TModuleConfig
- TNextDocumentContext
- TNotification
- TOrder
- TOrderCore
- TOrderFilter
- TOrderInput
- TOrderPaymentSession
- TOrderStatus
- TPackageCromwellConfig
- TPackageJson
- TPageCmsProps
- TPageConfig
- TPageInfo
- TPageStats
- TPagedList
- TPagedMeta
- TPagedParams
- TPagesMetaInfo
- TPalette
- TPaymentOption
- TPluginConfig
- TPluginEntity
- TPluginEntityInput
- TPluginInfo
- TPluginSettingsProps
- TPost
- TPostComment
- TPostCommentCore
- TPostCommentInput
- TPostFilter
- TPostInput
- TProduct
- TProductCategory
- TProductCategoryCore
- TProductCategoryFilter
- TProductCategoryInput
- TProductFilter
- TProductFilterAttribute
- TProductFilterMeta
- TProductInput
- TProductRating
- TProductReview
- TProductReviewCore
- TProductReviewFilter
- TProductReviewInput
- TProductVariant
- TProductVariantInput
- TRegisteredPluginInfo
- TRollupConfig
- TSalePerDay
- TScriptMetaInfo
- TServiceVersions
- TSharedComponents
- TShippingOption
- TStaticPageContext
- TStaticPagePluginContext
- TStockStatus
- TStoreListItem
- TSystemUsage
- TTag
- TTagInput
- TThemeConfig
- TThemeEntity
- TThemeEntityInput
- TUpdateInfo
- TUpdateUser
- TUser
- TUserFilter
- TUserRole
Variables#
- GraphQLPaths
- bundledModulesDirName
- genericPageName
- moduleArchiveFileName
- moduleBundleInfoFileName
- moduleChunksBuildDirChunk
- moduleExportsDirChunk
- moduleGeneratedFileName
- moduleLibBuildFileName
- moduleMainBuildFileName
- moduleMetaInfoFileName
- moduleNodeBuildFileName
- moduleNodeGeneratedFileName
- moduleOneChunkGeneratedFileName
- nodeRequire
- payLaterOption
- serviceLocator
- standardShipping
- systemPackages
Functions#
- findRedirect
- getBlockInstance
- getCmsSettings
- getPageCustomConfig
- getRandStr
- getSharedComponent
- getStore
- getStoreItem
- getThemeCustomConfig
- getThemeCustomConfigProp
- isServer
- onStoreChange
- registerRedirect
- registerRewrite
- registerSharedComponent
- removeOnStoreChange
- resolvePageRoute
- setStoreItem
- sleep
Type aliases#
GraphQLPathsType#
Ƭ GraphQLPathsType: { [K in TDBEntity]: TGraphQLNode}
Defined in#
system/core/common/src/types/data.ts:160
TAdditionalExports#
Ƭ TAdditionalExports: Object
Type declaration#
| Name | Type |
|---|---|
importType? | "default" | "named" |
name | string |
path? | string |
saveAsModules? | string[] |
Defined in#
system/core/common/src/types/data.ts:449
TAdminCustomEntity#
Ƭ TAdminCustomEntity: Object
Type declaration#
| Name | Type |
|---|---|
columns? | TCustomEntityColumn[] |
entityBaseRoute? | string |
entityLabel? | string |
entityListRoute? | string |
entityType | string |
icon? | string |
listLabel | string |
route? | string |
Defined in#
system/core/common/src/types/entities.ts:769
TAdminCustomField#
Ƭ TAdminCustomField: Object
Type declaration#
| Name | Type |
|---|---|
column? | TCustomEntityColumn |
entityType | EDBEntity | string |
fieldType | TCustomFieldType |
id | string |
key | string |
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#
| Name | Type |
|---|---|
key | string |
values | TAttributeInstanceValue[] |
Defined in#
system/core/common/src/types/entities.ts:383
TAttributeInstanceValue#
Ƭ TAttributeInstanceValue: Object
Type declaration#
| Name | Type |
|---|---|
value | string |
Defined in#
system/core/common/src/types/entities.ts:388
TAttributeValue#
Ƭ TAttributeValue: Object
Type declaration#
| Name | Type |
|---|---|
icon? | string |
title? | string |
value | string |
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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
rollupConfig? | () => TRollupConfig | Promise<TRollupConfig> |
Defined in#
system/core/common/src/types/data.ts:239
TBasePageEntity#
Ƭ TBasePageEntity: Object
Type declaration#
| Name | Type | Description |
|---|---|---|
createDate? | Date | null | DB createDate |
customMeta? | Record<string, string | null> | null | Entity meta data from "{Entity}Meta" table |
id | number | DB id |
isEnabled? | boolean | null | Is displaying at frontend |
meta? | TBasePageMeta | null | Other meta (SEO) data |
pageDescription? | string | null | Page meta description (SEO) |
pageTitle? | string | null | Page meta title (SEO) |
slug? | string | null | Slug for page route |
updateDate? | Date | null | DB updateDate |
views? | number | null | Qnt 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#
| Name | Type |
|---|---|
keywords? | string[] |
socialImage? | string |
Defined in#
system/core/common/src/types/entities.ts:46
TBlockContentProvider#
Ƭ TBlockContentProvider: Object
Type declaration#
| Name | Type | Description |
|---|---|---|
blockClass? | string | Additional 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#
| Name | Type |
|---|---|
instances | Record<string, TCromwellBlock | undefined> |
Defined in#
system/core/common/src/types/blocks.ts:317
TCCSModuleInfo#
Ƭ TCCSModuleInfo: Object
Type declaration#
| Name | Type |
|---|---|
author | string |
authorLink? | string |
betaPackageVersion | string |
betaVersion | string |
createdAt | Date |
description? | string |
excerpt? | string |
icon? | string |
image? | string |
images? | string[] |
link? | string |
name | string |
packageName | string |
packageVersion | string |
slug? | string |
tags? | string[] |
title? | string |
updatedAt | Date |
version | string |
Defined in#
system/core/common/src/types/data.ts:541
TCCSModuleShortInfo#
Ƭ TCCSModuleShortInfo: Object
Type declaration#
| Name | Type |
|---|---|
betaPackageVersion? | string |
betaVersion? | string |
packageVersion | string |
version | string |
Defined in#
system/core/common/src/types/data.ts:534
TCCSVersion#
Ƭ TCCSVersion: Object
Version of a CMS module. CCS - Cromwell Central Server
Type declaration#
| Name | Type |
|---|---|
beta | boolean |
changelog? | string |
createdAt | Date |
description? | string |
image? | string |
name | string |
onlyManualUpdate? | boolean |
packageVersion | string |
restartServices | keyof TServiceVersions[] |
version | string |
Defined in#
system/core/common/src/types/data.ts:521
TCmsAdminSettings#
Ƭ TCmsAdminSettings: Object
Admin (private) CMS settings
Type declaration#
| Name | Type | Description |
|---|---|---|
customEntities? | TAdminCustomEntity[] | Custom fields data |
customFields? | TAdminCustomField[] | Custom fields data |
sendFromEmail? | string | E-mail to send mails from |
smtpConnectionString? | string | SMTP connection string to e-mail service provider |
Defined in#
system/core/common/src/types/entities.ts:701
TCmsConfig#
Ƭ TCmsConfig: Object
cmsconfig.json
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type | Description |
|---|---|---|
adminSettings? | TCmsAdminSettings | Admin settings. Available from REST API endpoint with administrator role authorization |
internalSettings? | TCmsInternalSettings | Internal settings. |
publicSettings? | TCmsPublicSettings | Pubic settings. Available from REST API endpoint without authentication. |
Defined in#
system/core/common/src/types/entities.ts:614
TCmsInfo#
Ƭ TCmsInfo: Object
Type declaration#
| Name | Type |
|---|---|
packages | Partial<Record<typeof systemPackages[number], string>> |
Defined in#
system/core/common/src/types/data.ts:588
TCmsInternalSettings#
Ƭ TCmsInternalSettings: Object
Internal CMS settings
Type declaration#
| Name | Type | Description |
|---|---|---|
beta? | boolean | Internal. Receive unstable beta-updates |
installed? | boolean | Internal. If false or not set, will launch installation at first Admin Panel visit. |
isUpdating? | boolean | Internal. Is currently under update |
version? | string | Internal. CMS version, used for updates |
versions? | TServiceVersions | Internal. 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#
| Name | Type |
|---|---|
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#
| Name | Type | Description |
|---|---|---|
currencies? | TCurrency[] | Available currencies in the store and rates between them to convert |
customMeta? | Record<string, string> | Data of custom fields |
defaultPageSize? | number | Page size to use in lists, eg. at Product Category page |
defaultShippingPrice? | number | Standard shipping price if no shipment methods specified |
disablePayLater? | boolean | Enable "pay later" option (by default) or a customer must use one of payment services to finish order checkout |
favicon? | string | Website favicon |
footerHtml? | string | - |
headHtml? | string | Custom HTML code injection |
language? | string | Default language |
logo? | string | Website logo |
redirects? | TCmsRedirect[] | HTTP Redirects for Next.js server |
rewrites? | TCmsRedirect[] | HTTP rewrites for Next.js server |
themeName? | string | Package name of currently used theme |
timezone? | number | Default timezone in GMT, number +- |
url? | string | Website'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#
| Name | Type |
|---|---|
pathname | string |
search? | string | null |
Returns#
TCmsRedirectObject | undefined | void
Defined in#
system/core/common/src/types/entities.ts:828
TCmsRedirectObject#
Ƭ TCmsRedirectObject: Object
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
averageRating | number |
customers | number |
orders | number |
pageViews | number |
pages | number |
reviews | number |
salesPerDay | TSalePerDay[] |
salesValue | number |
topPageViews | TPageStats[] |
Defined in#
system/core/common/src/types/data.ts:462
TCmsStatus#
Ƭ TCmsStatus: Object
Type declaration#
| Name | Type |
|---|---|
currentVersion? | string |
isUpdating? | boolean |
notifications? | TNotification[] |
updateAvailable | boolean |
updateInfo? | TUpdateInfo |
Defined in#
system/core/common/src/types/data.ts:489
TCmsTheme#
Ƭ TCmsTheme: Object
Type declaration#
| Name | Type |
|---|---|
mode? | "default" | "light" | "dark" |
palette? | TPalette |
Defined in#
system/core/common/src/types/data.ts:579
TContentComponentProps#
Ƭ TContentComponentProps: Object
Type declaration#
| Name | Type |
|---|---|
children? | React.ReactNode |
config? | TCromwellBlockData |
id | string |
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#
| Name | Type | Description |
|---|---|---|
allowFreeShipping? | boolean | null | Set zero shipping price |
categoryIds? | number[] | null | Specific categories where coupon can be applied. Applied to all if not set |
code? | string | null | A secret code that customer will use to apply coupon |
description? | string | null | Describe coupon |
discountType? | "fixed" | "percentage" | null | How to apply coupon: subtract a fixed value from cart/product price or a percent of it. |
expiryDate? | Date | null | Date after which coupon will no longer be applicable |
maximumSpend? | number | null | Maximum cart total to apply this coupon |
minimumSpend? | number | null | Minimum cart total to apply this coupon |
productIds? | number[] | null | Specific products on what coupon can be applied. Applied to all if not set |
usageLimit? | number | null | Limit usage times of this coupon |
usedTimes? | number | null | How many time this coupon was applied to orders |
value? | number | null | How 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#
| Name | Type |
|---|---|
TContentBlock | React.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#
| Name | Type | Description |
|---|---|---|
editor? | Object | For editor block |
editor.data? | string | - |
editor.html? | string | - |
editorHidden? | boolean | Hide this block in Theme editor |
editorStyles? | Object | Styles 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? | TGallerySettings | For gallery block |
global? | boolean | Persist on all pages, all inner modifications will be saved as global |
html? | Object | For "HTML" block |
html.innerHTML? | string | - |
id | string | Component's id, must be unique in a page. |
image? | Object | For "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? | number | Index inside children array of parent element |
isConstant? | boolean | If true, user can't delete or modify this block in Theme editor |
isDeleted? | boolean | Non-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? | boolean | If 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? | Object | For link block |
link.href? | string | - |
link.text? | string | - |
parentId? | string | Id of Destination Component where this component will be displayed. |
plugin? | Object | For plugin block |
plugin.blockName? | string | Plugin's block name |
plugin.instanceSettings? | Record<string, any> | Plugin's local settings |
plugin.pluginName? | string | Plugin's name to render inside component. Same name must be in module.config.js |
style? | string | React.CSSProperties | CSS styles to apply to this block's wrapper |
text? | Object | For text block |
text.content? | string | - |
text.href? | string | - |
text.textElementType? | keyof React.ReactHTML | - |
type? | TCromwellBlockType | Component'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#
| Name | Type |
|---|---|
TContentBlock | React.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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
TOptions | any |
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
Props | Record<string, unknown> | undefined |
Defined in#
system/core/common/src/types/blocks.ts:76
TCromwellPageCoreProps#
Ƭ TCromwellPageCoreProps: Object
Type declaration#
| Name | Type |
|---|---|
cmsProps | TPageCmsProps |
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#
| Name | Type | Description |
|---|---|---|
apiClients? | Object | Internal |
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? | TCmsSettings | Public CMS Settings |
components? | TSharedComponents | Internal. Shared component storage. E.g. product cards to be reused by Plugins { [ComponentName]: (Class/function) } |
cstore? | any | - |
currency? | string | Active currency |
dbInfo? | TDBInfo | Info 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? | TPageConfig | Config 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#
| Name | Type |
|---|---|
frontendDependencies? | (string | TFrontendDependency)[] |
packages | string[] |
Defined in#
system/core/common/src/types/data.ts:427
TCurrency#
Ƭ TCurrency: Object
Type declaration#
| Name | Type | Description |
|---|---|---|
id | string | - |
ratio? | number | Ratio for currencies to compare: "USD": 1,"EURO": 0.83, "GBP": 0.72 etc. |
symbol? | string | Local currency symbols that will be added to price in getPriceWithCurrency method |
tag | string | - |
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#
| Name | Type |
|---|---|
customGraphQlFragment? | string |
disableSort? | boolean |
exactSearch? | boolean |
label | string |
maxWidth? | string |
meta? | boolean |
minWidth? | string |
multipleOptions? | boolean |
name | string |
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#
| Name | Type |
|---|---|
dbType? | string |
Defined in#
system/core/common/src/types/data.ts:584
TDataComponentProps#
Ƭ TDataComponentProps<Data>: Object
Type parameters#
| Name |
|---|
Data |
Type declaration#
| Name | Type |
|---|---|
component | React.ComponentType<Data> |
pluginName | string |
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#
| Name | Type |
|---|---|
all? | boolean |
ids | number[] |
Defined in#
system/core/common/src/types/entities.ts:816
TExternal#
Ƭ TExternal: Object
Type declaration#
| Name | Type |
|---|---|
importName? | string |
moduleName? | string |
usedName | string |
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#
| Name | Type |
|---|---|
cjsPath? | string |
meta? | TScriptMetaInfo |
source? | string |
Defined in#
system/core/common/src/types/data.ts:367
TFrontendDependency#
Ƭ TFrontendDependency: Object
Type declaration#
| Name | Type |
|---|---|
addExports? | TAdditionalExports[] |
builtins? | string[] |
bundledCss? | string[] |
excludeExports? | string[] |
externals? | TExternal[] |
ignore? | string[] |
name | string |
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#
| Name | Type |
|---|---|
TData | any |
TInstanceSettings | any |
Defined in#
system/core/common/src/types/data.ts:571
TGallerySettings#
Ƭ TGallerySettings: Object
Type declaration#
| Name | Type | Description |
|---|---|---|
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? | number | ratio = 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#
| Name | Type |
|---|---|
TResult | any |
TPluginSettings | any |
Q | extends ParsedUrlQuery``ParsedUrlQuery |
Type declaration#
â–¸ (ctx): Promise<TGetStaticPropsResult<TResult>> | TGetStaticPropsResult<TResult>
Parameters#
| Name | Type |
|---|---|
ctx | TStaticPagePluginContext<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#
| Name | Type |
|---|---|
P | any |
Q | extends ParsedUrlQuery``ParsedUrlQuery |
Type declaration#
â–¸ (ctx): Promise<TGetStaticPropsResult<P>> | TGetStaticPropsResult<P>
Parameters#
| Name | Type |
|---|---|
ctx | TStaticPageContext<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#
| Name | Type |
|---|---|
create | string |
delete | string |
deleteMany | string |
getFiltered | string |
getMany | string |
getOneById | string |
getOneBySlug | string |
update | string |
Defined in#
system/core/common/src/types/data.ts:162
TImageSettings#
Ƭ TImageSettings: Object
Type declaration#
| Name | Type |
|---|---|
alt? | string |
href? | string |
id? | string | number |
src | string |
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#
| Name | Type |
|---|---|
documentationLink? | string |
message | string |
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#
| Name | Type |
|---|---|
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#
| Name | Type | Description |
|---|---|---|
author? | string | - |
authorLink? | string | - |
bundledDependencies? | string[] | - |
description? | string | - |
excerpt? | string | - |
firstLoadedDependencies? | string[] | - |
frontendDependencies? | (string | TFrontendDependency)[] | - |
icon? | string | - |
image? | string | - |
images? | string[] | - |
link? | string | - |
minCmsVersion? | string | Minimal 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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
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#
| Name | Type | Description |
|---|---|---|
description? | string | Meta description (SEO) |
id | string | Unique ID of a page |
isVirtual? | boolean | If 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? | string | If page is generic and theme has multiple layouts specify route to responsible Next.js page |
name | string | Name |
route | string | Page'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? | string | Meta title (SEO) |
Defined in#
system/core/common/src/types/data.ts:294
TPageStats#
Ƭ TPageStats: Object
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
elements? | Entity[] |
pagedMeta? | TPagedMeta |
Defined in#
system/core/common/src/types/data.ts:175
TPagedMeta#
Ƭ TPagedMeta: Object
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
mode? | "light" | "dark" |
primaryColor? | string |
secondaryColor? | string |
Defined in#
system/core/common/src/types/data.ts:288
TPaymentOption#
Ƭ TPaymentOption: Object
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
name | string |
Defined in#
system/core/common/src/types/data.ts:373
TPluginSettingsProps#
Ƭ TPluginSettingsProps<TSettings>: Object
Type parameters#
| Name | Type |
|---|---|
TSettings | any |
Type declaration#
| Name | Type |
|---|---|
pluginInfo? | TPackageCromwellConfig |
pluginName | string |
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#
| Name | Type |
|---|---|
approved? | boolean |
comment? | string |
postId | number |
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#
| Name | Type | Description |
|---|---|---|
children? | TProductCategory[] | null | DB children |
description? | string | null | Description (HTML allowed) |
descriptionDelta? | string | null | Description in JSON format |
mainImage? | string | null | Href of main image |
name? | string | null | Name of the category (h1) |
nestedLevel? | number | null | Level in category tree counting from top (root category) |
parent? | TProductCategory | null | DB parent |
products? | TPagedList<TProduct> | null | Products in category |
views? | number | null | Qnt 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#
| Name | Type |
|---|---|
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#
| Name | Type | Description |
|---|---|---|
average? | number | null | Rating 1-5 |
reviewsNumber? | number | null | Number 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#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
globalSettings? | any | null |
pluginInstances? | any | null |
pluginName | string |
version? | string | null |
Defined in#
system/core/common/src/types/blocks.ts:48
TRollupConfig#
Ƭ TRollupConfig: Object
Type declaration#
| Name | Type |
|---|---|
adminPanel? | Record<string, any> |
backend? | Record<string, any> |
frontend? | Record<string, any> |
frontendCjs? | Record<string, any> |
main | Record<string, any> |
themePages? | Record<string, any> |
Defined in#
system/core/common/src/types/data.ts:227
TSalePerDay#
Ƭ TSalePerDay: Object
Type declaration#
| Name | Type |
|---|---|
date | Date |
orders | number |
salesValue | number |
Defined in#
system/core/common/src/types/data.ts:483
TScriptMetaInfo#
Ƭ TScriptMetaInfo: Object
Type declaration#
| Name | Type |
|---|---|
externalDependencies | Record<string, string[]> |
import? | "chunks" | "lib" |
name | string |
Defined in#
system/core/common/src/types/data.ts:346
TServiceVersions#
Ƭ TServiceVersions: Object
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
key | string |
label? | string |
name? | string |
price? | number |
Defined in#
system/core/common/src/types/entities.ts:491
TStaticPageContext#
Ƭ TStaticPageContext<Q>: Object
Type parameters#
| Name | Type |
|---|---|
Q | extends ParsedUrlQuery``ParsedUrlQuery |
Type declaration#
| Name | Type |
|---|---|
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#
| Name | Type |
|---|---|
TPluginSettings | any |
Q | extends 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#
| Name | Type |
|---|---|
amount? | number |
pickedAttributes? | Record<string, string[]> |
product? | TProduct |
Defined in#
system/core/common/src/types/data.ts:456
TSystemUsage#
Ƭ TSystemUsage: Object
Type declaration#
| Name | Type |
|---|---|
cpuInfo | Object |
cpuInfo.brand | string |
cpuInfo.cores | number |
cpuInfo.manufacturer | string |
cpuInfo.speed | string |
cpuUsage | Object |
cpuUsage.currentLoad | number |
cpuUsage.currentLoadIdle | number |
cpuUsage.previousLoads | { load: number ; time: Date }[] |
diskUsage | Object |
diskUsage.available | number |
diskUsage.size | number |
diskUsage.used | number |
memoryUsage | Object |
memoryUsage.available | number |
memoryUsage.total | number |
memoryUsage.used | number |
osInfo | Object |
osInfo.arch | string |
osInfo.distro | string |
osInfo.platform | string |
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#
| Name | Type |
|---|---|
beta | boolean |
changelog? | string |
createdAt | Date |
description? | string |
image? | string |
name | string |
onlyManualUpdate? | boolean |
packageVersion | string |
version | string |
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#
| Name | Type |
|---|---|
defaultLocations | TCmsConfig |
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#
| Name | Type |
|---|---|
pathname | string |
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#
| Name | Type |
|---|---|
TContentBlock | Component<Object, Object, any> |
Parameters#
| Name | Type |
|---|---|
blockId | string |
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#
| Name | Type | Default value |
|---|---|---|
length | number | 12 |
Returns#
string
Defined in#
system/core/common/src/helpers.ts:7
getSharedComponent#
â–¸ Const getSharedComponent<K>(componentName): Partial<Object>[K]
Type parameters#
| Name | Type |
|---|---|
K | extends ESharedComponentNames |
Parameters#
| Name | Type |
|---|---|
componentName | K |
Returns#
Partial<Object>[K]
Defined in#
system/core/common/src/global-store.ts:97
getStore#
â–¸ Const getStore(): TCromwellStore
Returns#
Defined in#
system/core/common/src/global-store.ts:19
getStoreItem#
â–¸ Const getStoreItem<K>(itemName): TCromwellStore[K]
Type parameters#
| Name | Type |
|---|---|
K | extends keyof TCromwellStore |
Parameters#
| Name | Type |
|---|---|
itemName | K |
Returns#
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#
| Name | Type |
|---|---|
propPath | string |
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#
| Name | Type |
|---|---|
K | extends keyof TCromwellStore |
Parameters#
| Name | Type |
|---|---|
itemName | K |
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#
| Name | Type |
|---|---|
ruleName | string |
redirect | TCmsRedirect |
Returns#
void
Defined in#
system/core/common/src/global-store.ts:120
registerRewrite#
â–¸ Const registerRewrite(ruleName, rewrite): void
Parameters#
| Name | Type |
|---|---|
ruleName | string |
rewrite | TCmsRedirect |
Returns#
void
Defined in#
system/core/common/src/global-store.ts:129
registerSharedComponent#
â–¸ Const registerSharedComponent<K>(componentName, component): void
Type parameters#
| Name | Type |
|---|---|
K | extends ESharedComponentNames |
Parameters#
| Name | Type |
|---|---|
componentName | K |
component | Partial<Object>[K] |
Returns#
void
Defined in#
system/core/common/src/global-store.ts:103
removeOnStoreChange#
â–¸ Const removeOnStoreChange<K>(itemName, callbackId): void
Type parameters#
| Name | Type |
|---|---|
K | extends keyof TCromwellStore |
Parameters#
| Name | Type |
|---|---|
itemName | K |
callbackId | string |
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#
| Name | Type | Description |
|---|---|---|
pageName | string | Can be: 1. TDefaultPageName (eg. product), 2. Resolved default page name (eg. product/[slug]), 3. Target page name (eg. product/my-product) |
routeOptions? | Object | Options 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#
| Name | Type |
|---|---|
K | extends keyof TCromwellStore |
Parameters#
| Name | Type |
|---|---|
itemName | K |
item | TCromwellStore[K] |
Returns#
void
Defined in#
system/core/common/src/global-store.ts:32
sleep#
â–¸ Const sleep(time): Promise<unknown>
Parameters#
| Name | Type |
|---|---|
time | number |
Returns#
Promise<unknown>