@stackbit/sdk
Advanced tools
Comparing version 0.2.11 to 0.2.12
export declare const SSG_NAMES: readonly ["unibit", "jekyll", "hugo", "gatsby", "nextjs", "custom", "eleventy", "vuepress", "gridsome", "nuxt", "sapper", "hexo"]; | ||
export declare const CMS_NAMES: readonly ["git", "contentful", "sanity", "forestry", "netlifycms"]; | ||
export declare const FIELD_TYPES: readonly ["string", "url", "slug", "text", "markdown", "html", "number", "boolean", "enum", "date", "datetime", "color", "image", "file", "object", "model", "reference", "style", "list"]; | ||
export declare const STYLE_PROPS: readonly ["objectFit", "objectPosition", "flexDirection", "justifyItems", "justifySelf", "alignItems", "alignSelf", "padding", "margin", "width", "height", "fontFamily", "fontSize", "fontStyle", "fontWeight", "textAlign", "textColor", "textDecoration", "backgroundColor", "backgroundPosition", "backgroundSize", "borderRadius", "borderWidth", "borderColor", "borderStyle", "boxShadow", "opacity"]; | ||
export declare const STYLE_PROPS: readonly ["objectFit", "objectPosition", "flexDirection", "justifyContent", "justifyItems", "justifySelf", "alignContent", "alignItems", "alignSelf", "padding", "margin", "width", "height", "fontFamily", "fontSize", "fontStyle", "fontWeight", "textAlign", "textColor", "textDecoration", "backgroundColor", "backgroundPosition", "backgroundSize", "borderRadius", "borderWidth", "borderColor", "borderStyle", "boxShadow", "opacity"]; | ||
export declare const STYLE_PROPS_VALUES: { | ||
@@ -9,4 +9,6 @@ nineRegions: string[]; | ||
flexDirection: string[]; | ||
justifyContent: string[]; | ||
justifyItems: string[]; | ||
justifySelf: string[]; | ||
alignContent: string[]; | ||
alignItems: string[]; | ||
@@ -13,0 +15,0 @@ alignSelf: string[]; |
@@ -33,4 +33,6 @@ "use strict"; | ||
'flexDirection', | ||
'justifyContent', | ||
'justifyItems', | ||
'justifySelf', | ||
'alignContent', | ||
'alignItems', | ||
@@ -63,6 +65,8 @@ 'alignSelf', | ||
flexDirection: ['row', 'row-reverse', 'col', 'col-reverse'], | ||
justifyContent: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'], | ||
justifyItems: ['start', 'end', 'center', 'stretch'], | ||
justifySelf: ['auto', 'start', 'end', 'center', 'stretch'], | ||
alignItems: ['start', 'end', 'center', 'baseline', 'stretch'], | ||
alignSelf: ['auto', 'start', 'end', 'center', 'baseline', 'stretch'], | ||
alignContent: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch'], | ||
alignItems: ['flex-start', 'flex-end', 'center', 'baseline', 'stretch'], | ||
alignSelf: ['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'], | ||
width: ['auto', 'narrow', 'wide', 'full'], | ||
@@ -69,0 +73,0 @@ height: ['auto', 'full', 'screen'], |
@@ -381,2 +381,3 @@ "use strict"; | ||
newFilePath: joi_1.default.string(), | ||
singleInstance: joi_1.default.boolean(), | ||
file: joi_1.default.string(), | ||
@@ -453,2 +454,3 @@ folder: joi_1.default.string(), | ||
filePath: joi_1.default.string(), | ||
singleInstance: joi_1.default.boolean(), | ||
file: joi_1.default.string(), | ||
@@ -455,0 +457,0 @@ folder: joi_1.default.string(), |
@@ -29,4 +29,6 @@ "use strict"; | ||
flexDirection: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.flexDirection), | ||
justifyContent: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.justifyContent), | ||
justifyItems: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.justifyItems), | ||
justifySelf: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.justifySelf), | ||
alignContent: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.alignContent), | ||
alignItems: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.alignItems), | ||
@@ -33,0 +35,0 @@ alignSelf: arrayOfStringsWithAll(...config_consts_1.STYLE_PROPS_VALUES.alignSelf), |
@@ -69,3 +69,3 @@ import { StricterUnion } from '../utils'; | ||
export declare type ContentModelMap = Record<string, ContentModel>; | ||
export interface ContentModel { | ||
export interface ContentModel extends BaseMatch { | ||
isPage?: boolean; | ||
@@ -75,6 +75,2 @@ urlPath?: string; | ||
newFilePath?: string; | ||
file?: string; | ||
folder?: string; | ||
match?: string; | ||
exclude?: string; | ||
} | ||
@@ -115,10 +111,17 @@ export interface ModelsSource { | ||
} | ||
interface BaseMatch { | ||
singleInstance?: boolean; | ||
file?: string; | ||
folder?: string; | ||
match?: string | string[]; | ||
exclude?: string | string[]; | ||
} | ||
export interface YamlObjectModel extends YamlBaseModel { | ||
type: 'object'; | ||
} | ||
export interface BaseDataModel extends YamlBaseModel { | ||
export interface BaseDataModel extends YamlBaseModel, BaseMatch { | ||
type: 'data'; | ||
filePath?: string; | ||
} | ||
export interface BasePageModel extends YamlBaseModel { | ||
export interface YamlPageModel extends YamlBaseModel, BaseMatch { | ||
type: 'page'; | ||
@@ -134,32 +137,10 @@ layout?: string; | ||
} | ||
interface BaseMatch { | ||
folder?: string; | ||
match?: string | string[]; | ||
exclude?: string | string[]; | ||
} | ||
export declare type YamlDataModel = StricterUnion<BaseDataModelFileSingle | BaseDataModelFileList | BaseDataModelMatchSingle | BaseDataModelMatchList>; | ||
export interface BaseDataModelFileSingle extends BaseDataModel { | ||
file: string; | ||
export declare type YamlDataModel = StricterUnion<BaseDataModelFields | BaseDataModeList>; | ||
export interface BaseDataModelFields extends BaseDataModel { | ||
isList?: false; | ||
} | ||
export interface BaseDataModelFileList extends Omit<BaseDataModel, 'fields'> { | ||
file: string; | ||
export interface BaseDataModeList extends Omit<BaseDataModel, 'fields'> { | ||
isList: true; | ||
items: FieldListItems; | ||
} | ||
export interface BaseDataModelMatchSingle extends BaseDataModel, BaseMatch { | ||
isList?: false; | ||
} | ||
export interface BaseDataModelMatchList extends Omit<BaseDataModel, 'fields'>, BaseMatch { | ||
isList: true; | ||
items: FieldListItems; | ||
} | ||
export declare type YamlPageModel = StricterUnion<PageModelSingle | PageModelMatch>; | ||
export interface PageModelSingle extends BasePageModel { | ||
singleInstance: true; | ||
file: string; | ||
} | ||
export interface PageModelMatch extends BasePageModel, BaseMatch { | ||
singleInstance?: false; | ||
} | ||
export interface FieldGroupItem { | ||
@@ -166,0 +147,0 @@ name: string; |
@@ -230,4 +230,6 @@ "use strict"; | ||
flexDirection: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.flexDirection), | ||
justifyContent: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.justifyContent), | ||
justifyItems: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.justifyItems), | ||
justifySelf: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.justifySelf), | ||
alignContent: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.alignContent), | ||
alignItems: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.alignItems), | ||
@@ -234,0 +236,0 @@ alignSelf: stylePropSchemaWithValidValues(config_consts_1.STYLE_PROPS_VALUES.alignSelf), |
@@ -38,3 +38,3 @@ "use strict"; | ||
else if (model.type === 'data') { | ||
return lodash_1.default.has(model, 'file'); | ||
return lodash_1.default.has(model, 'file') || lodash_1.default.get(model, 'singleInstance', false); | ||
} | ||
@@ -41,0 +41,0 @@ else if (model.type === 'page') { |
{ | ||
"name": "@stackbit/sdk", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "Stackbit SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -33,4 +33,6 @@ // SSGs Stackbit Studio supports | ||
'flexDirection', | ||
'justifyContent', | ||
'justifyItems', | ||
'justifySelf', | ||
'alignContent', | ||
'alignItems', | ||
@@ -64,6 +66,8 @@ 'alignSelf', | ||
flexDirection: ['row', 'row-reverse', 'col', 'col-reverse'], | ||
justifyContent: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'], | ||
justifyItems: ['start', 'end', 'center', 'stretch'], | ||
justifySelf: ['auto', 'start', 'end', 'center', 'stretch'], | ||
alignItems: ['start', 'end', 'center', 'baseline', 'stretch'], | ||
alignSelf: ['auto', 'start', 'end', 'center', 'baseline', 'stretch'], | ||
alignContent: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch'], | ||
alignItems: ['flex-start', 'flex-end', 'center', 'baseline', 'stretch'], | ||
alignSelf: ['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'], | ||
width: ['auto', 'narrow', 'wide', 'full'], | ||
@@ -70,0 +74,0 @@ height: ['auto', 'full', 'screen'], |
@@ -434,2 +434,3 @@ import Joi from 'joi'; | ||
newFilePath: Joi.string(), | ||
singleInstance: Joi.boolean(), | ||
file: Joi.string(), | ||
@@ -513,2 +514,3 @@ folder: Joi.string(), | ||
filePath: Joi.string(), | ||
singleInstance: Joi.boolean(), | ||
file: Joi.string(), | ||
@@ -683,3 +685,3 @@ folder: Joi.string(), | ||
logicFields: Joi.array().items(logicField), | ||
contentModels: Joi.any(), | ||
contentModels: Joi.any(), // contentModels should have been already validated by now | ||
modelsSource: modelsSourceSchema, | ||
@@ -686,0 +688,0 @@ models: modelsSchema |
@@ -31,4 +31,6 @@ import Joi, { CustomHelpers, ErrorReport } from 'joi'; | ||
flexDirection: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.flexDirection), | ||
justifyContent: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.justifyContent), | ||
justifyItems: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.justifyItems), | ||
justifySelf: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.justifySelf), | ||
alignContent: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.alignContent), | ||
alignItems: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.alignItems), | ||
@@ -35,0 +37,0 @@ alignSelf: arrayOfStringsWithAll(...STYLE_PROPS_VALUES.alignSelf), |
@@ -81,3 +81,3 @@ import { StricterUnion } from '../utils'; | ||
export interface ContentModel { | ||
export interface ContentModel extends BaseMatch { | ||
isPage?: boolean; | ||
@@ -87,6 +87,2 @@ urlPath?: string; | ||
newFilePath?: string; | ||
file?: string; | ||
folder?: string; | ||
match?: string; | ||
exclude?: string; | ||
} | ||
@@ -136,2 +132,10 @@ | ||
interface BaseMatch { | ||
singleInstance?: boolean; | ||
file?: string; | ||
folder?: string; | ||
match?: string | string[]; | ||
exclude?: string | string[]; | ||
} | ||
export interface YamlObjectModel extends YamlBaseModel { | ||
@@ -141,3 +145,3 @@ type: 'object'; | ||
export interface BaseDataModel extends YamlBaseModel { | ||
export interface BaseDataModel extends YamlBaseModel, BaseMatch { | ||
type: 'data'; | ||
@@ -147,3 +151,3 @@ filePath?: string; | ||
export interface BasePageModel extends YamlBaseModel { | ||
export interface YamlPageModel extends YamlBaseModel, BaseMatch { | ||
type: 'page'; | ||
@@ -161,17 +165,9 @@ layout?: string; | ||
interface BaseMatch { | ||
folder?: string; | ||
match?: string | string[]; | ||
exclude?: string | string[]; | ||
} | ||
export type YamlDataModel = StricterUnion<BaseDataModelFields | BaseDataModeList>; | ||
export type YamlDataModel = StricterUnion<BaseDataModelFileSingle | BaseDataModelFileList | BaseDataModelMatchSingle | BaseDataModelMatchList>; | ||
export interface BaseDataModelFileSingle extends BaseDataModel { | ||
file: string; | ||
export interface BaseDataModelFields extends BaseDataModel { | ||
isList?: false; | ||
} | ||
export interface BaseDataModelFileList extends Omit<BaseDataModel, 'fields'> { | ||
file: string; | ||
export interface BaseDataModeList extends Omit<BaseDataModel, 'fields'> { | ||
isList: true; | ||
@@ -181,22 +177,2 @@ items: FieldListItems; | ||
export interface BaseDataModelMatchSingle extends BaseDataModel, BaseMatch { | ||
isList?: false; | ||
} | ||
export interface BaseDataModelMatchList extends Omit<BaseDataModel, 'fields'>, BaseMatch { | ||
isList: true; | ||
items: FieldListItems; | ||
} | ||
export type YamlPageModel = StricterUnion<PageModelSingle | PageModelMatch>; | ||
export interface PageModelSingle extends BasePageModel { | ||
singleInstance: true; | ||
file: string; | ||
} | ||
export interface PageModelMatch extends BasePageModel, BaseMatch { | ||
singleInstance?: false; | ||
} | ||
export interface FieldGroupItem { | ||
@@ -203,0 +179,0 @@ name: string; |
@@ -280,4 +280,6 @@ import Joi from 'joi'; | ||
flexDirection: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.flexDirection), | ||
justifyContent: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.justifyContent), | ||
justifyItems: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.justifyItems), | ||
justifySelf: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.justifySelf), | ||
alignContent: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.alignContent), | ||
alignItems: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.alignItems), | ||
@@ -284,0 +286,0 @@ alignSelf: stylePropSchemaWithValidValues(STYLE_PROPS_VALUES.alignSelf), |
@@ -53,3 +53,3 @@ import _ from 'lodash'; | ||
} else if (model.type === 'data') { | ||
return _.has(model, 'file'); | ||
return _.has(model, 'file') || _.get(model, 'singleInstance', false); | ||
} else if (model.type === 'page') { | ||
@@ -56,0 +56,0 @@ return _.has(model, 'file') || _.get(model, 'singleInstance', false); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
720456
0
16
29
5
166
12727