<commit_before>/*!
 * Copyright (c) 2015-2017 Cisco Systems, Inc. See LICENSE file.
 */

import {oneFlight} from '@ciscospark/common';
import {safeSetTimeout} from '@ciscospark/common-timers';
import {omit} from 'lodash';
import util from 'util';
import FeaturesModel from './features-model';
import {persist, waitForValue, SparkPlugin} from '@ciscospark/spark-core';

/**
 * Decides if this device should be persisted to boundedStorage, based on
 * this.config.ephemeral.
 * @returns {Boolean}
 */
function decider() {
  return !this.config.ephemeral;
}

const Device = SparkPlugin.extend({
  children: {
    features: FeaturesModel
  },

  idAttribute: `url`,

  namespace: `Device`,

  props: {
    // deviceType doesn't have any real value, but we need to send it during
    // device refresh to make sure we don't get back an ios device url
    deviceType: `string`,
    intranetInactivityDuration: `number`,
    intranetInactivityCheckUrl: `string`,
    modificationTime: `string`,
    searchEncryptionKeyUrl: `string`,
    services: {
      // Even though @jodykstr will tell you the docs claim you don't need to
      // initialize `object` properties, the docs lie.
      default() {
        return {};
      },
      type: `object`
    },
    url: `string`,
    userId: `string`,
    webSocketUrl: `string`
  },<commit_msg>feat(internal-plugin-wdm): add 'webFileShareControl' field to Device<commit_after>/*!
 * Copyright (c) 2015-2017 Cisco Systems, Inc. See LICENSE file.
 */

import {oneFlight} from '@ciscospark/common';
import {safeSetTimeout} from '@ciscospark/common-timers';
import {omit} from 'lodash';
import util from 'util';
import FeaturesModel from './features-model';
import {persist, waitForValue, SparkPlugin} from '@ciscospark/spark-core';

/**
 * Decides if this device should be persisted to boundedStorage, based on
 * this.config.ephemeral.
 * @returns {Boolean}
 */
function decider() {
  return !this.config.ephemeral;
}

const Device = SparkPlugin.extend({
  children: {
    features: FeaturesModel
  },

  idAttribute: `url`,

  namespace: `Device`,

  props: {
    // deviceType doesn't have any real value, but we need to send it during
    // device refresh to make sure we don't get back an ios device url
    deviceType: `string`,
    intranetInactivityDuration: `number`,
    intranetInactivityCheckUrl: `string`,
    modificationTime: `string`,
    searchEncryptionKeyUrl: `string`,
    services: {
      // Even though @jodykstr will tell you the docs claim you don't need to
      // initialize `object` properties, the docs lie.
      default() {
        return {};
      },
      type: `object`
    },
    url: `string`,
    userId: `string`,
    /**
     * Notifies the client if file sharing is disabled.
     * Currently, the values for it are:
     * - BLOCK_BOTH
     * - BLOCK_UPLOAD
     * @instance
     * @memberof Device
     * @type {string}
     */
    webFileShareControl: `string`,
    webSocketUrl: `string`
  },
{'fraction_non_alphanumeric': 0.11936785474108944, 'fraction_numerical': 0.005379959650302623, 'mean_word_length': 3.292929292929293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4116052', 'n_tokens_mistral': 934, 'n_tokens_neox': 888, 'n_words': 290}