UNPKG

arlas-api

Version:

ARLAS Api.

907 lines 530 kB
/// <reference path="./custom.d.ts" /> // tslint:disable /** * ARLAS Exploration API * Explore the content of ARLAS collections * * OpenAPI spec version: 23.0.8-security.2 * Contact: contact@gisaia.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ 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 __()); }; })(); import * as url from "url"; import * as portableFetch from "portable-fetch"; var BASE_PATH = "http://localhost/arlas".replace(/\/+$/, ""); /** * * @export */ export var COLLECTION_FORMATS = { csv: ",", ssv: " ", tsv: "\t", pipes: "|", }; /** * * @export * @class BaseAPI */ var BaseAPI = (function () { function BaseAPI(configuration, basePath, fetch) { if (basePath === void 0) { basePath = BASE_PATH; } if (fetch === void 0) { fetch = portableFetch; } this.basePath = basePath; this.fetch = fetch; if (configuration) { this.configuration = configuration; this.basePath = configuration.basePath || this.basePath; } } return BaseAPI; }()); export { BaseAPI }; ; /** * * @export * @class RequiredError * @extends {Error} */ var RequiredError = (function (_super) { __extends(RequiredError, _super); function RequiredError(field, msg) { var _this = _super.call(this, msg) || this; _this.field = field; return _this; } return RequiredError; }(Error)); export { RequiredError }; /** * @export * @namespace Aggregation */ export var Aggregation; (function (Aggregation) { /** * @export * @enum {string} */ var TypeEnum; (function (TypeEnum) { TypeEnum[TypeEnum["Datehistogram"] = 'datehistogram'] = "Datehistogram"; TypeEnum[TypeEnum["Geohash"] = 'geohash'] = "Geohash"; TypeEnum[TypeEnum["Geotile"] = 'geotile'] = "Geotile"; TypeEnum[TypeEnum["Histogram"] = 'histogram'] = "Histogram"; TypeEnum[TypeEnum["Term"] = 'term'] = "Term"; TypeEnum[TypeEnum["H3"] = 'h3'] = "H3"; })(TypeEnum = Aggregation.TypeEnum || (Aggregation.TypeEnum = {})); /** * @export * @enum {string} */ var OrderEnum; (function (OrderEnum) { OrderEnum[OrderEnum["Asc"] = 'asc'] = "Asc"; OrderEnum[OrderEnum["Desc"] = 'desc'] = "Desc"; })(OrderEnum = Aggregation.OrderEnum || (Aggregation.OrderEnum = {})); /** * @export * @enum {string} */ var OnEnum; (function (OnEnum) { OnEnum[OnEnum["Field"] = 'field'] = "Field"; OnEnum[OnEnum["Count"] = 'count'] = "Count"; OnEnum[OnEnum["Result"] = 'result'] = "Result"; })(OnEnum = Aggregation.OnEnum || (Aggregation.OnEnum = {})); /** * @export * @enum {string} */ var AggregatedGeometriesEnum; (function (AggregatedGeometriesEnum) { AggregatedGeometriesEnum[AggregatedGeometriesEnum["BBOX"] = 'BBOX'] = "BBOX"; AggregatedGeometriesEnum[AggregatedGeometriesEnum["CENTROID"] = 'CENTROID'] = "CENTROID"; AggregatedGeometriesEnum[AggregatedGeometriesEnum["CELL"] = 'CELL'] = "CELL"; AggregatedGeometriesEnum[AggregatedGeometriesEnum["CELLCENTER"] = 'CELLCENTER'] = "CELLCENTER"; AggregatedGeometriesEnum[AggregatedGeometriesEnum["GEOHASH"] = 'GEOHASH'] = "GEOHASH"; AggregatedGeometriesEnum[AggregatedGeometriesEnum["GEOHASHCENTER"] = 'GEOHASH_CENTER'] = "GEOHASHCENTER"; })(AggregatedGeometriesEnum = Aggregation.AggregatedGeometriesEnum || (Aggregation.AggregatedGeometriesEnum = {})); })(Aggregation || (Aggregation = {})); /** * @export * @namespace CollectionReferenceDescriptionProperty */ export var CollectionReferenceDescriptionProperty; (function (CollectionReferenceDescriptionProperty) { /** * @export * @enum {string} */ var TypeEnum; (function (TypeEnum) { TypeEnum[TypeEnum["TEXT"] = 'TEXT'] = "TEXT"; TypeEnum[TypeEnum["KEYWORD"] = 'KEYWORD'] = "KEYWORD"; TypeEnum[TypeEnum["LONG"] = 'LONG'] = "LONG"; TypeEnum[TypeEnum["INTEGER"] = 'INTEGER'] = "INTEGER"; TypeEnum[TypeEnum["SHORT"] = 'SHORT'] = "SHORT"; TypeEnum[TypeEnum["BYTE"] = 'BYTE'] = "BYTE"; TypeEnum[TypeEnum["DOUBLE"] = 'DOUBLE'] = "DOUBLE"; TypeEnum[TypeEnum["FLOAT"] = 'FLOAT'] = "FLOAT"; TypeEnum[TypeEnum["DATE"] = 'DATE'] = "DATE"; TypeEnum[TypeEnum["BOOLEAN"] = 'BOOLEAN'] = "BOOLEAN"; TypeEnum[TypeEnum["BINARY"] = 'BINARY'] = "BINARY"; TypeEnum[TypeEnum["INTRANGE"] = 'INT_RANGE'] = "INTRANGE"; TypeEnum[TypeEnum["FLOATRANGE"] = 'FLOAT_RANGE'] = "FLOATRANGE"; TypeEnum[TypeEnum["LONGRANGE"] = 'LONG_RANGE'] = "LONGRANGE"; TypeEnum[TypeEnum["DOUBLERANGE"] = 'DOUBLE_RANGE'] = "DOUBLERANGE"; TypeEnum[TypeEnum["DATERANGE"] = 'DATE_RANGE'] = "DATERANGE"; TypeEnum[TypeEnum["OBJECT"] = 'OBJECT'] = "OBJECT"; TypeEnum[TypeEnum["NESTED"] = 'NESTED'] = "NESTED"; TypeEnum[TypeEnum["GEOPOINT"] = 'GEO_POINT'] = "GEOPOINT"; TypeEnum[TypeEnum["GEOSHAPE"] = 'GEO_SHAPE'] = "GEOSHAPE"; TypeEnum[TypeEnum["IP"] = 'IP'] = "IP"; TypeEnum[TypeEnum["COMPLETION"] = 'COMPLETION'] = "COMPLETION"; TypeEnum[TypeEnum["TOKENCOUNT"] = 'TOKEN_COUNT'] = "TOKENCOUNT"; TypeEnum[TypeEnum["MAPPERMURMUR3"] = 'MAPPER_MURMUR3'] = "MAPPERMURMUR3"; TypeEnum[TypeEnum["UNKNOWN"] = 'UNKNOWN'] = "UNKNOWN"; TypeEnum[TypeEnum["VARCHAR"] = 'VARCHAR'] = "VARCHAR"; TypeEnum[TypeEnum["CHAR"] = 'CHAR'] = "CHAR"; TypeEnum[TypeEnum["CHARACTER"] = 'CHARACTER'] = "CHARACTER"; TypeEnum[TypeEnum["BIT"] = 'BIT'] = "BIT"; TypeEnum[TypeEnum["TINYINT"] = 'TINYINT'] = "TINYINT"; TypeEnum[TypeEnum["SMALLINT"] = 'SMALLINT'] = "SMALLINT"; TypeEnum[TypeEnum["INT"] = 'INT'] = "INT"; TypeEnum[TypeEnum["BIGINT"] = 'BIGINT'] = "BIGINT"; TypeEnum[TypeEnum["DECIMAL"] = 'DECIMAL'] = "DECIMAL"; TypeEnum[TypeEnum["NUMERIC"] = 'NUMERIC'] = "NUMERIC"; TypeEnum[TypeEnum["REAL"] = 'REAL'] = "REAL"; TypeEnum[TypeEnum["DOUBLEPRECISION"] = 'DOUBLEPRECISION'] = "DOUBLEPRECISION"; TypeEnum[TypeEnum["TIMESTAMP"] = 'TIMESTAMP'] = "TIMESTAMP"; TypeEnum[TypeEnum["TIME"] = 'TIME'] = "TIME"; TypeEnum[TypeEnum["INTERVAL"] = 'INTERVAL'] = "INTERVAL"; TypeEnum[TypeEnum["GEOMETRY"] = 'GEOMETRY'] = "GEOMETRY"; TypeEnum[TypeEnum["GEOGRAPHY"] = 'GEOGRAPHY'] = "GEOGRAPHY"; TypeEnum[TypeEnum["POINT"] = 'POINT'] = "POINT"; TypeEnum[TypeEnum["LINESTRING"] = 'LINESTRING'] = "LINESTRING"; TypeEnum[TypeEnum["POLYGON"] = 'POLYGON'] = "POLYGON"; TypeEnum[TypeEnum["MULTIPOINT"] = 'MULTIPOINT'] = "MULTIPOINT"; TypeEnum[TypeEnum["MULTILINESTRING"] = 'MULTILINESTRING'] = "MULTILINESTRING"; TypeEnum[TypeEnum["MULTIPOLYGON"] = 'MULTIPOLYGON'] = "MULTIPOLYGON"; TypeEnum[TypeEnum["GEOMETRYCOLLECTION"] = 'GEOMETRYCOLLECTION'] = "GEOMETRYCOLLECTION"; TypeEnum[TypeEnum["MURMUR3"] = 'MURMUR3'] = "MURMUR3"; })(TypeEnum = CollectionReferenceDescriptionProperty.TypeEnum || (CollectionReferenceDescriptionProperty.TypeEnum = {})); })(CollectionReferenceDescriptionProperty || (CollectionReferenceDescriptionProperty = {})); /** * @export * @namespace ComputationRequest */ export var ComputationRequest; (function (ComputationRequest) { /** * @export * @enum {string} */ var MetricEnum; (function (MetricEnum) { MetricEnum[MetricEnum["AVG"] = 'AVG'] = "AVG"; MetricEnum[MetricEnum["MAX"] = 'MAX'] = "MAX"; MetricEnum[MetricEnum["MIN"] = 'MIN'] = "MIN"; MetricEnum[MetricEnum["SUM"] = 'SUM'] = "SUM"; MetricEnum[MetricEnum["CARDINALITY"] = 'CARDINALITY'] = "CARDINALITY"; MetricEnum[MetricEnum["SPANNING"] = 'SPANNING'] = "SPANNING"; MetricEnum[MetricEnum["GEOBBOX"] = 'GEOBBOX'] = "GEOBBOX"; MetricEnum[MetricEnum["GEOCENTROID"] = 'GEOCENTROID'] = "GEOCENTROID"; })(MetricEnum = ComputationRequest.MetricEnum || (ComputationRequest.MetricEnum = {})); })(ComputationRequest || (ComputationRequest = {})); /** * @export * @namespace ComputationResponse */ export var ComputationResponse; (function (ComputationResponse) { /** * @export * @enum {string} */ var MetricEnum; (function (MetricEnum) { MetricEnum[MetricEnum["AVG"] = 'AVG'] = "AVG"; MetricEnum[MetricEnum["MAX"] = 'MAX'] = "MAX"; MetricEnum[MetricEnum["MIN"] = 'MIN'] = "MIN"; MetricEnum[MetricEnum["SUM"] = 'SUM'] = "SUM"; MetricEnum[MetricEnum["CARDINALITY"] = 'CARDINALITY'] = "CARDINALITY"; MetricEnum[MetricEnum["SPANNING"] = 'SPANNING'] = "SPANNING"; MetricEnum[MetricEnum["GEOBBOX"] = 'GEOBBOX'] = "GEOBBOX"; MetricEnum[MetricEnum["GEOCENTROID"] = 'GEOCENTROID'] = "GEOCENTROID"; })(MetricEnum = ComputationResponse.MetricEnum || (ComputationResponse.MetricEnum = {})); })(ComputationResponse || (ComputationResponse = {})); /** * @export * @namespace Crs */ export var Crs; (function (Crs) { /** * @export * @enum {string} */ var TypeEnum; (function (TypeEnum) { TypeEnum[TypeEnum["Name"] = 'name'] = "Name"; TypeEnum[TypeEnum["Link"] = 'link'] = "Link"; })(TypeEnum = Crs.TypeEnum || (Crs.TypeEnum = {})); })(Crs || (Crs = {})); /** * @export * @namespace Expression */ export var Expression; (function (Expression) { /** * @export * @enum {string} */ var OpEnum; (function (OpEnum) { OpEnum[OpEnum["Eq"] = 'eq'] = "Eq"; OpEnum[OpEnum["Gte"] = 'gte'] = "Gte"; OpEnum[OpEnum["Gt"] = 'gt'] = "Gt"; OpEnum[OpEnum["Lte"] = 'lte'] = "Lte"; OpEnum[OpEnum["Lt"] = 'lt'] = "Lt"; OpEnum[OpEnum["Like"] = 'like'] = "Like"; OpEnum[OpEnum["Ne"] = 'ne'] = "Ne"; OpEnum[OpEnum["Range"] = 'range'] = "Range"; OpEnum[OpEnum["Within"] = 'within'] = "Within"; OpEnum[OpEnum["Notwithin"] = 'notwithin'] = "Notwithin"; OpEnum[OpEnum["Intersects"] = 'intersects'] = "Intersects"; OpEnum[OpEnum["Notintersects"] = 'notintersects'] = "Notintersects"; })(OpEnum = Expression.OpEnum || (Expression.OpEnum = {})); })(Expression || (Expression = {})); /** * @export * @namespace Interval */ export var Interval; (function (Interval) { /** * @export * @enum {string} */ var UnitEnum; (function (UnitEnum) { UnitEnum[UnitEnum["Year"] = 'year'] = "Year"; UnitEnum[UnitEnum["Quarter"] = 'quarter'] = "Quarter"; UnitEnum[UnitEnum["Month"] = 'month'] = "Month"; UnitEnum[UnitEnum["Week"] = 'week'] = "Week"; UnitEnum[UnitEnum["Day"] = 'day'] = "Day"; UnitEnum[UnitEnum["Hour"] = 'hour'] = "Hour"; UnitEnum[UnitEnum["Minute"] = 'minute'] = "Minute"; UnitEnum[UnitEnum["Second"] = 'second'] = "Second"; })(UnitEnum = Interval.UnitEnum || (Interval.UnitEnum = {})); })(Interval || (Interval = {})); /** * @export * @namespace Metric */ export var Metric; (function (Metric) { /** * @export * @enum {string} */ var CollectFctEnum; (function (CollectFctEnum) { CollectFctEnum[CollectFctEnum["AVG"] = 'AVG'] = "AVG"; CollectFctEnum[CollectFctEnum["CARDINALITY"] = 'CARDINALITY'] = "CARDINALITY"; CollectFctEnum[CollectFctEnum["MAX"] = 'MAX'] = "MAX"; CollectFctEnum[CollectFctEnum["MIN"] = 'MIN'] = "MIN"; CollectFctEnum[CollectFctEnum["SUM"] = 'SUM'] = "SUM"; CollectFctEnum[CollectFctEnum["GEOCENTROID"] = 'GEOCENTROID'] = "GEOCENTROID"; CollectFctEnum[CollectFctEnum["GEOBBOX"] = 'GEOBBOX'] = "GEOBBOX"; })(CollectFctEnum = Metric.CollectFctEnum || (Metric.CollectFctEnum = {})); })(Metric || (Metric = {})); /** * CollectionsApi - fetch parameter creator * @export */ export var CollectionsApiFetchParamCreator = function (configuration) { return { /** * Delete a collection reference in ARLAS * @summary Delete a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: function (collection, pretty, options) { if (options === void 0) { options = {}; } // verify required parameter 'collection' is not null or undefined if (collection === null || collection === undefined) { throw new RequiredError('collection', 'Required parameter collection was null or undefined when calling _delete.'); } var localVarPath = "/collections/{collection}" .replace("{" + "collection" + "}", encodeURIComponent(String(collection))); var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get all collection references in ARLAS as json file * @summary Get all collection references as a json file * @param {*} [options] Override http request option. * @throws {RequiredError} */ exportCollections: function (options) { if (options === void 0) { options = {}; } var localVarPath = "/collections/_export"; var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'GET' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get a collection reference in ARLAS * @summary Get a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ get: function (collection, pretty, options) { if (options === void 0) { options = {}; } // verify required parameter 'collection' is not null or undefined if (collection === null || collection === undefined) { throw new RequiredError('collection', 'Required parameter collection was null or undefined when calling get.'); } var localVarPath = "/collections/{collection}" .replace("{" + "collection" + "}", encodeURIComponent(String(collection))); var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'GET' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get all collection references in ARLAS * @summary Get all collection references * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: function (pretty, options) { if (options === void 0) { options = {}; } var localVarPath = "/collections"; var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'GET' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Add collection references in ARLAS from a json file * @summary Add collection references from a json file * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ importCollections: function (file, options) { if (options === void 0) { options = {}; } var localVarPath = "/collections/_import"; var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'POST' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; var localVarFormParams = new url.URLSearchParams(); if (file !== undefined) { localVarFormParams.set('file', file); } localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); localVarRequestOptions.body = localVarFormParams.toString(); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Add a collection reference in ARLAS * @summary Add a collection reference * @param {string} collection collection * @param {CollectionReferenceParameters} collection_params collectionParams * @param {boolean} [pretty] Pretty print * @param {boolean} [checkfields] * @param {*} [options] Override http request option. * @throws {RequiredError} */ put: function (collection, collection_params, pretty, checkfields, options) { if (options === void 0) { options = {}; } // verify required parameter 'collection' is not null or undefined if (collection === null || collection === undefined) { throw new RequiredError('collection', 'Required parameter collection was null or undefined when calling put.'); } // verify required parameter 'collection_params' is not null or undefined if (collection_params === null || collection_params === undefined) { throw new RequiredError('collection_params', 'Required parameter collection_params was null or undefined when calling put.'); } var localVarPath = "/collections/{collection}" .replace("{" + "collection" + "}", encodeURIComponent(String(collection))); var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'PUT' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } if (checkfields !== undefined) { localVarQueryParameter['checkfields'] = checkfields; } localVarHeaderParameter['Content-Type'] = 'application/json;charset=utf-8'; localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); var needsSerialization = ("CollectionReferenceParameters" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.body = needsSerialization ? JSON.stringify(collection_params || {}) : (collection_params || ""); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CollectionsApi - functional programming interface * @export */ export var CollectionsApiFp = function (configuration) { return { /** * Delete a collection reference in ARLAS * @summary Delete a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: function (collection, pretty, options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration)._delete(collection, pretty, options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, /** * Get all collection references in ARLAS as json file * @summary Get all collection references as a json file * @param {*} [options] Override http request option. * @throws {RequiredError} */ exportCollections: function (options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration).exportCollections(options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, /** * Get a collection reference in ARLAS * @summary Get a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ get: function (collection, pretty, options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration).get(collection, pretty, options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, /** * Get all collection references in ARLAS * @summary Get all collection references * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: function (pretty, options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration).getAll(pretty, options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, /** * Add collection references in ARLAS from a json file * @summary Add collection references from a json file * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ importCollections: function (file, options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration).importCollections(file, options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, /** * Add a collection reference in ARLAS * @summary Add a collection reference * @param {string} collection collection * @param {CollectionReferenceParameters} collection_params collectionParams * @param {boolean} [pretty] Pretty print * @param {boolean} [checkfields] * @param {*} [options] Override http request option. * @throws {RequiredError} */ put: function (collection, collection_params, pretty, checkfields, options) { var localVarFetchArgs = CollectionsApiFetchParamCreator(configuration).put(collection, collection_params, pretty, checkfields, options); return function (fetch, basePath) { if (fetch === void 0) { fetch = portableFetch; } if (basePath === void 0) { basePath = BASE_PATH; } return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { if (response.status >= 200 && response.status < 300) { return response.json(); } else { throw response; } }); }; }, }; }; /** * CollectionsApi - factory interface * @export */ export var CollectionsApiFactory = function (configuration, fetch, basePath) { return { /** * Delete a collection reference in ARLAS * @summary Delete a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: function (collection, pretty, options) { return CollectionsApiFp(configuration)._delete(collection, pretty, options)(fetch, basePath); }, /** * Get all collection references in ARLAS as json file * @summary Get all collection references as a json file * @param {*} [options] Override http request option. * @throws {RequiredError} */ exportCollections: function (options) { return CollectionsApiFp(configuration).exportCollections(options)(fetch, basePath); }, /** * Get a collection reference in ARLAS * @summary Get a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ get: function (collection, pretty, options) { return CollectionsApiFp(configuration).get(collection, pretty, options)(fetch, basePath); }, /** * Get all collection references in ARLAS * @summary Get all collection references * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: function (pretty, options) { return CollectionsApiFp(configuration).getAll(pretty, options)(fetch, basePath); }, /** * Add collection references in ARLAS from a json file * @summary Add collection references from a json file * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} */ importCollections: function (file, options) { return CollectionsApiFp(configuration).importCollections(file, options)(fetch, basePath); }, /** * Add a collection reference in ARLAS * @summary Add a collection reference * @param {string} collection collection * @param {CollectionReferenceParameters} collection_params collectionParams * @param {boolean} [pretty] Pretty print * @param {boolean} [checkfields] * @param {*} [options] Override http request option. * @throws {RequiredError} */ put: function (collection, collection_params, pretty, checkfields, options) { return CollectionsApiFp(configuration).put(collection, collection_params, pretty, checkfields, options)(fetch, basePath); }, }; }; /** * CollectionsApi - object-oriented interface * @export * @class CollectionsApi * @extends {BaseAPI} */ var CollectionsApi = (function (_super) { __extends(CollectionsApi, _super); function CollectionsApi() { return _super !== null && _super.apply(this, arguments) || this; } /** * Delete a collection reference in ARLAS * @summary Delete a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype._delete = function (collection, pretty, options) { return CollectionsApiFp(this.configuration)._delete(collection, pretty, options)(this.fetch, this.basePath); }; /** * Get all collection references in ARLAS as json file * @summary Get all collection references as a json file * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype.exportCollections = function (options) { return CollectionsApiFp(this.configuration).exportCollections(options)(this.fetch, this.basePath); }; /** * Get a collection reference in ARLAS * @summary Get a collection reference * @param {string} collection collection * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype.get = function (collection, pretty, options) { return CollectionsApiFp(this.configuration).get(collection, pretty, options)(this.fetch, this.basePath); }; /** * Get all collection references in ARLAS * @summary Get all collection references * @param {boolean} [pretty] Pretty print * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype.getAll = function (pretty, options) { return CollectionsApiFp(this.configuration).getAll(pretty, options)(this.fetch, this.basePath); }; /** * Add collection references in ARLAS from a json file * @summary Add collection references from a json file * @param {any} [file] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype.importCollections = function (file, options) { return CollectionsApiFp(this.configuration).importCollections(file, options)(this.fetch, this.basePath); }; /** * Add a collection reference in ARLAS * @summary Add a collection reference * @param {string} collection collection * @param {CollectionReferenceParameters} collection_params collectionParams * @param {boolean} [pretty] Pretty print * @param {boolean} [checkfields] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CollectionsApi */ CollectionsApi.prototype.put = function (collection, collection_params, pretty, checkfields, options) { return CollectionsApiFp(this.configuration).put(collection, collection_params, pretty, checkfields, options)(this.fetch, this.basePath); }; return CollectionsApi; }(BaseAPI)); export { CollectionsApi }; /** * ExploreApi - fetch parameter creator * @export */ export var ExploreApiFetchParamCreator = function (configuration) { return { /** * Aggregate the elements in the collection(s), given the filters and the aggregation parameters * @summary Aggregate * @param {string} collection collection * @param {Array<string>} agg - The agg parameter should be given in the following formats: {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:fetch_hits-{fetch_hits values} Where : - **{type}:{field}** part is mandatory. - **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash. - **format** is optional for datehistogram, and must not be specified for the other types. - (**collect_field**,**collect_fct**) couple is optional for all aggregation types. - It&#39;s possible to apply multiple metric aggregations by defining multiple (**collect_field**,**collect_fct**) couples. - (**collect_field**,**collect_fct**) couples should be unique in that case. - (**order**,**on**) couple is optional for all aggregation types. - **size** is optional for term and geohash/geotile, and must not be specified for the other types. - **include** is optional for term, and must not be specified for the other types. - {type} possible values are : datehistogram, histogram, geohash, geotile and term. - {interval} possible values depends on {type}. If {type} &#x3D; datehistogram, then {interval} &#x3D; {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities. If {type} &#x3D; histogram, then {interval} &#x3D; {size}. If {type} &#x3D; geohash, then {interval} &#x3D; {size}. It&#39;s an integer between 1 and 12. Lower the length, greater is the surface of aggregation. If {type} &#x3D; geotile, then {interval} &#x3D; {size}. It&#39;s an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6. If {type} &#x3D; term, then interval-{interval} is not needed. - format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss. - {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}. {collect_fct} possible values are : avg,cardinality,max,min,sum - {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are &#39;asc&#39; or &#39;desc&#39;. - {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are &#39;field&#39;, &#39;count&#39; or &#39;result&#39;. - If {on} is equal to &#x60;result&#x60; and two or more (**collect_field**,**collect_fct**) couples are specified, then the order is applied on the first &#x60;collect_fct&#x60; that is different from geobbox and geocentroid - {size} Defines how many buckets should be returned. - {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created. - **aggregated_geometries** &gt; **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket. &gt; __**Syntax**__: &#x60;aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}&#x60;. &gt; __**Available aggregated geometries**__: &#x60;centroid, bbox, cell, cell_center&#x60;. - **centroid**: returns the centroid of data inside the bucket. - **bbox**: returns the data extent (bbox) in each bucket. - **cell**: returns the cell extent (zxy or geohash) of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. &gt; __**Response**__: the aggregated geometries are returned in &#x60;geometries&#x60; list in the json response. Each object inside this list has : the reference to the aggregated form, the geojson geometry and an attribute &#x60;is_raw&#x60; set to false &gt; __**Example**__: &#x60;aggregated_geometries-bbox,cell&#x60; - **raw_geometries** &gt; **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort &gt; __**Syntax**__: &#x60;raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})&#x60;. &gt; __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**. - sort fields are optional. If no sort is specified, an ascending sort on &#x60;collection.params.timestamp_path&#x60; is applied - a sort field can be preceded by &#39;-&#39; for descending sort. Otherwise the sort is ascending &gt; __**Response**__: the aggregated geometries are returned in &#x60;geometries&#x60; list in the json response. Each object inside this list has : the reference to the geometry path, the used sort, the geojson geometry and an attribute &#x60;is_raw&#x60; set to true &gt; __**Example**__: &#x60;raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)&#x60; || raw_geometries-geo_field1(field1);geo_field2(field2,field3) - **fetch_hits** &gt; **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits. &gt; __**Syntax**__: &#x60;fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)&#x60;. &gt; **Note 1**: &#x60;{sizeOfHitsToFetch}&#x60; is optional, if not specified, 1 is considered as default. &gt; **Note 2**: &#x60;{field}&#x60; can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters. &gt; __**Example**__: &#x60;fetch_hits-3(-timestamp, geometry)&#x60;. Fetches the 3 last positions for each bucket. **agg** parameter is multiple. Every agg parameter specified is a subaggregation of the previous one : order matters. For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md. * @param {Array<string>} [f] - A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. - A triplet is composed of a field name, a comparison operator and a value. The possible values of the comparison operator are : Operator -- Description -- value type :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings :like: -- {fieldName} is like {value} -- numeric or strings :gte: -- {fieldName} is greater than or equal to {value} -- numeric :gt: -- {fieldName} is greater than {value} -- numeric :lte: -- {fieldName} is less than or equal to {value} -- numeric :lt: -- {fieldName} is less than {value} -- numeric :range: -- {fieldName} is between &#x60;{comma separated [min&lt;max] values}&#x60;. **OR** operation is applied for the specified ranges -- numeric or strings. If the field&#39;s type is date, then min &amp; max should be timestamps in millisecond or a Date expression :within: -- {GeofieldName}&#x60; is within the &#x60;{given WKT string or the given BBOX }&#x60; -- a WKT string or the BBOX string : &#x60;\&quot;west, south, east, north\&quot;&#x60; :notwithin: -- {GeofieldName} is not within the &#x60;{given WKT string or the given BBOX }&#x60; -- a WKT string or the BBOX string : &#x60;\&quot;west, south, east, north\&quot;&#x60; :intersects: -- {GeofieldName} intersects the &#x60;{given WKT string or the given BBOX }&#x60; | a WKT string or the BBOX string : &#x60;\&quot;west, south, east, north\&quot;&#x60; :notintersects: -- {GeofieldName} does not intersect the &#x60;{given WKT string or the given }&#x60; -- a WKT string or the BBOX string : &#x60;\&quot;west, south, east, north\&quot;&#x60; * @param {Array<string>} [q] A full text search. Optionally, it&#39;s possible to search on a field using this syntax: {fieldname}:{text} * @param {string} [dateformat] The format of dates. This parameter should be set only if a date field is queried in &#x60;f&#x60; param; when using &#x60;gt&#x60;, &#x60;lt&#x60;, &#x60;gte&#x60;, &#x60;lte&#x60; and &#x60;range&#x60; operations * @param {boolean} [righthand] If righthand &#x3D; true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the \&quot;Complementary\&quot; Polygon on the other facet of the planet. Inversely, If righthand &#x3D; false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the \&quot;Complementary\&quot; Polygon on the other facet of the planet. * @param {boolean} [pretty] Pretty print * @param {boolean} [flat] Flats the property map: only key/value on one level * @param {number} [max_age_cache] max-age-cache * @param {*} [options] Override http request option. * @throws {RequiredError} */ aggregate: function (collection, agg, f, q, dateformat, righthand, pretty, flat, max_age_cache, options) { if (options === void 0) { options = {}; } // verify required parameter 'collection' is not null or undefined if (collection === null || collection === undefined) { throw new RequiredError('collection', 'Required parameter collection was null or undefined when calling aggregate.'); } // verify required parameter 'agg' is not null or undefined if (agg === null || agg === undefined) { throw new RequiredError('agg', 'Required parameter agg was null or undefined when calling aggregate.'); } var localVarPath = "/explore/{collection}/_aggregate" .replace("{" + "collection" + "}", encodeURIComponent(String(collection))); var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'GET' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (agg) { localVarQueryParameter['agg'] = agg; } if (f) { localVarQueryParameter['f'] = f; } if (q) { localVarQueryParameter['q'] = q; } if (dateformat !== undefined) { localVarQueryParameter['dateformat'] = dateformat; } if (righthand !== undefined) { localVarQueryParameter['righthand'] = righthand; } if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } if (flat !== undefined) { localVarQueryParameter['flat'] = flat; } if (max_age_cache !== undefined) { localVarQueryParameter['max-age-cache'] = max_age_cache; } localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { url: url.format(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Aggregate the elements in the collection(s), given the filters and the aggregation parameters * @summary Aggregate * @param {string} collection collection * @param {AggregationsRequest} [body] * @param {boolean} [pretty] Pretty print * @param {number} [max_age_cache] max-age-cache * @param {*} [options] Override http request option. * @throws {RequiredError} */ aggregatePost: function (collection, body, pretty, max_age_cache, options) { if (options === void 0) { options = {}; } // verify required parameter 'collection' is not null or undefined if (collection === null || collection === undefined) { throw new RequiredError('collection', 'Required parameter collection was null or undefined when calling aggregatePost.'); } var localVarPath = "/explore/{collection}/_aggregate" .replace("{" + "collection" + "}", encodeURIComponent(String(collection))); var localVarUrlObj = url.parse(localVarPath, true); var localVarRequestOptions = Object.assign({ method: 'POST' }, options); var localVarHeaderParameter = {}; var localVarQueryParameter = {}; if (pretty !== undefined) { localVarQueryParameter['pretty'] = pretty; } if (max_age_cache !== undefined) { localVa