<commit_before>/**
 *   Wechaty - https://github.com/chatie/wechaty
 *
 *   @copyright 2016-2018 <NAME> <<EMAIL>>
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 *  @ignore
 */
import cuid    from 'cuid'
import os      from 'os'

import {
  // Constructor,
  cloneClass,
  // instanceToClass,
}                   from 'clone-class'
import {
  FileBox,
}                   from 'file-box'
import {
  callerResolve,
  hotImport,
}                   from 'hot-import'
import {
  MemoryCard,
}                   from 'memory-card'
import {
  StateSwitch,
}                   from 'state-switch'

import {
  CHAT_EVENT_DICT,
  Puppet,

  PUPPET_EVENT_DICT,
  PuppetEventName,
  PuppetOptions,
  ScanStatus,
}                       from 'wechaty-puppet'

import {
  Accessory,
}                       from './accessory'
import {
  config,
  isProduction,
  log,
  Raven,
  VERSION,
}                       from './config'

import {
  AnyFunction,
  Sayable,
}                       from './types'

import {
  Io,
}                       from './io'
import {
  PuppetModuleName,
}                       from './puppet-config'
import {
  PuppetManager,
}                       from './puppet-manager'

import {
  Contact,
  ContactSelf,
  Friendship,
  Message,
  Room,
  RoomInvitation,
  UrlLink,
}                       from './user/'

export const WECHATY_EVENT_DICT = {
  ...CHAT_EVENT_DICT,
  dong      : 'Should be emitted after we call `Wechaty.ding()`',
  error     : `Will be emit when there's an Error occurred.`,
  heartbeat : 'Will be emited periodly after the Wechaty started. If not, means that the Wechaty had died.',
  ready     : 'All underlined data source are ready for use.',
  start     : 'Will be emitted after the Wechaty had been started.',
  stop      : 'Will be emitted after the Wechaty had been stopped.',
}

export type WechatyEventName  = keyof typeof WECHATY_EVENT_DICT

export interface WechatyOptions {
  memory?        : MemoryCard,
  name?          : string,                    // Wechaty Name
  profile?       : null | string,             // DEPRECATED: use name instead
  puppet?        : PuppetModuleName | Puppet, // Puppet name or instance
  puppetOptions? : PuppetOptions,             // Puppet TOKEN
  ioToken?       : string,                    // Io TOKEN
}

const PUPPET_MEMORY_NAME = 'puppet'<commit_msg>Clean deprecated `profile` doc<commit_after>/**
 *   Wechaty - https://github.com/chatie/wechaty
 *
 *   @copyright 2016-2018 <NAME> <<EMAIL>>
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 *  @ignore
 */
import cuid    from 'cuid'
import os      from 'os'

import {
  // Constructor,
  cloneClass,
  // instanceToClass,
}                   from 'clone-class'
import {
  FileBox,
}                   from 'file-box'
import {
  callerResolve,
  hotImport,
}                   from 'hot-import'
import {
  MemoryCard,
}                   from 'memory-card'
import {
  StateSwitch,
}                   from 'state-switch'

import {
  CHAT_EVENT_DICT,
  Puppet,

  PUPPET_EVENT_DICT,
  PuppetEventName,
  PuppetOptions,
  ScanStatus,
}                       from 'wechaty-puppet'

import {
  Accessory,
}                       from './accessory'
import {
  config,
  isProduction,
  log,
  Raven,
  VERSION,
}                       from './config'

import {
  AnyFunction,
  Sayable,
}                       from './types'

import {
  Io,
}                       from './io'
import {
  PuppetModuleName,
}                       from './puppet-config'
import {
  PuppetManager,
}                       from './puppet-manager'

import {
  Contact,
  ContactSelf,
  Friendship,
  Message,
  Room,
  RoomInvitation,
  UrlLink,
}                       from './user/'

export const WECHATY_EVENT_DICT = {
  ...CHAT_EVENT_DICT,
  dong      : 'Should be emitted after we call `Wechaty.ding()`',
  error     : `Will be emit when there's an Error occurred.`,
  heartbeat : 'Will be emited periodly after the Wechaty started. If not, means that the Wechaty had died.',
  ready     : 'All underlined data source are ready for use.',
  start     : 'Will be emitted after the Wechaty had been started.',
  stop      : 'Will be emitted after the Wechaty had been stopped.',
}

export type WechatyEventName  = keyof typeof WECHATY_EVENT_DICT

export interface WechatyOptions {
  memory?        : MemoryCard,
  name?          : string,                    // Wechaty Name

  // @deprecated: use `name` instead of `profile`
  profile?       : null | string,             // DEPRECATED: use name instead

  puppet?        : PuppetModuleName | Puppet, // Puppet name or instance
  puppetOptions? : PuppetOptions,             // Puppet TOKEN
  ioToken?       : string,                    // Io TOKEN
}

const PUPPET_MEMORY_NAME = 'puppet'
{'fraction_non_alphanumeric': 0.09142464340952054, 'fraction_numerical': 0.0041244200034370165, 'mean_word_length': 2.029672045809474, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5236774', 'n_tokens_mistral': 1800, 'n_tokens_neox': 1735, 'n_words': 552}