<commit_before><?php
function getAttributes($type) {
 return '{
    "name": "attributes",
     "children": [
      {"name": "self"},
      {"name": "first"},
      {"name": "prev"},
      {"name": "next"},
      {"name": "last"},
      {
      "name": ".. { example entry } ..",
      "children": [
          {"name": "self"},
          {"name": "' . $type . '"}
        ]
      }
     ]
    }';
}
function getCoupon($multiple = false) {
    return '{
                   "name": "' . (($multiple) ? '.. { example entry } ..' : 'coupon') . '",
                   "children": [
                     {"name": "self"},
                     {"name": "store"},
                     {
                      "name": "coupon_codes",
                      "children": [
                          {"name": "self"},
                          {"name": "first"},
                          {"name": "prev"},
                          {"name": "next"},
                          {"name": "last"},
                          {
                              "name": ".. { example entry } ..",
                              "children": [
                                 {"name": "self"},
                                 {"name": "store"},
                                 {"name": "coupon"},
                                 {"name": "coupon_code_transactions"}
                              ]
                          }
                      ]
                     },
                     {"name": "coupon_product_categories"}
                   ]
                  }
        ';
}
function getTemplate($type) {
return '{
               "name": "' . $type . '_template",
               "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "template_sets"}
               ]
       }';
}
function getCustomer() {
     return '{
             "name": "customer",
             "children": [
                {"name": "self"},
                ' . getAttributes('customer') . ',
                {"name": "store"},
                {
                 "name": "default_billing_address",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"},
                  {"name": "customer_addresses"}
                 ]
                },
                {
                 "name": "default_shipping_address",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"},
                  {"name": "customer_addresses"}
                 ]
                },
                {
                 "name": "default_payment_method",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"}
                 ]
                },
                {
                 "name": "transactions",
                  "children": [
                    {"name": "self"},
                    {"name": "first"},
                    {"name": "prev"},
                    {"name": "next"},
                    {"name": "last"}
                  ]
                },
                {
                    "name": "subscriptions",
                    "children": [
                     {"name": "self"},
                     {"name": "first"},
                     {"name": "prev"},
                     {"name": "next"},
                     {"name": "last"}
                    ]
                },
                {
                 "name": "customer_addresses",
                 "children": [
                  {"name": "self"},
                  {"name": "first"},
                  {"name": "prev"},
                  {"name": "next"},
                  {"name": "last"},
                  {
                    "name": ".. { example entry } ..",
                    "children": [
                       {"name": "self"},
                       {"name": "store"},
                       {"name": "customer"}
                    ]
                  }
                 ]
                }
             ]
            }';
}

function getProductCategory($multiple = false) {
         return '{
                    "name": "' . (($multiple) ? '.. { example entry } ..' : 'product_category') . '",
                    "children": [
                      {"name": "self"},
                      {"name": "store"},
                      {"name": "downloadables"},
                      {"name": "admin_email_template"},
                      {"name": "customer_email_template"},
                      {
                       "name": "email_templates",
                       "children": [
                        {"name": "self"},
                        {"name": "first"},
                        {"name": "prev"},
                        {"name": "next"},
                        {"name": "last"}
                       ]
                      },
                      {
                       "name": "tax_product_categories",
                       "children": [
                          {"name": "self"},
                          {"name": "store"},
                          {"name": "product_category"},
                          {
                           "name": "tax",
                           "children": [
                              {"name": "self"},
                              {"name": "store"},
                              {"name": "tax_product_categories"}
                           ]
                          }
                       ]
                      }
                    ]
                  }';
}

include __DIR__ . '/../v/1.0.0/api/includes/rel_values.php';
$rels = '{"name": "self"},' . "\n";
foreach($rel_values as $rel => $description) {
    $rels .= '{"name": "' . $rel . '"},' . "\n";
}
$rels = trim($rels, ",\n");
?>
{
 "name": "/",
 "children": [
  {"name": "self"},
  {
  "name": "property_helpers", 
   "children": [
    {"name": "self"},
    {"name": "checkout_types"},
    {"name": "customer_password_hash_types"},
    {"name": "default_templates"},
    {"name": "languages"},
    {"name": "language_strings"},
    {"name": "locales"},
    {"name": "payment_method_gateway_types"},
    {"name": "shipping_methods"},
    {"name": "shipping_address_types"},<commit_msg>Fix for the link rel file no longer existing. :) Note: I'm hard coding the file location to the service... probably not the best plan, but it is what it is.<commit_after><?php
function getAttributes($type) {
 return '{
    "name": "attributes",
     "children": [
      {"name": "self"},
      {"name": "first"},
      {"name": "prev"},
      {"name": "next"},
      {"name": "last"},
      {
      "name": ".. { example entry } ..",
      "children": [
          {"name": "self"},
          {"name": "' . $type . '"}
        ]
      }
     ]
    }';
}
function getCoupon($multiple = false) {
    return '{
                   "name": "' . (($multiple) ? '.. { example entry } ..' : 'coupon') . '",
                   "children": [
                     {"name": "self"},
                     {"name": "store"},
                     {
                      "name": "coupon_codes",
                      "children": [
                          {"name": "self"},
                          {"name": "first"},
                          {"name": "prev"},
                          {"name": "next"},
                          {"name": "last"},
                          {
                              "name": ".. { example entry } ..",
                              "children": [
                                 {"name": "self"},
                                 {"name": "store"},
                                 {"name": "coupon"},
                                 {"name": "coupon_code_transactions"}
                              ]
                          }
                      ]
                     },
                     {"name": "coupon_product_categories"}
                   ]
                  }
        ';
}
function getTemplate($type) {
return '{
               "name": "' . $type . '_template",
               "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "template_sets"}
               ]
       }';
}
function getCustomer() {
     return '{
             "name": "customer",
             "children": [
                {"name": "self"},
                ' . getAttributes('customer') . ',
                {"name": "store"},
                {
                 "name": "default_billing_address",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"},
                  {"name": "customer_addresses"}
                 ]
                },
                {
                 "name": "default_shipping_address",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"},
                  {"name": "customer_addresses"}
                 ]
                },
                {
                 "name": "default_payment_method",
                 "children": [
                  {"name": "self"},
                  {"name": "store"},
                  {"name": "customer"}
                 ]
                },
                {
                 "name": "transactions",
                  "children": [
                    {"name": "self"},
                    {"name": "first"},
                    {"name": "prev"},
                    {"name": "next"},
                    {"name": "last"}
                  ]
                },
                {
                    "name": "subscriptions",
                    "children": [
                     {"name": "self"},
                     {"name": "first"},
                     {"name": "prev"},
                     {"name": "next"},
                     {"name": "last"}
                    ]
                },
                {
                 "name": "customer_addresses",
                 "children": [
                  {"name": "self"},
                  {"name": "first"},
                  {"name": "prev"},
                  {"name": "next"},
                  {"name": "last"},
                  {
                    "name": ".. { example entry } ..",
                    "children": [
                       {"name": "self"},
                       {"name": "store"},
                       {"name": "customer"}
                    ]
                  }
                 ]
                }
             ]
            }';
}

function getProductCategory($multiple = false) {
         return '{
                    "name": "' . (($multiple) ? '.. { example entry } ..' : 'product_category') . '",
                    "children": [
                      {"name": "self"},
                      {"name": "store"},
                      {"name": "downloadables"},
                      {"name": "admin_email_template"},
                      {"name": "customer_email_template"},
                      {
                       "name": "email_templates",
                       "children": [
                        {"name": "self"},
                        {"name": "first"},
                        {"name": "prev"},
                        {"name": "next"},
                        {"name": "last"}
                       ]
                      },
                      {
                       "name": "tax_product_categories",
                       "children": [
                          {"name": "self"},
                          {"name": "store"},
                          {"name": "product_category"},
                          {
                           "name": "tax",
                           "children": [
                              {"name": "self"},
                              {"name": "store"},
                              {"name": "tax_product_categories"}
                           ]
                          }
                       ]
                      }
                    ]
                  }';
}

include '/srv/foxy/code/hypermedia-api/src/FoxyCart/Services/LinkRelationsService.php';
$rel_values = \FoxyCart\Services\LinkRelationsService::$rel_values;
$rels = '{"name": "self"},' . "\n";
foreach($rel_values as $rel => $description) {
    $rels .= '{"name": "' . $rel . '"},' . "\n";
}
$rels = trim($rels, ",\n");
?>
{
 "name": "/",
 "children": [
  {"name": "self"},
  {
  "name": "property_helpers", 
   "children": [
    {"name": "self"},
    {"name": "checkout_types"},
    {"name": "customer_password_hash_types"},
    {"name": "default_templates"},
    {"name": "languages"},
    {"name": "language_strings"},
    {"name": "locales"},
    {"name": "payment_method_gateway_types"},
    {"name": "shipping_methods"},
    {"name": "shipping_address_types"},
{'fraction_non_alphanumeric': 0.1698505623170544, 'fraction_numerical': 0.00023108920043136651, 'mean_word_length': 0.8420828603859251, 'pattern_counts': {'":': 244, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '760963', 'n_tokens_mistral': 3160, 'n_tokens_neox': 2973, 'n_words': 561}