<commit_before>/*

A SimpleSchema-compatible JSON schema

*/

import Users from 'meteor/vulcan:users';

const schema = {
  _id: {
    type: String,
    viewableBy: ['guests'],
    optional: true,
  },
  userId: {
    type: String,
    viewableBy: ['members'],
    insertableBy: Users.owns,
    resolveAs: {
      fieldName: 'user',
      type: 'User',
      resolver: (message, args, context) => {
        return context.Users.findOne({_id: message.userId}, {fields: context.getViewableFields(context.currentUser, context.Users)});
      },
      addOriginalField: true,
    },
    optional: true,
  },
  createdAt: {
    optional: true,
    type: Date,
    viewableBy: ['members'],
    onInsert: (document, currentUser) => {
      return new Date();
    },
  },
  content: {
    type: Object,
    viewableBy: ['members'],
    insertableBy: ['members'],
    editableBy: Users.owns,
    control: 'EditorFormComponent',
    order: 2,
    blackbox: true,
    optional: true,
    form: {
      //Use the comment editor functionality (e.g. available toolbar options)
      commentEditor: true,
      //Use the comment editor styles (e.g. font and size)
      commentStyles: true,
    }
  },
  conversationId: {
    type: String,
    viewableBy: ['members'],
    insertableBy: ['members'],<commit_msg>Remove redundant messages schema<commit_after>/*

A SimpleSchema-compatible JSON schema

*/

import Users from 'meteor/vulcan:users';

const schema = {
  _id: {
    type: String,
    viewableBy: ['guests'],
    optional: true,
  },
  userId: {
    type: String,
    viewableBy: ['members'],
    insertableBy: Users.owns,
    resolveAs: {
      fieldName: 'user',
      type: 'User',
      resolver: (message, args, context) => {
        return context.Users.findOne({_id: message.userId}, {fields: context.getViewableFields(context.currentUser, context.Users)});
      },
      addOriginalField: true,
    },
    optional: true,
  },
  createdAt: {
    optional: true,
    type: Date,
    viewableBy: ['members'],
    onInsert: (document, currentUser) => {
      return new Date();
    },
  },
  conversationId: {
    type: String,
    viewableBy: ['members'],
    insertableBy: ['members'],
{'fraction_non_alphanumeric': 0.14272644098810613, 'fraction_numerical': 0.0004574565416285453, 'mean_word_length': 2.843585237258348, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '9104', 'n_tokens_mistral': 699, 'n_tokens_neox': 699, 'n_words': 170}