fb-wrapper
Advanced tools
Comparing version 0.1.1 to 0.1.3
@@ -1,3 +0,2 @@ | ||
declare const FB: any; | ||
declare class FacebookClient { | ||
export default class FacebookClient { | ||
constructor(facebookToken: number, facebookAppID: string, facebookAppSecret: string); | ||
@@ -4,0 +3,0 @@ postOnWall(msg: string): Promise<any>; |
@@ -37,8 +37,9 @@ "use strict"; | ||
}; | ||
var FB = require('fb').FB; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fb_1 = require("fb"); | ||
var FacebookClient = /** @class */ (function () { | ||
function FacebookClient(facebookToken, facebookAppID, facebookAppSecret) { | ||
FB.options({ version: 'v3.2' }); | ||
FB.setAccessToken(facebookToken); | ||
FB.extend({ appId: facebookAppID, appSecret: facebookAppSecret }); | ||
fb_1.default.options({ version: 'v3.2' }); | ||
fb_1.default.setAccessToken(facebookToken); | ||
fb_1.default.extend({ appId: facebookAppID, appSecret: facebookAppSecret }); | ||
} | ||
@@ -51,3 +52,3 @@ //// Methods | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, FB.api('me/feed', 'post', { message: msg })]; | ||
case 0: return [4 /*yield*/, fb_1.default.api('me/feed', 'post', { message: msg })]; | ||
case 1: | ||
@@ -65,3 +66,3 @@ res = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, FB.api('me?fields=id,name')]; | ||
case 0: return [4 /*yield*/, fb_1.default.api('me?fields=id,name')]; | ||
case 1: | ||
@@ -79,3 +80,3 @@ res = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, FB.api('me/feed')]; | ||
case 0: return [4 /*yield*/, fb_1.default.api('me/feed')]; | ||
case 1: | ||
@@ -90,2 +91,2 @@ res = _a.sent(); | ||
}()); | ||
module.exports = FacebookClient; | ||
exports.default = FacebookClient; |
{ | ||
"name": "fb-wrapper", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"description": "Facebook API client for Node.js", | ||
@@ -13,6 +13,8 @@ "license": "MIT", | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"test": "jest --config jestconfig.json", | ||
"build": "tsc", | ||
"prettier-format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"lint": "tslint -p tsconfig.json" | ||
"lint": "tslint -p tsconfig.json", | ||
"prepublish-clean": "npm run clean && npm run lint && npm run build" | ||
}, | ||
@@ -32,2 +34,3 @@ "keywords": [ | ||
"prettier": "^1.16.4", | ||
"rimraf": "^2.6.3", | ||
"ts-jest": "^24.0.0", | ||
@@ -34,0 +37,0 @@ "tslint": "^5.14.0", |
@@ -17,1 +17,9 @@ # fb-wrapper | ||
``` | ||
## Usage: | ||
Only most commonly used function for interacting with Facebook API are implemented: | ||
- postOnWall(msg: string) | ||
- getInfo() | ||
- getFeed() |
6524
25
8