master ea20e537e977
86 files
140.3 KB
37.7k tokens
Repository: lucascosta/facebook-js-ads-sdk
Branch: master
Commit: ea20e537e977
Files: 86
Total size: 140.3 KB

Directory structure:
gitextract_zqqg9s1r/

├── .babelrc
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .npmignore
├── .travis.yml
├── README.md
├── bower.json
├── gulpfile.js
├── package.json
├── src/
│   ├── api.js
│   ├── bundle.es6
│   ├── core.js
│   ├── exceptions.js
│   ├── globals.es6
│   ├── http.js
│   ├── mixins.js
│   └── objects/
│       ├── ad.js
│       ├── adaccount.js
│       ├── adaccountroas.js
│       ├── adaccounttargetingunified.js
│       ├── adaccountuser.js
│       ├── adactivity.js
│       ├── adasyncrequest.js
│       ├── adasyncrequestset.js
│       ├── adcreative.js
│       ├── adimage.js
│       ├── adkeywordstats.js
│       ├── adlabel.js
│       ├── adplacepageset.js
│       ├── adpreview.js
│       ├── adreportrun.js
│       ├── adsdatapartner.js
│       ├── adset.js
│       ├── adsinsights.js
│       ├── adspixel.js
│       ├── adspixelstatsresult.js
│       ├── broadtargetingcategories.js
│       ├── business.js
│       ├── businessadaccountrequest.js
│       ├── businesspagerequest.js
│       ├── campaign.js
│       ├── customaudience.js
│       ├── customaudienceprefillstate.js
│       ├── customaudiencesession.js
│       ├── customaudiencestos.js
│       ├── domain.js
│       ├── event.js
│       ├── eventsourcegroup.js
│       ├── externaleventsource.js
│       ├── hotel.js
│       ├── lead.js
│       ├── leadgenform.js
│       ├── legacybusinessadaccountrequest.js
│       ├── minimumbudget.js
│       ├── offsitepixel.js
│       ├── partnercategory.js
│       ├── productcatalog.js
│       ├── productcataloghotelroomsbatch.js
│       ├── productcatalogpricingvariablesbatch.js
│       ├── productfeed.js
│       ├── productfeedupload.js
│       ├── productfeeduploaderror.js
│       ├── productfeeduploaderrorsample.js
│       ├── productgroup.js
│       ├── productitem.js
│       ├── productset.js
│       ├── profilepicturesource.js
│       ├── ratecard.js
│       ├── reachestimate.js
│       ├── reachfrequencyprediction.js
│       ├── targetingsentenceline.js
│       ├── transaction.js
│       └── user.js
└── test/
    ├── index.html
    ├── integration/
    │   ├── config.sample
    │   ├── index.html
    │   ├── spec.js
    │   └── test-integration.js
    ├── mocha.opts
    ├── spec.js
    ├── src/
    │   ├── test-api.js
    │   ├── test-core.js
    │   └── test-exceptions.js
    ├── standard.js
    └── suite.es6

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "presets": ["es2015"]
}


================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

================================================
FILE: .gitattributes
================================================
* text=auto


================================================
FILE: .gitignore
================================================
dist/
test/**/suite.js*
test/**/*.json
node_modules
bower_components
*.log


================================================
FILE: .npmignore
================================================
test/**/suite.js*
test/**/*.json
node_modules
bower_components
*.log


================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
  - "6"
  - "5"
  - "4"
before_script:
  - npm install -g gulp
  - npm install -g bower
  - bower install


================================================
FILE: README.md
================================================
# DEPRECATED

Facebook released the official SDK based on this project. This project will no longer be maintained.

https://developers.facebook.com/ads/blog/post/2017/09/12/autogen-node.js-sdk/
https://github.com/facebook/facebook-nodejs-ads-sdk

A big thanks to all contributors.

# 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)

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

A Javascript SDK for [**Facebook Ads API**](https://developers.facebook.com/docs/ads-api) development in both client and server-side. ECMAScript 5 bundled minified distribuitions with sourcemaps are also available as AMD and CommonJS modules, as an IIFE (under the `fb` variable), as UMD if you want it all, and even as Browser Globals. Runs "anywhere" thanks to [Babel](https://babeljs.io/) and [Rollup](http://rollupjs.org/). It is consistent with many concepts from Python and PHP SDKs in a JS fashion, with some simplifications and tweaks. This is not an official library.

## Example

```javaScript
const adsSdk = require('facebook-ads-sdk');

const accessToken = 'VALID_ACCESS_TOKEN'
const accountId = 'AD_ACCOUNT_ID'

const FacebookAdsApi = adsSdk.FacebookAdsApi.init(accessToken)
const AdAccount = adsSdk.AdAccount
const Campaign = adsSdk.Campaign

const account = new AdAccount({ 'id': accountId })
const insightsFields = ['impressions', 'frequency', 'unique_clicks', 'actions', 'spend', 'cpc']
const insightsParams = { date_preset: Campaign.DatePreset.last_90d }
var campaigns

account.read([AdAccount.Field.name])
  .then((account) => {
    account.getInsights(insightsFields, insightsParams)
      .then((actInsights) => console.log(account, actInsights))
      .catch(console.error)
    return account.getCampaigns([Campaign.Field.name], { limit: 10 }) // fields array and params
  })
  .then((result) => {
    campaigns = result
    const campaign_ids = campaigns.map((campaign) => campaign.id)
    const campaignInsightsParams = Object.assign({
      level: 'campaign',
      filtering: [{ field: 'campaign.id', operator: 'IN', value: campaign_ids }]
    }, insightsParams)
    const campaigsInsightsFields = insightsFields.concat('campaign_id')
    return account.getInsights(campaigsInsightsFields, campaignInsightsParams)
  })
  .then((insights) => console.log(campaigns, insights))
  .catch(console.error)
```

## Installation

#### NPM

`npm install --save facebook-ads-sdk`

#### Bower

`bower install --save facebook-ads-sdk`

### Promises

This SDK returns [**Promises**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), a neat way to handle asynchronous requests. You should provide a polyfill if you intend to make this available in not supporting environments (check a [compatibility table](https://kangax.github.io/compat-table/es6/#test-Promise)). [Bluebird](http://bluebirdjs.com/docs/getting-started.html) seems a good choice and it's used here in Node through [request-promise](https://github.com/request/request-promise) and in browser unit tests.

## Usage

### Access Token

To instantiate an Api object you will need a valid [access token](https://developers.facebook.com/docs/marketing-api/authentication) for an app with the `ads_management` permission. A quick way to obtaining a short-lived token is using the [Graph API Explorer](https://developers.facebook.com/tools/explorer/). Instantiate the API using the token:

```javaScript
const FacebookAdsApi = require('facebook-ads-sdk').FacebookAdsApi;
const api = FacebookAdsApi.init(accessToken)
```

Once instantiated, the Api object be refered by the Graph objects. You can also directly assign an Api instance to an object, which enables using different tokens.

#### Debugging

A `FacebookAdsApi` object offers a debugging mode that will log all requests. To enable it just call `api.setDebug(true)` on an API instance.

### Facebook Objects

The currently supported objects are located in 'src/objects'. If the object need is not available or it doesn't posses a method you want you may add it and make a Pull Request, or ask for it in the Issues if you can't.

```javascript
// instantiating an object
const AdAccount = require('facebook-ads-sdk').AdAccount;
const account = new AdAccount({'id': 'AD_ACCOUNT_ID'}) // set data on instantiation
console.log(account.id) // fields can be accessed as properties
```

#### CRUD operations

Most of Facebook's Objects can perform Create, Read, Update, and Delete operations. Enums such as `Field` and other constants are provided by the classes to improve maintainability.

##### Create

```javascript
const Campaign = require('facebook-ads-sdk').Campaign;
const accountId = 'AD_ACCOUNT_ID'
const data = {
  [Campaign.Field.name]: 'Campaign Name',
  [Campaign.Field.status]: Campaign.Status.paused
}
new Campaign(data, accountId) // set data and parent ID on instantiation
  .create()
  .then((campaign) => { console.log(campaign.id) })
  .catch(errorFunction)
```

##### Read

```javascript
const Campaign = require('facebook-ads-sdk').Campaign;
const campaignId = 'CAMPAIGN_ID'
new Campaign({ 'id': campaignId })
  .read([Campaign.Field.name]) // fields array
  .then((campaign) => { console.log(campaign.name) })
  .catch(errorFunction)
```

An easy way to read a set of objects is to get them by their ids:

```javascript
const campaignIds = ['CAMPAIGN_A_ID', 'CAMPAIGN_B_ID']
Campaign.getByIds(campaignIds)
  .then((campaigns) => { console.log(campaigns[0], campaigns[1]) })
  .catch(errorFunction)
```

##### Update

```javascript
const Campaign = require('facebook-ads-sdk').Campaign;
const campaignId = 'CAMPAIGN_ID'
const newName = 'New Campaign Name'
new Campaign({ [Campaign.Field.id]: campaignId, [Campaign.Field.name]: newName })
  .udpate()
  .then((result) => { console.log(result.success) })
  .catch(errorFunction)
```

##### Delete

```javascript
const Campaign = require('facebook-ads-sdk').Campaign;
const campaignId = 'CAMPAIGN_ID'
new Campaign({ 'id': campaignId })
  .delete()
  .then((result) => { console.log(result.success) })
  .catch(errorFunction)
```

#### Edges and Cursor-based Pagination

When fetching nodes related to another (Edges) or a collection in the graph, the results are paginated in a `Cursor` class. Here the `Cursor` is a superpowered `Array` (with all it's native helpful operations) with `next` and `previous` methods that when resolved fills itself with the new set of objects. This should be great for reactive template systems.

Here's an example suposing we have currently 17 campaigns in an Ad Account:

```javascript
const AdAccount = require('facebook-ads-sdk').AdAccount;
const account = new AdAccount({'id': 'AD_ACCOUNT_ID'})
account.getCampaigns([Campaign.Field.name], { limit: 10 }) // fields array and params
.then((campaigns) => {
  console.log(campaigns.length) // 10
  console.log(campaigns.hasNext()) // true
  return campaigns.next()
}
.then((campaigns) => { // this is the same Cursor object instance
  console.log(campaigns.length) // 7
  console.log(campaigns.hasNext()) // false
  console.log(campaigns.hasPrevious()) // true
  return campaigns.previous()
}
.then((campaigns) => {
  console.log(campaigns.length) // 10
}
.catch(errorFunction)
```

## Development

### Dependencies

[Gulp](http://gulpjs.com/) and [Bower](http://bower.io/) should be installed globally. Install depencencies:

``` bash
npm install
bower install
```

Checkout `gulpfile.js` for all available tasks.

### Style

This package uses [StandardJS](http://standardjs.com/). Inconsistent code will break tests.

### Unit Tests

Unit tests run in Node.js, PhantomJS, and in Browsers. Travis CI will run both Node and PhantomJS tests to ensure isomorphism. 

* The default `gulp` task  will watch the files and run the Node tests repeatedly.
* `gulp test` will run the Node tests.
* `gulp test-phantom` will run tests against the PhatomJS headless browser.
* `gulp test-browser` will open your system browser with the tests.

Front-end tests rely on a bundle processed before the tests. You can use `gulp watch-bundle` to bundle as the code changes.

### Integration Tests

Integration tests run a few basic operations to ensure API connectivity. To run them, you'll need to setup a `config.json` file in `tests/integration`. Copy the `config.sample` and fill `accessToken` and `accountId`.

* `gulp integration` will run integration tests on Node.
* `gulp integration-browser` will open your system browser with the tests. Useful if you'd like to inspect the requests.


================================================
FILE: bower.json
================================================
{
  "name": "facebook-ads-sdk",
  "version": "2.10.5",
  "description": "SDK for the Facebook Ads API in Javascript and Node.js",
  "author": {
    "name": "Lucas Costa",
    "url": "https://github.com/lucascosta"
  },
  "maintainers": [
    "lucascosta <lucas@lucascosta.com>"
  ],
  "homepage": "https://github.com/lucascosta/facebook-js-ads-sdk",
  "bugs": "https://github.com/lucascosta/facebook-js-ads-sdk/issues",
  "keywords": [
    "facebook",
    "ads",
    "sdk",
    "api",
    "javascript",
    "nodejs",
    "amd",
    "requirejs",
    "umd",
    "promises"
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/lucascosta/facebook-js-ads-sdk.git"
  },
  "devDependencies": {
    "bluebird": "^3.4.1",
    "chai": "^3.5.0",
    "mocha": "^2.5.3",
    "requirejs": "^2.2.0"
  },
  "main": "./dist/iife.js",
  "license": "MIT"
}


================================================
FILE: gulpfile.js
================================================
'use strict'

var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var babel = require('rollup-plugin-babel')
var babelrc = require('babelrc-rollup')
var commonjs = require('rollup-plugin-commonjs')
var json = require('rollup-plugin-json')
var nodeResolve = require('rollup-plugin-node-resolve')
var rollup = require('rollup-stream');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');

gulp.task('test', function () {
  require('babel-register')
  return gulp.src(['test/*/*.js', 'test/standard.js', '!test/integration/**'], {read: false})
    .pipe($.mocha({reporter: 'min'}))
})

gulp.task('watch', function () {
  gulp.watch(['src/**/*.js', 'test/**/*.js', '!test/**/suite.js*'], ['test'])
})

gulp.task('default', function () {
  gulp.start('watch')
})

gulp.task('test-bundle', function () {
  roll('amd', 'suite.es6', 'suite', './test', './test')
})

gulp.task('watch-bundle', function () {
  gulp.watch(['src/**/*.js', 'test/**/*.*', '!test/**/suite.js*'], ['test-bundle'])
})

gulp.task('test-phantom', ['test-bundle'], function () {
  gulp.src('test/index.html')
    .pipe($.mochaPhantomjs({
      phantomjs: { useColors: true }
    }))
})

gulp.task('test-browser', ['test-bundle'], function () {
  gulp.src('test/index.html')
    .pipe($.open())
})

gulp.task('integration', function () {
  require('babel-register')
  return gulp.src(['test/integration/test-integration.js'], {read: false})
    .pipe($.mocha({reporter: 'min'}))
})

gulp.task('integration-bundle', function () {
  roll('amd', 'test-integration.js', 'suite', './test/integration', './test/integration')
})

gulp.task('integration-browser', ['integration-bundle'], function () {
  gulp.src('test/integration/index.html')
    .pipe($.open())
})

gulp.task('watch-integration', function () {
  gulp.watch(['test/integration/test-integration.js'], ['integration'])
})

function roll (format, entry, name, entry_dir, dest_dir) {
  name = (name || format) + '.js'
  entry_dir = entry_dir || './src'
  dest_dir = dest_dir || './dist'
  return rollup({
    entry: entry_dir + '/' + entry,
    format: format,
    exports: 'named',
    moduleName: 'fb',
    plugins: [
      babel(babelrc.default({
        config: {
          presets: [
            [
              'es2015',
              { 'modules': false }
            ]
          ],
          plugins: ['external-helpers'],
          exclude: ['node_modules/**', '**/*.json']
        }
      })),
      nodeResolve({
        skip: [ 'chai' ]
      }),
      commonjs({
        include: [ 'node_modules/mixwith/*', 'node_modules/chai-as-promised/lib/*' ],
        namedExports: { 'mixwith': ['mix'], 'chai-as-promised': ['chaiAsPromised'] }
      }),
      json(),
    ],
    sourceMap: true
  })
  .pipe(source(entry, entry_dir))
  .pipe(buffer())
  .pipe($.sourcemaps.init({loadMaps: true}))
  .pipe($.rename(name))
  .pipe($.sourcemaps.write('.'))
  .pipe(gulp.dest(dest_dir))
}

gulp.task('dist', function () {
  roll('amd', 'bundle.es6')
  roll('cjs', 'bundle.es6')
  roll('umd', 'bundle.es6')
  roll('iife', 'bundle.es6')
  roll('es', 'bundle.es6')
  roll('cjs', 'globals.es6', 'globals')
})


================================================
FILE: package.json
================================================
{
  "name": "facebook-ads-sdk",
  "version": "2.10.5",
  "description": "SDK for the Facebook Ads API in Javascript and Node.js",
  "author": "Lucas Costa (https://github.com/lucascosta)",
  "maintainers": [
    "lucascosta <lucas@lucascosta.com>"
  ],
  "homepage": "https://github.com/lucascosta/facebook-js-ads-sdk",
  "bugs": {
    "url": "https://github.com/lucascosta/facebook-js-ads-sdk/issues"
  },
  "keywords": [
    "facebook",
    "ads",
    "sdk",
    "api",
    "javascript",
    "es6",
    "es2015",
    "isomorphic",
    "nodejs",
    "amd",
    "requirejs",
    "umd",
    "promises"
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/lucascosta/facebook-js-ads-sdk.git"
  },
  "devDependencies": {
    "babel-core": "~6.17.0",
    "babel-plugin-external-helpers": "~6.8.0",
    "babel-preset-es2015": "~6.16.0",
    "babelrc-rollup": "^3.0.0",
    "chai": "~3.5.0",
    "gulp": "~3.9.1",
    "gulp-filenames": "~4.0.0",
    "gulp-load-plugins": "~1.3.0",
    "gulp-mocha": "~3.0.1",
    "gulp-mocha-phantomjs": "~0.12.0",
    "gulp-open": "~2.0.0",
    "gulp-rename": "~1.2.2",
    "gulp-sourcemaps": "~2.1.1",
    "mocha": "~3.1.2",
    "mocha-phantomjs": "~4.1.0",
    "mocha-standard": "~1.0.0",
    "rollup-plugin-babel": "~2.6.1",
    "rollup-plugin-commonjs": "~5.0.5",
    "rollup-plugin-json": "~2.0.2",
    "rollup-plugin-node-resolve": "~2.0.0",
    "rollup-stream": "~1.14.0",
    "standard": "~8.4.0",
    "vinyl-buffer": "~1.0.0",
    "vinyl-source-stream": "~1.1.0"
  },
  "dependencies": {
    "mixwith": "~0.1.1",
    "request": "^2.81.0",
    "request-promise": "~4.1.1"
  },
  "scripts": {
    "prepublish": "gulp dist",
    "test": "./node_modules/mocha/bin/mocha --compilers js:babel-core/register test/src/ test/standard.js"
  },
  "main": "./dist/cjs.js",
  "license": "MIT",
  "standard": {
    "globals": [
      "after",
      "afterEach",
      "before",
      "beforeEach",
      "context",
      "define",
      "describe",
      "expect",
      "it",
      "mocha",
      "requirejs"
    ]
  },
  "directories": {
    "test": "test"
  }
}


================================================
FILE: src/api.js
================================================
import Http from './http'
import { FacebookRequestError } from './exceptions'

/**
 * Facebook Ads API
 */
export default class FacebookAdsApi {

  static get VERSION () { return 'v2.10' }
  static get GRAPH () { return 'https://graph.facebook.com' }

  /**
   * @param {String} accessToken
   * @param {String} [locale]
   */
  constructor (accessToken, locale = 'en_US') {
    if (!accessToken) {
      throw new Error('Access token required')
    }
    this.accessToken = accessToken
    this.locale = locale
    this._debug = false
  }

  /**
   * Instantiate an API and store it as the default
   * @param  {String} accessToken
   * @param  {String} [locale]
   * @return {FacebookAdsApi}
   */
  static init (accessToken, locale) {
    const api = new this(accessToken, locale)
    this.setDefaultApi(api)
    return api
  }

  static setDefaultApi (api) {
    this._defaultApi = api
  }

  static getDefaultApi () {
    return this._defaultApi
  }

  setDebug (flag) {
    this._debug = flag
    return this
  }

  /**
   * Http Request
   * @param  {String} method
   * @param  {String} path
   * @param  {Object} [params]
   * @return {Promise}
   */
  call (method, path, params = {}) {
    var url
    if (method === 'POST' || method === 'PUT') {
      var data = params
      params = {}
    }
    if (typeof path !== 'string' && !(path instanceof String)) {
      url = [FacebookAdsApi.GRAPH, FacebookAdsApi.VERSION, ...path].join('/')
      params['access_token'] = this.accessToken
      url += `?${FacebookAdsApi._encodeParams(params)}`
    } else {
      url = path
    }

    return Http.request(method, url, data)
    .then((response) => {
      if (this._debug) console.log(`200 ${method} ${url} ${data ? JSON.stringify(data) : ''}`)
      return Promise.resolve(response)
    })
    .catch((response) => {
      if (this._debug) {
        console.log(`${response.status} ${method} ${url} ${data ? JSON.stringify(data) : ''}`)
      }
      throw new FacebookRequestError(response, method, url, data)
    })
  }

  static _encodeParams (params) {
    return Object.keys(params).map((key) => {
      var param = params[key]
      if (typeof param === 'object') {
        param = param ? JSON.stringify(param) : ''
      }
      return `${encodeURIComponent(key)}=${encodeURIComponent(param)}`
    }).join('&')
  }
}


================================================
FILE: src/bundle.es6
================================================
export { default as FacebookAdsApi } from './../src/api'
export { default as Ad } from './../src/objects/ad'
export { default as AdAccount } from './../src/objects/adaccount'
export { default as AdAccountRoas } from './../src/objects/adaccountroas'
export { default as AdAccountTargetingUnified } from './../src/objects/adaccounttargetingunified'
export { default as AdAccountUser } from './../src/objects/adaccountuser'
export { default as AdActivity } from './../src/objects/adactivity'
export { default as AdAsyncRequest } from './../src/objects/adasyncrequest'
export { default as AdAsyncRequestSet } from './../src/objects/adasyncrequestset'
export { default as AdCreative } from './../src/objects/adcreative'
export { default as AdImage } from './../src/objects/adimage'
export { default as AdKeywordStats } from './../src/objects/adkeywordstats'
export { default as AdLabel } from './../src/objects/adlabel'
export { default as AdPlacePageSet } from './../src/objects/adplacepageset'
export { default as AdPreview } from './../src/objects/adpreview'
export { default as AdReportRun } from './../src/objects/adreportrun'
export { default as AdsDataPartner } from './../src/objects/adsdatapartner'
export { default as AdSet } from './../src/objects/adset'
export { default as AdsInsights } from './../src/objects/adsinsights'
export { default as AdsPixel } from './../src/objects/adspixel'
export { default as AdsPixelStatsResult } from './../src/objects/adspixelstatsresult'
export { default as BroadTargetingCategories } from './../src/objects/broadtargetingcategories'
export { default as Business } from './../src/objects/business'
export { default as BusinessAdAccountRequest } from './../src/objects/businessadaccountrequest'
export { default as BusinessPageRequest } from './../src/objects/businesspagerequest'
export { default as Campaign } from './../src/objects/campaign'
export { default as CustomAudience } from './../src/objects/customaudience'
export { default as CustomAudiencePrefillState } from './../src/objects/customaudienceprefillstate'
export { default as CustomAudienceSession } from './../src/objects/customaudiencesession'
export { default as CustomAudiencesTOS } from './../src/objects/customaudiencestos'
export { default as Domain } from './../src/objects/domain'
export { default as Event } from './../src/objects/event'
export { default as EventSourceGroup } from './../src/objects/eventsourcegroup'
export { default as ExternalEventSource } from './../src/objects/externaleventsource'
export { default as Hotel } from './../src/objects/hotel'
export { default as Lead } from './../src/objects/lead'
export { default as LeadgenForm } from './../src/objects/leadgenform'
export { default as LegacyBusinessAdAccountRequest } from './../src/objects/legacybusinessadaccountrequest'
export { default as MinimumBudget } from './../src/objects/minimumbudget'
export { default as OffsitePixel } from './../src/objects/offsitepixel'
export { default as PartnerCategory } from './../src/objects/partnercategory'
export { default as ProductCatalog } from './../src/objects/productcatalog'
export { default as ProductCatalogHotelRoomsBatch } from './../src/objects/productcataloghotelroomsbatch'
export { default as ProductCatalogPricingVariablesBatch } from './../src/objects/productcatalogpricingvariablesbatch'
export { default as ProductFeed } from './../src/objects/productfeed'
export { default as ProductFeedUpload } from './../src/objects/productfeedupload'
export { default as ProductFeedUploadError } from './../src/objects/productfeeduploaderror'
export { default as ProductFeedUploadErrorSample } from './../src/objects/productfeeduploaderrorsample'
export { default as ProductGroup } from './../src/objects/productgroup'
export { default as ProductItem } from './../src/objects/productitem'
export { default as ProductSet } from './../src/objects/productset'
export { default as ProfilePictureSource } from './../src/objects/profilepicturesource'
export { default as RateCard } from './../src/objects/ratecard'
export { default as ReachEstimate } from './../src/objects/reachestimate'
export { default as ReachFrequencyPrediction } from './../src/objects/reachfrequencyprediction'
export { default as TargetingSentenceLine } from './../src/objects/targetingsentenceline'
export { default as Transaction } from './../src/objects/transaction'
export { default as User } from './../src/objects/user'


================================================
FILE: src/core.js
================================================
import FacebookAdsApi from './api'

/**
 * Abstract Object
 * Manages object data fields and provides matching properties
 */
export class AbstractObject {

  constructor (data) {
    this._data = {}
    if (this.constructor.Field === undefined) {
      throw new Error('A "Field" frozen object must be defined in the object class')
    }
    this._fields = Object.keys(this.constructor.Field)
    this._fields.forEach((field) => {
      this._defineProperty(field)
    })
    if (data) {
      this.setData(data)
    }
  }

  /**
   * Define data getter and setter field
   * @param {String} field
   */
  _defineProperty (field) {
    Object.defineProperty(this, field, {
      get: () => this._data[field],
      set: (value) => { this._data[field] = value },
      enumerable: true
    })
  }

  /**
   * Set data field
   * @param {String} field
   * @param {Mixed} value
   * @return this
   */
  set (field, value) {
    if (this._fields.indexOf(field) < 0) {
      this._defineProperty(field)
    }
    this[field] = value
    return this
  }

  /**
   * Set multiple data fields
   * @param {Object} data
   * @return this
   */
  setData (data) {
    Object.keys(data).forEach((key) => {
      this.set(key, data[key])
    })
    return this
  }

  /**
   * Export object data
   * @return {Object}
   */
  exportData () {
    return this._data
  }
}

/**
 * Abstract Crud Object
 * Facebook Object basic persistence functions
 * @extends AbstractObject
 */
export class AbstractCrudObject extends AbstractObject {

  /**
   * @param  {Object} data Initial data
   * @param  {String} parentId
   * @param  {FacebookAdApi} [api]
   */
  constructor (data, parentId, api) {
    super(data)
    this._parentId = parentId
    this._api = api || FacebookAdsApi.getDefaultApi()
    if (data) {
      super.setData(data)
    }
  }

  /**
   * Define data getter and setter recording changes
   * @param {String} field
   */
  _defineProperty (field) {
    if (this._changes === undefined) {
      this._changes = {}
    }
    Object.defineProperty(this, field, {
      get: () => this._data[field],
      set: (value) => {
        this._changes[field] = value
        this._data[field] = value
      },
      enumerable: true
    })
  }

  /**
   * Set object data as if it were read from the server. Wipes related changes
   * @param {Object} data
   * @return this
   */
  setData (data) {
    super.setData(data)
    Object.keys(data).forEach((key) => {
      delete this._changes[key]
    })
    return this
  }

  /**
   * Export changed object data
   * @return {Object}
   */
  exportData () {
    return this._changes
  }

  /**
   * Export object data
   * @return {Object}
   */
  exportAllData () {
    return this._data
  }

  /**
   * Clear change history
   * @return this
   */
  clearHistory () {
    this._changes = {}
    return this
  }

  /**
   * @throws {Error} if object has no id
   * @return {String}
   */
  getId () {
    if (!this.id) {
      throw new Error(`${this.constructor.name} Id not defined`)
    }
    return this.id
  }

  /**
   * @throws {Error} if object has no parent id
   * @return {String}
   */
  getParentId () {
    if (!this._parentId) {
      throw new Error(`${this.constructor.name} parentId not defined`)
    }
    return this._parentId
  }

  /**
   * @return {String}
   */
  getNodePath () {
    return this.getId()
  }

  /**
   * Return object API instance
   * @throws {Error} if object doesn't hold an API
   * @return {FacebookAdsApi}
   */
  getApi () {
    const api = this._api
    if (!api) {
      throw new Error(`${this.constructor.name} does not yet have an associated api object.\n
        Did you forget to instantiate an API session with: "FacebookAdsApi.init"?`
      )
    }
    return api
  }

  /**
   * Read object data
   * @param   {Array}   [fields]
   * @param   {Object}  [params]
   * @return  {Promise}
   */
  read (fields, params = {}) {
    const api = this.getApi()
    const path = [this.getNodePath()]
    if (fields) params['fields'] = fields.join(',')
    return new Promise((resolve, reject) => {
      api.call('GET', path, params)
      .then((data) => resolve(this.setData(data)))
      .catch(reject)
    })
  }

  /**
   * Create object
   * @param   {Object}  [params]
   * @return  {Promise}
   */
  create (params = {}) {
    const api = this.getApi()
    const path = [this.getParentId(), this.constructor.getEndpoint()]
    params = Object.assign(params, this.exportData())
    return new Promise((resolve, reject) => {
      api.call('POST', path, params)
      .then((data) => {
        if (path.indexOf('adimages') > -1) {
          data = data.images[params.name]
        }
        resolve(this.setData(data))
      })
      .catch(reject)
    })
  }

  /**
   * Update object
   * @param   {Object}  [params]
   * @return  {Promise}
   */
  update (params = {}) {
    const api = this.getApi()
    const path = [this.getNodePath()]
    params = Object.assign(params, this.exportData())
    return new Promise((resolve, reject) => {
      api.call('POST', path, params)
      .then((data) => resolve(data))
      .catch(reject)
    })
  }

  /**
   * Delete object
   * @param   {Object}  [params]
   * @return  {Promise}
   */
  delete (params = {}) {
    const api = this.getApi()
    const path = [this.getNodePath()]
    params = Object.assign(params, this.exportData())
    return new Promise((resolve, reject) => {
      api.call('DELETE', path, params)
      .then((data) => resolve(data))
      .catch(reject)
    })
  }

  /**
   * Create or Update object
   * @param   {Object}  [params]
   * @return  {Promise}
   */
  save (params) {
    if (this.id) return this.update(params)
    return this.create(params)
  }

  /**
   * Initialize Cursor to paginate on edges
   * @param  {Object}  targetClass
   * @param  {Array}   [fields]
   * @param  {Object}  [params]
   * @param  {String}  [endpoint]
   * @return {Cursor}
   */
  getEdge (targetClass, fields, params = {}, enpoint) {
    if (fields) params['fields'] = fields.join(',')
    const sourceObject = this
    const cursor = new Cursor(sourceObject, targetClass, params, enpoint)
    return cursor.next()
  }

  /**
   * Read Objects by Ids
   * @param  {Array}          ids
   * @param  {Array}          [fields]
   * @param  {Object}         [params]
   * @param  {FacebookAdsApi} [api]
   * @return {Promise}
   */
  static getByIds (ids, fields, params = {}, api) {
    api = api || FacebookAdsApi.getDefaultApi()
    if (fields) params['fields'] = fields.join(',')
    params['ids'] = ids.join(',')
    return new Promise((resolve, reject) => {
      return api.call('GET', [''], params)
      .then((response) => {
        var result = []
        for (let id in response) {
          let data = response[id]
          let object = new this(data)
          result.push(object)
        }
        resolve(result)
      })
      .catch(reject)
    })
  }
}

/**
 * Cursor
 * Iterates over edge objects and controls pagination
 */
export class Cursor extends Array {

  /**
   * @param  {Object} sourceObject
   * @param  {Object} targetClass
   * @param  {Object} [params]
   * @param  {String} [endpoint]
   */
  constructor (sourceObject, targetClass, params, endpoint) {
    super(0)
    const next = [sourceObject.getId()]
    next.push(endpoint || targetClass.getEndpoint())
    this._api = sourceObject.getApi()
    this._targetClass = targetClass
    this.paging = {next: next}
    this.summary

    this.clear = () => {
      this.length = 0
    }

    this.set = (array) => {
      this.clear()
      this.push(...array)
    }

    this.next = () => {
      if (!this.hasNext()) {
        return Promise.reject(new RangeError('end of pagination'))
      }
      return this._loadPage(this.paging.next)
    }

    this.hasNext = () => {
      return Boolean(this.paging) && Boolean(this.paging.next)
    }

    this.previous = () => {
      if (!this.hasPrevious()) {
        return Promise.reject(new RangeError('start of pagination'))
      }
      return this._loadPage(this.paging.previous)
    }

    this.hasPrevious = () => {
      return Boolean(this.paging) && Boolean(this.paging.previous)
    }

    this._loadPage = (path) => {
      const promise = new Promise((resolve, reject) => {
        this._api.call('GET', path, params)
        .then((response) => {
          const objects = this._buildObjectsFromResponse(response)
          this.set(objects)
          this.paging = response.paging
          this.summary = response.summary
          resolve(this)
        })
        .catch(reject)
      })
      if (params) params = undefined
      return promise
    }

    this._buildObjectsFromResponse = (response) => {
      return response.data.map((item) => new this._targetClass(item, undefined, this._api))
    }
  }
}


================================================
FILE: src/exceptions.js
================================================
function FacebookError (error) {
  this.name = 'FacebookError'
  this.message = error.message
  this.stack = (new Error()).stack
}
FacebookError.prototype = Object.create(Error.prototype)
FacebookError.prototype.constructor = FacebookError

/**
 * Raised when an api request fails.
 */
export class FacebookRequestError extends FacebookError {

  /**
   * @param  {[Object}  response
   * @param  {String}   method
   * @param  {String}   url
   * @param  {Object}   data
   */
  constructor (response, method, url, data) {
    let error = response.body.error
    let message = error.error_user_msg
      ? `${error.error_user_title}: ${error.error_user_msg}`
      : error.message
    super(message)
    this.name = 'FacebookRequestError'
    this.message = message
    this.status = response.status
    this.response = response.body
    this.method = method
    this.url = url
    if (data) this.data = data
  }
}


================================================
FILE: src/globals.es6
================================================
import './../src/api'
import './../src/objects/ad'
import './../src/objects/adaccount'
import './../src/objects/adaccountroas'
import './../src/objects/adaccounttargetingunified'
import './../src/objects/adaccountuser'
import './../src/objects/adactivity'
import './../src/objects/adasyncrequest'
import './../src/objects/adasyncrequestset'
import './../src/objects/adcreative'
import './../src/objects/adimage'
import './../src/objects/adkeywordstats'
import './../src/objects/adlabel'
import './../src/objects/adplacepageset'
import './../src/objects/adpreview'
import './../src/objects/adreportrun'
import './../src/objects/adsdatapartner'
import './../src/objects/adset'
import './../src/objects/adsinsights'
import './../src/objects/adspixel'
import './../src/objects/adspixelstatsresult'
import './../src/objects/broadtargetingcategories'
import './../src/objects/business'
import './../src/objects/businessadaccountrequest'
import './../src/objects/businesspagerequest'
import './../src/objects/campaign'
import './../src/objects/customaudience'
import './../src/objects/customaudienceprefillstate'
import './../src/objects/customaudiencesession'
import './../src/objects/customaudiencestos'
import './../src/objects/domain'
import './../src/objects/event'
import './../src/objects/eventsourcegroup'
import './../src/objects/externaleventsource'
import './../src/objects/hotel'
import './../src/objects/lead'
import './../src/objects/leadgenform'
import './../src/objects/legacybusinessadaccountrequest'
import './../src/objects/minimumbudget'
import './../src/objects/offsitepixel'
import './../src/objects/partnercategory'
import './../src/objects/productcatalog'
import './../src/objects/productcataloghotelroomsbatch'
import './../src/objects/productcatalogpricingvariablesbatch'
import './../src/objects/productfeed'
import './../src/objects/productfeedupload'
import './../src/objects/productfeeduploaderror'
import './../src/objects/productfeeduploaderrorsample'
import './../src/objects/productgroup'
import './../src/objects/productitem'
import './../src/objects/productset'
import './../src/objects/profilepicturesource'
import './../src/objects/ratecard'
import './../src/objects/reachestimate'
import './../src/objects/reachfrequencyprediction'
import './../src/objects/targetingsentenceline'
import './../src/objects/transaction'
import './../src/objects/user'


================================================
FILE: src/http.js
================================================
import Api from './api'

/**
 * Isomorphic Http Promise Requests Class
 */
export default class Http {

  /**
   * Request
   * @param   {String}  method
   * @param   {String}  url
   * @param   {Object}  [data]
   * @return  {Promise}
   */
  static request (method, url, data) {
    if (typeof window !== 'undefined' && window.XMLHttpRequest) {
      return Http.xmlHttpRequest(method, url, data)
    }
    return Http.requestPromise(method, url, data)
  }

  /**
   * XmlHttpRequest request
   * @param   {String}  method
   * @param   {String}  url
   * @param   {Object}  [data]
   * @return  {Promise}
   */
  static xmlHttpRequest (method, url, data) {
    return new Promise((resolve, reject) => {
      const request = new window.XMLHttpRequest()
      request.open(method, url)
      request.onload = function () {
        try {
          const response = JSON.parse(request.response)

          if (request.status === 200) {
            resolve(response)
          } else {
            reject({
              body: response,
              status: request.status
            })
          }
        } catch (e) {
          reject({
            body: request.responseText,
            status: request.status
          })
        }
      }
      request.onerror = function () {
        reject({
          body: { error: { message: 'An unknown error occurred during the request.' } },
          status: request.status
        })
      }
      request.setRequestHeader('Content-Type', 'application/json')
      request.setRequestHeader('Accept', 'application/json')
      request.send(JSON.stringify(data))
    })
  }

  /**
   * Request Promise
   * @param   {String}  method
   * @param   {String}  url
   * @param   {Object}  [data]
   * @return  {Promise}
   */
  static requestPromise (method, url, data) {
    const rp = require('request-promise')
    const options = {
      method: method,
      uri: url,
      json: true,
      headers: { 'User-Agent': 'Facebook-JS-Ads-SDK/' + Api.VERSION }
    }
    if (data) {
      options.body = data
    }
    return rp(options).catch((response) => {
      response = {
        body: response.error ? response.error : response,
        status: response.statusCode
      }
      throw response
    })
  }

}


================================================
FILE: src/mixins.js
================================================


================================================
FILE: src/objects/ad.js
================================================
import { AbstractCrudObject } from './../core'
import AdCreative from './adcreative'
import AdKeywordStats from './adkeywordstats'
import AdPreview from './adpreview'
import AdReportRun from './adreportrun'
import AdsInsights from './adsinsights'
import Lead from './lead'
import TargetingSentenceLine from './targetingsentenceline'

export default class Ad extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      ad_review_feedback: 'ad_review_feedback',
      adlabels: 'adlabels',
      adset: 'adset',
      adset_id: 'adset_id',
      adset_spec: 'adset_spec',
      bid_amount: 'bid_amount',
      bid_info: 'bid_info',
      bid_type: 'bid_type',
      campaign: 'campaign',
      campaign_id: 'campaign_id',
      configured_status: 'configured_status',
      conversion_specs: 'conversion_specs',
      created_time: 'created_time',
      creative: 'creative',
      date_format: 'date_format',
      display_sequence: 'display_sequence',
      effective_status: 'effective_status',
      execution_options: 'execution_options',
      filename: 'filename',
      id: 'id',
      last_updated_by_app_id: 'last_updated_by_app_id',
      name: 'name',
      recommendations: 'recommendations',
      redownload: 'redownload',
      status: 'status',
      tracking_specs: 'tracking_specs',
      updated_time: 'updated_time'
    })
  }

  static get BidType () {
    return Object.freeze({
      absolute_ocpm: 'ABSOLUTE_OCPM',
      cpa: 'CPA',
      cpc: 'CPC',
      cpm: 'CPM',
      multi_premium: 'MULTI_PREMIUM'
    })
  }

  static get ConfiguredStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get EffectiveStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      adset_paused: 'ADSET_PAUSED',
      archived: 'ARCHIVED',
      campaign_paused: 'CAMPAIGN_PAUSED',
      deleted: 'DELETED',
      disapproved: 'DISAPPROVED',
      paused: 'PAUSED',
      pending_billing_info: 'PENDING_BILLING_INFO',
      pending_review: 'PENDING_REVIEW',
      preapproved: 'PREAPPROVED'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get DatePreset () {
    return Object.freeze({
      last_14d: 'last_14d',
      last_28d: 'last_28d',
      last_30d: 'last_30d',
      last_3d: 'last_3d',
      last_7d: 'last_7d',
      last_90d: 'last_90d',
      last_month: 'last_month',
      last_quarter: 'last_quarter',
      last_week_mon_sun: 'last_week_mon_sun',
      last_week_sun_sat: 'last_week_sun_sat',
      last_year: 'last_year',
      lifetime: 'lifetime',
      this_month: 'this_month',
      this_quarter: 'this_quarter',
      this_week_mon_today: 'this_week_mon_today',
      this_week_sun_today: 'this_week_sun_today',
      this_year: 'this_year',
      today: 'today',
      yesterday: 'yesterday'
    })
  }

  static get ExecutionOptions () {
    return Object.freeze({
      include_recommendations: 'include_recommendations',
      synchronous_ad_review: 'synchronous_ad_review',
      validate_only: 'validate_only'
    })
  }

  static get Operator () {
    return Object.freeze({
      all: 'ALL',
      any: 'ANY'
    })
  }

  static getEndpoint () {
    return 'ads'
  }

  getAdCreatives (fields, params) {
    return this.getEdge(AdCreative, fields, params, 'adcreatives')
  }

  getInsights (fields, params) {
    return this.getEdge(AdsInsights, fields, params, 'insights')
  }

  getInsightsAsync (fields, params) {
    return this.getEdge(AdReportRun, fields, params, 'insights')
  }

  getKeywordStats (fields, params) {
    return this.getEdge(AdKeywordStats, fields, params, 'keywordstats')
  }

  getLeads (fields, params) {
    return this.getEdge(Lead, fields, params, 'leads')
  }

  getPreviews (fields, params) {
    return this.getEdge(AdPreview, fields, params, 'previews')
  }

  getTargetingSentenceLines (fields, params) {
    return this.getEdge(TargetingSentenceLine, fields, params, 'targetingsentencelines')
  }

}


================================================
FILE: src/objects/adaccount.js
================================================
import { AbstractCrudObject } from './../core'
import Ad from './ad'
import AdAccountRoas from './adaccountroas'
import AdAccountTargetingUnified from './adaccounttargetingunified'
import AdAccountUser from './adaccountuser'
import AdActivity from './adactivity'
import AdAsyncRequestSet from './adasyncrequestset'
import AdCreative from './adcreative'
import AdImage from './adimage'
import AdLabel from './adlabel'
import AdPlacePageSet from './adplacepageset'
import AdPreview from './adpreview'
import AdReportRun from './adreportrun'
import AdsDataPartner from './adsdatapartner'
import AdSet from './adset'
import AdsInsights from './adsinsights'
import AdsPixel from './adspixel'
import BroadTargetingCategories from './broadtargetingcategories'
import Campaign from './campaign'
import CustomAudience from './customaudience'
import CustomAudiencesTOS from './customaudiencestos'
import LeadgenForm from './leadgenform'
import MinimumBudget from './minimumbudget'
import OffsitePixel from './offsitepixel'
import PartnerCategory from './partnercategory'
import RateCard from './ratecard'
import ReachEstimate from './reachestimate'
import ReachFrequencyPrediction from './reachfrequencyprediction'
import TargetingSentenceLine from './targetingsentenceline'
import Transaction from './transaction'

export default class AdAccount extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      account_status: 'account_status',
      age: 'age',
      agency_client_declaration: 'agency_client_declaration',
      amount_spent: 'amount_spent',
      balance: 'balance',
      business: 'business',
      business_city: 'business_city',
      business_country_code: 'business_country_code',
      business_name: 'business_name',
      business_state: 'business_state',
      business_street: 'business_street',
      business_street2: 'business_street2',
      business_zip: 'business_zip',
      can_create_brand_lift_study: 'can_create_brand_lift_study',
      capabilities: 'capabilities',
      created_time: 'created_time',
      currency: 'currency',
      disable_reason: 'disable_reason',
      end_advertiser: 'end_advertiser',
      end_advertiser_name: 'end_advertiser_name',
      failed_delivery_checks: 'failed_delivery_checks',
      funding_source: 'funding_source',
      funding_source_details: 'funding_source_details',
      has_migrated_permissions: 'has_migrated_permissions',
      id: 'id',
      io_number: 'io_number',
      is_notifications_enabled: 'is_notifications_enabled',
      is_personal: 'is_personal',
      is_prepay_account: 'is_prepay_account',
      is_tax_id_required: 'is_tax_id_required',
      line_numbers: 'line_numbers',
      media_agency: 'media_agency',
      min_campaign_group_spend_cap: 'min_campaign_group_spend_cap',
      min_daily_budget: 'min_daily_budget',
      name: 'name',
      offsite_pixels_tos_accepted: 'offsite_pixels_tos_accepted',
      owner: 'owner',
      partner: 'partner',
      rf_spec: 'rf_spec',
      salesforce_invoice_group_id: 'salesforce_invoice_group_id',
      show_checkout_experience: 'show_checkout_experience',
      spend_cap: 'spend_cap',
      tax_id: 'tax_id',
      tax_id_status: 'tax_id_status',
      tax_id_type: 'tax_id_type',
      timezone_id: 'timezone_id',
      timezone_name: 'timezone_name',
      timezone_offset_hours_utc: 'timezone_offset_hours_utc',
      tos_accepted: 'tos_accepted',
      user_role: 'user_role'
    })
  }

  static get AccessType () {
    return Object.freeze({
      agency: 'AGENCY',
      owner: 'OWNER'
    })
  }

  static get PermittedRoles () {
    return Object.freeze({
      admin: 'ADMIN',
      fb_employee_dso_advertiser: 'FB_EMPLOYEE_DSO_ADVERTISER',
      general_user: 'GENERAL_USER',
      instagram_advertiser: 'INSTAGRAM_ADVERTISER',
      instagram_manager: 'INSTAGRAM_MANAGER',
      reports_only: 'REPORTS_ONLY'
    })
  }

  static getEndpoint () {
    return 'adaccounts'
  }

  getActivities (fields, params) {
    return this.getEdge(AdActivity, fields, params, 'activities')
  }

  getAdCreatives (fields, params) {
    return this.getEdge(AdCreative, fields, params, 'adcreatives')
  }

  getAdCreativesByLabels (fields, params) {
    return this.getEdge(AdCreative, fields, params, 'adcreativesbylabels')
  }

  getAdImages (fields, params) {
    return this.getEdge(AdImage, fields, params, 'adimages')
  }

  getAdLabels (fields, params) {
    return this.getEdge(AdLabel, fields, params, 'adlabels')
  }

  getAdPlacePageSets (fields, params) {
    return this.getEdge(AdPlacePageSet, fields, params, 'ad_place_page_sets')
  }

  getAdReportRuns (fields, params) {
    return this.getEdge(AdReportRun, fields, params, 'adreportruns')
  }

  getAdReportSchedules (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'adreportschedules')
  }

  getAdSets (fields, params) {
    return this.getEdge(AdSet, fields, params, 'adsets')
  }

  getAdSetsByLabels (fields, params) {
    return this.getEdge(AdSet, fields, params, 'adsetsbylabels')
  }

  getAdVideos (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'advideos')
  }

  getAds (fields, params) {
    return this.getEdge(Ad, fields, params, 'ads')
  }

  getAdsByLabels (fields, params) {
    return this.getEdge(Ad, fields, params, 'adsbylabels')
  }

  getAdsPixels (fields, params) {
    return this.getEdge(AdsPixel, fields, params, 'adspixels')
  }

  getAdvertisableApplications (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'advertisable_applications')
  }

  getApplications (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'applications')
  }

  getAsyncAdRequestSets (fields, params) {
    return this.getEdge(AdAsyncRequestSet, fields, params, 'asyncadrequestsets')
  }

  getBroadTargetingCategories (fields, params) {
    return this.getEdge(BroadTargetingCategories, fields, params, 'broadtargetingcategories')
  }

  getCampaigns (fields, params) {
    return this.getEdge(Campaign, fields, params, 'campaigns')
  }

  getCampaignsByLabels (fields, params) {
    return this.getEdge(Campaign, fields, params, 'campaignsbylabels')
  }

  getCustomAudiences (fields, params) {
    return this.getEdge(CustomAudience, fields, params, 'customaudiences')
  }

  getCustomAudiencesTos (fields, params) {
    return this.getEdge(CustomAudiencesTOS, fields, params, 'customaudiencestos')
  }

  getGeneratePreviews (fields, params) {
    return this.getEdge(AdPreview, fields, params, 'generatepreviews')
  }

  getInsights (fields, params) {
    return this.getEdge(AdsInsights, fields, params, 'insights')
  }

  getInsightsAsync (fields, params) {
    return this.getEdge(AdReportRun, fields, params, 'insights')
  }

  getInstagramAccounts (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'instagram_accounts')
  }

  getLeadGenForms (fields, params) {
    return this.getEdge(LeadgenForm, fields, params, 'leadgen_forms')
  }

  getMinimumBudgets (fields, params) {
    return this.getEdge(MinimumBudget, fields, params, 'minimum_budgets')
  }

  getOfflineConversionDataSets (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'offline_conversion_data_sets')
  }

  getOffsitePixels (fields, params) {
    return this.getEdge(OffsitePixel, fields, params, 'offsitepixels')
  }

  getPartnerCategories (fields, params) {
    return this.getEdge(PartnerCategory, fields, params, 'partnercategories')
  }

  getPartners (fields, params) {
    return this.getEdge(AdsDataPartner, fields, params, 'partners')
  }

  getPublisherBlockLists (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'publisher_block_lists')
  }

  getRateCard (fields, params) {
    return this.getEdge(RateCard, fields, params, 'ratecard')
  }

  getReachEstimate (fields, params) {
    return this.getEdge(ReachEstimate, fields, params, 'reachestimate')
  }

  getReachFrequencyPredictions (fields, params) {
    return this.getEdge(ReachFrequencyPrediction, fields, params, 'reachfrequencypredictions')
  }

  getRoas (fields, params) {
    return this.getEdge(AdAccountRoas, fields, params, 'roas')
  }

  getTargetingBrowse (fields, params) {
    return this.getEdge(AdAccountTargetingUnified, fields, params, 'targetingbrowse')
  }

  getTargetingSearch (fields, params) {
    return this.getEdge(AdAccountTargetingUnified, fields, params, 'targetingsearch')
  }

  getTargetingSentenceLines (fields, params) {
    return this.getEdge(TargetingSentenceLine, fields, params, 'targetingsentencelines')
  }

  getTargetingSuggestions (fields, params) {
    return this.getEdge(AdAccountTargetingUnified, fields, params, 'targetingsuggestions')
  }

  getTargetingValidation (fields, params) {
    return this.getEdge(AdAccountTargetingUnified, fields, params, 'targetingvalidation')
  }

  getTransactions (fields, params) {
    return this.getEdge(Transaction, fields, params, 'transactions')
  }

  getUsers (fields, params) {
    return this.getEdge(AdAccountUser, fields, params, 'users')
  }

}


================================================
FILE: src/objects/adaccountroas.js
================================================
import { AbstractObject } from './../core'

export default class AdAccountRoas extends AbstractObject {

  static get Field () {
    return Object.freeze({
      adgroup_id: 'adgroup_id',
      arpu_180d: 'arpu_180d',
      arpu_1d: 'arpu_1d',
      arpu_30d: 'arpu_30d',
      arpu_365d: 'arpu_365d',
      arpu_3d: 'arpu_3d',
      arpu_7d: 'arpu_7d',
      arpu_90d: 'arpu_90d',
      campaign_group_id: 'campaign_group_id',
      campaign_id: 'campaign_id',
      date_start: 'date_start',
      date_stop: 'date_stop',
      installs: 'installs',
      revenue: 'revenue',
      revenue_180d: 'revenue_180d',
      revenue_1d: 'revenue_1d',
      revenue_30d: 'revenue_30d',
      revenue_365d: 'revenue_365d',
      revenue_3d: 'revenue_3d',
      revenue_7d: 'revenue_7d',
      revenue_90d: 'revenue_90d',
      spend: 'spend',
      yield_180d: 'yield_180d',
      yield_1d: 'yield_1d',
      yield_30d: 'yield_30d',
      yield_365d: 'yield_365d',
      yield_3d: 'yield_3d',
      yield_7d: 'yield_7d',
      yield_90d: 'yield_90d'
    })
  }

  static get Fields () {
    return Object.freeze({
      adgroup_id: 'adgroup_id',
      arpu_180d: 'arpu_180d',
      arpu_1d: 'arpu_1d',
      arpu_30d: 'arpu_30d',
      arpu_365d: 'arpu_365d',
      arpu_3d: 'arpu_3d',
      arpu_7d: 'arpu_7d',
      arpu_90d: 'arpu_90d',
      campaign_group_id: 'campaign_group_id',
      campaign_id: 'campaign_id',
      date_start: 'date_start',
      date_stop: 'date_stop',
      installs: 'installs',
      revenue: 'revenue',
      revenue_180d: 'revenue_180d',
      revenue_1d: 'revenue_1d',
      revenue_30d: 'revenue_30d',
      revenue_365d: 'revenue_365d',
      revenue_3d: 'revenue_3d',
      revenue_7d: 'revenue_7d',
      revenue_90d: 'revenue_90d',
      spend: 'spend',
      yield_180d: 'yield_180d',
      yield_1d: 'yield_1d',
      yield_30d: 'yield_30d',
      yield_365d: 'yield_365d',
      yield_3d: 'yield_3d',
      yield_7d: 'yield_7d',
      yield_90d: 'yield_90d'
    })
  }

}


================================================
FILE: src/objects/adaccounttargetingunified.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdAccountTargetingUnified extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      audience_size: 'audience_size',
      description: 'description',
      id: 'id',
      name: 'name',
      path: 'path',
      type: 'type',
      valid: 'valid'
    })
  }

  static get LimitType () {
    return Object.freeze({
      adgroup_id: 'adgroup_id',
      age_max: 'age_max',
      age_min: 'age_min',
      alternate_auto_targeting_option: 'alternate_auto_targeting_option',
      app_install_state: 'app_install_state',
      audience_network_positions: 'audience_network_positions',
      behaviors: 'behaviors',
      cities: 'cities',
      college_years: 'college_years',
      conjunctive_user_adclusters: 'conjunctive_user_adclusters',
      connections: 'connections',
      countries: 'countries',
      country: 'country',
      country_groups: 'country_groups',
      custom_audiences: 'custom_audiences',
      device_platforms: 'device_platforms',
      dynamic_audience_ids: 'dynamic_audience_ids',
      education_majors: 'education_majors',
      education_schools: 'education_schools',
      education_statuses: 'education_statuses',
      effective_audience_network_positions: 'effective_audience_network_positions',
      effective_device_platforms: 'effective_device_platforms',
      effective_facebook_positions: 'effective_facebook_positions',
      effective_instagram_positions: 'effective_instagram_positions',
      effective_messenger_positions: 'effective_messenger_positions',
      effective_publisher_platforms: 'effective_publisher_platforms',
      engagement_specs: 'engagement_specs',
      ethnic_affinity: 'ethnic_affinity',
      exclude_previous_days: 'exclude_previous_days',
      exclude_reached_since: 'exclude_reached_since',
      excluded_connections: 'excluded_connections',
      excluded_custom_audiences: 'excluded_custom_audiences',
      excluded_dynamic_audience_ids: 'excluded_dynamic_audience_ids',
      excluded_engagement_specs: 'excluded_engagement_specs',
      excluded_geo_locations: 'excluded_geo_locations',
      excluded_mobile_device_model: 'excluded_mobile_device_model',
      excluded_product_audience_specs: 'excluded_product_audience_specs',
      excluded_publisher_categories: 'excluded_publisher_categories',
      excluded_publisher_domains: 'excluded_publisher_domains',
      excluded_publisher_list_ids: 'excluded_publisher_list_ids',
      excluded_user_adclusters: 'excluded_user_adclusters',
      excluded_user_device: 'excluded_user_device',
      exclusions: 'exclusions',
      facebook_positions: 'facebook_positions',
      family_statuses: 'family_statuses',
      fb_deal_id: 'fb_deal_id',
      flexible_spec: 'flexible_spec',
      friends_of_connections: 'friends_of_connections',
      genders: 'genders',
      generation: 'generation',
      geo_locations: 'geo_locations',
      home_ownership: 'home_ownership',
      home_type: 'home_type',
      home_value: 'home_value',
      household_composition: 'household_composition',
      income: 'income',
      industries: 'industries',
      instagram_positions: 'instagram_positions',
      interest_defaults_source: 'interest_defaults_source',
      interested_in: 'interested_in',
      interests: 'interests',
      keywords: 'keywords',
      life_events: 'life_events',
      locales: 'locales',
      messenger_positions: 'messenger_positions',
      mobile_device_model: 'mobile_device_model',
      moms: 'moms',
      net_worth: 'net_worth',
      office_type: 'office_type',
      page_types: 'page_types',
      place_page_set_ids: 'place_page_set_ids',
      political_views: 'political_views',
      politics: 'politics',
      product_audience_specs: 'product_audience_specs',
      publisher_platforms: 'publisher_platforms',
      publisher_visibility_categories: 'publisher_visibility_categories',
      radius: 'radius',
      regions: 'regions',
      relationship_statuses: 'relationship_statuses',
      rtb_flag: 'rtb_flag',
      site_category: 'site_category',
      targeting_optimization: 'targeting_optimization',
      timezones: 'timezones',
      user_adclusters: 'user_adclusters',
      user_device: 'user_device',
      user_event: 'user_event',
      user_os: 'user_os',
      wireless_carrier: 'wireless_carrier',
      work_employers: 'work_employers',
      work_positions: 'work_positions',
      zips: 'zips'
    })
  }

}


================================================
FILE: src/objects/adaccountuser.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdAccountUser extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      name: 'name',
      permissions: 'permissions',
      role: 'role'
    })
  }

  static getEndpoint () {
    return 'users'
  }

}


================================================
FILE: src/objects/adactivity.js
================================================
import { AbstractObject } from './../core'

export default class AdActivity extends AbstractObject {

  static get Field () {
    return Object.freeze({
      actor_id: 'actor_id',
      actor_name: 'actor_name',
      application_id: 'application_id',
      application_name: 'application_name',
      date_time_in_timezone: 'date_time_in_timezone',
      event_time: 'event_time',
      event_type: 'event_type',
      extra_data: 'extra_data',
      object_id: 'object_id',
      object_name: 'object_name',
      translated_event_type: 'translated_event_type'
    })
  }

  static get EventType () {
    return Object.freeze({
      account_spending_limit_reached: 'account_spending_limit_reached',
      ad_account_add_user_to_role: 'ad_account_add_user_to_role',
      ad_account_billing_charge: 'ad_account_billing_charge',
      ad_account_billing_charge_failed: 'ad_account_billing_charge_failed',
      ad_account_billing_chargeback: 'ad_account_billing_chargeback',
      ad_account_billing_chargeback_reversal: 'ad_account_billing_chargeback_reversal',
      ad_account_billing_decline: 'ad_account_billing_decline',
      ad_account_billing_refund: 'ad_account_billing_refund',
      ad_account_remove_spend_limit: 'ad_account_remove_spend_limit',
      ad_account_remove_user_from_role: 'ad_account_remove_user_from_role',
      ad_account_reset_spend_limit: 'ad_account_reset_spend_limit',
      ad_account_set_business_information: 'ad_account_set_business_information',
      ad_account_update_spend_limit: 'ad_account_update_spend_limit',
      ad_account_update_status: 'ad_account_update_status',
      ad_review_approved: 'ad_review_approved',
      ad_review_declined: 'ad_review_declined',
      add_funding_source: 'add_funding_source',
      add_images: 'add_images',
      billing_event: 'billing_event',
      campaign_spending_limit_reached: 'campaign_spending_limit_reached',
      create_ad: 'create_ad',
      create_ad_set: 'create_ad_set',
      create_audience: 'create_audience',
      create_campaign: 'create_campaign',
      create_campaign_group: 'create_campaign_group',
      create_campaign_legacy: 'create_campaign_legacy',
      delete_audience: 'delete_audience',
      delete_images: 'delete_images',
      edit_and_update_ad_creative: 'edit_and_update_ad_creative',
      edit_images: 'edit_images',
      first_delivery_event: 'first_delivery_event',
      funding_event_initiated: 'funding_event_initiated',
      funding_event_successful: 'funding_event_successful',
      lifetime_budget_spent: 'lifetime_budget_spent',
      receive_audience: 'receive_audience',
      remove_funding_source: 'remove_funding_source',
      remove_shared_audience: 'remove_shared_audience',
      share_audience: 'share_audience',
      unknown: 'unknown',
      unshare_audience: 'unshare_audience',
      update_ad_bid_info: 'update_ad_bid_info',
      update_ad_bid_type: 'update_ad_bid_type',
      update_ad_creative: 'update_ad_creative',
      update_ad_friendly_name: 'update_ad_friendly_name',
      update_ad_labels: 'update_ad_labels',
      update_ad_run_status: 'update_ad_run_status',
      update_ad_set_bidding: 'update_ad_set_bidding',
      update_ad_set_budget: 'update_ad_set_budget',
      update_ad_set_duration: 'update_ad_set_duration',
      update_ad_set_name: 'update_ad_set_name',
      update_ad_set_run_status: 'update_ad_set_run_status',
      update_ad_set_target_spec: 'update_ad_set_target_spec',
      update_ad_targets_spec: 'update_ad_targets_spec',
      update_adgroup_stop_delivery: 'update_adgroup_stop_delivery',
      update_audience: 'update_audience',
      update_campaign_budget: 'update_campaign_budget',
      update_campaign_duration: 'update_campaign_duration',
      update_campaign_group_spend_cap: 'update_campaign_group_spend_cap',
      update_campaign_name: 'update_campaign_name',
      update_campaign_run_status: 'update_campaign_run_status'
    })
  }

  static get Category () {
    return Object.freeze({
      account: 'ACCOUNT',
      ad: 'AD',
      ad_set: 'AD_SET',
      audience: 'AUDIENCE',
      bid: 'BID',
      budget: 'BUDGET',
      campaign: 'CAMPAIGN',
      date: 'DATE',
      status: 'STATUS',
      targeting: 'TARGETING'
    })
  }

}


================================================
FILE: src/objects/adasyncrequest.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdAsyncRequest extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      async_request_set: 'async_request_set',
      created_time: 'created_time',
      id: 'id',
      input: 'input',
      result: 'result',
      scope_object_id: 'scope_object_id',
      status: 'status',
      updated_time: 'updated_time'
    })
  }

  static get Status () {
    return Object.freeze({
      canceled: 'CANCELED',
      canceled_dependency: 'CANCELED_DEPENDENCY',
      error: 'ERROR',
      error_conflicts: 'ERROR_CONFLICTS',
      error_dependency: 'ERROR_DEPENDENCY',
      in_progress: 'IN_PROGRESS',
      initial: 'INITIAL',
      pending_dependency: 'PENDING_DEPENDENCY',
      success: 'SUCCESS'
    })
  }

  static get Statuses () {
    return Object.freeze({
      canceled: 'CANCELED',
      canceled_dependency: 'CANCELED_DEPENDENCY',
      error: 'ERROR',
      error_conflicts: 'ERROR_CONFLICTS',
      error_dependency: 'ERROR_DEPENDENCY',
      in_progress: 'IN_PROGRESS',
      initial: 'INITIAL',
      pending_dependency: 'PENDING_DEPENDENCY',
      success: 'SUCCESS'
    })
  }

}


================================================
FILE: src/objects/adasyncrequestset.js
================================================
import { AbstractCrudObject } from './../core'
import AdAsyncRequest from './adasyncrequest'

export default class AdAsyncRequestSet extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      ad_specs: 'ad_specs',
      canceled_count: 'canceled_count',
      created_time: 'created_time',
      error_count: 'error_count',
      id: 'id',
      in_progress_count: 'in_progress_count',
      initial_count: 'initial_count',
      is_completed: 'is_completed',
      name: 'name',
      notification_mode: 'notification_mode',
      notification_result: 'notification_result',
      notification_status: 'notification_status',
      notification_uri: 'notification_uri',
      owner_id: 'owner_id',
      success_count: 'success_count',
      total_count: 'total_count',
      updated_time: 'updated_time'
    })
  }

  static get NotificationMode () {
    return Object.freeze({
      off: 'OFF',
      on_complete: 'ON_COMPLETE'
    })
  }

  static get NotificationStatus () {
    return Object.freeze({
      not_sent: 'NOT_SENT',
      sending: 'SENDING',
      sent: 'SENT'
    })
  }

  static getEndpoint () {
    return 'asyncadrequestsets'
  }

  getRequests (fields, params) {
    return this.getEdge(AdAsyncRequest, fields, params, 'requests')
  }

}


================================================
FILE: src/objects/adcreative.js
================================================
import { AbstractCrudObject } from './../core'
import AdPreview from './adpreview'

export default class AdCreative extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      actor_id: 'actor_id',
      adlabels: 'adlabels',
      applink_treatment: 'applink_treatment',
      body: 'body',
      call_to_action: 'call_to_action',
      call_to_action_type: 'call_to_action_type',
      dynamic_ad_voice: 'dynamic_ad_voice',
      effective_instagram_story_id: 'effective_instagram_story_id',
      effective_object_story_id: 'effective_object_story_id',
      id: 'id',
      image_crops: 'image_crops',
      image_file: 'image_file',
      image_hash: 'image_hash',
      image_url: 'image_url',
      instagram_actor_id: 'instagram_actor_id',
      instagram_permalink_url: 'instagram_permalink_url',
      instagram_story_id: 'instagram_story_id',
      link_og_id: 'link_og_id',
      link_url: 'link_url',
      name: 'name',
      object_id: 'object_id',
      object_story_id: 'object_story_id',
      object_story_spec: 'object_story_spec',
      object_type: 'object_type',
      object_url: 'object_url',
      platform_customizations: 'platform_customizations',
      product_set_id: 'product_set_id',
      status: 'status',
      template_url: 'template_url',
      template_url_spec: 'template_url_spec',
      thumbnail_url: 'thumbnail_url',
      title: 'title',
      url_tags: 'url_tags',
      use_page_actor_override: 'use_page_actor_override',
      video_id: 'video_id'
    })
  }

  static get ApplinkTreatment () {
    return Object.freeze({
      deeplink_with_appstore_fallback: 'deeplink_with_appstore_fallback',
      deeplink_with_web_fallback: 'deeplink_with_web_fallback',
      web_only: 'web_only'
    })
  }

  static get CallToActionType () {
    return Object.freeze({
      apply_now: 'APPLY_NOW',
      book_travel: 'BOOK_TRAVEL',
      buy_now: 'BUY_NOW',
      call_now: 'CALL_NOW',
      contact_us: 'CONTACT_US',
      donate_now: 'DONATE_NOW',
      download: 'DOWNLOAD',
      get_directions: 'GET_DIRECTIONS',
      get_offer: 'GET_OFFER',
      get_offer_view: 'GET_OFFER_VIEW',
      get_quote: 'GET_QUOTE',
      install_app: 'INSTALL_APP',
      install_mobile_app: 'INSTALL_MOBILE_APP',
      learn_more: 'LEARN_MORE',
      like_page: 'LIKE_PAGE',
      listen_music: 'LISTEN_MUSIC',
      message_page: 'MESSAGE_PAGE',
      message_user: 'MESSAGE_USER',
      no_button: 'NO_BUTTON',
      open_link: 'OPEN_LINK',
      open_movies: 'OPEN_MOVIES',
      play_game: 'PLAY_GAME',
      record_now: 'RECORD_NOW',
      register_now: 'REGISTER_NOW',
      request_time: 'REQUEST_TIME',
      see_menu: 'SEE_MENU',
      sell_now: 'SELL_NOW',
      shop_now: 'SHOP_NOW',
      sign_up: 'SIGN_UP',
      subscribe: 'SUBSCRIBE',
      use_app: 'USE_APP',
      use_mobile_app: 'USE_MOBILE_APP',
      vote_now: 'VOTE_NOW',
      watch_more: 'WATCH_MORE'
    })
  }

  static get ObjectType () {
    return Object.freeze({
      application: 'APPLICATION',
      domain: 'DOMAIN',
      event: 'EVENT',
      invalid: 'INVALID',
      offer: 'OFFER',
      page: 'PAGE',
      photo: 'PHOTO',
      share: 'SHARE',
      status: 'STATUS',
      store_item: 'STORE_ITEM',
      video: 'VIDEO'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      deleted: 'DELETED'
    })
  }

  static get DynamicAdVoice () {
    return Object.freeze({
      dynamic: 'DYNAMIC',
      story_owner: 'STORY_OWNER'
    })
  }

  static get Operator () {
    return Object.freeze({
      all: 'ALL',
      any: 'ANY'
    })
  }

  static getEndpoint () {
    return 'adcreatives'
  }

  getPreviews (fields, params) {
    return this.getEdge(AdPreview, fields, params, 'previews')
  }

}


================================================
FILE: src/objects/adimage.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdImage extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      bytes: 'bytes',
      copy_from: 'copy_from',
      created_time: 'created_time',
      creatives: 'creatives',
      filename: 'filename',
      hash: 'hash',
      height: 'height',
      id: 'id',
      is_associated_creatives_in_adgroups: 'is_associated_creatives_in_adgroups',
      name: 'name',
      original_height: 'original_height',
      original_width: 'original_width',
      permalink_url: 'permalink_url',
      status: 'status',
      updated_time: 'updated_time',
      url: 'url',
      url_128: 'url_128',
      width: 'width',
      zipbytes: 'zipbytes'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      deleted: 'DELETED'
    })
  }

  static getEndpoint () {
    return 'adimages'
  }

}


================================================
FILE: src/objects/adkeywordstats.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdKeywordStats extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      actions: 'actions',
      clicks: 'clicks',
      cost_per_total_action: 'cost_per_total_action',
      cost_per_unique_click: 'cost_per_unique_click',
      cpc: 'cpc',
      cpm: 'cpm',
      cpp: 'cpp',
      ctr: 'ctr',
      frequency: 'frequency',
      id: 'id',
      impressions: 'impressions',
      name: 'name',
      reach: 'reach',
      spend: 'spend',
      total_actions: 'total_actions',
      total_unique_actions: 'total_unique_actions',
      unique_actions: 'unique_actions',
      unique_clicks: 'unique_clicks',
      unique_ctr: 'unique_ctr',
      unique_impressions: 'unique_impressions'
    })
  }

  static getEndpoint () {
    return 'keywordstats'
  }

}


================================================
FILE: src/objects/adlabel.js
================================================
import { AbstractCrudObject } from './../core'
import Ad from './ad'
import AdCreative from './adcreative'
import AdSet from './adset'
import Campaign from './campaign'

export default class AdLabel extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account: 'account',
      created_time: 'created_time',
      id: 'id',
      name: 'name',
      updated_time: 'updated_time'
    })
  }

  static get ExecutionOptions () {
    return Object.freeze({
      validate_only: 'validate_only'
    })
  }

  static getEndpoint () {
    return 'adlabels'
  }

  getAdCreatives (fields, params) {
    return this.getEdge(AdCreative, fields, params, 'adcreatives')
  }

  getAdSets (fields, params) {
    return this.getEdge(AdSet, fields, params, 'adsets')
  }

  getAds (fields, params) {
    return this.getEdge(Ad, fields, params, 'ads')
  }

  getCampaigns (fields, params) {
    return this.getEdge(Campaign, fields, params, 'campaigns')
  }

}


================================================
FILE: src/objects/adplacepageset.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdPlacePageSet extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      id: 'id',
      location_types: 'location_types',
      name: 'name',
      pages_count: 'pages_count',
      parent_page: 'parent_page'
    })
  }

  static get LocationTypes () {
    return Object.freeze({
      home: 'home',
      recent: 'recent'
    })
  }

  static getEndpoint () {
    return 'ad_place_page_sets'
  }

}


================================================
FILE: src/objects/adpreview.js
================================================
import { AbstractObject } from './../core'

export default class AdPreview extends AbstractObject {

  static get Field () {
    return Object.freeze({
      body: 'body'
    })
  }

  static get AdFormat () {
    return Object.freeze({
      audience_network_outstream_video: 'AUDIENCE_NETWORK_OUTSTREAM_VIDEO',
      desktop_feed_standard: 'DESKTOP_FEED_STANDARD',
      instagram_standard: 'INSTAGRAM_STANDARD',
      instant_article_standard: 'INSTANT_ARTICLE_STANDARD',
      instream_video_desktop: 'INSTREAM_VIDEO_DESKTOP',
      instream_video_mobile: 'INSTREAM_VIDEO_MOBILE',
      mobile_banner: 'MOBILE_BANNER',
      mobile_feed_basic: 'MOBILE_FEED_BASIC',
      mobile_feed_standard: 'MOBILE_FEED_STANDARD',
      mobile_fullwidth: 'MOBILE_FULLWIDTH',
      mobile_interstitial: 'MOBILE_INTERSTITIAL',
      mobile_medium_rectangle: 'MOBILE_MEDIUM_RECTANGLE',
      mobile_native: 'MOBILE_NATIVE',
      right_column_standard: 'RIGHT_COLUMN_STANDARD'
    })
  }

  static getEndpoint () {
    return 'previews'
  }

}


================================================
FILE: src/objects/adreportrun.js
================================================
import { AbstractCrudObject } from './../core'
import AdsInsights from './adsinsights'

export default class AdReportRun extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      action_attribution_windows: 'action_attribution_windows',
      action_breakdowns: 'action_breakdowns',
      action_report_time: 'action_report_time',
      async_percent_completion: 'async_percent_completion',
      async_status: 'async_status',
      breakdowns: 'breakdowns',
      date_preset: 'date_preset',
      date_start: 'date_start',
      date_stop: 'date_stop',
      default_summary: 'default_summary',
      emails: 'emails',
      export_columns: 'export_columns',
      export_format: 'export_format',
      export_name: 'export_name',
      fields: 'fields',
      filtering: 'filtering',
      friendly_name: 'friendly_name',
      id: 'id',
      is_bookmarked: 'is_bookmarked',
      is_running: 'is_running',
      level: 'level',
      product_id_limit: 'product_id_limit',
      schedule_id: 'schedule_id',
      sort: 'sort',
      summary: 'summary',
      summary_action_breakdowns: 'summary_action_breakdowns',
      time_completed: 'time_completed',
      time_increment: 'time_increment',
      time_range: 'time_range',
      time_ranges: 'time_ranges',
      time_ref: 'time_ref'
    })
  }

  static getEndpoint () {
    return 'insights'
  }

  getInsights (fields, params) {
    return this.getEdge(AdsInsights, fields, params, 'insights')
  }

}


================================================
FILE: src/objects/adsdatapartner.js
================================================
import { AbstractCrudObject } from './../core'

export default class AdsDataPartner extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      name: 'name',
      rev_share_policies: 'rev_share_policies'
    })
  }

}


================================================
FILE: src/objects/adset.js
================================================
import { AbstractCrudObject } from './../core'
import Ad from './ad'
import AdActivity from './adactivity'
import AdAsyncRequest from './adasyncrequest'
import AdCreative from './adcreative'
import AdReportRun from './adreportrun'
import AdsInsights from './adsinsights'
import TargetingSentenceLine from './targetingsentenceline'

export default class AdSet extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      adlabels: 'adlabels',
      adset_schedule: 'adset_schedule',
      attribution_spec: 'attribution_spec',
      bid_amount: 'bid_amount',
      bid_info: 'bid_info',
      billing_event: 'billing_event',
      budget_remaining: 'budget_remaining',
      campaign: 'campaign',
      campaign_id: 'campaign_id',
      campaign_spec: 'campaign_spec',
      configured_status: 'configured_status',
      created_time: 'created_time',
      creative_sequence: 'creative_sequence',
      daily_budget: 'daily_budget',
      daily_imps: 'daily_imps',
      effective_status: 'effective_status',
      end_time: 'end_time',
      execution_options: 'execution_options',
      frequency_cap: 'frequency_cap',
      frequency_cap_reset_period: 'frequency_cap_reset_period',
      frequency_control_specs: 'frequency_control_specs',
      id: 'id',
      is_autobid: 'is_autobid',
      is_average_price_pacing: 'is_average_price_pacing',
      lifetime_budget: 'lifetime_budget',
      lifetime_frequency_cap: 'lifetime_frequency_cap',
      lifetime_imps: 'lifetime_imps',
      name: 'name',
      optimization_goal: 'optimization_goal',
      pacing_type: 'pacing_type',
      promoted_object: 'promoted_object',
      recommendations: 'recommendations',
      recurring_budget_semantics: 'recurring_budget_semantics',
      redownload: 'redownload',
      rf_prediction_id: 'rf_prediction_id',
      rtb_flag: 'rtb_flag',
      start_time: 'start_time',
      status: 'status',
      targeting: 'targeting',
      time_based_ad_rotation_id_blocks: 'time_based_ad_rotation_id_blocks',
      time_based_ad_rotation_intervals: 'time_based_ad_rotation_intervals',
      updated_time: 'updated_time',
      use_new_app_click: 'use_new_app_click'
    })
  }

  static get BillingEvent () {
    return Object.freeze({
      app_installs: 'APP_INSTALLS',
      clicks: 'CLICKS',
      impressions: 'IMPRESSIONS',
      link_clicks: 'LINK_CLICKS',
      mrc_video_views: 'MRC_VIDEO_VIEWS',
      offer_claims: 'OFFER_CLAIMS',
      page_likes: 'PAGE_LIKES',
      post_engagement: 'POST_ENGAGEMENT',
      video_views: 'VIDEO_VIEWS'
    })
  }

  static get ConfiguredStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get EffectiveStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      adset_paused: 'ADSET_PAUSED',
      archived: 'ARCHIVED',
      campaign_paused: 'CAMPAIGN_PAUSED',
      deleted: 'DELETED',
      disapproved: 'DISAPPROVED',
      paused: 'PAUSED',
      pending_billing_info: 'PENDING_BILLING_INFO',
      pending_review: 'PENDING_REVIEW',
      preapproved: 'PREAPPROVED'
    })
  }

  static get OptimizationGoal () {
    return Object.freeze({
      app_downloads: 'APP_DOWNLOADS',
      app_installs: 'APP_INSTALLS',
      brand_awareness: 'BRAND_AWARENESS',
      clicks: 'CLICKS',
      engaged_users: 'ENGAGED_USERS',
      event_responses: 'EVENT_RESPONSES',
      impressions: 'IMPRESSIONS',
      lead_generation: 'LEAD_GENERATION',
      link_clicks: 'LINK_CLICKS',
      none: 'NONE',
      offer_claims: 'OFFER_CLAIMS',
      offsite_conversions: 'OFFSITE_CONVERSIONS',
      page_engagement: 'PAGE_ENGAGEMENT',
      page_likes: 'PAGE_LIKES',
      post_engagement: 'POST_ENGAGEMENT',
      reach: 'REACH',
      social_impressions: 'SOCIAL_IMPRESSIONS',
      video_views: 'VIDEO_VIEWS'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get DatePreset () {
    return Object.freeze({
      last_14d: 'last_14d',
      last_28d: 'last_28d',
      last_30d: 'last_30d',
      last_3d: 'last_3d',
      last_7d: 'last_7d',
      last_90d: 'last_90d',
      last_month: 'last_month',
      last_quarter: 'last_quarter',
      last_week_mon_sun: 'last_week_mon_sun',
      last_week_sun_sat: 'last_week_sun_sat',
      last_year: 'last_year',
      lifetime: 'lifetime',
      this_month: 'this_month',
      this_quarter: 'this_quarter',
      this_week_mon_today: 'this_week_mon_today',
      this_week_sun_today: 'this_week_sun_today',
      this_year: 'this_year',
      today: 'today',
      yesterday: 'yesterday'
    })
  }

  static get ExecutionOptions () {
    return Object.freeze({
      include_recommendations: 'include_recommendations',
      validate_only: 'validate_only'
    })
  }

  static get Operator () {
    return Object.freeze({
      all: 'ALL',
      any: 'ANY'
    })
  }

  static getEndpoint () {
    return 'adsets'
  }

  getActivities (fields, params) {
    return this.getEdge(AdActivity, fields, params, 'activities')
  }

  getAdCreatives (fields, params) {
    return this.getEdge(AdCreative, fields, params, 'adcreatives')
  }

  getAds (fields, params) {
    return this.getEdge(Ad, fields, params, 'ads')
  }

  getAsyncAdRequests (fields, params) {
    return this.getEdge(AdAsyncRequest, fields, params, 'asyncadrequests')
  }

  getInsights (fields, params) {
    return this.getEdge(AdsInsights, fields, params, 'insights')
  }

  getInsightsAsync (fields, params) {
    return this.getEdge(AdReportRun, fields, params, 'insights')
  }

  getTargetingSentenceLines (fields, params) {
    return this.getEdge(TargetingSentenceLine, fields, params, 'targetingsentencelines')
  }

}


================================================
FILE: src/objects/adsinsights.js
================================================
import { AbstractObject } from './../core'

export default class AdsInsights extends AbstractObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      account_name: 'account_name',
      action_values: 'action_values',
      actions: 'actions',
      ad_id: 'ad_id',
      ad_name: 'ad_name',
      adset_id: 'adset_id',
      adset_name: 'adset_name',
      age: 'age',
      app_store_clicks: 'app_store_clicks',
      buying_type: 'buying_type',
      call_to_action_asset: 'call_to_action_asset',
      call_to_action_clicks: 'call_to_action_clicks',
      campaign_id: 'campaign_id',
      campaign_name: 'campaign_name',
      canvas_avg_view_percent: 'canvas_avg_view_percent',
      canvas_avg_view_time: 'canvas_avg_view_time',
      canvas_component_avg_pct_view: 'canvas_component_avg_pct_view',
      clicks: 'clicks',
      cost_per_10_sec_video_view: 'cost_per_10_sec_video_view',
      cost_per_action_type: 'cost_per_action_type',
      cost_per_estimated_ad_recallers: 'cost_per_estimated_ad_recallers',
      cost_per_inline_link_click: 'cost_per_inline_link_click',
      cost_per_inline_post_engagement: 'cost_per_inline_post_engagement',
      cost_per_total_action: 'cost_per_total_action',
      cost_per_unique_action_type: 'cost_per_unique_action_type',
      cost_per_unique_click: 'cost_per_unique_click',
      cost_per_unique_inline_link_click: 'cost_per_unique_inline_link_click',
      country: 'country',
      cpc: 'cpc',
      cpm: 'cpm',
      cpp: 'cpp',
      ctr: 'ctr',
      date_start: 'date_start',
      date_stop: 'date_stop',
      deeplink_clicks: 'deeplink_clicks',
      device_platform: 'device_platform',
      dma: 'dma',
      estimated_ad_recall_rate: 'estimated_ad_recall_rate',
      estimated_ad_recallers: 'estimated_ad_recallers',
      frequency: 'frequency',
      frequency_value: 'frequency_value',
      gender: 'gender',
      hourly_stats_aggregated_by_advertiser_time_zone: 'hourly_stats_aggregated_by_advertiser_time_zone',
      hourly_stats_aggregated_by_audience_time_zone: 'hourly_stats_aggregated_by_audience_time_zone',
      impression_device: 'impression_device',
      impressions: 'impressions',
      impressions_dummy: 'impressions_dummy',
      inline_link_click_ctr: 'inline_link_click_ctr',
      inline_link_clicks: 'inline_link_clicks',
      inline_post_engagement: 'inline_post_engagement',
      objective: 'objective',
      place_page_id: 'place_page_id',
      place_page_name: 'place_page_name',
      placement: 'placement',
      product_id: 'product_id',
      reach: 'reach',
      region: 'region',
      relevance_score: 'relevance_score',
      social_clicks: 'social_clicks',
      social_impressions: 'social_impressions',
      social_reach: 'social_reach',
      social_spend: 'social_spend',
      spend: 'spend',
      total_action_value: 'total_action_value',
      total_actions: 'total_actions',
      total_unique_actions: 'total_unique_actions',
      unique_actions: 'unique_actions',
      unique_clicks: 'unique_clicks',
      unique_ctr: 'unique_ctr',
      unique_inline_link_click_ctr: 'unique_inline_link_click_ctr',
      unique_inline_link_clicks: 'unique_inline_link_clicks',
      unique_link_clicks_ctr: 'unique_link_clicks_ctr',
      unique_social_clicks: 'unique_social_clicks',
      video_10_sec_watched_actions: 'video_10_sec_watched_actions',
      video_15_sec_watched_actions: 'video_15_sec_watched_actions',
      video_30_sec_watched_actions: 'video_30_sec_watched_actions',
      video_avg_percent_watched_actions: 'video_avg_percent_watched_actions',
      video_avg_time_watched_actions: 'video_avg_time_watched_actions',
      video_p100_watched_actions: 'video_p100_watched_actions',
      video_p25_watched_actions: 'video_p25_watched_actions',
      video_p50_watched_actions: 'video_p50_watched_actions',
      video_p75_watched_actions: 'video_p75_watched_actions',
      video_p95_watched_actions: 'video_p95_watched_actions',
      website_clicks: 'website_clicks',
      website_ctr: 'website_ctr'
    })
  }

  static get ActionAttributionWindows () {
    return Object.freeze({
      value_1d_click: '1d_click',
      value_1d_view: '1d_view',
      value_28d_click: '28d_click',
      value_28d_view: '28d_view',
      value_7d_click: '7d_click',
      value_7d_view: '7d_view',
      value_default: 'default'
    })
  }

  static get ActionBreakdowns () {
    return Object.freeze({
      action_canvas_component_name: 'action_canvas_component_name',
      action_carousel_card_id: 'action_carousel_card_id',
      action_carousel_card_name: 'action_carousel_card_name',
      action_destination: 'action_destination',
      action_device: 'action_device',
      action_reaction: 'action_reaction',
      action_target_id: 'action_target_id',
      action_type: 'action_type',
      action_video_sound: 'action_video_sound',
      action_video_type: 'action_video_type'
    })
  }

  static get ActionReportTime () {
    return Object.freeze({
      conversion: 'conversion',
      impression: 'impression'
    })
  }

  static get Breakdowns () {
    return Object.freeze({
      age: 'age',
      country: 'country',
      device_platform: 'device_platform',
      dma: 'dma',
      frequency_value: 'frequency_value',
      gender: 'gender',
      hourly_stats_aggregated_by_advertiser_time_zone: 'hourly_stats_aggregated_by_advertiser_time_zone',
      hourly_stats_aggregated_by_audience_time_zone: 'hourly_stats_aggregated_by_audience_time_zone',
      impression_device: 'impression_device',
      place_page_id: 'place_page_id',
      platform_position: 'platform_position',
      product_id: 'product_id',
      publisher_platform: 'publisher_platform',
      region: 'region'
    })
  }

  static get DatePreset () {
    return Object.freeze({
      last_14d: 'last_14d',
      last_28d: 'last_28d',
      last_30d: 'last_30d',
      last_3d: 'last_3d',
      last_7d: 'last_7d',
      last_90d: 'last_90d',
      last_month: 'last_month',
      last_quarter: 'last_quarter',
      last_week_mon_sun: 'last_week_mon_sun',
      last_week_sun_sat: 'last_week_sun_sat',
      last_year: 'last_year',
      lifetime: 'lifetime',
      this_month: 'this_month',
      this_quarter: 'this_quarter',
      this_week_mon_today: 'this_week_mon_today',
      this_week_sun_today: 'this_week_sun_today',
      this_year: 'this_year',
      today: 'today',
      yesterday: 'yesterday'
    })
  }

  static get Level () {
    return Object.freeze({
      account: 'account',
      ad: 'ad',
      adset: 'adset',
      campaign: 'campaign'
    })
  }

  static get SummaryActionBreakdowns () {
    return Object.freeze({
      action_canvas_component_name: 'action_canvas_component_name',
      action_carousel_card_id: 'action_carousel_card_id',
      action_carousel_card_name: 'action_carousel_card_name',
      action_destination: 'action_destination',
      action_device: 'action_device',
      action_reaction: 'action_reaction',
      action_target_id: 'action_target_id',
      action_type: 'action_type',
      action_video_sound: 'action_video_sound',
      action_video_type: 'action_video_type'
    })
  }

  static get Summary () {
    return Object.freeze({
      account_id: 'account_id',
      async_percent_completion: 'async_percent_completion',
      async_status: 'async_status',
      date_start: 'date_start',
      date_stop: 'date_stop',
      emails: 'emails',
      friendly_name: 'friendly_name',
      id: 'id',
      is_bookmarked: 'is_bookmarked',
      is_running: 'is_running',
      schedule_id: 'schedule_id',
      time_completed: 'time_completed',
      time_ref: 'time_ref'
    })
  }

  static getEndpoint () {
    return 'insights'
  }

}


================================================
FILE: src/objects/adspixel.js
================================================
import { AbstractCrudObject } from './../core'
import AdAccount from './adaccount'
import AdsPixelStatsResult from './adspixelstatsresult'
import Business from './business'
import CustomAudience from './customaudience'

export default class AdsPixel extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      code: 'code',
      creation_time: 'creation_time',
      id: 'id',
      is_created_by_business: 'is_created_by_business',
      last_fired_time: 'last_fired_time',
      name: 'name',
      owner_ad_account: 'owner_ad_account',
      owner_business: 'owner_business'
    })
  }

  static getEndpoint () {
    return 'adspixels'
  }

  getAudiences (fields, params) {
    return this.getEdge(CustomAudience, fields, params, 'audiences')
  }

  getSharedAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'shared_accounts')
  }

  getSharedAgencies (fields, params) {
    return this.getEdge(Business, fields, params, 'shared_agencies')
  }

  getStats (fields, params) {
    return this.getEdge(AdsPixelStatsResult, fields, params, 'stats')
  }

}


================================================
FILE: src/objects/adspixelstatsresult.js
================================================
import { AbstractObject } from './../core'

export default class AdsPixelStatsResult extends AbstractObject {

  static get Field () {
    return Object.freeze({
      aggregation: 'aggregation',
      data: 'data',
      timestamp: 'timestamp'
    })
  }

  static get Aggregation () {
    return Object.freeze({
      browser_type: 'browser_type',
      custom_data_field: 'custom_data_field',
      device_os: 'device_os',
      device_type: 'device_type',
      event: 'event',
      host: 'host',
      pixel_fire: 'pixel_fire',
      url: 'url'
    })
  }

  static getEndpoint () {
    return 'stats'
  }

}


================================================
FILE: src/objects/broadtargetingcategories.js
================================================
import { AbstractCrudObject } from './../core'

export default class BroadTargetingCategories extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      category_description: 'category_description',
      id: 'id',
      name: 'name',
      parent_category: 'parent_category',
      path: 'path',
      size: 'size',
      source: 'source',
      type: 'type',
      type_name: 'type_name',
      untranslated_name: 'untranslated_name',
      untranslated_parent_name: 'untranslated_parent_name'
    })
  }

  static getEndpoint () {
    return 'broadtargetingcategories'
  }

}


================================================
FILE: src/objects/business.js
================================================
import { AbstractCrudObject } from './../core'
import AdAccount from './adaccount'
import AdsPixel from './adspixel'
import BusinessAdAccountRequest from './businessadaccountrequest'
import BusinessPageRequest from './businesspagerequest'
import EventSourceGroup from './eventsourcegroup'
import LegacyBusinessAdAccountRequest from './legacybusinessadaccountrequest'
import ProductCatalog from './productcatalog'
import ProfilePictureSource from './profilepicturesource'
import ReachFrequencyPrediction from './reachfrequencyprediction'

export default class Business extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      created_by: 'created_by',
      created_time: 'created_time',
      id: 'id',
      link: 'link',
      name: 'name',
      payment_account_id: 'payment_account_id',
      primary_page: 'primary_page',
      timezone_id: 'timezone_id',
      two_factor_type: 'two_factor_type',
      updated_by: 'updated_by',
      updated_time: 'updated_time'
    })
  }

  getAdsPixels (fields, params) {
    return this.getEdge(AdsPixel, fields, params, 'adspixels')
  }

  getAssignedAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'assigned_ad_accounts')
  }

  getAssignedPages (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'assigned_pages')
  }

  getAssignedProductCatalogs (fields, params) {
    return this.getEdge(ProductCatalog, fields, params, 'assigned_product_catalogs')
  }

  getClientAdAccountRequests (fields, params) {
    return this.getEdge(BusinessAdAccountRequest, fields, params, 'client_ad_account_requests')
  }

  getClientAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'client_ad_accounts')
  }

  getClientPageRequests (fields, params) {
    return this.getEdge(BusinessPageRequest, fields, params, 'client_page_requests')
  }

  getClientPages (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'client_pages')
  }

  getEventSourceGroups (fields, params) {
    return this.getEdge(EventSourceGroup, fields, params, 'event_source_groups')
  }

  getGrpPlans (fields, params) {
    return this.getEdge(ReachFrequencyPrediction, fields, params, 'grp_plans')
  }

  getInstagramAccounts (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'instagram_accounts')
  }

  getMeasurementReports (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'measurement_reports')
  }

  getOfflineConversionDataSets (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'offline_conversion_data_sets')
  }

  getOwnedAdAccountRequests (fields, params) {
    return this.getEdge(LegacyBusinessAdAccountRequest, fields, params, 'owned_ad_account_requests')
  }

  getOwnedAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'owned_ad_accounts')
  }

  getOwnedInstagramAccounts (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'owned_instagram_accounts')
  }

  getOwnedPageRequests (fields, params) {
    return this.getEdge(BusinessPageRequest, fields, params, 'owned_page_requests')
  }

  getOwnedPages (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'owned_pages')
  }

  getOwnedPixels (fields, params) {
    return this.getEdge(AdsPixel, fields, params, 'owned_pixels')
  }

  getPicture (fields, params) {
    return this.getEdge(ProfilePictureSource, fields, params, 'picture')
  }

  getProductCatalogs (fields, params) {
    return this.getEdge(ProductCatalog, fields, params, 'product_catalogs')
  }

  getReceivedAudiencePermissions (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'received_audience_permissions')
  }

  getSharedAudiencePermissions (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'shared_audience_permissions')
  }

  getSystemUsers (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'system_users')
  }

}


================================================
FILE: src/objects/businessadaccountrequest.js
================================================
import { AbstractCrudObject } from './../core'

export default class BusinessAdAccountRequest extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      ad_account: 'ad_account',
      id: 'id'
    })
  }

}


================================================
FILE: src/objects/businesspagerequest.js
================================================
import { AbstractCrudObject } from './../core'

export default class BusinessPageRequest extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      page: 'page'
    })
  }

}


================================================
FILE: src/objects/campaign.js
================================================
import { AbstractCrudObject } from './../core'
import Ad from './ad'
import AdReportRun from './adreportrun'
import AdSet from './adset'
import AdsInsights from './adsinsights'

export default class Campaign extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      adlabels: 'adlabels',
      brand_lift_studies: 'brand_lift_studies',
      budget_rebalance_flag: 'budget_rebalance_flag',
      buying_type: 'buying_type',
      can_create_brand_lift_study: 'can_create_brand_lift_study',
      can_use_spend_cap: 'can_use_spend_cap',
      configured_status: 'configured_status',
      created_time: 'created_time',
      effective_status: 'effective_status',
      execution_options: 'execution_options',
      id: 'id',
      name: 'name',
      objective: 'objective',
      promoted_object: 'promoted_object',
      recommendations: 'recommendations',
      spend_cap: 'spend_cap',
      start_time: 'start_time',
      status: 'status',
      stop_time: 'stop_time',
      updated_time: 'updated_time'
    })
  }

  static get ConfiguredStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get EffectiveStatus () {
    return Object.freeze({
      active: 'ACTIVE',
      adset_paused: 'ADSET_PAUSED',
      archived: 'ARCHIVED',
      campaign_paused: 'CAMPAIGN_PAUSED',
      deleted: 'DELETED',
      disapproved: 'DISAPPROVED',
      paused: 'PAUSED',
      pending_billing_info: 'PENDING_BILLING_INFO',
      pending_review: 'PENDING_REVIEW',
      preapproved: 'PREAPPROVED'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      archived: 'ARCHIVED',
      deleted: 'DELETED',
      paused: 'PAUSED'
    })
  }

  static get DatePreset () {
    return Object.freeze({
      last_14d: 'last_14d',
      last_28d: 'last_28d',
      last_30d: 'last_30d',
      last_3d: 'last_3d',
      last_7d: 'last_7d',
      last_90d: 'last_90d',
      last_month: 'last_month',
      last_quarter: 'last_quarter',
      last_week_mon_sun: 'last_week_mon_sun',
      last_week_sun_sat: 'last_week_sun_sat',
      last_year: 'last_year',
      lifetime: 'lifetime',
      this_month: 'this_month',
      this_quarter: 'this_quarter',
      this_week_mon_today: 'this_week_mon_today',
      this_week_sun_today: 'this_week_sun_today',
      this_year: 'this_year',
      today: 'today',
      yesterday: 'yesterday'
    })
  }

  static get DeleteStrategy () {
    return Object.freeze({
      delete_any: 'DELETE_ANY',
      delete_archived_before: 'DELETE_ARCHIVED_BEFORE',
      delete_oldest: 'DELETE_OLDEST'
    })
  }

  static get ExecutionOptions () {
    return Object.freeze({
      include_recommendations: 'include_recommendations',
      validate_only: 'validate_only'
    })
  }

  static get Objective () {
    return Object.freeze({
      app_installs: 'APP_INSTALLS',
      brand_awareness: 'BRAND_AWARENESS',
      conversions: 'CONVERSIONS',
      event_responses: 'EVENT_RESPONSES',
      lead_generation: 'LEAD_GENERATION',
      link_clicks: 'LINK_CLICKS',
      local_awareness: 'LOCAL_AWARENESS',
      offer_claims: 'OFFER_CLAIMS',
      page_likes: 'PAGE_LIKES',
      post_engagement: 'POST_ENGAGEMENT',
      product_catalog_sales: 'PRODUCT_CATALOG_SALES',
      reach: 'REACH',
      video_views: 'VIDEO_VIEWS'
    })
  }

  static get Operator () {
    return Object.freeze({
      all: 'ALL',
      any: 'ANY'
    })
  }

  static getEndpoint () {
    return 'campaigns'
  }

  getAdSets (fields, params) {
    return this.getEdge(AdSet, fields, params, 'adsets')
  }

  getAds (fields, params) {
    return this.getEdge(Ad, fields, params, 'ads')
  }

  getInsights (fields, params) {
    return this.getEdge(AdsInsights, fields, params, 'insights')
  }

  getInsightsAsync (fields, params) {
    return this.getEdge(AdReportRun, fields, params, 'insights')
  }

}


================================================
FILE: src/objects/customaudience.js
================================================
import { AbstractCrudObject } from './../core'
import Ad from './ad'
import AdAccount from './adaccount'
import CustomAudiencePrefillState from './customaudienceprefillstate'
import CustomAudienceSession from './customaudiencesession'

export default class CustomAudience extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      approximate_count: 'approximate_count',
      associated_audience_id: 'associated_audience_id',
      claim_objective: 'claim_objective',
      content_type: 'content_type',
      creation_params: 'creation_params',
      data_source: 'data_source',
      dataset_id: 'dataset_id',
      delivery_status: 'delivery_status',
      description: 'description',
      event_source_group: 'event_source_group',
      exclusions: 'exclusions',
      external_event_source: 'external_event_source',
      id: 'id',
      inclusions: 'inclusions',
      is_value_based: 'is_value_based',
      list_of_accounts: 'list_of_accounts',
      lookalike_audience_ids: 'lookalike_audience_ids',
      lookalike_spec: 'lookalike_spec',
      name: 'name',
      operation_status: 'operation_status',
      opt_out_link: 'opt_out_link',
      origin_audience_id: 'origin_audience_id',
      parent_audience_id: 'parent_audience_id',
      permission_for_actions: 'permission_for_actions',
      pixel_id: 'pixel_id',
      prefill: 'prefill',
      product_set_id: 'product_set_id',
      retention_days: 'retention_days',
      rule: 'rule',
      subtype: 'subtype',
      tags: 'tags',
      time_content_updated: 'time_content_updated',
      time_created: 'time_created',
      time_updated: 'time_updated'
    })
  }

  static get ClaimObjective () {
    return Object.freeze({
      home_listing: 'HOME_LISTING',
      product: 'PRODUCT',
      travel: 'TRAVEL'
    })
  }

  static get ContentType () {
    return Object.freeze({
      destination: 'DESTINATION',
      flight: 'FLIGHT',
      home_listing: 'HOME_LISTING',
      hotel: 'HOTEL'
    })
  }

  static get Subtype () {
    return Object.freeze({
      app: 'APP',
      bag_of_accounts: 'BAG_OF_ACCOUNTS',
      claim: 'CLAIM',
      custom: 'CUSTOM',
      data_set: 'DATA_SET',
      engagement: 'ENGAGEMENT',
      lookalike: 'LOOKALIKE',
      managed: 'MANAGED',
      offline_conversion: 'OFFLINE_CONVERSION',
      partner: 'PARTNER',
      study_rule_audience: 'STUDY_RULE_AUDIENCE',
      video: 'VIDEO',
      website: 'WEBSITE'
    })
  }

  static get Fields () {
    return Object.freeze({
      account_id: 'account_id',
      approximate_count: 'approximate_count',
      data_source: 'data_source',
      delivery_status: 'delivery_status',
      description: 'description',
      external_event_source: 'external_event_source',
      id: 'id',
      is_value_based: 'is_value_based',
      lookalike_audience_ids: 'lookalike_audience_ids',
      lookalike_spec: 'lookalike_spec',
      name: 'name',
      operation_status: 'operation_status',
      opt_out_link: 'opt_out_link',
      permission_for_actions: 'permission_for_actions',
      pixel_id: 'pixel_id',
      retention_days: 'retention_days',
      rule: 'rule',
      subtype: 'subtype',
      time_content_updated: 'time_content_updated',
      time_created: 'time_created',
      time_updated: 'time_updated'
    })
  }

  static getEndpoint () {
    return 'customaudiences'
  }

  getAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'adaccounts')
  }

  getAds (fields, params) {
    return this.getEdge(Ad, fields, params, 'ads')
  }

  getPrefills (fields, params) {
    return this.getEdge(CustomAudiencePrefillState, fields, params, 'prefills')
  }

  getSessions (fields, params) {
    return this.getEdge(CustomAudienceSession, fields, params, 'sessions')
  }

}


================================================
FILE: src/objects/customaudienceprefillstate.js
================================================
import { AbstractObject } from './../core'

export default class CustomAudiencePrefillState extends AbstractObject {

  static get Field () {
    return Object.freeze({
      description: 'description',
      num_added: 'num_added',
      status: 'status'
    })
  }

}


================================================
FILE: src/objects/customaudiencesession.js
================================================
import { AbstractObject } from './../core'

export default class CustomAudienceSession extends AbstractObject {

  static get Field () {
    return Object.freeze({
      end_time: 'end_time',
      num_invalid_entries: 'num_invalid_entries',
      num_matched: 'num_matched',
      num_received: 'num_received',
      progress: 'progress',
      session_id: 'session_id',
      stage: 'stage',
      start_time: 'start_time'
    })
  }

}


================================================
FILE: src/objects/customaudiencestos.js
================================================
import { AbstractCrudObject } from './../core'

export default class CustomAudiencesTOS extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      content: 'content',
      id: 'id',
      type: 'type'
    })
  }

}


================================================
FILE: src/objects/domain.js
================================================
import { AbstractCrudObject } from './../core'

export default class Domain extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      name: 'name',
      url: 'url'
    })
  }

}


================================================
FILE: src/objects/event.js
================================================
import { AbstractCrudObject } from './../core'
import ProfilePictureSource from './profilepicturesource'

export default class Event extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      attending_count: 'attending_count',
      can_guests_invite: 'can_guests_invite',
      category: 'category',
      cover: 'cover',
      declined_count: 'declined_count',
      description: 'description',
      end_time: 'end_time',
      guest_list_enabled: 'guest_list_enabled',
      id: 'id',
      interested_count: 'interested_count',
      is_canceled: 'is_canceled',
      is_page_owned: 'is_page_owned',
      is_viewer_admin: 'is_viewer_admin',
      maybe_count: 'maybe_count',
      name: 'name',
      noreply_count: 'noreply_count',
      owner: 'owner',
      parent_group: 'parent_group',
      place: 'place',
      start_time: 'start_time',
      ticket_uri: 'ticket_uri',
      timezone: 'timezone',
      type: 'type',
      updated_time: 'updated_time'
    })
  }

  static get Type () {
    return Object.freeze({
      community: 'community',
      group: 'group',
      private: 'private',
      public: 'public'
    })
  }

  getPicture (fields, params) {
    return this.getEdge(ProfilePictureSource, fields, params, 'picture')
  }

}


================================================
FILE: src/objects/eventsourcegroup.js
================================================
import { AbstractCrudObject } from './../core'

export default class EventSourceGroup extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      business: 'business',
      event_sources: 'event_sources',
      id: 'id',
      name: 'name'
    })
  }

  static getEndpoint () {
    return 'event_source_groups'
  }

}


================================================
FILE: src/objects/externaleventsource.js
================================================
import { AbstractCrudObject } from './../core'

export default class ExternalEventSource extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      external_event_sources: 'external_event_sources',
      id: 'id',
      name: 'name',
      source_type: 'source_type'
    })
  }

  static getEndpoint () {
    return 'external_event_sources'
  }

}


================================================
FILE: src/objects/hotel.js
================================================
import { AbstractCrudObject } from './../core'

export default class Hotel extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      address: 'address',
      applinks: 'applinks',
      brand: 'brand',
      description: 'description',
      guest_ratings: 'guest_ratings',
      hotel_id: 'hotel_id',
      id: 'id',
      images: 'images',
      lowest_base_price: 'lowest_base_price',
      name: 'name',
      phone: 'phone',
      star_rating: 'star_rating',
      url: 'url'
    })
  }

  static getEndpoint () {
    return 'hotels'
  }

}


================================================
FILE: src/objects/lead.js
================================================
import { AbstractCrudObject } from './../core'

export default class Lead extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      ad_id: 'ad_id',
      ad_name: 'ad_name',
      adset_id: 'adset_id',
      adset_name: 'adset_name',
      campaign_id: 'campaign_id',
      campaign_name: 'campaign_name',
      created_time: 'created_time',
      custom_disclaimer_responses: 'custom_disclaimer_responses',
      field_data: 'field_data',
      form_id: 'form_id',
      id: 'id',
      is_organic: 'is_organic',
      post: 'post',
      retailer_item_id: 'retailer_item_id'
    })
  }

  static getEndpoint () {
    return 'leads'
  }

}


================================================
FILE: src/objects/leadgenform.js
================================================
import { AbstractCrudObject } from './../core'
import Lead from './lead'

export default class LeadgenForm extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      allow_organic_lead: 'allow_organic_lead',
      context_card: 'context_card',
      continued_flow_request_method: 'continued_flow_request_method',
      created_time: 'created_time',
      creator: 'creator',
      creator_id: 'creator_id',
      cusomized_tcpa_content: 'cusomized_tcpa_content',
      expired_leads_count: 'expired_leads_count',
      follow_up_action_text: 'follow_up_action_text',
      follow_up_action_url: 'follow_up_action_url',
      id: 'id',
      is_continued_flow: 'is_continued_flow',
      leadgen_export_csv_url: 'leadgen_export_csv_url',
      leads_count: 'leads_count',
      legal_content: 'legal_content',
      locale: 'locale',
      messenger_welcome_message: 'messenger_welcome_message',
      name: 'name',
      organic_leads_count: 'organic_leads_count',
      page: 'page',
      page_id: 'page_id',
      privacy_policy_url: 'privacy_policy_url',
      qualifiers: 'qualifiers',
      questions: 'questions',
      status: 'status',
      tcpa_compliance: 'tcpa_compliance'
    })
  }

  static getEndpoint () {
    return 'leadgen_forms'
  }

  getLeads (fields, params) {
    return this.getEdge(Lead, fields, params, 'leads')
  }

}


================================================
FILE: src/objects/legacybusinessadaccountrequest.js
================================================
import { AbstractCrudObject } from './../core'

export default class LegacyBusinessAdAccountRequest extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      ad_account: 'ad_account',
      id: 'id',
      permitted_roles: 'permitted_roles'
    })
  }

}


================================================
FILE: src/objects/minimumbudget.js
================================================
import { AbstractObject } from './../core'

export default class MinimumBudget extends AbstractObject {

  static get Field () {
    return Object.freeze({
      currency: 'currency',
      min_daily_budget_high_freq: 'min_daily_budget_high_freq',
      min_daily_budget_imp: 'min_daily_budget_imp',
      min_daily_budget_low_freq: 'min_daily_budget_low_freq',
      min_daily_budget_video_views: 'min_daily_budget_video_views'
    })
  }

  static getEndpoint () {
    return 'minimum_budgets'
  }

}


================================================
FILE: src/objects/offsitepixel.js
================================================
import { AbstractCrudObject } from './../core'
import AdAccount from './adaccount'

export default class OffsitePixel extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      creator: 'creator',
      id: 'id',
      js_pixel: 'js_pixel',
      last_firing_time: 'last_firing_time',
      name: 'name',
      tag: 'tag'
    })
  }

  static get Tag () {
    return Object.freeze({
      add_to_cart: 'ADD_TO_CART',
      checkout: 'CHECKOUT',
      key_page_view: 'KEY_PAGE_VIEW',
      lead: 'LEAD',
      other: 'OTHER',
      registration: 'REGISTRATION'
    })
  }

  static getEndpoint () {
    return 'offsitepixels'
  }

  getAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'adaccounts')
  }

}


================================================
FILE: src/objects/partnercategory.js
================================================
import { AbstractCrudObject } from './../core'

export default class PartnerCategory extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      approximate_count: 'approximate_count',
      country: 'country',
      description: 'description',
      details: 'details',
      id: 'id',
      is_private: 'is_private',
      name: 'name',
      parent_category: 'parent_category',
      source: 'source',
      status: 'status',
      targeting_type: 'targeting_type'
    })
  }

  static get PrivateOrPublic () {
    return Object.freeze({
      private: 'PRIVATE',
      public: 'PUBLIC'
    })
  }

  static getEndpoint () {
    return 'partnercategories'
  }

}


================================================
FILE: src/objects/productcatalog.js
================================================
import { AbstractCrudObject } from './../core'
import Business from './business'
import ExternalEventSource from './externaleventsource'
import Hotel from './hotel'
import ProductCatalogHotelRoomsBatch from './productcataloghotelroomsbatch'
import ProductCatalogPricingVariablesBatch from './productcatalogpricingvariablesbatch'
import ProductFeed from './productfeed'
import ProductGroup from './productgroup'
import ProductItem from './productitem'
import ProductSet from './productset'

export default class ProductCatalog extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      business: 'business',
      da_display_settings: 'da_display_settings',
      default_image_url: 'default_image_url',
      fallback_image_url: 'fallback_image_url',
      feed_count: 'feed_count',
      id: 'id',
      image_padding_landscape: 'image_padding_landscape',
      image_padding_square: 'image_padding_square',
      name: 'name',
      product_count: 'product_count',
      vertical: 'vertical'
    })
  }

  static get Vertical () {
    return Object.freeze({
      commerce: 'commerce',
      destinations: 'destinations',
      flights: 'flights',
      hotels: 'hotels'
    })
  }

  static getEndpoint () {
    return 'product_catalogs'
  }

  getAgencies (fields, params) {
    return this.getEdge(Business, fields, params, 'agencies')
  }

  getDestinations (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'destinations')
  }

  getExternalEventSources (fields, params) {
    return this.getEdge(ExternalEventSource, fields, params, 'external_event_sources')
  }

  getFlights (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'flights')
  }

  getHotelRoomsBatch (fields, params) {
    return this.getEdge(ProductCatalogHotelRoomsBatch, fields, params, 'hotel_rooms_batch')
  }

  getHotels (fields, params) {
    return this.getEdge(Hotel, fields, params, 'hotels')
  }

  getPricingVariablesBatch (fields, params) {
    return this.getEdge(ProductCatalogPricingVariablesBatch, fields, params, 'pricing_variables_batch')
  }

  getProductFeeds (fields, params) {
    return this.getEdge(ProductFeed, fields, params, 'product_feeds')
  }

  getProductGroups (fields, params) {
    return this.getEdge(ProductGroup, fields, params, 'product_groups')
  }

  getProductSets (fields, params) {
    return this.getEdge(ProductSet, fields, params, 'product_sets')
  }

  getProductSetsBatch (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'product_sets_batch')
  }

  getProducts (fields, params) {
    return this.getEdge(ProductItem, fields, params, 'products')
  }

}


================================================
FILE: src/objects/productcataloghotelroomsbatch.js
================================================
import { AbstractCrudObject } from './../core'

export default class ProductCatalogHotelRoomsBatch extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      errors: 'errors',
      errors_total_count: 'errors_total_count',
      file: 'file',
      handle: 'handle',
      password: 'password',
      standard: 'standard',
      status: 'status',
      update_only: 'update_only',
      url: 'url',
      username: 'username'
    })
  }

  static get Standard () {
    return Object.freeze({
      google: 'google'
    })
  }

  static getEndpoint () {
    return 'hotel_rooms_batch'
  }

}


================================================
FILE: src/objects/productcatalogpricingvariablesbatch.js
================================================
import { AbstractCrudObject } from './../core'

export default class ProductCatalogPricingVariablesBatch extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      errors: 'errors',
      errors_total_count: 'errors_total_count',
      file: 'file',
      handle: 'handle',
      password: 'password',
      standard: 'standard',
      status: 'status',
      update_only: 'update_only',
      url: 'url',
      username: 'username'
    })
  }

  static get Standard () {
    return Object.freeze({
      google: 'google'
    })
  }

  static getEndpoint () {
    return 'pricing_variables_batch'
  }

}


================================================
FILE: src/objects/productfeed.js
================================================
import { AbstractCrudObject } from './../core'
import ProductFeedUpload from './productfeedupload'
import ProductItem from './productitem'

export default class ProductFeed extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      country: 'country',
      created_time: 'created_time',
      default_currency: 'default_currency',
      deletion_enabled: 'deletion_enabled',
      delimiter: 'delimiter',
      encoding: 'encoding',
      file_name: 'file_name',
      id: 'id',
      latest_upload: 'latest_upload',
      name: 'name',
      product_count: 'product_count',
      quoted_fields_mode: 'quoted_fields_mode',
      schedule: 'schedule'
    })
  }

  static get Delimiter () {
    return Object.freeze({
      autodetect: 'AUTODETECT',
      bar: 'BAR',
      comma: 'COMMA',
      semicolon: 'SEMICOLON',
      tab: 'TAB',
      tilde: 'TILDE'
    })
  }

  static get QuotedFieldsMode () {
    return Object.freeze({
      autodetect: 'AUTODETECT',
      off: 'OFF',
      on: 'ON'
    })
  }

  static get Encoding () {
    return Object.freeze({
      autodetect: 'AUTODETECT',
      latin1: 'LATIN1',
      utf16be: 'UTF16BE',
      utf16le: 'UTF16LE',
      utf32be: 'UTF32BE',
      utf32le: 'UTF32LE',
      utf8: 'UTF8'
    })
  }

  static getEndpoint () {
    return 'product_feeds'
  }

  getProducts (fields, params) {
    return this.getEdge(ProductItem, fields, params, 'products')
  }

  getUploads (fields, params) {
    return this.getEdge(ProductFeedUpload, fields, params, 'uploads')
  }

}


================================================
FILE: src/objects/productfeedupload.js
================================================
import { AbstractCrudObject } from './../core'
import ProductFeedUploadError from './productfeeduploaderror'

export default class ProductFeedUpload extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      end_time: 'end_time',
      id: 'id',
      input_method: 'input_method',
      start_time: 'start_time',
      url: 'url'
    })
  }

  static get InputMethod () {
    return Object.freeze({
      manual_upload: 'Manual Upload',
      server_fetch: 'Server Fetch'
    })
  }

  static getEndpoint () {
    return 'uploads'
  }

  getErrors (fields, params) {
    return this.getEdge(ProductFeedUploadError, fields, params, 'errors')
  }

}


================================================
FILE: src/objects/productfeeduploaderror.js
================================================
import { AbstractCrudObject } from './../core'
import ProductFeedUploadErrorSample from './productfeeduploaderrorsample'

export default class ProductFeedUploadError extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      description: 'description',
      error_type: 'error_type',
      id: 'id',
      severity: 'severity',
      summary: 'summary',
      total_count: 'total_count'
    })
  }

  static get Severity () {
    return Object.freeze({
      fatal: 'fatal',
      warning: 'warning'
    })
  }

  static getEndpoint () {
    return 'errors'
  }

  getSamples (fields, params) {
    return this.getEdge(ProductFeedUploadErrorSample, fields, params, 'samples')
  }

}


================================================
FILE: src/objects/productfeeduploaderrorsample.js
================================================
import { AbstractCrudObject } from './../core'

export default class ProductFeedUploadErrorSample extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      retailer_id: 'retailer_id',
      row_number: 'row_number'
    })
  }

}


================================================
FILE: src/objects/productgroup.js
================================================
import { AbstractCrudObject } from './../core'
import ProductItem from './productitem'
import ProductSet from './productset'

export default class ProductGroup extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      product_catalog: 'product_catalog',
      retailer_id: 'retailer_id',
      variants: 'variants'
    })
  }

  static getEndpoint () {
    return 'product_groups'
  }

  getProductSets (fields, params) {
    return this.getEdge(ProductSet, fields, params, 'product_sets')
  }

  getProducts (fields, params) {
    return this.getEdge(ProductItem, fields, params, 'products')
  }

}


================================================
FILE: src/objects/productitem.js
================================================
import { AbstractCrudObject } from './../core'
import ProductSet from './productset'

export default class ProductItem extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      additional_image_urls: 'additional_image_urls',
      age_group: 'age_group',
      android_app_name: 'android_app_name',
      android_class: 'android_class',
      android_package: 'android_package',
      android_url: 'android_url',
      applinks: 'applinks',
      availability: 'availability',
      brand: 'brand',
      category: 'category',
      checkout_url: 'checkout_url',
      color: 'color',
      commerce_insights: 'commerce_insights',
      condition: 'condition',
      currency: 'currency',
      custom_data: 'custom_data',
      custom_label_0: 'custom_label_0',
      custom_label_1: 'custom_label_1',
      custom_label_2: 'custom_label_2',
      custom_label_3: 'custom_label_3',
      custom_label_4: 'custom_label_4',
      description: 'description',
      expiration_date: 'expiration_date',
      gender: 'gender',
      gtin: 'gtin',
      id: 'id',
      image_url: 'image_url',
      inventory: 'inventory',
      ios_app_name: 'ios_app_name',
      ios_app_store_id: 'ios_app_store_id',
      ios_url: 'ios_url',
      ipad_app_name: 'ipad_app_name',
      ipad_app_store_id: 'ipad_app_store_id',
      ipad_url: 'ipad_url',
      iphone_app_name: 'iphone_app_name',
      iphone_app_store_id: 'iphone_app_store_id',
      iphone_url: 'iphone_url',
      manufacturer_part_number: 'manufacturer_part_number',
      material: 'material',
      name: 'name',
      ordering_index: 'ordering_index',
      pattern: 'pattern',
      price: 'price',
      product_catalog: 'product_catalog',
      product_feed: 'product_feed',
      product_group: 'product_group',
      product_type: 'product_type',
      retailer_id: 'retailer_id',
      retailer_product_group_id: 'retailer_product_group_id',
      review_rejection_reasons: 'review_rejection_reasons',
      review_status: 'review_status',
      sale_price: 'sale_price',
      sale_price_end_date: 'sale_price_end_date',
      sale_price_start_date: 'sale_price_start_date',
      shipping_weight_unit: 'shipping_weight_unit',
      shipping_weight_value: 'shipping_weight_value',
      short_description: 'short_description',
      size: 'size',
      start_date: 'start_date',
      url: 'url',
      visibility: 'visibility',
      windows_phone_app_id: 'windows_phone_app_id',
      windows_phone_app_name: 'windows_phone_app_name',
      windows_phone_url: 'windows_phone_url'
    })
  }

  static get AgeGroup () {
    return Object.freeze({
      adult: 'adult',
      infant: 'infant',
      kids: 'kids',
      newborn: 'newborn',
      toddler: 'toddler'
    })
  }

  static get Availability () {
    return Object.freeze({
      available_for_order: 'available for order',
      discontinued: 'discontinued',
      in_stock: 'in stock',
      out_of_stock: 'out of stock',
      preorder: 'preorder'
    })
  }

  static get Condition () {
    return Object.freeze({
      new: 'new',
      refurbished: 'refurbished',
      used: 'used'
    })
  }

  static get Gender () {
    return Object.freeze({
      female: 'female',
      male: 'male',
      unisex: 'unisex'
    })
  }

  static get ReviewStatus () {
    return Object.freeze({
      approved: 'approved',
      pending: 'pending',
      rejected: 'rejected'
    })
  }

  static get ShippingWeightUnit () {
    return Object.freeze({
      kg: 'kg',
      lb: 'lb',
      oz: 'oz',
      value_g: 'g'
    })
  }

  static get Visibility () {
    return Object.freeze({
      published: 'published',
      staging: 'staging'
    })
  }

  static getEndpoint () {
    return 'products'
  }

  getProductSets (fields, params) {
    return this.getEdge(ProductSet, fields, params, 'product_sets')
  }

}


================================================
FILE: src/objects/productset.js
================================================
import { AbstractCrudObject } from './../core'
import ProductGroup from './productgroup'
import ProductItem from './productitem'

export default class ProductSet extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      auto_creation_url: 'auto_creation_url',
      filter: 'filter',
      id: 'id',
      name: 'name',
      product_catalog: 'product_catalog',
      product_count: 'product_count'
    })
  }

  static getEndpoint () {
    return 'product_sets'
  }

  getProductGroups (fields, params) {
    return this.getEdge(ProductGroup, fields, params, 'product_groups')
  }

  getProducts (fields, params) {
    return this.getEdge(ProductItem, fields, params, 'products')
  }

}


================================================
FILE: src/objects/profilepicturesource.js
================================================
import { AbstractObject } from './../core'

export default class ProfilePictureSource extends AbstractObject {

  static get Field () {
    return Object.freeze({
      bottom: 'bottom',
      height: 'height',
      is_silhouette: 'is_silhouette',
      left: 'left',
      right: 'right',
      top: 'top',
      url: 'url',
      width: 'width'
    })
  }

  static get Type () {
    return Object.freeze({
      album: 'album',
      large: 'large',
      normal: 'normal',
      small: 'small',
      square: 'square'
    })
  }

}


================================================
FILE: src/objects/ratecard.js
================================================
import { AbstractObject } from './../core'

export default class RateCard extends AbstractObject {

  static get Field () {
    return Object.freeze({
      country: 'country',
      currency: 'currency',
      rate: 'rate'
    })
  }

  static getEndpoint () {
    return 'ratecard'
  }

}


================================================
FILE: src/objects/reachestimate.js
================================================
import { AbstractObject } from './../core'

export default class ReachEstimate extends AbstractObject {

  static get Field () {
    return Object.freeze({
      estimate_ready: 'estimate_ready',
      unsupported: 'unsupported',
      users: 'users'
    })
  }

  static get OptimizeFor () {
    return Object.freeze({
      app_downloads: 'APP_DOWNLOADS',
      app_installs: 'APP_INSTALLS',
      brand_awareness: 'BRAND_AWARENESS',
      clicks: 'CLICKS',
      engaged_users: 'ENGAGED_USERS',
      event_responses: 'EVENT_RESPONSES',
      impressions: 'IMPRESSIONS',
      lead_generation: 'LEAD_GENERATION',
      link_clicks: 'LINK_CLICKS',
      none: 'NONE',
      offer_claims: 'OFFER_CLAIMS',
      offsite_conversions: 'OFFSITE_CONVERSIONS',
      page_engagement: 'PAGE_ENGAGEMENT',
      page_likes: 'PAGE_LIKES',
      post_engagement: 'POST_ENGAGEMENT',
      reach: 'REACH',
      social_impressions: 'SOCIAL_IMPRESSIONS',
      video_views: 'VIDEO_VIEWS'
    })
  }

  static getEndpoint () {
    return 'reachestimate'
  }

}


================================================
FILE: src/objects/reachfrequencyprediction.js
================================================
import { AbstractCrudObject } from './../core'

export default class ReachFrequencyPrediction extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      budget: 'budget',
      campaign_group_id: 'campaign_group_id',
      campaign_id: 'campaign_id',
      campaign_time_start: 'campaign_time_start',
      campaign_time_stop: 'campaign_time_stop',
      curve_budget_reach: 'curve_budget_reach',
      daily_impression_curve: 'daily_impression_curve',
      day_parting_schedule: 'day_parting_schedule',
      destination_id: 'destination_id',
      destination_ids: 'destination_ids',
      end_time: 'end_time',
      expiration_time: 'expiration_time',
      external_budget: 'external_budget',
      external_impression: 'external_impression',
      external_maximum_budget: 'external_maximum_budget',
      external_maximum_impression: 'external_maximum_impression',
      external_maximum_reach: 'external_maximum_reach',
      external_minimum_budget: 'external_minimum_budget',
      external_minimum_impression: 'external_minimum_impression',
      external_minimum_reach: 'external_minimum_reach',
      external_reach: 'external_reach',
      frequency_cap: 'frequency_cap',
      grp_dmas_audience_size: 'grp_dmas_audience_size',
      holdout_percentage: 'holdout_percentage',
      id: 'id',
      instagram_destination_id: 'instagram_destination_id',
      interval_frequency_cap: 'interval_frequency_cap',
      interval_frequency_cap_reset_period: 'interval_frequency_cap_reset_period',
      name: 'name',
      num_curve_points: 'num_curve_points',
      objective: 'objective',
      pause_periods: 'pause_periods',
      placement_breakdown: 'placement_breakdown',
      prediction_mode: 'prediction_mode',
      prediction_progress: 'prediction_progress',
      reach: 'reach',
      reservation_status: 'reservation_status',
      rf_prediction_id_to_share: 'rf_prediction_id_to_share',
      start_time: 'start_time',
      status: 'status',
      stop_time: 'stop_time',
      story_event_type: 'story_event_type',
      target_audience_size: 'target_audience_size',
      target_spec: 'target_spec',
      time_created: 'time_created',
      time_updated: 'time_updated'
    })
  }

  static get Status () {
    return Object.freeze({
      active: 'ACTIVE',
      completed: 'COMPLETED',
      draft: 'DRAFT',
      expired: 'EXPIRED',
      pending: 'PENDING'
    })
  }

  static getEndpoint () {
    return 'reachfrequencypredictions'
  }

}


================================================
FILE: src/objects/targetingsentenceline.js
================================================
import { AbstractCrudObject } from './../core'

export default class TargetingSentenceLine extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      id: 'id',
      params: 'params',
      targetingsentencelines: 'targetingsentencelines'
    })
  }

  static getEndpoint () {
    return 'targetingsentencelines'
  }

}


================================================
FILE: src/objects/transaction.js
================================================
import { AbstractCrudObject } from './../core'

export default class Transaction extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      account_id: 'account_id',
      app_amount: 'app_amount',
      billing_end_time: 'billing_end_time',
      billing_reason: 'billing_reason',
      billing_start_time: 'billing_start_time',
      charge_type: 'charge_type',
      checkout_campaign_group_id: 'checkout_campaign_group_id',
      credential_id: 'credential_id',
      fatura_id: 'fatura_id',
      id: 'id',
      payment_option: 'payment_option',
      product_type: 'product_type',
      provider_amount: 'provider_amount',
      status: 'status',
      time: 'time',
      tracking_id: 'tracking_id'
    })
  }

  static get ProductType () {
    return Object.freeze({
      facebook_ad: 'facebook_ad',
      ig_ad: 'ig_ad'
    })
  }

  static getEndpoint () {
    return 'transactions'
  }

}


================================================
FILE: src/objects/user.js
================================================
import { AbstractCrudObject } from './../core'
import AdAccount from './adaccount'
import Domain from './domain'
import Event from './event'
import LeadgenForm from './leadgenform'
import ProfilePictureSource from './profilepicturesource'

export default class User extends AbstractCrudObject {

  static get Field () {
    return Object.freeze({
      about: 'about',
      admin_notes: 'admin_notes',
      age_range: 'age_range',
      birthday: 'birthday',
      can_review_measurement_request: 'can_review_measurement_request',
      context: 'context',
      cover: 'cover',
      currency: 'currency',
      devices: 'devices',
      education: 'education',
      email: 'email',
      employee_number: 'employee_number',
      favorite_athletes: 'favorite_athletes',
      favorite_teams: 'favorite_teams',
      first_name: 'first_name',
      gender: 'gender',
      hometown: 'hometown',
      id: 'id',
      inspirational_people: 'inspirational_people',
      install_type: 'install_type',
      installed: 'installed',
      interested_in: 'interested_in',
      is_shared_login: 'is_shared_login',
      is_verified: 'is_verified',
      labels: 'labels',
      languages: 'languages',
      last_name: 'last_name',
      link: 'link',
      locale: 'locale',
      location: 'location',
      meeting_for: 'meeting_for',
      middle_name: 'middle_name',
      name: 'name',
      name_format: 'name_format',
      payment_pricepoints: 'payment_pricepoints',
      political: 'political',
      public_key: 'public_key',
      quotes: 'quotes',
      relationship_status: 'relationship_status',
      religion: 'religion',
      security_settings: 'security_settings',
      shared_login_upgrade_required_by: 'shared_login_upgrade_required_by',
      short_name: 'short_name',
      significant_other: 'significant_other',
      sports: 'sports',
      test_group: 'test_group',
      third_party_id: 'third_party_id',
      timezone: 'timezone',
      token_for_business: 'token_for_business',
      updated_time: 'updated_time',
      verified: 'verified',
      video_upload_limits: 'video_upload_limits',
      viewer_can_send_gift: 'viewer_can_send_gift',
      website: 'website',
      work: 'work'
    })
  }

  getAccounts (fields, params) {
    return this.getEdge(AbstractCrudObject, fields, params, 'accounts')
  }

  getAdAccounts (fields, params) {
    return this.getEdge(AdAccount, fields, params, 'adaccounts')
  }

  getLeadGenForms (fields, params) {
    return this.getEdge(LeadgenForm, fields, params, 'leadgen_forms')
  }

  getPicture (fields, params) {
    return this.getEdge(ProfilePictureSource, fields, params, 'picture')
  }

  getPromotableDomains (fields, params) {
    return this.getEdge(Domain, fields, params, 'promotable_domains')
  }

  getPromotableEvents (fields, params) {
    return this.getEdge(Event, fields, params, 'promotable_events')
  }

}


================================================
FILE: test/index.html
================================================
<!doctype html>
<html>
  <head>
      <meta charset="utf-8">
      <title>Facebook JS Ads SDK Mocha Spec Runner</title>
      <link rel="stylesheet" href="../bower_components/mocha/mocha.css">
  </head>
  <body>
    <div id="mocha"></div>
    <script data-main="spec" src="../bower_components/requirejs/require.js"></script>
  </body>
</html>


================================================
FILE: test/integration/config.sample
================================================
{
  "accessToken": "",
  "accountId": ""
}


================================================
FILE: test/integration/index.html
================================================
<!doctype html>
<html>
  <head>
      <meta charset="utf-8">
      <title>Facebook JS Ads SDK Integration Mocha Spec Runner</title>
      <link rel="stylesheet" href="../../bower_components/mocha/mocha.css">
  </head>
  <body>
    <div id="mocha"></div>
    <script data-main="spec" src="../../bower_components/requirejs/require.js"></script>
  </body>
</html>


================================================
FILE: test/integration/spec.js
================================================
requirejs.config({
  paths: {
    'mocha': './../../bower_components/mocha/mocha',
    'chai': './../../bower_components/chai/chai'
  },
  shim: {
    'mocha': {
      init: function () {
        this.mocha.setup('bdd')
        return this.mocha
      }
    }
  }
})

require([
  'mocha',
  'chai'
], function () {
  require([
    './suite'
  ], function () {
    mocha.ui('bdd')
    mocha.run()
  })
})


================================================
FILE: test/integration/test-integration.js
================================================
import chai from 'chai'
import FacebookAdsApi from './../../src/api'
import { accessToken, accountId } from './config.json'
import { FacebookRequestError } from './../../src/exceptions'
import AdAccount from './../../src/objects/adaccount'
import AdsInsights from './../../src/objects/adsinsights'
import Campaign from './../../src/objects/campaign'

var api
var account
var campaign

chai.should()

before(() => {
  api = FacebookAdsApi.init(accessToken).setDebug(true)
  if (!accountId.startsWith('act_')) throw new Error('accountId should start with "act_"')
})

describe('Api', function () {
  this.timeout(10000)

  it('should reject requests with FacebookRequestError', (done) => {
    api.call('GET', [''])
      .then(() => { throw new Error('Promise should have been rejected') })
      .catch((error) => {
        error.should.be.an.instanceof(FacebookRequestError)
        done()
      })
      .catch(done)
  })
})

describe('Graph Objects', function () {
  this.timeout(10000)

  it('should be read', (done) => {
    account = new AdAccount({'id': accountId})
    account.read([AdAccount.Field.id, AdAccount.Field.name])
      .then(() => {
        account.name.should.be.ok
        done()
      })
      .catch(done)
  })

  it('should be created', (done) => {
    const data = {
      [Campaign.Field.name]: 'Facebook JS Ads SDK Test',
      [Campaign.Field.objective]: Campaign.Objective.link_clicks,
      [Campaign.Field.status]: Campaign.Status.paused
    }
    new Campaign(data, accountId).save()
      .then((result) => {
        campaign = result
        campaign.id.should.be.ok
        done()
      })
      .catch(done)
  })

  it('should be updated', (done) => {
    campaign.name = 'Facebook JS Ads SDK Test Updated'
    campaign.save()
      .then((result) => {
        result.success.should.be.true
        done()
      })
      .catch(done)
  })

  it('should read their related objects', (done) => {
    account.getCampaigns([Campaign.Field.name])
      .then((campaigns) => {
        campaigns.should.be.a('array').and.have.length.above(0)
        campaigns[0].should.be.an.instanceof(Campaign)
        campaigns[0].name.should.be.ok
        done()
      })
      .catch(done)
  })

  it('should get their insights', (done) => {
    const insightsFields = [AdsInsights.Field.spend]
    const insightsParams = { date_preset: Campaign.DatePreset.lifetime }
    account.getInsights(insightsFields, insightsParams)
      .then((insights) => {
        insights.should.be.a('array').and.have.length.above(0)
        insights[0].should.be.an.instanceof(AdsInsights)
        insights[0].spend.should.be.ok
        done()
      })
      .catch(done)
  })

  it('should be deleted', (done) => {
    campaign.delete()
      .then((result) => {
        result.success.should.be.true
        done()
      })
      .catch(done)
  })

  it('should be read by ids', (done) => {
    AdAccount.getByIds([accountId])
      .then((objects) => {
        objects.should.be.a('array').and.have.lengthOf(1)
        objects[0].should.be.an.instanceof(AdAccount)
        done()
      })
      .catch(done)
  })

  it('should paginate edges', (done) => {
    var campaigns
    const data = {
      [Campaign.Field.name]: 'Facebook JS Ads SDK Test',
      [Campaign.Field.objective]: Campaign.Objective.link_clicks,
      [Campaign.Field.status]: Campaign.Status.paused
    }
    Promise.all([new Campaign(data, accountId).save(), new Campaign(data, accountId).save()])
      .then((result) => {
        campaigns = result
        return account.getCampaigns(['name'], { 'limit': 1 })
      })
      .then((cursor) => {
        cursor.hasNext().should.be.true
        return cursor.next()
      })
      .then((cursor) => {
        cursor.hasPrevious().should.be.true
        return cursor.previous()
      })
      .then((cursor) => Promise.all([campaigns[0].delete(), campaigns[1].delete()]))
      .then((results) => done())
      .catch(done)
  })
})


================================================
FILE: test/mocha.opts
================================================
--recursive

================================================
FILE: test/spec.js
================================================
requirejs.config({
  paths: {
    'bluebird': './../bower_components/bluebird/js/browser/bluebird',
    'mocha': './../bower_components/mocha/mocha',
    'chai': './../bower_components/chai/chai'
  },
  shim: {
    'mocha': {
      init: function () {
        this.mocha.setup('bdd')
        return this.mocha
      }
    }
  }
})

require([
  'bluebird',
  'mocha',
  'chai'
], function (bluebird) {
  window.Promise = bluebird
  require([
    './suite'
  ], function () {
    mocha.ui('bdd')
    mocha.run()
  })
})


================================================
FILE: test/src/test-api.js
================================================
import FacebookAdsApi from './../../src/api'
import { should } from 'chai'
should()

describe('FacebookAdsApi', () => {
  it('should hold a a default instance', () => {
    const api = FacebookAdsApi.init('token')
    FacebookAdsApi.getDefaultApi().should.be.equal(api)
  })

  it('should encode params', () => {
    const params = {
      'a': 'b',
      'c': [1, 2],
      'd': {e: 'f'},
      'g': [{e: 'f'}]
    }
    const query = FacebookAdsApi._encodeParams(params)
    query.should.be.equal('a=b&c=%5B1%2C2%5D&d=%7B%22e%22%3A%22f%22%7D&g=%5B%7B%22e%22%3A%22f%22%7D%5D')
  })
})


================================================
FILE: test/src/test-core.js
================================================
import { AbstractObject, AbstractCrudObject, Cursor } from './../../src/core'
import chai from 'chai'
chai.should()

describe('AbstractObject', () => {
  class ConcreteObject extends AbstractObject {
    static get Field () { return Object.freeze({ field: 'field' }) }
  }

  it('should possess a Field enum', () => {
    ;() => (new AbstractObject()).should.throw(Error)
    ;() => (ConcreteObject.Field = {}).should.throw(TypeError)
    ;() => (ConcreteObject.Field.field = '').should.throw(TypeError)
    ConcreteObject.Field.field.should.be.equal('field')
  })

  it('should create a data object with getters and setters for fields', () => {
    const object = new ConcreteObject()
    const descriptor = Object.getOwnPropertyDescriptor(object, 'field')
    descriptor.get.should.be.a('function')
    descriptor.set.should.be.a('function')
    descriptor.enumerable.should.be.ok
  })

  it('should set data on instantiation', () => {
    const object = new ConcreteObject({'field': 3})
    object._data.should.be.eql({field: 3})
  })

  it('should set a data field value', () => {
    const object = new ConcreteObject()
    object.set('field', 1)
    object._data.field.should.be.equal(1)
  })

  it('should set an extra data field value', () => {
    const object = new ConcreteObject()
    object.set('field', 1)
    object._data.field.should.be.equal(1)
  })

  it('should chain the set method', () => {
    const object = new ConcreteObject()
    object.set('field', 1).should.be.equal(object)
  })

  it('should set multiple data fields', () => {
    const object = new ConcreteObject()
    object.setData({field: 1, extrafield: 2})
    object.field.should.be.equal(1)
    object.extrafield.should.be.equal(2)
  })

  it('should set data', () => {
    const data = {field: 1, extrafield: 2}
    const object = new ConcreteObject().setData(data)
    object.exportData().should.be.eql(data)
  })

  it('should chain the setData method', () => {
    const object = new ConcreteObject()
    object.setData({field: 1}).should.be.equal(object)
  })

  it('should export data', () => {
    const data = {field: 1, extrafield: 2}
    const object = new ConcreteObject()
    object.setData(data)
    object.exportData().should.be.eql(data)
  })
})

describe('AbstractCrudObject', () => {
  class ConcreteCrudObject extends AbstractCrudObject {
    static get Field () { return Object.freeze({ field: 'field', anotherfield: 'anotherfield' }) }
  }

  it('should store changes for field properties', () => {
    const object = new ConcreteCrudObject({'field': 3})
    object.set('extraField', 4)
    object._changes.should.be.eql({field: 3, extraField: 4})
  })

  it('should set data wiping change history', () => {
    const object = new ConcreteCrudObject()
    object.field = 3
    object.setData({'field': 3})
    object.exportData().should.be.eql({})
  })

  it('should export changed data', () => {
    const object = new ConcreteCrudObject()
    object.field = 3
    object.exportData().should.be.eql({'field': 3})
  })

  it('should export all data', () => {
    const object = new ConcreteCrudObject()
    object._data = {'field': 3}
    object.anotherfield = 4
    object.exportAllData().should.be.eql({'anotherfield': 4, 'field': 3})
  })

  it('should clear change history', () => {
    const object = new ConcreteCrudObject()
    object.field = 3
    object.clearHistory()
    object.exportData().should.be.eql({})
  })
})

describe('Cursor', () => {
  const callStub = (method, url) => {
    return new Promise((resolve, reject) => {
      if (url === '[nextUrl]') {
        resolve({
          data: [4, 5, 6],
          paging: {
            cursors: {
              before: '[beforeCursor]',
              after: '[afterCursor]'
            },
            previous: '[previousUrl]'
          },
          summary: { total_count: 6 }
        })
      } else {
        resolve({
          data: [1, 2, 3],
          paging: {
            cursors: {
              before: '[beforeCursor]',
              after: '[afterCursor]'
            },
            next: '[nextUrl]'
          },
          summary: { total_count: 6 }
        })
      }
    })
  }
  const sourceObject = { getId: () => 'id', getApi: () => ({call: callStub}) }
  class targetClass {
    constructor (num) { this.v = num }
    static get Field () {}
    static getEndpoint () { 'endpoint' }
  }

  it('should clear data', () => {
    const cursor = new Cursor(sourceObject, targetClass)
    cursor.push(1, 2, 3)
    cursor.clear()
    cursor.length.should.be.equal(0)
  })

  it('should set data', () => {
    const cursor = new Cursor(sourceObject, targetClass)
    const data = [1, 2, 3]
    cursor.set(data)
    cursor.length.should.be.equal(3)
    ;[...cursor].should.be.eql(data)
  })

  it('should load next and previous pages', (done) => {
    const cursor = new Cursor(sourceObject, targetClass)
    cursor.hasNext().should.be.true
    cursor.next()
    .then(() => {
      ;[...cursor].should.be.eql([{v: 1}, {v: 2}, {v: 3}])
      cursor.hasNext().should.be.true
      cursor.hasPrevious().should.be.false
      cursor.paging.next.should.be.eql('[nextUrl]')
      return cursor.next()
    })
    .then(() => {
      ;[...cursor].should.be.eql([{v: 4}, {v: 5}, {v: 6}])
      cursor.hasNext().should.be.false
      cursor.hasPrevious().should.be.true
      return cursor.next()
    })
    .catch((error) => {
      if (error instanceof chai.AssertionError) throw error
      error.should.be.an.instanceof(RangeError)
      return cursor.previous()
    })
    .then(() => {
      ;[...cursor].should.be.eql([{v: 1}, {v: 2}, {v: 3}])
      cursor.hasNext().should.be.true
      cursor.hasPrevious().should.be.false
      return cursor.previous()
    })
    .catch((error) => {
      if (error instanceof chai.AssertionError) throw error
      error.should.be.an.instanceof(RangeError)
      done()
    })
    .catch(done)
  })
})


================================================
FILE: test/src/test-exceptions.js
================================================
import * as exc from './../../src/exceptions'
import { should } from 'chai'
should()

describe('Exceptions', () => {
  it('should be checked with instanceof', () => {
    let error = new exc.FacebookRequestError({
      body: { error: { message: 'Unsupported get request' } }
    })
    error.should.be.an.instanceof(Error)
    error.should.be.an.instanceof(exc.FacebookRequestError)
  })
})


================================================
FILE: test/standard.js
================================================
describe('Standard JS', function () {
  this.timeout(5000)
  var standard = require('mocha-standard')
  it('should be respected', standard.files(['src/**/*.js', 'test/**/*.js']))
})


================================================
FILE: test/suite.es6
================================================
import './src/test-api'
import './src/test-core'
import './src/test-exceptions'
gitextract_zqqg9s1r/

├── .babelrc
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .npmignore
├── .travis.yml
├── README.md
├── bower.json
├── gulpfile.js
├── package.json
├── src/
│   ├── api.js
│   ├── bundle.es6
│   ├── core.js
│   ├── exceptions.js
│   ├── globals.es6
│   ├── http.js
│   ├── mixins.js
│   └── objects/
│       ├── ad.js
│       ├── adaccount.js
│       ├── adaccountroas.js
│       ├── adaccounttargetingunified.js
│       ├── adaccountuser.js
│       ├── adactivity.js
│       ├── adasyncrequest.js
│       ├── adasyncrequestset.js
│       ├── adcreative.js
│       ├── adimage.js
│       ├── adkeywordstats.js
│       ├── adlabel.js
│       ├── adplacepageset.js
│       ├── adpreview.js
│       ├── adreportrun.js
│       ├── adsdatapartner.js
│       ├── adset.js
│       ├── adsinsights.js
│       ├── adspixel.js
│       ├── adspixelstatsresult.js
│       ├── broadtargetingcategories.js
│       ├── business.js
│       ├── businessadaccountrequest.js
│       ├── businesspagerequest.js
│       ├── campaign.js
│       ├── customaudience.js
│       ├── customaudienceprefillstate.js
│       ├── customaudiencesession.js
│       ├── customaudiencestos.js
│       ├── domain.js
│       ├── event.js
│       ├── eventsourcegroup.js
│       ├── externaleventsource.js
│       ├── hotel.js
│       ├── lead.js
│       ├── leadgenform.js
│       ├── legacybusinessadaccountrequest.js
│       ├── minimumbudget.js
│       ├── offsitepixel.js
│       ├── partnercategory.js
│       ├── productcatalog.js
│       ├── productcataloghotelroomsbatch.js
│       ├── productcatalogpricingvariablesbatch.js
│       ├── productfeed.js
│       ├── productfeedupload.js
│       ├── productfeeduploaderror.js
│       ├── productfeeduploaderrorsample.js
│       ├── productgroup.js
│       ├── productitem.js
│       ├── productset.js
│       ├── profilepicturesource.js
│       ├── ratecard.js
│       ├── reachestimate.js
│       ├── reachfrequencyprediction.js
│       ├── targetingsentenceline.js
│       ├── transaction.js
│       └── user.js
└── test/
    ├── index.html
    ├── integration/
    │   ├── config.sample
    │   ├── index.html
    │   ├── spec.js
    │   └── test-integration.js
    ├── mocha.opts
    ├── spec.js
    ├── src/
    │   ├── test-api.js
    │   ├── test-core.js
    │   └── test-exceptions.js
    ├── standard.js
    └── suite.es6
Condensed preview — 86 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (154K chars).
[
  {
    "path": ".babelrc",
    "chars": 28,
    "preview": "{\n  \"presets\": [\"es2015\"]\n}\n"
  },
  {
    "path": ".editorconfig",
    "chars": 206,
    "preview": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_..."
  },
  {
    "path": ".gitattributes",
    "chars": 12,
    "preview": "* text=auto\n"
  },
  {
    "path": ".gitignore",
    "chars": 75,
    "preview": "dist/\ntest/**/suite.js*\ntest/**/*.json\nnode_modules\nbower_components\n*.log\n"
  },
  {
    "path": ".npmignore",
    "chars": 69,
    "preview": "test/**/suite.js*\ntest/**/*.json\nnode_modules\nbower_components\n*.log\n"
  },
  {
    "path": ".travis.yml",
    "chars": 133,
    "preview": "language: node_js\nnode_js:\n  - \"6\"\n  - \"5\"\n  - \"4\"\nbefore_script:\n  - npm install -g gulp\n  - npm install -g bower\n  - b..."
  },
  {
    "path": "README.md",
    "chars": 8815,
    "preview": "# DEPRECATED\n\nFacebook released the official SDK based on this project. This project will no longer be maintained.\n\nhttp..."
  },
  {
    "path": "bower.json",
    "chars": 857,
    "preview": "{\n  \"name\": \"facebook-ads-sdk\",\n  \"version\": \"2.10.5\",\n  \"description\": \"SDK for the Facebook Ads API in Javascript and..."
  },
  {
    "path": "gulpfile.js",
    "chars": 3167,
    "preview": "'use strict'\n\nvar gulp = require('gulp')\nvar $ = require('gulp-load-plugins')()\nvar babel = require('rollup-plugin-babel..."
  },
  {
    "path": "package.json",
    "chars": 2106,
    "preview": "{\n  \"name\": \"facebook-ads-sdk\",\n  \"version\": \"2.10.5\",\n  \"description\": \"SDK for the Facebook Ads API in Javascript and..."
  },
  {
    "path": "src/api.js",
    "chars": 2335,
    "preview": "import Http from './http'\nimport { FacebookRequestError } from './exceptions'\n\n/**\n * Facebook Ads API\n */\nexport defaul..."
  },
  {
    "path": "src/bundle.es6",
    "chars": 4433,
    "preview": "export { default as FacebookAdsApi } from './../src/api'\nexport { default as Ad } from './../src/objects/ad'\nexport { de..."
  },
  {
    "path": "src/core.js",
    "chars": 8827,
    "preview": "import FacebookAdsApi from './api'\n\n/**\n * Abstract Object\n * Manages object data fields and provides matching propertie..."
  },
  {
    "path": "src/exceptions.js",
    "chars": 916,
    "preview": "function FacebookError (error) {\n  this.name = 'FacebookError'\n  this.message = error.message\n  this.stack = (new Error(..."
  },
  {
    "path": "src/globals.es6",
    "chars": 2381,
    "preview": "import './../src/api'\nimport './../src/objects/ad'\nimport './../src/objects/adaccount'\nimport './../src/objects/adaccoun..."
  },
  {
    "path": "src/http.js",
    "chars": 2263,
    "preview": "import Api from './api'\n\n/**\n * Isomorphic Http Promise Requests Class\n */\nexport default class Http {\n\n  /**\n   * Reque..."
  },
  {
    "path": "src/mixins.js",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/objects/ad.js",
    "chars": 4190,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdCreative from './adcreative'\nimport AdKeywordStats from './adkey..."
  },
  {
    "path": "src/objects/adaccount.js",
    "chars": 9170,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Ad from './ad'\nimport AdAccountRoas from './adaccountroas'\nimport..."
  },
  {
    "path": "src/objects/adaccountroas.js",
    "chars": 2008,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class AdAccountRoas extends AbstractObject {\n\n  static get Fi..."
  },
  {
    "path": "src/objects/adaccounttargetingunified.js",
    "chars": 4505,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdAccountTargetingUnified extends AbstractCrudObjec..."
  },
  {
    "path": "src/objects/adaccountuser.js",
    "chars": 317,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdAccountUser extends AbstractCrudObject {\n\n  stati..."
  },
  {
    "path": "src/objects/adactivity.js",
    "chars": 4253,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class AdActivity extends AbstractObject {\n\n  static get Field..."
  },
  {
    "path": "src/objects/adasyncrequest.js",
    "chars": 1192,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdAsyncRequest extends AbstractCrudObject {\n\n  stat..."
  },
  {
    "path": "src/objects/adasyncrequestset.js",
    "chars": 1290,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdAsyncRequest from './adasyncrequest'\n\nexport default class AdAsy..."
  },
  {
    "path": "src/objects/adcreative.js",
    "chars": 3815,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdPreview from './adpreview'\n\nexport default class AdCreative exte..."
  },
  {
    "path": "src/objects/adimage.js",
    "chars": 951,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdImage extends AbstractCrudObject {\n\n  static get..."
  },
  {
    "path": "src/objects/adkeywordstats.js",
    "chars": 857,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdKeywordStats extends AbstractCrudObject {\n\n  stat..."
  },
  {
    "path": "src/objects/adlabel.js",
    "chars": 978,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Ad from './ad'\nimport AdCreative from './adcreative'\nimport AdSet..."
  },
  {
    "path": "src/objects/adplacepageset.js",
    "chars": 531,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdPlacePageSet extends AbstractCrudObject {\n\n  stat..."
  },
  {
    "path": "src/objects/adpreview.js",
    "chars": 1031,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class AdPreview extends AbstractObject {\n\n  static get Field..."
  },
  {
    "path": "src/objects/adreportrun.js",
    "chars": 1523,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdsInsights from './adsinsights'\n\nexport default class AdReportRun..."
  },
  {
    "path": "src/objects/adsdatapartner.js",
    "chars": 262,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class AdsDataPartner extends AbstractCrudObject {\n\n  stat..."
  },
  {
    "path": "src/objects/adset.js",
    "chars": 5881,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Ad from './ad'\nimport AdActivity from './adactivity'\nimport AdAsyn..."
  },
  {
    "path": "src/objects/adsinsights.js",
    "chars": 7767,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class AdsInsights extends AbstractObject {\n\n  static get Fiel..."
  },
  {
    "path": "src/objects/adspixel.js",
    "chars": 1114,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdAccount from './adaccount'\nimport AdsPixelStatsResult from './ad..."
  },
  {
    "path": "src/objects/adspixelstatsresult.js",
    "chars": 615,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class AdsPixelStatsResult extends AbstractObject {\n\n  static..."
  },
  {
    "path": "src/objects/broadtargetingcategories.js",
    "chars": 607,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class BroadTargetingCategories extends AbstractCrudObject..."
  },
  {
    "path": "src/objects/business.js",
    "chars": 4075,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdAccount from './adaccount'\nimport AdsPixel from './adspixel'\nimp..."
  },
  {
    "path": "src/objects/businessadaccountrequest.js",
    "chars": 236,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class BusinessAdAccountRequest extends AbstractCrudObject..."
  },
  {
    "path": "src/objects/businesspagerequest.js",
    "chars": 219,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class BusinessPageRequest extends AbstractCrudObject {..."
  },
  {
    "path": "src/objects/campaign.js",
    "chars": 4002,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Ad from './ad'\nimport AdReportRun from './adreportrun'\nimport AdSe..."
  },
  {
    "path": "src/objects/customaudience.js",
    "chars": 3830,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Ad from './ad'\nimport AdAccount from './adaccount'\nimport CustomAu..."
  },
  {
    "path": "src/objects/customaudienceprefillstate.js",
    "chars": 270,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class CustomAudiencePrefillState extends AbstractObject {..."
  },
  {
    "path": "src/objects/customaudiencesession.js",
    "chars": 439,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class CustomAudienceSession extends AbstractObject {\n\n  stati..."
  },
  {
    "path": "src/objects/customaudiencestos.js",
    "chars": 244,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class CustomAudiencesTOS extends AbstractCrudObject {..."
  },
  {
    "path": "src/objects/domain.js",
    "chars": 224,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class Domain extends AbstractCrudObject {\n\n  static get F..."
  },
  {
    "path": "src/objects/event.js",
    "chars": 1282,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProfilePictureSource from './profilepicturesource'\n\nexport default..."
  },
  {
    "path": "src/objects/eventsourcegroup.js",
    "chars": 346,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class EventSourceGroup extends AbstractCrudObject {\n\n  st..."
  },
  {
    "path": "src/objects/externaleventsource.js",
    "chars": 376,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class ExternalEventSource extends AbstractCrudObject {..."
  },
  {
    "path": "src/objects/hotel.js",
    "chars": 576,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class Hotel extends AbstractCrudObject {\n\n  static get Fi..."
  },
  {
    "path": "src/objects/lead.js",
    "chars": 670,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class Lead extends AbstractCrudObject {\n\n  static get Fie..."
  },
  {
    "path": "src/objects/leadgenform.js",
    "chars": 1377,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Lead from './lead'\n\nexport default class LeadgenForm extends Abstr..."
  },
  {
    "path": "src/objects/legacybusinessadaccountrequest.js",
    "chars": 284,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class LegacyBusinessAdAccountRequest extends AbstractCrud..."
  },
  {
    "path": "src/objects/minimumbudget.js",
    "chars": 503,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class MinimumBudget extends AbstractObject {\n\n  static get Fi..."
  },
  {
    "path": "src/objects/offsitepixel.js",
    "chars": 765,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdAccount from './adaccount'\n\nexport default class OffsitePixel ex..."
  },
  {
    "path": "src/objects/partnercategory.js",
    "chars": 693,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class PartnerCategory extends AbstractCrudObject {\n\n  sta..."
  },
  {
    "path": "src/objects/productcatalog.js",
    "chars": 2691,
    "preview": "import { AbstractCrudObject } from './../core'\nimport Business from './business'\nimport ExternalEventSource from './exte..."
  },
  {
    "path": "src/objects/productcataloghotelroomsbatch.js",
    "chars": 620,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class ProductCatalogHotelRoomsBatch extends AbstractCrudO..."
  },
  {
    "path": "src/objects/productcatalogpricingvariablesbatch.js",
    "chars": 632,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class ProductCatalogPricingVariablesBatch extends Abstrac..."
  },
  {
    "path": "src/objects/productfeed.js",
    "chars": 1553,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductFeedUpload from './productfeedupload'\nimport ProductItem fr..."
  },
  {
    "path": "src/objects/productfeedupload.js",
    "chars": 677,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductFeedUploadError from './productfeeduploaderror'\n\nexport def..."
  },
  {
    "path": "src/objects/productfeeduploaderror.js",
    "chars": 712,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductFeedUploadErrorSample from './productfeeduploaderrorsample'..."
  },
  {
    "path": "src/objects/productfeeduploaderrorsample.js",
    "chars": 274,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class ProductFeedUploadErrorSample extends AbstractCrudOb..."
  },
  {
    "path": "src/objects/productgroup.js",
    "chars": 645,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductItem from './productitem'\nimport ProductSet from './product..."
  },
  {
    "path": "src/objects/productitem.js",
    "chars": 3867,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductSet from './productset'\n\nexport default class ProductItem e..."
  },
  {
    "path": "src/objects/productset.js",
    "chars": 717,
    "preview": "import { AbstractCrudObject } from './../core'\nimport ProductGroup from './productgroup'\nimport ProductItem from './prod..."
  },
  {
    "path": "src/objects/profilepicturesource.js",
    "chars": 537,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class ProfilePictureSource extends AbstractObject {\n\n  static..."
  },
  {
    "path": "src/objects/ratecard.js",
    "chars": 291,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class RateCard extends AbstractObject {\n\n  static get Field (..."
  },
  {
    "path": "src/objects/reachestimate.js",
    "chars": 1047,
    "preview": "import { AbstractObject } from './../core'\n\nexport default class ReachEstimate extends AbstractObject {\n\n  static get Fi..."
  },
  {
    "path": "src/objects/reachfrequencyprediction.js",
    "chars": 2533,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class ReachFrequencyPrediction extends AbstractCrudObject..."
  },
  {
    "path": "src/objects/targetingsentenceline.js",
    "chars": 348,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class TargetingSentenceLine extends AbstractCrudObject {..."
  },
  {
    "path": "src/objects/transaction.js",
    "chars": 930,
    "preview": "import { AbstractCrudObject } from './../core'\n\nexport default class Transaction extends AbstractCrudObject {\n\n  static..."
  },
  {
    "path": "src/objects/user.js",
    "chars": 2904,
    "preview": "import { AbstractCrudObject } from './../core'\nimport AdAccount from './adaccount'\nimport Domain from './domain'\nimport..."
  },
  {
    "path": "test/index.html",
    "chars": 343,
    "preview": "<!doctype html>\n<html>\n  <head>\n      <meta charset=\"utf-8\">\n      <title>Facebook JS Ads SDK Mocha Spec Runner</title>..."
  },
  {
    "path": "test/integration/config.sample",
    "chars": 43,
    "preview": "{\n  \"accessToken\": \"\",\n  \"accountId\": \"\"\n}\n"
  },
  {
    "path": "test/integration/index.html",
    "chars": 361,
    "preview": "<!doctype html>\n<html>\n  <head>\n      <meta charset=\"utf-8\">\n      <title>Facebook JS Ads SDK Integration Mocha Spec Run..."
  },
  {
    "path": "test/integration/spec.js",
    "chars": 404,
    "preview": "requirejs.config({\n  paths: {\n    'mocha': './../../bower_components/mocha/mocha',\n    'chai': './../../bower_components..."
  },
  {
    "path": "test/integration/test-integration.js",
    "chars": 3960,
    "preview": "import chai from 'chai'\nimport FacebookAdsApi from './../../src/api'\nimport { accessToken, accountId } from './config.js..."
  },
  {
    "path": "test/mocha.opts",
    "chars": 11,
    "preview": "--recursive"
  },
  {
    "path": "test/spec.js",
    "chars": 518,
    "preview": "requirejs.config({\n  paths: {\n    'bluebird': './../bower_components/bluebird/js/browser/bluebird',\n    'mocha': './../b..."
  },
  {
    "path": "test/src/test-api.js",
    "chars": 586,
    "preview": "import FacebookAdsApi from './../../src/api'\nimport { should } from 'chai'\nshould()\n\ndescribe('FacebookAdsApi', () => {..."
  },
  {
    "path": "test/src/test-core.js",
    "chars": 5921,
    "preview": "import { AbstractObject, AbstractCrudObject, Cursor } from './../../src/core'\nimport chai from 'chai'\nchai.should()\n\ndes..."
  },
  {
    "path": "test/src/test-exceptions.js",
    "chars": 392,
    "preview": "import * as exc from './../../src/exceptions'\nimport { should } from 'chai'\nshould()\n\ndescribe('Exceptions', () => {\n  i..."
  },
  {
    "path": "test/standard.js",
    "chars": 182,
    "preview": "describe('Standard JS', function () {\n  this.timeout(5000)\n  var standard = require('mocha-standard')\n  it('should be re..."
  },
  {
    "path": "test/suite.es6",
    "chars": 80,
    "preview": "import './src/test-api'\nimport './src/test-core'\nimport './src/test-exceptions'\n"
  }
]

About this extraction

This page contains the full source code of the lucascosta/facebook-js-ads-sdk GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 86 files (140.3 KB), approximately 37.7k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!