Skip to content

Commit 879fb7e

Browse files
authored
Merge pull request #31 from lucascosta/v.2.9.0
v2.9.0
2 parents 2fd81ba + bdc5688 commit 879fb7e

18 files changed

+138
-72
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Facebook Ads API SDK for Javascript [![Build Status](https://travis-ci.org/lucascosta/facebook-js-ads-sdk.svg?branch=master)](https://travis-ci.org/lucascosta/facebook-js-ads-sdk) [![Marketing API Version](https://img.shields.io/badge/marketing--api-2.8-brightgreen.svg)](https://developers.facebook.com/docs/marketing-apis)
1+
# Facebook Ads API SDK for Javascript [![Build Status](https://travis-ci.org/lucascosta/facebook-js-ads-sdk.svg?branch=master)](https://travis-ci.org/lucascosta/facebook-js-ads-sdk) [![Marketing API Version](https://img.shields.io/badge/marketing--api-2.9-brightgreen.svg)](https://developers.facebook.com/docs/marketing-apis)
22

33
![Marketing API Banner](https://raw.githubusercontent.com/lucascosta/facebook-js-ads-sdk/master/marketingapi.png)
44

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "facebook-ads-sdk",
3-
"version": "2.8.2",
3+
"version": "2.9.0",
44
"description": "SDK for the Facebook Ads API in Javascript and Node.js",
55
"author": {
66
"name": "Lucas Costa",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "facebook-ads-sdk",
3-
"version": "2.8.2",
3+
"version": "2.9.0",
44
"description": "SDK for the Facebook Ads API in Javascript and Node.js",
55
"author": "Lucas Costa (https://github.com/lucascosta)",
66
"maintainers": [

src/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FacebookRequestError } from './exceptions'
66
*/
77
export default class FacebookAdsApi {
88

9-
static get VERSION () { return 'v2.8' }
9+
static get VERSION () { return 'v2.9' }
1010
static get GRAPH () { return 'https://graph.facebook.com' }
1111

1212
/**

src/core.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ export class AbstractCrudObject extends AbstractObject {
124124
return this._changes
125125
}
126126

127+
/**
128+
* Export object data
129+
* @return {Object}
130+
*/
131+
exportAllData () {
132+
return this._data
133+
}
134+
127135
/**
128136
* Clear change history
129137
* @return this

src/objects/ad-account.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export default class AdAccount extends AbstractCrudObject {
5757
owner: 'owner',
5858
partner: 'partner',
5959
rf_spec: 'rf_spec',
60+
salesforce_invoice_group_id: 'salesforce_invoice_group_id',
61+
show_checkout_experience: 'show_checkout_experience',
6062
spend_cap: 'spend_cap',
6163
tax_id: 'tax_id',
6264
tax_id_status: 'tax_id_status',

src/objects/ad-creative.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import AdPreview from './ad-preview'
99
export default class AdCreative extends AbstractCrudObject {
1010
static get Fields () {
1111
return Object.freeze({
12-
id: 'id',
12+
account_id: 'account_id',
13+
actor_id: 'actor_id',
1314
adlabels: 'adlabels',
1415
applink_treatment: 'applink_treatment',
1516
body: 'body',
17+
call_to_action_type: 'call_to_action_type',
1618
effective_instagram_story_id: 'effective_instagram_story_id',
1719
effective_object_story_id: 'effective_object_story_id',
18-
call_to_action_type: 'call_to_action_type',
20+
id: 'id',
1921
image_crops: 'image_crops',
2022
image_hash: 'image_hash',
2123
image_url: 'image_url',
@@ -32,19 +34,17 @@ export default class AdCreative extends AbstractCrudObject {
3234
object_url: 'object_url',
3335
platform_customizations: 'platform_customizations',
3436
product_set_id: 'product_set_id',
35-
run_status: 'run_status',
37+
status: 'status',
3638
template_url: 'template_url',
39+
template_url_spec: 'template_url_spec',
3740
thumbnail_url: 'thumbnail_url',
3841
title: 'title',
3942
url_tags: 'url_tags',
4043
use_page_actor_override: 'use_page_actor_override',
41-
action_spec: 'action_spec',
44+
video_id: 'video_id',
4245
call_to_action: 'call_to_action',
4346
dynamic_ad_voice: 'dynamic_ad_voice',
44-
follow_redirect: 'follow_redirect',
45-
image_file: 'image_file',
46-
object_instagram_id: 'object_instagram_id',
47-
place_page_set_id: 'place_page_set_id'
47+
image_file: 'image_file'
4848
})
4949
}
5050

@@ -68,25 +68,29 @@ export default class AdCreative extends AbstractCrudObject {
6868
use_mobile_app: 'USE_MOBILE_APP',
6969
book_travel: 'BOOK_TRAVEL',
7070
listen_music: 'LISTEN_MUSIC',
71-
watch_video: 'WATCH_VIDEO',
7271
learn_more: 'LEARN_MORE',
7372
sign_up: 'SIGN_UP',
7473
download: 'DOWNLOAD',
7574
watch_more: 'WATCH_MORE',
7675
no_button: 'NO_BUTTON',
7776
call_now: 'CALL_NOW',
77+
apply_now: 'APPLY_NOW',
7878
buy_now: 'BUY_NOW',
7979
get_offer: 'GET_OFFER',
8080
get_offer_view: 'GET_OFFER_VIEW',
8181
get_directions: 'GET_DIRECTIONS',
8282
message_page: 'MESSAGE_PAGE',
83+
message_user: 'MESSAGE_USER',
8384
subscribe: 'SUBSCRIBE',
8485
sell_now: 'SELL_NOW',
8586
donate_now: 'DONATE_NOW',
8687
get_quote: 'GET_QUOTE',
8788
contact_us: 'CONTACT_US',
8889
record_now: 'RECORD_NOW',
8990
vote_now: 'VOTE_NOW',
91+
register_now: 'REGISTER_NOW',
92+
request_time: 'REQUEST_TIME',
93+
see_menu: 'SEE_MENU',
9094
open_movies: 'OPEN_MOVIES'
9195
})
9296
}
@@ -109,7 +113,7 @@ export default class AdCreative extends AbstractCrudObject {
109113
})
110114
}
111115

112-
static get RunStatus () {
116+
static get Status () {
113117
return Object.freeze({
114118
active: 'ACTIVE',
115119
deleted: 'DELETED'

src/objects/ad-image.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import { AbstractCrudObject } from './../core'
88
export default class AdImage extends AbstractCrudObject {
99
static get Fields () {
1010
return Object.freeze({
11-
id: 'id',
1211
account_id: 'account_id',
1312
created_time: 'created_time',
1413
creatives: 'creatives',
1514
hash: 'hash',
1615
height: 'height',
16+
id: 'id',
17+
is_associated_creatives_in_adgroups: 'is_associated_creatives_in_adgroups',
1718
name: 'name',
1819
original_height: 'original_height',
1920
original_width: 'original_width',
@@ -25,7 +26,8 @@ export default class AdImage extends AbstractCrudObject {
2526
width: 'width',
2627
bytes: 'bytes',
2728
copy_from: 'copy_from',
28-
zipbytes: 'zipbytes'
29+
zipbytes: 'zipbytes',
30+
filename: 'filename'
2931
})
3032
}
3133

src/objects/ad-preview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default class AdPreview extends AbstractCrudObject {
2121
mobile_interstitial: 'MOBILE_INTERSTITIAL',
2222
mobile_banner: 'MOBILE_BANNER',
2323
mobile_medium_rectangle: 'MOBILE_MEDIUM_RECTANGLE',
24+
mobile_fullwidth: 'MOBILE_FULLWIDTH',
2425
mobile_native: 'MOBILE_NATIVE',
2526
instagram_standard: 'INSTAGRAM_STANDARD',
2627
audience_network_outstream_video: 'AUDIENCE_NETWORK_OUTSTREAM_VIDEO',

src/objects/ad-set.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default class AdSet extends AbstractCrudObject {
1313
account_id: 'account_id',
1414
adlabels: 'adlabels',
1515
adset_schedule: 'adset_schedule',
16+
attribution_spec: 'attribution_spec',
1617
bid_amount: 'bid_amount',
1718
bid_info: 'bid_info',
1819
billing_event: 'billing_event',
@@ -30,7 +31,7 @@ export default class AdSet extends AbstractCrudObject {
3031
frequency_control_specs: 'frequency_control_specs',
3132
id: 'id',
3233
is_autobid: 'is_autobid',
33-
'is_average_price_pacing': 'is_average_price_pacing',
34+
is_average_price_pacing: 'is_average_price_pacing',
3435
lifetime_budget: 'lifetime_budget',
3536
lifetime_frequency_cap: 'lifetime_frequency_cap',
3637
lifetime_imps: 'lifetime_imps',
@@ -39,14 +40,17 @@ export default class AdSet extends AbstractCrudObject {
3940
pacing_type: 'pacing_type',
4041
promoted_object: 'promoted_object',
4142
recommendations: 'recommendations',
42-
'recurring_budget_semantics': 'recurring_budget_semantics',
43+
recurring_budget_semantics: 'recurring_budget_semantics',
4344
rf_prediction_id: 'rf_prediction_id',
4445
rtb_flag: 'rtb_flag',
4546
start_time: 'start_time',
4647
status: 'status',
4748
targeting: 'targeting',
49+
time_based_ad_rotation_id_blocks: 'time_based_ad_rotation_id_blocks',
50+
time_based_ad_rotation_intervals: 'time_based_ad_rotation_intervals',
4851
updated_time: 'updated_time',
4952
use_new_app_click: 'use_new_app_click',
53+
campaign_spec: 'campaign_spec',
5054
daily_imps: 'daily_imps',
5155
execution_options: 'execution_options',
5256
redownload: 'redownload'
@@ -62,7 +66,8 @@ export default class AdSet extends AbstractCrudObject {
6266
offer_claims: 'OFFER_CLAIMS',
6367
page_likes: 'PAGE_LIKES',
6468
post_engagement: 'POST_ENGAGEMENT',
65-
video_views: 'VIDEO_VIEWS'
69+
video_views: 'VIDEO_VIEWS',
70+
mrc_video_views: 'MRC_VIDEO_VIEWS'
6671
})
6772
}
6873

@@ -97,7 +102,6 @@ export default class AdSet extends AbstractCrudObject {
97102
brand_awareness: 'BRAND_AWARENESS',
98103
clicks: 'CLICKS',
99104
engaged_users: 'ENGAGED_USERS',
100-
external: 'EXTERNAL',
101105
event_responses: 'EVENT_RESPONSES',
102106
impressions: 'IMPRESSIONS',
103107
lead_generation: 'LEAD_GENERATION',
@@ -109,7 +113,8 @@ export default class AdSet extends AbstractCrudObject {
109113
post_engagement: 'POST_ENGAGEMENT',
110114
reach: 'REACH',
111115
social_impressions: 'SOCIAL_IMPRESSIONS',
112-
video_views: 'VIDEO_VIEWS'
116+
video_views: 'VIDEO_VIEWS',
117+
app_downloads: 'APP_DOWNLOADS'
113118
})
114119
}
115120

@@ -126,19 +131,23 @@ export default class AdSet extends AbstractCrudObject {
126131
return Object.freeze({
127132
today: 'today',
128133
yesterday: 'yesterday',
129-
last_3_days: 'last_3_days',
130-
this_week: 'this_week',
131-
last_week: 'last_week',
132-
last_7_days: 'last_7_days',
133-
last_14_days: 'last_14_days',
134-
last_28_days: 'last_28_days',
135-
last_30_days: 'last_30_days',
136-
last_90_days: 'last_90_days',
137134
this_month: 'this_month',
138135
last_month: 'last_month',
139136
this_quarter: 'this_quarter',
140-
last_3_months: 'last_3_months',
141-
lifetime: 'lifetime'
137+
lifetime: 'lifetime',
138+
last_3d: 'last_3d',
139+
last_7d: 'last_7d',
140+
last_14d: 'last_14d',
141+
last_28d: 'last_28d',
142+
last_30d: 'last_30d',
143+
last_90d: 'last_90d',
144+
last_week_mon_sun: 'last_week_mon_sun',
145+
last_week_sun_sat: 'last_week_sun_sat',
146+
last_quarter: 'last_quarter',
147+
last_year: 'last_year',
148+
this_week_mon_today: 'this_week_mon_today',
149+
this_week_sun_today: 'this_week_sun_today',
150+
this_year: 'this_year'
142151
})
143152
}
144153

0 commit comments

Comments
 (0)