From a11608a60f7289465f5c7dac1de6d6cb1e1a66a7 Mon Sep 17 00:00:00 2001 From: Craig Kochis Date: Fri, 7 Dec 2018 14:37:53 -0500 Subject: [PATCH] Fix missing PLACES_PROVIDER field. Add VERSION field. --- package.json | 2 +- src/index.js | 14 +++++++++----- src/places_providers.js | 4 ++++ src/version.js | 2 +- test/index.test.js | 13 +++++++++++++ 5 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/places_providers.js diff --git a/package.json b/package.json index 89bf4274..ce052912 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Web JavaScript SDK for Radar, the location platform for mobile apps", "homepage": "https://radar.io", "license": "Apache-2.0", - "version": "1.0.0-beta4", + "version": "1.0.0-beta5", "main": "dist/index.js", "module": "src/index.js", "files": [ diff --git a/src/index.js b/src/index.js index 0838c59d..a1360fe3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,17 +1,21 @@ import * as Cookie from './cookie'; import * as Device from './device'; import * as Http from './http'; +import PLACES_PROVIDER from './places_providers'; import SDK_VERSION from './version'; import STATUS from './status_codes'; const DEFAULT_HOST = 'https://api.radar.io'; -const PLACES_PROVIDER = { - FACEBOOK: 'facebook', - NONE: 'none' -}; - class Radar { + static get VERSION() { + return SDK_VERSION; + } + + static get PLACES_PROVIDER() { + return PLACES_PROVIDER; + } + static initialize(publishableKey) { if (!publishableKey) { console.error('Radar "initialize" was called without a publishable key'); diff --git a/src/places_providers.js b/src/places_providers.js new file mode 100644 index 00000000..a18926a3 --- /dev/null +++ b/src/places_providers.js @@ -0,0 +1,4 @@ +export default { + FACEBOOK: 'facebook', + NONE: 'none' +}; diff --git a/src/version.js b/src/version.js index 98bb6159..9d5fbce9 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -export default '1.0.0-beta4'; +export default '1.0.0-beta5'; diff --git a/test/index.test.js b/test/index.test.js index 55434d7c..cfefe9bb 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -9,6 +9,7 @@ import * as Cookie from '../src/cookie'; import * as Device from '../src/device'; import * as Http from '../src/http'; import Radar from '../src/index'; +import PLACES_PROVIDER from '../src/places_providers'; import SDK_VERSION from '../src/version'; import STATUS from '../src/status_codes'; @@ -27,6 +28,18 @@ describe('Radar', () => { Cookie.setCookie.restore(); }); + describe('VERSION', () => { + it('should return sdk version', () => { + expect(Radar.VERSION).to.eq(SDK_VERSION); + }); + }); + + describe('PLACES_PROVIDER', () => { + it('should return places providers object', () => { + expect(Radar.PLACES_PROVIDER).to.eql(PLACES_PROVIDER); + }); + }); + describe('initialize', () => { context('no publishable key given', () => { before(() => {