<commit_before>import azureStorage from 'azure-storage';
import nconf from 'nconf';

nconf.env()
  .file({ file: 'config.json', search: true });

const partitionKey = nconf.get('PARTITION_KEY');
const accountName = nconf.get('STORAGE_NAME');
const accountKey = nconf.get('STORAGE_KEY');

let tableService = azureStorage
  .createTableService(accountName, accountKey);

tableService.createTableIfNotExists('tea',
  (error, result, response)=>{
  });

const upsertTea = (tea)=>{
  const upsertTask = Object.assign({
    PartitionKey:partitionKey,
    RowKey: tea.name},
    tea);
  return new Promise(function(resolve, reject){
    tableService.insertOrMergeEntity('tea',upsertTask,
      (error, result, response)=>{
        if(!error){
          resolve(result);
        }
        reject(error);
      });
  })

};

const getAllTeas = (continuationToken) => {
  return new Promise(function(resolve, reject){
    const query = new azureStorage.TableQuery()
      .where('PartitionKey eq ?', partitionKey);
    tableService.queryEntities('tea', query, continuationToken || null,
      (error, result, response)=>{
        if(!error){
          resolve(result);
        }
        reject(error);
      })
  });
};

const getTea = (teaId) => {

};


export default {
  upsertTea,
  getAllTeas,
  getTea
};
<commit_msg>remove restriction on get-all tea query<commit_after>import azureStorage from 'azure-storage';
import nconf from 'nconf';

import teaList from '../api/staticData.js'

nconf.env()
  .file({ file: 'config.json', search: true });

const partitionKey = nconf.get('PARTITION_KEY');
const accountName = nconf.get('STORAGE_NAME');
const accountKey = nconf.get('STORAGE_KEY');

let tableService = azureStorage
  .createTableService(accountName, accountKey);

tableService.createTableIfNotExists('tea',
  (error, result, response)=>{
  });

const upsertTea = (tea)=>{
  const upsertTask = Object.assign({
    PartitionKey:{'_':partitionKey},
    RowKey: {'_':tea.name}},
    tea);
  return new Promise(function(resolve, reject){
    tableService.insertOrMergeEntity('tea',upsertTask,
      (error, result, response)=>{
        if(!error){
          resolve(result);
        }
        reject(error);
      });
  })

};

const getAllTeas = (continuationToken) => {
  return new Promise(function(resolve, reject){
    const query = new azureStorage.TableQuery();
    tableService.queryEntities('tea', query, continuationToken || null,
      (error, result, response)=>{
        if(!error){
          resolve(result);
        }
        reject(error);
      })
  });
};

const getTea = (teaId) => {

};


export default {
  upsertTea,
  getAllTeas,
  getTea
};

{'fraction_non_alphanumeric': 0.14774436090225565, 'fraction_numerical': 0.0, 'mean_word_length': 3.6197916666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5750201', 'n_tokens_mistral': 857, 'n_tokens_neox': 848, 'n_words': 176}