Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
778 changes: 372 additions & 406 deletions dist/apisearch.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apisearch.js.map

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions dist/apisearch.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apisearch.min.js.map

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions lib/Apisearch.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
exports.__esModule = true;
var tslib_1 = require("tslib");
var NoCache_1 = require("./Cache/NoCache");
var AxiosClient_1 = require("./Http/AxiosClient");
var RetryMap_1 = require("./Http/RetryMap");
Expand All @@ -34,7 +27,7 @@ var Apisearch = /** @class */ (function () {
*/
Apisearch.createRepository = function (config) {
Apisearch.ensureRepositoryConfigIsValid(config);
config.options = __assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);
config.options = tslib_1.__assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);
/**
* Client
*/
Expand Down
11 changes: 2 additions & 9 deletions lib/Cache/InMemoryCache.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
exports.__esModule = true;
var tslib_1 = require("tslib");
/**
* Cache class
*/
Expand All @@ -31,7 +24,7 @@ var InMemoryCache = /** @class */ (function () {
*/
InMemoryCache.prototype.set = function (key, value) {
var _a;
this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));
this.cache = tslib_1.__assign({}, this.cache, (_a = {}, _a[key] = value, _a));
this.size = this.size + 1;
};
/**
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/ConnectionError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Connection error
*/
var ConnectionError = /** @class */ (function (_super) {
__extends(ConnectionError, _super);
tslib_1.__extends(ConnectionError, _super);
function ConnectionError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/EventError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* EventError
*/
var EventError = /** @class */ (function (_super) {
__extends(EventError, _super);
tslib_1.__extends(EventError, _super);
function EventError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/ForbiddenError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Forbidden Error
*/
var ForbiddenError = /** @class */ (function (_super) {
__extends(ForbiddenError, _super);
tslib_1.__extends(ForbiddenError, _super);
function ForbiddenError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/InvalidFormatError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Class InvalidFormatError
*/
var InvalidFormatError = /** @class */ (function (_super) {
__extends(InvalidFormatError, _super);
tslib_1.__extends(InvalidFormatError, _super);
function InvalidFormatError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/InvalidTokenError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Invalid token error
*/
var InvalidTokenError = /** @class */ (function (_super) {
__extends(InvalidTokenError, _super);
tslib_1.__extends(InvalidTokenError, _super);
function InvalidTokenError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/ResourceExistsError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Resource exists error
*/
var ResourceExistsError = /** @class */ (function (_super) {
__extends(ResourceExistsError, _super);
tslib_1.__extends(ResourceExistsError, _super);
function ResourceExistsError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/ResourceNotAvailableError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Resource not available error
*/
var ResourceNotAvailableError = /** @class */ (function (_super) {
__extends(ResourceNotAvailableError, _super);
tslib_1.__extends(ResourceNotAvailableError, _super);
function ResourceNotAvailableError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/Error/UnsupportedContentTypeError.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var ErrorWithMessage_1 = require("./ErrorWithMessage");
/**
* Unsupported content type error
*/
var UnsupportedContentTypeError = /** @class */ (function (_super) {
__extends(UnsupportedContentTypeError, _super);
tslib_1.__extends(UnsupportedContentTypeError, _super);
function UnsupportedContentTypeError() {
return _super !== null && _super.apply(this, arguments) || this;
}
Expand Down
17 changes: 4 additions & 13 deletions lib/Geo/LocationRange.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var tslib_1 = require("tslib");
var Coordinate_1 = require("../Model/Coordinate");
/**
* Abstract Location Range class
Expand Down Expand Up @@ -59,7 +50,7 @@ exports.LocationRange = LocationRange;
* CoordinateAndDistance
*/
var CoordinateAndDistance = /** @class */ (function (_super) {
__extends(CoordinateAndDistance, _super);
tslib_1.__extends(CoordinateAndDistance, _super);
/**
* Constructor
*
Expand Down Expand Up @@ -108,7 +99,7 @@ exports.CoordinateAndDistance = CoordinateAndDistance;
* Polygon
*/
var Polygon = /** @class */ (function (_super) {
__extends(Polygon, _super);
tslib_1.__extends(Polygon, _super);
/**
* Constructor
*
Expand Down Expand Up @@ -165,7 +156,7 @@ exports.Polygon = Polygon;
* Square
*/
var Square = /** @class */ (function (_super) {
__extends(Square, _super);
tslib_1.__extends(Square, _super);
/**
* Constructor
*
Expand Down
62 changes: 5 additions & 57 deletions lib/Http/AxiosClient.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,14 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
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;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
exports.__esModule = true;
var tslib_1 = require("tslib");
var axios_1 = require("axios");
var Client_1 = require("./Client");
var Response_1 = require("./Response");
/**
* AxiosClient
*/
var AxiosClient = /** @class */ (function (_super) {
__extends(AxiosClient, _super);
tslib_1.__extends(AxiosClient, _super);
/**
* Constructor
*
Expand Down Expand Up @@ -94,10 +42,10 @@ var AxiosClient = /** @class */ (function (_super) {
AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {
if (parameters === void 0) { parameters = {}; }
if (data === void 0) { data = {}; }
return __awaiter(this, void 0, void 0, function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var that;
var _this = this;
return __generator(this, function (_a) {
return tslib_1.__generator(this, function (_a) {
that = this;
url = url.replace(/^\/*|\/*$/g, "");
url = "/" + (this.version + "/" + url).replace(/^\/*|\/*$/g, "");
Expand All @@ -116,7 +64,7 @@ var AxiosClient = /** @class */ (function (_super) {
//noinspection TypeScriptValidateTypes
axios_1["default"]
.request({
url: url + "?" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),
url: url + "?" + Client_1.Client.objectToUrlParameters(tslib_1.__assign({}, credentials, parameters)),
data: data,
headers: headers,
method: method,
Expand Down
Loading