Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 报表
const SimpleSchema = require('simpl-schema').default;
module.exports = new SimpleSchema({
name: {
type: String,
label: '名称'
},
report_type: {
type: String,
label: '报表类型',
optional: true,
defaultValue: 'tabular',
allowedValues: ['tabular', 'summary', 'matrix']
},
object_name: {
type: String,
label: '对象名'
},
filter_scope: {
Mongo.Collection.prototype.attachSchema = function c2AttachSchema(ss, options) {
options = options || {};
// Allow passing just the schema object
if (!SimpleSchema.isSimpleSchema(ss)) {
ss = new SimpleSchema(ss);
}
this._c2 = this._c2 || {};
// If we've already attached one schema, we combine both into a new schema unless options.replace is `true`
if (this._c2._simpleSchema && options.replace !== true) {
if (ss.version >= 2) {
var newSS = new SimpleSchema(this._c2._simpleSchema);
newSS.extend(ss);
ss = newSS;
} else {
ss = new SimpleSchema([this._c2._simpleSchema, ss]);
}
}
var selector = options.selector;
}
});
if (schemaIndex === -1) {
// We didn't find the schema in our array - push it into the array
obj._c2._simpleSchemas.push({
schema: SimpleSchema.isSimpleSchema(ss) ? ss : new SimpleSchema(ss),
selector: selector,
});
} else {
// We found a schema with an identical selector in our array,
if (options.replace !== true) {
// Merge with existing schema unless options.replace is `true`
if (obj._c2._simpleSchemas[schemaIndex].schema.version >= 2) {
obj._c2._simpleSchemas[schemaIndex].schema.extend(ss);
} else {
obj._c2._simpleSchemas[schemaIndex].schema = new SimpleSchema([obj._c2._simpleSchemas[schemaIndex].schema, ss]);
}
} else {
// If options.replace is `true` replace existing schema with new schema
obj._c2._simpleSchemas[schemaIndex].schema = ss;
}
}
// Remove existing schemas without selector
delete obj._c2._simpleSchema;
} else {
// Track the schema in the collection
obj._c2._simpleSchema = ss;
// Remove existing schemas with selector
delete obj._c2._simpleSchemas;
Mongo.Collection.prototype.attachSchema = function c2AttachSchema(ss, options) {
options = options || {};
// Allow passing just the schema object
if (!SimpleSchema.isSimpleSchema(ss)) {
ss = new SimpleSchema(ss);
}
this._c2 = this._c2 || {};
// If we've already attached one schema, we combine both into a new schema unless options.replace is `true`
if (this._c2._simpleSchema && options.replace !== true) {
if (ss.version >= 2) {
var newSS = new SimpleSchema(this._c2._simpleSchema);
newSS.extend(ss);
ss = newSS;
} else {
ss = new SimpleSchema([this._c2._simpleSchema, ss]);
}
}
var selector = options.selector;
function attachTo(obj) {
if (typeof selector === "object") {
// Index of existing schema with identical selector
var schemaIndex = -1;
// we need an array to hold multiple schemas
obj._c2._simpleSchemas = obj._c2._simpleSchemas || [];
// Allow passing just the schema object
if (!SimpleSchema.isSimpleSchema(ss)) {
ss = new SimpleSchema(ss);
}
this._c2 = this._c2 || {};
// If we've already attached one schema, we combine both into a new schema unless options.replace is `true`
if (this._c2._simpleSchema && options.replace !== true) {
if (ss.version >= 2) {
var newSS = new SimpleSchema(this._c2._simpleSchema);
newSS.extend(ss);
ss = newSS;
} else {
ss = new SimpleSchema([this._c2._simpleSchema, ss]);
}
}
var selector = options.selector;
function attachTo(obj) {
if (typeof selector === "object") {
// Index of existing schema with identical selector
var schemaIndex = -1;
// we need an array to hold multiple schemas
obj._c2._simpleSchemas = obj._c2._simpleSchemas || [];
// Loop through existing schemas with selectors
obj._c2._simpleSchemas.forEach((schema, index) => {
// if we find a schema with an identical selector, save it's index
const SimpleSchema = require('simpl-schema').default;
const permissionSetSchema = require('./object_permission_set');
module.exports = new SimpleSchema({
name: {
type: String,
label: '对象名',
regEx: /^[a-zA-Z_][a-zA-Z0-9_]*$/
},
label: {
type: String,
label: '显示名称'
},
icon: {
type: String,
label: '图标',
optional: true
},
is_enable: {
type: Boolean,
const SimpleSchema = require('simpl-schema').default;
module.exports = new SimpleSchema({
name: {
type: String,
label: '字段名',
regEx: /^[a-zA-Z_]\w*(\.\$\.\w+)?[a-zA-Z0-9]*$/
},
label: {
type: String,
label: '显示名称',
optional: true
},
is_name: {
type: Boolean,
label: '',
optional: true
},
object: {