<commit_before>import EmberError from "@ember/error";
import $ from "jquery";
import { camelize } from "@ember/string";
import JSONAPIAdapter from "ember-data/adapters/json-api";

export default JSONAPIAdapter.extend({
  coalesceFindRequests: true,

  host: "",
  modelWhitelist: [
    "basket",
    "basket-item",
    "category",
    "country",
    "order",
    "order-line",
    "order-payment-method",
    "payment",
    "payment-method",
    "price",
    "product-category",
    "product-image",
    "product",
    "promotion",
    "shop-payment-method",
    "state",
    "sku-image",
    "sku"
  ],

  pathForType(type) {
    if (this.modelWhitelist.includes(type)) {
      return this._super(...arguments);
    }
    return "entries";
  },

  /**
   @override
   */
  findAll(store, type, sinceToken) {
    let modelName = type.modelName;

    if (this.modelWhitelist.includes(type.modelName)) {
      return this._super(...arguments);
    }

    let query = {
      content_group_api_identifier: camelize(modelName)
    };

    const url = this.buildURL(modelName, null, null, "findAll");

    if (sinceToken) {
      query.since = sinceToken;
    }

    if (this.sortQueryParams) {
      query = this.sortQueryParams(query);
    }
    return this.ajax(url, "GET", { data: { filter: query } });
  },

  // /**
  //  @override
  //  */
  query(store, type, query) {
    let modelName = type.modelName;

    if (this.modelWhitelist.includes(type.modelName)) {
      return this._super(...arguments);
    }

    query.filter = $.extend(query.filter, {
      content_group_api_identifier: camelize(modelName)
    });

    if (this.sortQueryParams) {
      query = this.sortQueryParams(query);
    }

    let url = this.buildURL(modelName, null, null, "query", query);

    return this.ajax(url, "GET", { data: query });
  },
<commit_msg>Remove jquery in content adapter<commit_after>import EmberError from "@ember/error";
import { camelize } from "@ember/string";
import JSONAPIAdapter from "ember-data/adapters/json-api";
import { assign } from "@ember/polyfills";

export default JSONAPIAdapter.extend({
  coalesceFindRequests: true,

  host: "",
  modelWhitelist: [
    "basket",
    "basket-item",
    "category",
    "country",
    "order",
    "order-line",
    "order-payment-method",
    "payment",
    "payment-method",
    "price",
    "product-category",
    "product-image",
    "product",
    "promotion",
    "shop-payment-method",
    "state",
    "sku-image",
    "sku"
  ],

  pathForType(type) {
    if (this.modelWhitelist.includes(type)) {
      return this._super(...arguments);
    }
    return "entries";
  },

  /**
   @override
   */
  findAll(store, type, sinceToken) {
    let modelName = type.modelName;

    if (this.modelWhitelist.includes(type.modelName)) {
      return this._super(...arguments);
    }

    let query = {
      content_group_api_identifier: camelize(modelName)
    };

    const url = this.buildURL(modelName, null, null, "findAll");

    if (sinceToken) {
      query.since = sinceToken;
    }

    if (this.sortQueryParams) {
      query = this.sortQueryParams(query);
    }
    return this.ajax(url, "GET", { data: { filter: query } });
  },

  // /**
  //  @override
  //  */
  query(store, type, query) {
    let modelName = type.modelName;

    if (this.modelWhitelist.includes(type.modelName)) {
      return this._super(...arguments);
    }

    query.filter = assign({}, query.filter, {
      content_group_api_identifier: camelize(modelName)
    });

    if (this.sortQueryParams) {
      query = this.sortQueryParams(query);
    }

    let url = this.buildURL(modelName, null, null, "query", query);

    return this.ajax(url, "GET", { data: query });
  },

{'fraction_non_alphanumeric': 0.15645161290322582, 'fraction_numerical': 0.0, 'mean_word_length': 2.7892057026476578, 'pattern_counts': {'":': 0, '<': 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': '2454618', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1215, 'n_words': 232}