schemas/config/sdk
Type Aliases
'Read the “', Type Aliases, '” section'CacheConfig
'Read the “', CacheConfig, '” section'type CacheConfig = { lifetime: number;};
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:79
Represents the configuration for the cache.
This type is inferred from the CacheConfigSchema
using Zod’s infer
method.
It ensures that the cache configuration adheres to the schema defined in CacheConfigSchema
.
Type declaration
'Read the “', Type declaration, '” section'lifetime: number;
Cache Lifetime
{number}{unit}
- e.g. ‘5m’ for 5 minutes or ‘1h’ for 1 hour
'5m'
ProcessedCacheConfig
'Read the “', ProcessedCacheConfig, '” section'type ProcessedCacheConfig = { enabled: boolean; lifetime: number;};
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:87
Represents the processed cache configuration inferred from the ProcessedCacheConfigSchema.
This type is used to define the structure of the cache configuration after it has been processed and validated by the schema.
Type declaration
'Read the “', Type declaration, '” section'enabled: boolean;
Cache Enabled
true
lifetime: number;
Cache Lifetime
{number}{unit}
- e.g. ‘5m’ for 5 minutes or ‘1h’ for 1 hour
'5m'
ProcessedSDKConfig
'Read the “', ProcessedSDKConfig, '” section'type ProcessedSDKConfig = { cacheConfig: { enabled: boolean; lifetime: number; };};
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:137
Type definition for the processed SDK configuration.
This type is inferred from the ProcessedSDKSchema
using Zod’s infer
method.
It represents the structure of the SDK configuration after it has been processed.
Type declaration
'Read the “', Type declaration, '” section'cacheConfig
'Read the “', cacheConfig, '” section'cacheConfig: { enabled: boolean; lifetime: number; } = ProcessedCacheConfigSchema;
Cache Configuration
cacheConfig: { lifetime: '5m' }
cacheConfig.enabled
'Read the “', cacheConfig.enabled, '” section'enabled: boolean;
Cache Enabled
true
cacheConfig.lifetime
'Read the “', cacheConfig.lifetime, '” section'lifetime: number;
Cache Lifetime
{number}{unit}
- e.g. ‘5m’ for 5 minutes or ‘1h’ for 1 hour
'5m'
StudioCMS_SDKConfig
'Read the “', StudioCMS_SDKConfig, '” section'type StudioCMS_SDKConfig = typeof SDKSchema._output;
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:176
StudioCMS_SDKOptions
'Read the “', StudioCMS_SDKOptions, '” section'type StudioCMS_SDKOptions = typeof SDKSchema._input;
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:175
TimeString
'Read the “', TimeString, '” section'type TimeString = typeof TimeStringSchema._input;
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:33
Variables
'Read the “', Variables, '” section'SDKSchema
'Read the “', SDKSchema, '” section'const SDKSchema: ZodEffects<ZodDefault<ZodOptional<ZodUnion<[ZodBoolean, ZodObject<{ cacheConfig: ZodEffects<ZodDefault<ZodOptional<ZodUnion<...>>>, { enabled: boolean; lifetime: number; }, | undefined | boolean | { lifetime: ... | ...; }>; }, "strip", ZodTypeAny, { cacheConfig: { enabled: boolean; lifetime: number; }; }, { cacheConfig: | boolean | { lifetime: string; }; }>]>>>, { cacheConfig: { enabled: boolean; lifetime: number; }; }, | undefined | boolean | { cacheConfig: | boolean | { lifetime: string; };}>;
Defined in: studiocms/packages/studiocms/src/schemas/config/sdk.ts:149
SDKSchema is a Zod schema that validates the SDK configuration. It can either be a boolean or an object containing cache configuration.
If it is a boolean, it defaults to true
and transforms into an object
with default cache configuration.
If it is an object, it must contain the cacheConfig
property which is
validated by the SDKCacheSchema
.