<commit_before>regard-query-client-node
========================

Node module for accessing Regard query engine

## Environment variables

`QUERY_USERNAME`
`QUERY_PASSWORD`

## API

The query client requires an organization and product.

```js
var QueryClient = new QueryClient(organization, product);
```

All of the following methods return promises.

### registerQuery: function (name, definition)

Register a query with the query engine. The name should be a GUID. The definition is the JSON query definition, eg

```json
{
   "verb":"CountUniqueValues",
   "key":"user-id",
   "name":"value",
   "applies-to":{
      "verb":"AllEvents",
      "applies-to":{

      }
   }
}
```

### runQuery: function (queryName)

Run a query using the query GUID. Returns JSON with a `Results` property.

### deleteData: function (userId)

Deletes user data for the provided user id.
<commit_msg>Update docs<commit_after>regard-query-client-node
========================

Node module for accessing Regard query engine

## Environment variables

```
QUERY_USERNAME
QUERY_PASSWORD
```

## API

The query client requires an organization and product.

```js
var QueryClient = require('regard-query-client-node');
var client = new QueryClient(organization, product);
```

All of the following methods return promises.

### registerQuery: function (name, definition)

Register a query with the query engine. The name should be a GUID. The definition is the JSON query definition, eg

```json
{
   "verb":"CountUniqueValues",
   "key":"user-id",
   "name":"value",
   "applies-to":{
      "verb":"AllEvents",
      "applies-to":{

      }
   }
}
```

### runQuery: function (queryName)

Run a query using the query GUID. Returns JSON with a `Results` property.

### deleteData: function (userId)

Deletes user data for the provided user id.

{'fraction_non_alphanumeric': 0.14089912280701755, 'fraction_numerical': 0.0, 'mean_word_length': 4.2898550724637685, 'pattern_counts': {'":': 12, '<': 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': '1233637', 'n_tokens_mistral': 546, 'n_tokens_neox': 522, 'n_words': 190}