Skip to content

Commit

Permalink
API v2.0.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitguigal committed Mar 7, 2017
1 parent c742521 commit f2f6b94
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 37 deletions.
3 changes: 3 additions & 0 deletions lib/figure.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ var resources = {
ImageVariables: require('./resources/ImageVariables.js'),
Portraits: require('./resources/Portraits.js'),
PosterOrders: require('./resources/PosterOrders'),
FigureGif: require('./resources/FigureGif'),
PlaceGifs: require('./resources/PlaceGifs'),
EventGifs: require('./resources/EventGifs'),
Users: require('./resources/Users.js'),
Analytics: require('./resources/Analytics.js'),
Auth: require('./resources/Auth.js')
Expand Down
20 changes: 3 additions & 17 deletions lib/resources/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,9 @@ module.exports = FigureResource.extend({

path: 'analytics',

portraitCount: figureMethod({
getReport: figureMethod({
method: 'GET',
path: '/portrait_count'
}),

posterCount: figureMethod({
method: 'GET',
path: '/poster_count'
}),

instagramSubscriberCount: figureMethod({
method: 'GET',
path: '/instagram_subscriber_count'
}),

twitterFollowerCount: figureMethod({
method: 'GET',
path: '/twitter_follower_count'
path: 'report'
})

});
18 changes: 18 additions & 0 deletions lib/resources/EventGifs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

var FigureResource = require('../FigureResource');
var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'gifs/event_gifs',
includeBasic: [
'get',
'getAll'
],
shareByEmail: figureMethod({
method: 'POST',
path: '/{id}/share_by_email',
urlParams: ['id']
})
});
8 changes: 1 addition & 7 deletions lib/resources/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ module.exports = FigureResource.extend({
path: 'events',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
],
shareByEmail: figureMethod({
method: 'POST',
path: '/{uuid}/share_by_email',
urlParams: ['uuid']
})

]
});
19 changes: 19 additions & 0 deletions lib/resources/FigureGif.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

var FigureResource = require('../FigureResource');
var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'gifs/figure_gif',
includeBasic: [],
get: figureMethod({
method: 'GET',
path: ''
}),
shareByEmail: figureMethod({
method: 'POST',
path: '/share_by_email',
urlParams: ['id']
})
});
2 changes: 1 addition & 1 deletion lib/resources/ImageVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'imagevariables',
path: 'image_variables',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
]
Expand Down
18 changes: 18 additions & 0 deletions lib/resources/PlaceGifs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

var FigureResource = require('../FigureResource');
var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'gifs/place_gifs',
includeBasic: [
'get',
'getAll'
],
shareByEmail: figureMethod({
method: 'POST',
path: '/{id}/share_by_email',
urlParams: ['id']
})
});
8 changes: 1 addition & 7 deletions lib/resources/Places.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ module.exports = FigureResource.extend({
path: 'places',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
],
shareByEmail: figureMethod({
method: 'POST',
path: '/{slug}/share_by_email',
urlParams: ['slug']
})

]
});
2 changes: 1 addition & 1 deletion lib/resources/PosterOrders.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'posterorders',
path: 'poster_orders',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
]
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/TextVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'textvariables',
path: 'text_variables',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
]
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/TicketTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var figureMethod = FigureResource.method;

module.exports = FigureResource.extend({

path: 'tickettemplates',
path: 'ticket_templates',
includeBasic: [
'create', 'get', 'getAll', 'edit', 'del'
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figure-sdk",
"version": "0.1.12",
"version": "0.2.0",
"description": "The Figure JavaScript SDK",
"main": "lib/figure.js",
"homepage": "https://github.com/postcard/figure-sdk-node",
Expand All @@ -13,7 +13,7 @@
"figure",
"photobooth"
],
"author": "Benoît Guigal <benoit@postcardgroup.com>",
"author": "Benoît Guigal <benoit@figure.co>",
"license": "MIT",
"dependencies": {
"bluebird": "^2.9.6",
Expand Down

0 comments on commit f2f6b94

Please sign in to comment.