<commit_before>#!/bin/bash

set -e

usage() {
  echo "$(basename $0) - Upload several product types"
  echo ""
  echo "Arguments:"
  echo "-p <project-key> - Your SPHERE.IO project key."
  echo "-t <token> - Your SPHERE.IO API access token."
  echo "-d <dir> - the directory, where the JSON files are located."
}

upload() {
  for pt in "${JSON_DIR}/"product-type-*.json; do
    echo "Uploading product type from file ${pt} ..."
    curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -X POST -d @"${pt}" "https://api.sphere.io/${PROJECT_KEY}/product-types"
  done<commit_msg>Set correct header on upload product types.<commit_after>#!/bin/bash

set -e

usage() {
  echo "$(basename $0) - Upload several product types"
  echo ""
  echo "Arguments:"
  echo "-p <project-key> - Your SPHERE.IO project key."
  echo "-t <token> - Your SPHERE.IO API access token."
  echo "-d <dir> - the directory, where the JSON files are located."
}

upload() {
  for pt in "${JSON_DIR}/"product-type-*.json; do
    echo "Uploading product type from file ${pt} ..."
    curl -H "Content-Type: application/json" -H "Authorization: Bearer ${ACCESS_TOKEN}" -X POST -d @"${pt}" "https://api.sphere.io/${PROJECT_KEY}/product-types"
  done
{'fraction_non_alphanumeric': 0.16942148760330578, 'fraction_numerical': 0.001652892561983471, 'mean_word_length': 3.356115107913669, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2324776', 'n_tokens_mistral': 416, 'n_tokens_neox': 407, 'n_words': 136}