Skip to content
RPDE Validator library, used as a component of validator.openactive.io
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec
src
.babelrc
.editorconfig
.eslintignore
.eslintrc.json
.gitignore
.npmignore
.nvmrc
.travis.yml
LICENSE
README.md
package-lock.json
package.json

README.md

RPDE Validator

The OpenActive RPDE validator library.

Build Status Known Vulnerabilities

Introduction

This library allows developers to validate RPDE feeds against the latest Realtime Paged Data Exchange specification.

Using in your application

This library can be used in your own application, perhaps as part of your CI pipeline.

Install

$ npm install @openactive/rpde-validator

Usage

import { RpdeValidator } from '@openactive/rpde-validator';

RpdeValidator(
  url, // The URL of the feed to test
  {
    // A callback that is called for log messages
    // Will be provided with an object that looks like:
    // {
    //   verbosity: 1, // 1-3 (higher is more verbose)
    //   percentage: 50, // The percentage complete
    //   message: '...', // String log message
    // }
    logCallback: (log) => {
      console.log(log.message);
    },
    // User agent used by the validator
    // Default: "RPDE_Validator/version (+https://validator.openactive.io/rpde)"
    userAgent: null, 
    // The time in between requests in a feed in milliseconds
    // Default: 0
    requestDelayMs: 1000,
    // The timeout in which to give up on requesting a feed URL
    // Must be non-zero
    // Default: 10000
    timeoutMs: 10000,
    // The number of feed pages to walk through
    // Must be non-zero
    // Default: 20
    pageLimit: 10,
  }
);

Development

Getting started

$ git clone git@github.com:openactive/rpde-validator.git
$ cd rpde-validator
$ npm install

Running tests

This project uses Jasmine for its tests. All spec files are located alongside the files that they target.

To run tests locally, run:

$ npm test

The test run will also include a run of eslint. To run the tests without these, use:

$ npm run test-no-lint
You can’t perform that action at this time.