How to use @here/olp-sdk-dataservice-read - 10 common examples

To help you get started, we’ve selected a few @here/olp-sdk-dataservice-read examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async getRequestBuilder(
        builderType: ApiName,
        abortSignal?: AbortSignal
    ): Promise {
        return RequestFactory.create(
            builderType,
            this.apiVersion,
            this.settings,
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(err =>
            Promise.reject(
                `Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
            )
        );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getRequestBuilder(
        builderType: ApiName,
        abortSignal?: AbortSignal
    ): Promise {
        return RequestFactory.create(
            builderType,
            this.apiVersion,
            this.settings,
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(err =>
            Promise.reject(
                `Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
            )
        );
    }
github heremaps / harp.gl / @here / harp-olp-utils / lib / OlpCopyrightProvider.ts View on Github external
async getCopyrightCoverageData(): Promise {
        if (this.m_cachedCopyrightResponse !== undefined) {
            return this.m_cachedCopyrightResponse;
        }

        const hrn = HRN.fromString(this.m_params.hrn);
        const context = new DataStoreContext({
            getToken: this.m_params.getToken,
            environment: hrn.data.partition
        });
        const catalogClient = new CatalogClient({
            context,
            hrn: this.m_params.hrn
        });

        this.m_cachedCopyrightResponse = catalogClient
            .getVolatileOrVersionedLayer(this.m_params.layer || DEFAULT_LAYER)
            .then()
            .then(layer => layer.getPartition(this.m_params.partition || DEFAULT_PARTITION))
            .then(response => response.json())
            .then(json => json[this.m_params.baseScheme || "normal"])
            .catch(error => {
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getRequestBuilder(
        builderType: ApiName,
        abortSignal?: AbortSignal
    ): Promise {
        return RequestFactory.create(
            builderType,
            this.apiVersion,
            this.settings,
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(err =>
            Promise.reject(
                `Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
            )
        );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async getRequestBuilder(
        builderType: ApiName,
        abortSignal?: AbortSignal
    ): Promise {
        return RequestFactory.create(
            builderType,
            this.apiVersion,
            this.settings,
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(err =>
            Promise.reject(
                `Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
            )
        );
    }
github heremaps / harp.gl / @here / harp-olp-utils / lib / OlpCopyrightProvider.ts View on Github external
async getCopyrightCoverageData(): Promise {
        if (this.m_cachedCopyrightResponse !== undefined) {
            return this.m_cachedCopyrightResponse;
        }

        const hrn = HRN.fromString(this.m_params.hrn);
        const context = new DataStoreContext({
            getToken: this.m_params.getToken,
            environment: hrn.data.partition
        });
        const catalogClient = new CatalogClient({
            context,
            hrn: this.m_params.hrn
        });

        this.m_cachedCopyrightResponse = catalogClient
            .getVolatileOrVersionedLayer(this.m_params.layer || DEFAULT_LAYER)
            .then()
            .then(layer => layer.getPartition(this.m_params.partition || DEFAULT_PARTITION))
            .then(response => response.json())
            .then(json => json[this.m_params.baseScheme || "normal"])
            .catch(error => {
                this.logger.error(error);
                return [];
            });

        return this.m_cachedCopyrightResponse;
github heremaps / harp.gl / @here / harp-olp-utils / lib / OlpCopyrightProvider.ts View on Github external
async getCopyrightCoverageData(): Promise {
        if (this.m_cachedCopyrightResponse !== undefined) {
            return this.m_cachedCopyrightResponse;
        }

        const hrn = HRN.fromString(this.m_params.hrn);
        const context = new DataStoreContext({
            getToken: this.m_params.getToken,
            environment: hrn.data.partition
        });
        const catalogClient = new CatalogClient({
            context,
            hrn: this.m_params.hrn
        });

        this.m_cachedCopyrightResponse = catalogClient
            .getVolatileOrVersionedLayer(this.m_params.layer || DEFAULT_LAYER)
            .then()
            .then(layer => layer.getPartition(this.m_params.partition || DEFAULT_PARTITION))
            .then(response => response.json())
            .then(json => json[this.m_params.baseScheme || "normal"])
            .catch(error => {
                this.logger.error(error);
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / DataStoreContext.ts View on Github external
constructor(params: DataStoreContextParams) {
        this.lookUpUrl = getEnvLookUpUrl(params.environment);
        this.getToken = params.getToken;
        this.dm = params.dm || new DataStoreDownloadManager();
        this.environment = params.environment;
        this.requestBuilder = new DataStoreRequestBuilder(
            this.dm,
            this.lookUpUrl,
            this.getToken
        );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / DataStoreContext.ts View on Github external
constructor(params: DataStoreContextParams) {
        this.lookUpUrl = getEnvLookUpUrl(params.environment);
        this.getToken = params.getToken;
        this.dm = params.dm || new DataStoreDownloadManager();
        this.environment = params.environment;
        this.requestBuilder = new DataStoreRequestBuilder(
            this.dm,
            this.lookUpUrl,
            this.getToken
        );
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VolatileLayerClient.ts View on Github external
private async errorHandler(error: any) {
        return Promise.reject(
            new ErrorHTTPResponse(
                `Statistics Service error: HTTP ${
                    error.status
                }, ${error.statusText || error.cause || ""}` +
                    `\n${error.action || ""}`,
                error
            )
        );
    }

@here/olp-sdk-dataservice-read

Wrapper around a subset of the HERE Open Location Platform Data REST API related to reading data from OLP catalogs

Apache-2.0
Latest version published 13 days ago

Package Health Score

69 / 100
Full package analysis

Similar packages