<commit_before>jraphical = require 'jraphical'
module.exports = class JStack extends jraphical.Module

  KodingError        = require '../error'

  {secure, ObjectId, signature} = require 'bongo'
  {Relationship}     = jraphical
  {permit}           = require './group/permissionset'

  @trait __dirname, '../traits/protected'

  @share()

  @set

    softDelete        : yes

    permissions       :
      'create stacks' : ['member']
      'update stacks' : ['member']
      'get stacks'    : ['member']

    sharedMethods     :
      static          :
        one           :
          (signature Object, Function)
        getStack      :
          (signature Function)
        createStack   :
          (signature Function)
        getStacks     :
          (signature Function)
      instance        :
        remove        :
          (signature Function)
        push          :
          (signature Object, Function)

    sharedEvents      :
      static          : [ ]
      instance        : [
        { name : "RemovedFromCollection" }
        { name : 'updateInstance' }
      ]

    schema            :
      user            : String
      group           : String
      sid             : Number
      meta            : Object

  @getStacks = ({user, group}, callback)->

    JStack.some {user, group}, {}, (err, stacks)->
      return callback err  if err
      callback null, stacks or []

  @getStackId = (selector, callback)-><commit_msg>Environments: Added missing scheme to createStack method of JStack.<commit_after>jraphical = require 'jraphical'
module.exports = class JStack extends jraphical.Module

  KodingError        = require '../error'

  {secure, ObjectId, signature} = require 'bongo'
  {Relationship}     = jraphical
  {permit}           = require './group/permissionset'

  @trait __dirname, '../traits/protected'

  @share()

  @set

    softDelete        : yes

    permissions       :
      'create stacks' : ['member']
      'update stacks' : ['member']
      'get stacks'    : ['member']

    sharedMethods     :
      static          :
        one           :
          (signature Object, Function)
        getStack      :
          (signature Function)
        createStack   :
          (signature Object, Function)
        getStacks     :
          (signature Function)
      instance        :
        remove        :
          (signature Function)
        push          :
          (signature Object, Function)

    sharedEvents      :
      static          : [ ]
      instance        : [
        { name : "RemovedFromCollection" }
        { name : 'updateInstance' }
      ]

    schema            :
      user            : String
      group           : String
      sid             : Number
      meta            : Object

  @getStacks = ({user, group}, callback)->

    JStack.some {user, group}, {}, (err, stacks)->
      return callback err  if err
      callback null, stacks or []

  @getStackId = (selector, callback)->
{'fraction_non_alphanumeric': 0.09925975773889636, 'fraction_numerical': 0.0, 'mean_word_length': 1.5004205214465938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3008996', 'n_tokens_mistral': 799, 'n_tokens_neox': 762, 'n_words': 204}