Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ccbeb4d
simplified npm scripts via cross-env
Jul 28, 2016
d67a5d5
Updated dependencies and amended tests in response
Jul 28, 2016
2c2d6fe
Adds ESLint and tweaked Standard config, adapts source to satisfy rules
Jul 29, 2016
f89dba3
Transitions to es2015
Jul 30, 2016
7c1980e
Added method and test for finding event images
Jul 30, 2016
6e12687
All files now converted to ES6
Aug 1, 2016
6c7f501
initial foray
Aug 1, 2016
0d5398b
stripped out weightier elements like Bluebird
Aug 1, 2016
d9f48b4
updated deps
oliverturner Aug 1, 2016
b7a0372
Fixed promise issues
oliverturner Aug 2, 2016
37b8be2
Added todos
oliverturner Aug 2, 2016
1172b4f
Moar tests and a more full-featured demo
Aug 2, 2016
dad0502
Tweaked demo
Aug 2, 2016
7501dd4
Added polyfill for Object.assign
oliverturner Aug 2, 2016
4aab865
Removed babel and webpack lodash plugins
oliverturner Aug 2, 2016
e496088
Added user safeguard
oliverturner Aug 2, 2016
5edbbf3
Removed support for 0.10.0
oliverturner Aug 2, 2016
1b8fcb8
Updated deps
Aug 4, 2016
273cafb
Ensuring that deps are exact matches
Aug 4, 2016
37dd519
Added safeguards - linting and tests - automatically on pre-commit
Aug 4, 2016
a5270a0
Added current stable version of Node to travis suite
Aug 4, 2016
89c7db9
Adds compilation for distinct targets
Aug 4, 2016
fdf1338
Minor clean-up to npm scripts
Aug 4, 2016
2609bf8
Fixed erroneous 'main' definition in packge.json
oliverturner Aug 4, 2016
04eb06b
moved Mocha args into test/mocha.opts
oliverturner Aug 4, 2016
b593917
Deduplicated utils
Aug 5, 2016
896a906
Minor tweaks
Aug 5, 2016
922eaf1
Moar tests and refactored layout
Aug 5, 2016
8903c65
Migrated v1 to new layout
Aug 5, 2016
41acf39
waypoint
Aug 5, 2016
b8b4501
Better README
oliverturner Aug 6, 2016
4f0d56c
More consistent examples in README and links to docs
oliverturner Aug 7, 2016
bd55349
Reordered docs
oliverturner Aug 7, 2016
02e2303
--amend
oliverturner Aug 7, 2016
81b9d6b
Added CONTRIBUTING.md
Aug 8, 2016
b65cbbb
Updated deps
Aug 8, 2016
47aaa0d
Grudgingly re-adding semis so as not to make the PR too cray
Aug 8, 2016
4184ed2
Resolving merge conflicts
Aug 8, 2016
4c3180a
Renamed tmapi as ticketmaster, updated deps
oliverturner Aug 27, 2016
1d0e205
merging changes from upstream
oliverturner Aug 27, 2016
a3700a4
Merge remote-tracking branch 'upstream/master'
oliverturner Aug 27, 2016
dd4b8b8
folding in updates from having renamed lib correctly...
oliverturner Aug 27, 2016
8f4069e
Bumped package version to 2.0.0
oliverturner Aug 27, 2016
23cdabe
Small improvements to docs
oliverturner Aug 27, 2016
f0dcf70
Fixed docs example
oliverturner Aug 27, 2016
b93397c
More improvements to docs
oliverturner Aug 27, 2016
cf02472
Merging upstream changes
Aug 30, 2016
c8af7a3
Added dynamic docs generation to keep file references in sync across …
Aug 31, 2016
de44ebf
amends to docs example
Aug 31, 2016
eaffaa7
amends to docs example
Aug 31, 2016
394e4c4
Downgraded to webpack@1.x
Aug 31, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"compact": "true",
"presets": ["es2015"],
"plugins": ["transform-object-assign"],
"env": {
"test": {
"plugins": ["rewire"]
},
"production": {
"plugins": ["add-module-exports"]
}
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"extends": "standard",
"rules": {
"semi": [2, "always"],
"space-before-function-paren": [2, "never"]
"space-before-function-paren": [2, "never"],
"key-spacing": ["error", {"align": "value"}]
},
"globals": {
"it": true,
"should": true,
"describe": true,
"before": true,
"after": true,
"__Rewire__": true,
"__ResetDependency__": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
npm-debug.log
.tmp/
dist/
docs/web/*
coverage/
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing

## Rebuild source:

In case you want to build your own bundle for client

1. Clone this repository

```bash
git clone git@github.com:ticketmaster-api/sdk-javascript.git
```

1. install dependencies

```bash
npm install
```

1. Run npm script:

```bash
npm run build
```

## Running Tests

```bash
npm test
```

## Contact Us

[internal only] Find us in #open-platform on Ticketmaster Slack!
47 changes: 47 additions & 0 deletions config/docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
display: flex;
align-content: center;
}
p {
margin: auto;
padding: 10px;
border: 1px solid grey;
border-radius: 5px;
text-align: center;
}
</style>
</head>
<body>
<p>Logging to console...</p>
<script>
(function (ticketmaster) {
var sdk = ticketmaster('YOUR_API_KEY');

function logNextPage (page) {
console.group('page: ' + page.page.number);
page.items.map(console.log);
console.groupEnd();

return page.getNext()
}

if (sdk) {
sdk.discovery.v1.attraction.all({page: 4, size: 5, city: 'London'})
.then(logNextPage)
.then(logNextPage)
.then(logNextPage)
.catch(function (e) {
console.log(e)
})
}
})(window.ticketmaster)
</script>
</body>
</html>
14 changes: 7 additions & 7 deletions config/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ function getFilename(suffix) {
}

const settings = (options) => ({
entry: './lib/index.js',
entry: './lib/index.js',
output: Object.assign({}, {
filename: `node/${pkg.name}.js`,
library: pkg.name,
filename: `node/${pkg.name}.js`,
library: pkg.name,
libraryTarget: 'umd',
path: path.resolve(process.cwd(), 'dist')
path: path.resolve(process.cwd(), 'dist')
}, options.output),
devtool: options.devtool,
module: {
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
test: /\.js$/,
loader: 'babel',
include: path.join(process.cwd(), 'lib')
}
]
Expand Down
15 changes: 15 additions & 0 deletions config/webpack/webpack.config.dev.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import webpack from 'webpack';

import {settings, getFilename} from './config';

const config = settings({
output: {
filename: 'web/' + getFilename('.js')
},
devtool: 'source-map',
plugins: [
new webpack.NoErrorsPlugin()
]
});

export default config;
34 changes: 34 additions & 0 deletions config/webpack/webpack.config.prod.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import {version} from '../../package.json';
import {settings, getFilename} from './config';

const config = settings({
devtool: false,

output: {
filename: 'web/' + getFilename('.min.js')
},

plugins: [
// Webpack2 specific :(
// new webpack.LoaderOptionsPlugin({
// minimize: true,
// debug: false
// }),
new webpack.optimize.UglifyJsPlugin({
compress: {warnings: false},
comments: false,
sourceMap: false
}),
new HtmlWebpackPlugin({
title: 'Ticketmaster SDK: ' + version,
filename: '../docs/web/index.html',
template: 'config/docs/index.html',
inject: 'head'
})
]
});

export default config;
23 changes: 0 additions & 23 deletions config/webpack/webpack.config.web.babel.js

This file was deleted.

35 changes: 0 additions & 35 deletions docs/index.html

This file was deleted.

17 changes: 17 additions & 0 deletions docs/node/es5/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var Event = require('../../../dist/node/discovery/v2').Event

function logNextPage(page) {
console.log(page.page.number, page.items.map(function(item) {
return item.name
}))

return page.getNext()
}

Event('YOUR_API_KEY').all({page: 4, size: 5, city: 'London'})
.then(logNextPage)
.then(logNextPage)
.then(logNextPage)
.catch(function(e) {
console.log(e)
})
4 changes: 2 additions & 2 deletions docs/test.js → docs/node/es5/sdk.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var tmapi = require('../dist/node');
var ticketmaster = require('../../../dist/node/index');

var sdk = tmapi('YOUR_KEY_HERE');
var sdk = ticketmaster('YOUR_API_KEY');

function logNextPage(page) {
console.log(page.page.number, page.items.map(function(item) {
Expand Down
13 changes: 13 additions & 0 deletions docs/node/es6/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Event} from '../../../dist/node/discovery/v2'

const logNextPage = (page) => {
console.log(page.page.number, page.items.map(({name}) => name))

return page.getNext()
}

Event('YOUR_API_KEY').all({page: 4, size: 5, city: 'London'})
.then(logNextPage)
.then(logNextPage)
.then(logNextPage)
.catch((e) => console.log(e))
17 changes: 17 additions & 0 deletions docs/node/es6/sdk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import ticketmaster from '../../../dist/node'

const sdk = ticketmaster('YOUR_API_KEY')

const logNextPage = (page) => {
console.log(page.page.number, page.items.map(({name}) => name))

return page.getNext()
}

if (sdk) {
sdk.discovery.v2.event.all({page: 4, size: 5, city: 'London'})
.then(logNextPage)
.then(logNextPage)
.then(logNextPage)
.catch((e) => console.log(e))
}
11 changes: 11 additions & 0 deletions lib/commerce/v2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import find from '../utils/find';

const api = 'commerce/v2';

export const Offer = (apikey) => ({
find: find(api, apikey, 'events', 'offers')
});

export default (apikey) => ({
offer: Offer(apikey)
});
7 changes: 0 additions & 7 deletions lib/commerce/v2/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/commerce/v2/offer.js

This file was deleted.

32 changes: 32 additions & 0 deletions lib/discovery/v1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import all from '../utils/all';
import find from '../utils/find';

export const api = 'discovery/v1';

export const Attraction = (apikey) => ({
all: all(api, apikey, 'attractions'),
find: find(api, apikey, 'attractions')
});

export const Category = (apikey) => ({
all: all(api, apikey, 'categories'),
find: find(api, apikey, 'categories')
});

export const Event = (apikey) => ({
all: all(api, apikey, 'events'),
find: find(api, apikey, 'events'),
findImages: find(api, apikey, 'events', 'images')
});

export const Venue = (apikey) => ({
all: all(api, apikey, 'venues'),
find: find(api, apikey, 'venues')
});

export default (apikey) => ({
attraction: Attraction(apikey),
category: Category(apikey),
event: Event(apikey),
venue: Venue(apikey)
});
9 changes: 0 additions & 9 deletions lib/discovery/v1/attraction.js

This file was deleted.

9 changes: 0 additions & 9 deletions lib/discovery/v1/category.js

This file was deleted.

Loading