Skip to content

Commit d01429f

Browse files
authored
flush() has been updated (#17)
* all calls are done in parallel, in order to improve the performance
1 parent 6ad9f0d commit d01429f

33 files changed

+724
-905
lines changed

dist/apisearch.js

Lines changed: 372 additions & 406 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: 17 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.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
"use strict";
2-
var __assign = (this && this.__assign) || Object.assign || function(t) {
3-
for (var s, i = 1, n = arguments.length; i < n; i++) {
4-
s = arguments[i];
5-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6-
t[p] = s[p];
7-
}
8-
return t;
9-
};
102
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
114
var NoCache_1 = require("./Cache/NoCache");
125
var AxiosClient_1 = require("./Http/AxiosClient");
136
var RetryMap_1 = require("./Http/RetryMap");
@@ -34,7 +27,7 @@ var Apisearch = /** @class */ (function () {
3427
*/
3528
Apisearch.createRepository = function (config) {
3629
Apisearch.ensureRepositoryConfigIsValid(config);
37-
config.options = __assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);
30+
config.options = tslib_1.__assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);
3831
/**
3932
* Client
4033
*/

lib/Cache/InMemoryCache.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
"use strict";
2-
var __assign = (this && this.__assign) || Object.assign || function(t) {
3-
for (var s, i = 1, n = arguments.length; i < n; i++) {
4-
s = arguments[i];
5-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6-
t[p] = s[p];
7-
}
8-
return t;
9-
};
102
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
114
/**
125
* Cache class
136
*/
@@ -31,7 +24,7 @@ var InMemoryCache = /** @class */ (function () {
3124
*/
3225
InMemoryCache.prototype.set = function (key, value) {
3326
var _a;
34-
this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));
27+
this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));
3528
this.size = this.size + 1;
3629
};
3730
/**

lib/Error/ConnectionError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Connection error
167
*/
178
var ConnectionError = /** @class */ (function (_super) {
18-
__extends(ConnectionError, _super);
9+
tslib_1.__extends(ConnectionError, _super);
1910
function ConnectionError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/EventError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* EventError
167
*/
178
var EventError = /** @class */ (function (_super) {
18-
__extends(EventError, _super);
9+
tslib_1.__extends(EventError, _super);
1910
function EventError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/ForbiddenError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Forbidden Error
167
*/
178
var ForbiddenError = /** @class */ (function (_super) {
18-
__extends(ForbiddenError, _super);
9+
tslib_1.__extends(ForbiddenError, _super);
1910
function ForbiddenError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/InvalidFormatError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Class InvalidFormatError
167
*/
178
var InvalidFormatError = /** @class */ (function (_super) {
18-
__extends(InvalidFormatError, _super);
9+
tslib_1.__extends(InvalidFormatError, _super);
1910
function InvalidFormatError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/InvalidTokenError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Invalid token error
167
*/
178
var InvalidTokenError = /** @class */ (function (_super) {
18-
__extends(InvalidTokenError, _super);
9+
tslib_1.__extends(InvalidTokenError, _super);
1910
function InvalidTokenError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/ResourceExistsError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Resource exists error
167
*/
178
var ResourceExistsError = /** @class */ (function (_super) {
18-
__extends(ResourceExistsError, _super);
9+
tslib_1.__extends(ResourceExistsError, _super);
1910
function ResourceExistsError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/ResourceNotAvailableError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Resource not available error
167
*/
178
var ResourceNotAvailableError = /** @class */ (function (_super) {
18-
__extends(ResourceNotAvailableError, _super);
9+
tslib_1.__extends(ResourceNotAvailableError, _super);
1910
function ResourceNotAvailableError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Error/UnsupportedContentTypeError.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var ErrorWithMessage_1 = require("./ErrorWithMessage");
145
/**
156
* Unsupported content type error
167
*/
178
var UnsupportedContentTypeError = /** @class */ (function (_super) {
18-
__extends(UnsupportedContentTypeError, _super);
9+
tslib_1.__extends(UnsupportedContentTypeError, _super);
1910
function UnsupportedContentTypeError() {
2011
return _super !== null && _super.apply(this, arguments) || this;
2112
}

lib/Geo/LocationRange.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
122
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
134
var Coordinate_1 = require("../Model/Coordinate");
145
/**
156
* Abstract Location Range class
@@ -59,7 +50,7 @@ exports.LocationRange = LocationRange;
5950
* CoordinateAndDistance
6051
*/
6152
var CoordinateAndDistance = /** @class */ (function (_super) {
62-
__extends(CoordinateAndDistance, _super);
53+
tslib_1.__extends(CoordinateAndDistance, _super);
6354
/**
6455
* Constructor
6556
*
@@ -108,7 +99,7 @@ exports.CoordinateAndDistance = CoordinateAndDistance;
10899
* Polygon
109100
*/
110101
var Polygon = /** @class */ (function (_super) {
111-
__extends(Polygon, _super);
102+
tslib_1.__extends(Polygon, _super);
112103
/**
113104
* Constructor
114105
*
@@ -165,7 +156,7 @@ exports.Polygon = Polygon;
165156
* Square
166157
*/
167158
var Square = /** @class */ (function (_super) {
168-
__extends(Square, _super);
159+
tslib_1.__extends(Square, _super);
169160
/**
170161
* Constructor
171162
*

lib/Http/AxiosClient.js

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,14 @@
11
"use strict";
2-
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6-
return function (d, b) {
7-
extendStatics(d, b);
8-
function __() { this.constructor = d; }
9-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10-
};
11-
})();
12-
var __assign = (this && this.__assign) || Object.assign || function(t) {
13-
for (var s, i = 1, n = arguments.length; i < n; i++) {
14-
s = arguments[i];
15-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
16-
t[p] = s[p];
17-
}
18-
return t;
19-
};
20-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
21-
return new (P || (P = Promise))(function (resolve, reject) {
22-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
23-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
24-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
25-
step((generator = generator.apply(thisArg, _arguments || [])).next());
26-
});
27-
};
28-
var __generator = (this && this.__generator) || function (thisArg, body) {
29-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
30-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
31-
function verb(n) { return function (v) { return step([n, v]); }; }
32-
function step(op) {
33-
if (f) throw new TypeError("Generator is already executing.");
34-
while (_) try {
35-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
36-
if (y = 0, t) op = [op[0] & 2, t.value];
37-
switch (op[0]) {
38-
case 0: case 1: t = op; break;
39-
case 4: _.label++; return { value: op[1], done: false };
40-
case 5: _.label++; y = op[1]; op = [0]; continue;
41-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
42-
default:
43-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
44-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
45-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
46-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
47-
if (t[2]) _.ops.pop();
48-
_.trys.pop(); continue;
49-
}
50-
op = body.call(thisArg, _);
51-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
52-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
53-
}
54-
};
552
exports.__esModule = true;
3+
var tslib_1 = require("tslib");
564
var axios_1 = require("axios");
575
var Client_1 = require("./Client");
586
var Response_1 = require("./Response");
597
/**
608
* AxiosClient
619
*/
6210
var AxiosClient = /** @class */ (function (_super) {
63-
__extends(AxiosClient, _super);
11+
tslib_1.__extends(AxiosClient, _super);
6412
/**
6513
* Constructor
6614
*
@@ -94,10 +42,10 @@ var AxiosClient = /** @class */ (function (_super) {
9442
AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {
9543
if (parameters === void 0) { parameters = {}; }
9644
if (data === void 0) { data = {}; }
97-
return __awaiter(this, void 0, void 0, function () {
45+
return tslib_1.__awaiter(this, void 0, void 0, function () {
9846
var that;
9947
var _this = this;
100-
return __generator(this, function (_a) {
48+
return tslib_1.__generator(this, function (_a) {
10149
that = this;
10250
url = url.replace(/^\/*|\/*$/g, "");
10351
url = "/" + (this.version + "/" + url).replace(/^\/*|\/*$/g, "");
@@ -116,7 +64,7 @@ var AxiosClient = /** @class */ (function (_super) {
11664
//noinspection TypeScriptValidateTypes
11765
axios_1["default"]
11866
.request({
119-
url: url + "?" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),
67+
url: url + "?" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),
12068
data: data,
12169
headers: headers,
12270
method: method,

0 commit comments

Comments
 (0)