Skip to main content

Module: backend

CromwellCMS Backend SDK

Exports backend helpers, ORM repositories and entities.

Install#

npm i @cromwell/core-backend

Use#

Example of usage

import { ProductRepository } from '@cromwell/core-backend';import { getCustomRepository } from 'typeorm';
const products = await getCustomRepository(ProductRepository).getProducts();

Table of contents#

Classes#

Type aliases#

Variables#

Functions#

Type aliases#

Action#

Ƭ Action<PayloadType, OutputType>: Object

Type parameters#

NameType
PayloadTypePayloadType
OutputTypeany

Type declaration#

NameType
outputOutputType
payloadPayloadType

Defined in#

system/core/backend/src/helpers/types.ts:25


ActionNames#

Ƭ ActionNames: keyof ActionTypes

Defined in#

system/core/backend/src/helpers/types.ts:91


ActionTypes#

Ƭ ActionTypes: Object

Type declaration#

NameType
create_attributeAction<TAttribute>
create_couponAction<TCoupon>
create_custom_entityAction<TCustomEntity>
create_orderAction<TOrder>
create_paymentAction<TOrderPaymentSession, Object>
create_postAction<TPost>
create_post_commentAction<TPostComment>
create_productAction<TProduct>
create_product_categoryAction<TProductCategory>
create_product_reviewAction<TProductReview>
create_tagAction<TTag>
create_userAction<TUser>
delete_attributeAction<Object>
delete_couponAction<Object>
delete_custom_entityAction<Object>
delete_orderAction<Object>
delete_postAction<Object>
delete_post_commentAction<Object>
delete_productAction<Object>
delete_product_categoryAction<Object>
delete_product_reviewAction<Object>
delete_tagAction<Object>
delete_userAction<Object>
install_pluginAction<Object>
install_themeAction<Object>
uninstall_pluginAction<Object>
uninstall_themeAction<Object>
update_attributeAction<TAttribute>
update_couponAction<TCoupon>
update_custom_entityAction<TCustomEntity>
update_orderAction<TOrder>
update_pluginAction<Object>
update_postAction<TPost>
update_post_commentAction<TPostComment>
update_productAction<TProduct>
update_product_categoryAction<TProductCategory>
update_product_reviewAction<TProductReview>
update_settingsAction<TCmsSettings>
update_tagAction<TTag>
update_themeAction<Object>
update_userAction<TUser>

Defined in#

system/core/backend/src/helpers/types.ts:30


DeepWriteable#

Ƭ DeepWriteable<T>: { -readonly[P in keyof T]: DeepWriteable<T[P]>}

Type parameters#

Name
T

Defined in#

system/core/backend/src/helpers/connect-database.ts:20


TAllThemeConfigs#

Ƭ TAllThemeConfigs: Object

Type declaration#

NameType
themeConfigTThemeConfig | null
themeInfoTPackageCromwellConfig | null
userConfigTThemeConfig | null

Defined in#

system/core/backend/src/helpers/theme-config.ts:18


TAuthSettings#

Ƭ TAuthSettings: Object

Type declaration#

NameType
accessSecretstring
accessTokenCookieNamestring
cookieSecretstring
expirationAccessTimenumber
expirationRefreshTimenumber
maxTokensPerUsernumber
refreshSecretstring
refreshTokenCookieNamestring
resetPasswordAttemptsnumber
resetPasswordCodeExpirationAccessTimenumber
serviceSecretstring

Defined in#

system/core/backend/src/helpers/auth-settings.ts:8


TAuthUserInfo#

Ƭ TAuthUserInfo: Object

Type declaration#

NameType
email?string | null
idnumber
roleTUserRole

Defined in#

system/core/backend/src/helpers/auth-guards.ts:7


TBackendModule#

Ƭ TBackendModule: Object

Type declaration#

NameType
controllers?unknown[]
entities?unknown[]
migrations?unknown[]
providers?unknown[]
resolvers?unknown[]

Defined in#

system/core/backend/src/helpers/types.ts:17


TEntityMeta#

Ƭ TEntityMeta: Object

Type declaration#

NameType
entityId?number
idnumber
key?string | null
value?string | null

Defined in#

system/core/backend/src/models/entities/meta/base-meta.entity.ts:4


TGraphQLContext#

Ƭ TGraphQLContext: Object

Type declaration#

NameType
user?TAuthUserInfo

Defined in#

system/core/backend/src/helpers/auth-guards.ts:30


TPluginInfo#

Ƭ TPluginInfo: Object

Type declaration#

NameType
adminPanelPath?string
backendPath?string
frontendPath?string
pluginDirstring
pluginNamestring

Defined in#

system/core/backend/src/helpers/plugin-exports.ts:19


TRequestWithUser#

Ƭ TRequestWithUser: FastifyRequest & { cookies: any ; user: TAuthUserInfo }

Defined in#

system/core/backend/src/helpers/auth-guards.ts:19


TTokenInfo#

Ƭ TTokenInfo: Object

Type declaration#

NameType
cookiestring
maxAgestring
tokenstring

Defined in#

system/core/backend/src/helpers/auth-guards.ts:24


TTokenPayload#

Ƭ TTokenPayload: Object

Type declaration#

NameType
roleTUserRole
subnumber
username?string | null

Defined in#

system/core/backend/src/helpers/auth-guards.ts:13


Writeable#

Ƭ Writeable<T>: { -readonly[P in keyof T]: T[P]}

Type parameters#

Name
T

Defined in#

system/core/backend/src/helpers/connect-database.ts:16

Variables#

CustomDateScalar#

• Const CustomDateScalar: GraphQLScalarType

Defined in#

system/core/backend/src/models/objects/custom-date.scalar.ts:3


GenericCms#

• Const GenericCms: Object

Type declaration#

NameType
abstractResolverany
createArgsany
pagedEntityany
repositoryObjectType<BaseRepository<CmsEntity, CmsEntity>>
updateArgsany

Defined in#

system/core/backend/src/helpers/generic-entities.ts:12


GenericPlugin#

• Const GenericPlugin: Object

Type declaration#

NameType
abstractResolverany
createArgsany
pagedEntityany
repositoryObjectType<BaseRepository<PluginEntity, TPluginEntityInput>>
updateArgsany

Defined in#

system/core/backend/src/helpers/generic-entities.ts:11


GenericTheme#

• Const GenericTheme: Object

Type declaration#

NameType
abstractResolverany
createArgsany
pagedEntityany
repositoryObjectType<BaseRepository<ThemeEntity, TThemeEntityInput>>
updateArgsany

Defined in#

system/core/backend/src/helpers/generic-entities.ts:10


ORMEntities#

• Const ORMEntities: (typeof ThemeEntity | typeof Product | typeof ProductCategory | typeof Post | typeof User | typeof Attribute | typeof ProductReview | typeof Order | typeof CmsEntity | typeof Tag | typeof PageStats | typeof PostComment | typeof AttributeMeta | typeof OrderMeta | typeof PostMeta | typeof ProductCategoryMeta | typeof ProductMeta | typeof TagMeta | typeof UserMeta | typeof AttributeToProduct | typeof AttributeValue | typeof CustomEntity | typeof CustomEntityMeta | typeof Coupon | typeof CouponMeta | typeof ProductVariant | typeof ProductVariantMeta)[]

Defined in#

system/core/backend/src/helpers/constants.ts:34


PrimitiveValueScalar#

• Const PrimitiveValueScalar: GraphQLScalarType

Defined in#

system/core/backend/src/models/objects/primitive-value.scalar.ts:16


adminPanelMessages#

• Const adminPanelMessages: Object

Type declaration#

NameType
onBuildEndMessagestring
onBuildErrorMessagestring
onBuildStartMessagestring
onStartErrorMessagestring
onStartMessagestring

Defined in#

system/core/backend/src/helpers/constants.ts:54


bcryptSaltRounds#

• Const bcryptSaltRounds: 10

Defined in#

system/core/backend/src/helpers/auth-settings.ts:6


buildDirName#

• Const buildDirName: "build"

Defined in#

system/core/backend/src/helpers/paths.ts:10


cmsConfigFileName#

• Const cmsConfigFileName: "cmsconfig.json"

Defined in#

system/core/backend/src/helpers/paths.ts:12


cmsName#

• Const cmsName: "cromwell"

Defined in#

system/core/backend/src/helpers/paths.ts:8


cmsPackageName#

• Const cmsPackageName: "@cromwell/cms"

Defined in#

system/core/backend/src/helpers/constants.ts:122


configFileName#

• Const configFileName: string

Defined in#

system/core/backend/src/helpers/paths.ts:11


defaultCmsConfig#

• Const defaultCmsConfig: TCmsConfig

Defined in#

system/core/backend/src/helpers/constants.ts:70


entityMetaRepository#

• Const entityMetaRepository: EntityMetaRepository

Defined in#

system/core/backend/src/helpers/entity-meta.ts:165


pluginAdminBundlePath#

• Const pluginAdminBundlePath: "admin/index.js"

Defined in#

system/core/backend/src/helpers/paths.ts:240


pluginAdminCjsPath#

• Const pluginAdminCjsPath: "admin/cjs.js"

Defined in#

system/core/backend/src/helpers/paths.ts:241


pluginFrontendBundlePath#

• Const pluginFrontendBundlePath: "frontend/index.js"

Defined in#

system/core/backend/src/helpers/paths.ts:238


pluginFrontendCjsPath#

• Const pluginFrontendCjsPath: "frontend/cjs.js"

Defined in#

system/core/backend/src/helpers/paths.ts:239


rendererMessages#

• Const rendererMessages: Object

Type declaration#

NameType
onBuildEndMessagestring
onBuildErrorMessagestring
onBuildStartMessagestring
onStartErrorMessagestring
onStartMessagestring

Defined in#

system/core/backend/src/helpers/constants.ts:46


serverMessages#

• Const serverMessages: Object

Type declaration#

NameType
onBuildEndMessagestring
onBuildErrorMessagestring
onBuildStartMessagestring
onStartErrorMessagestring
onStartMessagestring

Defined in#

system/core/backend/src/helpers/constants.ts:62


tempDirName#

• Const tempDirName: string

Defined in#

system/core/backend/src/helpers/paths.ts:9

Functions#

Roles#

â–¸ Const Roles(...roles): CustomDecorator<string>

Parameters#

NameType
...rolesTAuthRole[]

Returns#

CustomDecorator<string>

Defined in#

system/core/backend/src/helpers/auth-guards.ts:34


applyBaseFilter#

â–¸ Const applyBaseFilter<TEntity>(__namedParameters): SelectQueryBuilder<TEntity>

Type parameters#

Name
TEntity

Parameters#

NameType
__namedParametersObject
__namedParameters.EntityClass?(...args: any[]) => BasePageEntity & typeof BaseEntity
__namedParameters.dbType"mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"
__namedParameters.entityType?EDBEntity
__namedParameters.filterBaseFilterInput
__namedParameters.qbSelectQueryBuilder<TEntity>

Returns#

SelectQueryBuilder<TEntity>

Defined in#

system/core/backend/src/helpers/base-queries.ts:147


applyGetManyFromOne#

â–¸ Const applyGetManyFromOne<T>(qb, firstEntityName, firstEntityProp, secondEntityName, secondEntityId): SelectQueryBuilder<T>

Retrieve all related entities of one specified entity by id in many-to-many relationship E.g. get all products from a category

prop firstEntityName - table DB name of many

prop firstEntityProp - property of many that refers to relationship

prop secondEntityName - table DB name of one

prop secondEntityId - DB id of one

Type parameters#

Name
T

Parameters#

NameType
qbSelectQueryBuilder<T>
firstEntityNamestring
firstEntityPropkeyof T
secondEntityNamestring
secondEntityIdnumber

Returns#

SelectQueryBuilder<T>

Defined in#

system/core/backend/src/helpers/base-queries.ts:37


applyGetPaged#

â–¸ Const applyGetPaged<T>(qb, sortByTableName?, params?): SelectQueryBuilder<T>

Type parameters#

Name
T

Parameters#

NameType
qbSelectQueryBuilder<T>
sortByTableName?string
params?TPagedParams<T>

Returns#

SelectQueryBuilder<T>

Defined in#

system/core/backend/src/helpers/base-queries.ts:11


checkEntitySlug#

â–¸ Const checkEntitySlug<T>(entity, EntityClass): Promise<T>

Type parameters#

NameType
Textends BasePageEntity<T>

Parameters#

NameType
entityT
EntityClass(...args: any[]) => T

Returns#

Promise<T>

Defined in#

system/core/backend/src/helpers/base-queries.ts:96


collectPlugins#

â–¸ Const collectPlugins(options?): Promise<TBackendModule>

Parameters#

NameType
options?Object
options.cwd?string
options.updateCache?boolean

Returns#

Promise<TBackendModule>

Defined in#

system/core/backend/src/helpers/plugin-exports.ts:76


connectDatabase#

â–¸ Const connectDatabase(__namedParameters): Promise<void>

Parameters#

NameType
__namedParametersObject
__namedParameters.development?boolean
__namedParameters.ormConfigOverride?Partial<Writeable<MysqlConnectionOptions>>

Returns#

Promise<void>

Defined in#

system/core/backend/src/helpers/connect-database.ts:24


createGenericEntity#

â–¸ Const createGenericEntity<EntityType, EntityInputType>(entityName, EntityClass, InputEntityClass?): Object

Type parameters#

NameType
EntityTypeEntityType
EntityInputTypeEntityType

Parameters#

NameType
entityNamestring
EntityClass(...args: any[]) => EntityType
InputEntityClass?(...args: any[]) => EntityInputType

Returns#

Object

NameType
abstractResolverany
createArgsany
pagedEntityany
repositoryObjectType<BaseRepository<EntityType, EntityInputType>>
updateArgsany

Defined in#

system/core/backend/src/helpers/create-generic-entity.ts:10


findPlugin#

â–¸ Const findPlugin(pluginName): Promise<undefined | TPluginEntity>

Parameters#

NameType
pluginNamestring

Returns#

Promise<undefined | TPluginEntity>

Defined in#

system/core/backend/src/helpers/plugin-settings.ts:8


findTheme#

â–¸ Const findTheme(themeName): Promise<undefined | TThemeEntity>

Parameters#

NameType
themeNamestring

Returns#

Promise<undefined | TThemeEntity>

Defined in#

system/core/backend/src/helpers/theme-config.ts:9


fireAction#

â–¸ Const fireAction<T, TPayload, TOutput>(options): Promise<Record<string, TOutput>>

Type parameters#

NameType
Textends keyof ActionTypes
TPayloadActionTypes[T][``"payload"``]
TOutputActionTypes[T][``"output"``]

Parameters#

NameType
optionsObject
options.actionNamestring | T
options.payload?TPayload

Returns#

Promise<Record<string, TOutput>>

Defined in#

system/core/backend/src/helpers/actions.ts:27


getAdminPanelDir#

â–¸ Const getAdminPanelDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:103


getAdminPanelServiceBuildDir#

â–¸ Const getAdminPanelServiceBuildDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:104


getAdminPanelStartupPath#

â–¸ Const getAdminPanelStartupPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:116


getAdminPanelStaticDir#

â–¸ Const getAdminPanelStaticDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:120


getAdminPanelTempDir#

â–¸ Const getAdminPanelTempDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:108


getAdminPanelWebPublicDir#

â–¸ Const getAdminPanelWebPublicDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:113


getAdminPanelWebServiceBuildDir#

â–¸ Const getAdminPanelWebServiceBuildDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:110


getAuthSettings#

â–¸ Const getAuthSettings(options?): Promise<TAuthSettings>

Parameters#

NameType
options?Object
options.serverCachePath?string

Returns#

Promise<TAuthSettings>

Defined in#

system/core/backend/src/helpers/auth-settings.ts:24


getBundledModulesDir#

â–¸ Const getBundledModulesDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:251


getCmsConfigPath#

â–¸ Const getCmsConfigPath(dir?): Promise<any>

Parameters#

NameType
dir?string

Returns#

Promise<any>

Defined in#

system/core/backend/src/helpers/paths.ts:44


getCmsConfigPathSync#

â–¸ Const getCmsConfigPathSync(dir?): any

Parameters#

NameType
dir?string

Returns#

any

Defined in#

system/core/backend/src/helpers/paths.ts:60


getCmsEntity#

â–¸ Const getCmsEntity(): Promise<CmsEntity>

Returns#

Promise<CmsEntity>

Defined in#

system/core/backend/src/helpers/cms-settings.ts:57


getCmsInfo#

â–¸ Const getCmsInfo(): Promise<TCmsInfo>

Returns#

Promise<TCmsInfo>

Defined in#

system/core/backend/src/helpers/cms-settings.ts:104


getCmsModuleConfig#

â–¸ Const getCmsModuleConfig(moduleName?): Promise<undefined | TModuleConfig>

Parameters#

NameType
moduleName?string

Returns#

Promise<undefined | TModuleConfig>

Defined in#

system/core/backend/src/helpers/paths.ts:209


getCmsModuleInfo#

â–¸ Const getCmsModuleInfo(moduleName?): Promise<undefined | TPackageCromwellConfig>

Parameters#

NameType
moduleName?string

Returns#

Promise<undefined | TPackageCromwellConfig>

Defined in#

system/core/backend/src/helpers/paths.ts:220


getCmsSettings#

â–¸ Const getCmsSettings(): Promise<undefined | TCmsSettings>

Returns#

Promise<undefined | TCmsSettings>

Defined in#

system/core/backend/src/helpers/cms-settings.ts:72


getCoreBackendDir#

â–¸ Const getCoreBackendDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:78


getCoreCommonDir#

â–¸ Const getCoreCommonDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:76


getCoreFrontendDir#

â–¸ Const getCoreFrontendDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:77


getEmailTemplate#

â–¸ Const getEmailTemplate(fileName, props?): Promise<undefined | string>

Parameters#

NameType
fileNamestring
props?Record<string, any>

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/emailing.ts:14


getErrorLogPath#

â–¸ Const getErrorLogPath(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:80


getLogger#

â–¸ Const getLogger(writeToFile?): Object

Parameters#

NameTypeDefault value
writeToFilebooleantrue

Returns#

Object

NameType
error(...args: any[]) => void
info(...args: any[]) => void
log(...args: any[]) => void
warn(...args: any[]) => void

Defined in#

system/core/backend/src/helpers/logger.ts:17


getLogsDir#

â–¸ Const getLogsDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:79


getManagerDir#

â–¸ Const getManagerDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:83


getManagerTempDir#

â–¸ Const getManagerTempDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:84


getMetaInfoPath#

â–¸ Const getMetaInfoPath(filename): string

Parameters#

NameType
filenamestring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:236


getMigrationsDirName#

â–¸ Const getMigrationsDirName(dbType): undefined | "migrations/sqlite" | "migrations/mysql" | "migrations/postgres"

Parameters#

NameType
dbType"mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"

Returns#

undefined | "migrations/sqlite" | "migrations/mysql" | "migrations/postgres"

Defined in#

system/core/backend/src/helpers/constants.ts:124


getModulePackage#

â–¸ Const getModulePackage(moduleName?): Promise<undefined | TPackageJson>

Parameters#

NameType
moduleName?string

Returns#

Promise<undefined | TPackageJson>

Defined in#

system/core/backend/src/helpers/paths.ts:262


getModuleStaticDir#

â–¸ Const getModuleStaticDir(moduleName): Promise<undefined | string>

Parameters#

NameType
moduleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:229


getNodeModuleDir#

â–¸ Const getNodeModuleDir(moduleName): Promise<undefined | string>

Parameters#

NameType
moduleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:31


getNodeModuleDirSync#

â–¸ Const getNodeModuleDirSync(moduleName): undefined | string

Parameters#

NameType
moduleNamestring

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:22


getPaged#

â–¸ Const getPaged<T>(qb, sortByTableName?, params?): Promise<TPagedList<T>>

Type parameters#

Name
T

Parameters#

NameType
qbSelectQueryBuilder<T>
sortByTableName?string
params?TPagedParams<T>

Returns#

Promise<TPagedList<T>>

Defined in#

system/core/backend/src/helpers/base-queries.ts:44


getPluginAdminBundlePath#

â–¸ Const getPluginAdminBundlePath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:245


getPluginAdminCjsPath#

â–¸ Const getPluginAdminCjsPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:246


getPluginBackendPath#

â–¸ Const getPluginBackendPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:247


getPluginFrontendBundlePath#

â–¸ Const getPluginFrontendBundlePath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:242


getPluginFrontendCjsPath#

â–¸ Const getPluginFrontendCjsPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:243


getPluginFrontendMetaPath#

â–¸ Const getPluginFrontendMetaPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:244


getPluginSettings#

â–¸ Const getPluginSettings(pluginName): Promise<any>

Parameters#

NameType
pluginNamestring

Returns#

Promise<any>

Defined in#

system/core/backend/src/helpers/plugin-settings.ts:26


getPublicDir#

â–¸ Const getPublicDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:253


getPublicPluginsDir#

â–¸ Const getPublicPluginsDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:254


getPublicThemesDir#

â–¸ Const getPublicThemesDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:255


getRendererBuildDir#

â–¸ Const getRendererBuildDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:95


getRendererDir#

â–¸ Const getRendererDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:88


getRendererStartupPath#

â–¸ Const getRendererStartupPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:89


getRendererTempDevDir#

â–¸ Const getRendererTempDevDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:94


getRendererTempDir#

â–¸ Const getRendererTempDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:93


getServerBuildDir#

â–¸ Const getServerBuildDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:131


getServerBuildMonitorPath#

â–¸ Const getServerBuildMonitorPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:143


getServerBuildPath#

â–¸ Const getServerBuildPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:135


getServerBuildProxyPath#

â–¸ Const getServerBuildProxyPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:139


getServerCachePath#

â–¸ Const getServerCachePath(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:153


getServerDefaultEmailsDir#

â–¸ Const getServerDefaultEmailsDir(): void

Returns#

void

Defined in#

system/core/backend/src/helpers/paths.ts:149


getServerDir#

â–¸ Const getServerDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:126


getServerStartupPath#

â–¸ Const getServerStartupPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:127


getServerTempDir#

â–¸ Const getServerTempDir(dir?): string

Parameters#

NameType
dir?string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:147


getServerTempEmailsDir#

â–¸ Const getServerTempEmailsDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:148


getSqlBoolStr#

â–¸ Const getSqlBoolStr(dbType, b): "true" | "false" | "1" | "0"

Parameters#

NameType
dbType"mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"
bboolean

Returns#

"true" | "false" | "1" | "0"

Defined in#

system/core/backend/src/helpers/base-queries.ts:130


getSqlLike#

â–¸ Const getSqlLike(dbType): "ILIKE" | "LIKE"

Parameters#

NameType
dbType"mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"

Returns#

"ILIKE" | "LIKE"

Defined in#

system/core/backend/src/helpers/base-queries.ts:137


getTempDir#

â–¸ Const getTempDir(dir?): string

Parameters#

NameType
dir?string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:14


getThemeAdminPanelDir#

â–¸ Const getThemeAdminPanelDir(themeModuleName): Promise<undefined | string>

Parameters#

NameType
themeModuleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:202


getThemeBuildDir#

â–¸ Const getThemeBuildDir(themeModuleName): Promise<undefined | string>

Parameters#

NameType
themeModuleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:170


getThemeConfigs#

â–¸ Const getThemeConfigs(themeName): Promise<TAllThemeConfigs>

Get currently active Theme's configs from DB

Parameters#

NameTypeDescription
themeNamestringspecify Theme to get config from, otherwise it will return from an active theme

Returns#

Promise<TAllThemeConfigs>

Defined in#

system/core/backend/src/helpers/theme-config.ts:28


getThemeNextBuildDir#

â–¸ Const getThemeNextBuildDir(themeModuleName): Promise<undefined | string>

Parameters#

NameType
themeModuleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:189


getThemeNextBuildDirByPath#

â–¸ Const getThemeNextBuildDirByPath(themeDir): string

Parameters#

NameType
themeDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:195


getThemePagesMetaPath#

â–¸ Const getThemePagesMetaPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:248


getThemePagesVirtualPath#

â–¸ Const getThemePagesVirtualPath(distDir): string

Parameters#

NameType
distDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:249


getThemeRollupBuildDir#

â–¸ Const getThemeRollupBuildDir(themeModuleName): Promise<undefined | string>

Parameters#

NameType
themeModuleNamestring

Returns#

Promise<undefined | string>

Defined in#

system/core/backend/src/helpers/paths.ts:179


getThemeRollupBuildDirByPath#

â–¸ Const getThemeRollupBuildDirByPath(themeDir): string

Parameters#

NameType
themeDirstring

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:185


getThemeTempAdminPanelDir#

â–¸ Const getThemeTempAdminPanelDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:198


getThemeTempRollupBuildDir#

â–¸ Const getThemeTempRollupBuildDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:176


getUtilsBuildDir#

â–¸ Const getUtilsBuildDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:163


getUtilsDir#

â–¸ Const getUtilsDir(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:158


getUtilsImporterPath#

â–¸ Const getUtilsImporterPath(): undefined | string

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:159


getUtilsTempDir#

â–¸ Const getUtilsTempDir(): string

Returns#

string

Defined in#

system/core/backend/src/helpers/paths.ts:167


graphQlAuthChecker#

â–¸ Const graphQlAuthChecker(options?, roles?): boolean

Parameters#

NameType
options?null | { args?: Record<string, any> ; context?: TGraphQLContext ; info?: any ; root?: any }
roles?null | TAuthRole[]

Returns#

boolean

Defined in#

system/core/backend/src/helpers/auth-guards.ts:51


handleBaseInput#

â–¸ Const handleBaseInput(entity, input): Promise<void>

Parameters#

NameType
entityBasePageEntity
inputTBasePageEntityInput

Returns#

Promise<void>

Defined in#

system/core/backend/src/helpers/base-queries.ts:62


handleCustomMetaInput#

â–¸ Const handleCustomMetaInput<T>(entity, input): Promise<void>

Type parameters#

NameType
Textends Object

Parameters#

NameType
entityBasePageEntity
inputT

Returns#

Promise<void>

Defined in#

system/core/backend/src/helpers/base-queries.ts:77


isExternalForm#

â–¸ Const isExternalForm(id): boolean

Parameters#

NameType
idany

Returns#

boolean

Defined in#

system/core/backend/src/helpers/paths.ts:250


isSimpleString#

â–¸ Const isSimpleString(str): undefined | boolean | ""

Parameters#

NameType
strundefined | string

Returns#

undefined | boolean | ""

Defined in#

system/core/backend/src/helpers/base-queries.ts:128


readCMSConfig#

â–¸ Const readCMSConfig(path?): Promise<TCmsConfig>

Read CMS config from file in [project root]/cmsconfig.json, saves it into the store and returns

Parameters#

NameType
path?string

Returns#

Promise<TCmsConfig>

Defined in#

system/core/backend/src/helpers/cms-settings.ts:39


readCMSConfigSync#

â–¸ Const readCMSConfigSync(path?): TCmsConfig

Read CMS config from file in [project root]/cmsconfig.json, saves it into the store and returns

Parameters#

NameType
path?string

Returns#

TCmsConfig

Defined in#

system/core/backend/src/helpers/cms-settings.ts:21


readCmsModules#

â–¸ Const readCmsModules(dir?): Promise<Object>

Parameters#

NameType
dir?string

Returns#

Promise<Object>

Defined in#

system/core/backend/src/helpers/cms-modules.ts:7


readPackage#

â–¸ Const readPackage(path): Promise<any>

Parameters#

NameType
pathstring

Returns#

Promise<any>

Defined in#

system/core/backend/src/helpers/paths.ts:257


readPluginsExports#

â–¸ Const readPluginsExports(options?): Promise<TPluginInfo[]>

Parameters#

NameType
options?Object
options.cwd?string

Returns#

Promise<TPluginInfo[]>

Defined in#

system/core/backend/src/helpers/plugin-exports.ts:29


registerAction#

â–¸ Const registerAction<T, TPayload, TOutput>(options): void

Type parameters#

NameType
Textends keyof ActionTypeskeyof ActionTypes
TPayloadActionTypes[T][``"payload"``]
TOutputActionTypes[T][``"output"``]

Parameters#

NameType
optionsObject
options.actionNameT
options.pluginNamestring
options.action(payload: TPayload) => Promise<TOutput>

Returns#

void

Defined in#

system/core/backend/src/helpers/actions.ts:7


resolvePackageJsonPath#

â–¸ Const resolvePackageJsonPath(moduleName): undefined | string

Parameters#

NameType
moduleNamestring

Returns#

undefined | string

Defined in#

system/core/backend/src/helpers/paths.ts:16


runShellCommand#

â–¸ Const runShellCommand(command, cwd?): Promise<void>

Parameters#

NameType
commandstring
cwd?string

Returns#

Promise<void>

Defined in#

system/core/backend/src/helpers/shell.ts:7


savePlugin#

â–¸ Const savePlugin(plugin): Promise<TPluginEntity>

Parameters#

NameType
pluginTPluginEntity

Returns#

Promise<TPluginEntity>

Defined in#

system/core/backend/src/helpers/plugin-settings.ts:21


savePluginSettings#

â–¸ Const savePluginSettings(pluginName, input): Promise<boolean>

Parameters#

NameType
pluginNamestring
inputany

Returns#

Promise<boolean>

Defined in#

system/core/backend/src/helpers/plugin-settings.ts:50


sendEmail#

â–¸ Const sendEmail(addresses, subject, htmlContent): Promise<boolean>

Parameters#

NameType
addressesstring[]
subjectstring
htmlContentstring

Returns#

Promise<boolean>

Defined in#

system/core/backend/src/helpers/emailing.ts:34


validateEmail#

â–¸ Const validateEmail(email): boolean

Parameters#

NameType
emailany

Returns#

boolean

Defined in#

system/core/backend/src/helpers/validation.ts:1


wrapInQuotes#

â–¸ Const wrapInQuotes(dbType, str): string

Parameters#

NameType
dbType"mysql" | "mariadb" | "postgres" | "cockroachdb" | "sqlite" | "mssql" | "sap" | "oracle" | "cordova" | "nativescript" | "react-native" | "sqljs" | "mongodb" | "aurora-data-api" | "aurora-data-api-pg" | "expo" | "better-sqlite3" | "capacitor"
strstring

Returns#

string

Defined in#

system/core/backend/src/helpers/base-queries.ts:142