import { Aggregation, AggregationResponse, CollectionReferenceDescription, Count, ExploreApi, FeatureCollection, Filter, Hits, Search, ComputationRequest, ComputationResponse } from 'arlas-api'; import { Observable, Subject } from 'rxjs'; import { CollectionCount } from '../utils/utils.js'; import { Collaboration, CollaborationEvent } from '../models/collaboration.js'; import { Contributor } from '../models/contributor.js'; import { GeohashAggregation, TiledSearch, projType, GeoTileAggregation } from '../models/projections.js'; import { ConfigService } from './config.service.js'; export declare class CollaborativesearchService { /** * Bus of CollaborationEvent. */ collaborationBus: Subject; /** * Bus of CollaborationEvent. */ contribFilterBus: Subject; /** * Registry of Collaborations, Map of contributor identifier,Collaboration. */ collaborations: Map; /** * Registry of Contributor, Map of contributor identifier,Contributor. */ registry: Map; /** * ARLAS SERVER collection used by default by the contributors. */ defaultCollection: string; /** ARLAS SERVER collections that declared in the contributos */ collections: Set; /** * ARLAS SERVER max age cache used by the collaborativesearchService. */ max_age: number; /** * Number of entity return by the collaborativesearchService at any time */ countAll: Observable; /** * Bus number of ongoing subscribe to the collaborativesearchService */ ongoingSubscribe: Subject; /** * Bus number of ongoing subscribe to the collaborativesearchService */ totalSubscribe: number; /** * Bus of Error. */ collaborationErrorBus: Subject; /** * ARLAS SERVER Explore Api used by the collaborativesearchService. */ private exploreApi; /** * Configuration Service used by the collaborativesearchService. */ private configService; /** * Configuration object of fetch call. By default all credentials are included. */ private fetchOptions; constructor(); /** * Return options used to fetch call. * @returns Object. */ getFetchOptions(): { credentials: string; signal?: any; responseType?: string; referrerPolicy?: string; }; /** * Set the fetch options. * @param fetchOptions : Object. */ setFetchOptions(fetchOptions: any): void; /** * Return the ARLAS Explore API. * @returns ExploreApi. */ getExploreApi(): ExploreApi; /** * Set the ARLAS Explore API. * @param api : ExploreApi. */ setExploreApi(exploreApi: ExploreApi): void; /** * Return the Configuraion Service. * @returns ConfigService. */ getConfigService(): ConfigService; /** * Set the Configuraion Service. * @param configService ConfigService. */ setConfigService(configService: ConfigService): void; /** * Register contributor with its identifier in the map contributor registry. */ register(identifier: string, contributor: Contributor): void; /** * Register collections of the given contributor in a collections registry. */ registerCollections(contributor: Contributor): void; /** * Adds the contributor's collaboration in the registry of collaborations. Notifies the collaborationBus of the changement. * If the given contributor is linked to another one, the linked contributor will be assigned the same collaboration. * The collaborationBus in this case doesn't need to be notified. * @param contributorId identifier of contributor. * @param collaboration collaboration added by the contributor. */ setFilter(contributorId: string, collaboration: Collaboration): void; /** * Removes the contributor's collaboration of the registry of collaborations. Notifies the collaborationBus of the removed collaboration. * If the given contributor is linked to another one, the linked contributor's collaboration will be removed as well. * The collaborationBus needs to be notified of this removal as well. * @param contributorId Sting identifier of contributor. * @param collaboration Collaboration added by the contributor. */ removeFilter(contributorId: string): void; /** * Remove all the collaborations filters, notify the collaborationBus of a all removing changement. */ removeAll(): void; dataModelBuilder(filter: string): Object; urlBuilder(): string; /** * Initialise all the contributors collaborations from dataModel. * @param dataModel */ setCollaborations(dataModel: Object): void; /** * Retrieve the collaboration from a contributor identifier. * @param contributorId Identifier of a contributor. * @returns Collaboration. */ getCollaboration(contributorId: string): Collaboration; /** * Resolve an ARLAS Server Search or Count request with all the collaborations enabled in the collaboration registry except for the contributor given in second optionnal parameter. * @param projection Type of projection of ARLAS Server request:Search or Count. * @param contributorId Identifier contributor to resolve the request without the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveButNotHits(projection: [ projType.search, Search ] | [projType.count, Count], collaborations: Map, collection: any, contributorId?: string, filter?: Filter, isFlat?: boolean, max_age?: number): Observable; /** * Resolve an ARLAS Server Search or Count request for an optional contributor and optional filters. * @param projection Type of projection of ARLAS Server request :Search or Count . * @param contributorId Identifier contributor to resolve the request with the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveHits(projection: [ projType.search, Search ] | [projType.count, Count], collaborations: Map, collection: any, contributorId?: string, filter?: Filter, isFlat?: boolean, max_age?: number): Observable; /** * Resolve an ARLAS Server Search or Count request for an array of filter. * @param projection Type of projection of ARLAS Server request :Search or Count . * @param filters ARLAS API filters to resolve the request with compute * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveComputeHits(projection: [ projType.search, Search ] | [projType.count, Count], filters: Array, collection: any, isFlat?: boolean, max_age?: number): Observable; /** * Resolve an ARLAS Server Geosearch or Geoaggregate request with all the collaborations enabled in the collaboration registry except for the contributor given in second optionnal parameter. * @param projection Type of projection of ARLAS Server request:Geosearch or Geoaggregate. * @param isFlat Boolean option to isFlat output geojson properties. * @param contributorId Identifier contributor to resolve the request without the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveButNotFeatureCollection(projection: [ projType.geosearch, Search ] | [projType.tiledgeosearch, TiledSearch] | [projType.geohashgeoaggregate, GeohashAggregation] | [projType.geotilegeoaggregate, GeoTileAggregation] | [projType.geoaggregate, Array], collaborations: Map, collection: any, isFlat?: boolean, contributorId?: string, filter?: Filter, max_age?: number): Observable; resolveButNotShapefile(projection: [ projType.shapeaggregate, Array ] | [projType.shapesearch, Search], collaborations: Map, collection: any, isFlat?: boolean, contributorId?: string, filter?: Filter, max_age?: number): Observable; resolveButNotFeatureCollectionWithAbort(projection: [ projType.geosearch, Search ] | [projType.tiledgeosearch, TiledSearch] | [projType.geohashgeoaggregate, GeohashAggregation] | [projType.geotilegeoaggregate, GeoTileAggregation] | [projType.geoaggregate, Array], collaborations: Map, collection: any, isFlat: boolean, abortableSignal: any, contributorId?: string, filter?: Filter, max_age?: number): Observable; /** * Resolve an ARLAS Server Geosearch or Geoaggregate request for an optional contributor and optional filters. * @param projection Type of projection of ARLAS Server request :Geosearch or Geoaggregate. * @param isFlat Boolean option to flat output geojson properties. * @param contributorId Identifier contributor to resolve the request with the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveFeatureCollection(projection: [ projType.geosearch, Search ] | [projType.tiledgeosearch, TiledSearch] | [projType.geohashgeoaggregate, GeohashAggregation] | [projType.geotilegeoaggregate, GeoTileAggregation] | [projType.geoaggregate, Array], isFlat: boolean, collaborations: Map, collection: any, contributorId?: string, filter?: Filter, max_age?: number): Observable; /** * Resolve an ARLAS Server Aggregation request with all the collaborations enabled in the collaboration registry except for the contributor given in second optionnal parameter. * @param projection Type of projection of ARLAS Server request:Aggregation. * @param contributorId Identifier contributor to resolve the request without the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveButNotAggregation(projection: [ projType.aggregate, Array ], collaborations: Map, collection: any, contributorId?: string, filter?: Filter, isFlat?: boolean, max_age?: number): Observable; /** * Resolve an ARLAS Server Aggregation request for an optional contributor and optional filters. * @param projection Type of projection of ARLAS Server request :Aggregation. * @param contributorId Identifier contributor to resolve the request with the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveAggregation(projection: [ projType.aggregate, Array ], collaborations: Map, collection: any, contributorId?: string, filter?: Filter, isFlat?: boolean, max_age?: number): Observable; /** * Resolve an ARLAS Server Computation request with all the collaborations enabled in the collaboration registry except for the contributor given in second optionnal parameter. * @param projection Type of projection of ARLAS Server request : ComputationRequest. * @param collaborations Map * @param contributorId Identifier contributor to resolve the request without the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Whether flatten json. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ resolveButNotComputation(projection: [ projType.compute, ComputationRequest ], collaborations: Map, collection: any, contributorId?: string, filter?: Filter, isFlat?: boolean, max_age?: number): Observable; /** * Enable a contributor collaboration from its identifier. */ enable(contributorId: string): void; /** * Disable a contributor collaboration from its identifier. */ disable(contributorId: string): void; /** * Retrieve all the contributor identifiers. * @returns List of contributor idenfiers. */ getAllContributors(): Array; /** * Retrieve the contributor identifiers for which the collaboration is enabled. * @returns List of contributor idenfiers. */ getEnableContributors(): Array; /** * Retrieve the contributor identifiers for which the collaboration is disabled. * @returns List of contributor idenfiers. */ getDisableContributors(): Array; /** * Retrieve enabled parameter of collaboration from a contributor identifier. * @returns Contributor collaboration enabled properties. */ isEnable(contributorId: string): boolean; /** * Update countAll property. */ setCountAll(collaborations: Map): void; /** * Build query parameters from aggregation and filters * @return Url encoded string */ getUrl(projection: [ projType.geoaggregate | projType.geosearch | projType.aggregate | projType.shapeaggregate | projType.shapesearch | projType.count | projType.geohashgeoaggregate | projType.geotilegeoaggregate | projType.search | projType.tiledgeosearch, Array ], filters: Array, max_age?: number): string; getFinalFilter(filters: Array): Filter; /** * Describe the structure and the content of the given collection. * @param collection collection name * @param pretty Whether pretty print or not * @param max_age Duration of browser cache.s */ describe(collection: string, pretty?: boolean, max_age?: number): Observable; /** * Lists the collections configured in ARLAS. * @param pretty Whether pretty print or not */ list(pretty?: boolean): Observable>; /** * Set enabled value of a collaboration from a contributor identifier. * If the given contributor is linked to another one, the linked contributor will have the same enabling value. * @param enabled Enabled collaboration value. * @param contributorId Contributor identifier. */ private setEnable; /** * Resolve an ARLAS Server request for an optional contributor and optional filters. * @param projection Type of projection of ARLAS Server request. * @param contributorId Identifier contributor to resolve the request with the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Boolean option to flat output geojson properties. * @returns ARLAS Server observable. */ private resolve; /** * Resolve an ARLAS Server request with all the collaborations enabled in the collaboration registry except for the contributor given in second optionnal parameter. * @param projection Type of projection of ARLAS Server request. * @param contributorId Identifier contributor to resolve the request without the collaboration of this contributor. * @param filter ARLAS API filter to resolve the request with this filter in addition. * @param isFlat Boolean option to flat output geojson properties. * @param max_age Duration of browser cache. * @returns ARLAS Server observable. */ private resolveButNot; /** * Build an ARLAS Server request from an Array of Filter * @param projection Type of projection of ARLAS Server request. * @param filters ARLAS API filters list to resolve the request. * @param isFlat Boolean option to flat output geojson properties. * @returns ARLAS Server observable. */ private computeResolve; /** * Build an AggregationsRequest String[] for get mode request * @param aggregationRequest AggregationsRequest arlas object use in post request. * @returns aggregations as string[]. */ private buildAggGetParam; /** * Build an filter String[] or string for get mode request * @param field * @param filter * @returns aggregations as string[]. */ private buildFilterFieldGetParam; }