Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync fork #10

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0aabff6
feat: add advertiser_tracking_enabled to server-event (#249)
willgardner9 May 22, 2023
ca9f6f7
Fix NodeJS server-event function
stcheng May 22, 2023
fd97255
Auto-generated nodejs SDK code update
May 30, 2023
3b1cf65
Fix Quote Bug Missing Escape Backslash
stcheng Jun 16, 2023
92b94ac
Remove Single Quote Marks Completely to Avoid Bugs
stcheng Jun 16, 2023
1668f9f
Bump Version to 17.0.1 to Address Single Quote Issue
stcheng Jun 16, 2023
6e05857
Updated server-event.js normalize function to allow 0 for state and c…
thecodinglinguist Jul 13, 2023
e59913f
Update return value for advertiser_tracking_enabled in server-event.j…
yoongyj Jul 13, 2023
de4092c
Allow False for Parameter advertiser_tracking_enabled
stcheng Jul 13, 2023
d539b83
Add DSA Support on AdAccount
stcheng Aug 8, 2023
a2d64d9
Remove dependency request from package.json
stcheng Aug 14, 2023
3be19d2
Exclude Malformed File in Flow Config
stcheng Aug 14, 2023
09fbdd5
Fix preview Keyword
stcheng Aug 19, 2023
dfcff26
Bump eslint from 4.19.1 to 7.32.0 (#202)
dependabot[bot] Aug 21, 2023
59b142a
Remove gulp-flowtype Dependency
stcheng Sep 5, 2023
5e7041c
Update LICENSE and Header
stcheng Sep 13, 2023
7078615
Show headers when setShowHeader is enabled (#220)
mateioprea Sep 14, 2023
0c6cf64
Typo from thumbnailss to thumbnails (#175)
actuallymentor Sep 14, 2023
f9bd877
URGENT - Missing underscore private "EventID" (#216)
DanieleRusso97 Sep 14, 2023
4ec3e51
Auto-generated nodejs SDK code update
Sep 14, 2023
73e0c9e
Auto-generated nodejs SDK code update
Sep 26, 2023
9a1e477
Address Error Parsing Issue for Axios
stcheng Oct 13, 2023
082e89c
Auto-generated nodejs SDK code update
stcheng Oct 15, 2023
4ab4661
Auto-generated nodejs SDK code update
Nov 2, 2023
c6baaf0
Fix comments for fbc and fbp (#264)
rlloyd2001 Nov 7, 2023
d4b0064
Fix Typo
stcheng Nov 8, 2023
3edb78d
Auto-generated nodejs SDK code update
Dec 2, 2023
fe36328
add app secret proof support
regevbr Sep 1, 2020
e2fde50
upgrade ci to node 18 (#8)
montedonioluiz May 13, 2023
8cdb87b
fix tests (#9)
regevbr May 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
.*examples/.*
.*src/objects/serverside
.*src/objects/signal
<PROJECT_ROOT>/node_modules/resolve/test/resolver/malformed_package_json/package.json

[include]

[libs]

[lints]

[options]
exact_by_default=false

[strict]
4 changes: 2 additions & 2 deletions .github/workflows/ci-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 18
- name: Deploy
run: |
npm install
yarn install
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
npm publish
env:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ jobs:

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run flow
- run: yarn install
- run: yarn flow
env:
CI: true
- run: yarn build
env:
CI: true
- run: yarn test
env:
CI: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
# Runtime data
pids
*.pid
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.

## Unreleased

## v17.0.0


### Added
- `advanced_measurement_table` field to Event for Conversions API.

Expand Down Expand Up @@ -104,3 +107,4 @@ All notable changes to this project will be documented in this file.
## v3.3.0
### Changed
- Graph API call upgrade to [v3.3](https://developers.facebook.com/docs/graph-api/changelog/version3.3)

3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
Copyright (c) Meta Platforms, Inc. and affiliates.
All rights reserved.

You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
copy, modify, and distribute this software in source code or binary form for use
Expand Down
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ For now, we can use the <a href="https://developers.facebook.com/tools/explorer"
```javaScript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
```

### Api main class

The `FacebookAdsApi` object is the foundation of the Business SDK which encapsulates the logic to execute requests against the Graph API.
Once instantiated, the Api object will allows you to start making requests to the Graph API.
Once instantiated, the Api object will allow you to start making requests to the Graph API.

### Facebook Objects

Expand All @@ -114,7 +115,8 @@ You can access object properties like this:
```javaScript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const AdAccount = adsSdk.AdAccount;
const Campaign = adsSdk.Campaign;
const account = new AdAccount('act_<AD_ACCOUNT_ID>');
Expand All @@ -140,7 +142,8 @@ account
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const AdAccount = adsSdk.AdAccount;
const account = new AdAccount('act_<AD_ACCOUNT_ID>');
account
Expand All @@ -159,7 +162,8 @@ Requesting an high number of fields may cause the response time to visibly incre
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const AdAccount = adsSdk.AdAccount;
const Campaign = adsSdk.Campaign;
const account = new AdAccount('act_<AD_ACCOUNT_ID>');
Expand All @@ -183,7 +187,8 @@ account
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const Campaign = adsSdk.Campaign;
const campaignId = <CAMPAIGN_ID>;
new Campaign(campaignId, {
Expand All @@ -197,7 +202,8 @@ new Campaign(campaignId, {
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const Campaign = adsSdk.Campaign;
const campaignId = <CAMPAIGN_ID>;
new Campaign(campaignId).delete();
Expand All @@ -213,7 +219,8 @@ Here the `Cursor` is a superpowered `Array` (with all it's native helpful operat
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const AdAccount = adsSdk.AdAccount;
const Campaign = adsSdk.Campaign;
const account = new AdAccount('act_<AD_ACCOUNT_ID>');
Expand Down Expand Up @@ -246,7 +253,8 @@ If you are using cursor to iterate all of your object under your Ad Account, thi
```javascript
const adsSdk = require('facebook-nodejs-ads-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
const AdAccount = adsSdk.AdAccount;
const account = new AdAccount('act_<AD_ACCOUNT_ID>');

Expand All @@ -268,7 +276,8 @@ A `FacebookAdsApi` object offers a debugging mode that will log all requests. To
```javascript
const adsSdk = require('facebook-nodejs-business-sdk');
const accessToken = '<VALID_ACCESS_TOKEN>';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const appsecret_proof = '<VALID_APPSECRET_PROOF>'; //optional
const api = adsSdk.FacebookAdsApi.init(accessToken, appsecret_proof);
api.setDebug(true);
```

Expand Down
2 changes: 1 addition & 1 deletion __tests__/batch-processor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

'use strict';
const {BatchProcessor, Content, CustomData, DeliveryCategory} = require('facebook-nodejs-business-sdk');
const {BatchProcessor, Content, CustomData, DeliveryCategory} = require('../');



Expand Down
2 changes: 1 addition & 1 deletion __tests__/content.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

'use strict';
const {Content, DeliveryCategory} = require('facebook-nodejs-business-sdk');
const {Content, DeliveryCategory} = require('../');


describe('Content', function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/custom-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

'use strict';
const {Content, CustomData, DeliveryCategory} = require('facebook-nodejs-business-sdk');
const {Content, CustomData, DeliveryCategory} = require('../');


describe('CustomData', function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/event-request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {
HttpServiceClientConfig,
ServerEvent,
UserData,
} = require('facebook-nodejs-business-sdk');
} = require('../');


describe('EventRequest', function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/signal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

'use strict';
const { SignalUserData, SignalContent, SignalCustomData, SignalEvent, DeliveryCategory } = require('facebook-nodejs-business-sdk');
const { SignalUserData, SignalContent, SignalCustomData, SignalEvent, DeliveryCategory } = require('../');
const sha256 = require('js-sha256');


Expand Down
2 changes: 1 addition & 1 deletion __tests__/user-data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

'use strict';
const {UserData} = require('facebook-nodejs-business-sdk');
const {UserData} = require('../');
const sha256 = require('js-sha256');


Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

'use strict';

const { ServerSideUtils } = require('facebook-nodejs-business-sdk');
const { ServerSideUtils } = require('../');
const sha256 = require('js-sha256');


Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading