1.0.10 • Published 4 years ago

covid-travel-store v1.0.10

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

MIT license

Covid Travel Store

Open source store mechanism to store and retrieve travel statuses to a given database. WIP

To read from the DB:

Import the npm library npm i covid-travel-ban

Run start() with the StatusReader and StatusWriter

start(statusWriter: StatusWriter, statusReader: StatusReader)
export interface StatusWriter {
  store(status: TravelStatus): Promise<void>;
}

export interface StatusReader {
  readAll(): Promise<TravelStatus[]>;

  read(country: string): Promise<TravelStatus | null>;
}

You can then hit the endpoints to read

GET travel status curl -X GET https://yourHostedServer.com/status

GET travel status by country curl -X GET https://yourHostedServer.com/status/{country}

Updates to the data require auth, so please contact me for access.

POST travel status curl -X POST https://yourHostedServer.com/status -H 'authorization: Basic %{encodedCredentials}'

POST travel-bans by country curl -X POST https://yourHostedServer.com/status/{country} -H 'authorization: Basic %{encodedCredentials}'

NB a 'travel-ban' is designed for a specific format (still under development) and doesn't conform to the travelStatuses elsewhere. It is restructured duruing the storage process.

For contributors:

See main README main repo to contribute - this contains both the API and UI projects, but a single run script currently controls both.

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago