<commit_before>import restClient, { SERVER_PRODUCTION, SERVER_SANDBOX, SERVER_VERSION, ClientOptions } from './RestClient';
import { TokenStore } from './Token';
import Account from './paths/Account';
import ClientInfo from './paths/ClientInfo';
import Dictionary from './paths/Dictionary';
import NumberParser from './paths/NumberParser';
import NumberPool from './paths/Subscription';
import Subscription from './paths/Subscription';

export default class Client {
    rest: restClient;

    constructor(opts: ClientOptions) {
        this.rest = new restClient(opts);
    }

    /** Ttl: time to live in seconds. */
    auth(opts: {
        /** Phone number linked to account or extension in account in E.164 format with or without leading '+' sign */
        username: string;
        password: string;
        /** Extension short number. If company number is specified as a username, and extension is not specified, the server will attempt to authenticate client as main company administrator */
        extension?: string;
        /** Access token lifetime in seconds; the possible values are from 600 sec (10 min) to 3600 sec (1 hour). The default value is 3600 sec. If the value specified exceeds the default one, the default value is set. If the value specified is less than 600 seconds, the minimum value (600 sec) is set */
        accessTokenTtl?: number;
        /** Refresh token lifetime in seconds. The default value depends on the client application, but as usual it equals to 7 days. If the value specified exceeds the default one, the default value is applied. If client specifies refresh_token_ttl<=0, refresh token is not returned even if the corresponding grant type is supported */
        refreshTokenTtl?: number;
        /** List of API permissions to be used with access token (see [Application Permissions](https://developer.ringcentral.com/api-docs/latest/APIPermissions.html)). Can be omitted when requesting all permissions defined during the application registration phase */
        scope?: string[]
    }): Promise<void> {
        return this.rest.auth(opts);
    }

    restoreToken(tokenStore?: TokenStore): Promise<void> {
        return this.rest.restoreToken();
    }

    logout(): Promise<void> {
        return this.rest.logout();
    }


    account(id?: string): Account {
        return new Account(null, id, this.rest);
    }

    clientInfo(id?: string): ClientInfo {
        return new ClientInfo(null, id, this.rest);
    }

    dictionary(id?: string): Dictionary {<commit_msg>Fix bug pass storeToken parameters<commit_after>import restClient, { SERVER_PRODUCTION, SERVER_SANDBOX, SERVER_VERSION, ClientOptions } from './RestClient';
import { TokenStore } from './Token';
import Account from './paths/Account';
import ClientInfo from './paths/ClientInfo';
import Dictionary from './paths/Dictionary';
import NumberParser from './paths/NumberParser';
import NumberPool from './paths/Subscription';
import Subscription from './paths/Subscription';

export default class Client {
    rest: restClient;

    constructor(opts: ClientOptions) {
        this.rest = new restClient(opts);
    }

    /** Ttl: time to live in seconds. */
    auth(opts: {
        /** Phone number linked to account or extension in account in E.164 format with or without leading '+' sign */
        username: string;
        password: string;
        /** Extension short number. If company number is specified as a username, and extension is not specified, the server will attempt to authenticate client as main company administrator */
        extension?: string;
        /** Access token lifetime in seconds; the possible values are from 600 sec (10 min) to 3600 sec (1 hour). The default value is 3600 sec. If the value specified exceeds the default one, the default value is set. If the value specified is less than 600 seconds, the minimum value (600 sec) is set */
        accessTokenTtl?: number;
        /** Refresh token lifetime in seconds. The default value depends on the client application, but as usual it equals to 7 days. If the value specified exceeds the default one, the default value is applied. If client specifies refresh_token_ttl<=0, refresh token is not returned even if the corresponding grant type is supported */
        refreshTokenTtl?: number;
        /** List of API permissions to be used with access token (see [Application Permissions](https://developer.ringcentral.com/api-docs/latest/APIPermissions.html)). Can be omitted when requesting all permissions defined during the application registration phase */
        scope?: string[]
    }): Promise<void> {
        return this.rest.auth(opts);
    }

    restoreToken(tokenStore?: TokenStore): Promise<void> {
        return this.rest.restoreToken(tokenStore);
    }

    logout(): Promise<void> {
        return this.rest.logout();
    }


    account(id?: string): Account {
        return new Account(null, id, this.rest);
    }

    clientInfo(id?: string): ClientInfo {
        return new ClientInfo(null, id, this.rest);
    }

    dictionary(id?: string): Dictionary {
{'fraction_non_alphanumeric': 0.09282202556538839, 'fraction_numerical': 0.00983284169124877, 'mean_word_length': 3.3958513396715646, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '4687682', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1228, 'n_words': 548}