Module: common
CromwellCMS Shared SDK
Exports common type definitions and helpers used by frontend and backend.
#
Installnpm i @cromwell/core
#
UseExample 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 insystem/core/common/src/types/data.ts:160
#
TAdditionalExportsƬ TAdditionalExports: Object
#
Type declarationName | Type |
---|---|
importType? | "default" | "named" |
name | string |
path? | string |
saveAsModules? | string [] |
#
Defined insystem/core/common/src/types/data.ts:449
#
TAdminCustomEntityƬ TAdminCustomEntity: Object
#
Type declarationName | Type |
---|---|
columns? | TCustomEntityColumn [] |
entityBaseRoute? | string |
entityLabel? | string |
entityListRoute? | string |
entityType | string |
icon? | string |
listLabel | string |
route? | string |
#
Defined insystem/core/common/src/types/entities.ts:769
#
TAdminCustomFieldƬ TAdminCustomField: Object
#
Type declarationName | Type |
---|---|
column? | TCustomEntityColumn |
entityType | EDBEntity | string |
fieldType | TCustomFieldType |
id | string |
key | string |
label? | string |
options? | string [] |
order? | number |
#
Defined insystem/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 insystem/core/common/src/types/entities.ts:366
#
TAttributeInputƬ TAttributeInput: Omit
<TAttribute
, TDBAuxiliaryColumns
>
#
Defined insystem/core/common/src/types/entities.ts:375
#
TAttributeInstanceƬ TAttributeInstance: Object
#
Type declarationName | Type |
---|---|
key | string |
values | TAttributeInstanceValue [] |
#
Defined insystem/core/common/src/types/entities.ts:383
#
TAttributeInstanceValueƬ TAttributeInstanceValue: Object
#
Type declarationName | Type |
---|---|
value | string |
#
Defined insystem/core/common/src/types/entities.ts:388
#
TAttributeValueƬ TAttributeValue: Object
#
Type declarationName | Type |
---|---|
icon? | string |
title? | string |
value | string |
#
Defined insystem/core/common/src/types/entities.ts:377
#
TAuthRoleƬ TAuthRole: TUserRole
| "self"
| "all"
#
Defined insystem/core/common/src/types/entities.ts:346
#
TBaseFilterƬ TBaseFilter: Object
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:55
#
TBaseModuleConfigƬ TBaseModuleConfig: Object
Base config for Theme / Plugin in cromwell.config.js
#
Type declarationName | Type |
---|---|
rollupConfig? | () => TRollupConfig | Promise <TRollupConfig > |
#
Defined insystem/core/common/src/types/data.ts:239
#
TBasePageEntityƬ TBasePageEntity: Object
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:3
#
TBasePageEntityInputƬ TBasePageEntityInput: Omit
<TBasePageEntity
, TDBAuxiliaryColumns
>
#
Defined insystem/core/common/src/types/entities.ts:53
#
TBasePageMetaƬ TBasePageMeta: Object
#
Type declarationName | Type |
---|---|
keywords? | string [] |
socialImage? | string |
#
Defined insystem/core/common/src/types/entities.ts:46
#
TBlockContentProviderƬ TBlockContentProvider: Object
#
Type declarationName | 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 insystem/core/common/src/types/blocks.ts:306
#
TBlockStoreProviderƬ TBlockStoreProvider: Object
#
Type declarationName | Type |
---|---|
instances | Record <string , TCromwellBlock | undefined > |
#
Defined insystem/core/common/src/types/blocks.ts:317
#
TCCSModuleInfoƬ TCCSModuleInfo: Object
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:541
#
TCCSModuleShortInfoƬ TCCSModuleShortInfo: Object
#
Type declarationName | Type |
---|---|
betaPackageVersion? | string |
betaVersion? | string |
packageVersion | string |
version | string |
#
Defined insystem/core/common/src/types/data.ts:534
#
TCCSVersionƬ TCCSVersion: Object
Version of a CMS module. CCS - Cromwell Central Server
#
Type declarationName | Type |
---|---|
beta | boolean |
changelog? | string |
createdAt | Date |
description? | string |
image? | string |
name | string |
onlyManualUpdate? | boolean |
packageVersion | string |
restartServices | keyof TServiceVersions [] |
version | string |
#
Defined insystem/core/common/src/types/data.ts:521
#
TCmsAdminSettingsƬ TCmsAdminSettings: Object
Admin (private) CMS settings
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:701
#
TCmsConfigƬ TCmsConfig: Object
cmsconfig.json
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:197
#
TCmsEntityƬ TCmsEntity: TCmsEntityCore
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:803
#
TCmsEntityCoreƬ TCmsEntityCore: Object
DB CMS entity
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:614
#
TCmsInfoƬ TCmsInfo: Object
#
Type declarationName | Type |
---|---|
packages | Partial <Record <typeof systemPackages [number ], string >> |
#
Defined insystem/core/common/src/types/data.ts:588
#
TCmsInternalSettingsƬ TCmsInternalSettings: Object
Internal CMS settings
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:725
#
TCmsModuleEntityƬ TCmsModuleEntity: Object
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:584
#
TCmsPublicSettingsƬ TCmsPublicSettings: Object
Public CMS settings
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:634
#
TCmsRedirectƬ TCmsRedirect: TCmsRedirectObject
| TCmsRedirectFunction
#
Defined insystem/core/common/src/types/entities.ts:830
#
TCmsRedirectFunctionƬ TCmsRedirectFunction: (pathname
: string
, search?
: string
| null
) => TCmsRedirectObject
| undefined
| void
#
Type declarationâ–¸ (pathname
, search?
): TCmsRedirectObject
| undefined
| void
#
ParametersName | Type |
---|---|
pathname | string |
search? | string | null |
#
ReturnsTCmsRedirectObject
| undefined
| void
#
Defined insystem/core/common/src/types/entities.ts:828
#
TCmsRedirectObjectƬ TCmsRedirectObject: Object
#
Type declarationName | Type |
---|---|
from? | string |
permanent? | boolean |
statusCode? | number |
to? | string |
#
Defined insystem/core/common/src/types/entities.ts:821
#
TCmsSettingsƬ TCmsSettings: TCmsConfig
& TCmsPublicSettings
& TCmsAdminSettings
& TCmsInternalSettings
Merged info form cmsconfig.json and settings from DB
#
Defined insystem/core/common/src/types/data.ts:225
#
TCmsStatsƬ TCmsStats: Object
#
Type declarationName | Type |
---|---|
averageRating | number |
customers | number |
orders | number |
pageViews | number |
pages | number |
reviews | number |
salesPerDay | TSalePerDay [] |
salesValue | number |
topPageViews | TPageStats [] |
#
Defined insystem/core/common/src/types/data.ts:462
#
TCmsStatusƬ TCmsStatus: Object
#
Type declarationName | Type |
---|---|
currentVersion? | string |
isUpdating? | boolean |
notifications? | TNotification [] |
updateAvailable | boolean |
updateInfo? | TUpdateInfo |
#
Defined insystem/core/common/src/types/data.ts:489
#
TCmsThemeƬ TCmsTheme: Object
#
Type declarationName | Type |
---|---|
mode? | "default" | "light" | "dark" |
palette? | TPalette |
#
Defined insystem/core/common/src/types/data.ts:579
#
TContentComponentPropsƬ TContentComponentProps: Object
#
Type declarationName | Type |
---|---|
children? | React.ReactNode |
config? | TCromwellBlockData |
id | string |
#
Defined insystem/core/common/src/types/blocks.ts:127
#
TCouponƬ TCoupon: TCouponCore
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:579
#
TCouponCoreƬ TCouponCore: Object
Store discount coupon
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:528
#
TCouponInputƬ TCouponInput: TCouponCore
& TBasePageEntityInput
#
Defined insystem/core/common/src/types/entities.ts:581
#
TCreateUserƬ TCreateUser: Omit
<TUser
, TDBAuxiliaryColumns
> & { password?
: string
}
#
Defined insystem/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 parametersName | Type |
---|---|
TContentBlock | React.Component <TCromwellBlockProps > |
#
Defined insystem/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 declarationName | 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 insystem/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 parametersName | Type |
---|---|
TContentBlock | React.Component |
#
Defined insystem/core/common/src/types/blocks.ts:107
#
TCromwellBlockTypeƬ TCromwellBlockType: "container"
| "plugin"
| "text"
| "HTML"
| "image"
| "gallery"
| "list"
| "editor"
| "link"
#
Defined insystem/core/common/src/types/blocks.ts:133
#
TCromwellNodeModulesƬ TCromwellNodeModules: Object
Internal. Store for reusable Frontend dependencies.
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:333
#
TCromwellNotifyƬ TCromwellNotify<TOptions
>: Object
UI Notification service. In Admin panel it's react-toastify, for example.
#
Type parametersName | Type |
---|---|
TOptions | any |
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:380
#
TCromwellPageƬ TCromwellPage<Props
>: NextPage
<Props
& TCromwellPageCoreProps
>
#
Type parametersName | Type |
---|---|
Props | Record <string , unknown > | undefined |
#
Defined insystem/core/common/src/types/blocks.ts:76
#
TCromwellPageCorePropsƬ TCromwellPageCoreProps: Object
#
Type declarationName | Type |
---|---|
cmsProps | TPageCmsProps |
#
Defined insystem/core/common/src/types/blocks.ts:74
#
TCromwellStoreƬ TCromwellStore: Object
Global store mostly for internal usage. If you need Redux interactivity, use onStoreChange.
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:22
#
TCromwellaConfigƬ TCromwellaConfig: Object
#
Type declarationName | Type |
---|---|
frontendDependencies? | (string | TFrontendDependency )[] |
packages | string [] |
#
Defined insystem/core/common/src/types/data.ts:427
#
TCurrencyƬ TCurrency: Object
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:806
#
TCustomEntityƬ TCustomEntity: TBasePageEntity
& { entityType
: string
; name?
: string
| null
}
#
Defined insystem/core/common/src/types/entities.ts:832
#
TCustomEntityColumnƬ TCustomEntityColumn: Object
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:780
#
TCustomEntityFilterƬ TCustomEntityFilter: TBaseFilter
& { entityType?
: string
; name?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:839
#
TCustomEntityInputƬ TCustomEntityInput: Omit
<TCustomEntity
, TDBAuxiliaryColumns
>
#
Defined insystem/core/common/src/types/entities.ts:837
#
TCustomFieldTypeƬ TCustomFieldType: "Simple text"
| "Text editor"
| "Select"
| "Image"
| "Gallery"
| "Color"
| "Date"
| "Time"
| "Datetime"
| "Currency"
| "Rating"
| "Checkbox"
#
Defined insystem/core/common/src/types/entities.ts:755
#
TDBAuxiliaryColumnsƬ TDBAuxiliaryColumns: "id"
| "createDate"
| "updateDate"
#
Defined insystem/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 insystem/core/common/src/types/data.ts:122
#
TDBInfoƬ TDBInfo: Object
#
Type declarationName | Type |
---|---|
dbType? | string |
#
Defined insystem/core/common/src/types/data.ts:584
#
TDataComponentPropsƬ TDataComponentProps<Data
>: Object
#
Type parametersName |
---|
Data |
#
Type declarationName | Type |
---|---|
component | React.ComponentType <Data > |
pluginName | string |
#
Defined insystem/core/common/src/types/blocks.ts:99
#
TDefaultPageNameƬ TDefaultPageName: "index"
| "category"
| "product"
| "post"
| "tag"
| "pages"
| "account"
| "checkout"
| "blog"
#
Defined insystem/core/common/src/types/data.ts:286
#
TDeleteManyInputƬ TDeleteManyInput: Object
#
Type declarationName | Type |
---|---|
all? | boolean |
ids | number [] |
#
Defined insystem/core/common/src/types/entities.ts:816
#
TExternalƬ TExternal: Object
#
Type declarationName | Type |
---|---|
importName? | string |
moduleName? | string |
usedName | string |
#
Defined insystem/core/common/src/types/data.ts:443
#
TFilteredProductListƬ TFilteredProductList: TPagedList
<TProduct
> & { filterMeta
: TProductFilterMeta
}
#
Defined insystem/core/common/src/types/entities.ts:234
#
TFrontendBundleƬ TFrontendBundle: Object
#
Type declarationName | Type |
---|---|
cjsPath? | string |
meta? | TScriptMetaInfo |
source? | string |
#
Defined insystem/core/common/src/types/data.ts:367
#
TFrontendDependencyƬ TFrontendDependency: Object
#
Type declarationName | Type |
---|---|
addExports? | TAdditionalExports [] |
builtins? | string [] |
bundledCss? | string [] |
excludeExports? | string [] |
externals? | TExternal [] |
ignore? | string [] |
name | string |
version? | string |
#
Defined insystem/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 parametersName | Type |
---|---|
TData | any |
TInstanceSettings | any |
#
Defined insystem/core/common/src/types/data.ts:571
#
TGallerySettingsƬ TGallerySettings: Object
#
Type declarationName | 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 insystem/core/common/src/types/blocks.ts:262
#
TGetPluginStaticPropsƬ TGetPluginStaticProps<TResult
, TPluginSettings
, Q
>: (ctx
: TStaticPagePluginContext
<TPluginSettings
, Q
>) => Promise
<TGetStaticPropsResult
<TResult
>> | TGetStaticPropsResult
<TResult
>
#
Type parametersName | Type |
---|---|
TResult | any |
TPluginSettings | any |
Q | extends ParsedUrlQuery``ParsedUrlQuery |
#
Type declarationâ–¸ (ctx
): Promise
<TGetStaticPropsResult
<TResult
>> | TGetStaticPropsResult
<TResult
>
#
ParametersName | Type |
---|---|
ctx | TStaticPagePluginContext <TPluginSettings , Q > |
#
ReturnsPromise
<TGetStaticPropsResult
<TResult
>> | TGetStaticPropsResult
<TResult
>
#
Defined insystem/core/common/src/types/blocks.ts:42
#
TGetStaticPropsƬ TGetStaticProps<P
, Q
>: (ctx
: TStaticPageContext
<Q
>) => Promise
<TGetStaticPropsResult
<P
>> | TGetStaticPropsResult
<P
>
#
Type parametersName | Type |
---|---|
P | any |
Q | extends ParsedUrlQuery``ParsedUrlQuery |
#
Type declarationâ–¸ (ctx
): Promise
<TGetStaticPropsResult
<P
>> | TGetStaticPropsResult
<P
>
#
ParametersName | Type |
---|---|
ctx | TStaticPageContext <Q > |
#
ReturnsPromise
<TGetStaticPropsResult
<P
>> | TGetStaticPropsResult
<P
>
#
Defined insystem/core/common/src/types/blocks.ts:31
#
TGetStaticPropsResultƬ TGetStaticPropsResult<P
>: GetStaticPropsResult
<P
> & { extraPlugins?
: (TRegisteredPluginInfo
| string
)[] }
#
Type parametersName |
---|
P |
#
Defined insystem/core/common/src/types/blocks.ts:23
#
TGraphQLNodeƬ TGraphQLNode: Object
#
Index signatureâ–ª [x: string
]: string
#
Type declarationName | Type |
---|---|
create | string |
delete | string |
deleteMany | string |
getFiltered | string |
getMany | string |
getOneById | string |
getOneBySlug | string |
update | string |
#
Defined insystem/core/common/src/types/data.ts:162
#
TImageSettingsƬ TImageSettings: Object
#
Type declarationName | Type |
---|---|
alt? | string |
href? | string |
id? | string | number |
src | string |
thumb? | string |
#
Defined insystem/core/common/src/types/blocks.ts:254
#
TModuleConfigƬ TModuleConfig: TThemeConfig
& TPluginConfig
#
Defined insystem/core/common/src/types/data.ts:284
#
TNextDocumentContextƬ TNextDocumentContext: Partial
<DocumentContext
> & { cmsConfig?
: TCmsConfig
; fullUrl?
: string
; origin?
: string
}
#
Defined insystem/core/common/src/types/blocks.ts:78
#
TNotificationƬ TNotification: Object
#
Type declarationName | Type |
---|---|
documentationLink? | string |
message | string |
pageLink? | string |
type | "info" | "warning" | "error" |
#
Defined insystem/core/common/src/types/data.ts:509
#
TOrderƬ TOrder: TOrderCore
& { coupons?
: TCoupon
[] | null
}
#
Defined insystem/core/common/src/types/entities.ts:465
#
TOrderCoreƬ TOrderCore: Object
Store order
#
Type declarationName | 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 insystem/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 insystem/core/common/src/types/entities.ts:475
#
TOrderInputƬ TOrderInput: TOrderCore
& { couponCodes?
: string
[] | null
}
#
Defined insystem/core/common/src/types/entities.ts:471
#
TOrderPaymentSessionƬ TOrderPaymentSession: TOrderInput
& { appliedCoupons?
: string
[] ; cancelUrl?
: string
; paymentOptions?
: TPaymentOption
[] ; paymentSessionId?
: string
; shippingOptions?
: TShippingOption
[] ; successUrl?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:498
#
TOrderStatusƬ TOrderStatus: "Pending"
| "Awaiting shipment"
| "Shipped"
| "Refunded"
| "Cancelled"
| "Completed"
#
Defined insystem/core/common/src/types/entities.ts:469
#
TPackageCromwellConfigƬ TPackageCromwellConfig: Object
Module info in package.json under "cromwell" property
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:403
#
TPackageJsonƬ TPackageJson: Object
package.json definition with cromwell info
#
Type declarationName | Type |
---|---|
cromwell? | TPackageCromwellConfig |
dependencies? | Record <string , string > |
devDependencies? | Record <string , string > |
module? | string |
name? | string |
peerDependencies? | Record <string , string > |
version? | string |
#
Defined insystem/core/common/src/types/data.ts:390
#
TPageCmsPropsƬ TPageCmsProps: Object
#
Type declarationName | 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 insystem/core/common/src/types/blocks.ts:55
#
TPageConfigƬ TPageConfig: TPageInfo
& { footerHtml?
: string
; headHtml?
: string
; modifications
: TCromwellBlockData
[] ; pageCustomConfig?
: Record
<string
, any
> }
#
Defined insystem/core/common/src/types/data.ts:321
#
TPageInfoƬ TPageInfo: Object
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:294
#
TPageStatsƬ TPageStats: Object
#
Type declarationName | Type |
---|---|
entityType? | EDBEntity | string |
pageId? | string |
pageName? | string |
pageRoute? | string |
slug? | string | null |
views? | number |
#
Defined insystem/core/common/src/types/data.ts:474
#
TPagedListƬ TPagedList<Entity
>: Object
#
Type parametersName |
---|
Entity |
#
Type declarationName | Type |
---|---|
elements? | Entity [] |
pagedMeta? | TPagedMeta |
#
Defined insystem/core/common/src/types/data.ts:175
#
TPagedMetaƬ TPagedMeta: Object
#
Type declarationName | Type |
---|---|
pageNumber? | number |
pageSize? | number |
totalElements? | number |
totalPages? | number |
#
Defined insystem/core/common/src/types/data.ts:187
#
TPagedParamsƬ TPagedParams<Entity
>: Object
#
Type parametersName |
---|
Entity |
#
Type declarationName | Type |
---|---|
order? | "ASC" | "DESC" |
orderBy? | keyof Entity |
pageNumber? | number |
pageSize? | number |
#
Defined insystem/core/common/src/types/data.ts:180
#
TPagesMetaInfoƬ TPagesMetaInfo: Object
#
Type declarationName | Type |
---|---|
basePath? | string |
buildDir? | string |
paths | { basePath? : string ; importedStyles? : string [] ; localDepsBundle? : string ; localPath? : string ; pageName : string ; srcFullPath? : string }[] |
rootBuildDir? | string |
#
Defined insystem/core/common/src/types/data.ts:353
#
TPaletteƬ TPalette: Object
#
Type declarationName | Type |
---|---|
mode? | "light" | "dark" |
primaryColor? | string |
secondaryColor? | string |
#
Defined insystem/core/common/src/types/data.ts:288
#
TPaymentOptionƬ TPaymentOption: Object
#
Type declarationName | Type |
---|---|
key? | string |
link? | string |
name? | string |
#
Defined insystem/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 insystem/core/common/src/types/data.ts:276
#
TPluginEntityƬ TPluginEntity: TCmsModuleEntity
& TBasePageEntity
Plugin entity
#
Defined insystem/core/common/src/types/entities.ts:606
#
TPluginEntityInputƬ TPluginEntityInput: TCmsModuleEntity
& TBasePageEntityInput
#
Defined insystem/core/common/src/types/entities.ts:608
#
TPluginInfoƬ TPluginInfo: Object
#
Type declarationName | Type |
---|---|
name | string |
#
Defined insystem/core/common/src/types/data.ts:373
#
TPluginSettingsPropsƬ TPluginSettingsProps<TSettings
>: Object
#
Type parametersName | Type |
---|---|
TSettings | any |
#
Type declarationName | Type |
---|---|
pluginInfo? | TPackageCromwellConfig |
pluginName | string |
pluginSettings? | TSettings |
#
Defined insystem/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 insystem/core/common/src/types/entities.ts:247
#
TPostCommentƬ TPostComment: TPostCommentCore
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:521
#
TPostCommentCoreƬ TPostCommentCore: Object
Blog comment
#
Type declarationName | Type |
---|---|
approved? | boolean |
comment? | string |
postId | number |
title? | string |
userEmail? | string |
userId? | number |
userName? | string |
#
Defined insystem/core/common/src/types/entities.ts:511
#
TPostCommentInputƬ TPostCommentInput: TPostCommentCore
& TBasePageEntityInput
#
Defined insystem/core/common/src/types/entities.ts:523
#
TPostFilterƬ TPostFilter: TBaseFilter
& { authorId?
: number
; featured?
: boolean
| null
; published?
: boolean
; tagIds?
: number
[] ; titleSearch?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:304
#
TPostInputƬ TPostInput: Omit
<TPost
, TDBAuxiliaryColumns
| "author"
| "tags"
> & { authorId?
: number
| null
; tagIds?
: number
[] | null
}
#
Defined insystem/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 insystem/core/common/src/types/entities.ts:128
#
TProductCategoryƬ TProductCategory: TProductCategoryCore
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:114
#
TProductCategoryCoreƬ TProductCategoryCore: Object
ProductCategory
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:75
#
TProductCategoryFilterƬ TProductCategoryFilter: TBaseFilter
& { nameSearch?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:120
#
TProductCategoryInputƬ TProductCategoryInput: TBasePageEntityInput
& Omit
<TProductCategoryCore
, "children"
| "parent"
| "products"
> & { parentId?
: number
| null
}
#
Defined insystem/core/common/src/types/entities.ts:116
#
TProductFilterƬ TProductFilter: TBaseFilter
& { attributes?
: TProductFilterAttribute
[] ; categoryId?
: number
; maxPrice?
: number
; minPrice?
: number
; nameSearch?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:222
#
TProductFilterAttributeƬ TProductFilterAttribute: TBaseFilter
& { key
: string
; values
: string
[] }
#
Defined insystem/core/common/src/types/entities.ts:229
#
TProductFilterMetaƬ TProductFilterMeta: Object
#
Type declarationName | Type |
---|---|
maxPrice? | number |
minPrice? | number |
#
Defined insystem/core/common/src/types/entities.ts:238
#
TProductInputƬ TProductInput: Omit
<TProduct
, TDBAuxiliaryColumns
| "categories"
| "rating"
| "reviews"
| "variants"
> & { categoryIds?
: number
[] | null
; variants?
: TProductVariantInput
[] | null
}
#
Defined insystem/core/common/src/types/entities.ts:216
#
TProductRatingƬ TProductRating: Object
#
Type declarationName | Type | Description |
---|---|---|
average? | number | null | Rating 1-5 |
reviewsNumber? | number | null | Number of customer reviews |
#
Defined insystem/core/common/src/types/entities.ts:205
#
TProductReviewƬ TProductReview: TProductReviewCore
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:426
#
TProductReviewCoreƬ TProductReviewCore: Object
ProductReview
#
Type declarationName | 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 insystem/core/common/src/types/entities.ts:415
#
TProductReviewFilterƬ TProductReviewFilter: TBaseFilter
& { approved?
: boolean
; productId?
: number
; userId?
: number
; userName?
: string
}
#
Defined insystem/core/common/src/types/entities.ts:430
#
TProductReviewInputƬ TProductReviewInput: TProductReviewCore
& TBasePageEntityInput
#
Defined insystem/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 insystem/core/common/src/types/entities.ts:392
#
TProductVariantInputƬ TProductVariantInput: Omit
<TProductVariant
, TDBAuxiliaryColumns
> & { id?
: number
| null
; productId?
: number
| null
}
#
Defined insystem/core/common/src/types/entities.ts:407
#
TRegisteredPluginInfoƬ TRegisteredPluginInfo: Object
#
Type declarationName | Type |
---|---|
globalSettings? | any | null |
pluginInstances? | any | null |
pluginName | string |
version? | string | null |
#
Defined insystem/core/common/src/types/blocks.ts:48
#
TRollupConfigƬ TRollupConfig: Object
#
Type declarationName | 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 insystem/core/common/src/types/data.ts:227
#
TSalePerDayƬ TSalePerDay: Object
#
Type declarationName | Type |
---|---|
date | Date |
orders | number |
salesValue | number |
#
Defined insystem/core/common/src/types/data.ts:483
#
TScriptMetaInfoƬ TScriptMetaInfo: Object
#
Type declarationName | Type |
---|---|
externalDependencies | Record <string , string []> |
import? | "chunks" | "lib" |
name | string |
#
Defined insystem/core/common/src/types/data.ts:346
#
TServiceVersionsƬ TServiceVersions: Object
#
Type declarationName | Type |
---|---|
admin? | number |
api-server? | number |
renderer? | number |
server? | number |
#
Defined insystem/core/common/src/types/entities.ts:748
#
TSharedComponentsƬ TSharedComponents: Partial
<Object
>
#
Defined insystem/core/common/src/types/data.ts:624
#
TShippingOptionƬ TShippingOption: Object
#
Type declarationName | Type |
---|---|
key | string |
label? | string |
name? | string |
price? | number |
#
Defined insystem/core/common/src/types/entities.ts:491
#
TStaticPageContextƬ TStaticPageContext<Q
>: Object
#
Type parametersName | Type |
---|---|
Q | extends ParsedUrlQuery``ParsedUrlQuery |
#
Type declarationName | Type |
---|---|
cmsSettings? | TCmsConfig |
pageConfig? | TPageConfig |
pagesInfo? | TPageInfo [] |
params? | Q |
preview? | boolean |
previewData? | any |
themeConfig? | TThemeConfig |
themeCustomConfig? | any |
userConfig? | TThemeConfig |
#
Defined insystem/core/common/src/types/blocks.ts:11
#
TStaticPagePluginContextƬ TStaticPagePluginContext<TPluginSettings
, Q
>: TStaticPageContext
<Q
> & { pluginInstances?
: Record
<string
, any
> ; pluginSettings?
: TPluginSettings
}
#
Type parametersName | Type |
---|---|
TPluginSettings | any |
Q | extends ParsedUrlQuery``ParsedUrlQuery |
#
Defined insystem/core/common/src/types/blocks.ts:34
#
TStockStatusƬ TStockStatus: "In stock"
| "Out of stock"
| "On backorder"
#
Defined insystem/core/common/src/types/entities.ts:203
#
TStoreListItemƬ TStoreListItem: Object
#
Type declarationName | Type |
---|---|
amount? | number |
pickedAttributes? | Record <string , string []> |
product? | TProduct |
#
Defined insystem/core/common/src/types/data.ts:456
#
TSystemUsageƬ TSystemUsage: Object
#
Type declarationName | 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 insystem/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 insystem/core/common/src/types/entities.ts:312
#
TTagInputƬ TTagInput: Omit
<TTag
, TDBAuxiliaryColumns
>
#
Defined insystem/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 insystem/core/common/src/types/data.ts:247
#
TThemeEntityƬ TThemeEntity: TCmsModuleEntity
& TBasePageEntity
#
Defined insystem/core/common/src/types/entities.ts:596
#
TThemeEntityInputƬ TThemeEntityInput: TCmsModuleEntity
& TBasePageEntityInput
#
Defined insystem/core/common/src/types/entities.ts:598
#
TUpdateInfoƬ TUpdateInfo: Object
#
Type declarationName | Type |
---|---|
beta | boolean |
changelog? | string |
createdAt | Date |
description? | string |
image? | string |
name | string |
onlyManualUpdate? | boolean |
packageVersion | string |
version | string |
#
Defined insystem/core/common/src/types/data.ts:497
#
TUpdateUserƬ TUpdateUser: Omit
<TUser
, TDBAuxiliaryColumns
>
#
Defined insystem/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 insystem/core/common/src/types/entities.ts:327
#
TUserFilterƬ TUserFilter: TBaseFilter
& { address?
: string
; email?
: string
; fullName?
: string
; phone?
: string
; role?
: TUserRole
}
#
Defined insystem/core/common/src/types/entities.ts:354
#
TUserRoleƬ TUserRole: "administrator"
| "author"
| "customer"
| "guest"
#
Defined insystem/core/common/src/types/entities.ts:345
#
Variables#
GraphQLPaths• Const
GraphQLPaths: { [K in Exclude<TDBEntity, "Theme" | "Plugin" | "PostComment" | "CMS">]: TGraphQLNode}
#
Defined insystem/core/common/src/constants.ts:4
#
bundledModulesDirName• Const
bundledModulesDirName: "bundled-modules"
#
Defined insystem/core/common/src/constants.ts:157
#
genericPageName• Const
genericPageName: "pages/[slug]"
#
Defined insystem/core/common/src/constants.ts:149
#
moduleArchiveFileName• Const
moduleArchiveFileName: "module.zip"
#
Defined insystem/core/common/src/constants.ts:156
#
moduleBundleInfoFileName• Const
moduleBundleInfoFileName: "bundle.info.json"
#
Defined insystem/core/common/src/constants.ts:155
#
moduleChunksBuildDirChunk• Const
moduleChunksBuildDirChunk: "chunks"
#
Defined insystem/core/common/src/constants.ts:162
#
moduleExportsDirChunk• Const
moduleExportsDirChunk: "generated"
#
Defined insystem/core/common/src/constants.ts:161
#
moduleGeneratedFileName• Const
moduleGeneratedFileName: "generated.js"
#
Defined insystem/core/common/src/constants.ts:158
#
moduleLibBuildFileName• Const
moduleLibBuildFileName: "lib.bundle.js"
#
Defined insystem/core/common/src/constants.ts:152
#
moduleMainBuildFileName• Const
moduleMainBuildFileName: "main.bundle.js"
#
Defined insystem/core/common/src/constants.ts:151
#
moduleMetaInfoFileName• Const
moduleMetaInfoFileName: "meta.json"
#
Defined insystem/core/common/src/constants.ts:154
#
moduleNodeBuildFileName• Const
moduleNodeBuildFileName: "node.bundle.js"
#
Defined insystem/core/common/src/constants.ts:153
#
moduleNodeGeneratedFileName• Const
moduleNodeGeneratedFileName: "generated.node.js"
#
Defined insystem/core/common/src/constants.ts:160
#
moduleOneChunkGeneratedFileName• Const
moduleOneChunkGeneratedFileName: "generated.lib.js"
#
Defined insystem/core/common/src/constants.ts:159
#
nodeRequire• Const
nodeRequire: NodeRequire
#
Defined insystem/core/common/src/constants.ts:176
#
payLaterOption• Const
payLaterOption: TPaymentOption
#
Defined insystem/core/common/src/constants.ts:183
#
serviceLocator• Const
serviceLocator: Object
Get base url of a CMS Service
#
Type declarationName | 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 insystem/core/common/src/service-locator.ts:27
#
standardShipping• Const
standardShipping: TShippingOption
#
Defined insystem/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 insystem/core/common/src/constants.ts:164
#
Functions#
findRedirectâ–¸ Const
findRedirect(pathname
, search?
): undefined
| TCmsRedirectObject
& { type
: "redirect"
| "rewrite"
}
#
ParametersName | Type |
---|---|
pathname | string |
search? | null | string |
#
Returnsundefined
| TCmsRedirectObject
& { type
: "redirect"
| "rewrite"
}
#
Defined insystem/core/common/src/redirects.ts:4
#
getBlockInstanceâ–¸ Const
getBlockInstance<TContentBlock
>(blockId
): undefined
| TCromwellBlock
<TContentBlock
>
#
Type parametersName | Type |
---|---|
TContentBlock | Component <Object , Object , any > |
#
ParametersName | Type |
---|---|
blockId | string |
#
Returnsundefined
| TCromwellBlock
<TContentBlock
>
#
Defined insystem/core/common/src/global-store.ts:113
#
getCmsSettingsâ–¸ Const
getCmsSettings(): undefined
| TCmsSettings
#
Returnsundefined
| TCmsSettings
#
Defined insystem/core/common/src/global-store.ts:73
#
getPageCustomConfigâ–¸ Const
getPageCustomConfig(): undefined
| Record
<string
, any
>
#
Returnsundefined
| Record
<string
, any
>
#
Defined insystem/core/common/src/global-store.ts:68
#
getRandStrâ–¸ Const
getRandStr(length?
): string
#
ParametersName | Type | Default value |
---|---|---|
length | number | 12 |
#
Returnsstring
#
Defined insystem/core/common/src/helpers.ts:7
#
getSharedComponentâ–¸ Const
getSharedComponent<K
>(componentName
): Partial
<Object
>[K
]
#
Type parametersName | Type |
---|---|
K | extends ESharedComponentNames |
#
ParametersName | Type |
---|---|
componentName | K |
#
ReturnsPartial
<Object
>[K
]
#
Defined insystem/core/common/src/global-store.ts:97
#
getStoreâ–¸ Const
getStore(): TCromwellStore
#
Returns#
Defined insystem/core/common/src/global-store.ts:19
#
getStoreItemâ–¸ Const
getStoreItem<K
>(itemName
): TCromwellStore
[K
]
#
Type parametersName | Type |
---|---|
K | extends keyof TCromwellStore |
#
ParametersName | Type |
---|---|
itemName | K |
#
Returns#
Defined insystem/core/common/src/global-store.ts:28
#
getThemeCustomConfigâ–¸ Const
getThemeCustomConfig(): undefined
| Record
<string
, any
>
#
Returnsundefined
| Record
<string
, any
>
#
Defined insystem/core/common/src/global-store.ts:78
#
getThemeCustomConfigPropâ–¸ Const
getThemeCustomConfigProp(propPath
): any
#
ParametersName | Type |
---|---|
propPath | string |
#
Returnsany
#
Defined insystem/core/common/src/global-store.ts:82
#
isServerâ–¸ Const
isServer(): boolean
#
Returnsboolean
#
Defined insystem/core/common/src/helpers.ts:4
#
onStoreChangeâ–¸ Const
onStoreChange<K
>(itemName
, callback
, callbackId?
): string
#
Type parametersName | Type |
---|---|
K | extends keyof TCromwellStore |
#
ParametersName | Type |
---|---|
itemName | K |
callback | (itemValue : TCromwellStore [K ]) => any |
callbackId? | string |
#
Returnsstring
#
Defined insystem/core/common/src/global-store.ts:45
#
registerRedirectâ–¸ Const
registerRedirect(ruleName
, redirect
): void
#
ParametersName | Type |
---|---|
ruleName | string |
redirect | TCmsRedirect |
#
Returnsvoid
#
Defined insystem/core/common/src/global-store.ts:120
#
registerRewriteâ–¸ Const
registerRewrite(ruleName
, rewrite
): void
#
ParametersName | Type |
---|---|
ruleName | string |
rewrite | TCmsRedirect |
#
Returnsvoid
#
Defined insystem/core/common/src/global-store.ts:129
#
registerSharedComponentâ–¸ Const
registerSharedComponent<K
>(componentName
, component
): void
#
Type parametersName | Type |
---|---|
K | extends ESharedComponentNames |
#
ParametersName | Type |
---|---|
componentName | K |
component | Partial <Object >[K ] |
#
Returnsvoid
#
Defined insystem/core/common/src/global-store.ts:103
#
removeOnStoreChangeâ–¸ Const
removeOnStoreChange<K
>(itemName
, callbackId
): void
#
Type parametersName | Type |
---|---|
K | extends keyof TCromwellStore |
#
ParametersName | Type |
---|---|
itemName | K |
callbackId | string |
#
Returnsvoid
#
Defined insystem/core/common/src/global-store.ts:61
#
resolvePageRouteâ–¸ Const
resolvePageRoute(pageName
, routeOptions?
): string
Resolves page name to target page route
#
ParametersName | 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 | - |
#
Returnsstring
#
Defined insystem/core/common/src/helpers.ts:23
#
setStoreItemâ–¸ Const
setStoreItem<K
>(itemName
, item
): void
#
Type parametersName | Type |
---|---|
K | extends keyof TCromwellStore |
#
ParametersName | Type |
---|---|
itemName | K |
item | TCromwellStore [K ] |
#
Returnsvoid
#
Defined insystem/core/common/src/global-store.ts:32
#
sleepâ–¸ Const
sleep(time
): Promise
<unknown
>
#
ParametersName | Type |
---|---|
time | number |
#
ReturnsPromise
<unknown
>