UNPKG

loopback-workspace

Version:

**⚠️ LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical security fixes will be provided. (See [Module Long Term Support Policy](#module-long-term-support-policy) below.)**

28 lines (23 loc) 834 B
// Copyright IBM Corp. 2015,2019. All Rights Reserved. // Node module: loopback-workspace // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT 'use strict'; module.exports = function(ModelConfig) { /** * Defines a model configuration which attaches a model to a facet and a * dataSource. It also can extend a model definition with additional configuration. * * @class ModelDefinition * @inherits Definition */ /** * - `name` is required and must be unique per `Facet` * - `facetName` is required and must refer to an existing facet * * @header Property Validation */ ModelConfig.validatesUniquenessOf('name', {scopedTo: ['facetName']}); ModelConfig.validatesPresenceOf('name'); ModelConfig.validatesPresenceOf('facetName'); };