npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@here/olp-sdk-dataservice-read

v2.0.0

Published

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

Downloads

697

Readme

DataService Access Library

Overview

This repository contains the complete source code for the HERE Data SDK for TypeScript Dataservice Read @here/olp-sdk-dataservice-read project. olp-sdk-dataservice-read is a TypeScript library that will fetch request Layer and Partition data from the HERE platform catalogs.

Directory Layout

Here is an overview of the top-level files of the repository:

|
+- @here/olp-sdk-dataservice-read
                    |
                    +- lib    # Implementation of the project
                    |
                    +- test   # Test code

Development

Prerequisites

The following NPM packages are required to build/test the library:

- node: >= 10.0.0
- npm: >= 6.0.0

Build

Open a command prompt of the working tree's root directory and type:

npm install
npm run build

Test

Open a command prompt of the working tree's root directory and type:

npm run test

Generate a Bundle

If you want to have a compiled project, you can use bundle commands. After running each of the following commands in the @here/olp-sdk-dataservice-read folder from the root folder, you get the JavaScript bundled files.

To get bundled files with a source map, run:

npm run bundle

To get minified version for production, run:

npm run bundle:prod

To get bundled and minified JavaScript files, run:

npm run prepublish-bundle

Use a Bundle from CDN

Add minified JavaScript files to your html and create an object of userAuth and catalogClient:

<!DOCTYPE html>
<html lang="en">
    <head>
        <script src="https://unpkg.com/@here/olp-sdk-fetch/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-authentication/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-dataservice-api/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-dataservice-read/bundle.umd.min.js"></script>
    </head>
    <body>
        <script>
            /**
             * Authentication with olp-sdk-authentication
             */
            const userAuth = new UserAuth({
                env: "here",
                credentials: {
                    accessKeyId: "your-access-key",
                    accessKeySecret: "your-access-secret"
                },
                tokenRequester: requestToken
            });
            /**
             * Create the `OlpClientSettings` object
             */
            const olpClientSettings = new OlpClientSettings({
                environment:
                "here | here-dev | here-cn | here-cn-dev | http://YourCustomEnvironment",
                getToken: () => userAuth.getToken()
            });
            /**
             * Create client to the volatile layer with VolatileLayerClientParams
             */
            const volatileLayerClient = new VolatileLayerClient({
                    catalogHrn: "CatalogHRN",
                    layerId: "LayerId",
                    settings: olpClientSettings
            });
            /**
             * Gets some data from the layer by ID
             */
            const request = new DataRequest().withPartitionId("your-partition-id");
            volatileLayerClient
                .getData(request)
                .then(response => {
                    response.blob().then(blob => {
                        // your blob here
                    });
                });
        </script>
    </body>
</html>

LICENSE

Copyright (C) 2019-2023 HERE Europe B.V.

For license details, see the LICENSE.