<commit_before>import { base64Encode } from './utils/underscore';
import { http } from './http/http';
import { RequestOptions } from './http/request';
import * as promiseRetry from 'promise-retry';

import { Owners } from './ingestion/owners';
import { Objects } from './ingestion/objects';
import { Events } from './ingestion/events';
import { Search } from './restitution/search';
import { Bigdata } from './bigdata/bigdata';
import { Model } from './model/model';

let version: string;
try {
  version = require('../package.json').version;
} catch (e) {
  version = 'unknown';
}

export enum OAuth2Scopes {
  ALL,
  LIMITED,
  READ,
  WRITE,
}

export interface ClientCompression {
  requests: boolean;
  responses: boolean;
}

export interface ExponentialBackoff {
  numberOfAttempts?: number;
  initialDelayInMillis?: number;
  onRetry?: (attempt: number) => any;
}

export interface ClientOptions {
  id: string;
  secret: string;
  env?: string;
  token?: string;
  httpOptions?: RequestOptions;
  compression?: boolean | ClientCompression;
  exponentialBackoff?: ExponentialBackoff;
}

function isClientCompression(object: boolean | ClientCompression): object is ClientCompression {<commit_msg>fix(types): id secret are optional if token is given<commit_after>import { base64Encode } from './utils/underscore';
import { http } from './http/http';
import { RequestOptions } from './http/request';
import * as promiseRetry from 'promise-retry';

import { Owners } from './ingestion/owners';
import { Objects } from './ingestion/objects';
import { Events } from './ingestion/events';
import { Search } from './restitution/search';
import { Bigdata } from './bigdata/bigdata';
import { Model } from './model/model';

let version: string;
try {
  version = require('../package.json').version;
} catch (e) {
  version = 'unknown';
}

export enum OAuth2Scopes {
  ALL,
  LIMITED,
  READ,
  WRITE,
}

export interface ClientCompression {
  requests: boolean;
  responses: boolean;
}

export interface ExponentialBackoff {
  numberOfAttempts?: number;
  initialDelayInMillis?: number;
  onRetry?: (attempt: number) => any;
}

export interface ClientOptions {
  id?: string;
  secret?: string;
  env?: string;
  token?: string;
  httpOptions?: RequestOptions;
  compression?: boolean | ClientCompression;
  exponentialBackoff?: ExponentialBackoff;
}

function isClientCompression(object: boolean | ClientCompression): object is ClientCompression {
{'fraction_non_alphanumeric': 0.13210633946830266, 'fraction_numerical': 0.00245398773006135, 'mean_word_length': 4.622988505747126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '172325', 'n_tokens_mistral': 726, 'n_tokens_neox': 721, 'n_words': 210}