Module: backend
CromwellCMS Backend SDK
Exports backend helpers, ORM repositories and entities.
#
Installnpm i @cromwell/core-backend
#
UseExample of usage
import { ProductRepository } from '@cromwell/core-backend';import { getCustomRepository } from 'typeorm';
const products = await getCustomRepository(ProductRepository).getProducts();
#
Table of contents#
Classes- Attribute
- AttributeInput
- AttributeInstance
- AttributeInstanceValue
- AttributeMeta
- AttributeRepository
- AttributeToProduct
- AttributeValue
- AttributeValueInput
- BaseEntityMeta
- BaseFilterInput
- BasePageEntity
- BasePageInput
- BasePageMeta
- BasePageMetaInput
- BaseRepository
- CmsEntity
- Coupon
- CouponInput
- CouponMeta
- CouponRepository
- CreatePost
- CreateProduct
- CreateProductCategory
- CreateUser
- CustomEntity
- CustomEntityFilterInput
- CustomEntityInput
- CustomEntityMeta
- CustomEntityRepository
- DeleteManyInput
- FilteredProduct
- GenericPluginResolver
- GenericThemeResolver
- InputTag
- JwtAuthGuard
- Order
- OrderFilterInput
- OrderInput
- OrderMeta
- OrderRepository
- PageStats
- PageStatsRepository
- PagedCoupon
- PagedCustomEntity
- PagedMeta
- PagedOrder
- PagedParamsInput
- PagedPost
- PagedProduct
- PagedProductCategory
- PagedProductReview
- PagedTag
- PagedUser
- PluginEntity
- PluginInput
- PluginRepository
- Post
- PostComment
- PostFilterInput
- PostMeta
- PostRepository
- Product
- ProductCategory
- ProductCategoryFilterInput
- ProductCategoryMeta
- ProductCategoryRepository
- ProductFilterAttributes
- ProductFilterInput
- ProductFilterMeta
- ProductMeta
- ProductRating
- ProductRepository
- ProductReview
- ProductReviewFilter
- ProductReviewInput
- ProductReviewRepository
- ProductVariant
- ProductVariantInput
- ProductVariantMeta
- ProductVariantRepository
- PropertySearch
- SortByOptions
- Tag
- TagMeta
- TagRepository
- ThemeEntity
- UpdatePost
- UpdateProduct
- UpdateProductCategory
- UpdateUser
- User
- UserFilterInput
- UserMeta
- UserRepository
#
Type aliases- Action
- ActionNames
- ActionTypes
- DeepWriteable
- TAllThemeConfigs
- TAuthSettings
- TAuthUserInfo
- TBackendModule
- TEntityMeta
- TGraphQLContext
- TPluginInfo
- TRequestWithUser
- TTokenInfo
- TTokenPayload
- Writeable
#
Variables- CustomDateScalar
- GenericCms
- GenericPlugin
- GenericTheme
- ORMEntities
- PrimitiveValueScalar
- adminPanelMessages
- bcryptSaltRounds
- buildDirName
- cmsConfigFileName
- cmsName
- cmsPackageName
- configFileName
- defaultCmsConfig
- entityMetaRepository
- pluginAdminBundlePath
- pluginAdminCjsPath
- pluginFrontendBundlePath
- pluginFrontendCjsPath
- rendererMessages
- serverMessages
- tempDirName
#
Functions- Roles
- applyBaseFilter
- applyGetManyFromOne
- applyGetPaged
- checkEntitySlug
- collectPlugins
- connectDatabase
- createGenericEntity
- findPlugin
- findTheme
- fireAction
- getAdminPanelDir
- getAdminPanelServiceBuildDir
- getAdminPanelStartupPath
- getAdminPanelStaticDir
- getAdminPanelTempDir
- getAdminPanelWebPublicDir
- getAdminPanelWebServiceBuildDir
- getAuthSettings
- getBundledModulesDir
- getCmsConfigPath
- getCmsConfigPathSync
- getCmsEntity
- getCmsInfo
- getCmsModuleConfig
- getCmsModuleInfo
- getCmsSettings
- getCoreBackendDir
- getCoreCommonDir
- getCoreFrontendDir
- getEmailTemplate
- getErrorLogPath
- getLogger
- getLogsDir
- getManagerDir
- getManagerTempDir
- getMetaInfoPath
- getMigrationsDirName
- getModulePackage
- getModuleStaticDir
- getNodeModuleDir
- getNodeModuleDirSync
- getPaged
- getPluginAdminBundlePath
- getPluginAdminCjsPath
- getPluginBackendPath
- getPluginFrontendBundlePath
- getPluginFrontendCjsPath
- getPluginFrontendMetaPath
- getPluginSettings
- getPublicDir
- getPublicPluginsDir
- getPublicThemesDir
- getRendererBuildDir
- getRendererDir
- getRendererStartupPath
- getRendererTempDevDir
- getRendererTempDir
- getServerBuildDir
- getServerBuildMonitorPath
- getServerBuildPath
- getServerBuildProxyPath
- getServerCachePath
- getServerDefaultEmailsDir
- getServerDir
- getServerStartupPath
- getServerTempDir
- getServerTempEmailsDir
- getSqlBoolStr
- getSqlLike
- getTempDir
- getThemeAdminPanelDir
- getThemeBuildDir
- getThemeConfigs
- getThemeNextBuildDir
- getThemeNextBuildDirByPath
- getThemePagesMetaPath
- getThemePagesVirtualPath
- getThemeRollupBuildDir
- getThemeRollupBuildDirByPath
- getThemeTempAdminPanelDir
- getThemeTempRollupBuildDir
- getUtilsBuildDir
- getUtilsDir
- getUtilsImporterPath
- getUtilsTempDir
- graphQlAuthChecker
- handleBaseInput
- handleCustomMetaInput
- isExternalForm
- isSimpleString
- readCMSConfig
- readCMSConfigSync
- readCmsModules
- readPackage
- readPluginsExports
- registerAction
- resolvePackageJsonPath
- runShellCommand
- savePlugin
- savePluginSettings
- sendEmail
- validateEmail
- wrapInQuotes
#
Type aliases#
ActionƬ Action<PayloadType
, OutputType
>: Object
#
Type parametersName | Type |
---|---|
PayloadType | PayloadType |
OutputType | any |
#
Type declarationName | Type |
---|---|
output | OutputType |
payload | PayloadType |
#
Defined insystem/core/backend/src/helpers/types.ts:25
#
ActionNamesƬ ActionNames: keyof ActionTypes
#
Defined insystem/core/backend/src/helpers/types.ts:91
#
ActionTypesƬ ActionTypes: Object
#
Type declarationName | Type |
---|---|
create_attribute | Action <TAttribute > |
create_coupon | Action <TCoupon > |
create_custom_entity | Action <TCustomEntity > |
create_order | Action <TOrder > |
create_payment | Action <TOrderPaymentSession , Object > |
create_post | Action <TPost > |
create_post_comment | Action <TPostComment > |
create_product | Action <TProduct > |
create_product_category | Action <TProductCategory > |
create_product_review | Action <TProductReview > |
create_tag | Action <TTag > |
create_user | Action <TUser > |
delete_attribute | Action <Object > |
delete_coupon | Action <Object > |
delete_custom_entity | Action <Object > |
delete_order | Action <Object > |
delete_post | Action <Object > |
delete_post_comment | Action <Object > |
delete_product | Action <Object > |
delete_product_category | Action <Object > |
delete_product_review | Action <Object > |
delete_tag | Action <Object > |
delete_user | Action <Object > |
install_plugin | Action <Object > |
install_theme | Action <Object > |
uninstall_plugin | Action <Object > |
uninstall_theme | Action <Object > |
update_attribute | Action <TAttribute > |
update_coupon | Action <TCoupon > |
update_custom_entity | Action <TCustomEntity > |
update_order | Action <TOrder > |
update_plugin | Action <Object > |
update_post | Action <TPost > |
update_post_comment | Action <TPostComment > |
update_product | Action <TProduct > |
update_product_category | Action <TProductCategory > |
update_product_review | Action <TProductReview > |
update_settings | Action <TCmsSettings > |
update_tag | Action <TTag > |
update_theme | Action <Object > |
update_user | Action <TUser > |
#
Defined insystem/core/backend/src/helpers/types.ts:30
#
DeepWriteableƬ DeepWriteable<T
>: { -readonly[P in keyof T]: DeepWriteable<T[P]>}
#
Type parametersName |
---|
T |
#
Defined insystem/core/backend/src/helpers/connect-database.ts:20
#
TAllThemeConfigsƬ TAllThemeConfigs: Object
#
Type declarationName | Type |
---|---|
themeConfig | TThemeConfig | null |
themeInfo | TPackageCromwellConfig | null |
userConfig | TThemeConfig | null |
#
Defined insystem/core/backend/src/helpers/theme-config.ts:18
#
TAuthSettingsƬ TAuthSettings: Object
#
Type declarationName | Type |
---|---|
accessSecret | string |
accessTokenCookieName | string |
cookieSecret | string |
expirationAccessTime | number |
expirationRefreshTime | number |
maxTokensPerUser | number |
refreshSecret | string |
refreshTokenCookieName | string |
resetPasswordAttempts | number |
resetPasswordCodeExpirationAccessTime | number |
serviceSecret | string |
#
Defined insystem/core/backend/src/helpers/auth-settings.ts:8
#
TAuthUserInfoƬ TAuthUserInfo: Object
#
Type declarationName | Type |
---|---|
email? | string | null |
id | number |
role | TUserRole |
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:7
#
TBackendModuleƬ TBackendModule: Object
#
Type declarationName | Type |
---|---|
controllers? | unknown [] |
entities? | unknown [] |
migrations? | unknown [] |
providers? | unknown [] |
resolvers? | unknown [] |
#
Defined insystem/core/backend/src/helpers/types.ts:17
#
TEntityMetaƬ TEntityMeta: Object
#
Type declarationName | Type |
---|---|
entityId? | number |
id | number |
key? | string | null |
value? | string | null |
#
Defined insystem/core/backend/src/models/entities/meta/base-meta.entity.ts:4
#
TGraphQLContextƬ TGraphQLContext: Object
#
Type declarationName | Type |
---|---|
user? | TAuthUserInfo |
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:30
#
TPluginInfoƬ TPluginInfo: Object
#
Type declarationName | Type |
---|---|
adminPanelPath? | string |
backendPath? | string |
frontendPath? | string |
pluginDir | string |
pluginName | string |
#
Defined insystem/core/backend/src/helpers/plugin-exports.ts:19
#
TRequestWithUserƬ TRequestWithUser: FastifyRequest
& { cookies
: any
; user
: TAuthUserInfo
}
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:19
#
TTokenInfoƬ TTokenInfo: Object
#
Type declarationName | Type |
---|---|
cookie | string |
maxAge | string |
token | string |
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:24
#
TTokenPayloadƬ TTokenPayload: Object
#
Type declarationName | Type |
---|---|
role | TUserRole |
sub | number |
username? | string | null |
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:13
#
WriteableƬ Writeable<T
>: { -readonly[P in keyof T]: T[P]}
#
Type parametersName |
---|
T |
#
Defined insystem/core/backend/src/helpers/connect-database.ts:16
#
Variables#
CustomDateScalar• Const
CustomDateScalar: GraphQLScalarType
#
Defined insystem/core/backend/src/models/objects/custom-date.scalar.ts:3
#
GenericCms• Const
GenericCms: Object
#
Type declarationName | Type |
---|---|
abstractResolver | any |
createArgs | any |
pagedEntity | any |
repository | ObjectType <BaseRepository <CmsEntity , CmsEntity >> |
updateArgs | any |
#
Defined insystem/core/backend/src/helpers/generic-entities.ts:12
#
GenericPlugin• Const
GenericPlugin: Object
#
Type declarationName | Type |
---|---|
abstractResolver | any |
createArgs | any |
pagedEntity | any |
repository | ObjectType <BaseRepository <PluginEntity , TPluginEntityInput >> |
updateArgs | any |
#
Defined insystem/core/backend/src/helpers/generic-entities.ts:11
#
GenericTheme• Const
GenericTheme: Object
#
Type declarationName | Type |
---|---|
abstractResolver | any |
createArgs | any |
pagedEntity | any |
repository | ObjectType <BaseRepository <ThemeEntity , TThemeEntityInput >> |
updateArgs | any |
#
Defined insystem/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 insystem/core/backend/src/helpers/constants.ts:34
#
PrimitiveValueScalar• Const
PrimitiveValueScalar: GraphQLScalarType
#
Defined insystem/core/backend/src/models/objects/primitive-value.scalar.ts:16
#
adminPanelMessages• Const
adminPanelMessages: Object
#
Type declarationName | Type |
---|---|
onBuildEndMessage | string |
onBuildErrorMessage | string |
onBuildStartMessage | string |
onStartErrorMessage | string |
onStartMessage | string |
#
Defined insystem/core/backend/src/helpers/constants.ts:54
#
bcryptSaltRounds• Const
bcryptSaltRounds: 10
#
Defined insystem/core/backend/src/helpers/auth-settings.ts:6
#
buildDirName• Const
buildDirName: "build"
#
Defined insystem/core/backend/src/helpers/paths.ts:10
#
cmsConfigFileName• Const
cmsConfigFileName: "cmsconfig.json"
#
Defined insystem/core/backend/src/helpers/paths.ts:12
#
cmsName• Const
cmsName: "cromwell"
#
Defined insystem/core/backend/src/helpers/paths.ts:8
#
cmsPackageName• Const
cmsPackageName: "@cromwell/cms"
#
Defined insystem/core/backend/src/helpers/constants.ts:122
#
configFileName• Const
configFileName: string
#
Defined insystem/core/backend/src/helpers/paths.ts:11
#
defaultCmsConfig• Const
defaultCmsConfig: TCmsConfig
#
Defined insystem/core/backend/src/helpers/constants.ts:70
#
entityMetaRepository• Const
entityMetaRepository: EntityMetaRepository
#
Defined insystem/core/backend/src/helpers/entity-meta.ts:165
#
pluginAdminBundlePath• Const
pluginAdminBundlePath: "admin/index.js"
#
Defined insystem/core/backend/src/helpers/paths.ts:240
#
pluginAdminCjsPath• Const
pluginAdminCjsPath: "admin/cjs.js"
#
Defined insystem/core/backend/src/helpers/paths.ts:241
#
pluginFrontendBundlePath• Const
pluginFrontendBundlePath: "frontend/index.js"
#
Defined insystem/core/backend/src/helpers/paths.ts:238
#
pluginFrontendCjsPath• Const
pluginFrontendCjsPath: "frontend/cjs.js"
#
Defined insystem/core/backend/src/helpers/paths.ts:239
#
rendererMessages• Const
rendererMessages: Object
#
Type declarationName | Type |
---|---|
onBuildEndMessage | string |
onBuildErrorMessage | string |
onBuildStartMessage | string |
onStartErrorMessage | string |
onStartMessage | string |
#
Defined insystem/core/backend/src/helpers/constants.ts:46
#
serverMessages• Const
serverMessages: Object
#
Type declarationName | Type |
---|---|
onBuildEndMessage | string |
onBuildErrorMessage | string |
onBuildStartMessage | string |
onStartErrorMessage | string |
onStartMessage | string |
#
Defined insystem/core/backend/src/helpers/constants.ts:62
#
tempDirName• Const
tempDirName: string
#
Defined insystem/core/backend/src/helpers/paths.ts:9
#
Functions#
Rolesâ–¸ Const
Roles(...roles
): CustomDecorator
<string
>
#
ParametersName | Type |
---|---|
...roles | TAuthRole [] |
#
ReturnsCustomDecorator
<string
>
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:34
#
applyBaseFilterâ–¸ Const
applyBaseFilter<TEntity
>(__namedParameters
): SelectQueryBuilder
<TEntity
>
#
Type parametersName |
---|
TEntity |
#
ParametersName | Type |
---|---|
__namedParameters | Object |
__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.filter | BaseFilterInput |
__namedParameters.qb | SelectQueryBuilder <TEntity > |
#
ReturnsSelectQueryBuilder
<TEntity
>
#
Defined insystem/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 parametersName |
---|
T |
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <T > |
firstEntityName | string |
firstEntityProp | keyof T |
secondEntityName | string |
secondEntityId | number |
#
ReturnsSelectQueryBuilder
<T
>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:37
#
applyGetPagedâ–¸ Const
applyGetPaged<T
>(qb
, sortByTableName?
, params?
): SelectQueryBuilder
<T
>
#
Type parametersName |
---|
T |
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <T > |
sortByTableName? | string |
params? | TPagedParams <T > |
#
ReturnsSelectQueryBuilder
<T
>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:11
#
checkEntitySlugâ–¸ Const
checkEntitySlug<T
>(entity
, EntityClass
): Promise
<T
>
#
Type parametersName | Type |
---|---|
T | extends BasePageEntity <T > |
#
ParametersName | Type |
---|---|
entity | T |
EntityClass | (...args : any []) => T |
#
ReturnsPromise
<T
>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:96
#
collectPluginsâ–¸ Const
collectPlugins(options?
): Promise
<TBackendModule
>
#
ParametersName | Type |
---|---|
options? | Object |
options.cwd? | string |
options.updateCache? | boolean |
#
ReturnsPromise
<TBackendModule
>
#
Defined insystem/core/backend/src/helpers/plugin-exports.ts:76
#
connectDatabaseâ–¸ Const
connectDatabase(__namedParameters
): Promise
<void
>
#
ParametersName | Type |
---|---|
__namedParameters | Object |
__namedParameters.development? | boolean |
__namedParameters.ormConfigOverride? | Partial <Writeable <MysqlConnectionOptions >> |
#
ReturnsPromise
<void
>
#
Defined insystem/core/backend/src/helpers/connect-database.ts:24
#
createGenericEntityâ–¸ Const
createGenericEntity<EntityType
, EntityInputType
>(entityName
, EntityClass
, InputEntityClass?
): Object
#
Type parametersName | Type |
---|---|
EntityType | EntityType |
EntityInputType | EntityType |
#
ParametersName | Type |
---|---|
entityName | string |
EntityClass | (...args : any []) => EntityType |
InputEntityClass? | (...args : any []) => EntityInputType |
#
ReturnsObject
Name | Type |
---|---|
abstractResolver | any |
createArgs | any |
pagedEntity | any |
repository | ObjectType <BaseRepository <EntityType , EntityInputType >> |
updateArgs | any |
#
Defined insystem/core/backend/src/helpers/create-generic-entity.ts:10
#
findPluginâ–¸ Const
findPlugin(pluginName
): Promise
<undefined
| TPluginEntity
>
#
ParametersName | Type |
---|---|
pluginName | string |
#
ReturnsPromise
<undefined
| TPluginEntity
>
#
Defined insystem/core/backend/src/helpers/plugin-settings.ts:8
#
findThemeâ–¸ Const
findTheme(themeName
): Promise
<undefined
| TThemeEntity
>
#
ParametersName | Type |
---|---|
themeName | string |
#
ReturnsPromise
<undefined
| TThemeEntity
>
#
Defined insystem/core/backend/src/helpers/theme-config.ts:9
#
fireActionâ–¸ Const
fireAction<T
, TPayload
, TOutput
>(options
): Promise
<Record
<string
, TOutput
>>
#
Type parametersName | Type |
---|---|
T | extends keyof ActionTypes |
TPayload | ActionTypes [T ][``"payload"``] |
TOutput | ActionTypes [T ][``"output"``] |
#
ParametersName | Type |
---|---|
options | Object |
options.actionName | string | T |
options.payload? | TPayload |
#
ReturnsPromise
<Record
<string
, TOutput
>>
#
Defined insystem/core/backend/src/helpers/actions.ts:27
#
getAdminPanelDirâ–¸ Const
getAdminPanelDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:103
#
getAdminPanelServiceBuildDirâ–¸ Const
getAdminPanelServiceBuildDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:104
#
getAdminPanelStartupPathâ–¸ Const
getAdminPanelStartupPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:116
#
getAdminPanelStaticDirâ–¸ Const
getAdminPanelStaticDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:120
#
getAdminPanelTempDirâ–¸ Const
getAdminPanelTempDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:108
#
getAdminPanelWebPublicDirâ–¸ Const
getAdminPanelWebPublicDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:113
#
getAdminPanelWebServiceBuildDirâ–¸ Const
getAdminPanelWebServiceBuildDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:110
#
getAuthSettingsâ–¸ Const
getAuthSettings(options?
): Promise
<TAuthSettings
>
#
ParametersName | Type |
---|---|
options? | Object |
options.serverCachePath? | string |
#
ReturnsPromise
<TAuthSettings
>
#
Defined insystem/core/backend/src/helpers/auth-settings.ts:24
#
getBundledModulesDirâ–¸ Const
getBundledModulesDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:251
#
getCmsConfigPathâ–¸ Const
getCmsConfigPath(dir?
): Promise
<any
>
#
ParametersName | Type |
---|---|
dir? | string |
#
ReturnsPromise
<any
>
#
Defined insystem/core/backend/src/helpers/paths.ts:44
#
getCmsConfigPathSyncâ–¸ Const
getCmsConfigPathSync(dir?
): any
#
ParametersName | Type |
---|---|
dir? | string |
#
Returnsany
#
Defined insystem/core/backend/src/helpers/paths.ts:60
#
getCmsEntityâ–¸ Const
getCmsEntity(): Promise
<CmsEntity
>
#
ReturnsPromise
<CmsEntity
>
#
Defined insystem/core/backend/src/helpers/cms-settings.ts:57
#
getCmsInfoâ–¸ Const
getCmsInfo(): Promise
<TCmsInfo
>
#
ReturnsPromise
<TCmsInfo
>
#
Defined insystem/core/backend/src/helpers/cms-settings.ts:104
#
getCmsModuleConfigâ–¸ Const
getCmsModuleConfig(moduleName?
): Promise
<undefined
| TModuleConfig
>
#
ParametersName | Type |
---|---|
moduleName? | string |
#
ReturnsPromise
<undefined
| TModuleConfig
>
#
Defined insystem/core/backend/src/helpers/paths.ts:209
#
getCmsModuleInfoâ–¸ Const
getCmsModuleInfo(moduleName?
): Promise
<undefined
| TPackageCromwellConfig
>
#
ParametersName | Type |
---|---|
moduleName? | string |
#
ReturnsPromise
<undefined
| TPackageCromwellConfig
>
#
Defined insystem/core/backend/src/helpers/paths.ts:220
#
getCmsSettingsâ–¸ Const
getCmsSettings(): Promise
<undefined
| TCmsSettings
>
#
ReturnsPromise
<undefined
| TCmsSettings
>
#
Defined insystem/core/backend/src/helpers/cms-settings.ts:72
#
getCoreBackendDirâ–¸ Const
getCoreBackendDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:78
#
getCoreCommonDirâ–¸ Const
getCoreCommonDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:76
#
getCoreFrontendDirâ–¸ Const
getCoreFrontendDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:77
#
getEmailTemplateâ–¸ Const
getEmailTemplate(fileName
, props?
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
fileName | string |
props? | Record <string , any > |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/emailing.ts:14
#
getErrorLogPathâ–¸ Const
getErrorLogPath(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:80
#
getLoggerâ–¸ Const
getLogger(writeToFile?
): Object
#
ParametersName | Type | Default value |
---|---|---|
writeToFile | boolean | true |
#
ReturnsObject
Name | Type |
---|---|
error | (...args : any []) => void |
info | (...args : any []) => void |
log | (...args : any []) => void |
warn | (...args : any []) => void |
#
Defined insystem/core/backend/src/helpers/logger.ts:17
#
getLogsDirâ–¸ Const
getLogsDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:79
#
getManagerDirâ–¸ Const
getManagerDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:83
#
getManagerTempDirâ–¸ Const
getManagerTempDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:84
#
getMetaInfoPathâ–¸ Const
getMetaInfoPath(filename
): string
#
ParametersName | Type |
---|---|
filename | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:236
#
getMigrationsDirNameâ–¸ Const
getMigrationsDirName(dbType
): undefined
| "migrations/sqlite"
| "migrations/mysql"
| "migrations/postgres"
#
ParametersName | Type |
---|---|
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" |
#
Returnsundefined
| "migrations/sqlite"
| "migrations/mysql"
| "migrations/postgres"
#
Defined insystem/core/backend/src/helpers/constants.ts:124
#
getModulePackageâ–¸ Const
getModulePackage(moduleName?
): Promise
<undefined
| TPackageJson
>
#
ParametersName | Type |
---|---|
moduleName? | string |
#
ReturnsPromise
<undefined
| TPackageJson
>
#
Defined insystem/core/backend/src/helpers/paths.ts:262
#
getModuleStaticDirâ–¸ Const
getModuleStaticDir(moduleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
moduleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:229
#
getNodeModuleDirâ–¸ Const
getNodeModuleDir(moduleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
moduleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:31
#
getNodeModuleDirSyncâ–¸ Const
getNodeModuleDirSync(moduleName
): undefined
| string
#
ParametersName | Type |
---|---|
moduleName | string |
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:22
#
getPagedâ–¸ Const
getPaged<T
>(qb
, sortByTableName?
, params?
): Promise
<TPagedList
<T
>>
#
Type parametersName |
---|
T |
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <T > |
sortByTableName? | string |
params? | TPagedParams <T > |
#
ReturnsPromise
<TPagedList
<T
>>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:44
#
getPluginAdminBundlePathâ–¸ Const
getPluginAdminBundlePath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:245
#
getPluginAdminCjsPathâ–¸ Const
getPluginAdminCjsPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:246
#
getPluginBackendPathâ–¸ Const
getPluginBackendPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:247
#
getPluginFrontendBundlePathâ–¸ Const
getPluginFrontendBundlePath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:242
#
getPluginFrontendCjsPathâ–¸ Const
getPluginFrontendCjsPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:243
#
getPluginFrontendMetaPathâ–¸ Const
getPluginFrontendMetaPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:244
#
getPluginSettingsâ–¸ Const
getPluginSettings(pluginName
): Promise
<any
>
#
ParametersName | Type |
---|---|
pluginName | string |
#
ReturnsPromise
<any
>
#
Defined insystem/core/backend/src/helpers/plugin-settings.ts:26
#
getPublicDirâ–¸ Const
getPublicDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:253
#
getPublicPluginsDirâ–¸ Const
getPublicPluginsDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:254
#
getPublicThemesDirâ–¸ Const
getPublicThemesDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:255
#
getRendererBuildDirâ–¸ Const
getRendererBuildDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:95
#
getRendererDirâ–¸ Const
getRendererDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:88
#
getRendererStartupPathâ–¸ Const
getRendererStartupPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:89
#
getRendererTempDevDirâ–¸ Const
getRendererTempDevDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:94
#
getRendererTempDirâ–¸ Const
getRendererTempDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:93
#
getServerBuildDirâ–¸ Const
getServerBuildDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:131
#
getServerBuildMonitorPathâ–¸ Const
getServerBuildMonitorPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:143
#
getServerBuildPathâ–¸ Const
getServerBuildPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:135
#
getServerBuildProxyPathâ–¸ Const
getServerBuildProxyPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:139
#
getServerCachePathâ–¸ Const
getServerCachePath(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:153
#
getServerDefaultEmailsDirâ–¸ Const
getServerDefaultEmailsDir(): void
#
Returnsvoid
#
Defined insystem/core/backend/src/helpers/paths.ts:149
#
getServerDirâ–¸ Const
getServerDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:126
#
getServerStartupPathâ–¸ Const
getServerStartupPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:127
#
getServerTempDirâ–¸ Const
getServerTempDir(dir?
): string
#
ParametersName | Type |
---|---|
dir? | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:147
#
getServerTempEmailsDirâ–¸ Const
getServerTempEmailsDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:148
#
getSqlBoolStrâ–¸ Const
getSqlBoolStr(dbType
, b
): "true"
| "false"
| "1"
| "0"
#
ParametersName | Type |
---|---|
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" |
b | boolean |
#
Returns"true"
| "false"
| "1"
| "0"
#
Defined insystem/core/backend/src/helpers/base-queries.ts:130
#
getSqlLikeâ–¸ Const
getSqlLike(dbType
): "ILIKE"
| "LIKE"
#
ParametersName | Type |
---|---|
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 insystem/core/backend/src/helpers/base-queries.ts:137
#
getTempDirâ–¸ Const
getTempDir(dir?
): string
#
ParametersName | Type |
---|---|
dir? | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:14
#
getThemeAdminPanelDirâ–¸ Const
getThemeAdminPanelDir(themeModuleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
themeModuleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:202
#
getThemeBuildDirâ–¸ Const
getThemeBuildDir(themeModuleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
themeModuleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:170
#
getThemeConfigsâ–¸ Const
getThemeConfigs(themeName
): Promise
<TAllThemeConfigs
>
Get currently active Theme's configs from DB
#
ParametersName | Type | Description |
---|---|---|
themeName | string | specify Theme to get config from, otherwise it will return from an active theme |
#
ReturnsPromise
<TAllThemeConfigs
>
#
Defined insystem/core/backend/src/helpers/theme-config.ts:28
#
getThemeNextBuildDirâ–¸ Const
getThemeNextBuildDir(themeModuleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
themeModuleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:189
#
getThemeNextBuildDirByPathâ–¸ Const
getThemeNextBuildDirByPath(themeDir
): string
#
ParametersName | Type |
---|---|
themeDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:195
#
getThemePagesMetaPathâ–¸ Const
getThemePagesMetaPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:248
#
getThemePagesVirtualPathâ–¸ Const
getThemePagesVirtualPath(distDir
): string
#
ParametersName | Type |
---|---|
distDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:249
#
getThemeRollupBuildDirâ–¸ Const
getThemeRollupBuildDir(themeModuleName
): Promise
<undefined
| string
>
#
ParametersName | Type |
---|---|
themeModuleName | string |
#
ReturnsPromise
<undefined
| string
>
#
Defined insystem/core/backend/src/helpers/paths.ts:179
#
getThemeRollupBuildDirByPathâ–¸ Const
getThemeRollupBuildDirByPath(themeDir
): string
#
ParametersName | Type |
---|---|
themeDir | string |
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:185
#
getThemeTempAdminPanelDirâ–¸ Const
getThemeTempAdminPanelDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:198
#
getThemeTempRollupBuildDirâ–¸ Const
getThemeTempRollupBuildDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:176
#
getUtilsBuildDirâ–¸ Const
getUtilsBuildDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:163
#
getUtilsDirâ–¸ Const
getUtilsDir(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:158
#
getUtilsImporterPathâ–¸ Const
getUtilsImporterPath(): undefined
| string
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:159
#
getUtilsTempDirâ–¸ Const
getUtilsTempDir(): string
#
Returnsstring
#
Defined insystem/core/backend/src/helpers/paths.ts:167
#
graphQlAuthCheckerâ–¸ Const
graphQlAuthChecker(options?
, roles?
): boolean
#
ParametersName | Type |
---|---|
options? | null | { args? : Record <string , any > ; context? : TGraphQLContext ; info? : any ; root? : any } |
roles? | null | TAuthRole [] |
#
Returnsboolean
#
Defined insystem/core/backend/src/helpers/auth-guards.ts:51
#
handleBaseInputâ–¸ Const
handleBaseInput(entity
, input
): Promise
<void
>
#
ParametersName | Type |
---|---|
entity | BasePageEntity |
input | TBasePageEntityInput |
#
ReturnsPromise
<void
>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:62
#
handleCustomMetaInputâ–¸ Const
handleCustomMetaInput<T
>(entity
, input
): Promise
<void
>
#
Type parametersName | Type |
---|---|
T | extends Object |
#
ParametersName | Type |
---|---|
entity | BasePageEntity |
input | T |
#
ReturnsPromise
<void
>
#
Defined insystem/core/backend/src/helpers/base-queries.ts:77
#
isExternalFormâ–¸ Const
isExternalForm(id
): boolean
#
ParametersName | Type |
---|---|
id | any |
#
Returnsboolean
#
Defined insystem/core/backend/src/helpers/paths.ts:250
#
isSimpleStringâ–¸ Const
isSimpleString(str
): undefined
| boolean
| ""
#
ParametersName | Type |
---|---|
str | undefined | string |
#
Returnsundefined
| boolean
| ""
#
Defined insystem/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
#
ParametersName | Type |
---|---|
path? | string |
#
ReturnsPromise
<TCmsConfig
>
#
Defined insystem/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
#
ParametersName | Type |
---|---|
path? | string |
#
ReturnsTCmsConfig
#
Defined insystem/core/backend/src/helpers/cms-settings.ts:21
#
readCmsModulesâ–¸ Const
readCmsModules(dir?
): Promise
<Object
>
#
ParametersName | Type |
---|---|
dir? | string |
#
ReturnsPromise
<Object
>
#
Defined insystem/core/backend/src/helpers/cms-modules.ts:7
#
readPackageâ–¸ Const
readPackage(path
): Promise
<any
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<any
>
#
Defined insystem/core/backend/src/helpers/paths.ts:257
#
readPluginsExportsâ–¸ Const
readPluginsExports(options?
): Promise
<TPluginInfo
[]>
#
ParametersName | Type |
---|---|
options? | Object |
options.cwd? | string |
#
ReturnsPromise
<TPluginInfo
[]>
#
Defined insystem/core/backend/src/helpers/plugin-exports.ts:29
#
registerActionâ–¸ Const
registerAction<T
, TPayload
, TOutput
>(options
): void
#
Type parametersName | Type |
---|---|
T | extends keyof ActionTypes keyof ActionTypes |
TPayload | ActionTypes [T ][``"payload"``] |
TOutput | ActionTypes [T ][``"output"``] |
#
ParametersName | Type |
---|---|
options | Object |
options.actionName | T |
options.pluginName | string |
options.action | (payload : TPayload ) => Promise <TOutput > |
#
Returnsvoid
#
Defined insystem/core/backend/src/helpers/actions.ts:7
#
resolvePackageJsonPathâ–¸ Const
resolvePackageJsonPath(moduleName
): undefined
| string
#
ParametersName | Type |
---|---|
moduleName | string |
#
Returnsundefined
| string
#
Defined insystem/core/backend/src/helpers/paths.ts:16
#
runShellCommandâ–¸ Const
runShellCommand(command
, cwd?
): Promise
<void
>
#
ParametersName | Type |
---|---|
command | string |
cwd? | string |
#
ReturnsPromise
<void
>
#
Defined insystem/core/backend/src/helpers/shell.ts:7
#
savePluginâ–¸ Const
savePlugin(plugin
): Promise
<TPluginEntity
>
#
ParametersName | Type |
---|---|
plugin | TPluginEntity |
#
ReturnsPromise
<TPluginEntity
>
#
Defined insystem/core/backend/src/helpers/plugin-settings.ts:21
#
savePluginSettingsâ–¸ Const
savePluginSettings(pluginName
, input
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
pluginName | string |
input | any |
#
ReturnsPromise
<boolean
>
#
Defined insystem/core/backend/src/helpers/plugin-settings.ts:50
#
sendEmailâ–¸ Const
sendEmail(addresses
, subject
, htmlContent
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
addresses | string [] |
subject | string |
htmlContent | string |
#
ReturnsPromise
<boolean
>
#
Defined insystem/core/backend/src/helpers/emailing.ts:34
#
validateEmailâ–¸ Const
validateEmail(email
): boolean
#
ParametersName | Type |
---|---|
email | any |
#
Returnsboolean
#
Defined insystem/core/backend/src/helpers/validation.ts:1
#
wrapInQuotesâ–¸ Const
wrapInQuotes(dbType
, str
): string
#
ParametersName | Type |
---|---|
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" |
str | string |
#
Returnsstring