Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit 6f90bb4

Browse files
authored
Merge pull request #51 from rubenpenyafiel/feature/remove-unused-cache
Remove unused KeyValueCache.
2 parents dae8cb7 + c278b3e commit 6f90bb4

17 files changed

+15
-346
lines changed

dist/apisearch.js

Lines changed: 4 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/apisearch.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Apisearch.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { KeyValueCache } from "./Cache/KeyValueCache";
21
import { HttpClient } from "./Http/HttpClient";
32
import { Coordinate } from "./Model/Coordinate";
43
import { ItemUUID } from "./Model/ItemUUID";
@@ -26,7 +25,6 @@ export default class Apisearch {
2625
api_version?: string;
2726
timeout?: number;
2827
override_queries?: boolean;
29-
cache?: KeyValueCache;
3028
http_client?: HttpClient;
3129
};
3230
}): HttpRepository;

lib/Apisearch.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use strict";
22
exports.__esModule = true;
33
var tslib_1 = require("tslib");
4-
var NoCache_1 = require("./Cache/NoCache");
54
var AxiosClient_1 = require("./Http/AxiosClient");
65
var RetryMap_1 = require("./Http/RetryMap");
76
var Query_1 = require("./Query/Query");
@@ -27,13 +26,13 @@ var Apisearch = /** @class */ (function () {
2726
*/
2827
Apisearch.createRepository = function (config) {
2928
Apisearch.ensureRepositoryConfigIsValid(config);
30-
config.options = tslib_1.__assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);
29+
config.options = tslib_1.__assign({ api_version: "v1", override_queries: true, timeout: 5000 }, config.options);
3130
/**
3231
* Client
3332
*/
3433
var httpClient = typeof config.options.http_client !== "undefined"
3534
? config.options.http_client
36-
: new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);
35+
: new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries);
3736
return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());
3837
};
3938
/**
@@ -125,7 +124,7 @@ var Apisearch = /** @class */ (function () {
125124
* @return {Result}
126125
*/
127126
Apisearch.createEmptyResult = function () {
128-
return Result_1.Result.create('', 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);
127+
return Result_1.Result.create("", 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);
129128
};
130129
/**
131130
* Create empty sortby

lib/Http/AxiosClient.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { KeyValueCache } from "../Cache/KeyValueCache";
21
import { Client } from "./Client";
32
import { HttpClient } from "./HttpClient";
43
import { Response } from "./Response";
@@ -8,7 +7,6 @@ import { RetryMap } from "./RetryMap";
87
*/
98
export declare class AxiosClient extends Client implements HttpClient {
109
private host;
11-
private cache;
1210
private timeout;
1311
private overrideQueries;
1412
private cancelToken;
@@ -20,9 +18,8 @@ export declare class AxiosClient extends Client implements HttpClient {
2018
* @param timeout
2119
* @param retryMap
2220
* @param overrideQueries
23-
* @param cache
2421
*/
25-
constructor(host: string, version: string, timeout: number, retryMap: RetryMap, overrideQueries: boolean, cache: KeyValueCache);
22+
constructor(host: string, version: string, timeout: number, retryMap: RetryMap, overrideQueries: boolean);
2623
/**
2724
* Get
2825
*

lib/Http/AxiosClient.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ var AxiosClient = /** @class */ (function (_super) {
1818
* @param timeout
1919
* @param retryMap
2020
* @param overrideQueries
21-
* @param cache
2221
*/
23-
function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {
22+
function AxiosClient(host, version, timeout, retryMap, overrideQueries) {
2423
var _this = _super.call(this, version, retryMap) || this;
2524
_this.host = host;
2625
_this.timeout = timeout;
27-
_this.cache = cache;
2826
_this.overrideQueries = overrideQueries;
2927
_this.cancelToken = {};
3028
return _this;

lib/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import Apisearch from "./Apisearch";
22
export default Apisearch;
3-
export * from "./Cache/InMemoryCache";
4-
export * from "./Cache/KeyValueCache";
53
export * from "./Config/Config";
64
export * from "./Config/Synonym";
75
export * from "./Error/ConnectionError";

lib/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ exports.__esModule = true;
33
var tslib_1 = require("tslib");
44
var Apisearch_1 = require("./Apisearch");
55
exports["default"] = Apisearch_1["default"];
6-
tslib_1.__exportStar(require("./Cache/InMemoryCache"), exports);
76
tslib_1.__exportStar(require("./Config/Config"), exports);
87
tslib_1.__exportStar(require("./Config/Synonym"), exports);
98
tslib_1.__exportStar(require("./Error/ConnectionError"), exports);

0 commit comments

Comments
 (0)