@stackbit/sdk
Advanced tools
Comparing version 0.2.20 to 0.2.21
@@ -183,3 +183,3 @@ "use strict"; | ||
let referencedModelNames = []; | ||
lodash_1.default.forEach(models, (model) => { | ||
lodash_1.default.forEach(models, (model, modelName) => { | ||
var _a; | ||
@@ -189,2 +189,6 @@ if (!model) { | ||
} | ||
// add model label if not set | ||
if (!lodash_1.default.has(model, 'label')) { | ||
model.label = lodash_1.default.startCase(modelName); | ||
} | ||
if (lodash_1.default.has(model, 'fields') && !Array.isArray(model.fields)) { | ||
@@ -191,0 +195,0 @@ model.fields = []; |
@@ -433,6 +433,3 @@ "use strict"; | ||
type: joi_1.default.string().valid('page', 'data', 'config', 'object').required(), | ||
label: joi_1.default.string().required().when(joi_1.default.ref('/import'), { | ||
is: joi_1.default.exist(), | ||
then: joi_1.default.optional() | ||
}), | ||
label: joi_1.default.string(), | ||
description: joi_1.default.string(), | ||
@@ -439,0 +436,0 @@ thumbnail: joi_1.default.string(), |
@@ -99,3 +99,3 @@ import { StricterUnion } from '../utils'; | ||
}; | ||
label: string; | ||
label?: string; | ||
description?: string; | ||
@@ -102,0 +102,0 @@ thumbnail?: string; |
{ | ||
"name": "@stackbit/sdk", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"description": "Stackbit SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -243,3 +243,3 @@ import path from 'path'; | ||
_.forEach(models, (model) => { | ||
_.forEach(models, (model, modelName) => { | ||
if (!model) { | ||
@@ -249,2 +249,7 @@ return; | ||
// add model label if not set | ||
if (!_.has(model, 'label')) { | ||
model.label = _.startCase(modelName); | ||
} | ||
if (_.has(model, 'fields') && !Array.isArray(model.fields)) { | ||
@@ -251,0 +256,0 @@ model.fields = []; |
@@ -488,6 +488,3 @@ import Joi from 'joi'; | ||
type: Joi.string().valid('page', 'data', 'config', 'object').required(), | ||
label: Joi.string().required().when(Joi.ref('/import'), { | ||
is: Joi.exist(), | ||
then: Joi.optional() | ||
}), | ||
label: Joi.string(), | ||
description: Joi.string(), | ||
@@ -494,0 +491,0 @@ thumbnail: Joi.string(), |
@@ -119,3 +119,3 @@ import { StricterUnion } from '../utils'; | ||
}; | ||
label: string; | ||
label?: string; | ||
description?: string; | ||
@@ -122,0 +122,0 @@ thumbnail?: string; |
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
728771
12865