Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion types/chrome/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"@definitelytyped/no-unnecessary-generics": "off",
"@definitelytyped/strict-export-declare-modifiers": "off",
"@typescript-eslint/no-wrapper-object-types": "off",
"@typescript-eslint/prefer-namespace": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
} from 'facebook-nodejs-business-sdk';
import { FacebookRequestError } from 'facebook-nodejs-business-sdk/src/exceptions';
import TEventRequest from "facebook-nodejs-business-sdk/src/objects/serverside/event-request";
import BusinessDataApiUserData from "facebook-nodejs-business-sdk/src/objects/serverside/user-data";
import AttributionData from "facebook-nodejs-business-sdk/src/objects/serverside/attribution-data";

async function testGetAdsFetchFirstPageFalse(): Promise<Array<Record<string, string>>> {
const ads = [];
Expand Down Expand Up @@ -152,3 +154,11 @@ export function testDeleteFunctionInAbstractCrudObjects(){
const deleteAdCreativeFunction = new AdCreative().delete;
const deleteAdFunction = new Ad().delete;
}

export function testBusinessDataApiUserDataConstructor() {
const businessDataApiUserData = new BusinessDataApiUserData();
}

export function testAttributionDataConstructor() {
const attributionData = new AttributionData();
}
79 changes: 42 additions & 37 deletions types/facebook-nodejs-business-sdk/index.d.ts

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion types/facebook-nodejs-business-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/facebook-nodejs-business-sdk",
"version": "20.0.9999",
"version": "22.0.9999",
"projects": [
"https://github.com/facebook/facebook-nodejs-business-sdk"
],
Expand All @@ -12,6 +12,9 @@
{
"name": "Aisel Sherfedinova",
"githubUsername": "aisel01"
}, {
"name": "Rodin Hatokay",
"githubUsername": "rodinhatokay"
}
],
"minimumTypeScriptVersion": "5.1"
Expand Down
5 changes: 5 additions & 0 deletions types/facebook-nodejs-business-sdk/scripts/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"es6": true
}
}
27 changes: 27 additions & 0 deletions types/facebook-nodejs-business-sdk/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# README for TypeScript Type Generation

This folder contains scripts for generating TypeScript types for the `facebook-nodejs-business-sdk` package. The process automates most of the work but requires some manual fixes to ensure the types meet the required standards.

## How to Generate the Types

**Run the Generation Script**
Use the following command to generate the types:
```bash
pnpm run gen-types
```
This command should be run from the root of the repository.

This will execute the script that:
- Cleans up old generated files
- Copies the SDK source files
- Converts `.es6` files to `.js`
- Transforms Flow types to TypeScript
- Fixes common syntax issues
- Generates `.d.ts` files
- Extracts `bundle.d.ts` to `index.d.ts`
- Copies the `src` folder to the root directory

## Notes

- The generation process is designed to handle most of the work, but manual intervention is necessary for edge cases.
- Keep track of the manual fixes you make, as they may need to be reapplied if the types are regenerated.
Loading